/*
 * styles.css
 * Written mobile first. The phone layout is the base rule set and wider
 * screens only add to it. No fixed pixel width above 400px, every interactive
 * element clears 48 by 48 CSS pixels, no visible text below 14px, and every
 * table becomes a card list before it would need to scroll sideways.
 */

:root {
    --navy: #04285b;
    --blue: #0560e3;
    --cyan: #4eccec;
    --green: #23e294;
    --dgreen: #055c38;
    --amber: #8a4c05;
    --amber-fond: #fff8ec;
    --amber-bord: #f2dfbe;
    --red: #a3170d;
    --red-fond: #fef3f2;
    --red-bord: #f6cec9;
    --ink: #12203c;
    --ink-2: #45566f;
    --ink-3: #5c6c84;
    --line: #dfe7f3;
    --line-fort: #c7d5e9;
    --line-soft: #eaf0f8;
    --surface: #ffffff;
    --surface-2: #f6f9fe;
    --page: #f2f7fd;
    --radius: 14px;
    --radius-l: 18px;
    --tap: 48px;
    --shadow-sm: 0 2px 10px rgba(4, 40, 91, 0.06);
    --shadow-md: 0 14px 40px -20px rgba(4, 40, 91, 0.5);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--page);
    line-height: 1.5;
    font-size: 16px;
}

body.has-dialog { overflow: hidden; }

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(70vw 44vw at 6% -8%, rgba(78, 204, 236, 0.24), transparent 62%),
        radial-gradient(56vw 36vw at 98% 4%, rgba(5, 96, 227, 0.14), transparent 60%);
}

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

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.skip {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    background: #fff;
    color: var(--navy);
    padding: 12px 18px;
    min-height: var(--tap);
    display: inline-flex;
    align-items: center;
    border-radius: 0 0 12px 0;
    font-weight: 700;
}
.skip:focus { left: 0; }

:where(a, button, input, select, textarea):focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 2px;
    border-radius: 8px;
}

/* ------------------------------- top bar --------------------------------- */

