/* Admin Console — Galactic Radio Ads */

/* ======================== CSS VARIABLES ======================== */
:root {
    --bg-deep: #06050e;
    --bg-surface: #0d0b1a;
    --bg-card: #100e1f;
    --glass-bg: rgba(16, 14, 31, 0.6);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-hover: rgba(255, 255, 255, 0.08);
    --text-bright: #f0ecf8;
    --text-primary: #c8c2d8;
    --text-muted: #6b6188;
    --cyan: #00d4ff;
    --cyan-dim: rgba(0, 212, 255, 0.08);
    --purple: #a855f7;
    --purple-dim: rgba(124, 58, 237, 0.1);
    --green: #10b981;
    --green-dim: rgba(16, 185, 129, 0.1);
    --amber: #f59e0b;
    --amber-dim: rgba(245, 158, 11, 0.08);
    --red: #ef4444;
    --radius: 12px;
    --radius-sm: 8px;
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Monaco, monospace;
}

/* ======================== BASE STYLES ======================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ======================== STARFIELD ======================== */
.stars-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.stars {
    position: absolute;
    inset: 0;
    background-repeat: repeat;
    animation: star-drift linear infinite;
}

.stars-sm {
    background-image: radial-gradient(1px 1px at 50px 80px, rgba(255,255,255,0.3), transparent),
                       radial-gradient(1px 1px at 150px 200px, rgba(255,255,255,0.25), transparent),
                       radial-gradient(1px 1px at 300px 50px, rgba(255,255,255,0.2), transparent),
                       radial-gradient(1px 1px at 400px 300px, rgba(255,255,255,0.3), transparent),
                       radial-gradient(1px 1px at 500px 150px, rgba(255,255,255,0.15), transparent),
                       radial-gradient(1px 1px at 620px 250px, rgba(255,255,255,0.25), transparent),
                       radial-gradient(1px 1px at 720px 100px, rgba(255,255,255,0.2), transparent),
                       radial-gradient(1px 1px at 100px 350px, rgba(255,255,255,0.3), transparent);
    background-size: 800px 400px;
    animation-duration: 120s;
}

.stars-md {
    background-image: radial-gradient(1.5px 1.5px at 200px 120px, rgba(255,255,255,0.35), transparent),
                       radial-gradient(1.5px 1.5px at 450px 280px, rgba(255,255,255,0.3), transparent),
                       radial-gradient(1.5px 1.5px at 650px 60px, rgba(255,255,255,0.25), transparent),
                       radial-gradient(1.5px 1.5px at 350px 180px, rgba(255,255,255,0.35), transparent);
    background-size: 800px 400px;
    animation-duration: 90s;
}

.stars-lg {
    background-image: radial-gradient(2px 2px at 100px 200px, rgba(255,255,255,0.4), transparent),
                       radial-gradient(2px 2px at 550px 350px, rgba(255,255,255,0.35), transparent),
                       radial-gradient(2.5px 2.5px at 750px 180px, rgba(0,212,255,0.3), transparent);
    background-size: 800px 400px;
    animation-duration: 60s;
}

@keyframes star-drift {
    from { transform: translateY(0); }
    to { transform: translateY(-400px); }
}

/* ======================== FONTS ======================== */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ======================== TOP NAV ======================== */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    position: relative;
    z-index: 1;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-logo {
    width: 36px;
    height: 36px;
    color: var(--cyan);
    flex-shrink: 0;
}

