:root {
    --brand: #1f4f99;
    --ink: #1a1d23;
    --muted: #4f5a68;
    --line: #e3e6eb;
    --line-strong: #cfd4dc;
    --bg: #f4f6f9;
    --surface: #fff;
    --surface-alt: #f8f9fb;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);

    --tbd: #6b4fbb;        --tbd-bg: #f1edfb;
    --scheduled: #1a6fb5;  --scheduled-bg: #e8f2fb;
    --hold: #b54708;       --hold-bg: #fef0e6;
    --shipped: #1e7b4a;    --shipped-bg: #e7f6ee;
    --change: #c0262d;

    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--ink);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); font-size: 14px; line-height: 1.45; }
a { color: var(--link, var(--brand)); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; font-weight: 600; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; }
.eyebrow { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); margin-bottom: 4px; }

/* Header */
html { scroll-padding-top: calc(var(--header-h, 0px) + 12px); }
.topbar { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: inset 0 3px 0 var(--brand), 0 2px 8px rgba(16, 24, 40, .06); }
.topbar-inner { max-width: 1440px; margin: 0 auto; padding: 14px 20px 8px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.logo { margin-right: auto; display: flex; align-items: baseline; gap: 12px; color: var(--ink); }
.logo:hover { text-decoration: none; }
.logo img { height: 34px; }
.product { letter-spacing: .14em; font-weight: 600; font-size: 12px; text-transform: uppercase; color: var(--muted); }
.specs-link { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px 5px 8px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--ink); font-size: 12.5px; font-weight: 700; letter-spacing: .06em; }
.specs-link:hover { text-decoration: none; border-color: var(--brand); }
.specs-link img { display: block; width: 22px; height: 22px; }
.brand-switch { display: flex; align-items: center; gap: 8px; }
.brand-switch label { font-size: 12px; color: var(--muted); }
.user { display: flex; gap: 14px; align-items: center; font-size: 13px; }

