/* BagCam site. The colours, type and controls are the same as the BagCam screen
   in the store (bagcam/templates/base.html), so both read as one product.
   Stone is the light theme, Dark the dark one: <html data-theme="stone|dark">. */

:root {
  --page: #ECEBE7; --card: #FAF9F7; --band: #F1F0EC; --frame: #E1DFD9;
  --line: #C9C6BE; --line-soft: #E3E1DB; --line-strong: #A29E95;
  --text: #262624; --text-2: #474641; --text-3: #5C5A55;
  --accent: #3D6BC7; --accent-text: #2D58AC; --on-accent: #FFFFFF; --accent-soft: #E1E8F5; --accent-line: #7D98CF;
  --field: #FDFDFC; --field-line: #B5B1A8;
  --btn: linear-gradient(180deg, #FDFDFC 0%, #F0EFEB 100%); --btn-line: #B5B1A8;
  --ok: #11643D; --warn: #7A4F00; --warn-soft: #F6E4B8; --warn-line: #C99A3D;
  --bad: #A8221B; --bad-soft: #F8DAD7; --bad-line: #D7766E;
  --shadow: 0 1px 2px rgba(16, 30, 54, .10), 0 1px 3px rgba(16, 30, 54, .06);
  --lift: 0 18px 44px rgba(16, 30, 54, .22), 0 2px 8px rgba(16, 30, 54, .10);
  --scrim: rgba(38, 38, 36, .45);
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ctl: 40px;                      /* height of buttons and boxes; taller on touch screens */
}
:root[data-theme="dark"] {
  --page: #090B0F; --card: #11141A; --band: #171B23; --frame: #1E232D;
  --line: #333C4D; --line-soft: #262D3A; --line-strong: #46526A;
  --text: #EDF0F5; --text-2: #BFC7D4; --text-3: #9AA5B5;
  --accent: #428BF8; --accent-text: #428BF8; --on-accent: #0B0D12; --accent-soft: rgba(66, 139, 248, .14); --accent-line: #428BF8;
  --field: #171B23; --field-line: #46526A;
  --btn: #171B23; --btn-line: #333C4D;
  --ok: #63C684; --warn: #E8B339; --warn-soft: rgba(232, 179, 57, .13); --warn-line: rgba(232, 179, 57, .42);
  --bad: #EE726B; --bad-soft: rgba(237, 107, 99, .13); --bad-line: rgba(237, 107, 99, .45);
  --shadow: 0 1px 2px rgba(0, 0, 0, .42);
  --lift: 0 24px 60px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .4);
  --scrim: rgba(0, 0, 0, .62);
}
@media (pointer: coarse) { :root { --ctl: 44px; } }

* { box-sizing: border-box; }
html { color-scheme: light; scrollbar-gutter: stable; }
html[data-theme="dark"] { color-scheme: dark; }
body { margin: 0; background: var(--page); color: var(--text); font: 15px/1.45 var(--sans);
       -webkit-font-smoothing: antialiased; }
a { color: var(--accent-text); }
h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; margin: 0; }
h2 { font-size: 1.05rem; font-weight: 700; margin: 0; }
p { margin: 0; }
.mono { font-family: var(--mono); font-weight: 700; }
.muted { color: var(--text-3); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); }

/* top bar: Back and Home on the left, Sign out on the right, the same on every page */
.frame { background: var(--frame); border-bottom: 1px solid var(--line); }
.bar { max-width: 1280px; margin: 0 auto; padding: 8px 20px; display: flex; align-items: center;
       justify-content: space-between; gap: 8px 16px; }
