:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #66717e;
  --line: #d9dee5;
  --surface: #ffffff;
  --canvas: #f4f6f8;
  --blue: #1769aa;
  --blue-dark: #105487;
  --green: #1f7a50;
  --red: #b42318;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
}

button, input { font: inherit; }

.topbar {
  height: 64px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; background: var(--blue); color: white; border-radius: 6px; }
.system-state { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.state-dot { width: 8px; height: 8px; border-radius: 50%; background: #2e9b65; }

.workspace { width: min(720px, calc(100% - 32px)); margin: 64px auto 40px; }
.service-summary { margin: 0 0 22px; display: flex; justify-content: flex-end; color: var(--muted); }
.service-summary > div { min-width: 180px; padding: 2px 18px; display: flex; flex-direction: column; gap: 4px; border-left: 1px solid var(--line); }
.service-summary > div:first-child { border-left: 0; }
.service-summary small { font-size: 12px; line-height: 1.2; }
.service-summary strong { color: var(--ink); font-size: 16px; line-height: 1.25; }
.intro { margin-bottom: 24px; }
.eyebrow { margin: 0 0 10px; color: var(--blue); font-size: 13px; font-weight: 700; text-transform: uppercase; }
h1 { margin: 0 0 10px; font-size: clamp(30px, 5vw, 42px); line-height: 1.12; letter-spacing: 0; }
.intro > p:last-child { max-width: 650px; margin: 0; color: var(--muted); font-size: 17px; line-height: 1.55; }

.converter { padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 26px rgba(24, 35, 47, 0.06); }
.dropzone { width: 100%; min-height: 250px; padding: 32px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 2px dashed #b6c0cb; border-radius: 8px; background: #fafbfc; color: var(--ink); cursor: pointer; transition: border-color .16s ease, background .16s ease; }
.dropzone:hover, .dropzone.is-dragging { border-color: var(--blue); background: #f3f8fc; }
.dropzone:focus-visible, button:focus-visible { outline: 3px solid rgba(23, 105, 170, .25); outline-offset: 2px; }
.upload-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 6px; border-radius: 50%; background: #e6f0f8; color: var(--blue); font-size: 26px; line-height: 1; }
.drop-title { font-weight: 700; font-size: 18px; }
.drop-subtitle { color: var(--muted); }
.file-types { margin-top: 12px; color: #89929d; font-size: 13px; }

.file-list { display: grid; gap: 10px; }
.file-preview { min-height: 92px; padding: 12px; display: grid; grid-template-columns: 68px 1fr 36px; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 8px; }
.file-preview img { width: 68px; height: 68px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
.file-meta { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.file-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta span { color: var(--muted); font-size: 14px; }
.icon-button { width: 36px; height: 36px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 26px; cursor: pointer; }
.icon-button:hover { color: var(--red); }
.add-file-button { width: 100%; min-height: 44px; margin-top: 10px; border: 1px dashed #aeb8c3; border-radius: 6px; background: #fafbfc; color: var(--blue); font-size: 24px; font-weight: 700; cursor: pointer; }
.add-file-button:hover { border-color: var(--blue); background: #f3f8fc; }
.add-file-button span { font-size: 24px; line-height: 1; }

.primary-button, .secondary-button { min-height: 48px; border-radius: 6px; font-weight: 700; cursor: pointer; }
.primary-button { width: 100%; margin-top: 18px; border: 1px solid var(--blue); background: var(--blue); color: white; }
.primary-button:hover:not(:disabled) { background: var(--blue-dark); border-color: var(--blue-dark); }
.primary-button:disabled { border-color: #bcc4cd; background: #c8ced5; cursor: not-allowed; }
.primary-button.is-loading .button-label { opacity: .8; }
.spinner { display: none; width: 18px; height: 18px; margin-left: 10px; vertical-align: -4px; border: 2px solid rgba(255,255,255,.4); border-top-color: white; border-radius: 50%; animation: spin .8s linear infinite; }
.primary-button.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.status { margin-top: 18px; padding: 13px 15px; border-radius: 6px; background: #eef5fa; color: #234d6e; line-height: 1.45; }
.status.is-error { background: #fdf0ef; color: var(--red); }
.result { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.result-heading { display: flex; align-items: center; gap: 12px; }
.result-heading > div { display: flex; flex-direction: column; gap: 3px; }
.result-heading span:last-child { color: var(--muted); font-size: 14px; }
.success-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #e7f5ed; color: var(--green); font-weight: 800; }
.result-grid { margin: 20px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.result-grid div { padding: 13px; background: #fafbfc; }
.result-grid dt { margin-bottom: 5px; color: var(--muted); font-size: 12px; }
.result-grid dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.secondary-button { padding: 0 18px; border: 1px solid #aeb8c3; background: white; color: var(--ink); }
.secondary-button:hover { border-color: var(--blue); color: var(--blue); }
.privacy-note { margin: 18px 0 0; text-align: center; color: var(--muted); font-size: 13px; }

@media (max-width: 600px) {
  .workspace { margin-top: 32px; }
  .service-summary { justify-content: stretch; }
  .service-summary > div { min-width: 0; flex: 1; padding: 2px 12px; }
  .service-summary > div:first-child { padding-left: 0; }
  .converter { padding: 18px; }
  .dropzone { min-height: 220px; padding: 24px 16px; }
  .result-grid { grid-template-columns: 1fr; }
}