.tabs { max-width: 1440px; margin: 0 auto; padding: 0 12px; display: flex; flex-wrap: wrap; gap: 2px; }
.tabs a { padding: 10px 12px; color: var(--muted); font-size: 13px; font-weight: 500; white-space: nowrap; border-bottom: 2px solid transparent; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { border-bottom-color: var(--brand); color: var(--ink); font-weight: 600; }
/* Tools: links to the brand's List site and Cross Reference (other sites, new tab) */
.tools-menu { position: relative; }
.tools-menu summary { padding: 10px 12px; color: var(--muted); font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer; list-style: none; border-bottom: 2px solid transparent; }
.tools-menu summary::-webkit-details-marker { display: none; }
.tools-menu summary::after { content: ""; display: inline-block; margin-left: 6px; border: 4px solid transparent; border-top-color: currentColor; border-bottom: 0; vertical-align: 2px; }
.tools-menu summary:hover, .tools-menu[open] summary { color: var(--ink); }
.tools-list { position: absolute; z-index: 30; top: 100%; left: 0; min-width: 210px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.tabs .tools-list a { display: block; padding: 8px 10px; border: 0; border-radius: 6px; color: var(--ink); }
.tabs .tools-list a:hover { background: var(--surface-alt); }
.tools-list a::after { content: " ↗"; color: var(--muted); }

/* Phones: logo and a menu button; the button opens SPECS, brand, user and the tabs */
.menu-toggle { display: none; align-items: center; gap: 10px; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.menu-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.menu-icon { flex: none; }
.menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 1px; transition: transform .15s, background .15s; }
.menu-icon { position: relative; }
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
.menu-icon::before { top: -6px; }
.menu-icon::after { top: 6px; }
@media (max-width: 760px) {
    .topbar.menu-open { max-height: 100vh; max-height: 100dvh; overflow-y: auto; }
    .topbar-inner { padding: 10px 16px; gap: 12px; }
    .logo { gap: 8px; min-width: 0; }
    .logo img { height: 26px; }
    .logo .wordmark { font-size: 22px; }
    .product { font-size: 10.5px; letter-spacing: .1em; }
    .menu-toggle { display: inline-flex; flex: none; max-width: 52%; }
    .topbar:not(.menu-open) .topbar-inner { flex-wrap: nowrap; }
    .logo { overflow: hidden; }
    .topbar:not(.menu-open) .specs-link, .topbar:not(.menu-open) .brand-switch,
    .topbar:not(.menu-open) .user, .topbar:not(.menu-open) .tabs { display: none; }
    .menu-open .menu-icon { background: transparent; }
    .menu-open .menu-icon::before { transform: translateY(6px) rotate(45deg); }
    .menu-open .menu-icon::after { transform: translateY(-6px) rotate(-45deg); }
    .brand-switch { flex: 1 1 auto; }
    .brand-switch select { flex: 1; min-width: 0; }
    .user { flex: 1 1 100%; justify-content: space-between; padding-top: 4px; border-top: 1px solid var(--line); }
    .tabs { flex-direction: column; gap: 0; padding: 0 0 8px; overflow: visible; border-top: 1px solid var(--line); }
    .tabs a { padding: 12px 16px; font-size: 15px; border-bottom: 0; border-left: 3px solid transparent; }
    .tabs a.active { border-left-color: var(--brand); background: var(--surface-alt); }
    .tabs { flex-wrap: nowrap; }
    .tools-menu summary { padding: 12px 16px; font-size: 15px; border: 0; }
    .tools-list { position: static; box-shadow: none; border: 0; padding: 0 0 4px 16px; }
    .tabs .tools-list a { padding: 10px 16px; font-size: 15px; }
    .tabs a.tab-admin { margin-left: 0; }
}

/* Brand wordmarks (used when no logo image is configured) */
.wordmark { font-size: 26px; line-height: 1; }
.wordmark-pottorff { font-weight: 900; font-style: italic; letter-spacing: .02em; text-transform: uppercase; }
.wordmark-alllite { font-family: Georgia, "Times New Roman", serif; font-weight: 700; text-transform: uppercase; }
.wordmark-csair { font-style: italic; font-weight: 700; }

/* Page */
.page { max-width: 1440px; margin: 0 auto; padding: 24px 20px 48px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; margin-bottom: 12px; }
.date-form, .account-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.grow { flex: 1 1 280px; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; margin-right: auto; align-self: center; }

label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 500; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: 6px; padding-bottom: 8px; color: var(--ink); }
label.block { margin-top: 12px; }
input, select, textarea { font: inherit; color: var(--ink); padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
textarea { width: 100%; min-height: 54px; resize: vertical; }
select { max-width: 100%; }

.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 500; padding: 7px 14px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; color: var(--ink); cursor: pointer; }
.btn:hover { border-color: var(--brand); text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.chip { font: inherit; font-size: 12.5px; padding: 5px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; cursor: pointer; color: var(--ink); }
.chip:hover { border-color: var(--brand); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--surface-alt); border: 1px solid var(--line); color: var(--muted); }

/* Status summary */
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
.stat { text-align: left; font: inherit; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); cursor: pointer; }
.stat:hover:not(:disabled) { border-color: var(--line-strong); }
.stat:disabled { cursor: default; background: var(--surface-alt); box-shadow: none; }
.stat:disabled .stat-value { color: var(--muted); }
.stat.active { outline: 2px solid var(--brand); outline-offset: -1px; }
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat-tbd { border-left-color: var(--tbd); }
.stat-scheduled { border-left-color: var(--scheduled); }
.stat-hold { border-left-color: var(--hold); }
.stat-shipped { border-left-color: var(--shipped); }

.badge { display: inline-block; white-space: nowrap; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; }
.badge-tbd { color: var(--tbd); background: var(--tbd-bg); }
.badge-scheduled { color: var(--scheduled); background: var(--scheduled-bg); }
.badge-hold { color: var(--hold); background: var(--hold-bg); }
.badge-shipped { color: var(--shipped); background: var(--shipped-bg); }

