/* Mugdha Studio. The concierge inbox's design system (tokens, type, tab
   buttons, sheets), so Studio and the inbox read as one product. Phone first:
   the tab bar sits under the thumb; on a computer it becomes the plum rail. */
:root {
  --plum: #2a1330; --plum-2: #3a1c42; --plum-3: #4b2656;
  --gold: #e8d3a0; --gold-2: #d9bd7e; --gold-ink: #8a5a12;
  --bg: #f4f1f6; --bg-2: #ece7f0;
  --surface: #fff; --surface-2: #faf8fb; --surface-3: #f4f0f7;
  --ink: #1c161f; --ink-2: #4a4353; --muted: #6f6879;
  --line: #e6e0ec; --line-2: #d9d1e2;
  --teal: #116152; --teal-bg: #e4f3ee; --teal-line: #bfe0d6;
  --red: #9e2a1c; --red-bg: #fdeae7; --red-line: #f4cec7;
  --amber: #8a5a12; --amber-bg: #fdf2e0; --amber-line: #efdcb9;
  --lilac: #eadff5; --violet: #6b3fa0;
  --r-sm: 10px; --r-md: 14px; --r-lg: 20px;
  --e1: 0 1px 2px rgba(28,22,31,.05), 0 1px 1px rgba(28,22,31,.03);
  --e2: 0 2px 6px rgba(28,22,31,.07), 0 1px 2px rgba(28,22,31,.04);
  --e3: 0 12px 32px rgba(28,22,31,.16), 0 2px 8px rgba(28,22,31,.08);
  --e-up: 0 -10px 34px rgba(28,22,31,.2);
  --focus: 0 0 0 3px rgba(107,63,160,.32);
  --speed: .18s;
  --sans: Manrope, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --nav-h: calc(66px + env(safe-area-inset-bottom, 0px));
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --plum: #150f19; --plum-2: #1f1726; --plum-3: #33224a;
    --bg: #121016; --bg-2: #181420;
    --surface: #1c1822; --surface-2: #221d2a; --surface-3: #2a2333;
    --ink: #f2edf5; --ink-2: #cdc5d6; --muted: #9a91a6;
    --line: #302941; --line-2: #3c3450;
    --teal: #7fd9bf; --teal-bg: #123028; --teal-line: #1d4a3c;
    --red: #ff9d8c; --red-bg: #3a1a16; --red-line: #5a2820;
    --amber: #f0c476; --amber-bg: #372715; --amber-line: #523c1c;
    --lilac: #2e2440; --violet: #c5a6f0; --gold-ink: #f0c476;
    --e1: 0 1px 2px rgba(0,0,0,.4); --e2: 0 2px 8px rgba(0,0,0,.45);
    --e3: 0 14px 38px rgba(0,0,0,.6); --e-up: 0 -10px 34px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --plum: #150f19; --plum-2: #1f1726; --plum-3: #33224a;
  --bg: #121016; --bg-2: #181420;
  --surface: #1c1822; --surface-2: #221d2a; --surface-3: #2a2333;
  --ink: #f2edf5; --ink-2: #cdc5d6; --muted: #9a91a6;
  --line: #302941; --line-2: #3c3450;
  --teal: #7fd9bf; --teal-bg: #123028; --teal-line: #1d4a3c;
  --red: #ff9d8c; --red-bg: #3a1a16; --red-line: #5a2820;
  --amber: #f0c476; --amber-bg: #372715; --amber-line: #523c1c;
  --lilac: #2e2440; --violet: #c5a6f0; --gold-ink: #f0c476;
  --e1: 0 1px 2px rgba(0,0,0,.4); --e2: 0 2px 8px rgba(0,0,0,.45);
  --e3: 0 14px 38px rgba(0,0,0,.6); --e-up: 0 -10px 34px rgba(0,0,0,.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: var(--violet); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--focus); }
h1, h2, h3 { margin: 0; line-height: 1.15; text-wrap: balance; }
h1 { font-family: var(--serif); font-size: 2rem; font-weight: 700; }
h2 { font-family: var(--serif); font-size: 1.45rem; font-weight: 700; }
h3 { font-size: .98rem; font-weight: 800; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.eyebrow { font-size: .7rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; color: var(--gold-ink); }
.stack { display: grid; gap: 12px; min-width: 0; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; }

/* ---------- frame: tab bar below on a phone, rail on the left on a computer ---------- */
.pane { min-height: 100dvh; padding-bottom: calc(var(--nav-h) + 12px); }
.screen { max-width: 960px; margin: 0 auto; padding: calc(env(safe-area-inset-top, 0px) + 14px) 16px 24px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
/* Scrolling rows (chips, tabs) must not widen the page to fit their contents. */
.screen > *, .card > *, .stack > *, .filters .line > * { min-width: 0; }
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; gap: 4px;
  padding: 6px 6px calc(8px + env(safe-area-inset-bottom, 0px));
  background: var(--surface); border-top: 1px solid var(--line);
}
.nav button {
  flex: 1; height: 52px; border-radius: 13px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--muted); font-size: 10.5px; font-weight: 700; position: relative;
  background: var(--surface-2); border: 1px solid var(--line);
  transition: color var(--speed), background var(--speed), border-color var(--speed), transform var(--speed);
}
.nav button svg { width: 20px; height: 20px; }
.nav button:hover { background: var(--surface-3); color: var(--ink); }
.nav button:active { transform: scale(.94); }
.nav button[aria-pressed="true"] { color: var(--plum); background: var(--surface-3); }
/* On the phone's bottom bar a chosen tab is gold text in dark mode. Only there: on the
   rail the chosen tab is a gold button, and gold text on it would disappear. */
@media (max-width: 899px) {
  :root[data-theme="dark"] .nav button[aria-pressed="true"] { color: var(--gold); }
}
@media (max-width: 899px) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nav button[aria-pressed="true"] { color: var(--gold); }
}
.nav button.new { background: linear-gradient(180deg, var(--gold), var(--gold-2)); color: #2a1330; border-color: var(--gold-2); }
.nav button.new[aria-pressed="true"] { box-shadow: inset 0 0 0 2px #2a1330; }
/* The New button is gold in every theme, so its label stays dark whatever the theme says. */
.nav button.new, .nav button.new[aria-pressed] { color: #2a1330 !important; }
.nav .badge {
  position: absolute; top: 3px; right: 50%; transform: translateX(19px); min-width: 18px; height: 18px; border-radius: 99px;
  background: var(--red); color: #fff; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center;
  padding: 0 5px; box-shadow: 0 0 0 2px var(--surface);
}
.nav .brand { display: none; }
/* A label never pushes its tab wider than its share of the bar (SCRUM-108). */
.nav button { min-width: 0; }
.nav button > span:not(.badge) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-inline: 2px; }
/* On a phone: the first tabs and More (app.js renderNav); tablets and the rail show every tab. */
.nav .nav-more { display: none; }
@media (max-width: 599px) {
  .nav button.nav-extra { display: none; }
  .nav .nav-more { display: flex; }
}
.sheet .menu [aria-current="page"] { background: var(--surface-3); }
.sheet .menu .grow { flex: 1; }
/* The cross-check's pictures (SCRUM-110): tap one to look at it full screen. */
.xc-thumb { flex: none; width: 56px; height: 56px; padding: 0; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); overflow: hidden; cursor: zoom-in; }
.xc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.xc-thumb.none { cursor: default; }
/* A merged file's cross-check, one fold per quotation (SCRUM-115). */
.xc-group { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.xc-group > summary { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; list-style: none; }
.xc-group > summary::-webkit-details-marker { display: none; }
.xc-group > summary::before { content: '▸'; color: var(--muted); flex: none; transition: transform .15s; }
.xc-group[open] > summary::before { transform: rotate(90deg); }
.xc-group > .stack { padding: 0 12px 12px; }
.xc-search { width: 100%; }
/* Duplicates (SCRUM-116): one row per copy, its radio picks the one kept. */
.dup-copy { cursor: pointer; }
.dup-copy input[type=radio] { flex: none; width: 20px; height: 20px; accent-color: var(--violet); }
.dup-pic { flex: none; width: 56px; height: 56px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); background: var(--surface-2); }
.jw-photo-btn { padding: 0; border: 0; background: none; cursor: zoom-in; justify-self: start; max-width: 100%; }
.sheet .menu .badge {
  min-width: 20px; height: 20px; border-radius: 99px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 6px;
}
@media (min-width: 900px) {
  .pane { padding-bottom: 0; margin-left: 84px; }
  .screen { padding-top: 28px; padding-inline: 28px; }
  .nav {
    top: 0; right: auto; width: 84px; flex-direction: column; padding: 16px 10px; gap: 7px;
    border-top: 0; border-right: 1px solid rgba(0,0,0,.2);
    background: linear-gradient(176deg, var(--plum) 0%, var(--plum-2) 100%);
  }
  /* As in the inbox: glass buttons that share the rail's height, so each is a
     big, obvious target rather than a small chip at the top. */
  .nav button {
    flex: 1 1 0; height: auto; min-height: 64px; max-height: 128px; gap: 6px; font-size: 11.5px;
    color: #d9cfe2; background: rgba(255,255,255,.055); border-color: rgba(255,255,255,.09);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  }
  .nav button svg { width: 22px; height: 22px; }
  .nav button:hover { background: rgba(255,255,255,.13); border-color: rgba(255,255,255,.17); color: #fff; }
  .nav button[aria-pressed="true"],
  :root[data-theme="dark"] .nav button[aria-pressed="true"] {
    background: linear-gradient(180deg, var(--gold), var(--gold-2)); color: #2a1330; border-color: rgba(255,255,255,.28);
    box-shadow: 0 3px 12px rgba(232,211,160,.22);
  }
  .nav button.new { margin-block: 4px; }
  .nav .brand { display: block; font-family: var(--serif); color: var(--gold); font-size: 1.6rem; font-weight: 700; text-align: center; padding: 2px 0 12px; }
  .nav .badge { top: 8px; right: 8px; transform: none; box-shadow: 0 0 0 2px var(--plum); }
}

/* ---------- screen header ---------- */
.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.top .titles { display: grid; gap: 2px; min-width: 0; }
.top h1 { overflow-wrap: anywhere; }
.top .tools { display: flex; gap: 8px; flex: none; }
.avatar {
  flex: none; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  color: var(--violet); font-weight: 800; font-size: .9rem; box-shadow: var(--e1);
}
.back { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); text-decoration: none; font-weight: 700; font-size: .88rem; }
.back svg { width: 18px; height: 18px; }
.icon-btn {
  flex: none; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; color: var(--ink-2); box-shadow: var(--e1);
}
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--e1); display: grid; gap: 14px; min-width: 0; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); font-size: .9rem; border: 1px solid; }
.banner > div { display: grid; gap: 2px; min-width: 0; }
.banner.amber { background: var(--amber-bg); border-color: var(--amber-line); }
.banner.red { background: var(--red-bg); border-color: var(--red-line); }
.banner.teal { background: var(--teal-bg); border-color: var(--teal-line); }
.banner.lilac { background: var(--lilac); border-color: var(--line-2); }
.banner b { font-weight: 800; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 720px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; display: grid; gap: 2px; box-shadow: var(--e1); text-decoration: none; color: var(--ink); min-width: 0; }
.tile .n { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.15; }
.tile .l { font-size: .8rem; color: var(--muted); font-weight: 600; }
.tile.hot { background: var(--amber-bg); border-color: var(--amber-line); }
a.tile:hover { border-color: var(--line-2); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 18px;
  border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font-weight: 700; text-decoration: none; white-space: nowrap; transition: transform var(--speed), background var(--speed);
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: #2a1330; border-color: #2a1330; color: #fff; }
.btn.gold { background: linear-gradient(180deg, var(--gold), var(--gold-2)); border-color: var(--gold-2); color: #2a1330; box-shadow: 0 3px 12px rgba(217,189,126,.3); }
.btn.danger { color: var(--red); border-color: var(--red-line); }
.btn.ghost { border-color: transparent; background: none; color: var(--violet); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* pills */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 800; padding: 3px 9px; border-radius: 99px; white-space: nowrap; background: var(--surface-3); color: var(--ink-2); }
.pill.red { background: var(--red-bg); color: var(--red); }
.pill.amber { background: var(--amber-bg); color: var(--amber); }
.pill.teal { background: var(--teal-bg); color: var(--teal); }
.pill.lilac { background: var(--lilac); color: var(--violet); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }

/* segmented control */
.seg { display: flex; gap: 3px; padding: 3px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1 0 auto; border: 0; background: none; border-radius: 9px; padding: 8px 12px; font-weight: 700; font-size: .86rem; color: var(--muted); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: #2a1330; color: var(--gold); }
:root[data-theme="dark"] .seg button[aria-pressed="true"] { background: var(--plum-3); }
.seg .c { font-weight: 600; opacity: .75; margin-left: 4px; }
.seg .warn-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--red); margin-left: 5px; vertical-align: 1px; }

/* list rows */
.rows { display: grid; gap: 8px; }
.prow {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 8px; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--e1); min-width: 0;
}
.prow:hover { border-color: var(--line-2); }
.prow .ph { width: 52px; height: 66px; border-radius: 9px; object-fit: cover; background: var(--surface-3); }
.prow .t { font-weight: 700; font-size: .92rem; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prow .m { font-size: .8rem; color: var(--muted); }
.prow > div { display: grid; gap: 2px; min-width: 0; }
.empty { padding: 26px 16px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--r-md); display: grid; gap: 10px; justify-items: center; }

