:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f1f4f8;
  --text: #14202e;
  --muted: #536173;
  --border: #d9e0e8;
  --accent: #0b6e4f;
  --accent-strong: #08573f;
  --accent-contrast: #ffffff;
  --accent-soft: #e3f3ec;
  --warn-bg: #fff6e0;
  --warn-border: #e7b84a;
  --error-bg: #fdecec;
  --error-border: #d64545;
  --ok-bg: #e5f5ec;
  --ok-border: #2f9e63;
  --info-bg: #eaf1fb;
  --info-border: #5b8bd6;
  --neg: #b42318;
  --pos: #0b6e4f;
  --focus: #2563eb;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --radius: 10px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0f141a;
    --surface: #161d25;
    --surface-2: #1d2630;
    --text: #e6edf3;
    --muted: #9fb0c2;
    --border: #2c3946;
    --accent: #3ccf91;
    --accent-strong: #5ee0a6;
    --accent-contrast: #062a1c;
    --accent-soft: #143528;
    --warn-bg: #33280f;
    --warn-border: #b8862b;
    --error-bg: #3a1717;
    --error-border: #e06060;
    --ok-bg: #12301f;
    --ok-border: #3ccf91;
    --info-bg: #15253b;
    --info-border: #5b8bd6;
    --neg: #ff8a80;
    --pos: #5ee0a6;
    --focus: #7aa7ff;
    --shadow: none;
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --bg: #0f141a;
  --surface: #161d25;
  --surface-2: #1d2630;
  --text: #e6edf3;
  --muted: #9fb0c2;
  --border: #2c3946;
  --accent: #3ccf91;
  --accent-strong: #5ee0a6;
  --accent-contrast: #062a1c;
  --accent-soft: #143528;
  --warn-bg: #33280f;
  --warn-border: #b8862b;
  --error-bg: #3a1717;
  --error-border: #e06060;
  --ok-bg: #12301f;
  --ok-border: #3ccf91;
  --info-bg: #15253b;
  --info-border: #5b8bd6;
  --neg: #ff8a80;
  --pos: #5ee0a6;
  --focus: #7aa7ff;
  --shadow: none;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); letter-spacing: -0.02em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
code { font-family: var(--mono); font-size: 0.92em; background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 4px; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip-link:focus { left: 8px; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 780px; }

/* header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.site-header .container { display: flex; align-items: center; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); text-decoration: none; }
.brand svg { color: var(--accent); }
.nav { display: flex; gap: 4px 16px; flex-wrap: wrap; margin-left: auto; align-items: center; font-size: 0.95rem; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 2px; }
.nav a:hover, .nav a[aria-current='page'] { color: var(--text); }
.theme-toggle { background: none; border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 4px 10px; cursor: pointer; font: inherit; font-size: 0.9rem; }
.pro-pill { display: none; background: var(--accent); color: var(--accent-contrast); border-radius: 999px; padding: 2px 10px; font-size: 0.8rem; font-weight: 700; }
.is-pro .pro-pill { display: inline-block; }
@media (max-width: 720px) {
  .nav { margin-left: 0; width: 100%; padding-bottom: 8px; overflow-x: auto; flex-wrap: nowrap; }
  .nav a { white-space: nowrap; }
}

/* hero */
.hero { padding: 40px 0 16px; }
.hero .lede { font-size: 1.15rem; color: var(--muted); max-width: 760px; }
.trust { display: flex; flex-wrap: wrap; gap: 8px 20px; list-style: none; padding: 0; margin: 0 0 20px; color: var(--muted); font-size: 0.95rem; }
.trust li::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: middle; }

/* cards & converter */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.dropcard { padding: 12px; }
.dropzone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 32px 16px; text-align: center; transition: border-color 0.15s, background 0.15s; }
.dropzone.is-drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .icon { color: var(--accent); display: inline-block; margin-bottom: 8px; }
.dz-title { margin-bottom: 4px; }
.dz-or { color: var(--muted); }
.dz-formats { color: var(--muted); font-size: 0.9rem; margin-bottom: 4px; }
.privacy-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 10px 0 2px; color: var(--muted); font-size: 0.9rem; text-align: center; }
.privacy-note .icon { color: var(--accent); display: inline-flex; }
.step h2 { display: flex; align-items: center; gap: 10px; }
.step h2:focus { outline: none; }
.step-n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 0.95rem; flex: none; }
.step-desc { color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 8px 14px; cursor: pointer; text-decoration: none; min-height: 40px; }
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { background: var(--accent-strong); color: var(--accent-contrast); }
.btn-lg { padding: 12px 20px; font-size: 1.05rem; }
.btn-link { background: none; border: none; color: var(--accent); text-decoration: underline; font-weight: 500; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px 18px; margin-bottom: 12px; }
.field label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 4px; }
.field-check label { font-weight: 500; display: flex; align-items: center; gap: 6px; }
.field input[type='text'], .field select, select.role { width: 100%; font: inherit; font-size: 0.95rem; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); min-height: 40px; }
.hint { color: var(--muted); font-size: 0.85rem; margin: 4px 0 0; }
.meta { color: var(--muted); font-size: 0.9rem; }

