/* ================================================================
   Morning Briefing — Design System v3
   Refined Tech Utility: warmer depths, sharper hierarchy, 
   polished micro-interactions, premium native-app feel
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&family=Noto+Sans+SC:wght@400;500;600;700;800&family=Noto+Serif+SC:wght@400;500;600;700;800&display=swap');

:root {
    /* ── Palette ── */
    --bg: #0a0b0f;
    --surface: #11131a;
    --surface-raised: #181b24;
    --surface-glass: rgba(17, 19, 26, 0.88);

    --text-primary: #f2f3f7;
    --text-secondary: #a1a7b3;
    --text-muted: #4a5060;

    --accent: #5bb8ff;
    --accent-soft: rgba(91, 184, 255, 0.12);
    --accent-glow: rgba(91, 184, 255, 0.18);
    --accent-secondary: #f59e0b;
    --accent-secondary-soft: rgba(245, 158, 11, 0.12);

    --border: #181b26;
    --border-hover: #252a36;
    --border-accent: rgba(91, 184, 255, 0.28);

    --up: #4ade80;
    --up-soft: rgba(74, 222, 128, 0.12);
    --down: #f87171;
    --down-soft: rgba(248, 113, 113, 0.12);
    --warning: #fbbf24;
    --warning-soft: rgba(251, 191, 36, 0.12);

    /* ── Typography ── */
    --font-sans: "Inter", "Noto Sans SC", "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: "JetBrains Mono", "Noto Sans SC", "Noto Sans CJK SC", "SF Mono", "Cascadia Code", "Fira Code", ui-monospace, monospace;
    --font-chinese: "Noto Sans SC", "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", "WenQuanYi Zen Hei", sans-serif;

    /* ── Spacing & Radii ── */
    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-full: 999px;

    /* ── Shadows ── */
    --shadow-card: 0 1px 3px rgba(0,0,0,0.5), 0 6px 20px rgba(0,0,0,0.28);
    --shadow-raised: 0 6px 24px rgba(0,0,0,0.5), 0 3px 8px rgba(0,0,0,0.35);
    --shadow-glow: 0 0 28px rgba(91, 184, 255, 0.10);
    --shadow-glow-strong: 0 0 40px rgba(91, 184, 255, 0.16);

    /* ── Motion ── */
    --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15.5px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
    background: var(--bg);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    min-height: 100vh;
    /* ambient depth orbs + subtle grid */
    background-image:
        radial-gradient(ellipse 80% 50% at 10% 20%, rgba(91,184,255,0.04) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 90% 80%, rgba(245,158,11,0.025) 0%, transparent 60%),
        linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 52px 52px, 52px 52px;
}

/* ── Keyframes ── */
@keyframes cardEnter {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

@keyframes pulse-ring {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(2.2); opacity: 0; }
}

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

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* ── Skeleton ── */
.skeleton {
    background: linear-gradient(90deg, var(--surface-raised) 25%, rgba(255,255,255,0.045) 50%, var(--surface-raised) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s ease-in-out infinite;
    border-radius: var(--radius-xs);
}

.skeleton-line { height: 0.7rem; margin-bottom: 0.45rem; }
.skeleton-line.short { width: 55%; }

/* ================================================================
   HEADER
   ================================================================ */
header {
    display: block;
}

/* ================================================================
   HERO HEADER
   ================================================================ */
.hero-header {
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    position: relative;
    overflow: visible;
    display: block;
    z-index: 1000;
}

/* ---- Compact branded bar (all screen sizes) ---- */
.hero-header-compact {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #0a0b0f 0%, #12141a 50%, #0a0b0f 100%);
    border-bottom: 1px solid var(--border);
    padding: 0.7rem 1rem;
    position: relative;
    overflow: hidden;
}

.hero-header-compact::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.6;
}

.hero-header-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    position: relative;
    z-index: 1;
}

.hero-header-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow), 0 0 28px rgba(91,184,255,0.15);
    position: relative;
    flex-shrink: 0;
}

.hero-header-dot::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1.5px solid var(--accent);
    animation: pulse-ring 2.5s ease-out infinite;
}

.hero-header-brand-text {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.hero-header-accent-line {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--accent) 20%, var(--accent) 80%, transparent 100%);
    opacity: 0.4;
}

