:root, body.dark-mode {
    --bg-top: #050a18;
    --bg-bottom: #030611;
    --ink: #ffffff;
    --muted-ink: #94a3b8;
    --panel: rgba(255, 255, 255, 0.03);
    --panel-border: rgba(255, 255, 255, 0.1);
    --brand-navy: #050a18;
    --brand-gold: #ffd700;
    --bot-start: rgba(255, 255, 255, 0.05);
    --bot-end: rgba(255, 255, 255, 0.02);
    --bot-text: #ffffff;
    --user-start: rgba(255, 215, 0, 0.15);
    --user-end: rgba(255, 215, 0, 0.05);
    --composer-bg: rgba(255, 255, 255, 0.05);
    --composer-border: rgba(255, 255, 255, 0.1);
    --chip-bg: rgba(255, 215, 0, 0.1);
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-strong: 0 16px 48px rgba(0, 0, 0, 0.5);
    --hero-shadow: 0 8px 32px rgba(255, 215, 0, 0.05);
    --bot-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    --user-shadow: 0 4px 16px rgba(255, 215, 0, 0.05);
    /* Header & logo sizing controls */
    --topbar-height: 82px;
    --logo-wrap-height: 64px; /* height reserved for the logo box (won't expand layout) */
    --logo-scale: 2; /* visual scale applied to the image inside the reserved box */
    --logo-offset-x: -12px; /* move only the logo horizontally without shifting Eva/caption */
    --logo-offset-y: 0px; /* fine-tune vertical logo position inside the header */
}

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

html,
body {
    height: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--ink);
    background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
    overflow: hidden;
    position: relative;
    transition: background 220ms ease, color 220ms ease;
}

.bg-grid,
.bg-orb {
    position: absolute;
    pointer-events: none;
}

.bg-grid {
    inset: 0;
    background-image:
        linear-gradient(rgba(128, 144, 255, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(128, 144, 255, 0.12) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent 75%);
}

.bg-orb {
    border-radius: 999px;
    filter: blur(40px);
}

.bg-orb-1 {
    width: 280px;
    height: 280px;
    top: 6%;
    left: 8%;
    background: rgba(30, 113, 255, 0.22);
    animation: drift 9s ease-in-out infinite;
}

.bg-orb-2 {
    width: 320px;
    height: 320px;
    right: 7%;
    bottom: 11%;
    background: rgba(248, 215, 0, 0.2);
    animation: drift 11s ease-in-out infinite reverse;
}

.app-shell {
    width: 100%;
    height: 100vh;
    /* dynamic viewport so the composer isn't hidden behind the mobile keyboard */
    height: 100dvh;
    height: var(--app-height, 100dvh);
    margin: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    border-radius: 0;
    border: none;
    background: transparent;
    backdrop-filter: none;
    box-shadow: none;
    overflow: hidden;
    isolation: isolate;
}

.app-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 82% 22%, rgba(248, 215, 0, 0.12), transparent 42%);
    z-index: -1;
}

.app-shell::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 14% 88%, rgba(66, 122, 255, 0.2), transparent 42%),
        radial-gradient(circle at 86% 78%, rgba(248, 215, 0, 0.14), transparent 36%);
    z-index: -1;
}

.top-bar {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 1280px;
    display: flex;
    align-items: center;
    padding: 0.6rem 1.6rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(24px) saturate(180%);
    z-index: 50;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.top-row-main {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* ponytail: holds the (mobile-only) hamburger + logo together on the left */
.top-left {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

.logo-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: transform 200ms ease;
}

.logo-pill:hover {
    transform: translateY(-1px);
}

.logo-pill #logo {
    height: 48px;
    width: auto;
    object-fit: contain;
    transform: translateY(1px);
}

.logo-pill .logo-text {
    font-family: 'Inter', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    letter-spacing: 0.025em;
    margin-left: -15px;
}

/* ponytail: the wordmark is pinned to Inter — loaded via the Google Fonts link in the HTML heads */
.logo-text {
    font-family: 'Inter', sans-serif;
}

.brand-caption {
    font-family: "Poppins", sans-serif;
    font-size: 0.86rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--muted-ink);
}

.user-greeting {
    font-family: "Poppins", sans-serif;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #2c438e;
    margin-top: 0.05rem;
}

body.dark-mode .user-greeting {
    color: #d7e3ff;
}

.header-actions {
    display: flex;
    align-items: center;
    align-self: flex-end;
    margin-bottom: 0.5rem;
    margin-right: 0.65rem;
    gap: 0.6rem;
}

.status-pill {
    font-family: "Poppins", sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6e5b00;
    background: rgba(248, 215, 0, 0.35);
    border: 1px solid rgba(175, 140, 0, 0.3);
    border-radius: 999px;
    padding: 0.25rem 0.55rem;
}

.credits-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    min-width: 52px;
    justify-content: center;
    white-space: nowrap;
}

.credits-icon {
    color: currentColor;
    display: inline-flex;
    flex: none;
}

#creditsValue {
    font-variant-numeric: tabular-nums;
    min-width: 1ch;
    text-align: center;
    font-weight: bold;
}

/* Hide the number until it is authoritative (cached or server-confirmed) so a
   reload never flashes a wrong/default value before auth + wallet resolve. */
.credits-pill:not(.credits-ready) #creditsValue {
    visibility: hidden;
}

.credits-pill.depleted {
    opacity: 0.9;
}

.credits-pill.unlimited #creditsValue {
    font-size: 0.92rem;
    letter-spacing: 0.02em;
}

body.dark-mode .status-pill {
    color: #f8d700;
    background: rgba(248, 215, 0, 0.16);
    border-color: rgba(248, 215, 0, 0.28);
}

.icon-btn {
    width: 38px;
    height: 38px;
    border: 1px solid var(--panel-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 1rem;
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 180ms ease, box-shadow 200ms ease;
}

.icon-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

/* ponytail: theme toggle uses real lucide icons; CSS flips sun/moon by body class */
.theme-icon {
    width: 18px;
    height: 18px;
    color: currentColor;
}
body.dark-mode .theme-icon-sun { display: block; }
body.dark-mode .theme-icon-moon { display: none; }
body.light-mode .theme-icon-sun { display: none; }
body.light-mode .theme-icon-moon { display: block; }

.chat-stage {
    flex: 1;
    min-height: 0;
    padding: 0.4rem 0.8rem 0;
}

.chat-stage[hidden] {
    display: none !important;
}

.chat-container {
    width: min(940px, 100%);
    height: 100%;
    margin: 0 auto;
    overflow-y: auto;
    padding: 0.2rem 0.2rem 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(56, 76, 153, 0.55) transparent;
}

.hero-panel {
    width: min(92%, 760px);
    margin: 0 auto 0.28rem;
    padding: 0.95rem 1rem 0.85rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
    box-shadow: var(--hero-shadow);
    position: relative;
    z-index: 0;
    max-height: 230px;
    overflow: hidden;
    transition: transform 220ms ease, opacity 220ms ease, max-height 240ms ease, padding 220ms ease, margin 220ms ease, background 220ms ease;
}

body.dark-mode .hero-panel {
    border-color: rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
}

.hero-eyebrow {
    font-family: "Poppins", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.7rem;
    color: var(--muted-ink);
}

.sidebar-loading {
    padding: 0.75rem 0;
    font-size: 0.85rem;
    color: var(--muted-ink);
}


.hero-title {
    font-family: "Poppins", sans-serif;
    font-size: clamp(1.05rem, 2.4vw, 1.35rem);
    margin-top: 0.22rem;
    color: var(--ink);
    line-height: 1.25;
}

.quick-actions {
    margin-top: 0.7rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

/* ponytail: icons are mobile-only (ChatGPT-style suggestion rows); desktop keeps text-only */
.quick-prompt svg {
    display: none;
}

.quick-prompt {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    padding: 0.42rem 0.74rem;
    font-size: 0.82rem;
    font-family: "Poppins", sans-serif;
    cursor: pointer;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.quick-prompt:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 215, 0, 0.5);
    background: rgba(255, 215, 0, 0.15);
    color: #ffd700;
    /* ponytail: neutral shadow instead of gold halo — glow reads as AI-generated */
    box-shadow: 0 10px 18px rgba(10, 18, 36, 0.18);
}

.quick-prompt:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(10, 18, 36, 0.12);
}

body.dark-mode .quick-prompt {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

body.dark-mode .quick-prompt:hover {
    border-color: rgba(255, 215, 0, 0.5);
    background: rgba(255, 215, 0, 0.15);
    color: #ffd700;
}

.chat-container::-webkit-scrollbar {
    width: 7px;
}

.chat-container::-webkit-scrollbar-thumb {
    background: rgba(56, 76, 153, 0.55);
    border-radius: 999px;
}

.message {
    max-width: min(76%, 720px);
    padding: 0.8rem 1rem;
    border-radius: 16px;
    line-height: 1.5;
    font-size: 0.96rem;
    font-family: 'Inter', sans-serif;
    color: #f8fbff;
    border: 1px solid rgba(255, 255, 255, 0.08);
    animation: messageRise 340ms cubic-bezier(0.19, 1, 0.22, 1) both;
    animation-delay: var(--stagger-delay, 0ms);
    /* remove the global heavy panel shadow from messages; use role-specific shadows below */
    position: relative;
    z-index: 2;
    will-change: transform, opacity, filter;
}

.message.bot {
    align-self: flex-start;
    background: linear-gradient(125deg, var(--bot-start), var(--bot-end));
    color: var(--bot-text);
    border: 1px solid rgba(78, 108, 188, 0.22);
    backdrop-filter: blur(3px);
    box-shadow: var(--bot-shadow);
}

.message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--user-start), var(--user-end));
    color: #fbfcff;
    border: 1px solid rgba(255, 215, 0, 0.22);
    backdrop-filter: blur(3px);
    box-shadow: var(--user-shadow);
}

.default-message {
    border: 1px solid rgba(131, 155, 229, 0.36);
    box-shadow: 0 0 0 1px rgba(176, 195, 247, 0.26), var(--shadow-soft);
    transition: opacity 220ms ease, transform 220ms ease, margin 220ms ease;
}

.default-message.default-collapsing {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    margin: 0;
}

.message-body {
    white-space: pre-wrap;
    word-break: break-word;
}

