:root {
  color-scheme: light;
  --background: #f8fafc;
  --surface: #ffffff;
  --surface-subtle: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #1e293b;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --success: #15803d;
  --success-soft: #f0fdf4;
  --danger: #dc2626;
  --radius: 6px;
  --shadow: 0 1px 3px rgb(15 23 42 / 8%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--background); }
body { min-height: 100vh; margin: 0; color: var(--text); background: var(--background); line-height: 1.6; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }

.site-header { min-height: 70px; padding: 0 max(1rem, calc((100% - 1040px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: .7rem; color: var(--text); text-decoration: none; font-size: 1.05rem; font-weight: 700; letter-spacing: -.02em; }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--radius); color: #fff; background: var(--primary); font-size: .9rem; }
.site-header nav { display: flex; align-items: center; gap: 1rem; }
.privacy-pill { display: inline-flex; align-items: center; gap: .4rem; padding: .28rem .65rem; border: 1px solid #bbf7d0; border-radius: 999px; color: var(--success); background: var(--success-soft); font-size: .78rem; font-weight: 600; }
.privacy-pill span { font-size: .48rem; }
.github-link { color: var(--muted); text-decoration: none; font-size: .85rem; font-weight: 600; }
.github-link:hover { color: var(--primary); }

main { width: min(1040px, calc(100% - 32px)); margin: 0 auto; }
.hero { max-width: 720px; padding: 4.5rem 0 2.5rem; }
.eyebrow { margin: 0 0 .65rem; color: var(--primary); text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; font-weight: 700; }
h1 { margin: 0 0 .75rem; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.15; letter-spacing: -.035em; }
.intro { max-width: 640px; margin: 0; color: var(--muted); font-size: 1.02rem; }

.workspace, .results { padding: clamp(1.25rem, 4vw, 2rem); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.step-heading { display: flex; align-items: flex-start; gap: .85rem; margin-bottom: 1rem; }
.step-heading > span { width: 25px; height: 25px; flex: 0 0 25px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--primary); font-size: .72rem; font-weight: 700; }
.step-heading h2 { margin: 0 0 .15rem; font-size: 1.05rem; line-height: 1.4; font-weight: 650; }
.step-heading p { margin: 0; color: var(--muted); font-size: .85rem; }
code { padding: .08rem .28rem; border-radius: 3px; color: #475569; background: var(--surface-subtle); font-size: .8em; }

.drop-zone { width: 100%; min-height: 165px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem; border: 2px dashed var(--border-strong); border-radius: var(--radius); background: var(--background); cursor: pointer; transition: border-color .15s, background .15s; }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--primary); background: var(--primary-soft); }
.drop-zone strong { font-size: .95rem; }
.drop-zone > span:last-child { color: var(--muted); font-size: .82rem; }
.drop-icon { width: 34px; height: 34px; margin-bottom: .35rem; display: grid; place-items: center; border-radius: 50%; color: var(--primary); background: var(--primary-soft); font-size: 1.1rem; }

.file-summary { align-items: center; justify-content: space-between; padding: .75rem 1rem; border: 1px solid #bbf7d0; border-radius: var(--radius); background: var(--success-soft); }
.file-summary > div { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.file-summary > div > div { display: flex; flex-direction: column; min-width: 0; }
.file-summary strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.file-summary span { color: var(--muted); font-size: .76rem; }
.file-summary .file-badge { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border-radius: var(--radius); color: #fff; background: var(--success); font-size: .7rem; font-weight: 700; }
.file-summary button { border: 0; color: var(--danger); background: transparent; cursor: pointer; font-size: .8rem; font-weight: 600; }

fieldset { margin: 2rem 0 0; padding: 0; border: 0; }
fieldset:disabled { opacity: .5; }
legend { width: 100%; padding: 0; }
.format-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; }
.format-option { position: relative; }
.format-option input { position: absolute; opacity: 0; }
.format-option label { min-height: 105px; padding: .9rem; display: flex; flex-direction: column; gap: .2rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.format-option label:hover { border-color: var(--border-strong); background: var(--background); }
.format-option input:checked + label { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.format-option input:focus-visible + label { outline: 3px solid #93c5fd; outline-offset: 2px; }
.format-option strong { font-size: .87rem; font-weight: 600; }
.format-option small { color: var(--muted); line-height: 1.35; }
.format-option .extension { margin-top: auto; color: var(--primary); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .68rem; font-weight: 600; }

.convert-button { width: auto; min-width: 220px; margin-top: 1.25rem; padding: .65rem 1.15rem; border: 0; border-radius: var(--radius); color: #fff; background: var(--primary); cursor: pointer; font-size: .88rem; font-weight: 600; }
.convert-button:hover:not(:disabled) { background: var(--primary-hover); }
.convert-button:disabled { cursor: not-allowed; opacity: .45; }
.status { display: inline; min-height: 1.2em; margin: 0 0 0 .75rem; color: var(--muted); font-size: .8rem; }
.status.error { color: var(--danger); }

.results { margin-top: 1rem; }
.result-list { display: grid; gap: .5rem; }
.result-item { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--background); }
.result-item > div { min-width: 0; }
.result-item strong, .result-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-item strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; font-weight: 600; }
.result-item small { margin-top: .1rem; color: var(--muted); font-size: .72rem; }
.result-item a { flex: 0 0 auto; padding: .4rem .75rem; border-radius: var(--radius); color: #fff; background: var(--primary); text-decoration: none; font-size: .76rem; font-weight: 600; }
.result-item a:hover { background: var(--primary-hover); }

.privacy-note { max-width: 760px; margin: 2rem auto 4rem; padding: 1rem; display: flex; align-items: flex-start; gap: .75rem; border: 1px solid #bfdbfe; border-radius: var(--radius); color: #1e40af; background: var(--primary-soft); }
.privacy-note > span { width: 24px; height: 24px; flex: 0 0 24px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--primary); font-size: .72rem; }
.privacy-note h2 { margin: 0 0 .15rem; font-size: .88rem; font-weight: 650; }
.privacy-note p { margin: 0; color: #3b5c92; font-size: .8rem; line-height: 1.5; }
footer { min-height: 64px; padding: 0 max(1rem, calc((100% - 1040px) / 2)); display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); color: var(--muted); background: var(--surface); font-size: .75rem; }

@media (max-width: 720px) {
  .site-header { min-height: 62px; }
  .privacy-pill { display: none; }
  main { width: min(100% - 20px, 1040px); }
  .hero { padding: 2.75rem 0 1.75rem; }
  .workspace, .results { padding: 1rem; }
  .format-grid { grid-template-columns: 1fr; }
  .format-option label { min-height: 90px; }
  .convert-button { width: 100%; }
  .status { display: block; margin: .6rem 0 0; text-align: center; }
  footer { flex-direction: column; justify-content: center; gap: .15rem; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
