/* My Fitness ERP — offline stylesheet. No external fonts, no CDN. */
:root {
  /* MY Fitness store palette (25 Nov 2026), the colours of the logo and the ads:
     ink #0B0B0C, red #E3262B, chalk #F6F5F0. Warnings are amber so they never read as
     the brand red; gains stay green. */
  --bg: #f4f3ee;
  --bg-2: #f9f8f5;
  --panel: #ffffff;
  --ink: #0b0b0c;
  --ink-2: #2d2c2a;
  --muted: #6f6c66;
  --line: #e6e3dc;
  --line-2: #efede7;
  --brand: #e3262b;
  --brand-600: #c41e23;
  --brand-dark: #1b1a1a;
  --brand-deep: #0b0b0c;
  --brand-soft: #fcedec;
  --chalk: #f6f5f0;
  --accent: #b8532b;
  --warn: #b45309;
  --warn-soft: #fef4e4;
  --ok: #17784a;
  --ok-soft: #e4f4ea;
  --gold: #a67c1a;
  --gold-soft: #fbf3de;
  --radius: 14px;
  --radius-sm: 10px;
  --ring: 0 0 0 3px rgba(227, 38, 43, .18);
  --shadow-sm: 0 1px 2px rgba(11, 11, 12, .05);
  --shadow: 0 1px 2px rgba(11, 11, 12, .04), 0 6px 20px -6px rgba(11, 11, 12, .09);
  --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .45);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg); color: var(--ink);
  font: 15px/1.5 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto,
        Tahoma, "Noto Sans Arabic", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[dir="rtl"] body { font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif; }

h1, h2, h3 { margin: 0 0 .5rem; font-weight: 650; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.55rem; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 1.04rem; }
h3 { font-size: .95rem; }
a { color: var(--brand); }
::selection { background: rgba(227, 38, 43, .18); }

