/* ============================================================
   FINANCIAL STATEMENT ANALYZER — DESIGN SYSTEM
   Warm paper-like aesthetic
   ============================================================ */

/* ── Design Tokens ── */
:root {
    --bg-page: #faf6f1;
    --bg-card: #ffffff;
    --bg-card-alt: #fdf9f5;
    --bg-subtle: #f3ece3;
    --border-light: #e8ddd0;
    --border-lighter: #f0e9df;
    --text-primary: #2c2420;
    --text-secondary: #5c4f42;
    --text-dim: #8b7355;
    --text-muted: #b5a48e;
    --accent-orange: #c2703e;
    --accent-orange-light: #fef0e4;
    --accent-green: #5a8f6a;
    --accent-green-light: #e8f5ec;
    --accent-blue: #4a7fad;
    --accent-blue-light: #e4f0f9;
    --accent-red: #b84a3c;
    --accent-red-light: #fbe8e6;
    --accent-purple: #7b6198;
    --accent-purple-light: #f0ebf5;
    --accent-amber: #a67c3d;
    --accent-amber-light: #fef6e4;
    --font-display: 'Playfair Display', 'Songti SC', 'STSong', serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --font-cn: 'PingFang SC', 'Microsoft YaHei', 'Heiti SC', sans-serif;
    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --shadow-card: 0 1px 3px rgba(44,36,32,0.04), 0 4px 16px rgba(44,36,32,0.05);
    --shadow-card-hover: 0 2px 8px rgba(44,36,32,0.06), 0 8px 28px rgba(44,36,32,0.08);
    --shadow-tooltip: 0 8px 30px rgba(44,36,32,0.12), 0 2px 8px rgba(44,36,32,0.08);
}

/* ── Reset & Base ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Focus Visible ── */
:focus-visible {
    outline: 2px solid var(--accent-orange);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Override default outline for mouse users only */
:focus:not(:focus-visible) {
    outline: none;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

/* Lock the page horizontally — body can never scroll left/right.
   Wide financial tables keep their own overflow-x:auto scroll containers. */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-page);
    /* Subtle warm noise texture */
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Page Wrapper ── */
.page-wrapper {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    color: var(--text-primary);
    line-height: 1.2;
    font-weight: 700;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 900; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }
h4 { font-size: 1.1rem; }

p {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

a {
    color: var(--accent-orange);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover { color: var(--accent-amber); }

.cn, [lang="zh"], .cn * {
    font-family: var(--font-cn);
}

.en-title {
    font-family: var(--font-display);
    font-size: 0.65em;
    font-weight: 500;
    color: var(--text-dim);
    display: block;
    margin-top: 0.15em;
}

/* ── Tag / badge above headings ── */
.tag {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-orange);
    background: var(--accent-orange-light);
    border: 1px solid rgba(194,112,62,0.2);
    border-radius: 100px;
    padding: 4px 14px;
    margin-bottom: 18px;
}

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-lighter);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.25s var(--ease-out-expo), transform 0.25s var(--ease-out-expo);
}

.card:hover {
    box-shadow: var(--shadow-card-hover);
}

.card-alt {
    background: var(--bg-card-alt);
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1;
    min-height: 44px;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-light);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s var(--ease-out-expo);
    white-space: nowrap;
    user-select: none;
    text-decoration: none;
}

.btn:hover {
    background: var(--bg-subtle);
    border-color: var(--border-light);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--accent-orange);
    border-color: var(--accent-orange);
    color: #fff;
    box-shadow: 0 2px 10px rgba(194,112,62,0.3);
}

.btn-primary:hover {
    background: #b0622f;
    border-color: #b0622f;
    color: #fff;
    box-shadow: 0 4px 18px rgba(194,112,62,0.38);
}

.btn-sm {
    font-size: 0.78rem;
    padding: 6px 14px;
    border-radius: var(--radius-xs);
}

/* ── Homepage Header ── */
.home-header {
    text-align: center;
    padding: 80px 20px 40px;
}

.home-header h1 {
    margin-bottom: 18px;
}

.subtitle {
    font-size: 1rem;
    color: var(--text-dim);
    line-height: 1.7;
    max-width: 500px;
    margin: 0 auto 8px;
}

/* ── Search Box ── */
.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 520px;
    margin: 0 auto 10px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius);
    padding: 8px 8px 8px 20px;
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.2s, border-color 0.2s;
}

.search-box:focus-within {
    border-color: var(--accent-orange);
    box-shadow: 0 0 0 3px rgba(194,112,62,0.12), var(--shadow-card);
}

.search-typeahead {
    position: relative;
    flex: 1;
}

#ticker-input {
    flex: 1;
    width: 100%;
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-primary);
    background: transparent;
    border: none;
    outline: none;
    letter-spacing: 0.03em;
}

#ticker-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.92rem;
}

.search-dropdown {
    top: calc(100% + 10px);
}

.search-picker-hint,
.cta-picker-hint {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-cn);
  transition: color 200ms;
}

.search-picker-hint {
  max-width: 520px;
  margin: 0 auto 48px;
  padding: 0 8px;
}

.search-picker-hint.is-error,
.cta-picker-hint.is-error { color: var(--accent-red); }

.search-box .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.search-box .btn:disabled:hover {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
  color: #fff;
  box-shadow: none;
}

/* ── Loading ── */
.loading-container {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-dim);
    font-size: 0.9rem;
}

.spinner {
    width: 38px;
    height: 38px;
    border: 3px solid var(--border-light);
    border-top-color: var(--accent-orange);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 0.75s linear infinite;
}

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

/* ── Error Card ── */
.error-card {
    background: var(--accent-red-light);
    border: 1.5px solid rgba(184,74,60,0.2);
    border-radius: var(--radius);
    padding: 20px 24px;
    max-width: 520px;
    margin: 0 auto 24px;
    text-align: center;
}

.error-card p {
    color: var(--accent-red);
    font-weight: 500;
    margin-bottom: 14px;
}

/* ── Health Indicators ── */
.health-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.health-green  { color: var(--accent-green); }
.health-yellow { color: var(--accent-amber); }
.health-red    { color: var(--accent-red);   }

.health-green  .health-dot { background: var(--accent-green);  }
.health-yellow .health-dot { background: var(--accent-amber);  }
.health-red    .health-dot { background: var(--accent-red);    }

/* standalone dots */
.health-dot.green  { background: var(--accent-green);  }
.health-dot.yellow { background: var(--accent-amber);  }
.health-dot.red    { background: var(--accent-red);    }

/* ── Metric Cards ── */
.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-lighter);
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.25s var(--ease-out-expo), transform 0.25s var(--ease-out-expo);
    position: relative;
    overflow: hidden;
}

.metric-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

.metric-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.metric-header .label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
}

.metric-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 8px;
}

.metric-explain {
    font-size: 0.82rem;
    color: var(--text-dim);
    line-height: 1.5;
    border-top: 1px solid var(--border-lighter);
    padding-top: 10px;
    margin-top: 10px;
}

/* ── Statement Tables ── */
.statement-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.statement-table th {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    padding: 10px 16px;
    text-align: right;
    border-bottom: 1.5px solid var(--border-light);
    background: var(--bg-card-alt);
}

.statement-table th:first-child { text-align: left; }

.statement-table td {
    padding: 9px 16px;
    text-align: right;
    border-bottom: 1px solid var(--border-lighter);
    transition: background 0.15s;
}

.statement-table td:first-child {
    text-align: left;
    color: var(--text-primary);
    font-weight: 500;
}

.statement-table tr:hover td {
    background: var(--bg-card-alt);
}

.statement-table .subtotal-row td {
    font-weight: 700;
    color: var(--text-primary);
    border-top: 1.5px solid var(--border-light);
    border-bottom: 1.5px solid var(--border-light);
    background: var(--bg-subtle);
}

.statement-table .total-row td {
    font-weight: 700;
    color: var(--text-primary);
    border-top: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    background: var(--bg-subtle);
    font-size: 0.92rem;
}

.statement-table .indent-1 td:first-child { padding-left: 32px; }
.statement-table .indent-2 td:first-child { padding-left: 48px; }

/* ── Year Columns ── */
.year-col { transition: opacity 0.2s; }
.year-col.active-year {
    background: var(--accent-orange-light);
    font-weight: 600;
    color: var(--accent-orange) !important;
}
.year-col.dimmed { opacity: 0.5; }

/* ── Formula Row ── */
.formula-row {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 12px 18px;
    background: var(--bg-subtle);
    border-radius: var(--radius-xs);
    margin-bottom: 16px;
    text-align: center;
    letter-spacing: 0.02em;
}

/* ── Badges (statement info row) ── */
.badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 100px;
    border: 1px solid transparent;
}