.topbar {
    position: relative;
    z-index: 3;
    background: linear-gradient(120deg, #04285b, #0a3f8e 60%, #0560e3);
    color: #fff;
}
.topbar-in {
    max-width: 1280px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.marque { display: flex; flex-direction: column; min-width: 0; }
.marque-nom { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.marque-sous { font-size: 14px; color: rgba(255, 255, 255, 0.84); }

/* -------------------------------- layout --------------------------------- */

.wrap {
    position: relative;
    z-index: 1;
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 12px 40px;
}

.app-head {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 14px;
}

.app-title {
    margin: 0;
    font-size: clamp(22px, 6vw, 30px);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.12;
    background: linear-gradient(100deg, #04285b 0%, #0560e3 55%, #055c38 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.app-sub { margin: 6px 0 0; max-width: 66ch; color: var(--ink-2); font-size: 15px; }

.app-head-side {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.ledger-chip {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 8px 14px;
    min-height: var(--tap);
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}
.ledger-chip-n { font-size: 20px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.ledger-chip-l { font-size: 14px; color: var(--ink-3); font-weight: 700; }

.head-actions { display: flex; gap: 8px; align-items: center; flex: 1 1 auto; }
.lang-field { flex: 0 0 auto; }
.head-actions .btn { flex: 1 1 auto; }

/* Tabs. The strip wraps, so no view is ever pushed off screen. */
.tabs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 6px;
    padding: 6px;
    margin-bottom: 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-l);
    box-shadow: var(--shadow-sm);
}

.tab {
    min-height: var(--tap);
    border: 1px solid var(--line);
    background: var(--surface-2);
    font-weight: 700;
    font-size: 15px;
    line-height: 1.2;
    color: var(--ink-2);
    padding: 6px 10px;
    border-radius: 11px;
    cursor: pointer;
    white-space: normal;
}
.tab.is-active {
    background: linear-gradient(120deg, var(--navy), var(--blue));
    border-color: transparent;
    color: #fff;
}

.stack { display: flex; flex-direction: column; gap: 14px; }

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-l);
    box-shadow: var(--shadow-sm);
    padding: 14px;
}

.panel-title {
    margin: 0 0 10px;
    font-size: 17px;
    font-weight: 800;
    color: var(--navy);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.panel-body { margin: 0 0 12px; color: var(--ink-2); font-size: 15px; max-width: 84ch; }

.panel-proof {
    background: linear-gradient(140deg, rgba(5, 96, 227, 0.06), rgba(35, 226, 148, 0.08));
    border-color: rgba(5, 96, 227, 0.22);
}

.proof-result {
    margin: 10px 0 0;
    font-weight: 800;
    font-size: 15px;
    color: var(--dgreen);
    font-variant-numeric: tabular-nums;
    min-height: 1.2em;
}

.count-badge {
    font-size: 14px;
    font-weight: 800;
    color: var(--blue);
    background: rgba(5, 96, 227, 0.1);
    padding: 2px 9px;
    border-radius: 999px;
}

/* --------------------------------- kpis ---------------------------------- */

.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.kpi {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 14px;
    box-shadow: var(--shadow-sm);
}
.kpi-v { font-size: 24px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.kpi-l { font-size: 14px; color: var(--ink-3); font-weight: 700; margin-top: 2px; }

.site-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.site-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 14px;
    background: var(--surface-2);
}
.site-card.is-low { border-color: var(--amber-bord); background: var(--amber-fond); }
.site-card-transit { background: rgba(5, 96, 227, 0.05); border-color: rgba(5, 96, 227, 0.2); }
.site-card-h { font-size: 14px; font-weight: 700; color: var(--ink-3); }
.site-card-v { font-size: 24px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.site-card-v span { font-size: 14px; font-weight: 700; color: var(--ink-3); }
.site-card-f { font-size: 14px; color: var(--ink-3); font-weight: 700; }
.site-card-note { font-size: 14px; color: var(--ink-2); margin: 6px 0 0; }

.bar {
    height: 8px;
    border-radius: 99px;
    background: rgba(4, 40, 91, 0.09);
    overflow: hidden;
    margin: 8px 0 4px;
}
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--cyan)); }

/* -------------------------------- controls -------------------------------- */

.toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    margin-bottom: 12px;
    align-items: end;
}

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: 14px; font-weight: 700; color: var(--ink-3); }

input[type="search"],
input[type="text"],
input[type="number"],
input[type="date"],
select {
    font-size: 16px;
    min-height: var(--tap);
    width: 100%;
    padding: 0 12px;
    border: 1px solid var(--line-fort);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    min-width: 0;
    max-width: 100%;
}
select { cursor: pointer; }

.qty-input { width: 100%; max-width: 128px; text-align: right; margin-inline-start: auto; }

.check {
    display: flex;
    align-items: center;
    gap: 2px;
    min-height: var(--tap);
    font-size: 15px;
    font-weight: 700;
    color: var(--ink-2);
    cursor: pointer;
}
/* The input itself stays a 44 by 44 control, only the painted box is small. */
.check input {
    appearance: none;
    -webkit-appearance: none;
    width: 44px;
    height: 44px;
    min-height: 44px;
    margin: 0;
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    cursor: pointer;
    display: grid;
    place-content: center;
}
.check input::before {
    content: "";
    display: block;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    border: 2px solid var(--line-fort);
    background: #fff;
}
.check input:checked::before {
    border-color: var(--blue);
    background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2.8 8.4l3.1 3.1 7.3-7.3' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat;
}

.btn {
    font-size: 15px;
    font-weight: 800;
    min-height: var(--tap);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 12px;
    padding: 8px 16px;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
    color: #fff;
    background: linear-gradient(120deg, var(--navy), var(--blue));
}

