/* Soft Editorial, part one: the tokens (colour, type, space, shape,
   motion; light and dark) and the small parts every screen uses: the
   page base, buttons, links, chips, the segmented control, search, lists
   and the one label component. The look: warm paper, white surfaces with
   a hairline, serif titles, ink buttons with square corners and the
   mark's folded corner on the main one (button.css, shared with the
   landing page), and one teal that marks what is chosen, live or the way
   on.

   Shape: one radius family, 6 / 8 / 12 / 16, and the button, which is
   square (0): its corners are the mark's geometry.
     --radius-s       6   labels, checkboxes, avatars, chips' inner parts
     --radius-control 8   inputs, chips, nav rows, photo tiles
     --radius-l       12  panels, cards, delivery covers, the hero
     --radius-sheet   16  sheets, dialogs, sticky bars, the toast
   Nothing in the real app is a pill or a circle. The viewer's photograph
   has no radius: it is the page there.

   Colour: ink is the primary action. --accent (teal, from the brand's
   family) marks selection, progress, focus, links and where you are.
   Meaning (success, info, warning, danger, neutral) lives only in .tag, as
   a word on a tint. The brand teal (--teal, #1A8F81, lifted to #2AA797 on
   dark) stays on the mark's flap.

   Motion: two durations and one curve for almost everything; anything
   that moves animates transform or opacity, and reduced motion turns it
   all off (end of file).

   Load order (a later file wins a tie, so the order is part of the
   design):

     index.html   app.css, button.css (the same file the landing page
                  serves as /button.css: one button for the landing page
                  and the app), components.css, shell.css, then a group
                  of files for each part of the app (a delivery's page,
                  the client's page, the contributor's page, access
                  tokens and the operator's area), each group named in a
                  comment there
     demo.html    app.css, button.css, components.css, demo.css,
                  shell.css

   Where to look next: components.css for panels, fields, sheets, the
   toast and the tile grid; the header of the file that owns the screen
   you are reading about. */

@font-face{font-family:"Theirway Serif";src:url("../fonts/theirway-serif-latin-ext-opsz-wght.woff2") format("woff2");font-weight:400 600;font-display:swap}
@font-face{font-family:"Instrument Sans";src:url("../fonts/instrument-sans-latin-ext-wght.woff2") format("woff2");font-weight:400 600;font-display:swap}

/* Tokens. Light is the default; dark is repeated for the OS preference
   (unless the page forces light) and for data-theme="dark". A media query
   and an attribute selector cannot share one rule, so the two dark blocks
   hold the same values, byte for byte. In both themes the text colours
   meet 4.5:1 on the grounds they are drawn on, and a field's edge, the
   focus ring, the progress bar and the mark's flap meet 3:1. The softer
   rules (--line, --line-strong) are decoration, not edges you need to
   see. */
