/* =========================================================
   POP — PROOF OF PACKING
   Shared design system for Record, Settings and Help
   ========================================================= */


/* 01. DESIGN TOKENS */
:root {
    /* Core surfaces */
    --pop-bg: #0D1013;
    --pop-surface: #171C21;
    --pop-surface-raised: #20272E;
    --pop-surface-inset: #11161B;
    --pop-border: #303A43;

    /* Typography */
    --pop-text: #F5F7F8;
    --pop-muted: #AAB3BC;
    --pop-subtle: #818C96;

    /* Primary brand accent */
    --pop-sage: #B8F36B;

    /* Supporting accent colours */
    --pop-lavender: #91AFFF;
    --pop-sand: #F2C879;
    --pop-rose: #FF8A72;
    --pop-red: #FF716D;

    /* Additional semantic colours */
    --pop-success: #B8F36B;
    --pop-info: #91AFFF;
    --pop-warning: #F2C879;
    --pop-danger: #FF716D;

    /* Typography */
    --pop-font: 'DM Sans', sans-serif;

    /* Layout */
    --page-width: 1240px;
    --page-gutter: 32px;

    /* Components */
    --radius-card: 22px;
    --radius-control: 13px;

    /* Depth */
    --shadow-card: 0 18px 45px rgba(0, 0, 0, 0.28);
}


/* 02. RESET + GLOBAL */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--pop-bg);
    scroll-behavior: smooth;
}

body,
body.pop-app {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background: var(--pop-bg);
    color: var(--pop-text);
    font-family: var(--pop-font);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
    font: inherit;
}

a {
    color: inherit;
}

::selection {
    background: var(--pop-sage);
    color: #182019;
}

/* Shared small labels */
.section-kicker,
.card-kicker,
.settings-eyebrow,
.help-section-index,
.scan-card-number,
.settings-card-index {
    display: block;
    color: var(--pop-subtle);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.35px;
    line-height: 1.4;
}

/* 03. SHARED HEADER + NAVIGATION */
.app-header {
    position: relative;
    z-index: 100;
    width: 100%;
    height: 76px;
    background: #141719;
    border-bottom: 1px solid var(--pop-border);
}

.header-inner {
    width: 100%;
    max-width: 1600px;
    height: 100%;
    margin: 0 auto;
    padding: 0 4.5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pop-logo,
.pop-logo:hover {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--pop-text);
    text-decoration: none;
    font-size: 29px;
    font-weight: 800;
    letter-spacing: -2px;
    line-height: 1;
}

.pop-logo > span {
    color: var(--pop-sage);
}

.pop-logo small {
    margin-left: 3px;
    padding-left: 12px;
    border-left: 1px solid var(--pop-border);
    color: var(--pop-muted);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 1.3px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 30px;
}

.station-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    border: 1px solid var(--pop-border);
    border-radius: 50px;
    background: var(--pop-surface);
    color: var(--pop-muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.9px;
    white-space: nowrap;
}

.station-dot,
.ready-card-icon,
.scan-live-dot,
.session-live-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: var(--pop-sage);
}

.main-navigation {
    display: flex;
    align-items: center;
    gap: 27px;
}

.main-navigation .nav-link,
.nav-link {
    position: relative;
    padding: 10px 0;
    color: var(--pop-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: color 0.2s ease;
}

.main-navigation .nav-link:hover,
.main-navigation .nav-link.active,
.nav-link:hover,
.nav-link.active {
    color: var(--pop-text);
}

.main-navigation .nav-link.active::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2px;
    border-radius: 2px;
    background: var(--pop-sage);
    content: "";
}

/* Shared page width and alignment */
.app-main,
.pop-settings,
.pop-help {
    width: min(var(--page-width), calc(100% - (var(--page-gutter) * 2)));
    margin-right: auto;
    margin-left: auto;
}

.app-main {
    min-height: calc(100vh - 76px);
    padding: 42px 0 26px;
}

.record-section {
    width: 100%;
    max-width: var(--page-width);
    margin: 0 auto;
    text-align: left;
}

/* 04. RECORD PAGE — IDLE STATE */
.idle-topline {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    margin: 0 auto 30px;
}

.idle-topline h1 {
    margin: 13px 0 11px;
    color: var(--pop-text);
    font-size: clamp(44px, 5vw, 66px);
    font-weight: 700;
    letter-spacing: -3.8px;
    line-height: 0.99;
}

