/* ===========================================================================
   Inventory by CrewByte — inventory.crewbyte.io

   Owns the `cb-inv-` namespace and nothing else. Loaded after app.css, which
   supplies the type scale, colour and form styling so the extension reads as
   the same product rather than a lookalike.

   A separate file is right here, unlike a new page inside Core: this is a
   different entrypoint that no other surface loads, so it cannot be dropped on
   a deploy without the whole product being obviously missing — the failure
   mode that made announcements.css a bad idea does not apply.
   =========================================================================== */

.cb-inv-body {
    --inv-navy: #0C2A5E;
    --inv-blue: #2C8FE5;
    --inv-blue-strong: #1474C5;
    --inv-ink: #0B1D3A;
    --inv-muted: #5B7391;
    --inv-faint: #8B9BB0;
    --inv-line: #DEE8F3;
    --inv-surface: #FFFFFF;
    --inv-canvas: #F4F8FC;
    --inv-good: #0C7F4F;
    --inv-bad: #C4384A;
    --inv-radius: 12px;

    margin: 0;
    min-height: 100vh;
    background: var(--inv-canvas);
    color: var(--inv-ink);
    font-family: inherit;
}

/* ------------------------------------------------------------------ chrome */

.cb-inv-bar {
    background: linear-gradient(100deg, var(--inv-navy) 0%, #123A78 100%);
    position: sticky;
    top: 0;
    z-index: 20;
}

.cb-inv-bar-inner {
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 58px;
}

.cb-inv-brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; flex: none; }
.cb-inv-brand img { height: 22px; width: auto; display: block; }
.cb-inv-brand em {
    font-style: normal;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #7FC2F5;
    padding-left: 9px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.cb-inv-nav { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; }
.cb-inv-nav a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    white-space: nowrap;
}
.cb-inv-nav a:hover { background: rgba(255, 255, 255, 0.08); color: #FFFFFF; }
.cb-inv-nav a.is-active { background: rgba(255, 255, 255, 0.14); color: #FFFFFF; }
.cb-inv-nav svg { width: 15px; height: 15px; }

.cb-inv-account { display: flex; align-items: center; gap: 10px; flex: none; }
.cb-inv-workspace { font-size: 12.5px; color: rgba(255, 255, 255, 0.68); white-space: nowrap; }

.cb-inv-switch select,
.cb-inv-account select {
    font: inherit;
    font-size: 12.5px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
}
.cb-inv-switch option { color: var(--inv-ink); }

.cb-inv-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 12.5px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    white-space: nowrap;
}
.cb-inv-back:hover { background: rgba(255, 255, 255, 0.1); }
.cb-inv-back svg { width: 13px; height: 13px; }

.cb-inv-signout button {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    cursor: pointer;
}
.cb-inv-signout button:hover { background: rgba(255, 255, 255, 0.2); }
.cb-inv-signout svg { width: 15px; height: 15px; }

.cb-inv-main { padding: 28px 0 64px; }
.cb-inv-shell { width: min(1180px, 100%); margin: 0 auto; padding: 0 24px; }

/* -------------------------------------------------------------- page head */

.cb-inv-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}
.cb-inv-head h1 { margin: 0 0 5px; font-size: 24px; font-weight: 750; letter-spacing: -0.025em; color: var(--inv-ink); }
.cb-inv-head p { margin: 0; font-size: 14px; color: var(--inv-muted); }

/* ------------------------------------------------------------------ stats */

.cb-inv-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 22px;
}
@media (min-width: 560px) { .cb-inv-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .cb-inv-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.cb-inv-stats article {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 17px 18px;
    background: var(--inv-surface);
    border: 1px solid var(--inv-line);
    border-radius: var(--inv-radius);
}
.cb-inv-stats strong { font-size: 24px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.1; }
.cb-inv-stats small { font-size: 12px; color: var(--inv-faint); }
.cb-inv-stats article.is-down strong { color: var(--inv-bad); }
.cb-inv-stats article.is-up strong { color: var(--inv-good); }

/* ----------------------------------------------------------------- panels */

.cb-inv-panel {
    background: var(--inv-surface);
    border: 1px solid var(--inv-line);
    border-radius: var(--inv-radius);
    margin-bottom: 18px;
    overflow: hidden;
}
.cb-inv-panel > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--inv-line);
}
.cb-inv-panel > header h2 { margin: 0; font-size: 14.5px; font-weight: 700; }
.cb-inv-panel > header a { font-size: 12.5px; font-weight: 600; color: var(--inv-blue-strong); text-decoration: none; }
.cb-inv-panel-body { padding: 18px; }