/* ---- Meta bar (shared) ---- */
.header-meta-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 1rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
    font-size: 0.72rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: 0.35rem;
}

.header-meta-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    flex-wrap: wrap;
}

.header-sep {
    color: var(--border-hover);
}

.header-meta-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.header-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-raised);
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-mono);
    white-space: nowrap;
}

.header-btn:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

.header-btn-icon {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
}

/* ---- Responsive: narrow overrides ---- */
@media (max-width: 719px) {
    .hero-header-compact {
        padding: 0.6rem 0.75rem;
    }
    .hero-header-brand {
        gap: 0.5rem;
    }
    .hero-header-brand-text {
        font-size: 1rem;
    }
    .hero-header-dot {
        width: 8px;
        height: 8px;
    }
    .hero-header-accent-line {
        display: none;
    }
    header.hero-header .header-meta-bar,
    .header-meta-bar {
        display: flex;
        visibility: visible;
        opacity: 1;
        padding: 0.35rem 0.75rem;
        font-size: 0.65rem;
        gap: 0.3rem;
    }
    header.hero-header .header-meta-left,
    .header-meta-left {
        display: flex;
        gap: 0.35rem;
    }
    header.hero-header .header-meta-right,
    .header-meta-right {
        display: flex;
        gap: 0.35rem;
    }
    header.hero-header .header-btn,
    .header-btn {
        display: inline-flex;
        padding: 0.25rem 0.45rem;
        font-size: 0.6rem;
        gap: 0.2rem;
    }
    .header-btn-icon {
        width: 9px;
        height: 9px;
    }
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.025em;
}

.header-brand .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow), 0 0 28px rgba(91,184,255,0.15);
    position: relative;
}

.header-brand .dot::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1.5px solid var(--accent);
    animation: pulse-ring 2.5s ease-out infinite;
}

.header-brand .region {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: -0.01em;
    margin-left: 0.15rem;
}

.header-center {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.header-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
    background: var(--surface-raised);
    border: 1px solid var(--border);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    letter-spacing: 0.03em;
}

.header-chip .chip-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--up);
    box-shadow: 0 0 6px rgba(74,222,128,0.5);
    animation: pulse 2s ease-in-out infinite;
}

.header-meta {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    font-size: 0.88rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

#clock {
    color: var(--text-primary);
    text-shadow: 0 0 20px rgba(255,255,255,0.06);
    letter-spacing: -0.01em;
}

.status-dot {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--up);
}

.status-dot::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--up);
    box-shadow: 0 0 8px rgba(74,222,128,0.45);
    animation: pulse 2s ease-in-out infinite;
}

/* ================================================================
   MAIN LAYOUT
   ================================================================ */
main {
    max-width: 1480px;
    margin: 0 auto;
    padding: 1.75rem 2rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (min-width: 720px) {
    .dashboard-grid { grid-template-columns: 1fr 1fr; gap: 0.9rem; }
}

@media (min-width: 1100px) {
    .dashboard-grid { grid-template-columns: 340px 1fr 1fr; gap: 1rem; }
}

.col-left, .col-mid, .col-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Story card stretches full height in right column */
.col-right {
    min-height: 0;
}

.col-right > .card {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.col-right > .card > .card-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* card entrance stagger */
.col-left > .card,
.col-mid > .card,
.col-right > .card {
    animation: cardEnter 0.6s var(--ease-out) both;
}

.col-left > .card:nth-child(1) { animation-delay: 0.04s; }
.col-left > .card:nth-child(2) { animation-delay: 0.12s; }
.col-left > .card:nth-child(3) { animation-delay: 0.20s; }
.col-mid > .card:nth-child(1) { animation-delay: 0.08s; }
.col-mid > .card:nth-child(2) { animation-delay: 0.16s; }
.col-mid > .card:nth-child(3) { animation-delay: 0.24s; }
.col-right > .card:nth-child(1) { animation-delay: 0.10s; }

/* ================================================================
   CARDS
   ================================================================ */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-card);
    transition: border-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), transform 0.25s var(--ease-out);
    overflow: hidden;
    min-width: 0;
    position: relative;
}

.card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, transparent 35%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.card:hover {
    border-color: var(--border-accent);
    box-shadow: var(--shadow-raised), var(--shadow-glow);
    transform: translateY(-4px);
}

