/* MesloLGS NF — required for powerlevel10k Nerd Font icons in the shell terminal */
@font-face {
    font-family: 'MesloLGS NF';
    src: url('https://cdn.jsdelivr.net/gh/romkatv/powerlevel10k-media@master/MesloLGS%20NF%20Regular.ttf') format('truetype');
    font-weight: normal; font-style: normal;
}
@font-face {
    font-family: 'MesloLGS NF';
    src: url('https://cdn.jsdelivr.net/gh/romkatv/powerlevel10k-media@master/MesloLGS%20NF%20Bold.ttf') format('truetype');
    font-weight: bold; font-style: normal;
}
@font-face {
    font-family: 'MesloLGS NF';
    src: url('https://cdn.jsdelivr.net/gh/romkatv/powerlevel10k-media@master/MesloLGS%20NF%20Italic.ttf') format('truetype');
    font-weight: normal; font-style: italic;
}
@font-face {
    font-family: 'MesloLGS NF';
    src: url('https://cdn.jsdelivr.net/gh/romkatv/powerlevel10k-media@master/MesloLGS%20NF%20Bold%20Italic.ttf') format('truetype');
    font-weight: bold; font-style: italic;
}

/* ─── Tokens — aligned with dynatrace-wwse.github.io ──────────── */
:root {
    --bg:          #080c14;
    --surface:     #111826;
    --surface-2:   #16202f;
    --surface-3:   #1c2a3d;
    --border:      rgba(255,255,255,.16);
    --border-soft: rgba(255,255,255,.09);
    --text:        #e2e8f2;
    --text-muted:  #94a3b8;
    --text-2:      #94a3b8;
    --text-3:      #4e6278;
    --accent:      #00b4de;
    --accent-glow: rgba(0,180,222,.18);

    --green:       #4ade80;
    --red:         #fb7185;
    --yellow:      #fbbf24;
    --amber:       #d29922;
    --purple:      #a78bfa;

    --r:    12px;
    --r-sm: 7px;
    --ease: cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

body {
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.18); }

/* ─── Topbar ──────────────────────────────────────────────────── */
header {
    position: sticky; top: 0; z-index: 200;
    background: rgba(8,12,20,.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
}

.topbar-inner {
    max-width: 1400px; margin: 0 auto;
    height: 64px;
    display: flex; align-items: center; gap: 1rem;
}

.brand {
    display: flex; align-items: center; gap: .85rem;
    flex-shrink: 0;
}

.brand img { height: 28px; }

.brand-text {
    display: flex; flex-direction: column; line-height: 1.15;
}

.brand-text .title {
    font-size: .98rem; font-weight: 700; color: var(--text);
    letter-spacing: -0.01em;
}

.brand-text .sub {
    font-size: .68rem; font-weight: 600; color: var(--accent);
    letter-spacing: .14em; text-transform: uppercase;
}

.header-center {
    flex: 1; display: flex; align-items: center; justify-content: center;
}

.health-badge {
    padding: 5px 12px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: .04em;
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    color: var(--text-2);
    display: inline-flex; align-items: center; gap: .45rem;
}

.health-badge::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%;
    background: var(--text-3);
}

.health-badge.healthy { border-color: rgba(74,222,128,.4); color: var(--green); }
.health-badge.healthy::before {
    background: var(--green);
    box-shadow: 0 0 8px rgba(74,222,128,.6);
    animation: pulse 2.2s ease infinite;
}
.health-badge.unhealthy { border-color: rgba(251,113,133,.4); color: var(--red); }
.health-badge.unhealthy::before { background: var(--red); }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: .35; }
}

.header-right {
    display: flex; align-items: center; gap: .75rem;
}

.auth-status {
    display: flex; align-items: center; gap: .55rem;
    font-size: 0.85rem;
}

.user-info {
    display: flex; align-items: center; gap: .65rem;
    color: var(--text-2);
    font-size: 0.82rem;
}

/* ─── Nav tabs ────────────────────────────────────────────────── */
nav {
    background: var(--surface);
    border-bottom: 1px solid var(--border-soft);
    padding: 0 1.5rem;
    position: sticky; top: 64px; z-index: 150;
}

.nav-inner {
    max-width: 1400px; margin: 0 auto;
    display: flex; gap: .25rem; overflow-x: auto;
}

.tab {
    padding: 13px 18px;
    color: var(--text-2);
    font-size: 0.875rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all .18s var(--ease);
    white-space: nowrap;
}

.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    box-shadow: 0 1px 0 0 var(--accent);
}

/* ─── Main content ───────────────────────────────────────────── */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 1.5rem 48px;
}

.view { display: none; }
.view.active { display: block; }

/* ─── Controls ───────────────────────────────────────────────── */
.controls {
    display: flex; gap: .65rem; flex-wrap: wrap;
    margin-bottom: 1.5rem;
    align-items: center;
}

/* Enumerated by type rather than a bare `input` so checkboxes and radios keep
   their native rendering. That is also how `number` was missed: the workshop
   seat filters came out white-on-white against the dark surface, because an
   unlisted type falls through to the browser default instead of inheriting
   anything. Add new input types HERE, not as a one-off style attribute. */
.controls input[type="text"],
.controls select,
input[type="text"], input[type="password"], input[type="email"],
input[type="number"], input[type="date"], input[type="time"],
input[type="url"], input[type="tel"], textarea, select {
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    color: var(--text);
    padding: 8px 12px;
    border-radius: var(--r-sm);
    font-size: 0.86rem;
    font-family: inherit;
    transition: border-color .18s var(--ease);
}

/* The spinner is drawn by the browser in its own colours and cannot be themed,
   so it reads as a white block on the dark surface. The arrows earn nothing on
   a filter that is typed into. */
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.controls input[type="text"]:focus,
.controls select:focus,
input:focus, select:focus {
    outline: none;
    border-color: rgba(0,180,222,.5);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.controls input[type="text"] { min-width: 260px; }

/* ─── Tables ─────────────────────────────────────────────────── */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--r);
    overflow: hidden;
}

thead {
    background: var(--surface-2);
}