.idle-topline h1 span {
    color: var(--pop-rose);
}

.idle-description {
    max-width: 520px;
    margin: 0;
    color: var(--pop-muted);
    font-size: 15px;
    line-height: 1.65;
}

.ready-card {
    min-width: 126px;
    padding: 17px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    border: 1px solid rgba(196, 216, 183, 0.22);
    border-radius: 17px;
    background: #29352d;
    color: #e2eddd;
}

.ready-card-icon {
    margin-bottom: 4px;
    background: var(--pop-sage);
}

.ready-card span:not(.ready-card-icon) {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.1px;
}

.ready-card strong {
    font-size: 18px;
    letter-spacing: -0.3px;
}

.idle-grid {
    display: flex;
    justify-content: center;
    width: 100%;
}

.idle-grid > .scan-card {
    width: 100%;
    max-width: 760px;
}

.scan-card {
    position: relative;
    width: 100%;
    padding: 30px;
    overflow: hidden;
    border: 1px solid var(--pop-border);
    border-radius: var(--radius-card);
    background: var(--pop-surface);
    box-shadow: var(--shadow-card);
}

.scan-card-top,
.station-info-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.scan-card-number {
    color: var(--pop-subtle);
}

.scan-graphic {
    height: 145px;
    margin: 24px 0 23px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.035);
    border-radius: 17px;
    background: var(--pop-surface-inset);
}

.scan-graphic-inner {
    position: relative;
    width: 180px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scan-bars {
    height: 70px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.scan-bars i {
    display: block;
    width: 4px;
    height: 50px;
    border-radius: 3px;
    background: #e8e8df;
}

.scan-bars i:nth-child(3n) {
    width: 7px;
    height: 68px;
}

.scan-bars i:nth-child(4n) {
    height: 38px;
}

.scan-bars i:nth-child(5n) {
    background: var(--pop-rose);
}

.scan-corner {
    position: absolute;
    width: 17px;
    height: 17px;
    border-color: var(--pop-sage);
    border-style: solid;
}

.corner-tl {
    top: 0;
    left: 0;
    border-width: 2px 0 0 2px;
}

.corner-tr {
    top: 0;
    right: 0;
    border-width: 2px 2px 0 0;
}

.corner-bl {
    bottom: 0;
    left: 0;
    border-width: 0 0 2px 2px;
}

.corner-br {
    right: 0;
    bottom: 0;
    border-width: 0 2px 2px 0;
}

.scan-beam {
    position: absolute;
    width: 100%;
    height: 1px;
    background: var(--pop-rose);
    opacity: 0.7;
}

.scan-card-copy h2 {
    max-width: 600px;
    margin: 0;
    color: var(--pop-text);
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -1.1px;
    line-height: 1.15;
}

.scan-card-copy p {
    max-width: 560px;
    margin: 10px 0 22px;
    color: var(--pop-muted);
    font-size: 14px;
    line-height: 1.7;
}

/* Barcode input */
.barcode-input-wrapper {
    width: 100%;
    margin: 0;
}

.barcode-input-wrapper label {
    display: block;
    margin-bottom: 8px;
    color: #c0c5c2;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
}

.barcode-input-wrapper input {
    width: 100%;
    height: 54px;
    padding: 0 17px;
    border: 1px solid #41494a;
    border-radius: var(--radius-control);
    outline: none;
    background: var(--pop-surface-inset);
    color: var(--pop-text);
    text-align: left;
    text-transform: uppercase;
    font-family: var(--pop-font);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 1px;
    box-shadow: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.barcode-input-wrapper input::placeholder {
    color: #7d8585;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

.barcode-input-wrapper input:focus {
    border-color: var(--pop-sage);
    box-shadow: 0 0 0 3px rgba(196, 216, 183, 0.12);
}

.scan-card-bottom {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 16px;
    color: var(--pop-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
}

.scan-live-dot {
    width: 6px;
    height: 6px;
    flex-basis: 6px;
}

.scan-key-hint {
    margin-left: auto;
    color: var(--pop-subtle);
}

.idle-footer,
.settings-page-footer,
.help-page-footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin: 25px auto 0;
    padding-top: 16px;
    border-top: 1px solid var(--pop-border);
    color: var(--pop-subtle);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.1px;
}

.idle-footer {
    max-width: var(--page-width);
}

/* 05. RECORD PAGE — ACTIVE SESSION */
.active-state {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 0;
}

.active-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
}

.active-shipment h2,
.active-toolbar h2 {
    margin: 7px 0 0;
    color: var(--pop-text);
    font-size: 21px;
    font-weight: 700;
    letter-spacing: 0.2px;
    overflow-wrap: anywhere;
}

.active-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 11px;
}

.recording-status {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 15px;
    border: 1px solid rgba(229, 166, 161, 0.25);
    border-radius: 50px;
    background: rgba(229, 166, 161, 0.1);
    color: var(--pop-rose);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.9px;
}

.recording-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--pop-red);
    animation: popPulse 1.2s infinite;
}