.message-body a {
    /* Colour only — the browser's default underline stays as-is. */
    color: var(--brand-gold);
}
/* Slanted link glyph, tinted to the link colour via a mask (so it follows
   --brand-gold in both themes). */
.message-body a::before {
    content: "";
    display: inline-block;
    width: 0.85em;
    height: 0.85em;
    margin-right: 0.28em;
    vertical-align: -0.08em;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23000'%20stroke-width='2.5'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M10%2013a5%205%200%200%200%207.54.54l3-3a5%205%200%200%200-7.07-7.07l-1.72%201.71'/%3E%3Cpath%20d='M14%2011a5%205%200%200%200-7.54-.54l-3%203a5%205%200%200%200%207.07%207.07l1.71-1.71'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23000'%20stroke-width='2.5'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M10%2013a5%205%200%200%200%207.54.54l3-3a5%205%200%200%200-7.07-7.07l-1.72%201.71'/%3E%3Cpath%20d='M14%2011a5%205%200%200%200-7.54-.54l-3%203a5%205%200%200%200%207.07%207.07l1.71-1.71'/%3E%3C/svg%3E") center / contain no-repeat;
}

.input-container {
    width: min(940px, calc(100% - 1.6rem));
    margin: 0 auto 1rem;
    padding-top: 0.35rem;
}

/* ponytail: credits pill lives above the composer so it's visible on all screen sizes */
.composer-status {
    display: flex;
    justify-content: flex-end;
    padding: 0 0.35rem 0.4rem;
}

.input-container[hidden] {
    display: none !important;
}

.input-bar {
    min-height: 60px;
    border-radius: 18px;
    padding: 0.3rem 0.45rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--composer-bg);
    border: 1px solid var(--composer-border);
    box-shadow: var(--shadow-soft);
}

.send-btn {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 999px;
    font-size: 1.2rem;
    cursor: pointer;
    display: grid;
    place-items: center;
    color: #000000;
    background: #ffd700;
    transition: transform 160ms ease, box-shadow 180ms ease;
}

.send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(8, 14, 33, 0.26);
}

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

.send-btn.sending {
    opacity: 0.8;
    cursor: pointer;
    pointer-events: auto;
    transform: none;
}

.send-btn.sending i {
    animation: iconPulse 1.2s ease-in-out infinite;
}

/* replace send icon with pause icon via JS (lucide re-render) */

.input-bar input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #f6f8ff;
    font-size: 0.96rem;
    font-family: "Poppins", sans-serif;
    padding-left: 0.5rem; /* move placeholder and typed text slightly to the right */
}

.hero-panel.hero-collapsing {
    opacity: 0.3;
    transform: translateY(-5px) scale(0.986);
}

.hero-panel.hero-compact {
    width: min(82%, 620px);
    height: 86px;
    min-height: 86px;
    margin: 0 auto 0.18rem;
    padding: 0.46rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: linear-gradient(135deg, rgba(17, 31, 92, 0.08), rgba(255, 255, 255, 0.2));
    overflow: hidden;
    transition: height 220ms ease, padding 220ms ease, background 220ms ease;
}

.hero-panel.hero-compact .hero-eyebrow {
    font-size: 0.63rem;
}

/* Fade & hide variants: keep layout height but visually hide content to avoid layout 'squish' when scrolling */
.hero-panel.hero-fading {
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 220ms ease, transform 220ms ease;
    pointer-events: none;
}

.hero-panel.hero-hidden {
    opacity: 0;
    pointer-events: none;
}

.hero-panel.hero-hidden .hero-eyebrow,
.hero-panel.hero-hidden .hero-title,
.hero-panel.hero-hidden .quick-actions {
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 220ms ease, transform 220ms ease;
    pointer-events: none;
}

/* hero-title fade/hidden (now outside panel) */
.hero-title.hero-fading {
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 220ms ease, transform 220ms ease;
    pointer-events: none;
}
.hero-title.hero-hidden {
    opacity: 0;
    pointer-events: none;
}

.hero-panel.hero-compact .hero-title {
    font-size: 0.92rem;
    margin-top: 0.05rem;
}

.hero-panel.hero-compact .quick-actions {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    pointer-events: none;
    overflow: hidden;
    transition: opacity 160ms ease;
}

.input-bar input::placeholder {
    color: rgba(228, 235, 255, 0.55);
}

/* Depleted sign-in panel shown when anonymous free credits are exhausted */
.depleted-panel {
    position: relative;
    margin: 0.5rem 0;
    padding: 0.85rem 0.9rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    background: rgba(245, 248, 255, 0.92);
    border: 1px solid rgba(88, 107, 156, 0.24);
    box-shadow: 0 4px 10px rgba(10, 18, 36, 0.08);
    transform-origin: 50% 0%;
}

.depleted-panel.panel-enter {
    animation: depletedPanelSlideUp 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

.depleted-message {
    margin: 0;
    color: var(--muted-ink);
    font-size: 0.94rem;
    line-height: 1.24;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.depleted-message strong {
    font-weight: 700;
    color: #354476;
}

.bonus-bolt {
    color: #c59f00;
    margin-right: 0.18rem;
}

.google-signin-btn {
    padding: 0.46rem 0.9rem;
    background: var(--composer-bg);
    color: white;
    border: 1px solid var(--composer-border);
    border-radius: 8px;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1;
    min-width: 96px;
    flex: 0 0 auto;
    cursor: pointer;
    box-shadow:
        0 10px 20px rgba(10, 18, 36, 0.24);
    transition: transform 180ms ease, filter 180ms ease, box-shadow 220ms ease;
}

.google-signin-btn:hover {
    transform: translateY(-1px) scale(1.05);
    filter: brightness(1.08);
    box-shadow:
        0 12px 24px rgba(10, 18, 36, 0.28);
}

@keyframes depletedPanelSlideUp {
    0% {
        opacity: 0;
        transform: translateY(22px) scale(0.985);
    }
    70% {
        opacity: 1;
        transform: translateY(-2px) scale(1.002);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .depleted-panel.panel-enter {
        animation: none !important;
    }
}

body.dark-mode .depleted-panel {
    background: rgba(28, 34, 52, 0.92);
    border-color: rgba(185, 198, 235, 0.26);
    box-shadow: none;
}

body.dark-mode .depleted-message strong {
    color: #d8e2ff;
}


/* Footer meta row: left = usage status, right = tip/helper */
.input-meta {
    margin-top: 0.42rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.usage-status {
    margin: 0;
    font-size: 0.82rem;
    color: var(--muted-ink);
    letter-spacing: 0.015em;
}

.composer-hint {
    margin: 0;
    font-size: 0.78rem;
    color: var(--muted-ink);
    letter-spacing: 0.02em;
    text-align: right;
    white-space: nowrap;
}

.usage-status.limit-reached {
    color: #a42121;
    font-weight: 700;
}

body.dark-mode .usage-status.limit-reached {
    color: #ffd0d0;
}

/* Low-tokens nudge — slim strip above the composer. Flat surface (matches the
   composer), one gold accent, no glow. */
.low-tokens-nudge {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0.6rem 0.5rem 0.8rem;
    background: var(--composer-bg);
    border: 1px solid var(--composer-border);
    border-radius: 14px;
    color: var(--ink);
    font-size: 0.85rem;
    animation: lowTokensIn 0.28s cubic-bezier(0.19, 1, 0.22, 1) both;
}

.low-tokens-nudge[hidden] {
    display: none;
}

/* Transient failure notice (timeout / dropped connection): same banner, error icon. */
.chat-notice .low-tokens-icon { color: #ef4444; }
body.light-mode .chat-notice .low-tokens-icon { color: #dc2626; }

.low-tokens-nudge .low-tokens-icon {
    display: flex;
    align-items: center;
    color: var(--brand-gold);
    flex: none;
}

.low-tokens-nudge .low-tokens-text {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--muted-ink);
    line-height: 1.35;
}

.low-tokens-nudge .low-tokens-text strong {
    color: var(--ink);
    font-weight: 700;
}

.low-tokens-cta {
    flex: none;
    background: var(--brand-gold);
    color: #050a18;
    border: none;
    border-radius: 9px;
    padding: 0.4rem 0.8rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    min-height: 34px;
    transition: filter 0.15s ease;
}

.low-tokens-cta:hover {
    filter: brightness(1.06);
}

.low-tokens-cta:focus-visible,
.low-tokens-dismiss:focus-visible {
    outline: 2px solid var(--brand-gold);
    outline-offset: 2px;
}

.low-tokens-dismiss {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--muted-ink);
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 50%;
    transition: color 0.15s ease;
}

.low-tokens-dismiss:hover {
    color: var(--ink);
}

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

body.light-mode .low-tokens-cta {
    color: #ffffff;
    background: #b8860b;
}

@media (max-width: 480px) {
    .low-tokens-nudge {
        gap: 0.45rem;
        padding: 0.5rem;
        font-size: 0.8rem;
    }
}

/* Attachment/upload menu removed; styles intentionally omitted */

/* Thinking indicator — the orb rendered on its own (NOT inside a message
   bubble) while the reply is in flight. The bot bubble is created only once
   the response arrives, so no empty reply box sits on screen. */
.thinking-indicator {
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    padding: 0.4rem 1rem;
    min-height: 22px;
}

/* Revealed only when a reply is slow: hints the wait may be the network. */
.thinking-hint {
    color: #ef4444;
    font-size: 0.82rem;
    line-height: 1.35;
    max-width: 34ch;
}
.thinking-hint[hidden] { display: none; }
body.light-mode .thinking-hint { color: #dc2626; }

/* Original orb look: layered radial-gradient core + pulsing glow + spinning
   ring + glint highlight. */
.thinking-orb {
    position: relative;
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(
        circle at 34% 30%,
        #fff6c9 0%,
        #ffd700 40%,
        #d4a017 74%,
        #8a6a00 100%
    );
    box-shadow:
        0 0 10px rgba(255, 215, 0, 0.55),
        0 0 22px rgba(255, 215, 0, 0.28),
        inset 0 0 6px rgba(255, 255, 255, 0.5);
    animation: thinkingOrbPulse 1.7s ease-in-out infinite;
}

.thinking-orb::before {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 215, 0, 0.3);
    border-top-color: rgba(255, 215, 0, 0.95);
    animation: thinkingOrbSpin 1.1s linear infinite;
}

.thinking-orb::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(
        circle at 30% 28%,
        rgba(255, 255, 255, 0.95),
        rgba(255, 255, 255, 0) 45%
    );
    animation: thinkingOrbGlint 1.7s ease-in-out infinite;
}

body.light-mode .thinking-orb {
    /* Light mode uses the darker amber brand gold (#d97706); the yellow #ffd700
       core + glow washed out on white. */
    background: radial-gradient(
        circle at 34% 30%,
        #fde68a 0%,
        var(--brand-gold) 45%,
        #b45309 100%
    );
    box-shadow:
        0 0 10px rgba(217, 119, 6, 0.45),
        0 0 22px rgba(217, 119, 6, 0.22),
        inset 0 0 6px rgba(255, 255, 255, 0.65);
}

body.light-mode .thinking-orb::before {
    border-color: rgba(217, 119, 6, 0.35);
    border-top-color: rgba(217, 119, 6, 0.95);
}

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

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

@keyframes thinkingOrbGlint {
    0%,
    100% {
        opacity: 0.45;
    }
    50% {
        opacity: 1;
    }
}

@keyframes messageRise {
    from {
        transform: translateY(12px) scale(0.985);
        opacity: 0;
        filter: blur(2px);
    }
    to {
        transform: translateY(0);
        opacity: 1;
        filter: blur(0);
    }
}

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

.mobile-only-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--ink);
    margin-right: 0.5rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}
.mobile-only-btn:hover {
    color: var(--brand-gold);
}

@media (max-width: 900px) {
    /* Keep CSS variables in sync for smaller screens so header sizing stays consistent */
    :root {
        --topbar-height: 76px;
        --logo-wrap-height: 56px;
        --logo-scale: 1.25;
        --logo-offset-x: -4px;
    }
    .app-shell {
        width: 100%;
        height: 100%;
        margin: 0;
        border-radius: 0;
        border: 0;
    }

    .top-bar {
        min-height: 76px;
        padding: 0 0.95rem;
    }

    .brand-title-block {
        margin-top: 0;
    }

    .header-actions {
        align-self: center;
        margin-bottom: 0;
    }

    .brand-caption {
        font-size: 0.78rem;
    }

    .user-greeting {
        font-size: 0.7rem;
    }

    .brand-title {
        font-size: 0.92rem;
    }

    .chat-stage {
        padding: 0.75rem 0.55rem 0;
    }

    .message {
        max-width: 90%;
        font-size: 0.92rem;
    }

    .hero-panel {
        width: 98%;
        padding: 0.82rem 0.82rem 0.75rem;
    }

    .quick-actions {
        gap: 0.36rem;
    }

    .quick-prompt {
        font-size: 0.78rem;
        padding: 0.36rem 0.6rem;
    }

    .input-container {
        width: calc(100% - 1rem);
        margin-bottom: 0.75rem;
    }

    .input-bar {
        min-height: 60px;
    }

    .send-btn {
        width: 38px;
        height: 38px;
    }
    .input-meta {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .message {
        animation: none;
    }

    .msg-actions {
        animation: none;
    }

    .quick-prompt {
        animation: none;
    }

    .low-tokens-nudge {
        animation: none;
    }

    .bg-orb-1,
    .bg-orb-2,
    .thinking-orb,
    .thinking-orb::before,
    .thinking-orb::after {
        animation: none;
    }

    .sidebar-logo {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 1rem;
        font-weight: 700;
        font-size: 1.1rem;
    }
    .sidebar-logo img {
        height: 32px;
    }

    #overviewNav {
        display: none;
    }
}

.sidebar-logo {
    display: none;
}

/* 3-column layout styles */
.app-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    padding-top: 104px;
    /* ponytail: match top-bar's centered container so the sidebar nav aligns with the logo */
    width: 95%;
    max-width: 1280px;
    margin: 0 auto;
}
.sidebar-left {
    width: 200px;
    border-right: 1px solid var(--panel-border);
    /* ponytail: left pad matches top-bar's 1.6rem content inset (less .nav-item's .8rem) so nav aligns with logo */
    padding: 1rem 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-top: 1.5rem;
    transition: width 0.3s ease, padding 0.3s ease, opacity 0.3s ease, border-color 0.3s ease;
}

