/* =============================================================================
   Project CLASS - Network Manager
   Field-kit theme: sage / olive drab, stencil headings, mono readouts
   ============================================================================= */

:root {
    --olive-900: #1d2219;
    --olive-800: #262d21;
    --olive-700: #333c2c;
    --olive-600: #424d39;
    --sage-500:  #6f7d5f;
    --sage-400:  #8c9a7a;
    --sage-300:  #a9b69a;
    --sage-100:  #dfe4d3;
    --canvas:    #c9c3a6;
    --brass:     #c8a24a;
    --signal:    #d9622b;
    --ok:        #8fbf5a;
    --danger:    #d4553a;

    --font-stencil: 'Stardos Stencil', 'Black Ops One', Impact, sans-serif;
    --font-body: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    --font-mono: 'Share Tech Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

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

body {
    background-color: var(--olive-900);
    /* map grid */
    background-image:
        linear-gradient(rgba(169, 182, 154, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(169, 182, 154, 0.05) 1px, transparent 1px),
        linear-gradient(rgba(169, 182, 154, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(169, 182, 154, 0.08) 1px, transparent 1px),
        radial-gradient(ellipse at 50% 30%, var(--olive-700) 0%, var(--olive-900) 70%);
    background-size: 20px 20px, 20px 20px, 100px 100px, 100px 100px, 100% 100%;
    background-attachment: fixed;
    color: var(--sage-100);
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.45;
}

a { color: var(--sage-300); }
a:hover { color: var(--brass); }

.stencil { font-family: var(--font-stencil); letter-spacing: 0.12em; text-transform: uppercase; }
.mono { font-family: var(--font-mono); }

/* -----------------------------------------------------------------------------
   Auth screens
   ----------------------------------------------------------------------------- */

.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.auth-panel {
    width: 100%;
    max-width: 420px;
    background: var(--olive-800);
    border: 1px solid var(--olive-600);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    position: relative;
}

/* hazard tape across the top of the crate */
.auth-panel::before {
    content: '';
    display: block;
    height: 8px;
    background: repeating-linear-gradient(-45deg, var(--brass) 0 12px, var(--olive-900) 12px 24px);
}

.auth-head {
    padding: 28px 28px 20px;
    text-align: center;
    border-bottom: 1px dashed var(--olive-600);
}

.auth-head .emblem {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    color: var(--sage-300);
}

.auth-head h1 {
    margin: 0;
    font-family: var(--font-stencil);
    font-size: 2.4rem;
    line-height: 1;
    letter-spacing: 0.14em;
    color: var(--sage-100);
}

.auth-head .tagline {
    margin-top: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--brass);
}

.auth-head .sub {
    margin-top: 6px;
    font-family: var(--font-stencil);
    font-size: 1rem;
    letter-spacing: 0.4em;
    color: var(--sage-400);
}

.auth-body { padding: 24px 28px 28px; }

.auth-body h2 {
    margin: 0 0 4px;
    font-family: var(--font-stencil);
    font-size: 1.2rem;
    letter-spacing: 0.15em;
    color: var(--brass);
}

.auth-body p.lead { margin: 0 0 20px; color: var(--sage-300); font-size: 1rem; }

.field { margin-bottom: 16px; }

.field label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--sage-400);
}

.field input {
    width: 100%;
    padding: 11px 12px;
    background: var(--olive-900);
    border: 1px solid var(--olive-600);
    border-left: 3px solid var(--sage-500);
    color: var(--sage-100);
    font-family: var(--font-mono);
    font-size: 1.05rem;
    border-radius: 0;
    outline: none;
    transition: border-color 0.15s;
}

.field input:focus { border-color: var(--sage-400); border-left-color: var(--brass); }

.field input.code {
    text-align: center;
    font-size: 1.8rem;
    letter-spacing: 0.5em;
    padding-left: calc(12px + 0.5em);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: 1px solid var(--sage-400);
    background: var(--sage-500);
    color: var(--olive-900);
    font-family: var(--font-stencil);
    font-size: 1.1rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    border-radius: 0;
    transition: background 0.15s, color 0.15s;
}

.btn:hover { background: var(--sage-300); color: var(--olive-900); }
.btn:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.btn-block { width: 100%; }

.btn-ghost {
    background: transparent;
    color: var(--sage-300);
    border-color: var(--olive-600);
}
.btn-ghost:hover { background: var(--olive-700); color: var(--sage-100); }

.auth-links {
    display: flex;
    justify-content: space-between;
    margin-top: 18px;
    font-size: 0.95rem;
}

.auth-foot {
    padding: 10px 28px;
    border-top: 1px solid var(--olive-600);
    background: var(--olive-900);
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--sage-500);
    letter-spacing: 0.08em;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 6px;
    background: var(--ok);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--ok);
    animation: blink 2.4s infinite;
}

@keyframes blink { 50% { opacity: 0.35; } }

@media (prefers-reduced-motion: reduce) {
    .status-dot { animation: none; }
}

/* -----------------------------------------------------------------------------
   Flash messages
   ----------------------------------------------------------------------------- */

