/* =============================================================================
 * Pegenaut command console — futuristic composite interface
 *
 * Design language: satin white composite, edge-lit controls, calm cyan/blue
 * accents. Panels are molded into the hull rather than stacked on top.
 * Tune everything from the tokens block below.
 * ============================================================================= */

/* ---- 1. Design tokens ---- */

:root {

    /* Palette --------------------------------------------------------------- */

    --bg-1:        #F5F7F9;
    --bg-2:        #EEF2F5;
    --surface:     #FFFFFF;
    --surface-soft:#F7FAFC;

    --border-hair: rgba(101, 112, 124, 0.10);
    --border-soft: rgba(101, 112, 124, 0.20);

    --text-strong: #20242A;
    --text:        #303740;
    --text-muted:  #65707C;
    --text-subtle: #8B95A0;

    --cyan:        #5FD8FF;
    --blue:        #5A8DFF;
    --amber:       #FFBE4D;
    --warn:        #FF7654;

    --cyan-soft:   rgba(95, 216, 255, 0.16);
    --blue-soft:   rgba(90, 141, 255, 0.14);
    --amber-soft:  rgba(255, 190,  77, 0.20);

    /* Composite surfaces ---------------------------------------------------- */

    --panel:
        linear-gradient(180deg, #FFFFFF 0%, #F7FAFC 100%);
    --panel-illum:
        radial-gradient(140% 120% at 50% 0%, rgba(95, 216, 255, 0.07) 0%, rgba(95, 216, 255, 0) 55%),
        linear-gradient(180deg, #FFFFFF 0%, #F5F7F9 100%);
    --panel-recess:
        linear-gradient(180deg, #EEF2F5 0%, #F5F7F9 100%);

    /* Radii ---------------------------------------------------------------- */

    --r-xs: 8px;
    --r-sm: 12px;
    --r-md: 18px;
    --r-lg: 24px;
    --r-xl: 32px;

    /* Elevations & glows --------------------------------------------------- */

    --edge-inner:
        inset 0 1px 0 rgba(255, 255, 255, 0.85),
        inset 0 -1px 0 rgba(101, 112, 124, 0.06);
    --edge-hair:  0 0 0 1px var(--border-hair);

    --lift-1:
        0 1px 2px  rgba(32, 36, 42, 0.04),
        0 8px 24px rgba(32, 36, 42, 0.06);
    --lift-2:
        0 2px 4px  rgba(32, 36, 42, 0.06),
        0 24px 48px rgba(32, 36, 42, 0.08);
    --recess:
        inset 0 2px 6px rgba(32, 36, 42, 0.05);

    --glow-cyan:  0 0 0 3px rgba(95, 216, 255, 0.28);
    --glow-blue:  0 0 0 3px rgba(90, 141, 255, 0.24);
    --glow-amber: 0 0 0 3px rgba(255, 190,  77, 0.28);

    /* Spacing scale -------------------------------------------------------- */

    --sp-1:  4px;
    --sp-2:  8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 24px;
    --sp-6: 32px;
    --sp-7: 48px;

    /* Motion --------------------------------------------------------------- */

    --ease:  cubic-bezier(0.4, 0, 0.2, 1);
    --dur-1: 180ms;
    --dur-2: 260ms;

    /* Typography ----------------------------------------------------------- */

    --font-sans:
        "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
        Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono:
        ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}


/* ---- 2. Reset & base ---- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    height: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background:
        radial-gradient(1200px 800px at 20%   0%,  rgba(95, 216, 255, 0.06) 0%, transparent 60%),
        radial-gradient(1200px 800px at 100% 100%, rgba(90, 141, 255, 0.06) 0%, transparent 60%),
        var(--bg-1);
    overflow: hidden;
    letter-spacing: 0.005em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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


/* ---- 3. Hull layout ---- */

.hull {
    display: grid;
    grid-template-columns: 268px 1fr 300px;
    grid-template-rows:    64px 1fr 40px;
    grid-template-areas:
        "hdr hdr hdr"
        "nav main aside"
        "ftr ftr ftr";
    gap: var(--sp-4);
    padding: var(--sp-4);
    height: 100vh;
}

.hull-header,
.hull-nav,
.hull-main,
.hull-aside,
.hull-footer {
    border-radius: var(--r-lg);
    background: var(--panel);
    box-shadow: var(--edge-hair), var(--lift-1);
    position: relative;
    min-height: 0; /* let overflow: hidden work inside grid children */
}

.hull-header {
    grid-area: hdr;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--sp-6);
    border-radius: var(--r-xl);
    background: var(--panel-illum);
}

.hull-nav {
    grid-area: nav;
    display: flex;
    flex-direction: column;
    padding: var(--sp-5) var(--sp-4);
    gap: var(--sp-4);
    overflow: hidden;
}

.hull-main {
    grid-area: main;
    display: grid;
    grid-template-rows: auto 1fr auto;
    overflow: hidden;
}

.hull-aside {
    grid-area: aside;
    display: flex;
    flex-direction: column;
    padding: var(--sp-5);
    gap: var(--sp-4);
    overflow: hidden;
}

.hull-footer {
    grid-area: ftr;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--sp-5);
    font-size: 12px;
    color: var(--text-muted);
}


/* ---- 4. Header / brand ---- */

.brand {
    display: flex;
    align-items: baseline;
    gap: var(--sp-3);
}

.brand-mark {
    color: var(--blue);
    display: inline-flex;
    align-items: center;
    transform: translateY(4px);
    filter: drop-shadow(0 0 4px rgba(90, 141, 255, 0.28));
}

.brand-name {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--text-strong);
}

