/* Layout: fixed sidebar + content; the artwork takes centre stage and the interface steps back.
   Neutral "gallery wall" palette with a single ultramarine accent. */
:root {
  --bg: #f3f3f0;
  --surface: #ffffff;
  --surface-2: #ebebe7;
  --wall: #e6e5e0;
  --ink: #17181b;
  --ink-2: #3c3e44;
  --muted: #6c6f77;
  --line: #dddcd6;
  --accent: #2438c4;
  --accent-ink: #ffffff;
  --accent-soft: #e4e7fa;
  --shadow: 0 1px 2px rgba(20, 20, 30, .06), 0 8px 24px rgba(20, 20, 30, .06);
  --art-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 18px 40px rgba(0, 0, 0, .18);

  --st-available: #2f8a57;
  --st-reserved: #c98a12;
  --st-sold: #d3302f;
  --st-loan: #6b4fc9;
  --st-consignment: #13808a;
  --st-nfs: #7b7f8e;

  --f-display: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;  /* headings and figures */
  --f-work: 'Newsreader', 'Iowan Old Style', Georgia, serif;  /* only for the titles of artworks */
  --f-ui: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;

  --r-sm: 6px;
  --r-md: 10px;
  --sidebar: 232px;
}
/* Light is the default; the dark theme is opt-in from the sidebar */
:root[data-theme="dark"] {
  --bg: #121315; --surface: #1a1b1e; --surface-2: #232428; --wall: #1f2023;
  --ink: #ecebe7; --ink-2: #c9c8c3; --muted: #9a9ca4; --line: #2d2f33;
  --accent: #8796ff; --accent-ink: #0d1030; --accent-soft: #23284a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3);
  --art-shadow: 0 2px 6px rgba(0, 0, 0, .5), 0 20px 50px rgba(0, 0, 0, .55);
  --st-available: #4cb47c; --st-reserved: #e0a632; --st-sold: #ef5a54; --st-loan: #9a85ec; --st-consignment: #3bb1ba; --st-nfs: #a3a7b5;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--f-ui);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
em, .t-title { font-style: italic; }
.wt { font-family: var(--f-work); font-style: italic; }
.mono { font-family: var(--f-mono); font-size: .86em; letter-spacing: .01em; }
.muted { color: var(--muted); }
h1, h2, h3 { margin: 0; font-weight: 500; text-wrap: balance; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Structure ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100%; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 28px;
  padding: 26px 16px 18px;
  border-right: 1px solid var(--line);
  background: var(--bg);
}
.brand { display: flex; flex-direction: column; padding: 0 10px; }
.brand-logo, .cert-logo svg, .doc-logo svg, .bio-cover-logo svg { width: 148px; height: auto; fill: currentColor; stroke: none; color: var(--ink); display: block; }
.brand-sub { font-size: 11px; text-transform: uppercase; letter-spacing: .22em; color: var(--muted); margin: 6px 0 0 15px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .nav-soon {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px; border-radius: var(--r-sm);
  color: var(--ink-2); font-weight: 500;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.nav a.active svg { color: var(--accent); }
.nav-group { margin: 18px 10px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .16em; color: var(--muted); }
.nav-soon { color: var(--muted); opacity: .7; cursor: default; font-weight: 400; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 0 10px; }
.proto-tag { font-size: 11px; letter-spacing: .06em; color: var(--muted); border: 1px dashed var(--line); border-radius: 99px; padding: 4px 10px; align-self: flex-start; }
.sidebar-actions { display: flex; align-items: center; gap: 8px; }

.main-wrap { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 14px clamp(16px, 3vw, 40px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--line); }
main { padding: 18px clamp(16px, 3vw, 40px) 80px; outline: none; }

/* ---------- Search ---------- */
.search { position: relative; flex: 1; max-width: 640px; display: flex; align-items: center; }
.search > svg { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; height: 44px; padding: 0 16px 0 42px;
  border: 1px solid var(--line); border-radius: 99px;
  background: var(--surface); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search input::placeholder { color: var(--muted); }
.suggest {
  position: absolute; top: 52px; left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow); padding: 8px; max-height: 70vh; overflow: auto;
}
.suggest-group { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); padding: 8px 10px 4px; }
.suggest-item { display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-radius: var(--r-sm); cursor: pointer; }
.suggest-item:hover, .suggest-item.sel { background: var(--surface-2); }
.suggest-item img, .suggest-item .ph { width: 36px; height: 36px; object-fit: cover; border-radius: 3px; background: var(--wall); }
.suggest-item small { color: var(--muted); display: block; font-size: 12px; }
.suggest-all { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; color: var(--accent); font-weight: 500; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 99px; border: 1px solid var(--line); background: var(--surface);
  font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.icon-btn:hover { border-color: var(--ink-2); }
.text-btn { background: none; border: 0; color: var(--muted); font-size: 13px; cursor: pointer; padding: 4px; }
.text-btn:hover { color: var(--ink); text-decoration: underline; }
.link { color: var(--accent); cursor: pointer; background: none; border: 0; padding: 0; font-weight: 500; }
.link:hover { text-decoration: underline; }

/* ---------- Page headers ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 18px 0 22px; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .16em; color: var(--muted); margin-bottom: 8px; }
.page-title { font-family: var(--f-display); font-size: clamp(32px, 4vw, 46px); line-height: 1.05; letter-spacing: -.015em; font-weight: 400; }
.page-title em { font-style: italic; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-weight: 600; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.section-title a, .section-title button { text-transform: none; letter-spacing: 0; font-size: 14px; }

/* ---------- Statuses ---------- */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--muted); }
.st-available { --st: var(--st-available); }
.st-reserved { --st: var(--st-reserved); }
.st-sold { --st: var(--st-sold); }
.st-loan { --st: var(--st-loan); }
.st-consignment { --st: var(--st-consignment); }
.st-nfs { --st: var(--st-nfs); }
.dot[class*="st-"] { background: var(--st); }
.pill {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px;
  border-radius: 99px; font-size: 13px; font-weight: 500;
  background: color-mix(in srgb, var(--st, var(--muted)) 13%, transparent);
  color: color-mix(in srgb, var(--st, var(--muted)) 75%, var(--ink));
  border: 1px solid color-mix(in srgb, var(--st, var(--muted)) 30%, transparent);
}
.pill .dot { background: var(--st); }
button.pill { cursor: pointer; }
button.pill:hover { border-color: var(--st); }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 9px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); }
.tag-warn { background: color-mix(in srgb, var(--st-reserved) 16%, transparent); color: color-mix(in srgb, var(--st-reserved) 70%, var(--ink)); }

