/* ═══════════════════════════════════════════
   DocsCatchup — Design System
   Mobile-first, dark, glassmorphic
   ═══════════════════════════════════════════ */

/* ── Tokens ── */
:root {
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Colors */
    --glass-bg: rgba(12, 12, 20, 0.55);
    --glass-bg-strong: rgba(12, 12, 20, 0.75);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-hover: rgba(255, 255, 255, 0.15);
    --glass-blur: 20px;
    --glass-saturate: 1.4;

    --text-primary: rgba(255, 255, 255, 0.95);
    --text-secondary: rgba(255, 255, 255, 0.55);
    --text-muted: rgba(255, 255, 255, 0.35);

    --accent: #7c8cf8;
    --accent-glow: rgba(124, 140, 248, 0.4);
    --accent-warm: #f0a050;
    --success: #4ade80;
    --danger: #f87171;
    --warning: #fbbf24;

    /* Spacing */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --bar-height: 100px;         /* toggle pill + coach row */
    --header-height: 100px;
    --feed-pad-x: 16px;

    /* Radius */
    --radius-card: 20px;
    --radius-pill: 50px;
    --radius-btn: 14px;

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --duration-fast: 0.25s;
    --duration-normal: 0.4s;
    --duration-slow: 0.6s;
    --duration-bg: 2.5s;
}

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

html, body {
    height: 100%;
    overflow: hidden;
    font-family: var(--font);
    color: var(--text-primary);
    background: #080810;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

/* ═══════════════════════════════════════════
   Layer 0 — Animated Gradient Background
   ═══════════════════════════════════════════ */
.bg-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.bg-panel {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-gradient, linear-gradient(180deg, #6A82FB, #FC5C7D));
    background-size: 100% 140%;
    animation: gradientFlow 40s ease-in-out infinite;
    transition: opacity 3s ease-in-out;
}

.bg-panel.bg-hidden { opacity: 0; }
.bg-panel.bg-visible { opacity: 1; }

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

/* Logo watermark — centered, subtle */
.bg-logo {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 97px;
    background: url('logo.png') center/contain no-repeat;
    opacity: 0.25;
    filter: brightness(10) grayscale(1);
    pointer-events: none;
    z-index: 1;
}

/* Subtle dark gradient for text legibility */
.bg-layer::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.25) 0%,
        rgba(0, 0, 0, 0.05) 30%,
        rgba(0, 0, 0, 0.05) 60%,
        rgba(0, 0, 0, 0.35) 100%
    );
    pointer-events: none;
    z-index: 2;
}

/* ═══════════════════════════════════════════
   Context Header — FIXED, does not scroll
   ═══════════════════════════════════════════ */
.context-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1;
    padding: calc(var(--safe-top) + 16px) 16px 12px;
    text-align: center;
    pointer-events: none;
}

.context-header .greeting {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.6);
    margin-bottom: 10px;
}

.context-header .context-icon-row {
    font-size: 1.6rem;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
}

.context-header .context-insight {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.55);
    font-style: italic;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
    letter-spacing: 0.02em;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    max-width: 280px;
    text-align: center;
    width: 100%;
}

.context-header .context-insight.visible {
    opacity: 1;
    transform: translateY(0);
}

.context-header .context-insight.severity-warning {
    color: rgba(251, 191, 36, 0.7);
}

.context-header .context-insight.severity-alert {
    color: rgba(248, 113, 113, 0.75);
}

/* ═══════════════════════════════════════════
   Layer 1 — Scrollable Feed
   ═══════════════════════════════════════════ */
.feed {
    position: relative;
    z-index: 3;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: calc(var(--safe-top) + var(--header-height) + 8px) var(--feed-pad-x) calc(var(--bar-height) + var(--safe-bottom) + 100px);
}

.feed::-webkit-scrollbar { width: 0; }

/* ── Widget Cards (Solid) ── */
.widget-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    margin-bottom: 14px;
    overflow: hidden;
    transform-origin: top center;
    transition:
        transform var(--duration-normal) var(--ease-out),
        opacity var(--duration-normal) ease,
        max-height var(--duration-slow) var(--ease-out),
        margin var(--duration-slow) var(--ease-out);
    will-change: transform, opacity;
}

/* New widget entrance — scale up from slightly small + fade */
.widget-card.widget-entering {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
    transform: scale(0.95) translateY(-10px);
    overflow: hidden;
    pointer-events: none;
}

.widget-card.widget-entered {
    max-height: 5000px;
    opacity: 1;
    margin-bottom: 14px;
    transform: scale(1) translateY(0);
    transition:
        transform 0.5s var(--ease-spring),
        opacity 0.45s ease-out,
        max-height 0.55s var(--ease-out),
        margin 0.55s var(--ease-out);
}

/* Widget exit animation — collapse and fade */
.widget-card.widget-exiting {
    max-height: 0 !important;
    opacity: 0;
    margin-bottom: 0;
    transform: scale(0.95) translateY(-5px);
    pointer-events: none;
    transition:
        transform 0.35s var(--ease-out),
        opacity 0.3s ease-out,
        max-height 0.4s var(--ease-out),
        margin 0.4s var(--ease-out);
}

/* Widget content update — subtle pulse */
.widget-card.widget-content-updating {
    animation: widgetPulse 0.4s ease-out;
}

@keyframes widgetPulse {
    0% { transform: scale(1); }
    30% { transform: scale(1.008); }
    100% { transform: scale(1); }
}

