/* ResearchCave Notifications product interface */

:root {
    color-scheme: light;
    /* Surfaces */
    --bg-app: #f3f3f3;
    --bg-titlebar: #f8f8f8;
    --bg-activitybar: #f8f8f8;
    --bg-editor: #ffffff;
    --bg-panel: #ffffff;
    --bg-panel-2: #f3f3f3;
    --bg-inset: #f8f8f8;
    --bg-hover: #e8e8e8;
    --bg-statusbar: #007acc;

    /* Lines */
    --border: #d4d4d4;
    --border-soft: #e5e5e5;
    --border-strong: #b8b8b8;

    /* Text */
    --text: #3b3b3b;
    --text-strong: #1f1f1f;
    --text-muted: #616161;
    --text-faint: #7a7a7a;

    /* Syntax-inspired accents (the "colors") */
    --blue: #007acc;
    --azure: #0451a5;
    --teal: #008080;
    --green: #008000;
    --yellow: #795e26;
    --orange: #a31515;
    --purple: #af00db;
    --red: #d13438;
    --pink: #ff79c6;

    --accent: #007acc;
    --accent-strong: #0066b0;

    --radius: 8px;
    --radius-sm: 6px;
    --shadow: 0 18px 50px rgba(0, 0, 0, .16);
    --mono: "Cascadia Code", "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --sans: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
}

body {
    background: var(--bg-app);
    color: var(--text);
    font-family: var(--sans);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: #07568f; text-decoration: underline; }

code, pre, .mono { font-family: var(--mono); }

::selection { background: rgba(79, 193, 255, .28); }

/* Scrollbars */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #4a4a4f; border: 3px solid transparent; background-clip: content-box; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #5a5a60; background-clip: content-box; }

/* ============================================================
   IDE SHELL
   ============================================================ */
.ide {
    display: grid;
    grid-template-rows: 36px 1fr 24px;
    height: 100vh;
    width: 100%;
}

/* Title bar */
.ide-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-titlebar);
    border-bottom: 1px solid #000;
    padding: 0 10px;
    font-size: 13px;
    user-select: none;
}
.ide-titlebar-left { display: flex; align-items: center; gap: 8px; }
.ide-logo {
    display: inline-flex;
    width: 22px; height: 22px;
    align-items: center; justify-content: center;
    border-radius: 6px;
    background: linear-gradient(135deg, #4fc1ff, #c586c0);
    color: #10131a;
    font-size: 12px;
}
.ide-title { color: var(--text-strong); font-weight: 600; }
.ide-title-dim { color: var(--text-muted); }
.ide-service-tag {
    margin-left: 4px;
    font-family: var(--mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--teal);
    border: 1px solid rgba(78, 201, 176, .35);
    background: rgba(78, 201, 176, .08);
    padding: 1px 6px;
    border-radius: 999px;
}
.ide-titlebar-center { color: var(--text-muted); font-family: var(--mono); font-size: 12px; }
.ide-crumb i { color: var(--yellow); }
.ide-titlebar-right { display: flex; align-items: center; gap: 10px; }
.ide-user { display: inline-flex; align-items: center; gap: 7px; color: var(--text); font-size: 12.5px; }
.ide-avatar {
    width: 22px; height: 22px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-strong);
    box-shadow: 0 0 0 2px rgba(78,201,176,.25);
}
.ide-avatar-fallback { color: var(--teal); font-size: 18px; line-height: 1; }
.ide-user-name { color: var(--text); }
.ide-inline-form { margin: 0; display: inline-flex; }
.ide-titlebar-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-size: 13px;
    padding: 3px 8px;
    border-radius: 6px;
    cursor: pointer;
}
.ide-titlebar-btn:hover { background: var(--bg-hover); color: var(--text-strong); text-decoration: none; }
.ide-titlebar-btn--accent {
    color: #eaf6ff;
    border-color: rgba(79, 193, 255, .4);
    background: rgba(79, 193, 255, .12);
}
.ide-titlebar-btn--accent:hover { background: rgba(79, 193, 255, .22); color: #fff; }

/* Body split */
.ide-body { display: grid; grid-template-columns: 52px 1fr; min-height: 0; }

/* Activity bar */
.ide-activitybar {
    background: var(--bg-activitybar);
    border-right: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0;
    gap: 4px;
}
.ide-activity {
    position: relative;
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-faint);
    font-size: 22px;
    border-left: 2px solid transparent;
    border-radius: 0;
}
.ide-activity:hover { color: var(--text-strong); text-decoration: none; }
.ide-activity.is-active { color: var(--text-strong); border-left-color: var(--accent); }
.ide-activity-spacer { flex: 1; }
.ide-activity[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    left: 52px; top: 50%;
    transform: translateY(-50%);
    background: #1f1f22;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 4px 9px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0; pointer-events: none;
    transition: opacity .12s ease;
    box-shadow: var(--shadow);
    z-index: 50;
}
.ide-activity:hover::after { opacity: 1; }

/* Editor / content region */
.ide-editor {
    background: var(--bg-editor);
    overflow: auto;
    min-height: 0;
    padding: 0;
}

