/* SATELLITES Portal
 * Font stack: 'IBM Plex Mono', ui-monospace, monospace
 * Web font: https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;700&display=swap
 *   (loaded from pages/templates/head.html)
 * Aligned with satellites-v3 portal.css and satellites-v3/pages/partials/head.html
 * for v3 typography parity (story_797fbb95).
 *
 * No border-radius, no box-shadow.
 *
 * Theme tokens (story_5dd7167a). The body rule reads from the variables
 * below; [data-theme="dark"] overrides flip every chrome rule that uses
 * --color-fg / --color-bg / --color-border. The :root values are the
 * light defaults so a no-cookie no-JS reader still gets something.
 */

:root {
    --color-fg: #000;
    --color-bg: #fff;
    --color-border: #000;
    --color-muted: #888;
    --color-fg-inverse: #fff;
    --color-bg-inverse: #000;
    --color-input-bg: #fff;
    --color-input-fg: #000;

    /* Typography tokens (story_2469358b). One font-size for every
       interactive control (input/select/textarea/dropdown trigger
       button/dropdown menu item) so the bar reads as one strip and
       longer labels grow controls vertically rather than horizontally. */
    --font-size-control: 0.75rem;
    --control-padding-y: 0.4rem;
    --control-padding-x: 0.6rem;
}

[data-theme="dark"] {
    --color-fg: #e8e8e8;
    --color-bg: #0d0d0d;
    --color-border: #e8e8e8;
    --color-muted: #888;
    --color-fg-inverse: #0d0d0d;
    --color-bg-inverse: #e8e8e8;
    --color-input-bg: #1a1a1a;
    --color-input-fg: #e8e8e8;
}

[x-cloak] {
    display: none !important;
}

/* x-show workaround for @alpinejs/csp 3.13.7+ x-show reactivity bug
 * (epic:portal-csp-strict, story_739823eb). Bindings that would have
 * been x-show="X" are written :class="hiddenWhenX" with a getter
 * returning '' or 'is-hidden'. The static class on the element also
 * carries `is-hidden` so first paint is hidden without x-cloak.
 */
.is-hidden {
    display: none !important;
}

/* === RESET === */

* {
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    background: var(--color-bg);
    color: var(--color-fg);
}

body {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    font-size: 0.875rem;
}

::selection {
    background: var(--color-fg);
    color: var(--color-bg);
}

:focus-visible {
    outline: 3px solid var(--color-fg);
    outline-offset: 2px;
}

a {
    color: var(--color-fg);
    text-decoration: underline;
}

a:hover {
    color: var(--color-muted);
}

/* portal-main: centered content primitive used by login, landing, and any
 * page that wants its content horizontally centered with a max width.
 * (story_5dd7167a AC5).
 */
.portal-main {
    flex: 1;
    width: 100%;
    max-width: 90%;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Theme picker (story_5dd7167a AC2). Three-segment control sized to fit
 * inside the nav dropdown. The active state is rendered with the inverse
 * colour pair so the choice is unambiguous in either palette.
 */
.theme-picker {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    border: 1px solid var(--color-border);
    padding: 0.15rem;
    margin: 0.25rem 0;
}
.theme-picker-btn {
    flex: 1;
    background: var(--color-bg);
    color: var(--color-fg);
    border: none;
    padding: var(--control-padding-y) var(--control-padding-x);
    font-family: inherit;
    font-size: var(--font-size-control);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
}
.theme-picker-btn[aria-pressed="true"] {
    background: var(--color-bg-inverse);
    color: var(--color-fg-inverse);
}
.theme-picker-btn:hover:not([aria-pressed="true"]) {
    background: var(--color-fg);
    color: var(--color-bg);
}

/* Landing page (story_92210e4a). Dark-first hero with v3-style 01/02/03
 * grid. Inherits .portal-main centering and theme tokens. */

.landing-screen {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding-top: 3rem;
    max-width: 720px;
}

.landing-hero {
    text-align: center;
    margin-bottom: 1rem;
}

.landing-wordmark {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    margin-bottom: 0.5rem;
    color: var(--color-fg);
}

.landing-subhead {
    color: var(--color-fg);
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

.landing-providers {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-provider {
    display: block;
    text-align: center;
    padding: 0.85rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-decoration: none;
    border: 1px solid var(--color-border);
}

.btn-provider-primary {
    background: var(--color-bg-inverse);
    color: var(--color-fg-inverse);
}

.btn-provider-secondary {
    background: var(--color-bg);
    color: var(--color-fg);
}

.btn-provider:hover {
    opacity: 0.85;
}

.landing-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--color-muted);
    font-size: 0.8125rem;
}

.landing-divider::before,
.landing-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--color-muted);
    opacity: 0.4;
}

.landing-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.landing-form label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-fg);
}

.landing-form input {
    width: 100%;
    padding: 0.75rem;
    background: var(--color-input-bg);
    color: var(--color-input-fg);
    border: 1px solid var(--color-border);
    font-family: inherit;
    font-size: 0.875rem;
}

.landing-submit {
    background: var(--color-bg-inverse);
    color: var(--color-fg-inverse);
    border: none;
    padding: 0.85rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    cursor: pointer;
}
.landing-submit:hover { opacity: 0.85; }

.landing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    border-top: 2px solid var(--color-border);
    padding-top: 2rem;
    margin-top: 1rem;
}

@media (max-width: 48rem) {
    .landing-grid { grid-template-columns: 1fr; }
}

.landing-panel {
    border: 1px solid var(--color-border);
    padding: 1.25rem;
}

.landing-panel-title {
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
    color: var(--color-fg);
}

.landing-panel-body {
    color: var(--color-fg);
    opacity: 0.8;
    font-size: 0.8125rem;
}

.landing-footer {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}
.landing-footer .theme-picker { width: 12rem; }

/* Dev-mode quick-signin button + DEV chip (story_7105204f). */
.landing-devmode-form { margin-top: 0.5rem; }
.landing-devmode-btn {
    background: var(--color-bg);
    color: var(--color-fg);
    border: 1px dashed var(--color-border);
}
.nav-dev-chip {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    margin-left: 0.5rem;
    border: 1px solid var(--color-border);
    background: var(--color-bg-inverse);
    color: var(--color-fg-inverse);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.15em;
}
/* GLOBAL ADMIN chip (story_3548cde2). Renders when a global_admin is
   acting on a workspace they are not a member of. Sits next to the DEV
   chip in the nav strip; uses an accent border so the cross-tenancy
   signal is unmistakable without being alarming. */
.nav-global-admin-chip {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    margin-left: 0.5rem;
    border: 1px solid #c0392b;
    color: #c0392b;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.15em;
}

/* Hamburger menu (story_e7e8b455). Replaces the inline logout form. */
.nav-hamburger-wrap { position: relative; margin-left: 0.5rem; }
.nav-hamburger {
    background: transparent;
    color: var(--color-fg);
    border: 1px solid var(--color-border);
    padding: 0.2rem 0.6rem;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
}
/* Non-inverting hover: keep the button transparent, lift the border to the
   primary fg so the change is legible on dark theme without flashing white
   (story_cffd92d4). */
.nav-hamburger:hover {
    background: transparent;
    color: var(--color-fg);
    border-color: var(--color-fg);
}
.nav-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.25rem;
    min-width: 14rem;
    padding: 0.5rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.nav-dropdown-user {
    font-size: 0.75rem;
    color: var(--color-muted);
    border-bottom: 1px solid var(--color-muted);
    padding-bottom: 0.4rem;
}
.nav-dropdown-section { display: flex; flex-direction: column; }
.nav-dropdown-form { margin: 0; }
.nav-dropdown-logout {
    width: 100%;
    background: var(--color-bg-inverse);
    color: var(--color-fg-inverse);
    border: none;
    padding: 0.5rem;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
}
.nav-dropdown-logout:hover { opacity: 0.85; }


