/* Primismatics: shared site styles.
   Same palette as the World Ledger map: cool paper neutrals, ink, brass. */

:root {
  color-scheme: light;
  --page: #eaeef0;
  --surface: #fbfcfa;
  --surface-raised: #ffffff;
  --surface-sunken: #e2e7e6;
  --border: rgba(13, 20, 32, 0.12);
  --border-strong: rgba(13, 20, 32, 0.22);
  --ink: #0d1420;
  --ink-2: #48545c;
  --ink-3: #7c8890;
  --brass: #a9701f;
  --brass-strong: #8a5a15;
  --brass-tint: #f3e3c8;
  --ok: #0f7a0f;
  --ok-tint: #dff3df;
  --error: #b42318;
  --error-tint: #fde8e6;
  --warn: #8a5a00;
  --warn-tint: #fdf1d6;
  --shadow: 0 1px 2px rgba(13, 20, 32, 0.06), 0 8px 24px rgba(13, 20, 32, 0.06);
  --font-display: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "Public Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* Theme: <html data-theme="light|dark|system">. Light is the base above.
   Dark applies when chosen, or when "system" and the device prefers dark.
   The dark palette is a soft charcoal rather than near-black. */
:root[data-theme="dark"] {
    color-scheme: dark;
    --page: #171d1e;
    --surface: #1e2627;
    --surface-raised: #243031;
    --surface-sunken: #141a1b;
    --border: rgba(230, 238, 234, 0.14);
    --border-strong: rgba(230, 238, 234, 0.26);
    --ink: #e8eeea;
    --ink-2: #b3c0bb;
    --ink-3: #8a9a95;
    --brass: #d9a441;
    --brass-strong: #f0bf63;
    --brass-tint: #3a2e17;
    --ok: #7ad87a;
    --ok-tint: #1a3a22;
    --error: #ff9a90;
    --error-tint: #43201c;
    --warn: #f0c060;
    --warn-tint: #3d3214;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 8px 24px rgba(0, 0, 0, 0.25);
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
      color-scheme: dark;
      --page: #171d1e;
      --surface: #1e2627;
      --surface-raised: #243031;
      --surface-sunken: #141a1b;
      --border: rgba(230, 238, 234, 0.14);
      --border-strong: rgba(230, 238, 234, 0.26);
      --ink: #e8eeea;
      --ink-2: #b3c0bb;
      --ink-3: #8a9a95;
      --brass: #d9a441;
      --brass-strong: #f0bf63;
      --brass-tint: #3a2e17;
      --ok: #7ad87a;
      --ok-tint: #1a3a22;
      --error: #ff9a90;
      --error-tint: #43201c;
      --warn: #f0c060;
      --warn-tint: #3d3214;
      --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 8px 24px rgba(0, 0, 0, 0.25);
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brass-strong); }
a:hover { color: var(--brass); }

:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; text-wrap: balance; }
h1 { font-size: 1.9rem; margin: 0 0 16px; }
h2 { font-size: 1.25rem; margin: 0 0 12px; }

.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }

/* ---------- UAT banner ---------- */

.env-banner {
  background: repeating-linear-gradient(-45deg, #f0bf63, #f0bf63 12px, #e9b250 12px, #e9b250 24px);
  color: #3a2600;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 5px 12px;
}

/* ---------- header / footer ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.brand picture { display: block; line-height: 0; }
.brand-wordmark { height: 50px; width: auto; display: block; }
.brand:hover { color: inherit; }

.brand-mark {
  width: 34px; height: 34px; flex: none; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #f0bf63, var(--brass) 62%, #8a5a15);
  box-shadow: inset 0 0 0 3px rgba(0,0,0,0.08), inset 0 0 0 4px rgba(255,255,255,0.15);
}

.brand-logo { width: 44px; height: 44px; flex: none; display: block; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-family: var(--font-display); font-size: 20px; font-weight: 600; line-height: 1.1; }
.brand-sub {
  font-family: var(--font-display); font-style: italic; font-size: 15px; color: var(--ink-2);
  padding-left: 14px; border-left: 1px solid var(--border-strong); line-height: 1.2;
}

.site-nav { display: flex; align-items: center; gap: 18px; font-weight: 600; font-size: 14px; }
.site-nav a { text-decoration: none; }

.site-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  font-size: 12.5px;
  color: var(--ink-3);
  border-top: 1px solid var(--border);
}
.site-footer a { color: var(--ink-2); }
.site-footer a.quiet { color: var(--ink-3); text-decoration: none; }

/* Lift the navy wordmark off dark backgrounds */
:root[data-theme="dark"] .brand-wordmark,
:root[data-theme="dark"] .hero-wordmark {
  filter: brightness(1.12) drop-shadow(0 0 1px rgba(255, 226, 160, 0.45)) drop-shadow(0 0 10px rgba(240, 191, 99, 0.16));
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .brand-wordmark,
  :root[data-theme="system"] .hero-wordmark {
    filter: brightness(1.12) drop-shadow(0 0 1px rgba(255, 226, 160, 0.45)) drop-shadow(0 0 10px rgba(240, 191, 99, 0.16));
  }
}

/* ---------- theme toggle ---------- */

.theme-toggle { display: inline-flex; }
.theme-toggle button {
  font: inherit; font-size: 15px; line-height: 1;
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface-raised); color: var(--ink-2);
  cursor: pointer;
}
.theme-toggle button:hover { color: var(--ink); border-color: var(--border-strong); }
/* show "switch to dark" while light is in effect, and vice versa */
.to-light { display: none; }
:root[data-theme="dark"] .to-dark { display: none; }
:root[data-theme="dark"] .to-light { display: inline-block; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .to-dark { display: none; }
  :root[data-theme="system"] .to-light { display: inline-block; }
}
.header-right { display: flex; align-items: center; gap: 18px; }

/* ---------- settings pages ---------- */

.choice-row { display: flex; gap: 10px; flex-wrap: wrap; }
.choice {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px;
  border: 1px solid var(--border-strong); border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 14px;
}
.choice:has(input:checked) { border-color: var(--brass); background: var(--brass-tint); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 16px; }
.check-grid label { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.check-grid label .muted { display: block; font-size: 12px; }
table.matrix td, table.matrix th { text-align: center; }
table.matrix td:first-child, table.matrix th:first-child { text-align: left; }
table.matrix input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--brass-strong); }

/* ---------- page ---------- */

.page { width: 100%; max-width: 1080px; margin: 0 auto; padding: 28px 24px 40px; }
.page-wide { max-width: 1400px; }

.card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 20px;
}
.card.narrow { max-width: 420px; margin: 6vh auto 20px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.two-col > .card { margin-bottom: 0; }

/* ---------- home hero ---------- */

.hero { text-align: center; padding: 12vh 0 10vh; }
.hero-coin {
  width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 20px;
  background: radial-gradient(circle at 32% 28%, #f0bf63, var(--brass) 62%, #8a5a15);
  box-shadow: inset 0 0 0 4px rgba(0,0,0,0.08), inset 0 0 0 5px rgba(255,255,255,0.15);
}
.hero-title { margin: 0 0 6px; line-height: 0; }
.hero-wordmark { width: min(600px, 100%); height: auto; display: inline-block;
  filter: drop-shadow(0 8px 22px rgba(13, 20, 32, 0.16)); }
.lede { font-size: 1.15rem; color: var(--ink-2); margin: 0 0 24px; }

/* ---------- forms ---------- */

.stack { display: flex; flex-direction: column; gap: 14px; }
.stack label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink-2); }

input[type="email"], input[type="password"], input[type="text"], input[type="search"], input[type="url"], .exception-add input[type="number"], select {
  font: inherit;
  font-size: 15px;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.button {
  font: inherit;
  font-weight: 600;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: var(--brass-strong);
  color: #fff;
  cursor: pointer;
}
.button:hover { background: var(--brass); }
.button.secondary { background: transparent; color: var(--ink-2); border: 1px solid var(--border-strong); }

form.inline { display: inline; margin: 0; }
.link-button {
  font: inherit; font-weight: 600; font-size: 14px;
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--brass-strong);
}
.link-button:hover { color: var(--brass); }

/* ---------- messages / tags ---------- */

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.flash-ok    { background: var(--ok-tint);    color: var(--ok); }
.flash-error { background: var(--error-tint); color: var(--error); }
.flash-warn  { background: var(--warn-tint);  color: var(--warn); }

.tag {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 1px 7px; border-radius: 4px;
  background: var(--surface-sunken); color: var(--ink-2);
}
.tag-ok { background: var(--ok-tint); color: var(--ok); }
.tag-error, .tag-critical { background: var(--error-tint); color: var(--error); }
.tag-warning { background: var(--warn-tint); color: var(--warn); }
.tag-notice { background: var(--brass-tint); color: var(--brass-strong); }

/* ---------- stats ---------- */

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.kind-cards { grid-template-columns: repeat(var(--stat-cols, 4), 1fr); }
.stat-toggle { font: inherit; color: inherit; text-align: left; cursor: pointer; position: relative; }
.stat-toggle:hover { border-color: var(--brass); }
.stat-toggle:focus-visible { outline: 2px solid var(--brass-strong); outline-offset: 2px; }
.stat-toggle::after { content: 'Click to show only these'; font-size: 11px; color: var(--ink-3); margin-top: 2px; opacity: 0; transition: opacity .15s; }
.stat-toggle:hover::after, .stat-toggle:focus-visible::after { opacity: 1; }
.stat-toggle[aria-pressed="true"] { border-color: var(--brass-strong); background: var(--brass-tint); box-shadow: inset 0 0 0 1px var(--brass-strong); }
.stat-toggle[aria-pressed="true"] .stat-label { color: var(--brass-strong); }
.stat-toggle[aria-pressed="true"]::after { content: 'Showing only these · click to show all'; opacity: 1; color: var(--brass-strong); }
.kind-cards.is-filtering .stat-toggle[aria-pressed="false"] { opacity: .6; }
.is-kind-out, .is-uv-out, .is-photo-out { display: none !important; }
.stat {
  background: var(--surface-raised); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; display: flex; flex-direction: column;
}
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }
.stat-value { font-family: var(--font-display); font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- tables ---------- */

table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--ink-3); padding: 6px 8px; border-bottom: 1px solid var(--border-strong);
}
table.data td { padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- admin pages ---------- */

.title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.title-row h1 { margin: 0; }
.title-row p { margin: 0; }
.crumbs { margin: 0 0 4px; font-size: 13px; }
.crumbs a { text-decoration: none; }

.search { display: flex; gap: 8px; flex: 1; max-width: 460px; }
.search input { flex: 1; min-width: 0; }

.steps { margin: 0 0 16px; padding-left: 20px; color: var(--ink-2); }
.steps li { margin-bottom: 4px; }
.upload-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.upload-row input[type="file"] { font: inherit; font-size: 14px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
a.button { display: inline-block; text-decoration: none; }
a.button.secondary { color: var(--ink-2); }

details.card > summary { cursor: pointer; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary h2 { display: inline; }
details.card > summary::before { content: "▸ "; color: var(--ink-3); }
details.card[open] > summary::before { content: "▾ "; }
details.card[open] > summary { margin-bottom: 12px; }

.stat-link { text-decoration: none; color: inherit; }
.stat-link:hover { border-color: var(--brass); color: inherit; }

.sort-links a, .sort-links strong { margin-left: 8px; }
.th-sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.th-sort:hover { color: var(--brass-strong); }
.th-sort:focus-visible { outline: 2px solid var(--brass-strong); outline-offset: 2px; border-radius: 2px; }
.th-mark { font-size: 0.75em; color: var(--brass-strong); min-width: 0; }
th.num .th-sort { justify-content: flex-end; }
th.is-sorted .th-sort { color: var(--ink); }
.sort-bar { margin: 0 0 8px; color: var(--ink-2); }
.sort-bar .link-button { margin-left: 6px; }
.table-scroll { overflow-x: auto; }
table.items .item-title { font-weight: 600; }
.grade {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px;
  background: var(--brass-tint); color: var(--brass-strong);
}

/* ---------- goals ---------- */

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.progress { display: block; height: 8px; border-radius: 99px; background: var(--surface-sunken); overflow: hidden; }
.progress-lg { height: 14px; }
.progress-fill { display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--brass-strong), var(--brass)); }

.goal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.goal-card {
  display: flex; flex-direction: column; gap: 8px; padding: 18px 20px;
  background: var(--surface-raised); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
  text-decoration: none; color: inherit;
}
a.goal-card:hover { border-color: var(--brass); color: inherit; }
.goal-card-soon { opacity: 0.7; pointer-events: none; }
.goal-name { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }
.goal-desc { font-size: 13px; color: var(--ink-2); }
.goal-meta { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.goal-hero { display: flex; align-items: center; gap: 24px; }
.goal-hero-pct { font-family: var(--font-display); font-size: 3rem; font-weight: 600; line-height: 1; color: var(--brass-strong); font-variant-numeric: tabular-nums; }
.goal-hero-body { flex: 1; }
.goal-hero-body p { margin: 10px 0 0; color: var(--ink-2); }

.goal-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 2px 28px; }
.goal-row {
  display: grid; grid-template-columns: 1fr auto auto 72px; align-items: center; gap: 14px;
  padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 14px;
}
.goal-row.is-done .goal-country { color: var(--ink-2); }
.goal-country { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-country a { text-decoration: none; }
.goal-status { text-align: right; }
.pips { display: inline-flex; align-items: center; gap: 4px; }
.pips-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-3); margin-right: 2px; }
.pip { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--border-strong); background: transparent; }
.pip.on { background: var(--brass); border-color: var(--brass-strong); }
.pips-key { display: none; }

.find { display: flex; align-items: center; gap: 12px; margin: 18px 0 6px; }
.find input { flex: 1; max-width: 420px; min-width: 0; }
.find-results { border-color: var(--brass); }
.find-results .cl-table { width: auto; }
[hidden] { display: none !important; }

/* ---------- goal builder ---------- */

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-grid label, .form-grid fieldset { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid input[type="number"] { font: inherit; font-size: 15px; padding: 9px 11px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--ink); }
.form-grid em { font-weight: 400; font-style: normal; }
.form-grid textarea, .form-grid input[type="text"], .form-grid select {
  font: inherit; font-size: 14px; padding: 9px 11px; border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--surface); color: var(--ink); width: 100%; }
.form-grid textarea { font-family: ui-monospace, Consolas, monospace; font-size: 13px; resize: vertical; }
code { font-family: ui-monospace, Consolas, monospace; font-size: 0.92em; background: var(--surface-sunken); padding: 1px 5px; border-radius: 4px; }
label.check { flex-direction: row !important; align-items: center; gap: 8px !important; font-weight: 500 !important; }
fieldset { border: none; padding: 0; margin: 0; }
legend { padding: 0; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.sub { margin-top: 14px; }
.goal-form .card h2 { margin-bottom: 14px; }
.country-group { border-top: 1px solid var(--border); padding: 8px 0; }
.country-group summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.country-group .check-grid { margin-top: 8px; }
.delete-form { margin-top: 28px; text-align: right; }
.link-button.danger { color: var(--error); }
.flash ul { margin: 6px 0 0; padding-left: 20px; }
.lede-sm { color: var(--ink-2); margin: -6px 0 4px; }
.status-planned  { background: var(--brass-tint); color: var(--brass-strong); }
.status-paused   { background: var(--warn-tint);  color: var(--warn); }
.status-archived { background: var(--surface-sunken); color: var(--ink-3); }
.goal-name .tag { vertical-align: middle; margin-left: 6px; }
.pip-count { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-3); }
.pip-count.on { color: var(--brass-strong); }
.pip-na { font-size: 11px; font-weight: 600; color: var(--ink-3); border: 1px dashed var(--border-strong); border-radius: 4px; padding: 0 4px; }
.pips.is-lowered .pip:last-of-type { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--border); }
.goal-na-why { display: block; }
.goal-except { opacity: 0; margin-left: 6px; }
.goal-row:hover .goal-except, .goal-except:focus { opacity: 1; }
.exception-add { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 10px 14px; align-items: end; }
.exception-add .exception-why { grid-column: 1 / -1; }
.exception-add p { grid-column: 1 / -1; margin: 0; }
@media (max-width: 640px) { .exception-add { grid-template-columns: 1fr; } }

/* ---------- checklists ---------- */

