/* ============================================================
   PanTek Multiomic Analysis Lab — Public Demo (presentation only)
   模擬展示：本頁不處理或分析實際研究資料。
   Fixed synthetic data. No scientific capability.
   Visual system mirrors the PanTek landing page (dark, teal/cyan).
   ============================================================ */

:root {
    --black: #05090d;
    --bg: #05090d;
    --panel: #0b121a;
    --panel-2: #0e1824;
    --panel-3: #101f2c;
    --line: rgba(255, 255, 255, 0.10);
    --line-2: rgba(255, 255, 255, 0.16);
    --text: #e9eef4;
    --text-2: #9fb2c6;
    --muted: #8da0b5;

    --teal: #0d9488;
    --teal-light: #4fd6cb;
    --cyan: #39c0ff;
    --amber: #f9a03f;
    --violet: #b58cff;
    --green: #7ee081;
    --rose: #ff6b8b;

    /* status */
    --st-good: #4fd6cb;
    --st-warn: #f9a03f;
    --st-review: #b58cff;

    --radius: 10px;
    --radius-lg: 16px;
    --container: 1180px;
    --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
    --shadow-soft: 0 18px 44px rgba(0, 0, 0, 0.32);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    overflow-x: hidden;
    background:
        radial-gradient(1100px 620px at 78% -8%, rgba(57, 192, 255, 0.10), transparent 60%),
        radial-gradient(900px 560px at 8% 4%, rgba(13, 148, 136, 0.12), transparent 58%),
        var(--bg);
    color: var(--text);
    font-family: "Inter", "Noto Sans TC", -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", sans-serif;
    line-height: 1.7;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    cursor: pointer;
}

:focus-visible {
    outline: 3px solid rgba(79, 214, 203, 0.55);
    outline-offset: 3px;
    border-radius: 4px;
}

.mono {
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: 0.05em;
}

.serif {
    font-family: "Cormorant Garamond", "Noto Serif TC", serif;
}

.container {
    width: min(var(--container), calc(100% - 44px));
    margin-inline: auto;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -6rem;
    z-index: 200;
    padding: 0.7rem 1rem;
    border-radius: 6px;
    color: var(--black);
    background: var(--teal-light);
    font-weight: 800;
}

.skip-link:focus {
    top: 1rem;
}

.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;
}

/* ----------------------------------------------------------
   Top navigation
   ---------------------------------------------------------- */
.demo-nav {
    position: sticky;
    top: 0;
    z-index: 90;
    background: rgba(5, 9, 13, 0.86);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
}

.nav-inner {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    font-weight: 900;
    color: #fff;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(140deg, #12b7aa, #0d9488 60%, #0b6b73);
    color: #04120f;
    font-family: "Cormorant Garamond", serif;
    font-size: 1.5rem;
    font-weight: 600;
    box-shadow: 0 10px 22px rgba(13, 148, 136, 0.34);
}

/* Canonical PanTek faceted-P mark (replaces the prototype "P" glyph). */
.brand-logo {
    width: 36px;
    height: 40px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 6px 16px rgba(6, 12, 20, 0.55));
}

.footer-brand .brand-logo {
    width: 30px;
    height: 34px;
}

.brand-copy {
    display: grid;
    line-height: 1.1;
}

