/* ==========================================================================
   ThaiHao flagship (/thaihao): a live trade terminal and studio.
   Grammar: live surface. Status bar and workspace tabs are the navigation;
   the hero is the corridor terminal already running; the close is the D7
   intake. Palette: Studio Obsidian, Imperial Cinnabar, Champagne Gold, Jade
   Telemetry, Warm Rice Paper (document surfaces only).
   Shared engine and tokens: thaihao_scrollcraft.js, thaihao_gfw_safe_tokens.css.
   ASCII only.
   ========================================================================== */

.ths-body {
    --ths-o: #0A0E17;
    --ths-o2: #0F1420;
    --ths-o3: #161D2C;
    --ths-o4: #1D2638;
    --ths-line: rgba(246, 243, 236, 0.1);
    --ths-line-2: rgba(246, 243, 236, 0.2);
    --ths-ink: #F6F3EC;
    --ths-ink-2: #C3BEB2;
    --ths-ink-3: #959186;
    --ths-cinnabar: #8B1E24;
    --ths-cinnabar-hover: #A1262C;
    --ths-cinnabar-hi: #C93B3B;
    --ths-cinnabar-ink: #F08A80;
    --ths-gold: #D8A64D;
    --ths-gold-hi: #E8C27A;
    --ths-jade: #10B981;
    --ths-jade-ink: #3DD6A0;
    --ths-slate: #9AA3B8;
    --ths-paper: #F6F3EC;
    --ths-paper-2: #EFEADF;
    --ths-paper-field: #FFFDF8;
    --ths-paper-ink: #1A1712;
    --ths-paper-ink-2: #5B554A;
    --ths-paper-line: rgba(26, 23, 18, 0.16);
    --ths-sans: "IBM Plex Sans", "Sarabun", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
    --ths-zh: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", "IBM Plex Sans", sans-serif;
    --ths-th: "Sarabun", "IBM Plex Sans", "Leelawadee UI", "Noto Sans Thai", sans-serif;
    --ths-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
    --ths-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --ths-chrome-h: 104px;
    --ths-bar-vis: 0px;
    --ths-dock-h: 0px;
    --ths-stage-h: calc(100vh - var(--ths-chrome-h) - var(--ths-dock-h));
    /* transitions.dev: text swap soft (34) and tabs sliding (16) */
    --text-soft-dur: 200ms;
    --text-soft-blur: 2px;
    --text-soft-ease: ease-in-out;
    --text-soft-resize-dur: 240ms;
    --text-soft-resize-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --tabs-dur: 250ms;
    --tabs-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --tabs-text-muted: #C3BEB2;
    --tabs-text-active: #0A0E17;
    --tabs-bar-bg: #0F1420;
    --tabs-pill-bg: #F6F3EC;

    margin: 0;
    background-color: var(--ths-o);
    color: var(--ths-ink);
    font-family: var(--ths-sans);
    font-size: 16px;
    line-height: 1.6;
    font-variant-numeric: tabular-nums;
    caret-color: var(--ths-gold);
    accent-color: var(--ths-gold);
    scrollbar-color: #2A3346 var(--ths-o);
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

@supports (height: 100svh) {
    .ths-body {
        --ths-stage-h: calc(100svh - var(--ths-chrome-h) - var(--ths-dock-h));
    }
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 112px;
    background-color: #0A0E17;
}

html:lang(zh) .ths-body,
.ths-body [lang|="zh"] {
    font-family: var(--ths-zh);
}

html:lang(th) .ths-body,
.ths-body [lang="th"] {
    font-family: var(--ths-th);
}

html:lang(th) .ths-body {
    line-height: 1.7;
}

.ths-body *,
.ths-body *::before,
.ths-body *::after {
    box-sizing: border-box;
}

.ths-body ::selection {
    background-color: var(--ths-gold);
    color: #0A0E17;
}

.ths-body :focus-visible {
    outline: 2px solid var(--ths-gold);
    outline-offset: 3px;
}

:where(.ths-body) a {
    color: inherit;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

:where(.ths-body) :is(p, li, dd, figcaption) {
    text-wrap: pretty;
}

:where(.ths-body) :is(h1, h2, h3) {
    text-wrap: balance;
}

.ths-body img {
    max-width: 100%;
}

.ths-mono {
    font-family: var(--ths-mono);
    font-variant-numeric: tabular-nums slashed-zero;
}

.ths-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.ths-skip {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 100;
    padding: 10px 16px;
    border-radius: 10px;
    background-color: var(--ths-paper);
    color: var(--ths-paper-ink);
    font-weight: 600;
    text-decoration: none;
    transition: top 150ms var(--ths-ease);
}

.ths-skip:focus {
    top: 12px;
}

/* The shared SIVIRAI command bar, recoloured for the studio. */
.ths-body .sivilai-command-bar {
    background-color: #05070C;
    border-bottom-color: rgba(216, 166, 77, 0.22);
}

.ths-body .sivilai-command-bar .sivilai-brand-sub {
    font-size: 12px;
}

/* --------------------------------------------------------------------------
   App chrome
   -------------------------------------------------------------------------- */
.ths-chrome {
    position: sticky;
    top: 0;
    z-index: 40;
    background-color: var(--ths-o);
    border-bottom: 1px solid var(--ths-line);
}

.ths-status {
    display: flex;
    align-items: center;
    gap: 12px 20px;
    min-height: 58px;
    padding: 9px clamp(14px, 2.2vw, 28px);
}

.ths-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex: none;
}

.ths-brand img {
    display: block;
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.ths-brand-name {
    font-size: 18px;
    font-weight: 600;
    font-stretch: 84%;
    letter-spacing: -0.01em;
}

.ths-brand-native {
    font-size: 13px;
    color: var(--ths-ink-3);
}

.ths-domain {
    flex: none;
    padding: 5px 12px;
    border: 1px solid var(--ths-line);
    border-radius: 999px;
    font-size: 12.5px;
    color: var(--ths-ink-2);
}

.ths-facts {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px 22px;
    margin: 0;
    min-width: 0;
}

.ths-fact {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    white-space: nowrap;
}

.ths-fact dt {
    font-size: 12.5px;
    color: var(--ths-ink-3);
}

.ths-fact dd {
    margin: 0;
    font-size: 13.5px;
    color: var(--ths-ink);
}

.ths-fact-stage dd {
    font-family: var(--ths-sans);
    color: var(--ths-gold);
}

.ths-switches {
    display: flex;
    flex: none;
    align-items: center;
    gap: 8px;
}

.ths-seg {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--ths-line);
    border-radius: 11px;
    background-color: var(--ths-o2);
}

.ths-seg-btn {
    appearance: none;
    min-height: 36px;
    padding: 8px 12px;
    border: 0;
    border-radius: 8px;
    background-color: transparent;
    color: var(--ths-ink-2);
    font: 600 13.5px/1.1 var(--ths-sans);
    font-stretch: 88%;
    cursor: pointer;
    white-space: nowrap;
    transition: color 150ms var(--ths-ease), background-color 150ms var(--ths-ease);
}

.ths-seg-btn[aria-pressed="true"] {
    background-color: var(--ths-ink);
    color: var(--ths-o);
}

@media (hover: hover) and (pointer: fine) {
    .ths-seg-btn:not([aria-pressed="true"]):hover {
        color: var(--ths-ink);
        background-color: var(--ths-o3);
    }
}

.ths-tabs {
    display: flex;
    align-items: stretch;
    gap: 2px;
    height: 46px;
    padding: 0 clamp(8px, 1.6vw, 20px);
    border-top: 1px solid var(--ths-line);
}

.ths-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    color: var(--ths-ink-3);
    font-size: 14.5px;
    font-weight: 600;
    font-stretch: 86%;
    text-decoration: none;
    transition: color 150ms var(--ths-ease);
}