.nav-title {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-bright);
    letter-spacing: 1px;
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-glass {
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-glass:hover {
    background: var(--glass-hover);
    border-color: var(--cyan);
    color: var(--cyan);
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    border-color: var(--red);
    color: var(--red);
    background: rgba(239, 68, 68, 0.08);
}

/* ======================== GLASS CARD ======================== */
.glass-card {
    background: rgba(16, 14, 31, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ======================== HERO TEXT ======================== */
.tab-eyebrow {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--cyan);
    font-weight: 500;
}

.tab-heading {
    font-family: var(--font-display);
    font-weight: 800;
    color: var(--text-bright);
    line-height: 1.2;
    letter-spacing: 1px;
}

.tab-subcopy {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 640px;
    margin: 0.75rem auto 0;
}

/* ======================== FOOTER ======================== */
.app-footer {
    text-align: center;
    padding: 2rem 0;
}

.footer-copy {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ======================== HTTP METHOD BADGES ======================== */
.http-delete {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    letter-spacing: 0.03em;
    background: rgba(239, 68, 68, 0.1);
    color: var(--red);
}

.http-patch {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    letter-spacing: 0.03em;
    background: var(--amber-dim);
    color: var(--amber);
}

/* ======================== GATE / DENIED ======================== */
.admin-gate,
.admin-denied {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--text-muted);
}

.admin-gate-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ======================== CONSOLE LAYOUT ======================== */
.admin-console {
    position: relative;
    z-index: 1;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.25rem 3rem;
}

.admin-badge {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    background: var(--purple-dim);
    color: var(--purple);
    border: 1px solid rgba(124, 58, 237, 0.3);
    padding: 0.15rem 0.55rem;
    border-radius: 4px;
    margin-left: 0.5rem;
}

/* ======================== HERO ======================== */
.admin-hero {
    text-align: center;
    padding: 2.5rem 1rem 1.5rem;
}

.admin-hero .tab-heading {
    font-size: clamp(1.5rem, 3.5vw, 2.2rem);
}

/* ======================== TABLE OF CONTENTS ======================== */
.admin-toc {
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}

.admin-toc-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.admin-toc-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.toc-chip {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    text-decoration: none;
    transition: all 0.2s;
}

.toc-chip:hover {
    background: var(--glass-hover);
    border-color: var(--cyan);
    color: var(--cyan);
}

/* ======================== SECTIONS ======================== */
.admin-section {
    margin-bottom: 2.5rem;
    scroll-margin-top: 5rem;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0 0.25rem;
}

.section-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--cyan-dim);
    color: var(--cyan);
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.section-icon-purple { background: var(--purple-dim); color: var(--purple); border-color: rgba(124,58,237,0.2); }
.section-icon-green { background: var(--green-dim); color: var(--green); border-color: rgba(16,185,129,0.2); }
.section-icon-amber { background: var(--amber-dim); color: var(--amber); border-color: rgba(245,158,11,0.2); }
.section-icon-cyan { background: var(--cyan-dim); color: var(--cyan); border-color: rgba(0,212,255,0.2); }

.section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-bright);
    line-height: 1.3;
}

.section-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* ======================== CARDS ======================== */
.admin-card {
    padding: 1.5rem;
}

.admin-card-subtitle {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-bright);
    margin: 1.5rem 0 0.75rem;
}

.admin-card-subtitle:first-child {
    margin-top: 0;
}

.admin-prose {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.7;
}

.admin-prose p {
    margin-bottom: 0.75rem;
}

.admin-prose p:last-child {
    margin-bottom: 0;
}

.admin-prose code {
    background: rgba(0, 212, 255, 0.08);
    padding: 0.1em 0.35em;
    border-radius: 4px;
    font-size: 0.85em;
    color: var(--cyan);
}

/* ======================== CALLOUTS ======================== */
.admin-callout {
    margin-top: 1.25rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    line-height: 1.6;
}

.admin-callout-info {
    background: var(--cyan-dim);
    border-left: 3px solid var(--cyan);
    color: var(--text-primary);
}

.admin-callout-warn {
    background: var(--amber-dim);
    border-left: 3px solid var(--amber);
    color: var(--text-primary);
}

.admin-callout strong {
    color: var(--text-bright);
}

.admin-callout code {
    background: rgba(255,255,255,0.06);
    padding: 0.1em 0.3em;
    border-radius: 3px;
    font-size: 0.9em;
}

/* ======================== INFO GRID ======================== */
.admin-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.admin-info-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.admin-info-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.admin-info-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-bright);
}

/* ======================== FLOW CHARTS ======================== */
.flow-chart {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
}

.flow-row {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.flow-row-clients { gap: 1.5rem; }

.flow-node {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    text-align: center;
    min-width: 120px;
    transition: border-color 0.2s;
}

.flow-node:hover {
    border-color: rgba(255,255,255,0.15);
}

.flow-node-wide {
    min-width: 320px;
    max-width: 100%;
}

.flow-node-icon {
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
    line-height: 1;
}

.flow-node-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-bright);
}