:root{
  /* paper, surfaces and ink */
  --bg:#F5F3EE; --surface:#FFFFFF; --sunken:#EEEBE4; --hover:#F1EEE8;
  --line:#E2DED5; --line2:#ECE9E2; --line-strong:#CFCAC0; --field-line:#858178;
  --ink:#1C1B19; --ink2:#4A4843; --mute:#6A675F;
  /* the primary action is ink */
  --action:#1C1B19; --action-hover:#36342F; --on-action:#FAF9F6;
  /* the one accent: chosen, live, focus, links, where you are */
  --accent:#0E6B5F; --accent-hover:#0A574D; --accent-tint:#DCEEEA; --accent-ink:#0B5F54; --on-accent:#FFFFFF;
  --focus:var(--accent); --progress:var(--accent);
  /* meaning, for labels: a word on a tint (fg on bg is AA in both themes) */
  --neutral-fg:#4A4843; --neutral-bg:#ECE9E2;
  --info-fg:#24527F;    --info-bg:#E3EDF7;
  --success-fg:#2C6A34; --success-bg:#E2F0DF;
  --warning-fg:#7A4E0C; --warning-bg:#F7EBD3;
  --danger-fg:#A0352A;  --danger-bg:#F8E3DF;
  --amber:var(--warning-fg); --red:var(--danger-fg); --red-hover:#82291F;
  /* the flap of the mark, the one coloured plane (3.58:1 on --bg, where
     a graphic needs 3:1); the dark blocks lift it to #2AA797 (6.1:1 on
     #161615) */
  --teal:#1A8F81;
  /* over photos and in the viewer: the same in both themes */
  --on-photo:#FFFFFF; --photo-ink:#141412; --veil:rgba(20,20,18,.66); --photo-edge:rgba(0,0,0,.24);
  /* the QR card (request-qr.css) is paper in both themes: dark on white, always */
  --card-paper:#FFFFFF; --card-ink:#1C1B19; --card-mute:#4A4843;
  --solid-info:#2F6497; --solid-success:#2E7537; --solid-warning:#8A5A0E; --solid-danger:#B03A2E;
  --viewer:#161615; --viewer-surface:#262624; --viewer-mute:#A8A59E;
  --scrim:rgba(28,27,25,.36);
  /* the one shadow: things that float (sheets, menus, sticky bars, the toast,
     a photo tile lifted under the pointer) */
  --shadow-overlay:0 1px 2px rgba(28,27,25,.06),0 16px 40px -16px rgba(28,27,25,.30);
  --select-caret:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%234A4843' stroke-width='1.5'/%3E%3C/svg%3E");
  color-scheme:light}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --bg:#151514; --surface:#1D1D1B; --sunken:#191918; --hover:#252522;
  --line:#302F2B; --line2:#272623; --line-strong:#45433E; --field-line:#7A776F;
  --ink:#EDEBE5; --ink2:#C4C1B9; --mute:#9D9991;
  --action:#EDEBE5; --action-hover:#FFFFFF; --on-action:#161615;
  --teal:#2AA797;
  --accent:#5FC0B2; --accent-hover:#7ACDC1; --accent-tint:#173431; --accent-ink:#7FD3C6; --on-accent:#161615;
  --neutral-fg:#D6D3CB; --neutral-bg:#2C2B28;
  --info-fg:#A4C8F0;    --info-bg:#1C2A3A;
  --success-fg:#9DD4A3; --success-bg:#1B2E1E;
  --warning-fg:#E8C27E; --warning-bg:#352915;
  --danger-fg:#F2A699;  --danger-bg:#3A1F1B;
  --red-hover:#F8BDB2;
  --scrim:rgba(0,0,0,.56);
  --shadow-overlay:0 1px 2px rgba(0,0,0,.4),0 18px 48px -16px rgba(0,0,0,.75);
  --select-caret:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23C4C1B9' stroke-width='1.5'/%3E%3C/svg%3E");
  color-scheme:dark}}
:root[data-theme="dark"]{
  --bg:#151514; --surface:#1D1D1B; --sunken:#191918; --hover:#252522;
  --line:#302F2B; --line2:#272623; --line-strong:#45433E; --field-line:#7A776F;
  --ink:#EDEBE5; --ink2:#C4C1B9; --mute:#9D9991;
  --action:#EDEBE5; --action-hover:#FFFFFF; --on-action:#161615;
  --teal:#2AA797;
  --accent:#5FC0B2; --accent-hover:#7ACDC1; --accent-tint:#173431; --accent-ink:#7FD3C6; --on-accent:#161615;
  --neutral-fg:#D6D3CB; --neutral-bg:#2C2B28;
  --info-fg:#A4C8F0;    --info-bg:#1C2A3A;
  --success-fg:#9DD4A3; --success-bg:#1B2E1E;
  --warning-fg:#E8C27E; --warning-bg:#352915;
  --danger-fg:#F2A699;  --danger-bg:#3A1F1B;
  --red-hover:#F8BDB2;
  --scrim:rgba(0,0,0,.56);
  --shadow-overlay:0 1px 2px rgba(0,0,0,.4),0 18px 48px -16px rgba(0,0,0,.75);
  --select-caret:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23C4C1B9' stroke-width='1.5'/%3E%3C/svg%3E");
  color-scheme:dark}
:root{
  --font-sans:"Instrument Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  --font-display:"Theirway Serif",Georgia,"Times New Roman",serif;
  --font-mono:ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  --text-xs:12px; --text-s:12px; --text-m:13px; --text-ui:14px; --text-l:16px; --text-xl:18px;
  --text-label:12px;
  --text-2xl:22px; --text-3xl:30px; --text-4xl:40px; --text-display:56px;
  --radius-s:6px; --radius-control:8px; --radius-l:12px; --radius-sheet:16px;
  --space-0:2px; --space-1:4px; --space-1h:6px; --space-2:8px; --space-2h:10px; --space-3:12px;
  --space-4:16px; --space-5:24px; --space-6:32px; --space-7:48px; --space-8:64px; --space-9:96px;   /* 1h and 2h are half steps */
  --icon-s:14px; --icon-m:16px; --icon-l:20px;
  --chevron:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");   /* a mask: drawn in whatever colour the part sets */
  --control:36px; --control-s:30px; --control-l:44px;
  --row-y:14px; --row-x:var(--panel-pad); --panel-pad:24px; --sheet-pad:24px; --gutter:48px; --input-font:14px;
  --page-max:1180px; --cover-w:104px; --cover-h:68px;   /* a delivery's cover in the list */
  --dur-fast:120ms; --dur:180ms; --dur-slow:220ms;
  --ease-out:cubic-bezier(.2,.8,.2,1); --ease-in-out:cubic-bezier(.45,0,.2,1)}
