body { margin: 0; }

/* ═══ Tokens — src/app/tokens.css, `:root` scoped to `.tx` ═══ */
.tx {
    color-scheme: light;
    --bg: #FAFAF7;
    --surface: #FFFFFF;
    --surface2: #F1F3EF;
    --line: #DDE3DC;
    --line2: #C9D2C8;
    --ink: #1C2422;
    --ink2: #4A5652;
    --ink3: #7C8783;
    --accent: #0E7264;
    --accent-soft: #E2F0EC;
    --on-accent: #FFFFFF;
    --ok: #1B7A3D;
    --ok-soft: #E3F2E7;
    --warn: #A16207;
    --warn-soft: #FBF0DB;
    --err: #B3362C;
    --err-soft: #F9E7E4;
    --sel: #EAF4F1;
    --shadow: 0 1px 3px rgba(28, 36, 34, 0.08), 0 4px 16px rgba(28, 36, 34, 0.06);
}

@media (prefers-color-scheme: dark) {
    .tx {
        color-scheme: dark;
        --bg: #111716;
        --surface: #181F1D;
        --surface2: #1F2826;
        --line: #2A3532;
        --line2: #3A4642;
        --ink: #E6EDEA;
        --ink2: #A9B6B1;
        --ink3: #75827D;
        --accent: #4FB39E;
        --accent-soft: #1D3330;
        --on-accent: #0C1513;
        --ok: #5CBF7E;
        --ok-soft: #1C2E22;
        --warn: #D9A94A;
        --warn-soft: #332A17;
        --err: #E07B6F;
        --err-soft: #38201D;
        --sel: #20302C;
        --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.3);
    }
}

.tx[data-theme="light"] {
    color-scheme: light;
    --bg: #FAFAF7;
    --surface: #FFFFFF;
    --surface2: #F1F3EF;
    --line: #DDE3DC;
    --line2: #C9D2C8;
    --ink: #1C2422;
    --ink2: #4A5652;
    --ink3: #7C8783;
    --accent: #0E7264;
    --accent-soft: #E2F0EC;
    --on-accent: #FFFFFF;
    --ok: #1B7A3D;
    --ok-soft: #E3F2E7;
    --warn: #A16207;
    --warn-soft: #FBF0DB;
    --err: #B3362C;
    --err-soft: #F9E7E4;
    --sel: #EAF4F1;
    --shadow: 0 1px 3px rgba(28, 36, 34, 0.08), 0 4px 16px rgba(28, 36, 34, 0.06);
}

.tx[data-theme="dark"] {
    color-scheme: dark;
    --bg: #111716;
    --surface: #181F1D;
    --surface2: #1F2826;
    --line: #2A3532;
    --line2: #3A4642;
    --ink: #E6EDEA;
    --ink2: #A9B6B1;
    --ink3: #75827D;
    --accent: #4FB39E;
    --accent-soft: #1D3330;
    --on-accent: #0C1513;
    --ok: #5CBF7E;
    --ok-soft: #1C2E22;
    --warn: #D9A94A;
    --warn-soft: #332A17;
    --err: #E07B6F;
    --err-soft: #38201D;
    --sel: #20302C;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* ═══ Base — the app's own type stacks (globals.css) ═══ */
.tx { min-height: 100vh; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.6;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased; }
.tx *, .tx *::before, .tx *::after { box-sizing: border-box; }
.tx .num { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }
.tx a { color: var(--accent); }
.tx a:hover { color: var(--ink); }
.tx :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.tx .wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }
.tx .ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.tx .lg-i { fill: var(--ink); }
.tx .lg-a { fill: var(--accent); }
.tx .skip { position: absolute; left: 16px; top: -60px; z-index: 10; background: var(--surface); color: var(--ink); border: 1px solid var(--line2); border-radius: 8px; padding: 10px 14px; font-weight: 700; text-decoration: none; }
.tx .skip:focus { top: 12px; }