thead th {
    text-align: left;
    padding: 11px 14px;
    font-weight: 600;
    font-size: 0.72rem;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: .08em;
    border-bottom: 1px solid var(--border-soft);
}

tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-soft);
    font-size: 0.85rem;
    vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .14s var(--ease); }
tbody tr:hover { background: var(--surface-2); }

tbody td.loading {
    text-align: center;
    color: var(--text-3);
    padding: 28px;
    font-style: italic;
}

td.running { background: rgba(0,180,222,.06); }

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .42rem;
    padding: 7px 14px;
    background: var(--accent);
    color: #fff;
    border: 1px solid var(--accent);
    border-radius: var(--r-sm);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .18s var(--ease);
    text-decoration: none;
    line-height: 1.2;
    white-space: nowrap;
}

.btn:hover { filter: brightness(1.12); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,180,222,.3); }
.btn:active { transform: translateY(0); }

.btn-secondary {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border-soft);
}
.btn-secondary:hover {
    background: var(--surface-3);
    border-color: var(--border);
    box-shadow: none;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--red);
    border-color: var(--red);
}
.btn-danger:hover { filter: brightness(1.1); box-shadow: 0 6px 18px rgba(251,113,133,.3); }

.btn-danger-muted {
    background: rgba(251,113,133,.12);
    color: var(--red);
    border-color: rgba(251,113,133,.3);
}
.btn-danger-muted:hover { background: rgba(251,113,133,.22); box-shadow: 0 4px 12px rgba(251,113,133,.2); filter: none; transform: translateY(-1px); }

.btn-small { padding: 4px 10px; font-size: 0.75rem; }
.btn-auth {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: var(--r-sm);
    font-size: 0.82rem;
    transition: all .18s var(--ease);
}
.btn-auth:hover { background: var(--surface-2); border-color: rgba(255,255,255,.28); }

.btn:disabled, .btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ─── Status badges ──────────────────────────────────────────── */
.arch-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--r-sm);
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--surface-3);
    border: 1px solid var(--border-soft);
    color: var(--text-2);
    letter-spacing: .03em;
    text-transform: uppercase;
}

.status-pass, a.status-pass { color: var(--green); font-weight: 600; }
.status-fail, a.status-fail { color: var(--red); font-weight: 600; }
.status-terminated, a.status-terminated { color: var(--amber); font-weight: 600; }
.status-none { color: var(--text-3); }
.log-link { text-decoration: none; display: inline-flex; align-items: center; min-height: 32px; padding: 0 4px; }
.log-link:hover { filter: brightness(1.2); }

.spinner {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px;
    color: var(--accent);
    font-weight: 700;
    animation: spin 1.4s linear infinite;
    text-decoration: none;
    margin-right: 4px;
}
.spinner:hover { color: #fff; }

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

/* ─── Modals ─────────────────────────────────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(8,12,20,.78);
    backdrop-filter: blur(8px);
    z-index: 500;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
}

.modal-inner {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--r);
    width: min(1100px, 100%);
    max-height: 88vh;
    display: flex; flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,.4);
}

.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-soft);
    background: var(--surface-2);
    gap: 12px;
}

.modal-header h3 {
    font-size: 0.95rem; font-weight: 600;
    color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    flex: 1;
}

.modal-actions {
    display: flex; gap: 6px; align-items: center; flex-shrink: 0;
}

.modal-actions a.btn { text-decoration: none; }

.modal-inner pre {
    flex: 1;
    overflow: auto;
    padding: 14px 18px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.78rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    background: #050810;
    color: #d0d7de;
}

/* ─── Worker cards ───────────────────────────────────────────── */
.worker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}

.worker-card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--r);
    padding: 16px;
    transition: border-color .18s var(--ease);
}

.worker-card:hover { border-color: var(--border); }

.worker-card.offline { opacity: 0.65; }

.worker-status-pill {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 99px;
    border: 1px solid transparent;
}
.worker-status-pill.ready  { background: rgba(74,222,128,.12); color: var(--green); border-color: rgba(74,222,128,.3); }
.worker-status-pill.busy   { background: rgba(0,180,222,.12);  color: var(--accent); border-color: rgba(0,180,222,.3); }
.worker-status-pill.offline { background: rgba(255,255,255,.06); color: var(--text-3); border-color: var(--border-soft); }

.worker-card h4 {
    font-size: 0.85rem; font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    word-break: break-all;
}

.worker-card .meta { font-size: 0.78rem; color: var(--text-2); display: grid; gap: 3px; }
.worker-card .meta strong { color: var(--text); font-weight: 600; }

/* ─── Stat cards (nightly summary, etc.) ─────────────────────── */
.nightly-header {
    display: flex; gap: 14px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.stat {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--r);
    padding: 14px 20px;
    min-width: 120px;
}

.stat .value { font-size: 1.5rem; font-weight: 700; color: var(--text); line-height: 1; }
.stat .label { font-size: 0.7rem; color: var(--text-2); text-transform: uppercase; letter-spacing: .08em; margin-top: 4px; }

.queue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

/* ─── Sync panel ─────────────────────────────────────────────── */
.sync-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.sync-card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--r);
    padding: 14px 16px;
    transition: all .18s var(--ease);
    cursor: pointer;
}

.sync-card:hover {
    border-color: rgba(0,180,222,.35);
    background: var(--surface-2);
    transform: translateY(-1px);
}

.sync-card h4 {
    font-size: 0.88rem; font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    display: flex; align-items: center; gap: .4rem;
}

.sync-card p {
    font-size: 0.76rem;
    color: var(--text-2);
    line-height: 1.45;
}

.sync-card .cmd {
    font-family: ui-monospace, monospace;
    font-size: 0.72rem;
    color: var(--accent);
    margin-top: 6px;
    background: rgba(0,180,222,.08);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
}

/* ─── Sync sub-nav ───────────────────────────────────────────── */
.sync-subnav {
    display: flex;
    gap: 2px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-soft);
    padding-bottom: 0;
}