.widget-card:active {
    transform: scale(0.98);
}

.widget-card .widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
}

.widget-card .widget-header .widget-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
}

.widget-card .widget-header .widget-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.widget-card .widget-body {
    padding: 0 16px 14px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.widget-card .widget-footer {
    display: flex;
    gap: 8px;
    padding: 0 16px 14px;
    justify-content: flex-end;
}

.widget-card .widget-footer .widget-action {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--radius-btn);
    cursor: pointer;
    text-align: center;
    transition: background 0.2s;
    font-family: var(--font);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.widget-card .widget-footer .widget-action.icon-only {
    padding: 8px;
    min-width: 36px;
    justify-content: center;
}

.widget-card .widget-footer .widget-action.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.widget-card .widget-footer .widget-action.primary:active {
    background: #7c3aed;
}

.widget-card .widget-footer .widget-action:active {
    background: rgba(255, 255, 255, 0.12);
}

/* Upload request card */
.upload-actions {
    display: flex;
    gap: 8px;
    padding: 8px 14px 14px;
}

.upload-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.upload-btn .material-symbols-rounded {
    font-size: 22px;
    color: var(--accent);
}

.upload-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.upload-btn:active {
    transform: scale(0.95);
    background: rgba(124, 58, 237, 0.15);
    border-color: var(--accent);
}

/* ── Activity Feed ── */
#activityFeed {
    padding: 0 16px;
}

.activity-line {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 12px;
    color: rgba(255,255,255,0.45);
    transition: opacity 0.5s ease, transform 0.3s ease, max-height 0.5s ease;
    max-height: 40px;
    overflow: hidden;
}

.activity-entering {
    opacity: 0;
    transform: translateY(-8px);
    max-height: 0;
}

.activity-fading {
    opacity: 0;
    transform: translateY(-4px);
    max-height: 0;
    padding: 0;
}

.activity-running { color: rgba(255,255,255,0.55); }
.activity-done { color: rgba(16,185,129,0.7); }
.activity-error-line { color: rgba(239,68,68,0.6); }

.activity-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 1.5px solid rgba(255,255,255,0.15);
    border-top-color: rgba(168,85,247,0.7);
    border-radius: 50%;
    animation: activitySpin 0.8s linear infinite;
    flex-shrink: 0;
}

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

.activity-check {
    font-size: 11px;
    font-weight: 700;
    color: rgba(16,185,129,0.8);
    flex-shrink: 0;
    width: 12px;
    text-align: center;
}

.activity-error {
    font-size: 11px;
    font-weight: 700;
    color: rgba(239,68,68,0.7);
    flex-shrink: 0;
    width: 12px;
    text-align: center;
}

.activity-text {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Sources Panel (knowledge tool citations) ── */
.sources-panel {
    margin: 4px 0 8px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    overflow: hidden;
    transition: opacity 0.5s ease, transform 0.3s ease, max-height 0.5s ease;
}

.sources-summary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    font-size: 11px;
    color: rgba(168,85,247,0.7);
    cursor: pointer;
    list-style: none;
    user-select: none;
    -webkit-user-select: none;
}

.sources-summary::-webkit-details-marker { display: none; }

.sources-list {
    padding: 0 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.source-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,0.55);
    font-size: 11px;
    text-decoration: none;
    padding: 4px 0;
    border-top: 1px solid rgba(255,255,255,0.04);
    transition: color 0.2s;
}

.source-link:first-child { border-top: none; }

.source-link:active { color: rgba(168,85,247,0.9); }

.source-link-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.source-excerpt {
    font-size: 10px;
    color: rgba(255,255,255,0.3);
    line-height: 1.4;
    padding: 2px 0 4px 18px;
    font-style: italic;
}

/* ── Emotion Pulse Widget ── */
.emo-pulse-widget {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 20px;
}

.emo-pulse-ring {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    animation: emoPulseGlow 2s ease-in-out infinite;
}

@keyframes emoPulseGlow {
    0%, 100% { filter: drop-shadow(0 0 6px var(--pulse-color)); opacity: 0.85; }
    50% { filter: drop-shadow(0 0 16px var(--pulse-color)); opacity: 1; }
}

.emo-emoji-core {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    z-index: 1;
    animation: emoEmojiBreathe 3s ease-in-out infinite;
}

@keyframes emoEmojiBreathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.emo-ring-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.emo-ring-bg {
    fill: none;
    stroke: rgba(255,255,255,0.08);
    stroke-width: 4;
}

.emo-ring-fill {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dasharray 1s ease, stroke 1s ease;
}

.emo-pulse-info {
    flex: 1;
    min-width: 0;
}

.emo-primary-label {
    font-size: 18px;
    font-weight: 600;
    color: rgba(255,255,255,0.95);
    letter-spacing: 0.3px;
}

.emo-intensity-label {
    font-size: 12px;
    color: rgba(255,255,255,0.45);
    margin-top: 2px;
}

.emo-secondary {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 4px 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    width: fit-content;
}

.emo-sec-emoji { font-size: 16px; }
.emo-sec-label { font-size: 12px; color: rgba(255,255,255,0.6); }
.emo-sec-pct { font-size: 11px; color: rgba(255,255,255,0.35); }