.btn-ghost { background: #fff; border-color: var(--line-fort); color: var(--navy); }

.btn-mini {
    font-size: 14px;
    padding: 6px 12px;
    min-height: 44px;
    background: #fff;
    border-color: var(--line-fort);
    color: var(--blue);
}

.icon-btn {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 12px;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: var(--ink-2);
    min-width: var(--tap);
    min-height: var(--tap);
}

.linkish {
    border: 0;
    background: none;
    padding: 0;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    color: var(--blue);
    cursor: pointer;
    text-align: start;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.sort {
    border: 0;
    background: none;
    font: inherit;
    font-weight: 800;
    font-size: 14px;
    color: var(--ink-3);
    cursor: pointer;
    min-height: 44px;
    padding: 0;
    text-align: start;
}
.sort.is-sorted { color: var(--blue); }

.pager {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
    margin-top: 12px;
    flex-wrap: wrap;
}
.pager .btn { flex: 1 1 auto; }
.pager .muted { flex: 1 1 100%; text-align: center; order: -1; }

/* --------------------------------- tables --------------------------------- */
/* Below 900px every grid table is a card list: no sideways scroll exists. */

.table-wrap { overflow-x: auto; }

table.grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    background: transparent;
}

table.grid thead { display: none; }
table.grid tbody,
table.grid tr,
table.grid td { display: block; width: 100%; }

table.grid tbody tr {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 10px;
    padding: 4px 12px;
    background: #fff;
}

table.grid td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line-soft);
    text-align: right;
}
table.grid td:last-child { border-bottom: 0; }
table.grid td::before {
    content: attr(data-label);
    font-size: 14px;
    font-weight: 700;
    color: var(--ink-3);
    text-align: left;
    flex: 0 0 auto;
}
table.grid tfoot { display: block; }
table.grid tfoot tr { border: 1px solid var(--line-fort); background: var(--surface-2); }
table.grid tfoot th { display: block; text-align: left; padding: 8px 0; font-size: 15px; }
table.grid td.empty,
table.grid .empty { display: block; text-align: center; }

.num { font-variant-numeric: tabular-nums; }
.strong { font-weight: 800; }
.small { font-size: 14px; }
.muted { color: var(--ink-3); }
.empty { color: var(--ink-3); padding: 18px 10px; text-align: center; font-size: 15px; }

.sku { display: block; font-size: 14px; color: var(--ink-3); font-weight: 600; }
.mono { font-family: var(--mono); font-size: 14px; }
code { font-family: var(--mono); font-size: 14px; background: rgba(4, 40, 91, 0.06); padding: 1px 6px; border-radius: 5px; }

