@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;700&display=swap');

:root {
    color-scheme: light;
    --bg: #08111f;
    --bg-soft: rgba(12, 23, 40, 0.72);
    --panel: rgba(11, 18, 31, 0.82);
    --panel-strong: rgba(16, 28, 46, 0.94);
    --border: rgba(145, 174, 214, 0.18);
    --text: #eef4ff;
    --muted: #a8bbd6;
    --accent: #71f1d6;
    --accent-strong: #38c7ff;
    --accent-warm: #ffbe62;
    --danger: #ff718b;
    --success: #59e0a3;
    --shadow: 0 24px 60px rgba(2, 10, 22, 0.35);
    --radius-xl: 30px;
    --radius-lg: 22px;
    --radius-md: 16px;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Manrope', sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(113, 241, 214, 0.18), transparent 36%),
        radial-gradient(circle at 85% 15%, rgba(56, 199, 255, 0.18), transparent 32%),
        linear-gradient(180deg, #09111d 0%, #060b14 100%);
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.25), transparent 75%);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.backdrop {
    position: fixed;
    border-radius: 999px;
    filter: blur(24px);
    opacity: 0.7;
    pointer-events: none;
    z-index: 0;
}

.backdrop-a {
    top: -60px;
    left: -80px;
    width: 220px;
    height: 220px;
    background: rgba(113, 241, 214, 0.13);
}

.backdrop-b {
    right: -30px;
    bottom: 8%;
    width: 280px;
    height: 280px;
    background: rgba(56, 199, 255, 0.12);
}

.topbar,
.page-shell,
.footer {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
}

.topbar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto auto;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem 0 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.95rem;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(113, 241, 214, 0.95), rgba(56, 199, 255, 0.85));
    color: #07111c;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    letter-spacing: 0.08em;
    box-shadow: 0 14px 30px rgba(56, 199, 255, 0.22);
}

.brand strong,
.hero-copy h1,
.panel h1,
.panel h2,
.panel h3,
.section-head h1,
.section-head h2 {
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: -0.03em;
}

.brand strong,
.brand span {
    display: block;
}

.brand span,
.nav-links a,
.user-pill span,
.footer,
.meta-row,
.section-head span,
.eyebrow,
.version,
.tag,
.flash {
    color: var(--muted);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(9, 16, 28, 0.56);
    backdrop-filter: blur(18px);
}

.nav-links a {
    padding: 0.65rem 1rem;
    border-radius: 999px;
    transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-links a:hover,
.nav-links a.is-active {
    background: rgba(113, 241, 214, 0.12);
    color: var(--text);
}

.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.8rem;
}

.user-pill {
    display: grid;
    gap: 0.1rem;
    padding: 0.7rem 0.95rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(14, 22, 38, 0.7);
}

.user-pill strong {
    color: var(--text);
    font-size: 0.95rem;
}

.page-shell {
    display: grid;
    gap: 1rem;
    padding: 0.4rem 0 2rem;
}

.hero-grid,
.dashboard-grid,
.content-split,
.admin-grid,
.feature-grid,
.project-grid {
    display: grid;
    gap: 1rem;
}

.hero-grid {
    grid-template-columns: 1.25fr 0.95fr;
    align-items: stretch;
}

.dashboard-grid {
    grid-template-columns: 1.2fr 0.9fr;
}

.content-split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-grid,
.feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-grid.admin-grid--triple {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel {
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(17, 26, 42, 0.92), rgba(9, 15, 27, 0.88));
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
}

.panel-hero {
    padding: clamp(1.4rem, 3vw, 2.4rem);
}

.panel-highlight {
    padding: 1rem;
    background: linear-gradient(180deg, rgba(17, 30, 48, 0.96), rgba(9, 14, 24, 0.92));
}

.hero-copy h1,
.panel h1 {
    margin: 0.25rem 0 0.7rem;
    font-size: clamp(2.2rem, 4.7vw, 4.7rem);
    line-height: 0.95;
}