.emo-meters {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.emo-meter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.emo-meter-label {
    font-size: 10px;
    color: rgba(255,255,255,0.4);
    width: 48px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.emo-meter-bar {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    position: relative;
    overflow: visible;
}

.emo-meter-fill {
    position: absolute;
    top: -2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: left 1s ease, width 1s ease;
}

.emo-meter-fill.emo-valence {
    background: linear-gradient(135deg, #f59e0b, #10b981);
    transform: translateX(-4px);
}

.emo-meter-fill.emo-energy {
    left: 0;
    top: 0;
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, rgba(99,102,241,0.6), rgba(168,85,247,0.8));
}

.emo-meter-center {
    position: absolute;
    left: 50%;
    top: -1px;
    width: 1px;
    height: 6px;
    background: rgba(255,255,255,0.15);
}

.emo-meter-value {
    font-size: 10px;
    color: rgba(255,255,255,0.5);
    width: 50px;
    text-align: right;
}

/* ── Biomarker Panel Widget ── */
.bio-summary {
    padding: 10px 16px 4px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.4;
}

.bio-scores {
    padding: 4px 16px 8px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.bio-score-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.bio-categories {
    padding: 0 12px 16px;
}

.bio-category {
    margin-bottom: 4px;
}

.bio-category-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 8px 4px 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.bio-category:first-child .bio-category-label {
    border-top: none;
}

.bio-marker {
    padding: 8px 4px 6px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
}

.bio-marker:active {
    background: rgba(255, 255, 255, 0.04);
}

.bio-marker-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bio-emoji {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

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

.bio-value {
    font-size: 0.82rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.bio-value small {
    font-weight: 400;
    font-size: 0.65rem;
    opacity: 0.7;
}

/* Range bar: Apple Health-style three-zone with optimal overlay */
.bio-range-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 3px;
    margin: 8px 4px 0 36px;
    position: relative;
    overflow: hidden;
}

.bio-zone {
    position: absolute;
    top: 0;
    height: 100%;
}

.bio-zone-low {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.35), rgba(245, 158, 11, 0.25));
    border-radius: 3px 0 0 3px;
}

.bio-zone-normal {
    background: rgba(34, 197, 94, 0.15);
}

.bio-zone-high {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.25), rgba(239, 68, 68, 0.35));
    border-radius: 0 3px 3px 0;
}

.bio-zone-optimal {
    background: rgba(34, 197, 94, 0.35);
    border-radius: 2px;
}

/* Value dot */
.bio-dot {
    position: absolute;
    top: -4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    transform: translateX(-7px);
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.4), 0 0 12px currentColor;
    border: 2px solid rgba(0, 0, 0, 0.3);
    z-index: 1;
}

/* Range labels under bar */
.bio-range-labels {
    display: flex;
    justify-content: space-between;
    margin: 3px 4px 0 36px;
    font-size: 0.58rem;
    color: var(--text-muted);
    opacity: 0.5;
}

.bio-range-labels span:nth-child(2) {
    font-style: italic;
    letter-spacing: 0.03em;
}

/* Trend arrow */
.bio-trend {
    font-size: 0.7rem;
    margin-left: 4px;
    opacity: 0.6;
}

/* Expandable detail row */
.bio-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    margin-left: 36px;
}

.bio-detail.expanded {
    max-height: 100px;
    opacity: 1;
    padding-top: 6px;
}

.bio-detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 1px 4px;
}

.bio-detail-row.bio-score {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.04em;
}