/* Status bar */
.ide-statusbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-statusbar);
    color: #fff;
    font-size: 12px;
    padding: 0 8px;
    user-select: none;
}
.ide-statusbar-left, .ide-statusbar-right { display: flex; align-items: center; gap: 2px; }
.ide-status-item {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 0 8px; height: 24px; line-height: 24px;
}
.ide-status-item i { font-size: 12px; }
.ide-status-accent { background: rgba(0,0,0,.14); }
.ide-status-ok { color: #d6ffe0; }

/* ============================================================
   PAGE SCAFFOLD (tabs + content padding)
   ============================================================ */
.page {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}
.page-tabs {
    display: flex;
    align-items: stretch;
    background: var(--bg-activitybar);
    border-bottom: 1px solid var(--border-soft);
    height: 38px;
    padding-left: 2px;
}
.page-tab {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 0 16px;
    color: var(--text-muted);
    font-size: 13px;
    border-right: 1px solid var(--border-soft);
    background: transparent;
}
.page-tab.is-active {
    background: var(--bg-editor);
    color: var(--text-strong);
    border-top: 1px solid var(--accent);
    margin-top: -1px;
}
.page-tab i { font-size: 14px; }
.page-tab .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }

.page-body { padding: 28px 34px 48px; max-width: 1280px; width: 100%; margin: 0 auto; }

/* Section heading */
.section-eyebrow {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: .04em;
    color: var(--purple);
    margin-bottom: 6px;
}
.section-title {
    font-size: 22px;
    font-weight: 650;
    color: var(--text-strong);
    margin: 0 0 6px;
}
.section-sub { color: var(--text-muted); margin: 0; max-width: 70ch; }

/* ============================================================
   HERO (home)
   ============================================================ */
.hero {
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px 32px;
    margin-bottom: 26px;
    background:
        radial-gradient(1200px 300px at 0% -20%, rgba(79,193,255,.14), transparent 60%),
        radial-gradient(900px 300px at 100% 0%, rgba(197,134,192,.12), transparent 55%),
        var(--bg-panel);
    overflow: visible;
}
.hero::before {
    content: "";
    position: absolute; inset: 0;
    background-image: linear-gradient(rgba(255,255,255,.02) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
    background-size: 26px 26px;
    pointer-events: none;
}
.hero-inner { position: relative; }
.hero-kicker {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--mono); font-size: 12px;
    color: var(--teal);
    border: 1px solid rgba(78,201,176,.3);
    background: rgba(78,201,176,.08);
    padding: 4px 10px; border-radius: 999px;
    margin-bottom: 16px;
}
.hero h1 {
    font-size: 30px; font-weight: 700; margin: 0 0 10px;
    color: var(--text-strong); letter-spacing: -.01em;
}
.hero h1 .accent {
    background: linear-gradient(90deg, var(--blue), var(--purple));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--text-muted); font-size: 15px; margin: 0 0 20px; max-width: 68ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ============================================================
   BUTTONS (override bootstrap)
   ============================================================ */
.btn {
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 500;
    padding: 7px 14px;
    display: inline-flex; align-items: center; gap: 8px;
    border: 1px solid transparent;
    transition: background .12s ease, border-color .12s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn:focus, .btn:active:focus {
    box-shadow: 0 0 0 2px var(--bg-app), 0 0 0 4px rgba(79,193,255,.6);
}
.btn-primary, .btn-primary:focus {
    background: var(--accent-strong);
    border-color: #1177c7;
    color: #fff;
}
.btn-primary:hover { background: #1284d6; border-color: #1a90e6; color: #fff; }
.btn-outline-secondary {
    background: transparent;
    color: var(--text);
    border-color: var(--border-strong);
}
.btn-outline-secondary:hover { background: var(--bg-hover); color: var(--text-strong); border-color: var(--accent); }
.btn-outline-primary {
    background: transparent; color: var(--blue); border-color: rgba(79,193,255,.4);
}
.btn-outline-primary:hover { background: rgba(79,193,255,.12); color: #8ad4ff; border-color: var(--blue); }
.btn-outline-danger {
    background: transparent; color: var(--red); border-color: rgba(241,76,76,.4);
}
.btn-outline-danger:hover { background: rgba(241,76,76,.14); color: #ff6b6b; border-color: var(--red); }
.btn-ghost {
    background: transparent; color: var(--text-muted); border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-strong); }
.btn-sm { padding: 4px 10px; font-size: 12.5px; }

/* ============================================================
   CARDS / PANELS
   ============================================================ */
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    transition: border-color .15s ease, transform .15s ease;
}
.card:hover { border-color: var(--border-strong); }
.card-icon {
    width: 38px; height: 38px; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 18px; margin-bottom: 12px;
    background: rgba(79,193,255,.12); color: var(--blue);
    border: 1px solid rgba(79,193,255,.22);
}
.card-icon.teal { background: rgba(78,201,176,.12); color: var(--teal); border-color: rgba(78,201,176,.24); }
.card-icon.purple { background: rgba(197,134,192,.12); color: var(--purple); border-color: rgba(197,134,192,.24); }
.card-icon.yellow { background: rgba(220,220,170,.12); color: var(--yellow); border-color: rgba(220,220,170,.24); }
.card-icon.orange { background: rgba(206,145,120,.12); color: var(--orange); border-color: rgba(206,145,120,.24); }
.card h3 { font-size: 15px; color: var(--text-strong); margin: 0 0 6px; }
.card p { color: var(--text-muted); font-size: 13px; margin: 0; line-height: 1.5; }
.card-link {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 12px; font-size: 12.5px; font-family: var(--mono);
    color: var(--blue);
}

/* Stat strip */
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border-soft); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 26px; }
.stat { background: var(--bg-panel); padding: 16px 18px; }
.stat-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); margin-bottom: 6px; }
.stat-value { font-size: 20px; font-weight: 650; color: var(--text-strong); font-family: var(--mono); display: flex; align-items: center; gap: 8px; }
.stat-value .pip { width: 9px; height: 9px; border-radius: 50%; }
.pip.green { background: var(--green); box-shadow: 0 0 8px rgba(106,192,127,.7); }
.pip.blue { background: var(--blue); box-shadow: 0 0 8px rgba(79,193,255,.7); }