.brand-name {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.brand-sub {
    font-size: 0.66rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-family: "JetBrains Mono", monospace;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-back {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    font-family: "JetBrains Mono", monospace;
    padding-block: 0.4rem;
    border-bottom: 1px solid transparent;
    transition: color 160ms ease, border-color 160ms ease;
}

.nav-back:hover {
    color: var(--teal-light);
    border-color: currentColor;
}

/* ----------------------------------------------------------
   Buttons
   ---------------------------------------------------------- */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 46px;
    padding: 0.7rem 1.15rem;
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 800;
    color: #fff;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.button.primary {
    color: #04120f;
    background: linear-gradient(135deg, #5fe4d7, #12b7aa 55%, #0d9488);
    box-shadow: 0 16px 34px rgba(13, 148, 136, 0.32);
}

.button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 42px rgba(13, 148, 136, 0.42);
}

.button.ghost {
    color: #fff;
    border-color: var(--line-2);
    background: rgba(255, 255, 255, 0.05);
}

.button.ghost:hover {
    transform: translateY(-2px);
    border-color: rgba(79, 214, 203, 0.55);
    background: rgba(79, 214, 203, 0.10);
}

.button.small {
    min-height: 40px;
    padding: 0.5rem 0.9rem;
    font-size: 0.85rem;
}

/* ----------------------------------------------------------
   Persistent simulated-data disclaimer banner
   ---------------------------------------------------------- */
.disclaimer-banner {
    position: sticky;
    top: 68px;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    padding: 0.5rem 1rem;
    text-align: center;
    color: #04120f;
    background: linear-gradient(90deg, #4fd6cb, #39c0ff);
    font-weight: 700;
    font-size: 0.82rem;
    line-height: 1.4;
}

.disclaimer-banner .tag {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    background: rgba(5, 9, 13, 0.28);
    color: #04120f;
}

/* ----------------------------------------------------------
   Hero
   ---------------------------------------------------------- */
.demo-hero {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    padding: 5.5rem 0 4rem;
}

.demo-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        linear-gradient(180deg, rgba(5, 9, 13, 0.55), rgba(5, 9, 13, 0.92)),
        url("assets/omics-network-visual.png") center / cover no-repeat;
    opacity: 0.5;
    filter: saturate(0.7) contrast(1.05);
}

.demo-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 62px 62px;
    mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
}