.card.collapsed { opacity: 0.85; }
.card.collapsed .card-body { display: none; }

/* ── Card Header ── */
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    cursor: pointer;
    user-select: none;
    min-width: 0;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.refresh-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 1.8rem;
    height: 1.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s var(--ease-out);
    padding: 0;
}

.refresh-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: scale(1.1);
}

.refresh-btn:active { transform: scale(0.92); }

.refresh-btn.spinning {
    animation: spin 0.7s linear infinite;
    color: var(--accent);
    border-color: var(--accent);
}

.card-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.card-title .icon {
    font-size: 0.95rem;
    filter: grayscale(0.2);
    opacity: 0.9;
}

.card-collapse {
    font-size: 0.6rem;
    color: var(--text-muted);
    transition: transform 0.3s var(--ease-out);
}

.card.collapsed .card-collapse { transform: rotate(-90deg); }

.card-body { min-width: 0; }

/* ================================================================
   BADGES
   ================================================================ */
.badge {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-xs);
    flex-shrink: 0;
    font-family: var(--font-mono);
}

.badge-rec { background: var(--accent); color: #000; }
.badge-live { background: var(--up); color: #000; }
.badge-est { background: var(--warning); color: #000; }

/* ================================================================
   NEWS TABS — Pill Style
   ================================================================ */
.news-tabs {
    display: flex;
    gap: 0.3rem;
    margin-bottom: 0.85rem;
    padding: 0.3rem;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
}

.news-tab {
    flex: 1;
    padding: 0.42rem 0.25rem;
    font-size: 0.68rem;
    font-weight: 600;
    font-family: var(--font-sans);
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.25s var(--ease-out);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    letter-spacing: 0.02em;
}

.news-tab:hover {
    color: var(--text-secondary);
    background: rgba(255,255,255,0.04);
}

.news-tab.active {
    color: var(--text-primary);
    background: var(--surface);
    border-color: var(--border-hover);
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* ================================================================
   LOADING / EMPTY
   ================================================================ */
.loading {
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 1rem 0;
    text-align: center;
    font-style: italic;
}

/* ================================================================
   WEATHER
   ================================================================ */
.weather-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.6rem;
}

.weather-icon {
    font-size: 2.8rem;
    line-height: 1;
    filter: drop-shadow(0 0 12px rgba(255,255,255,0.1));
}

.big-temp {
    font-size: 3.4rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text-primary);
    font-family: var(--font-sans);
    background: linear-gradient(180deg, #fff 0%, #b8c5f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.weather-detail {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    font-family: var(--font-mono);
    font-weight: 500;
    letter-spacing: 0.01em;
}

.weather-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-family: var(--font-mono);
    font-weight: 500;
    letter-spacing: 0.02em;
}

.forecast-strip {
    display: flex;
    justify-content: space-between;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.forecast-chip {
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.4rem;
    text-align: center;
    min-width: 56px;
    flex: 1;
    transition: border-color 0.25s, transform 0.2s;
}

.forecast-chip:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.fc-day {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.3rem;
    font-weight: 600;
}

.fc-icon { font-size: 1.2rem; line-height: 1; margin-bottom: 0.25rem; }

.fc-temp {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-weight: 600;
}

/* ================================================================
   TRANSIT
   ================================================================ */
.travel-origin {
    font-size: 0.74rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 500;
    padding: 0.4rem 0.6rem;
    background: var(--surface-raised);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    width: fit-content;
}

.travel-dest-card {
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 0.55rem;
    min-width: 0;
    overflow: hidden;
    transition: border-color 0.25s;
}

.travel-dest-card:hover { border-color: var(--border-hover); }

.travel-dest-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    font-size: 0.8rem;
    gap: 0.55rem;
    min-width: 0;
    background: rgba(255,255,255,0.02);
}

.travel-dest-name {
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.travel-best-time {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 0.78rem;
    color: var(--accent);
    flex-shrink: 0;
    font-weight: 700;
}

.travel-chevron {
    font-size: 0.6rem;
    color: var(--text-muted);
    transition: transform 0.3s var(--ease-out);
    flex-shrink: 0;
}

.travel-dest-card.collapsed .travel-chevron { transform: rotate(-90deg); }
.travel-dest-card.collapsed .travel-modes { display: none; }

.travel-modes { padding: 0 0.65rem 0.55rem; min-width: 0; }

.mode-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.48rem 0.6rem;
    border-radius: var(--radius-xs);
    background: rgba(255,255,255,0.02);
    border: 1px solid transparent;
    font-size: 0.78rem;
    margin-bottom: 0.3rem;
    cursor: pointer;
    min-width: 0;
    transition: all 0.25s var(--ease-out);
}

.mode-row:hover {
    background: rgba(255,255,255,0.04);
    border-color: var(--border-accent);
}

.mode-row.recommended {
    background: var(--accent-soft);
    border-color: rgba(91,184,255,0.2);
}

.mode-icon { flex-shrink: 0; font-size: 0.9rem; }

.mode-name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-secondary);
    font-weight: 500;
}