/* type */
.tx h1, .tx h2, .tx h3 { margin: 0; color: var(--ink); text-wrap: balance; }
.tx h1 { font-size: clamp(36px, 5.6vw, 62px); line-height: 1.06; letter-spacing: -0.028em; font-weight: 800; }
.tx h2 { font-size: clamp(28px, 3.6vw, 42px); line-height: 1.12; letter-spacing: -0.02em; font-weight: 800; }
.tx h3 { font-size: 17px; line-height: 1.35; letter-spacing: -0.005em; font-weight: 700; }
.tx p { margin: 0; text-wrap: pretty; }
.tx .eyebrow { font-size: 12.5px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; color: var(--accent); }
.tx .lede { font-size: clamp(17px, 1.6vw, 19.5px); line-height: 1.6; color: var(--ink2); max-width: 62ch; }
.tx .body2 { font-size: 15px; line-height: 1.6; color: var(--ink2); }
/* zh headings break at punctuation, not mid-phrase; anywhere only as a fallback */
.tx:lang(zh) h1, .tx:lang(zh) h2, .tx:lang(zh) h3 { word-break: keep-all; overflow-wrap: anywhere; }
.tx:lang(zh) h1 { letter-spacing: 0; line-height: 1.22; font-weight: 700; }
.tx:lang(zh) h2 { letter-spacing: 0; line-height: 1.3; font-weight: 700; }
.tx:lang(zh) h3 { letter-spacing: 0; }
.tx:lang(zh) .eyebrow, .tx:lang(zh) .fit-h { letter-spacing: 0.06em; }
/* the zh hero eyebrow carries an English gloss (#754 decision 5): keep it in its own case, and balance the lines */
.tx:lang(zh) .eyebrow { text-transform: none; text-wrap: balance; }
.tx:lang(zh) .lede, .tx:lang(zh) .body2 { line-height: 1.75; }
.tx:lang(zh) { text-spacing-trim: trim-start; }

/* controls */
.tx button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.tx .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 8px; border: 1px solid var(--line2); background: var(--surface); color: var(--ink); font-weight: 700; font-size: 15.5px; text-decoration: none; white-space: nowrap; transition: border-color .15s, color .15s, box-shadow .15s; }
.tx .btn:hover { border-color: var(--accent); color: var(--accent); }
.tx .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tx .btn.primary:hover { color: var(--on-accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tx .seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; background: var(--surface); }
.tx .seg button { min-height: 44px; min-width: 48px; padding: 0 12px; font-size: 13.5px; font-weight: 700; color: var(--ink2); }
.tx .seg button:hover { background: var(--surface2); }
.tx .seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.tx .seg button:focus-visible { outline-offset: -3px; }
/* the app's fix: an accent ring on an accent fill would be invisible */
.tx .seg button[aria-pressed="true"]:focus-visible { outline-color: var(--on-accent); }
@media (forced-colors: active) { .tx .seg button[aria-pressed="true"] { forced-color-adjust: none; background: Highlight; color: HighlightText; } }
.tx .iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 8px; border: 1px solid var(--line2); background: var(--surface); color: var(--ink2); }
.tx .iconbtn:hover { color: var(--accent); border-color: var(--accent); }

/* header */
.tx .top { position: sticky; top: 0; z-index: 5; background: var(--bg); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.tx .top .wrap { display: flex; align-items: center; gap: 16px; min-height: 68px; flex-wrap: wrap; }
.tx .brand { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; padding: 0 2px; }
.tx .nav { display: flex; gap: 4px; margin-left: 12px; }
.tx .nav a { color: var(--ink2); text-decoration: none; font-weight: 600; font-size: 15px; padding: 10px 12px; border-radius: 8px; }
.tx .nav a:hover { color: var(--ink); background: var(--surface2); }
.tx .tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }
@media (max-width: 720px) { .tx .nav { display: none; } }