/* Tables */
.table-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.search { flex: 0 1 380px; padding-left: 32px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235f6b7a' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 4 4'/%3E%3C/svg%3E") no-repeat 10px center; }
.table-wrap { max-height: 70vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.table-wrap.short { max-height: 40vh; max-width: 720px; }
.grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.grid th { position: sticky; top: 0; z-index: 1; background: var(--surface-alt); color: var(--muted); text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.grid[data-sortable] th { cursor: pointer; user-select: none; }
.grid[data-sortable] th:hover { color: var(--ink); }
.grid th[aria-sort="ascending"]::after { content: " ↑"; }
.grid th[aria-sort="descending"]::after { content: " ↓"; }
.grid td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid tbody:hover td { background: var(--surface-alt); }
.grid tbody:last-child td { border-bottom: 0; }
.grid tbody.row-group:has(tr.recommit) tr:first-child td { border-bottom: 0; }
.grid tr.recommit td { padding-top: 0; color: var(--hold); font-size: 12.5px; }
.recommit-label { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #fff; background: var(--hold); border-radius: 4px; padding: 1px 6px; margin-right: 6px; }
.no-match td { text-align: center; color: var(--muted); padding: 24px; }
.orders td:nth-child(2) { min-width: 170px; }
.orders td:nth-child(3) { min-width: 140px; }
.orders td:nth-child(n+4) { white-space: nowrap; }

.row-actions { margin-top: 4px; }
.action { font: inherit; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 5px; border: 1px solid; background: #fff; cursor: pointer; white-space: nowrap; }
.action:hover { text-decoration: none; }
.action-change { color: var(--change); border-color: #f1b9bc; }
.action-change:hover { background: #fdf0f0; }
.action-shipment { color: var(--shipped); border-color: #a9dcc0; }
.action-shipment:hover { background: var(--shipped-bg); }

.empty { padding: 32px; text-align: center; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty p { margin-top: 4px; }
.notice { padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.alert-error { padding: 10px 12px; border: 1px solid #e5a3a3; background: #fdf0f0; color: #8a1c1c; border-radius: 6px; }
.alert-info { padding: 12px; border: 1px solid #a9c4e6; background: #eef5fd; color: #17375e; border-radius: 6px; margin: 12px 0; line-height: 1.45; }
.alert-info .register-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 10px 0 0; }
.alert-info .muted { color: #3d5677; }

.credits { margin-top: 32px; }

/* Content tabs */
.content-group h2 { border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.card h3 { font-size: 1rem; margin: 6px 0; }
.card video { width: 100%; border-radius: 6px; background: #000; }
.category-order summary { cursor: pointer; }
.category-list { list-style: none; margin: 12px 0 0; padding: 0; max-width: 900px; counter-reset: cat; }
.category-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 4px; border-bottom: 1px solid var(--line); counter-increment: cat; }
.category-list li::before { content: counter(cat) "."; width: 24px; color: var(--muted); font-size: 12px; text-align: right; }
.category-name { flex: 1; font-weight: 500; }
.category-tools { display: flex; gap: 4px; align-items: center; }
.item-order { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.item-order select { padding: 3px 6px; font-size: 12.5px; }
.file-picked { display: block; font-size: 13px; color: var(--shipped); font-weight: 500; margin-top: 4px; }
.video-frame { position: relative; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: #000; }
.video-facade { display: block; width: 100%; padding: 0; border: 0; cursor: pointer; }
.video-facade img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video-play { position: absolute; left: 50%; top: 50%; width: 64px; height: 44px; margin: -22px 0 0 -32px; border-radius: 12px; background: rgba(0, 0, 0, .72); transition: background .15s; }
.video-play::after { content: ""; position: absolute; left: 26px; top: 12px; border-style: solid; border-width: 10px 0 10px 17px; border-color: transparent transparent transparent #fff; }
.video-facade:hover .video-play, .video-facade:focus-visible .video-play { background: #e00; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Change request dialog */
.modal { width: min(1000px, 95vw); max-height: 90vh; border: 0; border-radius: 12px; padding: 22px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.modal::backdrop { background: rgba(16, 24, 40, .5); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.modal-head h2 { margin: 0; }
.modal .grid { border: 1px solid var(--line); border-radius: 8px; margin-top: 12px; }
.modal .grid th { position: static; }
.close { font-size: 28px; line-height: 1; background: none; border: 0; cursor: pointer; color: var(--muted); }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.form-row label { flex: 1 1 200px; }
.option-group { color: var(--brand); font-weight: 600; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.form-status { min-height: 1.2em; margin: 8px 0 0; }
.form-status.error { color: var(--change); }
.w35 { width: 35%; }

/* Login */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login-card { width: min(460px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 28px; }
.login-card h1 { margin: 12px 0 4px; }
.login-card form { display: grid; gap: 12px; margin: 16px 0; }
.login-links { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 8px; }
.dev-login { display: flex !important; gap: 6px; align-items: center; flex-wrap: wrap; padding: 10px; border: 1px dashed #c8a400; border-radius: 6px; background: #fffbe6; }
.dev-login input { width: 110px; }

@media (max-width: 1000px) {
    .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Phones: each order becomes a card */
@media (max-width: 760px) {
    .page { padding: 16px 16px 32px; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats .stat:first-child { grid-column: 1 / -1; }
    .presets { margin-right: 0; width: 100%; }
    .search { flex: 1 1 100%; }
    .table-wrap, .table-wrap.short { max-height: none; max-width: none; overflow: visible; background: none; border: 0; box-shadow: none; }
    .grid thead { display: none; }
    .grid, .grid tbody, .grid tr, .grid td { display: block; width: 100%; }
    .grid tbody { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 10px; padding: 6px 0; }
    .grid tbody:hover td { background: none; }
    .grid td { display: grid; grid-template-columns: 110px 1fr; gap: 8px; border: 0; padding: 5px 14px; }
    .grid td[data-label]::before { content: attr(data-label); font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
    .grid tr.recommit td { display: block; padding: 8px 14px 4px; }
    .no-match td { display: block; }
}

/* Flash messages */
.flash { padding: 10px 14px; border-radius: 8px; margin: 0 0 16px; font-weight: 500; }
.flash-success { background: var(--shipped-bg); color: var(--shipped); border: 1px solid #a9dcc0; }
.flash-error { background: #fdf0f0; color: #8a1c1c; border: 1px solid #e5a3a3; }
.flash-toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50; margin: 0; max-width: min(560px, calc(100vw - 32px)); box-shadow: 0 8px 24px rgba(16, 24, 40, .18); transition: opacity .5s; }
.flash-toast.is-fading { opacity: 0; }

/* Admin */
.tabs a.tab-admin { margin-left: auto; }
.filter-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.push-right { margin-left: auto; }
.admin-grid tr.inactive td { color: var(--muted); }
.admin-grid tr.inactive td strong { font-weight: 500; }
.badge-muted { color: var(--muted); background: var(--surface-alt); border: 1px solid var(--line); }
.row-buttons > div { display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }
.row-buttons form { margin: 0; }
.row-buttons .action { color: var(--ink); border-color: var(--line-strong); }

.admin-form { padding: 20px; max-width: 880px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.span-2 { grid-column: 1 / -1; }
.hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.field-error { color: var(--change); font-weight: 600; font-size: 12px; }
label:has(.field-error) input, label:has(.field-error) select { border-color: var(--change); }
.kind-picker { border: 0; padding: 0; margin: 0; display: flex; gap: 18px; flex-wrap: wrap; }
.kind-picker legend { font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 4px; padding: 0; }
.current-file { margin-bottom: 8px; font-size: 13px; }
.form-actions { display: flex; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.btn-danger { color: var(--change); border-color: #f1b9bc; }
.btn-danger:hover { background: #fdf0f0; border-color: var(--change); }

@media (max-width: 760px) {
    .form-grid { grid-template-columns: 1fr; }
    .tabs a.tab-admin { margin-left: 0; }
    .row-buttons > div { justify-content: flex-start; }
}

/* Admin sub navigation */
.subnav { display: flex; gap: 6px; margin-bottom: 18px; }
.subnav a { padding: 6px 14px; border-radius: 999px; color: var(--muted); font-weight: 500; border: 1px solid transparent; }
.subnav a:hover { text-decoration: none; color: var(--ink); border-color: var(--line-strong); }
.subnav a.active { background: var(--brand); color: #fff; }
.flash-warning { background: var(--hold-bg); color: var(--hold); border: 1px solid #f5c79f; }

/* Lead time sheets (rep view) */
.lt-sheet { margin-bottom: 32px; }
.lt-head h2 { font-size: 1.3rem; margin: 0 0 2px; }
.lt-period { color: var(--muted); font-weight: 500; }
.lt-notes { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--radius); padding: 10px 16px; margin: 14px 0; }
.lt-notes h3 { margin: 0 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.lt-notes ol { margin: 0; padding-left: 20px; }
.lt-notes li { margin: 2px 0; }
.lt-table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); max-width: 900px; }
.lt-table th.lt-value, .lt-table td.lt-value { text-align: center; width: 130px; white-space: nowrap; }
.lt-unit { display: block; font-weight: 500; text-transform: none; letter-spacing: 0; font-style: italic; }
.lt-table .lt-group-head th { position: static; white-space: normal; background: color-mix(in srgb, var(--brand) 10%, #fff); color: var(--ink); font-size: 13.5px; text-transform: none; letter-spacing: 0; padding: 10px; border-top: 1px solid var(--line); }
.lt-table td { padding: 6px 10px; }
.lt-table tbody:hover td { background: none; }
.lt-table tr.lt-row:hover td { background: var(--surface-alt); }
.lt-bold .lt-label { font-weight: 700; }
.lt-highlight .lt-label { font-weight: 700; color: var(--change); }
.lt-indent-1 .lt-label { padding-left: 32px; }
.lt-indent-2 .lt-label { padding-left: 56px; }
.lt-toc { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.lt-disclaimer { max-width: 900px; }
.print-only { display: none; }

/* Lead time admin */
.lt-admin-brand { margin-bottom: 24px; }
.new-sheet summary { cursor: pointer; }
.new-sheet form { margin-top: 12px; }
.lt-toolbar { position: sticky; top: var(--header-h, 0px); z-index: 5; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 14px; margin: 0 0 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 12px rgba(16, 24, 40, .08); }
.lt-toolbar form { margin: 0; }
.lt-status { font-size: 13px; color: var(--muted); }
.lt-status.is-warn { color: var(--hold); font-weight: 600; }
.lt-status.is-ok { color: var(--shipped); }
.lt-status.is-error { color: var(--change); font-weight: 600; }
.lt-replace { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.field-label { font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline input { flex: 1; }
.lt-columns { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.lt-column { display: flex; gap: 6px; align-items: flex-end; padding: 8px; background: var(--surface-alt); border-radius: 8px; }
.lt-column input { width: 130px; }
.lt-group-edit { padding: 12px; }
.lt-group-bar { display: flex; gap: 6px; align-items: center; margin-bottom: 10px; }
.lt-group-name { flex: 1; font-weight: 600; font-size: 15px; }
.lt-edit-table td { padding: 3px 6px; vertical-align: middle; }
.lt-edit-table th { position: static; }
.lt-edit-table input { width: 100%; padding: 5px 8px; }
.lt-edit-table td.lt-value { width: 110px; }
.lt-edit-table .lt-value-input { text-align: center; }
.lt-edit-table select { padding: 5px 6px; width: 140px; }
.lt-edit-table td:nth-last-child(2), .lt-edit-table th:nth-last-child(2) { width: 150px; }
.lt-edit-table tbody:hover td { background: none; }
.lt-label-cell.indent-1 { padding-left: 30px; }
.lt-label-cell.indent-2 { padding-left: 54px; }
.lt-edit-table tr.lt-bold .lt-label-input { font-weight: 700; }
.lt-edit-table tr.lt-highlight .lt-label-input { font-weight: 700; color: var(--change); }
.lt-row-tools { white-space: nowrap; text-align: right; }
.lt-row-tools-head { width: 1%; }
.icon-btn { font: inherit; font-size: 13px; width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; color: var(--muted); }
.icon-btn:hover:not(:disabled) { color: var(--ink); border-color: var(--line-strong); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn.danger:hover:not(:disabled) { color: var(--change); border-color: #f1b9bc; }
.btn-small { padding: 4px 10px; font-size: 12.5px; }
.lt-add-row { margin-top: 8px; }
.lt-add-group { margin-bottom: 24px; }
.lt-admin-footer { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.lt-admin-footer h2 { margin-top: 0; }
.lt-versions { list-style: none; margin: 0; padding: 0; }
.lt-versions li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.lt-versions form, .lt-danger form { margin: 0; }
.lt-danger { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.modal textarea { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }

@media (max-width: 760px) {
    .lt-admin-footer { grid-template-columns: 1fr; }
    .lt-table td.lt-value, .lt-table th.lt-value { width: auto; }
    .lt-table.grid thead { display: table-header-group; }
}

/* Lead time phone view keeps a real table (3 narrow columns fit) */
@media (max-width: 760px) {
    .lt-table.grid, .lt-table.grid tbody { display: table-row-group; }
    .lt-table.grid { display: table; width: 100%; }
    .lt-table.grid tr { display: table-row; }
    .lt-table.grid td, .lt-table.grid th { display: table-cell; width: auto; }
    .lt-table.grid tbody { border: 0; box-shadow: none; margin: 0; padding: 0; background: none; }
    .lt-edit-table.grid thead { display: none; }
}

/* Quick Ship Program (same layout as the printed All-Lite sheet) */
.qs-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
.qs-table { width: 100%; min-width: 980px; border-collapse: collapse; font-size: 13.5px; }
.qs-table th, .qs-table td { border: 1px solid var(--line-strong); padding: 6px 8px; vertical-align: middle; }
.qs-table thead th { background: var(--surface-alt); color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; text-align: center; }
.qs-table tr:first-child th { border-top: 0; }
.qs-table th:first-child, .qs-table td:first-child { border-left: 0; }
.qs-table th:last-child, .qs-table td:last-child { border-right: 0; }
.qs-table tbody:last-child tr:last-child > * { border-bottom: 0; }
.qs-col-cat { width: 11%; }
.qs-col-name { width: 18%; }
.qs-col-opt { width: 36%; }
.qs-table .qs-cat { background: color-mix(in srgb, var(--brand) 16%, #fff); text-align: left; font-weight: 400; font-size: 12px; }
.qs-cat-name { display: block; font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.qs-cat-note { display: block; color: var(--ink); }
.qs-table .qs-name { font-weight: 700; }
.qs-table .qs-num { text-align: center; font-weight: 600; white-space: nowrap; }
.qs-table thead .qs-num { width: 6%; }
.qs-table .qs-opt { font-size: 12.5px; line-height: 1.4; }
.qs-table tr.qs-alt > td { background: color-mix(in srgb, var(--brand) 6%, #fff); }
.qs-table tr > td.qs-shared { background: var(--surface); }
.qs-notes { margin: 10px 0 0; font-size: 13px; max-width: 1100px; }
.qs-key { margin: 0 0 8px; font-size: 13px; color: var(--ink); }
.qs-key span { display: block; }
.qs-cards { display: none; }
.qs-notes ul { margin: 4px 0 0; padding-left: 18px; }
.qs-image { grid-column: 1 / -1; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.qs-image img { display: block; width: 100%; height: auto; }
.qs-image figcaption { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* Quick Ship editor */
.qs-cat-note { margin-bottom: 10px; }
.lt-group-edit .qs-cat-note textarea, .qs-edit-table textarea { width: 100%; resize: vertical; padding: 5px 8px; font: inherit; line-height: 1.35; }
.qs-edit-table th { text-align: center; }
.qs-edit-table th.qs-span { border-bottom: 0; }
.qs-edit-table td.lt-value, .qs-edit-table th:nth-last-child(2), .qs-edit-table td:nth-last-child(2) { width: 82px; }
.qs-edit-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.qs-edit-table tr:first-child > td:first-child { width: 34%; min-width: 220px; }
.qs-edit-table td.lt-row-tools { width: 140px; }
.qs-edit-table tbody.qs-product td { border-bottom: 0; }
.qs-edit-table tbody.qs-product tr:last-child td { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.qs-edit-table .qs-name { font-weight: 600; }
.qs-options-cell label { display: block; }
.qs-options-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.qs-edit-table .lt-row-tools { vertical-align: top; }
.qs-move { display: block; margin: 6px 0 0 auto; width: 120px !important; font-size: 12px; }
.linkish { font: inherit; font-size: 12px; background: none; border: 0; padding: 0; color: var(--link, var(--brand)); cursor: pointer; text-decoration: underline; }

/* Footer (brand logo links to the brand site; C&S adds its warranty and USA badges) */
body:has(> .site-footer) { min-height: 100vh; display: flex; flex-direction: column; }
body:has(> .site-footer) > .page { flex: 1; width: 100%; }
.site-footer { background: var(--surface); border-top: 1px solid var(--line); box-shadow: inset 0 3px 0 var(--brand); margin-top: 24px; }
.footer-inner { max-width: 1440px; margin: 0 auto; padding: 22px 20px; display: flex; gap: 28px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.footer-logo { color: var(--ink); flex-shrink: 0; }
.footer-logo:hover { text-decoration: none; opacity: .8; }
.footer-logo img { height: 34px; width: auto; display: block; }
.footer-logo .wordmark { font-size: 22px; }
.footer-address { font-style: normal; line-height: 1.6; color: var(--muted); }
.footer-address strong { color: var(--ink); }
.footer-fax { margin-left: 10px; }
.footer-badges { display: flex; gap: 14px; align-items: center; }
.footer-badges img { height: 56px; width: auto; display: block; }
@media (max-width: 760px) {
    .footer-inner { gap: 16px; }
}

/* Contact */
.contact-office { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.contact-office h2 { margin: 0 0 4px; font-size: 1.05rem; }
.contact-office address { font-style: normal; color: var(--muted); }
.contact-office-lines { display: flex; gap: 24px; margin: 0; }
.contact-office-lines dt { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.contact-office-lines dd { margin: 0; font-weight: 600; }
.contact-office .btn { margin-left: auto; }
.contact-group { margin-bottom: 22px; }
.contact-group h2 { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; font-size: 1.1rem; margin: 0 0 8px; }
.contact-group-mail { font-size: 13px; font-weight: 500; }
.contact-wrap { max-height: none; }
/* Every group is its own table; fixed widths keep the columns lined up down the page */
.contact-table { table-layout: fixed; }
.contact-table th:nth-child(1) { width: 22%; }
.contact-table th:nth-child(2) { width: 36%; }
.contact-table th:nth-child(3) { width: 26%; }
.contact-table th:nth-child(4) { width: 16%; }
.contact-table td { overflow-wrap: anywhere; }
.contact-table td:nth-child(4) { overflow-wrap: normal; }
.contact-group-email { width: 260px; }
.contact-edit-table input { min-width: 110px; }
.contact-edit-table tbody.qs-product td { vertical-align: top; }
.contact-note-cell input { font-size: 12.5px; }

/* Print / Save as PDF */
@media print {
    @page { margin: 12mm; }
    body { background: #fff; font-size: 11px; }
    .topbar, .subnav, .no-print, .flash { display: none !important; }
    .print-only { display: block; }
    .print-brand { font-weight: 700; color: var(--brand); margin-bottom: 4px; }
    .page { padding: 0; max-width: none; }
    .lt-sheet { break-after: page; }
    .lt-sheet:last-of-type { break-after: auto; }
    .lt-table { box-shadow: none; max-width: none; width: 100%; border-radius: 0; }
    .lt-table thead { display: table-header-group; }
    .lt-table th { position: static; }
    .lt-table tr { break-inside: avoid; }
    .lt-table .lt-group-head th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .lt-notes { box-shadow: none; border-radius: 0; }
    .lt-row[hidden] { display: table-row !important; }
    .lt-group[hidden] { display: table-row-group !important; }
    .qs-wrap { box-shadow: none; border-radius: 0; overflow: visible; }
    .qs-table { min-width: 0; font-size: 8.5px; }
    .qs-table th, .qs-table td { padding: 3px 4px; }
    .qs-table thead th { font-size: 8px; }
    .qs-table .qs-opt { font-size: 7.5px; line-height: 1.2; }
    .qs-cat-name { font-size: 10px; }
    .qs-table .qs-cat, .qs-table tr.qs-alt > td, .qs-table thead th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .qs-table tr { break-inside: avoid; }
    .qs-notes { font-size: 8px; }
    a { color: inherit; text-decoration: none; }
}

/* YTD Sales */
.ytd-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-static { cursor: default; border-left-color: var(--brand); }
.stat-static .stat-value { font-size: 1.45rem; }
.meter { display: block; height: 6px; margin-top: 6px; background: var(--surface-alt); border-radius: 999px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.pct-pos { color: var(--shipped); font-weight: 600; }
.pct-neg { color: var(--change); font-weight: 600; }
.ytd-charts { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; margin-bottom: 8px; }
.ytd-charts h2 { margin: 0 0 8px; font-size: 1rem; }
.chart-box { position: relative; height: 340px; }
.chart-box-sm { height: 220px; }
.legend { list-style: none; margin: 12px 0 0; padding: 0; font-size: 13px; }
.legend li { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.legend .swatch { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend-label { flex: 1; }
.legend-amt { font-weight: 600; font-variant-numeric: tabular-nums; }
.legend-total { border-bottom: 0; font-weight: 700; padding-left: 18px !important; }
.num-grid td, .num-grid th { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.num-grid td:first-child, .num-grid th:first-child { text-align: left; }
.num-grid th.cat-col, .num-grid td.cat-col { background: color-mix(in srgb, var(--brand) 5%, transparent); }
.num-grid th.cat-col { background: var(--surface-alt); }

@media (max-width: 1000px) {
    .ytd-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ytd-charts { grid-template-columns: 1fr; }
}
/* Number tables stay tables on phones (they scroll sideways) */
@media (max-width: 760px) {
    .num-grid.grid { display: table; }
    .num-grid.grid thead { display: table-header-group; }
    .num-grid.grid tbody { display: table-row-group; border: 0; box-shadow: none; margin: 0; padding: 0; background: none; }
    .num-grid.grid tr { display: table-row; }
    .num-grid.grid td, .num-grid.grid th { display: table-cell; }
    .table-wrap:has(.num-grid) { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); }
    .ytd-kpis .stat:first-child { grid-column: auto; }
}

/* Phones: admin group bars and the new-sheet form wrap instead of running off screen */
@media (max-width: 760px) {
    .lt-group-bar { flex-wrap: wrap; }
    .lt-group-name { flex: 1 1 100%; min-width: 0; }
    .contact-group-email { flex: 1 1 0; width: auto; min-width: 0; }
    .filter-form label { flex: 1 1 100%; min-width: 0; }
    .filter-form select, .filter-form input { width: 100%; max-width: 100%; }
}

/* Phones: Quick Ship as product cards */
@media (max-width: 760px) {
    .qs-wrap { display: none; }
    .qs-cards { display: block; }
    .qs-card-group { margin-bottom: 18px; }
    .qs-card-cat { position: sticky; top: var(--header-h, 0px); z-index: 2; margin: 0 -16px 8px; padding: 8px 16px; font-size: 16px; background: color-mix(in srgb, var(--brand) 16%, var(--bg, #f3f4f6)); }
    .qs-card-cat .qs-cat-note { margin: 2px 0 0; font-size: 12.5px; font-weight: 400; }
    .qs-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; margin-bottom: 10px; }
    .qs-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
    .qs-card h4 { margin: 0; font-size: 15px; }
    .qs-loc { flex: none; padding: 2px 8px; border-radius: 999px; background: var(--surface-alt); border: 1px solid var(--line); font-size: 12px; font-weight: 600; }
    .qs-card-row { display: grid; grid-template-columns: 82px repeat(3, 1fr); gap: 6px; align-items: end; padding: 6px 0; border-top: 1px solid var(--line); }
    .qs-card-label { font-size: 12px; font-weight: 600; color: var(--muted); align-self: center; }
    .qs-card-cell { text-align: center; font-weight: 700; font-size: 14px; }
    .qs-card-cell small { display: block; font-size: 10.5px; font-weight: 600; color: var(--muted); letter-spacing: .03em; }
    .qs-card-opt { border-top: 1px solid var(--line); padding-top: 8px; font-size: 13.5px; }
    .qs-card-opt summary { cursor: pointer; color: var(--link); font-weight: 600; }
    .qs-card-opt div { margin-top: 6px; line-height: 1.45; }
}
@media print { .qs-cards { display: none !important; } .qs-wrap { display: block !important; } }

/* Phones: lead time column headings stay pinned under the header while scrolling */
@media (max-width: 760px) {
    .lt-table { overflow: visible; }
    .lt-table thead th { position: sticky; top: var(--header-h, 0px); z-index: 2; }
    .lt-table th.lt-value, .lt-table td.lt-value { white-space: normal; padding-left: 6px; padding-right: 6px; }
}
.format-buttons { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 0; }

/* Credits: desktop keeps the scrolling table; phones show one line per credit, 10 at a time */
.credits-more { display: none; }
@media (max-width: 760px) {
    .credits .grid tbody { padding: 0; }
    .credits .grid tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; width: auto; padding: 9px 14px; border-bottom: 1px solid var(--line); }
    .credits .grid tr:last-child { border-bottom: 0; }
    .credits .grid tr.is-more { display: none; }
    .credits .grid td { display: inline; width: auto; padding: 0; }
    .credits .grid td::before { content: none; }
    .credits .grid td[data-label="PO"]::before { content: "PO "; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; }
    .credits .grid td[data-label="Posting Date"] { margin-left: auto; color: var(--muted); }
    .credits-more { display: block; width: 100%; justify-content: center; margin-top: 4px; }
}
@media (max-width: 420px) { .topbar .product { display: none; } }
.archive-footer { margin: 24px 0 0; padding-top: 16px; border-top: 1px solid var(--line); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; color: var(--muted); }

/* C&S logo is a tall emblem (wordmarks are wide): give it more height so "AIR PRODUCTS" stays readable */
body[data-brand="csair"] .logo { align-items: center; }
body[data-brand="csair"] .topbar-inner { padding-top: 8px; padding-bottom: 4px; }
body[data-brand="csair"] .logo img { height: 52px; }
body[data-brand="csair"] .footer-logo img { height: 64px; }
@media (max-width: 760px) {
    body[data-brand="csair"] .topbar-inner { padding-top: 6px; padding-bottom: 6px; }
    body[data-brand="csair"] .logo img { height: 42px; }
}

/* Order Status date type: Unscheduled ignores the range; open orders never have a shipped date */
.date-type select { min-width: 170px; }
.unscheduled-note { display: none; margin: 0 auto 0 0; align-self: center; }
.date-type-unscheduled .presets, .date-type-unscheduled .range-field, .date-type-unscheduled .open-field,
.date-type-shipped .open-field { display: none; }
.date-type-unscheduled .unscheduled-note { display: block; }

/* Orders built at more than one plant: one line per plant, lined up across Plant, Sched. Ship and Shipped */
.plant-lines > div { min-height: 22px; line-height: 22px; white-space: nowrap; }
.plant-lines > div + div { border-top: 1px dashed var(--line-strong); }
.plant-lines .tag { line-height: 1.3; }
.orders td[data-label="SO#"] .tag { margin-left: 6px; vertical-align: 1px; }