.mode-time {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
    font-weight: 700;
    flex-shrink: 0;
    font-size: 0.78rem;
}

.mode-expand {
    display: none;
    padding: 0.5rem 0.6rem 0.7rem;
    font-size: 0.74rem;
    color: var(--text-secondary);
    border-left: 2px solid var(--border);
    margin-left: 0.6rem;
    margin-bottom: 0.5rem;
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 0;
}

.mode-row.expanded + .mode-expand { display: block; }

.mode-route {
    line-height: 1.7;
    color: var(--text-secondary);
}

.mode-note {
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.35rem;
    line-height: 1.55;
    font-size: 0.72rem;
}

.mode-detail-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.45rem;
    font-size: 0.66rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-weight: 500;
}

/* ================================================================
   STOCKS
   ================================================================ */
.stock-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0;
    gap: 0.6rem;
    min-width: 0;
}

.stock-symbol {
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: 0.84rem;
    color: var(--text-primary);
    flex-shrink: 0;
}

.stock-price {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 0.9rem;
    color: var(--text-primary);
    flex: 1;
    text-align: right;
    font-weight: 700;
}

.stock-change-badge {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-xs);
    flex-shrink: 0;
}

.stock-change-badge.up { background: var(--up-soft); color: var(--up); }
.stock-change-badge.down { background: var(--down-soft); color: var(--down); }

.stock-bar {
    height: 3px;
    border-radius: 2px;
    background: var(--border);
    position: relative;
    overflow: hidden;
    margin-bottom: 0.2rem;
}

.stock-bar-fill {
    height: 100%;
    position: absolute;
    top: 0;
    transition: width 0.6s var(--ease-out);
    border-radius: 2px;
}

.stock-bar-fill.up { background: var(--up); }
.stock-bar-fill.down { background: var(--down); }

.stock-meta {
    font-size: 0.66rem;
    color: var(--text-muted);
    text-align: right;
    font-family: var(--font-mono);
    font-weight: 500;
}

/* ================================================================
   NEWS
   ================================================================ */
.news-item {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    border-left: 2px solid transparent;
    padding-left: 0.5rem;
    margin-left: -0.5rem;
    min-width: 0;
    transition: border-left-color 0.25s, background 0.25s;
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}

.news-item:hover {
    border-left-color: var(--accent);
    background: rgba(255,255,255,0.02);
}

.news-item:last-child { border-bottom: none; }

.news-item a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.82rem;
    line-height: 1.55;
    display: block;
    overflow-wrap: anywhere;
    word-break: break-word;
    transition: color 0.25s;
    font-weight: 500;
}

.news-item a:hover { color: var(--accent); }

.news-item a::before {
    content: attr(data-idx);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: var(--radius-xs);
    background: var(--surface-raised);
    border: 1px solid var(--border);
    font-size: 0.6rem;
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--text-muted);
    margin-right: 0.5rem;
    vertical-align: middle;
    flex-shrink: 0;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 0.3rem;
    font-size: 0.66rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-weight: 500;
    letter-spacing: 0.02em;
}

.news-source-tag {
    color: var(--accent);
    font-weight: 700;
}

.news-date-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.66rem;
    font-weight: 700;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 0.12rem 0.45rem;
    border-radius: var(--radius-xs);
    margin-left: 0.4rem;
    flex-shrink: 0;
}

/* ================================================================
   IDEA CARDS (Game / Investment)
   ================================================================ */