.brand-sub {
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-subtle);
}

.hull-header-meta {
    display: flex;
    gap: var(--sp-2);
    align-items: center;
}

.lang-switch {
    display: inline-flex;
    gap: 4px;
    padding: 3px;
    border-radius: 999px;
    background: var(--surface-soft);
    box-shadow: var(--edge-hair);
}

.lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.lang-btn:hover {
    opacity: 0.9;
}

.lang-btn.active {
    opacity: 1;
    box-shadow: 0 0 0 1px rgba(95, 216, 255, 0.55), 0 0 6px rgba(95, 216, 255, 0.35);
    transform: translateY(-0.5px);
}

.lang-btn svg {
    display: block;
    border-radius: 2px;
}

.tag {
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--surface-soft);
    box-shadow: var(--edge-hair);
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.tag-accent {
    background: linear-gradient(135deg, rgba(95, 216, 255, 0.20), rgba(90, 141, 255, 0.14));
    color: var(--text-strong);
    box-shadow: inset 0 0 0 1px rgba(95, 216, 255, 0.32);
}


/* ---- 5. Buttons ---- */

.btn {
    --btn-bg: var(--panel);
    --btn-fg: var(--text-strong);
    --btn-glow: transparent;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: 10px 16px;
    border: 0;
    border-radius: var(--r-md);
    background: var(--btn-bg);
    color: var(--btn-fg);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.03em;
    cursor: pointer;
    box-shadow: var(--edge-inner), var(--edge-hair);
    transition:
        background var(--dur-1) var(--ease),
        box-shadow var(--dur-2) var(--ease),
        transform  var(--dur-1) var(--ease);
}

.btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #FFFFFF 0%, #EEF2F5 100%);
    box-shadow: var(--edge-inner), var(--edge-hair), var(--btn-glow);
}

.btn:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: var(--recess);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    --btn-bg: linear-gradient(180deg, #FFFFFF, #F0F5F9);
    --btn-glow: var(--glow-cyan);
}

.btn-accent {
    --btn-fg: #0E2340;
    --btn-bg: linear-gradient(180deg, #7FE4FF 0%, #5FD8FF 100%);
    --btn-glow: 0 0 0 3px rgba(95, 216, 255, 0.35), 0 8px 22px rgba(95, 216, 255, 0.30);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        inset 0 -1px 0 rgba(20, 90, 130, 0.12),
        0 6px 18px rgba(95, 216, 255, 0.26);
}

.btn-accent:hover:not(:disabled) {
    background: linear-gradient(180deg, #91EAFF 0%, #6FDEFF 100%);
}

.icon-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--r-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-soft);
    color: var(--text-muted);
    border: 0;
    cursor: pointer;
    box-shadow: var(--edge-inner), var(--edge-hair);
    transition:
        background var(--dur-1) var(--ease),
        color      var(--dur-1) var(--ease),
        box-shadow var(--dur-2) var(--ease);
}

.icon-btn:hover:not(:disabled) {
    color: var(--text-strong);
    background: #FFFFFF;
    box-shadow: var(--edge-inner), var(--edge-hair), var(--glow-cyan);
}

.icon-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}


/* ---- 6. Nav / chat list ---- */

