:root {
    --ink: #242423;
    --paper: #f7f7f2;
    --blue: #3a86ff;
    --amber: #ffbe0b;
    --line: rgba(36, 36, 35, 0.16);
    --muted: #77766d;
    --panel: #ffffff;
    --danger: #ef476f;
    --ready: #3fb950;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--paper);
    color: var(--ink);
    font-family: "Arial Narrow", "Roboto Condensed", "Helvetica Neue", Arial, sans-serif;
    letter-spacing: 0;
}

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.scanner-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(270px, 320px) minmax(0, 1fr);
}

.queue-panel {
    background:
        repeating-linear-gradient(90deg, rgba(247,247,242,.05) 0 2px, transparent 2px 12px),
        var(--ink);
    color: var(--paper);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    min-width: 0;
}

.brand {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand strong {
    display: block;
    font-size: 20px;
    line-height: 1;
}

.brand small,
.eyebrow,
.scan-label,
.metric-band span {
    text-transform: uppercase;
    letter-spacing: 0;
    font-size: 12px;
    color: rgba(247,247,242,.68);
}

.mode-tabs {
    display: grid;
    gap: 8px;
}

.mode-tab,
.icon-button,
.primary-button {
    border: 0;
    min-height: 42px;
    border-radius: 4px;
}

.mode-tab {
    background: transparent;
    color: rgba(247,247,242,.74);
    text-align: left;
    padding: 10px 12px;
    border-left: 4px solid transparent;
}

.mode-tab.is-active {
    color: var(--paper);
    background: rgba(247,247,242,.08);
    border-left-color: var(--amber);
}

.search-box {
    display: grid;
    gap: 7px;
}

.search-box label,
.note-form label {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.search-box input,
.note-form textarea {
    width: 100%;
    border: 1px solid rgba(247,247,242,.16);
    background: rgba(247,247,242,.07);
    color: var(--paper);
    border-radius: 4px;
    padding: 12px;
    outline: none;
}

.queue-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    border-top: 1px solid rgba(247,247,242,.16);
    padding-top: 18px;
}

.queue-head strong {
    font-size: 34px;
}

.queue-list {
    display: grid;
    gap: 10px;
    overflow: auto;
    padding-right: 2px;
}

.queue-item {
    width: 100%;
    color: var(--paper);
    background: rgba(247,247,242,.07);
    border: 1px solid rgba(247,247,242,.14);
    border-radius: 4px;
    padding: 12px;
    text-align: left;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.queue-item:hover,
.queue-item.is-active {
    transform: translateX(4px);
    border-color: var(--blue);
    background: rgba(58,134,255,.16);
}

.queue-item b,
.queue-item span {
    display: block;
}

.queue-item b {
    font-size: 16px;
    margin-bottom: 5px;
}

.queue-item span {
    color: rgba(247,247,242,.68);
    line-height: 1.35;
}

.zone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    padding: 4px 7px;
    margin-top: 10px;
    background: var(--amber);
    color: var(--ink);
    font-size: 11px;
    text-transform: uppercase;
}

.zone.hot {
    background: var(--danger);
    color: white;
}

.zone.ready,
.zone.interview {
    background: var(--ready);
    color: white;
}

.record-panel {
    min-width: 0;
    padding: 22px 24px 28px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 2px solid var(--ink);
    padding-bottom: 18px;
}

.eyebrow {
    color: var(--muted);
    margin: 0 0 7px;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    font-size: clamp(32px, 5vw, 58px);
    line-height: .96;
    margin-bottom: 0;
}

h2 {
    font-size: 24px;
    line-height: 1.12;
}

p {
    line-height: 1.6;
}

.top-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: end;
}

.icon-button {
    width: 44px;
    background: var(--ink);
    color: var(--paper);
}

.primary-button {
    background: var(--blue);
    color: white;
    padding: 0 16px;
    font-weight: 700;
}

.metric-band {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-bottom: 1px solid var(--line);
}

.metric-band article {
    padding: 18px 16px 18px 0;
    border-right: 1px solid var(--line);
}

.metric-band article + article {
    padding-left: 16px;
}

.metric-band span {
    color: var(--muted);
}