.badge-orange  { background: var(--accent-orange-light);  color: var(--accent-orange);  border-color: rgba(194,112,62,0.2);  }
.badge-green   { background: var(--accent-green-light);   color: var(--accent-green);   border-color: rgba(90,143,106,0.2);  }
.badge-blue    { background: var(--accent-blue-light);    color: var(--accent-blue);    border-color: rgba(74,127,173,0.2);  }
.badge-red     { background: var(--accent-red-light);     color: var(--accent-red);     border-color: rgba(184,74,60,0.2);   }
.badge-purple  { background: var(--accent-purple-light);  color: var(--accent-purple);  border-color: rgba(123,97,152,0.2);  }
.badge-amber   { background: var(--accent-amber-light);   color: var(--accent-amber);   border-color: rgba(166,124,61,0.2);  }
.badge-neutral { background: var(--bg-subtle);            color: var(--text-dim);       border-color: var(--border-light);   }

/* ── Anomaly Badge ── */
.anomaly-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 100px;
    background: var(--accent-red-light);
    color: var(--accent-red);
    border: 1px solid rgba(184,74,60,0.25);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ── Tooltip Panel ── */
.tooltip-panel {
    position: absolute;
    z-index: 200;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    box-shadow: var(--shadow-tooltip);
    max-width: 300px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.6;
    pointer-events: none;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.2s var(--ease-out-expo), transform 0.2s var(--ease-out-expo);
}

.tooltip-panel.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.tooltip-panel strong {
    display: block;
    font-size: 0.88rem;
    color: var(--text-primary);
    margin-bottom: 6px;
}

/* ── Balance Sheet 2-Column Grid (Assets | Liabilities+Equity) ── */
.bs-grid-lr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

.bs-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-lighter);
    cursor: pointer;
}

.bs-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bs-total {
    font-weight: 700;
    border-top: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    background: var(--bg-subtle);
    padding: 8px 6px;
    margin-top: 4px;
}

@media (max-width: 900px) {
    .bs-grid-lr { grid-template-columns: 1fr; }
}

/* ── Cash Flow Sections ── */
.cf-section {
    margin-bottom: 28px;
}

.cf-section-header {
    font-family: var(--font-display);
    font-size: 0.88rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    padding: 8px 16px;
    background: var(--bg-subtle);
    border-radius: var(--radius-xs);
    margin-bottom: 4px;
    border-left: 3px solid var(--accent-orange);
}

/* ── Details Table (in tooltips) ── */
.tp-details {
    margin: 8px 0;
    font-size: 0.85rem;
}
.tp-details strong {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
}
.tp-details-table {
    width: 100%;
    border-collapse: collapse;
}
.tp-details-table td {
    padding: 3px 8px;
    border-bottom: 1px solid var(--border-lighter);
}
.tp-details-table td:first-child {
    color: var(--text-secondary);
}
.tp-details-val {
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ── Pie Chart ── */
.pie-chart-container {
    margin-top: 24px;
    padding: 16px;
    background: var(--bg-card-alt);
    border: 1px solid var(--border-lighter);
    border-radius: var(--radius-sm);
}
.pie-legend {
    min-width: 180px;
}

/* ── FCF Highlight Row ── */
.highlight-row td {
    background: var(--accent-orange-light) !important;
    color: var(--accent-orange) !important;
    font-weight: 700 !important;
    border-top: 1.5px solid rgba(194,112,62,0.25) !important;
    border-bottom: 1.5px solid rgba(194,112,62,0.25) !important;
}

/* ── Sparkline ── */
.sparkline {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 28px;
    vertical-align: middle;
}

.sparkline-bar {
    width: 4px;
    border-radius: 2px;
    background: var(--accent-orange);
    opacity: 0.7;
    transition: opacity 0.2s;
}

.sparkline:hover .sparkline-bar { opacity: 1; }

/* ── Skeleton / Loading Shimmer ── */
.skeleton-card {
    background: var(--bg-card);
    border: 1px solid var(--border-lighter);
    border-radius: var(--radius);
    padding: 28px;
    overflow: hidden;
}

.skeleton-line {
    height: 14px;
    border-radius: 7px;
    background: linear-gradient(90deg,
        var(--bg-subtle) 25%,
        var(--border-lighter) 50%,
        var(--bg-subtle) 75%
    );
    background-size: 400% 100%;
    margin-bottom: 12px;
}

.skeleton-card.shimmer .skeleton-line {
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0%   { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* ── Animations ── */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Scroll animation classes */
.fade-in-ready {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.55s var(--ease-out-expo), transform 0.55s var(--ease-out-expo);
}

.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* ── Utility ── */
.hidden { display: none !important; }

.text-right  { text-align: right; }
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.text-dim    { color: var(--text-dim); }
.text-green  { color: var(--accent-green); }
.text-red    { color: var(--accent-red); }
.text-orange { color: var(--accent-orange); }

.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* ── Disclaimer ── */
.metrics-disclaimer {
    font-size: 0.76rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 24px;
    padding: 12px 20px;
    border-top: 1px solid var(--border-lighter);
    line-height: 1.7;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Margin Connector ── */
.margin-connector {
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
    margin: 8px 0;
}

.margin-connector::before {
    content: '';
    flex: 1;
    height: 0;
    border-top: 1.5px dashed var(--border-light);
}

.margin-connector-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-subtle);
    border: 1.5px solid var(--border-light);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-dim);
    flex-shrink: 0;
    margin: 0 8px;
}

.margin-connector::after {
    content: '';
    flex: 1;
    height: 0;
    border-top: 1.5px dashed var(--border-light);
}

/* ── Debt Ratio Cell ── */
.ratio-cell {
    cursor: pointer;
    position: relative;
    user-select: none;
    transition: color 0.15s;
}

.ratio-cell:hover {
    color: var(--accent-orange);
    text-decoration: underline dotted;
}

.ratio-cell::after {
    content: ' ⓘ';
    font-size: 0.7em;
    opacity: 0.5;
}

/* ── Metric Thresholds Popup ── */
.metric-thresholds {
    position: absolute;
    z-index: 300;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    box-shadow: var(--shadow-tooltip);
    min-width: 180px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.8;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px) scale(0.98);
    transition: opacity 0.18s var(--ease-out-expo), transform 0.18s var(--ease-out-expo);
}

.metric-thresholds.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.metric-thresholds .thresh-title {
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-primary);
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-lighter);
}

.metric-thresholds .thresh-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Report Layout ── */
.report-header {
    padding: 48px 0 32px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 40px;
}

.report-header .company-name {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 900;
}

.report-header .ticker-tag {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-orange);
    background: var(--accent-orange-light);
    border: 1px solid rgba(194,112,62,0.2);
    border-radius: var(--radius-xs);
    padding: 4px 12px;
    display: inline-block;
    margin-bottom: 14px;
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1.5px solid var(--border-light);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

/* ── Tab Navigation ── */
.tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 0;
    margin-top: 24px;
}

.tab-btn {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dim);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 14px 24px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    margin-bottom: -2px;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--accent-orange);
    border-bottom-color: var(--accent-orange);
}

.tab-panels {
    background: var(--bg-card);
    border: 1px solid var(--border-lighter);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 28px;
    box-shadow: var(--shadow-card);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* ── Report Type Badge ── */
.report-type-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-blue);
    background: var(--accent-blue-light);
    border: 1px solid rgba(74,127,173,0.2);
    border-radius: 100px;
    padding: 4px 14px;
    margin-bottom: 16px;
}

/* ── Inline Tooltip ── */
.tooltip-inline {
    background: var(--bg-card-alt);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xs);
    padding: 12px 16px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-top: 4px;
}

.tp-formula {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--accent-orange);
    margin-bottom: 8px;
    padding: 6px 10px;
    background: var(--accent-orange-light);
    border-radius: var(--radius-xs);
}

.tp-explain {
    margin-bottom: 6px;
}

.tp-analogy {
    margin-top: 2px;
}

/* ── Metrics Section (in tabs) ── */
.metrics-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1.5px solid var(--border-light);
}

.metrics-section h3 {
    font-size: 1rem;
    margin-bottom: 16px;
    color: var(--text-dim);
}

/* ── View Toggle (Annual/Quarterly) ── */
.view-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
    width: fit-content;
}

.toggle-btn {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dim);
    background: var(--bg-card);
    border: none;
    padding: 8px 18px;
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-btn:not(:last-child) {
    border-right: 1px solid var(--border-light);
}

.toggle-btn.active {
    background: var(--accent-orange);
    color: white;
}

.toggle-btn:hover:not(.active) {
    background: var(--bg-card-alt);
}

/* ── Supplemental Section ── */
.supplemental-section {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px dashed var(--border-light);
}

.supplemental-header {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 12px;
}

.supplemental-table {
    opacity: 0.9;
}

.supplemental-row td {
    color: var(--text-secondary);
    font-style: italic;
}