.cl-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; align-items: start; }
.cl-groups.cl-designs { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.cl-group { margin-bottom: 0; padding: 14px 16px; }
.cl-group h2 { font-size: 1.05rem; margin-bottom: 8px; }
.cl-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cl-table th { font-weight: 600; text-align: center; color: var(--ink-3); font-size: 11px; padding: 2px 4px; }
.cl-table tbody th { text-align: left; color: var(--ink); font-size: 13px; font-weight: 500; padding: 4px 6px 4px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
.cl-cell { text-align: center; padding: 3px; width: 40px; }
.cl-dot {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 22px; border-radius: 11px;
  border: 1.5px solid var(--border-strong); font-size: 10.5px; font-weight: 700;
}
.cl-have .cl-dot { background: var(--brass); border-color: var(--brass-strong); color: #fff; }
.cl-na { color: var(--ink-3); }
.cl-needed { margin: 0; line-height: 1.8; font-variant-numeric: tabular-nums; }

/* ---------- responsive ---------- */

@media (max-width: 760px) {
  .site-header, .site-footer { padding-left: 16px; padding-right: 16px; }
  .page { padding: 20px 16px 32px; }
  .two-col { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .kind-cards { grid-template-columns: repeat(2, 1fr); }
  .brand-sub { display: none; }
  .brand-wordmark { height: 40px; }
  .site-footer { flex-direction: column; }
  .site-nav { gap: 12px; font-size: 13px; }
  .site-header { flex-wrap: wrap; }
  .goal-hero { flex-direction: column; align-items: stretch; gap: 10px; }
  .goal-row { grid-template-columns: 1fr auto auto; }
  .goal-status { display: none; }
  .pips-label { display: none; }
  .pips-key { display: block; margin: -4px 0 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  table.data { font-size: 12.5px; }
}

details.advanced > summary { cursor: pointer; }
details.advanced > summary h2 { margin: 0 6px 0 4px; display: inline; }
details.advanced[open] > summary { margin-bottom: 14px; }

/* ---------- world map ---------- */
/* Color schemes: each is light-to-dark in light mode and dark-to-bright in dark mode,
   so "more" always reads as stronger. Picked on the map page (remembered per browser). */
:root { --map-edge: #8f9a9d; }
:root[data-theme="dark"] { --map-edge: #121718; }
@media (prefers-color-scheme: dark) { :root[data-theme="system"] { --map-edge: #121718; } }
.map-layout[data-palette="spectrum"], .map-layout:not([data-palette]) {
  --map-sea: #d6e4ec;
  --map-out: #c3c7c6;
  --map-0: #f7f3e6;
  --map-1: #f6e04b;
  --map-2: #9fd25a;
  --map-3: #35ad7d;
  --map-4: #2c7a90;
  --map-5: #3d3d84;
}
:root[data-theme="dark"] .map-layout[data-palette="spectrum"], :root[data-theme="dark"] .map-layout:not([data-palette]) {
  --map-sea: #182022;
  --map-out: #4b5254;
  --map-0: #363b39;
  --map-1: #463e7c;
  --map-2: #2f6d86;
  --map-3: #27a07c;
  --map-4: #83cc57;
  --map-5: #f4e24d;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .map-layout[data-palette="spectrum"], :root[data-theme="system"] .map-layout:not([data-palette]) {
    --map-sea: #182022;
    --map-out: #4b5254;
    --map-0: #363b39;
    --map-1: #463e7c;
    --map-2: #2f6d86;
    --map-3: #27a07c;
    --map-4: #83cc57;
    --map-5: #f4e24d;
  }
}
.map-layout[data-palette="sunset"] {
  --map-sea: #d6e4ec;
  --map-out: #c3c7c6;
  --map-0: #f8f1e3;
  --map-1: #fde29a;
  --map-2: #fdb45a;
  --map-3: #f57f36;
  --map-4: #d9422b;
  --map-5: #99132a;
}
:root[data-theme="dark"] .map-layout[data-palette="sunset"] {
  --map-sea: #182022;
  --map-out: #4b5254;
  --map-0: #3a3634;
  --map-1: #74283a;
  --map-2: #9a2b2a;
  --map-3: #d6532c;
  --map-4: #f59a3d;
  --map-5: #fdd879;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .map-layout[data-palette="sunset"] {
    --map-sea: #182022;
    --map-out: #4b5254;
    --map-0: #3a3634;
    --map-1: #74283a;
    --map-2: #9a2b2a;
    --map-3: #d6532c;
    --map-4: #f59a3d;
    --map-5: #fdd879;
  }
}
.map-layout[data-palette="ocean"] {
  --map-sea: #ecedea;
  --map-out: #c3c7c6;
  --map-0: #e9eef1;
  --map-1: #cfe2f2;
  --map-2: #9cc5e6;
  --map-3: #5d9cd0;
  --map-4: #2e6cab;
  --map-5: #123f7a;
}
:root[data-theme="dark"] .map-layout[data-palette="ocean"] {
  --map-sea: #16191a;
  --map-out: #4b5254;
  --map-0: #2e3538;
  --map-1: #25436e;
  --map-2: #24507e;
  --map-3: #3577b2;
  --map-4: #6aa7dd;
  --map-5: #b6d8f5;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .map-layout[data-palette="ocean"] {
    --map-sea: #16191a;
    --map-out: #4b5254;
    --map-0: #2e3538;
    --map-1: #25436e;
    --map-2: #24507e;
    --map-3: #3577b2;
    --map-4: #6aa7dd;
    --map-5: #b6d8f5;
  }
}
.map-layout[data-palette="forest"] {
  --map-sea: #d6e4ec;
  --map-out: #c3c7c6;
  --map-0: #f6f3e8;
  --map-1: #d9edcf;
  --map-2: #a5d494;
  --map-3: #62b05a;
  --map-4: #2c853b;
  --map-5: #11572a;
}
:root[data-theme="dark"] .map-layout[data-palette="forest"] {
  --map-sea: #182022;
  --map-out: #4b5254;
  --map-0: #363a35;
  --map-1: #2a4e33;
  --map-2: #2b5d36;
  --map-3: #3d894a;
  --map-4: #6dbd69;
  --map-5: #b6e6a2;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .map-layout[data-palette="forest"] {
    --map-sea: #182022;
    --map-out: #4b5254;
    --map-0: #363a35;
    --map-1: #2a4e33;
    --map-2: #2b5d36;
    --map-3: #3d894a;
    --map-4: #6dbd69;
    --map-5: #b6e6a2;
  }
}
.map-layout[data-palette="brass"] {
  --map-sea: #d6e4ec;
  --map-out: #c3c7c6;
  --map-0: #f8f0de;
  --map-1: #efd9ae;
  --map-2: #e0b96f;
  --map-3: #c7913d;
  --map-4: #a1681b;
  --map-5: #6b420d;
}
:root[data-theme="dark"] .map-layout[data-palette="brass"] {
  --map-sea: #1a2122;
  --map-out: #4b5254;
  --map-0: #3b3a33;
  --map-1: #4f3f20;
  --map-2: #735727;
  --map-3: #9d7432;
  --map-4: #cb9840;
  --map-5: #f3c56a;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .map-layout[data-palette="brass"] {
    --map-sea: #1a2122;
    --map-out: #4b5254;
    --map-0: #3b3a33;
    --map-1: #4f3f20;
    --map-2: #735727;
    --map-3: #9d7432;
    --map-4: #cb9840;
    --map-5: #f3c56a;
  }
}

.map-totals { margin: 0; }
.map-controls { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: end; margin: 6px 0 14px; }
.map-controls label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); }
.map-controls select { min-width: 260px; }
.map-controls select.map-palette { min-width: 140px; }
.map-find input { width: 240px; }
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.map-card { padding: 10px; }
.map-stage { position: relative; background: var(--map-sea); border-radius: 10px; overflow: hidden; min-height: 150px; }
.map-stage svg { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.map-stage svg:active { cursor: grabbing; }
.map-loading { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; }
.m-country { fill: var(--map-out); stroke: var(--map-edge); stroke-width: 0.5; vector-effect: non-scaling-stroke; }
.m-country.is-tracked { cursor: pointer; }
.m-country.is-tracked:hover { stroke: var(--ink); stroke-width: 1.4; }
.m-dots g:hover circle.dot { stroke: var(--ink); }
.m-country.is-selected { stroke: var(--ink); stroke-width: 2; }
.m-dots circle { stroke: var(--map-edge); cursor: pointer; }
.m-dots circle.hit { fill: transparent; stroke: none; }
.m-dots g { cursor: pointer; }
.m-dots circle.is-selected { stroke: var(--ink); }
[data-lvl="out"] { fill: var(--map-out); background: var(--map-out); }
[data-lvl="0"] { fill: var(--map-0); background: var(--map-0); }
[data-lvl="1"] { fill: var(--map-1); background: var(--map-1); }
[data-lvl="2"] { fill: var(--map-2); background: var(--map-2); }
[data-lvl="3"] { fill: var(--map-3); background: var(--map-3); }
[data-lvl="4"] { fill: var(--map-4); background: var(--map-4); }
[data-lvl="5"] { fill: var(--map-5); background: var(--map-5); }
.map-zoom { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 4px; }
.map-zoom button {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--surface-raised); color: var(--ink); font-size: 17px; line-height: 1; cursor: pointer;
}
.map-tooltip {
  position: absolute; transform: translate(-50%, -100%); pointer-events: none; z-index: 3;
  display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px;
  background: var(--surface-raised); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  font-size: 13px; white-space: nowrap;
}
.map-tooltip em.ok { color: var(--ok); font-style: normal; font-weight: 600; }
/* Year slider: today's map fades back and the former countries sit on top */
.map-layout.is-past .m-land path { opacity: 0.38; }
.map-layout.is-past .m-dots:not(.m-past-dots) g { opacity: 0.38; }
.m-former { stroke: var(--ink); stroke-width: 1; stroke-opacity: 0.75; }
.m-former:hover { stroke-width: 1.8; stroke-opacity: 1; }
.m-former.is-selected { stroke-width: 2.4; stroke-opacity: 1; }
.map-time { padding: 12px 6px 2px; }
.map-time-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.map-time-year { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; color: var(--brass-strong); min-width: 3.2em; }
.map-time-hint { font-size: 13px; color: var(--ink-2); flex: 1 1 auto; }
.map-time-track { position: relative; margin-top: 4px; }
.map-time-track input[type="range"] { width: 100%; margin: 0; accent-color: var(--brass); cursor: pointer; position: relative; z-index: 1; background: transparent; }
.map-time-ticks { position: absolute; left: 8px; right: 8px; top: 50%; height: 0; pointer-events: none; }
.map-time-ticks span { position: absolute; left: calc(var(--at) * 100%); top: 7px; width: 2px; height: 7px; margin-left: -1px; border-radius: 1px; background: var(--brass); opacity: 0.7; }
.map-time-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-3); padding: 6px 2px 0; }
.map-time-opt { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); margin-left: auto; cursor: pointer; }
.panel-past { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 4px; }
.panel-past .link-button { padding: 0; text-align: left; }
.offmap-count { color: var(--ink-3); }
.map-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 10px 4px 2px; font-size: 13px; color: var(--ink-2); }
.legend-title { font-weight: 600; color: var(--ink); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-item .sw { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--border-strong); }
.map-panel h2 { margin-top: 4px; }
.map-panel .panel-big { font-family: var(--font-display); font-size: 2.6rem; font-weight: 600; line-height: 1; margin: 6px 0; color: var(--brass-strong); }
.map-panel .panel-back { padding: 0; }
.panel-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.panel-stats div { background: var(--surface-sunken); border-radius: 8px; padding: 8px 10px; }
.panel-stats dt { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-3); }
.panel-stats dd { margin: 2px 0 0; font-size: 1.3rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.panel-goals { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 12px; }
.panel-goals li { display: grid; gap: 4px; }
.panel-goals .progress { width: 100%; }
.offmap-list { display: flex; flex-wrap: wrap; gap: 8px; }
.offmap-item {
  display: inline-flex; gap: 8px; align-items: baseline; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer;
}
.offmap-item:hover { border-color: var(--brass); }
.hero-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
@media (max-width: 900px) {
  .map-layout { grid-template-columns: 1fr; }
  .map-controls select, .map-find input { min-width: 0; width: 100%; }
  .map-controls label { flex: 1 1 220px; }
}

/* ---------- country page (styled after the Country Binder pages) ---------- */
.cp {
  --bd-navy: #1a2744; --bd-gold: #c9a84c; --bd-gold-dim: rgba(201, 168, 76, 0.35);
  --bd-paper: #f8f5ef; --bd-ink: #2e2620; --bd-ocean: #dce8f0; --bd-line: #d8d2c4;
}
.cp.is-historic { --bd-navy: #2a2018; }
:root[data-theme="dark"] .cp { --bd-paper: #21292a; --bd-ink: #dfe5e1; --bd-ocean: #1c2a33; --bd-line: #3a4446; --bd-navy: #1d2b4b; }
:root[data-theme="dark"] .cp.is-historic { --bd-navy: #33281e; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .cp { --bd-paper: #21292a; --bd-ink: #dfe5e1; --bd-ocean: #1c2a33; --bd-line: #3a4446; --bd-navy: #1d2b4b; }
  :root[data-theme="system"] .cp.is-historic { --bd-navy: #33281e; }
}
.cp-head { background: var(--bd-paper); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); margin-bottom: 18px; }
.cp-band { background: var(--bd-navy); display: flex; align-items: center; gap: 16px; padding: 18px 26px; }
.cp-band h1 { margin: 0; flex: 1; min-width: 0; color: #fff; font-family: var(--font-display); font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; overflow-wrap: anywhere; }
/* Faint halo behind the wordmark so it lifts off the navy band without blurring the letters */
.cp-mark { height: 40px; width: auto; flex-shrink: 0; filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.28)); }
.cp-stripe { height: 4px; background: linear-gradient(to right, #8a6a1a, var(--bd-gold), #e8cc7a, var(--bd-gold), #8a6a1a); }
.cp-emblems { display: grid; grid-template-columns: 1.25fr 0.8fr 1.1fr; gap: 14px; padding: 16px 26px 6px; }
.cp-emblem { margin: 0; display: flex; flex-direction: column; border: 1px solid var(--bd-line); background: var(--bd-paper); min-width: 0; }
.cp-emblem figcaption { background: var(--bd-navy); color: var(--bd-gold); font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 3px 8px; }
.cp-emblem-img { height: 170px; display: flex; align-items: center; justify-content: center; padding: 10px; }
.cp-emblem-img img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.cp-globe .cp-emblem-img { padding: 0; background: var(--bd-ocean); }
.cp-globe .cp-emblem-img img { width: 100%; height: 100%; object-fit: cover; }
.cp-emblem-none { color: var(--ink-3); font-size: 13px; }
.cp-meta { margin: 0; padding: 6px 26px 16px; color: var(--ink-2); font-size: 14px; }

.cp-about { margin-bottom: 18px; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); background: var(--bd-paper); }
.cp-about-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; padding: 14px 26px; background: var(--bd-navy); color: #fff; }
.cp-about-head .cp-about-title { margin: 0; color: #fff; }
.cp-about-body { position: relative; overflow: hidden; transition: max-height 0.35s ease; }
.cp-about.is-folded .cp-about-body { cursor: pointer; }
.cp-about.is-folded .cp-about-body::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 60px; pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--bd-paper) 85%); }
.cp-about-more { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin: 0; padding: 12px 16px 14px;
  border: 0; border-top: 1px solid var(--bd-line); background: var(--bd-paper); color: var(--bd-ink); font: inherit; font-weight: 600;
  cursor: pointer; }
.cp-about.is-folded .cp-about-more { border-top-color: transparent; }
.cp-about-more:hover, .cp-about-more:focus-visible { background: color-mix(in srgb, var(--bd-gold) 14%, var(--bd-paper)); }
.cp-about-more:focus-visible { outline: 2px solid var(--bd-gold); outline-offset: -3px; }
.cp-about-chev { color: var(--bd-gold); transition: transform 0.25s ease; transform: rotate(180deg); }
.cp-about.is-folded .cp-about-chev { transform: none; animation: cp-nudge 1.8s ease-in-out 0.6s 2; }
@keyframes cp-nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }
@media (prefers-reduced-motion: reduce) { .cp-about-body, .cp-about-chev { color: var(--bd-gold); transition: none; } .cp-about.is-folded .cp-about-chev { animation: none; } }
.cp-about-title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }
.cp-about-hint { color: var(--bd-gold); font-size: 13px; }
.binder { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; padding: 20px 26px 0; color: var(--bd-ink); }
.binder-label { font-family: var(--font-body); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; color: var(--bd-ink);
  border-bottom: 2px solid var(--bd-navy); padding-bottom: 3px; margin: 0 0 10px; }