.idea-card {
    background: linear-gradient(165deg, var(--surface-raised), var(--surface));
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    transition: border-color 0.3s, transform 0.25s;
    min-width: 0;
    position: relative;
    overflow: hidden;
}

.idea-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
}

.idea-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.idea-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.45rem;
    min-width: 0;
}

.idea-title {
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.idea-badge {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.14rem 0.45rem;
    border-radius: var(--radius-xs);
    flex-shrink: 0;
    font-family: var(--font-mono);
}

.idea-sub {
    font-size: 0.74rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-family: var(--font-mono);
    font-weight: 500;
    letter-spacing: 0.02em;
}

.idea-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.65;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* ================================================================
   GAME LIST
   ================================================================ */
.game-today {
    background: linear-gradient(165deg, var(--surface-raised), var(--surface));
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 0.75rem;
    position: relative;
    overflow: hidden;
}

.game-today::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
}

.game-today-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    margin-bottom: 0.35rem;
}

.game-today-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.game-today-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.game-today-meta {
    display: flex;
    gap: 0.4rem;
}

.game-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    background: var(--surface-raised);
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
}

.game-list-header {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin: 0.75rem 0 0.4rem;
    padding-left: 0.25rem;
}

.game-list-scrollable {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

/* ---- Game Compound Widget ---- */
.game-compound {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.game-compound-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    background: var(--surface);
}

.game-compound-header:hover {
    background: var(--surface-raised);
}

.game-compound-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.game-compound-icon {
    font-size: 1.1rem;
}

.game-compound-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.game-compound-arrow {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.game-compound-body {
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.game-compound-list {
    padding: 0.5rem;
}

.game-compound-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.7rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 0.25rem;
}

.game-compound-row:last-child {
    margin-bottom: 0;
}

.game-compound-row:hover {
    background: var(--surface-raised);
}

.game-compound-row.active {
    background: var(--accent-soft);
    border: 1px solid var(--accent);
}

.game-compound-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

.game-compound-row.active .game-compound-dot {
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent);
}

.game-compound-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.game-compound-badges {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.game-compound-detail {
    padding: 0 0.5rem 0.5rem 0.5rem;
}

.game-play {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--accent);
    margin-left: auto;
    font-family: var(--font-mono);
    letter-spacing: 0.04em;
}

/* ================================================================
   PHOTO OF THE DAY
   ================================================================ */
.photo-wrap {
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface-raised);
    transition: border-color 0.3s, transform 0.25s;
}

.photo-wrap:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.photo-link {
    display: block;
    position: relative;
    overflow: hidden;
}

.photo-link::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 60%, rgba(10,11,15,0.65) 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s;
}

.photo-link:hover::after { opacity: 1; }

.photo-img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.6s var(--ease-out);
}

.photo-link:hover .photo-img { transform: scale(1.05); }

.photo-caption {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    gap: 1rem;
    min-width: 0;
    background: var(--surface-raised);
}

.photo-title {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.photo-source {
    font-size: 0.64rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-family: var(--font-mono);
    font-weight: 500;
    flex-shrink: 0;
}

/* ================================================================
   ADVERTISEMENT BOARD
   ================================================================ */
.ad-board {
    display: block;
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.25s;
    text-decoration: none;
    aspect-ratio: 1.79 / 1;
}

.ad-board:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-raised);
    transform: translateY(-3px);
}

.ad-board img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s var(--ease-out);
}

.ad-board:hover img { transform: scale(1.05); }

.ad-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    background: rgba(10,11,15,0.4);
    transition: background 0.3s;
}

.ad-board:hover .ad-overlay { background: rgba(10,11,15,0.25); }

.ad-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 14px rgba(0,0,0,0.65);
    letter-spacing: -0.02em;
}

