[hidden] { display: none !important; }
:root {
  --bg: #0e1311; --bg2: #121916; --surface: #161e1b; --surface2: #1c2622; --line: #26332e; --line2: #33443d;
  --text: #e8efea; --muted: #9eaca5; --faint: #8b9891;
  --accent: #3fd68f; --accent-ink: #062115; --accent-soft: rgba(63, 214, 143, .12);
  --amber: #f5c451; --red: #ff7a6b; --red-soft: rgba(255, 122, 107, .12);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 14px; --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 12px 40px rgba(0,0,0,.35);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f6f7f4; --bg2: #eef1ec; --surface: #ffffff; --surface2: #f3f6f2; --line: #dde3dc; --line2: #c9d2c8;
  --text: #15201b; --muted: #4c5953; --faint: #5d6a63;
  --accent: #0b7a4b; --accent-ink: #ffffff; --accent-soft: rgba(11, 122, 75, .09);
  --amber: #8a5600; --red: #c2392b; --red-soft: rgba(194, 57, 43, .08);
  --shadow: 0 1px 2px rgba(20,32,27,.06), 0 10px 30px rgba(20,32,27,.07);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--sans); }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img, svg { max-width: 100%; height: auto; }
code, kbd, pre { font-family: var(--mono); font-size: .9em; }
code { background: var(--surface2); border: 1px solid var(--line); padding: .08em .35em; border-radius: 6px; }
kbd { background: var(--surface2); border: 1px solid var(--line2); border-bottom-width: 2px; padding: .05em .4em; border-radius: 5px; font-size: .85em; }
pre { background: var(--surface2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; overflow-x: auto; line-height: 1.5; }
pre code { background: none; border: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }

/* header */
.top { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent); position: sticky; top: 0; z-index: 5; backdrop-filter: saturate(1.4) blur(10px); }
.top .wrap { display: flex; align-items: center; gap: 18px; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 750; letter-spacing: -.02em; font-size: 1.08rem; }
.logo b { color: var(--accent); font-weight: 750; }
.logo svg { width: 28px; height: 28px; flex: none; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--muted); text-decoration: none; padding: 7px 11px; border-radius: 8px; font-size: .95rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--surface2); }
.theme { background: none; border: 1px solid var(--line); color: var(--muted); width: 38px; height: 38px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; margin-left: 4px; }
.theme:hover { color: var(--text); border-color: var(--line2); }
.theme svg { width: 18px; height: 18px; }
.theme .sun { display: none; } :root[data-theme="light"] .theme .sun { display: block; } :root[data-theme="light"] .theme .moon { display: none; }

/* hero + converter */
.hero { padding: 46px 0 8px; text-align: center; }
.hero h1 { font-size: clamp(2rem, 5.2vw, 3.3rem); line-height: 1.08; letter-spacing: -.035em; margin: 0 0 14px; }
.hero h1 span { color: var(--accent); }
.hero p.lede { color: var(--muted); font-size: clamp(1.02rem, 2.2vw, 1.18rem); max-width: 640px; margin: 0 auto; }
.badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin: 18px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: .92rem; }
.badges li { display: flex; align-items: center; gap: 7px; }
.badges svg { width: 16px; height: 16px; color: var(--accent); flex: none; }