/* Endpoint / code block */
.codeblock {
    background: var(--bg-inset);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--mono);
    font-size: 12.5px;
    overflow: hidden;
}
.codeblock-head {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px;
    background: var(--bg-panel-2);
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
}
.codeblock-dots { display: flex; gap: 6px; }
.codeblock-dots span { width: 11px; height: 11px; border-radius: 50%; }
.codeblock-dots span:nth-child(1) { background: #ff5f56; }
.codeblock-dots span:nth-child(2) { background: #ffbd2e; }
.codeblock-dots span:nth-child(3) { background: #27c93f; }
.codeblock-body { padding: 14px 16px; line-height: 1.7; color: var(--text); }
.tok-verb { color: var(--purple); font-weight: 600; }
.tok-path { color: var(--yellow); }
.tok-comment { color: var(--green); }
.tok-str { color: var(--orange); }
.tok-key { color: var(--azure); }

/* Endpoint list */
.endpoints { display: grid; gap: 8px; }
.endpoint {
    display: flex; align-items: center; gap: 12px;
    background: var(--bg-inset);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-family: var(--mono); font-size: 12.5px;
}
.verb {
    min-width: 52px; text-align: center;
    padding: 2px 0; border-radius: 5px; font-size: 11px; font-weight: 700;
}
.verb.get { color: #6ac07f; background: rgba(106,192,127,.12); border: 1px solid rgba(106,192,127,.3); }
.verb.post { color: #4fc1ff; background: rgba(79,193,255,.12); border: 1px solid rgba(79,193,255,.3); }
.endpoint .path { color: var(--text); }
.endpoint .desc { color: var(--text-faint); margin-left: auto; font-family: var(--sans); font-size: 12px; }

/* ============================================================
   PUBLIC HOME / USER INBOX
   ============================================================ */
.public-hero {
    --mascot-size: clamp(10rem, 25vw, 18rem);
    --mascot-zone: clamp(12rem, 29vw, 20rem);
    margin-bottom: 18px;
}
.landing-grid {
    align-items: start;
}
.home-inbox .notification-list {
    margin-top: 16px;
}
.home-inbox .notification-list:empty::after {
    content: "No active notifications in your inbox.";
}
.home-inbox-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}
.unread-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    border: 1px solid rgba(79,193,255,.35);
    border-radius: var(--radius-sm);
    padding: 0 10px;
    color: var(--blue);
    background: rgba(79,193,255,.1);
    font-family: var(--mono);
    font-size: 12px;
}
.signed-out-panel {
    display: grid;
    gap: 6px;
    justify-items: center;
    text-align: center;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 28px 18px;
    margin-top: 16px;
    color: var(--text-muted);
    background: var(--bg-inset);
}
.signed-out-panel i {
    color: var(--yellow);
    font-size: 26px;
}
.signed-out-panel strong {
    color: var(--text-strong);
}
.home-actions-list {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}
.home-actions-list div {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 10px;
    align-items: center;
    color: var(--text);
}
.home-actions-list i {
    color: var(--teal);
    font-size: 18px;
}
.compact-endpoints {
    margin-top: 14px;
}
.preference-panel {
    grid-column: 1 / -1;
}
.preference-list {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}
.preference-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    background: var(--bg-inset);
    color: var(--text);
}
.preference-switch-row {
    cursor: pointer;
    min-height: 56px;
}
.preference-row span {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}
.preference-row i {
    color: var(--teal);
}
.preference-switch {
    position: relative;
    flex: 0 0 auto;
    width: 46px;
    height: 26px;
}
.preference-switch input {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}
.preference-switch-track {
    position: absolute;
    inset: 0;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--bg-panel-2);
    transition: background .15s ease, border-color .15s ease;
}
.preference-switch-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-muted);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
    transition: transform .15s ease, background .15s ease;
}
.preference-switch input:checked + .preference-switch-track {
    border-color: rgba(79,193,255,.55);
    background: rgba(10,110,189,.55);
}
.preference-switch input:checked + .preference-switch-track::after {
    transform: translateX(20px);
    background: #fff;
}
.preference-switch input:focus-visible + .preference-switch-track {
    box-shadow: 0 0 0 2px rgba(79,193,255,.24);
}
.preference-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}