.nav-label {
    font-size: 10px;
    letter-spacing: 0.20em;
    text-transform: uppercase;
    color: var(--text-subtle);
    padding: 0 var(--sp-3);
    margin-top: var(--sp-2);
}

#chat-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#chat-list li {
    padding: 10px var(--sp-3);
    border-radius: var(--r-sm);
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition:
        background var(--dur-1) var(--ease),
        color      var(--dur-1) var(--ease),
        box-shadow var(--dur-2) var(--ease);
}

#chat-list li:hover {
    background: var(--surface-soft);
}

#chat-list li.active {
    background: linear-gradient(90deg, rgba(95, 216, 255, 0.18), rgba(90, 141, 255, 0.10));
    color: var(--text-strong);
    box-shadow: inset 2px 0 0 var(--cyan);
}


/* ---- 7. Conversation head ---- */

.conv-head {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-4) var(--sp-5);
    border-bottom: 1px solid var(--border-hair);
}

.title-input {
    flex: 1;
    padding: 10px var(--sp-4);
    border: 0;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--text-strong);
    font-size: 16px;
    font-weight: 500;
    outline: none;
    transition:
        background var(--dur-1) var(--ease),
        box-shadow var(--dur-2) var(--ease);
}

.title-input::placeholder { color: var(--text-subtle); }
.title-input:hover        { background: var(--surface-soft); }

.title-input:focus {
    background: var(--surface-soft);
    box-shadow: var(--edge-hair), var(--glow-cyan);
}


/* ---- 8. Conversation body ---- */

.conv-body {
    position: relative;
    overflow: hidden;
    min-height: 0;
}

.watermark {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0.55;
    z-index: 0;
}

.watermark svg {
    width:  min(60vh, 480px);
    height: min(60vh, 480px);
    max-width: 60%;
    max-height: 80%;
}

.messages {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    padding: var(--sp-6);
    padding-inline: max(var(--sp-6), calc((100% - 860px) / 2));
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
    z-index: 1;
}


/* ---- 9. Messages ---- */

.msg {
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--r-md);
    line-height: 1.55;
    font-size: 14px;
    color: var(--text);
    max-width: 82%;
    white-space: pre-wrap;
    word-wrap: break-word;
    animation: msg-in var(--dur-2) var(--ease);
}

@keyframes msg-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0);   }
}

.msg.user {
    align-self: flex-end;
    color: #0E2340;
    background: linear-gradient(180deg, rgba(90, 141, 255, 0.16), rgba(90, 141, 255, 0.10));
    box-shadow:
        inset 0 0 0 1px rgba(90, 141, 255, 0.30),
        0 2px 12px rgba(90, 141, 255, 0.10);
}

.msg.assistant {
    align-self: flex-start;
    background: var(--panel);
    box-shadow: var(--edge-hair), var(--lift-1);
    position: relative;
}

.msg.assistant::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 2px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--cyan), var(--blue));
    box-shadow: 0 0 8px rgba(95, 216, 255, 0.40);
    opacity: 0.75;
}

.msg.system {
    align-self: center;
    background: transparent;
    color: var(--text-muted);
    font-style: italic;
    font-size: 12px;
    max-width: 100%;
}

.msg .role {
    display: block;
    font-size: 10px;
    opacity: 0.70;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}


/* ---- 10. Markdown inside assistant body ---- */

.msg.assistant .body { white-space: normal; display: block; }
.msg.assistant .body > *:first-child { margin-top: 0; }
.msg.assistant .body > *:last-child  { margin-bottom: 0; }

.msg.assistant .body p { margin: 0.4em 0; }

.msg.assistant .body h1,
.msg.assistant .body h2,
.msg.assistant .body h3,
.msg.assistant .body h4,
.msg.assistant .body h5,
.msg.assistant .body h6 {
    margin: 0.9em 0 0.3em;
    line-height: 1.25;
    color: var(--text-strong);
    letter-spacing: 0.005em;
    font-weight: 600;
}

.msg.assistant .body h1 { font-size: 1.35em; }
.msg.assistant .body h2 { font-size: 1.20em; }
.msg.assistant .body h3 { font-size: 1.08em; }
.msg.assistant .body h4,
.msg.assistant .body h5,
.msg.assistant .body h6 { font-size: 1em; }

.msg.assistant .body ul,
.msg.assistant .body ol { margin: 0.4em 0; padding-left: 1.5em; }
.msg.assistant .body li + li { margin-top: 0.2em; }

.msg.assistant .body code {
    background: rgba(95, 216, 255, 0.14);
    color: #0E2340;
    padding: 0.1em 0.4em;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.92em;
}