.sync-tab {
    background: none;
    border: none;
    color: var(--text-2);
    font-size: 0.83rem;
    font-weight: 500;
    padding: 7px 14px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    border-radius: 0;
    transition: color .15s, border-color .15s;
}

.sync-tab:hover { color: var(--text); }

.sync-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.sync-subtab-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: var(--text-2);
}

/* ─── Agent sub-nav ───────────────────────────────────────────── */
.agent-subnav {
    display: flex;
    gap: 2px;
    margin: 28px 0 0;
    border-bottom: 1px solid var(--border-soft);
    padding-bottom: 0;
}
.agent-tab {
    background: none;
    border: none;
    color: var(--text-2);
    font-size: 0.83rem;
    font-weight: 500;
    padding: 7px 14px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    border-radius: 0;
    transition: color .15s, border-color .15s;
}
.agent-tab:hover { color: var(--text); }
.agent-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.agent-subview {
    margin-top: 16px;
}
.show-more-row {
    text-align: center;
    padding: 10px 0 4px;
}

.label-chip {
    display: inline-block;
    font-size: 0.68rem;
    padding: 1px 6px;
    border-radius: 10px;
    background: rgba(0,180,222,.12);
    color: var(--accent);
    white-space: nowrap;
}

/* ─── Trigger build inline form (per-row) ────────────────────── */
.trigger-form {
    display: flex; gap: 6px; align-items: center;
    flex-wrap: wrap;
}

.trigger-form select, .trigger-form input {
    padding: 4px 8px;
    font-size: 0.78rem;
}

.trigger-form .branch-select { min-width: 130px; }
.trigger-form .action-select { min-width: 140px; }
.trigger-form .arch-select   { min-width: 90px; }

/* ─── Misc ───────────────────────────────────────────────────── */
.loading {
    text-align: center;
    color: var(--text-3);
    padding: 28px;
    font-style: italic;
    font-size: 0.85rem;
}

h3 {
    font-size: 1rem; font-weight: 600;
    margin: 4px 0 12px;
    color: var(--text);
}

.user-name { font-weight: 500; color: var(--text); }

@media (max-width: 768px) {
    .topbar-inner { padding: 0; gap: .5rem; }
    .brand-text .sub { display: none; }
    main { padding: 16px 12px 32px; }
    .controls input[type="text"] { min-width: 0; flex: 1; }
}

/* ─── Role badges (writer/guest, master/agent) ───────────────── */
.role-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 99px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    vertical-align: middle;
    margin-left: 4px;
    border: 1px solid transparent;
    line-height: 1.4;
}
.role-badge.writer  { background: rgba(74,222,128,.14); color: var(--green); border-color: rgba(74,222,128,.35); }
.role-badge.guest   { background: rgba(148,163,184,.14); color: var(--text-2); border-color: rgba(148,163,184,.3); }
.role-badge.master  { background: rgba(0,180,222,.16); color: var(--accent); border-color: rgba(0,180,222,.4); }
.role-badge.agent   { background: rgba(167,139,250,.14); color: var(--purple); border-color: rgba(167,139,250,.32); }

.worker-card.is-master {
    background: linear-gradient(180deg, rgba(0,180,222,.05) 0%, var(--surface) 60%);
}

/* Guests: every action surface is dimmed and unclickable. */
body.role-guest [data-action] {
    opacity: 0.45;
    pointer-events: none;
    cursor: not-allowed;
}

/* ─── Fleet trigger panel ────────────────────────────────────── */
.fleet-trigger {
    background: linear-gradient(135deg, rgba(0,180,222,.07), rgba(167,139,250,.04));
    border: 1px solid rgba(0,180,222,.22);
    border-radius: var(--r);
    padding: 14px 18px;
    margin-bottom: 18px;
}
.fleet-trigger-head {
    display: flex; align-items: baseline; gap: .8rem;
    margin-bottom: 10px; flex-wrap: wrap;
}
.fleet-trigger-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.01em;
}
.fleet-trigger-help {
    font-size: 0.78rem;
    color: var(--text-2);
}
.fleet-trigger-row {
    display: flex; align-items: center; gap: .55rem; flex-wrap: wrap;
}
.fleet-trigger-row select { min-width: 220px; }
.fleet-trigger-row .fleet-action-select { min-width: 200px; }
.fleet-target-count { font-size: 0.78rem; color: var(--text-2); }

/* ─── Modal search bar + wrap toggle ─────────────────────────── */
.modal-search {
    display: flex; align-items: center; gap: 4px;
    flex-shrink: 0;
}
.modal-search input[type="search"] {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    color: var(--text);
    padding: 5px 10px;
    border-radius: var(--r-sm);
    font-size: 0.78rem;
    width: 200px;
}
.modal-search input[type="search"]:focus {
    outline: none;
    border-color: rgba(0,180,222,.5);
    box-shadow: 0 0 0 2px var(--accent-glow);
}
.search-nav {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px;
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    color: var(--text-2);
    border-radius: var(--r-sm);
    font-size: 0.7rem;
    cursor: pointer;
    transition: all .14s var(--ease);
}
.search-nav:hover { background: var(--surface-3); color: var(--text); }
.search-count {
    font-size: 0.7rem;
    color: var(--text-3);
    min-width: 50px;
    font-family: ui-monospace, monospace;
    padding: 0 4px;
}

mark.log-match {
    background: rgba(251,191,36,.32);
    color: inherit;
    border-radius: 2px;
    padding: 0;
}
mark.log-match.current {
    background: var(--accent);
    color: #06121b;
    box-shadow: 0 0 0 2px rgba(0,180,222,.5);
}

.modal-inner pre.nowrap {
    white-space: pre;
    word-break: normal;
    overflow-x: auto;
}

/* Tighten the modal header so search bar fits alongside actions */
.modal-header {
    flex-wrap: wrap;
    row-gap: 8px;
}
.modal-header h3 { min-width: 180px; }