.ths-tab::after {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: -1px;
    height: 2px;
    border-radius: 2px;
    background-color: var(--ths-gold);
    transform: scaleX(0);
    transition: transform 250ms var(--ths-ease);
    content: "";
}

.ths-tab[aria-current="true"] {
    color: var(--ths-ink);
}

.ths-tab[aria-current="true"]::after {
    transform: scaleX(1);
}

@media (hover: hover) and (pointer: fine) {
    .ths-tab:not([aria-current="true"]):hover {
        color: var(--ths-ink-2);
    }
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.ths-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 10px;
    font: 600 15px/1.2 var(--ths-sans);
    font-stretch: 90%;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 150ms var(--ths-ease), color 150ms var(--ths-ease), border-color 150ms var(--ths-ease), transform 120ms var(--ths-ease);
}

.ths-btn:active {
    transform: scale(0.98);
}

.ths-btn-cinnabar {
    background-color: var(--ths-cinnabar);
    color: var(--ths-paper);
}

.ths-btn-gold {
    background-color: var(--ths-gold);
    color: #17120A;
}

.ths-btn-ghost {
    background-color: transparent;
    border-color: var(--ths-line-2);
    color: var(--ths-ink);
}

@media (hover: hover) and (pointer: fine) {
    .ths-btn-cinnabar:hover {
        background-color: var(--ths-cinnabar-hover);
    }

    .ths-btn-gold:hover {
        background-color: var(--ths-gold-hi);
    }

    .ths-btn-ghost:hover {
        border-color: var(--ths-ink-3);
        background-color: var(--ths-o3);
    }
}

.ths-btn:disabled {
    background-color: #2A2F3A;
    border-color: transparent;
    color: #8A8C93;
    cursor: not-allowed;
    transform: none;
}

/* --------------------------------------------------------------------------
   Workspace 1: the corridor terminal
   -------------------------------------------------------------------------- */
.ths-term {
    position: relative;
    height: 300vh;
    background-color: var(--ths-o);
}

.ths-term .ths-term-stage {
    position: sticky;
    top: var(--ths-chrome-h);
    height: var(--ths-stage-h);
    min-height: 560px;
    overflow: hidden;
    isolation: isolate;
}

@media (hover: hover) and (pointer: fine) {
    html.sc-ready .ths-term .ths-term-stage[data-sc-spotlight] {
        background-image: radial-gradient(560px circle at calc(var(--sc-mx, 0.5) * 100%) calc(var(--sc-my, 0.5) * 100%), rgba(216, 166, 77, calc(0.07 * var(--sc-lit, 0))), transparent 70%);
    }
}

.ths-term-canvas {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.ths-term-canvas canvas[data-sc-canvas3d] {
    --c3d-primary: #D8A64D;
    --c3d-highlight: #E8C27A;
    --c3d-accent: #10B981;
    --c3d-accent-2: #C93B3B;
    --c3d-ink: #F6F3EC;
    --c3d-muted: #46506A;
    --c3d-ox: 0.6;
    --c3d-oy: 0.47;
    --c3d-zoom: 0.22;
    --c3d-font: 500 12px "IBM Plex Mono", ui-monospace, monospace;
}

html:lang(zh) .ths-term-canvas canvas[data-sc-canvas3d] {
    --c3d-font: 500 12px "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

html:lang(th) .ths-term-canvas canvas[data-sc-canvas3d] {
    --c3d-font: 500 13px "Sarabun", "Leelawadee UI", sans-serif;
}

/* Back plane: the camera frame of the terminal (two corner brackets). */
.ths-term .ths-frame {
    inset: 12px;
    z-index: 1;
    border-radius: 0;
    background-image: none;
    -webkit-mask-image: none;
    mask-image: none;
}

.ths-frame::before,
.ths-frame::after {
    position: absolute;
    width: 30px;
    height: 30px;
    border-color: rgba(216, 166, 77, 0.5);
    border-style: solid;
    content: "";
}

.ths-frame::before {
    top: 0;
    left: 0;
    border-width: 1px 0 0 1px;
}

.ths-frame::after {
    right: 0;
    bottom: 0;
    border-width: 0 1px 1px 0;
}

.ths-term-ui {
    position: absolute;
    inset: 0 0 var(--ths-bar-vis) 0;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(300px, 440px) minmax(0, 1fr) minmax(260px, 330px);
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    gap: 14px 24px;
    padding: clamp(16px, 2vw, 28px) clamp(16px, 2.4vw, 32px);
    pointer-events: none;
}

.ths-term-ui > * {
    pointer-events: auto;
}

.ths-title {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    padding: 20px 22px 18px;
    border: 1px solid var(--ths-line);
    border-radius: 16px;
    background-color: rgba(10, 14, 23, 0.88);
}

.ths-title-mark {
    display: block;
    width: 44px;
    height: 44px;
    margin-bottom: 14px;
    border-radius: 10px;
}

.ths-title h1 {
    margin: 0;
    font-size: clamp(1.75rem, 1.15rem + 1.35vw, 2.45rem);
    font-weight: 600;
    font-stretch: 82%;
    line-height: 1.08;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

html:lang(zh) .ths-title h1,
html:lang(th) .ths-title h1 {
    font-stretch: 100%;
    letter-spacing: 0;
    line-height: 1.3;
}

.ths-title-sub {
    max-width: 40ch;
    margin: 12px 0 0;
    font-size: 15.5px;
    color: var(--ths-ink-2);
    text-wrap: pretty;
}

.ths-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.ths-title-meta {
    margin: 14px 0 0;
    font-size: 12.5px;
    color: var(--ths-ink-3);
}

.ths-panel {
    padding: 16px 18px;
    border: 1px solid var(--ths-line);
    border-radius: 14px;
    background-color: var(--ths-o2);
}

.ths-panel-h {
    margin: 0 0 8px;
    font-size: 14.5px;
    font-weight: 600;
    font-stretch: 86%;
    letter-spacing: 0.01em;
    color: var(--ths-gold);
}

.ths-telemetry {
    grid-column: 3;
    grid-row: 1 / 4;
    align-self: end;
}

.ths-tele {
    display: grid;
    margin: 0;
}

.ths-tele-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 2px 12px;
    padding: 8px 0;
    border-top: 1px solid var(--ths-line);
}

.ths-tele-row:first-child {
    border-top: 0;
}

.ths-tele dt {
    font-size: 13.5px;
    color: var(--ths-ink-2);
}

.ths-tele dd {
    margin: 0;
    font-size: 15px;
    color: var(--ths-ink);
}

.ths-tele-split {
    display: flex;
    flex-basis: 100%;
    flex-wrap: wrap;
    gap: 2px 14px;
    font-size: 12.5px !important;
    color: var(--ths-ink-2) !important;
}

.ths-panel-foot {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--ths-ink-3);
}

.ths-term-ui .ths-hud {
    position: relative;
    left: auto;
    bottom: auto;
    grid-column: 1;
    grid-row: 3;
    align-self: end;
    justify-self: start;
    display: grid;
    gap: 1px;
    padding: 10px 14px;
    border: 1px solid var(--ths-line);
    border-radius: 10px;
    background-color: rgba(10, 14, 23, 0.82);
    font-size: 12.5px;
    line-height: 1.45;
}

.ths-hud-label {
    color: var(--ths-ink-3);
}

.ths-hud-place {
    font-weight: 600;
    color: var(--ths-ink);
}

.ths-hud-coord {
    font-size: 12px;
    color: var(--ths-gold);
}

/* Corridor rail: the engine's corridor device, dressed for the terminal. */
.ths-rail {
    grid-column: 1 / -1;
    grid-row: 4;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(260px, 1fr);
    align-items: center;
    gap: 12px 28px;
    padding: 14px 20px;
    border: 1px solid var(--ths-line);
    border-radius: 14px;
    background-color: var(--ths-o2);
}

.ths-rail .o_thaihao_sc_corridor_track {
    top: 6px;
    background-color: #2A3346;
}

.ths-rail .o_thaihao_sc_corridor_fill {
    background-image: linear-gradient(90deg, var(--ths-gold), var(--ths-cinnabar-hi));
}

.ths-rail .o_thaihao_sc_corridor_node {
    gap: 5px;
    min-height: 48px;
    padding: 0 4px 4px;
    color: var(--ths-ink-3);
    font-size: 13px;
    font-stretch: 88%;
    line-height: 1.3;
}

.ths-rail .o_thaihao_sc_corridor_node:focus-visible {
    outline-color: var(--ths-gold);
}

.ths-rail .o_thaihao_sc_corridor_node.is-sc-stage-active {
    color: var(--ths-ink);
}

.ths-rail .o_thaihao_sc_corridor_dot {
    width: 14px;
    height: 14px;
    margin-bottom: 1px;
    border: 2px solid #3A4459;
    background-color: var(--ths-o);
}

@media (hover: hover) and (pointer: fine) {
    .ths-rail .o_thaihao_sc_corridor_node:hover {
        color: var(--ths-ink-2);
    }

    .ths-rail .o_thaihao_sc_corridor_node:hover .o_thaihao_sc_corridor_dot {
        border-color: var(--ths-gold);
    }
}

.ths-rail .o_thaihao_sc_corridor_node.is-sc-stage-done .o_thaihao_sc_corridor_dot {
    border-color: var(--ths-gold);
    background-color: var(--ths-gold);
}

.ths-rail .o_thaihao_sc_corridor_node.is-sc-stage-active .o_thaihao_sc_corridor_dot {
    border-color: var(--ths-gold);
    background-color: var(--ths-o);
    box-shadow: none;
    outline: 2px solid rgba(216, 166, 77, 0.35);
    outline-offset: 3px;
}

.ths-rail .o_thaihao_sc_corridor_where {
    font-size: 12px;
    color: var(--ths-ink-3);
}

.ths-rail .o_thaihao_sc_corridor_node.is-sc-stage-active .o_thaihao_sc_corridor_where {
    color: var(--ths-gold);
}

.ths-rail .o_thaihao_sc_corridor_readout {
    min-height: 66px;
    margin: 0;
    padding: 2px 0 2px 22px;
    border-radius: 0;
    background-color: transparent;
    background-image: linear-gradient(var(--ths-line), var(--ths-line));
    background-repeat: no-repeat;
    background-size: 1px 100%;
    font-size: 14.5px;
    color: var(--ths-ink-2);
}

.ths-rail .o_thaihao_sc_corridor_readout_step {
    color: var(--ths-gold);
}

/* --------------------------------------------------------------------------
   Workspace sections
   -------------------------------------------------------------------------- */
.ths-section {
    position: relative;
    padding: clamp(72px, 9vw, 128px) 0;
    border-top: 1px solid var(--ths-line);
}

.ths-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 clamp(16px, 4vw, 40px);
}