@keyframes popPulse {
    50% { opacity: 0.3; }
}

.abort-recording-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    border: 1px solid rgba(229, 166, 161, 0.3);
    border-radius: 50px;
    background: rgba(229, 166, 161, 0.08);
    color: var(--pop-rose);
    font-family: var(--pop-font);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.abort-recording-btn span {
    font-size: 18px;
    line-height: 12px;
}

.abort-recording-btn:hover {
    background: var(--pop-rose);
    color: #251a18;
}

.camera-workspace {
    position: relative;
    width: 100%;
    min-height: 300px;
    max-height: calc(100svh - 250px);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--pop-border);
    border-radius: 20px;
    background: #080a0b;
    box-shadow: var(--shadow-card);
}

.camera-workspace video {
    display: none;
}

.camera-workspace canvas {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #080a0b;
}

.camera-preview-container {
    position: relative;
    width: 100%;
    margin-top: 18px;
}

.camera-preview-container video {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.camera-preview-container canvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    border-radius: 14px;
    background: #080a0b;
}

.camera-overlay-top {
    position: absolute;
    top: 18px;
    right: 18px;
    left: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
}

.overlay-rec,
.overlay-station {
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 50px;
    background: rgba(8, 10, 10, 0.86);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
}

.overlay-rec {
    display: flex;
    align-items: center;
    gap: 8px;
}

.overlay-rec span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--pop-red);
}

.camera-overlay-bottom {
    position: absolute;
    right: 18px;
    bottom: 18px;
    left: 18px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    pointer-events: none;
}

.overlay-time,
.overlay-tracking {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 13px 17px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 13px;
    background: rgba(8, 10, 10, 0.88);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
}

.overlay-time strong {
    font-size: clamp(19px, 2.5vw, 30px);
    letter-spacing: -0.8px;
}

.overlay-tracking strong {
    font-size: 14px;
    letter-spacing: 0.3px;
}

.active-footer {
    display: grid;
    grid-template-columns: 1fr 0.75fr 1.3fr;
    gap: 12px;
    margin-top: 14px;
    padding: 0;
}

.active-info-card,
.active-scan-hint {
    min-height: 76px;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--pop-border);
    border-radius: 15px;
    background: var(--pop-surface);
}

.active-info-card strong,
.active-scan-hint strong {
    color: var(--pop-text);
    font-size: 13px;
    font-weight: 700;
}

.active-info-card strong {
    display: flex;
    align-items: center;
    gap: 8px;
}

.session-live-dot {
    width: 6px;
    height: 6px;
    flex-basis: 6px;
}

.duration-card {
    border-color: rgba(228, 214, 185, 0.25);
    background: #38352e;
}

.duration-card .card-kicker {
    color: #c9bea9;
}

.duration-card strong {
    color: #f0e5d1;
    font-size: 18px;
    letter-spacing: 0.5px;
}

.active-scan-hint {
    border-color: rgba(185, 199, 235, 0.2);
    background: #292f3d;
}

.active-scan-hint .card-kicker,
.active-scan-hint span {
    color: #b6c1dc;
}

.active-scan-hint strong {
    color: #e8ecf7;
}

/* Operation overlay */
.pop-operation-overlay {
    position: fixed;
    z-index: 2000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(9px);
    -webkit-backdrop-filter: blur(9px);
}

.operation-overlay-card {
    width: 100%;
    max-width: 360px;
    padding: 34px 28px;
    border: 1px solid #3a4142;
    border-radius: 22px;
    background: var(--pop-surface);
    text-align: center;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.45);
}

