/* The Awiyid back office look: one palette with the mobile app (mobile Styles/Colors.xaml). The Awiyid teal is the
   brand (logo, sign-in band, menu, links, focus, route numbers); the violet stays on the action buttons and the status
   tags. The sand of the brand story (brand/STORY.md) is a small accent: the lozenge band and the sign-in scene. White blocks with a thin grey border on a light grey page, a white menu at the start with the active entry
   tinted, 8 px rounded buttons and fields, pill badges, IBM Plex Sans Arabic. */
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 400; font-display: swap; src: url("fonts/IBMPlexSansArabic-Regular.ttf") format("truetype"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 600; font-display: swap; src: url("fonts/IBMPlexSansArabic-SemiBold.ttf") format("truetype"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 700; font-display: swap; src: url("fonts/IBMPlexSansArabic-Bold.ttf") format("truetype"); }

:root {
  --brand: #0e7490;          /* Awiyid teal, white-on-X 5.4:1: logo, menu, links, focus */
  --brand-dark: #155e75;     /* hover / pressed */
  --brand-deep: #083344;     /* gradient end */
  --brand-light: #e3f4f8;    /* tint surfaces, the active menu entry */
  --primary: #6d28d9;        /* action buttons and status tags (kept violet), white-on-X 7.1:1 */
  --primary-dark: #5b21b6;   /* hover / pressed */
  --primary-light: #f1eafd;  /* tinted tags */
  --secondary: var(--brand);
  --secondary-light: var(--brand-light);
  --page: #f3f5f9;           /* the grey page the white blocks sit on */
  --card: #fff;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-soft: #f3f4f6;
  --sand: #e9b872;           /* the kasbah walls at sunset (brand/STORY.md): accents on the teal only */
  --clay: #c2703d;           /* the shade of the sand */
  /* The lozenge of Amazigh rugs, as a thin band (sign-in band, under the menu's logo). */
  --lozenges: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='8'%3E%3Cpath d='M8 1l3 3-3 3-3-3z' fill='none' stroke='%23e9b872' stroke-width='1.2'/%3E%3C/svg%3E");
  --ok: #15803d; --warn: #b45309; --bad: #dc2626;
  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
}
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { margin: 0; font: 14px/1.5 var(--font); background: var(--page); color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
h1 { font-size: 22px; line-height: 30px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 14px; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 10px; }

/* ---- buttons and fields ---- */
button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px;
  background: var(--primary); color: #fff; border: 1px solid transparent; border-radius: 8px; padding: 6px 14px;
  font-weight: 600; font-size: 13px; cursor: pointer; box-shadow: 0 1px 2px rgba(16, 24, 40, .06); transition: background .15s, border-color .15s; }
button:hover { background: var(--primary-dark); }
button:active { transform: scale(.99); }
button:focus-visible, a:focus-visible { outline: 2px solid rgb(14 116 144 / .45); outline-offset: 2px; }
button.secondary { background: #fff; color: #374151; border-color: var(--line); }
button.secondary:hover { border-color: var(--brand); color: var(--brand); background: #fff; }
button.danger { background: #fef2f2; color: var(--bad); border-color: #fecaca; box-shadow: none; }
button.danger:hover { background: #fee2e2; }
button.link, button.ghost { background: none; color: var(--brand); padding: 0 4px; min-height: 0; box-shadow: none; font-weight: 600; }
button.ghost { color: var(--muted); padding: 6px 10px; border-radius: 8px; }
button.ghost:hover { background: #fef2f2; color: var(--bad); }
button.link:hover { background: none; text-decoration: underline; }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { min-height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; background: #fff; font-size: 13px; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgb(14 116 144 / .15); }
input[type="checkbox"], input[type="radio"] { min-height: 0; accent-color: var(--brand); }
label { color: #374151; font-weight: 600; font-size: 13px; }
@media (pointer: coarse) { button, input:not([type="checkbox"]):not([type="radio"]), select { min-height: 44px; } }

/* ---- icon buttons: every action is an icon; its name shows in a tooltip on hover and keyboard focus ---- */
.ib { position: relative; width: 36px; min-width: 36px; padding: 0; text-decoration: none; }
.ib svg { width: 18px; height: 18px; flex-shrink: 0; }
a.ib { display: inline-flex; align-items: center; justify-content: center; height: 36px; border-radius: 8px; border: 1px solid transparent;
  background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .06); transition: background .15s, border-color .15s; }
a.ib:hover { background: var(--primary-dark); }
a.ib.secondary { background: #fff; color: #374151; border-color: var(--line); }
a.ib.secondary:hover { border-color: var(--brand); color: var(--brand); }
a.ib.danger { background: #fef2f2; color: var(--bad); border-color: #fecaca; }
.ib.wide { width: 100%; }
.ib .badge { position: absolute; top: -6px; inset-inline-end: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--secondary); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
[data-tip] { position: relative; }
[data-tip]::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 7px); left: 50%; transform: translate(-50%, 2px);
  background: var(--ink); color: #fff; font-size: 12px; font-weight: 500; line-height: 1.3; padding: 5px 8px; border-radius: 6px;
  white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s, transform .12s; z-index: 80; box-shadow: 0 4px 12px rgba(0,0,0,.18); }
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
[data-tip].tip-below::after { bottom: auto; top: calc(100% + 7px); }
[data-tip].tip-end::after { left: auto; right: 0; transform: none; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
td .actions { justify-content: flex-end; }
.chip { display: inline-flex; padding: 2px 8px; border-radius: 999px; background: var(--primary-light); color: var(--primary); font-size: 12px; font-weight: 600; margin: 0 0 4px; margin-inline-end: 4px; white-space: nowrap; }
details.multi { position: relative; margin-bottom: 8px; }
details.multi summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 30px 6px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 16px; font-size: 13px; }
details.multi summary::-webkit-details-marker { display: none; }
details.multi .multi-list { display: grid; gap: 4px; margin-top: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; max-height: 220px; overflow-y: auto; }
details.multi .multi-list label { font-weight: 500; display: flex; gap: 8px; align-items: center; }
table.links { margin-bottom: 8px; }
table.links th, table.links td { padding: 6px 8px; }
tr.done > td { color: var(--muted); }
tr.changed > td, tbody tr.changed:hover > td { background: var(--brand-light); } /* a price typed but not saved yet */
input.need { border-color: #f59e0b; background: #fffbeb; }
.pill.Draft { background: #fef3c7; color: #92400e; }
.pill.Validated { background: #dcfce7; color: #15803d; }

/* ---- shell ---- */
.layout { display: flex; min-height: 100vh; overflow-x: clip; } /* hidden tooltips at the page edge must not widen it */
.sidebar { position: sticky; top: 0; height: 100vh; width: 240px; flex-shrink: 0; display: flex; flex-direction: column;
  background: #fff; border-inline-end: 1px solid var(--line); z-index: 40; }
/* The menu head is the logo block itself: its teal gradient over the whole head, the mark (logo-mark.svg, written by
   brand/build_logos.py) and the name as live text, sized from the head's width so it fills the space left. */
.sidebar-head { height: 64px; display: flex; align-items: center; gap: 10px; padding: 0 16px; container-type: inline-size;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep)); color: #fff; }
.sidebar-head .mark { height: 34px; width: 52px; flex-shrink: 0; }
/* "awiyid" in Plex Bold is about 3 times its font size wide: the head's content width less the mark and the gap. */
.sidebar-head .wordmark { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; font-weight: 700; line-height: 1;
  letter-spacing: -.02em; font-size: calc((100cqi - 52px - 10px) / 3.05); }
.sidebar-head { position: relative; }
.sidebar-head::after { content: ""; position: absolute; inset-inline: 16px; bottom: -5px; height: 8px; background: var(--lozenges) repeat-x; opacity: .9; }
#nav { flex: 1; overflow-y: auto; padding: 8px 12px 12px; }
#nav .group { padding: 14px 10px 4px; font-size: 11px; font-weight: 600; color: #9ca3af; text-transform: uppercase; letter-spacing: .06em; }
#nav a { position: relative; display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; margin-bottom: 2px;
  border-radius: 8px; color: #4b5563; text-decoration: none; font-weight: 500; font-size: 13.5px; transition: background .15s, color .15s; }
#nav a svg { width: 18px; height: 18px; flex-shrink: 0; color: #9ca3af; }
#nav a:hover { background: #f3f4f6; color: var(--ink); }
#nav a:hover svg { color: #4b5563; }
#nav a.on { background: var(--brand-light); color: var(--brand); font-weight: 600; }
#nav a.on svg { color: var(--brand); stroke-width: 2; }
#nav a.on::before { content: ""; position: absolute; inset-block: 6px; inset-inline-start: 0; width: 3px; border-radius: 3px; background: var(--brand); }
svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 20px;
  background: rgb(255 255 255 / .95); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.top .business { flex: 1; min-width: 0; line-height: 1.25; }
.top .business .name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .business .role { font-size: 12px; color: var(--muted); }
.top .me { display: flex; gap: 8px; align-items: center; }
.top .user { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding-block: 0; padding-inline: 4px 10px; border: 1px solid var(--line); border-radius: 8px; font-weight: 600; font-size: 13px; }
.top .initials { display: inline-flex; width: 28px; height: 28px; border-radius: 6px; background: var(--brand); color: #fff; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.icon-button { width: 36px; height: 36px; padding: 0; background: none; color: #6b7280; box-shadow: none; }
.icon-button:hover { background: #f3f4f6; color: var(--ink); }
.icon-button svg { width: 20px; height: 20px; }
.menu-button { display: none; }

/* ---- order row actions: icon-only, the name in the tooltip ---- */
td.actions { white-space: nowrap; text-align: end; }
.icon-action { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; min-height: 0;
  padding: 0; margin-inline-start: 4px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #374151;
  box-shadow: none; vertical-align: middle; text-decoration: none; }
.icon-action:hover { border-color: var(--brand); color: var(--brand); background: #fff; text-decoration: none; }
.icon-action svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-action.bad { color: var(--bad); border-color: #fecaca; background: #fef2f2; }
.icon-action.bad:hover { background: #fee2e2; color: var(--bad); border-color: #fca5a5; }
.icon-action[aria-expanded="true"] { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }
@media (pointer: coarse) { .icon-action { width: 44px; height: 44px; } }
.scrim { position: fixed; inset: 0; background: rgb(17 24 39 / .4); z-index: 30; }
.filters { display: flex; gap: 16px; align-items: center; margin: 20px 20px 0; padding: 12px 16px; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; flex-wrap: wrap; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.filters label { display: inline-flex; align-items: center; gap: 8px; }
main { padding: 20px; width: 100%; max-width: 1440px; }
.maker { margin-top: auto; padding: 16px 20px 20px; font-size: 12px; color: #9ca3af; }
.maker a { color: #6b7280; font-weight: 600; text-decoration: none; }
@media (max-width: 1023px) {
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: 264px; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 20px 40px rgba(0,0,0,.15); }
  html[dir="rtl"] .sidebar { transform: translateX(100%); }
  .sidebar.open { transform: none !important; }
  .menu-button { display: inline-flex; }
  .top { padding: 0 12px; }
  .top .user #user { display: none; }
  main { padding: 12px; }
  .filters { margin: 12px 12px 0; }
}

/* ---- blocks ---- */
.card { background: var(--card); border: 1px solid rgb(229 231 235 / .8); border-radius: 12px; padding: 18px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.card:has(> table) { overflow-x: auto; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.spread > h1, .spread > .row { margin-bottom: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 16px; }
.grid > .card { position: relative; margin-bottom: 0; }
.grid > .card::before { content: ""; position: absolute; top: 0; inset-inline-start: 20px; width: 44px; height: 4px; border-radius: 0 0 6px 6px; background: var(--brand); }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 900px) { .two { grid-template-columns: 1fr; } }
.stat { font-size: 24px; line-height: 32px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.warn { color: var(--warn); }
/* Lines waiting for the shop: reach it before delivery (issues.js tellShopBlock). */
.tell-shop { justify-content: space-between; margin: 8px 0; padding: 8px 12px; border-radius: 8px; background: #fdf6ea;
  border-inline-start: 3px solid var(--sand); color: #7c3f17; font-weight: 600; }
.bad { color: var(--bad); }
.ok { color: var(--ok); }
table { width: 100%; border-collapse: collapse; background: #fff; font-size: 13px; }
th, td { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #f9fafb; border-bottom-color: var(--line); }
tbody tr:hover > td { background: #fafafb; }
td.n, th.n { text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
tr.sub > td, tbody tr.sub:hover > td { background: #f9fafb; }
.pill { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: #f3f4f6; color: #374151; }
.pill.Placed { background: var(--primary-light); color: var(--primary); }
.pill.Confirmed { background: var(--secondary-light); color: var(--secondary); }
.pill.Preparing { background: #fef3c7; color: #92400e; }
.pill.OutForDelivery { background: #e0e7ff; color: #4338ca; }
.pill.Delivered { background: #dcfce7; color: #15803d; }
.pill.Cancelled { background: #fee2e2; color: #b91c1c; }
/* What is paid on an order. */
.pill.Unpaid { background: #fef3c7; color: #92400e; }
.pill.PartlyPaid { background: var(--brand-light); color: var(--brand-dark); }
.pill.Paid { background: #dcfce7; color: #15803d; }
.paid-by { margin-top: 4px; font-size: 12.5px; line-height: 1.6; }
tr.voided .amount { text-decoration: line-through; color: var(--muted); }
.split { font-size: 13px; line-height: 1.6; }
.pay-form .form > * { min-width: 0; }
@media (max-width: 640px) { .pay-form .form { grid-template-columns: 1fr; gap: 4px 0; } .pay-form .form > label { margin-top: 6px; } }
.map { height: 380px; border-radius: 10px; border: 1px solid var(--line); }
.map.small { height: 260px; }
.form { display: grid; grid-template-columns: 140px 1fr; gap: 10px 12px; align-items: center; }
.form textarea { min-height: 64px; }

/* ---- sign-in: a violet band holding the logo, the form below ---- */
.login { max-width: 400px; margin: 10vh auto; padding: 0; overflow: hidden; }
.login .band { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%); padding: 28px 24px 0; }
/* The south-east of the brand story at the foot of the band: Atlas, kasbah, low sun, dunes (scene.svg, generated). */
.login .band .scene { display: block; width: calc(100% + 48px); height: auto; margin: 14px -24px 0; }
html[dir="rtl"] .login .band .scene { transform: scaleX(-1); }
.login .band::before { content: ""; position: absolute; inset-inline: 0; top: 0; height: 8px; background: var(--lozenges) repeat-x; opacity: .7; }
.login .band img { height: 54px; display: block; }
.login .band p { margin: 12px 0 0; color: rgb(255 255 255 / .8); font-size: 13px; }
.login .band p.slogan { margin-top: 14px; color: #fff; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.login .band p.slogan + p { margin-top: 2px; }
.login .body { padding: 22px 24px 24px; }
.login .form { grid-template-columns: 1fr; }
.login button:not(.link) { min-height: 42px; }

.toast { position: fixed; bottom: 16px; inset-inline-end: 16px; z-index: 60; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 12px; max-width: 420px; box-shadow: 0 10px 30px rgba(0,0,0,.2); animation: toast-in .2s ease-out; }
.toast.error { background: var(--bad); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.stops li { margin-bottom: 8px; }
.seq { display: inline-flex; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; margin-inline-end: 6px; }
.seq-icon { background: var(--brand); color: #fff; border-radius: 50%; width: 24px !important; height: 24px !important; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.seq-icon.depot { background: var(--brand-deep); }
.seq-icon.supplier { background: var(--primary); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print {
  .sidebar, .top, .filters, .maker, .noprint { display: none !important; }
  body { background: #fff; }
  main { padding: 0; }
  .card { border: 0; box-shadow: none; }
}
/* Tooltips of the buttons at the end of a table row open towards the start, so they stay inside the table. */
td .actions [data-tip]::after { left: auto; right: 0; transform: none; }
html[dir="rtl"] td .actions [data-tip]::after { right: auto; left: 0; }

/* ---- right-to-left (Arabic): the layout uses start/end properties; what remains physical is flipped here ---- */
html[dir="rtl"] [data-tip].tip-end::after { right: auto; left: 0; }
html[dir="rtl"] details.multi summary { padding: 6px 10px 6px 30px; background-position: left 8px center; }
html[dir="rtl"] svg.mirror { transform: scaleX(-1); }
/* Arabic letters must stay joined: no letter spacing, no capitals. */
html[dir="rtl"] h1, html[dir="rtl"] th, html[dir="rtl"] #nav .group, html[dir="rtl"] .stat,
html[dir="rtl"] .login .band p.slogan { letter-spacing: 0; text-transform: none; }
html[dir="rtl"] th { font-size: 12px; }
/* Maps, numbers typed in fields and coordinates read left to right in every language. */
.map, .leaflet-container { direction: ltr; }
html[dir="rtl"] input[type="number"], html[dir="rtl"] input[type="date"] { direction: ltr; text-align: end; }
/* The language picker on the sign-in card's band. */
.login .band { position: relative; }
.login .band select.lang { position: absolute; top: 14px; inset-inline-end: 14px; min-height: 30px; padding: 2px 8px;
  background: rgb(255 255 255 / .15); color: #fff; border-color: rgb(255 255 255 / .35); }
.login .band select.lang option { color: var(--ink); }

/* ---- supplier visit (onboarding.js): a tablet page, big touch targets with visible labels ---- */
.ob { max-width: 1000px; margin: 0 auto; font-size: 16px; }
.ob h1 { font-size: 26px; }
.ob h2 { font-size: 18px; }
.ob h3 { font-size: 16px; margin: 18px 0 4px; }
.ob input:not([type="checkbox"]):not([type="radio"]), .ob select, .ob textarea { min-height: 52px; font-size: 17px; padding: 8px 14px; border-radius: 10px; }
.ob .form { grid-template-columns: 180px 1fr; }
@media (max-width: 700px) { .ob .form { grid-template-columns: 1fr; } }
button.big, a.big, label.big { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 72px; min-width: 140px; padding: 10px 18px; border-radius: 14px; font-size: 15px; font-weight: 600; text-decoration: none;
  background: var(--primary); color: #fff; border: 1px solid transparent; cursor: pointer; box-shadow: 0 1px 2px rgba(16, 24, 40, .08); }
button.big svg, a.big svg, label.big svg { width: 26px; height: 26px; }
button.big:hover, a.big:hover, label.big:hover { background: var(--primary-dark); }
.big.secondary { background: #fff; color: #374151; border-color: var(--line); }
.big.secondary:hover { background: #fff; border-color: var(--brand); color: var(--brand); }
.big.yes { background: var(--ok); min-width: 200px; min-height: 96px; font-size: 18px; }
.big.yes:hover { background: #166534; }
.big.no { background: #fff; color: var(--bad); border: 2px solid #fecaca; min-width: 160px; min-height: 96px; font-size: 18px; }
.big.no:hover { background: #fef2f2; }
.big.yes svg, .big.no svg { width: 34px; height: 34px; }
.ob-actions, .ob-nav, .ob-yesno { display: flex; gap: 12px; flex-wrap: wrap; align-items: stretch; margin: 12px 0; }
.ob-nav { justify-content: space-between; margin-top: 18px; }
.ob-nav > :only-child { margin-inline-start: auto; }
.ob-yesno { justify-content: center; }
.ob-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 8px; }
.ob-step { flex-direction: row; gap: 10px; min-height: 56px; background: #fff; color: #4b5563; border: 1px solid var(--line); border-radius: 12px; font-size: 15px; box-shadow: none; }
.ob-step:hover { background: var(--brand-light); color: var(--brand); }
.ob-step .num { display: inline-flex; width: 28px; height: 28px; border-radius: 50%; align-items: center; justify-content: center; background: #f3f4f6; font-weight: 700; }
.ob-step.on { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }
.ob-step.on .num, .ob-step.past .num { background: var(--brand); color: #fff; }
@media (max-width: 700px) { .ob-step span:not(.num) { display: none; } }
.ob-bar { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; margin-bottom: 16px; }
.ob-bar span { display: block; height: 100%; background: var(--brand); transition: width .3s; }
.ob-bar.thin { height: 4px; margin: 6px 0 0; }
.ob-count { margin-bottom: 14px; color: var(--muted); font-weight: 600; }
.ob-card { padding: 22px; }
.ask { display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 12px; padding: 10px 14px; border-radius: 10px; background: #fdf6ea;
  border-inline-start: 3px solid var(--sand); color: #7c3f17; font-size: 17px; font-weight: 600; }
.ask svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 3px; }
.ob-choice, .ob-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 18px; }
.ob-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 120px; padding: 18px; border: 2px solid var(--line);
  border-radius: 14px; background: #fff; color: var(--ink); cursor: pointer; text-align: start; font-weight: 500; box-shadow: none; }
.ob-tile:hover { border-color: var(--brand); background: #fff; }
.ob-tile svg { width: 32px; height: 32px; color: var(--brand); }
.ob-tile strong { font-size: 18px; }
.ob-tile input { position: absolute; opacity: 0; pointer-events: none; }
.ob-tile:has(input:checked), .ob-tile.on { border-color: var(--brand); background: var(--brand-light); }
.ob-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 16px; margin-bottom: 14px; }
.ob-fields label, .ob-times label, .ob-tier label, .ob-inline { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.ob-fields label.wide { grid-column: 1 / -1; }
.ob-days { display: grid; gap: 8px; }
.ob-day { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.ob-day.off { background: #f9fafb; }
.ob-day.off .ob-times { display: none; }
.ob-day .closed { display: none; }
.ob-day.off .closed { display: inline; }
.ob-times { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.ob-times input[type="time"] { width: 160px; }
.ob-switch { display: inline-flex; align-items: center; gap: 10px; min-width: 150px; font-size: 16px; text-transform: capitalize; cursor: pointer; }
.ob-switch input, .ob-chip input { width: 26px; height: 26px; }
.ob-switch.small { min-width: 0; font-size: 14px; text-transform: none; align-self: center; }
.ob-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 14px; }
.ob-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 6px 16px; border: 2px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; font-size: 15px; }
.ob-chip:has(input:checked) { border-color: var(--brand); background: var(--brand-light); color: var(--brand-dark); }
.ob-chip .pt { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 500; }
.ob-today { margin-top: 10px; }
.ob-cats summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; font-weight: 600; }
.ob-product { display: grid; grid-template-columns: 180px 1fr; gap: 16px 20px; align-items: start; }
.ob-pic { width: 180px; height: 180px; border-radius: 14px; background: #f3f4f6; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ob-pic img { width: 100%; height: 100%; object-fit: contain; }
.ob-pic svg { width: 64px; height: 64px; color: #9ca3af; }
.ob-name { font-size: 24px; line-height: 1.25; margin: 4px 0; }
.ob-question, .ob-prices, .ob-prev-only { grid-column: 1 / -1; }
@media (max-width: 700px) { .ob-product { grid-template-columns: 1fr; } .ob-pic { width: 100%; height: 200px; } }
.ob-tier { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; padding: 10px 12px; margin-bottom: 8px; border-radius: 12px; background: var(--brand-light); }
.ob-tier-label { min-width: 120px; align-self: center; font-weight: 700; color: var(--brand-dark); }
.ob-tier input { width: 150px; }
.ob-tier .ib { width: 52px; height: 52px; min-height: 52px; }
.ob-search { display: flex; align-items: center; gap: 10px; }
.ob-search svg { width: 26px; height: 26px; color: var(--muted); }
.ob-search input { flex: 1; }
.ob-results { display: grid; gap: 12px; margin-top: 14px; }
.ob-result { border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.ob-result .ob-product { grid-template-columns: 96px 1fr; }
.ob-result .ob-pic { width: 96px; height: 96px; }
.ob-result .ob-name { font-size: 19px; }
.ob-end { text-align: center; padding: 20px; }
.ob-end > svg { width: 48px; height: 48px; color: var(--brand); }
.ob-end .ob-actions { justify-content: center; }
.ob-visits { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 20px; }
.ob-visit { display: flex; flex-direction: column; gap: 6px; color: inherit; text-decoration: none; margin: 0; }
.ob-visit:hover { border-color: var(--brand); }

/* Packing: the parcel's code, as on its label. */
.pack .row.spread { align-items: flex-start; }
.pack-code { display: inline-flex; min-width: 64px; justify-content: center; padding: 4px 8px; border: 2px solid var(--brand-deep, #083344); border-radius: 8px; font-size: 18px; font-weight: 700; color: var(--brand-deep, #083344); margin-inline-end: 10px; }
.pack table td { padding: 4px 8px; }

/* ---- the Demo guide and the banner of a demo session (demo.js) ---- */
.demo-banner { position: sticky; top: 56px; z-index: 19; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; padding: 10px 20px; background: #9a5528; color: #fff; font-weight: 600; font-size: 14px; }
.demo-banner[hidden] { display: none; }
.demo-banner .demo-return { display: inline-flex; align-items: center; gap: 8px; background: #fff; color: #9a5528; border-color: #fff; }
.demo-banner .demo-return:hover { background: #fdf1e4; color: #7a3f1c; }
.demo-banner .demo-return svg { width: 18px; height: 18px; }
.demo-group { margin-top: 8px; }
.demo-role, .demo-feature { display: flex; flex-direction: column; }
.demo-role .row, .demo-feature .row { margin-top: auto; }
.demo-note { font-size: 12px; }

/* Urgent orders (urgent.js): same day, within the urgent slot's delay. Red, the one colour that says "now". */
.pill.Urgent { background: #fee2e2; color: var(--bad); }
.pill.Urgent.late { background: var(--bad); color: #fff; }
.urgent-block { border-inline-start: 4px solid var(--bad); }
.urgent-block h2 { margin: 0 0 8px; font-size: 16px; color: var(--bad); }
.urgent-block table { width: 100%; }
.card.urgent-slot { border-color: #fecaca; }
#nav a .badge.urgent { margin-inline-start: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--bad);
  color: #fff; font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

/* Product pictures on the products page. */
.p-thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; display: block; background: var(--brand-light); border: 1px solid #e2e8f0; }

/* The pricing editor of a product, in its price cell (pricing.js). */
.pricing-form { display: grid; gap: 6px; min-width: 240px; text-align: start; }
.pricing-form input, .pricing-form select { width: 100%; }

/* ---- owner's dashboard (dashboard.js) ---- */
.dash-chart { width: 100%; height: auto; display: block; margin: 4px 0 10px; stroke: none; }
.dash-chart rect { stroke: none; }
.dash-chart line { stroke: var(--line); stroke-width: 1; }
.dash-chart text { stroke: none; font-weight: 400; font-size: 10px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.dash-bar:hover rect + rect { fill: var(--brand-dark); }
.dash-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.dash-cols > .card { margin-bottom: 16px; }
details > summary { cursor: pointer; }