/* ============================================================
   NATS CONSOLE (Test page)
   ============================================================ */
.notifications-shell { max-width: 1280px; margin: 0 auto; }
.notifications-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 1rem; margin-bottom: 22px;
}
.notifications-header h1 { font-size: 22px; margin: 0 0 6px; color: var(--text-strong); }
.notifications-header p { margin: 0; color: var(--text-muted); max-width: 70ch; }

.notification-panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    background: var(--bg-panel);
}
.notification-panel h2 {
    font-size: 12px; text-transform: uppercase; letter-spacing: .07em;
    margin: 0 0 14px; color: var(--text-faint);
    display: flex; align-items: center; gap: 8px;
}
.notification-panel h2::before {
    content: ""; width: 3px; height: 13px; border-radius: 2px; background: var(--accent);
}

.notification-list-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.notification-list { display: grid; gap: 10px; margin-top: 4px; }
.notification-list:empty::after {
    content: "No notifications yet — send one to see it appear here.";
    color: var(--text-faint); font-size: 13px; font-style: italic;
    padding: 18px; text-align: center;
    border: 1px dashed var(--border); border-radius: var(--radius-sm);
}
.notification-list-item {
    display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem;
    border: 1px solid var(--border);
    border-left: 3px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    background: var(--bg-inset);
    transition: border-color .15s ease, background .15s ease;
}
.notification-list-item:hover { background: #202021; }
.notification-list-item.notification-read { opacity: .55; }
.read-flag {
    display: inline-flex; align-items: center; gap: 5px;
    flex-shrink: 0;
    font-size: 12px; font-family: var(--mono);
    color: var(--green);
    padding: 4px 10px;
    border: 1px solid rgba(106,192,127,.3);
    background: rgba(106,192,127,.1);
    border-radius: var(--radius-sm);
}
.notification-title { font-weight: 650; color: var(--text-strong); }
.notification-body { color: var(--text); font-size: 13.5px; margin-top: 2px; }
.notification-meta { margin-top: 8px; color: var(--text-faint); font-size: 12px; font-family: var(--mono); }

/* Severity accents */
.severity-info { border-left-color: var(--blue); }
.severity-success { border-left-color: var(--green); }
.severity-warning { border-left-color: var(--yellow); }
.severity-error { border-left-color: var(--red); }
.severity-info .notification-title { color: var(--blue); }
.severity-success .notification-title { color: var(--green); }
.severity-warning .notification-title { color: var(--yellow); }
.severity-error .notification-title { color: #ff6b6b; }

/* Message catalog + activity */
.message-catalog, .activity-log { display: grid; gap: 10px; }
.activity-log:empty::after {
    content: "Waiting for NATS activity…";
    color: var(--text-faint); font-size: 13px; font-style: italic;
    padding: 16px; text-align: center;
    border: 1px dashed var(--border); border-radius: var(--radius-sm);
}
.message-catalog-item, .activity-item {
    display: grid; gap: 4px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    background: var(--bg-inset);
}
.message-catalog-item strong { color: var(--teal); font-family: var(--mono); font-size: 13px; }
.message-catalog-item code, .activity-item code {
    white-space: normal; overflow-wrap: anywhere;
    color: var(--orange); background: rgba(206,145,120,.08);
    border: 1px solid rgba(206,145,120,.16);
    padding: 1px 6px; border-radius: 4px; font-size: 11.5px; width: fit-content;
}
.message-catalog-item span { color: var(--text-muted); font-size: 12.5px; }
.activity-item strong { text-transform: uppercase; font-size: 10.5px; letter-spacing: .08em; color: var(--text-faint); }
.activity-item .notification-title { font-size: 13px; }
.activity-item small { color: var(--text-muted); font-size: 12px; }
.activity-sent { border-left: 3px solid var(--blue); }
.activity-received { border-left: 3px solid var(--green); }

/* Pills / links inside toasts + activity */
.notification-toast-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.notification-toast-pill {
    display: inline-flex; align-items: center; min-height: 1.5rem;
    border: 1px solid var(--border-strong);
    border-radius: 999px; padding: 2px 9px;
    color: var(--text-muted); background: var(--bg-panel-2);
    font-size: 11.5px; font-family: var(--mono);
}
.notification-toast-link {
    display: inline-flex; max-width: 100%; align-items: center; min-height: 1.5rem;
    overflow-wrap: anywhere; border-radius: 999px; padding: 2px 9px;
    background: rgba(79,193,255,.12); color: var(--blue);
    font-size: 11.5px; text-decoration: none; font-family: var(--mono);
}

/* ============================================================
   FORMS (override bootstrap)
   ============================================================ */
.form-label { color: var(--text-muted); font-size: 12.5px; margin-bottom: 5px; font-weight: 500; }
.form-control, .form-select {
    background-color: var(--bg-inset);
    border: 1px solid var(--border-strong);
    color: var(--text);
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    padding: 8px 11px;
}
.form-control::placeholder { color: var(--text-faint); }
.form-control:focus, .form-select:focus {
    background-color: var(--bg-inset);
    color: var(--text);
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(79,193,255,.18);
}
.form-select {
    padding-right: 34px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%238b8b8b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M4 6l4 4 4-4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 11px center;
    background-size: 14px 14px;
}

/* ============================================================
   DRAGGABLE MODAL
   ============================================================ */
.notification-modal-backdrop {
    position: fixed; inset: 0; z-index: 1070;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(2px);
}
.notification-modal-backdrop[hidden] { display: none; }
.notification-modal {
    position: fixed; top: 50%; left: 50%; z-index: 1080;
    display: grid; grid-template-rows: auto 1fr;
    width: min(560px, calc(100vw - 32px));
    min-width: 320px; min-height: 460px;
    max-width: calc(100vw - 16px); max-height: calc(100vh - 16px);
    overflow: auto; resize: both;
    transform: translate(-50%, -50%);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: var(--bg-panel);
    box-shadow: var(--shadow);
}
.notification-modal[hidden] { display: none; }
.notification-modal-moved { transform: none; }
.notification-modal-header {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem;
    min-height: 52px; padding: 12px 16px; cursor: move;
    border-bottom: 1px solid var(--border);
    background: var(--bg-panel-2); user-select: none;
    border-radius: 12px 12px 0 0;
}
.notification-modal-header h2 { margin: 0; font-size: 14px; color: var(--text-strong); display: flex; align-items: center; gap: 8px; }
.notification-modal-header h2::before { content: "\F32B"; font-family: "bootstrap-icons"; color: var(--blue); font-size: 15px; }
.notification-modal-body { padding: 18px; }
.btn-close {
    filter: invert(1) grayscale(1) brightness(1.6);
    opacity: .6;
}
.btn-close:hover { opacity: 1; }

/* ============================================================
   TOASTS (override bootstrap)
   ============================================================ */
.toast {
    background: var(--bg-panel);
    border: 1px solid var(--border-strong);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
    color: var(--text);
    box-shadow: var(--shadow);
}
.toast.severity-info { border-left-color: var(--blue); }
.toast.severity-success { border-left-color: var(--green); }
.toast.severity-warning { border-left-color: var(--yellow); }
.toast.severity-error { border-left-color: var(--red); }
.toast-header {
    background: var(--bg-panel-2);
    color: var(--text-strong);
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.toast-header small { color: var(--text-faint); }
.toast-body { color: var(--text); }

/* ============================================================
   PROSE (privacy / error)
   ============================================================ */
.prose { max-width: 76ch; }
.prose h1 { color: var(--text-strong); font-size: 24px; margin: 0 0 8px; }
.prose h2 { color: var(--text-strong); font-size: 18px; margin: 24px 0 8px; }
.prose h3 { color: var(--text); font-size: 15px; margin: 20px 0 6px; }
.prose p { color: var(--text-muted); line-height: 1.65; }
.prose code {
    color: var(--orange); background: rgba(206,145,120,.1);
    border: 1px solid rgba(206,145,120,.18);
    padding: 1px 6px; border-radius: 4px; font-size: 12.5px;
}
.callout {
    display: flex; gap: 12px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--yellow);
    background: rgba(220,220,170,.06);
    border-radius: var(--radius-sm);
    padding: 14px 16px; margin: 18px 0;
}
.callout i { color: var(--yellow); font-size: 18px; margin-top: 1px; }
.callout.danger { border-left-color: var(--red); background: rgba(241,76,76,.06); }
.callout.danger i { color: var(--red); }
.callout p { margin: 0; color: var(--text); font-size: 13.5px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .grid-3 { grid-template-columns: 1fr; }
    .grid-2 { grid-template-columns: 1fr; }
    .stat-strip { grid-template-columns: repeat(2, 1fr); }
    .notifications-header { display: grid; }
}
@media (max-width: 640px) {
    .ide-titlebar-center, .ide-service-tag { display: none; }
    .page-body { padding: 20px 16px 40px; }
    .stat-strip { grid-template-columns: 1fr; }
    .page-tabs {
        height: auto;
        overflow-x: auto;
    }
    .page-tab {
        min-height: 38px;
        white-space: nowrap;
    }
    .preference-row {
        align-items: flex-start;
        padding: 12px;
    }
    .preference-row > span:first-child {
        line-height: 1.35;
    }
    .preference-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================================
   PRODUCT SHELL
   ============================================================ */
.site-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: color-mix(in srgb, var(--bg-titlebar) 94%, transparent);
    border-bottom: 1px solid var(--border-soft);
    box-shadow: 0 8px 28px rgba(18, 55, 90, .06);
    backdrop-filter: blur(16px);
}

.site-header-inner,
.site-footer-inner {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

.site-header-inner {
    min-height: 76px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 28px;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--text-strong);
    text-decoration: none;
}

.site-brand:hover { color: var(--text-strong); text-decoration: none; }
.site-brand img { width: 46px; height: 46px; object-fit: contain; }
.site-brand-copy { display: grid; line-height: 1.05; }
.site-brand-copy strong { font-size: 16px; letter-spacing: .01em; }
.site-brand-copy small { margin-top: 5px; color: var(--text-muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }

.site-nav { display: flex; align-items: center; justify-content: center; gap: 6px; }
.site-nav a {
    position: relative;
    padding: 10px 14px;
    border-radius: 9px;
    color: var(--text-muted);
    font-weight: 600;
    text-decoration: none;
}
.site-nav a i { display: none; font-size: 18px; }
.site-nav a:hover { color: var(--text-strong); background: var(--bg-hover); }
.site-nav a.is-active { color: var(--blue); background: color-mix(in srgb, var(--blue) 13%, transparent); }

.site-account { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.account-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 2px solid #d9e9f7; }
.account-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--blue);
    background: var(--bg-panel-2);
}
.account-avatar-large { width: 40px; height: 40px; flex: 0 0 40px; }
.account-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    max-width: 210px;
    padding: 4px 10px 4px 5px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    background: var(--bg-panel);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.account-menu-toggle:hover,
.account-menu-toggle[aria-expanded="true"] { color: var(--text-strong); background: var(--bg-hover); }
.account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-form { margin: 0; }
.profile-dropdown {
    min-width: 250px;
    padding: 8px;
    border-color: var(--border);
    color: var(--text);
    background: var(--bg-panel);
    box-shadow: var(--shadow);
}
.profile-dropdown-identity { display: flex; align-items: center; gap: 11px; padding: 8px; }
.profile-dropdown-identity > span:last-child { display: grid; min-width: 0; }
.profile-dropdown-identity small { color: var(--text-muted); }
.profile-dropdown-identity strong { overflow-wrap: anywhere; color: var(--text-strong); }
.profile-dropdown .dropdown-divider { border-color: var(--border); }
.profile-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 5px;
    color: var(--text);
}
.profile-dropdown .dropdown-item:hover,
.profile-dropdown .dropdown-item:focus { color: var(--text-strong); background: var(--bg-hover); }
.profile-dropdown .dropdown-item i { color: var(--blue); }

.site-main { flex: 1; }
.site-footer { border-top: 1px solid var(--border-soft); background: var(--bg-panel); color: var(--text-muted); }
.site-footer-inner {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    font-size: 12.5px;
}
.site-footer nav { display: flex; gap: 18px; }
.site-footer a { color: var(--text-muted); font-weight: 600; }

.page-body {
    width: min(1180px, calc(100% - 40px));
    max-width: none;
    padding: 42px 0 64px;
}
.section-eyebrow {
    color: var(--accent);
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 750;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.section-title { font-size: clamp(1.65rem, 3vw, 2.2rem); letter-spacing: -.025em; }

.hero {
    min-height: 34rem;
    display: flex;
    align-items: center;
    width: 100%;
    padding: 52px 54px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background:
        radial-gradient(900px 320px at 0% -20%, rgba(79, 193, 255, .16), transparent 60%),
        radial-gradient(720px 320px at 100% 0%, rgba(197, 134, 192, .15), transparent 56%),
        var(--bg-panel);
}
.hero::before { display: none; }
.hero.mascot-box {
    --mascot-padding-x: 54px;
    --mascot-padding-y: 52px;
    display: grid;
    padding: var(--mascot-padding-y) var(--mascot-padding-x);
    overflow: visible;
}
.hero-inner { z-index: 2; width: auto; }
.hero-kicker {
    color: #bdebe6;
    border-color: rgba(189, 235, 230, .35);
    background: rgba(255, 255, 255, .1);
    font-family: var(--sans);
    font-weight: 700;
}
.hero h1 { color: var(--text-strong); font-size: clamp(2.35rem, 5vw, 4rem); line-height: 1.03; letter-spacing: -.045em; }
.hero h1 .accent { color: transparent; background: linear-gradient(90deg, var(--blue), var(--purple)); background-clip: text; }
.hero p { color: var(--text); font-size: 17px; line-height: 1.65; }
.hero .mascot-slot { min-height: 320px; }
.hero .mascot {
    filter: drop-shadow(0 24px 22px rgba(0, 0, 0, .25));
}
.hero .mascot-state {
    grid-area: 1 / 1;
    transition: opacity 260ms ease, filter 260ms ease, transform 320ms ease;
}
.public-hero.dock-bottom > .mascot-slot > .mascot-state-presenting {
    /* Desktop is width-constrained: normalize the visible character bounds. */
    --mascot-scale: calc(var(--mascot-overflow-scale) * 1.233);
}
.hero .mascot-state-hover { opacity: 0; }
.public-hero:is(:hover, :focus-visible) .mascot-state-idle { opacity: 0; }
.public-hero:is(:hover, :focus-visible) .mascot-state-hover { opacity: 1; }
.public-hero:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 4px;
}

.preference-hero {
    min-height: 230px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(150px, 260px);
    align-items: center;
    gap: 32px;
    margin-bottom: 24px;
    padding: 32px 46px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 90% 20%, rgba(79, 193, 255, .18), transparent 18rem),
        var(--bg-panel);
    box-shadow: var(--shadow);
}
.preference-hero .section-title { margin-top: 8px; font-size: clamp(2rem, 4vw, 3.25rem); }
.preference-hero .section-sub { font-size: 16px; line-height: 1.6; }
.preference-hero-copy { min-width: 0; }
.preference-hero-image {
    justify-self: end;
    width: min(100%, 210px);
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 20px 28px rgba(0, 0, 0, .22));
}