.converter { scroll-margin-top: 72px; margin: 28px auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 18px; max-width: 1080px; position: relative; }
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; min-height: 250px; border: 2px dashed var(--line2); border-radius: 14px; background: var(--bg2); cursor: pointer; padding: 30px 18px; transition: border-color .15s, background .15s; }
.drop:hover, .converter.dragging .drop { border-color: var(--accent); background: var(--accent-soft); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.drop .ico { width: 56px; height: 56px; color: var(--accent); }
.drop strong { font-size: 1.2rem; letter-spacing: -.01em; }
.drop .or { color: var(--muted); font-size: .95rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 650; border-radius: 11px; padding: 11px 18px; border: 1px solid transparent; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost { background: var(--surface2); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--line2); }
.btn-link { background: none; border: 0; color: var(--muted); padding: 6px 8px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.btn:disabled { opacity: .55; cursor: progress; }
.drop .fake { pointer-events: none; }
.drop-foot { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 14px; color: var(--faint); font-size: .86rem; margin-top: 10px; }
.converter.has-file .drop-area { display: none; }
.converter.dragging::after { content: "Drop to convert"; position: absolute; inset: 0; border-radius: 20px; background: color-mix(in srgb, var(--bg) 70%, transparent); border: 2px dashed var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 1.3rem; color: var(--accent); }

.work-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.files { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; min-width: 0; }
.chip { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--bg2); max-width: 100%; }
.chip.on { border-color: var(--accent); background: var(--accent-soft); }
.chip-name { background: none; border: 0; color: var(--text); font: inherit; font-weight: 600; font-size: .93rem; padding: 7px 4px 7px 12px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 300px; }
.chip-x { background: none; border: 0; color: var(--muted); font-size: 1.2rem; line-height: 1; padding: 6px 10px; cursor: pointer; border-radius: 0 10px 10px 0; }
.chip-x:hover { color: var(--red); }
.tabs { display: flex; gap: 4px; overflow-x: auto; margin: 14px 0 0; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.tab { background: none; border: 1px solid transparent; border-bottom: 0; color: var(--muted); font: inherit; font-size: .93rem; padding: 8px 14px; border-radius: 9px 9px 0 0; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); background: var(--bg2); border-color: var(--line); font-weight: 650; box-shadow: inset 0 2px 0 var(--accent); margin-bottom: -1px; }

.work-grid { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 18px; margin-top: 14px; }
.panel { min-width: 0; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; }
.meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 14px; font-size: .88rem; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table-wrap { overflow: auto; max-height: 460px; }
table.grid { border-collapse: separate; border-spacing: 0; font: 13px/1.35 var(--mono); min-width: 100%; }
table.grid th, table.grid td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 5px 9px; text-align: left; white-space: pre; max-width: 280px; overflow: hidden; text-overflow: ellipsis; vertical-align: top; }
table.grid thead th { position: sticky; top: 0; background: var(--surface2); color: var(--faint); font-weight: 600; text-align: center; z-index: 1; }
table.grid th.rn { position: sticky; left: 0; background: var(--surface2); color: var(--faint); text-align: right; font-weight: 500; z-index: 1; }
table.grid thead th.rn { z-index: 2; }
table.grid td.sp { background: rgba(245, 196, 81, .08); }
.preview-note { font-size: .84rem; color: var(--faint); padding: 8px 12px; min-height: 1em; }
.preview-note:empty { display: none; }

.opts { min-width: 0; padding: 14px; display: grid; gap: 12px; align-content: start; }
.opts h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin: 0; }
.field label, .field .lbl { display: block; font-size: .86rem; font-weight: 600; margin-bottom: 4px; }
.field select { width: 100%; font: inherit; font-size: .93rem; color: var(--text); background: var(--surface); border: 1px solid var(--line2); border-radius: 9px; padding: 8px 10px; }
.check { display: flex; gap: 9px; align-items: flex-start; font-size: .9rem; cursor: pointer; }
.check input { margin: 4px 0 0; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.check small { display: block; color: var(--faint); font-size: .8rem; line-height: 1.35; }
.actions { display: grid; gap: 8px; margin-top: 4px; }
.actions .btn { width: 100%; }
.row2 { display: flex; gap: 8px; } .row2 .btn { flex: 1; }
.status { font-size: .88rem; color: var(--accent); margin: 0; }
.status:empty { display: none; }
.err { background: var(--red-soft); color: var(--red); border: 1px solid color-mix(in srgb, var(--red) 40%, transparent); border-radius: 10px; padding: 10px 12px; margin: 12px 0 0; font-size: .93rem; }
.privacy-line { display: flex; align-items: center; gap: 8px; color: var(--faint); font-size: .84rem; justify-content: center; margin: 14px 0 0; text-align: center; }
.privacy-line svg { width: 15px; height: 15px; color: var(--accent); flex: none; }
.converter.busy { cursor: progress; }

/* content */
section.block { padding: 56px 0 8px; }
.kicker { color: var(--accent); font-weight: 700; font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 6px; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.05rem); letter-spacing: -.025em; line-height: 1.2; margin: 0 0 14px; }
h3 { font-size: 1.15rem; letter-spacing: -.01em; margin: 26px 0 8px; }
.steps { list-style: none; padding: 0; margin: 22px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: s; }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; counter-increment: s; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-weight: 800; margin-bottom: 10px; }
.steps h3 { margin: 0 0 6px; font-size: 1.05rem; }
.steps p { margin: 0; color: var(--muted); font-size: .95rem; }
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-top: 22px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.feature h3 { margin: 0 0 6px; font-size: 1.02rem; display: flex; gap: 9px; align-items: center; }
.feature h3 svg { width: 20px; height: 20px; color: var(--accent); flex: none; }
.feature p { margin: 0; color: var(--muted); font-size: .94rem; }
.compare { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: .95rem; }
.compare th, .compare td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare thead th { color: var(--faint); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.compare td:first-child { font-weight: 600; }
.tbl-scroll { overflow-x: auto; }
.yes { color: var(--accent); font-weight: 700; } .no { color: var(--red); font-weight: 700; } .meh { color: var(--amber); font-weight: 700; }
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; font-weight: 650; padding: 12px 28px 12px 0; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 8px; font-size: 1.4rem; color: var(--accent); font-weight: 400; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 14px; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: 20px; }
.card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); font-size: .93rem; }
.card .more { display: inline-block; margin-top: 10px; color: var(--accent); font-weight: 650; font-size: .9rem; }
.callout { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: var(--radius); padding: 16px 18px; margin: 22px 0; }
.callout p { margin: 0; }
.callout.warn { background: rgba(245, 196, 81, .1); border-color: rgba(245, 196, 81, .35); }
.cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin: 30px 0; }
.cta p { margin: 0; font-weight: 600; }