.mt-auto {
    margin-top: auto;
}

@media (min-width: 769px) {
    .sidebar-left.closed {
        width: 0;
        padding-left: 0;
        padding-right: 0;
        opacity: 0;
        border-right-color: transparent;
        overflow: hidden;
    }
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: var(--muted-ink);
    font-size: 0.85rem;
    font-family: "Poppins", sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 200ms ease;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* [hidden] must win over .nav-item's display:flex, or the logout button
   shows for anonymous users even when JS sets hidden=true */
.nav-item[hidden] {
    display: none;
}
.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}
.nav-item.active {
    background: rgba(255, 215, 0, 0.1);
    color: var(--brand-gold);
    border-color: rgba(255, 215, 0, 0.2);
}
.chat-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.sidebar-right {
    width: 280px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    border-left: 1px solid var(--panel-border);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
    transition: width 0.3s ease, padding 0.3s ease, opacity 0.3s ease, border-color 0.3s ease;
}

.sidebar-right.hidden-sidebar {
    width: 0;
    padding-left: 0;
    padding-right: 0;
    opacity: 0;
    border-left-color: transparent;
    overflow: hidden;
}
.right-panel {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 1rem;
}
.panel-title {
    font-family: "Poppins", sans-serif;
    font-size: 0.8rem;
    color: #fff;
    margin-bottom: 0.8rem;
}
.panel-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    padding: 0.5rem 0.6rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    margin-bottom: 0.4rem;
    color: var(--muted-ink);
}
.panel-item-left {
    display: flex;
    align-items: center;
}
.panel-item.urgent {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}
.panel-date {
    font-weight: 600;
}
.circle {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.4rem;
}
.req-circle {
    border: 1px solid rgba(255, 215, 0, 0.6);
}
.done-circle {
    background: #4ade80;
    color: #050a18;
    font-size: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.opt-circle {
    border: 1px solid #475569;
}
.done-text {
    text-decoration: line-through;
    opacity: 0.7;
}
.opt-tag {
    font-size: 9px;
    opacity: 0.5;
    margin-left: 0.3rem;
}

body.light-mode {
    --bg-top: #f0f4f8;
    --bg-bottom: #e2e8f0;
    --ink: #0f172a;
    --muted-ink: #64748b;
    --panel: rgba(255, 255, 255, 0.7);
    --panel-border: rgba(0, 0, 0, 0.1);
    --brand-navy: #0f172a;
    --brand-gold: #d97706;
    --bot-start: rgba(255, 255, 255, 0.9);
    --bot-end: rgba(255, 255, 255, 0.6);
    --bot-text: #0f172a;
    --user-start: rgba(217, 119, 6, 0.15);
    --user-end: rgba(217, 119, 6, 0.05);
    --composer-bg: rgba(255, 255, 255, 0.8);
    --composer-border: rgba(0, 0, 0, 0.1);
    --chip-bg: rgba(217, 119, 6, 0.1);
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.05);
    --shadow-strong: 0 16px 48px rgba(0, 0, 0, 0.1);
    --hero-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
    --bot-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    --user-shadow: 0 4px 16px rgba(217, 119, 6, 0.05);
}

