/* Paikar. The look borrows from the red cloth-bound khata:
   a red spine for navigation and ruled ledger pages with a red margin line. */

@font-face {
    font-family: "Anek Bangla";
    src: url("../fonts/anek-bangla-bengali-wght-normal.woff2") format("woff2");
    font-weight: 100 800;
    font-display: swap;
    unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1;
}
@font-face {
    font-family: "Anek Bangla";
    src: url("../fonts/anek-bangla-latin-wght-normal.woff2") format("woff2");
    font-weight: 100 800;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --font: "Anek Bangla", "Nirmala UI", "Noto Sans Bengali", system-ui, sans-serif;
    /* Three text sizes: small print, body, and titles or key figures */
    --fs-sm: 0.875rem;
    --fs-md: 1rem;
    --fs-lg: 1.75rem;
    /* Spacing: every margin, padding and gap is a step of 4px */
    --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px;
    --sp-8: 32px; --sp-10: 40px; --sp-12: 48px; --sp-16: 64px; --sp-20: 80px; --sp-24: 96px; --sp-32: 128px;
    accent-color: var(--accent);
    /* Accent: deep emerald. The old --red names are kept as aliases so every screen follows. */
    --accent: #0b7a66;
    --accent-deep: #085e4f;
    --accent-soft: #e7f4f0;
    --red: var(--accent);
    --red-deep: var(--accent-deep);
    --red-ink: #d9f0ea;
    --ink: #0f1b2d;
    --muted: #5b6678;
    --rule: #e1e6ee;
    --rule-soft: #eef1f6;
    --paper: #f5f7fa;
    --card: #ffffff;
    --green: #1b7a55;
    --amber: #b45309;
    --spine-w: 5rem;
    --radius: 8px;
}

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

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

body {
    margin: 0;
    font-family: var(--font);
    font-size: var(--fs-md);
    line-height: 1.55;
    color: var(--ink);
    background: var(--paper);
}

h1, h2 { line-height: 1.2; margin: 0; font-weight: 650; }
h1 { font-size: var(--fs-lg); letter-spacing: -0.01em; }
h2 { font-size: var(--fs-md); }
p { margin: 0; }
a { color: var(--red); text-underline-offset: 0.18em; }
a:hover { color: var(--red-deep); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* ---------- Menu: a slim rail; each group opens a small panel only when asked ---------- */

.rail {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--spine-w);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-1);
    padding: var(--sp-4) var(--sp-2);
    background: var(--card);
    border-right: 1px solid var(--rule);
    z-index: 30;
}
.rail ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-1); }
.rail li { position: relative; }