.stat-strip { background: transparent; border: 0; gap: 12px; }
.stat { border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 8px 24px rgba(20, 55, 90, .05); }
.stat-value { font-family: var(--sans); font-size: 18px; }
.stat-value i { color: var(--accent); }

.card,
.notification-panel { border-radius: 16px; box-shadow: 0 12px 34px rgba(20, 55, 90, .06); }
.notification-panel h2 { color: var(--text-strong); font-size: 14px; }
.notification-meta { overflow-wrap: anywhere; }
.notification-list-item:hover { background: var(--bg-hover); }
.signed-out-panel { background: var(--bg-inset); }
.preference-row { background: var(--bg-inset); }
.form-control,
.form-select { border-color: var(--border); background-color: var(--bg-inset); color: var(--text); }
.form-control:focus,
.form-select:focus { background-color: var(--bg-inset); color: var(--text); }
.toast { color: var(--text); background: var(--bg-panel); }
.toast-header { color: var(--text); background: var(--bg-panel-2); }

.prose { max-width: 820px; margin: 0 auto; }
.prose h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.035em; }
.prose h2 { margin-top: 32px; }
.prose p { font-size: 15.5px; }
.legal-document-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 18px;
    padding: 18px 20px;
    border: 1px solid #bcd8ee;
    border-radius: 14px;
    background: color-mix(in srgb, var(--blue) 10%, var(--bg-panel));
    color: var(--accent-strong);
    font-weight: 700;
}
.legal-document-link span { display: inline-flex; align-items: center; gap: 10px; }
.legal-document-link:hover { background: color-mix(in srgb, var(--blue) 17%, var(--bg-panel)); color: var(--blue); text-decoration: none; }