.ths-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px 32px;
    margin-bottom: clamp(28px, 3.5vw, 44px);
}

.ths-head h2,
.ths-intake-copy h2 {
    margin: 0;
    font-size: clamp(1.65rem, 1.2rem + 1vw, 2.2rem);
    font-weight: 600;
    font-stretch: 84%;
    line-height: 1.12;
    letter-spacing: -0.015em;
    text-wrap: balance;
}

html:lang(zh) .ths-head h2,
html:lang(th) .ths-head h2,
html:lang(zh) .ths-intake-copy h2,
html:lang(th) .ths-intake-copy h2 {
    font-stretch: 100%;
    letter-spacing: 0;
    line-height: 1.3;
}

.ths-head p,
.ths-intake-copy > p {
    max-width: 62ch;
    margin: 12px 0 0;
    color: var(--ths-ink-2);
    text-wrap: pretty;
}

/* transitions.dev 16: tabs sliding (also used as a filter segment) */
.t-tabs {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    max-width: 100%;
    padding: 3px;
    border: 1px solid var(--ths-line);
    border-radius: 12px;
    background-color: var(--tabs-bar-bg);
}

.t-tab {
    position: relative;
    z-index: 1;
    appearance: none;
    min-height: 40px;
    padding: 8px 14px;
    border: 0;
    border-radius: 9px;
    background-color: transparent;
    color: var(--tabs-text-muted);
    font: 600 14px/1.2 var(--ths-sans);
    font-stretch: 88%;
    white-space: nowrap;
    cursor: pointer;
    transition: color var(--tabs-dur) var(--tabs-ease);
}

.t-tab[aria-selected="true"],
.t-tab[aria-pressed="true"] {
    color: var(--tabs-text-active);
}

@media (hover: hover) and (pointer: fine) {
    .t-tab:not([aria-selected="true"]):not([aria-pressed="true"]):hover {
        color: var(--ths-ink);
    }
}

.t-tabs-pill {
    position: absolute;
    top: 3px;
    left: 0;
    z-index: 0;
    width: 0;
    height: calc(100% - 6px);
    border-radius: 9px;
    background-color: var(--tabs-pill-bg);
    transform: translateX(0);
    transition: transform var(--tabs-dur) var(--tabs-ease), width var(--tabs-dur) var(--tabs-ease);
    will-change: transform, width;
    pointer-events: none;
}

.ths-body:not(.ths-tabs-ready) .t-tabs-pill {
    visibility: hidden;
}

.ths-body:not(.ths-tabs-ready) .t-tab[aria-selected="true"],
.ths-body:not(.ths-tabs-ready) .t-tab[aria-pressed="true"] {
    background-color: var(--tabs-pill-bg);
}

/* transitions.dev 34: text swap soft */
.t-text-soft {
    display: inline-grid;
    justify-items: var(--text-soft-align, start);
    transition: width var(--text-soft-resize-dur) var(--text-soft-resize-ease);
}

.t-text-soft > span {
    grid-area: 1 / 1;
    white-space: pre;
    transition: filter var(--text-soft-dur) var(--text-soft-ease), opacity var(--text-soft-dur) var(--text-soft-ease);
}

.t-text-soft-new {
    opacity: 0;
    filter: blur(var(--text-soft-blur));
}

.t-text-soft.is-swapping .t-text-soft-old {
    opacity: 0;
    filter: blur(var(--text-soft-blur));
}

.t-text-soft.is-swapping .t-text-soft-new {
    opacity: 1;
    filter: blur(0);
}

/* --------------------------------------------------------------------------
   Workspace 2: sourcing board
   -------------------------------------------------------------------------- */
.ths-board {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
    align-items: start;
    gap: clamp(24px, 3vw, 48px);
}

.ths-groups {
    display: grid;
    gap: 30px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ths-group[hidden] {
    display: none;
}

.ths-group-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 14px;
    margin-bottom: 6px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--ths-line);
}