:root[data-theme="dark"] .binder-label { border-color: var(--bd-gold-dim); }
.binder-years { font-weight: 400; color: var(--ink-3); margin-left: 8px; }
.binder-about { font-family: var(--font-display); font-size: calc(1.08rem * var(--about-fit, 1)); line-height: 1.6; margin-bottom: 4px; }
.binder-about p { margin: 0 0 12px; text-align: justify; hyphens: auto; }
/* The landmark sits at the bottom of the left column, level with the bottom of Statistics */
.binder-main { display: flex; flex-direction: column; min-width: 0; }
.binder-landmark { display: flex; background: var(--bd-navy); margin: auto 0 0; min-height: 150px; }
.binder-lm-photo { position: relative; width: 240px; aspect-ratio: 3 / 2; align-self: center; flex-shrink: 0; background: #111; }
.binder-lm-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.binder-private { position: absolute; left: 6px; bottom: 6px; background: rgba(0, 0, 0, 0.7); color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 4px; }
.binder-lm-info { flex: 1; padding: 12px 16px; display: flex; flex-direction: column; gap: 5px; }
.binder-lm-name { color: #fff; font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: 1.1rem; }
.binder-lm-loc { color: var(--bd-gold); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.binder-lm-rule { width: 40px; height: 1px; background: var(--bd-gold); opacity: 0.5; }
.binder-lm-blurb { color: rgba(255, 255, 255, 0.78); font-family: var(--font-display); font-style: italic; font-size: 0.95rem; line-height: 1.45; }
.binder-stats { background: var(--bd-navy); align-self: stretch; }
.binder-stats-title { color: var(--bd-gold); font-family: var(--font-body); font-size: 12px; font-weight: 700; letter-spacing: 0.08em;
  padding: 8px 14px; margin: 0; border-bottom: 1px solid var(--bd-gold-dim); }
.binder-stats dl { margin: 0; padding: 0 14px 6px; }
.binder-stat { padding: 8px 0; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.binder-stat:first-child { border-top: 0; }
.binder-stat dt { color: var(--bd-gold); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; }
.binder-stat dd { margin: 1px 0 0; color: #fff; font-weight: 700; font-size: 15px; line-height: 1.2; }
.binder-stat dd.binder-stat-sub { color: rgba(255, 255, 255, 0.5); font-weight: 400; font-family: var(--font-display); font-style: italic; font-size: 13px; }
.binder-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; margin: 4px -26px 0;
  padding: 9px 26px; background: var(--bd-navy); color: var(--bd-gold); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.binder-curator { text-transform: none; font-style: italic; opacity: 0.75; letter-spacing: 0.02em; }

.cp-goals ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px 24px; }
.cp-goals li { display: grid; gap: 4px; }
.cp-collection .title-row { margin-bottom: 8px; }
.cp-collection h2 { margin: 0; }
.cp-credits { margin-top: 4px; }

@media screen and (max-width: 820px) {
  .binder-about p { text-align: left; hyphens: manual; }
  .cp-band { padding: 14px 16px; }
  .cp-mark { height: 30px; }
  .cp-emblems { grid-template-columns: 1fr 1fr; padding: 12px 16px 4px; }
  .cp-globe { grid-column: 1 / -1; }
  .cp-emblem-img { height: 130px; }
  .cp-meta { padding: 6px 16px 14px; }
  .cp-about-head { padding: 12px 16px; }
  .binder { grid-template-columns: 1fr; padding: 16px 16px 0; }
  .binder-landmark { flex-direction: column; }
  .binder-lm-photo { width: 100%; height: auto; aspect-ratio: 3 / 2; }
  .binder-foot { margin: 4px -16px 0; padding: 9px 16px; }
}

@media print {
  /* Paper is always light, whatever theme is on screen */
  :root, :root[data-theme] {
    --page: #fff; --surface: #fff; --surface-raised: #fff; --surface-sunken: #f1f3f2;
    --border: rgba(13, 20, 32, 0.15); --border-strong: rgba(13, 20, 32, 0.25);
    --ink: #0d1420; --ink-2: #48545c; --ink-3: #7c8890; --brass: #a9701f; --brass-strong: #8a5a15;
  }
  :root[data-theme] .cp { --bd-paper: #f8f5ef; --bd-ink: #2e2620; --bd-ocean: #dce8f0; --bd-line: #d8d2c4; --bd-navy: #1a2744; }
  :root[data-theme] .cp.is-historic { --bd-navy: #2a2018; }
  .binder-private { display: none; }
  .env-banner, .site-header, .site-footer, .crumbs, .sort-links, .cp-collection .title-row a { display: none !important; }
  body { background: #fff; }
  .cp, .cp * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cp-head, .cp-about, .card { box-shadow: none; break-inside: avoid; }
  .cp-about-hint, .cp-about-more { display: none !important; }
  .cp-about-body { max-height: none !important; }
  .cp-about-body::after { display: none !important; }
}

/* ---------- about + privacy ---------- */
.about-hero { text-align: center; padding: 4vh 0 2vh; }
.about-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; }
.about-grid > .card { margin-bottom: 0; }
.about-story p { line-height: 1.65; }
.about-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.about-stats div { background: var(--surface-sunken); border-radius: 8px; padding: 10px 12px; }
.about-stats dt { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); }
.about-stats dd { margin: 2px 0 0; font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.about-grid + .card { margin-top: 18px; }
.credit-list { margin: 0 0 18px; display: grid; gap: 12px; }
.credit-list div { display: grid; grid-template-columns: 190px 1fr; gap: 12px; }
.credit-list dt { font-weight: 600; }
.credit-list dd { margin: 0; color: var(--ink-2); }
.credit-summary { margin: 0 0 12px; padding-left: 18px; }
.credit-details summary { cursor: pointer; color: var(--brass-strong); margin-bottom: 8px; }
.prose { max-width: 760px; margin: 0 auto; }
.prose h2 { margin-top: 22px; }
.prose p { line-height: 1.65; }
.footer-links { display: inline-flex; gap: 16px; flex-wrap: wrap; }
@media (max-width: 760px) {
  .about-grid { grid-template-columns: 1fr; }
  .credit-list div { grid-template-columns: 1fr; gap: 2px; }
}
.credit-filters { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: end; margin-bottom: 12px; }
.credit-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); }
.credit-filters input { width: 240px; max-width: 100%; }
@media (max-width: 760px) { .credit-filters label { flex: 1 1 100%; } .credit-filters input { width: 100%; } }

/* ---------- image finder ---------- */
.kind-tabs { display: inline-flex; gap: 14px; }
.finder-form { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: end; scroll-margin-top: 12px; }
.finder-q { display: flex; flex-direction: column; gap: 4px; flex: 1 1 320px; font-size: 13px; color: var(--ink-2); }
.finder-src { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; }
.finder-src legend { font-size: 13px; color: var(--ink-2); margin-bottom: 4px; padding: 0; }
.finder-src label.is-off { color: var(--ink-3); }
.finder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.finder-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.finder-thumb { position: relative; display: block; height: 170px; border: 0; padding: 0; background: var(--surface-sunken); cursor: zoom-in; }
.finder-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.finder-match { position: absolute; left: 8px; top: 8px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--surface-raised); color: var(--ink-2); border: 1px solid var(--border); }
.finder-match.m-best { background: var(--ok-tint); color: var(--ok); border-color: transparent; }
.finder-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.finder-title { font-weight: 600; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.finder-fields { margin: 0; display: grid; gap: 3px; font-size: 13px; }
.finder-fields div { display: grid; grid-template-columns: 58px 1fr; gap: 6px; }
.finder-fields.wide div { grid-template-columns: 74px 1fr; }
.finder-fields dt { color: var(--ink-3); }
.finder-fields dd { margin: 0; overflow-wrap: anywhere; }
.finder-actions { margin-top: auto; display: flex; gap: 8px; }
.button.small { padding: 5px 12px; font-size: 13px; }
.lic { padding: 1px 6px; border-radius: 5px; }
.lic-free { background: var(--ok-tint); }
.lic-credit { background: #e3eefb; }
.lic-share { background: var(--warn-tint); }
.lic-check { background: var(--error-tint); }
:root[data-theme="dark"] .lic-credit { background: #1d2f45; }
@media (prefers-color-scheme: dark) { :root[data-theme="system"] .lic-credit { background: #1d2f45; } }
.finder-dialog { width: min(1100px, 94vw); max-height: 92vh; border: 0; border-radius: 14px; padding: 0; background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4); }
.finder-dialog::backdrop { background: rgba(10, 14, 20, 0.6); }
.finder-close { position: absolute; right: 10px; top: 6px; border: 0; background: none; color: var(--ink-2); font-size: 28px; cursor: pointer; z-index: 2; }
.finder-dialog-body { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); max-height: 92vh; }
.finder-big { background: var(--surface-sunken); display: flex; align-items: center; justify-content: center; min-height: 300px; }
.finder-big img { max-width: 100%; max-height: 88vh; object-fit: contain; }
.finder-dialog-info { padding: 22px 22px 18px; overflow-y: auto; }
.finder-dialog-info h2 { margin-top: 0; padding-right: 26px; overflow-wrap: anywhere; }
.finder-attrib { font-size: 13px; background: var(--surface-sunken); padding: 8px 10px; border-radius: 8px; }
.crop-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.crop-box { height: min(68vh, 640px); background: var(--surface-sunken); }
.crop-box img { display: block; max-width: 100%; }
.crop-svg { background: var(--surface-sunken); display: flex; justify-content: center; padding: 20px; }
.crop-svg img { max-width: 100%; max-height: 60vh; }
.crop-tools { display: flex; gap: 8px; margin: 10px 0 0; }
.crop-side .card { margin-bottom: 14px; }
.crop-side h2 { margin-top: 0; font-size: 1.05rem; }
.crop-preview { overflow: hidden; background: var(--surface-sunken); margin: 0 auto; }
.crop-preview img { max-width: none; }
.crop-preview-flag { width: 280px; height: 170px; }
.crop-preview-coat { width: 200px; height: 170px; }
.crop-preview-landmark { width: 300px; height: 200px; }
.crop-preview-flag > img, .crop-preview-coat > img { width: 100%; height: 100%; object-fit: contain; }
.crop-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); margin-bottom: 10px; }
.crop-form label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; }
.cp-change { display: block; text-align: center; font-size: 12px; padding: 3px 0 5px; }
@media (max-width: 900px) {
  .crop-layout, .finder-dialog-body { grid-template-columns: 1fr; }
  .crop-box { height: 52vh; }
}
.binder-lm-change { color: var(--bd-gold); }
.finder-current h2 { margin-top: 0; font-size: 1.05rem; }
.finder-current-row { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.finder-current-img { flex: 0 0 auto; width: 260px; height: 170px; background: var(--surface-sunken); display: flex; align-items: center; justify-content: center; border-radius: 8px; overflow: hidden; }
.finder-current-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.finder-current .finder-fields { flex: 1 1 280px; }
.crop-compare { display: grid; gap: 12px; }
.crop-compare figure { margin: 0; }
.crop-compare figcaption { font-size: 12px; color: var(--ink-3); text-align: center; margin-top: 4px; }
.crop-current { overflow: hidden; background: var(--surface-sunken); margin: 0 auto; display: flex; align-items: center; justify-content: center; }
.crop-current img { width: 100%; height: 100%; object-fit: contain; }
.crop-current.crop-preview-landmark img { object-fit: cover; }
.finder-words { margin: -6px 0 16px; }
.finder-words summary { cursor: pointer; color: var(--brass-strong); font-size: 14px; margin-bottom: 10px; }
.finder-words .form-grid { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.finder-words label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); }

/* ---------- "working" overlay for slow actions ---------- */
.busy-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: rgba(10, 14, 20, 0.45); }
.busy-box { display: flex; align-items: center; gap: 16px; padding: 22px 30px; border-radius: 14px; background: var(--surface-raised);
  color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); font-size: 1.1rem; font-weight: 600; }
.busy-spin { width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--brass-tint); border-top-color: var(--brass);
  border-right-color: var(--brass); animation: busy-spin 0.8s linear infinite; }