.msg.assistant .body pre {
    background: linear-gradient(180deg, #1B2130 0%, #171C29 100%);
    color: #E7EEF6;
    padding: 12px 14px;
    border-radius: var(--r-sm);
    overflow-x: auto;
    margin: 0.6em 0;
    line-height: 1.5;
    box-shadow:
        inset 0 0 0 1px rgba(95, 216, 255, 0.12),
        0 6px 18px rgba(32, 36, 42, 0.10);
}

.msg.assistant .body pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    font-size: 0.90em;
}

.msg.assistant .body blockquote {
    margin: 0.5em 0;
    padding: 0.3em 0.9em;
    border-left: 2px solid var(--cyan);
    color: var(--text-muted);
    background: var(--surface-soft);
    border-radius: 0 var(--r-xs) var(--r-xs) 0;
}

.msg.assistant .body a {
    color: var(--blue);
    text-decoration: none;
    border-bottom: 1px solid rgba(90, 141, 255, 0.35);
    transition: border-color var(--dur-1) var(--ease);
}

.msg.assistant .body a:hover { border-bottom-color: var(--blue); }

.msg.assistant .body table {
    border-collapse: separate;
    border-spacing: 0;
    margin: 0.5em 0;
    font-size: 0.95em;
    border-radius: var(--r-xs);
    overflow: hidden;
    box-shadow: 0 0 0 1px var(--border-hair);
}

.msg.assistant .body th,
.msg.assistant .body td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--border-hair);
    text-align: left;
}

.msg.assistant .body th { background: var(--surface-soft); font-weight: 600; }
.msg.assistant .body tr:last-child td { border-bottom: 0; }

.msg.assistant .body hr {
    border: 0;
    border-top: 1px solid var(--border-hair);
    margin: 0.9em 0;
}


/* ---- 11. Composer ---- */

.composer {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--sp-3);
    padding: var(--sp-4) var(--sp-5);
    border-top: 1px solid var(--border-hair);
    align-items: end;
}

.composer-input {
    min-height: 46px;
    padding: 12px 14px;
    border: 0;
    border-radius: var(--r-md);
    background: var(--surface-soft);
    color: var(--text-strong);
    resize: none;
    outline: none;
    box-shadow: var(--recess), var(--edge-hair);
    transition:
        box-shadow var(--dur-2) var(--ease),
        background var(--dur-1) var(--ease);
    font-family: inherit;
}

.composer-input::placeholder { color: var(--text-subtle); }

.composer-input:focus {
    background: #FFFFFF;
    box-shadow: var(--recess), var(--edge-hair), var(--glow-cyan);
}

.composer-input:disabled { opacity: 0.6; cursor: not-allowed; }

#send {
    padding: 12px 22px;
    height: 46px;
}


/* ---- 12. Aside / status cards ---- */

.card {
    border-radius: var(--r-md);
    background: var(--panel);
    padding: var(--sp-4);
    box-shadow: var(--edge-inner), var(--edge-hair);
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--sp-3);
}

.card-label {
    font-size: 10px;
    letter-spacing: 0.20em;
    text-transform: uppercase;
    color: var(--text-subtle);
}

.metrics {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.metric {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--r-xs);
    background: var(--surface-soft);
}

.metric-key {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.06em;
}

.metric-val {
    flex-shrink: 0;
    text-align: right;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-strong);
    font-variant-numeric: tabular-nums;
}

