@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&family=Fraunces:opsz,wght@9..144,500;9..144,700&family=IBM+Plex+Mono:wght@400;600&display=swap');

:root {
    --spot-bg: #f4f1ea;
    --spot-panel: #fffdf8;
    --spot-ink: #1f2933;
    --spot-muted: #5b6875;
    --spot-line: #d9d2c6;
    --spot-accent: #0369a1;
    --spot-accent-2: #ea580c;
    --spot-danger: #b42318;
    --spot-success: #15803d;
    --spot-warning: #b45309;
    --spot-info: #0369a1;
    --spot-surface-alt: #faf6ec;
    --spot-surface-hover: rgba(15, 23, 42, 0.04);
    --spot-focus: #0ea5e9;
    --spot-radius-sm: 8px;
    --spot-radius-md: 12px;
    --spot-radius-lg: 18px;
    --spot-shadow-sm: 0 4px 10px rgba(15, 23, 42, 0.04);
    --spot-shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
    --spot-shadow-lg: 0 14px 30px rgba(15, 23, 42, 0.1);
    --spot-font-sans: 'Space Grotesk', 'Segoe UI', sans-serif;
    --spot-font-display: 'Fraunces', serif;
    --spot-font-mono: 'IBM Plex Mono', monospace;
}

body.app-shell {
    margin: 0;
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
    color: var(--spot-ink);
    background: radial-gradient(80% 80% at 0% 0%, #e0f2fe 0%, var(--spot-bg) 60%);
    min-height: 100vh;
}

.app-viewport {
    max-width: 1300px;
    margin: 0 auto;
    padding: 18px 18px 28px;
}

.app-main {
    padding-bottom: 12px;
}

.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 4px 18px;
    border-bottom: 1px solid var(--spot-line);
    margin-bottom: 18px;
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--spot-ink);
    font-weight: 700;
}

.app-brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(140deg, var(--spot-accent), var(--spot-accent-2));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.app-brand-name {
    font-family: 'Fraunces', serif;
    font-size: 1.05rem;
    letter-spacing: 0.01em;
}

.app-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-practice-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.topbar-practice-label {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--spot-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.topbar-practice-select {
    min-width: 230px;
    max-width: 320px;
    border: 1px solid var(--spot-line);
    border-radius: 999px;
    background: #fff;
    color: var(--spot-ink);
    padding: 7px 12px;
    font-size: 0.83rem;
    font-weight: 600;
}

.topbar-practice-select:focus {
    border-color: var(--spot-accent);
    box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.16);
    outline: none;
}

.profile-menu {
    position: relative;
    display: inline-block;
}

.profile-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px 6px 6px;
    border: 1px solid var(--spot-line);
    border-radius: 999px;
    background: #fff;
    cursor: pointer;
    font-weight: 600;
    color: var(--spot-ink);
    font-size: 0.86rem;
}

.profile-trigger:hover {
    border-color: var(--spot-accent);
}

.profile-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(140deg, var(--spot-accent), var(--spot-accent-2));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    font-size: 0.82rem;
}

.profile-trigger .caret {
    color: var(--spot-muted);
    font-size: 0.7rem;
}

.profile-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 240px;
    background: #fff;
    border: 1px solid var(--spot-line);
    border-radius: 14px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    padding: 8px;
    display: none;
    z-index: 999;
}

.profile-menu.open .profile-dropdown {
    display: block;
}

.profile-dropdown .profile-head {
    padding: 10px 10px 12px;
    border-bottom: 1px solid var(--spot-line);
    margin-bottom: 6px;
}

.profile-dropdown .profile-head .name {
    font-weight: 700;
    font-size: 0.92rem;
}

.profile-dropdown .profile-head .meta {
    font-size: 0.78rem;
    color: var(--spot-muted);
    margin-top: 2px;
}

.profile-dropdown a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--spot-ink);
    font-size: 0.88rem;
}

.profile-dropdown a:hover {
    background: rgba(15, 23, 42, 0.04);
}

.profile-dropdown a.danger {
    color: var(--spot-danger);
}

.profile-dropdown .divider {
    height: 1px;
    background: var(--spot-line);
    margin: 6px 0;
}

.mode-switch {
    display: inline-flex;
    align-items: stretch;
    background: #fff;
    border: 1px solid var(--spot-line);
    border-radius: 999px;
    padding: 4px;
    gap: 2px;
    margin: 0 0 18px;
    align-self: flex-start;
}

.mode-switch a {
    text-decoration: none;
    color: var(--spot-muted);
    font-weight: 600;
    font-size: 0.84rem;
    padding: 8px 16px;
    min-height: 36px;
    box-sizing: border-box;
    border-radius: 999px;
    line-height: 1.1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    vertical-align: middle;
    transition: background 0.15s ease, color 0.15s ease;
}

.mode-switch a:hover {
    color: var(--spot-ink);
}

.mode-switch a.active {
    background: var(--spot-ink);
    color: #fff;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.18);
}

.mode-switch a .mode-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.75;
}

.mode-switch a.active .mode-dot {
    opacity: 1;
}

.mode-switch .mode-subtle {
    display: inline-flex;
    align-items: center;
    font-weight: 500;
    opacity: 0.85;
}