.group { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.25rem;
         letter-spacing: -.01em; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand svg { color: var(--accent-text); flex: none; }
.store { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pill { font-size: .8rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap;
        background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent-text); }
.icon-btn { flex: none; width: var(--ctl); height: var(--ctl); min-height: 0; display: inline-flex; align-items: center;
            justify-content: center; background: var(--btn); border: 1px solid var(--btn-line); border-radius: 9px;
            color: var(--text); text-decoration: none; cursor: pointer; padding: 0; }
.icon-btn.plain { background: transparent; border-color: transparent; color: var(--text-3); }
.icon-btn.accent { color: var(--accent-text); }

main { max-width: 1280px; margin: 0 auto; padding: 16px 20px 28px; }
main.narrow { max-width: 1040px; }
.card, .panel { background: var(--card); border: 1px solid var(--line); border-radius: 13px;
                box-shadow: var(--shadow); padding: 16px; }

/* controls */
.btn, button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--ctl);
       padding: 0 14px; font: inherit; font-weight: 600; border-radius: 9px; border: 1px solid var(--btn-line);
       background: var(--btn); color: var(--text); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn.primary, button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.big { min-height: 48px; padding: 8px 20px; font-size: 1.05rem; line-height: 1.25; white-space: normal; text-align: center; }
.btn[disabled], button[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: default; }
button.on { border-color: var(--ok); color: var(--ok); }
input, select { font: inherit; min-height: var(--ctl); padding: 0 12px; border-radius: 9px; border: 1px solid var(--field-line);
       background: var(--field); color: var(--text); min-width: 0; }
input[type="number"], input.address { font-family: var(--mono); font-weight: 700; }
input[type="checkbox"] { flex: none; width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--accent); }
:is(a, button, input, select, summary):focus-visible { outline: 3px solid var(--accent-line); outline-offset: 1px; }
.seg { display: inline-flex; flex: none; border: 1px solid var(--btn-line); border-radius: 9px; overflow: hidden;
       background: var(--btn); align-self: flex-start; }
.seg > * { display: inline-flex; align-items: center; min-height: calc(var(--ctl) - 2px); padding: 0 14px; border: 0; border-radius: 0;
           border-left: 1px solid var(--btn-line); background: transparent; color: var(--text); font-weight: 600;
           text-decoration: none; white-space: nowrap; cursor: pointer; }
.seg > :first-child { border-left: 0; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; padding: 0; }
.seg label:has(input:checked) { background: var(--accent); color: var(--on-accent); }
.seg label:has(input:focus-visible) { outline: 3px solid var(--accent-line); outline-offset: -3px; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600;
         background: var(--band); border: 1px solid var(--line); color: var(--text); white-space: nowrap; }