/* piece grid */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px 12px; }
.pcard { display: grid; gap: 6px; text-decoration: none; color: var(--ink); min-width: 0; align-content: start; }
.pcard .img { position: relative; aspect-ratio: 3 / 4; border-radius: var(--r-md); overflow: hidden; background: var(--surface-3); border: 1px solid var(--line); }
.pcard .img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.pcard:hover .img img { transform: scale(1.03); }
.pcard .img .pill { position: absolute; left: 6px; bottom: 6px; box-shadow: var(--e2); max-width: calc(100% - 12px); overflow: hidden; text-overflow: ellipsis; }
.pcard .t { font-weight: 700; font-size: .86rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .m { font-size: .78rem; color: var(--muted); }

/* search and filters */
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 38px; }
.chiprow { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chiprow::-webkit-scrollbar { display: none; }
.fchip { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 7px 13px; font-weight: 700; font-size: .82rem; color: var(--ink-2); }
.fchip[aria-pressed="true"] { background: var(--lilac); border-color: var(--line-2); color: var(--violet); }
.filters { display: grid; gap: 10px; }
.filters .line { display: flex; gap: 8px; align-items: center; }
.filters .line > :first-child { flex: 1; min-width: 0; }
.filters select { width: auto; min-width: 130px; }

/* forms */
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .label { font-size: .8rem; font-weight: 800; color: var(--ink-2); }
.field .hint { font-size: .78rem; color: var(--muted); }
.field.has-problem input, .field.has-problem textarea, .field.has-problem select, .field.has-problem .chips { border-color: var(--red); }
input[type="text"], input[type="number"], input[type="password"], input[type="search"], select, textarea {
  width: 100%; min-height: 46px; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2);
  transition: border-color var(--speed), box-shadow var(--speed);
}
textarea { min-height: 130px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--violet); box-shadow: var(--focus); background-color: var(--surface); }
/* Drop-downs in the theme, not the browser's own arrow and list (the focus rule above sets only the colour, so the arrow stays). */
:root { --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f6879' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a91a6' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); } }
:root[data-theme="dark"] { --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a91a6' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 40px; text-overflow: ellipsis;
  background-image: var(--chevron); background-repeat: no-repeat; background-position: right 13px center; background-size: 16px;
}
select:hover:not(:disabled) { border-color: var(--violet); }
select:disabled { cursor: default; }
select option, select optgroup { background-color: var(--surface); color: var(--ink); }
input:disabled, select:disabled, textarea:disabled { opacity: .7; }
.grid2 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.check { display: flex; gap: 10px; align-items: center; min-height: 40px; cursor: pointer; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: #6b3fa0; flex: none; }
.counter { font-size: .76rem; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.counter.over { color: var(--red); font-weight: 800; }
.money { position: relative; }
.money span { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; }
.money input { padding-left: 28px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface-2); min-height: 46px; align-items: center; }
.chips:focus-within { border-color: var(--violet); box-shadow: var(--focus); }
.chip { display: inline-flex; align-items: center; gap: 2px; padding: 3px 4px 3px 11px; border-radius: 99px; background: var(--lilac); color: var(--violet); font-size: .86rem; font-weight: 700; }
.chip.new { background: var(--amber-bg); color: var(--amber); }
.chip button { border: 0; background: none; color: inherit; width: 24px; height: 24px; border-radius: 50%; font-size: 1rem; line-height: 1; }
.chips input { border: 0 !important; background: none !important; box-shadow: none !important; flex: 1 1 120px; min-width: 100px; min-height: 34px; padding: 4px; }

/* piece page */
.ptabs { position: sticky; top: 0; z-index: 10; padding-block: 6px; margin-block: -6px; background: var(--bg); }
.statuscard { display: flex; gap: 12px; align-items: center; }
.statuscard .grow { flex: 1; min-width: 0; display: grid; gap: 2px; }
.checks { display: grid; gap: 8px; }
.checks .item { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: start; font-size: .9rem; }
.checks .item .i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 800; margin-top: 1px; }
.checks .item.bad .i { background: var(--red-bg); color: var(--red); }
.checks .item.warn .i { background: var(--amber-bg); color: var(--amber); }
.checks .item.ok .i { background: var(--teal-bg); color: var(--teal); }
.checks .fix { border: 0; background: none; color: var(--violet); font-weight: 800; font-size: .82rem; padding: 0 2px; }
.checks label.item { cursor: pointer; }
.checks label.item input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: #6b3fa0; }
.actionbar {
  position: fixed; left: 0; right: 0; bottom: var(--nav-h); z-index: 20; padding: 10px 16px;
  background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(28,22,31,.06);
}
@media (min-width: 900px) { .actionbar { left: 84px; bottom: 0; } }
.actionbar .inner { max-width: 960px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.actionbar .state { flex: 1; min-width: 0; font-size: .82rem; color: var(--muted); font-weight: 700; display: flex; gap: 6px; align-items: center; }
.pane.has-actionbar { padding-bottom: calc(var(--nav-h) + 84px); }
@media (min-width: 900px) { .pane.has-actionbar { padding-bottom: 90px; } }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.pick { position: relative; aspect-ratio: 3 / 4; border-radius: var(--r-md); overflow: hidden; background: var(--surface-3); border: 1px solid var(--line); }
.pick img { width: 100%; height: 100%; object-fit: cover; }
.pick .open { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.pick .cap { position: absolute; left: 0; right: 0; top: 0; padding: 5px 7px 12px; font-size: .68rem; font-weight: 700; line-height: 1.25; background: linear-gradient(180deg, rgba(20,10,18,.75), rgba(20,10,18,0)); color: #fff; pointer-events: none; }
.pick .badge { position: absolute; left: 6px; bottom: 6px; font-size: .68rem; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: var(--gold); color: #2a1330; pointer-events: none; }
.pick .acts { position: absolute; right: 5px; bottom: 5px; display: flex; gap: 4px; }
.pick .acts button { border: 0; border-radius: 8px; padding: 5px 8px; font-size: .7rem; font-weight: 800; background: rgba(255,255,255,.94); color: #2a1330; box-shadow: var(--e2); }
.pick.off img { opacity: .3; }
.pick.doubt { outline: 3px solid var(--amber); outline-offset: -3px; }
.pick .x { position: absolute; top: 5px; right: 5px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(20,10,18,.72); color: #fff; font-size: 1rem; }
.adder {
  aspect-ratio: 3 / 4; border: 1.5px dashed var(--line-2); border-radius: var(--r-md); display: grid; place-items: center; align-content: center; gap: 6px;
  color: var(--violet); background: var(--surface); text-align: center; font-size: .8rem; font-weight: 800; padding: 8px;
}
.adder svg { width: 22px; height: 22px; }
.adder:hover { border-color: var(--violet); }

/* website preview, in a phone frame */
.mock { width: min(100%, 360px); margin: 0 auto; border-radius: 30px; padding: 10px; background: #0d0a0f; box-shadow: var(--e3); }
.mock .scr { border-radius: 22px; overflow: hidden; background: #fbf8f4; color: #2a2226; max-height: 680px; overflow-y: auto; }
.mock .bar { background: #2e0a24; color: #fff; padding: 10px 14px; font-family: var(--serif); font-size: 1.05rem; border-bottom: 2px solid #c9a227; }
.mock .bar span { color: #c9a227; }
.mock .gal { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.mock .gal img { flex: 0 0 100%; aspect-ratio: 3 / 4; object-fit: cover; scroll-snap-align: start; }
.mock .count { text-align: center; font-size: .72rem; color: #8a7f86; padding-top: 6px; }
.mock .info { padding: 14px; display: grid; gap: 9px; }
.mock .ttl { font-family: var(--serif); font-size: 1.35rem; font-weight: 700; color: #2e0a24; line-height: 1.15; }
.mock .price { font-weight: 800; font-size: 1.05rem; }
.mock .price s { color: #8a7f86; font-weight: 600; margin-left: 6px; }
.mock .price .off { background: #c9a227; color: #2e0a24; font-size: .7rem; padding: 2px 6px; border-radius: 4px; margin-left: 6px; vertical-align: 2px; }
.mock .cta { background: #2e0a24; color: #fff; text-align: center; border-radius: 8px; padding: 12px; font-weight: 700; }
.mock .desc { font-size: .88rem; display: grid; gap: 8px; color: #3d3438; }
.mock .desc p { margin: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tags span { font-size: .74rem; padding: 2px 8px; border-radius: 6px; background: var(--surface-3); border: 1px solid var(--line); color: var(--ink-2); }

/* history */
.log { display: grid; }
.log .e { display: grid; grid-template-columns: 14px 1fr; gap: 10px; padding-bottom: 14px; position: relative; font-size: .9rem; }
.log .e::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--violet); margin-top: 6px; }
.log .e::after { content: ""; position: absolute; left: 4px; top: 18px; bottom: 0; width: 1px; background: var(--line-2); }
.log .e:last-child::after { display: none; }
.log time { display: block; font-size: .76rem; color: var(--muted); }

/* insights */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 130px; padding-top: 6px; border-bottom: 1px solid var(--line); }
.bars .b { flex: 1; min-width: 2px; border-radius: 4px 4px 0 0; background: var(--violet); opacity: .85; }
.bars .b.zero { background: var(--line); height: 2px !important; opacity: 1; }
.bars .b:hover { opacity: 1; }
.bars.gold .b { background: var(--gold-2); }
.axis { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.hbars { display: grid; gap: 9px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 32%) 1fr 48px; gap: 10px; align-items: center; font-size: .86rem; }
.hbar .track { height: 9px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 6px; background: var(--teal); }
.hbar .fill.amber { background: var(--amber); }
.hbar .fill.violet { background: var(--violet); }
.hbar b { text-align: right; font-variant-numeric: tabular-nums; }
.hbar span { overflow-wrap: anywhere; }
.cols { display: grid; gap: 14px; }
@media (min-width: 820px) { .cols { grid-template-columns: 1fr 1fr; } }

/* skeleton */
.sk { background: linear-gradient(90deg, var(--surface-3) 25%, var(--bg-2) 50%, var(--surface-3) 75%); background-size: 200% 100%; animation: sk 1.2s infinite linear; border-radius: 12px; }
@keyframes sk { to { background-position: -200% 0; } }

/* category picker */
.cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .cats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cat { min-height: 84px; padding: 14px; border-radius: var(--r-md); text-align: left; background: var(--surface); border: 1.5px solid var(--line); display: grid; gap: 2px; align-content: start; box-shadow: var(--e1); }
.cat b { font-size: 1rem; }
.cat span { font-size: .78rem; color: var(--muted); font-weight: 600; }
.cat[aria-pressed="true"] { border-color: var(--violet); background: var(--lilac); }

/* shot board */
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.shot-card { display: grid; gap: 6px; align-content: start; }
.shot-card .frame { position: relative; aspect-ratio: 3 / 4; border-radius: var(--r-md); overflow: hidden; background: var(--surface); border: 1.5px dashed var(--line-2); padding: 0; width: 100%; display: block; }
.shot-card .frame:hover { border-color: var(--violet); }
.shot-card .frame img { width: 100%; height: 100%; object-fit: cover; }
.shot-card .frame .outline .shape { stroke: var(--violet); fill: none; stroke-width: 1.4; }
.shot-card .frame .outline .shape-under, .shot-card .frame .outline .corner-under, .shot-card .frame .outline .mask, .shot-card .frame .outline .grid, .shot-card .frame .outline .label { display: none; }
.shot-card .frame .outline .corner { stroke: var(--line-2); }
.shot-card .name { font-size: .84rem; font-weight: 800; }
.shot-card .state { font-size: .78rem; color: var(--muted); font-weight: 600; }
.shot-card .state.warn { color: var(--amber); }
.shot-card .state.ok { color: var(--teal); }
.shot-card.taken .frame { border-style: solid; border-color: var(--teal-line); }
.shot-card.warn .frame { border-color: var(--amber); }
.progress { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > div { height: 100%; background: var(--violet); width: 0; transition: width .2s; }

/* ---------- sheet: bottom sheet on a phone, card on a computer ---------- */
.sheet {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 100%; max-height: 88dvh; overflow: auto;
  border-radius: 22px 22px 0 0; background: var(--surface); color: var(--ink); box-shadow: var(--e-up);
}
.sheet::backdrop { background: rgba(20,14,24,.52); backdrop-filter: blur(2px); }
.sheet[open] { animation: up .2s ease both; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.sheet .body { padding: 10px 18px calc(18px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 14px; }
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line-2); margin: 8px auto 0; }
.sheet .actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.sheet .actions .btn { flex: 1 1 140px; }
.sheet .menu { display: grid; gap: 2px; }
.sheet .menu button, .sheet .menu a {
  display: flex; align-items: center; gap: 12px; padding: 13px 12px; border-radius: 12px; border: 0; background: none; text-align: left;
  font-weight: 700; color: var(--ink); text-decoration: none; width: 100%;
}
.sheet .menu button:hover, .sheet .menu a:hover { background: var(--surface-3); }
.sheet .menu svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.sheet .menu .danger { color: var(--red); }
.sheet .menu .danger svg { color: var(--red); }
@media (min-width: 640px) {
  .sheet { margin: auto; width: min(480px, calc(100% - 40px)); border-radius: var(--r-lg); box-shadow: var(--e3); }
  .sheet .grab { display: none; }
  .sheet .body { padding: 22px; }
}

/* toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 92px); transform: translateX(-50%); z-index: 100;
  background: #2a1330; color: #fff; padding: 11px 16px; border-radius: 12px; max-width: calc(100% - 32px);
  box-shadow: var(--e3); font-weight: 600; font-size: .9rem; animation: up .18s ease both;
}
.toast.bad { background: #9e2a1c; }
.toast.link { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 900px) { .toast { bottom: 100px; margin-left: 42px; } }

/* sign in */
.signin { min-height: 100dvh; display: grid; place-items: center; padding: 20px; background: linear-gradient(170deg, #2a1330, #4b2656); }
.signin .card { width: min(380px, 100%); padding: 26px; gap: 16px; }
.signin .mark { font-family: var(--serif); font-size: 2.3rem; font-weight: 700; line-height: 1; }
.signin .mark span { color: var(--gold-ink); }
.signin-logo { background: #ffffff; border-radius: 16px; padding: 14px 18px; display: grid; place-items: center; }
.signin-logo img { width: 100%; max-width: 280px; height: auto; display: block; }

.spinner { width: 18px; height: 18px; border: 2.5px solid var(--lilac); border-top-color: var(--violet); border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* ---------- photo guide ---------- */
.guide-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.guide-shot { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 18px; align-items: start; }
.guide-shot .pic { position: relative; aspect-ratio: 3 / 4; border-radius: var(--r-md); overflow: hidden; background: #241a22; border: 1px solid var(--line); }
.guide-shot .pic img { width: 100%; height: 100%; object-fit: cover; }
.guide-shot .pic .outline { position: absolute; inset: 0; }
.guide-shot .n { font-family: var(--serif); font-size: 2rem; color: var(--gold-ink); line-height: 1; font-weight: 700; }
.guide-list { margin: 0; padding-left: 1.1rem; display: grid; gap: 5px; }
.donts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.dont { display: grid; gap: 6px; font-size: .86rem; margin: 0; }
.dont img { aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--r-md); border: 3px solid var(--red); }
.dont.do img { border-color: var(--teal); }
.dont b { font-weight: 800; }
@media (max-width: 520px) { .guide-shot { grid-template-columns: 1fr; } .guide-shot .pic { max-width: 260px; } }

/* ---------- photo viewer ---------- */
body.viewer-open { overflow: hidden; }
.viewer { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); background: rgba(14,8,13,.97); color: #fff; }
.viewer-top { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; }
.viewer-caption { flex: 1; min-width: 0; font-size: .92rem; font-weight: 600; overflow-wrap: anywhere; }
.viewer-close { flex: none; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #fff; font-size: 1.8rem; line-height: 1; }
.viewer-stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; padding: 0 8px 8px; }
.viewer-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; transition: opacity .15s; }
.viewer-img.loading { opacity: .25; }
.viewer-spin { position: absolute; }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; border: 0; border-radius: 10px; background: rgba(255,255,255,.1); color: #fff; font-size: 2rem; line-height: 1; }
.viewer-nav.prev { left: 8px; }
.viewer-nav.next { right: 8px; }
.viewer-note { margin: 0 16px 12px; padding: 10px 12px; border-radius: 10px; background: rgba(240,196,118,.18); border: 1px solid rgba(240,196,118,.4); font-size: .9rem; }

/* ---------- guided camera ---------- */
body.cam-open { overflow: hidden; }
.cam {
  position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 12px calc(env(safe-area-inset-bottom, 0px) + 10px);
  background: #0b0709; color: #fff;
}
.cam-top { width: 100%; max-width: 560px; display: flex; align-items: center; gap: 10px; }
.cam-heading { flex: 1; display: grid; gap: 4px; justify-items: center; text-align: center; line-height: 1.25; min-width: 0; }
.cam-step { font-size: .72rem; color: #b9adc4; letter-spacing: .05em; font-weight: 700; }
.cam-title { font-size: 1rem; font-weight: 800; color: #fff; }
.cam-progress { display: flex; gap: 4px; }
.cam-progress span { width: 18px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.22); }
.cam-progress span.done { background: #7fd9bf; }
.cam-progress span.warn { background: #f0c476; }
.cam-progress span.now { background: var(--gold); }
.cam-icon { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.07); color: #fff; font-size: 1.3rem; display: grid; place-items: center; flex: none; }

.cam-stage { position: relative; width: min(100%, calc((100dvh - 290px) * 3 / 4)); max-width: 560px; aspect-ratio: 3 / 4; border-radius: 18px; overflow: hidden; background: #000; flex: none; }
.cam-video, .cam-still, .cam-ghost { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-ghost { opacity: .32; pointer-events: none; inset: 5% 5%; width: 90%; height: 90%; mix-blend-mode: screen; }
.cam-outline { position: absolute; inset: 0; pointer-events: none; }
.cam-stage.reviewing .cam-outline { opacity: .3; }
.cam-stage.flash::after { content: ""; position: absolute; inset: 0; background: #fff; opacity: .7; pointer-events: none; animation: flashout .18s ease-out forwards; }
@keyframes flashout { to { opacity: 0; } }

/* outline drawing (camera, guide and shot cards) */
.outline { width: 100%; height: 100%; display: block; }
.outline path, .outline rect { vector-effect: non-scaling-stroke; }
.outline .mask { fill: rgba(5,3,6,.55); }
.outline .frame { fill: none; stroke: rgba(255,255,255,.55); stroke-width: 1; }
.outline .corner { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.outline .grid { stroke: rgba(255,255,255,.26); stroke-width: .8; }
.outline .shape { fill: rgba(232,211,160,.08); stroke: #e8d3a0; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 2px rgba(0,0,0,.6)); transition: stroke .25s, fill .25s; }
.outline .label { font: 800 11.5px var(--sans); fill: #fff; paint-order: stroke; stroke: rgba(20,8,18,.75); stroke-width: 3.5px; letter-spacing: .02em; }
.cam-stage.fit .outline .shape { stroke: #7fd9bf; fill: rgba(127,217,191,.1); }

.cam-coach {
  position: absolute; left: 50%; top: 10px; transform: translateX(-50%); max-width: calc(100% - 140px);
  padding: 7px 13px; border-radius: 99px; font-size: .82rem; font-weight: 800; text-align: center;
  background: rgba(13,10,15,.74); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.14);
}
.cam-coach:empty { display: none; }
.cam-coach.warn { border-color: rgba(240,196,118,.45); color: #ffe3b3; }
.cam-coach.ok { border-color: rgba(127,217,191,.5); color: #c9f2e4; }
.cam-level { position: absolute; top: 10px; right: 10px; width: 52px; height: 52px; border-radius: 50%; background: rgba(13,10,15,.6); backdrop-filter: blur(6px); display: grid; place-items: center; }
.cam-level .ring { position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.8); }
.cam-level .bubble { width: 11px; height: 11px; border-radius: 50%; background: #f0c476; transition: transform .12s linear; }
.cam-level.ok .bubble { background: #7fd9bf; }
.cam-level.ok { box-shadow: 0 0 0 2px #7fd9bf; }
.cam-tools { position: absolute; right: 10px; top: 72px; display: grid; gap: 8px; }
.cam-tool { width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,.2); background: rgba(13,10,15,.6); color: #fff; font-weight: 800; font-size: .82rem; backdrop-filter: blur(6px); }
.cam-tool.on { background: var(--gold); color: #2a1330; border-color: var(--gold-2); }
.cam-meters { position: absolute; left: 8px; right: 8px; bottom: 8px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cam-meter { background: rgba(13,10,15,.66); backdrop-filter: blur(8px); border-radius: 9px; padding: 5px 7px; display: grid; gap: 4px; font-size: .68rem; font-weight: 800; color: #e3d9ea; }
.cam-meter u { display: block; height: 3px; border-radius: 3px; background: rgba(255,255,255,.18); overflow: hidden; text-decoration: none; }
.cam-meter i { display: block; height: 100%; border-radius: 3px; background: #7fd9bf; transition: width .2s; }
.cam-meter.mid i { background: #f0c476; }
.cam-meter.bad i { background: #ff9d8c; }
.cam-meter.off { opacity: .45; }
.cam-meter.off i { width: 0 !important; }
.cam-check { position: absolute; left: 8px; right: 8px; bottom: 52px; padding: 9px 12px; border-radius: 10px; font-size: .84rem; font-weight: 600; background: rgba(13,10,15,.8); backdrop-filter: blur(8px); }
.cam-check.ok { background: rgba(17,97,82,.92); }
.cam-check.warn { background: rgba(138,90,18,.95); }
.cam-countdown { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-size: 5rem; font-weight: 700; color: rgba(255,255,255,.92); text-shadow: 0 2px 18px rgba(0,0,0,.6); pointer-events: none; }
.cam-focus { position: absolute; width: 64px; height: 64px; margin: -32px 0 0 -32px; border: 2px solid var(--gold); border-radius: 12px; pointer-events: none; }
.cam-focus.pulse { animation: focuspulse .6s ease-out; }
@keyframes focuspulse { from { transform: scale(1.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.cam-instruction { margin: 0; max-width: 560px; text-align: center; font-size: .9rem; color: #e3d9ea; min-height: 2.8em; }
.cam-strip { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.cam-dot { width: 38px; height: 50px; border-radius: 8px; border: 2px solid rgba(255,255,255,.18); background: #1f141c; color: #b9adc4; padding: 0; overflow: hidden; display: grid; place-items: center; font-weight: 800; }
.cam-dot img { width: 100%; height: 100%; object-fit: cover; }
.cam-dot.optional { border-style: dashed; }
.cam-dot.done { border-color: #7fd9bf; }
.cam-dot.warn { border-color: #f0c476; }
.cam-dot.checking { border-color: #c5a6f0; }
.cam-dot.on { outline: 3px solid var(--gold); outline-offset: 2px; }
.cam-controls { width: 100%; max-width: 560px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: auto; }
.cam-shoot { display: grid; justify-items: center; gap: 6px; }
.cam-side { min-height: 48px; border-radius: 12px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.07); color: #fff; font-weight: 700; padding: 8px 10px; }
.cam-controls > .cam-side:last-child { background: linear-gradient(180deg, var(--gold), var(--gold-2)); color: #2a1330; border-color: var(--gold-2); }
.cam-shutter {
  --p: 0; width: 74px; height: 74px; border-radius: 50%; border: 0; padding: 0; position: relative;
  background: conic-gradient(var(--gold) calc(var(--p) * 360deg), rgba(255,255,255,.25) 0);
}
.cam-shutter::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: #8a7a86; border: 3px solid #0b0709; transition: background .2s; }
.cam-shutter.ready::after { background: var(--gold); }
.cam-shutter:active { transform: scale(.94); }
.cam-auto { border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.06); color: #b9adc4; border-radius: 99px; padding: 3px 10px; font-size: .66rem; font-weight: 800; letter-spacing: .08em; }
.cam-auto.on { color: #7fd9bf; border-color: rgba(127,217,191,.45); background: rgba(127,217,191,.12); }
.cam-message { position: fixed; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom, 0px) + 120px); z-index: 3; background: #fdeae7; color: #9e2a1c; border-radius: 12px; padding: 12px 14px; font-weight: 700; }
.cam-help { position: absolute; inset: 0; z-index: 4; background: rgba(11,7,9,.96); overflow-y: auto; padding: calc(env(safe-area-inset-top, 0px) + 12px) 12px 24px; }
.cam-help-card { max-width: 480px; margin: 0 auto; display: grid; gap: 12px; color: #e3d9ea; }
.cam-help-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cam-help-head b { color: var(--gold); font-size: 1.1rem; }
.cam-help-pic { position: relative; width: min(100%, 300px); aspect-ratio: 3 / 4; justify-self: center; border-radius: 12px; overflow: hidden; background: #1f141c; }
.cam-help-pic img { width: 100%; height: 100%; object-fit: cover; }
.cam-help-pic .outline { position: absolute; inset: 0; }
.cam-help-card p { margin: 0; }
.cam-help-card ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 6px; }

/* ---------- after live: sold, hold, choosing several, batch, scanning ---------- */
.pill.gold { background: var(--gold); color: #2a1330; }
.banner.gold { background: color-mix(in srgb, var(--gold) 35%, var(--surface)); border-color: var(--gold-2); }
.banner .btn { min-height: 40px; padding: 8px 14px; justify-self: start; }

.tick { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--surface); flex: none; display: grid; place-items: center; }
.tick.on { background: var(--violet); border-color: var(--violet); }
.tick.on::after { content: ""; width: 10px; height: 5px; border: solid #fff; border-width: 0 0 2.5px 2.5px; transform: translate(0, -1px) rotate(-45deg); }
.pcard .img .tick { position: absolute; top: 8px; right: 8px; box-shadow: var(--e2); }
.pgrid.selecting .pcard .img img { transition: transform .15s, opacity .15s; }
.pcard.picked .img { outline: 3px solid var(--violet); outline-offset: -3px; }
.pcard.picked .img img { transform: scale(.94); }
.prow[aria-checked="true"] { border-color: var(--violet); box-shadow: 0 0 0 1px var(--violet); }

.batch .batch-head { align-items: flex-start; }
.batch .batch-head > span { display: grid; gap: 2px; }

.scan-box { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-md); overflow: hidden; background: #000; }
.scan-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-aim { position: absolute; inset: 22% 12%; border: 2px solid var(--gold); border-radius: 12px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }

/* ---------- price tags ---------- */
.print-area { display: grid; gap: 12px; justify-content: start; }
.ptag {
  background: #fff; color: #000; display: grid; grid-template-rows: 1fr auto auto; gap: .6mm; overflow: hidden;
  font-family: var(--sans); border: 1px dashed #bbb; break-inside: avoid;
}
.print-label .ptag { width: 50mm; height: 25mm; padding: 1.5mm 2mm 1mm; }
.print-a4 { grid-template-columns: repeat(3, 63.5mm); grid-auto-rows: 38.1mm; column-gap: 2.5mm; row-gap: 0; }
.print-a4 .ptag { width: 63.5mm; height: 38.1mm; padding: 3mm 3.5mm 2mm; }
.ptag-top { display: flex; gap: 2mm; min-height: 0; align-items: flex-start; }
.ptag .qr { flex: none; height: 100%; max-height: 14mm; width: auto; aspect-ratio: 1; }
.print-a4 .ptag .qr { max-height: 20mm; }
.ptag-info { display: grid; gap: .3mm; min-width: 0; align-content: start; }
.ptag-brand { font-family: var(--serif); font-weight: 700; font-size: 6.5pt; letter-spacing: .08em; text-transform: uppercase; }
.ptag-title { font-size: 5.6pt; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ptag-price { font-size: 11pt; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ptag-price s { font-size: 6.5pt; font-weight: 600; margin-left: 1.5mm; color: #555; }
.print-a4 .ptag-brand { font-size: 8pt; }
.print-a4 .ptag-title { font-size: 7pt; }
.print-a4 .ptag-price { font-size: 14pt; }
.ptag .bc { width: 100%; height: 5.5mm; display: block; }
.print-a4 .ptag .bc { height: 8mm; }
.ptag-sku { font-size: 5.5pt; text-align: center; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.print-a4 .ptag-sku { font-size: 7pt; }

@page label { size: 50mm 25mm; margin: 0; }
@page sheet { size: A4; margin: 15.1mm 7.2mm 0; }
@media print {
  .nav, .toast, .no-print, .actionbar, dialog { display: none !important; }
  html, body { background: #fff !important; }
  .pane { padding: 0 !important; min-height: 0; }
  .screen { padding: 0 !important; max-width: none; display: block; }
  .ptag { border: 0; }
  .print-label { page: label; display: block; }
  .print-label .ptag:not(:last-child) { break-after: page; }
  .print-a4 { page: sheet; gap: 0 2.5mm; }
}
.row.inline { flex-wrap: nowrap; }
.row.inline > input { flex: 1; min-width: 0; width: auto; }

/* ---------- stock ---------- */
.stepper { display: flex; gap: 6px; align-items: center; }
.stepper input { width: 84px; text-align: center; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper .icon-btn { font-size: 1.3rem; font-weight: 700; line-height: 1; }
.stock-rows { display: grid; gap: 8px; }
.stock-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.stock-row:last-child { border-bottom: 0; }
.stock-row label { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.chiprow.wrap { flex-wrap: wrap; overflow: visible; }
.icon-btn.spinning svg { animation: spin 1s linear infinite; }

/* ---------- filters from the store's menus ---------- */
.fchip .c { font-weight: 600; opacity: .7; margin-left: 5px; font-variant-numeric: tabular-nums; }
.fchip.none { opacity: .55; }
.filter-btn { min-height: 40px; padding: 8px 14px; }
.filter-btn .badge { background: var(--violet); color: #fff; border-radius: 99px; font-size: .72rem; padding: 1px 7px; }
.filters .line .grow { flex: 1; }
.small-btn { min-height: 32px; padding: 4px 10px; font-size: .82rem; }
.fgroup { display: grid; gap: 2px; }
.fgroup h3 { margin-bottom: 4px; }
.frow { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-radius: 10px; font-weight: 700; cursor: pointer; }
.frow:hover { background: var(--surface-3); }
.frow input { width: 20px; height: 20px; accent-color: var(--violet); flex: none; }
.frow span:first-of-type { flex: 1; min-width: 0; }
.frow .c { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.frow.none span { color: var(--muted); }
.fnode details { margin-left: 36px; }
.fnode summary { font-size: .8rem; color: var(--violet); font-weight: 700; cursor: pointer; padding: 2px 0 6px; }
.fkids { display: grid; gap: 2px; }
.filters { grid-template-columns: minmax(0, 1fr); }
.filters .line { min-width: 0; }

/* ---------- deleting photos ---------- */
.pick .acts { left: 5px; flex-wrap: wrap; justify-content: flex-end; }
.pick .acts button.del { color: #9e2a1c; }
.shot-card { position: relative; }
.shot-card .x { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(20,10,18,.72); color: #fff; font-size: 1.05rem; line-height: 1; z-index: 2; }

/* ---------- viewer: zoom, move, turn ---------- */
.viewer-tools { display: flex; gap: 6px; align-items: center; flex: none; }
.viewer-tool { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #fff; display: grid; place-items: center; }
.viewer-tool svg { width: 20px; height: 20px; }
.viewer-tool:hover, .viewer-close:hover { background: rgba(255,255,255,.16); }
.viewer-stage { overflow: hidden; touch-action: none; cursor: zoom-in; user-select: none; -webkit-user-select: none; }
.viewer-stage.zoomed { cursor: grab; }
.viewer-stage.zoomed:active { cursor: grabbing; }
.viewer-img { transform-origin: center center; transition: opacity .15s, transform .12s ease-out; will-change: transform; pointer-events: none; -webkit-user-drag: none; }
.viewer-save { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; padding: 10px 16px; font-size: .9rem; font-weight: 600; }
.viewer-save .btn { min-height: 40px; padding: 8px 16px; }
@media (max-width: 520px) { .viewer-tools { gap: 4px; } .viewer-tool { width: 40px; height: 40px; } .viewer-top { padding-left: 12px; } }

/* The photo always fits the window first (on a laptop it was shown at its full
   1440 px and cut off), then zooms and moves from there. */
.viewer-stage { display: block; }
.viewer-img { position: absolute; inset: 0 8px 8px; width: calc(100% - 16px); height: calc(100% - 8px); max-width: none; max-height: none; object-fit: contain; border-radius: 0; }
.viewer-spin { left: 50%; top: 50%; margin: -12px 0 0 -12px; }

/* ---------- Posts ---------- */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px 12px; align-items: start; }
.post-card { display: grid; gap: 6px; text-decoration: none; color: var(--ink); min-width: 0; }
.post-thumb { position: relative; width: 100%; max-height: 300px; border-radius: var(--r-md); overflow: hidden; background: var(--surface-3); border: 1px solid var(--line); }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-thumb .tick { position: absolute; top: 8px; right: 8px; }
.post-card.picked .post-thumb { outline: 3px solid var(--violet); outline-offset: -3px; }
.post-card .t { font-weight: 700; font-size: .88rem; overflow-wrap: anywhere; }
.post-card .m { font-size: .78rem; color: var(--muted); }

.composer { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
.composer-preview { display: grid; gap: 10px; align-content: start; min-width: 0; }
.canvas-wrap { background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px; display: grid; place-items: center; }
.post-canvas { display: block; max-width: 100%; max-height: 62vh; width: auto; height: auto; box-shadow: var(--e2); }
@media (min-width: 1000px) {
  .composer { grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); align-items: start; }
  .composer-preview { position: sticky; top: 16px; }
}
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.preset { display: grid; gap: 4px; justify-items: start; text-align: left; padding: 10px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); min-width: 0; }
.preset[aria-pressed="true"] { border-color: var(--violet); box-shadow: 0 0 0 2px var(--violet) inset; background: var(--lilac); }
.preset b { font-size: .86rem; }
.shape-box { width: 100%; height: 64px; display: grid; place-items: center; }
.shape { display: block; height: 100%; max-width: 100%; border: 2px solid var(--violet); border-radius: 4px; background: var(--surface-3); }
.photo-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.photo-pick button { padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: var(--surface-3); aspect-ratio: 3 / 4; }
.photo-pick button.on { border-color: var(--violet); }
.photo-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fchip.swatch { display: inline-flex; align-items: center; gap: 6px; }
.fchip .sw { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--line-2); }
.post-current { display: grid; gap: 10px; }
.post-image { display: block; width: 100%; max-height: 70vh; padding: 0; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--surface-3); cursor: zoom-in; }
.post-image img { width: 100%; height: 100%; object-fit: contain; display: block; }
.option-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.option { display: grid; gap: 6px; align-content: start; }
.option .post-image { max-height: 240px; }
.hf-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; max-height: 280px; overflow: auto; }
.hf-preset { display: grid; gap: 2px; text-align: left; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); }
.hf-preset[aria-pressed="true"] { border-color: var(--violet); background: var(--lilac); }
.conn { display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.conn-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.pick-row { cursor: pointer; }
.pick-row input { width: 22px; height: 22px; accent-color: var(--violet); }

/* ---------- Posts: photos from the device ---------- */
.photo-slot { position: relative; }
.photo-slot > button:first-child { width: 100%; }
.photo-slot .from-device { position: absolute; left: 4px; bottom: 4px; font-size: .62rem; font-weight: 800; padding: 1px 6px; border-radius: 99px; background: rgba(20,10,18,.72); color: #fff; }
.photo-slot .x { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(20,10,18,.72); color: #fff; font-size: .9rem; line-height: 1; padding: 0; aspect-ratio: auto; }
.btn.ghost.danger { color: var(--red); }
.log .e-text { min-width: 0; overflow-wrap: anywhere; }
/* The search box's icon space; the general input rule above would otherwise win. */
.search input[type="search"] { padding-left: 40px; }
/* With a mouse, sideways rows show a thin scrollbar (the wheel scrolls them too, see app.js). */
@media (hover: hover) and (pointer: fine) {
  .chiprow, .seg { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; padding-bottom: 6px; }
  .chiprow::-webkit-scrollbar, .seg::-webkit-scrollbar { display: block; height: 6px; }
  .chiprow::-webkit-scrollbar-thumb, .seg::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }
}
/* The sign-in screen has no menu: no room kept for the rail (computer) or the tab bar (phone). */
.pane:has(> .signin) { margin-left: 0; padding-bottom: 0; }

/* ---------- sign-in card (SCRUM-14) ---------- */
/* The primary button's colours as tokens: plum with white text in the light theme;
   in the dark theme a plum button vanishes into the dark card, so it turns brand gold. */
:root { --primary: #2a1330; --primary-hover: #4b2656; --primary-ink: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --primary: #e8d3a0; --primary-hover: #f1e2bd; --primary-ink: #2a1330; } }
:root[data-theme="dark"] { --primary: #e8d3a0; --primary-hover: #f1e2bd; --primary-ink: #2a1330; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); transition: transform var(--speed), background var(--speed), box-shadow var(--speed); }
.btn.primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); box-shadow: 0 4px 14px rgba(42,19,48,.22); }
.btn.primary:focus-visible { box-shadow: var(--focus); }

/* Centred both ways at every width, clear of a phone's notch and home bar. */
.signin {
  min-height: 100dvh; place-items: center;
  padding: max(24px, env(safe-area-inset-top, 0px)) 16px max(24px, env(safe-area-inset-bottom, 0px));
}
.signin .card { width: min(400px, 100%); padding: clamp(22px, 6vw, 34px); gap: 18px; border-radius: 22px; box-shadow: var(--e3); }
.signin .mark { font-size: clamp(2rem, 8vw, 2.5rem); }
.signin .card > p { margin-top: -6px; }
.signin .field { gap: 7px; }
.signin .field > label { font-size: .82rem; }
.signin input { min-height: 48px; padding: 12px 14px; }
/* Placeholders read as hints, the same in both fields. */
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
/* A browser's saved-password fill keeps the field's own colours (Chrome paints it pale blue otherwise). */
.signin input:-webkit-autofill, .signin input:-webkit-autofill:hover, .signin input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink); caret-color: var(--ink);
  box-shadow: 0 0 0 1000px var(--surface-2) inset; transition: background-color 9999s;
}
.signin input:-webkit-autofill:focus { box-shadow: 0 0 0 1000px var(--surface) inset, var(--focus); }
.signin .btn.primary { min-height: 50px; font-size: 1rem; margin-top: 4px; }

/* ---------- Library (SCRUM-16) ---------- */
.lib-screen.dropping { outline: 3px dashed var(--violet); outline-offset: -6px; border-radius: var(--r-lg); background: var(--lilac); }
.lib-intro { gap: 10px 14px; }
.seg button .n { margin-left: 6px; font-weight: 600; opacity: .65; font-variant-numeric: tabular-nums; }
.lib-tools { display: flex; gap: 8px; align-items: center; min-width: 0; }
.lib-tools .search { flex: 1; min-width: 0; }
.lib-tools select { width: auto; flex: none; }
.lib-progress { display: grid; gap: 8px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); font-size: .88rem; font-weight: 600; }
.lib-progress .track { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.lib-progress .fill { display: block; height: 100%; width: 0; background: var(--violet); transition: width .2s; }
.lib-results { min-width: 0; }

.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px 12px; }
.lib-card { display: grid; gap: 5px; text-align: left; background: none; border: 0; padding: 0; color: var(--ink); min-width: 0; cursor: pointer; }
.lib-thumb { aspect-ratio: 1; border-radius: var(--r-md); overflow: hidden; background: var(--surface-3); border: 1px solid var(--line); display: grid; place-items: center; transition: box-shadow var(--speed), transform var(--speed); }
.lib-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib-card:hover .lib-thumb { box-shadow: var(--e2); transform: translateY(-1px); }
.lib-card:focus-visible { outline: none; }
.lib-card:focus-visible .lib-thumb { box-shadow: var(--focus); }
.lib-card .t, .lib-row .t { font-weight: 700; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-card .m, .lib-row .m { font-size: .76rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lib-face { width: 100%; height: 100%; display: grid; place-content: center; justify-items: center; gap: 6px; color: var(--violet); background: var(--lilac); }
.lib-face svg { width: 34px; height: 34px; }
.lib-face span { font-size: .8rem; font-weight: 800; letter-spacing: .08em; }
.lib-face.video { color: var(--teal); background: var(--teal-bg); }
.lib-face.small svg { width: 18px; height: 18px; }
.lib-face.small span { font-size: .56rem; }

.lib-list { display: grid; gap: 6px; }
.lib-row { display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 6px 8px 6px 6px; min-width: 0; }
.lib-row-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; background: none; border: 0; padding: 0; color: var(--ink); text-align: left; cursor: pointer; }
.lib-mini { width: 48px; height: 48px; flex: none; border-radius: 10px; overflow: hidden; background: var(--surface-3); }
.lib-mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib-row-text { display: grid; gap: 2px; min-width: 0; }

.lib-preview { border-radius: var(--r-md); overflow: hidden; background: var(--surface-3); display: grid; place-items: center; min-height: 160px; max-height: 52vh; }
.lib-preview .lib-face { min-height: 180px; }
.lib-preview-img { max-width: 100%; max-height: 52vh; object-fit: contain; display: block; }
.lib-preview-video { width: 100%; max-height: 52vh; background: #000; display: block; }
.lib-inline { display: flex; gap: 8px; min-width: 0; }
.lib-inline input { flex: 1; min-width: 0; width: auto; }
.lib-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: .88rem; }
.lib-facts dt { color: var(--muted); font-weight: 700; }
.lib-facts dd { margin: 0; overflow-wrap: anywhere; }
.lib-actions { justify-content: space-between; }
@media (max-width: 520px) {
  .lib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; }
  .lib-tools { flex-wrap: wrap; }
  .lib-tools .search { flex-basis: 100%; }
  .lib-tools select { flex: 1; width: auto; }
}

/* ---------- photo downloads (SCRUM-13) ---------- */
/* Bottom-right of each photo tile; Main / Hide / Delete move left to make room. */
.pick .dl { position: absolute; right: 5px; bottom: 5px; width: 30px; height: 30px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(255,255,255,.94); color: #2a1330; box-shadow: var(--e2); z-index: 1; }
.pick .dl svg { width: 16px; height: 16px; }
.pick .dl:hover { background: #fff; }
.pick .dl:disabled { opacity: .6; }
.pick .dl ~ .acts { right: 40px; }
/* Bottom-right of the photo in the viewer. */
.viewer-dl { position: absolute; right: 18px; bottom: 18px; z-index: 2; width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: rgba(20,10,18,.62); color: #fff; display: grid; place-items: center; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.viewer-dl svg { width: 20px; height: 20px; }
.viewer-dl:hover { background: rgba(20,10,18,.8); }
.viewer-dl:disabled, .viewer-tool:disabled { opacity: .5; }
/* Six tools on a phone: smaller buttons, and the caption on one line. */
.viewer-caption { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 480px) {
  .viewer-top { gap: 8px; padding-left: 12px; }
  .viewer-tools { gap: 4px; }
  .viewer-tool { width: 38px; height: 38px; }
  .viewer-tool svg { width: 18px; height: 18px; }
}

/* ---------- Library: choosing several (SCRUM-16) ---------- */
.lib-selectrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lib-selectall { display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 14px 6px 8px; font-weight: 700; font-size: .86rem; }
.lib-selectall:hover { background: var(--surface-3); }
.lib-thumb { position: relative; }
.lib-thumb .tick { position: absolute; top: 8px; left: 8px; box-shadow: var(--e2); }
.lib-card.picked .lib-thumb { outline: 3px solid var(--violet); outline-offset: -3px; }
.lib-row.picked { border-color: var(--violet); box-shadow: inset 0 0 0 1px var(--violet); }
.lib-row-main .tick { flex: none; }

/* ---------- a piece's photos: choosing several, delete all (SCRUM-16) ---------- */
.photo-tools { gap: 8px; }
.photo-selbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.photo-selbar .state { flex: 1; min-width: 110px; font-weight: 800; font-size: .86rem; }
.photo-selbar .hint { flex-basis: 100%; font-size: .78rem; color: var(--muted); }
.pick .tick { position: absolute; top: 7px; right: 7px; z-index: 2; box-shadow: var(--e2); pointer-events: none; }
.pick.picked { outline: 3px solid var(--violet); outline-offset: -3px; }

/* ---------- Library > On the website (SCRUM-24) ---------- */
.lib-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-top: -4px; overflow-x: auto; scrollbar-width: none; }
.lib-tab { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; font-weight: 800; font-size: .9rem; color: var(--muted); text-decoration: none; border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.lib-tab svg { width: 18px; height: 18px; }
.lib-tab:hover { color: var(--ink); }
.lib-tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--gold-2); }
.lib-onweb { position: absolute; bottom: 8px; left: 8px; box-shadow: var(--e1); }

.web-body { gap: 18px; }
.web-lede { max-width: 68ch; }
.web-list { display: grid; gap: 8px; }
.web-row { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px; min-width: 0; }
.web-row.off { opacity: .62; }
.web-row-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; background: none; border: 0; padding: 0; color: var(--ink); text-align: left; cursor: pointer; }
.web-row-text { display: grid; gap: 3px; min-width: 0; }
.web-row .t { font-weight: 800; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.web-row .t.wrap { white-space: normal; font-weight: 700; }
.web-row .m { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.web-banner-thumb { width: 112px; aspect-ratio: 16 / 9; flex: none; border-radius: 10px; overflow: hidden; background: var(--surface-3); }
.web-banner-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.web-move { display: flex; flex-direction: column; gap: 2px; flex: none; }
.web-move .icon-btn { width: 34px; height: 30px; }
.web-move .icon-btn:disabled { opacity: .3; }
.web-switch { flex: none; display: grid; place-items: center; width: 40px; height: 40px; cursor: pointer; }
.web-switch input { width: 20px; height: 20px; accent-color: #6b3fa0; }
.web-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }

/* The banner as the homepage shows it: the picture with the words over its left side. */
.web-preview { position: relative; aspect-ratio: 2 / 1; border-radius: var(--r-md); overflow: hidden; background: #2a1330; }
.web-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.web-preview::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(24,4,19,.78) 0%, rgba(24,4,19,.35) 60%, rgba(24,4,19,.05) 100%); }
.web-preview-empty { position: absolute; inset: 0; display: grid; place-items: center; color: #d9bd7e; font-weight: 800; }
.web-preview-text { position: absolute; z-index: 1; left: 6%; top: 50%; transform: translateY(-50%); width: 58%; display: grid; gap: 5px; color: #fff; }
.web-preview-text .k { font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: #d9bd7e; font-weight: 800; }
.web-preview-text .hd { font-family: var(--serif); font-size: clamp(.95rem, 3.6vw, 1.5rem); line-height: 1.12; font-weight: 700; text-wrap: balance; }
.web-preview-text .tx { font-size: .7rem; line-height: 1.4; opacity: .9; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.web-preview-text .cta { justify-self: start; margin-top: 3px; font-size: .64rem; font-weight: 800; padding: 5px 10px; border-radius: 99px; background: #d9bd7e; color: #2a1330; }

.web-cat-thumb { aspect-ratio: 3 / 4; }
.web-tile-no { position: absolute; top: 8px; left: 8px; box-shadow: var(--e1); }
.web-more summary { cursor: pointer; font-weight: 800; padding: 6px 0; }
.web-more[open] { display: grid; gap: 10px; }
.web-cat-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.web-cat-compare figure { margin: 0; display: grid; gap: 6px; }
.web-cat-compare img, .web-cat-compare .lib-face { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--r-md); }
.web-cat-compare figcaption { font-size: .78rem; font-weight: 800; color: var(--muted); text-align: center; }
.web-pick-grid { max-height: 52vh; overflow-y: auto; padding: 2px; }

.web-brand { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.web-brand-item { display: grid; gap: 10px; align-content: start; }
/* The menu bar is white on the website, so the logo is shown on white in both themes. */
.web-logo-stage { min-height: 110px; display: grid; place-items: center; padding: 18px; border-radius: var(--r-md); background: #fff; border: 1px solid var(--line); }
.web-logo-stage img { max-width: 100%; max-height: 64px; object-fit: contain; }
.web-icon-stage { min-height: 110px; display: flex; align-items: center; justify-content: center; gap: 18px; padding: 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); flex-wrap: wrap; }
.web-icon-stage img.big { width: 72px; height: 72px; border-radius: 16px; box-shadow: var(--e1); }
.web-tab { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px 10px 0 0; background: var(--surface); border: 1px solid var(--line); border-bottom: 0; font-size: .8rem; font-weight: 600; }
.web-tab img { width: 16px; height: 16px; }
@media (max-width: 520px) {
  .web-banner-thumb { width: 84px; }
  .web-preview-text { width: 78%; }
}

/* ---------- photo crop (SCRUM-23) ---------- */
.viewer.cropping .viewer-nav, .viewer.cropping .viewer-dl,
.viewer.cropping .viewer-tool:not([aria-label="Crop the photo"]) { display: none; }
.viewer.cropping .viewer-stage { cursor: default; }
.crop-layer { position: absolute; z-index: 3; touch-action: none; }
.crop-frame { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(14,8,13,.62); cursor: move; touch-action: none; }
.crop-layer { overflow: hidden; }
.crop-grid { position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, transparent calc(33.33% - .5px), rgba(255,255,255,.45) calc(33.33% - .5px) calc(33.33% + .5px), transparent calc(33.33% + .5px) calc(66.66% - .5px), rgba(255,255,255,.45) calc(66.66% - .5px) calc(66.66% + .5px), transparent calc(66.66% + .5px)),
    linear-gradient(180deg, transparent calc(33.33% - .5px), rgba(255,255,255,.45) calc(33.33% - .5px) calc(33.33% + .5px), transparent calc(33.33% + .5px) calc(66.66% - .5px), rgba(255,255,255,.45) calc(66.66% - .5px) calc(66.66% + .5px), transparent calc(66.66% + .5px)); }
/* Big enough for a thumb, drawn as a gold corner. */
.crop-handle { position: absolute; width: 34px; height: 34px; touch-action: none; }
.crop-handle::after { content: ""; position: absolute; width: 18px; height: 18px; border: 4px solid var(--gold); }
.crop-handle.nw { left: -12px; top: -12px; cursor: nwse-resize; }
.crop-handle.nw::after { left: 12px; top: 12px; border-right: 0; border-bottom: 0; }
.crop-handle.ne { right: -12px; top: -12px; cursor: nesw-resize; }
.crop-handle.ne::after { right: 12px; top: 12px; border-left: 0; border-bottom: 0; }
.crop-handle.sw { left: -12px; bottom: -12px; cursor: nesw-resize; }
.crop-handle.sw::after { left: 12px; bottom: 12px; border-right: 0; border-top: 0; }
.crop-handle.se { right: -12px; bottom: -12px; cursor: nwse-resize; }
.crop-handle.se::after { right: 12px; bottom: 12px; border-left: 0; border-top: 0; }
/* Placed like the photo itself: the whole stage, fitted. */
.crop-preview { position: absolute; inset: 0 8px 8px; width: calc(100% - 16px); height: calc(100% - 8px); object-fit: contain; }
.viewer-save .crop-shapes { flex: 0 1 auto; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.15); }
.viewer-save .crop-shapes button { color: rgba(255,255,255,.75); }

/* ---------- stores: clothing and jewellery ----------
   Someone with both stores sees Clothing | Jewellery above every screen title.
   Both stores are the brand's violet and gold (client, 2026-10-26: no green,
   no marker lines). Jewellery is told apart by its shade: a deeper, bluer royal
   violet where clothing has its red plum (the rail, primary buttons, tints and
   the page itself), the gold kept as it is, and a gold pill with a diamond in
   the store switch. */
:root[data-store="jewellery"] {
  --plum: #231748; --plum-2: #33215f; --plum-3: #46307c;
  --bg: #f2f0f8; --bg-2: #e8e4f3; --surface-2: #f9f8fc; --surface-3: #f0edf8;
  --line: #e1dcee; --line-2: #d3cce5;
  --lilac: #e2dbf6; --violet: #5a3fb0; --focus: 0 0 0 3px rgba(90,63,176,.32);
  --primary: #231748; --primary-hover: #46307c;
}
@media (prefers-color-scheme: dark) {
  :root[data-store="jewellery"]:not([data-theme="light"]) {
    --plum: #1a1434; --plum-2: #282051; --plum-3: #3a2f6b;
    --bg: #100f18; --bg-2: #161422; --surface: #1a1826; --surface-2: #201d2f; --surface-3: #272339;
    --line: #2d2946; --line-2: #3a3558; --lilac: #29234c; --violet: #b4a7f5;
    --primary: #e8d3a0; --primary-hover: #f1e2bd;
  }
}
:root[data-store="jewellery"][data-theme="dark"] {
  --plum: #1a1434; --plum-2: #282051; --plum-3: #3a2f6b;
  --bg: #100f18; --bg-2: #161422; --surface: #1a1826; --surface-2: #201d2f; --surface-3: #272339;
  --line: #2d2946; --line-2: #3a3558; --lilac: #29234c; --violet: #b4a7f5;
  --primary: #e8d3a0; --primary-hover: #f1e2bd;
}

.top { flex-wrap: wrap; }
.top > .store-row { flex: 0 0 100%; margin-bottom: -6px; }
/* The title shrinks (its words wrap) rather than pushing the tools to a line of their own, down to about two
   words' width: below that, on a phone with several tools, the tools go under it instead of a word being cut in
   two ("quotatio / n", "Merge / d file"; SCRUM-108). A code longer than the line still wraps. */
.top > .titles { flex: 1 1 12rem; }
.top h1 { overflow-wrap: break-word; }
.top > .tools { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; max-width: 100%; }
/* Nothing may be wider than a phone (a wider element widens the whole page and pushes the tab bar's More off
   the edge): a long button label wraps onto a second line there (SCRUM-108). */
.btn { max-width: 100%; }
@media (max-width: 599px) {
  .btn { white-space: normal; text-align: center; }
}
.store-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); max-width: 100%; }
.store-switch button { border: 0; background: none; border-radius: 999px; padding: 6px 12px; font: 700 .8rem/1.1 var(--sans); color: var(--muted); cursor: pointer; white-space: nowrap; }
.store-switch button:hover { color: var(--ink); }
.store-switch button:focus-visible { outline: none; box-shadow: var(--focus); }
.store-switch button[aria-pressed="true"] { background: var(--plum); color: var(--gold); }
/* Jewellery: a small diamond before its name, and a gold pill when it is the store in use. */
.store-switch button[data-store="jewellery"]::before { content: "\25C6"; margin-right: 5px; font-size: .62rem; vertical-align: 1px; color: var(--gold-ink); }
.store-switch button[data-store="jewellery"][aria-pressed="true"] { background: linear-gradient(180deg, var(--gold), var(--gold-2)); color: #2a1330; }
.store-switch button[data-store="jewellery"][aria-pressed="true"]::before { color: #2a1330; }
.store-switch .warn-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--red); margin-left: 6px; vertical-align: 1px; }

.store-access-row { justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.store-access-picks { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.store-access-picks select { width: auto; min-width: 7.5rem; }

/* ---------- jewellery rates (rates.js) ---------- */
.rate-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .rate-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.rate-tile { text-align: left; font: inherit; cursor: default; gap: 4px; }
button.rate-tile { cursor: pointer; }
button.rate-tile:hover { border-color: var(--line-2); box-shadow: var(--e2); }
button.rate-tile:focus-visible, .rate-card:focus-visible, .rate-strip:focus-visible { outline: none; box-shadow: var(--focus); }
.rate-tile .n { font-size: 1.3rem; }
.rate-tile .n small { font-size: .75rem; font-weight: 700; color: var(--muted); }
.rate-src { font-size: .74rem; color: var(--muted); overflow-wrap: anywhere; }
.rate-src.manual { color: var(--amber); font-weight: 700; }
.rate-chg { font-size: .74rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.rate-chg.up { color: var(--teal); }
.rate-chg.down { color: var(--red); }

.rate-chart-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px; overflow-x: auto; }
.rate-chart { display: block; width: 100%; min-width: 320px; height: auto; }
.rate-chart .grid { stroke: var(--line); stroke-width: 1; }
.rate-chart .axis { fill: var(--muted); font: 600 11px var(--sans); font-variant-numeric: tabular-nums; }
.rate-chart .area { fill: color-mix(in srgb, var(--gold) 30%, transparent); stroke: none; }
.rate-chart .line { fill: none; stroke: var(--gold-ink); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.rate-chart .dot { fill: var(--gold-ink); }
.rate-chart .end { fill: var(--surface); stroke: var(--gold-ink); stroke-width: 2.5; }

.card-group { display: grid; gap: 8px; }
.card-group h3 { margin: 6px 0 0; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.rate-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 14px; box-shadow: var(--e1); }
button.rate-card { cursor: pointer; }
button.rate-card:hover { border-color: var(--line-2); }
.rate-card.off { opacity: .62; }
.card-rate { display: grid; justify-items: end; gap: 2px; flex: none; text-align: right; font-variant-numeric: tabular-nums; }

.settings-list { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; margin: 0; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.settings-list dt { color: var(--muted); font-weight: 600; }
.settings-list dd { margin: 0; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
/* Values that are sentences (Supplier rates): label above value on a phone. */
@media (max-width: 600px) { .settings-list.long-values { grid-template-columns: minmax(0, 1fr); gap: 2px; } .settings-list.long-values dd { text-align: left; margin-bottom: 8px; } }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
@media (max-width: 420px) { .settings-grid { grid-template-columns: minmax(0, 1fr); } }

.rate-strip { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: flex-end; padding: 12px 14px; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--e1); }
.strip-item { display: grid; gap: 1px; min-width: 0; }
.strip-item .l { font-size: .72rem; font-weight: 800; letter-spacing: .06em; color: var(--muted); }
.strip-item b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.strip-src { flex-basis: 100%; font-size: .74rem; color: var(--muted); }

/* A quotation being read (imports.js readingPanel). */
.imp-reading { display: grid; gap: 10px; padding: 18px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--e1); }
.imp-reading-head { display: flex; align-items: center; gap: 10px; }
.imp-reading-head b { flex: 1; font-size: 1.02rem; }
.imp-clock { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--muted); }
.imp-reading p { margin: 0; }
.imp-bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.imp-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold-2), var(--gold)); transition: width .4s ease; }

/* ---------- jewellery pieces (jewellery.js) ---------- */
.btn.small { min-height: 34px; padding: 6px 12px; font-size: .82rem; }
.jw-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--e1); }
.jw-row:hover { border-color: var(--line-2); }
.jw-row:focus-visible { outline: none; box-shadow: var(--focus); }
/* Daily prices (repricing.js). */
.jw-tight { display: grid; gap: 2px; min-width: 0; }
.jw-tight .row { margin-top: 6px; flex-wrap: wrap; }
.strong-link { font-weight: 800; color: var(--ink); text-decoration: none; }
.strong-link:hover { text-decoration: underline; }
.jw-row-end { display: grid; justify-items: end; gap: 4px; flex: none; font-variant-numeric: tabular-nums; }
/* Pieces filters (SCRUM-90): small boxes in a wrapping row. */
.jw-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.jw-filters .field { margin: 0; flex: 1 1 140px; min-width: 0; }
.jw-filters .field.price { flex: 0 1 110px; }
.jw-filters label { font-size: .74rem; }
.jw-filters select, .jw-filters input { min-height: 38px; padding-top: 6px; padding-bottom: 6px; font-size: .88rem; }
@media (max-width: 520px) { .jw-filters .field, .jw-filters .field.price { flex: 1 1 calc(50% - 4px); } }
.jw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 12px; }
.jw-lines { display: grid; gap: 8px; }
.jw-line { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; display: grid; gap: 8px; min-width: 0; }
.jw-line-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.jw-line-head select { width: auto; min-width: 160px; font-weight: 700; }
.jw-remove { width: 34px; height: 34px; }
.jw-cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.jw-cell { display: grid; gap: 3px; min-width: 0; }
.jw-cell label { font-size: .72rem; font-weight: 700; color: var(--muted); }
.jw-cell input { min-width: 0; font-variant-numeric: tabular-nums; }
/* The Code box's suggestions (jewellery.js codePicker): Studio's own list, in the theme. */
.jw-combo { position: relative; }
.jw-suggest {
  position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; min-width: 100%; width: max-content; max-width: min(360px, 86vw);
  max-height: 264px; overflow-y: auto; margin: 0; padding: 5px; list-style: none;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--e2);
}
.jw-suggest li { display: flex; align-items: baseline; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.jw-suggest li b { font-weight: 800; font-variant-numeric: tabular-nums; }
.jw-suggest li span { color: var(--muted); font-size: .84rem; overflow: hidden; text-overflow: ellipsis; }
.jw-suggest li:hover, .jw-suggest li[aria-selected="true"] { background: var(--surface-3); }
.jw-suggest li.current b { color: var(--violet); }
.jw-code { grid-column: span 2; }
.jw-price { display: grid; gap: 10px; }
.jw-price-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 6px 16px; }
.jw-big { font-size: 1.9rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.jw-table { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.jw-table table { width: 100%; border-collapse: collapse; font-size: .86rem; font-variant-numeric: tabular-nums; min-width: 520px; }
.jw-table th, .jw-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.jw-table th { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); }
.jw-table .r { text-align: right; white-space: nowrap; }
.jw-table tfoot td { font-weight: 800; border-bottom: 0; }
.jw-table tfoot tr.muted td { font-weight: 600; color: var(--muted); }
.jw-table tr.bad td { background: var(--red-bg); }
/* A group's total under its lines: gold, diamonds, stones (SCRUM-94). */
.jw-table tr.jw-sub td { background: var(--surface-2, var(--bg)); border-bottom: 2px solid var(--line-2); }
.jw-problem { color: var(--red); font-weight: 700; margin-top: 2px; }
.jw-actions { justify-content: flex-end; flex-wrap: wrap; }

/* ---------- quotation imports (imports.js) ---------- */
.imp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.imp-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--e1); }
.imp-card.done { opacity: .72; }
.imp-card select { width: 100%; }
.imp-pic { width: 96px; height: 96px; flex: none; border-radius: var(--r-sm); object-fit: contain; background: var(--surface-3); }
.imp-pic.none { display: grid; place-items: center; text-align: center; font-size: .7rem; color: var(--muted); padding: 6px; }
/* ---------- reports (reports.js, SCRUM-76) ---------- */
.rp-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 16px; align-items: start; }
.rp-title { margin: 0; }
.rp-block { padding: 0; overflow: hidden; }
.rp-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px; background: var(--surface-3); border-bottom: 1px solid var(--line); }
.rp-head h3 { margin: 0; font-size: .95rem; }
/* On a phone the label keeps room for two or three words and a long note wraps under its figure, rather than the
   note squeezing the label to a word a line over the top of it (SCRUM-108, at 320 px). */
.rp-rows { display: grid; grid-template-columns: minmax(6.5rem, 1fr) minmax(0, max-content); margin: 0; }
.rp-rows dd .small { text-align: right; }
.rp-rows dt, .rp-rows dd { margin: 0; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.rp-rows dd { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.rp-rows dt:nth-last-child(2), .rp-rows dd:last-child { border-bottom: 0; }
.rp-rows b { font-variant-numeric: tabular-nums; font-size: 1.05rem; }
/* An import item to enter by hand (SCRUM-78): its reasons, then the button. */
.imp-hand { gap: 4px; align-items: flex-start; }
/* The day bought and its metal rates (SCRUM-74): amber while a rate is still to be typed in. */
.jw-buy.need { border-color: var(--amber-line); background: var(--amber-bg); }
.jw-buy .row { flex-wrap: wrap; gap: 8px; align-items: center; }
.jw-buy input[type="number"] { width: 10rem; }
.jw-buy-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: baseline; }
.jw-buy-row > .muted { grid-column: 1 / -1; }
.jw-buy-row.need { grid-template-columns: minmax(0, 1fr); }
/* Invoices (invoices.js): a piece to tick in the picker. */
.jw-row.jw-pick { justify-content: flex-start; cursor: pointer; }
.jw-row.jw-pick input { width: 20px; height: 20px; accent-color: #6b3fa0; flex: none; }
/* Delete forever on the jewellery lists (jw-delete.js). */
.jw-row .row-trash { flex: none; margin-left: -4px; color: var(--muted); }
.jw-row .row-trash:hover { color: var(--red); }
.jw-row.choosing { justify-content: flex-start; }
.jw-row.choosing > .jw-row-end, .jw-row.choosing > .pill { margin-left: auto; }
.jw-row.cannot { opacity: .5; }
.jw-row.picked { border-color: var(--violet); }
/* Margins (margins.js): the figures beside each piece. */
#mg-quotation { width: auto; min-width: 200px; flex: 0 1 auto; }
.mg-row { align-items: flex-start; }
.mg-figs { display: grid; grid-template-columns: auto auto; gap: 1px 10px; margin: 0; font-size: .8rem; font-variant-numeric: tabular-nums; flex: none; }
.mg-figs dt { color: var(--muted); text-align: right; }
.mg-figs dd { margin: 0; text-align: right; }
.mg-figs dd.strong { font-weight: 800; }
.mg-row.below .mg-figs dd.strong { color: var(--red); }
@media (max-width: 520px) { .mg-row { flex-direction: column; } .mg-figs { width: 100%; grid-template-columns: 1fr auto; } .mg-figs dt { text-align: left; } }
/* How a price is worked out (rates.js). */
.how-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: .9rem; }
.jw-table tr.strong td { font-weight: 800; }
/* The PDF viewer (pdf-viewer.js): pdf.js inside a full-screen layer. */
.pdfv { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; background: #3b3640; }
.pdfv-bar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; background: #1d1720; color: #fff; }
.pdfv-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .95rem; }
.pdfv-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: rgba(255,255,255,.08); color: #fff; cursor: pointer; text-decoration: none; }
.pdfv-btn:hover { background: rgba(255,255,255,.18); }
.pdfv-btn svg { width: 20px; height: 20px; }
.pdfv-text { border: 0; border-radius: 10px; padding: 0 12px; height: 40px; background: rgba(255,255,255,.12); color: #fff; font-weight: 700; font-size: .85rem; cursor: pointer; white-space: nowrap; }
.pdfv-text:hover { background: rgba(255,255,255,.22); }
@media (max-width: 520px) { .pdfv-zoom { display: none; } }
.pdfv-zoom { min-width: 46px; text-align: center; font-size: .8rem; font-variant-numeric: tabular-nums; color: #ddd; }
.pdfv-pages { position: absolute; top: 56px; left: 0; right: 0; bottom: 0; overflow: auto; outline: none; }
.pdfv-pages .pdfViewer { padding: 12px 0; }
.pdfv-status { position: absolute; top: 45%; left: 0; right: 0; text-align: center; color: #fff; font-weight: 700; padding: 0 16px; }
.pdfv-status.bad { color: #ffb4ab; }
body.pdfv-open { overflow: hidden; }
.jw-thumb { width: 56px; height: 56px; flex: none; border-radius: var(--r-sm); object-fit: contain; background: var(--surface-3); }
.jw-photo { width: 100%; max-width: 360px; max-height: 360px; object-fit: contain; border-radius: var(--r-md); background: var(--surface-3); border: 1px solid var(--line); }

/* Paid orders from Shopify (invoices.js renderOrders): why one waits, and what to do. */
.ord-row { align-items: flex-start; }
.ord-problems { margin: 4px 0 2px; padding-left: 18px; color: var(--red); }
.ord-problems li + li { margin-top: 2px; }

/* ---------- Help (SCRUM-135) ---------- */
.hp-searchbox { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 0 12px; }
.hp-searchbox svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.hp-search { border: 0; background: none; flex: 1; min-width: 0; min-height: 44px; font: inherit; color: var(--ink); outline: none; }
.hp-group h2 { font-size: 1rem; }
.hp-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.hp-topic { gap: 4px; }
.hp-topic-head { justify-content: space-between; gap: 8px; align-items: flex-start; }
.hp-clipcount { font-size: .74rem; font-weight: 700; color: var(--violet); }
.hp-new h2 { font-size: 1rem; }
.hp-newlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hp-newlist li { display: grid; grid-template-columns: 4.2rem 1fr; gap: 8px; align-items: baseline; }
.hp-date { font-size: .78rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.hp-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.hp-step { gap: 10px; }
.hp-step.hp-over { border-color: var(--violet); box-shadow: 0 0 0 3px var(--lilac); }
.hp-step-head { align-items: flex-start; gap: 12px; }
.hp-step-head p { margin: 0; line-height: 1.5; }
.hp-n { flex: none; width: 28px; height: 28px; border-radius: 99px; display: grid; place-items: center; font-weight: 800; font-size: .85rem; background: var(--lilac); color: var(--violet); }
.hp-clip { display: block; width: 100%; max-width: 720px; max-height: 70vh; object-fit: contain; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-3); }
.hp-tools { flex-wrap: wrap; gap: 8px; align-items: center; }
.hp-drop-hint { flex: 1 1 12rem; }
.hp-next { margin-top: 4px; }
@media (max-width: 600px) { .hp-drop-hint { display: none; } }