.ths-group-h {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    font-stretch: 88%;
    color: var(--ths-gold);
}

.ths-group-note {
    margin: 0;
    font-size: 14px;
    color: var(--ths-ink-3);
}

.ths-rows {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ths-listing {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 16px;
    width: 100%;
    margin: 2px 0;
    padding: 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    background-color: transparent;
    color: inherit;
    font: inherit;
    text-align: start;
    cursor: pointer;
    transition: background-color 150ms var(--ths-ease), border-color 150ms var(--ths-ease);
}

@media (hover: hover) and (pointer: fine) {
    .ths-listing:hover {
        background-color: var(--ths-o2);
    }
}

.ths-listing[aria-pressed="true"] {
    border-color: rgba(216, 166, 77, 0.6);
    background-color: var(--ths-o2);
}

.ths-thumb {
    display: block;
    width: 64px;
    height: 64px;
    overflow: hidden;
    border-radius: 10px;
    background-color: #0D1627;
}

.ths-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 38%;
    transform: scale(2.3);
    transform-origin: 50% 38%;
}

.ths-listing-main {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.ths-listing-name {
    font-size: 15.5px;
    font-weight: 500;
    line-height: 1.35;
    color: var(--ths-ink);
}

.ths-listing-code {
    font-size: 12.5px;
    color: var(--ths-ink-3);
}

.ths-route {
    padding: 5px 11px;
    border: 1px solid rgba(16, 185, 129, 0.38);
    border-radius: 999px;
    font-size: 12.5px;
    line-height: 1.2;
    color: var(--ths-jade-ink);
    white-space: nowrap;
}

.ths-listing-price {
    --text-soft-align: end;
    min-width: 74px;
    font-size: 15px;
    color: var(--ths-ink);
    text-align: end;
}

.ths-detail {
    position: sticky;
    top: calc(var(--ths-chrome-h) + 20px);
    display: grid;
    gap: 18px;
    padding: 16px;
    border: 1px solid var(--ths-line);
    border-radius: 18px;
    background-color: var(--ths-o2);
}

.ths-detail-plate {
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 24px 44px -28px rgba(0, 0, 0, 0.95);
}

.ths-detail-plate img {
    display: block;
    width: 100%;
    height: auto;
}

.ths-detail-body {
    padding: 0 4px 4px;
}

.ths-detail-body h3 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 600;
    font-stretch: 88%;
    line-height: 1.25;
}

.ths-detail-native {
    margin: 4px 0 0;
    font-size: 14.5px;
    color: var(--ths-ink-3);
}

.ths-spec {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 18px;
    margin: 16px 0 0;
}

.ths-spec dt {
    font-size: 12.5px;
    color: var(--ths-ink-3);
}

.ths-spec dd {
    margin: 2px 0 0;
    font-size: 14.5px;
    color: var(--ths-ink);
}

.ths-route-note {
    max-width: 60ch;
    margin: 16px 0 0;
    font-size: 14px;
    color: var(--ths-ink-2);
}

.ths-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.ths-fineprint {
    max-width: 75ch;
    margin: 28px 0 0;
    font-size: 13px;
    color: var(--ths-ink-3);
}

/* --------------------------------------------------------------------------
   Workspace 3 (peak): live studio
   -------------------------------------------------------------------------- */
.ths-studio {
    background-color: #0C111C;
}

.ths-studio-grid {
    display: grid;
    grid-template-columns: 290px minmax(250px, 0.78fr) minmax(0, 1.25fr);
    align-items: start;
    gap: clamp(20px, 2.6vw, 40px);
}

.ths-room-col {
    display: grid;
    gap: 12px;
    justify-items: center;
}

.ths-phone {
    width: 100%;
    max-width: 290px;
    aspect-ratio: 9 / 18.6;
    padding: 9px;
    border: 1px solid #262D3B;
    border-radius: 40px;
    background-color: #04060A;
    box-shadow: 0 32px 60px -32px rgba(0, 0, 0, 0.95);
}

.ths-phone-screen {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border-radius: 31px;
    background-color: #0B0C10;
    color: #FFFFFF;
    transition: background-color 250ms var(--ths-ease), color 250ms var(--ths-ease);
}

.ths-phone[data-platform="xiaohongshu"] .ths-phone-screen {
    background-color: #FFFFFF;
    color: #1E1E1E;
}

.ths-room-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 16px 14px 8px;
}

.ths-room-host {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.12);
    font-size: 13px;
    font-weight: 600;
}

.ths-phone[data-platform="xiaohongshu"] .ths-room-host {
    background-color: #F2F2F2;
}

.ths-room-host img {
    display: block;
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.ths-room-platform {
    font-size: 13px;
    font-weight: 600;
}

.ths-room-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 0 14px 10px;
}

.ths-room-live,
.ths-room-sim,
.ths-room-viewers {
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}

.ths-room-live {
    background-color: #C51D3E;
    color: #FFFFFF;
}

.ths-phone[data-platform="xiaohongshu"] .ths-room-live {
    background-color: #D51F3A;
}

.ths-room-sim {
    background-color: rgba(255, 255, 255, 0.14);
    color: #FFFFFF;
}

.ths-room-viewers {
    background-color: rgba(255, 255, 255, 0.14);
    color: #FFFFFF;
}

.ths-phone[data-platform="xiaohongshu"] .ths-room-sim,
.ths-phone[data-platform="xiaohongshu"] .ths-room-viewers {
    background-color: #F2F2F2;
    color: #333333;
}

.ths-room-stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    margin: 0 10px;
    overflow: hidden;
    border-radius: 18px;
    background-color: #12141B;
}

.ths-room-stage img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 36%;
    transform: scale(2.42);
    transform-origin: 50% 36%;
}

.ths-room-gmv {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin: 10px 14px 0;
    font-size: 13px;
}

.ths-room-gmv strong {
    font-size: 16px;
    color: #FFD27A;
}

.ths-phone[data-platform="xiaohongshu"] .ths-room-gmv strong {
    color: #B5172E;
}

.ths-room-comments {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 126px;
    display: grid;
    justify-items: start;
    gap: 5px;
    margin: 0;
    padding: 0;
    list-style: none;
    pointer-events: none;
}

.ths-room-comments li {
    max-width: 92%;
    padding: 4px 10px;
    border-radius: 12px;
    background-color: rgba(8, 9, 13, 0.62);
    color: #FFFFFF;
    font-size: 12.5px;
    line-height: 1.4;
    animation: ths-comment-in 420ms var(--ths-ease) both;
}

.ths-room-comments b {
    margin-right: 6px;
    font-weight: 600;
    color: #FFD27A;
}

@keyframes ths-comment-in {
    from {
        opacity: 0;
        transform: translateY(8px);
        filter: blur(2px);
    }
}

.ths-room-card {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin: 10px;
    padding: 8px 10px 8px 8px;
    border-radius: 14px;
    background-color: #FFFFFF;
    color: #1E1E1E;
}

.ths-phone[data-platform="xiaohongshu"] .ths-room-card {
    background-color: #F6F6F6;
}

.ths-room-card img {
    display: block;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    object-position: 50% 38%;
}

.ths-room-card-name {
    overflow: hidden;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ths-room-card-price {
    font-size: 15px;
    color: #B5172E;
}

.ths-room-caption {
    max-width: 290px;
    margin: 0;
    font-size: 12.5px;
    text-align: center;
    color: var(--ths-ink-3);
}

.ths-pool[hidden] {
    display: none;
}

.ths-controls {
    display: grid;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--ths-line);
    border-radius: 16px;
    background-color: var(--ths-o2);
}