/* Livelog two-row header: title line + toolbar line */
.livelog-header {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 10px 18px 8px;
}
.livelog-title-row {
    display: flex;
    align-items: center;
}
.livelog-title-row #livelog-title {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-3);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.livelog-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    min-width: 0;
}
.livelog-toolbar .modal-search { flex-shrink: 0; }
.livelog-toolbar #livelog-app-tabs {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: nowrap;
    flex-shrink: 0;
}
.livelog-toolbar .modal-actions { margin-left: auto; flex-shrink: 0; }

@media (max-width: 768px) {
    .modal-search input[type="search"] { width: 130px; }
    .fleet-trigger-row select { min-width: 0; flex: 1; }
}

/* ─── Fleet repo cell ─────────────────────────────────────────── */
.fleet-repo-cell {
    min-width: 220px;
}

.fleet-repo-link {
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.3;
}

.fleet-repo-link strong {
    font-size: 0.88rem;
    color: var(--text);
}

.fleet-repo-org {
    font-size: 0.7rem;
    color: var(--text-3);
    font-family: ui-monospace, monospace;
}

.fleet-repo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

/* ─── Repo quick-action pill buttons ─────────────────────────── */
.repo-action {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-2);
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    border-radius: 99px;
    padding: 5px 10px;
    line-height: 1.5;
    white-space: nowrap;
    transition: color .13s, border-color .13s, background .13s;
}

.repo-action:hover {
    color: var(--accent);
    border-color: rgba(0,180,222,.35);
    background: var(--surface-3);
}

/* Release pill — accent-tinted when a tag is present */
.repo-action-release {
    color: var(--accent);
    border-color: rgba(0,180,222,.25);
    background: rgba(0,180,222,.06);
    font-family: ui-monospace, monospace;
}

.repo-action-release:hover {
    background: rgba(0,180,222,.14);
    border-color: rgba(0,180,222,.5);
}

/* No-releases variant — muted */
.repo-action-norelease {
    color: var(--text-3);
    border-color: var(--border-soft);
    background: transparent;
    font-family: inherit;
}

.repo-action-norelease:hover {
    color: var(--text-2);
    border-color: var(--border);
    background: var(--surface-2);
}

/* ── Shell modal ──────────────────────────────────────────────────────────── */
.shell-modal-inner {
    width: min(1200px, 96vw);
    height: 88vh;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
}

#shell-terminal {
    flex: 1;
    min-height: 0;
    background: #000;
    border-radius: 0 0 var(--r) var(--r);
    overflow: hidden;
    /* xterm.js injects its own canvas; padding handled inside */
    padding: 4px;
}

/* Make xterm fill the container */
#shell-terminal .xterm,
#shell-terminal .xterm-viewport,
#shell-terminal .xterm-screen { width: 100% !important; }

/* Fullscreen mode — terminal covers the entire viewport */
.shell-modal-inner:fullscreen,
.shell-modal-inner:-webkit-full-screen {
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0;
    background: #000;
    padding: 0;
    position: relative;
}
.shell-modal-inner:fullscreen .modal-header,
.shell-modal-inner:-webkit-full-screen .modal-header {
    display: none;
}
.shell-modal-inner:fullscreen #shell-terminal,
.shell-modal-inner:-webkit-full-screen #shell-terminal {
    position: absolute;
    inset: 0;
    min-height: unset;
    border-radius: 0;
    padding: 0;
}
/* xterm internals must fill the terminal div so fitAddon measures correctly */
#shell-terminal .xterm,
#shell-terminal .xterm-viewport,
#shell-terminal .xterm-screen {
    width: 100% !important;
    height: 100% !important;
}

/* App preview iframe — same flex slot as the terminal */
#shell-app-frame {
    flex: 1;
    min-height: 400px;
    border-radius: 0 0 var(--r) var(--r);
    background: #fff;
}

/* App tab buttons in the shell modal header */
#shell-app-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}
#shell-app-tabs .shell-tab-btn.active {
    background: var(--accent, #00b4de);
    color: #fff;
    border-color: var(--accent, #00b4de);
}

/* App preview iframe — livelog modal (same slot as the pre) */
#livelog-app-frame {
    flex: 1;
    min-height: 400px;
    border-radius: 0 0 var(--r) var(--r);
    background: #fff;
}

/* App tab buttons in the livelog modal header */
#livelog-app-tabs .livelog-tab-btn.active {
    background: var(--accent, #00b4de);
    color: #fff;
    border-color: var(--accent, #00b4de);
}

/* Empty state shown when Apps tab is clicked but no apps are registered */
#shell-app-empty,
#livelog-app-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #050810;
    border-radius: 0 0 var(--r) var(--r);
    color: var(--text-muted);
    padding: 32px;
    text-align: center;
}
#shell-app-empty h4,
#livelog-app-empty h4 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text);
}
#shell-app-empty code,
#livelog-app-empty code {
    font-family: ui-monospace, monospace;
    font-size: 0.8rem;
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    border-radius: 4px;
    padding: 6px 12px;
    color: var(--accent, #00b4de);
}

/* ── Agentic View ─────────────────────────────────────────────────────────── */