/* hero */
.tx .hero { padding: clamp(48px, 8vw, 96px) 0 clamp(48px, 7vw, 88px); }
.tx .hero-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr)); gap: clamp(40px, 6vw, 72px); align-items: start; }
@media (min-width: 1140px) { .tx .hero-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); } }
.tx .hero-copy { display: flex; flex-direction: column; gap: 22px; padding-top: clamp(0px, 3vw, 36px); }
.tx .ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
@media (max-width: 480px) { .tx .ctas .btn { flex: 1 1 100%; } }
.tx .aud { margin-top: clamp(48px, 7vw, 80px); border-top: 1px solid var(--line); padding-top: 22px; }
.tx .fit-h { margin: 0; font-size: 12.5px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; color: var(--ink2); line-height: 1.4; }
.tx .fit { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 0; }
.tx .fit > div { display: flex; flex-direction: column; gap: 6px; padding: 16px 24px 4px 0; }
.tx .fit .k { display: flex; align-items: flex-start; gap: 10px; color: var(--accent); }
.tx .fit .k .ic { margin-top: 1px; }
.tx .fit h3 { font-size: 16px; }

/* hero illustration — the product's own chips, cards and draft pill */
.tx .mock { position: relative; display: flex; flex-direction: column; gap: 16px; padding: clamp(16px, 3vw, 28px); border-radius: 16px; background: var(--surface2); border: 1px solid var(--line); }
/* dark: surface2 is lighter than surface, so the cards would look sunk — sit them on the page ground instead */
@media (prefers-color-scheme: dark) { .tx:not([data-theme="light"]) .mock { background: var(--bg); } }
.tx[data-theme="dark"] .mock { background: var(--bg); }
.tx .mock-cap { margin: -4px 0 0; font-size: 12px; color: var(--ink2); text-align: right; }
@media (max-width: 480px) { .tx .mrow.opt { display: none; } }
.tx .mcard { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.tx .mhead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.tx .mhead b { font-size: 13.5px; }
.tx .mhead .sp { flex: 1; }
.tx .mrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.tx .mrow:last-child { border-bottom: 0; }
.tx .mrow .d { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx .mrow .a { text-align: right; font-size: 12.5px; }
.tx .mrow .meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--ink2); font-size: 12px; }
.tx .mrow.sel { background: var(--sel); }
.tx .chip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.tx .chip.code { background: var(--accent-soft); color: var(--accent); }
.tx .chip.ok { background: var(--ok-soft); color: var(--ok); }
.tx .chip.warn { background: var(--warn-soft); color: color-mix(in srgb, var(--warn) 80%, var(--ink)); }
.tx .chip.ghost { background: var(--surface2); color: var(--ink2); }
.tx .draftpill { font-size: 11px; letter-spacing: .08em; padding: 3px 9px; border-radius: 999px; background: var(--warn-soft); color: color-mix(in srgb, var(--warn) 80%, var(--ink)); font-weight: 700; }
.tx .kv { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 14px; border-bottom: 1px dashed var(--line); font-size: 13px; }
.tx .kv .lbl { color: var(--ink2); }
.tx .kv .lbl .num { color: var(--ink); font-weight: 700; margin-right: 6px; }
.tx .trace { display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-size: 12.5px; color: var(--accent); font-weight: 600; }
.tx .note { margin: 0 14px 14px; padding: 8px 11px; border-radius: 8px; background: var(--warn-soft); color: color-mix(in srgb, var(--warn) 80%, var(--ink)); font-size: 12px; line-height: 1.5; }
.tx .audit { display: flex; gap: 8px; align-items: baseline; padding: 10px 14px; font-size: 12px; color: var(--ink2); border-top: 1px solid var(--line); }
.tx .mock-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 16px; align-items: start; }