body.light-mode .message.user { color: #0f172a; }
body.light-mode .quick-prompt { color: #0f172a; border-color: rgba(0,0,0,0.1); background: rgba(0,0,0,0.05); }
body.light-mode .logo-pill .logo-text { color: #0f172a; }
body.light-mode .top-bar { background: rgba(255, 255, 255, 0.6); border: 1px solid rgba(0,0,0,0.1); }
body.light-mode .send-btn { color: #000000; }
body.light-mode .input-bar input { color: #0f172a; }
body.light-mode .input-bar input::placeholder { color: rgba(15, 23, 42, 0.55); }
body.light-mode .message { color: #0f172a; border: 1px solid rgba(0,0,0,0.08); }
body.light-mode .panel-title { color: #0f172a; }
body.light-mode .right-panel { background: rgba(255,255,255,0.6); }
body.light-mode .nav-item { color: #64748b; }
body.light-mode .nav-item.active { background: rgba(0,0,0,0.05); color: #0f172a; }
body.light-mode .hero-panel { background: linear-gradient(135deg, rgba(255,255,255,0.7), rgba(255,255,255,0.4)); border-color: rgba(0,0,0,0.1); }

/* Events View Styles */
.events-view {
    display: flex;
    flex-direction: column;
    width: 100%;
    flex: 1;
    min-height: 0;
    padding: 2rem;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.events-view[hidden] {
    display: none !important;
}

.events-header {
    margin-bottom: 2rem;
}
.events-header h2 {
    font-family: "Poppins", sans-serif;
    font-size: 2rem;
    color: #fff;
    margin-bottom: 0.5rem;
}
.events-header p {
    color: var(--muted-ink);
    font-size: 0.95rem;
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.event-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}
.event-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.event-date {
    background: rgba(192, 132, 252, 0.15);
    color: #c084fc;
    border-radius: 12px;
    padding: 0.8rem;
    text-align: center;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: fit-content;
}
.event-date .month {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
}
.event-date .day {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.event-details h3 {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}
.event-time, .event-location {
    color: var(--muted-ink);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.3rem;
}

.auth-action-btn {
    background: transparent;
    color: #facc15;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.45rem 1.25rem;
    border: none;
    border-radius: 999px;
    transition: color 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.auth-action-btn:hover {
    filter: brightness(1.08);
}

.auth-action-btn:focus-visible {
    outline: 2px solid #facc15;
    outline-offset: 2px;
}

body.light-mode .auth-action-btn {
    color: #a16207;
}

body.light-mode .auth-action-btn:hover {
    filter: brightness(1.08);
}

.reward-badge {
    display: inline-flex;
    align-items: center;
    background: #1a1b1e;
    border: 1px solid #334155;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    margin: 0 auto 1.5rem;
    color: #f1f5f9;
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #f8fafc;
    margin-bottom: 0.5rem;
}

.modal-desc {
    font-size: 0.9rem;
    color: #94a3b8;
    line-height: 1.5;
    margin-bottom: 2rem;
}

.modal-primary-btn {
    background: #f1f5f9;
    color: #08090a;
    text-decoration: none;
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s, transform 0.1s;
}

.modal-primary-btn:hover {
    background: #ffffff;
    transform: translateY(-1px);
}

.modal-secondary-btn {
    background: transparent;
    color: #64748b;
    border: 1px solid #334155;
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.modal-secondary-btn:hover {
    background: #1e293b;
    color: #f1f5f9;
}

.event-desc {
    color: #cbd5e1;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-top: 0.8rem;
}

.event-btn {
    margin-top: auto;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.6rem 0;
    text-align: center;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}
.event-btn:hover {
    background: #c084fc;
    color: #000;
    border-color: #c084fc;
}

body.light-mode .events-header h2,
body.light-mode .event-details h3 {
    color: #0f172a;
}
body.light-mode .event-card {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.05);
}
body.light-mode .event-card:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}
body.light-mode .event-desc {
    color: #334155;
}
body.light-mode .event-btn {
    background: #fff;
    color: #0f172a;
    border-color: #cbd5e1;
}
body.light-mode .event-btn:hover {
    background: #c084fc;
    color: #fff;
    border-color: #c084fc;
}

/* Deadlines View Styles */
.deadlines-view {
    display: flex;
    flex-direction: column;
    width: 100%;
    flex: 1;
    min-height: 0;
    padding: 2rem;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.deadlines-view[hidden] {
    display: none !important;
}

.deadlines-header {
    margin-bottom: 2rem;
}
.deadlines-header h2 {
    font-family: "Poppins", sans-serif;
    font-size: 2rem;
    color: #fff;
    margin-bottom: 0.5rem;
}
.deadlines-header p {
    color: var(--muted-ink);
    font-size: 0.95rem;
}

.deadlines-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.deadline-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    gap: 1.2rem;
    align-items: flex-start;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}
.deadline-card:hover {
    transform: translateX(4px);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.deadline-card.urgent {
    border-color: rgba(239, 68, 68, 0.3);
    background: linear-gradient(145deg, rgba(239, 68, 68, 0.05), rgba(255, 255, 255, 0.02));
}
.deadline-card.urgent:hover {
    border-color: rgba(239, 68, 68, 0.6);
}
.deadline-card.urgent .deadline-date {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.deadline-date {
    background: rgba(192, 132, 252, 0.15);
    color: #c084fc;
    border-radius: 12px;
    padding: 0.8rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 70px;
}
.deadline-date .month {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
}
.deadline-date .day {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.deadline-details {
    flex: 1;
}
.deadline-details h3 {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
}
.deadline-desc {
    color: #cbd5e1;
    font-size: 0.9rem;
    line-height: 1.4;
}

.urgency-badge {
    display: inline-block;
    margin-top: 0.8rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Elapsed events/deadlines: dim the card + a small "Past" tag. */
.event-card.past,
.deadline-card.past { opacity: 0.62; }
.event-card.past .event-date,
.deadline-card.past .deadline-date { filter: grayscale(0.6); }
.panel-item.past { opacity: 0.55; }
.past-badge {
    display: inline-block;
    vertical-align: middle;
    margin-left: 0.4rem;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted-ink);
    background: rgba(148, 163, 184, 0.15);
    border: 1px solid rgba(148, 163, 184, 0.28);
}

body.light-mode .deadlines-header h2,
body.light-mode .deadline-details h3 {
    color: #0f172a;
}
body.light-mode .deadline-card {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.05);
}
body.light-mode .deadline-card:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}
body.light-mode .deadline-desc {
    color: #334155;
}
body.light-mode .deadline-card.urgent {
    background: rgba(239, 68, 68, 0.05);
}

/* Info Loading State */
.info-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
    width: 100%;
    grid-column: 1 / -1;
    color: var(--muted-ink);
    text-align: center;
}

.info-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(192, 132, 252, 0.1);
    border-top-color: #c084fc;
    border-radius: 50%;
    animation: info-spin 1s ease-in-out infinite;
    margin-bottom: 1.5rem;
}

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

/* Documents View Styles */
.documents-view {
    display: flex;
    flex-direction: column;
    width: 100%;
    flex: 1;
    min-height: 0;
    padding: 2rem;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}
.documents-view[hidden] { display: none !important; }

.documents-header { margin-bottom: 2rem; }
.documents-header h2 { font-family: "Poppins", sans-serif; font-size: 2rem; color: #fff; margin-bottom: 0.5rem; }
.documents-header p { color: var(--muted-ink); font-size: 0.95rem; }

.documents-grid { display: flex; flex-direction: column; gap: 1rem; }

.document-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}
.document-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.doc-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
}
.doc-details { flex: 1; }
.doc-details h3 { color: #fff; font-size: 1.1rem; margin-bottom: 0.3rem; }
.doc-status { font-size: 0.85rem; font-weight: 500; }
.doc-status.pending { color: var(--muted-ink); }

.doc-check-actions {
    display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
}

/* Document actions: rounded-rect (not pills) with solid-enough fills so they
   read as buttons, not faint glass. "View" keeps the brand-gold accent. */
.doc-tick-btn,
.doc-view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    padding: 0.55rem 1rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.doc-tick-btn:focus-visible,
.doc-view-btn:focus-visible { outline: 2px solid var(--brand-gold); outline-offset: 2px; }

.doc-tick-btn {
    background: rgba(34, 197, 94, 0.18);
    border-color: rgba(34, 197, 94, 0.45);
    color: #bbf7d0;
}
.doc-tick-btn:hover { background: rgba(34, 197, 94, 0.26); }
.doc-tick-btn.done {
    background: rgba(34, 197, 94, 0.26);
    border-color: rgba(34, 197, 94, 0.6);
    color: #dcfce7;
}

.doc-view-btn {
    background: rgba(255, 215, 0, 0.16);
    border-color: rgba(255, 215, 0, 0.45);
    color: var(--brand-gold);
}
.doc-view-btn:hover {
    background: rgba(255, 215, 0, 0.24);
    border-color: rgba(255, 215, 0, 0.65);
}

.doc-check-toggle { display: inline-flex; align-items: center; gap: 0.45rem; }
.doc-checkmark {
    display: inline-flex;
    width: 1.05rem;
    height: 1.05rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid currentColor;
    font-size: 0.72rem;
    line-height: 1;
}
.doc-tick-btn.done .doc-checkmark { border-color: transparent; background: rgba(52, 211, 153, 0.28); }

body.light-mode .doc-tick-btn {
    background: rgba(5, 150, 105, 0.14);
    border-color: rgba(5, 150, 105, 0.45);
    color: #047857;
}
body.light-mode .doc-tick-btn.done {
    background: rgba(5, 150, 105, 0.22);
    border-color: rgba(5, 150, 105, 0.55);
    color: #065f46;
}
body.light-mode .doc-view-btn {
    background: rgba(217, 119, 6, 0.14);
    border-color: rgba(217, 119, 6, 0.45);
    color: #b45309;
}
body.light-mode .doc-view-btn:hover { background: rgba(217, 119, 6, 0.22); }

.doc-action-btn {
    background: #c084fc; color: #000; border: none; border-radius: 8px;
    padding: 0.6rem 1.2rem; font-weight: 500; cursor: pointer; transition: all 0.2s ease;
}
.doc-action-btn:hover { background: #d8b4fe; }
.doc-action-btn.secondary { background: rgba(255, 255, 255, 0.1); color: #fff; }
.doc-action-btn.secondary:hover { background: rgba(255, 255, 255, 0.2); }

/* Settings View Styles */
.settings-view {
    display: flex; flex-direction: column; width: 100%; flex: 1; min-height: 0;
    padding: 2rem; overflow-y: auto; scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}
.settings-view[hidden] { display: none !important; }

.settings-header { margin-bottom: 2rem; }
.settings-header h2 { font-family: "Poppins", sans-serif; font-size: 2rem; color: #fff; margin-bottom: 0.5rem; }
.settings-header p { color: var(--muted-ink); font-size: 0.95rem; }

.settings-list {
    display: flex; flex-direction: column; gap: 0;
    /* ponytail: one card with hairline-divided rows (Stripe/Linear pattern) —
       replaces four separate chunky cards */
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 0.35rem 1.25rem;
}
.setting-item {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0;
    padding: 1.1rem 0.25rem;
    display: flex; align-items: center;
    justify-content: space-between; gap: 1rem; transition: background 0.2s ease;
}
.setting-item:last-child { border-bottom: none; }
.setting-info h3 { color: #fff; font-size: 1.1rem; margin-bottom: 0.3rem; }
.setting-info p { color: var(--muted-ink); font-size: 0.9rem; }

.setting-btn {
    background: #c084fc; color: #000; border: none; border-radius: 8px;
    padding: 0.6rem 1.2rem; font-weight: 500; cursor: pointer; transition: all 0.2s ease;
}
.setting-btn:hover { background: #d8b4fe; }
.setting-btn.secondary { background: rgba(255, 255, 255, 0.1); color: #fff; }
.setting-btn.secondary:hover { background: rgba(255, 255, 255, 0.2); }

.setting-btn.danger {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.setting-btn.danger:hover { background: rgba(239, 68, 68, 0.22); color: #fca5a5; }

/* Profile View Styles */
.profile-view {
    display: flex; flex-direction: column; width: 100%; flex: 1; min-height: 0;
    padding: 2rem; overflow-y: auto; scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}
.profile-view[hidden] { display: none !important; }

.profile-view-header { margin-bottom: 1.5rem; }
.profile-view-header h2 { font-family: "Poppins", sans-serif; font-size: 2rem; color: #fff; margin-bottom: 0.5rem; }
.profile-view-header p { color: var(--muted-ink); font-size: 0.95rem; }

.profile-card {
    /* ponytail: eva cloud + gold wash — the modals' signature texture, on the identity card */
    background:
        url("./gold-eva.png?v=3") no-repeat 100% -8px / 62px auto,
        radial-gradient(circle at 82% 8%, rgba(255, 215, 0, 0.08), transparent 45%),
        rgba(255, 255, 255, 0.03);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    position: relative; /* anchors the admin chip over the avatar */
    /* ponytail: stats belong to the identity — grouped tighter than the zone breaks */
    margin-bottom: 1.25rem;
}

.profile-card-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-gold), #ffb300);
    color: #050a18;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    font-family: "Poppins", sans-serif;
    margin: 0 auto 1rem;
    box-shadow: 0 8px 24px rgba(255, 215, 0, 0.3);
}

/* ponytail: admin chip — tiny gold tag pinned over the avatar; tier arrives
   server-verified via /api/auth/me (Clerk JWT claim), gated in updateProfile.
   No `display` rule here so the `hidden` attribute keeps working (the
   .profile-card-badge[hidden] precedent documents why). */
.admin-chip {
    position: absolute;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    background: var(--brand-gold);
    color: #050a18;
    font-size: 0.58rem;
    font-weight: 700;
    font-family: "Poppins", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    z-index: 3;
}
/* profile card: over the 80px centered avatar */
.profile-card .admin-chip {
    top: calc(2rem - 6px);
    left: calc(50% - 46px);
}
/* sidebar widget: over the 36px leading avatar */
.profile-widget .admin-chip {
    top: calc(0.5rem - 6px);
    left: calc(0.5rem - 6px);
}

.profile-card-name {
    font-family: "Poppins", sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.5rem;
}

.profile-card-tier {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    background: rgba(255, 215, 0, 0.15);
    color: var(--brand-gold);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: "Poppins", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.profile-card-email {
    color: var(--muted-ink);
    font-size: 0.9rem;
}

/* ponytail: founding-member badge — actual medal art, label under it.
   Badge art: game-icons "laurel-crown" by Lorc, CC-BY 3.0 (https://game-icons.net), recolored to brand gold. */
.profile-card-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.75rem;
}

/* `hidden` must beat `display: flex` above (author styles beat the UA rule). */
.profile-card-badge[hidden] {
    display: none;
}

.profile-card-badge img {
    width: 44px;
    height: 44px;
    display: block;
}

.profile-card-badge span {
    font-size: 0.68rem;
    font-weight: 600;
    font-family: "Poppins", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--brand-gold);
}

body.light-mode .profile-card-badge span {
    color: #a16207;
}

.profile-stats {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.profile-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    min-width: 100px;
}

/* ponytail: quota progress bars — CSS var + ::after, no extra DOM; fill set from JS in updateProfile */
.profile-stat.quota-stat {
    position: relative;
    --pct: 0%;
    padding-bottom: 1.4rem;
}

.profile-stat.quota-stat::after {
    content: "";
    position: absolute;
    left: 1.5rem;
    right: 1.5rem;
    bottom: 0.7rem;
    height: 5px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand-gold) var(--pct), rgba(148, 163, 184, 0.22) var(--pct));
}

.profile-stat-value {
    font-family: "Poppins", sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--brand-gold);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.profile-stat-label {
    font-size: 0.75rem;
    color: var(--muted-ink);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ponytail: badges grid — reuses the profile-stat card look; locked art dims, unlocked glows gold */
.profile-badges {
    margin-bottom: 1.25rem;
    text-align: center;
}

.profile-badges-heading {
    font-family: "Poppins", sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 0.75rem;
}

.profile-badges-grid {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.badge-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 1rem 1.1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    width: 132px;
    text-align: center;
}

.badge-card img {
    width: 44px;
    height: 44px;
    display: block;
}

.badge-card strong {
    font-family: "Poppins", sans-serif;
    font-size: 0.85rem;
    color: var(--ink);
}

.badge-card .badge-how {
    font-size: 0.68rem;
    line-height: 1.4;
    color: var(--muted-ink);
}

.badge-card .badge-state {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted-ink);
    margin-top: 0.15rem;
}

.badge-card.unlocked {
    border-color: rgba(255, 215, 0, 0.4);
}

.badge-card.unlocked .badge-state {
    color: var(--brand-gold);
}

.badge-card:not(.unlocked) img {
    opacity: 0.4;
}

body.light-mode .badge-card {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.05);
}

/* ponytail: separated danger zone — the buttons sat at 0 gap under the settings card */
.profile-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    /* ponytail: largest gap in the page — distance signals severity before color does */
    margin-top: 2.5rem;
    padding: 1rem;
    background: transparent;
}

.profile-actions .setting-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Sidebar Profile Widget */
.profile-widget {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 12px;
    /* ponytail: no card chrome, one faint top hairline marks the widget zone */
    background: transparent;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    /* ponytail: pinned bottom anchor — conversations scroll beneath it into the blur */
    position: relative;
    z-index: 2;
}

/* ponytail: blur mask above the widget — fading upward so items dissolve
   into it as the list scrolls (pointer-events none, bleeds over the rail padding) */
.profile-widget::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: -0.5rem;
    right: -0.5rem;
    height: 2.2rem;
    pointer-events: none;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    mask-image: linear-gradient(to top, #000 35%, transparent);
    -webkit-mask-image: linear-gradient(to top, #000 35%, transparent);
}

.profile-widget:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 215, 0, 0.3);
}

.profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-gold), #ffb300);
    color: #050a18;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: "Poppins", sans-serif;
    flex-shrink: 0;
}

/* ponytail: trailing chevron — the only click-affordance hint on the widget */
.profile-widget-chevron {
    margin-left: auto;
    color: var(--muted-ink);
    opacity: 0.7;
}

.profile-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.profile-name {
    font-family: "Poppins", sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-tier {
    font-size: 0.65rem;
    color: var(--brand-gold);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.light-mode .profile-card {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.05);
}
body.light-mode .profile-card-avatar {
    box-shadow: 0 8px 24px rgba(217, 119, 6, 0.3);
}
body.light-mode .profile-card-name { color: #0f172a; }
body.light-mode .profile-card-email { color: #64748b; }
body.light-mode .profile-stat { background: rgba(0, 0, 0, 0.02); border-color: rgba(0, 0, 0, 0.05); }
body.light-mode .profile-stat-value { color: #d97706; }
body.light-mode .profile-widget {
    background: transparent;
    border-color: rgba(0, 0, 0, 0.08);
}
body.light-mode .profile-widget:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(217, 119, 6, 0.3);
}
body.light-mode .profile-name { color: #0f172a; }
body.light-mode .profile-tier { color: #d97706; }

/* Switch Toggle CSS */
.switch { position: relative; display: inline-block; width: 50px; height: 28px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.1); transition: .4s; border-radius: 34px;
}
.slider:before {
    position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 4px;
    background-color: white; transition: .4s; border-radius: 50%;
}
input:checked + .slider { background-color: #c084fc; }
input:checked + .slider:before { transform: translateX(22px); }

/* Notifications switch is a placeholder: keep the look, but inert. */
.switch-disabled { pointer-events: none; cursor: default; }
.coming-soon-badge {
    display: inline-block;
    margin-top: 0.4rem;
    padding: 0.12rem 0.55rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted-ink);
    border: 1px solid var(--panel-border);
    border-radius: 999px;
}

body.light-mode .documents-header h2, body.light-mode .doc-details h3,
body.light-mode .settings-header h2, body.light-mode .setting-info h3 { color: #0f172a; }
body.light-mode .document-card { background: rgba(0, 0, 0, 0.02); border-color: rgba(0, 0, 0, 0.05); }
body.light-mode .settings-list { background: rgba(255, 255, 255, 0.6); border-color: rgba(0, 0, 0, 0.08); }
body.light-mode .setting-item { border-bottom-color: rgba(0, 0, 0, 0.06); }
body.light-mode .document-card:hover { background: rgba(0, 0, 0, 0.04); border-color: rgba(0, 0, 0, 0.1); }
body.light-mode .doc-action-btn.secondary, body.light-mode .setting-btn.secondary { background: rgba(0, 0, 0, 0.05); color: #0f172a; }
body.light-mode .doc-action-btn.secondary:hover, body.light-mode .setting-btn.secondary:hover { background: rgba(0, 0, 0, 0.1); }
body.light-mode .setting-btn.danger { background: rgba(239, 68, 68, 0.1); color: #b91c1c; border-color: rgba(239, 68, 68, 0.4); }
body.light-mode .setting-btn.danger:hover { background: rgba(239, 68, 68, 0.18); }

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

@media (max-width: 768px) {
    .sidebar-left {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        background: var(--bg-top);
        z-index: 100;
        width: min(240px, 82vw);
        transition: left 0.3s ease;
        padding-top: 56px;
    }
    
    body.light-mode .sidebar-left {
        background: #f0f4f8;
    }

    .sidebar-left.open {
        left: 0;
        box-shadow: 2px 0 10px rgba(0,0,0,0.5);
    }
    
    body.light-mode .sidebar-left.open {
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }

    .mobile-only-btn {
        display: flex;
    }
    
    .chat-col {
        width: 100%;
    }
    
    .logo-pill .logo-text {
        font-size: 1.15rem;
    }
    .sidebar-left .nav-item:first-child {
        display: none;
    }
    
    .sidebar-left .nav-item:nth-child(2) {
        background: rgba(255, 215, 0, 0.1);
        color: var(--brand-gold);
        border-color: rgba(255, 215, 0, 0.2);
    }
    
    body.light-mode .sidebar-left .nav-item:nth-child(2) {
        background: rgba(0,0,0,0.05);
        color: #0f172a;
        border-color: transparent;
    }
    
    .events-view, .deadlines-view, .documents-view, .settings-view {
        padding: 1.5rem;
    }

    /* ponytail: transparent mobile bar (chatgpt-style) — the page shows through */
    .top-bar {
        top: 0;
        width: 100%;
        padding: 0.55rem 0.9rem;
        border-radius: 0;
        border: none;
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
    }
    body.light-mode .top-bar {
        background: transparent;
        border: none;
    }
    /* ponytail: drop blur on stacked cards + message bubbles on mobile — many
       backdrop-filter layers jank scrolling on low-end phones. */
    .event-card,
    .deadline-card,
    .document-card,
    .message.bot,
    .message.user {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
    .app-body {
        padding-top: 56px;
    }
    .logo-pill #logo {
        height: 32px;
    }
    .logo-pill .logo-text {
        font-size: 1rem;
        margin-left: -10px;
    }
    /* ponytail: theme toggle lives in Settings on mobile — drop it from the bar */
    #themeToggle {
        display: none;
    }
    /* ponytail: compact, clean Sign In pill on mobile */
    .auth-action-btn {
        padding: 0.28rem 0.85rem;
        font-size: 0.78rem;
    }
    .credits-pill {
        min-width: 40px;
        padding: 0.2rem 0.5rem;
        font-size: 0.7rem;
    }
    .icon-btn {
        width: 30px;
        height: 30px;
        font-size: 0.82rem;
    }
    /* ponytail: bigger hamburger tap target */
    .mobile-only-btn {
        width: 38px;
        height: 38px;
    }

    /* ponytail: hero + chatgpt-style vertical suggestion list near the input */
    .hero-panel {
        max-height: none;
        margin-top: auto;
        padding: 0.75rem 0.9rem;
    }
    .hero-title {
        font-size: 1.05rem;
    }
    .quick-actions {
        flex-direction: column;
        gap: 0.35rem;
        margin-top: 0.85rem;
        width: 100%;
    }
    .quick-prompt {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        width: 100%;
        padding: 0.72rem 0.9rem;
        border-radius: 12px;
        font-size: 0.92rem;
        text-align: left;
    }

    /* ponytail: mobile — box chrome hidden, siblings hidden, greeting fixed center */
    .hero-panel,
    body.dark-mode .hero-panel,
    body.light-mode .hero-panel {
        max-height: none;
        margin-top: auto;
        padding: 0;
        background: none;
        border: 0;
        box-shadow: none;
        overflow: visible;
    }
    .hero-eyebrow {
        display: none;
    }
    /* ponytail: ChatGPT-style suggestion rows — icon + label, just above the input */
    .quick-actions {
        display: flex;
        flex-direction: column;
        gap: 0.4rem;
        margin-top: 0;
        width: 100%;
        padding: 0 0.2rem 0.6rem;
    }
    .quick-prompt {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 0.6rem;
        width: 100%;
        padding: 0.55rem 0.4rem;
        border-radius: 10px;
        border: 0;
        background: transparent;
        box-shadow: none;
        font-size: 0.9rem;
        font-family: 'Inter', sans-serif;
        text-align: left;
        color: var(--ink);
        white-space: normal;
        /* ponytail: no cards — fade-in cascade, rows appear bottom-up */
        --row-op: 1;
        opacity: var(--row-op);
        animation: rowIn 0.55s cubic-bezier(0.19, 1, 0.22, 1) backwards;
        transition: opacity 150ms ease, background 150ms ease, color 150ms ease;
    }
    .quick-prompt:nth-child(1) { --row-op: 1; animation-delay: 2s; }
    .quick-prompt:nth-child(2) { --row-op: 0.7; animation-delay: 2.25s; }
    .quick-prompt:nth-child(3) { --row-op: 0.45; animation-delay: 2.5s; }
    @keyframes rowIn {
        from { opacity: 0; transform: translateY(16px); }
        to { opacity: var(--row-op); transform: none; }
    }
    .quick-prompt svg { display: block; flex: 0 0 auto; width: 15px; height: 15px; color: var(--muted-ink); }
    .quick-prompt:hover { background: rgba(255, 255, 255, 0.04); color: var(--ink); opacity: 1; transform: none; box-shadow: none; }
    body.light-mode .quick-prompt { background: transparent; }
    body.light-mode .quick-prompt:hover { background: rgba(0, 0, 0, 0.03); }
    .hero-title {
        display: block;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 600px;
        text-align: center;
        z-index: 50;
        pointer-events: none;
    }
}

@media (max-width: 400px) {
    .top-bar {
        padding: 0 0.5rem;
        min-height: 64px;
        top: 0;
        width: 100%;
    }
    
    .logo-pill .logo-text {
        font-size: 1.05rem;
    }
    
    .logo-pill #logo {
        height: 36px;
    }
    
    .icon-btn, .mobile-only-btn {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    .header-actions {
        gap: 0.3rem;
    }
    
    .credits-pill {
        min-width: 44px;
        padding: 0.2rem 0.4rem;
        font-size: 0.65rem;
    }
    
    .chat-container {
        padding: 0.2rem 0.1rem 0.5rem;
    }
    
    .message {
        max-width: 95%;
        padding: 0.6rem 0.8rem;
        font-size: 0.88rem;
    }
    
    .quick-prompt {
        font-size: 0.85rem;
        padding: 0.55rem 0.6rem;
    }
    
    .input-container {
        width: calc(100% - 0.5rem);
    }
    
    .input-bar {
        min-height: 52px;
        padding: 0.2rem 0.3rem;
    }
    
    .send-btn {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }

    .hero-title {
        font-size: 1rem;
    }
    
    .depleted-panel {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 0.5rem;
    }
    
    .google-signin-btn {
        width: 100%;
    }
    
    .events-view, .deadlines-view, .documents-view, .settings-view {
        padding: 1rem 0.5rem;
    }
    
    .events-header h2, .deadlines-header h2, .documents-header h2, .settings-header h2 {
        font-size: 1.5rem;
    }
    
    .events-header p, .deadlines-header p, .documents-header p, .settings-header p {
        font-size: 0.85rem;
    }
    
    .events-grid, .deadlines-grid, .documents-grid {
        grid-template-columns: 1fr;
    }
    
    .document-card, .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .doc-check-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .doc-action-btn, .setting-btn {
        width: 100%;
        text-align: center;
    }
    
    .switch {
        align-self: flex-start;
    }
}


/* ponytail: conversation sidebar panel (chat history). Titles clip with
   ellipsis in the 200px rail; JS still caps titles at 48 chars. */
.sidebar-conversations {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.conversations-header {
    padding: 0.75rem 0.5rem 0.25rem;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.65;
}
.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    text-align: left;
    color: inherit;
    background: none;
    border: 0;
    padding: 0.5rem;
    font-size: 13px;
    cursor: pointer;
    border-radius: 6px;
    position: relative;
}
.history-item-title {
    flex: 1;
    min-width: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}
.history-delete {
    flex: 0 0 auto;
    background: none;
    border: 0;
    color: inherit;
    opacity: 0;
    cursor: pointer;
    padding: 8px 10px;
    font-size: 14px;
    border-radius: 6px;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease, color 0.15s ease;
}
.history-item:hover .history-delete,
.history-delete:focus-visible,
.sidebar-left.open .history-delete {
    opacity: 1;
}
.history-delete:hover,
.history-item:hover .history-delete:hover {
    opacity: 1;
    color: #ef4444;
}
.history-item:hover { background: rgba(255, 255, 255, 0.06); }
body.light-mode .history-item:hover { background: rgba(0, 0, 0, 0.05); }
.history-empty, .conversations-bucket {
    padding: 0.5rem;
    opacity: 0.7;
    font-size: 12px;
}

/* ponytail: sidebar controls that must NOT match the .nav-item selector —
   Chatbot_UI_fakeai.js navItems index math depends on .nav-item count/order. */
.history-ctl {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: var(--muted-ink);
    font-size: 0.85rem;
    font-family: "Poppins", sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 200ms ease;
    text-align: left;
    width: 100%;
}
.history-ctl:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
body.light-mode .history-ctl { color: #64748b; }
body.light-mode .history-ctl:hover { background: rgba(0, 0, 0, 0.05); color: #0f172a; }

/* ponytail: shared confirm dialog — matches the depleted-quota modal design
  (flat card, hairline border, off-black/white surface, blur backdrop, danger-red confirm). */
.confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(3, 6, 17, 0.72);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.confirm-overlay.active { opacity: 1; visibility: visible; pointer-events: auto; }
.confirm-overlay[hidden] { display: none; }

.confirm-card {
    width: min(92%, 380px);
    background: #0d1220;
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    padding: 1.75rem 1.5rem;
    box-shadow: var(--shadow-soft);
    transform: translateY(8px);
    transition: transform 0.2s ease;
}
.confirm-overlay.active .confirm-card { transform: translateY(0); }

.confirm-title {
    font-family: "Poppins", sans-serif;
    font-size: 1.25rem;
    line-height: 1.3;
    color: var(--ink);
}
.confirm-desc {
    margin-top: 0.5rem;
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--muted-ink);
}

.confirm-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 1.35rem;
}
.confirm-primary,
.confirm-secondary {
    flex: 1;
    padding: 0.7rem 1rem;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.15s ease, background 0.15s ease, color 0.15s ease;
}
/* destructive confirm — the codebase's semantic danger color */
.confirm-primary { background: #ef4444; color: #ffffff; border: 0; }
.confirm-primary:hover { filter: brightness(0.92); }
.confirm-primary:focus-visible,
.confirm-secondary:focus-visible {
    outline: 2px solid var(--brand-gold);
    outline-offset: 2px;
}
.confirm-secondary {
    background: transparent;
    color: var(--muted-ink);
    border: 1px solid var(--panel-border);
}
.confirm-secondary:hover { color: var(--ink); }

/* light mode */
body.light-mode .confirm-card { background: #ffffff; border-color: rgba(0, 0, 0, 0.08); }
body.light-mode .confirm-title { color: #0f172a; }
body.light-mode .confirm-overlay { background: rgba(15, 23, 42, 0.45); }
body.light-mode .confirm-primary { color: #ffffff; }
body.light-mode .confirm-secondary { color: #64748b; border-color: rgba(0, 0, 0, 0.1); }
body.light-mode .confirm-secondary:hover { color: #0f172a; }

/* ponytail: per-message action bar (bot replies) — hover-revealed like .history-delete */
.msg-actions {
    display: flex;
    gap: 2px;
    /* ponytail: always visible — no hover reveal (mobile can't hover) */
    margin-top: 0.3rem;
    position: absolute;
    top: 100%;
    left: 0.6rem;
    /* delayed fade-in after the box is populated */
    animation: msgActionsIn 0.3s ease 0.55s both;
}
@keyframes msgActionsIn {
    from { opacity: 0; transform: translateY(2px); }
    to { opacity: 1; transform: none; }
}

.msg-action {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 0;
    border-radius: 8px;
    color: var(--muted-ink);
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}
.msg-action:hover { color: var(--ink); background: rgba(255, 255, 255, 0.06); }
body.light-mode .msg-action:hover { background: rgba(0, 0, 0, 0.05); }
.msg-action.active { color: var(--brand-gold); }
.msg-action:focus-visible {
    outline: 2px solid var(--brand-gold);
    outline-offset: 2px;
}

/* User prompt actions: sit under the bubble, right-aligned to match it. */
.user-msg-actions {
    left: auto;
    right: 0.6rem;
    animation-delay: 0.15s;
}
.message.user {
    /* reserve space for the action row so it never overlaps the next bubble */
    margin-bottom: 1.4rem;
}

/* Fallback-answer free-text feedback ("Didn't help?") */
.didnt-help {
    display: flex;
    align-items: center;
    gap: 4px;
}
.didnt-help-link {
    width: auto !important;
    padding: 0 8px;
    font-size: 0.72rem;
    white-space: nowrap;
}
.didnt-help-input {
    height: 30px;
    min-width: 160px;
    padding: 0 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: var(--ink);
    font-size: 0.76rem;
}
body.light-mode .didnt-help-input {
    border-color: rgba(0, 0, 0, 0.14);
    background: rgba(0, 0, 0, 0.04);
}

/* ponytail: history '...' menu — matches the confirm dialog (flat card, hairline, soft shadow) */
.history-menu {
    position: absolute;
    right: 0.25rem;
    top: calc(100% - 2px);
    z-index: 60;
    display: flex;
    flex-direction: column;
    min-width: 150px;
    padding: 0.3rem;
    background: #0d1220;
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    animation: menuIn 0.15s ease both;
}
.history-menu[hidden] { display: none; }
@keyframes menuIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}

.history-menu-item {
    display: flex;
    align-items: center;
    background: none;
    border: 0;
    border-radius: 8px;
    color: var(--ink);
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    text-align: left;
    padding: 0.55rem 0.7rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.history-menu-item:hover { background: rgba(255, 255, 255, 0.06); }
.history-menu-item:focus-visible {
    outline: 2px solid var(--brand-gold);
    outline-offset: 1px;
}

/* destructive — the codebase's semantic danger color */
.history-menu-item.history-menu-danger { color: #ef4444; }
.history-menu-item.history-menu-danger:hover { background: rgba(239, 68, 68, 0.12); }

body.light-mode .history-menu { background: #ffffff; border-color: rgba(0, 0, 0, 0.1); }
body.light-mode .history-menu-item { color: #0f172a; }
body.light-mode .history-menu-item:hover { background: rgba(0, 0, 0, 0.05); }

/* ponytail: danger must win over the light-mode ink rule above (same specificity, later order) */
body.light-mode .history-menu-item.history-menu-danger { color: #ef4444; }

/* ponytail: inline rename input — sits in the history item, gold focus ring */
.history-rename-input {
    flex: 1;
    min-width: 0;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid var(--brand-gold);
    background: rgba(255, 255, 255, 0.08);
    color: var(--ink);
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    outline: 0;
}
.history-rename-input:focus { background: rgba(255, 255, 255, 0.12); }
body.light-mode .history-rename-input { background: rgba(0, 0, 0, 0.04); color: #0f172a; }
body.light-mode .history-rename-input:focus { background: rgba(0, 0, 0, 0.07); }

/* ponytail: follow-ups are one horizontal snap-scroll row pinned above the
   composer. Keeping the fixed slot to a single line stops it from eating chat
   space; long questions ellipsize and the row scrolls. Scoped to .follow-ups so
   the desktop hero presets and the mobile suggestion rows are untouched. */
.follow-ups {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    margin-top: 0;
    width: 100%;
    padding: 0 0.2rem 0.6rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
/* Author display:flex beats the UA [hidden] rule at equal specificity. */
.follow-ups[hidden] { display: none; }
.follow-ups::-webkit-scrollbar { display: none; }
.follow-ups .quick-prompt {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.45rem;
    width: auto;
    max-width: min(100%, 22rem);
    flex: 0 0 auto;
    padding: 0.5rem 0.8rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
    color: var(--ink);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    scroll-snap-align: start;
    --row-op: 1;
    opacity: var(--row-op);
    animation: followUpRowIn 0.55s cubic-bezier(0.19, 1, 0.22, 1) backwards;
    transition: opacity 150ms ease, background 150ms ease, color 150ms ease, border-color 150ms ease;
}
/* Shrinks/ellipsizes inside the pill once the question is longer than max-width. */
.follow-up-chip-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.follow-ups .quick-prompt:nth-child(1) {
    --row-op: 1;
    animation-delay: 0s;
}
.follow-ups .quick-prompt:nth-child(2) {
    --row-op: 0.7;
    animation-delay: 0.06s;
}
.follow-ups .quick-prompt:nth-child(3) {
    --row-op: 0.45;
    animation-delay: 0.12s;
}
@keyframes followUpRowIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: var(--row-op);
        transform: none;
    }
}
.follow-ups .quick-prompt svg {
    display: block;
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    color: var(--muted-ink);
}
.follow-ups .quick-prompt:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--ink);
    opacity: 1;
}
body.light-mode .follow-ups .quick-prompt {
    background: transparent;
}
body.light-mode .follow-ups .quick-prompt:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Onboarding Swiper — editorial shell with layered preview cards */
.onboarding-swiper {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.9rem, 2.8vw, 2rem);
    background:
        radial-gradient(circle at 14% 16%, rgba(250, 204, 21, 0.22), transparent 22%),
        radial-gradient(circle at 86% 18%, rgba(96, 165, 250, 0.18), transparent 24%),
        linear-gradient(180deg, rgba(3, 6, 17, 0.82), rgba(3, 6, 17, 0.9));
    backdrop-filter: blur(14px) saturate(140%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

.onboarding-swiper.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.onboarding-swiper[hidden] { display: none; }

.onboarding-shell {
    position: relative;
    width: min(1120px, 100%);
    max-height: min(90vh, 920px);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    border-radius: 32px;
    /* ponytail: eva cloud stack lifted from QuotaModal.css — three gold clouds
       at 30% peak alpha; default attachment keeps them pinned while the shell scrolls */
    background:
        url("./gold-eva-plain.png?v=3") no-repeat -230px -120px / 340px auto,
        url("./gold-eva.png?v=3") no-repeat 100% 210px / 62px auto,
        url("./gold-eva.png?v=3") no-repeat -8px 100% / 130px auto,
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 247, 250, 0.93));
    border: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: 0 34px 90px rgba(15, 23, 42, 0.28);
    /* ponytail: scroll instead of clipping on short/landscape viewports;
       scrollbars hidden, wheel/touch still scroll */
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
    transform: translateY(14px) scale(0.985);
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.onboarding-shell::-webkit-scrollbar { display: none; }

.onboarding-swiper.active .onboarding-shell {
    transform: translateY(0) scale(1);
}

.onboarding-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.42), transparent 28%),
        radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.24), transparent 38%);
    mix-blend-mode: soft-light;
}

.onboarding-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    width: 2.5rem;
    height: 2.5rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(255, 255, 255, 0.76);
    color: #334155;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.onboarding-close:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.92);
    color: #0f172a;
    border-color: rgba(148, 163, 184, 0.45);
}

.onboarding-close:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.onboarding-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 3.4rem 0.2rem 0.2rem;
}

.onboarding-header-copy {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.onboarding-kicker {
    font-family: "Poppins", sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #64748b;
}

.onboarding-shell-title {
    font-family: "Poppins", sans-serif;
    font-size: clamp(1.7rem, 3vw, 2.35rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: #0f172a;
}

.onboarding-shell-desc {
    max-width: 52ch;
    font-size: 0.98rem;
    line-height: 1.55;
    color: #475569;
}

.onboarding-chips {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 0.3rem;
}

.onboarding-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(37, 99, 235, 0.16);
    background: rgba(255, 255, 255, 0.82);
    color: #0f172a;
    font-size: 0.82rem;
    font-weight: 600;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.onboarding-chip-soft {
    /* ponytail: credits-pill look (light mode) — gold wash, on-gold text, hairline border */
    border-color: rgba(175, 140, 0, 0.3);
    background: rgba(248, 215, 0, 0.35);
    color: #6e5b00;
}

.onboarding-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    scrollbar-width: none;
    flex-shrink: 0;
}

.onboarding-track::-webkit-scrollbar { display: none; }

.onboard-card {
    flex: 0 0 100%;
    max-width: 100%;
    /* ponytail: 56vh leaves room for the header + shell chrome inside the
       shell's max-height — 74vh clipped the nav row on short laptops */
    min-height: min(56vh, 640px);
    scroll-snap-align: center;
    scroll-snap-stop: always;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.92fr);
    gap: 1rem;
    padding: 0.15rem;
}

.onboard-stage {
    position: relative;
    min-height: 100%;
    border-radius: 28px;
    padding: 1rem;
    background:
        radial-gradient(circle at 16% 14%, rgba(250, 204, 21, 0.14), transparent 18%),
        radial-gradient(circle at 82% 16%, rgba(37, 99, 235, 0.13), transparent 19%),
        linear-gradient(180deg, rgba(251, 245, 233, 0.95), rgba(247, 249, 252, 0.92));
    border: 1px solid rgba(148, 163, 184, 0.18);
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.preview-board {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 100%;
}

.preview-board::before,
.preview-board::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}

.preview-board-gallery::before {
    width: 180px;
    height: 180px;
    top: 18px;
    right: 20px;
    background: radial-gradient(circle, rgba(250, 204, 21, 0.16), transparent 70%);
    filter: blur(10px);
}

.preview-board-gallery::after {
    width: 230px;
    height: 230px;
    left: -56px;
    bottom: -54px;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.12), transparent 68%);
    filter: blur(12px);
}

.preview-card {
    position: absolute;
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 247, 251, 0.88));
    box-shadow: 0 20px 42px rgba(15, 23, 42, 0.10);
    overflow: hidden;
}

.preview-card-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.preview-kicker {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 700;
}

.preview-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.38rem 0.7rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.10);
    color: #1d4ed8;
    font-size: 0.72rem;
    font-weight: 700;
}

.preview-dot {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.55);
    flex: none;
}

.preview-dot-gold { background: rgba(250, 204, 21, 0.75); }

.preview-card-wide {
    inset: 50% 11% 12% 10%;
    transform: translateY(-50%);
    padding: 1rem;
}

.preview-card-left {
    top: 9%;
    left: 3%;
    width: 28%;
    min-height: 34%;
    padding: 0.9rem;
    transform: rotate(-5deg);
}

.preview-card-right {
    right: 5%;
    bottom: 7%;
    width: 29%;
    min-height: 35%;
    padding: 0.9rem;
    transform: rotate(6deg);
}

.preview-window {
    width: 100%;
    height: calc(100% - 1.6rem);
    margin-top: 0.85rem;
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 244, 250, 0.94));
    border: 1px solid rgba(148, 163, 184, 0.14);
    overflow: hidden;
}

.preview-window-bar {
    display: flex;
    gap: 0.3rem;
    padding: 0.8rem 0.85rem 0;
}

.preview-window-bar span {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.44);
}

.preview-window-body {
    height: calc(100% - 1.4rem);
    padding: 0.8rem 0.9rem 0.9rem;
}

.preview-searchbar {
    height: 0.95rem;
    width: 58%;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.14), rgba(250, 204, 21, 0.18));
    margin-bottom: 1rem;
}

.preview-lines {
    display: grid;
    gap: 0.56rem;
}

.preview-lines span,
.preview-mini-stack span {
    display: block;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.18), rgba(148, 163, 184, 0.08));
}

.preview-lines span:nth-child(1) { width: 78%; height: 0.88rem; }
.preview-lines span:nth-child(2) { width: 65%; height: 0.88rem; }
.preview-lines span:nth-child(3) { width: 56%; height: 0.88rem; }

.preview-mini-stack {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.95rem;
}

.preview-mini-stack span:nth-child(1) { width: 88%; height: 0.72rem; }
.preview-mini-stack span:nth-child(2) { width: 71%; height: 0.72rem; }
.preview-mini-stack span:nth-child(3) { width: 60%; height: 0.72rem; }
.preview-mini-stack.compact span:nth-child(1) { width: 82%; }
.preview-mini-stack.compact span:nth-child(2) { width: 66%; }
.preview-mini-stack.compact span:nth-child(3) { width: 52%; }

.preview-card-topline + .preview-mini-stack,
.preview-card-topline + .preview-window,
.preview-card-topline + .preview-mini-stack.compact {
    margin-top: 0.95rem;
}

.quota-ring-panel {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.9rem;
    align-items: center;
}

.quota-ring {
    width: 4.4rem;
    height: 4.4rem;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-family: "Poppins", sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #1d4ed8;
    background:
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.32)),
        conic-gradient(from 180deg, rgba(37, 99, 235, 0.92) 0deg 300deg, rgba(191, 219, 254, 0.68) 300deg 360deg);
    box-shadow: inset 0 0 0 0.55rem rgba(255, 255, 255, 0.72), 0 16px 30px rgba(37, 99, 235, 0.16);
}