@media (max-width: 860px) {
    .site-header-inner { grid-template-columns: auto 1fr auto; gap: 10px; padding: 8px 0; }
    .site-nav { grid-column: auto; grid-row: auto; justify-content: center; overflow: visible; }
    .site-account { justify-self: end; }
    .site-nav a { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; }
    .site-nav a i { display: inline-block; }
    .site-nav a span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
    .account-menu-toggle { max-width: 150px; }
    .site-footer-inner { padding: 22px 0; flex-wrap: wrap; }
}

@media (max-width: 640px) {
    .site-header-inner { width: 100%; min-height: 62px; grid-template-columns: auto auto minmax(0, 1fr); padding: 7px 8px; gap: 5px; }
    .site-footer-inner { width: calc(100% - 24px); }
    .site-brand { gap: 0; }
    .site-brand img { width: 40px; height: 40px; }
    .site-brand-copy { display: none; }
    .site-nav { gap: 2px; }
    .site-nav a { width: 36px; height: 38px; }
    .site-account,
    .account-menu { width: 100%; min-width: 0; }
    .account-menu-toggle { width: 100%; max-width: none; min-height: 40px; gap: 6px; padding-right: 7px; }
    .account-name { min-width: 0; max-width: none; }
    .account-avatar { width: 29px; height: 29px; }
    .account-sign-in { width: 40px; height: 40px; justify-content: center; padding: 0; }
    .account-sign-in span { display: none; }
    .page-body { width: 100%; padding: 24px 0 40px; }
    .page-body > .alert,
    .page-body > .stat-strip,
    .page-body > .grid,
    .page-body > .notification-panel,
    .page-body > .prose { margin-right: 12px; margin-left: 12px; }
    .hero { min-height: 380px; margin-right: 0; margin-left: 0; border-right: 0; border-left: 0; border-radius: 0; }
    .hero.mascot-box {
        --mascot-padding-x: 18px;
        --mascot-padding-y: 30px;
        padding: var(--mascot-padding-y) var(--mascot-padding-x);
    }
    .public-hero {
        --mascot-size: min(58vw, 15rem);
        --mascot-zone: 100%;
    }
    .hero .mascot-slot { min-height: 280px; }
    .hero .mascot { max-height: 290px; }
    .public-hero.dock-bottom > .mascot-slot > .mascot-state-presenting {
        /* Mobile is height-constrained, so only transparent headroom differs. */
        --mascot-scale: calc(var(--mascot-overflow-scale) * .963);
    }
    .preference-hero { grid-template-columns: minmax(0, 1fr) 110px; gap: 8px; margin-right: 0; margin-left: 0; padding: 26px 14px 26px 18px; border-right: 0; border-left: 0; border-radius: 0; }
    .preference-hero .section-title { font-size: clamp(1.65rem, 8vw, 2rem); overflow-wrap: anywhere; }
    .preference-hero-image { width: 110px; }
    .notifications-header {
        margin-right: 16px;
        margin-left: 16px;
    }
    .notifications-shell .notification-panel,
    .preference-panel {
        border-radius: 0;
    }
    .preference-panel { min-width: 0; overflow: hidden; }
    .site-footer-inner > span:nth-child(2) { display: none; }
}