@media (max-width:820px){:root{
  --text-3xl:24px; --text-4xl:30px; --text-display:36px;
  --control:44px; --control-s:36px; --row-y:14px; --panel-pad:16px; --sheet-pad:20px; --gutter:16px; --input-font:16px}}
/* Names kept for demo.css (demo.html's fake-data screens) only; nothing
   in the real app reads them. */
:root{
  --teal-ink:var(--accent-ink); --teal-soft:var(--accent-tint);
  --amber-fill:var(--solid-warning); --amber-soft:var(--warning-bg);
  --veil-teal:var(--on-photo); --veil-amber:var(--on-photo);
  --lamp-ok:transparent;
  --radius-m:var(--radius-control); --radius-pill:var(--radius-s)}

/* --- base, type, icons, focus ----------------------------------------- */

:root{box-sizing:border-box;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}
*,*::before,*::after{box-sizing:inherit}
html{scroll-padding-top:env(safe-area-inset-top,0px);-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--ink);font:400 var(--text-ui)/20px var(--font-sans);-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent}
[hidden]{display:none!important}
a{color:var(--accent-ink);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:3px;text-decoration-color:color-mix(in srgb,currentColor 40%,transparent)}
a:hover{text-decoration-color:currentColor}
svg{fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;width:var(--icon-m);height:var(--icon-m);flex:none}
button{font:inherit;color:inherit}
b,strong{font-weight:500}
h1{font:400 var(--text-4xl)/1.1 var(--font-display);letter-spacing:-.018em;margin:0;text-wrap:balance}
h2{font:500 var(--text-2xl)/28px var(--font-display);letter-spacing:-.008em;margin:0}
h3{font:500 var(--text-ui)/20px var(--font-sans);margin:0}
.s{color:var(--mute);font-size:var(--text-m);line-height:18px}
.lede{color:var(--ink2);font:400 var(--text-l)/24px var(--font-sans);margin:var(--space-2) 0 0;font-variant-numeric:tabular-nums}
.eyebrow{display:block;margin:0 0 var(--space-2);font:500 var(--text-label)/16px var(--font-sans);letter-spacing:.06em;text-transform:uppercase;color:var(--mute)}
/* The mark is a diamond in a square box two cap heights tall (Theirway
   Serif's cap is .667em, so 28px beside the 21px wordmark): the logo's
   lockup rule. The body is --ink, which is paper on dark; the flap is the
   one teal plane. */
.mark{width:1.334em;height:1.334em}
.mark-body{fill:var(--ink);stroke:none}
.mark-flap{fill:var(--teal);stroke:none}
/* Numbers that change while you watch stay still. */
.num,.when2,.list-row > .s,.up-summary-text,.up-indicator-text,.c-count,.c-created,.build,[data-part=rc-more] .s{font-variant-numeric:tabular-nums}

:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
.list-row:focus-visible,.up-toggle:focus-visible,.rc-cell a:focus-visible{outline-offset:-2px}
.backlink{border-radius:var(--radius-s)}

/* --- buttons: one primary per view region ------------------------------ */

/* The box buttons (.btn, .primary, .quiet, .danger, .sm, .lg, .block) are
   button.css, shared with the landing page: square corners, the primary and
   the danger button with the mark's folded corner. Here: which of the app's
   tokens they read (the one place), what they stand on, and the buttons
   that are text, not a box. */
:root{
  --btn-height:var(--control); --btn-height-sm:var(--control-s); --btn-height-lg:var(--control-l);
  --btn-pad:16px; --btn-pad-sm:12px; --btn-pad-lg:22px;
  --btn-label:var(--ink);
  --btn-action:var(--action); --btn-action-hover:var(--action-hover); --btn-on-action:var(--on-action);
  --btn-flap:var(--teal); --btn-danger:var(--red);
  --btn-quiet-bg:var(--surface); --btn-quiet-line:var(--line-strong); --btn-quiet-line-hover:var(--ink2); --btn-quiet-hover:var(--hover);
  --btn-disabled-bg:var(--sunken); --btn-disabled-fg:var(--mute); --btn-disabled-flap:var(--line-strong);
  --btn-ring:var(--focus); --btn-ring-offset:2px;
  --btn-ground:var(--bg)}   /* the paper; a surface below says its own */