.ad-section {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.card-body .ad-section { margin-top: 0.95rem; }

.ad-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.ad-row .ad-board { aspect-ratio: 1.79 / 1; }

.ad-row .ad-sub { font-size: 0.62rem; }

.ad-sub {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

/* ================================================================
   FOOTER
   ================================================================ */
footer {
    max-width: 1480px;
    margin: 0 auto;
    padding: 1.25rem 2rem 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    font-size: 0.66rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-weight: 500;
    border-top: 1px solid var(--border);
    box-shadow: inset 0 1px 0 rgba(91,184,255,0.06);
    letter-spacing: 0.02em;
    flex-wrap: wrap;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.footer-center {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-source {
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
    background: var(--surface-raised);
    border: 1px solid var(--border);
    font-size: 0.62rem;
    white-space: nowrap;
    transition: border-color 0.25s, color 0.25s;
}

.footer-source:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.refresh-indicator {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.refresh-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse 2.5s ease-in-out infinite;
}

/* ================================================================
   SCROLLBAR
   ================================================================ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

* { scrollbar-width: thin; scrollbar-color: var(--border-hover) transparent; }

/* ================================================================
   PS OPEN DAY CONCLUSION
   ================================================================ */
.ps-conclusion {
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.85rem 0.95rem;
    margin-bottom: 0.75rem;
    min-width: 0;
}

.ps-conclusion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
    min-width: 0;
}

.ps-conclusion-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.ps-conclusion-pill {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 700;
    padding: 0.18rem 0.55rem;
    border-radius: var(--radius-xs);
    background: var(--accent-soft);
    color: var(--accent);
    flex-shrink: 0;
}

.ps-conclusion-bar {
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    overflow: hidden;
    margin-bottom: 0.6rem;
}

.ps-conclusion-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
    border-radius: 2px;
    transition: width 0.7s var(--ease-out);
}

.ps-conclusion-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.ps-stat {
    text-align: center;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 0.5rem 0.3rem;
}

.ps-stat-value {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.ps-stat-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 0.15rem;
    font-weight: 600;
}

.ps-school-lists {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
}

.ps-school-list {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 0.55rem;
    min-width: 0;
}

.ps-school-list-header {
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.ps-school-list ul {
    list-style: none;
    max-height: 140px;
    overflow-y: auto;
    padding-right: 0.3rem;
    margin: 0;
}

.ps-school-list li {
    font-size: 0.74rem;
    color: var(--text-secondary);
    padding: 0.18rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.035);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ps-school-list li:last-child { border-bottom: none; }

.ps-school-list.matched .ps-school-list-header { color: var(--up); }
.ps-school-list.unmatched .ps-school-list-header { color: var(--text-muted); }

/* ================================================================
   NEWS CARD FIXED HEIGHT
   ================================================================ */
.news-scroll-container {
    max-height: 340px;
    overflow-y: auto;
    padding-right: 0.3rem;
}

#news-section {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

#news-section .card-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#news-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 0.3rem;
}

/* ================================================================
   STORY BOARD
   ================================================================ */
#story-section {
    min-height: 0;
}

#story-section .card-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#story-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 0.3rem;
}

.story-image-wrap {
    width: 100%;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 0.85rem;
    border: 1px solid var(--border);
    aspect-ratio: 1.79 / 1;
    flex-shrink: 0;
}

.story-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.story-image-wrap:hover .story-image {
    transform: scale(1.04);
}

.story-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-style: italic;
    line-height: 1.4;
    letter-spacing: -0.015em;
    flex-shrink: 0;
}

.story-content {
    line-height: 1.8;
    color: var(--text-secondary);
    font-size: 0.88rem;
    white-space: pre-wrap;
}

.story-content::-webkit-scrollbar { width: 4px; }
.story-content::-webkit-scrollbar-track { background: transparent; }
.story-content::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: var(--radius-full); }

.story-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.65rem;
    font-family: var(--font-mono);
    font-weight: 500;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 719px) {
    header { padding: 0 1.25rem; height: 60px; }
    .header-center { display: none; }
    .header-meta { gap: 0.7rem; font-size: 0.78rem; }
    .header-brand { font-size: 0.92rem; }

    main { padding: 1rem; }
    .dashboard-grid { gap: 0.8rem; }
    .card { padding: 1rem; }

    .ps-school-lists { grid-template-columns: 1fr; }
    .news-scroll-container { max-height: 300px; }
    .photo-img { max-height: 170px; }

    footer {
        flex-direction: column;
        justify-content: center;
        gap: 0.6rem;
        text-align: center;
        padding: 1rem 1.25rem 2rem;
    }
    .footer-left, .footer-center, .footer-right { justify-content: center; }
    .footer-center { order: -1; }
}