/* sections */
.tx .sec { padding: clamp(64px, 9vw, 112px) 0; }
.tx .sec-head { display: flex; flex-direction: column; gap: 14px; max-width: 760px; margin-bottom: clamp(36px, 5vw, 56px); }
.tx .band { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tx .grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 16px; }
/* nine features: three across from 900px; below that the last card spans the row instead of standing alone */
@media (min-width: 900px) { .tx #features .grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 899px) { .tx #features .grid3 > :last-child { grid-column: 1 / -1; } }
.tx .feat { display: flex; flex-direction: column; gap: 10px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.tx .feat .tile { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); margin-bottom: 4px; }

/* workflow */
/* one column with a left rule below 1000px, five across with a top rule above — never a 3+2 or 4+1 split */
.tx .steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.tx .step { display: flex; flex-direction: column; gap: 8px; padding: 2px 0 26px 20px; border-left: 2px solid var(--line2); }
.tx .step .body2 { max-width: 62ch; }
.tx .step .n { font-size: 13px; font-weight: 700; color: var(--accent); letter-spacing: .04em; }
.tx .step.last { border-left-color: var(--accent); padding-bottom: 2px; }
@media (min-width: 1000px) {
  .tx .steps { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .tx .step { gap: 10px; padding: 24px 22px 8px 0; border-left: 0; border-top: 2px solid var(--line2); }
  .tx .step.last { border-top-color: var(--accent); padding-bottom: 8px; }
}

/* principles — a short summary band: heading over three columns, heading beside them from 1100px */
.tx .sum { padding: clamp(40px, 6vw, 64px) 0; }
.tx .sum .wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px 32px; }
.tx .sum h2 { font-size: clamp(22px, 2.4vw, 28px); }
.tx .pr { display: flex; flex-direction: column; gap: 6px; padding-top: 16px; border-top: 1px solid var(--line2); }
@media (min-width: 720px) { .tx .sum .wrap { grid-template-columns: repeat(3, minmax(0, 1fr)); } .tx .sum h2 { grid-column: 1 / -1; } }
@media (min-width: 1100px) { .tx .sum .wrap { grid-template-columns: minmax(0, .8fr) repeat(3, minmax(0, 1fr)); } .tx .sum h2 { grid-column: auto; } }

/* contact — the address on show, one mailto button */
.tx .contact { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 40px; padding: clamp(24px, 4vw, 40px); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.tx .contact-text { flex: 1 1 360px; display: flex; flex-direction: column; gap: 10px; }
.tx .contact-act { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.tx .addr { display: flex; flex-direction: column; gap: 2px; }
.tx .addr-l { font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; color: var(--ink2); }
.tx .contact-text p { text-wrap: balance; }
.tx .addr-v { font-size: 18px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
@media (max-width: 480px) { .tx .contact-act, .tx .contact-act .btn { width: 100%; } }

/* compliance + footer */
.tx .legal { padding: clamp(40px, 6vw, 64px) 0; border-top: 1px solid var(--line); }
.tx .legal h2 { font-size: 15px; letter-spacing: 0; line-height: 1.4; margin-bottom: 12px; }
.tx .legal p { font-size: 13.5px; line-height: 1.65; color: var(--ink2); max-width: 88ch; }
.tx .legal p + p { margin-top: 8px; }
.tx .foot { background: var(--surface2); border-top: 1px solid var(--line); padding: 36px 0 44px; }
.tx .foot .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.tx .foot .fnav { display: flex; gap: 4px; flex-wrap: wrap; }
.tx .foot .fnav a { color: var(--ink2); text-decoration: none; font-weight: 600; font-size: 14px; padding: 10px 10px; border-radius: 8px; }
.tx .foot .fnav a:hover { color: var(--ink); }
.tx .foot .small { font-size: 13px; color: var(--ink2); }
.tx .foot .grow { flex: 1; }

/* privacy — one readable column; the headings step down from the landing's display sizes */
.tx .doc { padding: clamp(40px, 6vw, 72px) 0 clamp(56px, 8vw, 96px); }
.tx .doc-body { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.tx .doc h1 { font-size: clamp(30px, 4vw, 44px); line-height: 1.12; letter-spacing: -0.02em; }
.tx .doc .updated { font-size: 13.5px; color: var(--ink2); }
.tx .doc-sec { display: flex; flex-direction: column; gap: 8px; padding-top: 22px; margin-top: 10px; border-top: 1px solid var(--line); }
.tx .doc-sec h2 { font-size: 19px; line-height: 1.35; letter-spacing: -0.005em; }
.tx .doc .addr { margin-top: 18px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.tx:lang(zh) .doc h1 { letter-spacing: 0; line-height: 1.3; }
.tx:lang(zh) .doc-sec h2 { letter-spacing: 0; }

/* the footer takes up any frame height left below the page, in either language */
.tx { display: flex; flex-direction: column; }
.tx > .foot { flex: 1 0 auto; }

html { scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { .tx * { transition: none !important; scroll-behavior: auto !important; } }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