.flag { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; font-weight: 600; color: var(--warn); }
.flag.bad, .tone-bad { color: var(--bad); }
.flag.good, .tone-ok { color: var(--ok); }
.tone-warn { color: var(--warn); }
.tone-idle { color: var(--text-3); }
.label { font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tile { background: var(--band); border: 1px solid var(--line-soft); border-radius: 9px; padding: 8px 12px;
        display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile span:first-child { font-size: .78rem; color: var(--text-3); }
.tile span:nth-of-type(2) { font-weight: 600; overflow-wrap: anywhere; }
.tile .meter { margin-top: 4px; }
.items { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.items li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; background: var(--band);
            border: 1px solid var(--line-soft); border-radius: 9px; padding: 7px 12px; }
.items .qty { font-family: var(--mono); font-weight: 700; color: var(--accent-text); min-width: 22px; }
.items .name { font-weight: 600; }
.items .mods { color: var(--text-3); font-size: .93rem; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 28px 16px; text-align: center;
         font-weight: 600; color: var(--text-3); background: var(--band); border: 1px solid var(--line-soft); border-radius: 13px; }
.empty.bad { color: var(--bad); background: var(--bad-soft); border-color: var(--bad-line); }
.statusline { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 600; white-space: nowrap; }
.statusline i { flex: none; width: 10px; height: 10px; border-radius: 50%; background: currentColor; }

/* windows over the page */
dialog { width: min(940px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 16px; overflow: auto;
         background: var(--card); color: var(--text); border: 1px solid var(--line-strong); border-radius: 18px;
         box-shadow: var(--lift); }
dialog::backdrop { background: var(--scrim); }
dialog.small { width: min(400px, calc(100vw - 24px)); padding: 20px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.dialog-head .ticket-title { min-width: 0; }
/* a ticket's details: a window sized for reading */
dialog.panel { width: min(620px, calc(100vw - 24px)); padding: 20px; }
dialog.panel .ticket-num { font-size: 1.3rem; overflow-wrap: anywhere; }
.ticket-order { font-weight: 600; color: var(--text-2); white-space: nowrap; }
.panel-body { display: flex; flex-direction: column; gap: 16px; }
.items.big { gap: 8px; }
.items.big li { padding: 10px 14px; font-size: 1.05rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.player video, .player img, .novideo { width: 100%; max-height: calc(100vh - 140px); border-radius: 9px; background: #000; display: block; }
.player img { object-fit: contain; }
.novideo { aspect-ratio: 16 / 9; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
           color: #D5D5D5; padding: 16px; text-align: center; font-weight: 600; }

/* page heading with its buttons on the right */
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.pagehead h1 { overflow-wrap: anywhere; min-width: 0; }
.actions { display: flex; align-items: center; gap: 8px; }
.result { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; padding: 10px 14px; }
.result ul { margin: 0; padding-left: 18px; color: var(--bad); font-size: .93rem; }

/* your stores */
.stores-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.stores-layout.with-panel { grid-template-columns: minmax(0, 1fr) 380px; }
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.store-tile { background: var(--card); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow);
              padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.store-tile.picked { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.store-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.store-names { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.store-name { font-weight: 700; font-size: 1.15rem; overflow-wrap: anywhere; }
.store-place, .store-count { font-size: .9rem; color: var(--text-3); }
.store-count { min-height: 1.45em; }
.store-tile .btn { margin-top: auto; }
a.company-tile { color: inherit; text-decoration: none; min-height: 104px; }
a.company-tile:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.tile-mark { flex: none; color: var(--accent-text); display: inline-flex; }
.titlerow { display: flex; align-items: center; gap: 6px; min-width: 0; }
.icon-btn.danger:hover, .icon-btn.danger:focus-visible { color: var(--bad); }
dialog.small h2 { overflow-wrap: anywhere; }
.titlerow h1 { overflow-wrap: anywhere; min-width: 0; }
.empty .btn { text-decoration: none; }

/* a few boxes to fill in, in a small window */
.dialog-form { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.dialog-form .field { max-width: none; flex: none; }
.dialog-form .fields { flex-wrap: nowrap; }
.dialog-form .fields .field { flex: 2 1 0; }
.dialog-form .fields .field.small { flex: 1 1 0; }
.dialog-form .dialog-actions { margin-top: 6px; }
dialog.small:has(.fields) { width: min(460px, calc(100vw - 24px)); }
.info-panel { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 12px; min-width: 0; }
.info-panel:focus { outline: none; }
.info-panel:focus-visible { outline: 3px solid var(--accent-line); outline-offset: 1px; }
.info-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.info-head > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.info-head h2 { font-size: 1.3rem; overflow-wrap: anywhere; }
.info-block { display: flex; flex-direction: column; gap: 4px; }
.info-block .what { font-size: .82rem; font-weight: 600; color: var(--text-3); }
.info-alerts { margin: 0; padding-left: 18px; color: var(--warn); font-weight: 600; font-size: .93rem; }
.printer { display: flex; justify-content: space-between; align-items: center; gap: 6px 12px; flex-wrap: wrap;
           background: var(--band); border: 1px solid var(--line); border-radius: 9px; padding: 10px 14px; }
.printer .what { font-size: .82rem; font-weight: 600; color: var(--text-3); }
.printer .value { font-family: var(--mono); font-weight: 700; font-size: 1.2rem; }
.printer .value.unset { font-family: var(--sans); font-weight: 600; font-size: 1rem; color: var(--text-3); }
.pair { display: flex; gap: 8px; }
.pair > * { flex: 1 1 0; }

/* tickets: one row of search and the two drop-downs */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar select { flex: 0 1 auto; min-width: 150px; max-width: 220px; font-weight: 600; }
.toolbar input[type="date"] { flex: 0 1 170px; font-weight: 600; }
.find { position: relative; display: flex; align-items: center; min-width: 0; flex: 999 1 240px; }
.find svg { position: absolute; left: 12px; color: var(--text-3); pointer-events: none; }
.find input { width: 100%; padding-left: 38px; }
.ticket-list { display: flex; flex-direction: column; gap: 8px; }
.ticket { background: var(--card); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow);
          padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; }
.ticket-row { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; }
.photo { flex: none; width: 96px; height: 64px; min-height: 0; padding: 0; border-radius: 9px; overflow: hidden;
         border: 1px solid var(--line); background: var(--band); display: flex; flex-direction: column; align-items: center;
         justify-content: center; gap: 2px; color: var(--text-3); font-size: .75rem; font-weight: 500; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo.none { border-style: dashed; border-color: var(--line-strong); cursor: default; }
.ticket-main { flex: 1 1 160px; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ticket-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ticket-num { font-weight: 700; font-size: 1.1rem; }
.ticket-sub { font-size: .9rem; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; margin-left: auto; }
.fetching { width: 210px; display: flex; flex-direction: column; gap: 6px; font-size: .9rem; font-weight: 600; }
.progress { position: relative; height: 8px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.progress i { position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; border-radius: 999px; background: var(--accent);
              animation: progress-slide 1.4s ease-in-out infinite; }
@keyframes progress-slide { to { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .progress i { animation: none; left: 0; width: 45%; } }
.ticket-note { font-size: .9rem; font-weight: 600; }
.ticket-details { border-top: 1px solid var(--line-soft); padding-top: 10px; display: grid;
                  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.more { display: flex; justify-content: center; margin-top: 4px; }

/* store settings, alerts: one column of cards, all the same width */
.column { display: flex; flex-direction: column; gap: 14px; max-width: 720px; }
.column .card { display: flex; flex-direction: column; gap: 12px; }
.column .card > select { align-self: flex-start; min-width: min(280px, 100%); font-weight: 600; }
.column .checks.plain { border-top: 0; padding-top: 0; }
.column .savebar { margin-top: 0; }
a.email-row { color: inherit; text-decoration: none; padding-right: 12px; }
a.email-row:hover { border-color: var(--accent); }

/* how full: the cloud, a BagCam's disk */
.meter { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; min-width: 0; }
.meter-bar { flex: 1 1 200px; height: 12px; border-radius: 999px; background: var(--band); border: 1px solid var(--line);
             overflow: hidden; }
.meter-bar i { display: block; height: 100%; min-width: 4px; border-radius: 999px; background: var(--accent); }
.meter-bar.warn i { background: var(--warn); }
.meter-bar.bad i { background: var(--bad); }
.meter-text { font-weight: 600; }
.meter.small .meter-bar { height: 8px; flex-basis: 120px; }
.meter.small .meter-text { font-size: .9rem; color: var(--text-2); }
.meter-card { margin-bottom: 12px; }
a.meter-link { display: block; max-width: 520px; margin-bottom: 12px; color: inherit; text-decoration: none; }

/* storage: the clips that are in the cloud */
.toolbar .check { margin-left: auto; font-weight: 600; }
.bulkbar { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; margin-bottom: 10px; }
.bulkbar .check { font-weight: 600; }
.bulkbar .summary { font-weight: 600; color: var(--text-2); }
.bulkbar .actions { margin-left: auto; flex-wrap: wrap; }
button.danger { color: var(--bad); border-color: var(--bad-line); }
.clip-list { display: flex; flex-direction: column; gap: 8px; }
.clip-rows { padding: 0; overflow: hidden; }
.clip-row { display: grid; grid-template-columns: 18px minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) 76px 86px;
            align-items: center; gap: 4px 12px; padding: 9px 14px; border-top: 1px solid var(--line-soft); cursor: pointer; }
.clip-row:first-child { border-top: 0; }
.clip-row:has(input:checked) { background: var(--accent-soft); }
.clip-who { display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; min-width: 0; }
.clip-name { font-weight: 700; overflow-wrap: anywhere; }
.clip-order, .clip-store, .clip-when { color: var(--text-2); font-size: .93rem; }
.clip-store, .clip-when { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clip-size { font-weight: 600; font-size: .93rem; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.clip-state { text-align: right; }
.badge.kept { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }

.fields { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 150px; min-width: 0; max-width: 280px; }
.field label { font-size: .87rem; font-weight: 600; color: var(--text-2); }
.field input { width: 100%; font-size: 1.05rem; }
.field input.bad, input.bad { border-color: var(--bad); }
.error { font-size: .87rem; font-weight: 600; color: var(--bad); }
.emails { display: flex; flex-direction: column; gap: 6px; }
.email-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: var(--ctl);
             background: var(--band); border: 1px solid var(--line-soft); border-radius: 9px; padding-left: 12px; }
.email-row span { min-width: 0; overflow-wrap: anywhere; }
.add-email { display: flex; gap: 8px; }
.add-email input { flex: 1 1 auto; }
.checks { display: flex; flex-direction: column; border-top: 1px solid var(--line-soft); padding-top: 10px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 36px; cursor: pointer; }
.linked { display: flex; align-items: center; justify-content: space-between; gap: 10px 12px; flex-wrap: wrap; }
.savebar { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 14px; }

/* the store's BagCam above its orders: live picture on the left, address and health on the right */
.store-panel { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 14px; }
@media (max-width: 860px) { .store-panel { grid-template-columns: 1fr; } }
.live-box { position: relative; aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; padding: 12px;
            border-radius: 9px; overflow: hidden; background: var(--band); border: 1px dashed var(--line-strong);
            color: var(--text-3); font-weight: 600; text-align: center; }
.live-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.store-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.store-facts .tile { background: var(--band); border: 1px solid var(--line-soft); border-radius: 9px; padding: 9px 12px;
                     display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.store-facts .tile > span:first-child { font-size: .78rem; color: var(--text-3); }
.store-facts .tile > span:last-child { font-weight: 600; overflow-wrap: anywhere; }

/* a number box with its unit beside it (Clip length ... minutes) */
.with-unit { display: flex; align-items: center; gap: 10px; }
.with-unit input { flex: 0 1 140px; min-width: 0; font-family: var(--mono); font-weight: 700; }
.with-unit .unit { font-weight: 600; color: var(--text-2); }

/* people: who else can sign in, and the window that adds one */
.people-list { display: flex; flex-direction: column; gap: 8px; }
.person-row { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; background: var(--card);
              border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); padding: 12px 14px; }
.person-main { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.person-email { font-weight: 700; font-size: 1.05rem; overflow-wrap: anywhere; }
.person-sees { font-size: .9rem; color: var(--text-3); overflow-wrap: anywhere; }
.person-row .actions { margin-left: auto; }
dialog.small.person { width: min(520px, calc(100vw - 24px)); }
.dialog-form select { width: 100%; font-weight: 600; }
.picker { display: flex; flex-direction: column; gap: 8px; }
.picker .find { flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding: 2px 3px 2px 10px; border-radius: 999px;
        font-size: .9rem; font-weight: 600; background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent-text); }
.chip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip button { flex: none; width: 24px; height: 24px; min-height: 0; padding: 0; border: 0; border-radius: 50%;
               background: transparent; color: inherit; }
.picker-list { display: flex; flex-direction: column; max-height: 236px; overflow: auto; border: 1px solid var(--line);
               border-radius: 9px; background: var(--band); }
.picker-list button { flex: none; justify-content: flex-start; flex-wrap: wrap; gap: 2px 10px; min-height: var(--ctl); padding: 6px 12px;
                      border: 0; border-top: 1px solid var(--line-soft); border-radius: 0; background: transparent;
                      text-align: left; white-space: normal; }
.picker-list button:first-child { border-top: 0; }
.picker-list button:hover, .picker-list button.top { background: var(--accent-soft); }
.picker-list button:focus-visible { outline-offset: -3px; }
.picker-list .sub { font-weight: 500; font-size: .87rem; color: var(--text-3); }
.picker-list .none { padding: 10px 12px; font-weight: 600; color: var(--text-3); }

/* start page, restaurant page, account page */
.hero { padding: 28px 0 22px; }
.hero h1 { font-size: 2.3rem; line-height: 1.1; letter-spacing: -.02em; max-width: 720px; }
.doors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.door { display: flex; flex-direction: column; gap: 18px; padding: 22px; }
.door-head { display: flex; align-items: center; gap: 12px; }
.door-head h2 { font-size: 1.4rem; }
.door-icon { flex: none; width: 44px; height: 44px; border-radius: 9px; background: var(--accent-soft);
             border: 1px solid var(--accent-line); color: var(--accent-text); display: flex; align-items: center; justify-content: center; }
.below { display: flex; justify-content: center; margin-top: 18px; }
.setup { max-width: 560px; margin: 4vh auto 0; display: flex; flex-direction: column; gap: 16px; padding: 22px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.steps li { display: flex; align-items: center; gap: 12px; background: var(--band); border: 1px solid var(--line-soft);
            border-radius: 9px; padding: 10px 14px; font-weight: 600; }
.steps .n { flex: none; font-family: var(--mono); font-weight: 700; color: var(--accent-text); }
.steps li.tall { align-items: flex-start; }
.step-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1; }
.command { display: flex; align-items: stretch; gap: 8px; }
.command code { flex: 1; min-width: 0; font-family: var(--mono); font-size: .86rem; font-weight: 500; line-height: 1.45;
                background: var(--field); border: 1px solid var(--field-line); border-radius: 6px; padding: 8px 10px;
                overflow-wrap: anywhere; user-select: all; cursor: text; }
.command button { flex: none; align-self: flex-start; }
.setup-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.setup > .btn { align-self: flex-start; }
.setup { max-width: 640px; }
.account { max-width: 380px; margin: 6vh auto 0; display: flex; flex-direction: column; gap: 14px; padding: 22px; }
.account form { display: flex; flex-direction: column; gap: 12px; }
.account .field { max-width: none; flex: none; }
.account .links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.linklike { min-height: 32px; padding: 0; border: 0; background: none; color: var(--accent-text); font-weight: 600; cursor: pointer; }
.say { font-weight: 600; }
.say.bad { color: var(--bad); }
.say.good { color: var(--ok); }

@media (max-width: 900px) {
  .stores-layout.with-panel { grid-template-columns: minmax(0, 1fr); }
  .info-panel { order: -1; position: static; }
}
@media (max-width: 820px) {
  .field { max-width: none; }
  .clip-row { grid-template-columns: 18px minmax(0, 1fr) auto; }
  .clip-row .clip-store, .clip-row .clip-when { grid-column: 2; }
  .clip-row .clip-size { grid-column: 3; grid-row: 2; }
  .clip-row .clip-state { grid-column: 3; grid-row: 1; }
  .toolbar .check { margin-left: 0; flex: 1 1 100%; }
  .bulkbar .actions { margin-left: 0; flex: 1 1 100%; }
}
@media (max-width: 760px) {
  .ticket-details { grid-template-columns: minmax(0, 1fr); }
  .ticket-actions { flex: 1 1 100%; margin-left: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fetching { width: auto; }
  .doors { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { font-size: 1.8rem; }
}
@media (max-width: 560px) {
  .bar { padding: 8px 12px; flex-wrap: wrap; }
  main { padding: 12px 12px 24px; }
  .bar .store { display: none; }
  .app .brand span { display: none; }
  /* a phone's top bar: Back and Home, then Storage, Alerts and Sign out, on one row where they fit */
  .app .brand, .app .bar .pill { display: none; }
  .app .bar { gap: 8px; }
  .app .bar .group { gap: 6px; }
  .app .bar .btn, .app .bar button:not(.icon-btn) { padding: 0 8px; font-size: .93rem; }
  .pagehead .actions { flex: 1 1 100%; flex-wrap: wrap; }
  .pagehead .actions > * { flex: 1 1 auto; padding: 0 10px; }
  .toolbar select { flex: 1 1 130px; max-width: none; min-width: 0; }
  .toolbar input[type="date"] { flex: 1 1 100%; }
}
