/* Brettspielregal – two themes on one layout (D-033).
   Light = "Eile mit Weile" (proposal A), dark = Gloomhaven mood (proposal D).
   Components only use the tokens below; themes only change tokens.
   Spacing scale: 4 · 8 · 12 · 16 · 24 · 32. Phone first (360–412 px), desktop from 1024 px. */

@font-face { font-family: 'Archivo'; src: url('/fonts/archivo-latin.woff2') format('woff2'); font-weight: 400 900; font-stretch: 62% 125%; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Archivo'; src: url('/fonts/archivo-latin-ext.woff2') format('woff2'); font-weight: 400 900; font-stretch: 62% 125%; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Alegreya'; src: url('/fonts/alegreya-latin.woff2') format('woff2'); font-weight: 600 700; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Alegreya'; src: url('/fonts/alegreya-latin-ext.woff2') format('woff2'); font-weight: 600 700; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Crimson Pro'; src: url('/fonts/crimson-pro-latin.woff2') format('woff2'); font-weight: 400 700; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Crimson Pro'; src: url('/fonts/crimson-pro-latin-ext.woff2') format('woff2'); font-weight: 400 700; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---------- Light: Eile mit Weile ---------- */
:root {
  color-scheme: light;
  --bg: #F3F5F8;            /* cool board white */
  --text: #18213A;          /* ink */
  --text-2: #4A5368;
  --line: #C9CEDA;
  --line-soft: #DDE1EA;
  --card: #FFFFFF;
  --card-text: #18213A;
  --card-text-2: #4A5368;
  --card-border: #18213A;
  --card-line: rgba(24, 33, 58, 0.14);
  --outline: #18213A;       /* the 2 px ink outline is the signature of theme A */
  --accent: #2155C4;        /* primary action: blue */
  --accent-text: #FFFFFF;
  --accent-soft: #EEF3FC;
  --scan: #D62839;          /* scan button: red */
  --scan-text: #FFFFFF;
  --heading: #18213A;
  --mark-unplayed: #F4B400; /* pawn: yellow */
  --mark-unplayed-ink: #18213A;
  --mark-unplayed-ring: #FFFFFF;
  --star: #F2B705;          /* own rating: gold sticker */
  --star-ink: #18213A;
  --star-edge: #18213A;
  --star-empty: #C9CEDA;
  --ok: #1D8A50; --ok-soft: #E3F3EA; --ok-text: #11573A;
  --warn: #B07F00; --warn-soft: #FDF0C7; --warn-text: #5C4300;
  --danger: #B01E2C;
  --nav-bg: #FFFFFF; --nav-text: #4A5368; --nav-active: #18213A;
  --chip-bg: #FFFFFF; --chip-text: #18213A; --chip-border: #18213A; --chip-active-bg: #18213A; --chip-active-text: #FFFFFF;
  --input-bg: #FFFFFF; --input-text: #18213A; --input-border: #C9CEDA; --input-placeholder: #6B7386;
  --icon-button-bg: #FFFFFF; --icon-button-text: #18213A; --icon-button-border: #18213A;
  --focus: #2155C4;
  --overlay: rgba(24, 33, 58, 0.45);
  --tone-1: #2155C4; --tone-1-ink: #FFFFFF;
  --tone-2: #D62839; --tone-2-ink: #FFFFFF;
  --tone-3: #F4B400; --tone-3-ink: #18213A;
  --tone-4: #1D8A50; --tone-4-ink: #FFFFFF;
  --tone-5: #18213A; --tone-5-ink: #F4B400;
  --tone-6: #FFFFFF; --tone-6-ink: #D62839;
  --font-head: 'Archivo', system-ui, sans-serif;
  --font-body: 'Archivo', system-ui, sans-serif;
  --head-stretch: 125%;
  --head-weight: 850;
  --head-spacing: -0.01em;
  --body-size: 16px;
  --body-leading: 1.45;
  --radius-card: 10px;
  --radius-control: 999px;
  --radius-input: 10px;
  --radius-sheet: 24px;
  --border-w: 2px;
  --shadow-sheet: none;
  --cover-ring: none;
}

/* ---------- Dark: Gloomhaven mood ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1E1A17;            /* dark stone */
  --text: #E8DCC0;
  --text-2: #B5A88E;
  --line: #3C3329;
  --line-soft: #2E2721;
  --card: #E8DCC0;          /* parchment */
  --card-text: #231B14;
  --card-text-2: #5A4A38;
  --card-border: #8C7440;   /* brass */
  --card-line: rgba(35, 27, 20, 0.18);
  --outline: #8C7440;
  --accent: #8E2A1E;        /* rust red */
  --accent-text: #F1E3C4;
  --accent-soft: #3A2B21;
  --scan: #8E2A1E;
  --scan-text: #F1E3C4;
  --heading: #D9B866;
  --mark-unplayed: #8E2A1E; /* wax seal */
  --mark-unplayed-ink: #F1E3C4;
  --mark-unplayed-ring: #5C160E;
  --star: #C9A14A;          /* own rating: brass seal */
  --star-ink: #1E1A17;
  --star-edge: #3A2E14;
  --star-empty: #B9A57E;
  --ok: #7FA37A; --ok-soft: #2C3326; --ok-text: #CFE3C9;
  --warn: #D9B866; --warn-soft: #3A3120; --warn-text: #EBD59A;
  --danger: #E07A6A;
  --nav-bg: #15120F; --nav-text: #B5A88E; --nav-active: #D9B866;
  --chip-bg: transparent; --chip-text: #E8DCC0; --chip-border: #5E5040; --chip-active-bg: #D9B866; --chip-active-text: #1E1A17;
  --input-bg: #2A2420; --input-text: #E8DCC0; --input-border: #5E5040; --input-placeholder: #9A8D74;
  --icon-button-bg: #2A2420; --icon-button-text: #D9B866; --icon-button-border: #8C7440;
  --focus: #D9B866;
  --overlay: rgba(0, 0, 0, 0.6);
  --tone-1: #5C2A22; --tone-1-ink: #E8DCC0;
  --tone-2: #33493D; --tone-2-ink: #E8DCC0;
  --tone-3: #7A6033; --tone-3-ink: #F1E3C4;
  --tone-4: #40502A; --tone-4-ink: #E8DCC0;
  --tone-5: #2A2420; --tone-5-ink: #D9B866;
  --tone-6: #4A3A5C; --tone-6-ink: #E8DCC0;
  --font-head: 'Alegreya', Georgia, serif;
  --font-body: 'Crimson Pro', Georgia, serif;
  --head-stretch: 100%;
  --head-weight: 700;
  --head-spacing: 0;
  --body-size: 17px;
  --body-leading: 1.5;
  --radius-card: 8px;
  --radius-control: 6px;
  --radius-input: 6px;
  --radius-sheet: 12px;
  --border-w: 2px;
  --shadow-sheet: 0 0 0 4px #15120F, 0 0 0 5px #5E5040;
  --cover-ring: 0 0 0 3px var(--bg), 0 0 0 4px #3C3329;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: var(--body-size); line-height: var(--body-leading);
}
h1, h2, h3 { font-family: var(--font-head); font-stretch: var(--head-stretch); font-weight: var(--head-weight); letter-spacing: var(--head-spacing); color: var(--heading); margin: 0; line-height: 1.1; }
h1 { font-size: 2.2rem; overflow-wrap: anywhere; hyphens: auto; }
h1.long { font-size: 1.6rem; line-height: 1.15; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0; }
a { color: var(--accent); }
:root[data-theme="dark"] a { color: var(--heading); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 24px; height: 24px; flex: none; }
.muted { color: var(--text-2); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 420px) { h1 { font-size: 1.9rem; } }
@media (min-width: 900px) { h1.long { font-size: 2rem; } }