.hero-copy p,
.panel p,
.feature-card p,
.empty-state p {
    color: var(--muted);
    line-height: 1.65;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.eyebrow::before {
    content: '';
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    box-shadow: 0 0 0 6px rgba(113, 241, 214, 0.12);
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
    margin-top: 1.4rem;
}

.hero-stats div {
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.hero-stats strong {
    display: block;
    color: var(--text);
    font-size: clamp(1.4rem, 2vw, 2rem);
    font-family: 'Space Grotesk', sans-serif;
}

.hero-stats span {
    font-size: 0.9rem;
    color: var(--muted);
}

.hero-stats.compact {
    margin-top: 1rem;
}

.auth-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding: 0.2rem;
    margin-bottom: 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
}

.auth-switch span,
.auth-switch button {
    padding: 0.8rem 0.9rem;
    border-radius: 999px;
    text-align: center;
    font-weight: 700;
}

.auth-switch button {
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.auth-switch .active,
.auth-switch .is-active {
    background: linear-gradient(135deg, rgba(113, 241, 214, 0.14), rgba(56, 199, 255, 0.16));
    color: var(--text);
}

.auth-grid {
    display: grid;
    gap: 0.9rem;
}

.profile-action-row {
    margin-top: 1rem;
}

#profile-panel {
    margin-top: 1.25rem;
    scroll-margin-top: 6.5rem;
}

.card-form,
.stack-panel,
.empty-state,
.feature-card,
.project-card,
.list-card {
    padding: 1.15rem;
}

.card-form {
    border-radius: 24px;
    border: 1px solid var(--border);
    background: rgba(9, 15, 27, 0.72);
}

.card-form-accent {
    background: linear-gradient(180deg, rgba(22, 35, 53, 0.88), rgba(9, 15, 27, 0.82));
}

.card-form h2,
.stack-panel h2,
.feature-card h3,
.list-card h3,
.project-card h3,
.empty-state h3 {
    margin: 0 0 0.5rem;
}

.card-form label,
.stack-panel label,
.admin-form label {
    display: grid;
    gap: 0.45rem;
    margin-bottom: 0.95rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.card-form input,
.card-form select,
.card-form textarea,
.stack-panel select,
.admin-form input,
.admin-form select,
.admin-form textarea {
    width: 100%;
    padding: 0.9rem 1rem;
    color: var(--text);
    border: 1px solid rgba(145, 174, 214, 0.2);
    border-radius: 16px;
    background: rgba(5, 11, 20, 0.75);
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.card-form input:focus,
.card-form select:focus,
.card-form textarea:focus,
.stack-panel select:focus,
.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
    border-color: rgba(113, 241, 214, 0.6);
    box-shadow: 0 0 0 4px rgba(113, 241, 214, 0.08);
}

.button,
.button:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.95rem;
    padding: 0.8rem 1.15rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.button:hover,
.button:focus-visible,
.nav-links a:hover,
.nav-links a:focus-visible,
.js-copy:hover,
.js-copy:focus-visible {
    transform: translateY(-1px);
}

.button-primary {
    color: #07111c;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    box-shadow: 0 16px 32px rgba(56, 199, 255, 0.18);
}

.button-secondary {
    color: #08111f;
    background: linear-gradient(135deg, #ffd07d, #ff9f62);
}

.button-ghost {
    color: var(--text);
    border-color: rgba(145, 174, 214, 0.24);
    background: rgba(255, 255, 255, 0.02);
}

.button-danger {
    border-color: rgba(255, 113, 139, 0.36);
    color: #ffc0cf;
    background: rgba(255, 113, 139, 0.08);
}

.button[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.inline-form {
    margin: 0;
}

.inline-form-stack {
    display: grid;
    gap: 1rem;
}

.feature-card {
    border-radius: var(--radius-lg);
}

.dashboard-grid .stack-panel,
.project-card,
.list-card,
.empty-state,
.feature-card {
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(16, 24, 38, 0.9), rgba(8, 13, 22, 0.9));
}

.section-head,
.pwa-head,
.meta-row,
.button-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.standalone-head {
    padding: 0.35rem 0.15rem 0.1rem;
}

.standalone-head h1,
.section-head h2 {
    margin: 0;
}

.section-head span,
.version,
.meta-row,
.tag {
    font-size: 0.88rem;
}

.card-list {
    display: grid;
    gap: 0.95rem;
}

.list-card {
    display: grid;
    gap: 0.9rem;
}

.tag {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.35rem 0.65rem;
    border: 1px solid rgba(145, 174, 214, 0.2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
}

.tag-accent {
    color: var(--accent);
    border-color: rgba(113, 241, 214, 0.18);
}

.pwa-card {
    position: relative;
    overflow: hidden;
}

.pwa-card::after {
    content: '';
    position: absolute;
    inset: auto -30% -40% auto;
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, rgba(113, 241, 214, 0.16), transparent 70%);
    pointer-events: none;
}

.version {
    padding: 0.32rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(145, 174, 214, 0.16);
    background: rgba(255, 255, 255, 0.03);
}

.compact-meta {
    flex-wrap: wrap;
}

.admin-columns {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-manage-card {
    gap: 1rem;
}

.users-pane .section-head {
    margin-bottom: 0.1rem;
}

.user-card-list {
    gap: 0.75rem;
}

.user-card {
    position: relative;
    border-radius: 20px;
    border-color: rgba(113, 241, 214, 0.22);
    background: linear-gradient(165deg, rgba(15, 26, 42, 0.94), rgba(9, 14, 24, 0.9));
    overflow: hidden;
}

.user-card::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, rgba(113, 241, 214, 0.95), rgba(56, 199, 255, 0.65));
}

.admin-user-head {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    align-items: flex-start;
    padding: 0.75rem 0.85rem;
    border: 1px solid rgba(145, 174, 214, 0.16);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.015);
}

.admin-user-identity {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.user-initial {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #07111c;
    background: linear-gradient(135deg, rgba(113, 241, 214, 0.9), rgba(56, 199, 255, 0.8));
}

.admin-user-head h3 {
    margin: 0;
    font-size: 1.05rem;
}

.admin-user-head p {
    margin: 0.2rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.admin-user-meta {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.admin-user-grid {
    display: grid;
    gap: 0.7rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-fields {
    padding: 0.15rem 0;
}

.admin-user-foot {
    display: flex;
    gap: 0.8rem;
    align-items: end;
    justify-content: space-between;
    flex-wrap: wrap;
}

.password-inline {
    flex: 1 1 220px;
}

.user-edit-form input,
.user-edit-form select {
    border-radius: 12px;
    padding: 0.72rem 0.84rem;
}

.admin-user-actions {
    display: flex;
    justify-content: flex-start;
}

.admin-edit-form {
    display: grid;
    gap: 0.8rem;
}

.admin-edit-form label {
    display: grid;
    gap: 0.4rem;
    margin: 0;
    color: var(--muted);
}

.admin-delete-form {
    display: flex;
    justify-content: flex-end;
}

.admin-toggle {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0;
}

.admin-toggle input[type='checkbox'] {
    width: 1rem;
    height: 1rem;
}

.inline-help {
    margin-top: 0.8rem;
}

.inline-help summary {
    cursor: pointer;
    color: var(--muted);
    font-weight: 700;
}

.compact-form {
    margin-top: 0.8rem;
}

.admin-panel-tabs {
    padding: 0.8rem 1rem;
}

.button-row {
    flex-wrap: wrap;
    justify-content: flex-start;
}

.protocol-doc-card .section-head h2 {
    font-size: 1.35rem;
}

.metrics-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card {
    padding: 0.9rem 1rem;
    border-radius: 18px;
    display: grid;
    gap: 0.2rem;
}

.metric-card h3 {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.metric-card strong {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    line-height: 1.05;
}

.metric-card span {
    color: var(--muted);
    font-size: 0.85rem;
}

.stage-metrics-grid {
    margin-top: -0.2rem;
}

.queue-controls {
    padding: 1rem;
}

.metric-inline {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.protocol-doc-card details {
    margin-top: 0.2rem;
}

.protocol-doc-card summary {
    cursor: pointer;
    color: var(--muted);
    font-weight: 700;
}

.protocol-log {
    margin: 0.55rem 0 0;
    padding: 0.8rem;
    border-radius: 12px;
    border: 1px solid rgba(145, 174, 214, 0.2);
    background: rgba(4, 10, 18, 0.85);
    color: #d5e4ff;
    overflow: auto;
    max-height: 240px;
    white-space: pre-wrap;
    font-size: 0.82rem;
    line-height: 1.4;
}

.protocol-layout {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 1rem;
}

.protocol-sidebar {
    padding: 1rem;
    align-self: start;
    position: sticky;
    top: 1rem;
}

.protocol-sidebar h2 {
    margin-top: 0;
    margin-bottom: 0.7rem;
}

.protocol-links {
    display: grid;
    gap: 0.55rem;
}

.protocol-links a {
    display: grid;
    gap: 0.2rem;
    padding: 0.75rem 0.8rem;
    border: 1px solid rgba(145, 174, 214, 0.16);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
    transition: border-color 160ms ease, background 160ms ease;
}

.protocol-links a span {
    color: var(--muted);
    font-size: 0.85rem;
}

.protocol-links a.is-active,
.protocol-links a:hover {
    border-color: rgba(113, 241, 214, 0.35);
    background: rgba(113, 241, 214, 0.09);
}

.protocol-content {
    padding: 1.2rem;
}

.protocol-content h2 {
    margin: 0.7rem 0 1rem;
}

.protocol-pdf-viewer {
    margin-top: 0.8rem;
    border: 1px solid rgba(145, 174, 214, 0.22);
    border-radius: 16px;
    overflow: hidden;
    background: rgba(6, 11, 20, 0.92);
}

.protocol-pdf-frame {
    width: 100%;
    min-height: 78vh;
    border: 0;
    background: #0b1422;
}

.markdown-content {
    color: var(--text);
    line-height: 1.72;
}

.markdown-content p {
    margin: 0 0 0.95rem;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3 {
    margin: 1.1rem 0 0.6rem;
    line-height: 1.2;
}

.markdown-content ul {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
}

.empty-state {
    display: grid;
    gap: 0.35rem;
}

.project-card.is-member {
    border-color: rgba(89, 224, 163, 0.26);
}

.flash {
    padding: 0.9rem 1rem;
    border-radius: 18px;
    border: 1px solid rgba(145, 174, 214, 0.16);
    background: rgba(8, 14, 24, 0.82);
    box-shadow: var(--shadow);
    animation: slide-fade 420ms ease both;
}

.flash-success {
    color: #c8ffe6;
    border-color: rgba(89, 224, 163, 0.28);
}

.flash-warning {
    color: #ffe2a8;
    border-color: rgba(255, 190, 98, 0.28);
}

.flash-error {
    color: #ffc0cf;
    border-color: rgba(255, 113, 139, 0.28);
}

.footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0 1.8rem;
    font-size: 0.92rem;
}

@keyframes slide-fade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Background job progress bar & toast ─────────────────── */

.tag-processing {
    color: var(--accent-warm);
    border-color: rgba(255, 190, 98, 0.28);
    animation: pulse-tag 1.6s ease-in-out infinite;
}

@keyframes pulse-tag {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

.progress-track {
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 35%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--accent-strong));
    animation: progress-slide 1.8s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes progress-slide {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(320%); }
}

.job-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    padding: 0.75rem 1.4rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
    animation: toast-in 200ms ease;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(12px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.job-toast-ok {
    background: rgba(89, 224, 163, 0.18);
    border: 1px solid rgba(89, 224, 163, 0.4);
    color: var(--success);
}

.job-toast-error {
    background: rgba(255, 113, 139, 0.18);
    border: 1px solid rgba(255, 113, 139, 0.4);
    color: var(--danger);
}

/* ── Pipeline tool status panel ───────────────────────────── */

.tool-status-panel {
    padding: 1.2rem;
}

.tool-status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.tool-card {
    padding: 0.9rem 1rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    display: grid;
    gap: 0.4rem;
    align-content: start;
}

.tool-card.tool-status-ok {
    border-color: rgba(89, 224, 163, 0.28);
    background: rgba(89, 224, 163, 0.04);
}

.tool-card.tool-status-warn {
    border-color: rgba(255, 190, 98, 0.28);
    background: rgba(255, 190, 98, 0.04);
}

.tool-card.tool-status-na {
    border-color: rgba(145, 174, 214, 0.1);
    opacity: 0.65;
}

.tool-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tool-card p {
    margin: 0;
    font-size: 0.84rem;
    color: var(--muted);
    line-height: 1.5;
}

.tool-env {
    font-size: 0.77rem;
    color: var(--accent);
    background: rgba(113, 241, 214, 0.07);
    border-radius: 6px;
    padding: 0.18rem 0.44rem;
    word-break: break-all;
}

.tool-chain-hint {
    font-size: 0.77rem;
    color: var(--muted);
    opacity: 0.55;
}

.tag-ok {
    color: var(--success);
    border-color: rgba(89, 224, 163, 0.28);
}

.tag-warn {
    color: var(--accent-warm);
    border-color: rgba(255, 190, 98, 0.28);
}

.tag-error {
    color: var(--danger);
    border-color: rgba(255, 113, 139, 0.28);
}

.tag-muted {
    color: var(--muted);
    opacity: 0.75;
}

.text-ok { color: var(--success); }
.text-warn { color: var(--accent-warm); }

/* ── Ollama status block ──────────────────────────────────── */

.ollama-status {
    padding: 0.9rem 1rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    display: grid;
    gap: 0.55rem;
}

.ollama-ok {
    border-color: rgba(89, 224, 163, 0.28);
    background: rgba(89, 224, 163, 0.04);
}

.ollama-error {
    border-color: rgba(255, 113, 139, 0.28);
    background: rgba(255, 113, 139, 0.04);
}

.ollama-status-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.ollama-title-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.ollama-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    text-align: right;
    color: var(--muted);
    font-size: 0.85rem;
}

.ollama-error-msg {
    margin: 0;
    color: var(--danger);
    font-size: 0.84rem;
}

.ollama-error-msg code {
    background: rgba(255, 113, 139, 0.1);
    border-radius: 5px;
    padding: 0.1rem 0.38rem;
    color: var(--accent);
}

.ollama-models {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

/* ── End pipeline tool styles ────────────────────────────── */

@media (max-width: 1100px) {
    .topbar,
    .hero-grid,
    .dashboard-grid,
    .content-split,
    .admin-grid,
    .admin-columns,
    .metrics-grid,
    .protocol-layout,
    .feature-grid,
    .project-grid,
    .tool-status-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        grid-template-columns: 1fr;
        justify-items: start;
    }

    .topbar-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .nav-links {
        flex-wrap: wrap;
        border-radius: 24px;
    }

    .admin-user-grid {
        grid-template-columns: 1fr;
    }

    .admin-user-foot {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-user-actions .button {
        width: 100%;
    }

    .protocol-sidebar {
        position: static;
    }

    .protocol-pdf-frame {
        min-height: 68vh;
    }
}

@media (max-width: 720px) {
    .topbar,
    .page-shell,
    .footer {
        width: min(100% - 1rem, 1180px);
    }

    .hero-stats,
    .section-head,
    .pwa-head,
    .meta-row,
    .button-row,
    .footer {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-links {
        width: 100%;
    }

    .nav-links a {
        flex: 1 1 auto;
        text-align: center;
    }

    .admin-user-head {
        flex-direction: column;
    }

    .admin-user-meta {
        justify-content: flex-start;
    }

    .admin-user-identity {
        width: 100%;
    }
}