.metric-val.alert {
    color: var(--danger, #ff6b6b);
    text-shadow: 0 0 6px rgba(255, 107, 107, 0.35);
}

.msg .body.body-error {
    color: var(--danger, #ff6b6b);
    font-style: italic;
}

.info-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 12px;
    margin: 10px 0 0 0;
    padding: 0;
}

.info-list dt {
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.info-list dd {
    margin: 0;
    text-align: right;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-strong);
    font-variant-numeric: tabular-nums;
    word-break: break-all;
}

.metric-spark {
    flex-grow: 1;
    height: 14px;
    max-width: 90px;
    min-width: 30px;
    align-self: center;
    opacity: 0.85;
}

.metric-spark polyline {
    fill: none;
    stroke: var(--cyan);
    stroke-width: 1.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

/* Per-metric hue so five stacked sparklines aren't a wall of cyan.
 * Each colour also gets a matching drop-shadow so the glow reads
 * against the darker aside background. */
#spark-watts polyline { stroke: #5FD8FF; filter: drop-shadow(0 0 3px rgba(95, 216, 255, 0.55)); }
#spark-temp  polyline { stroke: #FF8B6B; filter: drop-shadow(0 0 3px rgba(255, 139, 107, 0.55)); }
#spark-ram   polyline { stroke: #7BE58B; filter: drop-shadow(0 0 3px rgba(123, 229, 139, 0.50)); }
#spark-gpu   polyline { stroke: #B6A6FF; filter: drop-shadow(0 0 3px rgba(182, 166, 255, 0.55)); }
#spark-perf  polyline { stroke: #FFD66B; filter: drop-shadow(0 0 3px rgba(255, 214, 107, 0.55)); }


/* ---- 13. Pills / status ---- */

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    background: var(--surface-soft);
    color: var(--text-muted);
    box-shadow: var(--edge-hair);
    transition:
        color      var(--dur-1) var(--ease),
        background var(--dur-1) var(--ease),
        box-shadow var(--dur-2) var(--ease);
}

.pill::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 6px currentColor;
}

.pill[data-state="ok"] {
    color: #0E7A9A;
    background: var(--cyan-soft);
    box-shadow: inset 0 0 0 1px rgba(95, 216, 255, 0.36);
}

.pill[data-state="throttling"] {
    color: #8A5A00;
    background: var(--amber-soft);
    box-shadow: inset 0 0 0 1px rgba(255, 190, 77, 0.44);
}

.pill[data-state="critical"] {
    color: #B84A2E;
    background: rgba(255, 118, 84, 0.16);
    box-shadow: inset 0 0 0 1px rgba(255, 118, 84, 0.36);
}

.pill[data-state="unknown"] {
    color: var(--text-muted);
}


/* ---- 14. Footer ---- */

.status      { font-size: 12px; color: var(--text-muted); }
.status.error{ color: var(--warn); }

.footer-meta {
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-subtle);
}

.model-label {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-strong);
    letter-spacing: 0;
    word-break: break-all;
}


/* ---- 15. Prefill placeholder (inside assistant bubble) ---- */

.prefill-saying {
    display: block;
    font-style: italic;
    color: var(--text-muted);
    font-size: 14px;
    letter-spacing: 0.005em;
    animation: prefill-pulse 1.8s ease-in-out infinite;
}

.prefill-progress {
    display: block;
    margin-top: var(--sp-2);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-subtle);
    letter-spacing: 0.06em;
    font-variant-numeric: tabular-nums;
}

@keyframes prefill-pulse {
    0%, 100% { opacity: 0.65; }
    50%      { opacity: 1.00; }
}


/* ---- 16. Astronaut mascot (aside footer) ---- */

.astro-card {
    padding: var(--sp-3);
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(80% 60% at 50% 90%, rgba(95, 216, 255, 0.14) 0%, rgba(95, 216, 255, 0) 70%),
        var(--panel);
    box-shadow: var(--edge-inner), var(--edge-hair);
    border-radius: var(--r-md);
    min-height: 200px;
    margin-top: auto; /* pin to the bottom of the aside */
}

.astronaut {
    width: 180px;
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 6px 14px rgba(32, 36, 42, 0.10));
}


/* ---- 17. Sending state ---- */
/* Composer stays fully interactive while jobs are pending — the
 * backend queue accepts more submissions in parallel. No opacity
 * dimming, no visual "greyed out" cue. */


/* ---- 18. Scrollbars ---- */

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(101, 112, 124, 0.28) transparent;
}

*::-webkit-scrollbar        { width: 8px; height: 8px; }
*::-webkit-scrollbar-track  { background: transparent; }
*::-webkit-scrollbar-thumb  {
    background: rgba(101, 112, 124, 0.24);
    border-radius: 999px;
}
*::-webkit-scrollbar-thumb:hover {
    background: rgba(101, 112, 124, 0.38);
}


/* ---- 19. Small viewports ---- */

@media (max-width: 960px) {
    .hull {
        grid-template-columns: 1fr;
        grid-template-rows: 64px auto 1fr 40px;
        grid-template-areas:
            "hdr"
            "nav"
            "main"
            "ftr";
        height: auto;
        min-height: 100vh;
        overflow: auto;
    }

    body { overflow: auto; }

    .hull-aside { display: none; }

    .hull-nav {
        max-height: 180px;
    }
}


/* ---- 20. Reduced motion ---- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration:  0ms !important;
        transition-duration: 0ms !important;
    }
}