.eyebrow {
    margin: 0 0 1rem;
    color: var(--teal-light);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.eyebrow::before {
    content: "";
    width: 26px;
    height: 1px;
    background: var(--teal-light);
}

.hero-title {
    max-width: 16ch;
    margin: 0 0 1.2rem;
    font-family: "Cormorant Garamond", "Noto Serif TC", serif;
    font-weight: 300;
    font-size: clamp(2.9rem, 6vw, 5.4rem);
    line-height: 1.02;
    color: #fff;
}

.hero-title em {
    font-style: normal;
    color: var(--teal-light);
}

.hero-lead {
    max-width: 60ch;
    margin: 0 0 2rem;
    color: var(--text-2);
    font-family: "Noto Serif TC", serif;
    font-size: clamp(1.02rem, 2vw, 1.28rem);
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.hero-proof {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    max-width: 960px;
    margin-top: 3.2rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.045);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.hero-proof div {
    padding: 1.1rem 1.15rem;
    border-right: 1px solid var(--line);
}

.hero-proof div:last-child {
    border-right: 0;
}

.hero-proof .k {
    display: block;
    color: var(--teal-light);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hero-proof .v {
    display: block;
    margin-top: 0.45rem;
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ----------------------------------------------------------
   Section scaffolding
   ---------------------------------------------------------- */
.section {
    padding: 3.6rem 0;
}

.section-head {
    max-width: 720px;
    margin-bottom: 2rem;
}

.section-kicker {
    margin: 0 0 0.7rem;
    color: var(--teal-light);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.section-title {
    margin: 0 0 0.7rem;
    font-family: "Cormorant Garamond", "Noto Serif TC", serif;
    font-weight: 400;
    font-size: clamp(2rem, 4vw, 3.1rem);
    line-height: 1.08;
    color: #fff;
}

.section-copy {
    margin: 0;
    color: var(--text-2);
    font-size: 1.02rem;
}

/* ----------------------------------------------------------
   Stepper / tab selector
   ---------------------------------------------------------- */
.stepper-wrap {
    position: sticky;
    top: 108px;
    z-index: 60;
    padding: 0.85rem 0;
    background: rgba(5, 9, 13, 0.82);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.stepper {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 1.1rem;
    padding: 0 0.15rem 0.35rem;
    -webkit-overflow-scrolling: touch;
}

.stepper::-webkit-scrollbar {
    height: 6px;
}

.stepper::-webkit-scrollbar-thumb {
    background: var(--line-2);
    border-radius: 999px;
}

.step {
    scroll-snap-align: start;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 44px;
    padding: 0.5rem 0.95rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-2);
    font-weight: 700;
    font-size: 0.82rem;
    white-space: nowrap;
    transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.step:hover {
    color: #fff;
    border-color: rgba(79, 214, 203, 0.45);
    transform: translateY(-1px);
}

.step:focus-visible {
    outline: 2px solid var(--teal-light, #4fd6cb);
    outline-offset: 2px;
}

.step .step-num {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: var(--muted);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.68rem;
    font-weight: 700;
}

.step[aria-selected="true"] {
    color: #04120f;
    background: linear-gradient(135deg, #4fd6cb, #39c0ff);
    border-color: transparent;
    box-shadow: 0 12px 26px rgba(57, 192, 255, 0.28);
}

.step[aria-selected="true"] .step-num {
    background: rgba(5, 9, 13, 0.22);
    color: #04120f;
}

/* ----------------------------------------------------------
   Stage panels
   ---------------------------------------------------------- */
.stage-region {
    padding: 2.6rem 0 3.4rem;
}

.stage-panel {
    animation: stage-in 460ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.stage-panel[hidden] {
    display: none;
}

@keyframes stage-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stage-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stage-index {
    color: var(--teal-light);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin: 0 0 0.4rem;
}

.stage-title {
    margin: 0;
    font-family: "Cormorant Garamond", "Noto Serif TC", serif;
    font-weight: 400;
    font-size: clamp(1.9rem, 3.6vw, 2.7rem);
    line-height: 1.1;
    color: #fff;
}

.stage-desc {
    margin: 0.6rem 0 0;
    max-width: 62ch;
    color: var(--text-2);
    font-size: 0.98rem;
}

/* Panel card + plot frame */
.panel-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)),
        var(--panel);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.panel-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1.15rem;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.02);
}

.panel-toolbar .panel-name {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 800;
    font-size: 0.92rem;
    color: #fff;
}

.panel-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--teal-light);
    box-shadow: 0 0 0 4px rgba(79, 214, 203, 0.18);
}

.replay-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 38px;
    padding: 0.42rem 0.85rem;
    border: 1px solid var(--line-2);
    border-radius: 8px;
    background: rgba(79, 214, 203, 0.08);
    color: var(--teal-light);
    font-weight: 700;
    font-size: 0.8rem;
    transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.replay-btn:hover {
    background: rgba(79, 214, 203, 0.16);
    border-color: rgba(79, 214, 203, 0.5);
    transform: translateY(-1px);
}

.replay-btn svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.plot-frame {
    position: relative;
    padding: 0.6rem 0.6rem 0.2rem;
}

/* Loading / error overlay — a sibling of the plot inside .plot-frame, removed
   on READY. Never injected into the Plotly graph div (which orphaned the
   spinner). */
.plot-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    gap: 0.7rem;
    grid-auto-flow: row;
    padding: 1rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.86rem;
    background: color-mix(in srgb, var(--panel, #0b121a) 78%, transparent);
    backdrop-filter: blur(1.5px);
    border-radius: inherit;
    z-index: 3;
    pointer-events: none;
}

.plot-overlay.is-error {
    color: var(--rose, #ff6b8b);
    background: color-mix(in srgb, var(--panel, #0b121a) 88%, transparent);
}

.plot-overlay .ov-text {
    max-width: 34ch;
    line-height: 1.5;
}

.plot {
    width: 100%;
    min-height: 380px;
}

.plot.tall {
    min-height: 440px;
}

.replaying {
    animation: replay-pop 620ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes replay-pop {
    0% {
        opacity: 0.15;
        transform: scale(0.985);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.panel-caption {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.15rem 0.95rem;
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.5;
    border-top: 1px solid var(--line);
}

.panel-caption .caption-tag {
    flex: 0 0 auto;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--teal-light);
    padding: 0.14rem 0.5rem;
    border: 1px solid rgba(79, 214, 203, 0.4);
    border-radius: 999px;
}

/* ----------------------------------------------------------
   Layout helpers for stages
   ---------------------------------------------------------- */
.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: 1.4rem;
    align-items: start;
}

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

.stack {
    display: grid;
    gap: 1.4rem;
}

/* Metric cards */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.metric-card {
    padding: 1rem 1.05rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.025);
}

.metric-card .m-label {
    color: var(--muted);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.64rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.metric-card .m-value {
    margin: 0.3rem 0 0.1rem;
    font-family: "Cormorant Garamond", serif;
    font-size: 2rem;
    line-height: 1;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.metric-card .m-note {
    color: var(--text-2);
    font-size: 0.76rem;
}

/* Gauge card */
.gauge-card {
    display: grid;
    gap: 0.6rem;
    padding: 1.2rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(120% 90% at 50% -10%, rgba(79, 214, 203, 0.12), transparent 60%),
        var(--panel-2);
    text-align: center;
}

.gauge-plot {
    width: 100%;
    min-height: 190px;
}

.gauge-verdict {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    justify-self: center;
    padding: 0.32rem 0.8rem;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.82rem;
    border: 1px solid transparent;
}

.gauge-verdict[data-verdict="Warning"] {
    color: var(--st-warn);
    background: rgba(249, 160, 63, 0.12);
    border-color: rgba(249, 160, 63, 0.4);
}

.gauge-verdict[data-verdict="Pass"] {
    color: var(--st-good);
    background: rgba(79, 214, 203, 0.12);
    border-color: rgba(79, 214, 203, 0.4);
}

.gauge-verdict[data-verdict="Review"] {
    color: var(--st-review);
    background: rgba(181, 140, 255, 0.14);
    border-color: rgba(181, 140, 255, 0.4);
}

.gauge-verdict .vdot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.gauge-note {
    margin: 0;
    color: var(--muted);
    font-size: 0.74rem;
}

/* ----------------------------------------------------------
   Mock upload / mapping visual (non-interactive, demo only)
   ---------------------------------------------------------- */
.mock-drop {
    position: relative;
    display: grid;
    place-items: center;
    gap: 0.7rem;
    min-height: 240px;
    padding: 1.6rem;
    text-align: center;
    border: 2px dashed rgba(79, 214, 203, 0.4);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(90% 80% at 50% 0%, rgba(57, 192, 255, 0.08), transparent 60%),
        rgba(255, 255, 255, 0.02);
    color: var(--text-2);
    cursor: not-allowed;
}

.mock-drop .drop-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(79, 214, 203, 0.12);
    color: var(--teal-light);
}

.mock-drop .drop-icon svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mock-drop .drop-title {
    font-weight: 800;
    color: #fff;
    font-size: 1rem;
}

.mock-drop .drop-sub {
    max-width: 40ch;
    font-size: 0.84rem;
}

.mock-drop .drop-lock {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    background: rgba(5, 9, 13, 0.5);
    border: 1px solid var(--line-2);
    color: var(--muted);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.64rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.map-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}

.map-table caption {
    text-align: left;
    color: var(--muted);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding-bottom: 0.6rem;
}

.map-table th,
.map-table td {
    text-align: left;
    padding: 0.6rem 0.7rem;
    border-bottom: 1px solid var(--line);
}

.map-table th {
    color: var(--muted);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 700;
}

.map-table td.col-name {
    font-family: "JetBrains Mono", monospace;
    color: var(--text);
}

.map-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.18rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    border: 1px solid var(--line-2);
}

.map-pill[data-role="sample"] {
    color: var(--cyan);
    background: rgba(57, 192, 255, 0.1);
    border-color: rgba(57, 192, 255, 0.35);
}

.map-pill[data-role="control"] {
    color: var(--teal-light);
    background: rgba(79, 214, 203, 0.1);
    border-color: rgba(79, 214, 203, 0.35);
}

.map-pill[data-role="treated"] {
    color: var(--violet);
    background: rgba(181, 140, 255, 0.1);
    border-color: rgba(181, 140, 255, 0.35);
}

.map-pill[data-role="id"] {
    color: var(--amber);
    background: rgba(249, 160, 63, 0.1);
    border-color: rgba(249, 160, 63, 0.35);
}

/* Workflow rail overview (shown on the mapping stage) */
.rail {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.2rem;
}

.rail-node {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-2);
    font-size: 0.76rem;
    font-weight: 700;
}

.rail-node .rn {
    font-family: "JetBrains Mono", monospace;
    color: var(--teal-light);
    font-size: 0.66rem;
}

.rail-arrow {
    align-self: center;
    color: var(--muted);
}

/* ----------------------------------------------------------
   Legend chips (accessibility: identity never color-alone)
   ---------------------------------------------------------- */
.legend-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
    padding: 0 1.15rem 0.4rem;
}

.legend-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text-2);
    font-size: 0.78rem;
    font-weight: 600;
}

.legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
}

/* ----------------------------------------------------------
   Data table (differential abundance)
   ---------------------------------------------------------- */
.table-scroll {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.data-table {
    width: 100%;
    min-width: 460px;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table caption {
    text-align: left;
    padding: 0.7rem 0.9rem;
    color: var(--muted);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--line);
}

.data-table th,
.data-table td {
    padding: 0.55rem 0.9rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
    font-variant-numeric: tabular-nums;
}

.data-table thead th {
    color: var(--muted);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.64rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.02);
}

.data-table tbody tr:hover {
    background: rgba(79, 214, 203, 0.05);
}

.dir-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.12rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.dir-pill[data-dir="Up"] {
    color: var(--rose);
    background: rgba(255, 107, 139, 0.12);
}

.dir-pill[data-dir="Down"] {
    color: var(--cyan);
    background: rgba(57, 192, 255, 0.12);
}

.dir-pill .arrow {
    font-size: 0.8rem;
}

/* ----------------------------------------------------------
   Report preview card
   ---------------------------------------------------------- */
.report-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 1.4rem;
    align-items: start;
}

/* Restrained light "report-paper" surface — the ONLY light region in the
   otherwise dark, immersive Demo (Owner ruling D/7E). The document-like report
   preview reads as printed research paper; the conversion CTAs beside it stay
   dark. Deliberately not a wholesale white conversion. */
.report-doc {
    padding: 1.7rem 1.7rem 1.4rem;
    border: 1px solid #e4e8f0;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #ffffff, #f5f8fc);
    color: #1b2430;
    box-shadow: 0 22px 46px rgba(3, 8, 16, 0.42), inset 0 1px 0 #ffffff;
}

.report-doc .doc-eyebrow {
    color: #0e7c86;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.64rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.report-doc h4 {
    margin: 0.5rem 0 0.2rem;
    font-family: "Cormorant Garamond", "Noto Serif TC", serif;
    font-weight: 600;
    font-size: 1.7rem;
    color: #0b1f3a;
}

.report-doc .doc-meta {
    color: #5a6b7d;
    font-size: 0.76rem;
    margin: 0 0 1rem;
}

/* dark-on-paper overrides for content that is otherwise styled for the dark UI */
.report-doc .dl-title {
    color: #1b2430;
}

.report-doc .dl-title .n {
    color: #0e7c86;
}

.report-doc .skeleton {
    background: linear-gradient(90deg, #dbe1ea, #eef1f7);
}

.report-doc .panel-caption {
    color: #5a6b7d;
}

.report-doc .caption-tag {
    background: rgba(14, 124, 134, 0.12);
    color: #0b6169;
    border-color: rgba(14, 124, 134, 0.32);
}

.doc-lines {
    display: grid;
    gap: 0.85rem;
    margin-top: 1rem;
}

.doc-line {
    display: grid;
    gap: 0.35rem;
}

.doc-line .dl-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
    font-weight: 700;
    font-size: 0.86rem;
}

.doc-line .dl-title .n {
    font-family: "JetBrains Mono", monospace;
    color: var(--teal-light);
    font-size: 0.72rem;
}

.skeleton {
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05));
}