/* article pages */
.article { padding: 34px 0 20px; }
.crumbs { font-size: .88rem; color: var(--faint); margin: 0 0 14px; }
.crumbs a { color: var(--muted); }
.article h1 { font-size: clamp(1.85rem, 4.4vw, 2.6rem); line-height: 1.12; letter-spacing: -.03em; margin: 0 0 12px; }
.article .lede { font-size: 1.12rem; color: var(--muted); margin: 0 0 8px; }
.byline { color: var(--faint); font-size: .88rem; margin: 0 0 24px; }
.article h2 { margin-top: 42px; font-size: 1.6rem; }
.article li { margin: 6px 0; }
.article ol.how > li { margin: 10px 0; }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin: 18px 0 8px; font-size: .95rem; }
.toc strong { display: block; margin-bottom: 4px; font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.toc ol { margin: 0; padding-left: 20px; }
figure { margin: 24px 0; }
figure .fig { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
figcaption { color: var(--faint); font-size: .86rem; margin-top: 8px; }
.related { border-top: 1px solid var(--line); margin-top: 44px; padding-top: 26px; }

/* footer */
.foot { border-top: 1px solid var(--line); margin-top: 70px; padding: 34px 0 40px; color: var(--muted); font-size: .92rem; background: var(--bg2); }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 26px; }
.foot h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .09em; color: var(--faint); margin: 0 0 10px; }
.foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--text); text-decoration: underline; }
.foot .small { font-size: .84rem; color: var(--faint); margin-top: 26px; }

@media (max-width: 900px) {
  .work-grid { grid-template-columns: minmax(0, 1fr); }
  .opts { min-width: 0; }
  .opts { order: -1; grid-template-columns: 1fr 1fr; }
  .opts h2, .opts .checks, .opts .actions, .opts .status { grid-column: 1 / -1; }
  .steps { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .top .wrap { gap: 8px; }
  .nav a { padding: 7px 7px; font-size: .9rem; }
  .nav a.hide-sm { display: none; }
  .converter { padding: 12px; border-radius: 16px; }
  .drop { min-height: 210px; }
  .opts { grid-template-columns: minmax(0, 1fr); }
  .compare { min-width: 540px; }
  .fig { overflow-x: auto; }
  .fig svg { min-width: 560px; }
  .table-wrap { max-height: 360px; }
  .chip-name { max-width: 210px; }
  .compare { font-size: .88rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .top, .foot, .converter, .theme { display: none; } body { background: #fff; color: #000; } }

/* figure palette (inline SVG) */
.fig svg { display: block; width: 100%; height: auto; }
.f-surf { fill: var(--surface); } .f-bg { fill: var(--bg2); } .f-acc-soft { fill: var(--accent-soft); } .f-red { fill: var(--red); } .f-muted { fill: var(--faint); }
.s-line { stroke: var(--line2); stroke-width: 1.5; } .s-acc { stroke: var(--accent); stroke-width: 2; } .s-muted { stroke: var(--faint); } .s-red { stroke: var(--red); }
.t-text { fill: var(--text); } .t-muted { fill: var(--muted); } .t-acc { fill: var(--accent); } .t-red { fill: var(--red); }

/* v2 additions */
.err { white-space: pre-line; }
.checks { display: grid; gap: 10px; }
.file-info { margin: 10px 0 0; font-size: .88rem; color: var(--muted); background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.file-info:empty { display: none; }
.pw { display: flex; gap: 14px; align-items: flex-start; padding: 16px; margin: 0 0 12px; border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.pw-ico { width: 34px; height: 34px; color: var(--accent); flex: none; }
.pw-ico svg { width: 100%; height: 100%; }
.pw-body { flex: 1; min-width: 0; }
.pw label { display: block; font-weight: 600; margin-bottom: 10px; }
.pw-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pw-row input { flex: 1; min-width: 180px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line2); border-radius: 10px; padding: 10px 12px; }
.pw-err { color: var(--red); font-size: .9rem; margin: 8px 0 0; }
.foot-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
@media (max-width: 1000px) { .nav a.hide-md { display: none; } }
@media (max-width: 900px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .nav a { padding: 7px 6px; font-size: .86rem; } .logo span { display: none; } .pw { flex-direction: column; } }

.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.card h2 { margin: 0 0 6px; font-size: 1.05rem; letter-spacing: -.01em; }
table.grid thead td.corner { position: sticky; top: 0; left: 0; background: var(--surface2); z-index: 2; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