.flash {
    margin-bottom: 16px;
    padding: 10px 12px;
    border-left: 4px solid var(--sage-400);
    background: rgba(0, 0, 0, 0.25);
    font-size: 1rem;
}
.flash-danger  { border-left-color: var(--danger); color: #f0c3b8; }
.flash-warning { border-left-color: var(--brass);  color: #ecdcae; }
.flash-success { border-left-color: var(--ok);     color: #d4e8bd; }

/* -----------------------------------------------------------------------------
   App shell
   ----------------------------------------------------------------------------- */

.topbar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 24px;
    height: 60px;
    background: var(--olive-800);
    border-bottom: 3px solid var(--olive-600);
}

.topbar .brand {
    display: flex;
    align-items: baseline;
    gap: 12px;
    color: var(--sage-100);
    text-decoration: none;
}
.topbar .brand b { font-family: var(--font-stencil); font-size: 1.5rem; letter-spacing: 0.14em; font-weight: normal; }
.topbar .brand span { font-family: var(--font-stencil); font-size: 0.8rem; letter-spacing: 0.3em; color: var(--sage-400); }

.topbar nav { display: flex; gap: 4px; flex: 1; }

.menu { position: relative; }
.menu > button {
    background: none;
    border: none;
    color: var(--sage-300);
    padding: 8px 12px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    cursor: pointer;
}
.menu > button:hover, .menu.open > button { color: var(--sage-100); background: var(--olive-700); }

.menu-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 260px;
    margin: 0;
    padding: 4px 0;
    list-style: none;
    background: var(--olive-800);
    border: 1px solid var(--olive-600);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    z-index: 10;
}
.menu.open .menu-list { display: block; }

.menu-list a, .menu-list .disabled {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 14px;
    color: var(--sage-100);
    text-decoration: none;
}
.menu-list a:hover { background: var(--olive-700); }
.menu-list .code { font-family: var(--font-mono); }
.menu-list .desc { color: var(--sage-400); font-size: 0.9rem; }
.menu-list .disabled { color: var(--sage-500); opacity: 0.55; cursor: not-allowed; }
.menu-list .disabled .desc::after { content: ' · planned'; }

.user-chip {
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--sage-300);
}
.user-chip a { font-family: var(--font-body); text-transform: uppercase; letter-spacing: 0.15em; font-size: 0.85rem; }

main.page { max-width: 1200px; margin: 0 auto; padding: 28px 16px; }

.page-title {
    margin: 0 0 20px;
    font-family: var(--font-stencil);
    font-size: 1.8rem;
    letter-spacing: 0.14em;
    font-weight: normal;
    color: var(--sage-100);
}

.panel {
    background: var(--olive-800);
    border: 1px solid var(--olive-600);
    padding: 20px;
}
.panel h3 {
    margin: 0 0 12px;
    font-family: var(--font-stencil);
    font-weight: normal;
    letter-spacing: 0.14em;
    color: var(--brass);
}

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

.type-card {
    padding: 14px;
    background: var(--olive-900);
    border: 1px solid var(--olive-600);
    border-top: 3px solid var(--sage-500);
}
.type-card .code { font-family: var(--font-stencil); font-size: 1.3rem; letter-spacing: 0.1em; }
.type-card .sensors { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.type-card.planned { opacity: 0.45; border-top-color: var(--olive-600); }

.tag {
    padding: 1px 8px;
    border: 1px solid var(--sage-500);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--sage-300);
    text-transform: uppercase;
}

@media (max-width: 720px) {
    .topbar { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 8px; }
    .topbar nav { order: 3; flex-basis: 100%; }
    .topbar .brand span { display: none; }
    .menu-list { min-width: 220px; }
}

/* -----------------------------------------------------------------------------
   Shell: top bar + left section menu
   ----------------------------------------------------------------------------- */

.topbar-fill { flex: 1; }

.shell {
    display: grid;
    grid-template-columns: 210px 1fr;
    min-height: calc(100vh - 60px);
}

.sidenav {
    background: var(--olive-800);
    border-right: 1px solid var(--olive-600);
    padding: 16px 0;
}

.nav-group { border-left: 3px solid transparent; }
.nav-group.active { border-left-color: var(--brass); background: rgba(0, 0, 0, 0.15); }

.nav-head {
    display: block;
    padding: 10px 18px;
    font-family: var(--font-stencil);
    font-size: 1.15rem;
    letter-spacing: 0.16em;
    color: var(--sage-300);
    text-decoration: none;
}
.nav-head:hover { color: var(--sage-100); background: var(--olive-700); }
.nav-group.active > .nav-head { color: var(--sage-100); }

.type-filter {
    margin: 0 0 10px;
    padding: 4px 18px 8px 26px;
    border: 0;
}
.type-filter legend {
    padding: 0;
    margin-bottom: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--sage-500);
}
.type-filter label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--sage-100);
    cursor: pointer;
}
.type-filter label.disabled { color: var(--sage-500); opacity: 0.5; cursor: not-allowed; }
.type-filter input { accent-color: var(--brass); width: 15px; height: 15px; margin: 0; }

.workspace { padding: 22px 24px; min-width: 0; }
.workspace .page-title { margin: 0; }

.muted { color: var(--sage-500); }
.small { font-size: 0.85rem; }

/* -----------------------------------------------------------------------------
   MFS page
   ----------------------------------------------------------------------------- */

/* device status colours (set by hand for now) */
:root {
    --st-new: #ffffff;
    --st-hub: #cfe6f6;
    --st-armed: #f29a2e;
    --st-fired: #7d1414;
    --st-battery: #ff2b2b;
}