.skeleton.w-90 {
    width: 90%;
}

.skeleton.w-70 {
    width: 70%;
}

.skeleton.w-50 {
    width: 50%;
}

.report-side {
    display: grid;
    gap: 1rem;
}

.report-cta {
    padding: 1.3rem;
    border: 1px solid rgba(79, 214, 203, 0.35);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(120% 90% at 100% 0%, rgba(57, 192, 255, 0.12), transparent 55%),
        var(--panel-3);
}

.report-cta h4 {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    color: #fff;
}

.report-cta p {
    margin: 0 0 1rem;
    color: var(--text-2);
    font-size: 0.86rem;
}

.report-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.55rem;
}

.report-list li {
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
    color: var(--text-2);
    font-size: 0.84rem;
}

.report-list li .chk {
    flex: 0 0 auto;
    color: var(--teal-light);
    font-weight: 900;
}

/* ----------------------------------------------------------
   Login CTA band
   ---------------------------------------------------------- */
.login-band {
    position: relative;
    overflow: hidden;
    margin: 1rem 0 0;
    padding: 3.6rem 0;
    isolation: isolate;
}

.login-band::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(80% 120% at 0% 0%, rgba(13, 148, 136, 0.28), transparent 55%),
        radial-gradient(80% 120% at 100% 100%, rgba(57, 192, 255, 0.24), transparent 55%),
        #07131d;
}