/* ---------- Dashboard ---------- */
.kpis { display: flex; flex-wrap: wrap; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; margin-bottom: 18px; }
.kpi { flex: 1 1 170px; background: var(--surface); padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.kpi-label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.kpi-value { font-family: var(--f-display); font-size: 38px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-value.money { font-size: 30px; }
.kpi-sub { font-size: 12px; color: var(--muted); }
.hidden-val { filter: blur(7px); user-select: none; }
.statusbar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; gap: 2px; margin: 4px 0 12px; }
.statusbar span { background: var(--st); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink-2); }
.legend a { display: inline-flex; align-items: center; gap: 8px; }
.legend a:hover { color: var(--ink); text-decoration: underline; }
.legend b { font-variant-numeric: tabular-nums; font-weight: 600; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 20px; min-width: 0; }
.panel + .panel { margin-top: 0; }
.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; padding-top: 0; }
.thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 3px; background: var(--wall); }
.thumb-ph { width: 48px; height: 48px; border-radius: 3px; background: var(--wall); display: grid; place-items: center; color: var(--muted); }
.tl-text { min-width: 0; }
.tl-text strong { font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-text span { font-size: 13px; color: var(--muted); }
.tl-date { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mv-icon { display: inline-flex; align-items: center; gap: 6px; }

.todo li { grid-template-columns: 48px minmax(0, 1fr) auto; }
.todo .tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }

.loc-bars { display: flex; flex-direction: column; gap: 10px; }
.loc-bar { display: grid; grid-template-columns: minmax(0, 1fr) 36px; gap: 4px 12px; align-items: center; font-size: 14px; }
.loc-bar .track { grid-column: 1 / -1; height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.loc-bar .track span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.loc-bar b { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.loc-bar:hover .name { text-decoration: underline; }

.strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 6px; }

/* ---------- Collection ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px;
  border-radius: 99px; border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; cursor: pointer; color: var(--ink-2); white-space: nowrap;
}
.chip:hover { border-color: var(--ink-2); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip[aria-pressed="true"] .dot { box-shadow: 0 0 0 2px var(--bg); }
.chip .count { font-variant-numeric: tabular-nums; opacity: .6; }
.chip-select { position: relative; display: inline-flex; }
.chip-select select {
  appearance: none; height: 32px; padding: 0 30px 0 12px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--surface); font-size: 13px; cursor: pointer; color: var(--ink-2);
  max-width: 220px;
}
.chip-select.on select { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip-select::after { content: ''; position: absolute; right: 13px; top: 13px; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); pointer-events: none; color: var(--muted); }
.chip-select.on::after { color: var(--bg); }
.divider-v { width: 1px; height: 22px; background: var(--line); }
.results-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 22px; padding-top: 14px; border-top: 1px solid var(--line); }
.results-count { color: var(--ink-2); }
.results-count b { font-weight: 600; font-variant-numeric: tabular-nums; }
.view-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 99px; padding: 3px; background: var(--surface); }
.view-switch button { border: 0; background: none; height: 28px; padding: 0 12px; border-radius: 99px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.view-switch button[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); }
.view-switch svg { width: 16px; height: 16px; }
.sort { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.sort select { border: 0; background: none; font-weight: 500; color: var(--ink); cursor: pointer; padding: 4px; }

/* Wall: masonry that keeps the real proportions */
.wall-view { columns: 4 240px; column-gap: 26px; }
.wall-view .card { break-inside: avoid; margin-bottom: 30px; }
.grid-view { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 30px 24px; }
.grid-view .card-img { aspect-ratio: 1 / 1 !important; background: var(--wall); display: grid; place-items: center; padding: 14%; }
.grid-view .card-img img { position: absolute; inset: 14%; width: 72%; height: 72%; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(0,0,0,.18)); }
.grid-view .card:hover .card-img img { transform: scale(1.03); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stage.over { outline: 2px dashed var(--accent); outline-offset: -10px; }

.card { display: flex; flex-direction: column; gap: 12px; cursor: pointer; }
.card-img { position: relative; overflow: hidden; background: var(--wall); border-radius: 2px; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.card:hover .card-img img { transform: scale(1.025); }
.card-img .ph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 13px; border: 1px dashed var(--line); }
.card-img .ph svg { width: 26px; height: 26px; }
.card-badge { position: absolute; top: 10px; left: 10px; }
.red-dot { position: absolute; bottom: 10px; right: 10px; width: 14px; height: 14px; border-radius: 50%; background: var(--st-sold); box-shadow: 0 0 0 2px rgba(255,255,255,.85); }
.card-hover {
  position: absolute; inset: auto 0 0 0; padding: 28px 12px 10px; font-size: 12px; color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.6)); opacity: 0; transition: opacity .2s; display: flex; justify-content: space-between; gap: 8px;
}
.card:hover .card-hover, .card:focus-visible .card-hover { opacity: 1; }
.card-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.card-artist { font-weight: 600; font-size: 14px; }
.card-title { font-size: 16px; color: var(--ink-2); line-height: 1.3; }
.card-title em { font-size: 17px; }
.card-foot { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-top: 4px; min-width: 0; }
.card-foot span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.list-wrap { overflow-x: auto; }
.list-view { width: 100%; border-collapse: collapse; min-width: 760px; }
.list-view th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; padding: 0 12px 10px; border-bottom: 1px solid var(--line); }
.list-view td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.list-view tr { cursor: pointer; }
.list-view tbody tr:hover td { background: var(--surface); }
.list-view .work-cell { display: flex; align-items: center; gap: 14px; }
.list-view .num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

.empty { text-align: center; padding: 70px 20px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty .page-title { color: var(--ink); font-size: 28px; }

/* ---------- Work record ---------- */
.crumbs { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 20px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.crumbs a:hover { color: var(--ink); }
.pager { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.artwork { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.artwork-stage { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 12px; }
.stage {
  background: var(--wall); border-radius: 4px; min-height: min(72vh, 680px);
  display: grid; place-items: center; padding: clamp(28px, 6%, 70px); position: relative;
}
.stage img { max-height: 58vh; width: auto; box-shadow: var(--art-shadow); cursor: zoom-in; }
.stage .ph { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--muted); text-align: center; border: 1.5px dashed var(--line); border-radius: 6px; padding: 50px 40px; }
.stage .ph svg { width: 36px; height: 36px; }
.stage-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.artwork-info { min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.artwork-artist { font-size: 15px; font-weight: 600; display: inline-flex; gap: 8px; align-items: baseline; }
.artwork-artist a:hover { text-decoration: underline; }
.artwork-title { font-family: var(--f-display); font-style: italic; font-size: clamp(34px, 3.6vw, 50px); line-height: 1.04; letter-spacing: -.015em; font-weight: 400; margin-top: 4px; }
.artwork-year { font-family: var(--f-display); font-size: 24px; color: var(--muted); margin-top: 4px; }
.artwork-state { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; position: relative; }
.loc-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 99px; background: var(--surface-2); font-size: 13px; border: 0; cursor: pointer; color: var(--ink); max-width: 100%; }
.loc-chip svg { width: 15px; height: 15px; }
.spec { display: grid; grid-template-columns: 140px minmax(0, 1fr); border-top: 1px solid var(--line); margin: 0; }
.spec dt, .spec dd { padding: 11px 0; border-bottom: 1px solid var(--line); margin: 0; }
.spec dt { color: var(--muted); font-size: 13px; padding-top: 13px; }
.spec dd { min-width: 0; overflow-wrap: anywhere; }
.spec .missing { color: color-mix(in srgb, var(--st-reserved) 75%, var(--ink)); font-style: italic; display: inline-flex; gap: 8px; align-items: center; }
.price-box { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.price-box > div { background: var(--surface); padding: 14px 16px; }
.price-box small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.price-box b { font-family: var(--f-display); font-weight: 400; font-size: 24px; font-variant-numeric: tabular-nums; }
.price-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.price-head span { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.price-head svg { width: 14px; height: 14px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: none; padding: 10px 14px; cursor: pointer; color: var(--muted); font-weight: 500; box-shadow: inset 0 -2px 0 transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
.tabs .n { font-size: 12px; opacity: .7; margin-left: 4px; }
.tab-body { padding-top: 16px; }
.plain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.plain-list li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.plain-list li:last-child { border-bottom: 0; }
.doc-icon { width: 34px; height: 40px; border-radius: 4px; background: var(--surface-2); display: grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--st-sold); flex: none; }
.notes { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; color: var(--ink-2); }
.notes-label { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 6px; }
.hist li { align-items: flex-start; }
.hist .when { width: 92px; flex: none; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 1px; }
.hist .who { font-size: 12px; color: var(--muted); }

/* In-place editing */
.edit-bar {
  position: sticky; bottom: 16px; z-index: 15; margin-top: 8px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--ink); color: var(--bg); border-radius: 99px; padding: 8px 8px 8px 20px; box-shadow: var(--shadow);
}
.edit-bar .btn { height: 36px; }
.edit-bar .btn-ghost { color: var(--bg); }
.edit-bar .btn-ghost:hover { background: rgba(255,255,255,.12); }
.edit-bar .btn-primary { background: var(--bg); color: var(--ink); border-color: var(--bg); }
.field { width: 100%; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); padding: 7px 10px; outline: none; }
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field-row { display: flex; gap: 6px; align-items: center; }
.field-row .field { width: 70px; }
textarea.field { min-height: 80px; resize: vertical; }
.title-field { font-family: var(--f-display); font-style: italic; font-size: 34px; padding: 4px 10px; }

/* Status menu */
.menu {
  position: absolute; top: 38px; left: 0; z-index: 30; min-width: 230px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 6px;
}
.menu button { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 9px 10px; border-radius: var(--r-sm); cursor: pointer; text-align: left; }
.menu button:hover { background: var(--surface-2); }
.menu .check { margin-left: auto; color: var(--accent); }

/* ---------- Artists ---------- */
.artist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 28px 24px; }
.artist-card { display: flex; flex-direction: column; gap: 12px; }
.mosaic { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); gap: 4px; aspect-ratio: 4 / 3; border-radius: 3px; overflow: hidden; background: var(--wall); }
.mosaic img, .mosaic div { width: 100%; height: 100%; min-height: 0; object-fit: cover; background: var(--wall); }
.mosaic > :first-child { grid-row: 1 / 3; }
.artist-card:hover .artist-name { text-decoration: underline; }
.artist-name { font-family: var(--f-display); font-size: 24px; line-height: 1.15; }
.artist-meta { font-size: 13px; color: var(--muted); }
.artist-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 30px; align-items: end; margin: 10px 0 30px; }
.artist-bio { max-width: 62ch; color: var(--ink-2); font-size: 17px; margin-top: 12px; }
.mini-stats { display: flex; gap: 28px; }
.mini-stats div { display: flex; flex-direction: column; }
.mini-stats b { font-family: var(--f-display); font-size: 32px; font-weight: 400; line-height: 1.1; font-variant-numeric: tabular-nums; }
.mini-stats span { font-size: 13px; color: var(--muted); }