/* Top actions */
.bio-actions {
    padding: 8px 16px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.bio-actions-title {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.bio-action-item {
    font-size: 0.78rem;
    color: var(--accent-light, #a78bfa);
    padding: 2px 0;
}

/* ── Supplement Stack Widget ── */
.supp-list {
    padding: 0 12px 8px;
}

.supp-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.supp-item:last-of-type {
    border-bottom: none;
}

.supp-thumb {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.supp-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.supp-thumb-placeholder .material-symbols-rounded {
    font-size: 22px;
}

.supp-info {
    flex: 1;
    min-width: 0;
}

.supp-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.supp-brand {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 11px;
    line-height: 1.3;
}

.supp-dose {
    font-size: 11.5px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.supp-expand-btn {
    padding: 4px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s;
}

.supp-expand-btn:active {
    background: rgba(255, 255, 255, 0.1);
}

.supp-nutrients {
    padding: 2px 12px 10px 60px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.25s ease, padding 0.3s ease;
    padding-top: 0;
    padding-bottom: 0;
}

.supp-nutrients.expanded {
    max-height: 500px;
    opacity: 1;
    padding-top: 2px;
    padding-bottom: 10px;
}

.supp-nutrient-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 3px 0;
    font-size: 11.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.supp-nutrient-row:last-child {
    border-bottom: none;
}

.supp-nutrient-amount {
    color: var(--accent);
    font-weight: 600;
    font-size: 11px;
    min-width: 52px;
    font-variant-numeric: tabular-nums;
}

.supp-nutrient-name {
    color: var(--text-secondary);
    font-weight: 400;
}

/* ── Diet Plan Widget ── */
.diet-cal-badge {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    padding: 12px 16px 4px;
}

.diet-style-badge {
    font-size: 0.65rem;
    font-weight: 500;
    padding: 2px 8px;
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent);
    border-radius: 20px;
    margin-left: 6px;
    vertical-align: middle;
}

.diet-macros {
    padding: 8px 16px 12px;
}

.macro-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.macro-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    width: 48px;
    flex-shrink: 0;
}

.macro-bar-wrap {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
}

.macro-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s var(--ease-out);
}

.macro-protein { background: linear-gradient(90deg, #6366f1, #818cf8); }
.macro-carbs { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.macro-fat { background: linear-gradient(90deg, #10b981, #34d399); }

.macro-val {
    font-size: 10.5px;
    color: var(--text-muted);
    width: 65px;
    text-align: right;
    flex-shrink: 0;
}

.diet-lists {
    display: flex;
    gap: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.diet-list-col {
    flex: 1;
    padding: 10px 14px;
}

.diet-list-col:first-child {
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.diet-list-header {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.diet-list-item {
    font-size: 12px;
    color: var(--text-primary);
    padding: 3px 0;
    line-height: 1.4;
}

.diet-list-item.include::before {
    content: '• ';
    color: #10b981;
}

.diet-list-item.avoid::before {
    content: '• ';
    color: #ef4444;
}

/* Diet Plan — Meals */
.diet-meals { padding: 10px 14px 0; }
.diet-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.diet-meal-block {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 6px;
}

.diet-meal-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.diet-meal-time {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    min-width: 42px;
}

.diet-meal-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
}

.diet-meal-foods {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
    padding-left: 50px;
}

.diet-meal-food {
    font-size: 10.5px;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(16, 185, 129, 0.08);
    color: #34d399;
}

.diet-meal-note {
    font-size: 10.5px;
    color: var(--text-muted);
    padding-left: 50px;
    margin-top: 2px;
}

/* Diet Plan — Allergies */
.diet-allergies { padding: 10px 14px 0; }
.diet-allergy-list { display: flex; flex-wrap: wrap; gap: 4px; }
.diet-allergy-tag {
    font-size: 10.5px;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    font-weight: 500;
}

.diet-notes {
    padding: 8px 14px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.diet-note {
    font-size: 11.5px;
    color: var(--text-secondary);
    padding: 2px 0;
}

/* Widget meta time-ago */
.widget-meta-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
}

.widget-meta-group .widget-meta { font-size: 0.7rem; }
.widget-meta-group .widget-timeago {
    font-size: 0.65rem;
    color: var(--text-muted);
    opacity: 0.7;
}

/* Day headers */
.day-header {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 16px 4px 6px;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

/* Widget state: logged */
.widget-card.state-logged { border-color: rgba(74, 222, 128, 0.15); }
.widget-card.state-logged .widget-header .widget-meta { color: var(--success); }

/* Widget state: faded */
.widget-card.state-faded { opacity: 0.5; }

/* ── Fluid Widgets ── */
.widget-fluid {
    padding: 12px 4px;
    margin-bottom: 14px;
    animation: widgetEnter 0.5s var(--ease-out) both;
}

.widget-fluid .fluid-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

.widget-fluid .fluid-content {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

/* ── Exposure Widget (Apple Weather style) ── */
.exposure-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 2px 16px 12px;
}

.exposure-metric {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.exposure-metric-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.exposure-metric-data {
    min-width: 0;
}

.exposure-metric-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.2;
}

.exposure-metric-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.exposure-gauge-wrap {
    flex-shrink: 0;
    width: 44px;
    height: 36px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.exposure-gauge-value {
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    margin-top: -2px;
}

.exposure-footnote {
    padding: 0 16px 12px;
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.7;
}

/* ── Collapsible Menu Section ── */
.widget-menu-section {
    padding: 0 16px 12px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.widget-menu-section.hidden {
    display: none;
}

.widget-menu-content {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-height: 300px;
    overflow-y: auto;
}

.widget-menu-content h3, .widget-menu-content h4 {
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    margin: 10px 0 4px;
    padding-bottom: 3px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.widget-menu-content h3:first-child, .widget-menu-content h4:first-child {
    margin-top: 0;
}

.widget-menu-content ul, .widget-menu-content ol {
    margin: 4px 0;
    padding-left: 16px;
}

.widget-menu-content li {
    margin: 2px 0;
}

.widget-menu-content strong, .widget-menu-content b {
    color: var(--text-primary);
    font-weight: 600;
}

.widget-menu-content p {
    margin: 4px 0;
}

.widget-menu-content em {
    color: var(--accent);
    font-style: normal;
    font-size: 0.75rem;
}

/* ── Alcohol Widget ── */
.alcohol-hero {
    text-align: center;
    padding: 8px 16px 4px;
}

.alcohol-total {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1;
}

.alcohol-unit {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 2px;
}

.alcohol-status {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 6px;
}

.alcohol-bar-wrap {
    padding: 8px 16px 4px;
}

.alcohol-bar-track {
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.alcohol-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease, background 0.3s ease;
}

.alcohol-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.6rem;
    color: var(--text-muted);
    opacity: 0.5;
    margin-top: 3px;
    padding: 0 2px;
}

.alcohol-entries {
    padding: 8px 16px 12px;
}

.alcohol-entry {
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.alcohol-entry:last-child {
    border-bottom: none;
}

/* ── Empty Prompt Card (positioned above bottom bar) ── */
.prompt-card {
    position: fixed;
    bottom: calc(var(--bar-height) + var(--safe-bottom) + 32px);
    left: var(--feed-pad-x);
    right: var(--feed-pad-x);
    z-index: 5;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    padding: 18px 20px 14px;
    text-align: center;
    overflow: visible;
    animation: promptSlideUp 0.8s var(--ease-out) 0.3s both;
    transition: opacity 0.4s ease, transform 0.4s var(--ease-out);
}

.prompt-card.hidden {
    opacity: 0;
    transform: translateY(30px);
    pointer-events: none;
}

.prompt-card .prompt-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.prompt-card .prompt-arrow {
    position: absolute;
    bottom: -28px;
    left: calc(-1 * var(--feed-pad-x));
    right: calc(-1 * var(--feed-pad-x));
    display: flex;
    justify-content: center;
    color: var(--accent);
    animation: promptBounce 2s ease-in-out infinite;
    filter: drop-shadow(0 2px 8px rgba(168, 85, 247, 0.4));
    pointer-events: none;
}

.prompt-card .prompt-arrow .material-symbols-rounded {
    font-size: 36px;
}

@keyframes promptSlideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes promptBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* ═══════════════════════════════════════════
   Coach Bar — Two-mode system (Specialist / Omni)
   ═══════════════════════════════════════════ */

.coach-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    padding: 0 6px calc(var(--safe-bottom) + 6px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    transition: transform 0.4s var(--ease-bounce), opacity 0.3s ease;
    /* Consistent height prevents jump when switching modes */
    min-height: var(--bar-height);
    justify-content: flex-end;
}

/* ── Bar hidden state (omni session active — slide off screen) ── */
.coach-bar.bar-hidden {
    transform: translateY(calc(100% + 20px));
    opacity: 0;
    pointer-events: none;
}

/* ── Mode Toggle Pill ── */
.coach-mode-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.3s ease;
    margin-bottom: 8px;   /* gap between pill and coach row */
    flex-shrink: 0;
}

.coach-mode-toggle:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.14);
}

.mode-toggle-icon {
    font-size: 16px;
    transition: all 0.35s var(--ease-bounce);
    line-height: 1;
}

/* specialist mode → show all_inclusive (non-omni), hide diversity_3 (omni-icon) */
.mode-toggle-icon.omni-icon { display: none; }
/* omni mode → show diversity_3, hide all_inclusive */
.coach-bar.omni-mode .mode-toggle-icon:not(.omni-icon) { display: none; }
.coach-bar.omni-mode .mode-toggle-icon.omni-icon { display: block; }

/* ── Specialist row ── */
.coach-specialists {
    display: flex;
    align-items: flex-end;
    justify-content: space-evenly;
    width: 100%;
    padding-top: 8px;
    transition: opacity 0.3s ease, transform 0.4s var(--ease-bounce);
    transform-origin: center bottom;
}

/* ── Omni mode container ── */
.coach-omni {
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 8px 0 4px;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.4s ease, transform 0.45s var(--ease-bounce);
}

/* When omni mode active */
.coach-bar.omni-mode .coach-specialists {
    opacity: 0;
    transform: scale(0.85);
    pointer-events: none;
    display: none;
}

.coach-bar.omni-mode .coach-omni {
    display: flex;
    opacity: 1;
    transform: scale(1);
}

/* ── Coach Buttons (Specialist — 6 coaches, slightly larger than old 7) ── */
.coach-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    padding: 0;
    min-width: 0;
    flex: 1;
    max-width: 62px;
    transition: transform 0.35s var(--ease-bounce), color 0.25s ease;
}

.coach-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.35s var(--ease-bounce);
}

.coach-icon .material-symbols-rounded {
    font-size: 24px;
    transition: all 0.3s var(--ease-bounce);
}

.coach-label {
    font-size: 0.58rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    opacity: 0.55;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.coach-btn:active .coach-icon {
    transform: scale(0.82);
}

/* ── Active Coach — lifts up + scales + glows ── */
.coach-btn.active {
    color: white;
    transform: translateY(-10px);
}

.coach-btn.active .coach-icon {
    width: 58px;
    height: 58px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.85), rgba(139, 92, 246, 0.85));
    border: 1.5px solid rgba(139, 92, 246, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow:
        0 4px 20px rgba(99, 102, 241, 0.35),
        0 0 40px rgba(139, 92, 246, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: coachPulse 2.5s ease-in-out infinite;
}

.coach-btn.active .coach-icon .material-symbols-rounded {
    font-size: 30px;
    color: white;
}

.coach-btn.active .coach-label {
    opacity: 0;
    font-size: 0;
    height: 0;
}

@keyframes coachPulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35), 0 0 40px rgba(139, 92, 246, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
    50% {
        box-shadow: 0 6px 30px rgba(99, 102, 241, 0.5), 0 0 60px rgba(139, 92, 246, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
}

/* ── OMNI button — large centred ── */
.coach-omni-btn {
    max-width: 100px !important;
    flex: none !important;
}

.coach-omni-icon {
    width: 72px !important;
    height: 72px !important;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(139, 92, 246, 0.25)) !important;
    border: 1px solid rgba(139, 92, 246, 0.3) !important;
}

.coach-omni-icon .material-symbols-rounded {
    font-size: 34px !important;
}

.coach-omni-btn.active .coach-omni-icon,
.coach-omni-btn:not(.active) .coach-omni-icon {
    /* Always use the large size */
    width: 72px !important;
    height: 72px !important;
}

.coach-omni-btn.active {
    transform: translateY(-8px);
}

.coach-omni-btn.active .coach-omni-icon {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.85), rgba(139, 92, 246, 0.85)) !important;
    border: 1.5px solid rgba(139, 92, 246, 0.6) !important;
    box-shadow:
        0 6px 32px rgba(99, 102, 241, 0.45),
        0 0 60px rgba(139, 92, 246, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
    animation: coachPulse 2.5s ease-in-out infinite !important;
}

/* ── Session states ── */
.coach-btn.session-active .coach-icon {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.85), rgba(248, 113, 113, 0.85)) !important;
    border-color: rgba(248, 113, 113, 0.5) !important;
    box-shadow: 0 4px 24px rgba(248, 113, 113, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    animation: activeGlow 2s ease-in-out infinite;
}

.coach-btn.session-saving .coach-icon {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.85), rgba(251, 191, 36, 0.85)) !important;
    border-color: rgba(251, 191, 36, 0.5) !important;
    box-shadow: 0 4px 24px rgba(251, 191, 36, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    animation: savePulse 1.2s ease-in-out infinite;
}

.coach-btn.session-saved .coach-icon {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.85), rgba(74, 222, 128, 0.85)) !important;
    border-color: rgba(74, 222, 128, 0.5) !important;
    box-shadow: 0 4px 24px rgba(74, 222, 128, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* ── Top-right buttons (Product + Feedback) ── */
.top-right-btns {
    position: fixed;
    top: calc(var(--safe-top) + 14px);
    right: 14px;
    z-index: 11;
    display: flex;
    gap: 8px;
    align-items: center;
}

.top-icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.top-icon-btn .material-symbols-rounded { font-size: 20px; }
.top-icon-btn:active { transform: scale(0.9); color: var(--text-primary); }

/* ═══════════════════════════════════════════
   Live Session Overlay
   ═══════════════════════════════════════════ */
.session-overlay {
    position: fixed;
    /* Sit just above the coach bar — much closer to bottom */
    bottom: calc(var(--bar-height) + var(--safe-bottom) - 24px);
    left: 0;
    right: 0;
    z-index: 12;
    transform: translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.4s var(--ease-out), opacity 0.3s ease, visibility 0.3s,
                bottom 0.4s var(--ease-bounce);
    pointer-events: none;
}

/* In omni mode the bar is off-screen — session overlay drops to bottom of viewport */
body.omni-session .session-overlay {
    bottom: calc(var(--safe-bottom) + 8px);
}

.session-overlay.visible {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.session-panel {
    margin: 0 var(--feed-pad-x) 8px;
    background: var(--glass-bg-strong);
    backdrop-filter: blur(30px) saturate(1.6);
    -webkit-backdrop-filter: blur(30px) saturate(1.6);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    padding: 14px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
}

body.scanner-active .session-panel {
    padding: 8px 10px;
}

.session-agent-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

body.scanner-active .session-agent-icon {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
}

.session-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    transition: opacity 0.3s ease;
}

body.scanner-active .session-info {
    opacity: 0;
    /* Optional: hide name completely, but shrinking wave is usually enough */
    flex: 0 0 0px;
    margin: 0;
}

.session-agent-name {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.session-status {
    font-size: 0.7rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.session-wave {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 24px;
    flex-shrink: 0;
    transition: height 0.3s ease;
}

body.scanner-active .session-wave {
    height: 16px;
    margin-left: auto; /* Push it to the right if info shrinks */
}

.session-wave .wave-bar {
    width: 3px;
    background: var(--accent);
    border-radius: 2px;
    transition: height 0.1s ease;
}

/* ── Camera Viewfinder ── */
.viewfinder {
    width: 100%;
    max-height: 0;
    overflow: hidden;
    border-radius: var(--radius-card);
    position: relative;
    background: #000;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.4s ease,
                margin-bottom 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    margin-bottom: 0;
}

.viewfinder.active {
    max-height: 300px;
    opacity: 1;
    margin-bottom: 16px;
}

.viewfinder video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: var(--radius-card);
}

.viewfinder-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: var(--radius-card);
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.viewfinder-scanning {
    position: absolute;
    inset: 0;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.viewfinder-scanning.active {
    opacity: 1;
}

.scanning-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.8), transparent);
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.5);
    animation: scanLine 2.5s ease-in-out infinite;
}

@keyframes scanLine {
    0%, 100% { top: 10%; }
    50% { top: 90%; }
}

.viewfinder-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.2s ease;
}

.viewfinder-close .material-symbols-rounded {
    font-size: 16px;
}

.viewfinder-close:active {
    transform: scale(0.85);
}

/* ── Camera Button (Session Panel) ── */
.session-camera-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: rgba(168, 85, 247, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.3s ease;
}

body.scanner-active .session-camera-btn {
    width: 28px;
    height: 28px;
}

.session-camera-btn.active {
    background: rgba(168, 85, 247, 0.3);
    border-color: rgba(168, 85, 247, 0.6);
    color: #c084fc;
}

.session-camera-btn .material-symbols-rounded {
    font-size: 18px;
    transition: font-size 0.3s ease;
}

body.scanner-active .session-camera-btn .material-symbols-rounded {
    font-size: 14px;
}

.session-camera-btn:active {
    transform: scale(0.88);
}

.session-stop-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s ease;
}

body.scanner-active .session-stop-btn {
    width: 28px;
    height: 28px;
}

.session-stop-btn .material-symbols-rounded {
    font-size: 20px;
    transition: font-size 0.3s ease;
}

body.scanner-active .session-stop-btn .material-symbols-rounded {
    font-size: 16px;
}

.session-stop-btn:active {
    transform: scale(0.88);
    background: rgba(239, 68, 68, 0.4);
}

/* ═══════════════════════════════════════════
   Scanner Widget — Two Stage
   ═══════════════════════════════════════════ */

.scanner-widget {
    padding: 0;
}

/* ─── Stage 1: Category selection ─── */

.scanner-prompt {
    padding: 4px 16px 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.scanner-cat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 16px 12px;
}

.scanner-cat-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
}

.scanner-cat-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.scanner-cat-chip:active {
    transform: scale(0.97);
    background: rgba(167, 139, 250, 0.15);
}

.scanner-chip-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.scanner-chip-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scanner-hint {
    padding: 0 16px 14px;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    letter-spacing: 0.02em;
}

/* ─── Stage 2: Active scanning ─── */

.scanner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
}