.login-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 2rem;
    align-items: center;
    padding: 2.2rem;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-lg);
    background: rgba(5, 9, 13, 0.42);
    backdrop-filter: blur(8px);
}

.login-inner h2 {
    margin: 0.5rem 0 0.6rem;
    font-family: "Cormorant Garamond", "Noto Serif TC", serif;
    font-weight: 400;
    font-size: clamp(1.9rem, 4vw, 2.9rem);
    line-height: 1.08;
    color: #fff;
}

.login-inner p {
    margin: 0;
    color: var(--text-2);
    font-size: 1rem;
}

.login-actions {
    display: grid;
    gap: 0.8rem;
}

.login-actions .button {
    width: 100%;
}

.login-fineprint {
    margin: 0.4rem 0 0;
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.5;
}

/* ----------------------------------------------------------
   Footer
   ---------------------------------------------------------- */
.demo-footer {
    padding: 3rem 0 2.4rem;
    border-top: 1px solid var(--line);
    color: var(--text-2);
    background: #04080c;
}

.footer-top {
    display: flex;
    flex-wrap: wrap;
    gap: 1.4rem;
    justify-content: space-between;
    align-items: flex-start;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: #fff;
    font-weight: 800;
}

.footer-note {
    max-width: 46ch;
    padding: 1rem 1.15rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.02);
    font-size: 0.82rem;
    line-height: 1.55;
}