.flow-node-detail {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.flow-node-client { border-color: rgba(0, 212, 255, 0.2); }
.flow-node-api { border-color: rgba(124, 58, 237, 0.3); background: rgba(124, 58, 237, 0.06); }
.flow-node-service { border-color: rgba(16, 185, 129, 0.2); }
.flow-node-data { border-color: rgba(245, 158, 11, 0.2); background: rgba(245, 158, 11, 0.04); }
.flow-node-agent { border-color: rgba(0, 212, 255, 0.3); }
.flow-node-endpoint { border-color: rgba(124, 58, 237, 0.3); background: rgba(124, 58, 237, 0.06); }

.flow-arrows-down {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 0.5rem 0;
}

.flow-arrow {
    width: 2px;
    height: 24px;
    background: linear-gradient(to bottom, var(--cyan), transparent);
    position: relative;
}

.flow-arrow::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: -3px;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 6px solid var(--cyan);
    opacity: 0.5;
}

/* Horizontal connectors for A2A flow */
.flow-row-a2a {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0;
}

.flow-connector-h {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 0.5rem;
    min-width: 100px;
}

.flow-connector-line {
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, var(--cyan), var(--purple));
    opacity: 0.4;
}

.flow-connector-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    margin-top: 0.25rem;
}

/* ======================== PIPELINE STEPS ======================== */
.pipeline-flow {
    position: relative;
    padding: 0.5rem 0;
}

.pipeline-step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.pipeline-step-num {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--cyan-dim);
    color: var(--cyan);
    font-weight: 700;
    font-size: 0.85rem;
    border: 1px solid rgba(0, 212, 255, 0.2);
    flex-shrink: 0;
}

.pipeline-step-highlight .pipeline-step-num {
    background: rgba(124, 58, 237, 0.15);
    color: var(--purple);
    border-color: rgba(124, 58, 237, 0.3);
}

.pipeline-step-content h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 0.25rem;
}

.pipeline-step-content p {
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 0.35rem;
}

.pipeline-code {
    display: inline-block;
    background: rgba(0, 212, 255, 0.08);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--cyan);
    margin-top: 0.25rem;
}

.pipeline-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.4rem;
}

.detail-tag {
    display: inline-block;
    font-size: 0.72rem;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
}

.pipeline-connector {
    width: 2px;
    height: 20px;
    background: linear-gradient(to bottom, rgba(0,212,255,0.3), transparent);
    margin: 0.35rem 0 0.35rem 17px;
}

/* ======================== AUTH FLOW ======================== */
.auth-flow {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-method {
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.auth-method-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    background: var(--glass-bg);
}

.auth-method-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-bright);
}

.auth-method-badge {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.auth-firebase .auth-method-badge { background: var(--amber-dim); color: var(--amber); }
.auth-apikey .auth-method-badge { background: var(--green-dim); color: var(--green); }
.auth-service .auth-method-badge { background: var(--purple-dim); color: var(--purple); }

.auth-method-body {
    padding: 0.85rem 1rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.6;
}

.auth-method-body p {
    margin-bottom: 0.5rem;
}

.auth-method-body code {
    background: rgba(0, 212, 255, 0.08);
    padding: 0.1em 0.3em;
    border-radius: 3px;
    font-size: 0.85em;
    color: var(--cyan);
}

.auth-method-flow {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0.5rem 0;
}

.auth-step {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-bright);
}

.auth-arrow {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ======================== CREDIT TIERS ======================== */
.credit-tiers {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.credit-tier {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
    position: relative;
}

.credit-tier-pop {
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.08);
}

.credit-tier-badge {
    position: absolute;
    top: -8px;
    right: -4px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--cyan);
    color: var(--bg-deep);
    padding: 0.1rem 0.5rem;
    border-radius: 8px;
}

.credit-tier-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 0.25rem;
}

.credit-tier-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--cyan);
}

.credit-tier-amount {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* ======================== SKILL GRID ======================== */
.skill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
}

.skill-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
}

.skill-card-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cyan);
    font-family: monospace;
    margin-bottom: 0.35rem;
}