.supplemental-row td:first-child {
    padding-left: 12px;
    border-left: 3px solid var(--accent-orange-light);
}

/* ── Health Checks ── */
.health-checks-section {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px dashed var(--border-light);
}

.health-checks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
}

.health-check-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--radius-xs);
    font-size: 0.82rem;
    background: var(--bg-card-alt);
    border: 1px solid var(--border-lighter);
}

.health-check-card.health-green { border-left: 3px solid var(--accent-green); }
.health-check-card.health-yellow { border-left: 3px solid var(--accent-orange); }
.health-check-card.health-red { border-left: 3px solid var(--accent-red); }

.hc-dot { font-size: 0.9rem; flex-shrink: 0; }
.hc-name { font-weight: 500; }
.hc-detail { margin-left: auto; font-weight: 600; color: var(--text-dim); white-space: nowrap; }

/* ── Verdict Card ── */
.verdict-card {
    margin-top: 28px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    border-left-width: 4px;
    padding: 20px 24px;
    background: var(--bg-card);
}
.verdict-card.tone-positive { border-left-color: var(--accent-green); background: var(--accent-green-light); }
.verdict-card.tone-negative { border-left-color: var(--accent-red); background: var(--accent-red-light); }
.verdict-card.tone-neutral  { border-left-color: var(--accent-orange); background: var(--accent-orange-light); }
.verdict-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 10px;
    background: rgba(0,0,0,0.07);
}
.verdict-headline {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.55;
    margin: 0 0 8px;
}
.verdict-summary {
    font-size: 0.84rem;
    line-height: 1.65;
    color: var(--text-dim);
    margin: 0;
}

/* ── Danger Signals ── */
.danger-signals-section {
    margin-top: 16px;
}
.danger-signals-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 8px;
}
.danger-signals-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.danger-signal-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-radius: var(--radius-xs);
    font-size: 0.82rem;
    border: 1px solid var(--border-lighter);
    border-left-width: 3px;
}
.danger-signal-item.severity-critical { border-left-color: var(--accent-red); background: var(--bg-card); }
.danger-signal-item.severity-warning  { border-left-color: var(--accent-orange); background: var(--bg-card); }
.ds-icon { flex-shrink: 0; font-size: 0.9rem; }
.ds-label { font-weight: 600; flex: 1; }
.ds-detail { font-size: 0.78rem; color: var(--text-dim); white-space: nowrap; font-family: monospace; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .page-wrapper {
        padding: 0 16px;
    }

    .home-header {
        padding: 52px 12px 32px;
    }

    .search-box {
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        gap: 8px;
    }

    #ticker-input {
        font-size: 1rem;
        text-align: center;
    }

    .search-picker-hint {
        margin-bottom: 40px;
        text-align: center;
    }

    .btn-primary {
        width: 100%;
        justify-content: center;
        padding: 12px;
    }

    .card {
        padding: 18px;
    }

    .metric-value {
        font-size: 1.6rem;
    }

    .statement-table {
        font-size: 0.78rem;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .bs-grid,
    .bs-grid-lr {
        grid-template-columns: 1fr;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .badge-row {
        gap: 6px;
    }

    .report-header {
        padding: 28px 0 20px;
    }

    h1 { font-size: 1.9rem; }
    h2 { font-size: 1.3rem; }
}

@media (max-width: 400px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }
}

.hero-pillars {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.hero-pillars span {
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
}

.home-panel {
    margin: 0 auto 28px;
    padding: 28px;
    background: linear-gradient(135deg, rgba(255,255,255,0.92), rgba(253,249,245,0.9));
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}

.home-panel-search {
    margin-bottom: 56px;
}

.home-panel-copy {
    max-width: 680px;
    margin-bottom: 20px;
}

.section-kicker {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--accent-blue);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.academy-search-box {
    margin: 0;
    max-width: 640px;
}

.case-study-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.case-study-card {
    color: inherit;
    text-decoration: none;
    display: block;
    min-height: 260px;
}

.case-study-card:hover {
    transform: translateY(-3px);
}

.case-study-card h3 {
    margin-bottom: 10px;
}

.case-study-top,
.case-study-meta,
.case-study-numbers {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.case-study-top {
    margin-bottom: 16px;
}

.case-study-ticker,
.case-study-badge {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.case-study-ticker {
    color: var(--text-primary);
}

.case-study-badge {
    color: var(--accent-orange);
}

.case-study-hook {
    min-height: 60px;
    margin-bottom: 18px;
}

.case-study-meta {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-bottom: 18px;
}

.case-study-numbers {
    align-items: stretch;
}

.case-study-number {
    flex: 1;
    padding: 10px 12px;
    border-radius: var(--radius-xs);
    background: var(--bg-card-alt);
    border: 1px solid var(--border-lighter);
}

.case-study-number span {
    display: block;
    font-size: 0.72rem;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.case-study-number strong {
    font-size: 1rem;
    color: var(--text-primary);
}

.case-study-placeholder {
    min-height: 260px;
}

.shimmer-shell {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-subtle) 50%, var(--bg-card) 75%);
    background-size: 300% 100%;
    animation: shimmer 1.8s ease-in-out infinite;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 26px 0 16px;
    color: var(--text-dim);
    font-size: 0.88rem;
    font-weight: 600;
}

.company-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 18px;
}

.company-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    color: var(--text-dim);
}


.summary-hero {
    margin-bottom: 24px;
    background:
        radial-gradient(circle at top right, rgba(194,112,62,0.18), transparent 34%),
        linear-gradient(145deg, #fffaf5, #ffffff);
}

.summary-hero-main {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.8fr);
    gap: 24px;
    margin-bottom: 20px;
}

.summary-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent-orange);
    background: var(--accent-orange-light);
    margin-bottom: 14px;
}

.summary-copy h2 {
    margin-bottom: 12px;
}

.summary-hook {
    margin-top: 12px;
    color: var(--text-primary);
    font-weight: 600;
}

.summary-key-numbers {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.summary-metric {
    padding: 14px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.72);
    border: 1px solid var(--border-lighter);
}

.summary-metric span {
    display: block;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.summary-metric strong {
    font-size: 1.2rem;
    color: var(--text-primary);
}

.summary-takeaways {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.summary-takeaway {
    padding: 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-lighter);
    background: rgba(255,255,255,0.82);
}

.summary-takeaway-label {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 0.78rem;
    font-weight: 700;
}

.summary-takeaway p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.tone-positive {
    border-color: rgba(90,143,106,0.28);
}

.tone-neutral {
    border-color: rgba(166,124,61,0.22);
}

.tone-negative {
    border-color: rgba(184,74,60,0.28);
}

@media (max-width: 900px) {
    .case-study-grid,
    .summary-takeaways,
    .summary-key-numbers,
    .summary-hero-main {
        grid-template-columns: 1fr;
    }

    .company-header {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .home-panel {
        padding: 20px;
    }

    .case-study-grid {
        grid-template-columns: 1fr;
    }

    .minimal-home {
        padding: 56px 0 40px;
    }

    .compact-home-header {
        padding-bottom: 20px;
    }

    .company-buttons {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }

    .company-btn {
        width: 100%;
        padding: 0.9rem 1rem;
    }

    .launch-note {
        padding: 0 10px;
        line-height: 1.5;
    }

    .site-footer {
        margin: 48px auto 24px;
        padding: 20px 16px 28px;
        font-size: 11.5px;
        line-height: 1.65;
    }

    .site-footer .source {
        line-height: 1.8;
    }

    .cta-card {
        margin-top: 32px;
        padding: 16px 16px 18px;
    }

    .cta-card.is-expanded {
        padding: 18px 16px 18px;
    }

    .cta-prompt {
        font-size: 14px;
        line-height: 1.45;
    }

    .cta-form-title {
        margin-bottom: 14px;
    }

    .cta-field label {
        flex-wrap: wrap;
        gap: 4px 8px;
        line-height: 1.4;
    }
}

.minimal-home {
    max-width: 680px;
    margin: 0 auto;
    padding: 88px 0 56px;
}

.compact-home-header {
    padding: 0 0 24px;
}

.compact-home-header h1 {
    margin-bottom: 14px;
}

.minimal-search-box {
    max-width: none;
    margin: 0 auto 14px;
}

.company-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.2rem;
}
.launch-note {
    margin-top: 0.7rem;
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-dim);
    font-family: var(--font-cn);
}
.company-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.8rem 1.6rem;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
    min-width: 140px;
}
.company-btn:hover {
    border-color: var(--accent-primary, #6c5ce7);
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.12);
}
.company-btn-ticker {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.04em;
}
.company-btn-name {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-top: 0.2rem;
}

.summary-focus {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--border-lighter);
}

.summary-focus h3 {
    font-size: 0.98rem;
    margin-bottom: 12px;
}