/* The bite of a fold shows what lies behind the button, so every surface
   that paints something else says so here; one missing would show as a
   wrong square in a corner. On every screen, in both themes, each fold's
   bite matches the ground it stands on. */
.panel,.sheet,.how,.rc-bar,.up-summary,.list.deliveries-table,.deliveries-loading{--btn-ground:var(--surface)}
.sheet footer,.recipient-form{--btn-ground:var(--bg)}   /* paper again */
.drop{--btn-ground:var(--bg)}   /* the empty Files panel's drop zone: paper inside a panel */
.callout{--btn-ground:var(--warning-bg)}
.callout.teal{--btn-ground:var(--accent-tint)}
.callout.info{--btn-ground:var(--info-bg)}
.callout.red{--btn-ground:var(--danger-bg)}

/* The link button is text: the accent's ink, an underline on hover, no box. */
.btn.link{height:auto;min-height:var(--control-s);padding:0;border:0;color:var(--accent-ink);text-decoration:none}
.btn.link:hover{color:var(--accent-hover);text-decoration:underline;text-underline-offset:3px}
.btn.link.red,.btn.quiet.red{color:var(--red)}
.btn.link.red:hover,.btn.quiet.red:hover{color:var(--red-hover)}
.btn.quiet.red{border-color:color-mix(in srgb,var(--red) 45%,transparent)}
.btn.link.btn:disabled{background:none;text-decoration:none}
.btn[aria-busy=true]{cursor:progress}
/* "Copied": the tick pops in, so the click visibly landed */
.btn.is-done svg{animation:pop var(--dur) var(--ease-out)}
.x{width:36px;height:36px;border:0;border-radius:var(--radius-control);background:none;display:grid;place-items:center;color:var(--mute);cursor:pointer;transition:background-color var(--dur-fast),color var(--dur-fast)}
.x:hover{color:var(--ink);background:var(--hover)}
.actions{display:flex;gap:var(--space-3);flex-wrap:wrap;align-items:center}

/* --- chips (filters, many may be on) and the segmented control (one) ---- */

.toolbar{display:flex;gap:var(--space-3);align-items:center;flex-wrap:wrap;margin-bottom:var(--space-4)}
.chips{display:flex;flex-wrap:wrap;gap:var(--space-2);align-items:center}
.chip{display:inline-flex;align-items:center;gap:var(--space-1h);height:var(--control-s);padding:0 12px;border:1px solid var(--line-strong);border-radius:var(--radius-control);background:var(--surface);color:var(--ink2);font:500 var(--text-m)/18px var(--font-sans);cursor:pointer;transition:background-color var(--dur-fast),border-color var(--dur-fast),color var(--dur-fast)}
.chip:hover{border-color:var(--ink2);color:var(--ink)}
.chip[aria-pressed=true],.chip[aria-pressed=mixed]{background:var(--accent-tint);border-color:var(--accent);color:var(--accent-ink)}
.chip svg{width:var(--icon-s);height:var(--icon-s);stroke-width:2.4}
.chip .n,.seg button .n{color:var(--mute);font-weight:400;font-variant-numeric:tabular-nums}
.chip[aria-pressed=true] .n,.chip[aria-pressed=mixed] .n{color:inherit}
.seg{display:inline-flex;gap:2px;padding:3px;background:var(--sunken);border-radius:var(--radius-control)}
.seg button{display:inline-flex;align-items:center;gap:var(--space-1h);height:calc(var(--control-s) - 4px);padding:0 12px;border:0;border-radius:var(--radius-s);background:none;color:var(--ink2);font:500 var(--text-m)/18px var(--font-sans);cursor:pointer;transition:background-color var(--dur-fast),color var(--dur-fast)}
.seg button:hover{color:var(--ink)}
.seg button[aria-pressed=true]{background:var(--surface);color:var(--ink);box-shadow:0 0 0 1px var(--line)}
@media (pointer:coarse),(max-width:820px){.chip{height:var(--control-l)}.seg button{height:calc(var(--control-l) - 6px)}}
.search{display:flex;align-items:center;gap:var(--space-2);margin-left:auto;height:var(--control);min-width:240px;padding:0 12px;border:1px solid var(--line-strong);border-radius:var(--radius-control);background:var(--surface);color:var(--mute);transition:border-color var(--dur-fast),box-shadow var(--dur-fast)}
.search:hover{border-color:var(--ink2)}
.search svg{width:var(--icon-s);height:var(--icon-s)}
.search input{border:0;outline:0;background:none;font:400 var(--input-font)/20px var(--font-sans);color:var(--ink);width:100%;height:100%;padding:0;box-shadow:none}
.search:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-tint)}