.cb-inv-summary { margin: 0 0 10px; font-size: 13.5px; color: var(--inv-muted); }
.cb-inv-note { margin: 0 0 12px; font-size: 13px; line-height: 1.6; color: var(--inv-muted); }
.cb-inv-note.is-quiet { color: var(--inv-faint); font-size: 12.5px; }
.cb-inv-good { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--inv-good); }
.cb-inv-good svg { width: 15px; height: 15px; }

.cb-inv-formula {
    margin: 0 0 18px;
    padding: 14px 16px;
    background: #EAF5FF;
    border-left: 3px solid var(--inv-blue);
    border-radius: 0 var(--inv-radius) var(--inv-radius) 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--inv-muted);
}
.cb-inv-formula strong { color: var(--inv-ink); display: block; margin-bottom: 3px; }

/* ------------------------------------------------------------------- feed */

.cb-inv-feed { list-style: none; margin: 0; padding: 0; }
.cb-inv-feed li {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 11px 18px;
    border-bottom: 1px solid var(--inv-line);
}
.cb-inv-feed li:last-child { border-bottom: 0; }
.cb-inv-feed-qty {
    flex: none;
    min-width: 54px;
    text-align: center;
    padding: 5px 8px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.cb-inv-feed-qty.is-in { background: rgba(12, 127, 79, 0.1); color: var(--inv-good); }
.cb-inv-feed-qty.is-out { background: rgba(196, 56, 74, 0.1); color: var(--inv-bad); }
.cb-inv-feed-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cb-inv-feed-copy strong { font-size: 13.5px; font-weight: 650; }
.cb-inv-feed-copy small { font-size: 12px; color: var(--inv-faint); }

/* ------------------------------------------------------------------- tabs */

.cb-inv-tabs { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.cb-inv-tabs a {
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: var(--inv-muted);
    text-decoration: none;
    border: 1px solid transparent;
}
.cb-inv-tabs a:hover { background: var(--inv-surface); }
.cb-inv-tabs a.is-active { background: var(--inv-surface); border-color: var(--inv-line); color: var(--inv-ink); }

/* ------------------------------------------------------------------- list */

.cb-inv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

.cb-inv-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 15px 18px;
    background: var(--inv-surface);
    border: 1px solid var(--inv-line);
    border-radius: var(--inv-radius);
    text-decoration: none;
    color: inherit;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}
.cb-inv-row:hover { border-color: rgba(44, 143, 229, 0.4); box-shadow: 0 8px 22px rgba(12, 42, 94, 0.08); }
.cb-inv-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cb-inv-row-main strong { font-size: 14.5px; font-weight: 650; }
.cb-inv-row-main small { font-size: 12.5px; color: var(--inv-faint); }
.cb-inv-row-go { flex: none; color: var(--inv-faint); }
.cb-inv-row-go svg { width: 15px; height: 15px; }

.cb-inv-progress { flex: none; display: flex; align-items: center; gap: 9px; }
.cb-inv-progress-bar { display: block; width: 84px; height: 5px; border-radius: 999px; background: var(--inv-line); overflow: hidden; }
.cb-inv-progress-bar i { display: block; height: 100%; background: var(--inv-blue); border-radius: 999px; }
.cb-inv-progress small { font-size: 11.5px; color: var(--inv-faint); font-variant-numeric: tabular-nums; }

.cb-inv-pill {
    flex: none;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
}
.cb-inv-pill.is-open { background: rgba(44, 143, 229, 0.12); color: var(--inv-blue-strong); }
.cb-inv-pill.is-done { background: rgba(12, 127, 79, 0.11); color: var(--inv-good); }

/* ------------------------------------------------------------------ sheet */

.cb-inv-sheet { display: flex; flex-direction: column; gap: 8px; }

.cb-inv-sheet-group {
    margin: 18px 0 4px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--inv-faint);
}
.cb-inv-sheet-group:first-child { margin-top: 0; }

