/* Stock Writer. Layout: a stock-room work queue. A slim intake bar on top, tabs by stage, one card per
   garment with its photos on the left and the listing on the right; one column on a phone. */
:root {
  --bg: #f3f4f2; --surface: #ffffff; --sunk: #eceeea; --ink: #161c2b; --muted: #5c6371; --line: #dcdfd9;
  --accent: #23345c; --accent-ink: #ffffff; --accent-soft: #e4e9f3;
  --review: #8a5a00; --review-soft: #fbefd6; --ok: #1d6a46; --ok-soft: #ddf0e5; --bad: #a3302b; --bad-soft: #f8e3e1;
  --display: "Newsreader", Georgia, "Times New Roman", serif;
  --body: "Nunito Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --r: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root {
  --bg: #11141b; --surface: #191d26; --sunk: #141821; --ink: #e9ebef; --muted: #a3a9b5; --line: #2b313d;
  --accent: #a9bce6; --accent-ink: #11141b; --accent-soft: #1f2a42;
  --review: #f0bf66; --review-soft: #33270f; --ok: #7fd1a6; --ok-soft: #15301f; --bad: #f2a19b; --bad-soft: #3a1c1b; color-scheme: dark; } }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--body); margin: 0; }
.wrap { max-width: 1040px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 20px 60px; }
h1, h2 { font-family: var(--display); font-weight: 500; margin: 0; text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: 2rem; line-height: 1.1; }
h2 { font-size: 1.3rem; }
p { margin: 0; }
a { color: var(--accent); }
img { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: var(--mono); font-size: .9rem; }
.mono.big { font-size: 1.3rem; letter-spacing: .04em; }
.stack { display: grid; gap: 12px; }
.stack-lg { display: grid; gap: 18px; }
button, .btn { font: 700 .88rem/1 var(--body); border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  min-height: 44px; padding: 0 18px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
button.primary, .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.ok { background: var(--ok); color: var(--surface); border-color: var(--ok); }
button.quiet { background: transparent; border-color: transparent; color: var(--muted); padding: 0 10px; }
button.danger { color: var(--bad); }
button.linkish { background: none; border: 0; padding: 0; min-height: 0; color: var(--accent); font: inherit; text-decoration: underline; }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type=text], input[type=password], input[type=number], textarea, select { width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; min-height: 44px; }
textarea { resize: vertical; min-height: 84px; line-height: 1.45; }
label.f { display: grid; gap: 4px; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); min-width: 0; }
label.f > span.count { justify-self: end; font: 400 .75rem var(--mono); letter-spacing: 0; text-transform: none; margin-top: -2px; }
label.f > span.count.over { color: var(--bad); font-weight: 500; }

header.site { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.site-in { max-width: 1040px; margin: 0 auto; padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
  display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: space-between; }
.brand { font: 500 1.2rem var(--display); color: var(--ink); text-decoration: none; display: flex; gap: 10px; align-items: baseline; }
.brand span { font: 700 .72rem var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.who { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: .9rem; }
.who form { margin: 0; }

.auth { max-width: 420px; margin: 8vh auto 0; display: grid; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 26px 22px; }

.top { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: end; justify-content: space-between; }
.top .lede { max-width: 60ch; margin-top: 6px; color: var(--muted); }
.intake { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 12px; }
.intake form { display: flex; gap: 8px; flex-wrap: wrap; }
.intake form input { flex: 1 1 240px; font-family: var(--mono); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filebtn { position: relative; overflow: hidden; }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.check { display: inline-flex; gap: 8px; align-items: center; font-size: .9rem; min-height: 44px; }
.check input { width: 20px; height: 20px; }
.notice { padding: 10px 14px; border-radius: 8px; background: var(--review-soft); color: var(--review); font-size: .9rem; }
.notice.bad { background: var(--bad-soft); color: var(--bad); }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.tabs button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tabs .n { font: 500 .78rem var(--mono); opacity: .8; }
.bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: space-between; min-height: 44px; }

.list { display: grid; gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); display: grid; grid-template-columns: 148px minmax(0, 1fr); overflow: hidden; }
.card.busy { border-color: var(--accent); }
.photos { background: var(--sunk); padding: 10px; display: grid; gap: 8px; align-content: start; }
.photo { position: relative; }
.photo img, .photos .ph { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 6px; background: var(--line); display: block; }
.photo button { position: absolute; top: 4px; right: 4px; min-height: 30px; padding: 0 9px; font-size: .75rem; background: var(--surface); }
.photos .ph { display: grid; place-items: center; color: var(--muted); font-size: .8rem; text-align: center; padding: 8px; }
.photos .filebtn { min-height: 38px; font-size: .8rem; padding: 0 10px; }
.body { padding: 14px 16px 16px; display: grid; gap: 12px; min-width: 0; }
.meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: .82rem; color: var(--muted); }
.chip { font: 700 .72rem/1 var(--body); letter-spacing: .06em; text-transform: uppercase; padding: 6px 9px; border-radius: 999px; background: var(--sunk); color: var(--muted); display: inline-block; }
.chip.review { background: var(--review-soft); color: var(--review); }
.chip.approved { background: var(--ok-soft); color: var(--ok); }
.chip.code { font-family: var(--mono); text-transform: none; letter-spacing: 0; font-weight: 500; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: end; }
.seo { border-top: 1px dashed var(--line); padding-top: 12px; display: grid; gap: 10px; }
.seo h3 { font: 700 .78rem var(--body); letter-spacing: .08em; text-transform: uppercase; margin: 0; color: var(--muted); }
.checks { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.checks li { background: var(--review-soft); color: var(--review); border-radius: 8px; padding: 8px 12px; font-size: .88rem; }
.checks li::before { content: "Check: "; font-weight: 700; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.err { color: var(--bad); font-size: .88rem; }
.writing { color: var(--accent); font-size: .9rem; font-weight: 700; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r); padding: 28px 20px; display: grid; gap: 10px; justify-items: start; }
.empty ol { margin: 4px 0 0; padding-left: 20px; display: grid; gap: 4px; color: var(--muted); max-width: 62ch; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 12px; }
.handover { border-color: var(--ok); }
.people { list-style: none; margin: 0; padding: 0; display: grid; }
.people li { display: flex; flex-wrap: wrap; gap: 10px 16px; justify-content: space-between; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.people li:first-child { border-top: 0; }
.people li.off { opacity: .6; }
.people form { margin: 0; }
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--bg);
  padding: 12px 18px; border-radius: 999px; font-weight: 700; font-size: .9rem; max-width: calc(100vw - 32px); z-index: 20; }

@media (max-width: 640px) {
  h1 { font-size: 1.6rem; }
  .card { grid-template-columns: minmax(0, 1fr); }
  .photos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: no-preference) { button { transition: background .15s, color .15s; } }