.scanner-category {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.scanner-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

.scanner-back-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.scanner-back-btn:active {
    background: rgba(255, 255, 255, 0.04);
}

.scanner-cat-icon {
    font-size: 1.2rem;
}

.scanner-status {
    font-size: 8px;
    margin-left: 4px;
}

.scanner-status.scanning {
    color: #a78bfa;
    animation: statusPulse 1.5s ease-in-out infinite;
}

.scanner-status.done {
    color: #22c55e;
}

.scanner-status.paused {
    color: #94a3b8;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.scanner-count {
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.scanner-products {
    display: flex;
    flex-direction: column;
}

.scanner-product {
    padding: 10px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    cursor: default;
    transition: background 0.2s ease, opacity 0.3s ease;
}

.scanner-product:first-child {
    border-top: none;
}

.scanner-product.scanner-new {
    animation: scannerNewProduct 0.4s ease-out;
}

@keyframes scannerNewProduct {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.scanner-product-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.scanner-rating {
    font-size: 1.3rem;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
}

.scanner-product-info {
    flex: 1;
    min-width: 0;
}


.scanner-product-name {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scanner-product-brand {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 1px;
}

/* Score bar — thin gradient fill */
.scanner-score-bar {
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    margin-top: 5px;
    overflow: hidden;
}

.scanner-score-fill {
    height: 100%;
    border-radius: 2px;
    min-width: 0;
}

/* Score number on the right */
.scanner-score-num {
    font-size: 0.78rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    min-width: 24px;
    text-align: right;
    flex-shrink: 0;
}

.scanner-expand-icon {
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.scanner-expand-icon.rotated {
    transform: rotate(180deg);
}


.scanner-product-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.3s ease,
                opacity 0.3s ease;
    opacity: 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.6;
    padding: 0 0 0 38px;
}

.scanner-product-detail.expanded {
    max-height: 300px;
    opacity: 1;
    padding: 8px 0 4px 38px;
}

.scanner-empty {
    padding: 20px 16px;
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
}

.scanner-product[onclick] {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.scanner-product:active {
    background: rgba(255, 255, 255, 0.04);
}

.scanner-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 0;
}

.scanner-badges:empty {
    display: none;
}

.scanner-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    white-space: nowrap;
}

.scanner-badge.stack {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.scanner-badge.conflict {
    background: rgba(251, 146, 60, 0.15);
    color: #fb923c;
    border: 1px solid rgba(251, 146, 60, 0.25);
}


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

/* ═══════════════════════════════════════════

/* ═══════════════════════════════════════════
   Animations
   ═══════════════════════════════════════════ */
@keyframes widgetEnter {
    from { opacity: 0; transform: translateY(-20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ringPulse {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.5); opacity: 0; }
}

@keyframes activeGlow {
    0%, 100% { box-shadow: 0 4px 20px rgba(248, 113, 113, 0.3); }
    50% { box-shadow: 0 4px 30px rgba(248, 113, 113, 0.6); }
}

@keyframes savePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ═══════════════════════════════════════════
   Hamburger Menu + Dev Panel
   ═══════════════════════════════════════════ */
.menu-btn {
    position: fixed;
    top: calc(var(--safe-top) + 14px);
    left: 14px;
    z-index: 11;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.menu-btn .material-symbols-rounded { font-size: 22px; }
.menu-btn:active { transform: scale(0.9); color: var(--text-primary); }

.dev-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.dev-menu-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.dev-menu-panel {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(360px, 85vw);
    background: rgba(12, 12, 24, 0.97);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.dev-menu-overlay.visible .dev-menu-panel {
    transform: translateX(0);
}

.dev-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(var(--safe-top) + 16px) 20px 16px;
    border-bottom: 1px solid var(--glass-border);
}
.dev-menu-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}
.dev-menu-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Menu Items */
.dev-menu-items {
    flex: 1;
    overflow-y: auto;
    padding: 12px 12px calc(16px + var(--safe-bottom));
}
.dev-menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 4px;
    background: transparent;
    border: none;
    border-radius: 14px;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
}
.dev-menu-item:active {
    background: rgba(255, 255, 255, 0.08);
}
.dev-menu-item > .material-symbols-rounded:first-child {
    font-size: 24px;
    color: var(--accent);
    flex-shrink: 0;
}
.dev-menu-item-text {
    flex: 1;
    min-width: 0;
}
.dev-menu-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}
.dev-menu-item-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.dev-menu-arrow {
    font-size: 20px;
    color: var(--text-muted);
    flex-shrink: 0;
}
.dev-menu-item-danger > .material-symbols-rounded:first-child {
    color: #ef4444;
}
.dev-menu-item-danger .dev-menu-item-title {
    color: #ef4444;
}
.dev-menu-item-danger .dev-menu-item-desc {
    color: #fca5a5;
}

/* Content Area (detail view) */
.dev-menu-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 16px calc(16px + var(--safe-bottom));
}
.dev-menu-back {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 0;
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
}
.dev-menu-back .material-symbols-rounded { font-size: 20px; }
.dev-menu-content-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}
.dev-menu-content-body {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* File list items */
.file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 4px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.file-item:active { background: rgba(255, 255, 255, 0.08); }
.file-item .material-symbols-rounded {
    font-size: 20px;
    color: var(--accent);
    flex-shrink: 0;
}
.file-item-name {
    flex: 1;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-primary);
}
.file-item-size {
    font-size: 0.68rem;
    color: var(--text-muted);
}

/* File content viewer */
.file-content-block {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.72rem;
    line-height: 1.7;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 60vh;
    overflow-y: auto;
}

/* Debug rows (reused from old overlay) */
.debug-section { margin-bottom: 20px; }
.debug-section-title {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.debug-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.73rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.debug-key { color: var(--text-muted); flex-shrink: 0; margin-right: 12px; }
.debug-value { color: var(--text-secondary); text-align: right; word-break: break-word; }
.debug-loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ── Coach Config (Dev Tools) ── */
.coach-config-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
    cursor: default; /* Ensures iOS Safari treats this as an interactive region */
}

.coach-config-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.coach-config-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.coach-config-sub {
    font-size: 10.5px;
    color: var(--text-muted);
}

.coach-config-settings {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.coach-config-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.coach-config-label {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.coach-config-value {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: right;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.coach-voice-select {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    outline: none;
    cursor: pointer;
}

.coach-name-input {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    outline: none;
    width: 120px;
    transition: border-color 0.2s;
}

.coach-name-input:focus {
    border-color: var(--accent);
}

.coach-config-expand,
.coach-config-view-prompt {
    font-size: 10px;
    color: var(--accent);
    background: none;
    border: none;
    padding: 4px 0;
    cursor: pointer;
    text-align: left;
}

.coach-config-view-prompt {
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 8px;
    margin-top: 4px;
}

/* ── Rendered Markdown (Dev Tools) ── */
.md-rendered {
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.md-rendered h1 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 16px 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.md-rendered h2 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 14px 0 6px;
}

.md-rendered h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    margin: 12px 0 4px;
}

.md-rendered h4, .md-rendered h5 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 10px 0 4px;
}

.md-rendered p {
    margin: 6px 0;
}

.md-rendered strong {
    color: var(--text-primary);
    font-weight: 600;
}

.md-rendered em {
    font-style: italic;
    color: var(--text-secondary);
}

.md-rendered code {
    font-size: 11px;
    padding: 2px 6px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 4px;
    color: var(--accent);
}

.md-rendered ul {
    padding-left: 18px;
    margin: 4px 0;
}

.md-rendered li {
    margin: 2px 0;
    color: var(--text-secondary);
}

.md-rendered hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin: 16px 0;
}

/* ═══════════════════════════════════════════
   Utilities
   ═══════════════════════════════════════════ */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}