.agentic-header {
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.agent-ready-indicator {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    margin-top: 2px;
}
.agent-ready-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--green);
    animation: pulse-dot 2.2s ease-in-out infinite;
    flex-shrink: 0;
}
.agent-ready-label {
    font-size: 0.8rem;
    color: var(--green);
    font-weight: 500;
    white-space: nowrap;
}
.agentic-intro {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
    max-width: 760px;
}
.agentic-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-2);
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.count-badge {
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--text-muted);
}
.agent-type-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #1a2744;
    color: #7eb8f7;
    border: 1px solid #2a3d60;
    white-space: nowrap;
}
.btn-agent {
    background: linear-gradient(135deg, #1e3a5f, #2a5298);
    color: #c8deff;
    border: 1px solid #3a6bc0;
    font-weight: 600;
    white-space: nowrap;
}
.btn-agent:hover {
    background: linear-gradient(135deg, #254a7a, #3362b8);
    color: #e0eeff;
}
.btn-success {
    background: #0e3320 !important;
    color: #4ade80 !important;
    border-color: #166534 !important;
    cursor: default;
}

/* ─── Running indicator (green pulsing dot) ──────────────────── */
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .65; transform: scale(.85); }
}
.running-dot {
    display: inline-block;
    color: var(--green);
    font-size: 1rem;
    line-height: 1;
    vertical-align: middle;
    animation: pulse-dot 1.4s ease-in-out infinite;
    cursor: pointer;
    text-decoration: none;
}
.running-dot:hover { color: #86efac; }

/* ─── Build sparkline bars (fleet + nightly history) ─────────── */
.build-spark {
    display: flex;
    gap: 1px;
    margin-top: 4px;
    align-items: center;
    min-height: 14px;
}
.spark-bar {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    cursor: default;
    transition: opacity .12s;
    font-family: ui-monospace, monospace;
    letter-spacing: -0.5px;
}
a.spark-bar { cursor: pointer; }
a.spark-bar:hover { opacity: .75; }
.spark-pass  { color: var(--green); }
.spark-fail  { color: var(--red); }
.spark-term  { color: var(--amber); }
.spark-none  { color: var(--text-3); }

/* ─── Fix with AI modal ─────────────────────────────────────── */
.fix-ai-modal-inner {
    width: min(560px, 94vw);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
}
.fix-ai-body {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}
.fix-ai-desc {
    font-size: 0.85rem;
    color: var(--text-2);
    margin: 0;
    line-height: 1.5;
}
.fix-ai-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-2);
}
.fix-ai-textarea {
    width: 100%;
    box-sizing: border-box;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.85rem;
    padding: 10px 12px;
    resize: vertical;
    outline: none;
    transition: border-color .13s;
}
.fix-ai-textarea:focus { border-color: var(--accent); }
.fix-ai-ci-info {
    font-size: 0.78rem;
    color: var(--text-2);
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    padding: 8px 12px;
    line-height: 1.5;
}
.fix-ai-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 24px;
    border-top: 1px solid var(--border-soft);
}

/* ─── CI status badge in Sync PRs table ─────────────────────── */
.ci-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 99px;
    border: 1px solid transparent;
    white-space: nowrap;
}
.ci-badge.pass   { background: rgba(74,222,128,.12); color: var(--green); border-color: rgba(74,222,128,.3); }
.ci-badge.fail   { background: rgba(251,113,133,.12); color: var(--red);  border-color: rgba(251,113,133,.3); }
.ci-badge.term   { background: rgba(251,191,36,.1);  color: var(--amber); border-color: rgba(251,191,36,.3); }
.ci-badge.pend   { background: rgba(251,191,36,.1);  color: var(--amber); border-color: rgba(251,191,36,.3); animation: pend-blink 1.2s ease-in-out infinite; }
.ci-badge.none   { color: var(--text-3); border-color: transparent; background: transparent; }
.ci-badge.unknown{ background: rgba(148,163,184,.12); color: var(--text-3); border-color: rgba(148,163,184,.3); }
@keyframes pend-blink { 0%,100% { opacity:1; } 50% { opacity:.35; } }

.instr-dot { font-size:.7rem; opacity:.6; cursor:default; margin-right:2px; }

/* ─── Fix with AI button in tables ──────────────────────────── */
.btn-fix-ai {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 99px;
    border: 1px solid rgba(0,180,222,.35);
    background: rgba(0,180,222,.08);
    color: var(--accent);
    cursor: pointer;
    white-space: nowrap;
    transition: background .12s, border-color .12s;
}
.btn-fix-ai:hover { background: rgba(0,180,222,.16); border-color: rgba(0,180,222,.55); }

/* ─── Toast notification ─────────────────────────────────────── */
#ops-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    color: var(--text-1);
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity .2s, transform .2s;
    pointer-events: none;
    z-index: 9999;
    white-space: nowrap;
}
#ops-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── Orbital icon ───────────────────────────────────────────── */
.orbital-icon {
    position: relative;
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; cursor: pointer;
}
.orbital-icon::before {
    content: '';
    position: absolute; inset: 0; border-radius: 50%;
    border: 1.5px dashed rgba(0,180,222,.22);
    pointer-events: none;
}
.orbital-planet {
    width: 13px; height: 13px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px rgba(0,180,222,.65), 0 0 18px rgba(0,180,222,.2);
    position: relative; z-index: 2;
}
.orbital-arm {
    position: absolute; inset: 0; border-radius: 50%;
    animation: orbit-spin 3.4s linear infinite;
    pointer-events: none;
}
.orbital-arm::after {
    content: '';
    position: absolute; top: -3.5px; left: 50%;
    transform: translateX(-50%);
    width: 7px; height: 7px; border-radius: 50%;
    background: #94a3b8;
    box-shadow: 0 0 4px rgba(148,163,184,.4);
}
@keyframes orbit-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.orbital-dot {
    position: absolute; bottom: 3px; right: 2px;
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--text-3);
    border: 2px solid var(--bg);
    transition: background .4s, box-shadow .4s;
    z-index: 3;
}
.orbital-dot.healthy  { background: var(--green);  box-shadow: 0 0 6px rgba(74,222,128,.55); animation: dot-pulse 2.2s ease infinite; }
.orbital-dot.degraded { background: var(--yellow); box-shadow: 0 0 6px rgba(251,191,36,.4); }
.orbital-dot.unhealthy{ background: var(--red);    box-shadow: 0 0 6px rgba(251,113,133,.4); }
@keyframes dot-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: .5; }
}

/* ─── Audit sub-view ─────────────────────────────────────────── */
.audit-content {
    padding: 4px 0;
    overflow-y: auto;
    max-height: 75vh;
}
/* Scope box-model reset to audit content only */
.audit-content * { box-sizing: border-box; }
.audit-issue  { color: var(--red); }
.audit-ok     { color: var(--green); }
.audit-warn   { color: var(--yellow); }