@media (max-width: 380px) {
    .site-brand img { width: 35px; height: 35px; }
    .site-nav a { width: 28px; }
    .preference-hero { grid-template-columns: minmax(0, 1fr) 82px; }
    .preference-hero-image { width: 82px; }
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --bg-app: #1e1e1e;
        --bg-titlebar: #323233;
        --bg-activitybar: #2d2d30;
        --bg-editor: #1e1e1e;
        --bg-panel: #252526;
        --bg-panel-2: #2d2d30;
        --bg-inset: #1b1b1c;
        --bg-hover: #2a2d2e;
        --bg-statusbar: #0a6ebd;
        --border: #3c3c3c;
        --border-soft: #333336;
        --border-strong: #4a4a4f;
        --text: #d4d4d4;
        --text-strong: #ffffff;
        --text-muted: #a5a5a5;
        --text-faint: #858585;
        --blue: #4fc1ff;
        --azure: #569cd6;
        --teal: #4ec9b0;
        --green: #6ac07f;
        --yellow: #dcdcaa;
        --orange: #ce9178;
        --purple: #c586c0;
        --red: #f14c4c;
        --accent: #4fc1ff;
        --accent-strong: #0a6ebd;
        --shadow: 0 18px 50px rgba(0, 0, 0, .55);
    }

    .site-header { box-shadow: 0 8px 28px rgba(0, 0, 0, .25); }
    .account-avatar { border-color: var(--border-strong); }
    .card,
    .notification-panel,
    .stat { box-shadow: 0 12px 34px rgba(0, 0, 0, .18); }
    .btn-close { filter: invert(1) grayscale(100%) brightness(180%); }
    .text-muted { color: var(--text-muted) !important; }
    .alert-warning {
        border-color: color-mix(in srgb, var(--yellow) 55%, var(--border));
        color: var(--text);
        background: color-mix(in srgb, var(--yellow) 12%, var(--bg-panel));
    }
}