.pill {
    display: inline-block;
    padding: 1px 9px;
    border-radius: 999px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.pill-warn { background: rgba(241, 188, 0, 0.24); color: var(--amber); }
.pill-transit { background: rgba(5, 96, 227, 0.12); color: var(--blue); }

.tag {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
}
.tag-up { background: rgba(35, 226, 148, 0.2); color: var(--dgreen); }
.tag-down { background: rgba(163, 23, 13, 0.1); color: var(--red); }
.tag-transfer { background: rgba(5, 96, 227, 0.12); color: var(--blue); }
.tag-warn { background: rgba(241, 188, 0, 0.24); color: var(--amber); }
.tag-neutral { background: rgba(4, 40, 91, 0.08); color: var(--ink-2); }

.tone-up { color: var(--dgreen); }
.tone-down { color: var(--red); }
.tone-transfer { color: var(--blue); }
.tone-neutral { color: var(--ink-2); }

/* ------------------------------- transfers -------------------------------- */

.trf {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 12px;
    background: var(--surface-2);
}
.trf:last-child { margin-bottom: 0; }

.trf-h {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.trf-ref { margin-inline-start: 8px; }
.trf-route { font-size: 15px; color: var(--navy); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.trf-route .arrow { color: var(--blue); font-size: 18px; }

.trf-meta {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px 14px;
    margin: 0 0 12px;
}
.trf-meta div { min-width: 0; }
.trf-meta dt { font-size: 14px; font-weight: 700; color: var(--ink-3); }
.trf-meta dd { margin: 0; font-size: 15px; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }

.trf-actions { margin-top: 12px; }
.trf-actions .btn { width: 100%; }

/* ------------------------------- stock count ------------------------------ */

.gap-list {
    list-style: none;
    margin: 8px 0 12px;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 4px 14px;
}
.gap-list li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 15px;
    border-bottom: 1px dashed var(--line-soft);
    padding: 4px 0;
}
.gap-list b { font-variant-numeric: tabular-nums; }

.form-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-items: end; }
.form-row .btn { width: 100%; }

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

.prod-head { margin: 12px 0; }
.prod-title { margin: 0; font-size: 20px; font-weight: 800; color: var(--navy); letter-spacing: -0.01em; }

.audit {
    border: 1px solid rgba(35, 226, 148, 0.45);
    background: rgba(35, 226, 148, 0.08);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
}
.audit h3 { margin: 0 0 4px; font-size: 16px; font-weight: 800; color: var(--dgreen); }
.audit p { margin: 0; font-size: 15px; color: var(--ink-2); }
.audit-sum { margin-top: 6px !important; font-weight: 800; color: var(--navy) !important; font-variant-numeric: tabular-nums; }

/* --------------------------------- dialog --------------------------------- */

.dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(4, 40, 91, 0.45);
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 0;
}

.dialog {
    width: 100%;
    max-width: 100%;
    background: #fff;
    border-radius: 0;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    max-height: 100dvh;
}

.dialog-h {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
}
.dialog-h h2 { margin: 0; font-size: 17px; font-weight: 800; color: var(--navy); }

.dialog-b { padding: 14px; flex: 1 1 auto; overflow-y: auto; }
.dialog-f {
    flex: 0 0 auto;
    display: flex;
    gap: 10px;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: #fff;
}
.dialog-f .btn { flex: 1 1 auto; }

.dialog-hint { margin: 0 0 12px; font-size: 15px; color: var(--ink-2); }
.dialog-sub { margin: 16px 0 8px; font-size: 16px; font-weight: 800; color: var(--navy); }

.form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.form-grid .span2 { grid-column: 1 / -1; }
.hint { font-size: 14px; color: var(--dgreen); font-weight: 700; }

.form-error {
    margin: 12px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--red-fond);
    border: 1px solid var(--red-bord);
    color: var(--red);
    font-weight: 700;
    font-size: 15px;
}

.pick-list {
    max-height: 52vh;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px;
    background: var(--surface-2);
}

/* --------------------------------- toast ---------------------------------- */

.toast {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    transform: translateY(140%);
    z-index: 60;
    padding: 12px 16px;
    border-radius: 14px;
    background: linear-gradient(120deg, #04285b, #0560e3);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    box-shadow: var(--shadow-md);
    transition: transform 0.28s ease, opacity 0.28s ease;
    opacity: 0;
    pointer-events: none;
    text-align: center;
}
.toast.is-on { transform: translateY(0); opacity: 1; }

/* --------------------------------- footer --------------------------------- */

.pied {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.78);
    padding: 18px 12px calc(24px + env(safe-area-inset-bottom));
}
.pied-inner { max-width: 1280px; margin: 0 auto; font-size: 14px; color: var(--ink-2); }
.pied-inner p { margin: 0 0 10px; max-width: 92ch; }
.pied-attr { margin: 0; }
.pied-attr a {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
    color: var(--blue);
    font-weight: 800;
    text-decoration: none;
    border-bottom: 1px solid rgba(5, 96, 227, 0.4);
}

/* ===========================================================================
 * Wider screens only add
 * ========================================================================= */