.metric-band strong {
    display: block;
    font-size: 34px;
    line-height: 1;
    margin: 8px 0;
}

.metric-band small {
    color: var(--muted);
}

.view {
    display: none;
    padding-top: 22px;
}

.view.is-visible {
    display: block;
    animation: enter .26s ease both;
}

@keyframes enter {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.barcode-ruler {
    height: 34px;
    background: repeating-linear-gradient(90deg, var(--ink) 0 3px, transparent 3px 9px, var(--ink) 9px 11px, transparent 11px 18px);
    opacity: .22;
    margin-bottom: 20px;
}

.record-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(290px, 360px);
    gap: 26px;
}

.active-record,
.next-action,
.analytics-card,
.public-row,
.import-console {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 4px;
}

.active-record,
.next-action {
    padding: 20px;
}

.active-record .scan-label,
.next-action .scan-label,
.section-head .scan-label {
    color: var(--muted);
}

.record-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.record-facts div {
    border-top: 3px solid var(--ink);
    padding-top: 9px;
}

.record-facts dt {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.record-facts dd {
    margin: 4px 0 0;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.checklist {
    display: grid;
    gap: 10px;
}

.check-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 13px 0;
    border-top: 1px solid var(--line);
}

.check-dot {
    width: 22px;
    height: 22px;
    border: 2px solid var(--ink);
    display: grid;
    place-items: center;
    font-size: 12px;
}

.check-row.ready .check-dot {
    background: var(--ready);
    border-color: var(--ready);
    color: white;
}

.check-row.missing .check-dot {
    background: var(--amber);
    border-color: var(--amber);
}

.check-row strong,
.check-row span {
    overflow-wrap: anywhere;
}

.check-row span {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.action-stack {
    display: grid;
    gap: 10px;
    margin: 18px 0;
}

.action-chip {
    padding: 12px;
    background: #f0f0e9;
    border-left: 5px solid var(--amber);
    line-height: 1.4;
}

.note-form {
    display: grid;
    gap: 10px;
}

.note-form textarea {
    color: var(--ink);
    background: #f0f0e9;
    border-color: var(--line);
    resize: vertical;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.analytics-card {
    padding: 18px;
    min-height: 150px;
}

.bar {
    height: 12px;
    background: #ecece4;
    margin: 10px 0 16px;
    overflow: hidden;
}

.bar i {
    display: block;
    height: 100%;
    background: var(--blue);
}

.import-console {
    padding: 18px;
}

.import-console pre {
    margin: 0 0 14px;
    padding: 16px;
    min-height: 210px;
    overflow: auto;
    color: var(--paper);
    background: var(--ink);
    line-height: 1.55;
    white-space: pre-wrap;
}

.public-board {
    display: grid;
    gap: 10px;
}

.public-row {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr) 170px;
    gap: 14px;
    align-items: center;
    padding: 14px;
}

.public-row .barcode {
    font-family: "Arial Narrow", Arial, sans-serif;
    background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 7px);
    min-height: 34px;
    color: transparent;
}

.toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    max-width: min(420px, calc(100vw - 40px));
    background: var(--ink);
    color: var(--paper);
    padding: 13px 15px;
    border-left: 5px solid var(--blue);
    border-radius: 4px;
    box-shadow: 0 18px 40px rgba(36,36,35,.22);
}

@media (max-width: 960px) {
    .scanner-shell,
    .record-grid {
        grid-template-columns: 1fr;
    }

    .queue-panel {
        min-height: auto;
    }

    .queue-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: none;
    }

    .metric-band,
    .analytics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .queue-panel,
    .record-panel {
        padding: 16px;
    }

    .topbar,
    .section-head {
        align-items: stretch;
        flex-direction: column;
    }

    .top-actions {
        justify-content: stretch;
    }

    .top-actions .primary-button {
        flex: 1;
    }

    .metric-band,
    .record-facts,
    .queue-list,
    .analytics-grid,
    .public-row {
        grid-template-columns: 1fr;
    }

    .metric-band article,
    .metric-band article + article {
        padding-left: 0;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .check-row {
        grid-template-columns: 28px minmax(0, 1fr);
    }

    .check-row span {
        grid-column: 2;
    }
}