/* ---------- Locations ---------- */
.loc-group { margin-bottom: 34px; }
.loc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.loc-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px; display: flex; flex-direction: column; gap: 12px; transition: border-color .15s; }
.loc-card:hover { border-color: var(--ink-2); }
.loc-card h3 { font-size: 17px; font-weight: 600; }
.loc-card p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.loc-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.loc-count { font-family: var(--f-display); font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; }
.thumbs { display: flex; gap: 6px; }
.thumbs img, .thumbs .thumb-ph { width: 52px; height: 52px; object-fit: cover; border-radius: 3px; }
.thumbs .more { width: 52px; height: 52px; border-radius: 3px; background: var(--surface-2); display: grid; place-items: center; font-size: 13px; color: var(--muted); }

/* ---------- Import ---------- */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 24px; }
.step { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-md); padding: 14px 16px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.step small { color: var(--muted); font-size: 12px; }
.step b { font-weight: 600; }
.step[aria-current="step"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.step.done small { color: var(--st-available); }
.dropzone { border: 1.5px dashed var(--line); border-radius: var(--r-md); padding: 50px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--muted); background: var(--surface); }
.dropzone svg { width: 34px; height: 34px; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.file-chip { display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r-md); background: var(--surface-2); color: var(--ink); }
.map-table-wrap { overflow-x: auto; }
.map-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.map-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; padding: 0 12px 10px; border-bottom: 1px solid var(--line); }
.map-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.map-table .src { font-family: var(--f-mono); font-size: 13px; background: var(--surface-2); padding: 2px 7px; border-radius: 4px; }
.map-table .sample { color: var(--muted); font-size: 13px; }
.issue { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 16px 0; border-bottom: 1px solid var(--line); }
.issue:last-child { border-bottom: 0; }
.issue-n { font-family: var(--f-display); font-size: 28px; line-height: 1; width: 46px; font-variant-numeric: tabular-nums; }
.issue p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.variants { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.variants .src { font-family: var(--f-mono); font-size: 12px; background: var(--surface-2); padding: 2px 7px; border-radius: 4px; }
.callout { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--ink); margin-bottom: 20px; }
.callout svg { color: var(--accent); margin-top: 2px; }

/* ---------- Overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(6px); display: flex; flex-direction: column; padding: 20px; }
.overlay-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 4px 12px; }
.overlay-body { flex: 1; min-height: 0; display: grid; place-items: center; }
.overlay-body img { max-height: 100%; max-width: 100%; object-fit: contain; box-shadow: var(--art-shadow); }
.scale-svg { width: 100%; height: 100%; max-height: 78vh; stroke: none; stroke-width: 1; }
.scale-note { text-align: center; color: var(--muted); font-size: 13px; padding-top: 10px; }
.label-sheet { background: #fff; color: #111; width: min(520px, 100%); padding: 34px 38px; box-shadow: var(--art-shadow); font-family: var(--f-ui); }
.label-sheet .l-artist { font-weight: 600; font-size: 18px; }
.label-sheet .l-life { color: #555; font-size: 14px; margin-bottom: 14px; }
.label-sheet .l-title { font-family: var(--f-display); font-style: italic; font-size: 26px; line-height: 1.15; }
.label-sheet .l-body { margin-top: 12px; font-size: 14px; color: #333; line-height: 1.6; }
.label-sheet .l-inv { margin-top: 18px; font-family: var(--f-mono); font-size: 11px; color: #777; display: flex; justify-content: space-between; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60;
  background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 99px; box-shadow: var(--shadow); font-weight: 500; font-size: 14px;
  animation: toast-in .25s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }
.fade-in { animation: fade .35s ease-out; }
@keyframes fade { from { opacity: .4; transform: translateY(6px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .artwork { grid-template-columns: minmax(0, 1fr); }
  .artwork-stage { position: static; }
  .stage { min-height: 0; }
}
.menu-toggle { display: none; }
@media (max-width: 860px) {
  /* Phone and small tablet: logo and account button on top, sections in a tab bar at the bottom */
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .sidebar {
    position: relative; z-index: 35; height: auto; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px; border-right: 0; border-bottom: 1px solid var(--line);
  }
  .brand { padding: 0; flex: none; }
  .brand-logo { width: 104px; }
  .brand-sub { display: none; }
  .menu-toggle { display: grid; }
  .menu-toggle[aria-expanded="true"] { border-color: var(--ink); }

  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
  }
  .nav a { flex-direction: column; justify-content: center; gap: 3px; min-width: 0; padding: 6px 2px; font-size: 11px; line-height: 1.2; text-align: center; }
  .nav a span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav a.active { background: none; box-shadow: none; }
  .nav-group, .nav-soon, .proto-tag, #reset-data { display: none; }

  .sidebar-foot {
    display: none; position: absolute; top: calc(100% - 6px); right: 12px; width: min(280px, calc(100vw - 24px));
    margin: 0; padding: 16px; gap: 14px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow);
  }
  .sidebar.menu-open .sidebar-foot { display: flex; }
  .sidebar-foot .admin-links a { padding: 6px 4px; font-size: 15px; color: var(--ink); }
  .sidebar-actions { justify-content: space-between; }
  .sidebar-actions .text-btn { font-size: 14px; padding: 8px 4px; }

  .topbar { padding: 10px 16px; }
  #new-work span { display: none; }
  #new-work { width: 44px; padding: 0; justify-content: center; }
  main { padding: 10px 16px calc(96px + env(safe-area-inset-bottom, 0px)); }
  .edit-bar { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); max-width: calc(100vw - 32px); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .artist-head { grid-template-columns: minmax(0, 1fr); }
  .spec { grid-template-columns: 110px minmax(0, 1fr); }
  .keys-head { flex-wrap: wrap; }

  /* Tables become stacked cards; each value carries its column name */
  .list-wrap { overflow: visible; }
  .list-view { min-width: 0; }
  .list-view, .list-view tbody { display: block; }
  .list-view thead { display: none; }
  .list-view tr { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 22px; padding: 16px 0; border-bottom: 1px solid var(--line); }
  .list-view td { display: block; padding: 0; border: 0; font-size: 14px; }
  .list-view tbody tr:hover td { background: none; }
  .list-view td:has(.work-cell), .users-table td:first-child { flex-basis: 100%; order: -1; }
  .list-view td[data-label]::before {
    content: attr(data-label); display: block; margin-bottom: 3px;
    font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600;
  }
  .list-view td:has(.work-cell)::before, .users-table td:first-child::before { display: none; }
  .list-view .num { text-align: left; }
  .users-table .user-actions { flex-basis: 100%; text-align: left; white-space: normal; margin-left: -10px; }
}
@media (max-width: 520px) {
  .wall-view { columns: 2 140px; column-gap: 14px; }
  .grid-view { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 14px; }
  .card-title em { font-size: 15px; }
  .kpi-value { font-size: 30px; }
  .stage { padding: 22px; }
}