/* --- lists and tables: the one row shape (a table sets only --cols) --- */

.list{background:none;border:0;border-radius:0;overflow:hidden}
.list-head,.list-row{display:grid;grid-template-columns:var(--cols,minmax(0,1fr) auto);column-gap:var(--space-5);align-items:center;padding:var(--row-y) var(--row-x);color:inherit;text-decoration:none}
.list-head{padding-block:12px;background:none;border-bottom:1px solid var(--line);font:500 var(--text-label)/16px var(--font-sans);letter-spacing:.04em;text-transform:uppercase;color:var(--mute)}
.list-row{row-gap:var(--space-2);transition:background-color var(--dur-fast)}
.list-row + .list-row{border-top:1px solid var(--line2)}
a.list-row:hover{background:var(--hover)}
.list-row .linkrow{grid-column:1 / -1}
.cell-num{text-align:right;font-variant-numeric:tabular-nums;color:var(--ink2);white-space:nowrap}
.cell-num .unit{color:var(--mute)}
.stack,.who{min-width:0}
.who{display:flex;flex-direction:column}
.who .t{font-weight:500;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.who .s{font-size:var(--text-m);line-height:18px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;overflow-wrap:anywhere}
.skeleton-row i{display:block;height:10px;width:20%;border-radius:var(--radius-s);background:var(--line2)}
.skeleton-row{--cols:minmax(0,1fr)}
.skeleton-row i:first-child{width:40%}
@media (max-width:820px){.list-head{display:none}}

/* --- the label: one component for every state, role and kind ------------ */

/* A word on a tint, never colour alone. data-tone picks the meaning:
     ok, done  success   busy  info     attention  warning
     failed    danger    idle  neutral  off        neutral, outlined
   .super is the accent (a role, not a state). Over a photo,
   upload-tiles.css swaps the tint for a solid fill (white words). Every
   label's words meet AA contrast (4.5:1) on its tint in both themes, and
   the white words on a solid fill do too.
   inline-block, not inline-flex, on purpose: text-overflow does not reach
   the anonymous text of a flex container, so a long word would be cut
   mid-letter ("Already storec" on a phone). */
/* unicode-bidi: isolate: a tag is the producer's text and may hold a
   right-to-left override (a format character); isolated, it cannot
   reorder the count or label beside it. */
.tag{unicode-bidi:isolate;display:inline-block;height:22px;padding:0 8px;border-radius:var(--radius-s);background:var(--neutral-bg);color:var(--neutral-fg);font:500 var(--text-xs)/22px var(--font-sans);white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis;vertical-align:middle}
.tag[data-tone=ok],.tag[data-tone=done]{background:var(--success-bg);color:var(--success-fg)}
.tag[data-tone=busy]{background:var(--info-bg);color:var(--info-fg)}
.tag[data-tone=attention]{background:var(--warning-bg);color:var(--warning-fg)}
.tag[data-tone=failed]{background:var(--danger-bg);color:var(--danger-fg)}
.tag[data-tone=off]{background:none;color:var(--mute);box-shadow:inset 0 0 0 1px var(--line-strong)}
.tag.super{background:var(--accent-tint);color:var(--accent-ink)}

/* --- narrow screens (more of them in components.css and shell.css) ---- */

@media (max-width:820px){
 .toolbar{gap:var(--space-2h)}
 .search{order:-1;width:100%;margin-left:0;min-width:0}
 .chips{flex-wrap:nowrap;overflow-x:auto;margin:0 -16px;padding:2px 16px;scrollbar-width:none}
 .chips::-webkit-scrollbar{display:none}
 .chip{flex:none}
}

/* --- motion ------------------------------------------------------------- */

@keyframes fade{from{opacity:0}}
@keyframes rise{from{opacity:0;transform:translateY(8px)}}
@keyframes pop{from{opacity:0;transform:scale(.6)}}
/* Reduced motion: nothing moves or fades; state still changes at once. */
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}
