/* Colors come from /theme.css (themes.py): the shop's scheme, light or dark. */
:root { --radius: 14px; --tap: 44px; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.4rem; margin: .2rem 0 .5rem; line-height: 1.2; }
h2 { font-size: 1.1rem; margin: 0 0 .6rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
code { background: var(--brand-soft); padding: 0 .3em; border-radius: 4px; }
small { display: block; color: var(--muted); font-size: .8rem; font-weight: 400; }

.top { position: sticky; top: 0; z-index: 5; background: var(--card); border-bottom: 1px solid var(--line); }
.bar { display: flex; gap: .75rem; align-items: center; padding: .6rem 1rem; padding-top: max(.6rem, env(safe-area-inset-top)); }
.brand { font-weight: 800; color: var(--ink); white-space: nowrap; font-size: 1.05rem; }
.brand span, .amp { color: var(--brand); }
.go { flex: 1; }
.go input { width: 100%; }
.tabs { display: flex; gap: .25rem; overflow-x: auto; padding: 0 .75rem .5rem; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: .45rem .7rem; border-radius: 999px; color: var(--muted); white-space: nowrap; font-weight: 600; font-size: .92rem; }
.tabs a.on { background: var(--brand-soft); color: var(--brand); }
/* Sign out sits at the far right of the tabs; its right edge lines up with the ? button (bar padding 1rem). */
.tabs .signout { margin: 0 .25rem 0 auto; padding-left: .5rem; flex: 0 0 auto; display: flex; align-items: center; }
.tabs .signout button { padding: .45rem .8rem; min-height: 0; border-radius: 999px; font-size: .92rem; font-weight: 600;
  white-space: nowrap; background: var(--card); color: var(--brand); border: 1px solid var(--line); }
.badge { background: var(--urgent); color: #fff; border-radius: 999px; padding: 0 .45em; font-size: .75rem; }

main { max-width: 980px; margin: 0 auto; padding: .75rem .75rem 2rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: .75rem; }
.card.urgent { border-color: var(--urgent); box-shadow: 0 0 0 3px var(--urgent-soft); }
.head-row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.muted { color: var(--muted); }
.help { background: var(--brand-soft); border-radius: 10px; padding: .6rem .8rem; }
.kind { text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; color: var(--muted); font-weight: 700; margin: 0; }
.sku-big { font: 800 1.5rem/1.1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .02em; margin: 0; }
.looks { font-size: 1.05rem; font-weight: 600; margin: .1rem 0 .4rem; }

input, select, textarea, button, .button {
  font: inherit; color: inherit; min-height: var(--tap); border-radius: 10px;
}
input, select, textarea {
  background: var(--bg); border: 1px solid var(--line); padding: .55rem .7rem; width: 100%;
}
/* Safari keeps native selects short; draw them like the text fields, with our own arrow. */
select { -webkit-appearance: none; appearance: none; padding-right: 2rem; background-repeat: no-repeat;
  background-position: right .7rem center; background-size: .7rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23888' stroke-width='2'/%3E%3C/svg%3E"); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: .3rem;
  background: var(--card); border: 1px solid var(--line); padding: .5rem 1rem; cursor: pointer;
  font-weight: 600; text-decoration: none; color: var(--ink);
}
button:hover, .button:hover { border-color: var(--brand); text-decoration: none; }
.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.primary:hover { filter: brightness(1.08); }
.wide { width: 100%; }
button.link { background: none; border: 0; color: var(--brand); padding: 0; min-height: 0; font-weight: 600; }
label { display: block; font-weight: 600; font-size: .9rem; }
label input, label select, label textarea { margin-top: .25rem; font-weight: 400; }
label.check { display: inline-flex; gap: .4rem; align-items: center; font-weight: 500; }
label.check input { width: auto; min-height: 0; margin: 0; }
fieldset { border: 1px solid var(--line); border-radius: 10px; }
.stack > * + * { margin-top: .75rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.inline, .filters { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0; }
.inline > input, .filters > input { flex: 1 1 10rem; width: auto; }
.inline > select, .filters > select { flex: 0 1 11rem; width: auto; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
details summary { cursor: pointer; color: var(--muted); margin: .75rem 0 .5rem; }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chips form { margin: 0; }
.chip { border-radius: 999px; padding: .4rem .9rem; min-height: 40px; font-size: .92rem; background: var(--card); border: 1px solid var(--line); color: var(--ink); display: inline-flex; align-items: center; }
.chip.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.kinds { margin-bottom: .75rem; }
.pill { display: inline-block; background: var(--brand-soft); color: var(--brand); border-radius: 999px; padding: .05rem .6rem; font-size: .8rem; font-weight: 700; }
.pill.big { font-size: 1rem; padding: .2rem .8rem; }
.pill.lilac { background: var(--lilac-soft); color: var(--lilac); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }

.status { display: inline-block; border-radius: 999px; padding: .1rem .6rem; font-size: .8rem; font-weight: 700; background: var(--line); }
.s-listed, .s-processed { background: var(--green-soft); color: var(--green); }
.s-sold { background: var(--pink-soft); color: var(--pink); }
.s-in-show { background: var(--lilac-soft); color: var(--lilac); }
.s-missing, .s-error { background: var(--urgent-soft); color: var(--urgent); }
.s-review, .s-needs-repair, .s-needs-cleaning, .s-on-hold, .s-pulled { background: var(--warn-soft); color: var(--warn); }
.s-unsaleable { background: var(--urgent-soft); color: var(--urgent); }
[hidden] { display: none !important; }
label.reason { grid-column: 1 / -1; }
.status-reason { margin: .5rem 0; padding: .5rem .75rem; border-radius: 8px; background: var(--warn-soft); }
form.pull { margin-top: 1rem; padding-top: .75rem; border-top: 1px solid var(--line); }

.flash { border-radius: 10px; padding: .7rem .9rem; background: var(--green-soft); color: var(--green); font-weight: 600; }
.flash.error { background: var(--urgent-soft); color: var(--urgent); }
.flash.warn { background: var(--warn-soft); color: var(--warn); }
.error { color: var(--urgent); font-weight: 600; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-bottom: .75rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem; text-align: center; color: var(--ink); }
.stat b { display: block; font-size: 1.35rem; }
.stat span { color: var(--muted); font-size: .85rem; }
.card .stats .stat { background: var(--bg); }

ul.plain { list-style: none; padding: 0; margin: 0 0 .75rem; }
ul.plain li { padding: .35rem 0; }
ul.rows { list-style: none; padding: 0; margin: 0; }
ul.rows li { border-top: 1px solid var(--line); }
ul.rows li:first-child { border-top: 0; }
h2.spaced { margin-top: 1.25rem; }
ul.rows a, ul.rows .row { display: grid; grid-template-columns: 1fr auto auto; gap: .2rem .75rem; padding: .6rem 0; color: var(--ink); align-items: center; }
.row-button { width: 100%; justify-content: flex-start; text-align: left; flex-wrap: wrap; margin: .2rem 0; }
.listings li, .checklist li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; border-top: 1px solid var(--line); padding: .5rem 0; }
.checklist li.done { opacity: .6; }
.task-group { border-top: 1px solid var(--line); padding: .6rem 0; }
.task-group:first-of-type { border-top: 0; }
.task-head { margin: 0 0 .4rem; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.small { font-size: .85rem; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: .75rem 0; }
.pair > div { background: var(--bg); border-radius: 10px; padding: .6rem; display: flex; flex-direction: column; gap: .2rem; }
.pair .pill { align-self: flex-start; }
.item-box { margin: .75rem 0; display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
dl.facts { display: grid; grid-template-columns: auto 1fr; gap: .25rem 1rem; margin: .75rem 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }

table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: .8rem; color: var(--muted); font-weight: 700; padding: .4rem; border-bottom: 1px solid var(--line); }
table.list td { padding: .55rem .4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.money td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.pager { display: flex; gap: 1rem; justify-content: center; margin-top: .75rem; align-items: center; }
.login { max-width: 360px; margin: 15vh auto 0; }

/* Phones: tables become stacked rows, two-column forms become one. */
@media (max-width: 640px) {
  main { padding: .5rem .5rem 2rem; }
  .grid2, .pair { grid-template-columns: 1fr; }
  .kinds { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: .2rem; }
  .kinds .chip { white-space: nowrap; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  table.list thead { display: none; }
  table.list, table.list tbody, table.list tr, table.list td { display: block; width: 100%; }
  table.list tr { border-bottom: 1px solid var(--line); padding: .5rem 0; }
  table.list td { border: 0; padding: .1rem 0; }
  table.list td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: .85rem; }
  table.list td[data-label]:empty { display: none; }  /* a stacked row skips fields with nothing in them */
  table.money td:last-child { text-align: left; }
  ul.rows a, ul.rows .row { grid-template-columns: 1fr auto; }
  ul.rows a > .muted, ul.rows .row > .muted { grid-column: 1; grid-row: 2; font-size: .85rem; }
}

/* Help button in the top bar */
.help-button { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: 1.05rem; }
.help-button:hover { text-decoration: none; filter: brightness(.95); }

/* Coach chat and wishlist threads */
.messages { display: flex; flex-direction: column; gap: .6rem; margin: .5rem 0 1rem; }
.msg { border-radius: 14px; padding: .65rem .85rem; max-width: 92%; overflow-wrap: anywhere; }
.msg.mine { align-self: flex-end; background: var(--brand); color: var(--on-brand); }
.msg.coach { align-self: flex-start; background: var(--bg); border: 1px solid var(--line); }
.msg.coach p { margin: .3rem 0; }
.msg.coach ul, .msg.coach ol { margin: .3rem 0; padding-left: 1.2rem; }
.msg.coach h3, .msg.coach h4, .msg.coach h5 { margin: .6rem 0 .3rem; font-size: 1rem; }
.msg.thinking { color: var(--muted); font-style: italic; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .msg.thinking { animation: none; } }
.msg .used, .msg .who { font-size: .78rem; color: var(--muted); margin: .4rem 0 0; }
.msg .who { margin: 0 0 .2rem; }
.msg.mine .who { color: inherit; opacity: .8; }
.composer textarea { min-height: 3.2rem; }
.starters { margin-top: .75rem; }
.starters .chip { text-align: left; }
.table-wrap { overflow-x: auto; }
table.md { border-collapse: collapse; margin: .4rem 0; font-size: .92rem; overflow-wrap: normal; word-break: normal; }
table.md th, table.md td { border-bottom: 1px solid var(--line); padding: .3rem .5rem; text-align: left; vertical-align: top; }
table.md th { color: var(--muted); font-size: .8rem; }
.draft { border-top: 1px solid var(--line); padding: .6rem 0; }
.draft p { margin: .25rem 0; }
.pre { white-space: pre-wrap; }
.s-wl-new { background: var(--brand-soft); color: var(--brand); }
.s-wl-planned, .s-wl-done { background: var(--green-soft); color: var(--green); }
.s-wl-discussing { background: var(--warn-soft); color: var(--warn); }
.s-tk-new { background: var(--brand-soft); color: var(--brand); }
.s-tk-triaged, .s-tk-in_progress { background: var(--warn-soft); color: var(--warn); }
.s-tk-done { background: var(--green-soft); color: var(--green); }
p.escalated { margin: .75rem 0 0; padding: .5rem .75rem; border-radius: 8px; background: var(--warn-soft); }
.admin-nav { margin-bottom: .75rem; }
.ticket-body { margin: .5rem 0; }
button:disabled { opacity: .5; cursor: default; }

/* Coach memory: note on the left, Forget on the right */
ul.memory li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .6rem 0; }
ul.memory li span { flex: 1; min-width: 0; }

/* Assistant setup: big tappable choices */
.choices { display: grid; gap: .5rem; }
.choice { display: flex; justify-content: flex-start; align-items: center; gap: .6rem; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 10px; font-size: 1.05rem; cursor: pointer; }
.choice input { width: 1.25rem; height: 1.25rem; min-height: 0; margin: 0; padding: 0; flex: none; accent-color: var(--brand); }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.setup h1 { font-size: 1.35rem; }

/* Copy buttons beside every field she pastes into a platform */
button.copy { min-height: 30px; padding: .1rem .6rem; font-size: .78rem; border-radius: 999px; color: var(--brand);
  background: var(--brand-soft); border-color: transparent; vertical-align: middle; margin-left: .25rem;
  transition: background-color .2s ease, color .2s ease; }
button.copy.done { background: var(--green-soft); color: var(--green); }
.sku-big button.copy, h1 button.copy { font-family: inherit; letter-spacing: 0; }
.field-label { font-size: .8rem; font-weight: 700; color: var(--muted); margin: .6rem 0 .1rem; }
.copyable { display: flex; gap: .4rem; align-items: flex-start; justify-content: space-between; margin: 0; }
.copyable .pre, .copyable b { flex: 1; min-width: 0; margin: 0; overflow-wrap: anywhere; }
.actions.tight { margin: 0; }

/* Item photos */
ul.photos { list-style: none; padding: 0; margin: 0 0 .75rem; display: grid; gap: .6rem;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
ul.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; background: var(--bg); }
.photo-actions { display: flex; flex-wrap: wrap; gap: .2rem .6rem; align-items: center; margin-top: .25rem; }
.photo-actions form { margin: 0; }
.dropzone input[type=file] { padding: 1.2rem .7rem; border-style: dashed; border-width: 2px; }
.working { transition: opacity .3s ease; }
@media (max-width: 640px) { ul.photos { grid-template-columns: repeat(3, 1fr); gap: .4rem; } }

/* Color scheme picker in Settings: a mini page in each scheme, light and dark */
.schemes { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.scheme { display: grid; gap: .4rem; padding: .7rem; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 600; }
.scheme:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.scheme .name { display: flex; gap: .5rem; align-items: center; }
.scheme .name input { width: 1.2rem; height: 1.2rem; min-height: 0; margin: 0; accent-color: var(--brand); }
.scheme small { margin: 0; }
.swatches { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; }
.swatch { display: flex; gap: .25rem; align-items: center; padding: .35rem; border: 1px solid; border-radius: 8px; }
.swatch i, .swatch b, .swatch u { font-style: normal; text-decoration: none; font-size: .72rem; font-weight: 700;
  border-radius: 6px; padding: .1rem .35rem; }
.swatch i { flex: 1; }

/* Item pictures in lists (templates/_thumb.html): an empty square when the item has no photos */
.thumb { flex: none; display: inline-block; width: 44px; height: 44px; border-radius: 8px; overflow: hidden;
  background: var(--line); vertical-align: middle; }
.thumb.big { width: 72px; height: 72px; border-radius: 10px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.none { opacity: .6; }
.with-thumb:not(tr) { display: flex; align-items: center; gap: .6rem; }
.task-head .thumb { margin-right: .1rem; }
.row-button .thumb { margin-right: .3rem; }
.pair .thumb { margin-bottom: .3rem; }
table.list td.thumb-col, table.list th.thumb-col { width: 56px; padding-right: 0; }
table.list tr.with-thumb td { vertical-align: middle; }
@media (max-width: 640px) {
  table.list tr.with-thumb { display: grid; grid-template-columns: 44px 1fr; column-gap: .7rem; }
  table.list tr.with-thumb td.thumb-col { grid-row: 1 / span 6; width: auto; padding-top: .2rem; }
  table.list tr.with-thumb td { grid-column: 2; }
  table.list tr.with-thumb td.thumb-col { grid-column: 1; }
}

/* Activity history (item, sale and Activity pages) */
.history { list-style: none; padding: 0; margin: 0; }
.history > li { padding: .6rem 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.history > li:first-child { border-top: 0; }
.history p { margin: .1rem 0; }
.history-head { font-size: .85rem; color: var(--muted); }
.history li.error { border-left: 3px solid var(--urgent); padding-left: .6rem; }
.history li.warning { border-left: 3px solid var(--warn); padding-left: .6rem; }
.changes { margin: .2rem 0 0; padding-left: 1.1rem; font-size: .9rem; }
.changes s { color: var(--muted); }
.pill.error { background: var(--urgent-soft); color: var(--urgent); }
.pill.warning { background: var(--warn-soft); color: var(--warn); }
.filters .datef { display: flex; align-items: center; gap: .35rem; font-size: .9rem; color: var(--muted); }
.filters .datef input { width: auto; }
.bulk-link { margin: .25rem 0 .5rem; text-align: right; font-weight: 600; }
form.reopen { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 1rem; }
.lookup { margin: 0; padding: .5rem .75rem; border-radius: var(--radius); background: var(--green-soft); color: var(--green); font-weight: 600; }
.lookup.warn { background: var(--warn-soft); color: var(--warn); }
.lookup.bad { background: var(--urgent-soft); color: var(--urgent); }
details.wrong-item { margin-top: .5rem; }
details.wrong-item summary { cursor: pointer; color: var(--muted); }
details.wrong-item form { margin-top: .75rem; }
.reminder-list li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.reminder-list li:last-child { border-bottom: 0; }
.reminder-list li.overdue b { color: var(--urgent); }
.card.warnish { border-color: var(--warn); }
label.attach { font-weight: 600; color: var(--muted); }
label.attach input[type=file] { display: block; margin-top: .25rem; font-weight: 400; }
table.changes td:first-child { text-align: left; }
table.changes input[type=checkbox] { width: 1.4rem; height: 1.4rem; margin: 0; }
ul.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .25rem .75rem; list-style: none; padding: 0; }
code.big { font-size: 1.1rem; letter-spacing: .05em; word-break: break-all; }

/* The guide: the Help page and the "?" pop-up */
.guide h2 { margin-top: 0; }
.guide h3 { margin: 1.1rem 0 .4rem; font-size: 1.02rem; }
.guide ul, .guide ol { padding-left: 1.2rem; }
.guide li { margin: .3rem 0; }
.guide-table th { text-align: left; vertical-align: top; width: 32%; padding-right: .75rem; }
.guide-table td { vertical-align: top; }
.guide-toc { display: flex; flex-wrap: wrap; gap: .35rem .9rem; margin-top: .5rem; }
.guide-top { margin: .75rem 0 0; font-size: .9rem; }
.help-dialog { width: min(640px, calc(100vw - 32px)); max-height: min(80vh, 760px); padding: 0; border: 1px solid var(--line);
  border-radius: 16px; background: var(--card); color: var(--ink); display: none; }
.help-dialog[open] { display: flex; flex-direction: column; }
.help-dialog::backdrop { background: rgb(0 0 0 / 45%); }
.help-dialog-body { overflow-y: auto; padding: 1rem 1.1rem .25rem; }
.help-dialog > .actions { margin: 0; padding: .75rem 1.1rem; border-top: 1px solid var(--line); justify-content: flex-end; }
@media (max-width: 640px) { .guide-table th { width: auto; display: block; } .guide-table td { display: block; padding-top: 0; } }
@media print {
  header.top, .guide-top, .guide-toc, .help-dialog { display: none !important; }
  .card { box-shadow: none; border: 0; break-inside: auto; }
}

/* Bulk edit (#25): a tick column on Items and a bar that stays at the bottom of the screen. */
table.list td.pick-col, table.list th.pick-col { width: 2.2rem; padding-right: 0; }
.pick-col input { width: 1.3rem; height: 1.3rem; min-height: 0; margin: 0; }
.pickbar { position: sticky; bottom: 0; z-index: 4; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  justify-content: space-between; margin: .75rem -1rem -1rem; padding: .6rem 1rem;
  padding-bottom: max(.6rem, env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); }
.pickbar [data-pick-count] { font-weight: 600; color: var(--muted); }
.pickbar.on [data-pick-count] { color: var(--ink); }
fieldset[data-for-action] { margin: .75rem 0 0; padding: .6rem .8rem; }
fieldset[data-for-action] > * + * { margin-top: .6rem; }
.lot-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: .5rem; margin: .5rem 0 1rem; }
.lot-stats div { background: var(--brand-soft); border-radius: 10px; padding: .5rem .7rem; }
.lot-stats b { display: block; font-size: 1.15rem; }
.lot-stats .loss b { color: var(--urgent); }
table.list input.cell { width: 6.5rem; }
@media (max-width: 640px) {
  table.list tr.with-pick { grid-template-columns: 2rem 44px 1fr; }
  table.list tr.with-pick td.pick-col { grid-column: 1; grid-row: 1 / span 6; width: auto; padding-top: .3rem; }
  table.list tr.with-pick td.thumb-col { grid-column: 2; }
  table.list tr.with-pick td { grid-column: 3; }
}
#preview { scroll-margin-top: 7.5rem; }

/* Audits (#26) */
.audit-count { font-size: 1.1rem; margin: .25rem 0 .5rem; }
.audit-count b { font-size: 1.6rem; }
form.scan input { font-size: 1.2rem; }
.audit-flag { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem;
  border-top: 1px solid var(--line); padding: .55rem 0; }
.audit-flag form { display: flex; gap: .4rem; margin: 0; }
.audit-flag select { width: auto; }
.bins-pick li { padding: .45rem 0; }
.status-trail { margin: .35rem 0 0; }

/* Sale ledger lines (#14) */
.ledger-lines li.voided { opacity: .6; }
.ledger-lines li.voided b { text-decoration: line-through; }
.ledger-lines small { display: block; }
.didnt-stick { margin: .5rem 0 1rem; }
/* Expenses and receipts (#15) */
.receipt-pick { padding: .8rem; border: 2px dashed var(--line); border-radius: var(--radius); font-weight: 700; }
.receipt-pick input { display: block; margin-top: .4rem; font-weight: 400; }
.receipts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem; margin-bottom: .75rem; }
.receipts figure { margin: 0; }
.receipts img { width: 100%; height: 180px; object-fit: contain; background: var(--line); border-radius: 8px; border: 1px solid var(--line); }
input[type=file] { max-width: 100%; min-width: 0; }
.cat-row { display: grid; grid-template-columns: 1fr 1.4fr auto auto auto; gap: .5rem; align-items: center; padding: .4rem 0; border-top: 1px solid var(--line); }
@media (max-width: 640px) { .cat-row { grid-template-columns: 1fr 1fr; } }

/* Home: Today (#28) */
.today h1 { margin-bottom: .5rem; }
.today-list { list-style: none; margin: 0; padding: 0; }
.today-list li a { display: flex; align-items: center; gap: .75rem; padding: .6rem .25rem; border-top: 1px solid var(--line); color: inherit; text-decoration: none; min-height: 44px; }
.today-list li:first-child a { border-top: 0; }
.today-list .n { min-width: 2.2rem; text-align: center; border-radius: 999px; padding: .1rem .5rem; background: var(--line); font-size: .95rem; }
.today-list li.urgent .n { background: var(--urgent); color: #fff; }
.today-list li.warn .n { background: var(--warn-soft); color: var(--warn); }
.today-list span:not(.go) { flex: 1; }
.today-list .go { color: var(--muted); font-size: 1.3rem; }
.all-clear { color: var(--green); font-weight: 600; margin: .25rem 0; }
dl.strip { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin: .75rem 0 0; padding-top: .75rem; border-top: 1px solid var(--line); }
dl.strip dt { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
dl.strip dd { margin: .15rem 0 0; font-weight: 700; }
dl.strip small { display: block; font-weight: 400; color: var(--muted); }

/* Search (#32) */
.search-form .inline input { flex: 1 1 12rem; }
.search-jump { margin: 0 0 .75rem; }
.search-jump b { margin-left: .25rem; }

/* Aging (#19) */
.aging-list { list-style: none; margin: 0; padding: 0; }
.aging-list li { padding: .6rem 0; border-top: 1px solid var(--line); }
.aging-list li:first-child { border-top: 0; }
.aging-list p { margin: .2rem 0; }
.aging-list form.inline input { flex: 0 1 7rem; }
.ok-note { color: var(--green); }
.grid3 { display: grid; grid-template-columns: 5rem 1fr 6rem; gap: .5rem; }
/* Shipping (#17) */
.ship-fields { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: .5rem; }
@media (max-width: 640px) { .ship-fields { grid-template-columns: 1fr 1fr; } .ship-fields label:first-child { grid-column: 1 / -1; } }
.ship-card .task-head { margin-bottom: .2rem; }

/* Goals (#29) */
.goal-bar { position: relative; height: .6rem; border-radius: 999px; background: var(--line); margin: .4rem 0 .6rem; overflow: hidden; }
.goal-bar .fill { display: block; height: 100%; border-radius: 999px; background: var(--brand); transition: width .4s ease; }
.goal-bar .fill.s-hit, .goal-bar .fill.s-on_pace { background: var(--green); }
.goal-bar .fill.s-behind, .goal-bar .fill.s-fast { background: var(--warn); }
.goal-bar .fill.s-over { background: var(--urgent); }
.goal-bar .pace { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); opacity: .6; }
.pill.goal-hit, .pill.goal-on_pace { background: var(--green-soft); color: var(--green); }
.pill.goal-behind, .pill.goal-fast { background: var(--warn-soft); color: var(--warn); }
.pill.goal-over { background: var(--urgent-soft); color: var(--urgent); }
ul.goal-history { list-style: none; padding: 0; margin: .25rem 0 .75rem; display: flex; flex-wrap: wrap; gap: .35rem; }
ul.goal-history li { font-size: .8rem; border: 1px solid var(--line); border-radius: var(--radius); padding: .15rem .5rem; }
ul.goal-history li.hit > span:first-child { color: var(--green); }
ul.goal-history li.missed > span:first-child { color: var(--urgent); }
ul.home-goals { list-style: none; padding: 0; margin: .75rem 0 0; border-top: 1px solid var(--line); padding-top: .5rem; }
ul.home-goals li a { display: block; color: inherit; text-decoration: none; padding: .25rem 0; }
ul.home-goals .goal-bar { margin: .25rem 0 .1rem; height: .45rem; }

/* Goal bars: widths and the pace mark in 5% steps (the CSP allows no inline styles) */
.goal-bar .w-0 { width: 0%; } .goal-bar .at-0 { left: 0%; }
.goal-bar .w-5 { width: 5%; } .goal-bar .at-5 { left: 5%; }
.goal-bar .w-10 { width: 10%; } .goal-bar .at-10 { left: 10%; }
.goal-bar .w-15 { width: 15%; } .goal-bar .at-15 { left: 15%; }
.goal-bar .w-20 { width: 20%; } .goal-bar .at-20 { left: 20%; }
.goal-bar .w-25 { width: 25%; } .goal-bar .at-25 { left: 25%; }
.goal-bar .w-30 { width: 30%; } .goal-bar .at-30 { left: 30%; }
.goal-bar .w-35 { width: 35%; } .goal-bar .at-35 { left: 35%; }
.goal-bar .w-40 { width: 40%; } .goal-bar .at-40 { left: 40%; }
.goal-bar .w-45 { width: 45%; } .goal-bar .at-45 { left: 45%; }
.goal-bar .w-50 { width: 50%; } .goal-bar .at-50 { left: 50%; }
.goal-bar .w-55 { width: 55%; } .goal-bar .at-55 { left: 55%; }
.goal-bar .w-60 { width: 60%; } .goal-bar .at-60 { left: 60%; }
.goal-bar .w-65 { width: 65%; } .goal-bar .at-65 { left: 65%; }
.goal-bar .w-70 { width: 70%; } .goal-bar .at-70 { left: 70%; }
.goal-bar .w-75 { width: 75%; } .goal-bar .at-75 { left: 75%; }
.goal-bar .w-80 { width: 80%; } .goal-bar .at-80 { left: 80%; }
.goal-bar .w-85 { width: 85%; } .goal-bar .at-85 { left: 85%; }
.goal-bar .w-90 { width: 90%; } .goal-bar .at-90 { left: 90%; }
.goal-bar .w-95 { width: 95%; } .goal-bar .at-95 { left: 95%; }
.goal-bar .w-100 { width: 100%; } .goal-bar .at-100 { left: 100%; }

/* Documents (#31) */
img.doc-preview { display: block; max-width: 100%; max-height: 70vh; margin: .5rem 0; border: 1px solid var(--line); border-radius: var(--radius); }