@keyframes busy-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .busy-spin { animation-duration: 2.4s; } }
.keys-form input[type=password] { width: 100%; min-width: 220px; }
.keys-tests { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.tag-warn { background: var(--warn-tint); color: var(--warn); }

/* ---------- accounts: avatar, account menu, sign-in, profile, users ---------- */
.avatar { border-radius: 50%; object-fit: cover; display: inline-block; flex: none; background: var(--surface-sunken); vertical-align: middle; }
.avatar-initials {
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; letter-spacing: 0.02em;
  color: #fff; font-family: var(--font-body, inherit); line-height: 1;
}
.avatar-initials[data-hue="0"] { background: #8a5a15; }
.avatar-initials[data-hue="1"] { background: #2c7a90; }
.avatar-initials[data-hue="2"] { background: #3d6b4a; }
.avatar-initials[data-hue="3"] { background: #7a3e6c; }
.avatar-initials[data-hue="4"] { background: #45508a; }
.avatar-initials[data-hue="5"] { background: #a0472d; }
.avatar-initials[data-hue="6"] { background: #2f6f6a; }
.avatar-initials[data-hue="7"] { background: #5e5a2c; }

.sign-in-link {
  font-weight: 600; font-size: 14px; text-decoration: none; padding: 7px 14px; border-radius: 8px;
  border: 1px solid var(--border-strong); color: var(--ink);
}
.sign-in-link:hover { border-color: var(--brass); color: var(--brass-strong); }

.user-menu { position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; border-radius: 50%; display: block; line-height: 0; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.user-menu > summary .avatar { box-shadow: 0 0 0 2px var(--surface-raised), 0 0 0 3px var(--border-strong); }
.user-menu[open] > summary .avatar, .user-menu > summary:hover .avatar { box-shadow: 0 0 0 2px var(--surface-raised), 0 0 0 3px var(--brass); }
.user-menu-panel {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 50; min-width: 240px; padding: 6px;
  background: var(--surface-raised); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.user-menu-who { display: flex; gap: 10px; align-items: center; padding: 8px 10px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.user-menu-who > div { display: flex; flex-direction: column; min-width: 0; }
.user-menu-who .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.user-menu-panel a, .user-menu-out {
  display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; font: inherit; font-size: 14px;
  font-weight: 600; text-decoration: none; color: var(--ink); background: none; border: 0; cursor: pointer;
}
.user-menu-panel a:hover, .user-menu-out:hover { background: var(--surface-sunken); color: var(--brass-strong); }
.user-menu-panel form { margin: 4px 0 0; padding-top: 4px; border-top: 1px solid var(--border); }

.login-card { max-width: 420px; }
.google-button {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 11px 16px;
  border-radius: 8px; border: 1px solid var(--border-strong); background: #fff; color: #1f1f1f;
  font-weight: 600; text-decoration: none; font-size: 15px;
}
.google-button:hover { border-color: #8a9aa0; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); color: #1f1f1f; }
.login-or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 13px; margin: 18px 0 6px; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.login-note { margin: 14px 0 0; }

.profile-row { display: flex; gap: 28px; align-items: flex-start; flex-wrap: wrap; }
.profile-pic { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 170px; text-align: center; }
.profile-pic p { margin: 0; }
.profile-fields { flex: 1 1 300px; max-width: 460px; }
.profile-fields p { margin: 0; }
.profile-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 4px 0; font-size: 14px; }
.profile-facts div { display: contents; }
.profile-facts dt { color: var(--ink-3); }
.profile-facts dd { margin: 0; }
.file-button { position: relative; overflow: hidden; display: inline-block; }
.file-button input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.file-button:focus-within { outline: 2px solid var(--brass); outline-offset: 2px; }
.crop-dialog { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.avatar-crop-box { max-width: 420px; height: 340px; background: var(--surface-sunken); border-radius: 10px; overflow: hidden; }
.avatar-crop-box img { display: block; max-width: 100%; }
.avatar-crop-box .cropper-view-box, .avatar-crop-box .cropper-face { border-radius: 50%; }
.signin-methods { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.signin-methods li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.signin-methods strong { min-width: 160px; }

.admin-tools { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.admin-tools a { font-weight: 600; margin-right: 6px; }
.user-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.user-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.user-who { display: flex; flex-direction: column; flex: 1 1 220px; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-table td { vertical-align: middle; }
.role-form select { padding: 4px 8px; font-size: 14px; }
.signup-toggle p { margin-top: 0; }

.keys-form input[type=text] { width: 100%; min-width: 220px; }
.keys-saved .small { word-break: break-all; }
.copy-box { display: inline-block; padding: 6px 10px; border-radius: 6px; background: var(--surface-sunken); font-size: 13px; word-break: break-all; user-select: all; }

@media (max-width: 760px) {
  .header-right { gap: 10px; }
  .user-menu-panel { right: -6px; }
  .profile-pic { width: 100%; }
}

/* ---------- collection: every piece ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 3px; border-radius: 10px; background: var(--surface-sunken); }
.tabs a { padding: 6px 14px; border-radius: 8px; font-weight: 600; font-size: 14px; text-decoration: none; color: var(--ink-2); }
.tabs a[aria-current="page"] { background: var(--surface-raised); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
.list-tools { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: end; margin-bottom: 6px; }
.list-tools label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); }
.list-find { flex: 1 1 280px; }
.list-find input { width: 100%; }
.list-count { margin: 8px 0; }
.items-list tr.piece-row { cursor: pointer; }
.items-list tr.piece-row:hover td { background: var(--surface-sunken); }
.items-list tr.piece-row.is-open td { background: var(--brass-tint); }
.col-open { width: 28px; padding-right: 0 !important; }
.piece-open { border: 0; background: none; cursor: pointer; color: var(--ink-3); font-size: 14px; padding: 2px 4px; line-height: 1; }
.piece-open span { display: inline-block; transition: transform 0.15s; }
.piece-open[aria-expanded="true"] span { transform: rotate(90deg); color: var(--brass-strong); }
.piece-detail-row > td { background: var(--surface); padding: 14px 18px 10px 40px; border-left: 3px solid var(--brass); }
.piece-details { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px 28px; }
.piece-details section h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); margin: 6px 0 6px; }
.piece-details dl { margin: 0 0 6px; display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 14px; }
.piece-details dl div { display: contents; }
.piece-details dt { color: var(--ink-3); white-space: nowrap; }
.piece-details dd { margin: 0; overflow-wrap: anywhere; }
.piece-facts.piece-details { display: block; }
.piece-facts.piece-details dl { grid-template-columns: 8.2em 1fr; }
.piece-facts.piece-details section + section { margin-top: 10px; }
.piece-foot { grid-column: 1 / -1; margin: 6px 0 0; }
.note-cell { max-width: 260px; }
@media (max-width: 760px) {
  .piece-detail-row > td { padding-left: 14px; }
}
.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 6px; }
.button-row form { margin: 0; }
.sync-card { display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.sync-card > div { flex: 1 1 380px; }
.sync-card p { margin: 6px 0; }
.sync-stats { grid-template-columns: repeat(5, 1fr); }
.diff-old { color: var(--ink-3); text-decoration: line-through; text-decoration-color: rgba(127, 127, 127, 0.5); }
.diff-new { font-weight: 600; }
tr.row-cont td { border-top-color: transparent; }
.plain-list { margin: 0; padding-left: 18px; }
@media (max-width: 760px) { .sync-stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- notifications ---------- */
.user-menu > summary { position: relative; }
.avatar-badge {
  position: absolute; top: -3px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: #d9422b; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px var(--surface-raised);
}
.notif-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.notif-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; }
.notif-list li .tag { margin-top: 2px; }
.alert-card { border-left: 4px solid var(--warn); }
.notif-channels { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.notif-channels fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin: 0; display: grid; gap: 8px; }
.notif-channels legend { font-weight: 600; padding: 0 4px; }
.notif-channels label:not(.check) { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); }
.notif-channels p { margin: 0; }
.share-form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin: 8px 0; }
.share-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); }
.share-form input { width: 140px; }
.cron-help { margin-top: 12px; }
.cron-help summary { cursor: pointer; font-weight: 600; color: var(--brass-strong); }

/* ---------- logs ---------- */
.log-filters { align-items: end; }
.log-filter-buttons { display: flex; gap: 8px; }
.log-table td { vertical-align: top; }
.log-more { margin-top: 4px; }
.log-more summary { cursor: pointer; font-size: 12px; color: var(--brass-strong); }
.log-more pre { margin: 6px 0; padding: 8px 10px; background: var(--surface-sunken); border-radius: 6px; font-size: 12px; max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.log-diff { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.log-diff h4 { margin: 6px 0 0; font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; }
.log-endpoint { word-break: break-all; max-width: 520px; }
.log-agent { font-size: 11px; }
.pager { display: flex; gap: 8px; margin: 12px 0 0; }
@media (max-width: 760px) { .log-diff { grid-template-columns: 1fr; } }

/* ---------- picture pages + picture manager ---------- */
.cp-emblem-link { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; cursor: zoom-in; }
.cp-emblem-link:hover img, .binder-lm-photo a:hover img { filter: brightness(1.06); }
.binder-lm-photo a { display: block; height: 100%; cursor: zoom-in; }
.picture-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; margin-bottom: 14px; }
.picture-big { margin: 0; background: var(--surface-sunken); border-radius: 12px; padding: 18px; text-align: center; }
.picture-big img { max-width: 100%; max-height: 70vh; width: auto; height: auto; display: inline-block; }
.picture-big.picture-landmark, .picture-big.picture-globe { padding: 0; overflow: hidden; }
.picture-big.picture-landmark img, .picture-big.picture-globe img { display: block; width: 100%; max-height: none; }
.picture-big figcaption { font-size: 13px; color: var(--ink-2); padding: 10px 14px; text-align: left; }
.picture-side .card { margin-bottom: 14px; }
.picture-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 10px; font-size: 14px; }
.picture-facts div { display: contents; }
.picture-facts dt { color: var(--ink-3); white-space: nowrap; }
.picture-facts dd { margin: 0; overflow-wrap: anywhere; }
.picture-form fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px 12px; margin: 0 0 12px; display: grid; gap: 10px; }
.picture-form legend { font-weight: 600; padding: 0 4px; }
.picture-form label:not(.check) { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--ink-2); }
.picture-form small { font-size: 12px; }
.pic-totals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.pic-totals .stat { display: flex; flex-direction: column; gap: 4px; text-decoration: none; }
.pic-table td { vertical-align: top; }
.pic-cell { min-width: 120px; }
.pic-thumb { display: flex; align-items: center; justify-content: center; width: 110px; height: 66px; background: var(--surface-sunken); border-radius: 6px; overflow: hidden; }
.pic-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pic-thumb.pic-landmark img, .pic-thumb.pic-globe img { width: 100%; height: 100%; object-fit: cover; max-height: none; }
.pic-gap { display: inline-flex; align-items: center; justify-content: center; width: 110px; height: 66px; border: 1px dashed var(--border-strong); border-radius: 6px; font-size: 13px; font-weight: 600; text-decoration: none; }
.pic-badges { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; max-width: 150px; }
.pic-badge { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 4px; text-decoration: none; background: var(--surface-sunken); color: var(--ink-2); }
.pic-badge.pb-missing, .pic-badge.pb-file_missing { background: var(--error-tint); color: var(--error); }
.pic-badge.pb-no_source, .pic-badge.pb-no_license, .pic-badge.pb-no_creator, .pic-badge.pb-noncommercial { background: var(--warn-tint); color: var(--warn); }
.pic-badge.pb-hidden, .pic-badge.pb-shared, .pic-badge.pb-shape { background: var(--brass-tint); color: var(--brass-strong); }
@media (max-width: 900px) { .picture-layout { grid-template-columns: 1fr; } .pic-totals { grid-template-columns: repeat(2, 1fr); } }
.pic-checked { margin-top: 3px; font-size: 11.5px; }
.pic-checked .ok-text { color: var(--ok); font-weight: 600; }
.pic-checked a { text-decoration: none; }
.piece-photos { grid-column: 1 / -1; }
.piece-photo-row { display: flex; flex-wrap: wrap; gap: 8px; }
.piece-photo-row img { height: 90px; width: auto; border-radius: 6px; background: var(--surface-sunken); display: block; }

/* Names visitors see */
.nick-form { display: flex; gap: .4rem; align-items: center; min-width: 16rem; }
.nick-form input[type="text"] { flex: 1; min-width: 8rem; }
.names-table td { vertical-align: middle; }

/* What changed (Numista sync) */
.changes-table td { vertical-align: top; }
.changes-table tr.change-first td { border-top: 1px solid var(--border-strong); }
.changes-table .change-piece { min-width: 14rem; }
.inline-form select { min-width: 16rem; }

/* Working through Admin > Pictures */
.back-to-list { margin: 0 0 10px; }
.pic-row { scroll-margin-top: 90px; }
.pic-row:target > td { animation: pic-flash 2.4s ease-out 1; }
@keyframes pic-flash { 0%, 35% { background: color-mix(in srgb, var(--brass) 22%, transparent); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .pic-row:target > td { animation: none; background: color-mix(in srgb, var(--brass) 14%, transparent); } }

/* Landmark details beside the current landmark in the finder */
.finder-current:has(.finder-landmark) { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 0 22px; }
.finder-current:has(.finder-landmark) > h2 { grid-column: 1 / -1; }
.finder-landmark { border-left: 3px solid var(--brass); padding: 2px 0 2px 14px; }
.finder-landmark h3 { margin: 0; font-family: var(--font-display); font-style: italic; font-size: 1.1rem; }
.finder-landmark-loc { margin: 2px 0 6px; color: var(--brass); font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; }
.finder-landmark-blurb { margin: 0 0 8px; font-size: 14px; line-height: 1.5; }
.finder-tries { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
@media (max-width: 760px) { .finder-current:has(.finder-landmark) { grid-template-columns: 1fr; } .finder-landmark { margin-top: 14px; } }
.finder-tries .chip { display: inline-block; padding: 3px 10px; border: 1px solid var(--border-strong); border-radius: 999px; text-decoration: none; color: var(--ink); background: var(--surface-sunken); }
.finder-tries .chip:hover { border-color: var(--brass); color: var(--brass-strong); }

/* Wikipedia's current picture, pinned first in the finder */
.finder-card.is-pinned { outline: 2px solid var(--brass); outline-offset: -2px; }
.finder-match.m-on { background: var(--brass); color: #1a1205; }
/* Picture search defaults */
.pic-defaults > summary { cursor: pointer; font-weight: 600; }
.pic-defaults-table td.center, .pic-defaults-table th.center { text-align: center; }

/* About: a credit with a special thank-you */
.credit-special { margin: 8px 0 0; padding: 6px 0 6px 12px; border-left: 3px solid var(--brass); font-style: italic; color: var(--ink-2); }

/* New pill on recently added pieces */
.pill-new { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; vertical-align: 2px; background: var(--brass); color: #1a1205; }
h1 .pill-new { font-size: 12px; vertical-align: 6px; }
.inline-setting { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.inline-setting input[type="number"] { width: 4.5em; }

/* Fill from Wikipedia */
.wf-table td { vertical-align: middle; }
.wf-thumb img { display: block; max-width: 120px; max-height: 70px; object-fit: contain; background: var(--surface-sunken); border-radius: 4px; }
.wf-table tr.wf-done { opacity: 0.45; }
.wf-progress .progress { display: block; margin: 6px 0; }
.checks-row { display: flex; flex-wrap: wrap; gap: 6px 16px; }

/* "?" help bubbles */
.help { position: relative; display: inline-block; vertical-align: middle; margin-left: 6px; }
.help-q { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; padding: 0; border-radius: 50%;
  border: 1.5px solid var(--ink-3); background: transparent; color: var(--ink-3); font: 700 11px/1 var(--font-body); cursor: pointer; }
.help-q:hover, .help-q[aria-expanded="true"] { border-color: var(--brass); color: var(--brass-strong); }
.help-q:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.help-q-demo { display: inline-flex; width: 16px; height: 16px; vertical-align: 1px; cursor: default; }
.help-pop { position: absolute; z-index: 40; top: calc(100% + 8px); left: -8px; width: min(320px, 80vw); padding: 10px 12px; border-radius: 8px;
  background: var(--surface-raised); border: 1px solid var(--border-strong); box-shadow: var(--shadow); color: var(--ink);
  font: 400 13px/1.5 var(--font-body); text-transform: none; letter-spacing: normal; text-align: left; white-space: normal; }
.help-pop strong { display: block; margin-bottom: 2px; }
.help-pop a { display: inline-block; margin-top: 4px; }
@media (max-width: 600px) { .help-pop { position: fixed; left: 16px; right: 16px; top: auto; bottom: 16px; width: auto; } }
/* Guide */
.guide { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; align-items: start; }
.guide-toc { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
.guide-toc h2 { font-size: 0.95rem; margin: 10px 0 4px; }
.guide-toc li { margin: 2px 0; font-size: 14px; }
.guide-topic { padding: 12px 0; border-top: 1px solid var(--border); scroll-margin-top: 16px; }
.guide-topic:first-of-type { border-top: 0; }
.guide-topic h3 { margin: 0 0 4px; }
.guide-short { color: var(--ink-2); font-style: italic; }
.guide-topic:target h3 { color: var(--brass-strong); }
@media (max-width: 800px) { .guide { grid-template-columns: 1fr; } .guide-toc { position: static; max-height: none; } }

/* Info cards */
.cards-table tr.cards-group th { text-align: left; padding-top: 14px; font-family: var(--font-display); font-size: 1rem; color: var(--brass-strong); border-bottom: 1px solid var(--border-strong); }
.piece-card .button-row { margin: 4px 0 0; }

/* Piece pages and photos */
.item-title { color: inherit; text-decoration: none; }
a.item-title:hover { text-decoration: underline; color: var(--brass-strong); }
.item-thumbs { display: flex; gap: 6px; margin-top: 6px; width: fit-content; }
.item-thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 50%; background: var(--surface-sunken); }
.item-thumbs.is-note img { width: auto; height: 54px; max-width: 120px; object-fit: contain; border-radius: 3px; border: 1px solid var(--border-strong); background: none; }
.item-thumbs:hover img { box-shadow: 0 0 0 2px var(--brass); }
.piece-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.piece-photos-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.piece-ph { margin: 0; }
.piece-ph.is-main { grid-column: span 2; }
.piece-ph-open { display: block; width: 100%; padding: 0; border: 0; background: var(--surface-sunken); border-radius: 10px; overflow: hidden; cursor: zoom-in; }
.piece-ph-open img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; }
.piece-ph figcaption { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.piece-nophoto { padding: 40px 16px; text-align: center; background: var(--surface-sunken); border-radius: 10px; }
.piece-zoom { width: min(96vw, 1400px); max-height: 94vh; padding: 12px 52px; border: 0; border-radius: 12px; background: #0b0f14; color: #eee; }
.piece-zoom::backdrop { background: rgba(0, 0, 0, 0.82); }
.piece-zoom img { display: block; max-width: 100%; max-height: 78vh; margin: 0 auto; object-fit: contain; }
.zoom-stage { overflow: hidden; display: flex; align-items: center; justify-content: center; max-height: 78vh; cursor: zoom-in; touch-action: none; user-select: none; }
.zoom-stage img { transform-origin: center center; transition: transform .08s ease-out; will-change: transform; }
.zoom-stage.is-zoomed { cursor: grab; }
.zoom-stage.is-zoomed:active { cursor: grabbing; }
.zoom-bar { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 8px; }
.zoom-bar button { background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 6px; min-width: 32px; height: 28px; cursor: pointer; font-size: 15px; }
.zoom-bar button:hover { background: rgba(255,255,255,.2); }
.zoom-level { min-width: 48px; text-align: center; font-size: 13px; color: #ccc; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .zoom-stage img { transition: none; } }
.piece-zoom p { text-align: center; margin: 8px 0 0; font-size: 14px; }
.piece-zoom-close { position: absolute; top: 6px; right: 10px; font-size: 28px; background: none; border: 0; color: #fff; cursor: pointer; }
.piece-zoom-nav { position: absolute; top: 50%; transform: translateY(-50%); font-size: 40px; background: none; border: 0; color: #fff; cursor: pointer; padding: 0 10px; }
.piece-zoom-nav.prev { left: 4px; } .piece-zoom-nav.next { right: 4px; }
.drop-zone { border: 2px dashed var(--border-strong); border-radius: 10px; padding: 18px; text-align: center; transition: background .15s, border-color .15s; }
.drop-zone.is-over { border-color: var(--brass-strong); background: color-mix(in srgb, var(--brass) 10%, transparent); }
.drop-zone p { margin: 0 0 4px; }
.drop-pick { display: inline; cursor: pointer; color: var(--brass-strong); text-decoration: underline; }
.drop-pick input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-pick:focus-within { outline: 2px solid var(--brass-strong); outline-offset: 2px; }
.drop-previews { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; text-align: left; }
.drop-msg { color: var(--warn); margin-top: 8px; }
.drop-previews:empty { display: none; }
.drop-item { display: grid; grid-template-columns: 160px 1fr auto; gap: 12px; align-items: center; padding: 8px; border-radius: 8px; background: var(--surface-sunken); }
.drop-view { padding: 0; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); cursor: zoom-in; width: 160px; height: 120px;
  display: flex; align-items: center; justify-content: center; overflow: hidden; }
.drop-view:hover, .drop-view:focus-visible { border-color: var(--brass-strong); outline: none; }
.drop-view img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
@media (max-width: 560px) { .drop-item { grid-template-columns: 110px 1fr auto; } .drop-view { width: 110px; height: 90px; } }
.drop-fields { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.drop-fields select, .drop-fields input { width: 100%; }
.drop-status { margin-top: 2px; }
.drop-status p { margin: 4px 0 0; }
.drop-bar { height: 6px; border-radius: 3px; background: var(--surface); overflow: hidden; }
.drop-bar span { display: block; height: 100%; width: 0; background: var(--brass); transition: width .2s; }
.drop-status.is-processing .drop-bar span { animation: drop-pulse 1.2s ease-in-out infinite; }
@keyframes drop-pulse { 50% { opacity: .45; } }
.drop-item.is-done .drop-bar span { background: var(--ok); }
.drop-item.is-failed .drop-status p { color: var(--error); }
.drop-item.is-failed .drop-bar span { background: var(--error); }
@media (prefers-reduced-motion: reduce) { .drop-status.is-processing .drop-bar span { animation: none; } }
.drop-remove { width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--ink); color: var(--surface); cursor: pointer; line-height: 1; font-size: 16px; align-self: start; }
.photo-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.photo-admin { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; }
.photo-admin img { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--surface-sunken); border-radius: 6px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 170px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
@media (max-width: 760px) { .piece-layout { grid-template-columns: 1fr; } .piece-photos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .piece-ph.is-main { grid-column: span 1; } .timeline li { grid-template-columns: 1fr; gap: 2px; } .piece-zoom { padding: 12px 36px; } }
.matrix tr.matrix-head th { background: var(--surface-sunken); color: var(--ink-2); font-size: 11px; padding-top: 10px; }
.feature-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px 24px; }
.feature-list li { display: flex; gap: 10px; align-items: flex-start; }
.feature-list p { margin: 2px 0 0; color: var(--ink-2); font-size: 14px; }
.feature-mark { flex: none; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; border: 1.5px solid var(--border-strong); color: var(--ink-3); margin-top: 1px; }
.feature-mark.is-done { background: var(--ok-tint); border-color: var(--ok); color: var(--ok); }
.feature-soon h2 { color: var(--ink-2); }
.hero.hero-compact { padding: 2vh 0 10px; }
.hero-compact .hero-wordmark { width: min(440px, 100%); }
.hero-compact .lede { margin: 4px 0 0; }
.map-simple .title-row, .map-simple .map-controls, .map-simple .map-panel, .map-simple .map-time, .map-simple #past-list, .map-simple .map-zoom { display: none !important; }
.map-simple .map-layout { grid-template-columns: 1fr; }
.map-simple .map-stage svg { cursor: pointer; }
.map-simple-totals { text-align: center; margin: 0 0 8px; }
.finder-own summary { cursor: pointer; }
.finder-own[open] summary { margin-bottom: 12px; }
.own-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px 16px; }
.own-fields input, .own-fields select { width: 100%; }
.own-preview { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 10px; }
.own-preview img { max-width: 180px; max-height: 140px; object-fit: contain;
  background: repeating-conic-gradient(var(--surface-sunken) 0 25%, var(--surface) 0 50%) 0 0 / 16px 16px; border: 1px solid var(--border); border-radius: 6px; }
.uv-tools { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; }
.uv-chip { font: inherit; font-size: 13px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.uv-chip::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; background: #7b3fe4; opacity: .35; vertical-align: 1px; }
.uv-chip[aria-pressed="true"] { border-color: #7b3fe4; background: color-mix(in srgb, #7b3fe4 14%, var(--surface)); color: var(--ink); }
.uv-chip[aria-pressed="true"]::before { opacity: 1; box-shadow: 0 0 6px #9d6bff; }
.item-thumbs img.uv-only { display: none; }
.show-uv .item-thumbs img.uv-only { display: block; }
.show-uv .item-thumbs img[data-uv] { box-shadow: 0 0 0 2px #7b3fe4; }
.piece-uv-switch { margin: 0 0 10px; }
.guest-view-bar { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; padding: 8px 16px;
  background: color-mix(in srgb, var(--brass) 22%, var(--surface)); border-bottom: 1px solid var(--brass-strong); font-size: 14px; }

/* ---------- stats page ---------- */
.stats-tiles .stat .small { margin-top: 4px; }
.stats-grid { columns: 2; column-gap: 20px; }
.stats-grid .card { margin: 0 0 20px; break-inside: avoid; }
@media (max-width: 860px) { .stats-grid { columns: 1; } }
.bar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bar-list li { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; align-items: center; gap: 10px; font-size: 13.5px; padding: 2px 4px; border-radius: 6px; }
.bar-list li:hover { background: var(--surface-sunken); }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 12px; display: block; }
.bar-fill { display: block; height: 100%; background: var(--brass); border-radius: 0 4px 4px 0; min-width: 2px; }
.bar-list li:hover .bar-fill { background: var(--brass-strong); }
.bar-value { font-variant-numeric: tabular-nums; color: var(--ink-2); min-width: 3.5em; text-align: right; }
.stats-value-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
@media (max-width: 860px) { .stats-value-grid { grid-template-columns: 1fr; } }
.stats-big { font-family: var(--font-display); font-size: 40px; font-weight: 600; margin: 0 0 4px; font-variant-numeric: tabular-nums; }
.stats-value h3 { margin-top: 0; }
.stats-top { margin: 0; padding-left: 1.4em; display: grid; gap: 6px; font-size: 13.5px; }
.stats-top li { display: grid; grid-template-columns: 1fr auto; column-gap: 10px; }
.stats-top li .muted { grid-column: 1; }
.stats-top-v { grid-column: 2; grid-row: 1; font-variant-numeric: tabular-nums; }

/* ---------- piece lists: List / Tiles / Detail (assets/list-view.js, _items_table.php) ---------- */
.list-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 10px; }
.view-switch { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; margin-right: 6px; }
.view-switch button { font: inherit; font-size: 13px; padding: 5px 11px; border: 0; background: var(--surface); color: var(--ink-2); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; }
.view-switch button + button { border-left: 1px solid var(--border-strong); }
.view-switch button:hover { color: var(--ink); }
.view-switch button[aria-pressed="true"] { background: var(--brass-tint); color: var(--ink); font-weight: 600; }
.view-switch button:focus-visible { outline: 2px solid var(--brass-strong); outline-offset: -2px; }
.vs-icon { width: 13px; height: 11px; display: inline-block; color: currentColor; }
.vs-list { background: linear-gradient(currentColor 0 0) 0 0 / 100% 2px no-repeat, linear-gradient(currentColor 0 0) 0 50% / 100% 2px no-repeat, linear-gradient(currentColor 0 0) 0 100% / 100% 2px no-repeat; }
.vs-tile { background: linear-gradient(currentColor 0 0) 0 0 / 5px 4px no-repeat, linear-gradient(currentColor 0 0) 100% 0 / 5px 4px no-repeat,
  linear-gradient(currentColor 0 0) 0 100% / 5px 4px no-repeat, linear-gradient(currentColor 0 0) 100% 100% / 5px 4px no-repeat; }
.vs-detail { background: linear-gradient(currentColor 0 0) 0 0 / 5px 100% no-repeat, linear-gradient(currentColor 0 0) 100% 1px / 6px 2px no-repeat,
  linear-gradient(currentColor 0 0) 100% 5px / 6px 2px no-repeat, linear-gradient(currentColor 0 0) 100% 9px / 6px 2px no-repeat; }

/* List view: the big photos are only for the other views */
.view-list .c-photos { display: none; }

/* Tiles and Detail: the table becomes cards; the headings become "Sort by" buttons */
.view-tile, .view-detail { overflow: visible; }
.view-tile table.items, .view-detail table.items,
.view-tile table.items tbody, .view-detail table.items tbody,
.view-tile table.items thead, .view-detail table.items thead { display: block; border: 0; }
.view-tile table.items thead tr, .view-detail table.items thead tr { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 12px; }
.view-tile table.items thead tr::before, .view-detail table.items thead tr::before { content: "Sort by"; font-size: 13px; color: var(--ink-3); margin-right: 2px; }
.view-tile table.items thead th, .view-detail table.items thead th { display: flex; padding: 0; border: 0; background: none; font-size: 13px; font-weight: 400;
  text-transform: none; letter-spacing: 0; position: static; }
.view-tile table.items thead th:not([data-key]), .view-detail table.items thead th:not([data-key]) { display: none; }
.view-tile .th-sort, .view-detail .th-sort { padding: 4px 11px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-2); }
.view-tile th.is-sorted .th-sort, .view-detail th.is-sorted .th-sort { border-color: var(--brass); background: var(--brass-tint); color: var(--ink); }
.view-tile table.items td, .view-detail table.items td { border: 0; padding: 0; background: none !important; }
.view-tile .c-open, .view-detail .c-open, .view-tile tr.piece-detail-row, .view-detail tr.piece-detail-row { display: none !important; }
.view-tile td.c-piece .item-thumbs, .view-detail td.c-piece .item-thumbs { display: none; }
.big-photos { display: flex; gap: 8px; justify-content: center; align-items: center; text-decoration: none; }
.big-photos img { display: block; background: var(--surface-sunken); }
.big-photos:not(.is-note) img { border-radius: 50%; object-fit: cover; aspect-ratio: 1; }
.big-photos.is-note img { object-fit: contain; border-radius: 3px; border: 1px solid var(--border-strong); background: none; }
.big-photos img.uv-only { display: none; }
.show-uv .big-photos img.uv-only { display: block; }
.show-uv .big-photos img[data-uv] { box-shadow: 0 0 0 2px #7b3fe4; }
.big-photos:hover img { box-shadow: 0 0 0 2px var(--brass); }
.no-photo { display: grid; place-items: center; min-height: 70px; border: 1px dashed var(--border-strong); border-radius: 8px; color: var(--ink-3); font-size: 12px; }

/* Tiles: laid out like the printed info cards (country and name top, photos middle, grade and N# bottom-left, year bottom-right) */
.view-tile table.items tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.view-tile table.items tbody tr { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto 1fr auto auto;
  grid-template-areas: "country country" "piece piece" "photos photos" "grade year" "n year";
  gap: 2px 8px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-raised); box-shadow: var(--shadow); cursor: default; }
.view-tile table.items tbody tr:hover { border-color: var(--brass); }
.view-tile td.c-country { grid-area: country; font-weight: 700; font-size: 13px; }
.view-tile td.c-country a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.view-tile td.c-piece { grid-area: piece; font-size: 14px; line-height: 1.3; }
.view-tile td.c-piece .muted.small { display: none; }
.view-tile td.c-photos { grid-area: photos; padding: 10px 0 8px !important; align-self: center; }
.view-tile .big-photos img { width: calc(50% - 4px); max-width: 130px; }
.view-tile .big-photos.is-note { flex-direction: column; gap: 6px; }
.view-tile .big-photos.is-note img { width: 100%; max-width: none; max-height: 110px; }
.view-tile td.c-grade { grid-area: grade; align-self: end; }
.view-tile td.c-year { grid-area: year; align-self: end; justify-self: end; text-align: right; font-weight: 700; font-size: 13px; }
.view-tile td.c-n { grid-area: n; font-size: 12px; color: var(--ink-3); }
.view-tile td.c-n::before { content: "N# "; }
.view-tile td.c-x { display: none; }

/* Detail: big photos beside every column the viewer has picked */
.view-detail table.items tbody tr { display: grid; grid-template-columns: minmax(0, 560px) minmax(220px, 1fr); grid-template-areas: "photos info";
  gap: 0 24px; padding: 18px; margin: 0 0 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-raised); box-shadow: var(--shadow); align-items: start; cursor: default; }
.view-detail table.items tbody tr > td { grid-column: 2; }
.view-detail td.c-photos { grid-column: 1 !important; grid-row: 1 / span 30; align-self: center; }
.view-detail .big-photos { gap: 14px; }
.view-detail .big-photos img { width: calc(50% - 7px); max-width: 270px; }
.view-detail .big-photos.is-note img { width: calc(50% - 7px); max-width: none; max-height: 260px; }
.view-detail .no-photo { min-height: 160px; }
.view-detail td.c-piece { font-size: 18px; margin-bottom: 6px; }
.view-detail td.c-piece .item-title { font-family: var(--font-display); }
.view-detail td.c-country { font-weight: 700; }
.view-detail td[data-label] { display: flex; gap: 10px; font-size: 14px; padding: 3px 0 !important; border-top: 1px solid var(--border) !important; text-align: left; }
.view-detail td[data-label]::before { content: attr(data-label); flex: 0 0 96px; color: var(--ink-3); font-size: 13px; }
.view-detail td[data-label]:empty { display: none; }
.view-detail td.c-year .muted.small { display: inline; margin-left: 4px; }

@media (max-width: 700px) {
  .view-tile table.items tbody { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .view-tile table.items tbody tr { padding: 9px; }
  .view-tile td.c-piece { font-size: 13px; }
  .view-detail table.items tbody tr { grid-template-columns: 1fr; grid-template-areas: none; padding: 12px; }
  .view-detail table.items tbody tr > td, .view-detail td.c-photos { grid-column: 1 !important; grid-row: auto; }
  .view-detail td.c-photos { margin-bottom: 8px; }
}

/* ---------- gallery (/gallery, assets/gallery.js) ---------- */
.gallery-card .list-bar { margin-top: 4px; }
.gallery-card .list-bar .list-count { margin: 0 8px 0 0; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); grid-auto-flow: dense; gap: 18px 14px; margin: 6px 0 14px; }
.g-item { margin: 0; min-width: 0; }
.g-item.is-note { grid-column: span 2; }
.g-open { all: unset; box-sizing: border-box; position: relative; display: block; width: 100%; aspect-ratio: 1; cursor: zoom-in;
  border-radius: 12px; background: var(--surface-sunken); overflow: hidden; }
.g-item.is-note .g-open { aspect-ratio: 2 / 1; }
.g-open img { position: absolute; inset: 8%; width: 84%; height: 84%; object-fit: contain; transition: opacity .35s ease, transform .35s ease; }
.g-item.is-note .g-open img { inset: 6% 4%; width: 92%; height: 88%; }
.g-open .g-back { opacity: 0; }
.g-open img.uv-only { display: none; }
.show-uv .g-open img.uv-only { display: block; }
.show-uv .g-item[data-has-uv] .g-open { box-shadow: inset 0 0 0 2px #7b3fe4; }
@media (hover: hover) {
  .g-open:hover .g-back { opacity: 1; }
  .g-open:hover .g-front:not(:only-child) { opacity: 0; }
  .g-open:hover img:only-child { transform: scale(1.04); }
}
.g-open:focus-visible { outline: 3px solid var(--brass-strong); outline-offset: 2px; }
.g-item figcaption { margin-top: 7px; font-size: 13.5px; line-height: 1.3; }
.g-item figcaption a { color: var(--ink); font-weight: 600; text-decoration: none; }
.g-item figcaption a:hover { color: var(--brass-strong); text-decoration: underline; }
.g-item figcaption > span:last-child { display: block; color: var(--ink-3); font-size: 12.5px; margin-top: 1px; }
.g-item figcaption .pill-new { margin-left: 5px; }
.gz-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; margin-top: 8px; font-size: 14px; }
.gz-sides { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.gz-sides button { font: inherit; font-size: 13px; padding: 4px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.3); background: none; color: #ddd; cursor: pointer; }
.gz-sides button[aria-pressed="true"] { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.6); }
.gz-sides button.is-uv { border-color: #9d6bff; }
.gz-title a { color: #f0c46c; font-weight: 600; }
.gz-where { color: #aaa; }
@media (max-width: 600px) {
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; }
  .g-item figcaption { font-size: 13px; }
}

/* Phones: logo, theme and sign-in on the top line; the six nav links get their own line below (no sideways scroll) */
@media (max-width: 760px) {
  .site-header { flex-wrap: wrap; row-gap: 10px; column-gap: 10px; }
  .header-right { display: contents; }
  .brand { margin-right: auto; }
  .site-nav { order: 5; flex: 1 1 100%; justify-content: space-between; gap: 6px; }
}

/* Home: Collection / Gallery / Goals buttons between the wordmark and the map */
.home-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 18px 0 22px; }
.home-links .button { min-width: 120px; text-align: center; }
.home-new { text-align: center; margin: -10px 0 16px; }
.home-new a { color: inherit; text-decoration: none; }
.home-new a:hover { text-decoration: underline; }
@media (max-width: 600px) { .home-links { gap: 8px; } .home-links .button { min-width: 0; flex: 1 1 0; padding-left: 8px; padding-right: 8px; } }

/* ---------- landmark ideas (/admin/landmarks/{slug}) ---------- */
.idea-now { display: flex; gap: 18px; align-items: flex-start; }
.idea-now img { width: 220px; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 8px; flex: none; }
.idea-now h2 { margin: 2px 0 2px; }
.idea-kind { margin: 0; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--brass-strong); font-weight: 700; }
.idea-loc { margin: 0 0 6px; color: var(--ink-2); font-size: 13.5px; font-style: italic; }
.idea-ask { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-bottom: 14px; }
.idea-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin: 4px 0 12px; }
.idea-card { display: flex; flex-direction: column; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-raised); }
.idea-card.is-current { border-color: var(--brass); box-shadow: 0 0 0 1px var(--brass) inset; }
.idea-card h3 { margin: 4px 0 2px; font-family: var(--font-display); font-size: 1.15rem; line-height: 1.25; }
.idea-blurb { font-size: 13.5px; margin: 0 0 12px; color: var(--ink); }
.idea-actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.idea-actions form { margin: 0; }
.finder-idea h2 { margin: 2px 0; }
.binder-lm-edit { display: inline-block; margin-top: 6px; font-size: 12px; }
@media print { .binder-lm-edit { display: none !important; } }
@media (max-width: 600px) { .idea-now { flex-direction: column; } .idea-now img { width: 100%; } }
.finder-ideas > summary { cursor: pointer; }
.finder-ideas[open] > summary { margin-bottom: 12px; }
.idea-grid.compact { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.idea-grid.compact .idea-card { padding: 11px 13px; }
.idea-grid.compact .idea-card h3 { font-size: 1.02rem; }
.idea-grid.compact .idea-blurb { font-size: 12.5px; margin-bottom: 8px; }
.finder-ideas .idea-ask { margin: 4px 0 0; }
.idea-ask-form { margin: 0 0 14px; }
.kind-chips { border: 0; padding: 0; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.kind-chips legend { padding: 0; margin-bottom: 6px; width: 100%; }
.kind-chip { position: relative; cursor: pointer; }
.kind-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.kind-chip span { display: inline-block; font-size: 13px; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-2); }
.kind-chip input:checked + span { border-color: var(--brass); background: var(--brass-tint); color: var(--ink); font-weight: 600; }
.kind-chip input:checked + span::before { content: "✓ "; }
.kind-chip input:focus-visible + span { outline: 2px solid var(--brass-strong); outline-offset: 2px; }
.idea-ask .idea-wish { flex: 1 1 320px; }
.idea-ask .idea-wish input { width: 100%; }
.idea-why { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--brass-strong); }
.idea-key-problem ol { margin: 6px 0 0; padding-left: 20px; }
.idea-key-problem a { color: inherit; }
.idea-cost { margin: 6px 0 0; }

/* World location drawn live (assets/locator.js): crimson country, brass frame, on the box's sea colour */
.cp-locator { width: 100%; height: 100%; }
.cp-locator img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cp-locator svg { display: block; }
.cp-globe .cp-emblem-img:has(.cp-locator.is-drawn) { background: #dce8f0; }
.idea-own { margin: 4px 0 12px; padding-top: 12px; border-top: 1px dashed var(--border-strong); align-items: flex-end; }
.idea-own .idea-wish { display: flex; flex-direction: column; gap: 4px; }
.cp-locator { display: flex; align-items: center; justify-content: center; }
.locator-fail { color: var(--ink-3); font-size: 13px; }
.binder-lm-kind { color: var(--bd-gold); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.85; }
.kind-sep { align-self: center; margin: 0 2px 0 8px; }
.kind-chip.not-place span { border-style: dashed; }
.kind-chip.not-place input:checked + span { border-style: solid; }

/* "Only pieces with photos" chip (list bar) */
.photo-chip { font: inherit; font-size: 13px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.photo-chip::before { content: "▣ "; color: var(--brass); }
.photo-chip[aria-pressed="true"] { border-color: var(--brass); background: var(--brass-tint); color: var(--ink); font-weight: 600; }

/* Back to top: appears once the page is scrolled */
.to-top { position: fixed; right: 18px; bottom: 18px; z-index: 50; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border-strong);
  background: var(--surface-raised); color: var(--ink); box-shadow: var(--shadow); cursor: pointer; font-size: 20px; line-height: 1;
  display: grid; place-items: center; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .2s, transform .2s; }
.to-top.is-on { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { border-color: var(--brass); color: var(--brass-strong); }
.to-top:focus-visible { outline: 2px solid var(--brass-strong); outline-offset: 2px; }
@media print { .to-top { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .to-top { transition: none; } }

/* Bot protection: the hidden trap box on sign-in (Guard::fields) stays off screen for people and screen readers */
.hp-field { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
/* Admin > Users > Sign-in protection */
.guard-form fieldset { border: 0; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
.guard-form legend { font-weight: 600; margin-bottom: .35rem; }
.guard-form label { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.guard-form input[type=number] { width: 5.5rem; }
/* Privy mark icons (Privy::icons) beside the mark's words */
.privy-ic { display: inline-flex; align-items: flex-end; gap: 2px; margin-right: .35em; vertical-align: -0.2em; }
/* Privy marks above the year in Tiles (like the coin flip cards) and beside it in Detail; not in List */
.year-privy { display: none; }
.view-tile td.c-year .year-privy { display: flex; justify-content: flex-end; margin: 0 0 2px; }
.view-tile td.c-year .privy-svg { width: 20px; height: 20px; }
.view-tile td.c-year .privy-svg.is-small { width: 11px; height: 11px; }
.view-detail td.c-year .year-privy { display: inline-flex; }
.view-detail td.c-year .privy-svg { width: 18px; height: 18px; }
.year-privy-text { font-size: 11px; font-weight: 400; color: var(--ink-3); white-space: normal; max-width: 120px; text-align: right; }
.privy-svg { width: 1.2em; height: 1.2em; fill: currentColor; }
.privy-svg.is-small { width: .65em; height: .65em; }
/* About credits: an organisation's own logo beside its name (only where its rules allow; Wikimedia Commons) */
.credit-logo { display: inline-flex; align-items: center; gap: .4em; }
.credit-logo img { width: auto; height: 1.35em; flex: none; }
.credit-tm { display: block; margin-top: 4px; }
/* Picture finder: a slow source (Openverse) still looking, done or failed */
.finder-late { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; margin: 0 0 12px;
  border: 1px solid var(--line, rgba(127,127,127,.3)); border-radius: 8px; font-size: .9rem; }
.finder-late .spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--brass-tint); border-top-color: var(--brass);
  animation: busy-spin 0.8s linear infinite; flex: none; }
.finder-late.is-done .spinner, .finder-late.is-error .spinner { display: none; }
.finder-late.is-done { opacity: .75; }
.finder-late.is-error { border-color: var(--warn, #b7791f); }
@media (prefers-reduced-motion: reduce) { .finder-late .spinner { animation-duration: 2.4s; } }
/* Goal edit: Check with Numista */
.nk-actions { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; }
.nk-actions form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.nk-table td { vertical-align: top; }
.nk-titles { display: block; max-width: 28em; }
/* Change many pieces (bulk edit) */
.bulk-filters { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; }
.bulk-filters label { display: grid; gap: 4px; min-width: 150px; flex: 1 1 150px; }
.bulk-filter-go { display: flex; gap: 10px; align-items: center; }
.bulk-table td:first-child, .bulk-table th:first-child { width: 2.2em; }
.bulk-table tr.is-waiting td { background: color-mix(in srgb, var(--brass, #b8913f) 8%, transparent); }
.bulk-action { position: sticky; bottom: 8px; z-index: 5; display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end;
  box-shadow: 0 -2px 14px rgba(0,0,0,.18); margin-top: 12px; }
.bulk-action label { display: grid; gap: 4px; }
.bulk-action label[hidden] { display: none; }
.bulk-action input[type=text] { min-width: 16em; }
/* Waiting for Numista */
.outbox-send { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin: 10px 0; }
.outbox-daily { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.outbox-daily input[type=number] { width: 5.5em; }
.outbox-error { color: var(--danger, #b0342b); }
.piece-edit textarea { width: 100%; }
.bulk-filters input, .bulk-filters select { width: 100%; min-width: 0; box-sizing: border-box; }
@media (max-width: 640px) {
  .bulk-filters label { flex-basis: 100%; }
  .bulk-action input[type=text] { min-width: 0; width: 100%; }
  .bulk-action label { flex: 1 1 100%; }
}
.bulk-top-links { display: inline-flex; gap: 12px; align-items: center; margin-left: auto; }
/* Change many pieces: by country */
.bulk-tabs { margin: 0 0 12px; }
.bulk-books { align-self: center; }
.bulk-names-bar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 0 0 10px; }
.bulk-country-table .bulk-loc { width: 100%; min-width: 12em; box-sizing: border-box; }
.bulk-country-table tr.is-differs .bulk-loc { border-color: var(--brass, #b8913f); box-shadow: 0 0 0 1px var(--brass, #b8913f); }
.bulk-country-table td.num, .bulk-country-table th.num { text-align: right; }
.bulk-filters label.bulk-books { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.bulk-filters label.bulk-books input { width: auto; }
.bulk-filters label.bulk-books .muted { flex-basis: 100%; }
/* Fill from Wikipedia: yearly re-check card */
.recheck-actions { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; }
.recheck-actions .inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.recheck-actions input[type=number] { width: 5em; }
/* Waiting for Numista: tags on pieces and the Admin tile */
.tag-link { text-decoration: none; }
.tag-link:hover { text-decoration: underline; }
.stat .stat-sub { display: block; color: var(--muted, #8a8a8a); margin-top: 2px; }
.stat.stat-warn { border-color: var(--warn, #b7791f); }
/* Storage locations */
.storage-table tr.is-flagged td:first-child { box-shadow: inset 3px 0 0 var(--warn, #b7791f); }
.storage-flag { color: var(--warn, #b7791f); }
.storage-rename { display: flex; gap: 6px; align-items: center; }
.storage-rename input[type=text] { min-width: 14em; flex: 1; }
.bulk-top-links { gap: 14px; }
/* Rows hidden by a search box as you type (assets/autofilter.js) */
tr.is-search-out { display: none; }

/* Admin > Settings */
h2.settings-group { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 26px 0 8px; }
.settings-grid { display: grid; gap: 8px; }
.settings-grid label { display: flex; gap: 10px; align-items: center; }
.settings-grid input[type="number"] { width: 5em; }
.settings-grid p { margin: 6px 0 0; }
.settings-elsewhere { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 4px 24px; }
.settings-elsewhere h3 { font-size: 14px; margin: 4px 0 6px; }

/* Worklist */
.worklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.worklist .wl-item { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.worklist .wl-item:first-child { border-top: 0; }
.worklist .wl-link { display: inline-flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 600; }
.worklist .wl-link:hover .wl-label { text-decoration: underline; }
.worklist .wl-clear { margin-left: auto; }
.worklist .wl-clear .link-button { color: var(--ink-3); }
.worklist .wl-clear .link-button:hover { color: var(--brass-strong); }
.wl-restore { margin-top: 4px; }
.worklist .wl-n { min-width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; color: var(--brass); font-weight: 700; }
.worklist .is-problem .wl-n { color: var(--error); }
.worklist-short .wl-item { padding: 5px 0; }
.owned-hint { display: block; margin-top: 4px; }
p.owned-hint { margin: 0; padding: 8px 10px; border-radius: 6px; background: var(--brass-tint); }
.two-col + .card { margin-top: 20px; }
/* Map filters */
.map-filters { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: -4px 0 14px; font-size: 13px; color: var(--ink-2); }
.map-filters-title { font-weight: 600; color: var(--ink); }
.map-filters label { display: inline-flex; align-items: center; gap: 6px; }
.map-filters input[type="number"] { width: 6.5em; padding: 8px 10px; font-size: 14px; }
.map-filters.is-off label { opacity: .5; }
/* Pieces that left the collection */
.piece-departed { border-left: 4px solid var(--brass); }
.piece-departed p { margin: 0 0 6px; }
.leave-reasons { display: flex; flex-wrap: wrap; gap: 6px 18px; border: 0; padding: 0; margin: 0; }
.leave-reasons legend { font-weight: 600; margin-bottom: 6px; }
.past-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.past-chips .chip[aria-current="page"] { border-color: var(--brass); background: var(--brass-tint); }
.past-chips .chip { display: inline-block; padding: 4px 12px; border: 1px solid var(--border-strong); border-radius: 999px; text-decoration: none; color: var(--ink); font-size: 14px; }
/* Admin > Settings: printed page colours */
.print-colors .pc-pick { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: end; margin-bottom: 12px; }
.print-colors .pc-pick label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.print-colors input[type="color"] { width: 72px; height: 36px; padding: 2px; border-radius: 6px; }
.print-colors .pc-presets { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.print-colors .pc-preview { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-bottom: 12px; }
.print-colors .pc-band { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 3px solid #c9a84c; color: #f4efe3; }
.print-colors .pc-band strong { font: 600 18px var(--font-display, Georgia), serif; letter-spacing: .12em; text-transform: uppercase; }
.print-colors .pc-band span { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #e2c27a; }

/* Country text (2026-11-07): paragraph headings on the about text, and the editor */
.binder-about h3.binder-ph { font: 600 .66em/1.2 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: #9a7a34; margin: 12px 0 3px; }
.binder-about h3.binder-ph:first-child { margin-top: 2px; }
.binder-about span.binder-ph { font: 600 .68em var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: #9a7a34; margin-right: .45em; }
:root[data-theme="dark"] .binder-about .binder-ph { color: var(--bd-gold, #c9a84c); }
.binder-edit { float: right; margin-left: 12px; font-size: 12px; font-weight: 500; letter-spacing: 0; }
.binder-empty { padding: 18px; border: 1px dashed var(--line); color: var(--ink-2); margin: 0 0 14px; }
@media print { .binder-edit, .binder-empty { display: none !important; } }
.ct-card .title-row { align-items: baseline; }
.ct-draft-note { background: var(--warn-tint); color: var(--ink); padding: 8px 12px; border-radius: 6px; font-size: 14px; }
.ct-form { display: flex; flex-direction: column; gap: 10px; }
.ct-para { display: flex; flex-direction: column; gap: 4px; }
.ct-head { font-weight: 600; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ct-count.is-long { color: var(--warn); }
.ct-para textarea { width: 100%; font: 15px/1.55 var(--font-display); }
.ct-was { margin: -4px 0 4px; font-size: 13px; color: var(--ink-2); }
.ct-was p { margin: 4px 0 0; }
.ct-ask { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.ct-ask label { flex: 1 1 320px; display: flex; flex-direction: column; gap: 4px; }
.ct-stats { width: 100%; }
.ct-stats input { width: 100%; min-width: 120px; }
.ct-history { list-style: none; padding: 0; margin: 0; }
.ct-history > li { border-top: 1px solid var(--line); padding: 8px 0; }
.ct-settings { display: flex; flex-direction: column; gap: 12px; }
.ct-settings > label, .ct-set-para label { display: flex; flex-direction: column; gap: 4px; }
.ct-set-para { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 8px 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ct-set-para .span-2 { grid-column: 1 / -1; }
.ct-settings textarea, .ct-settings input[type=text] { width: 100%; }
@media (max-width: 640px) { .ct-set-para { grid-template-columns: 1fr; } }
.ct-settings textarea.mono { font: 13px/1.5 ui-monospace, Consolas, monospace; }
.binder-lm-photo > a { position: absolute; inset: 0; }

/* Country names (2026-11-07) */
.cn-stats { grid-template-columns: repeat(4, 1fr); }
.cn-issuer { width: 100%; min-width: 180px; }
.cn-sugg { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 4px; color: var(--ink-3); }
.cn-sugg .chip { font: inherit; font-size: 12px; padding: 1px 8px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--ink-2); cursor: pointer; }
.cn-sugg .chip:hover { border-color: var(--brass); }
.cn-remove { margin-left: 6px; color: var(--ink-3); }
.cn-remove:hover { color: var(--error); }
.button.danger { background: var(--error); border-color: var(--error); color: #fff; }
.button.danger:hover { filter: brightness(1.08); color: #fff; }
.cn-actions { display: flex; flex-direction: column; gap: 12px; }
.cn-actions form { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.cn-filter { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 10px; }
.cn-filter input[type=search] { flex: 1 1 240px; }
.cn-table td { vertical-align: top; }
.cn-table input[type=text] { width: 100%; min-width: 130px; }
.cn-table .cn-short { min-width: 90px; }
.cn-src { min-width: 230px; }
.cn-src .check { display: flex; width: 100%; margin-bottom: 4px; }
.cn-mine input[type=text] { flex: 1; }
.cn-code { font-family: ui-monospace, Consolas, monospace; font-size: 11px; }
.cn-member td:first-child { padding-left: 22px; }
.cn-bar { position: sticky; bottom: 0; background: var(--surface); padding: 10px 0; border-top: 1px solid var(--line); margin-top: 8px; display: flex; gap: 12px; align-items: center; }
.cn-changes td { padding: 4px 10px 4px 0; }

/* Reprints (2026-11-07) */
.rp-table td { vertical-align: top; }
.rp-why, .rp-cards, .rp-all ul { margin: 0; padding-left: 18px; }
.rp-why li { margin-bottom: 2px; }
.rp-closed td { padding: 4px 10px 4px 0; vertical-align: top; }

/* Staff-only links (2026-11-07): a small brass pill so they read as admin tools, not page content */
.staff-pills { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.staff-pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px 2px 8px; border-radius: 999px; border: 1px solid var(--brass);
  background: var(--brass-tint); color: var(--brass-strong, var(--brass)); font: 600 12px/1.5 var(--font-body); letter-spacing: 0; text-transform: none;
  text-decoration: none; white-space: nowrap; vertical-align: middle; }
.staff-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.staff-pill:hover { background: var(--brass); color: #fff; }
.staff-pill.on-dark { background: rgba(201, 168, 76, .14); border-color: rgba(201, 168, 76, .6); color: #e2c27a; }
.staff-pill.on-dark:hover { background: #c9a84c; color: #1a2744; }
.binder-staff { float: right; margin-left: 12px; }
.binder-lm-edit.staff-pill { margin-top: 8px; font-size: 11px; }
@media print { .staff-pill, .staff-pills { display: none !important; } }

/* Numismatic details on country pages (2026-11-07) */
.cp-numis { margin-top: 18px; }
.cp-numis > summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; list-style: none; }
.cp-numis > summary::-webkit-details-marker { display: none; }
.cp-numis > summary::before { content: '▸'; color: var(--brass); }
.cp-numis[open] > summary::before { content: '▾'; }
.cp-numis-title { font: 600 1.3rem var(--font-display); }
.cp-numis > summary .staff-pill { margin-left: auto; }
.cp-numis-body { margin-top: 12px; display: flex; flex-direction: column; gap: 18px; }
.cp-numis-part h3 { font-size: 1rem; margin: 0 0 8px; color: var(--brass-strong); letter-spacing: .02em; }
.cp-numis-part h4 { font-size: .85rem; margin: 0 0 6px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
.cp-numis-table td { vertical-align: top; }
.cp-mints { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px 18px; }
.cp-mints li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.cp-mints li.is-yours { border-color: var(--brass); background: var(--brass-tint); }
.cp-mark-letter { flex-shrink: 0; min-width: 30px; height: 30px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
  border: 1.5px solid var(--brass); font: 700 13px var(--font-body); color: var(--brass-strong); background: var(--surface); }
.cp-privy { display: inline-flex; align-items: center; gap: 4px; margin: 0 12px 4px 0; }
.cp-privy .privy-ic svg { width: 18px; height: 18px; }
.cp-numis-notes { margin: 0; padding-left: 20px; line-height: 1.55; }
.cp-numis-notes li { margin-bottom: 4px; }
.cp-numis-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 24px; }
.cp-numis-grid ul.plain { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.cp-denoms { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.cp-denoms .chip { font-size: 11.5px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-sunken); }
.cp-denoms .chip.is-note { border-style: dashed; border-color: var(--ink-3); }
.cp-numis-credit { margin: 0; }
@media print { .cp-numis { display: none !important; } }

/* Bulk drafts and the review walk (2026-11-07) */
.ct-review { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between;
  padding: 10px 14px; margin: 0 0 14px; border: 1px solid var(--brass); border-radius: 8px; background: var(--brass-tint); }
.ct-review .button-row { margin: 0; }
.cb-row { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: flex-end; margin-bottom: 10px; }
.cb-row label:not(.check) { display: flex; flex-direction: column; gap: 4px; }
.cb-pending { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; justify-content: space-between; }
.cb-pending p { margin: 0; }
.cb-bar { height: 10px; border-radius: 5px; background: var(--surface-sunken); overflow: hidden; }
.cb-bar span { display: block; height: 100%; width: 0; background: var(--brass); transition: width .3s; }
.cb-res.is-ok { color: var(--ok, #2f7d4f); } .cb-res.is-bad { color: var(--error); }
.cb-run.is-running { border-color: var(--brass); }
.cb-run .cb-bar { margin: 6px 0 8px; }
.cb-run .cb-line { margin: 0 0 6px; }
.cb-run .button-row { margin-bottom: 0; }
.cb-what { margin: 0 0 4px; }
.cm-forms { display: grid; grid-template-columns: 3fr 2fr; gap: 16px 28px; }
.cm-forms form { display: flex; flex-direction: column; gap: 10px; }
.cm-forms form label:not(.check) { display: flex; flex-direction: column; gap: 4px; }
.cm-forms h3 { margin: 0; font-size: 15px; }
.cm-forms p { margin: 0; }
.cm-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-end; }
.cm-year { width: 90px; }
.cm-assign { border-left: 1px solid var(--line); padding-left: 24px; }
@media (max-width: 760px) { .cm-forms { grid-template-columns: 1fr; } .cm-assign { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 14px; } }
.jobs-table td { padding: 6px 12px 6px 0; vertical-align: top; }
.jobs-table code { font-size: 12px; word-break: break-all; }

/* ---------- Eurozone (Prime 2026-11-08) ---------- */
.cp-chip-euro { display: inline-flex; align-items: center; gap: 6px; margin-left: 12px; padding: 2px 10px 2px 4px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  text-decoration: none; color: var(--ink); background: var(--surface-sunken); border: 1px solid var(--border-strong); white-space: nowrap; }
.cp-chip-euro:hover { border-color: var(--brass); color: var(--ink); }
.cp-chip-euro .cp-chip-sym { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 12px; color: #0d1626; background: #e5b13a; }
.cp-chip-euro.is-agreement .cp-chip-sym { background: #2fb8c4; }
.cp-chip-euro.is-unilateral .cp-chip-sym { background: #f06b4f; }
.eu-years { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 10px 0 4px; padding: 0 26px; }
.eu-years input[type=range] { flex: 1 1 220px; accent-color: var(--brass); }
.eu-play { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface-raised); color: var(--ink); cursor: pointer; font-size: 13px; }
.eu-play:hover { border-color: var(--brass); }
.eu-year-out { font: 600 18px var(--font-display); min-width: 3.4em; font-variant-numeric: tabular-nums; }
.eu-count { color: var(--ink-2); flex-basis: 100%; }
.eu-legend { display: grid; gap: 4px; margin: 6px 0 10px; padding: 0 26px; }
@media (max-width: 600px) { .eu-years, .eu-legend { padding: 0 16px; } }
.eu-key summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: 13.5px; }
.eu-key summary::-webkit-details-marker { display: none; }
.eu-key-short { color: var(--ink-2); }
.eu-more { color: var(--ink-3); font-size: 12px; }
.eu-key[open] .eu-more { color: var(--brass-strong); }
.eu-key p { margin: 4px 0 6px 30px; font-size: 13px; color: var(--ink-2); max-width: 70ch; }
.eu-swatch { display: inline-block; width: 22px; height: 0; border-top: 3px solid; vertical-align: middle; }
.eu-swatch.eu-member { border-color: #e5b13a; }
.eu-swatch.eu-agreement { border-color: #2fb8c4; border-top-style: dashed; }
.eu-swatch.eu-unilateral { border-color: #f06b4f; border-top-style: dotted; border-top-width: 4px; }
.eu-table td { vertical-align: top; }
.eu-table input[type=text] { width: 100%; min-width: 90px; }
.eu-table .eu-date { min-width: 104px; width: 104px; }
.eu-table .eu-rate { min-width: 80px; width: 90px; }
.eu-table tr.is-flagged td { background: var(--warn-tint); }
.eu-table tr.is-gone td { opacity: .55; }
.eu-review { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; }
.eu-inline { display: inline; margin-left: 8px; }
.eu-defs dt { font-weight: 600; margin-top: 8px; display: flex; align-items: center; gap: 8px; }
.eu-defs dd { margin: 2px 0 0 30px; color: var(--ink-2); font-size: 14px; }
@media print { .eu-years, .eu-play { display: none; } }

/* Admin menu and links (Prime 2026-11-08: Admin = health; Site tools; Site settings) */
.user-menu-sep { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.admin-jump { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin: -6px 0 14px; }
.admin-jobs .tag { text-decoration: none; }

/* ---- Create an account: password checker (Prime 2026-11-08) ---- */
.login-new { margin: 16px 0 0; font-size: 14px; }
.pw-meter { height: 6px; border-radius: 3px; background: var(--surface-sunken); overflow: hidden; margin: -6px 0 0; }
.pw-meter span { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--error); transition: width .2s ease, background-color .2s ease; }
.pw-meter span.mid { background: var(--warn); }
.pw-meter span.good { background: var(--ok); }
.pw-rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 13px; color: var(--ink-2); }
.pw-rules li { display: flex; align-items: center; gap: 8px; }
.pw-mark { width: 14px; height: 14px; flex: none; border-radius: 50%; border: 1.5px solid var(--border-strong); position: relative; }
.pw-rules li.met { color: var(--ok); }
.pw-rules li.met .pw-mark { border-color: var(--ok); background: var(--ok); }
.pw-rules li.met .pw-mark::after { content: ""; position: absolute; left: 4px; top: 1px; width: 3px; height: 7px; border: solid var(--surface); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.tried .pw-rules li:not(.met) { color: var(--error); }
.pw-match { margin: -6px 0 0; min-height: 1.4em; }
.pw-match.ok { color: var(--ok); }
.pw-match.no { color: var(--error); }

/* World location jumps to the map from above */
.cp-map { scroll-margin-top: 16px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
.login-forgot { margin: -6px 0 0; text-align: right; }

/* Bulk drafts: Save without reviewing (Prime 2026-11-08) */
.cb-save { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.cb-save summary { cursor: pointer; font-weight: 600; }
.cb-wlist { list-style: none; margin: 8px 0 12px; padding: 0; columns: 3 220px; column-gap: 24px; }
.cb-wlist li { break-inside: avoid; padding: 2px 0; }
.cb-wlist .check { display: inline-flex; }

/* Country checklist (Prime 2026-11-08) */
.ck-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-bottom: 14px; }
.ck-tiles .stat { display: flex; flex-direction: column; gap: 2px; text-decoration: none; padding: 10px 12px; }
.ck-tiles .stat .stat-value { font-size: 22px; }
.ck-tiles .stat.on { border-color: var(--brass); box-shadow: inset 0 0 0 1px var(--brass); }
.ck-filters { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: flex-end; }
.ck-filters label:not(.check) { display: flex; flex-direction: column; gap: 4px; }
.ck-grid th, .ck-grid td { white-space: nowrap; }
.ck-grid thead th a { color: inherit; text-decoration: none; }
.ck-grid thead th a:hover { color: var(--brass); }
.ck-grid thead th a.ck-bulk { display: block; margin-top: 3px; font-size: 11px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--brass); }
.ck-grid thead th a.ck-bulk:hover { text-decoration: underline; }
.ck-grid tbody th { font-weight: 500; text-align: left; text-transform: none; letter-spacing: normal; font-size: inherit; color: inherit; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.ck-grid .ck-state { padding: 1px 6px; }
.ck-cell { text-align: center; }
.ck-state { font-size: 12px; border-radius: 10px; padding: 2px 8px; border: 1px solid transparent; background: none; font: inherit; font-size: 12px; line-height: 1.4; }
button.ck-state { cursor: pointer; }
.ck-have { color: var(--ok); padding: 0; }
.ck-na { color: var(--ink-3); }
.ck-gap { color: var(--error); border-color: color-mix(in srgb, var(--error) 45%, transparent); background: color-mix(in srgb, var(--error) 10%, transparent); }
.ck-ok { color: var(--ink-2); border-color: var(--border-strong); }
button.ck-gap:hover, button.ck-ok:hover { border-color: var(--brass); }
.ck-tick { width: 28px; }
.ck-bulk { align-items: flex-end; margin-top: 12px; }
.ck-note { display: flex; flex-direction: column; gap: 4px; flex: 1 1 260px; }
.ck-pop { position: absolute; z-index: 50; width: 300px; max-width: calc(100vw - 16px); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 12px 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); display: flex; flex-direction: column; gap: 8px; }
.ck-pop[hidden] { display: none; }
.ck-pop p { margin: 0; }
.ck-pop-title { font-weight: 600; }
.ck-pop-cont { display: flex; gap: 8px; }
.ck-pop .button-row { gap: 6px; flex-wrap: wrap; }

/* Spotlights that pop (Prime 2026-11-08): Commons' reviewed photos, style words, best shot */
.finder-match.m-featured, .finder-match.m-quality { background: var(--brass); color: #1a1205; border-color: transparent; }
.finder-styles { flex: 1 1 100%; margin: -6px 0 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.finder-styles .chip { display: inline-block; padding: 2px 10px; border: 1px solid var(--border-strong); border-radius: 999px; text-decoration: none; color: var(--ink); background: var(--surface-sunken); }
.finder-styles .chip:hover { border-color: var(--brass); color: var(--brass-strong); }
.finder-styles .chip.on { border-color: var(--brass); background: var(--brass-tint); }
.finder-styles .chip.on::before { content: "\2715  "; font-size: 10px; }
.idea-shot { margin: 4px 0 0; }

/* Spotlight kinds settings (Prime 2026-11-09) */
.sk-table input[type="text"] { width: 100%; min-width: 180px; }
.sk-table td:nth-child(2) input { min-width: 300px; }
.sk-table td.c, .sk-table th:nth-child(n+3) { text-align: center; width: 64px; white-space: nowrap; }
.sk-table { width: 100%; }
.sk-table td:nth-child(1) { width: 26%; }
.sk-table tr.sk-new td { background: var(--surface-sunken); }
.idea-savekind { white-space: nowrap; align-self: center; }

/* Spotlight insights (Prime 2026-11-09) */
.si-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.si-tiles .stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; }
.si-tips { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.si-tips li { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 8px 12px; border-radius: 8px; border-left: 3px solid var(--border-strong); background: var(--surface-sunken); }
.si-tips li > span { flex: 1 1 320px; }
.si-tips li.si-warn { border-left-color: var(--warn); }
.si-tips li.si-good { border-left-color: var(--ok); }
.si-table tbody th { text-transform: none; letter-spacing: normal; font-size: inherit; color: inherit; font-weight: 500; text-align: left; }
.si-table .si-bad { color: var(--error); }
.si-bar { display: inline-block; width: 90px; height: 8px; border-radius: 4px; background: var(--surface-sunken); overflow: hidden; vertical-align: middle; }
.si-bar span { display: block; height: 100%; background: var(--brass); border-radius: 4px; }
.si-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.si-two table tbody th { text-transform: none; letter-spacing: normal; font-size: inherit; color: inherit; font-weight: 500; text-align: left; }
.si-wishes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.kind-star { color: var(--brass); font-size: 11px; }

/* Roadmap (Prime 2026-11-09) */
.rm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rm-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 4px; border-bottom: 1px solid var(--border); }
.rm-item:last-child { border-bottom: 0; }
.rm-tick { flex: none; width: 22px; padding-top: 2px; display: flex; justify-content: center; }
.rm-tick input { width: 18px; height: 18px; accent-color: var(--brass); cursor: pointer; }
.rm-state { color: var(--ok); font-weight: 700; }
.rm-item.is-dropped .rm-state { color: var(--ink-3); }
.rm-body { flex: 1; min-width: 0; }
.rm-body p { margin: 0; }
.rm-title { font-weight: 500; }
.rm-detail { margin-top: 2px !important; }
.rm-note { margin-top: 4px !important; color: var(--ink-2); font-style: italic; }
.rm-item.is-done .rm-title, .rm-item.is-dropped .rm-title { color: var(--ink-3); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ink-3) 60%, transparent); }
.rm-item.is-next { background: color-mix(in srgb, var(--brass) 7%, transparent); border-radius: 6px; }
.rm-after { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rm-after[hidden] { display: none; }
.rm-after input { flex: 1 1 220px; min-width: 0; }
.rm-actions { margin-top: 6px; }
.rm-add { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; }
.rm-add label { display: flex; flex-direction: column; gap: 4px; flex: 1 1 220px; }
.rm-done summary { cursor: pointer; list-style: none; }
.rm-done summary h2 { display: inline; }
.rm-actions .rm-quiet { color: var(--ink-3); font-weight: 400; }
.rm-due { margin-top: 3px !important; }
.rm-when { margin-top: 6px; }
.rm-when summary { cursor: pointer; color: var(--brass); }
.rm-when-form { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin-top: 6px; }
.rm-add-dt { display: flex; gap: 6px; }
.rm-add-dt input { flex: 1; min-width: 0; }

/* Binder page counts (Prime 2026-11-10) */
.bp-table input.bp-in { width: 4.2em; text-align: right; padding: 4px 6px; }
.bp-table th.bp-h { white-space: normal; max-width: 6.5em; line-height: 1.2; }
.bp-table .bp-sub th { text-align: left; background: color-mix(in srgb, var(--brass) 8%, transparent); font-weight: 600; }
.bp-table .bp-other td:first-child { color: var(--ink-2); font-style: italic; }
.bp-table tfoot th, .bp-table tfoot td { font-weight: 600; border-top: 2px solid var(--border); }
.bp-table .bp-total { font-weight: 600; }
.bp-state { white-space: nowrap; min-width: 6em; }
.bp-ok { color: var(--ok); }
.bp-bad { color: var(--danger, #b3261e); }
.bp-table input.bp-in { -moz-appearance: textfield; appearance: textfield; }
.bp-table input.bp-in::-webkit-outer-spin-button, .bp-table input.bp-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Purchases and sources (Prime 2026-11-13) */
.pur-new { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.pur-new label, .pur-grid label { display: flex; flex-direction: column; gap: 3px; }
.pur-new label span, .pur-grid label span { font-size: .85rem; color: var(--ink-2); }
.pur-new input[name=source] { min-width: 18em; }
.pur-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; align-items: end; }
.pur-grid .span-2 { grid-column: span 2; }
.pur-grid .span-3 { grid-column: 1 / -1; }
.pur-grid input, .pur-grid textarea { width: 100%; }
.pur-total { margin: 0; }
.pur-share { width: 6em; text-align: right; }
.pur-ltable { width: 100%; border-collapse: collapse; }
.pur-ltable th { text-align: left; font-size: .85rem; font-weight: normal; color: var(--ink-2); padding: 0 6px 3px 0; }
.pur-ltable td { padding: 0 6px 6px 0; vertical-align: middle; }
.pur-ltable input { width: 100%; }
.pur-ltable td:nth-child(2) { min-width: 14em; }
.pur-ltable td:nth-child(2) a { white-space: nowrap; }
.pur-ltable td:nth-child(3) input { width: 9em; }
.pur-ltable td:nth-child(4) { min-width: 16em; }
.pur-ltable .pur-price { width: 6.5em; text-align: right; }
.pur-ltable .num, .pur-ltable th.num { text-align: right; }
@media (max-width: 700px) {   /* each listing stacked, labels from data-label */
  .pur-ltable thead { display: none; }
  .pur-ltable tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; padding: 8px 0; border-top: 1px solid var(--line, #ddd); }
  .pur-ltable tr[hidden] { display: none; }
  .pur-ltable td { padding: 0; min-width: 0 !important; text-align: left !important; }
  .pur-ltable td[data-label]::before { content: attr(data-label); display: block; font-size: .8rem; color: var(--ink-2); }
  .pur-ltable td:first-child { grid-column: 1 / -1; }
  .pur-ltable td:first-child::before { display: inline; content: 'Listing '; }
  .pur-ltable td:nth-child(2), .pur-ltable td:nth-child(4) { grid-column: 1 / -1; }
  .pur-ltable td:nth-child(3) input, .pur-ltable .pur-price { width: 100%; text-align: left; }
  .pur-ltable td.pur-lpool[hidden] { display: none; }
}
.pur-off { color: var(--danger, #b3261e); font-weight: 600; }
.src-edit form { display: grid; gap: 6px; margin-top: 6px; min-width: 16em; }
.src-edit label { display: flex; flex-direction: column; gap: 2px; }
td.nowrap, .nowrap { white-space: nowrap; }
@media (max-width: 640px) { .pur-grid { grid-template-columns: 1fr; } .pur-grid .span-2, .pur-grid .span-3 { grid-column: auto; } }
.pur-grid input[type=date], .pur-grid textarea, .pur-new input[type=date], .src-edit textarea {
  font: inherit; font-size: 15px; padding: 9px 11px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--ink); }
.pur-grid textarea, .src-edit textarea { resize: vertical; }

/* Sign in with Discord (Prime 2026-11-13) */
.discord-button {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 11px 16px; margin-top: 10px;
  border-radius: 8px; border: 1px solid #4752c4; background: #5865f2; color: #fff; font-weight: 600; text-decoration: none; font-size: 15px;
}
.discord-button:hover { background: #4752c4; color: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); }

/* Binder fill bar (Binder page counts) and the binders table (Storage locations) */
.bp-fill { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 12px; }
.bp-bar { flex: 0 1 260px; min-width: 140px; height: 10px; border-radius: 5px; background: color-mix(in srgb, var(--border) 70%, transparent); overflow: hidden; }
.bp-bar > span { display: block; height: 100%; width: 0; border-radius: 5px; background: var(--ok); transition: width .2s; }
.bp-fill.is-warn .bp-bar > span { background: var(--warn); }
.bp-fill.is-warn .bp-fill-text { color: var(--warn); font-weight: 600; }
.bp-fill.is-over .bp-bar > span { background: var(--danger, #b3261e); }
.bp-fill.is-over .bp-fill-text { color: var(--danger, #b3261e); }
.bn-table { margin-bottom: 14px; }
.bn-table input.bn-pos { width: 4.2em; text-align: right; }
.bn-table input[type=text] { width: 100%; min-width: 20em; }
/* Page counts to check (Binder page counts) */
.bp-review-card { border-left: 4px solid var(--warn); }
.bp-review-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.bp-table tr.bp-check td { background: var(--warn-tint); }
.bp-table .bp-what { display: block; color: var(--warn); font-weight: 600; }
.bp-table tr.bp-checked td:first-child { box-shadow: inset 3px 0 0 var(--ok); }

/* Virtual bookshelf (Prime 2026-11-14) */
.shelf { --s: .44; margin: 18px 0 22px; }
.shelf-row { display: flex; align-items: flex-end; gap: 3px; padding: 18px 14px 0; overflow-x: auto; overflow-y: hidden;
  background: linear-gradient(#2a1c12, #3b2818 70%, #2a1c12); border-radius: 8px 8px 0 0; box-shadow: inset 0 10px 18px rgba(0,0,0,.55); min-height: calc(1100px * var(--s) + 18px); }
.shelf-item { flex: none; display: block; width: calc(var(--w) * 1px * var(--s)); height: calc(1100px * var(--s)); border-radius: 3px 3px 1px 1px; overflow: hidden;
  box-shadow: 2px 0 4px rgba(0,0,0,.55), inset -1px 0 0 rgba(255,255,255,.08); transition: transform .18s ease, box-shadow .18s ease; transform-origin: bottom center; }
.shelf-item svg { display: block; width: 100%; height: 100%; }
.shelf-item:hover, .shelf-item:focus-visible { transform: translateY(-14px); box-shadow: 4px 6px 12px rgba(0,0,0,.6); }
.shelf-other { height: calc(1100px * var(--s) * .86); }
.shelf-plank { height: 22px; border-radius: 0 0 6px 6px; background: linear-gradient(#7a5434, #5c3d23 55%, #3e2814); box-shadow: 0 6px 12px rgba(0,0,0,.35); }
.shelf-list { display: grid; gap: 8px 22px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.shelf-list > div > span { display: block; }
.shelf-binder { display: grid; grid-template-columns: minmax(240px, 400px) 1fr; gap: 28px; align-items: start; }
.shelf-faces { position: relative; }
.shelf-face { display: block; width: 100%; height: auto; aspect-ratio: 850 / 1100; border-radius: 4px; box-shadow: 0 6px 18px rgba(0,0,0,.4); }
.shelf-face.is-back { position: absolute; inset: 0; }
.shelf-face.is-off { visibility: hidden; }
.shelf-chapter h2 { margin: 18px 0 6px; }
.shelf-countries { columns: 2 200px; margin: 0; padding-left: 18px; }
.shelf-countries li { break-inside: avoid; margin-bottom: 3px; }
@media (max-width: 760px) {
  .shelf { --s: .3; }
  .shelf-binder { grid-template-columns: 1fr; }
  .shelf-cover { max-width: 360px; margin: 0 auto; }
}

/* What's special (per-piece numismatics, Prime 2026-11-14) */
.piece-special { margin-top: 18px; }
.piece-special h2 { margin-top: 0; }
.piece-special h3 { margin: 14px 0 4px; font-size: 1rem; }
.pn-tabs { margin: 6px 0 12px; }
.pn-table textarea { width: 100%; min-width: 280px; }
.pn-table td.pn-piece { min-width: 180px; }
.pn-vars { margin: 4px 0 6px; padding-left: 18px; }
.pn-check { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--border); }
.pn-check:first-of-type { border-top: 0; }
.pn-check > div { flex: 1 1 320px; }
.pn-check textarea { width: 100%; min-width: 260px; }
.pn-log { max-height: 220px; overflow: auto; padding-left: 18px; }
.pn-log .ok { color: var(--ok); }
.pn-log .warn { color: var(--warn); }
.pn-nothing li { margin-bottom: 6px; }
.pn-bg { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.pn-bg h3 { margin: 0 0 4px; font-size: 1rem; }
.pn-bg .warn { color: var(--warn); }
.pn-sources a { overflow-wrap: anywhere; }
.pn-nm { margin: 4px 0; padding: 6px 8px; border-left: 3px solid var(--border); background: color-mix(in srgb, var(--border) 18%, transparent); }
.piece-numista h2 { font-size: 1.15rem; }

/* Install from your phone (Prime 2026-11-15) */
.deploy-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 8px 16px; font-size: 14px;
  background: var(--warn-tint); color: var(--ink); border-bottom: 1px solid var(--line, rgba(0,0,0,.1)); }
.deploy-bar span { flex: 1 1 260px; }
.deploy-bar.deploy-failed { background: var(--error-tint); }
.deploy-bar.deploy-running, .deploy-bar.deploy-asked { background: var(--ok-tint); }
.dp-big { font-size: 17px; margin: 6px 0; }
.dp-msg { margin: 4px 0 8px; padding-left: 20px; }
.dp-on { color: var(--ok); }
.dp-off { color: var(--warn); }
.dp-ok { color: var(--ok); }
.dp-bad { color: var(--error); }
.dp-log { white-space: pre-wrap; word-break: break-word; font-size: 12px; max-height: 360px; overflow: auto; background: var(--surface-2, rgba(0,0,0,.2)); padding: 10px; border-radius: 6px; }
.dp-code { font-size: 22px; letter-spacing: 2px; font-family: ui-monospace, Consolas, monospace; }
.dp-steps li { margin-bottom: 4px; }

/* Add a country (Prime 2026-11-15) */
.cn-new { max-width: 640px; }
.cn-new label:not(.check) { display: block; margin: 0 0 14px; }
.cn-new label:not(.check) > span { display: block; margin-bottom: 4px; }
.cn-new input[type=text], .cn-new select { width: 100%; }
.cn-new .cm-row { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 14px; }
.cn-new .cm-row > label:not(.check) { flex: 1 1 180px; margin: 0; }
.cn-new label.check { display: flex; gap: 8px; align-items: baseline; margin: 0 0 14px; }
.cn-new .cm-row > label.check { margin: 0; }
.cn-new label.check .muted { display: inline; }

/* Storage locations: Needs info card (Prime 2026-11-15) */
.storage-card-h, .storage-card-c { text-align: center; }
.storage-card { display: inline-flex; margin: 0; }
.storage-card label.check { margin: 0; }
.storage-none td { font-style: normal; }

/* ---------- Menu button and Appearance (Prime 2026-11-15) ---------- */
.site-nav a[aria-current="page"] { color: var(--brass-strong); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.nav-menu { display: none; position: relative; }
.nav-menu > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--surface-raised); color: var(--ink); font-weight: 600; font-size: 15px; line-height: 1;
}
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu > summary:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.nav-menu[open] > summary, .nav-menu > summary:hover { border-color: var(--brass); color: var(--brass-strong); }
.nav-burger { font-size: 17px; }
.nav-menu-panel {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 50; min-width: 220px; padding: 6px;
  background: var(--surface-raised); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.nav-menu-panel a { display: block; padding: 11px 12px; border-radius: 8px; font-weight: 600; font-size: 16px; text-decoration: none; color: var(--ink); }
.nav-menu-panel a:hover { background: var(--surface-sunken); color: var(--brass-strong); }
.nav-menu-panel a[aria-current="page"] { background: var(--surface-sunken); color: var(--brass-strong); box-shadow: inset 3px 0 0 var(--brass); }
@media (max-width: 900px) {
  .site-nav { display: none; }
  .nav-menu { display: block; }
  .site-header { flex-wrap: nowrap; }
}

.theme-pick { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.theme-pick-label { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.theme-seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.theme-seg button { font: inherit; font-size: 13px; font-weight: 600; padding: 5px 10px; border: 0; background: none; color: var(--ink-2); cursor: pointer; }
.theme-seg button + button { border-left: 1px solid var(--border-strong); }
.theme-seg button:hover { color: var(--ink); background: var(--surface-sunken); }
.theme-seg button[aria-pressed="true"] { background: var(--brass); color: #1a1205; cursor: default; }
.user-menu-panel form.theme-pick { margin: 2px 0 4px; padding: 6px 10px 8px; border-top: 0; }
.site-footer .theme-pick { justify-content: flex-start; }
.user-menu-panel hr.user-menu-sep + form { border-top: 0; margin-top: 0; padding-top: 0; }

/* Country page: tap a card's top to fold or open it (Prime 2026-11-15) */
.cp-about-head.is-foldable { cursor: pointer; user-select: none; }
.cp-about-head.is-foldable:hover { filter: brightness(1.08); }
.cp-about-head.is-foldable:focus-visible { outline: 2px solid var(--bd-gold); outline-offset: -3px; }
.cp-about-head.is-foldable { position: relative; padding-right: 54px; }
.cp-about-head .cp-fold-chev { position: absolute; right: 20px; top: 50%; margin-top: -11px; width: 22px; height: 22px; color: var(--bd-gold); transition: transform 0.25s ease; transform: rotate(180deg); }
.cp-about.is-folded .cp-about-head .cp-fold-chev { transform: none; }
.cp-fold-head { cursor: pointer; user-select: none; }
.cp-fold { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.cp-fold:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: 4px; }
.cp-fold .cp-fold-chev { color: var(--brass); transition: transform 0.25s ease; transform: rotate(180deg); }
.cp-collection.is-folded .cp-fold .cp-fold-chev { transform: none; }
.cp-fold-head:hover .cp-fold { color: var(--brass-strong); }
@media (prefers-reduced-motion: reduce) { .cp-fold-chev { transition: none; } }
@media print { .cp-fold-chev { display: none; } }
.ct-save-rest { display: inline; margin: 0; }
.ct-save-rest .link-button.is-sure { color: var(--brass-strong); font-weight: 700; }
.finder-paste { margin: 4px 0 0; }

/* Numista monthly allowance (Prime 2026-11-16) */
.al-use { margin: 8px 0 12px; }
.al-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 14px; align-items: end; margin-top: 6px; }
.al-form label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.al-form label > span { font-weight: 600; }
.al-form input[type=number] { width: 100%; }
.al-form .al-live, .al-form button { grid-column: 1 / -1; margin: 0; }
.al-form button { justify-self: start; }

/* ---------- Claude credit (Prime 2026-11-17) ---------- */
.cc-facts { display: flex; flex-wrap: wrap; gap: 6px 20px; color: var(--ink-2); margin: -6px 0 18px; }
.cc-facts strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.cc-range { margin-bottom: 14px; }
.cc-card h2 { margin-bottom: 6px; }
.cc-chart { display: block; width: 100%; height: auto; overflow: visible; }
.cc-chart.cc-narrow { display: none; }
.cc-chart .cc-grid { stroke: var(--border); stroke-width: 1; }
.cc-chart .cc-zero { stroke: var(--border-strong); }
.cc-chart .cc-axis { fill: var(--ink-3); font-size: 11px; font-family: var(--font-body); font-variant-numeric: tabular-nums; }
.cc-chart .cc-bar { fill: var(--brass); }
.cc-chart .cc-line { fill: none; stroke: var(--brass); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.cc-chart .cc-dot { fill: var(--brass); stroke: var(--surface); stroke-width: 2; }
.cc-chart .cc-ref { stroke-width: 1.5; stroke-dasharray: 5 4; }
.cc-chart .cc-ref-label { font-size: 11px; font-weight: 600; font-family: var(--font-body); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.cc-chart .cc-warnline { stroke: var(--error); }
.cc-chart text.cc-warnline { fill: var(--error); stroke: var(--surface); }
.cc-chart .cc-typline { stroke: var(--ink-3); }
.cc-chart text.cc-typline { fill: var(--ink-2); stroke: var(--surface); }
.cc-chart .cc-hit { fill: transparent; cursor: default; }
.cc-chart .cc-hit.is-on { fill: var(--ink); fill-opacity: 0.06; }
.cc-tip { position: absolute; z-index: 50; pointer-events: none; background: var(--ink); color: var(--surface); font-size: 12.5px;
  padding: 5px 9px; border-radius: 6px; white-space: nowrap; box-shadow: var(--shadow); font-variant-numeric: tabular-nums; }
.cc-table { margin-top: 10px; }
.cc-table table { margin-top: 8px; }
.cc-forms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 12px 0 16px; }
.cc-form { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-raised); }
.cc-form h3 { margin: 0; font-size: 15px; }
.cc-form label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.cc-form label > span { font-weight: 600; }
.cc-form button { align-self: flex-start; }
.cc-form input[type="datetime-local"] { font: inherit; font-size: 15px; padding: 8px 11px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--ink); color-scheme: light dark; }
.cc-events td form { margin: 0; }
@media (max-width: 700px) {
  .cc-forms { grid-template-columns: 1fr; }
  .cc-events th:nth-child(4), .cc-events td:nth-child(4) { display: none; }
  .cc-chart.cc-wide { display: none; }
  .cc-chart.cc-narrow { display: block; }
  .cc-why th:nth-child(4), .cc-why td:nth-child(4) { display: none; }
  .cc-why .cc-searches { display: block; }
}

/* ---------- Changelog (Prime 2026-11-18) ---------- */
.cl-running { margin: -8px 0 16px; }
.cl-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 4px 0 14px; }
.cl-filters input[type="search"] { flex: 1 1 260px; max-width: 420px; }
.cl-filters .check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.cl-day { margin-bottom: 22px; }
.cl-date { font-size: 17px; margin: 0 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.cl-entry { padding: 14px 18px; margin-bottom: 10px; }
.cl-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.cl-build { font-weight: 700; color: var(--brass); font-variant-numeric: tabular-nums; text-decoration: none; }
.cl-build:hover { text-decoration: underline; }
.cl-title { font-size: 16px; margin: 4px 0 0; line-height: 1.35; }
.cl-fix .cl-title { font-weight: 600; color: var(--ink-2); }
.cl-list { margin: 8px 0 0; padding-left: 20px; color: var(--ink-2); font-size: 14.5px; }
.cl-list li { margin: 3px 0; }
.cl-p { margin: 8px 0 0; color: var(--ink-2); font-size: 14.5px; }
:target.cl-entry { outline: 2px solid var(--brass); outline-offset: 2px; }

/* ---------- Chapter for each country (Prime 2026-11-19) ---------- */
.chapters-table td { vertical-align: middle; }
.chapters-table select { min-width: 12em; }
.chapters-table select.is-changed { outline: 2px solid var(--brass); outline-offset: 1px; }
.chapters-table .tag { margin-left: 6px; }
.chapters-save { position: sticky; bottom: 0; background: var(--surface); padding: 10px 0 4px; margin-top: 8px; border-top: 1px solid var(--border); }
.chapter-hint { margin: -6px 0 4px; }
.chapter-hint .link-button { font-weight: 600; }

/* ---------- UNESCO World Heritage Sites in spotlight ideas (Prime 2026-11-20) ---------- */
.tag-unesco { background: #0b6fb8; color: #fff; border-color: #0b6fb8; letter-spacing: .04em; }
.idea-card.is-unesco { border-color: color-mix(in srgb, #0b6fb8 45%, var(--border)); }
.unesco-list summary { cursor: pointer; font-weight: 600; }
.unesco-sites { list-style: none; margin: 10px 0; padding: 0; }
.unesco-sites li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.unesco-sites li form { margin: 0; flex: none; }
.idea-unesco { display: inline-flex; align-items: center; gap: 6px; margin: 2px 0 8px; }

/* ---------- Waiting for Claude (Prime 2026-11-20) ---------- */
.cj-card { max-width: 640px; margin: 24px auto; }
.cj-head { display: flex; align-items: center; gap: 14px; }
.cj-head h1 { margin: 0; font-size: 24px; }
.cj-line { font-size: 16px; margin-top: 14px; }
.cj-time { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.cj-spin { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--brass); animation: cj-spin 0.9s linear infinite; }
@keyframes cj-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cj-spin { animation-duration: 3s; } }

/* ---------- Pause Numista until next month (Prime 2026-11-20) ---------- */
.np-pause { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 14px; margin: 10px 0 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-raised); }
.np-pause p { margin: 0; flex: 1 1 320px; font-size: 14px; }
.np-pause.is-paused { background: var(--warn-tint); border-color: transparent; }
.np-buttons { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.np-all { flex-basis: 100%; display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Nightly jobs, grouped (Prime 2026-11-20) ---------- */
.nj-group { border-top: 1px solid var(--border); padding: 12px 0 4px; }
.nj-group h3 { font-size: 15px; margin: 0 0 8px; }
.nj-row { display: grid; grid-template-columns: 5.5em 1fr; gap: 4px 14px; align-items: start; padding: 7px 0; }
.nj-row input[type="number"] { width: 5em; }
.nj-title { font-weight: 600; }
.nj-what { margin: 2px 0 0; color: var(--ink-2); max-width: 70ch; }
.nj-info .nj-what { margin: 0; }
.nj-always { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); padding-top: 2px; }
@media (max-width: 600px) { .nj-row { grid-template-columns: 4.5em 1fr; gap: 4px 10px; } }

/* ---------- What's special: the design (Prime 2026-11-20) ---------- */
.pn-design-label { display: block; font-weight: 600; margin: 8px 0 3px; }
.pn-design-label textarea { display: block; width: 100%; margin-top: 3px; font-weight: 400; }
.pn-design { margin-top: 4px; }
.pn-design-run { margin: 6px 0 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-raised); }
.pn-design-run p { margin: 0 0 8px; }

/* ---------- Ways to sign in (Prime 2026-11-20) ---------- */
.lm-list { list-style: none; margin: 6px 0 10px; padding: 0; }
.lm-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.lm-list li .check { min-width: 13em; }

/* ---------- photo capture (Prime 2026-11-20) ---------- */
.list-tools label { max-width: 100%; min-width: 0; }
.list-tools select, .list-tools input { max-width: 100%; }
.pc-bar { display: block; height: 6px; border-radius: 3px; background: var(--surface-sunken); overflow: hidden; margin-top: 6px; }
.pc-bar > span { display: block; height: 100%; background: var(--brass); border-radius: 3px; transition: width .3s; }
.pc-stats .stat-value small { font-size: 14px; font-weight: 400; font-family: var(--font-body, inherit); }
.pc-binders summary { cursor: pointer; }
.pc-binders ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 22px; }
.pc-binders li { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 8px; }
.pc-binders li .pc-bar { grid-column: 1 / -1; grid-row: 2; margin-top: 3px; }
.pc-binders li.is-on a { font-weight: 600; color: var(--brass-strong); }
.pc-list { list-style: none; margin: 0; padding: 0; }
.pc-row { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 10px 6px; border-top: 1px solid var(--border); border-radius: 8px; transition: background .15s, opacity .4s; }
.pc-row.is-over { background: var(--brass-tint); }
.pc-row.is-done { opacity: .55; }
.pc-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pc-slots { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pc-slot { width: 92px; height: 92px; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 11px; text-align: center; color: var(--ink-2); text-decoration: none; position: relative; overflow: hidden; }
.pc-slot.is-empty { border: 2px dashed var(--border-strong); cursor: pointer; background: var(--surface); }
.pc-slot.is-empty:hover, .pc-slot.is-empty:focus-visible, .pc-row.is-over .pc-slot.is-empty { border-color: var(--brass); color: var(--brass-strong); outline: none; }
.pc-slot.is-empty b { font-size: 26px; font-weight: 400; line-height: 1; }
.pc-slot.is-uv.is-empty { border-color: #8a6cc4; color: #6b4fa8; }
.pc-slot.is-error { border-color: #c0392b !important; }
.pc-slot.is-busy { border: 2px solid var(--brass); background: var(--brass-tint); color: var(--brass-strong); font-weight: 600; }
.pc-slot.is-busy b { display: none; }
.pc-slot.is-have { border: 1px solid var(--border); background: var(--surface-sunken); }
.pc-slot.is-have img { width: 100%; height: 100%; object-fit: contain; }
.pc-slot.is-have span { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, .55); color: #fff; font-size: 10px; padding: 1px 0; }
@media (max-width: 700px) {
  .pc-row { flex-direction: column; align-items: stretch; }
  .pc-slots { display: grid; grid-template-columns: repeat(4, 1fr); }
  .pc-slot { width: auto; height: auto; aspect-ratio: 1; }
  .pc-stats { grid-template-columns: repeat(2, 1fr); }
}
.pur-group td { background: var(--surface-sunken); padding-top: 10px; }

/* ---------- purchase invoice (Prime 2026-11-21) ---------- */
.pur-inv-actions { display: flex; gap: 8px; margin-left: auto; }
.pur-inv-head { display: flex; flex-wrap: wrap; gap: 10px 36px; margin: 0 0 18px; }
.pur-inv-head dt { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.pur-inv-head dd { margin: 2px 0 0; font-weight: 600; }
.pur-inv-table { width: 100%; border-collapse: collapse; }
.pur-inv-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 500; padding: 0 8px 6px; border-bottom: 2px solid var(--border-strong); }
.pur-inv-table td { padding: 7px 8px; vertical-align: top; }
.pur-inv-table .num { text-align: right; white-space: nowrap; }
.pur-inv-listing td { font-weight: 600; border-top: 1px solid var(--border); padding-top: 12px; }
.pur-inv-piece td:first-child { padding-left: 24px; }
.pur-inv-piece td { color: var(--ink-2); font-size: 14px; }
.pur-inv-totals { margin: 16px 0 0 auto; border-collapse: collapse; min-width: 260px; border-top: 2px solid var(--border-strong); }
.pur-inv-totals th { text-align: left; font-weight: 400; color: var(--ink-2); padding: 6px 24px 6px 0; }
.pur-inv-totals td { text-align: right; padding: 6px 0; white-space: nowrap; }
.pur-inv-total th, .pur-inv-total td { font-weight: 700; font-size: 18px; color: var(--ink); border-top: 1px solid var(--border); padding-top: 10px; }
.pur-inv-check { text-align: right; margin: 6px 0 0; }
.pur-inv-notes { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 10px; }
.pur-inv-notes h3 { font-size: 14px; margin: 0 0 4px; }
@media print { .pur-inv-actions, .help-bubble, .flash { display: none !important; } .pur-inv a { color: inherit; text-decoration: none; } }
@media (max-width: 600px) { .pur-inv-totals { min-width: 0; width: 100%; } .pur-inv-piece td:first-child { padding-left: 12px; } }
.pur-stats { grid-template-columns: repeat(6, 1fr); }
.pur-stats .stat.is-key { border-color: var(--brass); }
.pur-stats .stat.is-key .stat-value { color: var(--brass-strong); }
@media (max-width: 900px) { .pur-stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px) { .pur-stats { grid-template-columns: repeat(2, 1fr); } }
.pur-ltable td.pur-scol { min-width: 12em; }
/* photo crop and turn (Prime 2026-11-22) */
.pc-slot.is-have > a { display: block; width: 100%; height: 100%; }
.pc-turn { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; border: 0; padding: 0; line-height: 24px;
  background: rgba(0, 0, 0, .6); color: #fff; font-size: 14px; cursor: pointer; opacity: .85; }
.pc-turn:hover, .pc-turn:focus-visible { opacity: 1; background: var(--brass); }
.pc-turn:disabled { opacity: .4; cursor: wait; }
.pc-trim { margin: -4px 0 14px; }
.photo-tools { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.photo-fine label { display: flex; flex-direction: column; gap: 2px; }
.photo-fine input[type=range] { width: 100%; accent-color: var(--brass); }
.photo-admin img { transition: transform .08s linear; }
/* size ruler on piece photos (Prime 2026-11-22) */
.piece-ph-open { position: relative; }
.size-ruler { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.size-ruler .sr-line, .size-ruler .sr-tick { fill: #fff; stroke: rgba(0, 0, 0, .55); stroke-width: .6; paint-order: stroke; }
.size-ruler .sr-num { font-size: 10px; fill: #fff; stroke: rgba(0, 0, 0, .7); stroke-width: 2.5px; paint-order: stroke; font-weight: 600; }
.size-ruler .sr-label { font-size: 12px; fill: #fff; stroke: rgba(0, 0, 0, .75); stroke-width: 3px; paint-order: stroke; font-weight: 700; }
.size-chip::before { background: var(--brass); }
.size-chip[aria-pressed="true"] { border-color: var(--brass); background: var(--brass-tint); }
.size-chip[aria-pressed="true"]::before { opacity: 1; box-shadow: none; }
.piece-size-switch { margin: 8px 0 0; display: flex; gap: 10px; align-items: center; }
.keys-check { margin: 4px 0; }
.keys-test { margin-left: auto; }
.size-ruler .sr-pill { fill: rgba(0, 0, 0, .62); }
.size-ruler .sr-label { stroke: none; }
.size-units { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 999px; overflow: hidden; }
.size-units button { border: 0; background: transparent; padding: 3px 10px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.size-units button[aria-pressed="true"] { background: var(--brass-tint); color: var(--brass-strong); font-weight: 600; }
/* Show size in the enlarged photo (Prime 2026-11-23) */
.zoom-stage { position: relative; }
.zoom-stage .size-ruler { transform-origin: center center; transition: transform .08s ease-out; }
@media (prefers-reduced-motion: reduce) { .zoom-stage .size-ruler { transition: none; } }
.zoom-bar { flex-wrap: wrap; }
.pz-size { display: inline-flex; gap: 8px; align-items: center; margin-left: 10px; }
.pz-size[hidden] { display: none; }
.piece-zoom .uv-chip { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.25); padding: 3px 10px; }
.piece-zoom .size-chip[aria-pressed="true"] { background: color-mix(in srgb, var(--brass) 35%, transparent); border-color: var(--brass); color: #fff; }
.piece-zoom .size-units { border-color: rgba(255,255,255,.25); }
.piece-zoom .size-units[hidden] { display: none; }
.piece-zoom .size-units button { color: #ddd; }
.piece-zoom .size-units button[aria-pressed="true"] { background: color-mix(in srgb, var(--brass) 35%, transparent); color: #fff; }
/* Gallery viewer: click the photo for its next side (Prime 2026-11-23) */
.gallery-zoom .zoom-stage:not(.is-zoomed) img { cursor: pointer; }
/* Purchase: the listing buttons as two separate buttons (Prime 2026-11-26) */
.pur-l-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
/* Privy mark icons found with Claude (Prime 2026-12-01) */
.pi-mark { border-top: 1px solid var(--border); padding: 12px 0; }
.pi-head { margin-bottom: 8px; }
.pi-svg { width: 56px; height: 56px; color: var(--ink); flex: none; }
.pi-pick { display: flex; gap: 14px; align-items: flex-start; }
.pi-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 6px 0; }
.pi-alt button { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; background: var(--surface-raised);
  border: 1px solid var(--border-strong); border-radius: 10px; cursor: pointer; font: inherit; font-size: .82rem; color: inherit; }
.pi-alt button:hover, .pi-alt button:focus-visible { border-color: var(--brass); }
.pi-alt .pi-svg { width: 44px; height: 44px; }
.pi-own { margin-top: 8px; }
.pi-own form { display: grid; gap: 8px; max-width: 520px; margin-top: 6px; }
.pi-own textarea { width: 100%; font-family: ui-monospace, monospace; font-size: .8rem; }
.pi-own .pi-letters { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-bottom: 10px; }
.pi-own .pi-letters input { width: 5em; text-transform: uppercase; }