/* ── Pending supplement (researching state) ── */
.supp-item-pending {
    opacity: 0.75;
}

.supp-researching {
    color: var(--accent);
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    animation: researchPulse 1.8s ease-in-out infinite;
    display: inline-block;
}

@keyframes researchPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}/* ── IN-APP INVITE MODAL (Track A) ── */
.invite-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.3s ease;
}
.invite-modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}
.invite-modal-card {
    background: #111116;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 32px 24px;
    width: 90%;
    max-width: 380px;
    position: relative;
    box-shadow: 0 16px 40px rgba(0,0,0,0.5);
    text-align: center;
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.invite-modal-overlay.hidden .invite-modal-card {
    transform: scale(0.95);
}
.invite-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.invite-modal-close:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}
.invite-modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}
.invite-modal-brief {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    margin-bottom: 24px;
    line-height: 1.4;
}
.invite-generate-btn {
    background: var(--accent, #6B3A6B);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    transition: transform 0.1s, opacity 0.2s;
}
.invite-generate-btn:active {
    transform: scale(0.98);
}
.invite-generate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.invite-quota-text {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    margin-top: 12px;
}
.invite-error-text {
    color: #e57373;
    font-size: 14px;
    padding: 12px;
    background: rgba(229,115,115,0.1);
    border-radius: 8px;
}
.invite-qr-container {
    background: #fff;
    padding: 12px;
    border-radius: 16px;
    display: inline-block;
    margin-bottom: 20px;
}
.invite-qr-container img {
    display: block;
    width: 220px;
    height: 220px;
}
.invite-pill-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.invite-url-pill {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    color: rgba(255,255,255,0.8);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}
.invite-copy-btn {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}
.invite-copy-btn:hover {
    background: rgba(255,255,255,0.2);
}
.invite-expiry-text {
    font-size: 13px;
    color: #a5d6a7;
    margin-bottom: 24px;
}
.invite-reset-btn {
    background: transparent;
    color: rgba(255,255,255,0.5);
    border: none;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
}
.invite-reset-btn:hover {
    color: rgba(255,255,255,0.8);
}