.ths-controls .ths-panel-h {
    margin-bottom: 0;
}

.ths-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 4px 12px;
}

.ths-control label {
    font-size: 14px;
    color: var(--ths-ink-2);
}

.ths-control output {
    font-size: 14.5px;
    color: var(--ths-ink);
}

.ths-control input[type="range"] {
    grid-column: 1 / -1;
    width: 100%;
    height: 28px;
    margin: 0;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.ths-control input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--ths-gold) var(--fill, 50%), #2A3346 var(--fill, 50%));
}

.ths-control input[type="range"]::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    margin-top: -8px;
    border: 2px solid var(--ths-gold);
    border-radius: 50%;
    background-color: var(--ths-paper);
    -webkit-appearance: none;
    appearance: none;
}

.ths-control input[type="range"]::-moz-range-track {
    height: 4px;
    border-radius: 2px;
    background-color: #2A3346;
}

.ths-control input[type="range"]::-moz-range-progress {
    height: 4px;
    border-radius: 2px;
    background-color: var(--ths-gold);
}

.ths-control input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border: 2px solid var(--ths-gold);
    border-radius: 50%;
    background-color: var(--ths-paper);
}

.ths-control-fixed {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
    padding-top: 12px;
    border-top: 1px solid var(--ths-line);
    font-size: 14px;
    color: var(--ths-ink-2);
}

.ths-control-fixed .ths-mono {
    color: var(--ths-ink);
}

.ths-control-note {
    margin: 0;
    font-size: 12.5px;
    color: var(--ths-ink-3);
}

.ths-viz {
    display: grid;
    gap: 22px;
    min-width: 0;
}

.ths-viz > .ths-panel-h {
    margin-bottom: -10px;
}