.rail-brand {
    display: grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    margin: 0 auto var(--sp-4);
    font-size: var(--fs-md);
    font-weight: 700;
    color: #fff;
    background: var(--accent);
    border-radius: 12px;
    text-decoration: none;
}
.rail-brand:hover { color: #fff; background: var(--accent-deep); }
.rail-name { display: none; }

.rail-item {
    display: grid;
    justify-items: center;
    gap: var(--sp-1);
    width: 100%;
    padding: var(--sp-2) var(--sp-1) var(--sp-2);
    font: inherit;
    font-size: var(--fs-sm);
    line-height: 1.2;
    text-align: center;
    color: var(--muted);
    background: none;
    border: 0;
    border-radius: 10px;
    text-decoration: none;
    cursor: pointer;
    list-style: none;
}
.rail-item::-webkit-details-marker { display: none; }
.rail-item svg { width: 1.4rem; height: 1.4rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.rail-item .glyph { font-size: var(--fs-md); font-weight: 650; line-height: 1.4rem; }
.rail-item:hover { color: var(--ink); background: var(--paper); }
.rail-item.is-current, .rail-group[data-current] > .rail-item { color: var(--accent-deep); background: var(--accent-soft); font-weight: 600; }
.rail-group[open] > .rail-item { color: var(--ink); background: var(--rule-soft); }

.rail-panel {
    position: absolute;
    left: calc(100% + 0.7rem);
    top: 0;
    min-width: 14.5rem;
    padding: var(--sp-2);
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: 12px;
    box-shadow: 0 12px 32px -12px rgba(15, 27, 45, 0.28);
    display: grid;
    gap: 0;
}
.rail-up .rail-panel { top: auto; bottom: 0; }
.rail-panel-title { padding: var(--sp-1) var(--sp-3) var(--sp-1); font-size: var(--fs-sm); color: var(--muted); }
.rail-link {
    display: block;
    width: 100%;
    padding: var(--sp-2) var(--sp-3);
    font: inherit;
    text-align: left;
    color: var(--ink);
    background: none;
    border: 0;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
}
.rail-link:hover { color: var(--ink); background: var(--paper); }
.rail-link.is-current { color: var(--accent-deep); background: var(--accent-soft); font-weight: 600; }
.rail-foot { margin-top: auto; display: grid; gap: var(--sp-1); }
.rail-foot form { display: contents; }
.rail-chevron { display: none; }

.topbar, .scrim { display: none; }

/* ---------- Page ---------- */

.shell .page { margin-left: var(--spine-w); padding: var(--sp-8) clamp(var(--sp-5), 3vw, var(--sp-12)) var(--sp-16); max-width: 92rem; }
.plain .page { padding: var(--sp-6) var(--sp-4) var(--sp-12); }

.page-head { margin-bottom: var(--sp-6); }
.lede { color: var(--muted); max-width: 44rem; margin-top: var(--sp-1); }
.hint { color: var(--muted); font-size: var(--fs-sm); margin-top: var(--sp-3); }
.block { margin-top: var(--sp-10); }
.block .ledger-wrap { margin-top: var(--sp-4); max-width: 34rem; }

.notice {
    margin-bottom: var(--sp-5);
    padding: var(--sp-3) var(--sp-4);
    background: #e6f4ec;
    border-left: 4px solid var(--green);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.empty { padding: var(--sp-5); background: var(--card); border: 1px dashed var(--rule); border-radius: var(--radius); color: var(--muted); }

/* ---------- Pipeline (dashboard) ---------- */

.pipeline {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
}
.stage { position: relative; padding: var(--sp-4) var(--sp-5) var(--sp-5); display: grid; gap: 0; }
.stage + .stage { border-left: 1px solid var(--rule); }
.stage + .stage::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 1.45rem;
    width: 12px;
    height: 12px;
    background: var(--card);
    border-top: 1px solid var(--rule);
    border-right: 1px solid var(--rule);
    transform: rotate(45deg);
}
.stage-name { font-weight: 600; }
.stage-num { font-size: var(--fs-lg); font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stage-unit { color: var(--muted); font-size: var(--fs-sm); }
.stage-due .stage-num { color: var(--amber); }

/* ---------- Ledger tables ---------- */

.ledger-wrap {
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    overflow-x: auto;
    /* the khata's red margin line */
    padding-left: var(--sp-2);
    background-image: linear-gradient(90deg, transparent 3px, var(--red) 3px, var(--red) 4px, transparent 4px, transparent 6px, var(--red) 6px, var(--red) 7px, transparent 7px);
}
.ledger { width: 100%; border-collapse: collapse; }
.ledger th, .ledger td { padding: var(--sp-2) var(--sp-4); text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule-soft); }
.ledger thead th { font-weight: 600; color: var(--muted); font-size: var(--fs-sm); border-bottom: 1px solid var(--rule); white-space: nowrap; }
.ledger tbody tr:last-child td { border-bottom: 0; }
.ledger tbody tr:hover { background: #f8fafd; }
.ledger .num { text-align: right; font-variant-numeric: tabular-nums; }
.ledger tr.is-off td:not(.actions) { color: #8b93a6; }
.ledger tr.is-editing { background: #fff6e2; }

.actions { white-space: nowrap; text-align: right !important; }
.actions form { display: inline; }
.actions > * + * { margin-left: var(--sp-3); }

.tag { font-size: var(--fs-sm); padding: 0 var(--sp-2); border: 1px solid #b9c0cf; border-radius: 99px; color: var(--muted); }

.linklike { font: inherit; color: var(--red); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 0.18em; }
.linklike:hover { color: var(--red-deep); }

/* ---------- List + form layout ---------- */

.split { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: var(--sp-6); align-items: start; }
.split-form { position: sticky; top: 1.5rem; }

.card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--sp-5); display: grid; gap: var(--sp-4); }

.field { display: grid; gap: var(--sp-1); }
.field > span { font-weight: 550; font-size: var(--fs-sm); }
.req { font-style: normal; font-weight: 400; color: var(--muted); font-size: var(--fs-sm); margin-left: var(--sp-1); }
.field input, .field select {
    width: 100%;
    min-height: 2.75rem;
    padding: var(--sp-2) var(--sp-3);
    font: inherit;
    color: var(--ink);
    background: #fff;
    border: 1px solid #aab4c6;
    border-radius: var(--radius);
}
.field input:hover, .field select:hover { border-color: #6f7c94; }
.field .upper { text-transform: uppercase; }
.field-hint { color: var(--muted); font-size: var(--fs-sm); }
.field-error { color: #a01226; font-size: var(--fs-sm); font-weight: 550; }
.field-search { max-width: 22rem; margin-bottom: var(--sp-4); }

.check { display: flex; gap: var(--sp-2); align-items: center; }
.check input { width: 1.15rem; height: 1.15rem; accent-color: var(--red); }

.form-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-1); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: var(--sp-2) var(--sp-4);
    font: inherit;
    font-weight: 600;
    color: var(--ink);
    background: #fff;
    border: 1px solid #aab4c6;
    border-radius: var(--radius);
    text-decoration: none;
    cursor: pointer;
}
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn-primary { color: #fff; background: var(--red); border-color: var(--red); }
.btn-primary:hover { color: #fff; background: var(--red-deep); border-color: var(--red-deep); }
.btn-wide { width: 100%; }

/* ---------- Login ---------- */

.login { max-width: 25rem; margin: 6vh auto 0; }
.login-book {
    padding: var(--sp-6) var(--sp-6) var(--sp-6) var(--sp-8);
    color: #fff;
    background: var(--red);
    border-radius: var(--radius) var(--radius) 0 0;
}
.login-title { font-size: var(--fs-lg); font-weight: 700; }
.login-sub { margin-top: var(--sp-1); color: var(--red-ink); }
.login-form {
    display: grid;
    gap: var(--sp-4);
    padding: var(--sp-6);
    background: var(--card);
    border: 1px solid var(--rule);
    border-top: 0;
    border-radius: 0 0 var(--radius) var(--radius);
}
.login-book + .login-form { border-top: 0; }
.login > .login-form:first-child { border-top: 1px solid var(--rule); border-radius: var(--radius); }
.login-lang { margin-top: var(--sp-4); text-align: center; }
.plainlist { margin: 0; padding-left: var(--sp-4); white-space: pre-line; }
.creds { padding: var(--sp-3) var(--sp-4); background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); font-weight: 600; user-select: all; }

/* ---------- Small screens ---------- */

@media (max-width: 62rem) {
    .split { grid-template-columns: 1fr; }
    .split-form { position: static; order: -1; }
    .pipeline { grid-template-columns: repeat(2, 1fr); }
    .stage:nth-child(3) { border-left: 0; }
    .stage:nth-child(3)::before { display: none; }
    .stage:nth-child(n+3) { border-top: 1px solid var(--rule); }
}

@media (max-width: 48rem) {
    .topbar {
        position: sticky;
        top: 0;
        z-index: 20;
        display: flex;
        align-items: center;
        gap: var(--sp-4);
        padding: var(--sp-2) var(--sp-4);
        background: var(--card);
        border-bottom: 1px solid var(--rule);
    }
    .menu-btn { min-height: 2.5rem; padding: var(--sp-1) var(--sp-4); font: inherit; font-weight: 600; color: #fff; background: var(--accent); border: 0; border-radius: var(--radius); }
    .topbar-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    /* the rail becomes a drawer, and each group an accordion */
    .rail { width: min(19rem, 88vw); padding: var(--sp-4) var(--sp-3); overflow-y: auto; transform: translateX(-100%); transition: transform 0.18s ease-out; }
    .nav-open .rail { transform: none; }
    .nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(15, 27, 45, 0.45); }
    .rail-head { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); }
    .rail-brand { margin: 0; flex: none; }
    .rail-name { display: block; font-weight: 650; }
    .rail-item { grid-template-columns: 1.4rem minmax(0, 1fr) auto; justify-items: start; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-3); font-size: var(--fs-md); text-align: left; }
    .rail-chevron { display: block; width: 1rem !important; height: 1rem !important; transition: transform 0.15s; }
    .rail-group[open] .rail-chevron { transform: rotate(90deg); }
    .rail-panel, .rail-up .rail-panel { position: static; min-width: 0; padding: var(--sp-1) 0 var(--sp-2) var(--sp-8); border: 0; border-radius: 0; box-shadow: none; }
    .rail-panel-title { display: none; }

    .shell .page { margin-left: 0; padding: var(--sp-5) var(--sp-4) var(--sp-12); }
    h1 { font-size: var(--fs-lg); }

    .pipeline { grid-template-columns: 1fr; }
    .stage + .stage { border-left: 0; border-top: 1px solid var(--rule); }
    .stage + .stage::before { display: none; }
    .stage { grid-template-columns: 1fr auto; align-items: baseline; column-gap: var(--sp-4); }
    .stage-num { grid-row: span 2; font-size: var(--fs-lg); }

    /* ledger rows become stacked entries */
    .ledger thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .ledger, .ledger tbody, .ledger tr, .ledger td { display: block; }
    .ledger tr { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--rule); }
    .ledger tbody tr:last-child { border-bottom: 0; }
    .ledger td { padding: 0 0; border: 0; }
    .ledger td:empty { display: none; }
    .ledger td[data-label] { display: grid; grid-template-columns: 8.5rem 1fr; gap: var(--sp-3); }
    .ledger td[data-label]:empty { display: none; }
    .ledger td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: var(--fs-sm); }
    .ledger .num { text-align: left; }
    .actions { text-align: left !important; margin-top: var(--sp-2); }
}

@media (prefers-reduced-motion: reduce) {
    .rail, .rail-chevron { transition: none; }
}

/* ---------- Entry screens (step 2) ---------- */

.page-head.with-action { display: flex; gap: var(--sp-4); justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.head-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

.notice-error { background: #fdecee; border-left-color: #a01226; color: #7c0d1c; }

.ledger-wrap.wide { max-width: none; }
.ledger .strong { font-weight: 650; }
.ledger .imei { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.sub { display: block; color: var(--muted); font-size: var(--fs-sm); }

.entry { display: grid; gap: var(--sp-4); max-width: 60rem; }
.entry > p { margin: 0; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); align-items: start; }

.field textarea {
    width: 100%;
    padding: var(--sp-2) var(--sp-3);
    font: inherit;
    font-variant-numeric: tabular-nums;
    line-height: 1.5;
    color: var(--ink);
    background: #fff;
    border: 1px solid #aab4c6;
    border-radius: var(--radius);
    resize: vertical;
}
.field textarea:hover { border-color: #6f7c94; }
.field > span b { font-weight: 600; color: var(--red); }

fieldset.group { margin: 0; min-width: 0; }
.group + .group { margin-top: var(--sp-4); }
.group-head { display: flex; justify-content: space-between; gap: var(--sp-4); align-items: baseline; }
.group-head legend { padding: 0; font-weight: 650; font-size: var(--fs-md); }
.group-sum { color: var(--muted); }
.group-sum span { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }

.calc { margin: 0; display: grid; gap: var(--sp-1); }
.calc > div { display: flex; justify-content: space-between; gap: var(--sp-4); padding-bottom: var(--sp-1); border-bottom: 1px solid var(--rule-soft); }
.calc > div:last-child { border-bottom: 0; padding-bottom: 0; }
.calc dt { color: var(--muted); }
.calc dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.card > .calc { padding: var(--sp-3) var(--sp-4); background: var(--paper); border-radius: var(--radius); }

.calc-row { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); }
.calc-row > div { flex-direction: column; gap: 0; padding: var(--sp-3) var(--sp-4); border-bottom: 0; }
.calc-row > div + div { border-left: 1px solid var(--rule); }
.calc-row dd { text-align: left; font-size: var(--fs-md); }

.bigfig { display: flex; align-items: center; min-height: 2.75rem; font-size: var(--fs-md); font-weight: 700; font-variant-numeric: tabular-nums; }

.due-line { margin-bottom: var(--sp-4); font-size: var(--fs-md); }
.due-line b { margin-left: var(--sp-2); font-size: var(--fs-lg); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--amber); }

.btn-danger { color: #fff; background: #a01226; border-color: #a01226; }
.btn-danger:hover { color: #fff; background: #7c0d1c; border-color: #7c0d1c; }

.confirm { display: inline-block; text-align: left; }
.confirm summary { color: var(--red); text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; list-style: none; }
.confirm summary::-webkit-details-marker { display: none; }
.confirm[open] summary { color: var(--muted); }
.confirm form { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin-top: var(--sp-2); white-space: normal; }
.confirm .btn { min-height: 2.25rem; padding: var(--sp-1) var(--sp-3); }

.pager { display: flex; gap: var(--sp-4); align-items: center; margin-top: var(--sp-4); color: var(--muted); }

@media (max-width: 62rem) {
    .calc-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .calc-row > div { border-left: 0 !important; border-bottom: 1px solid var(--rule-soft); }
}

@media (max-width: 48rem) {
    .grid-3 { grid-template-columns: 1fr; }
    .grid-3 > .field > span:empty { display: none; }
    .calc-row { grid-template-columns: 1fr; }
}

@media print {
    .rail, .spine, .topbar, .scrim, .no-print, .notice { display: none !important; }
    body { background: #fff; }
    .shell .page { margin: 0; padding: 0; max-width: none; }
    .split { display: block; }
    .ledger-wrap { border: 0; }
}

/* ---------- Transit and stock (step 3) ---------- */

.entry-wide { max-width: none; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-4); align-items: start; }

.choices { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.btn.is-on { color: #fff; background: var(--ink); border-color: var(--ink); }

.picktools { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: end; }
.picktools .field { flex: 1 1 16rem; max-width: 24rem; }
.pick-msg { flex: 1 1 100%; min-height: 1.5rem; color: var(--green); font-weight: 550; }
.pick-msg.is-bad { color: #a01226; }

.picklist .pick { width: 2.75rem; }
.picklist input[type="checkbox"] { width: 1.3rem; height: 1.3rem; accent-color: var(--red); vertical-align: middle; }
.picklist tr.is-picked { background: #eef7f1; }
.picklist tr.is-picked:hover { background: #e3f1e8; }
.picklist select { min-height: 2.25rem; padding: var(--sp-1) var(--sp-2); font: inherit; color: var(--ink); background: #fff; border: 1px solid #aab4c6; border-radius: var(--radius); }

.calc-row.calc-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: var(--sp-4); max-width: 40rem; }
.calc-row.calc-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.calc-row.calc-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.searchbar { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: end; margin-bottom: var(--sp-4); }
.searchbar .field { flex: 0 1 20rem; }

@media (max-width: 62rem) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .calc-row.calc-3, .calc-row.calc-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 48rem) {
    .grid-4 { grid-template-columns: 1fr; }
    .calc-row.calc-2, .calc-row.calc-3, .calc-row.calc-4 { grid-template-columns: 1fr; }
    .picklist tr { position: relative; padding-left: var(--sp-12); }
    .picklist .pick { position: absolute; left: 0.9rem; top: 0.8rem; width: auto; }
}

/* ---------- Sales, invoice and reseller ledger (step 4) ---------- */

.loss { color: #a01226; }
.narrow { max-width: 30rem; }
.calc-top { margin-top: var(--sp-4); }
.print-only { display: none; }

.salelist input[data-price] {
    width: 9rem;
    max-width: 100%;
    min-height: 2.4rem;
    padding: var(--sp-1) var(--sp-2);
    font: inherit;
    font-variant-numeric: tabular-nums;
    text-align: right;
    color: var(--ink);
    background: #fff;
    border: 1px solid #aab4c6;
    border-radius: var(--radius);
}
.empty-inline { padding: var(--sp-4) var(--sp-4); color: var(--muted); }
.empty-inline[hidden] { display: none; }

/* the printed paper */
.paper { max-width: 52rem; padding: var(--sp-8) var(--sp-8); background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); }
.paper p { margin: 0; }
.paper-head { display: flex; justify-content: space-between; gap: var(--sp-6); padding-bottom: var(--sp-4); border-bottom: 3px double var(--red); }
.paper-biz { font-size: var(--fs-lg); font-weight: 700; }
.paper-meta { text-align: right; }
.paper-title { font-size: var(--fs-lg); font-weight: 700; color: var(--red); }
.paper-to { margin: var(--sp-5) 0; }
.paper-label { color: var(--muted); font-size: var(--fs-sm); }
.paper-name { font-weight: 650; font-size: var(--fs-md); }
.paper-table { width: 100%; border-collapse: collapse; }
.paper-table th, .paper-table td { padding: var(--sp-2) var(--sp-2); text-align: left; border-bottom: 1px solid var(--rule); }
.paper-table thead th { border-bottom: 1px solid var(--ink); font-weight: 650; }
.paper-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.paper-table .imei { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.paper-totals { margin: var(--sp-4) 0 0 auto; width: min(100%, 20rem); display: grid; gap: var(--sp-1); }
.paper-totals > div { display: flex; justify-content: space-between; gap: var(--sp-4); }
.paper-totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.paper-totals .strong { padding-top: var(--sp-1); border-top: 1px solid var(--ink); font-weight: 700; }
.paper-count { margin-top: var(--sp-4) !important; font-weight: 650; }
.paper-note { margin-top: var(--sp-4) !important; color: var(--muted); }
.paper-sign { display: flex; justify-content: space-between; gap: var(--sp-8); margin-top: var(--sp-16); }
.paper-sign p { min-width: 11rem; padding-top: var(--sp-2); border-top: 1px solid var(--ink); text-align: center; font-size: var(--fs-sm); }

.only-challan { display: none; }
.print-challan .only-challan { display: revert; }
.print-challan .only-invoice { display: none; }

@media (max-width: 48rem) {
    .paper { padding: var(--sp-4) var(--sp-4); }
    .paper-head { flex-direction: column; gap: var(--sp-2); }
    .paper-meta { text-align: left; }
    .paper-sign { margin-top: var(--sp-10); gap: var(--sp-4); }
    .paper-sign p { min-width: 0; flex: 1; }
    .salelist input[data-price] { width: 100%; text-align: left; }
}

@media print {
    @page { margin: 14mm; }
    .print-only { display: block; }
    .paper { max-width: none; padding: 0; border: 0; }
    a { color: inherit; text-decoration: none; }
    .ledger-wrap { padding-left: 0; background: none; overflow: visible; }
    .due-line b { color: inherit; }
}

/* ---------- Returns, seizures, history, reports (step 5) ---------- */

.paper-table tr.is-returned td { color: var(--muted); text-decoration: line-through; }

.timeline { list-style: none; margin: var(--sp-6) 0 0; padding: 0 0 0 var(--sp-6); border-left: 2px solid var(--red); max-width: 46rem; }
.timeline li { position: relative; padding: 0 0 var(--sp-5) var(--sp-2); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -1.85rem; top: 0.45rem; width: 0.7rem; height: 0.7rem; background: var(--paper); border: 2px solid var(--red); border-radius: 50%; }
.timeline-date { color: var(--muted); font-size: var(--fs-sm); }
.timeline-title { font-weight: 650; font-size: var(--fs-md); }
.calc-row .imei { font-size: var(--fs-md); }

@media print {
    /* keep the invoice in its desktop shape on paper, whatever the paper width */
    .paper-head { flex-direction: row !important; }
    .paper-meta { text-align: right !important; }
    .paper-sign { margin-top: var(--sp-20) !important; gap: var(--sp-12) !important; }
    .paper-sign p { flex: 0 1 12rem !important; }
    .split { display: block; }
    .calc-row { break-inside: avoid; }
}


/* ---------- Dashboard ---------- */

.dash-head { display: flex; flex-wrap: wrap; gap: var(--sp-4) var(--sp-8); justify-content: space-between; align-items: flex-end; margin-bottom: var(--sp-6); }
.dash-head h1 { font-size: var(--fs-lg); }
.dash-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

.panel { background: var(--card); border: 1px solid var(--rule); border-radius: 10px; padding: var(--sp-5) var(--sp-6) var(--sp-6); min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-4); margin-bottom: var(--sp-4); }
.panel-head h2 { font-size: var(--fs-md); font-weight: 600; color: var(--muted); }
.panel-head a { font-size: var(--fs-sm); }
.quiet { color: var(--muted); }

.start { margin-bottom: var(--sp-5); border-left: 4px solid var(--red); }
.start h2 { margin-bottom: var(--sp-2); }
.start-steps { margin: 0; padding-left: var(--sp-5); display: grid; gap: var(--sp-1); }
.start-steps span { display: block; color: var(--muted); font-size: var(--fs-sm); }

/* the journey: one quiet strip, a red rail with a stop at each stage */
.flow { list-style: none; margin: 0 0 var(--sp-5); padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--card); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; }
.flow-step { position: relative; }
.flow-step a { display: grid; gap: var(--sp-1); padding: var(--sp-8) var(--sp-6) var(--sp-6); color: inherit; text-decoration: none; height: 100%; }
.flow-step a:hover { background: var(--paper); }
.flow-step::before { content: ""; position: absolute; left: 0; right: 0; top: 1.05rem; height: 2px; background: var(--red); opacity: 0.22; }
.flow-step:first-child::before { left: 1.5rem; }
.flow-step:last-child::before { right: 1.5rem; }
.flow-step::after { content: ""; position: absolute; left: 1.5rem; top: calc(1.05rem - 4px); width: 10px; height: 10px; background: var(--card); border: 2px solid var(--red); border-radius: 50%; }
.flow-label { font-size: var(--fs-sm); color: var(--muted); }
.flow-num { font-size: var(--fs-lg); font-weight: 650; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.flow-num small, .hero-num small, .position .net small { font-size: var(--fs-sm); font-weight: 500; color: var(--muted); letter-spacing: 0; }
.flow-sub { font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
.flow-due .flow-num { color: var(--amber); }

.dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--sp-5); }
.span-12 { grid-column: span 12; }
.span-7 { grid-column: span 7; }
.span-5 { grid-column: span 5; }
.span-4 { grid-column: span 4; }

.hero-num { font-size: var(--fs-lg); font-weight: 650; line-height: 1.05; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
.hero-sub { margin-top: var(--sp-2); color: var(--muted); max-width: 34rem; }

.chart { margin: var(--sp-6) 0 0; position: relative; }
.chart figcaption { font-size: var(--fs-sm); color: var(--muted); margin-bottom: var(--sp-2); }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-base { stroke: #b9c3d4; stroke-width: 1; }
.chart-grid { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 2 4; }
.chart-tick { font-size: var(--fs-sm); fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart-hit { fill: transparent; }
.chart-fill { fill: var(--red); }
.chart-zero { fill: #cfd7e4; }
.chart-bar { outline: none; cursor: default; }
.chart-bar:hover .chart-fill, .chart-bar:focus-visible .chart-fill { fill: var(--red-deep); }
.chart-bar:hover .chart-hit, .chart-bar:focus-visible .chart-hit { fill: rgba(23, 32, 58, 0.04); }
.chart-empty { position: absolute; left: 0; right: 0; top: 45%; text-align: center; color: var(--muted); }

.tip { position: fixed; z-index: 60; padding: var(--sp-1) var(--sp-2); font-size: var(--fs-sm); color: #fff; background: var(--ink); border-radius: 6px; pointer-events: none; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); }
.tip[hidden] { display: none; }

.position { margin: 0; display: grid; }
.position > div { display: flex; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-2) 0; border-bottom: 1px solid var(--rule-soft); }
.position dt a { color: inherit; text-decoration: none; }
.position dt a:hover { color: var(--red); text-decoration: underline; }
.position dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 550; }
.position .less dd { color: var(--muted); }
.position .net { border-bottom: 0; border-top: 2px solid var(--ink); margin-top: 0; padding-top: var(--sp-3); align-items: baseline; }
.position .net dt { font-weight: 650; }
.position .net dd { font-size: var(--fs-lg); font-weight: 650; letter-spacing: -0.02em; }

.rows, .feed { list-style: none; margin: 0; padding: 0; display: grid; }
.rows li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 var(--sp-4); padding: var(--sp-2) 0; border-bottom: 1px solid var(--rule-soft); }
.rows li:last-child, .feed li:last-child { border-bottom: 0; padding-bottom: 0; }
.rows a, .feed a { color: inherit; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows a:hover, .feed a:hover { color: var(--red); text-decoration: underline; }
.rows-num { font-weight: 600; font-variant-numeric: tabular-nums; }
.rows-note { grid-column: 1 / -1; font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
.rows-bar { grid-column: 1 / -1; height: 4px; background: var(--rule-soft); border-radius: 2px; }
.rows-bar i { display: block; height: 100%; background: var(--amber); border-radius: 2px; }

.feed li { display: grid; gap: 0; padding: var(--sp-2) 0; border-bottom: 1px solid var(--rule-soft); }
.feed-meta { font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; }

.plain-table { overflow-x: auto; margin: 0 calc(var(--sp-4) * -1); }
.plain-table .ledger tbody tr:hover { background: transparent; }

@media (max-width: 75rem) {
    .span-7, .span-5 { grid-column: span 12; }
    .span-4 { grid-column: span 6; }
    .span-4:last-of-type { grid-column: span 12; }
}

@media (max-width: 62rem) {
    .flow { grid-template-columns: repeat(2, 1fr); }
    .flow-step:nth-child(2)::before { right: 1.5rem; }
    .flow-step:nth-child(3)::before { left: 1.5rem; }
    .flow-step:nth-child(n+3) { border-top: 1px solid var(--rule-soft); }
}

@media (max-width: 48rem) {
    .dash-head h1 { font-size: var(--fs-lg); }
    .dash-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
    .panel { padding: var(--sp-4) var(--sp-4) var(--sp-5); }
    .flow-step a { padding: var(--sp-8) var(--sp-4) var(--sp-4); }
    .flow-step::after { left: 1.1rem; }
    .flow-step:first-child::before, .flow-step:nth-child(3)::before { left: 1.1rem; }
    .flow-step:last-child::before, .flow-step:nth-child(2)::before { right: 1.1rem; }
    .flow-num { font-size: var(--fs-lg); }
    .hero-num { font-size: var(--fs-lg); }
    .span-4, .span-4:last-of-type { grid-column: span 12; }
    .dash-grid { gap: var(--sp-4); }
    .plain-table { margin: 0; }
}

/* ---------- Footnote ---------- */

.foot { padding: 0 var(--sp-4) var(--sp-6); text-align: center; font-size: var(--fs-sm); color: var(--muted); }
.shell .foot { margin-left: var(--spine-w); }
.foot a { color: inherit; font-weight: 600; }
.foot a:hover { color: var(--accent); }

@media (max-width: 48rem) {
    .shell .foot { margin-left: 0; }
}

/* ---------- Phone: bottom bar, thumb-sized controls ---------- */

.tabbar { display: none; }

@media (max-width: 48rem) {
    .menu-btn { display: none; }
    .topbar { justify-content: center; padding: var(--sp-3) var(--sp-4); }

    .tabbar {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 22;
        display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
        padding: var(--sp-1) var(--sp-1) calc(var(--sp-1) + env(safe-area-inset-bottom));
        background: var(--card); border-top: 1px solid var(--rule);
        box-shadow: 0 -4px 16px rgba(15, 27, 45, 0.06);
    }
    .tab {
        display: grid; justify-items: center; gap: 0; min-height: 3.25rem; padding: var(--sp-1) 0;
        font: inherit; font-size: var(--fs-sm); font-weight: 600; line-height: 1.2; color: var(--muted);
        text-decoration: none; background: none; border: 0; border-radius: var(--radius);
    }
    .tab svg { width: 1.45rem; height: 1.45rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
    .tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .tab.is-current { color: var(--accent); }
    .tab-main { color: var(--accent-deep); }
    .tab-main b { display: grid; place-items: center; width: 3rem; height: 3rem; margin-top: calc(var(--sp-5) * -1); color: #fff; background: var(--accent); border-radius: 50%; box-shadow: 0 4px 12px rgba(11, 122, 102, 0.35); }
    .tab-main b svg { stroke-width: 2.4; }

    .rail { z-index: 30; padding-bottom: var(--sp-20); }
    .shell .page { padding-bottom: var(--sp-8); }
    .shell .foot { padding-bottom: calc(var(--sp-20) + var(--sp-2) + env(safe-area-inset-bottom)); }

    /* fields and buttons big enough for a thumb; 16px text stops the phone zooming in */
    input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea { min-height: 2.9rem; font-size: var(--fs-md); }
    button, .btn, .button { min-height: 2.75rem; }
    input[type=checkbox], input[type=radio] { width: 1.3rem; height: 1.3rem; }
    .rail-link { padding-top: var(--sp-2); padding-bottom: var(--sp-2); }

    /* the save button stays in reach on long entry screens */
    .entry > .form-actions {
        position: sticky; bottom: calc(4.1rem + env(safe-area-inset-bottom)); z-index: 15;
        margin: 0 calc(var(--sp-4) * -1); padding: var(--sp-2) var(--sp-4);
        background: var(--card); border-top: 1px solid var(--rule); box-shadow: 0 -4px 14px rgba(15, 27, 45, 0.07);
    }
    .entry > .form-actions > :first-child { flex: 1; }

}

@media print { .tabbar { display: none !important; } }

/* ---------- Opening balances, Google Drive setup, forgot password ---------- */
.plainlinks { margin: var(--sp-2) 0 0; padding: 0; list-style: none; display: grid; gap: var(--sp-2); }
.plainlinks a { font-weight: 600; }
.plainlinks .hint { display: block; margin-top: 0; }
h2.gap { margin-top: var(--sp-8); }
.steps { margin-top: var(--sp-5); max-width: 46rem; }
.steps summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.steps ol { margin: var(--sp-4) 0 var(--sp-5); padding-left: var(--sp-5); display: grid; gap: var(--sp-2); }
.steps .creds { display: block; margin-top: var(--sp-2); overflow-wrap: anywhere; }
.login-forgot { margin: 0; text-align: center; font-size: var(--fs-sm); }
.login-form .hint { margin: 0; }

.prose { max-width: 44rem; margin: 4vh auto 0; }
.prose h2 { margin-top: var(--sp-2); font-size: var(--fs-md); }
.prose p { margin: 0; }

/* ---------- IMEI tools and camera scanner ---------- */
.imei-tools { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.imei-tools .pick-msg { flex: 1 1 12rem; min-height: 0; }
.btn-tool { min-height: 2.4rem; padding: var(--sp-1) var(--sp-3); font-size: var(--fs-sm); color: var(--accent-deep); border-color: var(--accent); background: var(--accent-soft); }
.scanner { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-rows: auto 1fr auto auto; gap: var(--sp-3); padding: var(--sp-4); padding-bottom: calc(var(--sp-4) + env(safe-area-inset-bottom)); background: #0b1220; color: #fff; }
.scanner[hidden] { display: none; }
.scanner-top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-4); }
.scanner-title { margin: 0; font-weight: 600; }
.scanner-count { font-weight: 700; color: #7fe0c8; white-space: nowrap; }
.scanner-view { position: relative; min-height: 0; overflow: hidden; border-radius: 12px; background: #000; }
.scanner-view video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner-line { position: absolute; left: 8%; right: 8%; top: 50%; height: 2px; background: #ff5a5a; box-shadow: 0 0 10px #ff5a5a; }
.scanner-status { margin: 0; min-height: 1.6rem; text-align: center; font-weight: 600; color: #7fe0c8; }
.scanner-status.is-bad { color: #ffb4a8; }
.scanner-actions { display: flex; gap: var(--sp-2); justify-content: center; }
.scanner-actions .btn { min-width: 8rem; }
.is-scanning { overflow: hidden; }
@media print { .imei-tools, .btn-tool, .scanner { display: none !important; } }

/* ---------- Staff, wholesalers, Google login ---------- */
.is-staff .profit-col, .is-staff details.confirm { display: none !important; }
.tag-bad { color: #a01226; border-color: #a01226; }
.tag-warn { color: var(--amber); border-color: var(--amber); }
.notice-warn { background: #fff6e5; border-left-color: var(--amber); color: #7a3b05; }
.ledger td .sub { display: block; color: var(--muted); font-size: var(--fs-sm); }
.btn-google { gap: var(--sp-2); }
.btn-google svg { width: 1.15rem; height: 1.15rem; }

/* ---------- Subscription ---------- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: var(--sp-3); margin-top: var(--sp-3); max-width: 30rem; }
.plan { padding: var(--sp-4) var(--sp-4); background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); }
.plan-best { border-color: var(--accent); background: var(--accent-soft); }
.plan-name { margin: 0; color: var(--muted); font-weight: 600; }
.plan-price { margin: var(--sp-1) 0 0; font-size: var(--fs-lg); font-weight: 700; }
.plan-note { margin: var(--sp-1) 0 0; color: var(--accent-deep); font-weight: 600; font-size: var(--fs-sm); }
.paylist { margin: var(--sp-3) 0 0; max-width: 30rem; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); }
.paylist div { display: flex; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-2) var(--sp-4); border-bottom: 1px solid var(--rule-soft); }
.paylist div:last-child { border-bottom: 0; }
.paylist dt { color: var(--muted); }
.paylist dd { margin: 0; font-weight: 700; letter-spacing: 0.02em; user-select: all; }
.paycard { margin-top: var(--sp-3); }
.paycard p { margin: 0; }
.rail-link .count { display: inline-block; min-width: 1.3rem; padding: 0 var(--sp-1); margin-left: var(--sp-1); text-align: center; font-size: var(--fs-sm); color: #fff; background: #a01226; border-radius: 99px; }
.field input[type=file] { padding: var(--sp-2); height: auto; }

/* ---------- Front page: what the portal is, next to the login ---------- */
.landing { display: grid; grid-template-columns: minmax(0, 1fr) 25rem; gap: var(--sp-12); align-items: start; max-width: 68rem; margin: 5vh auto 0; }
.landing .login { margin: 0; max-width: none; grid-column: 2; grid-row: 1; position: sticky; top: 1.5rem; }
.landing-info { grid-column: 1; grid-row: 1; padding-top: var(--sp-2); }
.landing-kicker { margin: 0; color: var(--accent); font-weight: 700; font-size: var(--fs-sm); letter-spacing: 0.04em; text-transform: uppercase; }
.landing-head { margin: var(--sp-2) 0 0; font-size: var(--fs-lg); line-height: 1.15; font-weight: 750; text-wrap: balance; }
.landing-lede { margin: var(--sp-4) 0 0; font-size: var(--fs-md); color: var(--muted); max-width: 36rem; }
.landing-points { list-style: none; margin: var(--sp-6) 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4) var(--sp-6); }
.landing-points li { padding-left: var(--sp-4); border-left: 3px solid var(--accent); color: var(--muted); font-size: var(--fs-md); }
.landing-points b { display: block; color: var(--ink); font-size: var(--fs-md); }
.landing-price { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: var(--sp-3); margin-top: var(--sp-8); }
.landing-trial, .landing-plan { display: grid; align-content: center; gap: 0; padding: var(--sp-4) var(--sp-4); background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); }
.landing-trial { color: #fff; background: var(--accent); border-color: var(--accent); }
.landing-trial strong { font-size: var(--fs-lg); line-height: 1.2; }
.landing-trial span { color: var(--red-ink); font-size: var(--fs-sm); }
.landing-plan .plan-price { font-size: var(--fs-lg); }
.landing-cta { margin-top: var(--sp-5); }
@media (max-width: 62rem) {
    .landing { grid-template-columns: 1fr; gap: var(--sp-8); max-width: 34rem; margin-top: var(--sp-4); }
    .landing .login, .landing-info { grid-column: 1; grid-row: auto; position: static; }
}
@media (max-width: 34rem) {
    .landing-points { grid-template-columns: 1fr; }
    .landing-price { grid-template-columns: 1fr 1fr; }
    .landing-trial { grid-column: 1 / -1; }
    .landing-cta { width: 100%; }
}

/* ---------- Documents: invoice, challan, statements, reports as A4 sheets ---------- */
.sheet-view { max-width: 794px; overflow: hidden; border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: 0 6px 24px rgba(15, 27, 45, 0.07); }
.sheet-view .sheet { min-height: 1123px; padding-top: var(--sp-10); padding-bottom: var(--sp-10); }
.sheet-store { display: none; }
.sheet-export { position: fixed; left: -10000px; top: 0; width: 794px; }

.sheet { width: 794px; padding: 0 var(--sp-12); background: #fff; color: #17202e; font-size: var(--fs-sm); line-height: 1.5; display: flex; flex-direction: column; }
.sheet p { margin: 0; }
.sheet-head { display: flex; justify-content: space-between; gap: var(--sp-8); padding: 0 0 var(--sp-4); border-bottom: 3px solid #0b7a66; }
.sheet-biz { color: #4b5768; }
.sheet-biz-name { font-size: var(--fs-lg); font-weight: 750; line-height: 1.25; color: #0f1b2d; margin-bottom: 0 !important; }
.sheet-doc { text-align: right; color: #4b5768; flex: none; }
.sheet-title { font-size: var(--fs-lg); font-weight: 750; line-height: 1.2; color: #0b7a66; margin-bottom: var(--sp-1) !important; }
.sheet-doc b { color: #0f1b2d; font-weight: 650; }
.sheet-doc span::after { content: ":"; }

.sheet-party { display: flex; gap: var(--sp-6); align-items: flex-start; margin: var(--sp-5) 0 var(--sp-5); color: #4b5768; }
.sheet-party > div:first-child { flex: 1; min-width: 0; }
.sheet-label { font-size: var(--fs-sm); font-weight: 650; color: #6b7686; margin-bottom: 0 !important; }
.sheet-name { font-size: var(--fs-md); font-weight: 700; color: #0f1b2d; }
.sheet-fact { flex: none; min-width: 120px; padding: var(--sp-2) var(--sp-3) var(--sp-2); background: #f1f8f6; border-radius: 6px; text-align: right; }
.sheet-big { font-size: var(--fs-md); font-weight: 750; color: #0f1b2d; font-variant-numeric: tabular-nums; }

.sheet-boxes { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-2); margin: 0 0 var(--sp-4); }
.sheet-boxes-3 { grid-template-columns: repeat(3, 1fr); }
.sheet-boxes > div { padding: var(--sp-2) var(--sp-3) var(--sp-2); border: 1px solid #dfe5ec; border-radius: 6px; }
.sheet-boxes dt { font-size: var(--fs-sm); font-weight: 600; color: #6b7686; }
.sheet-boxes dd { margin: 0 0 0; font-size: var(--fs-md); font-weight: 700; font-variant-numeric: tabular-nums; }
.sheet-boxes .is-key { background: #0b7a66; border-color: #0b7a66; }
.sheet-boxes .is-key dt { color: #d5efe8; }
.sheet-boxes .is-key dd { color: #fff; }

.sheet-h { margin: var(--sp-4) 0 var(--sp-2); font-size: var(--fs-sm); font-weight: 700; color: #0f1b2d; }
.sheet-table { width: 100%; border-collapse: collapse; }
.sheet-table th, .sheet-table td { padding: var(--sp-2) var(--sp-2); text-align: left; vertical-align: top; border-bottom: 1px solid #e3e8ee; }
.sheet-table thead th { font-size: var(--fs-sm); font-weight: 700; color: #0f1b2d; background: #eef5f3; border-bottom: 1px solid #0b7a66; }
.sheet-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sheet-table .narrow { width: 34px; color: #6b7686; }
.sheet-table .date { width: 92px; white-space: nowrap; }
.sheet-table .mono { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sheet-table .strong { font-weight: 650; }
.sheet-table tr.is-struck td { color: #8a94a3; text-decoration: line-through; }
.sheet-table tfoot td { font-weight: 700; border-top: 1px solid #0b7a66; border-bottom: 0; background: #f6f9f8; }

.sheet-end { display: flex; justify-content: space-between; gap: var(--sp-8); margin-top: var(--sp-4); }
.sheet-remark { flex: 1; min-width: 0; color: #4b5768; }
.sheet-remark .sheet-label { margin-top: var(--sp-1); }
.sheet-remark .sheet-label:first-child { margin-top: 0; }
.sheet-remark b { color: #0f1b2d; }
.sheet-totals { flex: none; width: 270px; margin: 0; }
.sheet-totals > div { display: flex; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-1) var(--sp-3); }
.sheet-totals dt { color: #4b5768; }
.sheet-totals dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.sheet-totals .sheet-due { margin-top: var(--sp-1); padding: var(--sp-2) var(--sp-3); color: #fff; background: #0b7a66; border-radius: 6px; }
.sheet-totals .sheet-due dt { color: #fff; font-weight: 600; }
.sheet-totals .sheet-due dd { font-size: var(--fs-md); font-weight: 750; }
.sheet-count { margin-top: var(--sp-4) !important; font-size: var(--fs-sm); font-weight: 700; }
.sheet-note { margin-top: var(--sp-1) !important; color: #4b5768; }

.sheet-sign { display: flex; justify-content: space-between; gap: var(--sp-12); margin-top: var(--sp-20); }
.sheet-sign p { flex: 0 1 210px; padding-top: var(--sp-1); border-top: 1px solid #17202e; text-align: center; font-size: var(--fs-sm); color: #4b5768; }
.sheet-foot { display: flex; justify-content: space-between; gap: var(--sp-4); margin-top: var(--sp-6); padding-top: var(--sp-2); border-top: 1px solid #e3e8ee; font-size: var(--fs-sm); color: #8a94a3; }
.sheet-view .sheet-foot { margin-top: auto; }
.sheet-view .sheet-sign { margin-bottom: var(--sp-6); }

/* ---------- Reports ---------- */
.report-master { display: grid; gap: var(--sp-1); max-width: 46rem; margin-top: var(--sp-5); padding: var(--sp-4) var(--sp-5); color: #fff; background: var(--accent); border-radius: var(--radius); text-decoration: none; }
.report-master:hover { background: var(--accent-deep); color: #fff; }
.report-master strong { font-size: var(--fs-md); }
.report-master span { color: var(--red-ink); }
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: var(--sp-3); margin-top: var(--sp-3); }
.report-card { display: grid; gap: var(--sp-1); align-content: start; padding: var(--sp-4) var(--sp-4); color: var(--ink); background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); text-decoration: none; }
.report-card:hover { border-color: var(--accent); color: var(--ink); }
.report-card strong { font-size: var(--fs-md); }
.report-card span { color: var(--muted); font-size: var(--fs-sm); }

.sheet-report .sheet-head { margin-bottom: var(--sp-4); }
.sheet-h-first { margin-top: 0; }
.sheet-group { margin: var(--sp-6) 0 0; padding: var(--sp-2) var(--sp-3); font-size: var(--fs-md); font-weight: 750; color: #fff; background: #0f1b2d; border-radius: 4px; }
.sheet-sec { margin-top: var(--sp-1); }
.sheet-sec + .sheet-sec { margin-top: var(--sp-5); }
.sheet-sec .sheet-h { margin: var(--sp-3) 0 0; padding-bottom: var(--sp-1); border-bottom: 1px solid #dfe5ec; }
.sheet-intro { margin: 0 0 var(--sp-2) !important; color: #6b7686; font-size: var(--fs-sm); }
.sheet-none { padding: var(--sp-2) var(--sp-3); color: #6b7686; background: #f6f8fa; border-radius: 6px; }
.sheet-boxes { margin-bottom: var(--sp-3); }
.sheet-boxes-1 { grid-template-columns: 1fr; }
.sheet-boxes-2 { grid-template-columns: repeat(2, 1fr); }
.sheet-report .sheet-boxes dd { font-size: var(--fs-sm); }
.sheet-report .sheet-table th, .sheet-report .sheet-table td { padding: var(--sp-1) var(--sp-2); font-size: var(--fs-sm); }
.sheet-report .sheet-table thead th { font-size: var(--fs-sm); }
.sheet-table tr.is-sub td { font-weight: 700; color: #0b7a66; background: #f6f9f8; }

.sheet-signs-only { padding-top: 0; padding-bottom: 0; }
.sheet-signs-only .sheet-sign { margin-top: 0; padding-top: var(--sp-8); }

/* ---------- New sale: shop finder and IMEI suggestions; scanner extras ---------- */
.who { position: relative; }
.who.is-saved { border-color: var(--accent); }
.who-state { margin: 0; min-height: 1.4rem; font-weight: 600; color: var(--muted); }
.who.is-saved .who-state { color: var(--accent-deep); }
.who-list { list-style: none; margin: 0; padding: var(--sp-1); display: grid; gap: var(--sp-1); background: var(--card); border: 1px solid var(--accent); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(15, 27, 45, 0.12); }
.who-list[hidden] { display: none; }
.who-list button { display: grid; width: 100%; gap: 0; padding: var(--sp-2) var(--sp-3); min-height: 0; font: inherit; text-align: left; color: var(--ink); background: none; border: 0; border-radius: 6px; cursor: pointer; }
.who-list button:hover, .who-list button:focus { background: var(--accent-soft); }
.who-list button span { color: var(--muted); font-size: var(--fs-sm); }
.picktools .field { position: relative; }
.picktools .who-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 12; margin-top: var(--sp-1); }
.scanner { grid-template-rows: auto 1fr auto auto auto; }
.scanner-actions { flex-wrap: wrap; }
.scanner-actions .btn { min-width: 0; flex: 1 1 auto; }
.scanner-info { margin: 0; text-align: center; font-size: var(--fs-sm); color: #7d8aa0; overflow-wrap: anywhere; }

/* ---------- Accounts ---------- */
.stand { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); margin-top: var(--sp-3); max-width: 46rem; }
.stand-col { margin: 0; padding: var(--sp-2) var(--sp-4) var(--sp-4); background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); align-self: start; }
.stand-col > div { display: flex; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-2) 0; border-bottom: 1px solid var(--rule-soft); }
.stand-col dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; }
.stand-col dt { color: var(--muted); }
.stand-head { padding: var(--sp-2) 0 var(--sp-1); font-weight: 700; color: var(--ink) !important; }
.stand-col .stand-total { border-bottom: 0; }
.stand-col .stand-total dt, .stand-col .stand-total dd { color: var(--ink); font-weight: 700; }
.stand-col .stand-net { margin: var(--sp-2) calc(var(--sp-2) * -1) 0; padding: var(--sp-3) var(--sp-3); border: 0; color: #fff; background: var(--accent); border-radius: 6px; }
.stand-col .stand-net dt { color: #fff; font-weight: 600; }
.stand-col .stand-net dd { font-size: var(--fs-md); font-weight: 750; }
.field[hidden] { display: none; }
@media (max-width: 48rem) { .stand { grid-template-columns: 1fr; } }

/* ---------- Roles, credit limits, price list, portal overview (update 26) ---------- */
/* Sales staff work with selling prices only */
.no-cost .cost-col { display: none !important; }

/* Model > Memory > Colour */
.modelpick { display: grid; grid-template-columns: 1fr; gap: var(--sp-4); align-items: start; margin-bottom: var(--sp-4); }
.group .modelpick { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1.2fr); }
@media (max-width: 720px) { .group .modelpick { grid-template-columns: 1fr; } }

/* Staff roles */
.inline-pick select { height: 2.1rem; padding: 0 var(--sp-8) 0 var(--sp-2); font: inherit; color: var(--ink); background-color: var(--card); border: 1px solid #b9c0cf; border-radius: 6px; }
.roles { margin: var(--sp-3) 0 0; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); }
.roles div { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: var(--sp-4); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--rule-soft); }
.roles div:last-child { border-bottom: 0; }
.roles dt { font-weight: 650; }
.roles dd { margin: 0; color: var(--muted); }
@media (max-width: 560px) { .roles div { grid-template-columns: 1fr; gap: var(--sp-1); } }

/* A tick box with its words beside it */
.check { display: flex; align-items: flex-start; gap: var(--sp-2); margin: var(--sp-2) 0; line-height: 1.4; cursor: pointer; }
.check input { flex: none; width: 1.1rem; height: 1.1rem; margin-top: var(--sp-1); accent-color: var(--accent); }
.notice .check { margin-bottom: 0; font-weight: 600; }
.notice p + p, .notice p + .check { margin-top: var(--sp-2); }

/* A button that opens a short "are you sure" */
details.ask { margin: 0 0 var(--sp-4); }
details.ask > summary { display: inline-flex; list-style: none; cursor: pointer; }
details.ask > summary::-webkit-details-marker { display: none; }
details.ask[open] > summary { margin-bottom: var(--sp-3); }
details.ask form { max-width: 38rem; padding: var(--sp-4) var(--sp-4); background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); }
details.ask form p { margin: 0 0 var(--sp-3); }

.card.gap { margin-top: var(--sp-5); }
.due-limit { display: inline-block; margin-left: var(--sp-4); font-size: var(--fs-sm); color: var(--muted); }
.due-limit .tag { margin-left: var(--sp-1); }

/* Net profit under the month's profit */
.hero-net { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-6); align-items: baseline; margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--rule-soft); color: var(--muted); }
.hero-net b { margin-left: var(--sp-1); color: var(--ink); font-variant-numeric: tabular-nums; }
.hero-net-key { font-weight: 650; color: var(--ink); }
.hero-net-key b { color: var(--green); font-size: var(--fs-md); }
.hero-net-key.loss b { color: #a01226; }
dl.position.gap { margin-top: var(--sp-5); }

/* Filter chips above a list */
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.chip { padding: var(--sp-1) var(--sp-3); font-size: var(--fs-sm); color: var(--ink); text-decoration: none; background: var(--card); border: 1px solid var(--rule); border-radius: 99px; }
.chip:hover { border-color: #6f7c94; }
.chip.is-current { color: #fff; background: var(--accent); border-color: var(--accent); }

/* Price list */
.price-in { width: 7.5rem; height: 2.2rem; padding: 0 var(--sp-2); font: inherit; font-variant-numeric: tabular-nums; text-align: right; color: var(--ink); background: var(--card); border: 1px solid #b9c0cf; border-radius: 6px; }
.price-in:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.pl-text { width: 100%; margin-top: var(--sp-2); padding: var(--sp-3) var(--sp-3); font: inherit; font-size: var(--fs-sm); line-height: 1.5; color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; resize: vertical; white-space: pre-wrap; }
@media (max-width: 760px) { .price-in { width: 100%; max-width: 9rem; } }

/* The picture of the price list: drawn off screen at a fixed width so it comes out the same on every phone */
.pricecard { width: 794px; padding: var(--sp-8) var(--sp-10) var(--sp-8); background: #fff; color: #17202e; font-size: var(--fs-md); line-height: 1.4; }
.pricecard p { margin: 0; }
.pricecard-head { padding-bottom: var(--sp-3); border-bottom: 4px solid #0b7a66; }
.pricecard-biz { font-size: var(--fs-lg); font-weight: 750; line-height: 1.2; color: #0f1b2d; }
.pricecard-title { margin-top: var(--sp-1) !important; font-size: var(--fs-md); color: #4b5768; }
.pricecard-brand { margin: var(--sp-4) 0 var(--sp-1) !important; font-size: var(--fs-sm); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #0b7a66; }
.pricecard table { width: 100%; border-collapse: collapse; }
.pricecard td { padding: var(--sp-2) 0; border-bottom: 1px solid #e1e6ee; vertical-align: top; }
.pricecard td b { display: block; font-weight: 650; }
.pricecard .pc-colours { display: block; font-size: var(--fs-sm); color: #5b6678; }
.pricecard .pc-qty { width: 76px; padding-left: var(--sp-2); text-align: right; white-space: nowrap; font-size: var(--fs-sm); color: #5b6678; }
.pricecard .pc-price { width: 132px; padding-left: var(--sp-2); text-align: right; white-space: nowrap; font-size: var(--fs-md); font-weight: 750; font-variant-numeric: tabular-nums; }
.pricecard.hide-qty .pc-qty, .pricecard.hide-colours .pc-colours { display: none; }
.pricecard-foot { margin-top: var(--sp-4) !important; font-size: var(--fs-sm); color: #4b5768; }
.pricecard-foot b { color: #0f1b2d; }

.tag { white-space: nowrap; }
.ledger[data-master="phone-models"] td:nth-child(2) { white-space: nowrap; }

/* ---------- One font, three sizes, brand colour, hover and focus everywhere (update 27) ---------- */
button, input, select, textarea, svg text { font-family: var(--font); }
h3, h4, legend, summary { font-size: var(--fs-md); }
small, .small { font-size: var(--fs-sm); }
::selection { background: var(--accent-soft); color: var(--ink); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }

/* Every link and button shows that it can be pressed, and where the keyboard is */
a, button, summary, [role=button], label.check { cursor: pointer; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:hover { border-color: var(--accent); }
.btn-primary:hover { filter: none; }
.btn:focus-visible { box-shadow: 0 0 0 4px var(--accent-soft); }
.linklike:hover, .linklike:focus-visible { color: var(--accent-deep); text-decoration-thickness: 2px; }
.rail-item:hover, .rail-link:hover, .tab:hover { color: var(--accent-deep); background: var(--accent-soft); }
.chip:hover, .chip:focus-visible { border-color: var(--accent); color: var(--accent-deep); }
.chip.is-current:hover { color: #fff; }
.report-card:hover, .report-master:hover, .flow-step a:hover { border-color: var(--accent); }
.flow-step a:hover .flow-label, .panel-head a:hover { color: var(--accent-deep); }
.who-list button:hover, .who-list button:focus-visible { background: var(--accent-soft); }
.foot a:hover { color: var(--accent-deep); }
button:disabled, .btn:disabled { cursor: progress; opacity: 0.75; }

/* Waiting for the server: a spinner on the pressed button, or in the field being checked */
@keyframes spin { to { transform: rotate(360deg); } }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy::after {
    content: ""; position: absolute; inset: 0; margin: auto; width: var(--sp-4); height: var(--sp-4);
    border: 2px solid currentColor; border-color: var(--accent) transparent var(--accent) transparent; border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.btn-primary.is-busy::after { border-color: #fff transparent #fff transparent; }
.field.is-loading { position: relative; }
.field.is-loading::after {
    content: ""; position: absolute; right: var(--sp-3); bottom: var(--sp-3); width: var(--sp-5); height: var(--sp-5);
    border: 2px solid var(--accent); border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite;
}
@media (prefers-reduced-motion: reduce) { .btn.is-busy::after, .field.is-loading::after { animation-duration: 2s; } }

/* An empty list: what is missing, and one thing to do about it */
.empty-state { display: grid; justify-items: start; gap: var(--sp-3); padding: var(--sp-6); background: var(--card); border: 1px dashed var(--rule); border-radius: var(--radius); color: var(--muted); }
.empty-state p { max-width: 36rem; }
.empty-state .empty-icon { width: var(--sp-8); height: var(--sp-8); fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; }
.empty-state form { margin: 0; }
.empty-state.is-quiet { padding: 0; background: none; border: 0; }
.empty-state.is-quiet .empty-icon { display: none; }
.empty-state.is-quiet .btn { min-height: 0; padding: var(--sp-1) var(--sp-3); }

/* 404 and 403 */
.errorpage { display: grid; justify-items: center; gap: var(--sp-4); max-width: 30rem; margin: var(--sp-16) auto; padding: 0 var(--sp-4); text-align: center; }
.errorpage-mark { border-radius: var(--sp-4); }
.errorpage-code { color: var(--accent); font-weight: 700; letter-spacing: 0.08em; }
.errorpage p { color: var(--muted); }

/* The app as it looks, on the login page */
.landing-shot { margin: var(--sp-6) 0 0; }
.landing-shot img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: 0 var(--sp-3) var(--sp-8) rgba(15, 27, 45, 0.12); }
.landing-shot figcaption { margin-top: var(--sp-2); color: var(--muted); font-size: var(--fs-sm); }
.login-brand { display: flex; align-items: center; gap: var(--sp-3); }
.login-brand img { width: var(--sp-12); height: var(--sp-12); border-radius: var(--sp-3); }

/* The subscription plans fit a 375px phone */
.plans { grid-template-columns: repeat(auto-fit, minmax(min(9rem, 100%), 1fr)); }
.rail-item:hover, .rail-item.is-current:hover, .rail-group[open] > summary.rail-item:hover, details[data-current] > summary.rail-item:hover { background: var(--accent-soft); color: var(--accent-deep); box-shadow: inset 3px 0 0 var(--accent); }
.chip.is-current:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
details > summary:hover { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 0.18em; }
summary.rail-item:hover, details.ask > summary:hover { text-decoration: none; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type=date]:focus-within, input[type=time]:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- Login: only the essentials show; everything else opens on a click ---------- */
.landing { display: block; max-width: 40rem; margin: 6vh auto 0; }
.landing .login { position: static; max-width: 25rem; margin: 0 auto; }
.more { margin: var(--sp-8) auto 0; }
.more-row { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-2); }
.more-btn {
    min-height: var(--sp-10); padding: 0 var(--sp-4); font: inherit; font-size: var(--fs-sm); font-weight: 600;
    color: var(--muted); background: transparent; border: 1px solid var(--rule); border-radius: 99px;
    transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}
.more-btn:hover { color: var(--accent-deep); border-color: var(--accent); background: var(--card); }
.more-btn[aria-expanded="true"] { color: #fff; background: var(--accent); border-color: var(--accent); }
.more-panel { margin-top: var(--sp-4); padding: var(--sp-6); background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); animation: more-in 0.18s ease-out; }
.more-panel .landing-head { margin: 0; }
.more-panel .landing-points { grid-template-columns: 1fr; }
.more-panel .landing-price { margin-top: 0; grid-template-columns: 1fr 1fr; }
.more-panel .landing-trial { grid-column: 1 / -1; }
.more-panel .landing-shot { margin: 0; }
.more-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-4); }
@keyframes more-in { from { opacity: 0; transform: translateY(calc(var(--sp-1) * -1)); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .more-panel { animation: none; } }
@media (max-width: 760px) { .landing { margin-top: var(--sp-4); } .more-panel { padding: var(--sp-4); } }
.whatsnew { margin-bottom: var(--sp-4); }
.whatsnew ul { margin: var(--sp-2) 0 0; padding-left: var(--sp-5); display: grid; gap: var(--sp-2); }
.foot .count { display: inline-block; padding: 0 var(--sp-2); color: #fff; background: var(--accent); border-radius: 99px; font-size: var(--fs-sm); }
.split.gap, .notice.gap, .calc + .split { margin-top: var(--sp-6); }
.toast { position: fixed; left: 50%; bottom: calc(var(--sp-20) + env(safe-area-inset-bottom)); z-index: 80; display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); align-items: center; max-width: min(32rem, calc(100% - var(--sp-8))); padding: var(--sp-3) var(--sp-4); color: #fff; background: var(--ink); border-radius: var(--radius); box-shadow: 0 var(--sp-2) var(--sp-6) rgba(15, 27, 45, 0.25); transform: translateX(-50%); transition: opacity 0.3s; }
.toast .linklike { color: #9fe3cf; }
.toast.is-gone { opacity: 0; pointer-events: none; }
@media (min-width: 900px) { .toast { bottom: var(--sp-6); } }

/* Market prices: the collector's address and key */
.facts { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-2) var(--sp-4); margin: var(--sp-4) 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.facts code, pre.code { font-family: var(--font); font-size: var(--fs-sm); }
pre.code { background: #f4f7f6; border-radius: 8px; padding: var(--sp-3); overflow-x: auto; max-width: 100%; white-space: pre; margin: var(--sp-2) 0; }
.card details summary { cursor: pointer; margin-top: var(--sp-2); }
.split-list, .split-form { min-width: 0; }
.feed li > span, .notice, .position dd { overflow-wrap: anywhere; }