/* Framework tab */
.framework-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.framework-suite-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 8px;
}
.framework-card {
    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.framework-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.framework-card-name {
    font-weight: 600;
    font-size: 0.9rem;
    flex: 1;
}
.framework-card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}
.framework-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}
.badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}
.badge-warn  { background: rgba(251,191,36,.15); color: #fbbf24; }
.badge-info  { background: rgba(99,102,241,.15); color: #818cf8; }
.badge-muted { background: rgba(255,255,255,.05); color: var(--text-muted); }

/* Nightly toolbar */
.nightly-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.audit-header { color: var(--accent); font-weight: 700; }

/* ── Help modal ─────────────────────────────────────────────────────────────*/
.tab-help {
    margin-left: auto;
    font-weight: 700;
    font-size: 1rem;
    padding: 4px 10px;
    opacity: 0.7;
}
.tab-help:hover { opacity: 1; }

.help-section {
    margin-bottom: 24px;
}
.help-section h4 {
    color: var(--accent);
    font-size: 0.82rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin: 0 0 8px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 4px;
}
.help-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0 0 8px;
}
.help-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.help-table th {
    text-align: left;
    color: var(--text-muted);
    font-weight: 600;
    padding: 4px 8px 4px 0;
    border-bottom: 1px solid var(--border);
}
.help-table td {
    padding: 5px 8px 5px 0;
    vertical-align: top;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 40%, transparent);
}
.help-table td:first-child { white-space: nowrap; padding-right: 16px; }
kbd {
    display: inline-block;
    padding: 1px 6px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: var(--font-mono, monospace);
    font-size: 0.8rem;
    background: var(--surface-2, #1a2035);
    color: var(--text);
}

/* ─── Content Service tab ─────────────────────────────────────── */
.tab-writer-only { display: none; }
body.role-writer .tab-writer-only { display: inline-block; }
.content-subnav { display: flex; gap: 2px; margin-bottom: 20px; border-bottom: 1px solid var(--border-soft); }
.content-tab { background: none; border: none; color: var(--text-2); font-size: 0.83rem; font-weight: 500;
  padding: 7px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
  border-radius: 0; transition: color .15s, border-color .15s; }
.content-tab:hover { color: var(--text); }
.content-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.content-card { background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 10px; padding: 16px; margin: 12px 0; }
.content-card h3 { font-size: 0.92rem; font-weight: 600; }
.content-hint { font-size: 0.82rem; color: var(--text-muted); margin: 0 0 12px; }
.content-msg { font-size: 0.8rem; color: var(--text-2); }
.content-sub { font-size: 0.82rem; color: var(--text-2); }
.content-repos { column-count: 2; column-gap: 22px; }
.content-repos label { display: block; font-size: 0.82rem; padding: 2px 0; cursor: pointer; }
.content-chip { display: inline-block; background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: 10px; padding: 2px 9px; margin: 2px; font-size: 0.74rem; }
.content-profile-row { background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 10px; padding: 12px 14px; margin: 10px 0; }
.content-profile-row .pr-head { display: flex; align-items: center; gap: 10px; }
.content-profile-row .pr-actions { margin-left: auto; display: flex; gap: 6px; }
@media (max-width: 700px) { .content-repos { column-count: 1; } }

/* ─── Register Tenant tab ─────────────────────────────────────── */
.reg-spin { display: none; align-items: center; gap: 10px; margin-top: 12px; font-size: 0.84rem; color: var(--text-2); }
.reg-spin.busy { display: flex; }
.reg-spinner { width: 18px; height: 18px; border: 3px solid var(--border-soft); border-top-color: var(--accent); border-radius: 50%; animation: reg-sp 0.8s linear infinite; flex-shrink: 0; }
@keyframes reg-sp { to { transform: rotate(360deg); } }
.reg-bar { height: 4px; background: var(--border-soft); border-radius: 3px; overflow: hidden; margin-top: 10px; }
.reg-bar > i { display: block; height: 100%; width: 30%; background: var(--accent); border-radius: 3px; animation: reg-slide 1.4s ease-in-out infinite; }
@keyframes reg-slide { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }

/* ── Automation coverage badge (Synchronizer → Status) ──────────────────────
   How much of a training a machine can drive end to end. Sits beside the
   version columns because the two questions belong together: which framework a
   repo pins, and whether that repo can actually test — and resume — itself. */
.auto-badge {
    display: inline-block; padding: 1px 7px; border-radius: 10px;
    font-size: 11px; font-weight: 600; letter-spacing: .02em; white-space: nowrap;
    border: 1px solid transparent; cursor: help;
}
.auto-verified { color: var(--green);  border-color: color-mix(in srgb, var(--green) 45%, transparent); background: color-mix(in srgb, var(--green) 12%, transparent); }
.auto-complete { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.auto-partial  { color: var(--amber);  border-color: color-mix(in srgb, var(--amber) 45%, transparent); background: color-mix(in srgb, var(--amber) 12%, transparent); }
.auto-none     { color: var(--text-3); border-color: var(--border-soft); }
.auto-unknown  { color: var(--text-3); border-color: transparent; }

/* ── Fleet autoscaling panel (Workers tab, fleet owners only) ─────────────── */
.autoscale-panel {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--r);
    padding: 14px 16px;
    margin-bottom: 18px;
}
.autoscale-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.autoscale-title { font-weight: 600; font-size: 0.92rem; color: var(--text); }
.autoscale-sub   { font-size: 0.78rem; color: var(--text-2); }
.autoscale-spacer { flex: 1 1 auto; }

.autoscale-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.autoscale-row label {
    font-size: 0.75rem;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: .06em;
}
.fleet-seats {
    width: 72px;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-sm);
    padding: 4px 8px;
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
}
.fleet-select {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-sm);
    padding: 4px 8px;
    font-size: 0.8rem;
}
.fleet-seats:focus-visible,
.fleet-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.freeze-pill {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: .08em;
    color: var(--red);
    border: 1px solid rgba(251,113,133,.4);
    background: rgba(251,113,133,.12);
    border-radius: var(--r-sm);
    padding: 2px 8px;
}

