/* Gadgets overlay on the shared UNEB shell. */

body.portal {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(900px 420px at 12% -8%, rgba(14, 165, 233, 0.16), transparent 58%),
        radial-gradient(720px 380px at 92% 0%, rgba(14, 165, 233, 0.07), transparent 52%),
        var(--bg);
}
html[data-theme="light"] body.portal {
    background:
        radial-gradient(900px 420px at 12% -8%, rgba(14, 165, 233, 0.1), transparent 58%),
        radial-gradient(720px 380px at 92% 0%, rgba(14, 165, 233, 0.05), transparent 52%),
        var(--bg);
}
.portal-top {
    height: 56px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-elevated) 82%, transparent);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 20;
}
.portal-top .sidebar-brand { margin-right: auto; }
.portal-work {
    flex: 1;
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 28px 16px 48px;
}
.hero-band {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
    gap: 16px;
    align-items: stretch;
    margin-bottom: 22px;
}
.hero-band .page-head { margin-bottom: 0; max-width: none; }
body.portal .page-head h1 {
    margin: 0 0 8px;
    font-family: var(--serif);
    font-size: clamp(30px, 4.2vw, 44px);
    letter-spacing: -0.03em;
    line-height: 1.12;
    font-weight: 500;
}
.module-photo {
    position: relative;
    min-height: 280px;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    margin: 0;
}
.module-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.module-photo figcaption {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--bg) 72%, transparent);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    font-size: 12.5px;
    font-weight: 650;
}
.hero-actions, .slug-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-top: 20px; }
.slug-form label { flex: 1 1 180px; margin: 0; }
.fine { margin: 14px 0 0; color: var(--text-3); font-size: 13px; }
.fine a { color: var(--primary); font-weight: 700; }
.scenes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.scenes figure {
    margin: 0;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
}
.scenes img { width: 100%; height: 220px; object-fit: cover; display: block; }
.scenes figcaption { padding: 12px 14px; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.scenes figcaption b { display: block; color: var(--text); margin-bottom: 2px; }
.pass-steps {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.pass-steps li {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--shadow);
}
.pass-steps b { color: var(--primary); font-size: 12px; letter-spacing: 0.08em; }
.pass-steps strong { display: block; margin: 6px 0 4px; }
.pass-steps span { color: var(--text-2); font-size: 13px; line-height: 1.5; }

.lede { margin: -8px 0 18px; max-width: 760px; color: var(--text-2); font-size: 15px; line-height: 1.65; }
.workspace .stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; align-items: start; }
.panel, .result {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
    box-shadow: var(--shadow);
    min-width: 0;
}
.panel.mint { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.panel h2 { margin: 0 0 8px; font-size: 16px; letter-spacing: -0.02em; }
.panel p { margin: 0 0 14px; color: var(--text-2); font-size: 14px; line-height: 1.65; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }
.panel-head a { color: var(--primary); font-size: 13px; font-weight: 700; text-decoration: none; }
.mode-links { display: flex; flex-wrap: wrap; gap: 8px; }
.plain { margin: 0; padding-left: 18px; color: var(--text-2); }
.plain li { margin: 6px 0; }

.flash.ok { border-color: transparent; background: var(--success-soft); color: var(--success); }
.flash.bad { border-color: transparent; background: var(--danger-soft); color: var(--danger); }
.empty strong { display: block; color: var(--text); font-size: 16px; margin-bottom: 6px; }
.empty .btn { margin-top: 12px; }

.filters, .mode-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin: 0 0 14px;
    width: fit-content;
    max-width: 100%;
}
.filters a, .mode-switch a {
    height: 32px;
    padding: 0 12px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 650;
    text-decoration: none;
    color: var(--text-2);
}
.filters a.on, .mode-switch a.on,
.filters a:hover, .mode-switch a:hover { background: var(--primary-soft); color: var(--text); }

