/* Scipraxis Reference Manager — landing page, auth screens and app shell.
   One stylesheet, no build step, no third-party CSS. Palette tokens are the
   ones the existing Scipraxis app uses in public/style.css, so the Pages
   frontend and the mini's PDF reader look like one product. */

:root {
    --bg-dark: #0b0f19;
    --sidebar-bg: #111827;
    --panel-bg: #1f2937;
    --border-color: rgba(255, 255, 255, 0.08);
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --accent-blue: #38bdf8;
    --accent-violet: #818cf8;
    --accent-pink: #c084fc;
    --accent-gradient: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
    --card-bg: rgba(31, 41, 55, 0.45);
    --input-bg: rgba(31, 41, 55, 0.7);
    --hover-bg: rgba(255, 255, 255, 0.06);
    --danger: #f87171;
    --ok: #34d399;
    --radius: 14px;
    --maxw: 1120px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(1100px 620px at 12% -8%, rgba(56, 189, 248, 0.16), transparent 62%),
        radial-gradient(900px 560px at 92% 4%, rgba(192, 132, 252, 0.13), transparent 58%),
        var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.18; margin: 0; letter-spacing: -0.015em; }
p { margin: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; }
.hidden { display: none !important; }

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---------- buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: var(--hover-bg);
    color: var(--text-main);
    font: inherit;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}
.btn-primary {
    background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 8px 22px rgba(2, 132, 199, 0.22);
}
.btn-primary:hover { filter: brightness(1.07); }
.btn-outline { background: transparent; border-color: var(--border-color); }
.btn-outline:hover { background: var(--hover-bg); }
/* The existing app markup uses .btn-secondary; keep the name working here. */
.btn-secondary { background: var(--hover-bg); border-color: var(--border-color); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.1); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--hover-bg); color: var(--text-main); }
.btn-sm { padding: 7px 12px; font-size: 0.8rem; border-radius: 8px; }
.btn:disabled,
.btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }

/* ---------- site navigation ---------- */

.site-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 14px 24px;
    background: rgba(11, 15, 25, 0.82);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
    font-weight: 700;
    letter-spacing: -0.02em;
    font-size: 1.02rem;
}
.brand:hover { text-decoration: none; }
.brand-mark {
    display: grid;
    place-items: center;
    width: 30px; height: 30px;
    border-radius: 9px;
    background: var(--accent-gradient);
    color: #06121f;
    font-weight: 800;
    font-size: 0.98rem;
}
.brand-sub { color: var(--text-muted); font-weight: 500; }
.nav-links {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-left: 8px;
}
.nav-links a { color: var(--text-muted); font-size: 0.9rem; font-weight: 500; }
.nav-links a:hover { color: var(--text-main); text-decoration: none; }
.nav-spacer { flex: 1 1 auto; }
.nav-actions { display: flex; align-items: center; gap: 10px; }

/* ---------- landing: hero ---------- */

.wrap {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 24px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 56px;
    align-items: center;
    padding: 76px 0 64px;
}
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--card-bg);
    color: var(--accent-blue);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.hero h1 {
    font-size: clamp(2.2rem, 4.4vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 18px;
}
.lede {
    color: var(--text-muted);
    font-size: 1.06rem;
    max-width: 34em;
}
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}
.hero-note {
    margin-top: 16px;
    color: var(--text-muted);
    font-size: 0.84rem;
}
.hero-note strong { color: var(--text-main); font-weight: 600; }

/* CSS-only product preview: a library list, so the page needs no screenshots. */
.preview {
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(31, 41, 55, 0.9), rgba(17, 24, 39, 0.9));
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}
.preview-bar {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.25);
}
.preview-dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); }
.preview-title { margin-left: 8px; color: var(--text-muted); font-size: 0.76rem; }
.preview-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.preview-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 11px;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: var(--input-bg);
    color: var(--text-muted);
    font-size: 0.8rem;
}
.preview-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 11px;
    align-items: start;
    padding: 10px 11px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.18);
}
.preview-thumb {
    width: 34px; height: 44px;
    border-radius: 4px;
    background: linear-gradient(160deg, rgba(56, 189, 248, 0.35), rgba(129, 140, 248, 0.18));
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.preview-row h4 { font-size: 0.82rem; font-weight: 600; margin-bottom: 3px; }
.preview-row span { color: var(--text-muted); font-size: 0.72rem; }
.preview-tags { display: flex; gap: 5px; margin-top: 6px; flex-wrap: wrap; }
.preview-tag {
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.24);
    color: var(--accent-blue);
    font-size: 0.64rem;
}

