:root {
  --bg: #eef2f1;
  --panel: #ffffff;
  --sunken: #e3e9e7;
  --ink: #182629;
  --muted: #536367;
  --line: #cfd9d6;
  --accent: #0c5f63;
  --on-accent: #ffffff;
  --accent-soft: #d9eeec;
  --low: #8a4600;
  --low-bg: #fff1dc;
  --bad: #a3211b;
  --on-bad: #ffffff;
  --good: #17663a;
  --to-pick: #6b3fa0;
  --picked: #2459a8;
  --packed: #805300;
  --shipped: #17663a;
  --cancelled: #8b3a3a;
  --bar: #2a78d6; /* passes the color checks on --panel */
  --shadow: 0 1px 2px rgb(16 40 44 / .12);
  --lift: 0 14px 34px rgb(16 40 44 / .28);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10171a;
    --panel: #1b2629;
    --sunken: #151e21;
    --ink: #e6eeec;
    --muted: #a0b1b1;
    --line: #334347;
    --accent: #6cc5c1;
    --on-accent: #0c2022;
    --accent-soft: #1d3c3e;
    --low: #ffc777;
    --low-bg: #3a2b13;
    --bad: #ff9a92;
    --on-bad: #2b0d0b;
    --good: #7fd6a2;
    --to-pick: #c5a6f5;
    --picked: #8ab8f5;
    --packed: #f0c168;
    --shipped: #7fd6a2;
    --cancelled: #eba0a0;
    --bar: #3987e5;
    --shadow: 0 1px 2px rgb(0 0 0 / .4);
    --lift: 0 14px 34px rgb(0 0 0 / .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 system-ui, sans-serif; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.25rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

button, input, select {
  font: inherit; color: inherit; background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px; padding: .5rem .8rem; max-width: 100%;
}
button { cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: .6; cursor: wait; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
button.primary.danger { background: var(--bad); border-color: var(--bad); color: var(--on-bad); }
button.link { background: none; border: 0; color: var(--muted); text-decoration: underline; font-size: .875rem; }
button.small { padding: .3rem .65rem; font-size: .875rem; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* -------------------------------------------------------------- header */
.top {
  display: flex; flex-wrap: wrap; gap: .6rem 1.5rem; align-items: center;
  padding: .7rem 1.25rem; background: var(--panel); border-bottom: 1px solid var(--line);
}
nav { display: flex; gap: .15rem; padding: .2rem; background: var(--sunken); border-radius: 10px; }
nav button { border-color: transparent; background: none; padding: .4rem .8rem; color: var(--muted); }
nav button[aria-current] { background: var(--panel); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.badge, .count {
  position: relative; display: inline-block; min-width: 1.4rem; padding: 0 .4rem; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent); font-size: .8125rem; font-weight: 600; text-align: center;
}
.badge.warn { background: var(--low-bg); color: var(--low); }
.account { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-left: auto; }
#sync { color: var(--muted); font-size: .875rem; }

main { max-width: 1800px; margin: 0 auto; padding: .9rem 1.25rem; }
.tools { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-bottom: .7rem; }
.tools input[type="search"] { width: 290px; }
.tools .spacer { flex: 1; }
#search-status:empty { position: absolute; }
.check { display: flex; gap: .4rem; align-items: center; }
.muted, .note { color: var(--muted); font-size: .875rem; }

/* -------------------------------------------------------------- tables */
.scroll { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: .7rem 1rem; text-align: left; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--bg); }
tbody tr.low, tbody tr.low:hover { background: var(--low-bg); }
th { color: var(--muted); font-size: .875rem; font-weight: 600; white-space: nowrap; }
.num { text-align: right; white-space: nowrap; }
td.num { font-weight: 650; }
td.reserved { color: var(--muted); font-weight: 400; }
.sku { white-space: nowrap; color: var(--muted); }
.tag { color: var(--low); font-size: .8125rem; font-weight: 600; white-space: nowrap; }
.plus { color: var(--good); }
.minus { color: var(--bad); }
td .inline { display: flex; flex-wrap: wrap; gap: .4rem; }

/* -------------------------------------------------------------- SKU colors */
/* The text color is fixed for each tone, so it stays readable in light and dark mode. */
.tone-0 { --sku-bg: oklch(.89 .09 var(--hue)); --sku-ink: #10181a; }
.tone-1 { --sku-bg: oklch(.75 .14 var(--hue)); --sku-ink: #10181a; }
.tone-2 { --sku-bg: oklch(.43 .13 var(--hue)); --sku-ink: #ffffff; }
.sku-chip {
  display: inline-block; flex: none; padding: .1rem .5rem; border: 1px solid var(--line); border-radius: 6px;
  background: var(--sku-bg); color: var(--sku-ink);
  font-size: .8125rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.sku-row td:first-child { box-shadow: inset 7px 0 var(--sku-bg); padding-left: 1.3rem; }

/* -------------------------------------------------------------- picker */
#picker-totals { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin-bottom: .8rem; }
#picker-totals:empty { display: none; }
.sku-total { display: inline-flex; gap: .4rem; align-items: center; min-height: 32px; padding: .15rem .5rem .15rem .2rem; font-size: .875rem; text-align: left; overflow-wrap: anywhere; }
.sku-total b { white-space: nowrap; }
#picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: .75rem; align-items: start; }
#picker .empty { grid-column: 1 / -1; }
#picker + p { margin-top: .75rem; }
.pick-card { min-width: 0; padding: .75rem; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow-wrap: anywhere; }
.pick-card > header { display: flex; gap: .75rem; align-items: baseline; justify-content: space-between; }
.pick-card > header h3 { min-width: 0; font-size: 1.1rem; }
.pick-card > header .count { flex: none; background: var(--accent-soft); color: var(--accent); }
.pick-order { margin-top: .6rem; padding-top: .6rem; border-top: 1px solid var(--line); }
.pick-head { display: flex; flex-wrap: wrap; gap: .1rem .6rem; align-items: baseline; font-size: .875rem; font-variant-numeric: tabular-nums; }
.pick-head .station { margin-left: auto; }
.pick-items { margin: .4rem 0 0; padding: 0; list-style: none; }
.pick-items li {
  display: flex; gap: .5rem; align-items: center; margin-top: .25rem; padding: .3rem .5rem;
  border-left: 7px solid var(--sku-bg); border-radius: 6px;
  background: color-mix(in oklab, var(--sku-bg) 16%, var(--panel));
}
.pick-name { flex: 1; min-width: 0; }
.pick-qty { flex: none; font-size: 1.1rem; }
.pick-items .muted { flex: none; max-width: 25%; color: var(--ink); }
button.done {
  flex: none; min-height: 40px; padding: .3rem 1rem;
  background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 650;
}
.pick-head button.done {
  min-height: 34px; padding: .15rem .8rem;
  background: var(--accent-soft); border-color: transparent; color: var(--accent);
}
.pick-card > header { flex-wrap: wrap; align-items: center; }
.pick-card > header h3 { flex: 1 1 8rem; }
.pick-head { align-items: center; }
/* Long lists scroll by themselves, so the buttons always stay on screen. */
#done-dialog [data-orders] { max-height: 50dvh; overflow-y: auto; }
#done-dialog .actions button { min-height: 44px; }
#done-dialog .pick-head strong, #done-dialog .pick-head span { overflow-wrap: anywhere; }
.pick-card.flash { animation: flash 2.5s ease-out; }

#order-items { margin-inline: 0; padding: .6rem .75rem .75rem; border: 1px solid var(--line); border-radius: 10px; }
#order-items legend { padding: 0 .3rem; font-weight: 600; font-size: .9375rem; }
dialog .item-edit {
  display: flex; gap: .5rem; align-items: center; margin-top: .35rem; padding-left: .5rem;
  border-left: 7px solid var(--sku-bg); font-weight: 400; overflow-wrap: anywhere;
}
dialog .item-edit input { flex: none; width: 6rem; margin: 0; }
#order-items .note { margin-top: .6rem; }
dialog fieldset { min-width: 0; }
.order-line { display: flex; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.order-line select { flex: 1; min-width: 0; }
.order-line input { flex: none; width: 5rem; }
.order-line button { flex: none; min-width: 44px; min-height: 44px; }
.workers { color: var(--muted); font-size: .8125rem; overflow-wrap: anywhere; }

/* -------------------------------------------------------------- board */
[data-status="to_pick"] { --step: var(--to-pick); }
[data-status="picked"] { --step: var(--picked); }
[data-status="packed"] { --step: var(--packed); }
[data-status="shipped"] { --step: var(--shipped); }
[data-status="cancelled"] { --step: var(--cancelled); }

.board {
  display: grid; grid-template-columns: repeat(5, minmax(225px, 1fr)); gap: .7rem;
  overflow-x: auto; padding: 4px 4px .5rem;
}
/* Each column scrolls by itself, so wide screens keep all five in view as drop targets. */
.column {
  display: flex; flex-direction: column; min-width: 0; min-height: 320px; height: calc(100dvh - 168px);
  background: var(--sunken); border-radius: 12px; outline: 2px solid transparent;
}
.column > header { display: flex; gap: .5rem; align-items: center; padding: .5rem .8rem .35rem; }
.column h3 { display: flex; gap: .5rem; align-items: center; }
.column h3::before { content: ""; width: .7rem; height: .7rem; border-radius: 3px; background: var(--step); }
.count { background: var(--panel); color: var(--ink); }
.cards { position: relative; flex: 1; overflow: hidden auto; scrollbar-width: thin; padding: .2rem .5rem .5rem; }
.empty { padding: 1.5rem .5rem; color: var(--muted); font-size: .875rem; text-align: center; }

.card {
  position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: .15rem .5rem .3rem; margin-bottom: .3rem; box-shadow: var(--shadow);
  font-size: .875rem; line-height: 1.3;
}
.card-top { display: flex; gap: .3rem; align-items: center; min-height: 1.65rem; }
.card-top strong, .who > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-top strong { flex: 1; font-size: .9375rem; }
.card.movable { cursor: grab; user-select: none; }
.card.movable:hover { border-color: var(--accent); }
/* touch-action lets a finger drag the handle, while swiping anywhere else still scrolls. */
.handle {
  flex: none; width: 1.15rem; height: 1.65rem; margin-left: -.3rem; padding: .35rem .2rem;
  touch-action: none; -webkit-touch-callout: none; cursor: grab;
  background: radial-gradient(circle, var(--muted) 1.4px, transparent 1.9px) 0 0 / 6px 6px;
  background-clip: content-box; background-origin: content-box;
}
button.mini { flex: none; min-height: 24px; padding: 0 .35rem; border-radius: 6px; font-size: .8125rem; }
button.next { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 600; }
.card-about { display: flex; gap: .5rem; align-items: center; }
.card-about a { flex: none; font-size: .8125rem; color: var(--accent); }
.card-about img { display: block; width: 28px; height: 28px; object-fit: cover; border-radius: 5px; background: var(--bg); }
/* When a card is narrow, the staff name moves to its own line, so the order number
   isn't cut short to make room for it. */
.card p { position: relative; display: flex; gap: 0 .35rem; align-items: baseline; }
.card .who { flex: 1; flex-wrap: wrap; min-width: 0; }
.who .number { flex: none; max-width: 100%; }
.who .orders-count {
  flex: none; padding: 0 .3rem; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent); font-size: .75rem; font-weight: 600;
}
.who .staff { flex: none; max-width: 100%; margin-left: auto; }
.card .times { flex-wrap: wrap; }
.times .by { margin-left: auto; }
.station::before {
  content: ""; display: inline-block; width: .45rem; height: .45rem; margin-right: .2rem;
  border-radius: 2px; background: var(--step);
}
.station { white-space: nowrap; }
.station.live { color: var(--ink); font-weight: 650; }
.number, .staff, .times { color: var(--muted); }
.who { font-size: .8125rem; }
.times { font-size: .75rem; font-variant-numeric: tabular-nums; }
.avatar {
  display: inline-grid; place-items: center; flex: none; width: 1.55rem; height: 1.55rem; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-size: .6875rem; font-weight: 700;
}

.card.pending { border: 1px dashed var(--accent); outline: 1px dashed var(--accent); }
.pending-note { flex: none; color: var(--accent); font-size: .8125rem; font-weight: 600; }
.card.flash { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: var(--accent-soft); border-color: var(--accent); } }

/* -------------------------------------------------------------- overview and customers */
#overview h2 { margin: 1.25rem 0 .5rem; font-size: 1.05rem; }
.tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: .6rem; }
.tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: .05rem; padding: .7rem .9rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; text-align: left;
}
.tile-label { color: var(--muted); font-size: .875rem; font-weight: 600; }
.tile-value { font-size: 1.75rem; font-weight: 650; line-height: 1.2; }
.tile .muted { font-size: .8125rem; }
.tile.warn { background: var(--low-bg); }
.tile.warn .tile-label { color: var(--low); }

.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(330px, 100%), 1fr)); gap: .75rem; align-items: start; }
.panel { min-width: 0; padding: .8rem .6rem .6rem; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.panel > header { padding: 0 .5rem .4rem; }
.bar-row, .list-row {
  position: relative; display: flex; gap: .75rem; align-items: center; width: 100%; min-height: 36px;
  padding: .25rem .5rem; border-color: transparent; background: none; text-align: left;
}
.bar-row:hover, .list-row:hover { background: var(--bg); }
.bar-label { flex: 0 0 36%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9375rem; }
.bar-plot { flex: 1; display: flex; gap: .4rem; align-items: center; min-width: 0; min-height: 22px; border-left: 1px solid var(--line); }
.bar { flex: none; width: calc((100% - 4rem) * var(--ratio)); min-width: 2px; height: 14px; border-radius: 0 4px 4px 0; background: var(--bar); }
.bar-row:hover .bar { filter: brightness(1.12); }
.bar-value, .list-value { font-size: .9375rem; font-weight: 600; font-variant-numeric: tabular-nums; }
/* The tooltip adds detail. The main value is always written beside the bar. */
.bar-row:is(:hover, :focus-visible)::after {
  content: attr(data-tip); position: absolute; z-index: 5; right: .5rem; bottom: calc(100% - 2px);
  max-width: calc(100% - 1rem); padding: .3rem .6rem; border-radius: 8px; pointer-events: none;
  background: var(--ink); color: var(--panel); font-size: .8125rem; font-weight: 600;
}
.list-text { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.list-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.list-text .muted { font-size: .8125rem; overflow-wrap: anywhere; }
.list-value { flex: none; }

#customer-filter { display: inline-flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-weight: 600; overflow-wrap: anywhere; }
#customers { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr)); gap: .5rem; }
#customers .empty { grid-column: 1 / -1; }
#customers + p { margin-top: .75rem; }
.customer-card { display: flex; gap: .7rem; align-items: center; padding: .55rem .75rem; border-radius: 10px; text-align: left; }
.customer-total { display: flex; flex: none; flex-direction: column; align-items: center; line-height: 1.15; }
.customer-total b { font-size: 1.4rem; }
.customer-total .muted { font-size: .75rem; }

/* -------------------------------------------------------------- dragging */
.is-dragging, .is-dragging * { cursor: grabbing !important; user-select: none; }
.is-dragging .board { scroll-snap-type: none; }
.card.lifted { opacity: .35; border-style: dashed; box-shadow: none; }
.card.ghost {
  position: fixed; z-index: 30; margin: 0; pointer-events: none; opacity: .94;
  border-color: var(--accent); box-shadow: var(--lift);
}
.card.ghost.over-dock { opacity: .25; }
.card.ghost.returning { transition: transform .18s ease-out, opacity .18s; opacity: .4; }
.drag-label {
  position: fixed; z-index: 31; top: 0; left: 0; max-width: calc(100vw - 16px); padding: .35rem .85rem;
  border-radius: 99px; background: var(--accent); color: var(--on-accent); box-shadow: var(--lift);
  font-size: .9375rem; font-weight: 600; pointer-events: none;
}
.drag-label.danger { background: var(--bad); color: var(--on-bad); }
.column.drop-ok { outline: 2px dashed var(--step); }
.column.drop-same { opacity: .6; }
.column.drop-over { outline: 3px solid var(--step); background: color-mix(in srgb, var(--step) 16%, var(--sunken)); }

.chip {
  display: inline-flex; gap: .45rem; align-items: center; padding: .4rem .8rem; border-radius: 10px;
  background: var(--panel); border: 2px solid var(--line); font-weight: 600; overflow-wrap: anywhere;
}
.chip[data-status] { border-color: var(--step); color: var(--step); }
#drag-dock {
  position: fixed; z-index: 20; left: 50%; bottom: 12px; transform: translateX(-50%);
  width: max-content; max-width: min(1100px, calc(100vw - 24px)); max-height: 45dvh; overflow-y: auto;
  padding: .8rem 1rem; background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--lift);
}
.dock-group { display: flex; gap: .75rem; align-items: center; }
.dock-group > .muted { flex: none; }
.dock-group > div { display: flex; flex-wrap: wrap; gap: .5rem; }
.dock-steps { display: none; }
#drag-dock .chip { min-height: 46px; }
#drag-dock .drop-same { opacity: .4; }
#drag-dock .drop-over { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
#drag-dock .drop-over[data-status] { background: var(--step); border-color: var(--step); color: var(--panel); }

/* -------------------------------------------------------------- dialogs */
dialog {
  width: min(480px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 14px;
  background: var(--panel); color: var(--ink); padding: 1.4rem; box-shadow: var(--lift);
}
dialog::backdrop { background: rgb(8 24 27 / .5); }
dialog > * + *, form > * + *, [data-new-item] > * + *, [data-order-fields] > * + *,
[data-password-login] > * + * { margin-top: .9rem; }
td form > * + * { margin-top: 0; }
dialog label { display: block; font-weight: 600; font-size: .9375rem; }
dialog label input, dialog label select { display: block; width: 100%; margin-top: .25rem; font-weight: 400; }
dialog label.check { display: flex; min-height: 44px; font-weight: 400; }
dialog label.check input { display: inline-block; width: 20px; height: 20px; margin: 0; }
#staff-rows .email { overflow-wrap: anywhere; }
#staff-rows .reset { margin-left: .5rem; }
dialog ul:empty, [data-move]:empty { display: none; }
[data-move] { position: relative; padding: 1rem; background: var(--bg); border-radius: 10px; text-align: center; }
[data-move] p + p { margin-top: .6rem; }
.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
.error { color: var(--bad); font-weight: 600; }
.error:empty { display: none; }

#toasts { position: fixed; right: 16px; bottom: 16px; width: min(400px, calc(100vw - 32px)); z-index: 10; }
.toast {
  display: flex; gap: .75rem; align-items: center; justify-content: space-between; margin-top: .5rem;
  padding: .8rem; background: var(--panel); border: 1px solid var(--line);
  border-left: 5px solid var(--good); border-radius: 10px; box-shadow: var(--lift);
}
.toast.bad { border-left-color: var(--bad); }

/* -------------------------------------------------------------- small screens */
@media (max-width: 1230px) {
  .board { grid-template-columns: repeat(5, 260px); scroll-snap-type: x proximity; }
  .column { scroll-snap-align: start; }
  /* Some columns are off screen here, so the dock offers the steps too. */
  .dock-steps { display: flex; margin-bottom: .7rem; }
}
@media (max-width: 950px) {
  .tiles { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .top { padding: .7rem 1rem; }
  .account { margin-left: 0; }
  /* The tabs don't all fit, so the tab bar scrolls sideways by itself. */
  nav { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
  nav button { flex: 1 0 auto; padding: .5rem .55rem; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .tile { padding: .6rem .7rem; }
  .tile-value { font-size: 1.4rem; }
  .bar-row, .list-row { min-height: 44px; }
  main { padding: 1rem; }
  .tools input[type="search"] { width: 100%; }
  .board { grid-template-columns: repeat(5, 82vw); }
  .column { height: calc(100dvh - 260px); }
  #drag-dock { width: calc(100vw - 24px); max-height: 55dvh; padding: .6rem .7rem; }
  #drag-dock .chip { min-height: 44px; padding: .2rem .55rem; font-size: .875rem; }
  .dock-group > div { gap: .35rem; }
  .dock-group { display: block; }
  .dock-group > div { margin-top: .3rem; }
  button.small { min-height: 44px; }

  /* Table rows become cards, so nothing is hidden off to the side. */
  .scroll { background: none; border: 0; overflow: visible; }
  table, tbody { display: block; }
  thead { display: none; }
  tbody tr {
    display: grid; grid-template-columns: 1fr 1fr; gap: .1rem 1rem; margin-bottom: .45rem; padding: .5rem .75rem;
    background: var(--panel); border: 1px solid var(--line); border-radius: 10px; font-size: .875rem;
  }
  tbody tr.sku-row { border-left: 7px solid var(--sku-bg); }
  .sku-row td:first-child { box-shadow: none; padding-left: 0; }
  /* One row that swipes sideways, so the cards stay near the top. */
  #picker-totals { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .3rem; }
  #picker-totals > * { flex: none; max-width: 80vw; }
  .sku-total { min-height: 44px; }
  td { display: block; min-width: 0; padding: 0; border: 0; white-space: normal; overflow-wrap: anywhere; }
  td:empty { display: none; }
  td.num { text-align: left; }
  td[data-label="Item"] { order: -1; grid-column: 1 / -1; font-size: 1rem; font-weight: 600; }
  td[colspan], td[data-label=""] { grid-column: 1 / -1; }
  td[data-label]:not([data-label=""], [data-label="Item"])::before {
    content: attr(data-label) ": "; color: var(--muted); font-weight: 400;
  }
}

/* Bigger buttons and handles for fingers. */
@media (pointer: coarse) {
  .actions button, .tools button { min-height: 2.75rem; }
  button.done, .pick-head button.done { min-height: 2.75rem; }
  .card-top { min-height: 2.75rem; }
  .handle { width: 2.75rem; height: 2.75rem; margin-left: -.5rem; padding: .8rem 1rem; }
  button.mini { min-width: 2.75rem; min-height: 2.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