.summary-focus-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.summary-focus-item {
    padding: 14px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.78);
    border: 1px solid var(--border-lighter);
}

.summary-focus-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 8px;
}

.summary-focus-head span {
    font-size: 0.76rem;
    color: var(--text-dim);
}

.summary-focus-head strong {
    font-size: 1rem;
    color: var(--text-primary);
    white-space: nowrap;
}

.summary-focus-item p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

@media (max-width: 900px) {
    .summary-focus-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .minimal-home {
        padding: 56px 0 40px;
    }
}

.educational-report-shell {
    max-width: 1440px;
}

.education-report {
    padding: 0 0 2rem;
}

/* ── Education compact header ── */
.edu-header {
    padding: 0.75rem 0 1.1rem;
    margin-bottom: 1.1rem;
    border-bottom: 1px solid var(--border-lighter);
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.edu-header-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.edu-back-link,
.edu-switch-link {
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    transition: opacity 0.15s;
}

.edu-back-link {
    color: var(--text-dim);
}
.edu-back-link:hover { color: var(--text-primary); }

.edu-switch-link {
    color: var(--accent-orange);
}
.edu-switch-link:hover { opacity: 0.75; }

.edu-header-identity {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.edu-header-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.edu-company-name {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 2.5vw, 1.75rem);
    font-weight: 900;
    line-height: 1.1;
    color: var(--text-primary);
}

.edu-header-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    color: var(--text-dim);
    font-size: 0.82rem;
}

.edu-dot {
    color: var(--border-light);
    user-select: none;
}

.education-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(0.9rem, 1.8vw, 1.3rem);
    align-items: start;
}

.education-column {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.education-column-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.12rem;
    padding: 0.9rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    text-align: center;
}

.education-column-header.income {
    background: var(--accent-orange-light);
    color: var(--accent-orange);
}

.education-column-header.balance {
    background: var(--accent-green-light);
    color: var(--accent-green);
}

.education-column-header.cashflow {
    background: var(--accent-blue-light);
    color: var(--accent-blue);
}

.education-column-en {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 900;
}

.education-column-zh {
    font-family: var(--font-cn);
    font-size: 0.86rem;
    font-weight: 700;
}

.education-column-tag {
    font-size: 0.72rem;
    opacity: 0.75;
}

.education-statement-box {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 0.85rem;
    box-shadow: var(--shadow-card);
}

.education-line-wrap + .education-line-wrap {
    margin-top: 0.5rem;
}

.education-line-item {
    width: 100%;
    border: 0;
    background: transparent;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.9rem;
    padding: 0.72rem 0.8rem;
    border-radius: var(--radius-sm);
    border-bottom: 1px solid var(--border-lighter);
    text-align: left;
    cursor: pointer;
    transition: background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.education-line-item:hover {
    background: rgba(194, 112, 62, 0.04);
    transform: translateX(2px);
}

.education-line-item[aria-expanded="true"] {
    background: rgba(194, 112, 62, 0.08);
    box-shadow: inset 0 0 0 1px rgba(194, 112, 62, 0.08);
}

.education-line-item.is-key {
    background: var(--accent-amber-light);
    border-left: 3px solid var(--accent-amber);
}

.education-line-copy {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}

.education-line-en {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text-primary);
}

.education-line-zh {
    font-family: var(--font-cn);
    font-size: 0.82rem;
    color: var(--text-dim);
}

.education-line-value {
    flex-shrink: 0;
    font-weight: 800;
    color: var(--text-primary);
    padding-top: 0.1rem;
}

.education-line-explainer {
    margin-top: 0.35rem;
    margin-bottom: 0.25rem;
    padding: 0.9rem 0.95rem;
    border-radius: var(--radius-sm);
    background: var(--bg-card-alt);
    border: 1px solid var(--border-lighter);
}

.education-line-explainer p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.65;
}

@media (max-width: 1100px) {
    .education-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .edu-company-name {
        font-size: 1.2rem;
    }

    .education-line-item {
        flex-direction: column;
    }

    .education-line-value {
        padding-top: 0;
    }
}

.education-column-header {
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.education-column-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(44, 36, 32, 0.08);
}

.education-column-tag {
    opacity: 0.82;
}

.education-column-hint {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
    margin-top: 0.35rem;
    font-size: 0.72rem;
}

.education-stmt-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.08rem;
    padding-bottom: 0.7rem;
    margin-bottom: 0.7rem;
    border-bottom: 1px solid var(--border-lighter);
}

.education-stmt-en {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text-secondary);
}

.education-stmt-zh {
    font-family: var(--font-cn);
    font-size: 0.82rem;
    color: var(--text-muted);
}

.education-stack {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.education-line-item {
    align-items: center;
}

.education-line-prefix {
    width: 18px;
    flex-shrink: 0;
    font-weight: 700;
    color: var(--text-muted);
    text-align: center;
}

.education-line-item.is-negative .education-line-prefix {
    color: var(--accent-red);
}

.education-line-item.is-result {
    background: rgba(90, 143, 106, 0.08);
}

.education-line-plus {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-subtle);
    color: var(--text-muted);
    font-size: 0.78rem;
    flex-shrink: 0;
}

.education-margin-connector {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.25rem 0.4rem;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.education-margin-connector .connector-line {
    flex: 1;
    border-top: 2px dashed var(--accent-purple);
    opacity: 0.45;
}

.education-margin-connector .connector-dot {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid var(--accent-purple);
    background: var(--accent-purple-light);
    color: var(--accent-purple);
    font-weight: 700;
}

.education-margin-connector .connector-label {
    font-size: 0.72rem;
    color: var(--accent-purple);
    font-weight: 700;
}

.education-bs-formula {
    text-align: center;
    padding: 0.65rem 0.8rem;
    margin-bottom: 0.9rem;
    border-radius: var(--radius-xs);
    background: var(--bg-subtle);
    color: var(--text-secondary);
    font-weight: 700;
}

.education-bs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

.education-bs-subtable {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.education-bs-subtable th {
    text-align: center;
    padding: 0.55rem;
    border-radius: var(--radius-xs);
    background: var(--bg-subtle);
    color: var(--text-secondary);
}

.education-bs-subtable th span {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.education-bs-subtable td {
    padding-top: 0.45rem;
}

.education-bs-item {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.08rem;
    padding: 0.55rem 0.6rem;
    border: 0;
    background: transparent;
    border-bottom: 1px solid var(--border-lighter);
    border-radius: var(--radius-xs);
    cursor: pointer;
}

.education-bs-item:hover {
    background: rgba(194, 112, 62, 0.04);
}

.education-bs-item.is-result {
    background: var(--accent-amber-light);
    border-left: 3px solid var(--accent-amber);
}

.education-bs-en {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text-primary);
}

.education-bs-zh {
    font-family: var(--font-cn);
    font-size: 0.8rem;
    color: var(--text-dim);
}

.education-ratio-card {
    width: 100%;
    margin-top: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-lighter);
    background: var(--accent-purple-light);
    color: var(--accent-purple);
    cursor: pointer;
}

.education-ratio-card strong {
    font-size: 1.1rem;
}

.education-cf-section + .education-cf-section {
    margin-top: 1rem;
}

.education-cf-header {
    margin-bottom: 0.45rem;
    color: var(--accent-blue);
    font-weight: 700;
}

.education-cf-header span {
    color: var(--text-dim);
    font-weight: 600;
}

.education-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(44, 36, 32, 0.18);
    backdrop-filter: blur(3px);
    z-index: 999;
}

.education-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(480px, 92vw);
    max-height: 84vh;
    overflow-y: auto;
    background: #fffdf9;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-tooltip);
    padding: 1.2rem 1.2rem 1.1rem;
    z-index: 1000;
}