.quota-ring-copy {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.quota-ring-copy strong {
    font-size: 1.02rem;
    line-height: 1.35;
    color: #0f172a;
}

.quota-meter {
    height: 0.88rem;
    margin-top: 1rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.16);
    overflow: hidden;
}

.quota-meter span {
    display: block;
    width: 68%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #fbbf24, #60a5fa);
}

.quota-tile-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.quota-tile {
    padding: 0.85rem 0.8rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.16);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-height: 6rem;
    justify-content: flex-end;
}

.quota-tile-label {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 700;
}

.quota-tile strong {
    font-size: 0.93rem;
    line-height: 1.35;
    color: #0f172a;
}

/* ponytail: university board — native select + optgroups, shell styling, gold focus ring */
.preview-board-university {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
}

/* ponytail: the ask is pinned to the TOP of the board, bold and larger; the
   campus label + dropdown stay vertically centered exactly as before */
.preview-board-university .onboard-title {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    text-align: center;
    font-weight: 800;
    font-size: clamp(1.6rem, 2.6vw, 2.2rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.onboard-select {
    width: 100%;
    max-width: 340px;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(255, 255, 255, 0.85);
    color: #0f172a;
    font-family: 'Inter', sans-serif;
    font-size: 0.92rem;
    outline: 0;
    cursor: text;
    transition: border 0.15s ease, background 0.15s ease;
}

.onboard-select:focus {
    border-color: var(--brand-gold);
    background: #ffffff;
}

.onboard-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.85rem;
    padding: 0.55rem 0.2rem 0.2rem;
}

.onboard-step-badge {
    width: fit-content;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(37, 99, 235, 0.14);
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.onboard-title {
    font-family: "Poppins", sans-serif;
    font-size: clamp(1.45rem, 2.2vw, 2.05rem);
    line-height: 1.12;
    letter-spacing: -0.03em;
    color: #0f172a;
}

.onboard-desc {
    font-size: 0.98rem;
    line-height: 1.62;
    color: #475569;
    max-width: 42ch;
}

.onboard-points {
    display: grid;
    gap: 0.75rem;
}

.onboard-point {
    padding: 0.85rem 0.9rem;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.onboard-point strong {
    display: block;
    font-size: 0.92rem;
    color: #0f172a;
    margin-bottom: 0.2rem;
}

.onboard-point span {
    display: block;
    font-size: 0.86rem;
    line-height: 1.55;
    color: #64748b;
}

.onboard-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    margin-top: auto;
    padding-top: 0.3rem;
}

.onboard-btn {
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.onboard-btn:hover {
    transform: translateY(-1px);
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.26);
    color: #1d4ed8;
}

.onboard-btn:disabled {
    opacity: 0.36;
    cursor: not-allowed;
    transform: none;
}

.onboard-btn i { width: 22px; height: 22px; }

.onboard-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    flex: 1;
}

.onboard-dot {
    width: 0.72rem;
    height: 0.72rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.34);
    border: none;
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.onboard-dot:hover { background: rgba(37, 99, 235, 0.5); }

.onboard-dot.active {
    background: linear-gradient(135deg, #2563eb, #f59e0b);
    transform: scale(1.24);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.onboard-dot:focus-visible,
.onboard-btn:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

body.dark-mode .onboard-dot:focus-visible {
    outline-color: #ffd700;
}

body.dark-mode .onboarding-shell {
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 34px 90px rgba(0, 0, 0, 0.42);
}

body.dark-mode .onboarding-close {
    background: rgba(15, 23, 42, 0.82);
    border-color: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
}

body.dark-mode .onboarding-close:hover {
    background: rgba(15, 23, 42, 0.94);
    color: #ffffff;
}

body.dark-mode .onboarding-kicker,
body.dark-mode .onboarding-shell-desc,
body.dark-mode .onboard-desc,
body.dark-mode .onboard-point span,
body.dark-mode .preview-kicker,
body.dark-mode .quota-tile-label,
body.dark-mode .preview-pill {
    color: #64748b;
}

body.dark-mode .onboarding-shell-title,
body.dark-mode .onboard-title,
body.dark-mode .quota-ring-copy strong,
body.dark-mode .quota-tile strong,
body.dark-mode .onboard-point strong {
    color: #0f172a;
}

body.dark-mode .onboard-stage {
    background:
        radial-gradient(circle at 16% 14%, rgba(250, 204, 21, 0.16), transparent 18%),
        radial-gradient(circle at 82% 16%, rgba(59, 130, 246, 0.15), transparent 19%),
        linear-gradient(180deg, rgba(252, 246, 236, 0.98), rgba(246, 248, 252, 0.96));
}

body.dark-mode .preview-card,
body.dark-mode .quota-tile,
body.dark-mode .onboard-point,
body.dark-mode .preview-window {
    border-color: rgba(148, 163, 184, 0.14);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 247, 251, 0.92));
}

body.dark-mode .onboard-btn {
    background: rgba(15, 23, 42, 0.04);
    border-color: rgba(148, 163, 184, 0.16);
    color: #0f172a;
}

body.dark-mode .onboard-btn:hover {
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.28);
    color: #1d4ed8;
}