/* ---------- Real-data screens: exhibitions, certificates, sheets ---------- */
.icon-sm { width: 15px; height: 15px; }
.grow { flex: 1; min-width: 0; }
.nowrap { white-space: nowrap; }
.flush { margin: 0; }
.meta { font-size: 13px; color: var(--muted); }
.meta-sm { display: block; font-size: 12px; color: var(--muted); }
.section-note { letter-spacing: 0; text-transform: none; font-weight: 400; color: var(--muted); }
.list-title { font-size: 17px; }
.panel-gap { margin-bottom: 18px; }
.prose { margin: 0; color: var(--ink-2); line-height: 1.65; max-width: 65ch; }
.edit-head { display: grid; gap: 8px; }
.edit-actions { display: flex; gap: 6px; justify-content: flex-end; }
.field-year { width: 110px; }
.menu-right { left: auto; right: 0; }
.price-text { font-size: 17px; }
.thumb-sm { width: 36px; height: 36px; font-size: 12px; font-weight: 600; }

.feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(20px, 3vw, 36px); align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px; margin-bottom: 18px; }
.feature-media .mosaic { aspect-ratio: 16 / 10; }
.feature-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.feature-title { font-family: var(--f-display); font-style: italic; font-weight: 400; font-size: clamp(28px, 3vw, 40px); line-height: 1.05; }
.feature-title a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.feature-sub { margin: 0; color: var(--ink-2); }
.feature-stats { font-size: 14px; color: var(--muted); }
.feature-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.events { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.event { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; background: var(--accent-soft); color: var(--ink); font-size: 13px; }
.event svg { width: 15px; height: 15px; color: var(--accent); }
.event.past { background: var(--surface-2); color: var(--muted); }
.event.past svg { color: var(--muted); }

.gaps { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.gap { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--surface-2); transition: background .15s; }
.gap:hover { background: color-mix(in srgb, var(--st-reserved) 15%, var(--surface-2)); }
.gap b { font-family: var(--f-display); font-weight: 400; font-size: 28px; line-height: 1; font-variant-numeric: tabular-nums; }
.gap span { font-size: 13px; color: var(--muted); }

.pill.phase-current { --st: var(--st-available); }
.pill.phase-upcoming { --st: var(--accent); }
.pill.phase-past, .pill.phase-tba { --st: var(--st-nfs); }
.plain-list .pill { height: 24px; font-size: 12px; flex: none; }

.exh-card { display: flex; flex-direction: column; gap: 12px; }
.exh-card:hover .artist-name { text-decoration: underline; text-decoration-thickness: 1px; }
.portrait { aspect-ratio: 4 / 3; border-radius: 3px; overflow: hidden; background: var(--wall); }
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; }
.artist-head.with-portrait { grid-template-columns: 160px minmax(0, 1fr) auto; align-items: start; }
.portrait-lg { width: 160px; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 25%; border-radius: 3px; }

.cert-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.cert-row > svg { color: var(--accent); }
.cert-row + .cert-row { margin-top: -12px; }
.empty-cert { border-style: dashed; background: transparent; color: var(--ink-2); }
tr[data-action] { cursor: pointer; }
tr[data-action]:hover td { background: var(--surface); }

.overlay-actions { display: flex; align-items: center; gap: 8px; }
.overlay-body.scroll { overflow: auto; place-items: start center; padding-block: 8px 24px; }