.footer-note strong {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--teal-light);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-family: "JetBrains Mono", monospace;
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: space-between;
    margin-top: 1.8rem;
    padding-top: 1.4rem;
    border-top: 1px solid var(--line);
    font-size: 0.78rem;
    color: var(--muted);
}

/* ----------------------------------------------------------
   Loading / error states
   ---------------------------------------------------------- */
.plot-status {
    display: grid;
    place-items: center;
    min-height: 200px;
    color: var(--muted);
    font-size: 0.86rem;
    text-align: center;
    padding: 1rem;
}

.plot-status .spinner,
.plot-overlay .spinner {
    width: 26px;
    height: 26px;
    margin-bottom: 0.7rem;
    border: 3px solid rgba(79, 214, 203, 0.25);
    border-top-color: var(--teal-light);
    border-radius: 50%;
    animation: spin 900ms linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ----------------------------------------------------------
   Responsive
   ---------------------------------------------------------- */
@media (max-width: 940px) {
    .split,
    .split.even,
    .report-grid,
    .login-inner {
        grid-template-columns: 1fr;
    }

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

    .hero-proof div:nth-child(2n) {
        border-right: 0;
    }

    .hero-proof div:nth-child(-n + 2) {
        border-bottom: 1px solid var(--line);
    }

    .stepper-wrap {
        top: 104px;
    }
}

@media (max-width: 620px) {
    .container {
        width: min(100% - 28px, var(--container));
    }

    .brand-sub {
        display: none;
    }

    .metric-grid {
        grid-template-columns: 1fr;
    }

    .hero-proof {
        grid-template-columns: 1fr;
    }

    .hero-proof div {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .hero-proof div:last-child {
        border-bottom: 0;
    }

    .disclaimer-banner {
        font-size: 0.74rem;
    }

    .stepper-wrap {
        top: 100px;
    }

    .hero-actions .button {
        width: 100%;
    }

    /* Declutter the mobile header: the brand logo already links Home, so the
       redundant "回官網 / Home" text link is hidden below 620px. Keeps the
       brand + Pilot Login cleanly aligned without wrapping. */
    .nav-back {
        display: none;
    }

    .nav-actions {
        gap: 0.5rem;
    }

    .button.small {
        font-size: 0.8rem;
    }
}

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

    *,
    *::before,
    *::after {
        animation-duration: 1ms !important;
        transition-duration: 1ms !important;
    }
}