/* ---------- landing: sections ---------- */

.section { padding: 56px 0; border-top: 1px solid var(--border-color); }
.section-head { max-width: 640px; margin-bottom: 32px; }
.section-head h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin-bottom: 10px; }
.section-head p { color: var(--text-muted); }

.features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.feature {
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--card-bg);
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.feature:hover { border-color: rgba(56, 189, 248, 0.32); transform: translateY(-2px); }
.feature-icon { font-size: 1.3rem; margin-bottom: 10px; }
.feature h3 { font-size: 0.98rem; margin-bottom: 6px; }
.feature p { color: var(--text-muted); font-size: 0.87rem; }

.access-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.access-card {
    padding: 22px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--card-bg);
}
.access-card h3 { font-size: 1rem; margin-bottom: 8px; }
.access-card p { color: var(--text-muted); font-size: 0.88rem; }
.access-card ul {
    margin: 12px 0 0;
    padding-left: 18px;
    color: var(--text-muted);
    font-size: 0.86rem;
}
.access-card li { margin-bottom: 5px; }
.pill-ok {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    background: rgba(52, 211, 153, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.3);
    color: var(--ok);
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    counter-reset: step;
}
.step {
    padding: 22px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.16);
}
.step-num {
    display: grid;
    place-items: center;
    width: 28px; height: 28px;
    margin-bottom: 12px;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.14);
    border: 1px solid rgba(56, 189, 248, 0.32);
    color: var(--accent-blue);
    font-size: 0.82rem;
    font-weight: 700;
}
.step h3 { font-size: 0.96rem; margin-bottom: 6px; }
.step p { color: var(--text-muted); font-size: 0.86rem; }

.cta-band {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 8px 0 56px;
    padding: 26px 28px;
    border: 1px solid rgba(56, 189, 248, 0.28);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(192, 132, 252, 0.1)),
        var(--card-bg);
}
.cta-band h2 { font-size: 1.25rem; margin-bottom: 4px; }
.cta-band p { color: var(--text-muted); font-size: 0.88rem; }

.site-footer {
    border-top: 1px solid var(--border-color);
    padding: 26px 0 34px;
}
.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.82rem;
}
.footer-inner nav { display: flex; gap: 18px; }
.footer-inner a { color: var(--text-muted); }
.footer-inner a:hover { color: var(--text-main); text-decoration: none; }

/* ---------- auth screens ---------- */

.auth-wrap {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 48px;
    align-items: start;
    max-width: 980px;
    margin: 0 auto;
    padding: 60px 24px 80px;
}
.auth-card {
    padding: 28px;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: rgba(17, 24, 39, 0.82);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.auth-card h1 { font-size: 1.5rem; margin-bottom: 6px; }
.auth-card .sub { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 22px; }
.auth-side { padding-top: 8px; }
.auth-side h2 { font-size: 1.05rem; margin-bottom: 14px; }
.auth-side ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 11px;
}
.auth-side li {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.88rem;
}
.auth-side li b { color: var(--text-main); font-weight: 600; }
.auth-foot {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.84rem;
    text-align: center;
}
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.field label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-muted);
    font-size: 0.79rem;
    font-weight: 600;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field textarea,