.mfs-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 22px;
    align-items: start;
}

.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }

.btn-small { padding: 6px 12px; font-size: 0.85rem; letter-spacing: 0.14em; }
.btn-danger { background: var(--danger); border-color: #e57a62; color: #fff; }
.btn-danger:hover { background: #e86b4f; color: #fff; }

.link-btn {
    background: none; border: 0; padding: 0;
    font: inherit; font-size: 0.9rem;
    color: #2f5c7a; text-decoration: underline; cursor: pointer;
}
.link-btn.danger { color: #a3261b; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px;
    background: var(--olive-800);
    border: 1px solid var(--olive-600);
    color: var(--sage-300);
    font-family: var(--font-body); font-size: 0.95rem; font-weight: 600;
    letter-spacing: 0.06em;
    cursor: pointer;
}
.chip b { font-family: var(--font-mono); font-weight: normal; color: var(--sage-500); }
.chip:hover { color: var(--sage-100); border-color: var(--sage-500); }
.chip.on { background: var(--sage-500); border-color: var(--sage-300); color: var(--olive-900); }
.chip.on b { color: var(--olive-800); }
.sw { display: inline-block; width: 11px; height: 11px; border: 1px solid rgba(0, 0, 0, 0.4); }
.sw.st-new { background: var(--st-new); }
.sw.st-hub { background: var(--st-hub); }
.sw.st-armed { background: var(--st-armed); }
.sw.st-fired { background: var(--st-fired); }
.sw.st-battery { background: var(--st-battery); }

#search, .workspace input:not([type=checkbox]):not([type=file]), .workspace select {
    padding: 6px 9px;
    background: var(--olive-900);
    border: 1px solid var(--olive-600);
    color: var(--sage-100);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    border-radius: 0;
}
#search { flex: 1; min-width: 180px; }

.drag-all {
    margin-bottom: 10px;
    padding: 7px 12px;
    border: 1px dashed var(--brass);
    color: var(--brass);
    font-size: 0.95rem;
    cursor: grab;
    user-select: none;
}
.drag-all:active { cursor: grabbing; }

.add-form { margin-bottom: 14px; }
.add-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; margin-bottom: 12px; }
.add-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; color: var(--sage-400); }
.add-grid label i { font-style: normal; font-weight: normal; letter-spacing: 0.05em; text-transform: none; color: var(--sage-500); }
.row-actions { display: flex; gap: 8px; }
.row-actions.end { justify-content: flex-end; margin-top: 10px; }

/* device cards */
.device-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }

.device {
    --card: var(--st-new);
    --ink: #1d2219;
    --ink-soft: #4b5545;
    background: var(--card);
    color: var(--ink);
    border: 1px solid rgba(0, 0, 0, 0.35);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.device.st-hub { --card: var(--st-hub); }
.device.st-armed { --card: var(--st-armed); }
.device.st-fired { --card: var(--st-fired); --ink: #fff; --ink-soft: #f0c9c2; }
.device.st-battery { --card: var(--st-battery); --ink: #fff; --ink-soft: #ffe1dc; }

.device-row { display: flex; align-items: center; gap: 10px; padding-right: 10px; }
.device-row[draggable=true] { cursor: grab; }
.device-toggle {
    flex: 1;
    display: flex; align-items: baseline; gap: 18px;
    padding: 10px 12px;
    background: none; border: 0;
    color: var(--ink);
    font: inherit; text-align: left;
    cursor: pointer;
}
.device-toggle:focus-visible { outline: 2px solid var(--brass); outline-offset: -2px; }
.caret { display: inline-block; width: 1em; color: var(--ink-soft); transition: transform 0.12s; }
.device.open .caret, .cluster.open .caret { transform: rotate(90deg); }
.serial { font-family: var(--font-mono); font-size: 1.1rem; letter-spacing: 0.04em; }
.did { font-family: var(--font-mono); font-size: 1rem; color: var(--ink-soft); }
.fict {
    padding: 0 6px; border: 1px solid currentColor;
    font-size: 0.7rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--ink-soft);
}

.device .hub-select {
    max-width: 230px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(0, 0, 0, 0.35);
    color: #1d2219;
    font-size: 0.85rem;
}
.device .hub-select:disabled { opacity: 0.45; cursor: not-allowed; }

.device-detail {
    margin: 0 10px 10px;
    padding: 12px 14px;
    background: #f7f6ef;
    color: #1d2219;
    border: 1px solid rgba(0, 0, 0, 0.2);
}
.device-detail .muted { color: #6b7363; }
.device-detail input:not([type=checkbox]):not([type=file]), .device-detail select {
    background: #fff !important; color: #1d2219 !important; border-color: #b9bba9 !important;
}
.props { display: grid; grid-template-columns: 170px 1fr; gap: 8px 14px; margin: 0; }
.props dt { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; color: #5b6452; padding-top: 3px; }
.props dd { margin: 0; min-width: 0; }
.secret { font-family: var(--font-mono); font-size: 0.85rem; word-break: break-all; background: #e9e8dc; padding: 1px 4px; }
.secret.masked { letter-spacing: 0.1em; color: #6b7363; }
.mono { font-family: var(--font-mono); }

.toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.toggle { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid #b9bba9; background: #fff; cursor: pointer; font-weight: 600; }
.toggle input { width: 15px; height: 15px; margin: 0; }
.toggle.t-armed input { accent-color: var(--st-armed); }
.toggle.t-fired input { accent-color: var(--st-fired); }
.toggle.t-battery_change input { accent-color: var(--st-battery); }
.toggle:has(input:checked).t-armed { border-color: var(--st-armed); background: #fde7cd; }
.toggle:has(input:checked).t-fired { border-color: var(--st-fired); background: #f1d4d4; }
.toggle:has(input:checked).t-battery_change { border-color: var(--st-battery); background: #ffd9d9; }

.inline-form { display: flex; gap: 6px; margin-top: 4px; }
.inline-form input { flex: 1; min-width: 0; }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { padding: 1px 0; }
ul.photos li.current { font-weight: 600; }
ul.photos li.current::before { content: '▶ '; font-size: 0.7em; }
.upload { margin-top: 6px; color: #2f5c7a; border-color: #b9bba9; }
.upload:hover { background: #e9e8dc; color: #1d2219; }

.tagchip {
    display: inline-flex; align-items: center; gap: 4px;
    margin: 0 6px 4px 0; padding: 1px 4px 1px 8px;
    background: #e3e8d8; border: 1px solid #9aa58a;
    font-size: 0.9rem;
}
.tagchip button { background: none; border: 0; cursor: pointer; color: #a3261b; font-size: 1rem; line-height: 1; padding: 0 3px; }

.empty { padding: 14px 0; }

/* right column */
.side-col { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 16px; }

.cluster-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; margin-bottom: 12px; }
.cluster-form input { min-width: 0; }

.cluster-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cluster {
    background: var(--olive-900);
    border: 1px solid var(--olive-600);
    border-left: 3px solid var(--sage-500);
    transition: border-color 0.1s, background 0.1s;
}
body.dragging .cluster { border-style: dashed; border-left-style: solid; }
.cluster.drop-over { border-color: var(--brass); background: #3a3a22; }
.cluster-toggle {
    display: flex; align-items: center; gap: 8px; width: 100%;
    padding: 8px 10px;
    background: none; border: 0; color: var(--sage-100);
    font: inherit; text-align: left; cursor: pointer;
}
.cluster-toggle b { flex: 1; font-weight: 600; letter-spacing: 0.04em; }
.cluster-toggle .caret { color: var(--sage-500); }
.cluster-toggle .count {
    min-width: 26px; padding: 0 6px; text-align: center;
    background: var(--olive-700); font-family: var(--font-mono); font-size: 0.85rem; color: var(--sage-300);
}
.cluster-eng { padding: 0 10px 8px 30px; font-size: 0.9rem; color: var(--sage-300); }
.cluster-eng .inline-form { margin: 0; }
.cluster-members { list-style: none; margin: 0 10px 8px 30px; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.cluster-members li[class^=st-] {
    display: flex; justify-content: space-between; align-items: center;
    padding: 2px 4px 2px 8px; color: #1d2219; font-size: 0.9rem;
}
.cluster-members li.st-new { background: var(--st-new); }
.cluster-members li.st-hub { background: var(--st-hub); }
.cluster-members li.st-armed { background: var(--st-armed); }
.cluster-members li.st-fired { background: var(--st-fired); color: #fff; }
.cluster-members li.st-battery { background: var(--st-battery); color: #fff; }
.cluster-members button { background: none; border: 0; color: inherit; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 4px; }
.cluster .row-actions { padding: 0 10px 8px; margin-top: 0; }
.cluster .link-btn.danger { color: #e88a75; }

.photo-panel:focus { outline: none; }
.photo-panel h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.photo-panel h3 span { color: var(--sage-300); letter-spacing: 0.04em; }
.viewer-frame {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    min-height: 240px;
    background: #0f120d;
    border: 1px solid var(--olive-600);
}
.viewer-frame img { display: block; max-width: 100%; max-height: 60vh; }
.viewer-frame .nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 38px; height: 56px;
    background: rgba(29, 34, 25, 0.75); border: 1px solid var(--olive-600);
    color: var(--sage-100); font-size: 1.8rem; line-height: 1; cursor: pointer;
}
.viewer-frame .nav:hover:not(:disabled) { background: var(--olive-600); }
.viewer-frame .nav:disabled { opacity: 0.25; cursor: default; }
.viewer-frame .prev { left: 6px; }
.viewer-frame .next { right: 6px; }
.viewer-caption { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 0.9rem; color: var(--sage-300); word-break: break-all; }

.toast {
    position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
    max-width: 90vw; padding: 10px 16px;
    background: var(--olive-800); border: 1px solid var(--brass); color: var(--sage-100);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1100px) {
    .mfs-layout { grid-template-columns: 1fr; }
    .side-col { position: static; }
}
@media (max-width: 720px) {
    .shell { grid-template-columns: 1fr; }
    .sidenav { border-right: 0; border-bottom: 1px solid var(--olive-600); padding: 6px 0; }
    .sidenav nav { display: flex; flex-wrap: wrap; }
    .type-filter { display: flex; flex-wrap: wrap; gap: 4px 14px; flex-basis: 100%; }
    .props { grid-template-columns: 1fr; gap: 2px; }
    .props dd { margin-bottom: 8px; }
    .add-grid { grid-template-columns: 1fr; }
    .device .hub-select { max-width: 120px; }
}

/* device lock */
.lock-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 30px; padding: 0;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.35);
    color: #4b5545;
    cursor: pointer;
}
.lock-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.lock-btn:hover:not(:disabled) { background: #fff; color: #1d2219; }
.lock-btn.locked { background: #1d2219; border-color: #1d2219; color: var(--brass); }
.lock-btn.locked svg rect { fill: currentColor; }
.lock-btn.locked:hover { background: #333c2c; color: #e0bd62; }
.lock-btn:disabled { cursor: default; opacity: 0.7; }
.lock-btn:focus-visible { outline: 2px solid var(--brass); outline-offset: 1px; }
.locked-note {
    margin: 0 0 10px; padding: 6px 10px;
    background: #ecebe0; border-left: 4px solid #1d2219;
    font-weight: 600; color: #333c2c;
}
.device-detail input:disabled, .device-detail .toggle:has(input:disabled) { opacity: 0.6; cursor: not-allowed; }

/* -----------------------------------------------------------------------------
   Hubs page
   ----------------------------------------------------------------------------- */

:root { --hub-card: #aebd98; --hub-card-hi: #bccaa7; }

.add-grid.one { grid-template-columns: minmax(0, 320px); }

.hub-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.hub {
    background: var(--hub-card);
    color: #1d2219;
    border: 1px solid #6f7d5f;
    border-left: 5px solid #5d6b4e;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.hub-row { display: flex; align-items: center; gap: 10px; padding-right: 10px; }
.hub-toggle {
    flex: 1; min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(150px, auto) minmax(0, 1fr) auto;
    align-items: baseline; gap: 16px;
    padding: 10px 12px;
    background: none; border: 0; color: inherit;
    font: inherit; text-align: left; cursor: pointer;
}
.hub-toggle:hover { background: var(--hub-card-hi); }
.hub-toggle:focus-visible { outline: 2px solid var(--brass); outline-offset: -2px; }
.hub .caret { color: #4b5545; }
.hub.open .caret { transform: rotate(90deg); }
.hub-id { display: flex; align-items: baseline; gap: 8px; }
.hub-id .fict { color: #4b5545; }
.hub-loc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #333c2c; }
.hub-last { white-space: nowrap; font-size: 0.95rem; }
.hub-last .ago, .props .ago { color: #4b5545; font-size: 0.85rem; margin-left: 4px; }
.hub .muted { color: #56604c; }

/* coloured device drop-down */
.dev-menu { position: relative; }
.dev-menu-btn {
    min-width: 118px; padding: 5px 10px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.35);
    color: #1d2219;
    font: inherit; font-size: 0.9rem; font-weight: 600;
    cursor: pointer;
}
.dev-menu-btn:hover:not(:disabled) { background: #fff; }
.dev-menu-btn:disabled { opacity: 0.45; cursor: not-allowed; font-weight: normal; }
.dev-menu-list {
    position: absolute; right: 0; top: calc(100% + 4px); z-index: 20;
    min-width: 330px; max-height: 60vh; overflow: auto;
    margin: 0; padding: 4px; list-style: none;
    background: var(--olive-800); border: 1px solid var(--olive-600);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
    display: flex; flex-direction: column; gap: 3px;
}

.dev-item {
    display: flex; align-items: baseline; gap: 12px; width: 100%;
    padding: 6px 10px;
    border: 1px solid rgba(0, 0, 0, 0.3);
    background: var(--st-new); color: #1d2219;
    font: inherit; text-align: left; cursor: pointer;
}
.dev-item.st-hub { background: var(--st-hub); }
.dev-item.st-armed { background: var(--st-armed); }
.dev-item.st-fired { background: var(--st-fired); color: #fff; }
.dev-item.st-battery { background: var(--st-battery); color: #fff; }
.dev-item:hover { filter: brightness(1.06); outline: 2px solid var(--brass); outline-offset: -2px; }
.dev-item.selected { outline: 2px solid var(--brass); outline-offset: -2px; }
.dev-item .pos { min-width: 1.6em; font-family: var(--font-mono); opacity: 0.7; }
.dev-item .serial { font-size: 1rem; }
.dev-item .did { font-family: var(--font-mono); font-size: 0.9rem; opacity: 0.75; }
.dev-item .state { margin-left: auto; font-size: 0.85rem; font-weight: 600; opacity: 0.85; }
.dev-item .lk { margin-left: auto; font-size: 0.85rem; }

.hub-detail {
    margin: 0 10px 10px;
    padding: 12px 14px;
    background: #f4f5ee; color: #1d2219;
    border: 1px solid rgba(0, 0, 0, 0.2);
}
.hub-detail .muted { color: #6b7363; }
.hub-detail input:not([type=checkbox]):not([type=file]), .hub-detail select {
    background: #fff !important; color: #1d2219 !important; border-color: #b9bba9 !important;
}

.positions { list-style: none; margin: 0 0 4px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.pos-row { display: flex; align-items: center; gap: 10px; }
.pos-row > .pos { min-width: 1.8em; text-align: right; font-family: var(--font-mono); color: #5b6452; }
.pos-row .dev-item { flex: 1; }
.pos-row.retired { color: #8a907f; font-size: 0.9rem; }
.pos-row.retired .mono { text-decoration: line-through; }

/* device panel */
.device-panel h4 {
    margin: 14px 0 6px;
    font-size: 0.8rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--sage-400);
}
.dp-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 12px;
    background: var(--st-new); color: #1d2219;
    border: 1px solid rgba(0, 0, 0, 0.35);
}
.dp-head.st-hub { background: var(--st-hub); }
.dp-head.st-armed { background: var(--st-armed); }
.dp-head.st-fired { background: var(--st-fired); color: #fff; }
.dp-head.st-battery { background: var(--st-battery); color: #fff; }
.dp-head .serial { font-size: 1.25rem; }
.dp-head .did { font-family: var(--font-mono); font-size: 0.95rem; opacity: 0.8; }
.dp-via { margin: 8px 0 10px; font-size: 0.95rem; color: var(--sage-300); }
.props.compact { grid-template-columns: 90px 1fr; color: var(--sage-100); }
.props.compact dt { color: var(--sage-400); }
.device-panel .toggle { color: #1d2219; }

.cmd-buttons { display: flex; gap: 8px; margin-bottom: 6px; }
.cmd-buttons .btn { flex: 1; }
.btn-arm { background: var(--st-armed); border-color: #f6b765; color: #1d2219; }
.btn-arm:hover { background: #f6b05a; }
.btn-fire { background: var(--st-fired); border-color: #b23a3a; color: #fff; }
.btn-fire:hover { background: #9c1c1c; color: #fff; }
.btn:disabled, .btn:disabled:hover { opacity: 0.35; cursor: not-allowed; background: var(--olive-700); color: var(--sage-400); border-color: var(--olive-600); }

.cmd-log ul.plain li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 4px 0; border-top: 1px solid var(--olive-700); }
.cmd {
    min-width: 58px; padding: 0 6px; text-align: center;
    font-family: var(--font-mono); font-size: 0.8rem;
    background: var(--olive-700); color: var(--sage-100);
}
.cmd-arm { background: var(--st-armed); color: #1d2219; }
.cmd-fire { background: var(--st-fired); color: #fff; }

@media (max-width: 900px) {
    .hub-toggle { grid-template-columns: auto 1fr; }
    .hub-loc, .hub-last { grid-column: 2; }
    .dev-menu-list { min-width: 260px; }
}

/* -----------------------------------------------------------------------------
   Clusters page
   ----------------------------------------------------------------------------- */

.new-cluster { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-bottom: 14px; padding: 12px; }
.new-cluster input { min-width: 0; }
#engineerFilter { min-width: 170px; }

.clusterx-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.clusterx {
    background: var(--olive-800);
    border: 1px solid var(--olive-600);
    border-left: 5px solid var(--brass);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.clusterx-toggle {
    display: grid;
    grid-template-columns: auto minmax(120px, 1fr) minmax(100px, auto) auto auto;
    align-items: center; gap: 16px; width: 100%;
    padding: 10px 12px;
    background: none; border: 0; color: var(--sage-100);
    font: inherit; text-align: left; cursor: pointer;
}
.clusterx-toggle:hover { background: var(--olive-700); }
.clusterx-toggle:focus-visible { outline: 2px solid var(--brass); outline-offset: -2px; }
.clusterx .caret { color: var(--sage-500); }
.clusterx.open .caret { transform: rotate(90deg); }
.cx-name { font-size: 1.1rem; font-weight: 600; letter-spacing: 0.03em; }
.cx-eng { color: var(--brass); }
.cx-sum { display: flex; gap: 10px; }
.cx-sum .sum { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 0.9rem; }
.cx-count { font-family: var(--font-mono); font-size: 0.9rem; color: var(--sage-300); white-space: nowrap; }
.clusterx .hub-detail .btn-danger { color: #fff; }

@media (max-width: 900px) {
    .clusterx-toggle { grid-template-columns: auto 1fr auto; }
    .cx-sum { grid-column: 2; }
    .new-cluster { grid-template-columns: 1fr; }
}

/* -----------------------------------------------------------------------------
   Devices (paired) and Slots
   ----------------------------------------------------------------------------- */

.lead-line { margin: -6px 0 16px; }
.count-badge { margin-left: 10px; font-family: var(--font-mono); font-size: 1rem; letter-spacing: 0; color: var(--sage-400); vertical-align: middle; }
.add-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.table-panel { padding: 0; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    padding: 10px 14px; text-align: left;
    font-size: 0.78rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--sage-400); background: var(--olive-900); border-bottom: 1px solid var(--olive-600);
}
.data-table td { padding: 9px 14px; border-bottom: 1px solid var(--olive-700); vertical-align: baseline; }
.data-table tr:hover td { background: rgba(255, 255, 255, 0.03); }
.data-table .num { color: var(--brass); font-size: 1.05rem; }
.data-table .actions { text-align: right; }
.data-table .link-btn.danger { color: #e88a75; }
.data-table .fict { color: var(--sage-500); }

.kind { padding: 0 7px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; border: 1px solid currentColor; }
.kind-phone { color: #9cc7e6; }
.kind-drone { color: #d8c07a; }
.kind-ugv { color: #b6c98e; }
.kind-other { color: var(--sage-300); }
.slot-tag { font-family: var(--font-mono); }

.slot-grid {
    list-style: none; margin: 0; padding: 0;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px;
}
.slot {
    display: flex; gap: 12px;
    padding: 12px;
    background: var(--olive-800);
    border: 1px solid var(--olive-600);
}
.slot.empty { border-style: dashed; background: rgba(38, 45, 33, 0.6); }
.slot.filled { border-left: 4px solid var(--brass); }
.slot.nm { border-left: 4px solid var(--sage-400); background: var(--olive-700); }
.slot-no {
    flex: none; width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-stencil); font-size: 1.7rem;
    background: var(--olive-900); border: 1px solid var(--olive-600); color: var(--brass);
}
.slot.nm .slot-no { color: var(--sage-300); }
.slot-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.slot-name { font-size: 1.1rem; font-weight: 600; }
.slot-body select { margin-top: 6px; width: 100%; }
.slot .kind { font-size: 0.72rem; }

@media (max-width: 900px) { .add-grid.four { grid-template-columns: 1fr 1fr; } }

/* slots: device + cluster, date codes */
.slot.partial { border-left: 4px solid var(--sage-500); }
.slot-field { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; color: var(--sage-500); }
.slot-field select { margin-top: 0 !important; }
.gen-btn { margin-top: 10px; }
.issues-panel { margin-top: 20px; padding: 16px 0 0; }
.issues-panel h3 { padding: 0 16px; }
.issues-panel > div > .muted { padding: 0 16px 16px; }

.nm-dialog {
    width: min(480px, 94vw);
    padding: 20px 22px;
    background: var(--olive-800); color: var(--sage-100);
    border: 1px solid var(--olive-600); border-top: 6px solid var(--brass);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.nm-dialog::backdrop { background: rgba(10, 12, 8, 0.7); }
.nm-dialog h2 { margin: 0 0 6px; font-family: var(--font-stencil); font-weight: normal; letter-spacing: 0.12em; color: var(--brass); }
.nm-dialog.wide { width: min(1100px, 96vw); }
.nm-dialog.warn { border-top-color: var(--danger); }
.nm-dialog.warn h2 { color: #ff8a70; }
.nm-dialog.warn p { font-size: 1.05rem; }
.dlg-sub { margin: 0 0 14px; color: var(--sage-300); }
.dlg-note { margin: 8px 0; font-size: 0.9rem; color: var(--sage-400); }
.dlg-note.bad { color: #ff8a70; }
.date-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.date-row label { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; color: var(--sage-400); }
.date-row input {
    padding: 8px; background: var(--olive-900); border: 1px solid var(--olive-600);
    color: var(--sage-100); font-family: var(--font-mono); font-size: 1rem; color-scheme: dark;
}
.demo-banner { margin: 0 0 10px; padding: 6px 10px; background: repeating-linear-gradient(-45deg, #5a4a1a 0 10px, #4a3d15 10px 20px); color: #ffe29a; font-weight: 600; letter-spacing: 0.08em; }
.codes-wrap { max-height: 55vh; overflow: auto; border: 1px solid var(--olive-600); }
table.codes { border-collapse: collapse; font-size: 0.85rem; }
table.codes th, table.codes td { padding: 5px 8px; border-bottom: 1px solid var(--olive-700); white-space: nowrap; text-align: left; }
table.codes thead th { position: sticky; top: 0; background: var(--olive-900); color: var(--sage-400); font-family: var(--font-mono); font-weight: normal; }
table.codes tbody th { position: sticky; left: 0; background: var(--olive-800); font-weight: normal; }
table.codes td { color: var(--sage-100); letter-spacing: 0.04em; }

/* -----------------------------------------------------------------------------
   User menu and account page
   ----------------------------------------------------------------------------- */

.user-menu { position: relative; }
.user-btn {
    display: flex; align-items: baseline; gap: 10px;
    padding: 6px 12px;
    background: var(--olive-700); border: 1px solid var(--olive-600);
    color: var(--sage-100); font: inherit; cursor: pointer;
}
.user-btn:hover, .user-btn[aria-expanded=true] { background: var(--olive-600); }
.user-btn:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.user-name { font-family: var(--font-mono); }
.user-role { font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--brass); }
.user-menu-list {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
    min-width: 240px; margin: 0; padding: 4px 0; list-style: none;
    background: var(--olive-800); border: 1px solid var(--olive-600);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}
.user-menu-list a {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    padding: 9px 16px; color: var(--sage-100); text-decoration: none;
}
.user-menu-list a:hover, .user-menu-list a:focus-visible { background: var(--olive-700); outline: none; }
.user-menu-list .sep { border-top: 1px solid var(--olive-600); margin-top: 4px; padding-top: 4px; }
.mfa-flag { padding: 0 6px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; border: 1px solid currentColor; }
.mfa-flag.on { color: var(--ok); }
.mfa-flag.off { color: var(--sage-500); }

.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; max-width: 1200px; }
.acct.wide { grid-column: 1 / -1; padding: 20px 0 8px; }
.acct.wide h3 { padding: 0 20px; }
.acct { scroll-margin-top: 16px; }
.acct:target { border-color: var(--brass); }
.acct-facts { display: grid; grid-template-columns: 110px 1fr; gap: 4px 12px; margin: 0 0 16px; }
.acct-facts dt { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; color: var(--sage-500); padding-top: 2px; }
.acct-facts dd { margin: 0; }
.acct-form .field input { font-size: 1rem; padding: 9px 10px; }
.acct-form .hint { text-transform: none; letter-spacing: 0.02em; font-weight: normal; color: var(--sage-500); }
.code-box { margin-bottom: 16px; padding: 12px; border: 1px dashed var(--brass); background: rgba(200, 162, 74, 0.06); }
.code-box p { margin: 0 0 10px; }
.mfa-state { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 1.2rem; font-weight: 600; }
.mfa-state .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--sage-500); }
.mfa-state.on .dot { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.mfa-state .muted { font-size: 0.95rem; font-weight: normal; }
.sessions .ua { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9rem; color: var(--sage-300); }
.this-session { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ok); }
.sess-actions { padding: 10px 20px; }
.sessions form { margin: 0; }

/* ---- Recent logins (MFS page side column) ---- */
.logins-panel h3 .small { font-family: inherit; letter-spacing: 0.05em; text-transform: none; font-weight: 400; }
.login-list { list-style: none; margin: 0 0 8px; padding: 0; font-size: 0.88rem; }
.login-list li {
    display: grid; grid-template-columns: 1fr auto auto; column-gap: 10px; align-items: baseline;
    padding: 5px 0; border-bottom: 1px solid var(--olive-700);
}
.login-list li:last-child { border-bottom: 0; }
.login-list .who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.login-list time { color: var(--sage-300); }
.login-list .ip { grid-column: 1 / -1; color: var(--sage-500); font-size: 0.8rem; }
.mfa-tag { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; padding: 0 5px; border: 1px solid currentColor; }
.mfa-tag.on { color: var(--sage-300); }
.mfa-tag.off { color: #d8c07a; }

.login-list li.failed { color: #e88a75; }
.login-list li.failed time, .login-list li.failed .ip { color: #c07563; }
.login-list .who.unknown, .login-list .who.typed { font-weight: 400; font-style: italic; }
.mfa-tag.fail { color: #e88a75; }
.fail-key { color: #e88a75; }

/* ---- Day keys to phones: Engineers, Slots, cluster key period ---- */
.warn-list { list-style: none; margin: 0 0 16px; padding: 10px 14px; border-left: 3px solid var(--brass);
    background: rgba(200, 162, 74, 0.08); color: #ecdcae; font-size: 0.9rem; }
.warn-list li + li { margin-top: 4px; }
.key-badge { margin-left: 6px; padding: 0 6px; font-size: 0.75rem; border: 1px solid var(--sage-400); color: var(--sage-300); white-space: nowrap; }
.keys-form { margin-top: 6px; }

.eng-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.eng-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.eng-head h3 { margin: 0; }
.eng-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.eng-edit { margin: 10px 0 0; flex-wrap: wrap; }
.eng-body { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(320px, 2fr); gap: 18px; margin-top: 12px; }
.eng-body h4, .eng-preview h4 { margin: 0 0 6px; font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--sage-400); }
.eng-preview { margin-top: 14px; border-top: 1px dashed var(--olive-600); padding-top: 10px; }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { padding: 3px 0; }
.phones { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.phone { padding: 8px 10px; border: 1px solid var(--olive-600); border-left-width: 3px; }
.phone.st-approved { border-left-color: var(--sage-300); }
.phone.st-pending { border-left-color: var(--brass); }
.phone.st-revoked { border-left-color: #8a5a4f; opacity: 0.8; }
.phone-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; }
.phone-status { font-weight: 700; letter-spacing: 0.06em; }
.phone.st-pending .phone-status { color: var(--brass); }
.phone .row-actions { margin-top: 6px; }
.att summary { cursor: pointer; font-size: 0.85rem; margin-top: 4px; }
.checks { list-style: none; margin: 6px 0 0; padding: 0; font-size: 0.82rem; }
.checks li { padding: 1px 0; }
.ok { color: var(--sage-300); }
.bad, .checks li.bad { color: #e88a75; }
.old-phones { margin-top: 8px; }
.pin-line { margin-top: 18px; word-break: break-all; }
.qr-box { background: #fff; padding: 8px; width: max-content; margin: 12px auto; }
.qr-box svg { display: block; width: min(320px, 70vw); height: auto; }
.qr-box.expired { opacity: 0.15; }
.qr-timer { text-align: center; font-family: var(--font-mono, monospace); color: var(--brass); margin: 0; }
.data-table.preview td, .data-table.preview th { padding: 5px 10px; font-size: 0.85rem; }

.slot-table th, .slot-table td { padding: 6px 8px; }
.slot-table .nm-col { color: var(--sage-500); background: rgba(0, 0, 0, 0.12); }
.slot-cell { min-width: 90px; font-size: 0.85rem; vertical-align: top; }
.slot-cell.taken { background: rgba(140, 154, 122, 0.08); }
.slot-cell select { max-width: 130px; font-size: 0.82rem; }
.held { display: block; font-size: 0.72rem; color: #e0b8a8; margin-top: 2px; }
.held.own { color: var(--sage-400); }

@media (max-width: 900px) { .eng-body { grid-template-columns: 1fr; } .eng-actions { margin-left: 0; } }