.skill-card-desc {
    font-size: 0.8rem;
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.skill-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.skill-tag {
    display: inline-block;
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    border-radius: 8px;
    background: rgba(124, 58, 237, 0.1);
    color: var(--purple);
    border: 1px solid rgba(124, 58, 237, 0.2);
}

/* ======================== TABLES ======================== */
.admin-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.admin-table th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.72rem;
    border-bottom: 1px solid var(--glass-border);
}

.admin-table td {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    color: var(--text-primary);
    vertical-align: top;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table code {
    background: rgba(0, 212, 255, 0.08);
    padding: 0.1em 0.35em;
    border-radius: 3px;
    font-size: 0.9em;
    color: var(--cyan);
    white-space: nowrap;
}

.admin-table-divider td {
    border-bottom: none;
}

.admin-table-divider-cell {
    padding-top: 1rem !important;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--glass-border) !important;
}

.http-get, .http-post {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    letter-spacing: 0.03em;
}

.http-get { background: var(--green-dim); color: var(--green); }
.http-post { background: var(--cyan-dim); color: var(--cyan); }

/* ======================== PROMPTS ======================== */
.prompt-arch {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.prompt-layer {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.prompt-layer-label {
    min-width: 140px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--cyan);
    padding-top: 0.6rem;
    flex-shrink: 0;
}

.prompt-layer-content {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.85rem;
    flex: 1;
    font-size: 0.82rem;
    color: var(--text-primary);
    line-height: 1.6;
}

.prompt-layer-content p {
    margin: 0;
}

/* ======================== CODE BLOCKS ======================== */
.admin-code-block {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    overflow-x: auto;
    margin-top: 0.75rem;
}

.admin-code-block pre {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.78rem;
    line-height: 1.7;
    color: var(--text-primary);
    white-space: pre;
    margin: 0;
}

/* ======================== CLI COMMANDS ======================== */
.cli-commands {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.cli-group-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 0.5rem;
}

.cli-cmd {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.85rem;
    margin-bottom: 0.4rem;
}

.cli-cmd code {
    display: block;
    font-size: 0.82rem;
    color: var(--cyan);
    margin-bottom: 0.2rem;
}

.cli-cmd p {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0;
}

/* ======================== DEPLOY FLOW ======================== */
.deploy-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.deploy-step {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    text-align: center;
    min-width: 120px;
}

.deploy-step-active {
    border-color: var(--green);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
}

.deploy-step-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-bright);
}

.deploy-step-detail {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.deploy-arrow {
    color: var(--text-muted);
    font-size: 1.2rem;
}

/* ======================== STACK GRID ======================== */
.stack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.stack-category {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
}

.stack-category-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--glass-border);
}

.stack-items {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.stack-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}

.stack-item-name {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--cyan);
}

.stack-item-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
}