.operation-overlay-kicker {
    display: block;
    margin-bottom: 12px;
    color: var(--pop-sage);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.operation-spinner {
    width: 35px;
    height: 35px;
    margin: 0 auto 22px;
    border: 3px solid #414849;
    border-top-color: var(--pop-sage);
    border-radius: 50%;
    animation: popSpin 0.8s linear infinite;
}

@keyframes popSpin {
    to { transform: rotate(360deg); }
}

.operation-overlay-icon {
    width: 42px;
    height: 42px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    background: var(--pop-sage);
    color: #1b251b;
    font-size: 20px;
    font-weight: 800;
}

.operation-overlay-card h3 {
    margin: 0 0 9px;
    color: var(--pop-text);
    font-size: 19px;
    font-weight: 700;
}

.operation-overlay-card p {
    margin: 0;
    color: var(--pop-muted);
    font-size: 13px;
    line-height: 1.7;
}

/* Toasts */
.toast-container {
    position: fixed;
    z-index: 2100;
    top: 90px;
    right: 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pop-toast {
    min-width: 270px;
    padding: 15px 18px;
    border: 1px solid #3a4142;
    border-radius: 14px;
    background: #202527;
    color: var(--pop-text);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
    animation: toastIn 0.25s ease;
}

.pop-toast strong {
    display: block;
    margin-bottom: 4px;
    color: var(--pop-text);
    font-size: 13px;
}

.pop-toast span {
    color: var(--pop-muted);
    font-size: 12px;
}

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

/* Scanner inputs remain available to physical barcode scanner */
#scannerCapture,
.scanner-input-hidden {
    position: fixed !important;
    top: 0 !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

#barcodeInput {
    text-transform: uppercase;
}

.navigation-locked {
    opacity: 0.35;
    pointer-events: none;
    cursor: not-allowed;
}

/* 06. SETTINGS PAGE */
.pop-settings {
    padding: 42px 0 26px;
}

.settings-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 34px;
}

.settings-hero h1 {
    margin: 13px 0 10px;
    color: var(--pop-text);
    font-size: clamp(44px, 5vw, 64px);
    font-weight: 700;
    letter-spacing: -3.6px;
    line-height: 1;
}

.settings-hero h1 span {
    color: var(--pop-rose);
}

.settings-hero p {
    max-width: 500px;
    margin: 0;
    color: var(--pop-muted);
    font-size: 15px;
    line-height: 1.65;
}

.settings-hero-badge {
    min-width: 140px;
    padding: 17px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    border: 1px solid rgba(230, 189, 182, 0.22);
    border-radius: 17px;
    background: #3b302f;
    color: #f0d9d5;
}

.settings-hero-icon {
    font-size: 22px;
}

.settings-hero-badge > span:not(.settings-hero-icon) {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
}

.settings-hero-badge strong {
    font-size: 17px;
}

.settings-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 18px;
    align-items: stretch;
}

.pop-settings-card {
    min-width: 0;
    margin: 0;
    padding: 27px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--pop-border);
    border-radius: var(--radius-card);
    background: var(--pop-surface);
    box-shadow: var(--shadow-card);
}

.settings-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
}

.pop-settings .settings-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    font-size: 20px;
}

.storage-settings-icon {
    background: var(--pop-lavender);
    color: #202738;
}

.preferences-settings-icon {
    background: var(--pop-sage);
    color: #263126;
}

.settings-card-index {
    color: var(--pop-subtle);
}

.settings-card-title h2 {
    margin: 8px 0;
    color: var(--pop-text);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.8px;
}

.settings-card-title p {
    max-width: 450px;
    margin: 0;
    color: var(--pop-muted);
    font-size: 14px;
    line-height: 1.7;
}

.pop-settings .storage-location-box {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
    margin-top: 25px;
    padding: 16px;
    border: 1px solid var(--pop-border);
    border-radius: 15px;
    background: var(--pop-surface-inset);
}

.pop-settings .storage-folder-icon {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--pop-lavender);
    color: #202738;
    font-size: 20px;
}