/* ---------- Layout ---------- */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.page { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 20px 16px calc(104px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 420px) { .page { padding-left: 14px; padding-right: 14px; } }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.page-head > .stack { gap: 4px; min-width: 0; }
.page-head p { color: var(--text-2); }
.page-head .button { flex: none; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.tight { gap: 4px; }
.stack > section { margin-top: 12px; }
.stack > .button:not(.wide) { align-self: flex-start; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.spread { justify-content: space-between; row-gap: 8px; }
.section-title { font-family: var(--font-head); font-stretch: 100%; font-weight: 700; font-size: 0.9rem; color: var(--text-2); letter-spacing: 0; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--text); text-decoration: none; font-weight: 600; }
:root[data-theme="dark"] .back { color: var(--text); }
.back .icon { width: 22px; height: 22px; }
.back span { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }

/* ---------- Navigation: bottom tab bar (mobile), top bar (desktop) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: calc(72px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: var(--nav-bg); border-top: var(--border-w) solid var(--outline);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: stretch;
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 56px; font-size: 12px; font-weight: 600; line-height: 1; color: var(--nav-text); text-decoration: none; position: relative; }
:root[data-theme="dark"] .tabbar a { font-size: 13px; }
.tabbar a[aria-current="page"] { color: var(--nav-active); font-weight: 800; }
.tabbar .scan-button { justify-content: flex-start; padding-top: 0; }
.scan-button span.disc {
  width: 64px; height: 64px; margin-top: -24px; border-radius: 50%; background: var(--scan); color: var(--scan-text);
  border: 3px solid var(--outline); box-shadow: 0 0 0 4px var(--nav-bg); display: flex; align-items: center; justify-content: center;
}
:root[data-theme="dark"] .scan-button span.disc { border-color: #D9B866; }
.scan-button span.disc .icon { width: 28px; height: 28px; }
.badge { position: absolute; top: 4px; left: 50%; margin-left: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--mark-unplayed); color: var(--mark-unplayed-ink); font-family: var(--font-body); font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.topbar { display: none; }

@media (min-width: 1024px) {
  .tabbar { display: none; }
  .topbar {
    display: flex; position: sticky; top: 0; z-index: 20; height: 64px; padding: 0 24px; gap: 24px; align-items: center;
    background: var(--nav-bg); border-bottom: var(--border-w) solid var(--outline);
  }
  .topbar .brand { font-family: var(--font-head); font-stretch: var(--head-stretch); font-weight: var(--head-weight); font-size: 1.2rem; color: var(--heading); text-decoration: none; }
  .topbar nav { display: flex; gap: 6px; flex: 1; }
  .topbar nav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: var(--radius-control); color: var(--nav-text); text-decoration: none; position: relative; font-weight: 600; }
  .topbar nav a[aria-current="page"] { color: var(--nav-active); font-weight: 800; background: var(--accent-soft); }
  .topbar nav .badge { position: static; display: inline-flex; margin-left: 6px; }
  .page { padding: 32px 32px 48px; gap: 20px; }
}

/* ---------- Controls ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border-radius: var(--radius-control); border: var(--border-w) solid var(--outline); background: var(--card); color: var(--card-text);
  font-weight: 700; cursor: pointer; text-decoration: none; text-align: center; line-height: 1.2;
}
.button .icon { width: 20px; height: 20px; }
.button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--outline); }
:root[data-theme="dark"] .button.primary { border-color: #5C160E; font-family: var(--font-head); font-size: 1.1rem; }
.button.wide { width: 100%; min-height: 54px; }
.button.small { min-height: 44px; padding: 0 16px; font-size: 0.95rem; }
.button.danger { color: var(--danger); }
.button:disabled { opacity: 0.55; cursor: progress; }
.link-button { background: none; border: 0; padding: 8px 4px; min-height: 44px; color: var(--text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; white-space: nowrap; font-weight: 600; }
.icon-button {
  width: 44px; height: 44px; min-width: 44px; min-height: 44px; flex: none; aspect-ratio: 1 / 1; border-radius: 50%; padding: 0; line-height: 0;
  border: var(--border-w) solid var(--icon-button-border); background: var(--icon-button-bg); color: var(--icon-button-text);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.icon-button .icon { width: 22px; height: 22px; }
.icon-button.quiet { border-color: transparent; background: transparent; color: var(--text); }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
@media (max-width: 420px) { .chips { margin: 0 -14px; padding-left: 14px; padding-right: 14px; } }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; white-space: nowrap; cursor: pointer; text-decoration: none;
  border-radius: var(--radius-control); border: var(--border-w) solid var(--chip-border); background: var(--chip-bg); color: var(--chip-text); font-weight: 600; font-size: 0.93rem;
}
:root[data-theme="dark"] .chip { border-width: 1px; }
.chip[aria-pressed="true"] { background: var(--chip-active-bg); color: var(--chip-active-text); border-color: var(--chip-active-bg); }
.chip .icon { width: 16px; height: 16px; }
.chip .mark { width: 22px; height: 22px; margin-left: -4px; }
.chip .mark .icon { width: 13px; height: 13px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 0.95rem; }
.field input, .field select, .field textarea, .search input, .search select {
  width: 100%; min-width: 0; min-height: 48px; padding: 10px 14px; border-radius: var(--radius-input); border: 1.5px solid var(--input-border); background: var(--input-bg); color: var(--input-text); font-weight: 400;
}
.field select, .search select { padding-top: 0; padding-bottom: 0; }
::placeholder { color: var(--input-placeholder); opacity: 1; }
.field textarea { min-height: 96px; resize: vertical; }
.field .hint { font-weight: 400; color: var(--text-2); font-size: 0.85rem; line-height: 1.35; }
.field-error { color: var(--danger); font-weight: 600; font-size: 0.9rem; }
.field-error:empty { display: none; }
.search { display: flex; align-items: center; gap: 8px; }
.search input { flex: 1; }
.search-box { position: relative; display: flex; }
.search-box .icon { position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; margin-top: -10px; color: var(--input-placeholder); pointer-events: none; }
.search-box input { width: 100%; min-height: 48px; padding: 10px 14px 10px 42px; border-radius: var(--radius-input); border: 1.5px solid var(--input-border); background: var(--input-bg); color: var(--input-text); }
.search-box input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: -4px; }
.toolbar select { max-width: 60%; min-height: 44px; padding: 0 4px; border: 0; border-radius: 6px; background: transparent; color: var(--text); font-weight: 600; cursor: pointer; }
.segmented { display: flex; border: var(--border-w) solid var(--outline); border-radius: var(--radius-control); overflow: hidden; }
.segmented button { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 6px 8px; border: 0; background: var(--card); color: var(--card-text); cursor: pointer; font-size: 0.93rem; line-height: 1.15; hyphens: auto; }
.segmented button + button { border-left: 1px solid var(--line-soft); }
.segmented button[aria-pressed="true"] { background: var(--chip-active-bg); color: var(--chip-active-text); font-weight: 700; border-color: var(--chip-active-bg); }
:root[data-theme="dark"] .segmented button { background: #2A2420; color: var(--text); }
:root[data-theme="dark"] .segmented button + button { border-left-color: #4A3F33; }
:root[data-theme="dark"] .segmented button[aria-pressed="true"] { background: var(--chip-active-bg); color: var(--chip-active-text); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.switch input[type="checkbox"] {
  appearance: none; margin: 0; width: 52px; height: 30px; border-radius: 15px; background: var(--line); position: relative; cursor: pointer; flex: none;
  border: var(--border-w) solid var(--outline); transition: background 0.15s;
}
.switch input[type="checkbox"]::after { content: ''; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #FFFFFF; transition: transform 0.15s; }
.switch input[type="checkbox"]:checked { background: var(--ok); }
.switch input[type="checkbox"]:checked::after { transform: translateX(22px); }
:root[data-theme="dark"] .switch input[type="checkbox"] { background: #4A3F33; border-color: #8C7440; }
:root[data-theme="dark"] .switch input[type="checkbox"]:checked { background: #4F6B2F; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.stars { display: inline-flex; gap: 2px; color: var(--mark-unplayed); }
:root[data-theme="dark"] .stars { color: #8E2A1E; }
.stars .icon { width: 22px; height: 22px; }
.stars button { background: none; border: 0; padding: 4px; cursor: pointer; color: inherit; min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.stars button .icon { width: 26px; height: 26px; }
/* Own rating: ten stars in one row, no gaps, each at least 30 px wide; the big number answers the tap. */
.rating-readout { display: flex; align-items: baseline; justify-content: center; gap: 8px; font-family: var(--font-head); font-stretch: var(--head-stretch); color: var(--card-text); }
.rating-readout strong { font-size: 3.4rem; font-weight: var(--head-weight); line-height: 1; letter-spacing: var(--head-spacing); font-variant-numeric: tabular-nums; min-width: 2ch; text-align: center; }
.rating-readout span { color: var(--card-text-2); font-weight: 600; }
.star-picker { display: flex; justify-content: center; width: 100%; }
.star-picker button {
  flex: 1 1 0; min-width: 30px; max-width: 44px; height: 52px; padding: 0; border: 0; background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: var(--star-empty); border-radius: 6px;
}
.star-picker button .icon { width: 30px; height: 30px; stroke-width: 1.6; }
.star-picker button.on { color: var(--star); }
.star-picker button.on .icon { stroke: var(--star-edge); stroke-width: 1.4; }
.star-picker button:focus-visible { outline-offset: -3px; }
.barcode-field { display: flex; gap: 8px; align-items: center; }
.barcode-field input { flex: 1; min-width: 0; }
.camera-box { position: relative; border-radius: 12px; overflow: hidden; background: #0B0F1A; aspect-ratio: 4 / 3; }
.camera-box video { width: 100%; height: 100%; object-fit: cover; }
.camera-box .frame { position: absolute; left: 12%; right: 12%; top: 30%; bottom: 30%; border: 3px solid #FFFFFF; border-radius: 10px; }

/* ---------- Covers: the box on the shelf ---------- */
.cover {
  position: relative; aspect-ratio: 1 / 1; border-radius: var(--radius-card); border: var(--border-w) solid var(--card-border);
  overflow: hidden; display: flex; align-items: flex-end; padding: 12px; background: var(--tone-1); color: var(--tone-1-ink);
  container-type: inline-size; box-shadow: var(--cover-ring);
}
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--card); }
/* Placeholder: a monogram instead of the title (the title stands below the box). */
.cover .cover-title { font-family: var(--font-head); font-stretch: 112%; font-weight: var(--head-weight); font-size: 1.6rem; font-size: 27cqi; line-height: 0.9; letter-spacing: -0.02em; position: relative; }
.cover[data-tone="2"] { background: var(--tone-2); color: var(--tone-2-ink); }
.cover[data-tone="3"] { background: var(--tone-3); color: var(--tone-3-ink); }
.cover[data-tone="4"] { background: var(--tone-4); color: var(--tone-4-ink); }
.cover[data-tone="5"] { background: var(--tone-5); color: var(--tone-5-ink); }
.cover[data-tone="6"] { background: var(--tone-6); color: var(--tone-6-ink); }
.cover .marks { position: absolute; top: 8px; right: 8px; display: flex; align-items: center; gap: 6px; }
.mark { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.mark .icon { width: 16px; height: 16px; }
.mark-unplayed { background: var(--mark-unplayed); color: var(--mark-unplayed-ink); box-shadow: 0 0 0 2px var(--mark-unplayed-ring); }
.mark-open { width: 20px; height: 20px; border: 3px solid var(--warn); background: var(--card); }
.mark-expansion { position: absolute; left: 8px; top: 8px; padding: 3px 8px; border-radius: 6px; background: var(--card); color: var(--card-text); font-family: var(--font-body); font-size: 0.72rem; font-weight: 800; line-height: 1.1; }
/* Own rating: the award sticker in the lower right corner of the box. Scales with the box (container units). */
.rating-badge {
  --badge: clamp(30px, 26cqi, 60px);
  position: absolute; right: 6px; bottom: 6px; width: var(--badge); height: var(--badge);
  display: grid; place-items: center; color: var(--star-ink); filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}
.rating-badge .rosette { position: absolute; inset: 0; width: 100%; height: 100%; fill: var(--star); stroke: var(--star-edge); stroke-width: 2.2; }
.rating-badge-value {
  position: relative; font-family: var(--font-head); font-stretch: 100%; font-weight: 850; font-size: calc(var(--badge) * 0.44);
  line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; padding-top: 0.04em;
}
:root[data-theme="dark"] .rating-badge-value { font-weight: 700; }
.rating-badge.wide .rating-badge-value { font-size: calc(var(--badge) * 0.34); letter-spacing: -0.04em; }
/* Inline variant for lists: small rosette, number as text beside it. */
.rating-badge.small { position: static; width: auto; height: auto; display: inline-flex; align-items: center; gap: 4px; color: inherit; filter: none; vertical-align: middle; }
.rating-badge.small .rosette { position: static; width: 16px; height: 16px; stroke-width: 2.5; }
.rating-badge.small .rating-badge-value { font-family: inherit; font-weight: 700; font-size: inherit; padding: 0; letter-spacing: 0; }
.shelf-list .cover .rating-badge, .list-row .cover .rating-badge, .detail-head .cover .rating-badge { display: none; }
/* Theme specific marker: pawn in light, seal in dark */
.only-light { display: inline-flex; }
.only-dark { display: none; }
:root[data-theme="dark"] .only-light { display: none; }
:root[data-theme="dark"] .only-dark { display: inline-flex; }

/* ---------- Shelf ---------- */
.shelf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 14px; }
@media (min-width: 560px) { .shelf-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 18px; } }
@media (min-width: 900px) { .shelf-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.tile { display: flex; flex-direction: column; gap: 8px; color: inherit; text-decoration: none; min-width: 0; }
.tile h3 { font-family: var(--font-body); font-stretch: 100%; font-size: 0.97rem; font-weight: 650; line-height: 1.25; color: var(--text); letter-spacing: 0; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
:root[data-theme="dark"] .tile h3 { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; }
.tile .meta { font-size: 0.82rem; line-height: 1.3; color: var(--text-2); display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 2px; }
.tile .meta .flag { color: var(--warn-text); font-weight: 600; }
:root[data-theme="dark"] .tile .meta .flag { color: var(--warn); }
.shelf-list { display: flex; flex-direction: column; }
.shelf-list .tile, .list-row { flex-direction: row; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-row { display: flex; color: inherit; text-decoration: none; min-width: 0; }
.shelf-list .tile:first-child, .list-row:first-child { border-top: 1px solid var(--line); }
.shelf-list .cover, .list-row .cover { width: 56px; flex: none; padding: 6px; }
.shelf-list .cover .marks, .list-row .cover .marks { display: none; }
.shelf-list .tile > div:not(.cover), .list-row > div:not(.cover) { min-width: 0; flex: 1; }
.empty { padding: 24px 0; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; max-width: 36rem; }
.empty strong { font-family: var(--font-head); font-size: 1.3rem; color: var(--heading); }
.skeleton { background: var(--line-soft); border-radius: var(--radius-card); aspect-ratio: 1 / 1; }

/* ---------- Cards, pills ---------- */
.card { background: var(--card); color: var(--card-text); border: var(--border-w) solid var(--card-border); border-radius: var(--radius-card); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card .muted, .card .section-title { color: var(--card-text-2); }
.card h2, .card h3 { color: var(--card-text); }
.card .link-button { color: var(--card-text); }
.card .button { border-color: var(--card-border); }
:root[data-theme="dark"] .card a:not(.button) { color: #6B2014; }
:root[data-theme="dark"] .card .button { background: #F3EAD6; color: var(--card-text); }
:root[data-theme="dark"] .card .segmented button { background: #F3EAD6; color: var(--card-text); }
:root[data-theme="dark"] .card .segmented button + button { border-left-color: #CDBFA9; }
:root[data-theme="dark"] .card .segmented button[aria-pressed="true"] { background: var(--chip-active-bg); color: var(--chip-active-text); }
:root[data-theme="dark"] .card .switch input[type="checkbox"] { border-color: #8C7440; background: #CDBFA9; }
:root[data-theme="dark"] .card .switch input[type="checkbox"]:checked { background: #4F6B2F; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 0.85rem; font-weight: 700; width: fit-content; line-height: 1.3; }
.pill.ok { background: var(--ok-soft); color: var(--ok-text); }
.pill.likely { background: var(--accent-soft); color: var(--text); }
.pill.open { background: var(--warn-soft); color: var(--warn-text); }
.card .pill.likely, .sheet .pill.likely { color: var(--card-text); }
:root[data-theme="dark"] .card .pill.ok, :root[data-theme="dark"] .sheet .pill.ok { background: #DCE6D2; color: #2F4A2A; }
:root[data-theme="dark"] .card .pill.open, :root[data-theme="dark"] .sheet .pill.open { background: #F0DFB0; color: #5C4300; }
:root[data-theme="dark"] .card .pill.likely, :root[data-theme="dark"] .sheet .pill.likely { background: #E0D2B2; }

/* ---------- Detail ---------- */
.detail { display: grid; gap: 24px; }
.detail.has-cover .detail-cover { display: flex; justify-content: center; }
.detail.has-cover .detail-cover .cover { width: min(100%, 320px); }
@media (max-width: 899px) { .detail.has-cover .detail-cover .cover { width: min(100%, 220px); } }
@media (min-width: 900px) {
  .detail.has-cover { grid-template-columns: 320px minmax(0, 1fr); align-items: start; }
  .detail.plain { max-width: 760px; }
}
.detail-head { display: flex; gap: 14px; align-items: flex-start; }
.detail-head .cover { width: 76px; flex: none; padding: 8px; }
.detail-head > .stack { min-width: 0; flex: 1; }
.detail-head h1 { font-size: 1.75rem; line-height: 1.1; }
.detail-head h1.long { font-size: 1.4rem; }
@media (min-width: 900px) { .detail-head .cover { width: 96px; } .detail-head h1 { font-size: 2.2rem; } .detail-head h1.long { font-size: 1.8rem; } }
/* BGG main title below the title of the own edition (D-052) */
.original-title { margin: 0; color: var(--text-2); font-size: 0.95rem; font-style: italic; }
.tile .original-title { display: block; font-size: 0.8rem; line-height: 1.3; overflow-wrap: anywhere; }
.edition-title { margin: 0; overflow-wrap: anywhere; }
.facts { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--text-2); font-variant-numeric: tabular-nums; }
/* BGG figures: clearly the community's numbers, not the own rating (no gold here). */
.bgg-facts { font-size: 0.95rem; }
.bgg-facts strong { color: var(--text); font-weight: 700; }
.bgg-credit .link-button { padding-left: 0; padding-right: 0; min-height: 36px; font-weight: 600; }
.bgg-credit .link-button:disabled { text-decoration: none; cursor: progress; color: var(--text-2); }
.copy-row { display: flex; flex-direction: column; gap: 8px; padding: 12px 0 2px; border-top: 1px solid var(--card-line); }
.copy-main { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.copy-main > .stack { min-width: 0; flex: 1; }
.copy-row .actions { display: flex; gap: 8px; flex: none; }
.card .copy-row .icon-button { background: transparent; color: var(--card-text); border-color: var(--card-border); }
.relation { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.relation > span { min-width: 0; }
.relation .icon-button { width: 40px; height: 40px; min-width: 40px; min-height: 40px; }
.relation .icon-button .icon { width: 20px; height: 20px; }
.comment-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.comment-head strong { font-family: var(--font-head); font-stretch: 100%; }
.comment .stars { align-self: center; }

/* ---------- Sheets, dialogs, toast ---------- */
dialog.sheet {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 640px; max-height: 92dvh; overflow: auto;
  background: var(--card); color: var(--card-text); border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  border-top: 3px solid var(--card-border); box-shadow: var(--shadow-sheet);
}
dialog.sheet::backdrop { background: var(--overlay); }
@media (min-width: 1024px) { dialog.sheet { margin: auto; border-radius: var(--radius-sheet); border: var(--border-w) solid var(--card-border); max-width: 560px; } }
.sheet-inner { padding: 10px 16px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 560px) { .sheet-inner { padding-left: 24px; padding-right: 24px; } }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; min-height: 44px; }
.sheet-head h2 { color: var(--card-text); font-size: 1.3rem; line-height: 1.15; padding-top: 8px; min-width: 0; overflow-wrap: anywhere; }
.sheet-grip { width: 36px; height: 4px; border-radius: 2px; background: var(--card-line); align-self: center; }
.sheet .muted, .sheet .hint, .sheet .section-title { color: var(--card-text-2); }
.sheet .link-button { color: var(--card-text); }
.sheet h3 { color: var(--card-text); }
.sheet .field input, .sheet .field select, .sheet .field textarea { background: var(--card); color: var(--card-text); border-color: var(--input-border); }
:root[data-theme="dark"] .sheet .field input, :root[data-theme="dark"] .sheet .field select, :root[data-theme="dark"] .sheet .field textarea { background: #F3EAD6; color: var(--card-text); border-color: #B9A57E; }
:root[data-theme="dark"] .sheet ::placeholder { color: #7D6B53; }
:root[data-theme="dark"] .sheet .segmented button { background: #F3EAD6; color: var(--card-text); }
:root[data-theme="dark"] .sheet .segmented button + button { border-left-color: #CDBFA9; }
:root[data-theme="dark"] .sheet .segmented button[aria-pressed="true"] { background: var(--chip-active-bg); color: var(--chip-active-text); }
:root[data-theme="dark"] .sheet .switch input[type="checkbox"] { border-color: #8C7440; background: #CDBFA9; }
:root[data-theme="dark"] .sheet .switch input[type="checkbox"]:checked { background: #4F6B2F; }
:root[data-theme="dark"] .sheet a:not(.button) { color: #6B2014; }
:root[data-theme="dark"] .sheet .button:not(.primary) { background: #F3EAD6; color: var(--card-text); }
:root[data-theme="dark"] .sheet .stars { color: #8E2A1E; }
.sheet .link-button.center { align-self: center; }
.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 40; margin: 0 auto; max-width: 520px;
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; background: var(--text); color: var(--bg);
}
.toast button { background: none; border: 0; color: inherit; font-weight: 800; text-decoration: underline; min-height: 40px; cursor: pointer; }
.toast span { flex: 1; }
@media (min-width: 1024px) { .toast { bottom: 24px; } }

/* ---------- Scanner ---------- */
.scanner { position: fixed; inset: 0; z-index: 30; background: #0B0F1A; color: #FFFFFF; display: flex; flex-direction: column; }
:root[data-theme="dark"] .scanner { background: #0F0C0A; }
.scanner :focus-visible { outline-color: #FFFFFF; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scanner .scanner-top { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; gap: 10px; }
.scanner .scanner-top .row { flex-wrap: nowrap; }
.scanner .frame { position: relative; z-index: 1; margin: 6vh auto 0; width: min(78vw, 360px); aspect-ratio: 2 / 1; border: 3px solid #FFFFFF; border-radius: 14px; box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.35); }
.scanner .frame.hit { border-color: #4ADE80; }
.scanner .scanner-bottom { position: relative; z-index: 2; margin-top: auto; padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }
.scanner .status { text-align: center; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); min-height: 1.4em; }
.scanner .status:empty { display: none; }
.scanner .search { flex-wrap: nowrap; }
.scanner .search input { background: rgba(255, 255, 255, 0.95); color: #18213A; border-color: transparent; }
.scanner .search input::placeholder { color: #6B7386; }
.scanner .series { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.scanner .series:empty { display: none; }
.scanner .series .chip { background: rgba(255, 255, 255, 0.92); color: #18213A; border-color: transparent; height: 36px; font-size: 0.88rem; }
.scanner .icon-button { background: rgba(255, 255, 255, 0.92); color: #18213A; border-color: transparent; }
.scanner .chip { background: rgba(255, 255, 255, 0.14); color: #FFFFFF; border-color: rgba(255, 255, 255, 0.5); }
.scanner .chip[aria-pressed="true"] { background: #FFFFFF; color: #18213A; border-color: #FFFFFF; }
.scanner .fallback { position: relative; z-index: 2; margin: 8vh 16px 0; padding: 20px; border-radius: 16px; background: var(--card); color: var(--card-text); display: flex; flex-direction: column; gap: 8px; }
.scanner .fallback strong { font-family: var(--font-head); font-size: 1.1rem; }
.candidate { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 10px; border-radius: 12px; border: 1.5px solid var(--input-border); background: transparent; color: inherit; cursor: pointer; min-height: 64px; }
.candidate[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.sheet .candidate[aria-pressed="true"] { color: var(--card-text); }
:root[data-theme="dark"] .sheet .candidate { border-color: #B9A57E; }
:root[data-theme="dark"] .sheet .candidate[aria-pressed="true"] { background: #F3EAD6; border-color: #8E2A1E; }
.candidate .cover { width: 52px; flex: none; padding: 6px; }
.hit-own { display: flex; gap: 12px; align-items: center; }
.hit-own .cover { width: 64px; flex: none; padding: 6px; }

/* ---------- Login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.login h1 { font-size: 2.1rem; hyphens: manual; overflow-wrap: normal; }
@media (max-width: 400px) { .login h1 { font-size: 1.9rem; } }
.login .button { margin-top: 8px; }

/* ---------- Pile of Shame artwork ---------- */
.cover.cover-art { padding: 0; background: #F8EBC8; }
.cover.cover-art img { object-fit: cover; background: transparent; }
.cover.cover-art .cover-title { display: none; }
.pile-hero { width: min(100%, 320px); aspect-ratio: 1 / 1; height: auto; border-radius: var(--radius-card); border: var(--border-w) solid var(--card-border); align-self: center; background: #F8EBC8; }

/* ---------- Hit card: edition choice ---------- */
fieldset.versions { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.versions legend { padding: 0; margin-bottom: 4px; }
.switch.version { min-height: 48px; padding: 4px 0; border-top: 1px solid var(--line); font-weight: 500; }
.switch.version input[type="radio"] { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 6px; font-weight: 600; }

/* ---------- Picture chooser ---------- */
.picture-row { display: flex; gap: 14px; align-items: center; }
.picture-preview .cover { width: 96px; padding: 8px; }
.picture-suggestions { display: grid; gap: 8px; }
.picture-suggestions .candidate .cover { width: 48px; }
.cover.cover-art img { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------- Crop editor ---------- */
.crop-frame { align-self: center; width: min(100%, 300px); aspect-ratio: 1 / 1; border-radius: var(--radius-card); overflow: hidden; border: var(--border-w) solid var(--card-border); background: #FFFFFF; touch-action: none; }
.crop-canvas { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.crop-canvas:active { cursor: grabbing; }
.bgg-credit { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }

/* ---------- Backup ---------- */
.reminder { text-decoration: none; color: var(--card-text); border-color: var(--warn); }
.token-row { padding: 6px 0; border-top: 1px solid var(--line); }
ol.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
code { font-size: 0.9em; padding: 1px 6px; border-radius: 4px; background: var(--accent-soft); }

/* ---------- Places and loans (D-053) ----------
   The shelf tag is the one memorable piece: the code set like a small plate on the shelf edge
   (ink outline in light, brass plate in dark). Everything around it stays quiet. */
.loc-tag {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 28px; height: 28px; padding: 0 8px;
  border: var(--border-w) solid var(--outline); border-radius: 6px; background: var(--card); color: var(--card-text);
  font-family: var(--font-head); font-stretch: 100%; font-weight: 800; font-size: 0.95rem; line-height: 1; letter-spacing: 0.01em; font-variant-numeric: tabular-nums;
  vertical-align: middle; flex: none;
}
.loc-tag.home { padding: 0 5px; }
.loc-tag .icon { width: 16px; height: 16px; }
.loc-tag.small { height: 22px; min-width: 22px; padding: 0 6px; font-size: 0.78rem; border-width: 1.5px; border-radius: 5px; }
.loc-tag.small .icon { width: 13px; height: 13px; }
:root[data-theme="dark"] .loc-tag { background: #D9B866; color: #1E1A17; border-color: #8C7440; font-weight: 700; box-shadow: inset 0 0 0 1px #F1E3C4; }
.card .loc-tag, .sheet .loc-tag { border-color: var(--card-border); }
.place { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.loan-tag { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 2px 6px; color: var(--text); font-weight: 600; }
.loan-tag .icon { width: 15px; height: 15px; color: var(--accent); }
:root[data-theme="dark"] .loan-tag .icon { color: var(--heading); }
.loan-tag .since { color: var(--text-2); font-weight: 400; }
.shelf-grid .loan-tag .since { flex-basis: 100%; padding-left: 21px; } /* own line under the name, aligned with it */
.tile .meta .places { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; width: 100%; }
.shelf-list .tile .meta .places { width: auto; }
/* Lent copy: the row gets the accent on its edge; the state line names who and since when. */
.copy-row.lent { border-left: 4px solid var(--accent); padding-left: 10px; }
:root[data-theme="dark"] .copy-row.lent { border-left-color: #8E2A1E; }
.loan-line { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.loan-state { display: flex; gap: 8px; align-items: flex-start; }
.loan-state .icon { width: 20px; height: 20px; flex: none; margin-top: 2px; color: var(--accent); }
:root[data-theme="dark"] .loan-state .icon { color: #8E2A1E; }
.quick-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.chip.quick { height: 36px; padding: 0 12px 0 10px; font-size: 0.88rem; }
.chip.quick .icon { width: 17px; height: 17px; }
.card .chip.quick, .sheet .chip.quick { background: transparent; color: var(--card-text); border-color: var(--card-border); }
.card .chip.quick[aria-pressed="true"], .sheet .chip.quick[aria-pressed="true"] { background: var(--chip-active-bg); color: var(--chip-active-text); border-color: var(--chip-active-bg); }
:root[data-theme="dark"] .card .chip.quick, :root[data-theme="dark"] .sheet .chip.quick { border-color: #8C7440; }
.link-button.small { min-height: 36px; padding: 4px; font-size: 0.88rem; }
.link-button.danger { color: var(--danger); }
.sheet .link-button.danger { color: var(--danger); }
:root[data-theme="dark"] .sheet .link-button.danger { color: #8E2A1E; }
.loan-history { font-size: 0.93rem; }
.loan-history summary { min-height: 36px; font-size: 0.9rem; color: var(--card-text-2); }
.loan-history .row.spread { min-height: 36px; border-top: 1px solid var(--card-line); padding-top: 2px; }
/* Picker sheet: numbers in a row, the big read-out answers every tap. */
.loc-readout { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; color: var(--card-text); }
.loc-readout strong { font-family: var(--font-head); font-stretch: var(--head-stretch); font-weight: var(--head-weight); font-size: 3rem; line-height: 1; letter-spacing: var(--head-spacing); font-variant-numeric: tabular-nums; min-height: 1em; }
.loc-readout span { color: var(--card-text-2); font-weight: 600; min-height: 1.4em; text-align: center; }
.level-row { display: flex; gap: 6px; }
.level-row button {
  flex: 1 1 0; min-width: 0; height: 48px; border-radius: var(--radius-input); border: var(--border-w) solid var(--card-border); background: var(--card); color: var(--card-text);
  font-family: var(--font-head); font-stretch: 100%; font-weight: 700; font-size: 1.15rem; cursor: pointer; font-variant-numeric: tabular-nums;
}
.level-row button[aria-pressed="true"] { background: var(--chip-active-bg); color: var(--chip-active-text); border-color: var(--chip-active-bg); }
.level-row button:disabled { opacity: 0.35; cursor: default; }
:root[data-theme="dark"] .level-row button { background: #F3EAD6; border-color: #B9A57E; }
:root[data-theme="dark"] .level-row button[aria-pressed="true"] { background: var(--chip-active-bg); color: var(--chip-active-text); border-color: var(--chip-active-bg); }
.row.center { justify-content: center; }
.row.names { gap: 6px; }
.sheet .row.names .chip { background: transparent; color: var(--card-text); border-color: var(--card-border); height: 36px; font-size: 0.9rem; }
.sheet .row.names .chip[aria-pressed="true"] { background: var(--chip-active-bg); color: var(--chip-active-text); border-color: var(--chip-active-bg); }
:root[data-theme="dark"] .sheet .row.names .chip { border-color: #8C7440; }
/* Chip with a tag inside and a remove button (place filter on the shelf, session place in the scanner). */
.chip.location { gap: 8px; padding-left: 4px; padding-right: 4px; height: 40px; }
.chip.location .loc-tag { height: 30px; }
.chip.location > button { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; padding: 0; }
.chip.location > button .icon { width: 18px; height: 18px; }
.chips .chip.location[aria-pressed="true"] .loc-tag { border-color: var(--chip-active-text); }
/* Scanner: the session place sits under the top row, before the frame. */
.scanner .scan-location { position: relative; z-index: 2; display: flex; justify-content: center; padding: 0 16px; }
.scanner .scan-location:empty { display: none; }
.scanner .chip.location { background: rgba(255, 255, 255, 0.94); color: #18213A; border-color: transparent; height: 44px; max-width: 100%; }
.scanner .chip.location > span:not(.loc-tag) { white-space: normal; line-height: 1.15; font-size: 0.88rem; }
.scanner .chip.location .loc-tag { border-color: #18213A; background: #FFFFFF; color: #18213A; }
.hit-place { display: flex; flex-direction: column; gap: 8px; }
.hit-place-value { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.camera-box.square { aspect-ratio: 1 / 1; }
.camera-box.square .frame { left: 20%; right: 20%; top: 20%; bottom: 20%; }

/* ---------- Regaletiketten ---------- */
.label-canvas { display: block; width: 128px; height: 34px; background: #FFFFFF; } /* 240 × 64 dots at 180 dpi = real size on a 96 dpi screen */
.label-group { display: flex; flex-direction: column; gap: 10px; }
.label-group h2 { font-size: 1rem; }
.label-sheets { display: flex; flex-direction: column; gap: 20px; }
.label-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.label-button {
  display: flex; align-items: center; justify-content: center; padding: 6px; border-radius: 6px; border: 1.5px solid var(--line); background: #FFFFFF; cursor: pointer; min-height: 48px;
}
.label-button:hover { border-color: var(--text); }
:root[data-theme="dark"] .label-button { border-color: #5E5040; }
.labels .card .row.spread .button { flex: none; }

/* ---------- Version + changelog ---------- */
.title-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.version-button { background: none; border: 0; padding: 6px 4px; min-height: 32px; color: var(--text-2); font-size: 0.8rem; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.changelog ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.changelog h3 { color: var(--card-text); }