/* ======================== PRINT BUTTON ======================== */
.btn-print {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-print:hover {
    background: var(--glass-hover);
    border-color: var(--cyan);
    color: var(--cyan);
}

/* ======================== RESPONSIVE ======================== */
@media (max-width: 640px) {
    .admin-console {
        padding: 0 0.75rem 2rem;
    }

    .flow-chart {
        padding: 1rem;
    }

    .flow-node-wide {
        min-width: 200px;
    }

    .prompt-layer {
        flex-direction: column;
        gap: 0.25rem;
    }

    .prompt-layer-label {
        min-width: auto;
        padding-top: 0;
    }

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

    .skill-grid {
        grid-template-columns: 1fr;
    }

    .credit-tiers {
        grid-template-columns: repeat(2, 1fr);
    }

    .stack-grid {
        grid-template-columns: 1fr;
    }

    .deploy-flow {
        flex-direction: column;
    }

    .deploy-arrow {
        transform: rotate(90deg);
    }

    .flow-row-a2a {
        flex-direction: column;
        align-items: center;
    }

    .flow-connector-h {
        transform: rotate(90deg);
        min-width: 60px;
        padding: 0.5rem 0;
    }
}

/* ================================================================
   PRINT STYLES — Book-quality PDF output
   ================================================================ */
@media print {
    /* ---- Page setup ---- */
    @page {
        size: letter;
        margin: 0.75in 0.85in;
    }

    @page :first {
        margin-top: 1.5in;
    }

    /* ---- Reset dark theme to print-friendly ---- */
    *,
    *::before,
    *::after {
        color: #1a1a1a !important;
        background: transparent !important;
        box-shadow: none !important;
        text-shadow: none !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    html, body {
        background: #fff !important;
        font-size: 11pt;
        line-height: 1.5;
    }

    /* ---- Hide non-print elements ---- */
    .stars-bg,
    .top-nav,
    .admin-gate,
    .admin-denied,
    .admin-toc,
    .btn-print,
    .btn-logout,
    .btn-sm,
    .app-footer {
        display: none !important;
    }

    /* ---- Console layout ---- */
    .admin-console {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        display: block !important;
    }

    /* ---- Hero / Title Page ---- */
    .admin-hero {
        text-align: center;
        padding: 0 0 0.4in !important;
        border-bottom: 2pt solid #1a1a1a;
        margin-bottom: 0.3in;
    }

    .admin-hero .tab-eyebrow {
        font-size: 10pt;
        text-transform: uppercase;
        letter-spacing: 0.15em;
        color: #666 !important;
        margin-bottom: 0.1in;
    }

    .admin-hero .tab-heading {
        font-size: 22pt !important;
        font-weight: 800;
        line-height: 1.2;
        margin-bottom: 0.1in;
    }

    .admin-hero .tab-subcopy {
        font-size: 10pt;
        color: #555 !important;
        max-width: 5.5in;
        margin: 0 auto;
        line-height: 1.6;
    }

    /* ---- Sections ---- */
    .admin-section {
        margin-bottom: 0.25in !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    /* Each major section starts on a new page */
    .admin-section {
        page-break-before: auto;
    }

    /* Force page break before these heavier sections */
    #section-a2a,
    #section-api,
    #section-deploy {
        page-break-before: always;
        break-before: page;
    }

    .section-header {
        margin-bottom: 0.15in !important;
        padding: 0 !important;
        border-bottom: 1pt solid #ccc;
        padding-bottom: 0.08in !important;
    }

    .section-icon {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        border: 1pt solid #999 !important;
        border-radius: 6px !important;
    }

    .section-icon svg {
        width: 16px !important;
        height: 16px !important;
    }

    .section-title {
        font-size: 15pt !important;
        font-weight: 700;
    }

    .section-subtitle {
        font-size: 9pt !important;
        color: #666 !important;
    }

    /* ---- Glass cards → clean bordered boxes ---- */
    .glass-card,
    .admin-card {
        border: 1pt solid #ccc !important;
        border-radius: 6px !important;
        padding: 0.15in 0.2in !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    /* ---- Flow charts ---- */
    .flow-chart {
        border: 1pt solid #ddd !important;
        border-radius: 4px !important;
        padding: 0.15in !important;
        margin: 0.12in 0 !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .flow-node {
        border: 1pt solid #aaa !important;
        border-radius: 4px !important;
        padding: 0.06in 0.1in !important;
        min-width: 90px !important;
    }

    .flow-node-api,
    .flow-node-endpoint {
        border: 1.5pt solid #666 !important;
    }

    .flow-node-data {
        border-style: dashed !important;
    }

    .flow-node-icon {
        font-size: 14pt !important;
    }

    .flow-node-label {
        font-size: 9pt !important;
        font-weight: 700;
    }

    .flow-node-detail {
        font-size: 7.5pt !important;
        color: #666 !important;
    }

    .flow-node-wide {
        min-width: 200px !important;
    }

    .flow-arrow {
        background: #999 !important;
        height: 16px !important;
    }

    .flow-arrow::after {
        border-top-color: #999 !important;
        opacity: 1 !important;
    }

    .flow-connector-line {
        background: #aaa !important;
        opacity: 1 !important;
    }

    /* ---- Pipeline steps ---- */
    .pipeline-flow {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .pipeline-step {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .pipeline-step-num {
        width: 24px !important;
        height: 24px !important;
        min-width: 24px !important;
        font-size: 9pt !important;
        border: 1.5pt solid #333 !important;
        border-radius: 50% !important;
        font-weight: 800;
    }

    .pipeline-step-content h3 {
        font-size: 10.5pt !important;
        font-weight: 700;
    }

    .pipeline-step-content p {
        font-size: 9pt !important;
        line-height: 1.5;
    }

    .pipeline-code {
        border: 1pt solid #ccc !important;
        font-size: 8pt !important;
        padding: 0.02in 0.08in !important;
        font-family: 'Courier New', monospace !important;
    }

    .pipeline-connector {
        background: #ccc !important;
        margin-left: 11px !important;
        height: 14px !important;
    }

    .detail-tag {
        border: 1pt solid #ccc !important;
        font-size: 7pt !important;
    }

    /* ---- Auth flow ---- */
    .auth-flow {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .auth-method {
        border: 1pt solid #bbb !important;
        border-radius: 4px !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .auth-method-header {
        border-bottom: 1pt solid #ddd !important;
        padding: 0.06in 0.12in !important;
    }

    .auth-method-header h3 {
        font-size: 10pt !important;
    }

    .auth-method-badge {
        border: 1pt solid #999 !important;
        font-size: 7pt !important;
        padding: 0.01in 0.06in !important;
    }

    .auth-method-body {
        font-size: 9pt !important;
        padding: 0.08in 0.12in !important;
    }

    .auth-step {
        border: 1pt solid #bbb !important;
        font-size: 8pt !important;
        padding: 0.02in 0.08in !important;
    }

    /* ---- Credit tiers ---- */
    .credit-tiers {
        page-break-inside: avoid;
        break-inside: avoid;
        grid-template-columns: repeat(4, 1fr) !important;
    }

    .credit-tier {
        border: 1pt solid #bbb !important;
        border-radius: 4px !important;
        padding: 0.1in !important;
    }

    .credit-tier-pop {
        border: 2pt solid #333 !important;
    }

    .credit-tier-badge {
        border: 1pt solid #333 !important;
        font-size: 6pt !important;
    }

    .credit-tier-name {
        font-size: 9pt !important;
    }

    .credit-tier-price {
        font-size: 11pt !important;
        font-weight: 800;
    }

    .credit-tier-amount {
        font-size: 8pt !important;
    }

    /* ---- Skill grid ---- */
    .skill-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .skill-card {
        border: 1pt solid #bbb !important;
        border-radius: 4px !important;
        padding: 0.08in 0.12in !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .skill-card-name {
        font-size: 9pt !important;
        font-weight: 700;
        font-family: 'Courier New', monospace !important;
    }

    .skill-card-desc {
        font-size: 8pt !important;
    }

    .skill-tag {
        border: 1pt solid #ccc !important;
        font-size: 6.5pt !important;
    }

    /* ---- Tables ---- */
    .admin-table-wrap {
        overflow: visible !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .admin-table {
        font-size: 8.5pt !important;
    }

    .admin-table th {
        font-size: 7.5pt !important;
        border-bottom: 1.5pt solid #333 !important;
        padding: 0.04in 0.08in !important;
    }

    .admin-table td {
        padding: 0.04in 0.08in !important;
        border-bottom: 0.5pt solid #ddd !important;
    }

    .admin-table code {
        font-family: 'Courier New', monospace !important;
        font-size: 8pt !important;
        border: 0.5pt solid #ccc !important;
        padding: 0 0.04in !important;
    }

    .admin-table-divider-cell {
        border-bottom: 1pt solid #999 !important;
        font-size: 7.5pt !important;
        padding-top: 0.1in !important;
    }

    .http-get, .http-post {
        font-size: 7pt !important;
        border: 1pt solid #999 !important;
        padding: 0 0.04in !important;
    }

    /* ---- Prompts ---- */
    .prompt-arch {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .prompt-layer {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .prompt-layer-label {
        font-size: 8.5pt !important;
        font-weight: 700;
        min-width: 100px !important;
    }

    .prompt-layer-content {
        border: 1pt solid #ccc !important;
        font-size: 8.5pt !important;
        padding: 0.06in 0.1in !important;
    }

    /* ---- Code blocks ---- */
    .admin-code-block {
        border: 1pt solid #ccc !important;
        border-radius: 4px !important;
        padding: 0.1in !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .admin-code-block pre {
        font-family: 'Courier New', monospace !important;
        font-size: 7.5pt !important;
        line-height: 1.5 !important;
        white-space: pre-wrap !important;
        word-break: break-all;
    }

    /* ---- CLI commands ---- */
    .cli-commands {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .cli-group {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .cli-group-title {
        font-size: 10pt !important;
        font-weight: 700;
        border-bottom: 0.5pt solid #ddd;
        padding-bottom: 0.03in;
    }

    .cli-cmd {
        border: 1pt solid #ddd !important;
        border-radius: 3px !important;
        padding: 0.04in 0.1in !important;
        margin-bottom: 0.04in !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .cli-cmd code {
        font-family: 'Courier New', monospace !important;
        font-size: 8.5pt !important;
        font-weight: 600;
    }

    .cli-cmd p {
        font-size: 8pt !important;
    }

    /* ---- Deploy flow ---- */
    .deploy-flow {
        page-break-inside: avoid;
        break-inside: avoid;
        flex-wrap: nowrap !important;
    }

    .deploy-step {
        border: 1pt solid #bbb !important;
        border-radius: 4px !important;
        padding: 0.06in 0.1in !important;
        min-width: 90px !important;
    }

    .deploy-step-active {
        border: 2pt solid #333 !important;
    }

    .deploy-step-label {
        font-size: 9pt !important;
    }

    .deploy-step-detail {
        font-size: 7pt !important;
    }

    .deploy-arrow {
        font-size: 12pt !important;
    }

    /* ---- Stack grid ---- */
    .stack-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .stack-category {
        border: 1pt solid #bbb !important;
        border-radius: 4px !important;
        padding: 0.08in !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .stack-category-title {
        font-size: 9pt !important;
        font-weight: 700;
        border-bottom: 1pt solid #ddd !important;
    }

    .stack-item-name {
        font-size: 8.5pt !important;
        font-weight: 600;
    }

    .stack-item-desc {
        font-size: 7.5pt !important;
    }

    /* ---- Info grid ---- */
    .admin-info-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .admin-info-item {
        border: 1pt solid #ccc !important;
        border-radius: 3px !important;
        padding: 0.05in 0.08in !important;
    }

    .admin-info-label {
        font-size: 7pt !important;
    }

    .admin-info-value {
        font-size: 9pt !important;
    }

    /* ---- Callouts ---- */
    .admin-callout {
        border: 1pt solid #999 !important;
        border-left: 3pt solid #333 !important;
        border-radius: 3px !important;
        padding: 0.08in 0.12in !important;
        font-size: 8.5pt !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .admin-callout code {
        border: 0.5pt solid #ccc !important;
        font-family: 'Courier New', monospace !important;
        font-size: 8pt !important;
    }

    /* ---- Prose ---- */
    .admin-prose {
        font-size: 9.5pt !important;
        line-height: 1.6 !important;
    }

    .admin-prose code {
        font-family: 'Courier New', monospace !important;
        font-size: 8.5pt !important;
        border: 0.5pt solid #ccc !important;
        padding: 0 0.03in !important;
    }

    .admin-card-subtitle {
        font-size: 11pt !important;
        font-weight: 700;
        margin-top: 0.15in !important;
        margin-bottom: 0.08in !important;
    }

    /* ---- Prevent widows/orphans ---- */
    p, li {
        orphans: 3;
        widows: 3;
    }

    h2, h3 {
        page-break-after: avoid;
        break-after: avoid;
    }

    /* ---- Links: show URL for external links ---- */
    a[href^="http"]:not([href*="localhost"])::after {
        content: " (" attr(href) ")";
        font-size: 7pt;
        color: #666 !important;
        word-break: break-all;
    }

    /* ---- Footer for printed pages ---- */
    .admin-console::after {
        content: "Galactic Radio Ads — System Architecture — Confidential";
        display: block;
        text-align: center;
        font-size: 8pt;
        color: #999 !important;
        padding-top: 0.3in;
        margin-top: 0.3in;
        border-top: 0.5pt solid #ccc;
    }
}