.pop-settings .storage-location-info {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.pop-settings .storage-location-info strong {
    color: var(--pop-text);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.pop-settings .storage-location-info span {
    color: var(--pop-muted);
    font-size: 12px;
    line-height: 1.45;
}

.pop-settings .storage-status {
    padding: 7px 10px;
    border-radius: 50px;
    background: #30373a;
    color: #c0c7c6;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.6px;
    white-space: nowrap;
}

.pop-settings .storage-status.connected {
    background: #344438;
    color: #d1e2c8;
}

.pop-settings .storage-status.permission-needed {
    background: #473d2c;
    color: #ead6a8;
}

.pop-settings .settings-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
}

.pop-settings .settings-primary-btn,
.pop-settings .settings-secondary-btn {
    min-height: 44px;
    padding: 11px 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid transparent;
    border-radius: 50px;
    font-family: var(--pop-font);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.pop-settings .settings-primary-btn {
    background: var(--pop-sage);
    color: #20291f;
}

.pop-settings .settings-primary-btn:hover {
    background: #d3e2ca;
    transform: translateY(-1px);
}

.pop-settings .settings-primary-btn span {
    font-size: 14px;
}

.pop-settings .settings-primary-btn:disabled {
    background: #343c37;
    color: #aab5a9;
    cursor: default;
    transform: none;
}

.pop-settings .settings-secondary-btn {
    border-color: var(--pop-border);
    background: #2a3033;
    color: var(--pop-text);
}

.pop-settings .settings-secondary-btn:hover {
    background: #353d40;
}

.pop-settings .settings-edit-btn {
    width: 43px;
    height: 43px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--pop-border);
    border-radius: 50%;
    background: #2a3033;
    color: var(--pop-text);
    font-size: 17px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.pop-settings .settings-edit-btn:hover {
    background: #3b4549;
}

.pop-settings .storage-message,
.pop-settings .settings-message {
    margin-top: 15px;
    color: var(--pop-muted);
    font-size: 13px;
    line-height: 1.65;
}

.storage-note {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-top: 19px;
    padding: 14px;
    border: 1px solid rgba(185, 199, 235, 0.18);
    border-radius: 12px;
    background: rgba(185, 199, 235, 0.07);
}

.storage-note > span {
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--pop-lavender);
    color: #202738;
    font-size: 11px;
    font-weight: 800;
}

.storage-note p {
    margin: 0;
    color: #c0c9df;
    font-size: 12px;
    line-height: 1.65;
}

/* Preferences preview */
.preferences-preview {
    margin-top: 24px;
    padding: 5px 15px;
    border: 1px solid var(--pop-border);
    border-radius: 15px;
    background: var(--pop-surface-inset);
}

.preference-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--pop-border);
}

.preference-row:last-child {
    border-bottom: 0;
}

.preference-row strong,
.preference-row span {
    display: block;
}

.preference-row strong {
    color: var(--pop-text);
    font-size: 13px;
}

.preference-row div > span {
    margin-top: 4px;
    color: var(--pop-muted);
    font-size: 12px;
    line-height: 1.5;
}

.preference-value,
.preference-enabled {
    padding: 7px 10px;
    border-radius: 50px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.preference-value {
    background: #30373a;
    color: #c0c7c6;
}

.preference-enabled {
    background: #344438;
    color: #d1e2c8;
}

.coming-soon-footer {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-top: auto;
    padding-top: 23px;
}

.coming-soon-label {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 50px;
    background: var(--pop-sage);
    color: #20291f;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.9px;
}

.coming-soon-footer > span:last-child {
    color: var(--pop-subtle);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.8px;
}

.settings-page-footer {
    width: 100%;
}

/* Legacy settings class support, if any old markup remains */
.settings-main {
    width: min(var(--page-width), calc(100% - (var(--page-gutter) * 2)));
    margin: 0 auto;
    padding: 42px 0 26px;
}

.settings-heading {
    margin-bottom: 30px;
}

.settings-eyebrow {
    color: var(--pop-subtle);
}

.settings-heading h1 {
    margin: 12px 0 8px;
    font-size: clamp(40px, 5vw, 60px);
    font-weight: 700;
    letter-spacing: -3px;
}

.settings-heading p,
.settings-card-heading p {
    color: var(--pop-muted);
    font-size: 14px;
}

.settings-card {
    margin-bottom: 18px;
    padding: 26px;
    border: 1px solid var(--pop-border);
    border-radius: var(--radius-card);
    background: var(--pop-surface);
}

.settings-card-heading {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 22px;
}

.settings-card-heading h2 {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
}

.settings-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    background: var(--pop-lavender);
    color: #202738;
}

.storage-location-box {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 16px;
    border: 1px solid var(--pop-border);
    border-radius: 15px;
    background: var(--pop-surface-inset);
}

.storage-folder-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--pop-lavender);
}