.cb-inv-sheet-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: var(--inv-surface);
    border: 1px solid var(--inv-line);
    border-radius: var(--inv-radius);
}
/* A counted line is visibly done, so a half-finished sheet can be resumed by
   eye rather than by scrolling and remembering. */
.cb-inv-sheet-row.is-counted { border-left: 3px solid var(--inv-good); }

.cb-inv-sheet-item { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cb-inv-sheet-item strong { font-size: 14px; font-weight: 620; }
.cb-inv-sheet-item small { font-size: 12px; color: var(--inv-faint); }

.cb-inv-sheet-qty { flex: none; }
.cb-inv-sheet-qty input {
    width: 96px;
    padding: 9px 11px;
    font: inherit;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    text-align: right;
    color: var(--inv-ink);
    background: var(--inv-canvas);
    border: 1px solid var(--inv-line);
    border-radius: 9px;
}
.cb-inv-sheet-qty input:focus { outline: none; border-color: var(--inv-blue); box-shadow: 0 0 0 3px rgba(44, 143, 229, 0.16); background: var(--inv-surface); }
.cb-inv-sheet-qty input[readonly] { color: var(--inv-faint); }

/* ------------------------------------------------------------------ table */

.cb-inv-table-wrap {
    background: var(--inv-surface);
    border: 1px solid var(--inv-line);
    border-radius: var(--inv-radius);
    /* Wide tables scroll inside their own box; the page must never scroll
       sideways. */
    overflow-x: auto;
}

.cb-inv-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
.cb-inv-table th, .cb-inv-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--inv-line); vertical-align: top; }
.cb-inv-table thead th {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--inv-faint);
    background: var(--inv-canvas);
    position: sticky;
    top: 0;
}
.cb-inv-table tbody tr:last-child td { border-bottom: 0; }
.cb-inv-table td strong { display: block; font-weight: 620; }
.cb-inv-table td small { display: block; font-size: 11.5px; color: var(--inv-faint); }
.cb-inv-table .is-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cb-inv-table .is-num small { display: inline; }

.cb-inv-table-group th {
    background: var(--inv-canvas);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--inv-faint);
}

.cb-inv-table tr.is-short td.is-num { color: var(--inv-bad); font-weight: 650; }
.cb-inv-table tr.is-over td.is-num { color: var(--inv-good); font-weight: 650; }
.cb-inv-table td.is-short { color: var(--inv-bad); font-weight: 650; }
.cb-inv-table td.is-over { color: var(--inv-good); font-weight: 650; }
.cb-inv-table tr.is-archived { opacity: 0.55; }

.cb-inv-baseline { font-size: 11.5px; color: var(--inv-faint); font-style: italic; }

/* ------------------------------------------------------------------ forms */