@media (max-width: 400px) {
    .big-temp { font-size: 2.6rem; }
    .weather-icon { font-size: 2.2rem; }
    .news-tab { font-size: 0.62rem; padding: 0.32rem 0.12rem; }
}

/* ================================================================
   HEADER BUTTON
   ================================================================ */
/* NOTE: .header-btn is defined in the HERO HEADER section above (line ~261).
   The duplicate below was removed to prevent CSS override conflicts.
*/

/* ================================================================
   FEEDBACK MODAL
   ================================================================ */
.feedback-modal-content {
    max-width: 520px;
}

.feedback-field {
    margin-bottom: 0.9rem;
}

.feedback-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.feedback-input,
.feedback-textarea {
    width: 100%;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.8rem;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    line-height: 1.5;
    transition: border-color 0.25s, box-shadow 0.25s;
    outline: none;
}

.feedback-input::placeholder,
.feedback-textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.feedback-input:focus,
.feedback-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.feedback-textarea {
    resize: vertical;
    min-height: 80px;
}

.star-rating {
    display: flex;
    gap: 0.25rem;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    user-select: none;
}

.star-rating .star {
    color: var(--border-hover);
    transition: color 0.2s, transform 0.2s;
}

.star-rating .star.active {
    color: var(--accent-secondary);
    text-shadow: 0 0 8px var(--accent-secondary-soft);
}

.star-rating .star:hover {
    transform: scale(1.2);
}

.feedback-submit {
    width: 100%;
    padding: 0.7rem;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent), #3d9be8);
    border: none;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: all 0.25s var(--ease-out);
    box-shadow: 0 4px 16px rgba(91, 184, 255, 0.25);
}

.feedback-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(91, 184, 255, 0.35);
}

.feedback-submit:active {
    transform: scale(0.98);
}

.feedback-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-hover), transparent);
    margin-bottom: 1rem;
}

.feedback-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.feedback-count {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-xs);
    background: var(--accent-soft);
    color: var(--accent);
}

.feedback-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 0.3rem;
}

.feedback-item {
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 0.9rem;
    transition: border-color 0.25s;
    min-width: 0;
}

.feedback-item:hover {
    border-color: var(--border-hover);
}

.feedback-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    flex-wrap: wrap;
}

.feedback-item-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.feedback-item-stars {
    font-size: 0.85rem;
    color: var(--accent-secondary);
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.feedback-item-time {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.feedback-item-message {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.6;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* ================================================================
   HISTORY MODAL
   ================================================================ */
.history-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.history-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.history-modal-content {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-raised), 0 0 60px rgba(0,0,0,0.5);
    width: 100%;
    max-width: 640px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: cardEnter 0.35s var(--ease-out) both;
}

.history-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-raised);
    flex-shrink: 0;
}

.history-modal-header span {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-primary);
}

.history-modal-close {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 1.9rem;
    height: 1.9rem;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s var(--ease-out);
    padding: 0;
}

.history-modal-close:hover {
    color: var(--down);
    border-color: var(--down);
    background: var(--down-soft);
    transform: scale(1.1);
}

.history-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    min-height: 0;
}

.history-item {
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.9rem 1rem;
    margin-bottom: 0.7rem;
    transition: border-color 0.25s, transform 0.2s;
    min-width: 0;
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
}

.history-item-thumb {
    width: 72px;
    height: 96px;
    object-fit: cover;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--surface);
}

.history-item-content {
    flex: 1;
    min-width: 0;
}

.history-item:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.history-item.history-current {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 12px var(--accent-glow);
}

.history-item-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
    flex-wrap: wrap;
}

.history-item-date {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.03em;
}

.history-item-badge {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 0.12rem 0.45rem;
    border-radius: var(--radius-xs);
    flex-shrink: 0;
    font-family: var(--font-mono);
}

.history-item-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    line-height: 1.35;
}

.history-item-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    font-family: var(--font-mono);
    font-weight: 500;
    letter-spacing: 0.02em;
}

.history-item-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.6;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* ================================================================
   PRINT
   ================================================================ */