.ths-fall {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ths-fall-row {
    display: grid;
    grid-template-columns: minmax(140px, 0.85fr) minmax(0, 1.45fr) minmax(96px, auto);
    align-items: center;
    gap: 14px;
    padding: 6px 0;
}

.ths-fall-label {
    font-size: 14px;
    line-height: 1.3;
    color: var(--ths-ink-2);
}

.ths-fall-label small {
    display: block;
    font-size: 12px;
    color: var(--ths-ink-3);
}

.ths-fall-bar {
    display: block;
    width: 100%;
    height: 14px;
}

.ths-fall-track {
    fill: #1A2131;
}

.ths-fall-fill {
    fill: var(--ths-slate);
}

.ths-fall-row.is-out .ths-fall-fill {
    fill: var(--ths-cinnabar-hi);
}

.ths-fall-row.is-net .ths-fall-fill {
    fill: var(--ths-paper);
}

.ths-fall-row.is-share .ths-fall-fill {
    fill: var(--ths-gold);
}

.ths-fall-row.is-partner .ths-fall-fill {
    fill: var(--ths-jade);
}

.ths-fall-value {
    --text-soft-align: end;
    font-size: 15px;
    color: var(--ths-ink);
    text-align: end;
}

.ths-fall-row.is-out .ths-fall-value {
    color: var(--ths-cinnabar-ink);
}

.ths-fall-row.is-net {
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid var(--ths-line-2);
}

.ths-fall-row.is-net .ths-fall-label,
.ths-fall-row.is-net .ths-fall-value {
    font-weight: 600;
    color: var(--ths-ink);
}

.ths-fall-row.is-loss .ths-fall-value {
    color: var(--ths-cinnabar-ink);
}

.ths-ring {
    display: grid;
    grid-template-columns: 196px minmax(0, 1fr);
    align-items: center;
    gap: 22px;
    margin: 0;
    padding: 18px;
    border: 1px solid var(--ths-line);
    border-radius: 16px;
    background-color: var(--ths-o2);
}

.ths-ring-chart {
    position: relative;
    width: 196px;
    height: 196px;
}

.ths-ring-chart svg {
    display: block;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ths-ring-track {
    fill: none;
    stroke: #1A2131;
    stroke-width: 18;
}

.ths-ring-seg {
    fill: none;
    stroke-width: 18;
}

.ths-ring-seg[data-key="fee"],
.ths-legend [data-key="fee"] i {
    stroke: #C93B3B;
    background-color: #C93B3B;
}

.ths-ring-seg[data-key="kol"],
.ths-legend [data-key="kol"] i {
    stroke: #E07A5F;
    background-color: #E07A5F;
}

.ths-ring-seg[data-key="cost"],
.ths-legend [data-key="cost"] i {
    stroke: #6B7590;
    background-color: #6B7590;
}

.ths-ring-seg[data-key="tpl"],
.ths-legend [data-key="tpl"] i {
    stroke: #9AA3B8;
    background-color: #9AA3B8;
}

.ths-ring-seg[data-key="tax"],
.ths-legend [data-key="tax"] i {
    stroke: #8B1E24;
    background-color: #8B1E24;
}

.ths-ring-seg[data-key="siv"],
.ths-legend [data-key="siv"] i {
    stroke: #D8A64D;
    background-color: #D8A64D;
}

.ths-ring-seg[data-key="jia"],
.ths-legend [data-key="jia"] i {
    stroke: #10B981;
    background-color: #10B981;
}

.ths-ring-center {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 1px;
    text-align: center;
}

.ths-ring-k {
    font-size: 12.5px;
    color: var(--ths-ink-3);
}

.ths-ring-v {
    --text-soft-align: center;
    font-size: 21px;
    color: var(--ths-ink);
}

.ths-ring figcaption {
    min-width: 0;
}

.ths-ring-title {
    display: block;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--ths-ink);
}

.ths-legend {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px 18px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
    font-size: 13.5px;
    color: var(--ths-ink-2);
}

.ths-legend li {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.ths-legend i {
    flex: none;
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

.ths-legend b {
    margin-left: auto;
    font-weight: 500;
    color: var(--ths-ink);
}

.ths-legal-note {
    max-width: 78ch;
    margin: 32px 0 0;
    padding: 14px 18px;
    border: 1px solid var(--ths-line);
    border-radius: 12px;
    font-size: 13.5px;
    color: var(--ths-ink-3);
}

/* --------------------------------------------------------------------------
   Workspace 4: role previews
   -------------------------------------------------------------------------- */
.ths-role-tabs {
    margin-bottom: clamp(24px, 3vw, 36px);
    overflow-x: auto;
    scrollbar-width: none;
}

.ths-role-tabs::-webkit-scrollbar {
    display: none;
}

.ths-role-panel {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-items: center;
    gap: clamp(24px, 3.5vw, 56px);
}

.ths-role-panel:focus-visible {
    outline-offset: 8px;
}

.ths-js .ths-role-panel[data-inactive] {
    display: none;
}

.ths-role-copy h3 {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 600;
    font-stretch: 88%;
    line-height: 1.22;
}

html:lang(zh) .ths-role-copy h3,
html:lang(th) .ths-role-copy h3 {
    font-stretch: 100%;
}

.ths-role-copy p {
    max-width: 52ch;
    margin: 12px 0 0;
    color: var(--ths-ink-2);
}

.ths-role-copy .ths-role-meta {
    margin: 14px 0 20px;
    font-size: 12.5px;
    color: var(--ths-ink-3);
}

.ths-device {
    padding: 18px;
    border-radius: 20px;
    background-color: var(--ths-paper);
    color: var(--ths-paper-ink);
    box-shadow: 0 30px 56px -32px rgba(0, 0, 0, 0.95);
}

.ths-device-phone {
    justify-self: center;
    width: 100%;
    max-width: 340px;
    border: 8px solid #04060A;
    border-radius: 34px;
}

.ths-device-desk::before {
    display: block;
    height: 18px;
    margin: -18px -18px 16px;
    border-radius: 20px 20px 0 0;
    background-color: #E2DCCF;
    content: "";
}

.ths-device-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    margin-bottom: 12px;
    font-size: 15px;
}

.ths-sample {
    padding: 3px 10px;
    border-radius: 999px;
    background-color: #E7E0D1;
    color: var(--ths-paper-ink-2);
    font-size: 12px;
    font-weight: 600;
}

.ths-kpis {
    display: grid;
    margin: 0;
}

.ths-kpis > div {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2px 12px;
    padding: 10px 0;
    border-top: 1px solid var(--ths-paper-line);
}

.ths-kpis-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
    margin-top: 10px;
}

.ths-kpis dt {
    font-size: 13.5px;
    color: var(--ths-paper-ink-2);
}

.ths-kpis dd {
    margin: 0;
    font-size: 15px;
    color: var(--ths-paper-ink);
}

.ths-device-cap {
    margin: 14px 0 6px;
    font-size: 12.5px;
    color: var(--ths-paper-ink-2);
}

.ths-cols,
.ths-hbars {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.ths-cols rect,
.ths-hbars rect {
    fill: var(--ths-cinnabar);
}

.ths-cols text {
    fill: var(--ths-paper-ink-2);
    font: 500 12px var(--ths-mono);
    text-anchor: middle;
}

.ths-hbars text {
    fill: var(--ths-paper-ink-2);
    font: 500 13px var(--ths-sans);
}

.ths-hbars .ths-hv {
    fill: var(--ths-paper-ink);
    font-family: var(--ths-mono);
}

.ths-js .ths-role-panel .ths-cols rect {
    transform-box: fill-box;
    transform-origin: 50% 100%;
    transform: scaleY(0.04);
    transition: transform 620ms var(--ths-ease);
}

.ths-js .ths-role-panel .ths-hbars rect,
.ths-js .ths-role-panel .ths-board-bars rect {
    transform-box: fill-box;
    transform-origin: 0 50%;
    transform: scaleX(0.04);
    transition: transform 620ms var(--ths-ease);
}

.ths-js .ths-role-panel.is-live .ths-cols rect,
.ths-js .ths-role-panel.is-live .ths-hbars rect,
.ths-js .ths-role-panel.is-live .ths-board-bars rect {
    transform: none;
}

.ths-js .ths-role-panel .ths-cols g:nth-child(2) rect,
.ths-js .ths-role-panel .ths-hbars g:nth-child(2) rect {
    transition-delay: 40ms;
}

.ths-js .ths-role-panel .ths-cols g:nth-child(3) rect,
.ths-js .ths-role-panel .ths-hbars g:nth-child(3) rect {
    transition-delay: 80ms;
}

.ths-js .ths-role-panel .ths-cols g:nth-child(4) rect,
.ths-js .ths-role-panel .ths-hbars g:nth-child(4) rect {
    transition-delay: 120ms;
}

.ths-js .ths-role-panel .ths-cols g:nth-child(5) rect {
    transition-delay: 160ms;
}

.ths-js .ths-role-panel .ths-cols g:nth-child(6) rect {
    transition-delay: 200ms;
}

.ths-mini-ring {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 6px 0 4px;
}

.ths-mini-ring svg {
    flex: none;
    width: 92px;
    height: 92px;
    transform: rotate(-90deg);
}

.ths-mini-track {
    fill: none;
    stroke: #E2DCCF;
    stroke-width: 12;
}

.ths-mini-fill {
    fill: none;
    stroke: var(--ths-cinnabar);
    stroke-width: 12;
}

.ths-mini-jade {
    stroke: #0B7A55;
}

.ths-mini-ring b {
    display: block;
    font-size: 21px;
    font-weight: 600;
}

.ths-mini-ring span {
    font-size: 13px;
    color: var(--ths-paper-ink-2);
}

.ths-device-list {
    display: grid;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}

.ths-device-list li {
    padding: 9px 0;
    border-top: 1px solid var(--ths-paper-line);
    font-size: 14px;
}

.ths-device-list .ths-mono {
    margin-right: 8px;
    color: var(--ths-cinnabar);
}

.ths-board-bars {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ths-board-bars li {
    display: grid;
    grid-template-columns: minmax(96px, 0.8fr) minmax(0, 1.2fr) auto;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.ths-board-bars svg {
    display: block;
    width: 100%;
    height: 12px;
}

.ths-board-bars rect {
    fill: var(--ths-paper-ink-2);
}

.ths-board-bars [data-key="siv"] rect {
    fill: #A8771E;
}

.ths-board-bars [data-key="jia"] rect {
    fill: #0B7A55;
}

.ths-board-bars b {
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   Workspace 5 (close): the D7 intake, on rice paper
   -------------------------------------------------------------------------- */
.ths-intake-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
    align-items: start;
    gap: clamp(28px, 4vw, 64px);
}

.ths-steps {
    display: grid;
    gap: 14px;
    margin: 26px 0 0;
    padding: 0;
    list-style: none;
    counter-reset: ths-step;
}

.ths-steps li {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 12px;
    font-size: 15px;
    color: var(--ths-ink-2);
    counter-increment: ths-step;
}

.ths-steps li::before {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(216, 166, 77, 0.5);
    border-radius: 8px;
    font: 500 13px/1 var(--ths-mono);
    color: var(--ths-gold);
    content: counter(ths-step);
}

.ths-sheet {
    padding: clamp(20px, 3vw, 32px);
    border-radius: 18px;
    background-color: var(--ths-paper);
    color: var(--ths-paper-ink);
    box-shadow: 0 32px 60px -36px rgba(0, 0, 0, 0.9);
}

.ths-sheet ::selection {
    background-color: var(--ths-cinnabar);
    color: var(--ths-paper);
}

.ths-sheet :focus-visible {
    outline-color: var(--ths-cinnabar);
}

.ths-alert {
    display: grid;
    gap: 4px;
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 14.5px;
}

.ths-alert-ok {
    border: 1px solid #A7D9C2;
    background-color: #E3F4EC;
    color: #0B4D36;
}

.ths-alert-err {
    border: 1px solid #EDB3AC;
    background-color: #FBE9E7;
    color: #7C1D1D;
}

.ths-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}

.ths-field {
    display: grid;
    gap: 6px;
}

.ths-field-wide {
    grid-column: 1 / -1;
}

.ths-form > .ths-field {
    margin-top: 18px;
}

.ths-field label,
.ths-reasons legend {
    font-size: 14px;
    font-weight: 600;
    color: var(--ths-paper-ink);
}

.ths-sheet input[type="text"],
.ths-sheet input[type="email"],
.ths-sheet textarea {
    width: 100%;
    min-height: 46px;
    padding: 11px 14px;
    border: 1px solid #ADA595;
    border-radius: 10px;
    background-color: var(--ths-paper-field);
    color: var(--ths-paper-ink);
    font: 16px/1.4 var(--ths-sans);
    transition: border-color 150ms var(--ths-ease);
}

.ths-sheet textarea {
    min-height: 96px;
    resize: vertical;
}

.ths-sheet input:focus,
.ths-sheet textarea:focus {
    border-color: var(--ths-cinnabar);
}

.ths-reasons {
    min-width: 0;
    margin: 20px 0 0;
    padding: 0;
    border: 0;
}

.ths-reasons legend {
    margin-bottom: 10px;
    padding: 0;
}

.ths-reason-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.ths-reason {
    position: relative;
    display: block;
    cursor: pointer;
}

.ths-reason input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.ths-reason-body {
    display: grid;
    gap: 4px;
    height: 100%;
    padding: 12px 40px 12px 14px;
    border: 1px solid #C9C1B2;
    border-radius: 12px;
    background-color: var(--ths-paper-field);
    transition: border-color 150ms var(--ths-ease), background-color 150ms var(--ths-ease);
}

@media (hover: hover) and (pointer: fine) {
    .ths-reason:hover .ths-reason-body {
        border-color: #8C8474;
    }
}

.ths-reason input:checked + .ths-reason-body {
    border-color: var(--ths-cinnabar);
    background-color: #FBEFEA;
}

.ths-reason input:focus-visible + .ths-reason-body {
    outline: 2px solid var(--ths-cinnabar);
    outline-offset: 2px;
}

.ths-reason input:checked + .ths-reason-body::after {
    position: absolute;
    top: 14px;
    right: 17px;
    width: 7px;
    height: 13px;
    border: solid var(--ths-cinnabar);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    content: "";
}

.ths-reason-code {
    font-size: 12.5px;
    color: var(--ths-cinnabar);
}

.ths-reason-label {
    font-size: 14px;
    line-height: 1.45;
    color: var(--ths-paper-ink);
}

.ths-link-btn {
    justify-self: start;
    min-height: 44px;
    margin-top: 2px;
    padding: 6px 0;
    border: 0;
    background: none;
    color: var(--ths-cinnabar);
    font: 600 14px/1.3 var(--ths-sans);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.ths-link-btn[hidden] {
    display: none;
}

.ths-submit-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--ths-paper-line);
}

.ths-gate {
    max-width: 46ch;
    margin: 0;
    font-size: 14px;
    color: var(--ths-paper-ink-2);
}

.ths-gate.is-ready {
    color: #0B6B4A;
}

.ths-sheet .ths-btn:disabled {
    background-color: #DDD6C8;
    color: #5F594E;
}

/* --------------------------------------------------------------------------
   Executive footer
   -------------------------------------------------------------------------- */
.ths-footer {
    padding: clamp(56px, 7vw, 88px) 0 calc(28px + var(--ths-dock-h));
    border-top: 1px solid var(--ths-line);
    background-color: #070A11;
    color: var(--ths-ink-2);
    font-size: 14.5px;
}

.ths-foot-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
    gap: 32px 40px;
}

.ths-foot-mark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ths-ink);
    font-size: 17px;
    font-weight: 600;
    font-stretch: 88%;
    text-decoration: none;
}