.table-toolbar { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.cards-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.cards-bar-end { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.check-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
}
.check-all input,
.card-stage th input[type="checkbox"],
.pass-pick input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--primary);
    cursor: pointer;
}
.view-toggle {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
}
.view-toggle button {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--text-3);
    height: 32px;
    padding: 0 12px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
}
.view-toggle button svg { width: 14px; height: 14px; display: block; }
.view-toggle button:hover { color: var(--text); background: var(--surface-2); }
.view-toggle button.is-on { background: var(--primary-soft); color: var(--text); }
.card-stage {
    height: 500px;
    max-height: 500px;
    overflow: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
}
.card-stage .table-wrap { overflow: visible; border: 0; border-radius: 0; background: transparent; }
.card-stage.is-list .card-grid,
.card-stage.is-list .device-grid,
.card-stage.is-grid .table-wrap { display: none; }
.device-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px;
    padding: 12px;
}
.gear-line { display: flex; align-items: center; gap: 10px; min-width: 0; }
.gear-mini { width: 42px; height: 32px; color: var(--primary); flex: 0 0 auto; display: grid; place-items: center; }
.gear-mini .gear-svg-laptop { width: 42px; height: auto; }
.gear-mini .gear-svg-tablet { width: 28px; height: auto; }
.gear-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 248px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface-2);
    color: inherit;
    text-decoration: none;
}
.gear-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.gear-visual {
    height: 168px;
    display: grid;
    place-items: center;
    color: var(--text);
    border-radius: 12px;
    border: 1px solid var(--border);
    background:
        radial-gradient(120px 28px at 58% 88%, color-mix(in srgb, var(--text) 16%, transparent), transparent 70%),
        var(--surface);
}
.gear-visual .gear-svg-laptop { width: min(100%, 228px); height: auto; }
.gear-visual .gear-svg-tablet { width: 148px; height: auto; }
.gear-mini .screen-ui,
.gear-mini .kb { display: none; }
.gear-card strong { font-size: 15px; letter-spacing: -0.02em; }
.gear-card .gear-sub { margin: 0; color: var(--text-2); font-size: 12.5px; font-weight: 650; }
.gear-card .gear-sub small { display: block; margin-top: 2px; color: var(--text-3); font-weight: 500; }
.gear-card .gear-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    padding: 12px;
}
.pass-tile {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 168px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-2);
}
.pass-tile-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.pass-pick { display: flex; align-items: flex-start; gap: 8px; min-width: 0; cursor: pointer; }
.pass-pick .mono { font-size: 16px; letter-spacing: 0.06em; line-height: 1.2; }
.pass-who { margin: 0; font-size: 13px; font-weight: 700; color: var(--text); }
.pass-who small { display: block; margin-top: 2px; color: var(--text-3); font-size: 12px; font-weight: 500; }
.pass-serial { margin: 0; color: var(--text-2); font-size: 12.5px; font-weight: 650; }
.pass-serial span { display: block; margin-bottom: 2px; color: var(--text-3); font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.pass-tile-actions { display: flex; gap: 12px; align-items: center; margin-top: auto; padding-top: 8px; }
.pass-tile-actions a { color: var(--primary); font-size: 13px; font-weight: 700; text-decoration: none; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: 0.04em; font-weight: 700; }
.row-actions { display: flex; gap: 12px; justify-content: flex-end; align-items: center; white-space: nowrap; }
.row-actions a, .name-link { color: var(--primary); font-weight: 700; text-decoration: none; }
button.link {
    background: none;
    border: 0;
    padding: 0;
    color: var(--danger);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
td small { display: block; margin-top: 2px; color: var(--text-3); font-size: 12px; font-weight: 500; }
.search-form { display: flex; gap: 8px; align-items: center; margin: 0 0 14px; }
.search-form input { flex: 1; }

.badge.available, .pill.report { border-color: transparent; background: var(--success-soft); color: var(--success); }
.badge.assigned, .pill.issue { border-color: transparent; background: var(--primary-soft); color: var(--primary); }
.badge.retired, .pill.retire { border-color: transparent; background: var(--danger-soft); color: var(--danger); }
.pill.return { border-color: transparent; background: var(--amber-soft); color: var(--amber); }
.pill.take_home { border-color: transparent; background: var(--sky-soft); color: var(--sky); }
.badge.on_campus { border-color: transparent; background: #16a34a; color: #fff; }
.badge.returned { background: #fff; color: #18181b; border: 1px solid #d4d4d8; }
.badge.home { border-color: transparent; background: #dc2626; color: #fff; }
.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.pill svg,
.mode-switch a svg {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
}

.moves { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.move {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-width: 0;
    padding: 8px 10px 8px 8px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-2);
}
.move-body { min-width: 0; }
.move-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--primary);
}
.move-mark svg { width: 18px; height: 18px; }
.move-mark.issue { background: var(--primary-soft); color: var(--primary); }
.move-mark.report { background: var(--success-soft); color: var(--success); }
.move-mark.return { background: var(--amber-soft); color: var(--amber); }
.move-mark.take_home { background: var(--sky-soft); color: var(--sky); }
.move-mark.retire { background: var(--danger-soft); color: var(--danger); }
.move-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.move-top strong {
    min-width: 0;
    font-size: 14px;
    font-weight: 750;
    letter-spacing: -0.02em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.move time { flex: 0 0 auto; color: var(--text-3); font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums; }
.move-body p { display: flex; flex-wrap: wrap; gap: 2px 8px; margin: 3px 0 0; color: var(--text-2); font-size: 12px; line-height: 1.3; }
.move-act { font-weight: 750; color: var(--text); }
.move-body .mono { font-size: 12px; font-weight: 650; }
.move-staff { color: var(--text-3); }
.floor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 10px;
}
.floor-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
}
.floor-link {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}
.floor-card .gear-visual {
    height: 92px;
    border: 0;
    background: transparent;
}
.floor-card .gear-visual .gear-svg-laptop { width: min(100%, 140px); }
.floor-card .gear-visual .gear-svg-tablet { width: 96px; }
.floor-link strong { font-size: 15px; letter-spacing: -0.02em; }
.floor-link p { margin: 0; font-size: 12.5px; font-weight: 650; opacity: 0.8; }
.floor-unit { font-style: normal; font-size: 12px; font-weight: 800; letter-spacing: 0.04em; }
.floor-card.is-use { background: #dcfce7; border-color: #86efac; color: #14532d; }
.floor-card.is-store { background: #fff; border-color: #e4e4e7; color: #18181b; }
.floor-card.is-home { background: #fee2e2; border-color: #fca5a5; color: #7f1d1d; }
.floor-assign { display: flex; gap: 6px; align-items: end; margin: 0; }
.floor-assign label { flex: 1; min-width: 0; margin: 0; }
.floor-assign span { display: block; margin-bottom: 3px; font-size: 10px; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.7; }
.floor-assign select, .locker-panel select { height: 36px; width: 100%; }
.floor-assign .btn { height: 36px; padding: 0 10px; }
.locker-panel { margin-bottom: 14px; }
.unit-list { list-style: none; margin: 10px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.unit-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-2);
}
.unit-picks { display: flex; flex-direction: column; gap: 6px; max-height: min(52vh, 420px); overflow: auto; }
.unit-pick {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.unit-pick strong { font-size: 14px; }
.unit-pick em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--text-3); }
.unit-pick.is-on { background: var(--primary-soft); border-color: transparent; }
.unit-pick.is-on em { color: var(--primary); }
.unit-pick.is-busy { opacity: 0.6; cursor: default; }
.unit-pick:hover:not(:disabled) { background: var(--surface-2); }
.unit-list span, .unit-list a { color: var(--text-2); font-size: 13px; }
.unit-list a { color: var(--primary); font-weight: 750; text-decoration: none; justify-self: end; }
.unit-list form { margin: 0; }
.unit-add { display: flex; gap: 8px; align-items: end; margin: 0; }
.unit-add .field { flex: 1; margin: 0; }
.filters b { font-weight: 800; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .field { margin: 0; }
.span-2 { grid-column: span 2; }
textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; }
.action-stack { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.logo-preview {
    width: 72px;
    height: 72px;
    object-fit: contain;
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 12px;
}

.scan-desk .lede { margin: -4px 0 12px; font-size: 14.5px; }
.scan-desk .mode-switch,
.desk .mode-switch {
    width: 100%;
    max-width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 12px;
    overflow: hidden;
}
.scan-desk .mode-switch a,
.desk .mode-switch a {
    justify-content: center;
    min-width: 0;
    min-height: 58px;
    height: auto;
    padding: 8px 4px;
    flex-direction: column;
    gap: 3px;
    font-size: 11px;
    line-height: 1.15;
    text-align: center;
}
.scan-desk .mode-switch a span,
.desk .mode-switch a span { white-space: normal; overflow-wrap: anywhere; }
.scan-desk .mode-switch a.on { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 35%, transparent); }
.scan-stage {
    margin-bottom: 14px;
    padding: 14px;
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.scan-form { display: grid; gap: 10px; margin: 0; }
.scan-field { margin: 0; }
.scan-field span {
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-3);
}
.scan-field input {
    height: 64px;
    width: 100%;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-align: center;
    border-radius: 16px;
}
.scan-actions { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: 8px; }
.scan-actions .btn { height: 52px; font-size: 15px; min-width: 0; padding-left: 10px; padding-right: 10px; }
.scan-desk { max-width: 100%; }
.scan-note { margin: 10px 2px 0; color: var(--text-3); font-size: 13px; line-height: 1.5; }
.workspace:has(.scan-desk) .page-toolbar { margin-bottom: 6px; }
.workspace:has(.scan-desk) .page-head h2 {
    font-family: var(--serif);
    font-weight: 500;
    font-size: clamp(26px, 4vw, 34px);
    letter-spacing: -0.03em;
}
@media (min-width: 760px) {
    .scan-desk .mode-switch a,
    .desk .mode-switch a {
        flex-direction: row;
        min-height: 42px;
        padding: 0 10px;
        font-size: 13px;
    }
    .scan-form { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
    .scan-actions { grid-template-columns: auto auto; }
    .scan-actions .btn { min-width: 128px; }
    .scan-field input { text-align: left; padding-left: 16px; }
}
.g-modal-head .scan-note { margin-top: 6px; }
.scan-steps { margin-top: 4px; }
.scan-desk.is-result .lede,
.scan-desk.is-result .scan-stage { display: none; }
.scan-hit {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 14px;
}
.scan-hit-hero {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 16px;
}
.scan-hit-hero.is-plain { grid-template-columns: 1fr; }
.scan-hit-art {
    height: 96px;
    display: grid;
    place-items: center;
    color: var(--text);
    border-radius: 16px;
    border: 1px solid var(--border);
    background:
        radial-gradient(70px 22px at 50% 84%, color-mix(in srgb, var(--text) 14%, transparent), transparent 72%),
        var(--surface-2);
}
.scan-hit-art .gear-svg-laptop { width: 96px; height: auto; }
.scan-hit-art .gear-svg-tablet { width: 78px; height: auto; }
.scan-kicker {
    margin: 0;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-3);
}
.scan-hit-id h2 {
    margin: 4px 0 0;
    font-family: var(--serif);
    font-weight: 500;
    font-size: clamp(28px, 7vw, 40px);
    letter-spacing: -0.03em;
    line-height: 1.05;
}
.scan-hit-id > p { margin: 6px 0 0; color: var(--text-2); font-size: 15px; line-height: 1.4; }
.scan-hit-tags { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 10px; }
.scan-hit-id .badge { margin-top: 10px; }
.scan-hit-tags .badge { margin-top: 0; }
.scan-record { color: var(--primary); font-size: 13px; font-weight: 750; text-decoration: none; }
.scan-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin: 0;
    border-top: 1px solid var(--border);
}
.scan-facts div { padding: 12px 16px; border-bottom: 1px solid var(--border); min-width: 0; }
.scan-facts div:nth-child(odd) { border-right: 1px solid var(--border); }
.scan-facts div:last-child:nth-child(odd) { grid-column: 1 / -1; border-right: 0; }
.scan-facts dt {
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-3);
}
.scan-facts dd { margin: 3px 0 0; font-size: 16px; font-weight: 750; letter-spacing: 0.01em; word-break: break-word; }
.scan-fault {
    margin: 0;
    padding: 12px 16px;
    background: var(--danger-soft);
    color: var(--danger);
    font-size: 14px;
    font-weight: 650;
    line-height: 1.45;
}
.scan-hit-actions { display: grid; gap: 8px; padding: 14px 16px 16px; }
.scan-hit-actions .btn { width: 100%; min-height: 52px; }
.camera-go,
.camera-type { width: 100%; height: 48px; margin-top: 10px; }
@media (min-width: 760px) {
    .scan-hit-main {
        display: grid;
        grid-template-columns: minmax(0, 1.15fr) minmax(240px, 0.85fr);
        align-items: stretch;
    }
    .scan-hit-hero { grid-template-columns: 132px minmax(0, 1fr); padding: 22px; }
    .scan-hit-art { height: 120px; }
    .scan-hit-art .gear-svg-laptop { width: 124px; }
    .scan-facts { border-top: 0; border-left: 1px solid var(--border); align-content: center; }
    .scan-hit-hero.is-plain + .scan-facts,
    .scan-hit-main:has(.is-plain) { grid-template-columns: 1fr; }
    .scan-hit-main:has(.is-plain) .scan-facts { border-left: 0; border-top: 1px solid var(--border); }
    .scan-hit-actions { grid-template-columns: repeat(auto-fit, minmax(180px, max-content)); }
    .scan-hit-actions .btn { width: auto; min-width: 180px; }
}
.pass-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 16px 22px;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
    box-shadow: var(--shadow);
    margin-bottom: 14px;
}
.pass-code {
    min-width: 180px;
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.pass-code span { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.pass-code strong { display: block; margin: 6px 0 8px; font-size: 26px; letter-spacing: 0.08em; font-weight: 800; }
.pass-code em { font-style: normal; }
.pass-who h2 { margin: 0 0 6px; font-size: 20px; letter-spacing: -0.03em; }
.pass-who p { margin: 0; color: var(--text-2); font-size: 14px; line-height: 1.55; }
.pass-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr; gap: 8px; }
.pass-actions .btn { width: 100%; min-height: 48px; }
@media (min-width: 760px) {
    .pass-actions { grid-template-columns: repeat(auto-fit, minmax(180px, max-content)); justify-content: start; }
    .pass-actions .btn { width: auto; min-width: 180px; }
}
.camera {
    position: relative;
    margin: 0;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #000;
    min-height: 240px;
}
.camera video { width: 100%; max-height: 360px; min-height: 240px; display: block; object-fit: cover; background: #000; }
.finder {
    position: absolute;
    inset: 13% 16%;
    pointer-events: none;
    box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.45);
}
.finder i {
    position: absolute;
    width: 22px;
    height: 22px;
    border: 3px solid #f8fafc;
}
.finder i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.finder i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.finder i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.finder i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.finder b {
    position: absolute;
    left: 8%;
    right: 8%;
    height: 2px;
    top: 16%;
    background: #38bdf8;
    box-shadow: 0 0 12px #38bdf8;
    animation: scan-beam 1.5s ease-in-out infinite;
}
.camera.is-hit .finder i { border-color: #4ade80; }
.camera.is-hit .finder b { opacity: 0; }
@keyframes scan-beam {
    0%, 100% { top: 14%; }
    50% { top: 84%; }
}
.fault { margin: 8px 0 0; color: var(--danger); font-size: 13px; }
.device-meta { margin: 0 0 12px; color: var(--text-2); font-size: 14px; line-height: 1.6; }
.callout {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--text);
    font-size: 13px;
    line-height: 1.5;
    font-weight: 600;
}
.callout.warn { background: var(--danger-soft); color: var(--danger); }
.assign-kind {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
}
.assign-kind-btn {
    appearance: none;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.assign-kind-btn.is-on {
    background: var(--primary-soft);
    border-color: transparent;
    color: var(--text);
}
.student-recall { margin-bottom: 14px; }
.student-recall .scan-note { margin: 8px 0; }
.student-matches {
    max-height: 280px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
}
.student-match {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid var(--border);
    background: transparent;
    color: inherit;
    text-align: left;
    font: inherit;
    cursor: pointer;
}
.student-match:last-child { border-bottom: 0; }
.student-match:hover { background: var(--surface-2); }
.student-match.is-on { background: var(--primary-soft); }
.student-match.is-busy { cursor: default; opacity: 0.72; }
.student-match strong { display: block; font-size: 13.5px; }
.student-match small { display: block; margin-top: 2px; color: var(--text-3); font-size: 12px; }
.student-match em { display: block; margin-top: 3px; font-style: normal; font-size: 12px; font-weight: 700; color: var(--success); }
.student-match.is-busy em { color: var(--amber); }
.student-empty { margin: 0; padding: 12px; color: var(--text-3); font-size: 13px; }
.serial-hint { margin: 6px 0 0; font-size: 12px; color: var(--primary); font-weight: 650; }
.serial-hint.warn { color: var(--danger); }
.form-section { margin-bottom: 8px; }
.form-section h4 {
    margin: 0 0 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-3);
}
.summary { margin: 0 0 12px; }
.summary div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.summary dt { color: var(--text-3); font-size: 12px; font-weight: 700; }
.summary dd { margin: 0; text-align: right; font-weight: 700; }
.receipt-copy { margin: 0; font-size: 16px; line-height: 1.55; }
.g-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.g-modal.open { display: flex; }
.g-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
}
.g-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(760px, 100%);
    max-height: min(92vh, 900px);
    overflow: auto;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}