/* Large screens: stop the shell/card growing with the viewport. Without this
   the card's 56vh min-height plus the header can push the prev/next controls
   below the fold, and the shell's scrollbar is hidden so there's no cue. A
   tighter cap keeps the whole card (controls included) inside the viewport. */
@media (min-width: 1000px) {
    .onboarding-shell {
        width: min(1040px, 100%);
        max-height: min(82vh, 760px);
    }

    .onboard-card {
        min-height: min(46vh, 520px);
    }
}

@media (max-width: 900px) {
    .onboarding-shell {
        max-height: 92vh;
        padding: 0.9rem;
    }

    .onboarding-header {
        flex-direction: column;
        align-items: flex-start;
        padding-right: 3rem;
    }

    .onboarding-chips {
        justify-content: flex-start;
    }

    .onboard-card {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .onboard-stage {
        min-height: 320px;
    }

    .onboard-copy {
        padding: 0.2rem 0.1rem 0.4rem;
    }

    .preview-card-left {
        width: 30%;
        left: 2%;
    }

    .preview-card-right {
        width: 31%;
        right: 3%;
    }
}

@media (max-width: 640px) {
    .onboarding-swiper {
        padding: 0.65rem;
    }

    .onboarding-shell {
        padding: 0.75rem;
        border-radius: 26px;
    }

    .onboarding-close {
        top: 0.75rem;
        right: 0.75rem;
        width: 2.2rem;
        height: 2.2rem;
    }

    .onboarding-header {
        padding-right: 2.6rem;
    }

    .onboarding-shell-title {
        font-size: 1.4rem;
    }

    .onboarding-shell-desc {
        font-size: 0.92rem;
    }

    .onboard-stage {
        min-height: 250px;
        padding: 0.8rem;
    }

    .preview-card-wide {
        inset: 49% 8% 10% 8%;
    }

    .preview-card-left {
        top: 10%;
        width: 32%;
        transform: rotate(-4deg);
    }

    .preview-card-right {
        bottom: 8%;
        width: 32%;
        transform: rotate(4deg);
    }

    .quota-tile-grid {
        grid-template-columns: 1fr;
    }

    .quota-ring-panel {
        grid-template-columns: 1fr;
        justify-items: start;
    }

    .quota-ring {
        width: 3.8rem;
        height: 3.8rem;
        font-size: 1.25rem;
    }

    .onboard-nav {
        flex-wrap: wrap;
    }

    .onboard-dots {
        order: 3;
        width: 100%;
    }

    .onboard-btn {
        width: 2.8rem;
        height: 2.8rem;
    }
}

/* ponytail: mobile pull-to-refresh. The pinned shell (body/.app-shell
   overflow:hidden + fixed height) leaves the document nothing to overscroll,
   which disables the browser's native swipe-down-to-reload. Let the document
   expose its vertical scroll gesture and stop clamping overscroll on the
   scrollers, so the refresh gesture works like on other sites. */
@media (max-width: 768px) {
    html,
    body {
        height: auto;
        min-height: 100%;
        overflow-y: visible;
    }

    .app-shell {
        height: var(--app-height, 100dvh);
        min-height: 100dvh;
    }

    .chat-container,
    .app-body {
        overscroll-behavior-y: auto;
    }
}