.education-modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: var(--bg-subtle);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.education-modal-title-en {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.education-modal-title-zh {
    font-family: var(--font-cn);
    color: var(--text-muted);
    margin-bottom: 0.9rem;
}

.education-modal-formula {
    margin-bottom: 0.85rem;
    padding: 0.55rem 0.7rem;
    border-radius: var(--radius-xs);
    background: var(--bg-subtle);
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-weight: 700;
}

.education-modal-copy {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.7;
}

@media (max-width: 900px) {
    .education-bs-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .spinner {
        animation: none;
        border-color: var(--accent-orange);
        border-top-color: var(--border-light);
    }
}

/* ── Site Footer ── */
.site-footer {
  max-width: 880px;
  margin: 64px auto 32px;
  padding: 24px;
  text-align: center;
  font-family: var(--font-cn);
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-lighter);
}
.site-footer .disclaimer {
  color: var(--text-dim);
  margin-bottom: 6px;
}
.site-footer .disclaimer .en {
  display: block;
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.site-footer .source a {
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px dotted var(--text-muted);
}
.site-footer .source a:hover {
  color: var(--accent-orange);
}

/* ── App nav / Founding conversion ── */
.app-top-nav,
.founding-nav {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.app-top-nav a,
.founding-nav a,
.founding-brand {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 700;
}

.founding-nav nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.founding-pill {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 1px solid rgba(194,112,62,0.28);
  border-radius: 999px;
  background: var(--accent-orange-light);
  color: var(--accent-orange);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

/* round-3: the top-bar Founding identity badge was removed. For a Founding
 * member the slot simply goes blank (founding-badge.js empties it); the
 * Founding identity now lives only in the auth chip + /account page. */

/* round-6 (FOUC fix): the upgrade pill's slot ships `hidden` by default so a
 * Founding user never sees even a one-frame flash of the "升级" pill. The slot
 * is revealed only once we KNOW the visitor is non-Founding / logged-out
 * (founding-badge.js after /api/account/me, or the <head> pre-paint script
 * from a cached localStorage hint).
 *
 * The slot carries an inline `display:inline-flex` (for layout-shift-free
 * async reveal). A bare `[hidden] { display:none }` UA rule loses to that
 * inline declaration — exactly the round-5 trap where `[hidden]` was beaten by
 * an author `display` rule. So this rule is `!important`: the `hidden`
 * attribute means "unconditionally not rendered" and MUST win over the inline
 * display. (HTML-spec-recommended reset semantics.) */
[data-founding-slot][hidden] {
  display: none !important;
}

.founding-brand { gap: 10px; font-family: var(--font-display); font-size: 1.25rem; }
.founding-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: inline-grid;
  place-items: center;
  background: var(--text-primary);
  color: var(--accent-orange);
  font-family: var(--font-cn);
  font-weight: 900;
}

.founding-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

.founding-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 42px;
  align-items: center;
  padding: 56px 0 48px;
}

.founding-kicker {
  margin: 0 0 12px;
  color: var(--accent-orange);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.founding-hero h1 {
  max-width: 760px;
  font-size: clamp(2.4rem, 7vw, 5rem);
  margin-bottom: 18px;
}

.founding-lede {
  max-width: 700px;
  font-size: 1.08rem;
  color: var(--text-secondary);
}

.founding-lede span,
.founding-list span {
  display: block;
  color: var(--text-dim);
  font-size: 0.92em;
}

.founding-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.founding-login-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-weight: 800;
  color: var(--text-primary);
}

.founding-price {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 28px;
  box-shadow: var(--shadow-card);
}

.founding-price-label {
  color: var(--text-dim);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.founding-price-num {
  margin: 12px 0 8px;
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1;
}

.founding-price-num span {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-dim);
}

.founding-small {
  margin: 12px 0 0;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.founding-section,
.founding-bottom {
  border-top: 1px solid var(--border-light);
  padding: 42px 0;
}

.founding-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.founding-section-head h2,
.founding-bottom h2 { margin: 0; }

.founding-section-head h2 span {
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
}

.founding-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  list-style: none;
}

.founding-list li {
  background: var(--bg-card);
  border: 1px solid var(--border-lighter);
  border-radius: 8px;
  padding: 18px;
  color: var(--text-primary);
  font-weight: 700;
}

.founding-roadmap { counter-reset: roadmap; }
.founding-roadmap li::before {
  counter-increment: roadmap;
  content: counter(roadmap, decimal-leading-zero);
  display: block;
  margin-bottom: 8px;
  color: var(--accent-orange);
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

.founding-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.conversion-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(44, 36, 32, 0.38);
}

.conversion-modal {
  width: min(420px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow-tooltip);
}

.conversion-modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.conversion-modal h2 {
  font-family: var(--font-body);
  font-size: 1.2rem;
  margin: 0 0 8px;
}

.conversion-modal p { margin: 0 0 18px; }

.conversion-modal-close {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 1.2rem;
}

.conversion-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.free-preview-banner {
  max-width: 1180px;
  margin: 18px auto 0;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #fff8ed;
  border: 1px solid #ead0a6;
  border-radius: 8px;
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
  font-size: 0.94rem;
  font-weight: 600;
}

.free-preview-banner span {
  min-width: 0;
}

.free-preview-banner__sample {
  color: #a8642a;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.free-preview-banner__sample:hover {
  color: #8a4e1f;
}

.free-preview-banner__dismiss {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1.15rem;
}

.free-preview-banner__dismiss:hover {
  background: rgba(194, 112, 62, 0.12);
  color: var(--text-primary);
}

.narrative-upgrade-card {
  max-width: 1180px;
  margin: 18px auto 0;
  padding: 22px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: linear-gradient(135deg, #fff8ed 0%, #fdeed0 100%);
  border: 1px solid #d8a86a;
  border-radius: 12px;
  box-shadow: var(--shadow-card);
}

.narrative-upgrade-card__body {
  flex: 1 1 auto;
  min-width: 0;
}

.narrative-upgrade-card__eyebrow {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #a8642a;
  margin-bottom: 6px;
}

.narrative-upgrade-card__title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 6px;
}

.narrative-upgrade-card__copy {
  font-size: 0.94rem;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.55;
}

.narrative-upgrade-card__sample {
  display: inline-block;
  margin-top: 10px;
  color: #a8642a;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.narrative-upgrade-card__sample:hover {
  color: #8a4e1f;
}

.narrative-upgrade-card__cta {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.narrative-upgrade-card__btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  background: var(--text-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.96rem;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(168, 100, 42, 0.25);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.narrative-upgrade-card__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(168, 100, 42, 0.35);
}

.narrative-upgrade-card__hint {
  font-size: 0.78rem;
  color: var(--text-dim);
}

@media (max-width: 768px) {
  .narrative-upgrade-card {
    flex-direction: column;
    align-items: stretch;
    padding: 18px 18px;
    gap: 14px;
  }
  .narrative-upgrade-card__cta {
    align-items: stretch;
  }
  .narrative-upgrade-card__btn {
    justify-content: center;
  }
}

/* ── Earnings Deep Dive — redesign v2 (ADR-0009 chip + mode switcher) ────────
 * Replaces the top-of-page big card with:
 *   1. .dd-chip        — compact strip announcing a new deep dive
 *   2. .report-mode-switcher — Financial Report | 📊 Deep Dive toggle
 *   3. .dd-panel       — full reading panel (hidden in report mode)
 * ─────────────────────────────────────────────────────────────────────────── */

/* ── Compact chip ── */
.dd-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 12px;
  background: var(--accent-orange-light, #fef0e4);
  border-left: 3px solid var(--accent-orange, #c2703e);
  border-radius: 0 var(--radius-xs, 6px) var(--radius-xs, 6px) 0;
  margin: 16px 0 0;
  width: fit-content;
  max-width: 100%;
}
.dd-chip__text {
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.dd-chip__cta {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-orange, #c2703e);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
  flex-shrink: 0;
}
.dd-chip__cta:hover { color: #a35a2b; }

/* ── Mode switcher ── */
.report-mode-switcher {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 2px solid var(--border-light);
  margin-top: 20px;
}
.report-mode-btn {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-dim);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 12px 22px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  margin-bottom: -2px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.report-mode-btn:hover:not(:disabled) { color: var(--text-primary); }
.report-mode-btn.active {
  color: var(--accent-orange, #c2703e);
  border-bottom-color: var(--accent-orange, #c2703e);
}
.report-mode-btn:disabled {
  cursor: default;
  opacity: 0.45;
}
.report-mode-btn__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-orange, #c2703e);
  flex-shrink: 0;
}

/* ── Deep Dive reading panel ── */
.dd-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-lighter);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
}
.dd-panel[hidden] { display: none; }
.dd-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-lighter);
  flex-wrap: wrap;
  /* Center the reading column inside the full-width card (matches
     .dd-panel__content / __footer so the whole stack aligns). */
  max-width: 768px;
  margin-inline: auto;
  width: 100%;
  box-sizing: border-box;
}
.dd-panel__eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-orange, #c2703e);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dd-panel__sample {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8a6a2a;
  background: #f3e2c2;
  border-radius: 999px;
  padding: 1px 7px;
}
.dd-panel__title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px;
  line-height: 1.25;
}
.dd-panel__period {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.dd-panel__all {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.dd-panel__all:hover { color: var(--accent-orange, #c2703e); text-decoration: underline; }
.dd-panel__content {
  padding: 24px 28px;
  max-width: 768px;
  margin-inline: auto;
  width: 100%;
  box-sizing: border-box;
}
.dd-panel__teaser {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin: 0 0 16px;
}
/* Key figures (money, %, bps, multiples) pulled out of the flat summary
   prose — darker + bolder so the eye lands on the numbers. */
.dd-panel__teaser .dd-figure {
  color: var(--text-primary);
  font-weight: 600;
}
.dd-panel__body {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.8;
}
.dd-panel__body h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 26px 0 10px;
  padding-top: 18px;
  border-top: 1px solid var(--border-lighter);
}
/* First heading sits right under the disclaimer — no divider above it. */
.dd-panel__body > h3:first-of-type {
  margin-top: 8px;
  padding-top: 0;
  border-top: none;
}
.dd-panel__body h4 {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 16px 0 6px;
}
.dd-panel__body p { margin: 0 0 12px; }
.dd-panel__body ul { margin: 0 0 14px; padding-left: 20px; }
.dd-panel__body li { margin: 0 0 6px; }
.dd-panel__body ul ul { margin: 6px 0 4px; }
.dd-panel__body strong { color: var(--text-primary); font-weight: 600; }

/* Data tables — mirror .statement-table so financial figures read as a
   structured grid, not a wall of floating columns. */
.dd-panel__body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  margin: 6px 0 18px;
  display: block;
  overflow-x: auto;
}
.dd-panel__body thead th {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-align: right;
  padding: 9px 12px;
  background: var(--bg-card-alt);
  border-bottom: 1.5px solid var(--border-light);
  white-space: nowrap;
}
.dd-panel__body th:first-child,
.dd-panel__body td:first-child {
  text-align: left;
  color: var(--text-primary);
  font-weight: 500;
}
.dd-panel__body td {
  padding: 8px 12px;
  text-align: right;
  border-bottom: 1px solid var(--border-lighter);
  vertical-align: top;
  white-space: nowrap;
}
.dd-panel__body tbody tr:nth-child(even) td { background: var(--bg-card-alt); }
.dd-panel__body tbody tr:hover td { background: var(--accent-orange-light); }

/* Disclaimer red-line top & bottom — render as fine print, not body copy. */
.dd-panel__body > p:first-child,
.dd-panel__body > p:last-child {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.dd-panel__body > p:first-child {
  margin-bottom: 4px;
  padding-bottom: 12px;
}
/* Locked state: blurred body + overlay CTA */
.dd-panel__locked {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-top: 4px;
}
.dd-panel__locked-body {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.8;
  filter: blur(4px);
  pointer-events: none;
  user-select: none;
}
.dd-panel__lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.15);
}
.dd-panel__lock-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(255,255,255,0.95);
  border-radius: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-orange, #c2703e);
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.dd-panel__lock-btn:hover {
  background: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.14);
}
.dd-panel__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-top: 1px solid var(--border-lighter);
  flex-wrap: wrap;
  gap: 8px;
  max-width: 768px;
  margin-inline: auto;
  width: 100%;
  box-sizing: border-box;
}
.dd-panel__back {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text-dim);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.dd-panel__back:hover { color: var(--accent-orange, #c2703e); }
.dd-panel__all-link {
  font-size: 0.82rem;
  color: var(--text-dim);
  text-decoration: none;
}
.dd-panel__all-link:hover { color: var(--accent-orange, #c2703e); text-decoration: underline; }
@media (max-width: 768px) {
  .dd-panel__content { padding: 18px; }
  .dd-panel__header { padding: 16px 18px 12px; }
  .dd-panel__footer { padding: 12px 18px; }
  .report-mode-btn { font-size: 0.82rem; padding: 10px 14px; }
}

/* ADR-0008: PREMIUM skeleton grid + EXCLUSIVE empty-state.
 * Greyscale placeholders, CTA-less (Q9 — single banner converts).        */
.section-gating-grid { max-width: 1180px; margin: 20px auto 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.locked-card { display: flex; flex-direction: column; gap: 10px; padding: 18px; background: var(--bg-card, #fff); border: 1px dashed var(--border-light, #d6d6d6); border-radius: 12px; min-height: 140px; box-shadow: var(--shadow-card); }
.locked-card__skeleton { flex: 1 1 auto; display: grid; place-items: center; min-height: 70px; background: linear-gradient(135deg, #f5f5f7 0%, #ececef 100%); border-radius: 8px; overflow: hidden; }
.locked-card__meta { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--text-dim, #6b6b73); }
.locked-card__lock { font-size: 0.95rem; }
.locked-card__caption { font-weight: 600; }

.locked-skel { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.locked-skel--pie { width: 56px; height: 56px; border-radius: 999px; background: conic-gradient(#cfcfd4 0 35%, #b9b9c1 35% 60%, #a8a8b0 60% 80%, #d6d6dc 80% 100%); position: relative; }
.locked-skel--pie::after { content: ''; position: absolute; inset: 14px; border-radius: 999px; background: #f5f5f7; }
.locked-skel--spark { width: 80%; height: 40px; align-items: flex-end; }
.locked-skel--spark span { flex: 1; background: #c5c5cc; border-radius: 2px 2px 0 0; }
.locked-skel--spark span:nth-child(1) { height: 35%; } .locked-skel--spark span:nth-child(2) { height: 55%; }
.locked-skel--spark span:nth-child(3) { height: 45%; } .locked-skel--spark span:nth-child(4) { height: 75%; }
.locked-skel--spark span:nth-child(5) { height: 65%; }
.locked-skel--rows, .locked-skel--metrics, .locked-skel--bridge { flex-direction: column; width: 80%; gap: 6px; }
.locked-skel--rows span, .locked-skel--metrics span, .locked-skel--bridge span { height: 10px; background: #cfcfd4; border-radius: 4px; }
.locked-skel--rows span:nth-child(2) { width: 80%; } .locked-skel--rows span:nth-child(3) { width: 60%; }
.locked-skel--metrics span:nth-child(odd) { width: 70%; } .locked-skel--metrics span:nth-child(even) { width: 90%; }
.locked-skel--bridge span:nth-child(1), .locked-skel--bridge span:nth-child(3) { width: 55%; }
.locked-skel--bridge span:nth-child(2) { width: 75%; align-self: center; }
.locked-skel--bridge span:nth-child(3) { align-self: flex-end; }
.locked-skel--health { gap: 10px; }
.locked-skel--health span { width: 24px; height: 24px; display: grid; place-items: center; background: #cfcfd4; border-radius: 999px; color: #6b6b73; font-weight: 700; }

/* ADR-0008: PREMIUM blur overlay (replaces skeleton cards for free users) */
.premium-blurred {
  filter: blur(5px);
  -webkit-filter: blur(5px);
  pointer-events: none;
  user-select: none;
}
.premium-blur-container {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}
.premium-blur-container .paid-checks-grid {
  margin-top: 0;
}
.premium-blur-container .premium-blurred {
  transform: translateZ(0);
}
.premium-lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  pointer-events: auto;
}
.premium-lock-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  font-size: 0.9rem;
  font-weight: 600;
}
.premium-lock-cta a {
  color: var(--brand-primary, #4f9cf9);
  text-decoration: none;
}
.premium-lock-cta a:hover {
  text-decoration: underline;
}
.premium-lock-icon {
  font-size: 1rem;
}
/* Lock badge for individual tooltip sections (trends, breakdown) */
.premium-lock-badge {
  display: flex;
  justify-content: center;
  padding: 6px 0;
  font-size: 0.85rem;
  color: var(--text-dim, #6b6b73);
}
.tp-premium-hint {
  display: flex;
  justify-content: center;
  padding: 16px 0 8px;
}
.report-mode-btn--locked {
  opacity: 0.75;
}
/* ADR-0008 T7: in-context upgrade modal */
.upgrade-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.upgrade-modal[hidden] {
  display: none;
}
.upgrade-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.upgrade-modal__panel {
  position: relative;
  z-index: 1;
  background: var(--bg-card, #fff);
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
  max-width: 420px;
  width: 100%;
  padding: 32px;
  animation: upgradeModalIn 0.2s ease-out;
}
@keyframes upgradeModalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.upgrade-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-dim, #8e8e93);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  transition: background 0.15s;
}
.upgrade-modal__close:hover {
  background: var(--bg-hover, #f5f5f7);
}
.upgrade-modal__body {
  text-align: center;
}
.upgrade-modal__icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}
.upgrade-modal__title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary, #1d1d1f);
  margin: 0 0 8px;
}
.upgrade-modal__lead {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-secondary, #6e6e73);
  margin: 0 0 18px;
}
.upgrade-modal__features-label {
  text-align: left;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary, #6e6e73);
  margin: 0 0 6px;
}
.upgrade-modal__features {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  text-align: left;
}
.upgrade-modal__features li {
  padding: 6px 0;
  font-size: 0.9rem;
  color: var(--text-secondary, #6e6e73);
  border-bottom: 1px solid var(--border-light, #f0f0f0);
}
.upgrade-modal__features li:last-child {
  border-bottom: none;
}
.upgrade-modal__features li::before {
  content: '✓ ';
  color: #34c759;
  font-weight: 700;
}
.upgrade-modal__price {
  margin-bottom: 16px;
}
.upgrade-modal__amount {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary, #1d1d1f);
}
.upgrade-modal__period {
  font-size: 1rem;
  color: var(--text-dim, #8e8e93);
}
.upgrade-modal__cta {
  display: inline-block;
  width: 100%;
  padding: 14px 24px;
  background: var(--brand-primary, #4f9cf9);
  color: #fff;
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  text-align: center;
  box-sizing: border-box;
}
.upgrade-modal__cta:hover {
  background: var(--brand-primary-hover, #3a8ae5);
  transform: translateY(-1px);
}
.upgrade-modal__hint {
  margin: 12px 0 0;
  font-size: 0.8rem;
  color: var(--text-dim, #8e8e93);
}
/* Trigger buttons styled like links (reset button chrome) */
.upgrade-modal-trigger {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--brand-primary, #4f9cf9);
  cursor: pointer;
  text-decoration: none;
}
.upgrade-modal-trigger:hover {
  text-decoration: underline;
}
/* Preserve narrative-upgrade-card button styling */
.narrative-upgrade-card__btn.upgrade-modal-trigger {
  background: var(--brand-primary, #4f9cf9);
  color: #fff;
  padding: 14px 24px;
  border-radius: 12px;
  font-weight: 700;
  display: inline-block;
  text-align: center;
}
.narrative-upgrade-card__btn.upgrade-modal-trigger:hover {
  text-decoration: none;
  background: var(--brand-primary-hover, #3a8ae5);
}
/* Free preview banner CTA button reset */
.free-preview-banner__cta.upgrade-modal-trigger {
  flex: 0 0 auto;
  color: inherit;
  font-weight: inherit;
}

@media (max-width: 600px) {
  .upgrade-modal__panel {
    padding: 24px 20px;
    border-radius: 16px;
  }
  .upgrade-modal__title {
    font-size: 1.1rem;
  }
}
/* Non-gaap note blur — smaller inline element */
.non-gaap-note.premium-blurred {
  filter: blur(3px);
  -webkit-filter: blur(3px);
}

/* Issue #193: paid-only 健康检查 + 完整性校验 cards.
   Layout mirrors .section-gating-grid but uses 2 columns so each card has
   room to render its real content; collapses to 1 column under 720px. */
.paid-checks-grid { max-width: 1180px; margin: 20px auto 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.paid-check-card { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; background: var(--bg-card, #fff); border: 1px solid var(--border-light, #d6d6d6); border-radius: 12px; box-shadow: var(--shadow-card); }
.paid-check-card__header { display: flex; flex-direction: column; gap: 4px; }
.paid-check-card__title { margin: 0; font-size: 1.05rem; font-weight: 800; color: var(--text-primary); display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.paid-check-card__title .en { font-family: var(--font-display); font-size: 0.7em; font-weight: 500; color: var(--text-dim); text-transform: none; }
.paid-check-card__hint { margin: 0; font-size: 0.82rem; color: var(--text-dim); line-height: 1.5; }
.paid-check-card__hint .en { display: block; font-family: var(--font-display); font-size: 0.92em; opacity: 0.9; }

.paid-check-pill-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.paid-check-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; border: 1px solid transparent; font-size: 0.82rem; line-height: 1.2; max-width: 100%; }
.paid-check-pill__dot { width: 10px; height: 10px; border-radius: 999px; flex: 0 0 auto; }
.paid-check-pill__label { display: inline-flex; align-items: baseline; gap: 6px; font-weight: 600; color: var(--text-primary); }
.paid-check-pill__label .en { font-family: var(--font-display); font-size: 0.82em; font-weight: 500; color: var(--text-dim); }
.paid-check-pill__detail { font-family: var(--font-display); font-size: 0.78rem; color: var(--text-dim); }
.paid-check-pill__detail--muted { font-style: italic; opacity: 0.85; }
.paid-check-pill--green   { background: #ecfdf5; border-color: #a7f3d0; }
.paid-check-pill--green   .paid-check-pill__dot { background: #059669; }
.paid-check-pill--yellow  { background: #fffbeb; border-color: #fcd34d; }
.paid-check-pill--yellow  .paid-check-pill__dot { background: #d97706; }
.paid-check-pill--red     { background: #fef2f2; border-color: #fecaca; }
.paid-check-pill--red     .paid-check-pill__dot { background: #dc2626; }
.paid-check-pill--skipped { background: #f3f4f6; border-color: #e5e7eb; }
.paid-check-pill--skipped .paid-check-pill__dot { background: #9ca3af; }
.paid-check-pill--skipped .paid-check-pill__label { color: var(--text-dim); }

/* Issue #224: health-check legend bar — replaces "颜色越深越需要关注" */
.health-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; font-family: var(--font-display); font-size: 0.78rem; color: var(--text-dim); }
.health-legend__prefix { font-size: 0.75rem; color: var(--text-dim); opacity: 0.7; }
.health-legend__item { display: inline-flex; align-items: center; gap: 5px; }
.health-legend__dot { width: 8px; height: 8px; border-radius: 999px; flex-shrink: 0; }
.health-legend__dot--green  { background: #059669; }
.health-legend__dot--yellow { background: #d97706; }
.health-legend__dot--red    { background: #dc2626; }
.health-legend__dot--gray   { background: #9ca3af; }
.health-legend__label { font-weight: 500; color: var(--text-primary); }
.health-legend__label-en { font-size: 0.88em; color: var(--text-dim); font-weight: 400; }

/* Issue #224: pill body groups label + detail + threshold vertically */
.paid-check-pill { align-items: flex-start; }
.paid-check-pill__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.paid-check-pill__threshold { font-family: var(--font-display); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.01em; opacity: 0.85; }
.paid-check-pill__threshold--green  { color: #065f46; }
.paid-check-pill__threshold--yellow { color: #92400e; }
.paid-check-pill__threshold--red    { color: #991b1b; }
.paid-check-pill__threshold--gray   { color: #6b7280; }

.paid-check-row-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.paid-check-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 8px; border: 1px solid transparent; }
.paid-check-row__glyph { flex: 0 0 22px; width: 22px; height: 22px; display: inline-grid; place-items: center; border-radius: 999px; font-weight: 800; font-size: 0.85rem; color: #fff; }
.paid-check-row__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.paid-check-row__label { display: inline-flex; align-items: baseline; gap: 6px; font-weight: 600; color: var(--text-primary); font-size: 0.92rem; }
.paid-check-row__label .en { font-family: var(--font-display); font-size: 0.82em; font-weight: 500; color: var(--text-dim); }
.paid-check-row__detail { font-family: var(--font-display); font-size: 0.8rem; color: var(--text-dim); word-break: break-word; }
.paid-check-row--pass { background: #ecfdf5; border-color: #a7f3d0; }
.paid-check-row--pass .paid-check-row__glyph { background: #059669; }
.paid-check-row--warn { background: #fffbeb; border-color: #fcd34d; }
.paid-check-row--warn .paid-check-row__glyph { background: #d97706; }
.paid-check-row--fail { background: #fef2f2; border-color: #fecaca; }
.paid-check-row--fail .paid-check-row__glyph { background: #dc2626; }

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.empty-state-request-card { max-width: 1180px; margin: 20px auto 0; padding: 22px 26px; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: var(--bg-card, #fff); border: 1px solid var(--border-light, #d6d6d6); border-radius: 12px; box-shadow: var(--shadow-card); }
.empty-state-request-card__body { flex: 1 1 auto; min-width: 0; }
.empty-state-request-card__eyebrow { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-dim, #6b6b73); margin-bottom: 6px; }
.empty-state-request-card__title { font-size: 1.15rem; font-weight: 800; color: var(--text-primary); margin: 0 0 6px; }
.empty-state-request-card__copy { font-size: 0.94rem; color: var(--text-primary); margin: 0 0 6px; line-height: 1.55; }
.empty-state-request-card__hint { font-size: 0.82rem; color: var(--text-dim); margin: 0; }
.empty-state-request-card__cta { flex: 0 0 auto; }
.empty-state-request-card__btn { display: inline-flex; align-items: center; padding: 10px 18px; background: var(--text-primary); color: #fff; font-weight: 700; font-size: 0.96rem; border-radius: 999px; border: 0; cursor: pointer; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18); transition: transform 0.12s ease, box-shadow 0.12s ease; }
.empty-state-request-card__btn:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25); }

@media (max-width: 768px) {
  .section-gating-grid { grid-template-columns: 1fr; }
  .paid-checks-grid { grid-template-columns: 1fr; }
  .empty-state-request-card { flex-direction: column; align-items: stretch; padding: 18px; gap: 14px; }
  .empty-state-request-card__btn { justify-content: center; width: 100%; }
}

.ticker-waitlist-fallback {
  max-width: 520px;
  margin: -34px auto 42px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-shadow: var(--shadow-card);
}

.ticker-waitlist-fallback p {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
}

.ticker-waitlist-fallback .en {
  display: block;
  color: var(--text-dim);
  font-size: 0.82rem;
  font-weight: 500;
}

@media (max-width: 768px) {
  .app-top-nav,
  .founding-nav { padding: 12px 18px; }
  .founding-nav nav {
    gap: 10px;
    font-size: 0.9rem;
  }
  .founding-hero,
  .founding-list {
    grid-template-columns: 1fr;
  }
  .founding-hero { padding-top: 34px; }
  .founding-bottom { display: block; }
  .conversion-modal-overlay {
    align-items: end;
    padding: 0;
  }
  .conversion-modal {
    width: 100%;
    border-radius: 8px 8px 0 0;
  }
  .conversion-modal-actions .btn,
  .ticker-waitlist-fallback button { width: 100%; }
  .free-preview-banner {
    margin-top: 12px;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .free-preview-banner__dismiss {
    margin-left: auto;
  }
  .ticker-waitlist-fallback {
    margin-top: -30px;
    flex-direction: column;
    align-items: stretch;
  }
}

/* ── CTA: Request a Ticker ── */
.cta-card {
  max-width: 680px;
  margin: 48px auto 0;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: var(--shadow-card);
  transition: box-shadow 200ms var(--ease-out-expo), padding 200ms var(--ease-out-expo);
}
.cta-card.is-expanded { padding: 24px 26px 22px; box-shadow: var(--shadow-card-hover); }
.cta-card.is-success { background: var(--accent-green-light); border-color: #c9e2d1; }
.cta-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cta-prompt {
  font-family: var(--font-cn);
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 500;
}
.cta-prompt .en {
  display: block;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 400;
}
.cta-trigger {
  flex-shrink: 0;
  background: transparent;
  color: var(--accent-orange);
  border: 1px solid var(--accent-orange);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 150ms var(--ease-out-expo);
  white-space: nowrap;
}
.cta-trigger:hover { background: var(--accent-orange); color: #fff; }
.cta-form { display: none; animation: ctaFadeIn 200ms var(--ease-out-expo); }
.cta-card.is-expanded .cta-row { display: none; }
.cta-card.is-expanded .cta-form { display: block; }
.cta-form-title {
  font-family: var(--font-cn);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.cta-form-subtitle {
  font-family: var(--font-cn);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.cta-field { margin-bottom: 14px; }
.cta-field label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-family: var(--font-cn);
}
.cta-field label .hint { color: var(--text-muted); font-size: 11px; }
.cta-field input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-body);
  background: var(--bg-card-alt);
  color: var(--text-primary);
  transition: border-color 150ms, background 150ms;
}
.cta-field input:focus { outline: none; border-color: var(--accent-orange); background: #fff; }
.cta-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.cta-note { font-size: 11px; color: var(--text-muted); margin-top: 10px; font-family: var(--font-cn); }
.cta-btn-ghost {
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 9px 14px;
  font-size: 13px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
}
.cta-btn-ghost:hover { color: var(--text-primary); }
.cta-btn-submit {
  background: var(--accent-orange);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 150ms;
}
.cta-btn-submit:hover { background: #a85c2f; }
.cta-btn-submit:disabled { opacity: 0.6; cursor: wait; }
.cta-success {
  display: none;
  align-items: center;
  gap: 12px;
  color: var(--accent-green);
  font-family: var(--font-cn);
  font-size: 14px;
}
.cta-card.is-success .cta-row,
.cta-card.is-success .cta-form { display: none; }
.cta-card.is-success .cta-success { display: flex; }
.cta-success .check {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--accent-green);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.cta-success .msg strong { color: var(--text-primary); font-weight: 600; }
.cta-success .sub { display: block; font-size: 12px; color: var(--text-dim); margin-top: 2px; }
@keyframes ctaFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (max-width: 560px) {
  .cta-card .cta-row { flex-direction: column; align-items: stretch; }
  .cta-card .cta-trigger { width: 100%; }
  .cta-card .cta-actions { flex-direction: column-reverse; }
  .cta-card .cta-actions button { width: 100%; }
}

/* ── CTA Typeahead & Chips ── */
.cta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  min-height: 0;
}
.cta-chips:empty { margin-bottom: 0; }
.cta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-orange-light);
  color: var(--text-primary);
  border: 1px solid #f0d8c0;
  border-radius: 999px;
  padding: 4px 4px 4px 10px;
  font-size: 12px;
  font-family: var(--font-body);
  max-width: 100%;
}
.cta-chip strong { font-weight: 600; color: var(--accent-orange); }
.cta-chip .chip-name {
  color: var(--text-dim);
  font-size: 11px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cta-chip .chip-remove {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}
.cta-chip .chip-remove:hover { background: rgba(0,0,0,0.06); color: var(--text-primary); }

.cta-typeahead { position: relative; }
.cta-typeahead input:disabled {
  background: var(--bg-subtle);
  cursor: not-allowed;
}
.cta-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-tooltip);
  max-height: 280px;
  overflow-y: auto;
  z-index: 20;
}
.cta-dropdown.is-open { display: block; }
.cta-dropdown-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-lighter);
  font-family: var(--font-body);
}
.cta-dropdown-item:last-child { border-bottom: none; }
.cta-dropdown-item:hover,
.cta-dropdown-item.is-active {
  background: var(--bg-card-alt);
}
.cta-dropdown-item .dd-ticker {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 13px;
  min-width: 54px;
}
.cta-dropdown-item .dd-name {
  color: var(--text-dim);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cta-dropdown-item mark {
  background: #fbe8a8;
  color: inherit;
  padding: 0 1px;
  border-radius: 2px;
}
.cta-dropdown-empty {
  padding: 12px 14px;
  color: var(--text-muted);
  font-size: 13px;
  font-family: var(--font-cn);
}
.cta-picker-hint {
  margin-top: 6px;
}

/* ── Health Check panel (mode-switcher third tab) ── */
.health-check-panel {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}
.health-check-panel[hidden] { display: none; }

.hc-panel__header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.hc-panel__title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}
.hc-panel__subtitle {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-family: var(--font-display);
}

.hc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.hc-card {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-light, #e8ddd0);
  border-left: 4px solid var(--border-light);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hc-card--green  { border-left-color: #059669; }
.hc-card--yellow { border-left-color: #d97706; }
.hc-card--red    { border-left-color: #dc2626; }
.hc-card--skipped { opacity: 0.65; }

.hc-card__status {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.hc-card__status--green  { color: #059669; }
.hc-card__status--yellow { color: #d97706; }
.hc-card__status--red    { color: #dc2626; }
.hc-card__status--skipped { color: var(--text-dim); }

.hc-card__names {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hc-card__name-cn {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.3;
}
.hc-card__name-en {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--font-display);
}
.hc-card__value {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-display);
  margin-top: 2px;
}
.hc-card__threshold {
  font-size: 0.71rem;
  color: var(--text-dim);
  line-height: 1.45;
  margin-top: 2px;
}

@media (max-width: 768px) {
  .hc-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .hc-grid { grid-template-columns: 1fr; }
}

/* Override browser [hidden] suppression for grid/flex containers toggled by mode-switcher */
.columns[hidden],
.dd-panel[hidden],
.health-check-panel[hidden] { display: none !important; }

/* Portfolio entry card on the home page (links to /login → /portfolio). */
.portfolio-entry {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 1.4rem;
    padding: 16px 20px;
    border: 1px solid var(--border-light);
    border-radius: 14px;
    text-decoration: none;
    color: var(--text-primary);
    background: rgba(255,255,255,0.6);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.portfolio-entry:hover {
    border-color: var(--accent-primary, #6c5ce7);
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.12);
    background: rgba(255,255,255,0.85);
}
.portfolio-entry-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--accent-green-light, #e6f1ea);
    color: var(--accent-green, #2f7a4e);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.portfolio-entry-text {
    flex: 1;
    min-width: 0;
}
.portfolio-entry-text strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 2px;
}
.portfolio-entry-text span {
    font-size: 0.78rem;
    color: var(--text-dim);
    line-height: 1.4;
}
.portfolio-entry-arrow {
    font-size: 1.1rem;
    color: var(--text-dim);
    transition: transform 0.2s, color 0.2s;
    flex-shrink: 0;
}
.portfolio-entry:hover .portfolio-entry-arrow {
    transform: translateX(3px);
    color: var(--accent-primary, #6c5ce7);
}
.portfolio-entry-demo {
    text-align: center;
    margin: 10px 0 0;
    font-size: 12px;
    color: var(--text-dim);
}
.portfolio-entry-demo a {
    color: var(--text-secondary, var(--accent-primary));
    text-decoration: none;
    border-bottom: 1px dashed var(--border-light);
    padding-bottom: 1px;
}
.portfolio-entry-demo a:hover {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}