.notice { border: 1px solid var(--info-border); background: var(--info-bg); border-left-width: 4px; border-radius: 8px; padding: 10px 14px; margin: 10px 0; }
.notice ul { margin: 6px 0 0; padding-left: 20px; }
.notice-warn, .notice-ask { border-color: var(--warn-border); background: var(--warn-bg); }
.notice-error { border-color: var(--error-border); background: var(--error-bg); }
.notice-ok { border-color: var(--ok-border); background: var(--ok-bg); }
.notice-beta { border-color: var(--info-border); }
.status:empty { display: none; }

.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; }
.tab { font: inherit; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; padding: 6px 12px; cursor: pointer; white-space: nowrap; }
.tab[aria-selected='true'] { border-color: var(--accent); background: var(--accent-soft); }
.tab-count { color: var(--muted); }

.table-wrap { overflow: auto; max-height: 460px; border: 1px solid var(--border); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { padding: 6px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
thead th { position: sticky; top: 0; background: var(--surface-2); z-index: 1; }
.grid-table th { min-width: 140px; }
.grid-table td { white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.grid-table .rownum { min-width: 0; width: 1%; color: var(--muted); font-variant-numeric: tabular-nums; }
.col-label { font-weight: 500; color: var(--muted); font-size: 0.82rem; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
td.role-ignore { color: var(--muted); }
tr.row-skipped td { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent); }
tr.row-bad td { background: var(--warn-bg); }
.legend::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.legend-used::before { background: var(--accent); }
.legend-skipped::before { background: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-family: var(--mono); font-size: 0.86rem; }
.neg { color: var(--neg); }
.pos { color: var(--pos); }
.nowrap { white-space: nowrap; }
.status { font-size: 0.85rem; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 0 0 12px; }
.stat { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; }
.stat dt { color: var(--muted); font-size: 0.82rem; }
.stat dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
details.skipped { margin: 8px 0 12px; font-size: 0.9rem; }
details.skipped li { color: var(--muted); word-break: break-word; }

.formats { border: none; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.formats legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.format { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; cursor: pointer; }
.format.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.format span:first-of-type { flex: 1; }
.badge { font-size: 0.72rem; font-weight: 700; border-radius: 999px; padding: 2px 8px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge-free { color: var(--accent); }
.export-actions { margin: 8px 0; }
.disclaimer { font-size: 0.88rem; color: var(--muted); border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }

/* content */
.content { padding: 24px 0 8px; }
.content section { margin-bottom: 32px; }
.content li { margin-bottom: 6px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.faq details { border-bottom: 1px solid var(--border); padding: 12px 0; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq details p { margin: 8px 0 0; }
.compare { font-size: 0.95rem; }
.compare th { background: var(--surface-2); }

.pricing { padding: 24px 0; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-bottom: 16px; }
.plan { display: flex; flex-direction: column; }
.plan.featured { border-color: var(--accent); border-width: 2px; }
.plan .price { font-size: 2rem; font-weight: 800; margin: 0; }
.plan .price small { font-size: 0.95rem; font-weight: 500; color: var(--muted); }
.plan ul { padding-left: 18px; flex: 1; }
.license-form { display: flex; gap: 8px; flex-wrap: wrap; }
.license-form input { flex: 1 1 240px; font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); min-height: 40px; }

.site-footer { border-top: 1px solid var(--border); margin-top: 32px; padding: 24px 0 40px; color: var(--muted); font-size: 0.92rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 10px; }
.site-footer a { color: var(--muted); }
.breadcrumbs { font-size: 0.9rem; color: var(--muted); margin: 16px 0 0; }
.breadcrumbs a { color: var(--muted); }