/* Notifications landing layout; uses the existing VSCode theme tokens. */
.hero.notification-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 32px;
    min-height: 340px;
    padding: 36px 40px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: none;
}
.notification-hero .hero-kicker {
    color: var(--accent);
    border-color: var(--border);
    background: var(--bg-inset);
}
.notification-hero h1 { font-size: clamp(2.25rem, 4vw, 3.4rem); line-height: 1.1; }
.notification-hero p { font-size: 16px; max-width: 44ch; }
.notification-hero-art { min-width: 0; }
.notification-hero-art img { display: block; width: 100%; height: auto; object-fit: contain; }
.notification-landing-grid { grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 20px; }
.notification-landing-grid > section { min-width: 0; }
.notification-controls-intro { color: var(--text-muted); line-height: 1.6; margin-bottom: 20px; }
.home-inbox .notification-list-header { flex-wrap: wrap; }
.home-inbox .notification-list-header h2 { margin: 5px 0 0; }
.notification-list-item > div { min-width: 0; overflow-wrap: anywhere; }
.notification-list-item > button { flex-shrink: 0; }
.notification-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border-soft);
}
.notification-page-summary { color: var(--text-muted); font-size: 12px; }
.notification-page-buttons { display: flex; gap: 8px; margin-inline-start: auto; }
.notification-error { margin: 12px 0 0; color: var(--red); }
.notifications-shell .activity-log { max-height: 360px; overflow-y: auto; overscroll-behavior: contain; }
.notifications-shell .row > div { min-width: 0; }
.notifications-shell .notification-list-header { flex-wrap: wrap; margin-bottom: 12px; }
.notifications-shell .notification-list-header h2 { margin-bottom: 0; }
[dir="rtl"] .notification-page-buttons .bi { transform: rotate(180deg); }
@media (max-width: 860px) {
    .hero.notification-hero { gap: 16px; padding: 28px; min-height: 300px; }
    .notification-landing-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
    .hero.notification-hero { grid-template-columns: minmax(0, 1fr); padding: 24px 20px; gap: 8px; }
    .notification-hero-art { width: min(100%, 340px); justify-self: center; }
    .notification-hero h1 { font-size: 2.4rem; }
    .notification-hero p { font-size: 15px; }
    .home-inbox-actions { justify-content: flex-start; }
    .notification-list-item { padding: 10px; }
    .notification-page-buttons { margin-inline-start: 0; }
}