.autoscale-out {
    margin-top: 12px;
    padding: 11px 13px;
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-sm);
    font-size: 0.8rem;
    line-height: 1.55;
    color: var(--text);
}
.autoscale-out .ok   { color: var(--green); }
.autoscale-out .warn { color: var(--amber); }
.autoscale-out .bad  { color: var(--red); }
.autoscale-out .dim  { color: var(--text-2); }
.autoscale-out b     { font-variant-numeric: tabular-nums; }
.autoscale-out ul    { margin: 6px 0 0; padding-left: 18px; }
.autoscale-out li    { margin-bottom: 3px; }
.autoscale-metrics {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    font-variant-numeric: tabular-nums;
}
.autoscale-metrics span { color: var(--text-2); font-size: 0.76rem; }
.autoscale-metrics b { color: var(--text); font-size: 0.95rem; display: block; }

/* Instance picker explanation — sits beside the select so the trade-off is
   readable before you spend money, not after. */
.inst-note {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    margin-top: 4px;
    border-left: 3px solid var(--accent, #4a9eff);
    background: rgba(74, 158, 255, 0.06);
    border-radius: 3px;
    font-size: 12px;
    line-height: 1.45;
    max-width: 42ch;
}
.inst-note .inst-family {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 10px;
    opacity: 0.75;
}
.inst-note .inst-best { font-weight: 600; }
.inst-note .inst-why,
.inst-note .inst-limit { opacity: 0.8; }
.inst-note .inst-limit { font-variant-numeric: tabular-nums; }

/* ── Lanes ───────────────────────────────────────────────────────────────────
   A worker serves exactly one queue topology, and that decides who can land on
   it. Self-service and workshop machines used to look identical here, so an
   operator could not tell which ones were safe to cordon. Colour carries the
   lane; the badge repeats it in words, because colour alone is not a label. */

.lane-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 99px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    vertical-align: middle;
    border: 1px solid transparent;
}
.lane-badge.daily      { background: rgba(74,222,128,.12); color: var(--green);  border-color: rgba(74,222,128,.32); }
.lane-badge.workshop   { background: rgba(251,191,36,.13); color: var(--yellow); border-color: rgba(251,191,36,.34); }
/* Not an error, but not nothing either: it means the worker has registered and
   not yet published a pool, and every consumer is reading it as daily. */
.lane-badge.unassigned { background: rgba(148,163,184,.14); color: var(--text-2); border-color: rgba(148,163,184,.34); }

/* A thin left edge on the card, so a grid of workers separates into lanes at a
   glance without reading a single badge. */
.worker-card.lane-workshop { border-left: 3px solid rgba(251,191,36,.55); }
.worker-card.lane-daily    { border-left: 3px solid rgba(74,222,128,.40); }

.lane-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 14px;
}
.lane-card {
    flex: 1 1 260px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 14px;
    border: 1px solid var(--border-soft);
    border-left-width: 3px;
    border-radius: var(--r-sm);
    background: var(--surface);
}
.lane-card.lane-daily    { border-left-color: rgba(74,222,128,.55); }
.lane-card.lane-workshop { border-left-color: rgba(251,191,36,.65); }
.lane-card .lane-name {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--text-2);
}
.lane-card .lane-stats { font-size: 0.82rem; color: var(--text); }
.lane-card .lane-stats b { color: var(--accent); font-variant-numeric: tabular-nums; }
.worker-card .meta .muted { color: var(--text-3); }

/* ─── Workshops: filter bar + calendar ───────────────────────── */
/* One row for month nav AND every filter. State used to sit alone above the
   search inputs, which read as two unrelated controls for the same table.
   `align-items: end` is what keeps the bare buttons on the same baseline as the
   inputs, which carry a label line above them. */
.ws-filter-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: end;
    margin-bottom: 10px;
}
.ws-filter-bar > label {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 12px;
    color: var(--text-2);
}
/* The note is the only thing that should take the leftover width, so it lands
   at the right end of the row instead of being squeezed against Reload. */
.ws-filter-bar #ws-filter-note {
    flex: 1 1 auto;
    text-align: right;
    margin: 0;
    font-size: 11px;
    min-width: 120px;
}

/* A day with eight workshops used to render eight chips into a 64px cell and
   drag the whole month grid out of shape. Cap the visible ones and fold the
   rest behind a toggle, so a busy day costs one line, not eight. */
.ws-cal-day {
    vertical-align: top;
    height: 64px;
    padding: 4px;
}
.ws-cal-daynum { font-size: .7rem; opacity: .6; }
.ws-cal-chip {
    cursor: pointer;
    font-size: .68rem;
    margin-top: 2px;
    padding: 1px 4px;
    border-radius: 4px;
    background: var(--surface-3, #1b2434);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ws-cal-more {
    cursor: pointer;
    display: block;
    width: 100%;
    text-align: left;
    margin-top: 2px;
    padding: 1px 4px;
    border: 1px dashed var(--border-soft);
    border-radius: 4px;
    background: none;
    color: var(--text-2);
    font-size: .68rem;
    font-family: inherit;
}
.ws-cal-more:hover { color: var(--text); border-color: var(--accent); }

/* ─── Sign-in gate + landing hero ────────────────────────────────────────────
   Anonymous visitors get the hero and the Register Tenant tab; every other tab
   and view is removed from the page. This is the PRESENTATION half only — the
   security boundary is nginx auth_request + _require_writer on the API. Anyone
   who deletes these rules in DevTools still gets 401/403 from the endpoints.   */

/* Until loadAuthState() resolves, the fleet view is markup-active. Hide the shell
   rather than let a signed-out visitor watch the dashboard flash and disappear. */
body.auth-pending nav,
body.auth-pending main { visibility: hidden; }

body.role-anon nav .tab:not(#tab-register) { display: none; }
body.role-anon .view:not(#view-register) { display: none !important; }

#landing {
    position: relative; overflow: hidden;
    padding: clamp(1.5rem, 6vh, 5rem) 1.5rem 4rem;
    margin: -20px -24px 0;          /* bleed past main's padding, edge to edge */
    background: var(--bg);
    /* Fill what is left below the header + tab bar, so the hero does not end in a
       band of empty page. The copy itself is NOT vertically centred: flex-start plus
       the padding above parks it in the upper band, which reads better on tall screens
       than a block floating dead-centre. */
    min-height: calc(100vh - 108px);
    display: none;                  /* .active (set by showLanding) reveals it */
    align-items: flex-start;
}
#landing.active { display: flex; }
#landing .hero-mesh {
    position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(ellipse 80% 60% at 60% 0%, rgba(0,180,222,.22) 0%, transparent 65%),
        radial-gradient(ellipse 50% 40% at 20% 80%, rgba(124,58,237,.18) 0%, transparent 60%),
        radial-gradient(ellipse 40% 50% at 90% 70%, rgba(248,113,113,.14) 0%, transparent 55%);
    animation: heroMeshPulse 8s ease-in-out infinite alternate;
}
@keyframes heroMeshPulse { 0% { opacity: .7; } 100% { opacity: 1; } }
#landing .hero-grid-lines {
    position: absolute; inset: 0; pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
    background-size: 60px 60px;
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 0%, transparent 80%);
    mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 0%, transparent 80%);
}
#hero-particles { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
#landing .hero-inner { position: relative; z-index: 2; max-width: 1180px; margin: 0 auto; width: 100%; text-align: center; }