.g-modal-dialog.narrow { width: min(480px, 100%); }
#assignModal.is-full { padding: 0; align-items: stretch; }
#assignModal.is-full .g-modal-dialog {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    overflow: hidden;
}
#assignModal.is-full #assignForm {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: auto;
}
#assignModal.is-full .g-modal-body { width: min(1040px, 100%); margin-left: auto; margin-right: auto; }
#assignModal.is-full .g-modal-foot {
    position: sticky;
    bottom: 0;
    margin-top: auto;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding-top: 12px;
}
@media (min-width: 721px) {
    #assignModal.is-full .form-grid { grid-template-columns: 1fr 1fr; }
    #assignModal.is-full .span-2 { grid-column: span 2; }
}
.g-modal-head, .g-modal-body, .g-modal-foot { padding-left: 18px; padding-right: 18px; }
.g-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-top: 18px; }
.g-modal-head h3 { margin: 0; font-size: 22px; letter-spacing: -0.03em; }
.g-modal-body { padding-top: 14px; padding-bottom: 8px; }
.g-modal-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding-bottom: 18px; }
body.g-modal-open { overflow: hidden; }
.desk-brief {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.7fr);
    gap: 14px;
    align-items: center;
    margin-bottom: 8px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background:
        radial-gradient(480px 200px at 100% 0%, rgba(14, 165, 233, 0.16), transparent 62%),
        var(--surface);
    box-shadow: var(--shadow);
}
.desk-kicker {
    margin: 0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--primary);
}
.desk-brief h3 {
    margin: 4px 0;
    font-family: var(--serif);
    font-size: clamp(18px, 2vw, 24px);
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 1.15;
}
.desk-brief p { margin: 0; color: var(--text-2); font-size: 12.5px; line-height: 1.45; }
.desk-rates { display: grid; gap: 8px; }
.rate {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1px 10px;
    align-items: center;
    padding: 7px 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 62%, transparent);
}
.rate span { font-size: 11px; font-weight: 650; color: var(--text-3); }
.rate strong { font-size: 15px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.rate .meter { grid-column: 1 / -1; height: 4px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.rate .meter i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--primary); }
.rate .meter.campus i { background: var(--amber); }
.rate .meter.clear i { background: var(--success); }
.desk-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 8px;
}
.kpi {
    position: relative;
    overflow: hidden;
    padding: 10px 12px 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
}
.kpi::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--kpi, var(--primary));
}
.kpi .label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-3);
}
.kpi .value {
    margin-top: 4px;
    font-size: 22px;
    font-weight: 750;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.kpi .hint { margin: 4px 0 0; font-size: 11.5px; color: var(--text-2); line-height: 1.35; }
.kpi.up .hint { color: var(--success); }
.kpi.down .hint { color: var(--amber); }
.desk-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}
.desk .panel { padding: 12px 14px; }
.desk .panel h2 { font-size: 14px; }
.desk-note { color: var(--text-3); font-size: 11px; font-weight: 700; }
.desk-empty { margin: 0; color: var(--text-3); font-size: 12.5px; line-height: 1.45; }
.mix-track {
    display: flex;
    height: 12px;
    gap: 3px;
    margin: 4px 0 14px;
    padding: 0;
    border-radius: 999px;
    overflow: hidden;
    background: var(--surface-2);
}
.mix-seg { display: block; min-width: 8px; border-radius: 999px; }
.mix-seg.pool, .mix-legend i.pool { background: var(--success); }
.mix-seg.attached, .mix-legend i.attached { background: var(--primary); }
.mix-seg.retired, .mix-legend i.retired { background: var(--danger); }
.mix-seg.campus, .mix-legend i.campus { background: var(--success); }
.mix-seg.store, .mix-legend i.store { background: var(--amber); }
.mix-seg.home, .mix-legend i.home { background: var(--sky); }
.mix-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mix-legend li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; font-size: 13px; }
.mix-legend i { width: 10px; height: 10px; border-radius: 999px; }
.mix-legend span { color: var(--text-2); }
.mix-legend strong { font-variant-numeric: tabular-nums; }
.mix-legend em { min-width: 36px; text-align: right; font-style: normal; color: var(--text-3); font-size: 12px; font-weight: 700; }
.week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    height: 108px;
    align-items: end;
}
.week-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; height: 100%; }
.week-val { min-height: 16px; font-size: 11px; font-weight: 700; color: var(--text-3); font-variant-numeric: tabular-nums; }
.week-bar {
    width: 100%;
    max-width: 28px;
    border-radius: 8px 8px 4px 4px;
    background: linear-gradient(180deg, var(--primary), color-mix(in srgb, var(--primary) 55%, var(--bg)));
}
.week-bar.is-empty { background: var(--surface-2); }
.week-name { font-size: 11px; font-weight: 700; color: var(--text-3); letter-spacing: 0.02em; }
.today-list { list-style: none; margin: 0; padding: 0; }
.today-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}
.today-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.today-list strong { font-size: 16px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.ranks { display: grid; gap: 8px; }
.rank-top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: 13px; font-weight: 700; }
.rank-top strong { font-variant-numeric: tabular-nums; }
.rank-track { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.rank-track i { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.watch-list { display: grid; gap: 8px; }
.watch {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
}
.watch:last-child { border-bottom: 0; padding-bottom: 0; }
.watch strong { display: block; font-size: 14px; }
.watch small, .watch p { display: block; margin: 3px 0 0; color: var(--text-3); font-size: 12px; line-height: 1.45; }
.watch p { color: var(--text-2); }
.watch .badge { flex: 0 0 auto; }

.dossier-hero {
    display: grid;
    grid-template-columns: 168px minmax(0, 1fr) minmax(220px, 280px);
    gap: 18px;
    align-items: center;
    margin-bottom: 14px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.dossier-art {
    height: 140px;
    display: grid;
    place-items: center;
    color: var(--text);
    border-radius: 14px;
    border: 1px solid var(--border);
    background:
        radial-gradient(80px 28px at 50% 82%, color-mix(in srgb, var(--text) 14%, transparent), transparent 72%),
        var(--surface-2);
}
.dossier-art .gear-svg-laptop { width: 148px; height: auto; }
.dossier-art .gear-svg-tablet { width: 118px; height: auto; }
.dossier-machine {
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 1.1;
}
.dossier-meta { margin: 8px 0 0; color: var(--text-2); font-size: 14px; line-height: 1.5; }
.dossier-tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.dossier-pass { color: var(--text-2); font-size: 13px; font-weight: 750; letter-spacing: 0.06em; }
.dossier-actions { display: flex; flex-direction: column; gap: 10px; }
.dossier-act { margin: 0; }
.dossier-act .btn { width: 100%; }
.dossier-act p { margin: 5px 0 0; color: var(--text-2); font-size: 12.5px; line-height: 1.45; }
.dossier-quiet {
    margin: 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--surface-2);
    color: var(--text-2);
    font-size: 13.5px;
    line-height: 1.55;
}
.dossier-quiet a { color: var(--primary); font-weight: 750; }
.dossier-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.85fr);
    gap: 14px;
    align-items: start;
}
.dossier-side { display: flex; flex-direction: column; gap: 14px; }
.dossier-edit .form-section { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.dossier-edit .form-section:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.form-foot { display: flex; justify-content: flex-end; margin-top: 8px; }
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.specs span { display: block; font-size: 11px; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.specs strong { display: block; margin-top: 3px; font-size: 14px; font-weight: 650; line-height: 1.35; word-break: break-word; }
.dossier-empty { margin: 0; color: var(--text-3); font-size: 13.5px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 18px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 7px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.timeline li:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 3px;
    top: 18px;
    bottom: 0;
    width: 2px;
    background: var(--border);
}
.timeline-body strong { display: block; margin-top: 6px; font-size: 13px; letter-spacing: 0.04em; }
.timeline-body small { display: block; margin-top: 3px; color: var(--text-2); font-size: 12.5px; line-height: 1.4; }
.timeline-body time { display: block; margin-top: 4px; color: var(--text-3); font-size: 12px; }
.workspace:has(.dossier) .page-head h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(26px, 3vw, 34px); letter-spacing: -0.03em; }
.workspace:has(.desk) .page-head h2 { font-size: 22px; }
.workspace:has(.desk) .page-toolbar { margin-bottom: 10px; }
@media (max-width: 720px) {
    .scan-desk[data-camera-first="1"] .lede,
    .scan-desk[data-camera-first="1"] .scan-stage,
    .scan-desk[data-camera-first="1"] .scan-steps { display: none; }
    .scan-desk .scan-steps { gap: 6px; margin-top: 0; }
    .scan-desk .scan-steps li { padding: 8px 10px; border-radius: 10px; box-shadow: none; }
    .scan-desk .scan-steps b { font-size: 10px; }
    .scan-desk .scan-steps strong { margin: 2px 0 1px; font-size: 13px; }
    .scan-desk .scan-steps span { font-size: 12px; line-height: 1.35; }
    .workspace:has(.scan-desk) { padding-top: 8px; padding-bottom: 78px; }
    .workspace:has(.scan-desk) .page-toolbar { margin-bottom: 2px; }
    .workspace:has(.scan-desk) .eyebrow { margin-bottom: 2px; font-size: 10px; }
    .workspace:has(.scan-desk) .page-head h2 { font-size: 22px; margin: 0; line-height: 1.05; }
    .scan-desk .lede { margin: 2px 0 8px; font-size: 12.5px; line-height: 1.35; }
    .scan-desk .mode-switch,
    .desk .mode-switch { margin-bottom: 8px; padding: 3px; border-radius: 10px; }
    .scan-desk .mode-switch a,
    .desk .mode-switch a { min-height: 42px; padding: 4px 2px; gap: 1px; font-size: 10px; }
    .scan-desk .mode-switch a svg,
    .desk .mode-switch a svg { width: 13px; height: 13px; }
    .scan-stage { margin-bottom: 8px; padding: 8px 10px 10px; border-radius: 14px; }
    .scan-form { gap: 6px; }
    .scan-field span { margin-bottom: 3px; font-size: 10px; }
    .scan-field input { font-size: 20px; letter-spacing: 0.1em; height: 42px; border-radius: 10px; }
    .scan-actions { gap: 6px; }
    .scan-actions .btn { height: 40px; font-size: 14px; }
    .scan-note { margin: 6px 0 0; font-size: 11.5px; line-height: 1.3; }
    .pass-card { grid-template-columns: 1fr; }
    .scan-result .pass-code,
    .scan-result .pass-who { text-align: center; }
    body:has(.scan-desk) .g-modal { padding: 0; align-items: flex-end; }
    body:has(.scan-desk) .g-modal-dialog,
    body:has(.scan-desk) .g-modal-dialog.narrow {
        width: 100%;
        max-height: min(94dvh, 940px);
        border-radius: 22px 22px 0 0;
    }
    body:has(.scan-desk) #cameraModal { align-items: stretch; }
    body:has(.scan-desk) #cameraModal .g-modal-dialog {
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
    }
    body:has(.scan-desk) .camera video { min-height: 58dvh; max-height: none; }
    body:has(.scan-desk) .g-modal-foot { flex-direction: column; align-items: stretch; }
    body:has(.scan-desk) .g-modal-foot .btn { width: 100%; height: 48px; }
    .assign-kind-btn { height: 48px; }
    .student-matches { max-height: min(42dvh, 320px); }
    .cards-bar { align-items: stretch; flex-wrap: wrap; }
    .card-grid, .device-grid, .specs { grid-template-columns: 1fr; }
    .cards-bar:has([data-device-view]) { display: none; }
    #deviceStage .device-grid { display: none; }
    #deviceStage .table-wrap { display: block; }
    #deviceStage.is-list { overflow-x: hidden; }
    #deviceStage.is-list table,
    #deviceStage.is-list tbody { display: block; width: 100%; }
    #deviceStage.is-list thead { display: none; }
    #deviceStage.is-list tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 4px 10px;
        margin: 10px;
        padding: 12px;
        border: 1px solid var(--border);
        border-radius: 16px;
        background: var(--surface-2);
    }
    #deviceStage.is-list td {
        display: block;
        width: auto;
        min-width: 0;
        padding: 0;
        border: 0;
    }
    #deviceStage.is-list td:nth-child(1) { grid-column: 1; grid-row: 1; }
    #deviceStage.is-list td:nth-child(1) .name-link { font-size: 16px; font-weight: 800; }
    #deviceStage.is-list td:nth-child(4) { grid-column: 2; grid-row: 1; align-self: start; }
    #deviceStage.is-list td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
    #deviceStage.is-list td:nth-child(3) { grid-column: 1; grid-row: 3; overflow-wrap: anywhere; }
    #deviceStage.is-list td:nth-child(5) { grid-column: 2; grid-row: 3; text-align: right; }
    #deviceStage.is-list td:nth-child(3)::before,
    #deviceStage.is-list td:nth-child(5)::before {
        display: block;
        margin-bottom: 2px;
        font-size: 10px;
        font-weight: 750;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--text-3);
    }
    #deviceStage.is-list td:nth-child(3)::before { content: "Serial"; }
    #deviceStage.is-list td:nth-child(5)::before { content: "Pass"; }
    .view-toggle:has([data-card-view]) { display: none; }
    #cardStage .card-grid { display: none; }
    #cardStage .table-wrap { display: block; }
    #cardStage { overflow-x: hidden; }
    #cardStage table,
    #cardStage tbody { display: block; width: 100%; }
    #cardStage thead { display: none; }
    #cardStage tr {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 4px 10px;
        margin: 10px;
        padding: 12px;
        border: 1px solid var(--border);
        border-radius: 16px;
        background: var(--surface-2);
    }
    #cardStage td {
        display: block;
        width: auto;
        min-width: 0;
        padding: 0;
        border: 0;
    }
    #cardStage td:nth-child(1) { grid-column: 1; grid-row: 1; align-self: center; }
    #cardStage td:nth-child(2) { grid-column: 2; grid-row: 1; align-self: center; font-size: 16px; }
    #cardStage td:nth-child(3) { grid-column: 3; grid-row: 1; align-self: center; }
    #cardStage td:nth-child(4) { grid-column: 2 / -1; grid-row: 2; }
    #cardStage td:nth-child(5) { grid-column: 2 / -1; grid-row: 3; overflow-wrap: anywhere; }
    #cardStage td:nth-child(6),
    #cardStage td.row-actions { grid-column: 2 / -1; grid-row: 4; display: flex; justify-content: flex-start; }
    #cardStage td:nth-child(5)::before {
        content: "Serial";
        display: block;
        margin-bottom: 2px;
        font-size: 10px;
        font-weight: 750;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--text-3);
    }
}

@media (max-width: 1024px) {
    .workspace .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hero-band, .scenes, .pass-steps, .split, .form-grid, .desk-brief, .desk-grid, .dossier-hero, .dossier-grid { grid-template-columns: 1fr; }
    .desk-kpis { grid-template-columns: 1fr 1fr; }
    .span-2 { grid-column: auto; }
}
@media (max-width: 860px) {
    body.portal .portal-work { padding-bottom: 28px; }
}