.ths-foot-mark img {
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 10px;
}

.ths-foot-brand p {
    max-width: 40ch;
    margin: 14px 0 0;
}

.ths-foot-unit {
    display: grid;
    justify-items: start;
    gap: 8px;
    margin-top: 22px;
    font-size: 13px;
    color: var(--ths-ink-3);
}

.ths-foot-unit img {
    display: block;
    width: 196px;
    height: auto;
}

.ths-foot-col h2 {
    margin: 0 0 14px;
    font-size: 14.5px;
    font-weight: 600;
    font-stretch: 88%;
    letter-spacing: 0.01em;
    color: var(--ths-gold);
}

.ths-foot-col ul {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ths-foot-col a {
    color: var(--ths-ink-2);
    text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
    .ths-foot-col a:hover {
        color: var(--ths-ink);
        text-decoration: underline;
    }
}

.ths-foot-facts li {
    line-height: 1.55;
}

.ths-foot-legal {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--ths-line);
    font-size: 13px;
    color: var(--ths-ink-3);
}

.ths-foot-legal p {
    margin: 0;
}

.ths-foot-emblem {
    flex: none;
    width: 28px;
    height: 28px;
}

.ths-dock {
    display: none;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1180px) {
    .ths-facts .ths-fact:nth-child(-n+2) {
        display: none;
    }

    .ths-studio-grid {
        grid-template-columns: 280px minmax(0, 1fr);
    }

    .ths-viz {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1024px) {
    .ths-domain {
        display: none;
    }

    .ths-term-ui {
        grid-template-columns: minmax(280px, 400px) minmax(0, 1fr) minmax(240px, 300px);
    }

    .ths-board {
        grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
    }

    .ths-listing {
        grid-template-columns: 56px minmax(0, 1fr) auto;
    }

    .ths-listing .ths-route {
        display: none;
    }

    .ths-thumb {
        width: 56px;
        height: 56px;
    }

    .ths-foot-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .ths-facts {
        display: none;
    }

    .ths-switches {
        margin-left: auto;
    }

    .ths-term-ui {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr) auto auto;
    }

    .ths-title {
        grid-column: 1 / -1;
        max-width: 520px;
    }

    .ths-term-ui .ths-hud {
        grid-column: 1;
    }

    .ths-telemetry {
        grid-column: 2;
        grid-row: 3;
    }

    .ths-rail {
        grid-template-columns: minmax(0, 1fr);
    }

    .ths-rail .o_thaihao_sc_corridor_readout {
        padding: 10px 0 0;
        background-size: 100% 1px;
    }

    .ths-board {
        grid-template-columns: minmax(0, 1fr);
    }

    .ths-detail {
        position: static;
        order: -1;
        grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
        align-items: start;
    }

    .ths-role-panel,
    .ths-intake-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 760px) {
    .ths-body {
        --ths-dock-h: calc(64px + env(safe-area-inset-bottom, 0px));
    }

    html {
        scroll-padding-top: 72px;
        scroll-padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    }

    .ths-status {
        min-height: 56px;
        padding: 8px 12px;
        gap: 10px;
    }

    .ths-brand-native {
        display: none;
    }

    .ths-seg-btn {
        padding: 8px 10px;
        font-size: 13px;
    }

    .ths-tabs {
        display: none;
    }

    .ths-dock {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 45;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        height: var(--ths-dock-h);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        border-top: 1px solid var(--ths-line);
        background-color: #070A11;
    }

    .ths-dock a {
        display: grid;
        align-content: center;
        justify-items: center;
        gap: 3px;
        min-height: 48px;
        color: var(--ths-ink-3);
        font-size: 12px;
        font-weight: 600;
        text-decoration: none;
    }

    .ths-dock a[aria-current="true"] {
        color: var(--ths-gold);
    }

    .ths-dock .ti::before {
        width: 20px;
        height: 20px;
    }

    /* The corridor terminal on phones keeps the 3D map in view. The stage
       is a size container as tall as the visible viewport (100svh less the
       chrome and the dock). The title card and the readout rail compact
       around a guaranteed open map window in grid row 2, where the map
       focus HUD rides as a small pill, and the cards shed copy before that
       window shrinks (container queries after this block). */
    .ths-term {
        height: 250vh;
    }

    .ths-term .ths-term-stage {
        min-height: 420px;
        container: ths-stage / size;
    }

    .ths-term-canvas canvas[data-sc-canvas3d] {
        --c3d-ox: 0.5;
        --c3d-oy: 0.46;
        --c3d-zoom: 0.14;
    }

    .ths-term .ths-frame {
        inset: 8px;
    }

    .ths-term-ui {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(220px, 1fr) auto auto;
        gap: 8px;
        padding: 10px;
    }

    .ths-title {
        grid-column: 1;
        padding: 10px 12px;
        border-radius: 12px;
        background-color: rgba(12, 18, 31, 0.76);
        -webkit-backdrop-filter: blur(8px);
        backdrop-filter: blur(8px);
    }

    .ths-title-mark {
        float: left;
        width: 30px;
        height: 30px;
        margin: 1px 10px 0 0;
        border-radius: 8px;
    }

    .ths-title h1 {
        font-size: 1.15rem;
        line-height: 1.16;
    }

    .ths-title-sub {
        clear: both;
        margin-top: 6px;
        font-size: 13px;
        line-height: 1.45;
    }

    .ths-title-meta {
        display: none;
    }

    .ths-cta {
        clear: both;
        gap: 8px;
        margin-top: 8px;
    }

    .ths-cta .ths-btn {
        flex: 1 1 auto;
        min-height: 38px;
        padding: 7px 12px;
        border-radius: 9px;
        font-size: 13.5px;
    }

    /* Map focus: a compact pill at the top left of the open map window. */
    .ths-term-ui .ths-hud {
        grid-column: 1;
        grid-row: 2;
        align-self: start;
        justify-self: start;
        display: grid;
        gap: 0;
        max-width: 100%;
        padding: 5px 12px 6px;
        border-radius: 14px;
        background-color: rgba(12, 18, 31, 0.78);
        -webkit-backdrop-filter: blur(6px);
        backdrop-filter: blur(6px);
        font-size: 11.5px;
        line-height: 1.35;
        pointer-events: none;
    }

    .ths-term-ui .ths-hud .ths-hud-label {
        display: none;
    }

    .ths-term-ui .ths-hud .ths-hud-coord {
        font-size: 10.5px;
    }

    .ths-telemetry {
        grid-column: 1;
        grid-row: 3;
        padding: 6px 10px;
        border-radius: 12px;
        background-color: rgba(12, 18, 31, 0.82);
        -webkit-backdrop-filter: blur(8px);
        backdrop-filter: blur(8px);
    }

    .ths-telemetry .ths-panel-h,
    .ths-telemetry .ths-panel-foot,
    .ths-telemetry .ths-tele-split {
        display: none;
    }

    /* One strip of four figures; the rate takes the width it needs. */
    .ths-tele {
        grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
        column-gap: 8px;
    }

    /* Figure over label; the markup keeps the label first for reading. */
    .ths-tele-row {
        display: flex;
        flex-direction: column-reverse;
        justify-content: flex-end;
        gap: 1px;
        padding: 2px 0;
        border-top: 0;
    }

    .ths-tele dt {
        display: -webkit-box;
        overflow: hidden;
        font-size: 11px;
        line-height: 1.25;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .ths-tele dd {
        font-size: 14px;
        line-height: 1.2;
        white-space: nowrap;
    }

    .ths-tele-ledger {
        grid-column: 1 / -1;
    }

    .ths-rail {
        grid-row: 4;
        gap: 4px;
        padding: 8px 10px 9px;
        border-radius: 12px;
        background-color: rgba(12, 18, 31, 0.82);
        -webkit-backdrop-filter: blur(8px);
        backdrop-filter: blur(8px);
    }

    /* The stepper keeps its five dots. Each stage name stays the button's
       accessible name, and the readout below names the current stage. */
    .ths-rail .o_thaihao_sc_corridor_node {
        position: relative;
        min-height: 34px;
        padding: 0 2px;
        font-size: 12px;
    }

    .ths-rail .o_thaihao_sc_corridor_label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .ths-rail .o_thaihao_sc_corridor_where {
        display: none;
    }

    .ths-rail .o_thaihao_sc_corridor_readout {
        min-height: 0;
        padding: 6px 0 0;
        font-size: 12.5px;
        line-height: 1.45;
    }

    .ths-rail .o_thaihao_sc_corridor_readout_line {
        display: -webkit-box;
        overflow: hidden;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    /* Thai vowel and tone marks sit above and below the line: give the
       clamped readout and the figure labels the room to keep them. */
    html:lang(th) .ths-rail .o_thaihao_sc_corridor_readout,
    html:lang(th) .ths-tele dt {
        line-height: 1.6;
    }

    .ths-section {
        padding: 64px 0;
    }

    .ths-pills {
        width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .ths-pills::-webkit-scrollbar {
        display: none;
    }

    .ths-detail {
        grid-template-columns: minmax(0, 1fr);
        padding: 12px;
    }

    .ths-listing {
        grid-template-columns: 52px minmax(0, 1fr) auto;
        gap: 12px;
        padding: 10px;
    }

    .ths-thumb {
        width: 52px;
        height: 52px;
    }

    .ths-spec {
        grid-template-columns: minmax(0, 1fr);
    }

    .ths-studio-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .ths-phone {
        max-width: 270px;
    }

    .ths-fall-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px 12px;
    }

    .ths-fall-bar {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .ths-ring {
        grid-template-columns: minmax(0, 1fr);
        justify-items: center;
    }

    .ths-ring figcaption {
        width: 100%;
    }

    .ths-fields,
    .ths-reason-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .ths-submit-row .ths-btn {
        width: 100%;
    }

    .ths-foot-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .ths-foot-legal {
        align-items: flex-start;
    }
}

/* Shorter phones: sized by the terminal stage itself (the visible viewport
   less the chrome and the dock), the cards shed copy before the open map
   window shrinks. The container only exists under 761px. */
@container ths-stage (max-height: 559px) {
    .ths-title-sub {
        display: none;
    }
}

@container ths-stage (max-height: 499px) {
    .ths-term-ui {
        grid-template-rows: auto minmax(180px, 1fr) auto;
    }

    /* The figures step aside and the rail moves up into their row, so no
       empty row keeps its two gutters. */
    .ths-telemetry {
        display: none;
    }

    .ths-rail {
        grid-row: 3;
        padding: 6px 10px 7px;
    }

    .ths-title {
        padding: 8px 12px;
    }

    .ths-title h1 {
        font-size: 1.05rem;
    }

    .ths-cta {
        margin-top: 6px;
    }

    .ths-rail .o_thaihao_sc_corridor_readout_line {
        -webkit-line-clamp: 1;
    }
}

@media (max-width: 420px) {
    .ths-seg-code {
        display: none;
    }
}

@media (max-width: 380px) {
    .ths-brand-name {
        font-size: 16px;
    }

    .ths-seg-btn {
        padding: 8px 8px;
    }

    .ths-title h1 {
        font-size: 1.32rem;
    }

    .ths-cta .ths-btn-ghost {
        display: none;
    }
}

@media print {
    .ths-chrome,
    .ths-dock,
    .ths-term-canvas {
        display: none;
    }

    .ths-term {
        height: auto;
    }

    .ths-term .ths-term-stage {
        position: static;
        height: auto;
    }

    .ths-term-ui {
        position: static;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .ths-skip,
    .ths-seg-btn,
    .ths-tab,
    .ths-tab::after,
    .ths-btn,
    .ths-listing,
    .ths-phone-screen,
    .ths-reason-body,
    .ths-sheet input,
    .ths-sheet textarea,
    .t-tab,
    .t-tabs-pill {
        transition: none !important;
    }

    .t-text-soft,
    .t-text-soft > span {
        transition: none !important;
    }

    .ths-room-comments li {
        animation: none;
    }

    .ths-js .ths-role-panel .ths-cols rect,
    .ths-js .ths-role-panel .ths-hbars rect,
    .ths-js .ths-role-panel .ths-board-bars rect {
        transform: none;
        transition: none;
    }
}