/* Printable sheets keep a paper look in both themes */
.sheet-doc, .cert-sheet, .label-sheet { background: #fff; color: #17181b; box-shadow: var(--art-shadow); }
.sheet-doc { width: min(880px, 100%); padding: 40px 44px; }
.sheet-doc .meta, .sheet-doc .muted { color: #6c6f77; }
.doc-head { margin-bottom: 22px; }
.doc-head .eyebrow { color: #6c6f77; }
.doc-title { font-family: var(--f-display); font-style: italic; font-weight: 400; font-size: 32px; line-height: 1.1; margin: 4px 0; }
.price-table { width: 100%; border-collapse: collapse; }
.price-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: #6c6f77; font-weight: 600; padding: 0 10px 8px; border-bottom: 1px solid #ddd; }
.price-table td { padding: 10px; border-bottom: 1px solid #eee; vertical-align: middle; }
.price-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.price-table .thumb { width: 44px; height: 44px; }
.red-dot-inline { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #d3302f; margin-right: 6px; vertical-align: -1px; }
.labels-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; width: min(1000px, 100%); }
.labels-grid .label-sheet { width: auto; padding: 26px 28px; }
.label-sheet .l-year { font-style: normal; }
.bio-item { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 18px; padding: 18px 0; border-top: 1px solid #eee; }
.bio-item img { width: 96px; height: 120px; object-fit: cover; object-position: 50% 25%; }
.bio-item h3 { font-size: 17px; font-weight: 600; }
.bio-item p { margin: 6px 0 0; line-height: 1.6; color: #3c3e44; }

.cert-sheet { width: min(780px, 100%); padding: 48px 56px; outline: 1px solid #d8d6cf; outline-offset: -14px; display: flex; flex-direction: column; gap: 18px; }
.cert-top { display: flex; justify-content: space-between; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #6c6f77; }
.cert-title { font-family: var(--f-display); font-weight: 400; font-size: clamp(30px, 4vw, 42px); text-align: center; letter-spacing: -.01em; margin-top: 10px; }
.cert-kind { text-align: center; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: #6c6f77; margin-top: -10px; }
.cert-main { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 28px; align-items: center; margin-top: 8px; }
.cert-main img { width: 100%; max-height: 300px; object-fit: contain; }
.cert-data { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 8px 14px; margin: 0; font-size: 15px; }
.cert-data dt { color: #6c6f77; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; padding-top: 3px; }
.cert-data dd { margin: 0; }
.cert-data em { font-family: var(--f-display); font-size: 18px; }
.cert-statement { margin: 6px 0 0; font-family: var(--f-display); font-size: 17px; line-height: 1.6; color: #3c3e44; text-align: center; }
.cert-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 26px; font-size: 13px; color: #3c3e44; }
.sign-line { display: block; border-bottom: 1px solid #17181b; height: 34px; margin-bottom: 6px; font-family: var(--f-display); font-size: 17px; color: #17181b; }
.cert-sign small { color: #6c6f77; }

.sale-form { width: min(460px, 100%); display: flex; flex-direction: column; gap: 14px; }
.sale-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.sale-form .check-row { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; }

.issue-group { border-top: 1px solid var(--line); }
.issue-group:first-of-type { border-top: 0; }
.issue-group summary { display: flex; align-items: center; gap: 14px; padding: 12px 0; cursor: pointer; list-style: none; }
.issue-group summary::-webkit-details-marker { display: none; }
.issue-group summary svg { color: var(--muted); transition: transform .2s; }
.issue-group[open] summary svg { transform: rotate(90deg); }
.issue-group .issue-n { width: 44px; font-size: 24px; }
.issue-group ul { margin: 0 0 14px 58px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-2); }

.scale-svg text { font-family: var(--f-ui); }
.person { fill: var(--muted); opacity: .45; }
.svg-muted { fill: var(--muted); }
.svg-ink { fill: var(--ink); }
.svg-accent { fill: var(--accent); }
.svg-accent-line { stroke: var(--accent); stroke-width: .6; }
.svg-wall { fill: var(--wall); }
.svg-floor { fill: var(--surface-2); }
.svg-plinth { fill: var(--surface); stroke: var(--line); stroke-width: 1; }
.svg-placeholder { fill: var(--surface-2); stroke: var(--muted); stroke-width: 1; }

@media (max-width: 860px) {
  .feature { grid-template-columns: minmax(0, 1fr); }
  .artist-head.with-portrait { grid-template-columns: minmax(0, 1fr); }
  .portrait-lg { width: 120px; }
  .cert-sheet { padding: 32px 26px; }
  .cert-main, .cert-sign { grid-template-columns: minmax(0, 1fr); }
  .sheet-doc { padding: 26px 20px; }
}

@media print {
  html, body { height: auto !important; overflow: visible !important; background: #fff !important; }
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .overlay { position: absolute; inset: 0 auto auto 0; padding: 0; background: none; backdrop-filter: none; }
  .overlay-body, .overlay-body.scroll { overflow: visible; display: block; }
  .print-area { position: absolute; left: 0; top: 0; width: 100% !important; box-shadow: none !important; }
  .labels-grid .label-sheet { break-inside: avoid; box-shadow: none; outline: 1px dashed #bbb; }
  .price-table tr { break-inside: avoid; }
}

/* ---------- Artist bios: one page per artist, like an exhibition catalogue ---------- */
.bios-head { margin-bottom: 14px; }
.bio-index { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 18px; scrollbar-width: none; mask-image: linear-gradient(90deg, #000 92%, transparent); }
.bio-index::-webkit-scrollbar { display: none; }
.bio-chip { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px 4px 4px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; white-space: nowrap; color: var(--ink-2); transition: border-color .15s, background .15s; }
.bio-chip:hover { border-color: var(--ink-2); color: var(--ink); }
.bio-chip img, .bio-chip-ph { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; object-position: 50% 25%; }
.bio-chip-ph { display: grid; place-items: center; background: var(--surface-2); font-size: 11px; font-weight: 600; color: var(--muted); }
.bio-chip.active { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.bio-spread { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); min-height: min(78vh, 780px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.bio-portrait { position: relative; margin: 0; min-height: 360px; background: var(--wall); }
.bio-portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.bio-portrait figcaption { position: absolute; left: 18px; bottom: 16px; font-size: 13px; color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, .55); }
.bio-initials { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-display); font-size: 104px; color: var(--muted); }
.bio-text { display: flex; flex-direction: column; gap: 22px; min-width: 0; padding: clamp(28px, 4.5vw, 72px) clamp(24px, 4.5vw, 72px) clamp(24px, 3vw, 40px); }
.bio-kicker { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.bio-kicker span:last-child { font-variant-numeric: tabular-nums; }
.bio-name { font-family: var(--f-display); font-weight: 400; font-size: clamp(40px, 5vw, 72px); line-height: .98; letter-spacing: -.025em; text-wrap: balance; }
.bio-lede { margin: 0; max-width: 36ch; font-family: var(--f-display); font-style: italic; font-size: clamp(20px, 1.7vw, 25px); line-height: 1.38; color: var(--ink); text-wrap: pretty; }
.bio-body { max-width: 68ch; font-size: 15.5px; line-height: 1.72; color: var(--ink-2); text-wrap: pretty; hyphens: auto; }
.bio-body.two-col { max-width: none; columns: 2 250px; column-gap: 36px; }
.bio-body p { margin: 0 0 1em; }
.bio-body p:last-child { margin-bottom: 0; }
.bio-works { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
.bio-works-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.bio-works-head span { letter-spacing: 0; text-transform: none; font-size: 13px; }
.bio-works-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.bio-work { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 12px; color: var(--muted); }
.bio-work img, .bio-work .thumb-ph { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 2px; background: var(--wall); }
.bio-work em { overflow: hidden; font-family: var(--f-display); font-size: 14px; line-height: 1.25; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.bio-work:hover em { text-decoration: underline; text-decoration-thickness: 1px; }
.bio-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 22px; border: 1.5px dashed var(--line); border-radius: var(--r-md); color: var(--muted); }
.bio-empty p { margin: 0; }
.bio-edit { display: flex; flex-direction: column; gap: 10px; }
.bio-textarea { min-height: 300px; font-size: 15px; line-height: 1.65; }
.bio-pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; }
.artist-bio-full { max-width: 70ch; margin-top: 14px; }
.artist-bio-full .bio-body.two-col { columns: auto; }
.artist-bio-full .bio-lede { margin-bottom: 14px; }
.bios-print { display: none; }

@media (max-width: 860px) {
  .bio-spread { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .bio-portrait { min-height: 0; aspect-ratio: 4 / 5; max-height: 70vh; }
  .bio-works-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bio-pager .meta { display: none; }
}

/* Printed / PDF booklet: cover page, then one landscape page per artist */
@page bio { size: letter landscape; margin: 0.35in; }
@media print {
  body.print-bios .sidebar, body.print-bios .topbar, body.print-bios #main > :not(.bios-print) { display: none !important; }
  body.print-bios .app { display: block; }
  body.print-bios main { padding: 0; }
  body.print-bios .bios-print { display: block; position: static; }
  .bios-print .bio-cover, .bios-print .bio-spread { page: bio; break-after: page; height: 7.75in; min-height: 0; border: 0; border-radius: 0; background: #fff; color: #17181b; }
  .bios-print .bio-spread { grid-template-columns: 38% 62%; }
  .bios-print .bio-text { gap: 14px; padding: 0.4in 0.5in 0.3in; }
  .bios-print .bio-name { font-size: 40pt; color: #17181b; }
  .bios-print .bio-lede { font-size: 15pt; color: #17181b; }
  .bios-print .bio-body { font-size: 10.5pt; line-height: 1.6; color: #3c3e44; }
  .bios-print .bio-kicker, .bios-print .bio-works { border-color: #ddd; }
  .bios-print .bio-kicker, .bios-print .bio-works-head, .bios-print .bio-work { color: #6c6f77; }
  .bios-print .bio-work em { color: #17181b; }
  .bio-cover { display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 0.9in 1in; }
  .bio-cover .eyebrow { color: #6c6f77; }
  .bio-cover h1 { font-family: var(--f-display); font-style: italic; font-weight: 400; font-size: 58pt; line-height: 1; letter-spacing: -.02em; }
  .bio-cover-sub { margin: 0; font-family: var(--f-display); font-size: 18pt; color: #3c3e44; }
  .bio-cover-dates { margin: 0; font-size: 11pt; color: #6c6f77; }
  .bio-cover-label { margin-top: 0.5in; padding-top: 12px; border-top: 1px solid #17181b; font-size: 9pt; letter-spacing: .2em; text-transform: uppercase; }
  .bio-cover ol { margin: 0; padding: 0; list-style: none; columns: 2; column-gap: 0.5in; font-family: var(--f-display); font-size: 15pt; line-height: 1.7; }
}

/* Logo on printed documents: always black on paper */
.cert-logo svg, .doc-logo svg, .bio-cover-logo svg { color: #17181b; }
.cert-logo svg { width: 132px; }
.doc-logo svg { width: 120px; margin-bottom: 14px; }
.bio-cover-logo svg { width: 190px; margin-bottom: 0.4in; }

/* Certificate details that follow the gallery's own certificate */
.cert-top { align-items: flex-start; }
.cert-address { text-align: right; font-size: 11px; line-height: 1.6; letter-spacing: .12em; }
.cert-statement { text-align: left; font-size: 16px; }
.cert-boxes { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 12px; color: #3c3e44; }
.cert-box { display: inline-flex; align-items: center; gap: 6px; }
.cert-box::before { content: ''; width: 11px; height: 11px; border: 1px solid #17181b; }
.cert-box.on::before { background: #17181b; box-shadow: inset 0 0 0 2px #fff; }
.cert-note { margin: 0; font-size: 13px; color: #3c3e44; }
.cert-lines { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 40px; margin-top: 10px; }
.cert-line { display: flex; align-items: flex-end; gap: 10px; font-size: 13px; color: #3c3e44; }
.cert-line span { flex: none; }
.cert-line b { flex: 1; min-height: 24px; border-bottom: 1px solid #17181b; font-weight: 400; color: #17181b; padding-bottom: 2px; }
.cert-foot { font-size: 12px; color: #6c6f77; }
.bio-source { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.exh-text { max-width: 68ch; margin-top: 10px; color: var(--ink-2); line-height: 1.65; }
.exh-text p { margin: 0 0 .8em; }
@media (max-width: 860px) { .cert-lines { grid-template-columns: minmax(0, 1fr); } }

.tag-ok { background: color-mix(in srgb, var(--st-available) 16%, transparent); color: color-mix(in srgb, var(--st-available) 70%, var(--ink)); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }

/* ---------- Accounts ---------- */
body.auth-mode .sidebar, body.auth-mode .topbar { display: none; }
body.auth-mode .app { grid-template-columns: minmax(0, 1fr); }
/* dvh = the height actually visible on phones, with the browser's address bar showing */
body.auth-mode main { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding-block: 24px; }
.auth-card { width: min(400px, 100%); display: flex; flex-direction: column; align-items: stretch; gap: 18px; }
.auth-logo svg { width: 150px; height: auto; fill: currentColor; stroke: none; color: var(--ink); display: block; margin-bottom: 8px; }
.auth-product { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .22em; color: var(--muted); margin: 2px 0 6px 15px; }
.auth-title { font-family: var(--f-display); font-weight: 400; font-size: 36px; line-height: 1.1; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.auth-form .field { height: 44px; font-size: 15px; }
.auth-submit { height: 46px; justify-content: center; margin-top: 4px; }
.auth-submit:disabled { opacity: .6; cursor: progress; }
.auth-error { min-height: 1.2em; margin: 0; font-size: 14px; color: var(--st-sold); }
.auth-card > .text-btn { align-self: center; }

.sidebar-foot { gap: 12px; }
.user-chip { display: flex; flex-direction: column; font-size: 13px; line-height: 1.3; }
.user-chip span { color: var(--muted); font-size: 12px; }
.admin-links { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.admin-links a.active { color: var(--ink); font-weight: 600; }
.sidebar-actions { flex-wrap: wrap; }

.users-table .field-role { width: auto; min-width: 110px; }
.keys-head { margin-top: 44px; align-items: flex-end; }
.keys-head .meta { max-width: 62ch; margin: 6px 0 0; }
.section-heading { font-family: var(--f-display); font-size: 28px; line-height: 1.1; font-weight: 400; letter-spacing: -.01em; margin: 0; }
.user-actions { text-align: right; }
.danger-text { color: var(--st-sold); }
.steps-list { margin: 0 0 14px; padding-left: 20px; display: flex; flex-direction: column; gap: 14px; }
.steps-list li { padding-left: 4px; }
.steps-list .field { margin-top: 8px; }
.field-row .grow { flex: 1; }

/* Viewers can look but not change anything */
body[data-role="viewer"] :is(#new-work, [data-action="edit"], [data-action="new-artist"], [data-action="edit-artist"], [data-action="new-work-for"],
  [data-action="new-work-in"], [data-action="new-exhibition"], [data-action="edit-exhibition"], [data-action="upload"], [data-action="new-cert"],
  [data-action="issue-cert"], [data-action="edit-bio"], [data-action="toggle-sales"]) { display: none !important; }
body[data-role="viewer"] [data-action="open-menu"] { pointer-events: none; }

/* Name and language share one row */
.account-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.account-row .user-chip { min-width: 0; }
.account-row .lang-switch { flex: none; align-self: center; }
@media (max-width: 860px) {
  .account-row { order: -1; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
  .user-chip { font-size: 15px; }
  .user-chip span { font-size: 13px; }
}

/* Certificates: actions, signed copy, void */
.cert-toolbar { width: min(780px, 100%); display: flex; flex-wrap: wrap; gap: 8px; margin: 0 auto 14px; }
.cert-void-note, .cert-signed-meta { width: min(780px, 100%); margin: 0 auto 14px; }
.cert-sheet { position: relative; }
.cert-sheet.is-void > :not(.void-stamp) { opacity: .45; }
.void-stamp {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%) rotate(-18deg); z-index: 2; pointer-events: none;
  font-family: var(--f-ui); font-weight: 700; font-size: clamp(64px, 14vw, 120px); letter-spacing: .18em; text-transform: uppercase;
  color: #c62f2b; border: 6px solid #c62f2b; border-radius: 12px; padding: 0 28px; opacity: .8;
}
.list-view tr.is-void td { color: var(--muted); }
.list-view tr.is-void .list-title, .list-view tr.is-void .mono { text-decoration: line-through; }
.cert-add { margin-top: 2px; }
.cert-add .link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.cert-add .link svg { width: 15px; height: 15px; }
.btn-danger, .btn-danger:hover { background: var(--st-sold); border-color: var(--st-sold); color: #fff; }
body[data-role="viewer"] :is([data-action="new-print-cert"], [data-action="edit-cert"], [data-action="void-cert"], [data-action="restore-cert"], [data-action="upload-signed"]) { display: none !important; }

/* Archive */
.archived-banner { align-items: center; flex-wrap: wrap; }
.archived-banner > .grow { flex: 1 1 260px; }
.archived-banner .edit-actions { margin-left: auto; flex-wrap: wrap; }
.work-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.archive-link { display: inline-flex; align-items: center; gap: 5px; margin-left: 12px; letter-spacing: 0; text-transform: none; font-size: 13px; }
.archive-link svg, .btn svg.archive-icon { width: 14px; height: 14px; }
.archive-list { list-style: none; margin: 0; padding: 0; }
.archive-list li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.archive-list li:first-child { border-top: 0; }
.archive-list .grow { display: flex; flex-direction: column; gap: 2px; min-width: 180px; }
body[data-role="viewer"] :is([data-action="archive"], [data-action="restore"]) { display: none !important; }

/* ---------- Typography: sans-serif throughout; the serif is kept for the titles of artworks ---------- */
.artwork-title, .title-field, .label-sheet .l-title, .cert-data em, .bio-work em { font-family: var(--f-work); font-style: italic; }
.page-title { font-weight: 600; letter-spacing: -.025em; }
.page-title em { font-weight: 500; }
.feature-title { font-style: normal; font-weight: 600; letter-spacing: -.02em; }
.doc-title { font-style: normal; font-weight: 600; font-size: 26px; letter-spacing: -.015em; }
.auth-title, .section-heading { font-weight: 600; letter-spacing: -.02em; }
.artist-name { font-weight: 600; font-size: 20px; letter-spacing: -.01em; }
.artwork-year { font-size: 20px; }
.kpi-value, .mini-stats b, .price-box b, .gap b, .loc-count, .issue-n { font-weight: 500; letter-spacing: -.02em; }
.cert-title { font-weight: 600; letter-spacing: -.02em; }
.bio-name { font-weight: 600; letter-spacing: -.035em; }
.bio-lede { font-style: normal; }
.bio-cover h1 { font-style: normal; font-weight: 600; }

/* Certificate: the signer, and a marked spot for the gallery's embossed seal */
.cert-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.cert-seal { flex: none; width: 1.15in; height: 1.15in; border: 1px dashed #b9b7af; border-radius: 50%; display: grid; place-items: center; }
.cert-seal span { font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: #9a9890; }

/* ---------- Print pricing ---------- */
.pricing-lede { max-width: 62ch; margin-top: 8px; }
.pricing-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 20px; align-items: start; margin-bottom: 20px; }
.pricing-form { display: flex; flex-direction: column; gap: 14px; }
.pricing-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.pricing-form .check-row { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; }
.pricing-open { align-self: end; padding-bottom: 8px; }
.pricing-set { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 14px 0 0; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pricing-set legend { padding: 0 8px 0 0; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pricing-work { display: flex; align-items: center; gap: 12px; margin: 0; }
.pricing-more { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.pricing-more[open] { gap: 12px; }
.pricing-more summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink); }
.pricing-more > * + * { margin-top: 12px; }
.pricing-results { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 14px; }
.pricing-price { font-family: var(--f-display); font-weight: 600; font-size: clamp(44px, 5vw, 60px); line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.pricing-range { font-size: 15px; color: var(--ink-2); margin-top: -6px; font-variant-numeric: tabular-nums; }
.pricing-formula { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; }
.pf-step { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface-2); min-width: 0; }
.pf-step b { font-variant-numeric: tabular-nums; font-size: 15px; }
.pf-step small { font-size: 11px; color: var(--muted); line-height: 1.3; }
.pf-op { align-self: center; color: var(--muted); font-size: 14px; }
.pricing-exact { margin: 0; }
.pricing-ref { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 10px 12px; border-radius: var(--r-sm); font-size: 13px; }
.pricing-ref svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.ref-within { background: color-mix(in srgb, var(--st-available) 12%, transparent); }
.ref-above, .ref-below { background: color-mix(in srgb, var(--st-reserved) 16%, transparent); }
.pricing-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 0; }
.pricing-figures div { border-top: 1px solid var(--line); padding-top: 8px; }
.pricing-figures dt { font-size: 12px; color: var(--muted); }
.pricing-figures dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.pricing-figures small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.pricing-ladder, .pricing-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.pricing-ladder th, .pricing-table th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 0 6px 6px; border-bottom: 1px solid var(--line); }
.pricing-ladder td, .pricing-table td { padding: 7px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.pricing-ladder tfoot td { font-weight: 600; border-bottom: 0; }
.pricing-ladder .num, .pricing-table .num { text-align: right; }
.pricing-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pricing-tables summary { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; cursor: pointer; }
.pricing-model { display: flex; flex-direction: column; gap: 28px; margin-top: 18px; min-width: 0; }
.pricing-model > section { min-width: 0; }
.pricing-model .section-title { margin-top: 0; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pricing-sizes { min-width: 860px; }
.pricing-sizes .th-group th { border-bottom: 0; padding-bottom: 2px; text-align: right; }
.pricing-sizes .band-cell { min-width: 150px; }
.pricing-sizes .band-cell .meta { font-size: 12px; }
.range-in { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.pricing-tables .field-num { width: 68px; padding: 5px 7px; text-align: right; }
.pricing-tables .field-text { width: 92px; padding: 5px 7px; }
.pricing-factors { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.pricing-factors .section-title { margin-bottom: 8px; }
.pricing-defaults { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px 24px; }
.pricing-default { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.pricing-steps { grid-column: 1 / -1; flex-wrap: wrap; }
.steps-in { display: flex; flex-wrap: wrap; gap: 6px; }
.pricing-tables-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pricing-tables-actions .meta { margin: 0; }
.size-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.size-picks .chip { font-variant-numeric: tabular-nums; }
.pricing-compare { border-top: 1px solid var(--line); padding-top: 10px; }
.pricing-compare summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.pricing-compare table { margin-top: 8px; }
.pricing-compare tr.on td { background: var(--surface-2); }
.pricing-compare td .meta-sm { margin-top: 1px; }
.pricing-peek { display: none; }
@media (max-width: 1000px) {
  .pricing-peek {
    position: fixed; left: 50%; bottom: 16px; z-index: 35; transform: translateX(-50%);
    display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 99px; border: 1px solid var(--line);
    background: var(--surface); color: var(--ink); box-shadow: 0 8px 24px rgba(0,0,0,.14); font: inherit; cursor: pointer;
    transition: opacity .2s, transform .2s;
  }
  .pricing-peek:empty, .pricing-peek.is-away { opacity: 0; pointer-events: none; transform: translate(-50%, 12px); }
  .pricing-peek b { font-size: 18px; font-variant-numeric: tabular-nums; }
  .pricing-peek > * { white-space: nowrap; }
  .pricing-peek { width: max-content; max-width: calc(100vw - 32px); }
}
@media (max-width: 860px) { .pricing-peek { bottom: calc(74px + env(safe-area-inset-bottom, 0px)); } }
@media (max-width: 1180px) {
  /* The sizes table becomes one card per size, its fields side by side where there is room */
  .pricing-sizes { min-width: 0; }
  .pricing-sizes thead { display: none; }
  .pricing-sizes, .pricing-sizes tbody { display: block; width: 100%; }
  .pricing-sizes tr { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 2px 28px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .pricing-sizes td { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 0; padding: 4px 0; text-align: left; }
  .pricing-sizes td.band-cell { display: block; grid-column: 1 / -1; padding-bottom: 6px; }
  .pricing-sizes td[data-label]::before { content: attr(data-label); font-size: 13px; color: var(--muted); text-align: left; }
}
.print-formats ul { list-style: none; margin: 8px 0 0; padding: 0; }
.print-formats li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.pf-price { font-variant-numeric: tabular-nums; }
.cert-add { display: flex; flex-wrap: wrap; gap: 4px 18px; }
body[data-role="viewer"] :is([data-nav="pricing"], [data-action="price-print"], [data-action="remove-format"]) { display: none !important; }
@media (max-width: 1000px) { .pricing-grid { grid-template-columns: minmax(0, 1fr); } .pricing-results { position: static; } }

/* Interface language */
.lang-switch { display: inline-flex; align-self: flex-start; gap: 0; padding: 2px; border-radius: 8px; background: var(--surface-2); }
.lang-switch button { font: 600 11px/1 var(--f-ui); letter-spacing: .06em; color: var(--muted); background: none; border: 0; border-radius: 6px; padding: 5px 8px; cursor: pointer; }
.lang-switch button:hover { color: var(--ink); }
.lang-switch button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
:root[data-theme="dark"] .lang-switch button[aria-pressed="true"] { background: #34363b; box-shadow: none; }
.auth-lang { margin: 18px auto 0; align-self: center; }
/* A shorter tab label where the translated one doesn't fit the phone's tab bar */
@media (max-width: 860px) {
  html:not([lang^="en"]) .nav a span[data-short] { font-size: 0; }
  html:not([lang^="en"]) .nav a span[data-short]::after { content: attr(data-short); font-size: 11px; }
}
/* Desktop sidebar: on shorter screens it tightens up, and it can always scroll so the account area stays reachable */
@media (min-width: 861px) {
  .sidebar { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
  .sidebar::-webkit-scrollbar { display: none; }
}
@media (min-width: 861px) and (max-height: 920px) {
  .sidebar { gap: 16px; padding: 16px 16px 12px; }
  .sidebar .brand-logo { width: 112px; }
  .brand-sub { margin-top: 4px; }
  .nav a, .nav-soon { padding: 6px 10px; }
  .nav-group { margin: 10px 10px 2px; }
  .sidebar-foot { gap: 8px; }
  .admin-links { padding-bottom: 6px; }
}

/* Print pricing: tabs for the calculator and the model behind it */
.pricing-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: -6px 0 20px; border-bottom: 1px solid var(--line); }
.pricing-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 500; }
.pricing-tabs a:hover { color: var(--ink); }
.pricing-tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.pricing-tabs svg { width: 16px; height: 16px; }
.tab-badge { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 3px 7px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.tab-badge.is-edit { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.pricing-model-intro { max-width: 70ch; margin-bottom: 4px; }
.pricing-model-intro p { margin: 0 0 6px; }
.pricing-tables .pricing-model { margin-top: 18px; }

/* Print pricing: artwork search */
.work-pick { position: relative; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.work-pick-box { position: relative; display: flex; align-items: center; }
.work-pick-box > svg { position: absolute; left: 11px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.work-pick-box .field { width: 100%; padding-left: 34px; padding-right: 38px; }
.work-pick-clear { position: absolute; right: 4px; width: 30px; height: 30px; }
.work-pick-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30;
  max-height: min(420px, 60vh); overflow-y: auto; overscroll-behavior: contain;
  padding: 6px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); box-shadow: 0 12px 32px rgba(0,0,0,.16); color: var(--ink);
}
.wp-group { position: sticky; top: -6px; z-index: 1; padding: 8px 8px 4px; background: var(--surface); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.wp-opt { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.wp-opt .thumb, .wp-opt .thumb-ph { width: 34px; height: 34px; flex: none; }
.wp-opt span { display: flex; flex-direction: column; min-width: 0; }
.wp-opt em { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wp-opt small { font-size: 12px; color: var(--muted); }
.wp-opt:hover, .wp-opt.active { background: var(--surface-2); }
.wp-opt[aria-selected="true"] em { font-weight: 600; }
.wp-empty { padding: 14px 8px; color: var(--muted); font-size: 14px; }
.work-pick-clear { border: 0; background: none; color: var(--muted); }

/* Contacts and collectors */
body[data-role="viewer"] [data-nav="contacts"] { display: none !important; }
.hidden-val a { pointer-events: none; }
.contact-search { width: min(280px, 100%); }
.contacts-table { min-width: 680px; }
.contact-head { align-items: flex-start; }
.contact-lines, .contact-address { margin: 8px 0 0; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 28px; margin: 8px 0 32px; }
.contact-grid p { margin: 0 0 10px; }
.contact-artists { display: flex; flex-wrap: wrap; gap: 8px; }
.contact-notes { white-space: normal; line-height: 1.55; }
.contact-purchases { margin-bottom: 24px; }
.contact-purchases .work-cell { display: flex; align-items: center; gap: 14px; min-width: 0; color: inherit; }
.contact-added { margin-top: 8px; }
.check-grid { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px 14px; }
.check-grid legend { padding: 0; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
.check-grid .check-row { margin: 0; }
@media (max-width: 860px) {
  .contacts-table { min-width: 0; }
  .contact-search { width: 100%; }
}

/* Wall labels on Avery sheets: each sheet is a Letter page, labels placed in inches */
.avery-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 18px; width: min(820px, 100%); margin-bottom: 8px; }
.avery-controls > label:not(.check-row) { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.avery-controls input[type="number"] { width: 90px; }
.avery-controls .check-row { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); padding-bottom: 8px; }
.avery-hint { width: min(820px, 100%); margin: 0 0 16px; }
.avery-sheets { display: flex; flex-direction: column; gap: 24px; align-items: center; }
.avery-sheet { position: relative; width: 8.5in; height: 11in; flex: none; background: #fff; color: #17181b; box-shadow: var(--art-shadow); overflow: hidden; }
.avery-cell { position: absolute; width: var(--lw); height: var(--lh); outline: 1px dashed #c9c9c4; outline-offset: -1px; border-radius: 6px; }
.avery-label { position: absolute; inset: 0; padding: 0.16in 0.2in; display: flex; gap: 0.14in; align-items: stretch; font-family: var(--f-ui); }
.al-text { --k: 1; flex: 1; min-width: 0; overflow: hidden; display: flex; flex-direction: column; font-size: calc(10.5pt * var(--k)); line-height: 1.3; }
.al-artist { font-weight: 600; font-size: 1.05em; }
.al-title { font-family: var(--f-work); font-style: italic; font-size: 1.3em; line-height: 1.15; margin-top: .15em; }
.al-year { font-style: normal; }
.al-body { margin-top: .45em; color: #333; font-size: .9em; }
.al-price { margin-top: auto; padding-top: .4em; font-weight: 600; font-size: .95em; }
.al-qr { flex: none; width: var(--qr); display: flex; align-items: center; }
.al-qr svg { width: 100%; height: auto; display: block; }
.al-qr svg, .al-qr svg path { stroke: none !important; fill: #111; }
.avery-label.overflows { background: color-mix(in srgb, var(--st-sold) 8%, #fff); }
@media (max-width: 900px) { .avery-sheets { align-items: flex-start; overflow-x: auto; } }
@media print {
  body.print-avery .app, body.print-avery .overlay-head, body.print-avery .scale-note, body.print-avery .avery-controls, body.print-avery .avery-hint { display: none !important; }
  body.print-avery .overlay { position: static; inset: auto; display: block; padding: 0; background: none; }
  body.print-avery .overlay-body { padding: 0; }
  body.print-avery .print-area.avery-sheets { position: static; display: block; width: auto !important; }
  body.print-avery .avery-sheet { box-shadow: none; margin: 0; break-after: page; }
  body.print-avery .avery-sheet:last-child { break-after: auto; }
  body.print-avery .avery-cell { outline: none; }
  body.print-avery .avery-label.overflows { background: none; }
}

/* Home heading: "today" upright, smaller and bold next to the gallery name */
.page-title .title-today { font-style: normal; font-weight: 700; font-size: .5em; letter-spacing: 0; vertical-align: .12em; margin-left: .15em; }

/* Arrivals and returns */
@media (max-width: 860px) { .nav a.nav-wide { display: none; } }  /* on phones it opens from the Inventory page */
body[data-role="viewer"] :is([data-action="record-arrival"], [data-action="record-return"], [data-action="movement-delete"]) { display: none !important; }
.move-fieldset legend { display: flex; justify-content: space-between; width: 100%; }
.move-works { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow-y: auto; padding-right: 6px; grid-column: 1 / -1; }
.move-works .check-row { align-items: flex-start; }
.move-works .meta-sm { display: block; color: var(--muted); font-size: 12px; }
.receipt-doc p { margin: 18px 0; }
.receipt-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 22px 0 0; }
.receipt-facts dt { color: #6c6f77; }
.receipt-facts dd { margin: 0; }
.receipt-signs { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 64px; }
.receipt-signs div { border-top: 1px solid #17181b; padding-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.receipt-signs span { font-size: 12px; color: #6c6f77; }

/* Exhibition form: artist ticks; works picker */
.check-grid-note { grid-column: 1 / -1; margin: 4px 0 0; }
.check-grid input:disabled + * , .check-grid label:has(input:disabled) { opacity: .75; }
body[data-role="viewer"] [data-action="show-works"] { display: none !important; }