.storage-location-info {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.storage-location-info strong {
    font-size: 13px;
    overflow-wrap: anywhere;
}

.storage-location-info span {
    color: var(--pop-muted);
    font-size: 12px;
}

.storage-status {
    padding: 7px 10px;
    border-radius: 50px;
    background: #30373a;
    color: #c0c7c6;
    font-size: 9px;
    font-weight: 800;
}

.settings-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.settings-primary-btn,
.settings-secondary-btn {
    min-height: 44px;
    padding: 11px 18px;
    border: 0;
    border-radius: 50px;
    font-family: var(--pop-font);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.settings-primary-btn {
    background: var(--pop-sage);
    color: #20291f;
}

.settings-secondary-btn {
    background: #30373a;
    color: var(--pop-text);
}

.settings-edit-btn {
    width: 43px;
    height: 43px;
    border: 1px solid var(--pop-border);
    border-radius: 50%;
    background: #30373a;
    color: var(--pop-text);
    cursor: pointer;
}

.storage-message {
    margin-top: 15px;
    color: var(--pop-muted);
    font-size: 13px;
}

.settings-coming-soon {
    opacity: 0.8;
}

/* 07. HELP PAGE */
.pop-help {
    padding: 42px 0 26px;
}

.help-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 43px;
}

.help-hero h1 {
    margin: 13px 0 12px;
    color: var(--pop-text);
    font-size: clamp(44px, 5vw, 64px);
    font-weight: 700;
    letter-spacing: -3.6px;
    line-height: 1;
}

.help-hero h1 span {
    color: var(--pop-rose);
}

.help-hero p {
    max-width: 520px;
    margin: 0;
    color: var(--pop-muted);
    font-size: 15px;
    line-height: 1.7;
}

.help-hero-badge {
    min-width: 140px;
    padding: 17px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    border: 1px solid rgba(196, 216, 183, 0.22);
    border-radius: 17px;
    background: #29352d;
    color: #e2eddd;
}

.help-hero-badge > span {
    font-size: 23px;
    font-weight: 800;
}

.help-hero-badge strong {
    font-size: 10px;
    letter-spacing: 0.4px;
}

.help-hero-badge small {
    color: #b9c9b5;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.8px;
}

.help-section {
    margin-bottom: 42px;
}

.help-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.help-section-heading h2 {
    margin: 8px 0 0;
    color: var(--pop-text);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.7px;
}

.help-section-index {
    color: var(--pop-subtle);
    text-align: right;
}

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

.help-step-card {
    min-height: 270px;
    padding: 23px;
    border: 1px solid var(--pop-border);
    border-radius: var(--radius-card);
    background: var(--pop-surface);
}

.help-step-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.help-step-number {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 800;
}

.help-step-tag {
    color: var(--pop-subtle);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1px;
}

.help-orange {
    background: var(--pop-sand);
    color: #332d22;
}

.help-blue {
    background: var(--pop-lavender);
    color: #252d40;
}

.help-green {
    background: var(--pop-sage);
    color: #263126;
}

.help-step-icon {
    width: 49px;
    height: 49px;
    margin-top: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    font-size: 22px;
    font-weight: 800;
}

.help-step-card h3 {
    margin: 17px 0 8px;
    color: var(--pop-text);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.4px;
}

.help-step-card p {
    margin: 0;
    color: var(--pop-muted);
    font-size: 13px;
    line-height: 1.75;
}

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

.help-info-card {
    display: flex;
    gap: 17px;
    padding: 23px;
    border: 1px solid var(--pop-border);
    border-radius: var(--radius-card);
    background: var(--pop-surface);
}

.help-info-icon {
    width: 43px;
    height: 43px;
    flex: 0 0 43px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    font-size: 21px;
    font-weight: 800;
}

.help-red {
    background: var(--pop-rose);
    color: #352321;
}

.help-info-card h3 {
    margin: 7px 0 9px;
    color: var(--pop-text);
    font-size: 19px;
    font-weight: 700;
}

.help-info-card p,
.help-info-card li {
    color: var(--pop-muted);
    font-size: 13px;
    line-height: 1.75;
}

.help-info-card p {
    margin-bottom: 12px;
}

.help-info-card ul {
    margin: 0;
    padding-left: 18px;
}

.help-info-card li {
    margin-bottom: 5px;
    padding-left: 3px;
}

.help-storage-card {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 28px;
    padding: 26px;
    border: 1px solid var(--pop-border);
    border-radius: var(--radius-card);
    background: var(--pop-surface);
}

.help-storage-visual {
    min-height: 250px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    border: 1px solid rgba(185, 199, 235, 0.2);
    border-radius: 17px;
    background: #30384a;
    color: #e9edf7;
}

.help-folder-icon {
    width: 57px;
    height: 57px;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 28px;
}

.help-storage-visual > span {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1px;
}

.help-storage-visual > strong {
    margin-top: 7px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.help-folder-path {
    width: 100%;
    margin-top: 23px;
    padding-top: 13px;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    color: #c1cbe0;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.6px;
}

.help-storage-content {
    align-self: center;
}

.help-storage-content h3 {
    margin: 0 0 11px;
    color: var(--pop-text);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.6px;
}

.help-storage-content p,
.help-storage-content li {
    color: var(--pop-muted);
    font-size: 13px;
    line-height: 1.8;
}

.help-storage-content ol {
    margin: 14px 0 19px;
    padding-left: 19px;
}

.help-storage-content li {
    margin-bottom: 5px;
    padding-left: 4px;
}

.help-storage-content li strong {
    color: var(--pop-text);
}

.help-action-link {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 11px 17px;
    border-radius: 50px;
    background: var(--pop-sage);
    color: #20291f;
    text-decoration: none;
    font-size: 12px;
    font-weight: 800;
    transition: background 0.2s ease, transform 0.2s ease;
}

.help-action-link:hover {
    transform: translateY(-1px);
    background: #d3e2ca;
    color: #20291f;
}

.help-faq-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.help-faq-item {
    padding: 0 19px;
    border: 1px solid var(--pop-border);
    border-radius: 14px;
    background: var(--pop-surface);
}

.help-faq-item summary {
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    color: var(--pop-text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.help-faq-item summary::-webkit-details-marker {
    display: none;
}

.help-faq-plus {
    width: 27px;
    height: 27px;
    flex: 0 0 27px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #30373a;
    color: var(--pop-sage);
    font-size: 18px;
    transition: transform 0.2s ease;
}

.help-faq-item[open] .help-faq-plus {
    transform: rotate(45deg);
}

.help-faq-item p {
    max-width: 850px;
    margin: 0;
    padding: 0 35px 18px 0;
    color: var(--pop-muted);
    font-size: 13px;
    line-height: 1.8;
}

.help-page-footer a {
    color: var(--pop-sage);
    text-decoration: none;
}

.help-page-footer a:hover {
    color: #d3e2ca;
}

/* 08. RESPONSIVE */
@media (max-width: 950px) {
    .settings-layout {
        grid-template-columns: 1fr;
    }

    .help-storage-card {
        grid-template-columns: 1fr;
    }

    .camera-workspace {
        max-height: none;
    }
}

@media (max-width: 700px) {
    :root {
        --page-gutter: 20px;
    }

    .app-header {
        height: 68px;
    }

    .header-inner {
        padding: 0 20px;
    }

    .pop-logo {
        font-size: 25px;
    }

    .pop-logo small,
    .station-chip {
        display: none;
    }

    .header-right {
        gap: 0;
    }

    .main-navigation {
        gap: 19px;
    }

    .main-navigation .nav-link {
        font-size: 12px;
    }

    .app-main,
    .pop-settings,
    .pop-help {
        width: calc(100% - 40px);
    }

    .app-main,
    .pop-settings,
    .pop-help {
        padding-top: 30px;
    }

    .idle-topline,
    .settings-hero,
    .help-hero {
        align-items: flex-start;
        gap: 16px;
    }

    .idle-topline h1,
    .settings-hero h1,
    .help-hero h1 {
        font-size: clamp(38px, 9vw, 48px);
        letter-spacing: -2.6px;
    }

    .idle-description,
    .settings-hero p,
    .help-hero p {
        font-size: 14px;
    }

    .ready-card,
    .settings-hero-badge,
    .help-hero-badge {
        min-width: 98px;
        padding: 12px;
    }

    .ready-card strong,
    .settings-hero-badge strong {
        font-size: 14px;
    }

    .scan-card {
        padding: 22px;
        border-radius: 19px;
    }

    .scan-graphic {
        height: 125px;
    }

    .scan-card-copy h2 {
        font-size: 26px;
    }

    .scan-card-copy p {
        font-size: 13px;
    }

    .settings-layout,
    .help-info-grid,
    .help-steps-grid {
        grid-template-columns: 1fr;
    }

    .pop-settings-card {
        padding: 21px;
    }

    .settings-card-title h2,
    .help-section-heading h2 {
        font-size: 21px;
    }

    .help-step-card {
        min-height: auto;
    }

    .help-step-card p,
    .help-info-card p,
    .help-info-card li,
    .help-storage-content p,
    .help-storage-content li,
    .help-faq-item p {
        font-size: 13px;
    }

    .help-storage-card {
        padding: 17px;
    }

    .help-storage-visual {
        min-height: 210px;
    }

    .active-toolbar {
        align-items: flex-start;
    }

    .active-toolbar-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 7px;
    }

    .active-shipment h2,
    .active-toolbar h2 {
        font-size: 15px;
    }

    .recording-status,
    .abort-recording-btn {
        padding: 9px 10px;
        font-size: 9px;
    }

    .camera-workspace {
        min-height: 230px;
        aspect-ratio: 4 / 3;
        border-radius: 14px;
    }

    .camera-overlay-top {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .camera-overlay-bottom {
        right: 10px;
        bottom: 10px;
        left: 10px;
    }

    .overlay-rec,
    .overlay-station {
        padding: 7px 9px;
        font-size: 8px;
    }

    .overlay-time,
    .overlay-tracking {
        padding: 9px;
    }

    .overlay-time strong {
        font-size: 15px;
    }

    .overlay-tracking strong {
        font-size: 10px;
    }

    .active-footer {
        grid-template-columns: 1fr 1fr;
    }

    .active-scan-hint {
        grid-column: 1 / -1;
    }

    .storage-location-box {
        flex-wrap: wrap;
    }

    .storage-status {
        margin-left: 57px;
    }

    .help-section {
        margin-bottom: 34px;
    }

    .help-section-heading {
        align-items: flex-end;
    }

    .help-section-index {
        max-width: 100px;
        font-size: 8px;
    }

    .help-page-footer,
    .settings-page-footer,
    .idle-footer {
        font-size: 8px;
    }
}

@media (max-width: 420px) {
    .main-navigation {
        gap: 13px;
    }

    .main-navigation .nav-link {
        font-size: 11px;
    }

    .idle-topline {
        flex-direction: column;
    }

    .ready-card {
        min-width: 100%;
        flex-direction: row;
        align-items: center;
    }

    .ready-card-icon {
        margin: 0 4px 0 0;
    }

    .help-hero {
        flex-direction: column;
    }

    .help-hero-badge {
        min-width: 100%;
    }

    .help-info-card {
        padding: 18px;
    }

    .help-faq-item {
        padding: 0 14px;
    }

    .help-faq-item summary {
        font-size: 13px;
    }

    .idle-footer,
    .settings-page-footer,
    .help-page-footer {
        flex-wrap: wrap;
    }
}

.display-none {
    display: none;
}



/* POP — Operation Overlay Refinement */

.pop-operation-overlay {
    background: rgba(5, 8, 11, 0.78);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.operation-overlay-card {
    padding: 42px 34px;
    border: 1px solid #39434b;
    border-radius: 22px;
    background: #171c21;
    box-shadow: 0 25px 90px rgba(0, 0, 0, 0.55);
}

.operation-spinner {
    width: 42px;
    height: 42px;
    border: 3px solid #35404a;
    border-top-color: #b8f36b;
    border-right-color: #91afff;
    border-radius: 50%;
    animation: popSpin 0.8s linear infinite;
}

.operation-overlay-kicker {
    color: #b8f36b;
    letter-spacing: 1.8px;
}

.operation-overlay-card h3 {
    font-size: 21px;
    letter-spacing: -0.5px;
}

.operation-overlay-card p {
    font-size: 14px;
    line-height: 1.7;
}



/* =================================
   POP — BARCODE INPUT FOCUS
================================= */

#barcodeInput {
    background-color: var(--pop-surface-inset);
    color: var(--pop-text);
    border: 1px solid var(--pop-border);
    box-shadow: none;
    outline: none;
}

#barcodeInput:focus {
    background-color: var(--pop-surface-inset);
    color: var(--pop-text);
    border-color: var(--pop-sage);
    box-shadow: 0 0 0 3px rgba(184, 243, 107, 0.12);
    outline: none;
}

#barcodeInput::placeholder {
    color: var(--pop-subtle);
    opacity: 1;
}