@media print {
    header, footer { display: none; }
    .card { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
    body { background: #fff; color: #000; }
}

/* ================================================================
   Idiom Comic Styles — 4-Panel Comic Strip with Images
   ================================================================ */

.comic-strip {
    background: #f5f0e6;
    border: 3px solid #1a1a1a;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 0.8rem;
}

.comic-strip-header {
    text-align: center;
    border-bottom: 2px solid #1a1a1a;
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.comic-idiom {
    font-family: "Comic Sans MS", "Chalkboard SE", "Marker Felt", cursive, sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    color: #1a1a1a;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.comic-meaning {
    font-size: 0.78rem;
    color: #555;
    margin-top: 3px;
    font-style: italic;
}

.comic-example {
    font-size: 0.75rem;
    color: #666;
    text-align: center;
    font-style: italic;
    margin: 8px 0 10px;
    padding: 6px 10px;
    background: rgba(0,0,0,0.04);
    border-radius: 6px;
    border-left: 3px solid #d4a017;
}

.comic-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.comic-panel {
    background: #fff;
    border: 2px solid #1a1a1a;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.comic-panel-number {
    position: absolute;
    top: 4px;
    left: 4px;
    background: #1a1a1a;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-family: var(--font-mono);
    z-index: 2;
}

.comic-panel-image {
    width: 100%;
    aspect-ratio: 2 / 3;
    background: #e8e4d9;
    overflow: hidden;
    border-bottom: 2px solid #1a1a1a;
}

.comic-panel-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.comic-panel-caption {
    font-family: "Comic Sans MS", "Chalkboard SE", "Marker Felt", cursive, sans-serif;
    font-size: 0.82rem;
    color: #1a1a1a;
    line-height: 1.5;
    padding: 10px 12px;
    background: #fff;
    flex: 1;
}

/* Alternate panel backgrounds for visual rhythm */
.comic-panel:nth-child(1) { background: #fff; }
.comic-panel:nth-child(2) { background: #faf8f3; }
.comic-panel:nth-child(3) { background: #faf8f3; }
.comic-panel:nth-child(4) { background: #fff; }

/* Mobile: stack panels */
@media (max-width: 480px) {
    .comic-panels {
        grid-template-columns: 1fr;
    }
}

/* ================================================================
   Comic Viewer — History modal flip-through reader
   ================================================================ */
.comic-viewer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem;
}

.comic-viewer .comic-meta {
    text-align: center;
    margin-bottom: 0.3rem;
}

.comic-viewer .comic-idiom {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

.comic-viewer .comic-meaning {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 2px;
}

.comic-panel-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    max-width: 400px;
}

.comic-nav-btn {
    background: var(--surface-raised);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.comic-nav-btn:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}

.comic-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.comic-panel-counter {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    font-family: var(--font-mono);
    letter-spacing: 0.05em;
}

.comic-viewer .comic-panel {
    background: #f5f0e6;
    border: 2px solid #1a1a1a;
    border-radius: 6px;
    overflow: hidden;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
}

.comic-panel-img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    display: block;
    border-bottom: 2px solid #1a1a1a;
    background: #e8e4d9;
}

.comic-no-img {
    width: 100%;
    aspect-ratio: 2 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: #e8e4d9;
    border-bottom: 2px solid #1a1a1a;
    color: #999;
}

.comic-viewer .comic-speaker {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent);
    padding: 8px 12px 2px;
    font-family: "Noto Sans SC", "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.comic-viewer .comic-text {
    font-size: 0.9rem;
    color: #1a1a1a;
    padding: 4px 12px 12px;
    line-height: 1.5;
    font-family: "Comic Sans MS", "Chalkboard SE", "Marker Felt", "Noto Sans SC", "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", cursive, sans-serif;
}

.comic-back-btn {
    background: var(--surface-raised);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.3rem;
}

.comic-back-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}

@media (max-width: 480px) {
    .comic-viewer .comic-panel {
        max-width: 100%;
    }
    .comic-nav-btn {
        padding: 0.45rem 0.7rem;
        font-size: 0.75rem;
    }
}


/* ---- Comic Tabs ---- */
.comic-tabs {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
    padding: 0.25rem;
    background: var(--surface-raised);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.comic-tab {
    flex: 1;
    padding: 0.45rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    white-space: nowrap;
}

.comic-tab:hover {
    color: var(--text-secondary);
    background: var(--surface-hover);
}

.comic-tab.active {
    color: var(--accent);
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