.field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: var(--input-bg);
    color: var(--text-main);
    font: inherit;
    font-size: 0.9rem;
}
.field textarea { resize: vertical; min-height: 74px; line-height: 1.45; }
.field input:focus,
.field textarea:focus,
.field select:focus {
    outline: none;
    border-color: rgba(56, 189, 248, 0.6);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.14);
}
.field-hint { margin-top: 5px; color: var(--text-muted); font-size: 0.76rem; }
.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.checkbox-row input { margin-top: 3px; accent-color: var(--accent-blue); }
.form-error {
    padding: 9px 12px;
    border: 1px solid rgba(248, 113, 113, 0.35);
    border-radius: 9px;
    background: rgba(248, 113, 113, 0.1);
    color: #fecaca;
    font-size: 0.83rem;
}
.form-ok {
    padding: 9px 12px;
    border: 1px solid rgba(52, 211, 153, 0.35);
    border-radius: 9px;
    background: rgba(52, 211, 153, 0.1);
    color: #a7f3d0;
    font-size: 0.83rem;
}
.form-note { color: var(--text-muted); font-size: 0.78rem; }
.pw-meter {
    display: flex;
    gap: 4px;
    margin-top: 7px;
    height: 4px;
}
.pw-meter span {
    flex: 1 1 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
}
.pw-meter[data-score="1"] span:nth-child(1) { background: var(--danger); }
.pw-meter[data-score="2"] span:nth-child(-n+2) { background: #fbbf24; }
.pw-meter[data-score="3"] span:nth-child(-n+3) { background: var(--accent-blue); }
.pw-meter[data-score="4"] span { background: var(--ok); }

/* ---------- app shell (mirrors the Reference Manager tab) ---------- */

.app-topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--border-color);
    background: var(--sidebar-bg);
}
.app-topbar .brand { font-size: 0.94rem; }
.app-topbar .brand-mark { width: 26px; height: 26px; font-size: 0.85rem; border-radius: 8px; }
.app-tab {
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--accent-blue);
    font-size: 0.82rem;
    font-weight: 600;
}
.app-topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.status-dot {
    display: inline-block;
    width: 8px; height: 8px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    vertical-align: middle;
}
.status-dot.ok { background: var(--ok); box-shadow: 0 0 8px rgba(52, 211, 153, 0.6); }
.status-dot.bad { background: var(--danger); }
.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 10px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--card-bg);
    color: var(--text-main);
}

.app-main {
    display: flex;
    height: calc(100vh - 53px);
    min-height: 0;
}
.ref-shell {
    display: flex;
    width: 100%;
    min-width: 0;
    height: 100%;
}
.ref-library-pane {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 70%;
    min-width: 0;
    height: 100%;
    padding: 16px;
    border-right: 1px solid var(--border-color);
}
.ref-assistant-pane {
    display: flex;
    flex-direction: column;
    width: 30%;
    min-width: 0;
    height: 100%;
    background: var(--bg-dark);
    overflow-y: auto;
}
.ref-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.ref-title { font-size: 1.02rem; font-weight: 700; }
.ref-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.ref-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-filters input[type="search"] {
    flex: 1 1 220px;
    min-width: 0;
    padding: 9px 12px;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: var(--input-bg);
    color: var(--text-main);
    font: inherit;
    font-size: 0.86rem;
}
.ref-filters input[type="search"]:focus,
.ref-filters select:focus {
    outline: none;
    border-color: rgba(56, 189, 248, 0.6);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.14);
}
.ref-filters select {
    padding: 9px 10px;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: var(--input-bg);
    color: var(--text-main);
    font: inherit;
    font-size: 0.84rem;
}
.notice {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--text-muted);
    font-size: 0.81rem;
}
.notice.warn {
    border-color: rgba(251, 191, 36, 0.35);
    background: rgba(251, 191, 36, 0.08);
    color: #fde68a;
}
.notice code { color: var(--text-main); }
.ref-list-wrap {
    flex: 1 1 auto;
    min-height: 120px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.18);
}
.ref-list { display: flex; flex-direction: column; gap: 8px; }
.ref-row {
    display: grid;
    grid-template-columns: 20px 38px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: rgba(31, 41, 55, 0.55);
    cursor: pointer;
}
.ref-row:hover { border-color: rgba(56, 189, 248, 0.34); background: rgba(31, 41, 55, 0.8); }
.ref-row input[type="checkbox"] { margin-top: 12px; accent-color: var(--accent-blue); }
.ref-thumb {
    width: 38px; height: 48px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(160deg, rgba(56, 189, 248, 0.32), rgba(129, 140, 248, 0.16));
}
.ref-row h4 { font-size: 0.86rem; font-weight: 600; margin-bottom: 2px; }
.ref-row p { color: var(--text-muted); font-size: 0.76rem; }
.ref-row-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.ref-row-tags span {
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.22);
    color: var(--accent-blue);
    font-size: 0.65rem;
}
.ref-badge {
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.66rem;
    white-space: nowrap;
}
.ref-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 100%;
    min-height: 220px;
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
}
.ref-empty-icon { font-size: 1.9rem; }
.ref-empty h3 { color: var(--text-main); font-size: 0.98rem; }
.ref-empty p { font-size: 0.84rem; max-width: 34em; }