@media (min-width: 560px) {
    .wrap { padding: 20px 16px 48px; }
    .toolbar { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
    .form-row { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
    .form-row .btn { width: auto; }
    .form-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
    .pager .muted { flex: 0 0 auto; order: 0; }
    .pager .btn { flex: 0 0 auto; }
    .trf-actions .btn { width: auto; }
}

@media (min-width: 720px) {
    .dialog-backdrop { align-items: flex-start; padding: 24px 16px; overflow-y: auto; }
    .dialog { width: min(760px, 100%); border-radius: var(--radius-l); margin: auto; max-height: calc(100dvh - 48px); }
    .dialog-f { justify-content: flex-end; }
    .dialog-f .btn { flex: 0 0 auto; }
    .toast { left: 50%; right: auto; transform: translate(-50%, 140%); max-width: min(560px, calc(100vw - 28px)); }
    .toast.is-on { transform: translate(-50%, 0); }
}

@media (min-width: 900px) {
    .app-head { flex-direction: row; align-items: flex-start; justify-content: space-between; }
    .app-head-side { flex-direction: column; align-items: flex-end; }
    .head-actions .btn { flex: 0 0 auto; }
    .panel { padding: 16px; }
    .panel-sticky { position: sticky; bottom: 0; }

    /* Real tables again, inside a container that shows its own scroll edges. */
    .table-wrap {
        border: 1px solid var(--line-soft);
        border-radius: 12px;
        background:
            linear-gradient(to right, #fff 30%, rgba(255, 255, 255, 0)) left center,
            linear-gradient(to left, #fff 30%, rgba(255, 255, 255, 0)) right center,
            radial-gradient(farthest-side at 0 50%, rgba(4, 40, 91, 0.22), rgba(4, 40, 91, 0)) left center,
            radial-gradient(farthest-side at 100% 50%, rgba(4, 40, 91, 0.22), rgba(4, 40, 91, 0)) right center;
        background-repeat: no-repeat;
        background-size: 42px 100%, 42px 100%, 14px 100%, 14px 100%;
        background-attachment: local, local, scroll, scroll;
    }
    table.grid { background: transparent; }
    table.grid thead { display: table-header-group; }
    table.grid tbody { display: table-row-group; }
    table.grid tr { display: table-row; }
    table.grid td { display: table-cell; }
    table.grid th {
        text-align: left;
        font-size: 14px;
        font-weight: 800;
        color: var(--ink-3);
        background: #f4f8fd;
        padding: 8px 10px;
        border-bottom: 1px solid var(--line);
        white-space: nowrap;
        position: sticky;
        top: 0;
        z-index: 1;
    }
    table.grid tbody tr { border: 0; border-radius: 0; margin: 0; padding: 0; background: transparent; }
    table.grid td {
        padding: 8px 10px;
        border-bottom: 1px solid var(--line-soft);
        vertical-align: top;
        text-align: left;
    }
    table.grid td.num,
    table.grid th.num { text-align: right; }
    table.grid td::before { content: none; }
    table.grid tbody tr:last-child td { border-bottom: 0; }
    table.grid tfoot { display: table-footer-group; }
    table.grid tfoot tr { background: #f4f8fd; }
    table.grid tfoot th,
    table.grid tfoot td {
        display: table-cell;
        background: #f4f8fd;
        border-top: 2px solid var(--line);
        font-weight: 800;
        position: static;
        padding: 8px 10px;
    }
    .qty-input { width: 112px; max-width: none; }
    .check input { width: 26px; height: 26px; min-height: 26px; }
    .linkish { min-height: 0; display: inline; text-decoration: none; }
    .linkish:hover { text-decoration: underline; }
}

@media (min-width: 1100px) {
    .wrap { padding: 24px 24px 56px; }
    .topbar-in { padding: 12px 24px; }
    .pied { padding: 22px 24px 34px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
    .topbar, .tabs, .toolbar, .toast, .pied { display: none; }
    body::before { display: none; }
}