/* ============================================================
   LAYOUT
   ============================================================ */

.page {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.page-body {
    flex: 1;
    max-width: 90%;
    margin: 0 auto;
    width: 100%;
    padding: 2rem 1.5rem;
}

.page-body-fluid {
    flex: 1;
    width: 100%;
    padding: 2rem 1.5rem;
}


/* ============================================================
   NAVIGATION
   ============================================================ */

.nav {
    border-bottom: 2px solid #000;
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
}

.nav-inner {
    max-width: 90%;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-brand {
    font-size: 1.125rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.1em;
}

.nav-project-focus {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #000;
    text-decoration: none;
    border: 1px solid #000;
    padding: 0.15rem 0.5rem;
    margin-left: 0.75rem;
}
.nav-project-focus:hover { background: #000; color: #fff; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
    margin-left: auto;
}

.nav-links a {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    color: #000;
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
    border-bottom-color: #000;
    color: #000;
}

@media (max-width: 48rem) {
    .nav-links { display: none; }
}

/* Workspace switcher (story_4d1ef14f). The trigger button reuses the
   .nav-links typography so the bar reads as one strip; the dropdown is
   absolutely positioned so opening it never reflows the nav row. */
.nav-workspace {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: 1rem;
}

.btn-link {
    background: transparent;
    border: 0;
    padding: var(--control-padding-y) var(--control-padding-x);
    margin: 0;
    font: inherit;
    font-size: var(--font-size-control);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: inherit;
    cursor: pointer;
}

.nav-workspace .btn-link:hover { text-decoration: underline; }

.nav-workspace-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin: 0.25rem 0 0 0;
    padding: 0.25rem 0;
    list-style: none;
    background: #fff;
    border: 1px solid #000;
    min-width: 14rem;
    z-index: 50;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.nav-workspace-menu li { margin: 0; }

.nav-workspace-menu a {
    display: block;
    padding: var(--control-padding-y) var(--control-padding-x);
    text-decoration: none;
    color: #000;
    font-size: var(--font-size-control);
    letter-spacing: 0.05em;
}

.nav-workspace-menu a:hover { background: #f5f5f5; }
.nav-workspace-menu a[aria-current="true"] { font-weight: 700; }

.nav-workspace-empty {
    padding: var(--control-padding-y) var(--control-padding-x);
    color: #888;
    font-size: var(--font-size-control);
    letter-spacing: 0.05em;
    font-style: italic;
}


/* ============================================================
   FOOTER
   ============================================================ */

.footer {
    border-top: 2px solid #000;
    padding: 1rem 1.5rem;
}

.footer-inner {
    max-width: 90%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.footer-text {
    font-size: 0.75rem;
    color: var(--color-muted);
    letter-spacing: 0.1em;
}

/* sty_558c0431 — three-slot footer (left identity / middle uptime /
   right status badges). Slots are flex children sized by content; the
   status slot grows to host additional badges as the registry adds
   them. The badges follow the V3 colour rules (ok=green, amber, error,
   muted). */
.footer-slot { display: flex; align-items: center; gap: 0.5rem; }
.footer-slot-left { flex: 0 0 auto; }
.footer-slot-mid { flex: 0 0 auto; opacity: 0.85; }
.footer-slot-right { flex: 0 0 auto; gap: 0.4rem; flex-wrap: wrap; justify-content: flex-end; }

.footer-status-badge {
    display: inline-flex;
    align-items: baseline;
    gap: 0.25rem;
    font-size: 0.65rem;
    letter-spacing: 0.05em;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    border: 1px solid currentColor;
}
.footer-status-label { text-transform: uppercase; opacity: 0.8; }
.footer-status-value { font-weight: 700; }

.footer-status-badge.is-ok { color: #2d5b3a; background: rgba(76, 169, 122, 0.12); border-color: #4ca97a; }
.footer-status-badge.is-amber { color: #774400; background: rgba(212, 146, 42, 0.15); border-color: #d4922a; }
.footer-status-badge.is-error { color: #842029; background: rgba(176, 42, 55, 0.12); border-color: #b02a37; }
.footer-status-badge.is-muted { color: var(--color-muted); background: transparent; border-color: var(--color-muted); }

[data-theme="dark"] .footer-status-badge.is-ok { color: #b8d8c0; background: rgba(76, 169, 122, 0.18); }
[data-theme="dark"] .footer-status-badge.is-amber { color: #e0c898; background: rgba(212, 146, 42, 0.2); }
[data-theme="dark"] .footer-status-badge.is-error { color: #f4a8b1; background: rgba(176, 42, 55, 0.18); }

.footer a {
    color: #000;
    font-weight: 700;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}


/* ============================================================
   FORMS
   ============================================================ */

input, select, textarea {
    background: #fff;
    color: #000;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: var(--font-size-control);
    padding: var(--control-padding-y) var(--control-padding-x);
    border: 2px solid #000;
}

input:focus, textarea:focus {
    outline: none;
    border-color: #555;
}

select:focus {
    background-color: #1a1a2e;
    color: #fff;
    outline: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23fff'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
}

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23000'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    padding-right: 1.5rem;
    cursor: pointer;
}

select option {
    background: #1a1a2e;
    color: #e0e0e0;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    padding: 0.3rem 0.5rem;
}

select option:checked {
    background: #2a2a3e;
    color: #fff;
}

select option:hover {
    background: #2a2a3e;
}

input:disabled, select:disabled, textarea:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.8125rem;
    border: 2px solid #000;
    background: #fff;
    color: #000;
    outline: none;
}

.form-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23000'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
    cursor: pointer;
}

.form-input:focus,
.form-textarea:focus {
    border-color: #555;
}

.form-select:focus {
    background-color: #1a1a2e;
    color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23fff'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
}


/* ============================================================
   TYPOGRAPHY
   ============================================================ */

.section-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
}

.label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #888;
    margin-bottom: 0.5rem;
}

.text-muted {
    color: #888;
}

.text-sm {
    font-size: 0.8125rem;
}

.text-bold {
    font-weight: 700;
}


/* ============================================================
   HAMBURGER MENU
   ============================================================ */

.nav-hamburger-wrap {
    position: relative;
}

.nav-hamburger {
    display: block;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-hamburger-icon {
    display: block;
    width: 22px;
    height: 2px;
    background: #000;
    position: relative;
}

.nav-hamburger-icon::before,
.nav-hamburger-icon::after {
    content: '';
    display: block;
    width: 22px;
    height: 2px;
    background: #000;
    position: absolute;
    left: 0;
}

.nav-hamburger-icon::before { top: -6px; }
.nav-hamburger-icon::after  { top:  6px; }

.nav-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 2px solid #000;
    min-width: 160px;
    z-index: 200;
}

.nav-dropdown a,
.nav-dropdown-logout {
    display: block;
    width: 100%;
    padding: 0.6rem 1rem;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    color: #000;
    border: none;
    border-bottom: 1px solid #888;
    background: none;
    cursor: pointer;
    text-align: left;
}

.nav-dropdown a:last-child,
.nav-dropdown-logout {
    border-bottom: none;
}

.nav-dropdown a:hover,
.nav-dropdown-logout:hover {
    background: #000;
    color: #fff;
}

.nav-dropdown a.nav-admin-item,
.mobile-menu a.nav-admin-item {
    background: #fee2e2;
}

.nav-dropdown a.nav-admin-item:hover,
.mobile-menu a.nav-admin-item:hover {
    background: #7f1d1d;
}


/* ============================================================
   MOBILE MENU
   ============================================================ */

.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.25);
    z-index: 299;
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 260px;
    height: 100vh;
    background: #fff;
    border-left: 2px solid #000;
    z-index: 300;
    padding: 1.5rem;
}

.mobile-menu-close {
    display: block;
    background: none;
    border: none;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 1.25rem;
    cursor: pointer;
    margin-bottom: 1.5rem;
}

.mobile-menu a {
    display: block;
    padding: 0.6rem 0;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    color: #000;
    border-bottom: 1px solid #888;
}


/* ============================================================
   PANELS
   ============================================================ */

.panel-headed {
    border: 1px solid #000;
    margin-bottom: 1.5rem;
}

.panel-header {
    background: #000;
    color: #fff;
    padding: 0.6rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.panel-body {
    padding: 1rem 1.25rem;
}

/* /config system-* panels (story_64935bc0). V3-style table layout with
   click-to-expand sub-rows. Click a `tr.system-doc-row` to toggle the
   adjacent `tr.system-doc-expansion` (Alpine x-show). Subtle green pills
   for category/scope/status reuse the agent-canonical-pill palette. */
.system-doc-table .system-doc-row {
    cursor: pointer;
}
.system-doc-table .system-doc-row:hover {
    background: #f5f5f5;
}
.system-doc-table .system-doc-expansion > td {
    background: #fafafa;
    padding: 0.75rem 1rem;
}
.system-doc-section {
    margin-bottom: 0.75rem;
}
.system-doc-section:last-child {
    margin-bottom: 0;
}
.system-doc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.7rem;
}
.system-doc-body {
    white-space: pre-wrap;
    font-size: 0.75rem;
    margin: 0.25rem 0;
    padding: 0.4rem 0.6rem;
    background: #fff;
    border: 1px solid #e0e0e0;
}

.scope-pill, .category-pill, .status-pill {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: #eaf5ec;
    color: #2d5b3a;
    border: 1px solid #4ca97a;
}

[data-theme="dark"] .system-doc-table .system-doc-row:hover {
    background: #1a1a1a;
}
[data-theme="dark"] .system-doc-table .system-doc-expansion > td {
    background: #0f0f0f;
}
[data-theme="dark"] .system-doc-body {
    background: #050505;
    border-color: #222;
}
[data-theme="dark"] .scope-pill,
[data-theme="dark"] .category-pill,
[data-theme="dark"] .status-pill {
    background: #142013;
    color: #b8d8c0;
    border-color: #4ca97a;
}

/* Compact panel body for empty-state banners (story_dda346f9). Used on
   /config when no Configurations exist so two short lines don't take
   the full panel-body padding. */
.panel-body-compact {
    padding: 0.4rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* /config selector form (story_9fd0b9de). Lays out the label + select
   inline with breathing room, and adds bottom-margin so the muted
   helper paragraph below doesn't collide. */
.config-selector-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.config-selector-form label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Stories list (story_59b11d8c). Header carries the (n / total) count and
   a refresh affordance; body holds the search input, filter chips, and
   the sortable column table. */
.stories-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stories-count {
    font-weight: 400;
    margin-left: 0.5rem;
    opacity: 0.85;
}

.stories-back-link {
    margin: 0 0 0.75rem 0;
}

.stories-search-form {
    margin-bottom: 0.75rem;
}

.stories-search-input {
    width: 100%;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-fg);
    padding: 0.55rem 0.75rem;
    font-family: inherit;
    font-size: var(--font-size-control);
}

.stories-search-input:focus {
    outline: none;
    border-color: var(--color-fg);
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    border: 1px solid var(--color-border);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
}

.filter-chip-clear {
    color: var(--color-fg);
    text-decoration: none;
    font-weight: 700;
    line-height: 1;
}

.filter-chip-clear:hover {
    text-decoration: none;
    opacity: 0.7;
}

.btn-icon {
    display: inline-block;
    padding: 0.25rem 0.55rem;
    color: inherit;
    text-decoration: none;
    border: 1px solid currentColor;
    font-size: 0.9rem;
    line-height: 1;
}

.btn-icon:hover {
    opacity: 0.8;
}

.stories-table {
    margin-top: 0.5rem;
}

.stories-table th a {
    color: inherit;
    text-decoration: none;
}

.stories-table th a:hover {
    text-decoration: underline;
}

.stories-table .col-select { width: 2rem; }
.stories-table .col-id { width: 9rem; }
.stories-table .col-pts { width: 3rem; text-align: right; }
.stories-table .col-created,
.stories-table .col-updated { width: 11rem; white-space: nowrap; }

.stories-tag-row {
    margin-top: 0.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.stories-title-link {
    font-weight: 700;
    text-decoration: none;
    color: inherit;
}

.stories-title-link:hover {
    text-decoration: underline;
}

.cell-pill {
    border: 1px solid var(--color-border);
    padding: 0.05rem 0.4rem;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.panel-actions {
    margin: 0 0 0.5rem 0;
    font-size: 0.85rem;
}

/* story_25695308 — every panel-headed section gains a click-target
   header that toggles its body. The body uses x-show/Alpine; the
   .section-collapsed class is also toggled on the section element so
   the absence of a body-frame doesn't leave a stray bottom border. */
.panel-header.section-toggle {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-header.section-toggle .section-toggle-caret {
    margin-left: 0.4rem;
    font-size: 0.7rem;
}

.section-collapsed > .panel-body {
    display: none !important;
}

.panel-content {
    padding: 1rem;
}

.metric-box {
    background: #1a1a2e;
    border: 1px solid #333;
    padding: 0.6rem 0.8rem;
    color: #e0e0e0;
}

.metric-box .text-muted {
    color: #aaa;
}


/* ============================================================
   DATA TABLES
   ============================================================ */

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #888;
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 2px solid #000;
    white-space: nowrap;
}

.data-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #eee;
    font-size: 0.8125rem;
}

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

.data-table a {
    color: #000;
}

/* Document thumbnails */
.doc-thumb {
    max-height: 48px;
    max-width: 80px;
    object-fit: contain;
    cursor: pointer;
    border: 1px solid #eee;
}

.doc-thumb:hover {
    border-color: #888;
}

/* Lightbox overlay */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: pointer;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    cursor: default;
}

/* ============================================================
   STATUS BADGES
   ============================================================ */

.status-badge {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.15rem 0.5rem;
    border: 1px solid #000;
}

.status-pending   { color: #888; border-color: #888; }
.status-running   { color: #fff; background: #000; }
.status-completed { color: #000; border-color: #000; }
.status-success   { color: #4ade80; border-color: #4ade80; background: rgba(74, 222, 128, 0.1); }
.status-passed    { color: #4ade80; border-color: #4ade80; background: rgba(74, 222, 128, 0.1); }
.status-failed    { color: #ef4444; border-color: #ef4444; background: rgba(239, 68, 68, 0.1); }
.status-skipped   { color: #888; border-color: #888; }
.status-cancelled { color: #888; border-color: #888; }

/* Story statuses */
.status-backlog       { color: #888; border-color: #888; }
.status-ready         { color: #6a9fb5; border-color: #6a9fb5; }
.status-in_progress   { color: #d4a017; border-color: #d4a017; }
.status-done          { color: #4ade80; border-color: #4ade80; background: rgba(74, 222, 128, 0.1); }
.status-blocked       { color: #ef4444; border-color: #ef4444; }
.status-failed        { color: #ef4444; border-color: #ef4444; background: rgba(239, 68, 68, 0.1); }

/* Project statuses */
.status-active    { color: #4ade80; border-color: #4ade80; background: rgba(74, 222, 128, 0.1); }
.status-available { color: #4ade80; border-color: #4ade80; background: transparent; }
.status-deprecated { color: #a0522d; border-color: #a0522d; background: rgba(160, 82, 45, 0.1); text-decoration: line-through; }
.status-disabled  { color: #888; border-color: #888; }
.status-inactive  { color: #888; border-color: #888; }

/* Priority statuses */
.status-critical { color: #ef4444; border-color: #ef4444; }
.status-high     { color: #e07c3e; border-color: #e07c3e; }
.status-medium   { color: #d4a017; border-color: #d4a017; }
.status-low      { color: #888; border-color: #888; }


/* Live indicator pulse */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ============================================================
   CODE BLOCKS
   ============================================================ */

.code-block {
    background: #fff;
    color: #000;
    border: 2px solid #000;
    padding: 1rem;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.8125rem;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre;
}

code {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.8125rem;
}


/* ============================================================
   TOASTS
   ============================================================ */

.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: #fff;
    border: 2px solid #000;
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    min-width: 200px;
    max-width: 360px;
}

.toast-dark {
    background: #000;
    color: #fff;
}

/* ============================================================
   HELP PAGE
   ============================================================ */

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 0.35rem;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.btn {
    display: inline-block;
    border: 2px solid #000;
    padding: 0.5rem 1.25rem;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
}

.btn-primary {
    background: #000;
    color: #fff;
}

.btn-primary:hover {
    background: #fff;
    color: #000;
}

.btn-secondary {
    background: transparent;
    color: #000;
    border: 2px solid #000;
    padding: 0.5rem 1.25rem;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #f5f5f5;
}

.btn-sm {
    display: inline-block;
    border: 1px solid #000;
    padding: 0.15rem 0.4rem;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.7rem;
    cursor: pointer;
    background: transparent;
    color: #000;
}

.btn-sm:hover {
    background: #f5f5f5;
}

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

.btn-refresh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #888;
    border-radius: 50%;
    width: 1.4rem;
    height: 1.4rem;
    font-size: 0.9rem;
    cursor: pointer;
    background: transparent;
    color: #888;
    padding: 0;
    line-height: 1;
    transition: transform 0.3s;
}
.btn-refresh:hover {
    color: #000;
    border-color: #000;
}
.btn-refresh:active {
    transform: rotate(360deg);
}

.btn-danger {
    background: #c0392b;
    color: #fff;
    border-color: #a93226;
}

.btn-danger:hover {
    background: #e74c3c;
    border-color: #c0392b;
}

.danger-zone {
    border: 1px solid #c0392b;
    border-radius: 4px;
    padding: 1rem;
    margin-top: 1rem;
}

.danger-zone-label {
    color: #c0392b;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

/* ============================================================
   DROP ZONE
   ============================================================ */

.drop-zone {
    border: 2px dashed #888;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    font-size: 0.8125rem;
    transition: border-color 0.15s, background 0.15s;
}

.drop-zone:hover,
.drop-zone-active {
    border-color: #000;
    background: #f5f5f5;
}

.help-support-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.help-support-contact {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.help-feedback-form {
    margin-top: 0.5rem;
}

.feedback-id {
    cursor: pointer;
    font-size: 0.75rem;
    color: #888;
    border-bottom: 1px dashed #888;
}

.feedback-id:hover {
    color: #000;
    border-bottom-color: #000;
}

.help-loading {
    padding: 1.5rem;
    text-align: center;
    color: #888;
    font-size: 0.8125rem;
    letter-spacing: 0.1em;
}

.badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1px solid #000;
}

.badge-filled {
    background: #000;
    color: #fff;
}

.badge-muted {
    color: #888;
    border-color: #888;
}

.badge-critical {
    color: #c00;
    border-color: #c00;
}

.badge-warning {
    color: #b60;
    border-color: #b60;
}

.badge-success {
    color: #080;
    border-color: #080;
}

.feedback-desc {
    white-space: normal;
    word-wrap: break-word;
    max-width: 30rem;
    line-height: 1.5;
}

/* ============================================================
   CHANGELOG PAGE
   ============================================================ */

.changelog-meta {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.changelog-heading {
    font-size: 0.9375rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.changelog-body {
    white-space: pre-wrap;
    font-size: 0.8125rem;
    line-height: 1.7;
    color: #000;
}

/* ============================================================
   PAGINATION
   ============================================================ */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.filter-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eee;
}

.filter-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #888;
}

.filter-toggle input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    border: 2px solid #000;
    cursor: pointer;
}

/* Toggle switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 2.5rem;
    height: 1.25rem;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-track {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ccc;
    border: 2px solid #000;
    transition: background 0.2s;
}

.toggle-track::after {
    content: "";
    position: absolute;
    width: 0.75rem;
    height: 0.75rem;
    left: 0.125rem;
    top: 50%;
    transform: translateY(-50%);
    background: #000;
    transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-track {
    background: #000;
}

.toggle-switch input:checked + .toggle-track::after {
    background: #fff;
    transform: translateY(-50%) translateX(1.25rem);
}


/* ============================================================
   DARK MODE
   ============================================================ */

[data-theme="dark"] {
    color-scheme: dark;
}

[data-theme="dark"] body {
    background: #111;
    color: #e0e0e0;
}

[data-theme="dark"] ::selection {
    background: #e0e0e0;
    color: #111;
}

[data-theme="dark"] a {
    color: #e0e0e0;
}

[data-theme="dark"] a:hover {
    color: #888;
}

/* Nav */
[data-theme="dark"] .nav {
    background: #111;
    border-bottom-color: #e0e0e0;
}

[data-theme="dark"] .nav-brand,
[data-theme="dark"] .nav-links a {
    color: #e0e0e0;
}

[data-theme="dark"] .nav-links a:hover,
[data-theme="dark"] .nav-links a.active {
    border-bottom-color: #e0e0e0;
    color: #e0e0e0;
}

[data-theme="dark"] .nav-project-focus {
    color: #e0e0e0;
    border-color: #e0e0e0;
}

[data-theme="dark"] .nav-project-focus:hover {
    background: #e0e0e0;
    color: #111;
}

/* Workspace switcher (story_4d1ef14f) — dark-theme. */
[data-theme="dark"] .nav-workspace-menu {
    background: #1a1a1a;
    border-color: #e0e0e0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
[data-theme="dark"] .nav-workspace-menu a { color: #e0e0e0; }
[data-theme="dark"] .nav-workspace-menu a:hover { background: #2a2a2a; }
[data-theme="dark"] .nav-workspace-empty { color: #888; }

/* Hamburger */
[data-theme="dark"] .nav-hamburger-icon,
[data-theme="dark"] .nav-hamburger-icon::before,
[data-theme="dark"] .nav-hamburger-icon::after {
    background: #e0e0e0;
}

[data-theme="dark"] .nav-dropdown {
    background: #111;
    border-color: #e0e0e0;
}

[data-theme="dark"] .nav-dropdown a,
[data-theme="dark"] .nav-dropdown-logout {
    color: #e0e0e0;
    border-bottom-color: #444;
}

[data-theme="dark"] .nav-dropdown a:hover,
[data-theme="dark"] .nav-dropdown-logout:hover {
    background: #e0e0e0;
    color: #111;
}

[data-theme="dark"] .mobile-menu {
    background: #111;
    border-left-color: #e0e0e0;
}

[data-theme="dark"] .mobile-menu a {
    color: #e0e0e0;
    border-bottom-color: #444;
}

[data-theme="dark"] .nav-dropdown a.nav-admin-item,
[data-theme="dark"] .mobile-menu a.nav-admin-item {
    color: #000;
}

/* Footer */
[data-theme="dark"] .footer {
    border-top-color: #e0e0e0;
}

[data-theme="dark"] .footer a {
    color: #e0e0e0;
}

/* Panels */
[data-theme="dark"] .panel-headed {
    border-color: #e0e0e0;
}

[data-theme="dark"] .panel-header {
    background: #333;
    color: #e0e0e0;
}

[data-theme="dark"] .panel-content {
    background: #111;
}

/* Tables */
[data-theme="dark"] .data-table th {
    border-bottom-color: #e0e0e0;
}

[data-theme="dark"] .data-table td {
    border-bottom-color: #333;
}

[data-theme="dark"] .data-table a {
    color: #e0e0e0;
}

/* Forms */
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    /* longhand background-color so the inherited background-image,
       background-repeat, and background-position from the base
       `select { ... }` rule survive (story_e5efcb6d). The shorthand
       `background:` would reset background-repeat to the default
       `repeat`, tiling the select's caret SVG across the control. */
    background-color: #111;
    color: #e0e0e0;
    border-color: #e0e0e0;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus {
    border-color: #888;
}

[data-theme="dark"] select:focus {
    background-color: #e0e0e0;
    color: #111;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23111'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
}

[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-textarea {
    /* See story_e5efcb6d — longhand to keep cascaded background-image,
       background-repeat, and background-position intact. */
    background-color: #111;
    color: #e0e0e0;
    border-color: #e0e0e0;
}

[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-textarea:focus {
    border-color: #888;
}

[data-theme="dark"] .form-select:focus {
    background-color: #e0e0e0;
    color: #111;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23111'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
}

[data-theme="dark"] select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23e0e0e0'/%3E%3C/svg%3E");
}

/* Buttons */
[data-theme="dark"] .btn {
    border-color: #e0e0e0;
    color: #e0e0e0;
}

[data-theme="dark"] .btn-primary {
    background: #e0e0e0;
    color: #111;
}

[data-theme="dark"] .btn-primary:hover {
    background: #111;
    color: #e0e0e0;
}

[data-theme="dark"] .btn-secondary {
    color: #e0e0e0;
    border-color: #e0e0e0;
}

[data-theme="dark"] .btn-secondary:hover {
    background: #222;
}

[data-theme="dark"] .btn-sm {
    border-color: #e0e0e0;
    color: #e0e0e0;
}

[data-theme="dark"] .btn-sm:hover {
    background: #222;
}

/* Badges */
[data-theme="dark"] .badge {
    border-color: #e0e0e0;
}

[data-theme="dark"] .badge-filled {
    background: #e0e0e0;
    color: #111;
}

[data-theme="dark"] .status-badge {
    border-color: #e0e0e0;
}

/* Code */
[data-theme="dark"] .code-block {
    background: #111;
    color: #e0e0e0;
    border-color: #e0e0e0;
}

/* Toasts */
[data-theme="dark"] .toast {
    background: #111;
    color: #e0e0e0;
    border-color: #e0e0e0;
}

[data-theme="dark"] .toast-dark {
    background: #e0e0e0;
    color: #111;
}

/* Toggle switch */
[data-theme="dark"] .toggle-track {
    background: #444;
    border-color: #e0e0e0;
}

[data-theme="dark"] .toggle-track::after {
    background: #e0e0e0;
}

[data-theme="dark"] .toggle-switch input:checked + .toggle-track {
    background: #e0e0e0;
}

[data-theme="dark"] .toggle-switch input:checked + .toggle-track::after {
    background: #111;
}

/* Drop zone */
[data-theme="dark"] .drop-zone {
    border-color: #888;
}

[data-theme="dark"] .drop-zone:hover,
[data-theme="dark"] .drop-zone-active {
    border-color: #e0e0e0;
    background: #222;
}

/* Focus */
[data-theme="dark"] :focus-visible {
    outline-color: #e0e0e0;
}

/* Misc borders */
[data-theme="dark"] .help-support-row,
[data-theme="dark"] .filter-bar,
[data-theme="dark"] .pagination {
    border-color: #333;
}

[data-theme="dark"] .filter-toggle {
    color: #888;
}

[data-theme="dark"] .doc-thumb {
    border-color: #333;
}

[data-theme="dark"] .doc-thumb:hover {
    border-color: #888;
}

/* Websocket connection indicator (slice 10.4) */
.ws-indicator {
    position: relative;
    margin-right: 0.5rem;
    display: inline-flex;
    align-items: center;
}
.ws-indicator-btn {
    background: transparent;
    border: 0;
    padding: 0.25rem;
    cursor: pointer;
    color: inherit;
}
.ws-dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #666;
}
.ws-indicator-live .ws-dot { background: #4caf50; }
.ws-indicator-connecting .ws-dot,
.ws-indicator-reconnecting .ws-dot {
    background: #f5a623;
    animation: ws-pulse 1.2s infinite ease-in-out;
}
.ws-indicator-disconnected .ws-dot { background: #e04f5f; }
.ws-indicator-idle .ws-dot { background: #666; }
@keyframes ws-pulse {
    0%, 100% { opacity: 0.4; }
    50%      { opacity: 1; }
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
.ws-debug {
    position: absolute;
    right: 0;
    top: 100%;
    min-width: 18rem;
    background: #181818;
    border: 1px solid #333;
    padding: 0.5rem;
    font-size: var(--font-size-control);
    z-index: 60;
}
.ws-debug-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}
.ws-debug-events {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 12rem;
    overflow-y: auto;
}
.ws-debug-events li {
    padding: 0.15rem 0;
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
}
.ws-debug-empty {
    color: #888;
    font-style: italic;
}
.ws-debug-ts {
    color: #888;
    font-size: 0.75rem;
}

/* ============================================================
   DARK THEME OVERRIDES (story_5dd7167a)
   Override scope: page chrome (background, text, borders, links, nav,
   footer, forms, buttons). Per-component rules below are explicit
   rather than fully tokenised so the migration stays localised; later
   stories can fold these into shared semantic tokens.
   ============================================================ */

[data-theme="dark"] body { background: #0d0d0d; color: #e8e8e8; }

[data-theme="dark"] a { color: #e8e8e8; }
[data-theme="dark"] a:hover { color: #b0b0b0; }

[data-theme="dark"] .nav { background: #0d0d0d; border-bottom-color: #e8e8e8; }
[data-theme="dark"] .nav-brand,
[data-theme="dark"] .nav-links a { color: #e8e8e8; }
[data-theme="dark"] .nav-links a:hover,
[data-theme="dark"] .nav-links a.active { border-bottom-color: #e8e8e8; color: #e8e8e8; }
[data-theme="dark"] .nav-project-focus { color: #e8e8e8; border-color: #e8e8e8; }
[data-theme="dark"] .nav-project-focus:hover { background: #e8e8e8; color: #0d0d0d; }

[data-theme="dark"] .footer { border-top-color: #e8e8e8; }
[data-theme="dark"] .footer a { color: #e8e8e8; }

[data-theme="dark"] input,
[data-theme="dark"] textarea {
    background: #1a1a1a;
    color: #e8e8e8;
    border-color: #e8e8e8;
}
[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus { border-color: #b0b0b0; }
[data-theme="dark"] .form-input,
[data-theme="dark"] .form-textarea {
    background: #1a1a1a;
    color: #e8e8e8;
    border-color: #e8e8e8;
}
[data-theme="dark"] .form-select {
    background-color: #1a1a1a;
    color: #e8e8e8;
    border-color: #e8e8e8;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23e8e8e8'/%3E%3C/svg%3E");
}

[data-theme="dark"] .ws-debug { background: #181818; border-color: #333; color: #e8e8e8; }

::selection { background: var(--color-fg); color: var(--color-bg); }

.landing-no-auth-banner {
    display: block;
    padding: 0.6em 0.8em;
    margin: 0 0 1em 0;
    border: 1px solid #d4922a;
    border-radius: 0.2em;
    background: #fff5e3;
    color: #774400;
    font-family: var(--font-mono);
    font-size: 0.85em;
    line-height: 1.4;
}
.landing-no-auth-banner code {
    background: rgba(119, 68, 0, 0.08);
    padding: 0 0.25em;
    border-radius: 0.15em;
}
[data-theme="dark"] .landing-no-auth-banner {
    background: #2a1f0d;
    color: #e0c898;
    border-color: #d4922a;
}
[data-theme="dark"] .landing-no-auth-banner code {
    background: rgba(224, 200, 152, 0.12);
}

/* ============================================================
   ROLE-BASED EXECUTION UI — story_7b77ffb0
   Role chip in nav, AC scope chip + iteration counter in story
   timeline, ledger-kind classes for distinct lifecycle rows, agent
   detail panel, /agents promote-to-canonical CTA.
   ============================================================ */

.ac-scope-chip {
    display: inline-block;
    padding: 0 0.4em;
    margin-left: 0.4em;
    border: 1px dashed var(--color-fg);
    border-radius: 0.15em;
    font-size: 0.85em;
}
.iteration-chip {
    display: inline-block;
    padding: 0 0.4em;
    margin-left: 0.4em;
    border: 1px solid var(--color-fg);
    border-radius: 0.15em;
    font-size: 0.78em;
}
.iteration-warn {
    border-color: #d4922a;
    color: #d4922a;
    font-weight: 600;
}

.ci-row { padding: 0.2em 0; }
.ci-depth-1 { padding-left: 1.5em; border-left: 2px solid var(--color-fg); }
.ci-depth-2 { padding-left: 3em; border-left: 2px solid var(--color-fg); }
.ci-depth-3 { padding-left: 4.5em; border-left: 2px solid var(--color-fg); }
.ci-child { font-style: italic; }
.ci-agent-link { margin-left: 0.4em; }
.ci-agent-empty { margin-left: 0.4em; }

.excerpt-row.ledger-kind-plan-amend td:first-child { border-left: 3px solid #6b8cf2; }
.excerpt-row.ledger-kind-agent-compose td:first-child { border-left: 3px solid #4ca97a; }
.excerpt-row.ledger-kind-agent-archive td:first-child { border-left: 3px solid #a35a5a; }
.excerpt-row.ledger-kind-session-default-install td:first-child { border-left: 3px solid #b88a3e; }

.agent-ephemeral-pill { background: #fff5e3; color: #774400; border: 1px solid #d4922a; }
.agent-canonical-pill { background: #eaf5ec; color: #2d5b3a; border: 1px solid #4ca97a; }

.agent-promote-hints { list-style: none; padding: 0; margin: 0 0 1em 0; }
.agent-promote-hints li { margin-bottom: 0.6em; }
.agent-promote-cta {
    display: inline-block;
    padding: 0.2em 0.7em;
    border: 1px solid var(--color-fg);
    border-radius: 0.15em;
    text-decoration: none;
    font-weight: 600;
    margin-right: 0.6em;
}
.agent-promote-cta:hover { background: var(--color-fg); color: var(--color-bg); }
.agent-promote-skill-list { display: inline; padding: 0; }
.agent-promote-skill-list li { display: inline; margin-right: 0.3em; }

.agent-skill-links { padding: 0; margin: 0; list-style: none; }
.agent-skill-links li { display: inline; margin-right: 0.3em; }

.pattern-chip { white-space: nowrap; }

.document-agent-panel .document-agent-permissions,
.document-agent-panel .document-agent-skills { padding-left: 1.2em; }

.agents-filter-form { margin-bottom: 1em; }

[data-theme="dark"] .agent-ephemeral-pill { background: #2a1f0d; color: #e0c898; border-color: #d4922a; }
[data-theme="dark"] .agent-canonical-pill { background: #142013; color: #b8d8c0; border-color: #4ca97a; }

/* sty_70c0f7a3 — single-page project view styling. Panel registry on
   project_detail.html iterates and renders each panel from the same
   shell; URL `?expand=...` controls open state (no server-side prefs).
   The story panel adopts V3's click-to-expand table shape, mirroring
   `.system-doc-table` above. */
.panel-search {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 0.4rem 0.6rem;
    margin: 0.25rem 0 0.4rem 0;
    border: 1px solid #ccc;
    background: #fff;
    color: inherit;
    font: inherit;
}
[data-theme="dark"] .panel-search {
    background: #0a0a0a;
    border-color: #333;
}

/* sty_48198f3e: V3-parity chip strip beneath the panel search input.
   Built on the same theme tokens as the rest of the page (--color-fg /
   --color-bg / --color-border / --color-muted) so both light and dark
   themes render with the page's monochrome palette. Defaults carry a
   dashed border + muted text to signal "default, not user-set"; user
   chips use the solid border + foreground colour pattern shared with
   .status-pill / .category-pill. */
.panel-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin: 0 0 0.75rem 0;
    align-items: center;
    min-height: 1.2rem;
}
.panel-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    font-weight: 400;
    padding: 0.15rem 0.5rem;
    background: var(--color-bg);
    color: var(--color-fg);
    border: 1px solid var(--color-border);
    line-height: 1.3;
    text-transform: lowercase;
    letter-spacing: 0.02em;
}
.panel-filter-chip.is-default {
    color: var(--color-muted);
    border-style: dashed;
}
.panel-filter-chip.is-user {
    background: var(--color-fg);
    color: var(--color-bg);
}
.panel-filter-chip-label { white-space: nowrap; }
.panel-filter-chip-remove {
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    padding: 0 0.1rem;
}
.panel-filter-chip-remove:hover { opacity: 0.6; }
.panel-filter-chip-remove:focus-visible {
    outline: 2px solid var(--color-fg);
    outline-offset: 1px;
}
.panel-filter-chip-clear {
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-fg);
    cursor: pointer;
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    line-height: 1.3;
    text-transform: lowercase;
    letter-spacing: 0.02em;
}
.panel-filter-chip-clear:hover {
    background: var(--color-fg);
    color: var(--color-bg);
}
.panel-filter-chip-clear:focus-visible {
    outline: 2px solid var(--color-fg);
    outline-offset: 1px;
}

.panel-actions { margin: 0 0 0.6rem 0; font-size: 0.8rem; }

.panel-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}
.panel-table thead th {
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.65rem;
    border-bottom: 1px solid #ccc;
    padding: 0.35rem 0.5rem;
}
.panel-table tbody td { padding: 0.4rem 0.5rem; vertical-align: top; }
.panel-table tbody tr.story-row { cursor: pointer; }
.panel-table tbody tr.story-row:hover { background: #f5f5f5; }
.panel-table tbody tr.story-row.is-expanded { background: #f0f0f0; }
.panel-table tbody tr.story-detail > td { background: #fafafa; padding: 0.75rem 1rem; }

[data-theme="dark"] .panel-table thead th { border-color: #333; }
[data-theme="dark"] .panel-table tbody tr.story-row:hover { background: #1a1a1a; }
[data-theme="dark"] .panel-table tbody tr.story-row.is-expanded { background: #1f1f1f; }
[data-theme="dark"] .panel-table tbody tr.story-detail > td { background: #0f0f0f; }

/* sty_f4b87ea3 — expanded story row is full-width single-column.
   The block sequence (description, acceptance criteria, contracts)
   reads top-to-bottom; nothing splits horizontally. */
.story-detail-flat {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.story-detail-block { min-width: 0; }
.story-detail-block h4 {
    margin: 0 0 0.35rem 0;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.story-detail-pre {
    white-space: pre-wrap;
    font-size: 0.75rem;
    margin: 0;
    padding: 0.4rem 0.6rem;
    background: #fff;
    border: 1px solid #e0e0e0;
    max-height: 14rem;
    overflow: auto;
}
[data-theme="dark"] .story-detail-pre { background: #050505; border-color: #222; }

/* Tasks sub-table inside the expanded story row. Uses the same
   panel-table base styles as the parent stories table; only the
   per-column widths differ. */
.panel-table-tasks { width: 100%; table-layout: fixed; font-size: 0.75rem; }
.panel-table-tasks .col-seq { width: 3rem; }
.panel-table-tasks .col-status { width: 8rem; }
.panel-table-tasks .col-agent { width: 12rem; }
.panel-table-tasks tbody tr.story-task-row > td { padding: 0.3rem 0.5rem; }
.panel-table-tasks code.ci-name { font-weight: 600; }

.legacy-banner {
    background: #fff5e3;
    color: #774400;
    border: 1px solid #d4922a;
    padding: 0.5rem 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.8rem;
}
.legacy-banner a { color: inherit; font-weight: 700; }
[data-theme="dark"] .legacy-banner { background: #2a1f0d; color: #e0c898; border-color: #d4922a; }

/* sty_6300fb27 — story panel tag presentation, V3 parity.
   Tags render in a flex row beneath the title (matching V3's
   project-detail.html shape). The chip is a real <button> for
   keyboard accessibility; click is captured with @click.stop so it
   does not trigger the row's expand toggle. The colour palette
   mirrors V3 directly (rgba(106,159,181,0.15) background + #6a9fb5
   foreground) so the rendering reads as the same control across
   the version cut. */
.story-row-title { white-space: normal; word-break: break-word; line-height: 1.4; }
.story-row-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    margin-top: 0.2rem;
}
button.tag-chip.is-clickable {
    background: rgba(106, 159, 181, 0.15);
    color: #6a9fb5;
    border: 0;
    border-radius: 3px;
    padding: 0.15rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.3;
    margin: 0;
    cursor: pointer;
}
button.tag-chip.is-clickable:hover { background: rgba(106, 159, 181, 0.3); }
button.tag-chip.is-clickable:focus-visible { outline: 2px solid #6a9fb5; outline-offset: 1px; }
[data-theme="dark"] button.tag-chip.is-clickable { background: rgba(106, 159, 181, 0.2); color: #8ab4c9; }
[data-theme="dark"] button.tag-chip.is-clickable:hover { background: rgba(106, 159, 181, 0.35); }

/* sty_0495f550 — .kv-list grid layout. Used across the project meta
   panel, story detail, document detail, repo, tasks, admin pages.
   Pairs of <dt>/<dd> render side-by-side; the <dt> column is fixed
   width and uses the same muted-uppercase style as panel headers, the
   <dd> column wraps long values without breaking row alignment. */
.kv-list {
    display: grid;
    grid-template-columns: minmax(7rem, max-content) 1fr;
    column-gap: 1rem;
    row-gap: 0.25rem;
    margin: 0 0 0.75rem 0;
    align-items: baseline;
}
.kv-list dt {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-muted);
    white-space: nowrap;
}
.kv-list dd {
    margin: 0;
    color: var(--color-fg);
    overflow-wrap: anywhere;
    word-break: break-word;
}
.kv-list dd code {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
}

/* MCP URL row [copy] button (sty_0495f550 part B). Sits at the end
   of the row; clicking copies data-copy-source into the clipboard
   via the common.js delegated handler. Reuses the muted-uppercase
   palette so it reads as an affordance, not a primary action. */
.kv-list dd[data-mcp-state="unset"] {
    color: var(--color-muted);
}
button.mcp-copy-btn {
    background: transparent;
    color: var(--color-muted);
    border: 0;
    padding: 0 0.25rem;
    margin-left: 0.4rem;
    font: inherit;
    font-size: 0.7rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
button.mcp-copy-btn:hover { color: var(--color-fg); }
button.mcp-copy-btn:focus-visible { outline: 1px dotted var(--color-fg); outline-offset: 1px; }
button.mcp-copy-btn[data-copied="true"] { color: var(--color-fg); }

/* ============================================================
   epic:mobile-view — view-mode parity at narrow viewports.
   Single 48rem (768px) breakpoint mirrors the existing nav rule.
   No new colour tokens; light/dark parity preserved through the
   existing [data-theme="dark"] overrides on each base class.

   Strategy:
   - Slice 1 (sty_11f60d6d): hide every action affordance via one
     selector list; reduce body font-size for reading density.
   - Slice 2 (sty_f8791f88): stories panel + contracts sub-table
     collapse — thead hides, tr/td render as block-level cards.
   - Slice 3 (sty_dc8349d8): task-table on /projects/{id}/tasks
     gets the same card collapse; story walk cards tighten padding
     + font for phone density.
   - Slice 4 (sty_ba2c9de8): .kv-list single-column; footer 3-slot
     row stacks vertically; nav workspace switcher condenses.
   ============================================================ */
@media (max-width: 48rem) {
    /* slice 1: action-affordance hide. Every write-path surface
       hides at mobile width so view-mode is enforced by
       construction. New action surfaces should be added to this
       selector list as they ship. */
    .story-bulk-bar,
    .story-status-controls,
    .panel-table-stories .col-select,
    .status-reason-input { display: none !important; }

    /* slice 1: reading-density font shrink. */
    body { font-size: 0.8rem; }

    /* slice 2: stories panel — table → card stack. thead hides;
       tr.story-row becomes a block with a divider; the
       td.col-id + td.col-status pair sits inline on the header
       line, td.col-title takes its own line, the muted
       priority + updated pair forms the footer. */
    .panel-table-stories thead { display: none; }
    .panel-table-stories,
    .panel-table-stories tbody,
    .panel-table-stories tr,
    .panel-table-stories td { display: block; width: 100%; }
    .panel-table-stories tbody tr.story-row {
        padding: 0.5rem 0.6rem;
        border-bottom: 1px solid var(--color-border);
    }
    .panel-table-stories tbody tr.story-row td.col-id,
    .panel-table-stories tbody tr.story-row td.col-status {
        display: inline-block;
        width: auto;
        vertical-align: baseline;
        margin-right: 0.6rem;
    }
    .panel-table-stories tbody tr.story-row td.col-title {
        display: block;
        margin: 0.25rem 0;
    }
    .panel-table-stories tbody tr.story-row td.col-priority,
    .panel-table-stories tbody tr.story-row td.col-updated {
        display: inline-block;
        width: auto;
        margin-right: 0.6rem;
        color: var(--color-muted);
        font-size: 0.7rem;
    }
    /* The detail row (sty_f4b87ea3 single-column wrapper) already
       stacks vertically via flex-direction:column; just give it
       the same edge padding as the parent row. */
    .panel-table-stories tbody tr.story-detail > td {
        padding: 0.5rem 0.6rem;
    }

    /* slice 2: tasks sub-table inside the expand row. Same
       collapse as the parent table; sequence + status pill share
       the header line, name takes the body line, agent muted
       footer. */
    .panel-table-tasks thead { display: none; }
    .panel-table-tasks,
    .panel-table-tasks tbody,
    .panel-table-tasks tr,
    .panel-table-tasks td { display: block; width: 100%; }
    .panel-table-tasks tbody tr.story-task-row {
        padding: 0.4rem 0.5rem;
        border-bottom: 1px solid var(--color-border);
    }
    .panel-table-tasks tbody tr.story-task-row td.col-seq,
    .panel-table-tasks tbody tr.story-task-row td.col-status {
        display: inline-block;
        width: auto;
        margin-right: 0.5rem;
    }
    .panel-table-tasks tbody tr.story-task-row td.col-name {
        display: block;
        margin: 0.2rem 0;
    }
    .panel-table-tasks tbody tr.story-task-row td.col-agent {
        display: block;
        color: var(--color-muted);
        font-size: 0.7rem;
    }

    /* slice 3: project task feed — same card-collapse pattern as
       the stories panel applied to .task-table. The 3 panes
       (Enqueued / In-flight / Closed) are already separate
       <section class="panel-headed"> blocks, so they stack
       vertically by default — no template change needed. */
    .task-table thead { display: none; }
    .task-table,
    .task-table tbody,
    .task-table tr,
    .task-table td { display: block; width: 100%; }
    .task-table tbody tr {
        padding: 0.4rem 0.5rem;
        border-bottom: 1px solid var(--color-border);
    }
    .task-table tbody tr td { font-size: 0.7rem; }
    .task-table tbody tr td:first-child { font-size: 0.75rem; }

    /* slice 3: story walk page card density. The walk cards
       (.walk-card) already stack vertically via the .walk-card-list
       <ul>; tighten padding + font so more cards fit a phone
       viewport. */
    .walk-card { padding: 0.4rem 0.5rem; }
    .walk-card-meta { font-size: 0.65rem; gap: 0.3rem; }
    .walk-group-header { font-size: 0.75rem; margin: 0.4rem 0 0.25rem; }

    /* slice 4: kv-list single-column. dt above dd, dt as a small
       muted label. Used by the project meta panel + document
       detail + repo + tasks views. */
    .kv-list {
        grid-template-columns: 1fr;
        column-gap: 0;
        row-gap: 0.3rem;
    }
    .kv-list dt {
        font-size: 0.65rem;
        margin-top: 0.4rem;
    }
    .kv-list dt:first-child { margin-top: 0; }

    /* slice 4: footer 3-slot row stacks vertically. */
    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
        padding: 0.5rem 0.6rem;
    }
    .footer-slot { flex: 0 0 auto; width: 100%; justify-content: flex-start; }
    .footer-slot-right { justify-content: flex-start; }

    /* slice 4: at mobile width the top-bar workspace switcher and
       global-admin / dev chips eat too much horizontal space — hide
       them; the workspace switcher reappears inside the hamburger
       dropdown via .nav-dropdown-mobile-links. The top bar collapses
       to brand + WS dot + hamburger, which fits a 360px viewport
       cleanly. */
    .nav-workspace,
    .nav-global-admin-chip,
    .nav-dev-chip { display: none; }

    /* sty_9ab89ca3 — surface the primary nav links + workspace
       switcher inside the hamburger dropdown at mobile. */
    .nav-dropdown-mobile-links { display: flex; flex-direction: column; }
    .nav-dropdown-section-label {
        font-size: 0.6rem;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: var(--color-muted);
        padding: 0.4rem 0.6rem 0.15rem;
    }
    .nav-dropdown-mobile-active {
        padding: 0 0.6rem 0.3rem;
        font-weight: 700;
    }

    /* Filter chip strip — the chips already wrap via flex-wrap on
       .panel-filter-chips, just shrink them slightly. */
    .panel-filter-chip { font-size: 0.7rem; }
    .panel-search { font-size: 0.7rem; }

    /* Reduce panel padding so panel content claims more of the
       narrow viewport. */
    .panel-body { padding: 0.5rem 0.6rem; }
    .panel-header { padding: 0.4rem 0.6rem; }

    /* Reduce portal-main side padding. */
    .portal-main { padding-left: 0.5rem; padding-right: 0.5rem; }
}

/* sty_9ab89ca3 — desktop-default: the hamburger's mobile-links
   mirror is hidden. The mobile @media block above flips it to
   display: flex at narrow widths. */
.nav-dropdown-mobile-links { display: none; }

/* sty_f315d848 — operator-override surface styling (status button-group
   + reason input + bulk action bar). The templates were shipped by
   sty_1d6751e9 referencing classes that had no CSS, so the disabled
   current-status button rendered with the OS's grey, reading as
   *highlighted* against the un-styled siblings. These rules pin the
   button-group to the V3 token palette and invert the disabled-current
   so the active status reads as a pill not a greyed-out widget. */
.story-status-controls {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.status-button-group {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0;
}
button.status-button {
    background: var(--color-bg);
    color: var(--color-fg);
    border: 1px solid var(--color-border);
    padding: var(--control-padding-y) var(--control-padding-x);
    font-family: inherit;
    font-size: var(--font-size-control);
    line-height: 1;
    cursor: pointer;
    margin: 0 -1px 0 0;
}
button.status-button:hover:not([disabled]) { color: var(--color-muted); }
button.status-button:focus-visible { outline: 2px solid var(--color-fg); outline-offset: 1px; z-index: 1; }
button.status-button[disabled] {
    background: var(--color-fg);
    color: var(--color-bg);
    cursor: default;
}
input.status-reason-input {
    width: 100%;
    background: var(--color-input-bg);
    color: var(--color-input-fg);
    border: 1px solid var(--color-border);
    padding: var(--control-padding-y) var(--control-padding-x);
    font: inherit;
    font-size: var(--font-size-control);
}
input.status-reason-input::placeholder { color: var(--color-muted); }

.story-bulk-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.6rem;
    margin: 0 0 0.6rem 0;
    background: var(--color-bg);
    color: var(--color-fg);
    border: 1px solid var(--color-border);
    font-size: var(--font-size-control);
}
.story-bulk-bar label { display: inline-flex; align-items: center; gap: 0.3rem; }
.story-bulk-bar select,
.story-bulk-bar input[type="text"] {
    background: var(--color-input-bg);
    color: var(--color-input-fg);
    border: 1px solid var(--color-border);
    padding: var(--control-padding-y) var(--control-padding-x);
    font: inherit;
    font-size: var(--font-size-control);
}
.story-bulk-bar input[type="text"] { flex: 1 1 14rem; min-width: 10rem; }
.story-bulk-bar button {
    background: var(--color-bg);
    color: var(--color-fg);
    border: 1px solid var(--color-border);
    padding: var(--control-padding-y) var(--control-padding-x);
    font: inherit;
    font-size: var(--font-size-control);
    cursor: pointer;
}
.story-bulk-bar button:hover:not([disabled]) { color: var(--color-muted); }
.story-bulk-bar button[disabled] { color: var(--color-muted); cursor: default; }
.story-bulk-count { color: var(--color-muted); white-space: nowrap; }
.story-bulk-result { color: var(--color-muted); margin-left: auto; }