/* thin, quiet scrollbars */
* { scrollbar-width: thin; scrollbar-color: #ccc8c0 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #ccc8c0; border-radius: 10px; border: 2px solid transparent;
                            background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: #aeaaa1; }

/* ------------------------------------------------------------------ layout */
#app { display: flex; min-height: 100vh; }

/* The menu stays put while the page scrolls, so the next screen is always one click away. */
nav.side {
  width: 228px; flex: 0 0 228px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background:
    radial-gradient(120% 55% at 0% 0%, rgba(227, 38, 43, .20), transparent 60%),
    linear-gradient(180deg, var(--brand-dark), var(--brand-deep));
  color: rgba(246, 245, 240, .74);
  display: flex; flex-direction: column; padding: 16px 12px; gap: 2px;
}
nav.side .brand {
  display: flex; align-items: center; gap: 11px;
  font-size: 1.06rem; font-weight: 700; color: #fff;
  padding: 4px 8px 16px; margin-bottom: 8px; letter-spacing: .2px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
nav.side .brand small { display: block; font-weight: 400; font-size: .72rem; opacity: .65; letter-spacing: .4px; }
nav.side .brand-logo {
  width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%;
  background: #fff; padding: 3px; object-fit: contain;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .12), 0 4px 12px rgba(0, 0, 0, .25);
}
nav.side button {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  background: none; border: 0; color: inherit; cursor: pointer;
  padding: 9px 12px; border-radius: 10px; font: inherit; font-size: .93rem; text-align: start;
  width: 100%; box-shadow: none; transition: background .15s var(--ease), color .15s var(--ease);
}
nav.side button:hover { background: rgba(255, 255, 255, .07); color: #fff; border-color: transparent; }
nav.side button.on {
  background: rgba(255, 255, 255, .13); color: #fff; font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}
nav.side button.on::before {
  content: ""; position: absolute; inset-inline-start: -12px; top: 9px; bottom: 9px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--brand);
}
[dir="rtl"] nav.side button.on::before { border-radius: 3px 0 0 3px; }
nav.side .ico { width: 22px; text-align: center; font-size: 1rem; filter: saturate(.85); }
nav.side .foot { margin-top: auto; padding: 14px 6px 4px; font-size: .78rem;
                 border-top: 1px solid rgba(255, 255, 255, .08); }
nav.side .foot .who { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
nav.side .foot .who b { display: block; color: #fff; font-size: .88rem; }
nav.side .foot .who small { display: block; opacity: .7; }
nav.side .avatar {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #f0484d, var(--brand-600));
}
nav.side .foot .langpick { margin: 0 0 8px; gap: 4px; padding: 3px;
                           background: rgba(0, 0, 0, .18); border-radius: 10px; }
nav.side .foot .langpick button { justify-content: center; padding: 5px 0; font-size: .76rem;
                                  border-radius: 7px; color: rgba(246, 245, 240, .75); }
nav.side .foot .langpick button.on { background: #fff; color: var(--brand-dark); font-weight: 700; }
nav.side .foot .langpick button.on::before { display: none; }
nav.side .foot .out { justify-content: center; font-size: .82rem; color: rgba(246, 245, 240, .8);
                      border: 1px solid rgba(255, 255, 255, .12); }
nav.side .foot .out:hover { background: rgba(255, 255, 255, .08); }

main { flex: 1; min-width: 0; padding: 24px 30px 64px; animation: fadein .25s var(--ease); }

header.top {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px;
}
header.top h1 { margin: 0; flex: 1; min-width: 180px; }

@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }

/* ------------------------------------------------------------------ pieces */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; margin-bottom: 16px;
}
.card > h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
/* a wide list beside a narrow summary */
.split { grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); align-items: start; }
@media (max-width: 1050px) { .split { grid-template-columns: minmax(0, 1fr); } }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.spacer { flex: 1; }
.nowrap { white-space: nowrap; }

.kpi { position: relative; background: var(--panel); border: 1px solid var(--line);
       border-radius: var(--radius); padding: 14px 16px 13px; box-shadow: var(--shadow); overflow: hidden; }
.kpi::after { content: ""; position: absolute; inset: 0 0 auto; height: 3px;
              background: linear-gradient(90deg, var(--brand), #0b0b0c); opacity: .8; }
.kpi .lab { font-size: .72rem; text-transform: uppercase; letter-spacing: .6px; color: var(--muted);
            font-weight: 600; }
.kpi .val { font-size: 1.55rem; font-weight: 700; margin-top: 4px; letter-spacing: -.02em;
            font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.kpi.good { background: linear-gradient(180deg, #f3fbf6, var(--panel) 70%); }
.kpi.good::after { background: linear-gradient(90deg, var(--ok), #6fd3a0); }
.kpi.good .val { color: var(--ok); }
.kpi.bad  .val { color: var(--warn); }
.kpi.bad::after { background: var(--warn); }
/* the real gain on the dashboard: gain on sales, each fixed cost taken off, what is left */
.rgain { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
         border-inline-start: 4px solid var(--ok); background: var(--bg-2); padding: 12px 14px; max-width: 560px; }
.rgain.neg { border-inline-start-color: var(--warn); }
.rgain .lab { font-size: .72rem; text-transform: uppercase; letter-spacing: .6px; color: var(--muted);
              font-weight: 600; margin-bottom: 6px; }
.rg-line { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0;
           font-variant-numeric: tabular-nums; }
.rg-line.minus b { color: var(--muted); font-weight: 600; }
.rg-line.total { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 7px; font-size: 1.15rem; }
.rg-line.total b { color: var(--ok); font-weight: 700; }
.rgain.neg .rg-line.total b { color: var(--warn); }
.kpi.link { cursor: pointer; transition: transform .15s var(--ease), box-shadow .15s var(--ease); }
.kpi.link:hover { transform: translateY(-2px); box-shadow: 0 10px 26px -10px rgba(11, 11, 12, .25); }

.bar { height: 10px; background: var(--line-2); border-radius: 6px; overflow: hidden; margin-top: 8px; }
.bar > i { display: block; height: 100%; border-radius: 6px;
           background: linear-gradient(90deg, var(--brand), #f0686b); transition: width .5s var(--ease); }
.bar.done > i { background: linear-gradient(90deg, var(--ok), #6fd3a0); }

/* ------------------------------------------------------------------ inputs */
label.f { display: flex; flex-direction: column; gap: 5px; font-size: .78rem; font-weight: 550;
          color: var(--muted); min-width: 130px; flex: 1 1 150px; }
input, select, textarea {
  font: inherit; color: var(--ink); background: #fff;
  border: 1px solid #dad7d0; border-radius: var(--radius-sm); padding: 8px 11px; width: 100%;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
input:hover, select:hover, textarea:hover { border-color: #bcb8b0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
input[readonly] { background: var(--bg-2); color: var(--muted); }
input[type="checkbox"] { accent-color: var(--brand); }
textarea { min-height: 60px; resize: vertical; }

button, .btn {
  font: inherit; font-weight: 550; cursor: pointer; border-radius: var(--radius-sm); padding: 8px 15px;
  border: 1px solid #dad7d0; background: #fff; color: var(--ink); box-shadow: var(--shadow-sm);
  transition: background .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease),
              transform .08s var(--ease);
}
button:hover { border-color: #b6b2aa; background: var(--bg-2); }
button:active { transform: translateY(1px); }
button:focus-visible { outline: none; box-shadow: var(--ring); }
button.primary { background: linear-gradient(180deg, #ea3a3f, var(--brand)); border-color: var(--brand-600);
                 color: #fff; font-weight: 600; box-shadow: 0 1px 2px rgba(140, 18, 22, .3),
                 inset 0 1px 0 rgba(255, 255, 255, .12); }
button.primary:hover { background: linear-gradient(180deg, var(--brand), var(--brand-600)); }
button.danger { background: #fff; border-color: #f0c9a6; color: var(--warn); }
button.danger:hover { background: var(--warn-soft); }
button.ghost { background: transparent; border-color: transparent; color: var(--muted); box-shadow: none; }
button.small { padding: 4px 10px; font-size: .8rem; border-radius: 8px; }
button:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; padding: 3px;
        background: var(--line-2); border-radius: 11px; width: fit-content; max-width: 100%; }
.tabs button { border: 0; background: transparent; box-shadow: none; padding: 6px 13px;
               color: var(--ink-2); border-radius: 8px; }
.tabs button:hover { background: rgba(255, 255, 255, .6); }
.tabs button.on { background: #fff; color: var(--brand-dark); font-weight: 650;
                  box-shadow: 0 1px 3px rgba(11, 11, 12, .12); }

/* ------------------------------------------------------------------ tables */
.tw { overflow-x: auto; border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: 9px 11px; text-align: start; border-bottom: 1px solid var(--line-2); }
th { font-size: .7rem; text-transform: uppercase; letter-spacing: .55px;
     color: var(--muted); font-weight: 650; white-space: nowrap; background: var(--bg-2);
     border-bottom: 1px solid var(--line); }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #f8f7f3; }
tbody tr:last-child td { border-bottom: 0; }
td.n, th.n { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
[dir="rtl"] td.n, [dir="rtl"] th.n { text-align: start; }
tr.dim td { color: var(--muted); }

.tag { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: .72rem;
       font-weight: 650; white-space: nowrap; letter-spacing: .1px; }
.tag.ok   { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.gray { background: #eeede8; color: #5f5d58; }
.tag.gold { background: var(--gold-soft); color: var(--gold); }

.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.hint { font-size: .82rem; color: var(--muted); margin: 4px 0 0; }
.note { background: var(--chalk); border: 1px solid var(--line); border-inline-start: 3px solid var(--brand);
        padding: 10px 13px; border-radius: 10px; font-size: .86rem; margin: 10px 0; }
.alert { background: var(--warn-soft); border: 1px solid #f5dbb0; border-inline-start: 3px solid var(--warn);
         padding: 10px 13px; border-radius: 10px; font-size: .86rem; margin: 10px 0; color: #78350f; }
.amt-up { color: var(--ok); }
.amt-down { color: var(--warn); }

/* ------------------------------------------------------------------ POS */
.pos { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; align-items: start; }
.pos > .cartcard { position: sticky; top: 18px; }

/* Stacked on a narrow window the cart falls below the product list, which put the
   "Post the sale" button two scrolls off-screen. The cart goes first there, and the
   totals stay pinned to the bottom of the screen so the sale can always be closed. */
@media (max-width: 900px) {
  .pos { grid-template-columns: 1fr; }
  .pos > .cartcard { position: static; order: -1; margin-bottom: 0; }
  .pos .checkout { position: sticky; bottom: 0; background: var(--panel);
                   border-top: 2px solid var(--ink); padding-top: 8px;
                   margin: 0 -20px -18px; padding: 10px 20px 14px;
                   box-shadow: 0 -6px 18px rgba(11, 11, 12, .10); }
  .plist { max-height: 44vh; }
}

.plist { max-height: 62vh; overflow-y: auto; }
.pitem { display: flex; align-items: center; gap: 10px; padding: 10px 10px;
         border-bottom: 1px solid var(--line-2); cursor: pointer; border-radius: 8px;
         transition: background .12s; }
.pitem:hover { background: var(--brand-soft); }
.pitem .nm { flex: 1; min-width: 0; }
.pitem .nm b { display: block; font-weight: 600; }
.pitem .nm span { font-size: .76rem; color: var(--muted); }
.pitem .pr { text-align: end; font-variant-numeric: tabular-nums; }
.pitem .pr b { display: block; color: var(--brand-dark); }
.pitem .pr span { font-size: .74rem; color: var(--muted); }
.pitem.off { opacity: .45; cursor: not-allowed; }

.cart td { padding: 6px 6px; }
.cart input { padding: 5px 7px; }
.cart input.qty { width: 62px; }
.cart input.prc { width: 92px; }
.cart input.under { border-color: var(--warn); background: var(--warn-soft); color: #78350f; font-weight: 600; }

.totals { border-top: 2px solid var(--ink); margin-top: 10px; padding-top: 10px; }
.totals div { display: flex; justify-content: space-between; padding: 3px 0; }
.totals .big { font-size: 1.4rem; font-weight: 750; border-top: 1px solid var(--line);
               margin-top: 6px; padding-top: 8px; letter-spacing: -.02em; }

/* ------------------------------------------------------------------ modal */
.mask { position: fixed; inset: 0; background: rgba(11, 11, 12, .48);
        -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
        display: flex; align-items: flex-start; justify-content: center;
        padding: 5vh 14px; z-index: 60; overflow-y: auto; animation: fadein .18s var(--ease); }
.modal { background: var(--panel); border-radius: 18px; box-shadow: var(--shadow-lg);
         border: 1px solid rgba(255, 255, 255, .6);
         width: min(760px, 100%); padding: 22px 24px; animation: pop .22s var(--ease); }
.modal h2 { margin: -2px 0 16px; font-size: 1.15rem; padding-bottom: 12px; border-bottom: 1px solid var(--line-2); }
.modal .foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px;
               padding-top: 14px; border-top: 1px solid var(--line-2); }
.modal .row + .row { margin-top: 10px; }

/* ------------------------------------------------------------------ login */
.login { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px;
         background:
           radial-gradient(60% 50% at 15% 10%, rgba(227, 38, 43, .30), transparent 70%),
           radial-gradient(50% 45% at 90% 95%, rgba(227, 38, 43, .14), transparent 70%),
           linear-gradient(160deg, #262424, var(--brand-deep) 60%, #000); }
.login .box { background: rgba(255, 255, 255, .97); border-radius: 22px; padding: 34px 32px 26px;
              width: min(390px, 100%); box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, .5);
              animation: pop .35s var(--ease); }
.login-logo { display: block; width: 92px; height: 92px; margin: 0 auto 12px; object-fit: contain;
              border-radius: 50%; padding: 6px; background: #fff;
              box-shadow: 0 0 0 6px rgba(227, 38, 43, .22), 0 10px 24px -8px rgba(0, 0, 0, .55); }
.login h1 { text-align: center; color: var(--brand-dark); margin-bottom: 2px; }
.login .sub { text-align: center; color: var(--muted); font-size: .85rem; margin-bottom: 22px; }
.login label.f { min-width: 100%; margin-bottom: 14px; font-size: .8rem; }
.login input { padding: 11px 13px; font-size: 1rem; }
.login button { width: 100%; }
.login button.primary { padding: 11px; font-size: 1rem; margin-top: 4px; }
.langpick { display: flex; gap: 6px; justify-content: center; margin-top: 18px; }
.langpick button { flex: 1; font-size: .82rem; padding: 6px; }
.login .langpick { gap: 4px; padding: 3px; background: var(--line-2); border-radius: 11px; }
.login .langpick button { border: 0; background: transparent; box-shadow: none; color: var(--ink-2); border-radius: 8px; }
.login .langpick button:hover { background: #fff; }

/* -------------------------------------------------------------- mini chart */
.spark { display: flex; align-items: flex-end; gap: 3px; height: 90px; margin-top: 10px; }
.spark div { flex: 1 1 0; max-width: 46px; background: linear-gradient(180deg, #f0585c, var(--brand));
             border-radius: 4px 4px 0 0; min-height: 2px; position: relative; transition: background .15s; }
.spark div:hover { background: var(--ink); }

/* ------------------------------------------------------------------ toast */
#toast { position: fixed; inset-inline-end: 18px; bottom: 18px; z-index: 90;
         display: flex; flex-direction: column; gap: 8px; }
#toast .t { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px;
            box-shadow: 0 12px 30px -8px rgba(0, 0, 0, .4); font-size: .88rem; max-width: 360px;
            animation: pop .22s var(--ease); }
#toast .t.err { background: var(--warn); }
#toast .t.ok { background: var(--ok); }

/* ------------------------------------------------------------- worker pay */
.payhero { display: grid; grid-template-columns: minmax(230px, 1fr) minmax(0, 1.6fr); gap: 0;
           padding: 0; overflow: hidden; }
.payhero-due { padding: 22px 24px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start;
               background: linear-gradient(160deg, var(--bg-2), #fff); border-inline-end: 1px solid var(--line); }
.payhero-due.owed { background: linear-gradient(160deg, #e3262b, #a8161b); color: #fff; }
.payhero-due .lab { font-size: .74rem; text-transform: uppercase; letter-spacing: .6px; font-weight: 650; opacity: .75; }
.payhero-due .big { font-size: 2.1rem; font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.payhero-due .sub { font-size: .82rem; opacity: .8; margin-bottom: 12px; max-width: 34ch; }
.payhero-due.owed button.primary { background: #fff; color: var(--brand-dark); border-color: #fff; }
.payhero-cur { padding: 20px 24px; }
.paypair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0 8px; }
.paypair .lab { font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; }
.paypair .val { font-size: 1.45rem; font-weight: 700; color: var(--ok); font-variant-numeric: tabular-nums; }
.paypair .val.soft { color: var(--ink-2); }
.formula { font-size: .86rem; color: var(--ink-2); background: var(--bg-2); border: 1px dashed var(--line);
           border-radius: 10px; padding: 8px 12px; font-variant-numeric: tabular-nums; }
tr.current td { background: #fdf4f3; }
@media (max-width: 760px) {
  .payhero { grid-template-columns: 1fr; }
  .payhero-due { border-inline-end: 0; border-bottom: 1px solid var(--line); }
}

/* ------------------------------------------------------------------ zakat */
.zktable td { padding: 8px 6px; vertical-align: top; }
.zktable tbody tr:hover { background: transparent; }
.zktable tr.sec td { padding: 16px 6px 4px; font-size: .72rem; text-transform: uppercase; letter-spacing: .6px;
                     color: var(--brand); font-weight: 700; border-bottom: 0; }
.zktable tr.sum td { border-bottom: 1px solid var(--line); }
.zktable tr.off td, .zktable tr.off td b { color: var(--muted); font-weight: 500; }
.zktable tr.grand td { font-size: 1.08rem; font-weight: 750; background: var(--bg-2);
                       border-top: 2px solid var(--line); }
.zktable tr.zk td { font-size: 1.2rem; color: var(--ok); background: var(--ok-soft); }
.zktable tr.zk td b { font-weight: 750; }
.zktable label.f { margin: 0; }
.zktable details summary { cursor: pointer; color: var(--brand); }
.payhero-due.owed .sub { opacity: .9; }

/* ------------------------------------------------------ shipments in an import */
.shipcard { border: 1px solid var(--line); border-inline-start: 3px solid var(--muted);
            border-radius: 8px; padding: 9px 12px; margin-bottom: 8px; background: #fbfcfd; }
.shipcard.arrived  { border-inline-start-color: var(--gold); background: #fffdf6; }
.shipcard.received { border-inline-start-color: var(--ok);   background: var(--ok-soft); }
.shipcard.pending  { border-inline-start-color: var(--muted); }
/* a line whose freight is not known yet must never look like a finished cost */
tr.provisional td { background: #fffaf3; }
tr.provisional td:nth-child(1) { box-shadow: inset 3px 0 0 var(--gold); }

/* ------------------------------------------------- the printed document */
.receipt { display: none; }

.doc { color: #000; background: #fff; }
.doc-a4 { width: 100%; max-width: 180mm; font-size: 12pt; }
.doc-slip { width: 100%; max-width: 80mm; font-size: 10pt; }

.doc-head { display: flex; justify-content: space-between; gap: 16px;
            border-bottom: 2px solid #000; padding-bottom: 8px; margin-bottom: 12px; }
.doc-slip .doc-head { display: block; text-align: center; }
.doc-logo { width: 22mm; height: 22mm; object-fit: contain; display: block;
            margin-bottom: 4px; }
.doc-slip .doc-logo { width: 18mm; height: 18mm; margin: 0 auto 4px; }
.doc-name { font-size: 1.5em; font-weight: 700; letter-spacing: .3px; }
.doc-meta { font-size: .82em; color: #333; }
.doc-id { text-align: end; }
.doc-slip .doc-id { text-align: center; margin-top: 6px; }
.doc-title { font-size: 1.35em; font-weight: 700; letter-spacing: 2px; }
.doc-void { border: 2px solid var(--warn); color: var(--warn); font-weight: 700;
            text-align: center; padding: 4px; letter-spacing: 3px; margin-bottom: 10px; }
.doc-billto { border: 1px solid #999; border-radius: 4px; padding: 8px 10px; margin-bottom: 12px; }
.doc-lab { font-size: .72em; text-transform: uppercase; letter-spacing: 1px; color: #555; }
.doc-client { font-size: 1.1em; font-weight: 600; }

.doc-lines { width: 100%; border-collapse: collapse; margin-top: 10px; }
.doc-lines th { background: #eee; border-bottom: 1.5px solid #000; font-size: .78em;
                text-transform: uppercase; letter-spacing: .5px; padding: 6px 8px;
                text-align: start; color: #000; }
.doc-lines td { border-bottom: 1px solid #ccc; padding: 6px 8px; vertical-align: top; }
.doc-lines .n { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
[dir="rtl"] .doc-lines .n { text-align: start; }
.doc-sku { display: block; font-size: .74em; color: #666; }

.doc-totals { margin-top: 10px; margin-inline-start: auto; width: min(280px, 100%); }
.doc-totals > div { display: flex; justify-content: space-between; padding: 3px 0; }
.doc-grand { border-top: 2px solid #000; margin-top: 5px; padding-top: 7px !important;
             font-size: 1.2em; font-weight: 700; }

.doc-foot { display: flex; justify-content: space-between; gap: 20px;
            margin-top: 26px; align-items: flex-end; }
.doc-note { font-size: .84em; color: #333; }
.doc-slip .doc-note { text-align: center; margin-top: 14px; }
.doc-sign { min-width: 170px; }
.doc-signbox { border-bottom: 1px solid #000; height: 46px; }

/* on-screen preview of the same document */
.doc-preview { border: 1px solid var(--line); border-radius: 8px; padding: 16px;
               background: #fff; overflow-x: auto; }


/* ------------------------------------- branded header for a printed page (Reports) */
.print-head { display: none; }
.phead-logo { width: 18mm; height: 18mm; object-fit: contain; }
.phead-txt { flex: 1; }
.phead-name { font-size: 1.3em; font-weight: 700; }
.phead-meta { font-size: .78em; color: #333; }
.phead-right { text-align: end; }
[dir="rtl"] .phead-right { text-align: start; }
.phead-title { font-size: 1.1em; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }

/* --------------------------------------------------------- printable coupon voucher */
.doc-voucher { max-width: 105mm; text-align: center; border: 2px dashed #000;
               border-radius: 8px; padding: 14px 16px; }
.doc-voucher .doc-logo { width: 20mm; height: 20mm; margin: 0 auto 6px; }
.vh-shop { font-size: 1.25em; font-weight: 700; }
.vh-meta { font-size: .8em; color: #333; }
.vh-title { margin-top: 10px; font-size: .9em; font-weight: 700; letter-spacing: 3px; }
.vh-amount { font-size: 2.4em; font-weight: 800; line-height: 1.1; margin: 4px 0 8px; }
.vh-amount span { font-size: .38em; font-weight: 600; letter-spacing: 1px; }
.vh-code { font-family: "Consolas", "Courier New", monospace; font-size: 1.7em;
           font-weight: 700; letter-spacing: 4px; border: 1.5px solid #000;
           border-radius: 6px; padding: 6px 10px; margin: 8px 0; }
.vh-terms { font-size: .72em; color: #444; margin-top: 10px; }

@page { size: A4; margin: 14mm; }

@media print {
  nav.side, header.top, .noprint, #toast, .mask { display: none !important; }
  /* Chrome drops background images when "background graphics" is off; the logo is a
     real <img>, and this keeps its colours from being stripped as well. */
  .doc-logo { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #fff; margin: 0; }
  main { padding: 0; }
  .card { box-shadow: none; border: 0; }

  /* Printing a report prints the page. Printing an invoice prints only the
     document, so the body carries a flag to say which of the two is happening. */
  body.print-doc main { display: none !important; }
  body.print-doc .receipt { display: block !important; }
  /* the page-print header appears only when a page, not a document, is being printed */
  body:not(.print-doc) .print-head {
    display: flex; align-items: center; gap: 12px;
    border-bottom: 2px solid #000; padding-bottom: 8px; margin-bottom: 12px;
  }
  .phead-logo { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .doc-a4, .doc-slip { max-width: 100%; }
  .doc-lines tr, .doc-foot { break-inside: avoid; }
}

@media (max-width: 720px) {
  #app { flex-direction: column; }
  nav.side { width: 100%; height: auto; flex: none; flex-direction: row; overflow-x: auto;
             padding: 8px; gap: 4px; z-index: 30; box-shadow: 0 4px 16px rgba(11, 11, 12, .25); }
  nav.side .brand div { display: none; }
  /* The foot (languages + sign out) used to be hidden here, which left a phone with no way
     to sign out or change language (he hit it 3 Dec 2026). It now ends the menu row. */
  nav.side .foot { display: flex; align-items: center; gap: 6px; flex: none;
                   margin: 0; padding: 0; padding-inline-start: 8px; border-top: 0;
                   border-inline-start: 1px solid rgba(255, 255, 255, .14); }
  nav.side .foot .who { display: none; }
  nav.side .foot .langpick { margin: 0; flex: none; }
  nav.side .foot .langpick button { flex: none; padding: 5px 8px; }
  nav.side .foot .out { white-space: nowrap; padding: 7px 12px; }
  nav.side .brand { padding: 0 6px 0 2px; margin: 0; border: 0; }
  nav.side .brand-logo { width: 34px; height: 34px; flex-basis: 34px; }
  nav.side button { width: auto; white-space: nowrap; }
  nav.side button.on::before { display: none; }
  main { padding: 14px; }
  .card { padding: 14px; }
}

/* ------------------------------------- fixed-cost coverage banner on the dashboard */
.card.cov { border-inline-start: 4px solid var(--gold); }
.card.cov.covered { border-inline-start-color: var(--ok); }
.card.cov.behind  { border-inline-start-color: var(--warn); }
.card.cov .bar { position: relative; overflow: visible; }
.card.cov .bar > i { position: relative; z-index: 1; }
/* marker showing how far through the trading year you are */
.card.cov .bar > u { position: absolute; top: -4px; width: 2px; height: 22px;
                     background: var(--ink); opacity: .5; z-index: 2; }

/* quantity-break hint on a cart line */
.bulkhint { display: inline-block; margin-top: 3px; padding: 2px 7px; border-radius: 6px;
            background: #fbf3de; color: var(--gold); }
.bulkhint b { color: var(--ink); }
.bulkhint i { font-style: normal; opacity: .8; }
.bulkhint button { margin-inline-start: 6px; padding: 1px 7px; font-size: .78rem; }
/* a basket that has not earned a discount yet: informative, not alarming */
.bulkhint.none { background: #efeee9; color: var(--muted); }
.bulkhint.none b { color: var(--ink); }

/* ------------------------------------------------------------ dashboard figures */
.figtabs button { padding: 6px 12px; font-size: .85rem; }
#figcard .kpi { box-shadow: none; }

/* -------------------------------------------------------- shipment timeline row */
.shipdates { margin: 4px 0 2px; color: var(--ink); }
.shipdates b { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------- store header on the till */
.storeband { display: flex; align-items: center; gap: 12px; background: var(--panel);
             border: 1px solid var(--line); border-radius: var(--radius);
             padding: 8px 14px; margin-bottom: 14px; box-shadow: var(--shadow); }
.storeband img { width: 46px; height: 46px; object-fit: contain; }
.storeband b { display: block; font-size: 1.1rem; }
.storeband span { color: var(--muted); font-size: .88rem; }
.netunit { color: var(--ok); font-weight: 600; }

/* ---------------------------------------------------------------- ranking bars */
.rkbar { display: grid; grid-template-columns: minmax(130px, 1.3fr) 3fr auto;
         gap: 10px; align-items: center; padding: 4px 0; }
.rktrack { background: var(--line); border-radius: 6px; height: 12px; overflow: hidden; }
.rktrack .b { height: 12px; background: var(--brand); border-radius: 6px; }
.rktrack .b.gain { background: var(--ok); }

/* --------------------------------------------------- import a seller's file */
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center;
            justify-content: center; gap: 6px; text-align: center; padding: 44px 18px;
            border: 2px dashed var(--line); border-radius: var(--radius); background: var(--panel);
            cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-soft); }
.dropzone:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.dropzone.busy { opacity: .7; pointer-events: none; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone b { font-size: 1.05rem; }
.dropzone span { color: var(--muted); font-size: .88rem; max-width: 54ch; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: .9rem; cursor: pointer; }
.check input { width: auto; margin: 0; }
.sheetcard.off { opacity: .55; }
.mapchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 12px; }
.mapchip { font-size: .8rem; padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px;
           background: var(--panel); white-space: nowrap; }
.mapchip b { font-weight: 600; }
.mapfix { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px;
          margin: 0 0 12px; padding: 10px; border: 1px dashed var(--line); border-radius: var(--radius); }
table .cell { padding: 4px 6px; font-size: .86rem; }
table input.cell { width: 100%; min-width: 70px; }
table input.cell.wide { min-width: 190px; }
table input.cell.short { min-width: 70px; max-width: 110px; }
table input.cell.num { width: 88px; min-width: 70px; text-align: end; }
table select.cell { min-width: 150px; max-width: 220px; }
.imptable td { vertical-align: top; }
.warnline { color: var(--warn); }
.impbar { position: sticky; bottom: 10px; z-index: 5; display: flex; flex-wrap: wrap;
          align-items: center; gap: 10px; box-shadow: var(--shadow); }

/* ------------------------------------------------------- ask sellers for a quote */
.dropzone.slim { padding: 16px 18px; }
.rfqtable td { vertical-align: top; }
.rfqshot { display: block; width: 64px; height: 64px; object-fit: cover; background: #fff;
           border: 1px solid var(--line); border-radius: 8px; cursor: zoom-in; }
.rfqvar { min-width: 250px; }
.vchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.vchips:empty { display: none; }
.vchip { display: inline-flex; align-items: center; gap: 2px; padding: 1px 3px 1px 10px;
         font-size: .82rem; color: var(--brand-dark); background: var(--brand-soft);
         border: 1px solid var(--brand); border-radius: 999px; }
.vchip button { border: 0; background: transparent; color: inherit; padding: 0 6px;
                font-size: 1rem; line-height: 1.2; }
.vsug { padding: 1px 8px; font-size: .78rem; color: var(--brand-dark); border-radius: 999px; }
.rfqtext { margin: 0; padding: 10px; max-height: 220px; overflow: auto; white-space: pre-wrap;
           font-size: .82rem; background: var(--bg); border: 1px solid var(--line);
           border-radius: 8px; }

/* ------------------------------------------------------------ compare sellers */
.cmpgroups { display: flex; flex-direction: column; gap: 14px; }
.cmpgroup h3 { margin: 0; font-size: 1.02rem; }
.cmpgroup tr.best td { background: var(--ok-soft); }
.cmpgroup .spec { display: block; color: var(--muted); font-size: .76rem; max-width: 48ch; margin-top: 2px; }
.cmpgroup .pct { color: var(--warn); font-variant-numeric: tabular-nums; font-size: .88rem; }
/* comparison by type: each seller's lowest price, the shop's own lines, the summary rows */
.schips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 6px; }
.schip { display: inline-flex; gap: 5px; align-items: baseline; padding: 3px 10px; border-radius: 999px;
         border: 1px solid var(--line); background: var(--bg-2); font-size: .84rem;
         font-variant-numeric: tabular-nums; }
.schip.best { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.tag.mine { background: var(--brand-soft); color: var(--brand-600); }
.cmpgroup tr.mine td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
[dir="rtl"] .cmpgroup tr.mine td:first-child { box-shadow: inset -3px 0 0 var(--brand); }
/* the same product by its photos (2 Dec 2026): the group's photos, one per seller, and
   each line's own; a letter marks the lines of one product inside a type */
.cmppics { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 4px; }
.cmppic { margin: 0; text-align: center; font-size: .72rem; color: var(--muted); max-width: 96px; }
.cmppic img { width: 88px; height: 88px; margin: 0 auto 3px; }
.cmpgroup td.pic { width: 52px; padding-inline-end: 0; }
.cmpgroup img.impthumb { cursor: zoom-in; }
.cmpgroup tr.vhead td { background: var(--bg-2); font-size: .82rem; padding-top: 6px; padding-bottom: 6px; }
.mletter { display: inline-block; min-width: 20px; padding: 0 5px; border-radius: 6px; text-align: center;
           background: var(--gold-soft); color: var(--gold); font-weight: 700; font-size: .76rem; }
/* the owner's "add a product to this group" list */
.cmpaddlist { max-height: 55vh; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.cmpaddrow { display: flex; align-items: center; gap: 10px; text-align: start; width: 100%;
             background: var(--bg-2); border: 1px solid var(--line); padding: 6px 8px; }
.cmpaddrow:hover { border-color: var(--brand); }
.cmpaddrow .impthumb { flex: 0 0 44px; }
.cmpsum tr.link { cursor: pointer; }
.cmpsum tr.link:hover td { background: var(--bg-2); }

/* row actions sit on one or two lines instead of a tall stack */
td.acts { min-width: 250px; }
td.acts > button { margin: 2px 0; white-space: nowrap; }
table.dense th, table.dense td { padding: 8px 7px; }

/* ---- agent tracking: the agent's lists against the orders */
.agkpis { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.agkpis .kpi .val small { font-size: .85rem; color: var(--muted); font-weight: 500; }
.agtable td { vertical-align: middle; }
.agthumb { width: 64px; height: 64px; object-fit: contain; border-radius: 8px; background: #f5f4f0;
  cursor: zoom-in; display: block; }
.agbig { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto; }
.agcont td { background: #faf9f6; }
.agcont td:first-child { border-inline-start: 3px solid var(--line); }
.agok { font-size: .86rem; line-height: 1.45; margin-bottom: 4px; }
.agcands { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.agren { margin-inline-start: 6px; padding: 0 6px; opacity: .55; }
.agren:hover { opacity: 1; }
tr.agmiss td:first-child { border-inline-start: 3px solid var(--warn); }
.agmaybe { color: var(--gold); font-size: .8rem; margin-top: 2px; }
.agpicker h3 { margin: 14px 0 6px; font-size: .95rem; }
.agpicker h3:first-child { margin-top: 0; }
.aggroup { padding: 6px 0 8px; border-bottom: 1px solid var(--line); }
.aggroup .agpl { padding-inline-start: 14px; margin-top: 3px; }
.agbatch h2 { flex-wrap: wrap; }
.agdrops { margin-bottom: 16px; align-items: stretch; }
.agdrops .card { margin: 0; }
.agstep { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  color: var(--brand); margin-bottom: 8px; }
.agmini { width: 26px; height: 26px; object-fit: contain; border-radius: 5px; background: #f5f4f0;
  vertical-align: middle; margin-inline-end: 4px; }
.agcand { display: inline-flex; align-items: center; gap: 2px; }
.impthumb { width: 44px; height: 44px; object-fit: contain; border-radius: 6px; background: #f5f4f0;
  display: block; margin-bottom: 3px; cursor: zoom-in; }

.shipshared { color: var(--brand-dark); background: var(--brand-soft); border-radius: 8px;
              padding: 4px 8px; margin: 6px 0 2px; }

/* -------------------------------------------------------------------- CRM */
.modal.wide { width: min(900px, 100%); }
.crmsegs button b { font-weight: 700; margin-inline-start: 4px; opacity: .7; }
.barlist { display: flex; flex-direction: column; gap: 7px; }
.bl-row { display: grid; grid-template-columns: minmax(70px, 34%) 1fr auto; gap: 10px; align-items: center;
          font-size: .84rem; padding: 2px 0; border-radius: 6px; }
.bl-row:hover { background: var(--bg-2); }
.bl-lab { color: var(--ink-2); line-height: 1.25; overflow-wrap: anywhere; }
.bl-track { height: 10px; background: var(--line-2); border-radius: 5px; overflow: hidden; }
.bl-track > i { display: block; height: 100%; background: var(--brand);
                border-start-end-radius: 4px; border-end-end-radius: 4px; }
.bl-val { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.persona .grid > div { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; }
.persona .lab { font-size: .7rem; text-transform: uppercase; letter-spacing: .55px; color: var(--muted); font-weight: 650;
                margin-bottom: 3px; }
ul.insights { margin: 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 7px; font-size: .9rem; }

/* delivery block on the till: the fee comes off what the client paid */
.dlvbox { margin-top: 10px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 10px; }
.dlvbox.on { border-style: solid; border-color: var(--warn); background: color-mix(in srgb, var(--warn) 7%, transparent); }
.dlvhead { display: flex; align-items: center; gap: 8px; cursor: pointer; margin: 0; }
.dlvhead input { width: auto; margin: 0; }
.dlvpay { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 8px; }
.dlvpay label { display: inline-flex; align-items: center; gap: 6px; margin: 0; cursor: pointer; font-weight: 600; }
.dlvpay input { width: auto; margin: 0; }
/* split delivery: the total is worked out from the two parts, not typed */
.dlvtotal { display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; }
.dlvtotal b { font-size: 1.05rem; padding: 8px 0; }

/* ------------------------------------------------------------- Claude (23 Nov 2026) */
.ai-model select { width: auto; margin-inline-start: 6px; padding: 5px 8px; }
.ai-ok { color: var(--ok); margin: 0 0 10px; }
.ai-chat { display: flex; flex-direction: column; gap: 12px; padding: 14px; }
.ai-log { display: flex; flex-direction: column; gap: 12px; min-height: 260px;
  max-height: calc(100vh - 290px); overflow-y: auto; padding: 2px 4px 2px 2px; }
.ai-hello { color: var(--ink-2); max-width: 760px; }
.ai-hello p { margin: 4px 0 12px; line-height: 1.5; }
.ai-ex { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-ex button { text-align: start; white-space: normal; }
.ai-msg { max-width: min(820px, 92%); padding: 10px 14px; border-radius: var(--radius); line-height: 1.5;
  overflow-wrap: anywhere; }
.ai-msg.me { align-self: flex-end; background: var(--brand-soft); border: 1px solid #f3cfd0; }
.ai-msg.ai { align-self: flex-start; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.ai-msg.err { align-self: flex-start; background: var(--warn-soft); border: 1px solid #f5dbb0; color: var(--warn); }
.ai-msg.wait { color: var(--muted); display: flex; align-items: center; gap: 10px; }
.ai-who { font-size: .72rem; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.ai-md p { margin: 0 0 8px; }
.ai-md p:last-child { margin-bottom: 0; }
.ai-md ul, .ai-md ol { margin: 4px 0 8px; padding-inline-start: 22px; }
.ai-md li { margin: 2px 0; }
.ai-md h4 { margin: 10px 0 4px; font-size: .95rem; }
.ai-md code { background: var(--bg-2); border: 1px solid var(--line); border-radius: 5px; padding: 0 4px; font-size: .85em; }
.ai-tw { overflow-x: auto; margin: 6px 0 10px; }
.ai-t { font-size: .84rem; }
.ai-t th, .ai-t td { padding: 5px 8px; }
.ai-card { margin-top: 10px; border: 1px solid var(--line); border-inline-start: 3px solid var(--warn);
  border-radius: var(--radius-sm); padding: 10px 12px; background: var(--bg-2); }
.ai-card.done { border-inline-start-color: var(--ok); }
.ai-card.cancelled { border-inline-start-color: var(--line); opacity: .75; }
.ai-card-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.ai-rows { display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; margin: 6px 0 0; font-size: .88rem; }
.ai-rows dt { color: var(--muted); }
.ai-rows dd { margin: 0; font-weight: 600; }
.ai-card .alert { margin: 8px 0 0; }
.ai-card-b { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.ai-form { display: flex; gap: 8px; align-items: flex-end; border-top: 1px solid var(--line); padding-top: 12px; }
.ai-form textarea { flex: 1; resize: vertical; min-height: 48px; max-height: 200px; margin: 0; }
.ai-form button { flex: 0 0 auto; }
.ai-dots { display: inline-flex; gap: 4px; }
.ai-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); opacity: .3;
  animation: aidot 1.2s infinite var(--ease); }
.ai-dots i:nth-child(2) { animation-delay: .2s; }
.ai-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes aidot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (max-width: 760px) {
  .ai-log { max-height: none; min-height: 200px; }
  .ai-msg { max-width: 100%; }
  .ai-form { position: sticky; bottom: 0; background: var(--panel); padding-bottom: 6px; }
}

/* ---- delivery options (3 Dec 2026): how the goods leave, the shop's offer, the receipt */
.dlvmodes { margin-top: 6px; gap: 6px; }
.dlvmodes .dlvmode { position: relative; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); font-weight: 600; }
.dlvmodes .dlvmode input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.dlvmodes .dlvmode:focus-within { outline: 2px solid var(--warn); outline-offset: 1px; }
.dlvmodes .dlvmode.on { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 13%, var(--panel)); }
.dlvoffer { margin-top: 8px; padding: 6px 9px; border-radius: 8px; background: #efeee9; color: var(--ink); }
.dlvoffer.free { background: var(--ok-soft); color: var(--ok); }
.kpi.todo::after { background: var(--gold); }
.kpi.todo .val { color: var(--gold); }
.doc-dlv { margin-top: 10px; padding-top: 6px; border-top: 1px dashed #999; font-size: .86em; line-height: 1.5; }
.doc-slip .doc-dlv { text-align: center; }

/* the invoice editor wraps the till totals in #etotals: keep that wrapper a plain block */
#etotals { display: block; padding: 0; }