.details {
    padding: 14px;
    border-bottom: 1px solid var(--border-color);
    background: var(--panel-bg);
}
.details-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}
.details-head h3 { font-size: 0.88rem; color: var(--accent-blue); }
.details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    font-size: 0.8rem;
}
.details-grid .full { grid-column: 1 / -1; }
.details label { display: block; margin-bottom: 3px; color: var(--text-muted); font-size: 0.74rem; }
.details input,
.details textarea,
.details select {
    width: 100%;
    padding: 7px 9px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-main);
    font: inherit;
    font-size: 0.8rem;
}
.details textarea { resize: vertical; min-height: 64px; line-height: 1.45; }
.ai-panel {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    color: var(--text-muted);
    font-size: 0.84rem;
}
.ai-panel h3 { font-size: 0.88rem; color: var(--text-main); }
.ai-actions { display: flex; flex-wrap: wrap; gap: 7px; }

/* ---------- admin ---------- */

.admin-main {
    max-width: 1120px;
    margin: 0 auto;
    padding: 22px 18px 64px;
}
.admin-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.admin-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.18);
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}
.admin-table th {
    padding: 10px;
    text-align: left;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}
.admin-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover td { background: rgba(255, 255, 255, 0.03); }
.admin-reason { color: var(--text-muted); min-width: 16em; max-width: 34em; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-empty { color: var(--text-muted); padding: 18px 10px; text-align: center; }
.admin-badge {
    display: inline-block;
    padding: 2px 9px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    font-size: 0.68rem;
    text-transform: lowercase;
}
.admin-badge.pending {
    color: #fde68a;
    border-color: rgba(251, 191, 36, 0.35);
    background: rgba(251, 191, 36, 0.08);
}
.admin-badge.approved {
    color: #a7f3d0;
    border-color: rgba(52, 211, 153, 0.35);
    background: rgba(52, 211, 153, 0.1);
}
.admin-badge.rejected {
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.35);
    background: rgba(248, 113, 113, 0.1);
}
.admin-audit { margin-top: 26px; }
.admin-audit h2 { font-size: 0.98rem; margin-bottom: 4px; }
.admin-audit ul {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ---------- responsive ---------- */

@media (max-width: 980px) {
    .hero { grid-template-columns: minmax(0, 1fr); gap: 36px; padding-top: 52px; }
    .features, .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .auth-wrap { grid-template-columns: minmax(0, 1fr); gap: 32px; }
    .auth-side { order: 2; }
    .app-main { height: auto; }
    .ref-shell { flex-direction: column; height: auto; }
    .ref-library-pane { width: 100%; border-right: 0; border-bottom: 1px solid var(--border-color); }
    .ref-assistant-pane { width: 100%; }
    .ref-list-wrap { max-height: 62vh; }
}

@media (max-width: 700px) {
    .nav-links { display: none; }
    .site-nav { padding: 12px 16px; gap: 12px; }
    .wrap { padding: 0 16px; }
    .features, .steps, .access-grid { grid-template-columns: minmax(0, 1fr); }
    .hero { padding: 40px 0 44px; }
    .section { padding: 44px 0; }
    .cta-band { padding: 20px; }
    .auth-wrap { padding: 36px 16px 56px; }
    .auth-card { padding: 20px; }
    .app-topbar { flex-wrap: wrap; gap: 10px; }
    .app-topbar-right { margin-left: 0; width: 100%; justify-content: space-between; }
    .ref-actions { margin-left: 0; width: 100%; }
    .details-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; }
}