#landing .hero-badge {
    display: inline-flex; align-items: center; gap: .45rem;
    background: rgba(0,180,222,.1); border: 1px solid rgba(0,180,222,.25);
    color: var(--accent); font-size: .68rem; font-weight: 700;
    letter-spacing: .08em; text-transform: uppercase;
    padding: .3rem .8rem; border-radius: 99px; margin-bottom: 1.4rem;
}
#landing .hero-badge .pulse {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent); box-shadow: 0 0 0 0 var(--accent-glow);
    animation: heroPulse 2s infinite;
}
@keyframes heroPulse {
    0%   { box-shadow: 0 0 0 0 rgba(0,180,222,.5); }
    70%  { box-shadow: 0 0 0 7px rgba(0,180,222,0); }
    100% { box-shadow: 0 0 0 0 rgba(0,180,222,0); }
}
#landing h1 {
    font-size: clamp(2.1rem, 5.5vw, 3.6rem); font-weight: 800;
    letter-spacing: -.03em; line-height: 1.05; margin: 0 0 .6rem;
}
#landing h1 .gradient {
    background: linear-gradient(135deg, var(--accent) 0%, #60a5fa 50%, #e879f9 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
}
#landing h2 {
    font-size: clamp(.95rem, 2vw, 1.2rem); font-weight: 500;
    color: var(--text-2); margin: 0 0 .9rem; letter-spacing: -.01em;
}
/* "powered by Orbital" credit riding on the tagline. inline-block so the phrase
   never splits across a wrap on narrow viewports. */
#landing .hero-powered {
    display: inline-block; margin-left: .55rem;
    font-size: .78em; font-weight: 500; opacity: .7; letter-spacing: 0;
}
#landing .hero-powered strong { color: var(--accent); font-weight: 700; }
#landing p { max-width: 640px; color: var(--text-2); font-size: .9rem; line-height: 1.65; margin: 0 auto 1.8rem; }
#landing .hero-note { font-size: .76rem; opacity: .75; margin: 1.6rem auto 0; }

#landing .hero-ctas { display: flex; justify-content: center; gap: .7rem; flex-wrap: wrap; }
.btn-hero {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .62rem 1.15rem; border-radius: 8px;
    font-size: .86rem; font-weight: 600; font-family: inherit;
    cursor: pointer; border: 1px solid transparent;
    transition: all .18s cubic-bezier(.4,0,.2,1);
}
.btn-hero-accent { background: var(--accent); color: #fff; box-shadow: 0 0 20px rgba(0,180,222,.35); }
.btn-hero-accent:hover { filter: brightness(1.15); transform: translateY(-1px); box-shadow: 0 8px 28px rgba(0,180,222,.5); }
.btn-hero-outline { background: var(--surface-2); color: var(--text); border-color: rgba(255,255,255,.25); }
.btn-hero-outline:hover { border-color: rgba(255,255,255,.38); background: var(--surface-3); color: #fff; }

@media (prefers-reduced-motion: reduce) {
    #landing .hero-mesh, #landing .hero-badge .pulse { animation: none; }
}

/* ─── Register Tenant: collapsible reference blocks ──────────────────────────
   The scope table and the post-install notes are consulted once and then never
   again, but they were taller than the form itself.                            */
details.reg-fold { margin: 0 0 10px; }
details.reg-fold > summary {
    cursor: pointer; list-style: none;
    display: inline-flex; align-items: center; gap: .4rem;
    font-size: .78rem; font-weight: 600; color: var(--accent);
    padding: 5px 0; user-select: none;
}
details.reg-fold > summary::-webkit-details-marker { display: none; }
details.reg-fold > summary::before { content: '▸'; font-size: .7rem; transition: transform .15s ease; }
details.reg-fold[open] > summary::before { transform: rotate(90deg); }
details.reg-fold > summary:hover { filter: brightness(1.2); }

/* Missing registry value — a real "we do not know", not an empty cell. */
.cs-dash { color: var(--text-3); }

/* ─── History: provisioning-job columns (tenant / user / daemon) ──────────── */
/* These three are only populated for Enablement-App daemon jobs, so most rows
   show the em dash. Keep them narrow and monospaced — the daemon id is copied
   into `docker exec` and misreading a character costs a troubleshooting cycle. */
.hist-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  color: var(--text-2);
  max-width: 180px;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}
.hist-empty { color: var(--text-muted); }

/* ─── Register Tenant sub-tabs ───────────────────────────────────────────── */
/* The registration form is public; the two data tables are org-member only and
   their tabs are hidden by .tab-writer-only (display:none unless body.role-writer). */
.reg-filters {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px;
}
.reg-filters input, .reg-filters select { font-size: 0.8rem; }
.reg-count { color: var(--text-muted); font-size: 0.85rem; }

/* A wide table scrolls inside its own box instead of being squeezed by
   table{width:100%} — body has overflow-x:hidden, so without this the
   overflow is simply lost. */
.table-scroll { overflow-x: auto; }
.table-scroll > table { min-width: 1500px; }
