:root {
  color-scheme: light;
  --ink: #102b46;
  --muted: #64768a;
  --blue: #5067df;
  --navy: #071b34;
  --line: #dfe6ef;
  --soft: #f5f7fc;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; padding-bottom: calc(86px + env(safe-area-inset-bottom)); color: var(--ink); background: #fff; }
.feedback-launcher { position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 25; display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); background: #fff; box-shadow: 0 6px 24px rgba(13,35,67,.14); font-size: .85rem; font-weight: 700; text-decoration: none; }
.feedback-launcher:hover { color: var(--blue); border-color: var(--blue); }
.feedback-launcher:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
:root[data-theme="dark"] .feedback-launcher { color: #dbe5f2; border-color: #34445a; background: #151f2e; }
@media (max-width: 600px) { .feedback-launcher { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); } }
button, textarea, input { font: inherit; }
button, .button { cursor: pointer; }
a { color: inherit; }
.shell { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
.site-header { min-height: 76px; display: flex; align-items: center; gap: 28px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 850; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; padding: 7px; border-radius: 9px; display: grid; gap: 3px; background: linear-gradient(145deg, #546cf0, #22bcd2); transform: rotate(-6deg); }
.brand-mark i { height: 3px; display: block; border-radius: 3px; background: white; }
.site-header nav { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.site-header nav a { color: #53687e; font-size: .85rem; font-weight: 700; text-decoration: none; }
.site-header nav a.button { color: white; }
.theme-toggle { min-height: 34px; padding: 0 10px; border: 1px solid #dce3eb; border-radius: 8px; color: #53667d; background: #f2f5f8; display: inline-flex; align-items: center; gap: 6px; font-size: .65rem; font-weight: 800; transition: color .18s ease, background .18s ease, border-color .18s ease; }
.theme-toggle:hover { color: #4058d5; border-color: #c9d3e5; background: #e9eef8; }
.theme-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.button { min-height: 44px; padding: 0 18px; border: 0; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; color: white; background: var(--blue); font-weight: 800; text-decoration: none; }
.button--secondary { color: var(--ink); background: white; border: 1px solid var(--line); }
.breadcrumbs { padding-top: 30px; color: #76879a; font-size: .75rem; }
.breadcrumbs a { color: #4c62d7; text-decoration: none; }
.hero { padding: 60px 0 70px; background: radial-gradient(circle at 75% 8%, rgba(83,108,240,.14), transparent 33%), linear-gradient(180deg,#fbfcff,#f6f9fd); }
.hero-grid { display: grid; grid-template-columns: .92fr 1.08fr; gap: 62px; align-items: center; }
.eyebrow { color: #4d64d9; font-size: .74rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
h1 { margin: 17px 0 21px; font-size: clamp(2.8rem, 5.8vw, 4.9rem); line-height: .98; letter-spacing: -.06em; }
.lede { margin: 0; color: var(--muted); font-size: 1.02rem; line-height: 1.75; }
.trust-list { margin: 25px 0 0; padding: 0; list-style: none; display: grid; gap: 9px; color: #496177; font-size: .82rem; font-weight: 650; }
.trust-list li::before { content: "✓"; margin-right: 9px; color: #07966d; font-weight: 900; }
.tool-card { padding: 24px; border: 1px solid #dae3ee; border-radius: 18px; background: white; box-shadow: 0 24px 70px rgba(17,43,72,.12); }
.tool-card > label:not(.file-button) { display: block; margin-bottom: 9px; color: #415b75; font-size: .77rem; font-weight: 800; }
.tool-card textarea { width: 100%; min-height: 260px; padding: 16px; resize: vertical; border: 1px solid #dbe3ec; border-radius: 10px; outline: 0; color: #bfd0df; background: var(--navy); font: 400 .73rem/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.tool-card textarea:focus { border-color: #6d80eb; box-shadow: 0 0 0 3px rgba(82,105,224,.13); }
.tool-actions { margin-top: 13px; display: flex; flex-wrap: wrap; gap: 9px; }
.file-button { position: relative; overflow: hidden; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.free-note { margin: 13px 0 0; color: #6d7f91; font-size: .72rem; text-align: center; }
.tool-error { margin-top: 13px; padding: 11px 13px; border-radius: 8px; color: #a03440; background: #fff0f1; font-size: .76rem; }
.tool-result { margin-top: 16px; padding: 18px; border: 1px solid #dfe6ef; border-radius: 11px; background: #f8fafd; }
.tool-result[hidden] { display: none; }
.tool-result h2 { margin: 0 0 14px; font-size: 1rem; }
.result-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
.result-grid div { padding: 10px; border-radius: 7px; background: white; }
.result-grid span, .result-grid strong { display: block; overflow-wrap: anywhere; }
.result-grid span { color: #7d8d9d; font-size: .64rem; }
.result-grid strong { margin-top: 4px; color: #233d59; font-size: .76rem; }
.result-export { margin-top: 14px; }
.conversion-result h2 { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.conversion-warnings { margin: 0 0 14px; padding: 13px 13px 13px 31px; border-radius: 8px; color: #76591f; background: #fff7e7; font-size: .72rem; line-height: 1.55; }
.conversion-warnings li + li { margin-top: 5px; }
.conversion-output { max-height: 430px; margin: 0; padding: 15px; overflow: auto; border-radius: 8px; color: #bed0de; background: var(--navy); font: 400 .68rem/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; }
.conversion-result-actions { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 9px; }
.validation-summary { margin-bottom: 13px; padding: 12px; border-radius: 8px; color: #176b55; background: #eaf8f3; font-size: .74rem; font-weight: 800; }
.validation-summary.is-invalid { color: #9e3641; background: #fff0f1; }
.validation-list { display: grid; gap: 8px; }
.validation-item { padding: 11px 12px; border: 1px solid #eadfe0; border-radius: 8px; background: white; }
.validation-item.warning { border-color: #eee3c9; }
.validation-item strong, .validation-item span { display: block; }
.validation-item strong { color: #30485f; font-size: .72rem; }
.validation-item span { margin-top: 4px; color: #6f8092; font-size: .66rem; line-height: 1.5; }
.validation-note { margin: 13px 0 0; color: #7c8b9a; font-size: .62rem; line-height: 1.5; }
.content { padding: 85px 0; }
.content-grid { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(260px,.7fr); gap: 72px; align-items: start; }
.article h2 { margin: 48px 0 14px; font-size: 1.8rem; letter-spacing: -.035em; }
.article h2:first-child { margin-top: 0; }
.article h3 { margin: 30px 0 10px; font-size: 1.12rem; }
.article p, .article li { color: #556b81; font-size: .94rem; line-height: 1.82; }
.article code { padding: 2px 5px; border-radius: 4px; color: #3651cf; background: #eef1ff; }
.article table { width: 100%; margin: 23px 0; border-collapse: collapse; font-size: .84rem; }
.article th, .article td { padding: 13px 12px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.article th { color: #2c4662; background: #f5f7fb; }
.article td { color: #5b7085; }
.callout { margin: 28px 0; padding: 19px 21px; border: 1px solid #d8e0ff; border-left: 4px solid #5a70e7; border-radius: 10px; color: #4e6177; background: #f5f7ff; line-height: 1.7; }
.sidebar-card { position: sticky; top: 24px; padding: 24px; border-radius: 14px; color: white; background: linear-gradient(145deg,#071b34,#1b3763); }
.sidebar-card h2 { margin: 0 0 11px; font-size: 1.3rem; }
.sidebar-card p { color: #bdcad9; font-size: .82rem; line-height: 1.65; }
.sidebar-card .button { width: 100%; margin-top: 8px; }
.related { padding: 70px 0; background: var(--soft); }
.related h2 { margin: 0 0 24px; font-size: 1.8rem; letter-spacing: -.035em; }
.card-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.link-card { padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: white; text-decoration: none; }
.link-card strong { display: block; margin-bottom: 8px; }
.link-card span { color: #687a8d; font-size: .8rem; line-height: 1.55; }
.footer { min-height: 120px; display: flex; align-items: center; gap: 24px; color: #708195; font-size: .76rem; }
.footer nav { margin-left: auto; display: flex; gap: 18px; }
.guide-hero { padding: 70px 0; background: linear-gradient(180deg,#f8faff,#fff); }
.guide-hero h1 { max-width: 850px; }
.guide-hero .lede { max-width: 760px; }
.guide-meta { margin-top: 22px; color: #7b8b9c; font-size: .74rem; font-weight: 700; }

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #eef4ff;
  --muted: #a9b8ca;
  --blue: #6174e8;
  --navy: #07111e;
  --line: #2b3a4f;
  --soft: #111c2b;
}
:root[data-theme="dark"] body { background: #0c1420; }
:root[data-theme="dark"] .site-header nav a,
:root[data-theme="dark"] .breadcrumbs,
:root[data-theme="dark"] .guide-meta,
:root[data-theme="dark"] .footer { color: #9fb0c4; }
:root[data-theme="dark"] .theme-toggle { color: #c2cfdf; background: #182437; }
:root[data-theme="dark"] .theme-toggle:hover { color: #fff; border-color: #536986; background: #202e43; }
:root[data-theme="dark"] .hero { background: radial-gradient(circle at 75% 8%, rgba(99,102,241,.17), transparent 33%), linear-gradient(180deg,#0c1420,#101a29); }
:root[data-theme="dark"] .guide-hero { background: linear-gradient(180deg,#101a29,#0c1420); }
:root[data-theme="dark"] .trust-list,
:root[data-theme="dark"] .article p,
:root[data-theme="dark"] .article li,
:root[data-theme="dark"] .article td,
:root[data-theme="dark"] .link-card span,
:root[data-theme="dark"] .free-note,
:root[data-theme="dark"] .validation-note { color: #9fb0c4; }
:root[data-theme="dark"] .tool-card,
:root[data-theme="dark"] .link-card { border-color: #2b3a4f; background: #151f2e; box-shadow: 0 24px 70px rgba(0,0,0,.2); }
:root[data-theme="dark"] .tool-card > label:not(.file-button) { color: #c2cfdf; }
:root[data-theme="dark"] .button--secondary { color: #dce6f2; border-color: #3a4960; background: #182437; }
:root[data-theme="dark"] .tool-result { border-color: #2d3b50; background: #111a27; }
:root[data-theme="dark"] .result-grid div,
:root[data-theme="dark"] .validation-item { border-color: #34445a; background: #182437; }
:root[data-theme="dark"] .result-grid span,
:root[data-theme="dark"] .validation-item span { color: #9cabbf; }
:root[data-theme="dark"] .result-grid strong,
:root[data-theme="dark"] .validation-item strong,
:root[data-theme="dark"] .article th { color: #dce6f2; }
:root[data-theme="dark"] .article th { background: #182437; }
:root[data-theme="dark"] .article code { color: #b8c3ff; background: #1a2543; }
:root[data-theme="dark"] .callout { color: #b7c4d5; border-color: #344467; border-left-color: #7284ee; background: #151f35; }
:root[data-theme="dark"] .related { background: #101a29; }
:root[data-theme="dark"] .validation-summary { color: #6ed5b4; background: #153129; }
:root[data-theme="dark"] .validation-summary.is-invalid,
:root[data-theme="dark"] .tool-error { color: #f0a5ad; background: #321d22; }
:root[data-theme="dark"] .conversion-warnings { color: #e2c77f; background: #292414; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) { color-scheme: dark; }
}

@media (max-width: 850px) {
  .site-header nav a:not(.button) { display: none; }
  .hero-grid, .content-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 38px; }
  .tool-card textarea { min-height: 220px; }
  .content-grid { gap: 45px; }
  .sidebar-card { position: static; }
  .card-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .shell { width: min(100% - 28px,1120px); }
  .site-header { gap: 10px; }
  .site-header nav { gap: 8px; }
  .site-header nav .button { min-height: 39px; padding-inline: 11px; font-size: .72rem; }
  .theme-toggle span { display: none; }
  .theme-toggle { width: 34px; padding: 0; justify-content: center; }
  h1 { font-size: 2.75rem; }
  .tool-card { padding: 15px; }
  .result-grid { grid-template-columns: 1fr; }
  .article table { display: block; overflow-x: auto; }
  .footer { padding-block: 28px; align-items: flex-start; flex-direction: column; }
  .footer nav { margin-left: 0; }
}