.cb-inv-form { display: flex; flex-direction: column; gap: 12px; }
.cb-inv-form.is-row { flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
.cb-inv-form.is-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .cb-inv-form.is-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 980px) { .cb-inv-form.is-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.cb-inv-form label { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; }
.cb-inv-form label.is-wide { grid-column: 1 / -1; }
.cb-inv-form label > span { font-size: 12.5px; font-weight: 600; color: var(--inv-ink); }
.cb-inv-form label > span small { font-weight: 500; color: var(--inv-faint); }

.cb-inv-form input,
.cb-inv-form select {
    width: 100%;
    padding: 9px 11px;
    font: inherit;
    font-size: 13.5px;
    color: var(--inv-ink);
    background: var(--inv-surface);
    border: 1px solid var(--inv-line);
    border-radius: 9px;
}
.cb-inv-form input:focus,
.cb-inv-form select:focus { outline: none; border-color: var(--inv-blue); box-shadow: 0 0 0 3px rgba(44, 143, 229, 0.16); }
.cb-inv-form-actions { grid-column: 1 / -1; display: flex; gap: 10px; }

.cb-inv-filters { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.cb-inv-filters label { display: flex; flex-direction: column; gap: 5px; }
.cb-inv-filters input,
.cb-inv-filters select {
    padding: 9px 11px;
    font: inherit;
    font-size: 13.5px;
    border: 1px solid var(--inv-line);
    border-radius: 9px;
    background: var(--inv-surface);
    color: var(--inv-ink);
    min-width: 200px;
}

.cb-inv-primary,
.cb-inv-quiet {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 9px;
    font: inherit;
    font-size: 13.5px;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}
.cb-inv-primary { background: linear-gradient(180deg, var(--inv-blue) 0%, var(--inv-blue-strong) 100%); color: #FFFFFF; }
.cb-inv-primary:hover { box-shadow: 0 8px 20px rgba(20, 116, 197, 0.28); }
.cb-inv-quiet { background: var(--inv-surface); color: var(--inv-ink); border-color: var(--inv-line); }
.cb-inv-quiet:hover { border-color: var(--inv-blue); color: var(--inv-blue-strong); }

.cb-inv-disclosure { margin-bottom: 18px; }
.cb-inv-disclosure > summary {
    display: inline-flex;
    align-items: center;
    padding: 9px 16px;
    background: var(--inv-surface);
    border: 1px solid var(--inv-line);
    border-radius: 9px;
    font-size: 13.5px;
    font-weight: 620;
    cursor: pointer;
    list-style: none;
}
.cb-inv-disclosure > summary::-webkit-details-marker { display: none; }
.cb-inv-disclosure[open] > summary { margin-bottom: 12px; }
.cb-inv-disclosure > form {
    padding: 18px;
    background: var(--inv-surface);
    border: 1px solid var(--inv-line);
    border-radius: var(--inv-radius);
}
.cb-inv-disclosure.is-inline { margin: 0; }
.cb-inv-disclosure.is-inline > summary { padding: 5px 11px; font-size: 12.5px; }
.cb-inv-row-actions { white-space: nowrap; }

/* ------------------------------------------------------------------ empty */

.cb-inv-empty {
    text-align: center;
    padding: 48px 24px;
    background: var(--inv-surface);
    border: 1px solid var(--inv-line);
    border-radius: var(--inv-radius);
}
.cb-inv-empty.is-wide { max-width: none; }
.cb-inv-empty-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    border-radius: 14px;
    background: var(--inv-canvas);
    color: var(--inv-faint);
}
.cb-inv-empty-icon svg { width: 21px; height: 21px; }
.cb-inv-empty h1,
.cb-inv-empty h2 { margin: 0 0 8px; font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.cb-inv-empty p { margin: 0 auto 16px; max-width: 44ch; font-size: 13.5px; line-height: 1.6; color: var(--inv-muted); }
.cb-inv-empty p:last-child { margin-bottom: 0; }
.cb-inv-empty-note code { font-size: 12px; padding: 2px 6px; border-radius: 5px; background: var(--inv-canvas); }

/* ------------------------------------------------------------------- auth */

.cb-inv-auth-body { display: grid; place-items: center; padding: 24px; background: linear-gradient(160deg, #0C2A5E 0%, #071D42 100%); }
.cb-inv-auth { width: min(420px, 100%); }
.cb-inv-auth-brand { display: flex; align-items: center; justify-content: center; gap: 9px; margin-bottom: 22px; text-decoration: none; }
.cb-inv-auth-brand img { height: 24px; }
.cb-inv-auth-brand em {
    font-style: normal;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #7FC2F5;
    padding-left: 9px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.cb-inv-auth-card {
    padding: 30px 28px;
    background: var(--inv-surface);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(4, 16, 40, 0.4);
}
.cb-inv-auth-card h1 { margin: 0 0 8px; font-size: 20px; font-weight: 750; letter-spacing: -0.02em; }
.cb-inv-auth-lede { margin: 0 0 20px; font-size: 13.5px; line-height: 1.6; color: var(--inv-muted); }
.cb-inv-auth-lede code { font-size: 12.5px; padding: 2px 6px; border-radius: 5px; background: var(--inv-canvas); }
.cb-inv-auth-card .cb-inv-primary { width: 100%; }
.cb-inv-auth-foot { margin: 18px 0 0; font-size: 12.5px; color: var(--inv-faint); text-align: center; }
.cb-inv-auth-foot a { color: var(--inv-blue-strong); }

.cb-inv-auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(196, 56, 74, 0.1);
    color: var(--inv-bad);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.cb-inv-auth-kicker svg { width: 12px; height: 12px; }

/* ----------------------------------------------------------------- mobile */

@media (max-width: 760px) {
    .cb-inv-bar-inner { flex-wrap: wrap; padding: 10px 16px; gap: 12px; }
    .cb-inv-nav { order: 3; width: 100%; }
    .cb-inv-workspace { display: none; }
    .cb-inv-back span { display: none; }
    .cb-inv-shell { padding: 0 16px; }
    .cb-inv-sheet-row { flex-wrap: wrap; }
    .cb-inv-sheet-qty { flex: 1; }
    .cb-inv-sheet-qty input { width: 100%; }
    .cb-inv-filters input,
    .cb-inv-filters select { min-width: 0; width: 100%; }
    .cb-inv-filters label { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .cb-inv-row { transition: none; }
}

/* --------------------------------------------------------------- import */

.cb-inv-fieldlist {
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

@media (min-width: 640px) { .cb-inv-fieldlist { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .cb-inv-fieldlist { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.cb-inv-fieldlist li {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 11px 13px;
    background: var(--inv-canvas);
    border: 1px solid var(--inv-line);
    border-radius: 9px;
}
.cb-inv-fieldlist strong { font-size: 13px; font-weight: 650; color: var(--inv-ink); }
.cb-inv-fieldlist small { font-size: 11.5px; line-height: 1.45; color: var(--inv-faint); }

/*
 * The column mapping grid.
 *
 * Explicit breakpoints rather than auto-fit: a supplier export can easily carry
 * twenty columns, and auto-fit collapsing to one silently would turn this into
 * a very long scroll at exactly the moment it matters most.
 */
.cb-inv-mapping {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

@media (min-width: 620px) { .cb-inv-mapping { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .cb-inv-mapping { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.cb-inv-mapping label { display: flex; flex-direction: column; gap: 5px; min-width: 0; }

/* The heading is the file's own text, so it is shown verbatim and allowed to
   truncate rather than wrapping the grid out of alignment. */
.cb-inv-mapping label > span {
    font-size: 12px;
    font-weight: 650;
    color: var(--inv-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cb-inv-mapping select {
    width: 100%;
    padding: 8px 10px;
    font: inherit;
    font-size: 13px;
    color: var(--inv-ink);
    background: var(--inv-surface);
    border: 1px solid var(--inv-line);
    border-radius: 8px;
}
.cb-inv-mapping select:focus {
    outline: none;
    border-color: var(--inv-blue);
    box-shadow: 0 0 0 3px rgba(44, 143, 229, 0.16);
}

.cb-inv-filename {
    font-size: 12px;
    color: var(--inv-faint);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 50%;
}

.cb-inv-import-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.cb-inv-import-actions button[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.cb-inv-form input[type="file"] {
    padding: 9px 11px;
    font-size: 13px;
    background: var(--inv-canvas);
}

/* -------------------------------------------------------------- confirm */

/*
 * Styled replacement for window.confirm().
 *
 * The browser dialog puts the hostname above the message, which reads as the
 * browser warning you about the site rather than the product asking a
 * question — exactly the wrong tone for "submit this count".
 *
 * A native <dialog>, so focus trapping, Escape and the top layer come from the
 * platform rather than being reimplemented.
 */
.cb-inv-confirm {
    width: min(440px, calc(100vw - 32px));
    padding: 0;
    border: 0;
    border-radius: 16px;
    background: var(--inv-surface);
    color: var(--inv-ink);
    box-shadow: 0 30px 80px rgba(4, 16, 40, 0.35);
}

/* ::backdrop does not inherit custom properties from the page, so this is a
   literal colour rather than a var(). */
.cb-inv-confirm::backdrop {
    background: rgba(7, 29, 66, 0.55);
}

.cb-inv-confirm-inner {
    display: flex;
    flex-direction: column;
    padding: 26px 26px 22px;
    margin: 0;
}

.cb-inv-confirm-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-bottom: 16px;
    border-radius: 13px;
    background: rgba(44, 143, 229, 0.11);
    color: var(--inv-blue-strong);
}
.cb-inv-confirm-icon svg { width: 19px; height: 19px; }

.cb-inv-confirm h2 {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 750;
    letter-spacing: -0.02em;
    color: var(--inv-ink);
    text-wrap: balance;
}

.cb-inv-confirm p {
    margin: 0 0 22px;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--inv-muted);
}

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

/* Destructive actions read as destructive, so "Discard" and "Submit" are not
   the same button in a different sentence. */
.cb-inv-confirm .cb-inv-primary.is-danger {
    background: linear-gradient(180deg, #D2495A 0%, var(--inv-bad) 100%);
}
.cb-inv-confirm .cb-inv-primary.is-danger:hover {
    box-shadow: 0 8px 20px rgba(196, 56, 74, 0.3);
}

@media (max-width: 480px) {
    .cb-inv-confirm-actions { flex-direction: column-reverse; }
    .cb-inv-confirm-actions button { width: 100%; }
}

/* ------------------------------------------------------------- briefing */

/*
 * The morning briefing.
 *
 * Given weight at the top of the overview because it is the reason to open the
 * screen. Signals are rows rather than cards: a card grid invites scanning for
 * the prettiest one, and these are ordered by what they cost — the reading
 * order is the point.
 */
.cb-inv-brief { margin-bottom: 26px; }

.cb-inv-brief > header { margin-bottom: 16px; }
.cb-inv-brief h1 {
    margin: 0 0 4px;
    font-size: clamp(22px, 3vw, 27px);
    font-weight: 750;
    letter-spacing: -0.025em;
    color: var(--inv-ink);
}
.cb-inv-brief > header p { margin: 0; font-size: 14px; color: var(--inv-muted); }

.cb-inv-brief-clear {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 18px 20px;
    background: var(--inv-surface);
    border: 1px solid var(--inv-line);
    border-radius: var(--inv-radius);
}
.cb-inv-brief-clear-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: rgba(12, 127, 79, 0.11);
    color: var(--inv-good);
}
.cb-inv-brief-clear-icon svg { width: 16px; height: 16px; }
.cb-inv-brief-clear strong { display: block; font-size: 14.5px; font-weight: 650; margin-bottom: 3px; }
.cb-inv-brief-clear small { font-size: 12.5px; line-height: 1.55; color: var(--inv-muted); }

.cb-inv-signals { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

.cb-inv-signal {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 17px 20px;
    background: var(--inv-surface);
    border: 1px solid var(--inv-line);
    border-left: 3px solid var(--inv-line);
    border-radius: var(--inv-radius);
}

/* Tone carries urgency, and only urgency. It never implies blame — a negative
   gap has innocent explanations and the briefing cannot know which. */
.cb-inv-signal.is-urgent { border-left-color: var(--inv-bad); }
.cb-inv-signal.is-warn { border-left-color: #B57408; }
.cb-inv-signal.is-info { border-left-color: var(--inv-blue); }
.cb-inv-signal.is-good { border-left-color: var(--inv-good); }

.cb-inv-signal-main { flex: 1; min-width: 0; }
.cb-inv-signal-main strong {
    display: block;
    font-size: 14.5px;
    font-weight: 650;
    letter-spacing: -0.012em;
    color: var(--inv-ink);
    margin-bottom: 4px;
}
.cb-inv-signal-main p { margin: 0 0 6px; font-size: 13px; line-height: 1.55; color: var(--inv-muted); }

/* The working. Quiet, but never hidden — it is what makes the number worth
   acting on. */
.cb-inv-signal-main small { font-size: 11.5px; line-height: 1.5; color: var(--inv-faint); }

.cb-inv-signal-value {
    flex: none;
    text-align: right;
    min-width: 96px;
}
.cb-inv-signal-value strong {
    display: block;
    font-size: 18px;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
    color: var(--inv-ink);
    line-height: 1.15;
}
.cb-inv-signal-value small { font-size: 11px; color: var(--inv-faint); }

.cb-inv-signal-action {
    flex: none;
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--inv-line);
    border-radius: 9px;
    font-size: 12.5px;
    font-weight: 650;
    color: var(--inv-blue-strong);
    text-decoration: none;
    white-space: nowrap;
}
.cb-inv-signal-action:hover { border-color: var(--inv-blue); background: #F4FAFF; }
.cb-inv-signal-action svg { width: 13px; height: 13px; }

@media (max-width: 760px) {
    .cb-inv-signal { flex-wrap: wrap; gap: 12px; }
    .cb-inv-signal-value { text-align: left; min-width: 0; }
    .cb-inv-signal-action { width: 100%; justify-content: center; }
}