.mode-switch.admin a.active {
    background: #0f172a;
}

.mode-switch.practice a.active {
    background: #0f766e;
}

.spotlight-secondary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.spotlight-secondary a {
    text-decoration: none;
    border: 1px solid var(--spot-line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    padding: 6px 12px;
    min-height: 32px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    font-size: 0.8rem;
    line-height: 1.1;
    color: var(--spot-ink);
    font-weight: 500;
}

.spotlight-secondary a:hover {
    border-color: var(--spot-accent);
}

.spotlight-secondary a.active {
    border-color: var(--spot-accent);
    background: color-mix(in srgb, var(--spot-accent) 12%, white);
}

.app-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 0.82rem;
    color: var(--spot-muted);
}

.app-breadcrumb a {
    color: var(--spot-accent);
    text-decoration: none;
}

.app-breadcrumb a:hover {
    text-decoration: underline;
}

.app-breadcrumb span:last-child {
    color: var(--spot-muted);
}

.app-breadcrumb span:last-child::before {
    content: '/';
    margin-right: 8px;
    color: var(--spot-line);
}

.spotlight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}

.spotlight-tile {
    position: relative;
    border-radius: 22px;
    padding: 22px 22px 18px;
    background: var(--spot-panel);
    border: 1px solid var(--spot-line);
    text-decoration: none;
    color: var(--spot-ink);
    overflow: hidden;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.spotlight-tile.tile-accent-a8550f {
    --tile-accent: #a8550f;
}

.spotlight-tile.tile-accent-0f766e {
    --tile-accent: #0f766e;
}

.spotlight-tile.tile-accent-1d4ed8 {
    --tile-accent: #1d4ed8;
}

.spotlight-tile.tile-accent-be123c {
    --tile-accent: #be123c;
}

.spotlight-tile.tile-accent-0369a1 {
    --tile-accent: #0369a1;
}

.spotlight-tile.tile-accent-7c3aed {
    --tile-accent: #7c3aed;
}

.spotlight-tile.tile-accent-4f46e5 {
    --tile-accent: #4f46e5;
}

.spotlight-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.1);
}

.spotlight-tile::after {
    content: '';
    position: absolute;
    right: -40px;
    top: -40px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, var(--tile-accent, var(--spot-accent)) 0%, transparent 70%);
    opacity: 0.18;
}

.spotlight-tile .tile-eyebrow {
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--tile-accent, var(--spot-accent));
}

.spotlight-tile h2 {
    margin: 6px 0 4px;
    font-family: 'Fraunces', serif;
    font-size: 1.7rem;
    line-height: 1.1;
}

.spotlight-tile p {
    margin: 0 0 12px;
    color: var(--spot-muted);
    font-size: 0.88rem;
}

.spotlight-tile .tile-stat {
    margin-top: auto;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.spotlight-tile .tile-stat .num {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 2rem;
    font-weight: 700;
    color: var(--spot-ink);
}

.spotlight-tile .tile-stat .label {
    font-size: 0.78rem;
    color: var(--spot-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.spotlight-tile .tile-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.spotlight-tile .tile-quick span {
    font-size: 0.74rem;
    background: rgba(15, 23, 42, 0.06);
    border-radius: 999px;
    padding: 3px 10px;
    color: var(--spot-ink);
}

.spotlight-recent {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.spotlight-recent .surface {
    border: 1px solid var(--spot-line);
    border-radius: 14px;
    background: var(--spot-panel);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
    padding: 14px 16px;
}

.spotlight-recent h3 {
    font-family: 'Fraunces', serif;
    margin: 0 0 8px;
    font-size: 1.05rem;
}

.spotlight-recent ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 6px;
    font-size: 0.86rem;
}

.spotlight-recent li {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: var(--spot-muted);
}

.spotlight-recent li strong {
    color: var(--spot-ink);
    font-weight: 600;
}

.spotlight-recent li .spotlight-recent-main {
    color: var(--spot-ink);
    font-weight: 600;
    text-decoration: none;
}

.spotlight-recent li .spotlight-recent-main:hover {
    text-decoration: underline;
}

.spotlight-recent li .spotlight-recent-sub {
    color: var(--spot-muted);
    text-decoration: none;
}

.spotlight-recent li .spotlight-recent-sub:hover {
    text-decoration: underline;
}

.mono {
    font-family: 'IBM Plex Mono', monospace;
}

.spotlight-page {
    padding-bottom: 6px;
}

.help-page .help-container {
    max-width: 100%;
}

@media (max-width: 900px) {
    .app-topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .app-topbar-actions {
        width: 100%;
        justify-content: space-between;
    }

    .topbar-practice-switch {
        flex: 1 1 auto;
        min-width: 0;
    }

    .topbar-practice-select {
        min-width: 0;
        width: 100%;
        max-width: none;
    }
}

@media (max-width: 720px) {
    .app-viewport {
        padding: 12px;
    }

    .mode-switch {
        width: 100%;
        justify-content: space-between;
    }

    .spotlight-secondary {
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: thin;
    }

    .spotlight-secondary a {
        flex: 0 0 auto;
    }
}
