@import url("fonts/fonts.dbc422b4862a.css");

/* ---------- Tokens ---------- */
:root {
  --paper: #f4efe4;
  --paper-2: #ebe3d1;
  --card: #fbf8f1;
  --ink: #1c1a16;
  --ink-2: #4d483e;
  --rule: #cdc3ad;
  --red: #b8281b;
  --yellow: #f4c21b;
  --green: #2d6a3a;

  /* Role tokens: redefined in dark mode */
  --line: #1c1a16;          /* borders and rules */
  --red-bg: #b8281b;        /* filled red blocks */
  --on-red: #ffffff;
  --on-yellow: #1c1a16;     /* text and border on yellow stickers */
  --green-bg: #2d6a3a;
  --inv-bg: #1c1a16;        /* inverted label blocks (section headings, tags) */
  --inv-fg: #f4efe4;
  --bar-bg: #1c1a16;        /* top strip and footer */
  --bar-fg: #f4efe4;
  --bar-muted: #bdb5a4;
  --bar-rule: #4d483e;
  --stripe: rgba(28, 26, 22, 0.05);
  /* Title stickers (accounts/titles.py): cartridge colours */
  --cart-gra: #a8a59c; --on-cart-gra: #1c1a16;
  --cart-svart: #1c1a16; --on-cart-svart: #f4efe4; --cart-svart-edge: #1c1a16;
  --cart-gull: #d9a92a; --on-cart-gull: #1c1a16;

  --f-display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --f-body: "Atkinson Hyperlegible", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, monospace;

  --gutter: 16px;
  --max: 1200px;
  color-scheme: light;
}

/* Dark mode: "black box" edition. Follows the system setting unless the
   visitor has picked a theme with the toggle (data-theme on <html>). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #17150f; --paper-2: #221f18; --card: #1f1c16;
    --ink: #ede6d5; --ink-2: #b5ac98; --rule: #3e392e;
    --red: #ec6a55; --yellow: #f2bf1a; --green: #7cc68a;
    --line: #857c68; --red-bg: #c0301f; --on-red: #ffffff; --on-yellow: #17150f;
    --green-bg: #2d6a3a; --inv-bg: #ede6d5; --inv-fg: #17150f;
    --bar-bg: #0c0b08; --bar-fg: #ede6d5; --bar-muted: #9d9481; --bar-rule: #3e392e;
    --stripe: rgba(237, 230, 213, 0.04);
    --cart-gra: #a8a59c; --on-cart-gra: #17150f;
    --cart-svart: #050403; --on-cart-svart: #ede6d5; --cart-svart-edge: #857c68;
    --cart-gull: #e0b23a; --on-cart-gull: #17150f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #17150f; --paper-2: #221f18; --card: #1f1c16;
  --ink: #ede6d5; --ink-2: #b5ac98; --rule: #3e392e;
  --red: #ec6a55; --yellow: #f2bf1a; --green: #7cc68a;
  --line: #857c68; --red-bg: #c0301f; --on-red: #ffffff; --on-yellow: #17150f;
  --green-bg: #2d6a3a; --inv-bg: #ede6d5; --inv-fg: #17150f;
  --bar-bg: #0c0b08; --bar-fg: #ede6d5; --bar-muted: #9d9481; --bar-rule: #3e392e;
  --stripe: rgba(237, 230, 213, 0.04);
  --cart-gra: #a8a59c; --on-cart-gra: #17150f;
  --cart-svart: #050403; --on-cart-svart: #ede6d5; --cart-svart-edge: #857c68;
  --cart-gull: #e0b23a; --on-cart-gull: #17150f;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 1rem;
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
/* The yellow highlight is for links and buttons only; form fields keep their
   own colours so typed text stays readable in both themes. */
a:focus-visible, summary:focus-visible { background-color: var(--yellow); color: var(--on-yellow); }
input, select, textarea { color: var(--ink); }
h1, h2, h3 { margin: 0; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--f-mono); }
.muted { color: var(--ink-2); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Top strip + header ---------- */
.strip {
  background: var(--bar-bg); color: var(--bar-fg);
  font-family: var(--f-mono); font-size: 0.75rem; letter-spacing: 0.04em;
}
.strip .wrap { display: flex; justify-content: space-between; gap: 1rem; padding-block: 6px; }
.strip a { color: var(--bar-fg); }
.strip .right { display: flex; gap: 12px; align-items: center; }
.theme-toggle {
  font: inherit; color: var(--bar-fg); background: none; border: 1px solid var(--bar-rule);
  padding: 0 8px; cursor: pointer;
}
.theme-toggle:hover { border-color: var(--bar-fg); }

.masthead { border-bottom: 3px solid var(--line); }
.masthead .wrap {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  gap: 24px; padding-block: 16px;
}
.logo {
  font-family: var(--f-display); font-weight: 900; font-size: 2.4rem;
  line-height: 0.9; text-transform: uppercase; text-decoration: none;
  letter-spacing: 0.01em; display: flex; align-items: center; gap: 8px;
}
.logo:hover { color: var(--ink); }
.logo .mark {
  background: var(--red-bg); color: var(--on-red); padding: 4px 8px 2px;
  transform: skewX(-8deg); display: inline-block;
}
.logo small {
  display: block; font-family: var(--f-mono); font-weight: 400;
  font-size: 0.65rem; letter-spacing: 0.08em; text-transform: none;
  color: var(--ink-2); margin-top: 4px;
}
.search { display: flex; border: 2px solid var(--line); background: var(--card); }
.search input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink);
  font: inherit; padding: 10px 12px;
}
.search input:focus { outline: none; }
.search:focus-within { outline: 3px solid var(--yellow); outline-offset: 0; }
.search button {
  border: 0; border-left: 2px solid var(--line); background: var(--inv-bg); color: var(--inv-fg);
  font-family: var(--f-display); font-weight: 700; font-size: 1.1rem;
  text-transform: uppercase; letter-spacing: 0.05em; padding: 0 18px; cursor: pointer;
}
.nav { display: flex; gap: 16px; align-items: center; white-space: nowrap; }
.nav a { font-weight: 700; text-decoration: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--f-display); font-weight: 700; font-size: 1.15rem;
  text-transform: uppercase; letter-spacing: 0.05em; text-decoration: none;
  padding: 10px 18px; border: 2px solid var(--line); background: var(--card);
  color: var(--ink); cursor: pointer;
}
.btn:hover { background: var(--inv-bg); color: var(--inv-fg); }
.btn-red { background: var(--red-bg); border-color: var(--red-bg); color: var(--on-red); }
.btn-red:hover { background: var(--inv-bg); border-color: var(--inv-bg); color: var(--inv-fg); }
.btn-block { width: 100%; }

/* ---------- Section headings ---------- */
.section { margin-block: 40px; }
/* The first section right after the home page intro: less of a gap. */
.intro + .section { margin-top: 20px; }
.sec-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 16px;
  border-bottom: 2px solid var(--line);
}
.sec-head h2 {
  font-family: var(--f-display); font-weight: 900; font-size: 1.6rem;
  text-transform: uppercase; letter-spacing: 0.02em; line-height: 1;
  background: var(--inv-bg); color: var(--inv-fg); padding: 6px 12px 4px;
}
.sec-head.red h2 { background: var(--red-bg); color: var(--on-red); }
.sec-head .more { margin-left: auto; font-family: var(--f-mono); font-size: 0.85rem; padding-bottom: 4px; }

/* ---------- Intro ---------- */
.intro {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px 32px; align-items: end;
  padding-block: 24px 8px;
}
/* "Siste nytt" and "Neste arrangement": their own full-width row under the
   headline, side by side (one alone takes the whole width). */
.intro-now {
  grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px 32px;
  border-top: 1px dashed var(--rule); padding-top: 12px;
}
.intro .intro-now .next-event, .intro .intro-now .next-event + .next-event {
  margin: 0; padding: 0; border: 0; min-width: 0;
}
.intro h1 {
  font-family: var(--f-display); font-weight: 900; text-transform: uppercase;
  font-size: clamp(2.4rem, 6vw, 4.4rem); line-height: 0.92; letter-spacing: 0.005em;
}
.intro h1 em { font-style: normal; color: var(--red); }
.intro p { margin: 0; max-width: 42ch; font-size: 1.1rem; }
.stats { display: flex; gap: 24px; margin-top: 16px; font-family: var(--f-mono); font-size: 0.85rem; }
.stats b { display: block; font-family: var(--f-display); font-size: 1.8rem; line-height: 1; }

/* ---------- Catalogue index (platforms) ---------- */
.catalogue {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0 32px; background: var(--card); border: 2px solid var(--line); padding: 20px 24px;
}
.catalogue h3 {
  font-family: var(--f-display); font-weight: 900; text-transform: uppercase;
  font-size: 1.25rem; margin: 8px 0 6px; border-bottom: 1px solid var(--line);
}
.catalogue ul { list-style: none; margin: 0 0 12px; padding: 0; }
.catalogue li a {
  display: flex; align-items: baseline; gap: 6px; text-decoration: none; padding: 2px 0;
}
.catalogue li a::after {
  content: ""; order: 1; flex: 1; border-bottom: 2px dotted var(--rule); transform: translateY(-4px);
}
.catalogue li .n { order: 2; font-family: var(--f-mono); font-size: 0.85rem; color: var(--ink-2); }
.catalogue li a:hover .n { color: var(--red); }

/* ---------- Photo placeholder ---------- */
.ph {
  aspect-ratio: 4 / 3; position: relative; overflow: hidden;
  background:
    repeating-linear-gradient(135deg, transparent 0 10px, var(--stripe) 10px 20px),
    var(--paper-2);
  display: grid; place-items: center; text-align: center;
  font-family: var(--f-mono); font-size: 0.75rem; color: var(--ink-2);
}
.ph span { background: var(--card); padding: 2px 6px; border: 1px solid var(--rule); }

/* ---------- Listing cards ---------- */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px;
}
.card {
  position: relative; background: var(--card); border: 1px solid var(--line);
  text-decoration: none; display: flex; flex-direction: column;
}
.card:hover { color: inherit; box-shadow: 0 0 0 2px var(--ink); }
.card:hover .card-title { text-decoration: underline; }
.card-body { padding: 12px 12px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title { font-weight: 700; font-size: 1.05rem; line-height: 1.25; }
.card-meta {
  margin-top: auto; display: flex; justify-content: space-between; gap: 8px;
  font-size: 0.85rem; color: var(--ink-2); border-top: 1px dashed var(--rule); padding-top: 8px;
}

/* Price sticker, like the ones on second-hand game boxes */
.sticker {
  position: absolute; top: 10px; right: -6px; z-index: 1;
  background: var(--yellow); color: var(--on-yellow); border: 1px solid var(--on-yellow);
  font-family: var(--f-display); font-weight: 900; font-size: 1.35rem; line-height: 1;
  padding: 6px 10px 4px; transform: rotate(3deg);
}
.sticker small { font-size: 0.8rem; font-weight: 700; }

/* Spec tags, like cartridge-label codes */
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag {
  font-family: var(--f-mono); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em;
  border: 1px solid var(--line); padding: 1px 5px; text-transform: uppercase; background: var(--paper);
}
.tag.region { background: var(--inv-bg); color: var(--inv-fg); }
.tag.trade { border-color: var(--red); color: var(--red); }
.tag.mod { border-style: dashed; }
.tag.ok { border-color: var(--green); color: var(--green); }

/* ---------- Classifieds (wanted) + workshop ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.classifieds { columns: 2; column-gap: 24px; column-rule: 1px solid var(--rule); font-size: 0.92rem; }
.classifieds article { break-inside: avoid; margin-bottom: 14px; }
.classifieds h3 {
  font-family: var(--f-display); font-weight: 900; text-transform: uppercase; font-size: 1.1rem;
  line-height: 1.1;
}
.classifieds p { margin: 2px 0; }
.classifieds .by { font-family: var(--f-mono); font-size: 0.75rem; color: var(--ink-2); }

.threads { list-style: none; margin: 0; padding: 0; }
.threads li { border-bottom: 1px solid var(--rule); padding: 10px 0; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.threads a { font-weight: 700; text-decoration: none; }
.threads .n { font-family: var(--f-mono); font-size: 0.8rem; color: var(--ink-2); grid-row: span 2; align-self: center; text-align: right; }
.threads .by { font-size: 0.85rem; color: var(--ink-2); }
.badge {
  font-family: var(--f-mono); font-size: 0.68rem; font-weight: 600; text-transform: uppercase;
  background: var(--green-bg); color: #fff; padding: 1px 5px; margin-left: 4px; vertical-align: 1px;
}

/* ---------- Footer ---------- */
.footer { margin-top: 64px; background: var(--bar-bg); color: var(--bar-fg); padding-block: 32px; }
.footer .wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 24px; }
.footer h3 { font-family: var(--f-display); text-transform: uppercase; font-size: 1.2rem; color: var(--yellow); margin-bottom: 8px; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin: 4px 0; }
.footer a { color: var(--bar-fg); }
.footer a:hover { color: var(--yellow); }
.footer .fine { grid-column: 1 / -1; font-family: var(--f-mono); font-size: 0.75rem; color: var(--bar-muted); border-top: 1px solid var(--bar-rule); padding-top: 16px; }

/* ---------- Breadcrumb ---------- */
.crumbs { font-family: var(--f-mono); font-size: 0.8rem; padding-block: 16px; color: var(--ink-2); }
.crumbs a { color: var(--ink-2); }

/* ---------- Listing page ---------- */
.listing { display: grid; grid-template-columns: 1.35fr 1fr; grid-template-rows: auto 1fr; gap: 0 40px; align-items: start; }
.listing .gallery { grid-column: 1; grid-row: 1; }
.listing aside { grid-column: 2; grid-row: 1 / span 2; }
.listing .l-desc { grid-column: 1; grid-row: 2; }
.gallery .ph { aspect-ratio: 4 / 3; border: 1px solid var(--line); font-size: 0.9rem; }
.thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 8px; }
.thumbs .ph { aspect-ratio: 1; border: 1px solid var(--rule); font-size: 0.65rem; }
.thumbs .ph.active { border: 2px solid var(--line); }

.l-head { position: relative; padding-right: 110px; }
.l-head .type {
  font-family: var(--f-mono); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--red); font-weight: 600;
}
.l-head h1 {
  font-family: var(--f-display); font-weight: 900; text-transform: uppercase;
  font-size: clamp(2rem, 4vw, 2.8rem); line-height: 0.95; margin: 4px 0 8px;
}
.l-head .sticker { top: 0; right: 0; font-size: 2rem; padding: 10px 14px 6px; }

/* Spec sheet, styled like a cartridge label */
.spec { margin: 20px 0; border: 2px solid var(--line); background: var(--card); }
.spec h2 {
  font-family: var(--f-display); font-weight: 900; text-transform: uppercase; font-size: 1.1rem;
  background: var(--inv-bg); color: var(--inv-fg); padding: 4px 12px 2px; letter-spacing: 0.06em;
}
.spec dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; }
.spec dt, .spec dd { margin: 0; padding: 7px 12px; border-top: 1px solid var(--rule); }
.spec dl > :nth-child(-n+2) { border-top: 0; }
.spec dt { font-family: var(--f-mono); font-size: 0.8rem; text-transform: uppercase; color: var(--ink-2); padding-top: 9px; }
.spec dd { font-weight: 700; }
.spec .repro { color: var(--green); }
.spec .repro::before { content: "✔ "; }

.seller { border: 1px solid var(--line); background: var(--card); padding: 16px; display: grid; gap: 12px; }
.seller-top { display: flex; gap: 12px; align-items: center; }
.avatar {
  width: 52px; height: 52px; flex: none; background: var(--yellow); color: var(--on-yellow); border: 2px solid var(--on-yellow);
  display: grid; place-items: center; font-family: var(--f-display); font-weight: 900; font-size: 1.6rem;
}
.seller-name { font-weight: 700; font-size: 1.1rem; }
.seller-facts { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; border-block: 1px dashed var(--rule); padding-block: 8px; }
.seller-facts b { display: block; font-family: var(--f-display); font-size: 1.5rem; line-height: 1; }
.seller-facts span { font-family: var(--f-mono); font-size: 0.7rem; text-transform: uppercase; color: var(--ink-2); }

.delivery { display: grid; gap: 6px; margin: 16px 0; font-size: 0.95rem; }
.delivery div { display: flex; gap: 8px; }
.delivery .k { font-family: var(--f-mono); font-size: 0.8rem; width: 88px; flex: none; color: var(--ink-2); padding-top: 2px; text-transform: uppercase; }

.prose { max-width: 65ch; }
.prose h2 { font-family: var(--f-display); font-weight: 900; text-transform: uppercase; font-size: 1.5rem; margin: 28px 0 8px; }
.prose p { margin: 0 0 12px; }

.tip {
  border-left: 6px solid var(--yellow); background: var(--card); padding: 12px 16px;
  font-size: 0.92rem; margin-top: 16px;
}
.tip b { font-family: var(--f-display); text-transform: uppercase; font-size: 1.05rem; letter-spacing: 0.03em; }

.actions-row { display: flex; gap: 8px; margin-top: 12px; }
.actions-row .btn { flex: 1; font-size: 1rem; padding: 8px 10px; }

/* ---------- Search page ---------- */
.search-layout { display: grid; grid-template-columns: 260px 1fr; gap: 32px; align-items: start; }
.filters { border: 2px solid var(--line); background: var(--card); }
.filters summary {
  font-family: var(--f-display); font-weight: 900; text-transform: uppercase; font-size: 1.2rem;
  background: var(--inv-bg); color: var(--inv-fg); padding: 6px 12px 4px; cursor: pointer; list-style: none;
}
.filters summary::-webkit-details-marker { display: none; }
.filters fieldset { border: 0; border-top: 1px solid var(--rule); margin: 0; padding: 12px; }
.filters fieldset:first-of-type { border-top: 0; }
.filters legend {
  font-family: var(--f-mono); font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 0; float: left; width: 100%; margin-bottom: 6px;
}
.filters label { display: flex; align-items: center; gap: 8px; font-size: 0.95rem; padding: 2px 0; clear: left; }
.filters label .n { margin-left: auto; font-family: var(--f-mono); font-size: 0.75rem; color: var(--ink-2); }
.filters input[type="checkbox"], .filters input[type="radio"] { accent-color: var(--ink); width: 16px; height: 16px; }
.filters select, .filters input[type="number"] {
  width: 100%; font: inherit; padding: 6px 8px; border: 1px solid var(--line); background: var(--paper);
}
.range { display: flex; gap: 8px; align-items: center; clear: left; }
.filters .apply { padding: 12px; border-top: 1px solid var(--rule); }
/* With JavaScript the filters apply by themselves; the button is only
   kept on phones, where it closes the panel and shows the results. */
@media (min-width: 901px) { .filters.auto .apply { display: none; } }

.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; justify-content: space-between;
  border-bottom: 2px solid var(--line); padding-bottom: 10px; margin-bottom: 4px;
}
.toolbar h1 { font-family: var(--f-display); font-weight: 900; text-transform: uppercase; font-size: 2rem; line-height: 1; }
.toolbar .count { font-family: var(--f-mono); font-size: 0.85rem; color: var(--ink-2); }
.toolbar select { font: inherit; padding: 6px 8px; border: 1px solid var(--line); background: var(--card); }
.toolbar .btn { font-size: 1rem; padding: 6px 12px; }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.chip {
  font-family: var(--f-mono); font-size: 0.78rem; border: 1px solid var(--on-yellow); background: var(--yellow); color: var(--on-yellow);
  padding: 2px 4px 2px 8px; display: inline-flex; gap: 6px; align-items: center;
}
.chip button { border: 0; background: none; font: inherit; color: inherit; cursor: pointer; padding: 0 4px; }

.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid; grid-template-columns: 132px 1fr auto; gap: 16px; align-items: start;
  padding: 14px 0; border-bottom: 1px solid var(--rule);
}
.row .ph { aspect-ratio: 4 / 3; border: 1px solid var(--rule); font-size: 0.65rem; }
.row h2 { font-size: 1.1rem; line-height: 1.25; margin-bottom: 6px; }
.row h2 a { text-decoration: none; }
.row h2 a:hover { text-decoration: underline; }
.row .desc { margin: 6px 0 0; font-size: 0.9rem; color: var(--ink-2); }
.row .where { font-size: 0.85rem; color: var(--ink-2); margin-top: 6px; font-family: var(--f-mono); }
.row .price {
  font-family: var(--f-display); font-weight: 900; font-size: 1.6rem; line-height: 1; white-space: nowrap;
  background: var(--yellow); color: var(--on-yellow); border: 1px solid var(--on-yellow); padding: 6px 10px 4px; transform: rotate(2deg);
}
.row.wanted .price { background: var(--card); color: var(--ink); border-color: var(--line); }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 24px; font-family: var(--f-mono); }
.pager a, .pager span { border: 1px solid var(--line); padding: 4px 10px; text-decoration: none; background: var(--card); }
.pager span[aria-current] { background: var(--inv-bg); color: var(--inv-fg); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .masthead .wrap { grid-template-columns: 1fr auto; }
  .masthead .search { grid-column: 1 / -1; grid-row: 2; }
  .intro, .two-col, .listing, .search-layout { grid-template-columns: 1fr; }
  .news-forum { gap: 0; }
  .classifieds { columns: 1; }
  .listing .gallery, .listing aside, .listing .l-desc { grid-column: 1; grid-row: auto; }
  .listing aside { margin-top: 24px; }
  .filters:not([open]) fieldset, .filters:not([open]) .apply { display: none; }
}
@media (max-width: 560px) {
  .strip .wrap { align-items: center; }
  .strip .long { display: none; }
  .nav { gap: 10px; }
  .nav .btn { padding: 8px 12px; font-size: 1.05rem; }
  .strip .hide-sm, .nav .hide-sm { display: none; }
  .logo { font-size: 1.9rem; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card-body { padding: 10px 8px 12px; }
  .card-title { font-size: 0.95rem; }
  .sticker { font-size: 1.1rem; right: -4px; }
  .card-meta { flex-direction: column; gap: 0; }
  .row { grid-template-columns: 96px 1fr; }
  .row .price { grid-column: 2; justify-self: start; font-size: 1.3rem; }
  .l-head { padding-right: 0; }
  .l-head .sticker { position: static; display: inline-block; margin-bottom: 8px; }
  .thumbs { grid-template-columns: repeat(5, 1fr); gap: 4px; }
}

/* Photos sit on top of the striped placeholder; if an image is missing the
   placeholder shows through. */
.ph img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; background: var(--card);
}
/* The main listing photo is shown whole: buyers need to see the entire item. */
.gallery > .ph img { object-fit: contain; }

/* ---------- Create listing ---------- */
.page-head { padding-block: 28px 8px; border-bottom: 3px solid var(--line); margin-bottom: 24px; }
.page-head h1 {
  font-family: var(--f-display); font-weight: 900; text-transform: uppercase;
  font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 0.95;
}
.page-head p { margin: 8px 0 0; max-width: 60ch; }

.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 0 40px; align-items: start; }
.form-layout .listing-form { grid-column: 1; grid-row: 1; }
.form-layout .preview-col { grid-column: 2; grid-row: 1 / span 2; }
.form-layout .submit-row { grid-column: 1; grid-row: 2; }

.step { border: 2px solid var(--line); background: var(--card); margin-bottom: 20px; }
.step > h2 {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--f-display); font-weight: 900; text-transform: uppercase; font-size: 1.45rem;
  line-height: 1; padding: 10px 16px 8px; border-bottom: 1px solid var(--rule);
}
.step .num {
  font-family: var(--f-mono); font-size: 0.85rem; font-weight: 600;
  background: var(--inv-bg); color: var(--inv-fg); padding: 4px 6px;
}
.step > .field { padding: 16px; }
.step > .field + .field { border-top: 1px dashed var(--rule); }

.field { border: 0; margin: 0; min-width: 0; }
.field > label, .field > legend {
  display: block; font-weight: 700; margin-bottom: 8px; padding: 0;
}
/* Float the legend so it sits inside the fieldset instead of on its border. */
.field > legend { float: left; width: 100%; }
.field > legend + * { clear: left; }
.field.sub { margin-top: 14px; }
.req, .opt {
  font-family: var(--f-mono); font-size: 0.7rem; font-weight: 400; text-transform: uppercase;
  letter-spacing: 0.04em; margin-left: 6px; color: var(--ink-2);
}
.req { color: var(--red); }
.hint { font-size: 0.88rem; color: var(--ink-2); margin: 8px 0 0; max-width: 62ch; }
.hint b { color: var(--ink); }

.listing-form input[type="text"], .listing-form select, .listing-form textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper);
  border: 2px solid var(--line); padding: 10px 12px; border-radius: 0;
}
.listing-form textarea { resize: vertical; min-height: 140px; }
.listing-form input:focus, .listing-form select:focus, .listing-form textarea:focus {
  outline: 3px solid var(--yellow); outline-offset: 0;
}
.listing-form input[type="text"]:focus-visible, .listing-form textarea:focus-visible,
.listing-form select:focus-visible { background-color: var(--paper); color: var(--ink); }

/* Choice buttons: real radios/checkboxes, styled like label tags */
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice > span {
  display: flex; flex-direction: column; gap: 1px; min-height: 44px; justify-content: center;
  border: 2px solid var(--line); background: var(--paper); padding: 6px 12px;
}
.choice b { font-weight: 700; font-size: 0.95rem; }
.choice small { font-size: 0.75rem; color: var(--ink-2); line-height: 1.25; }
.choice:hover > span { border-color: var(--ink); }
.choice input:checked + span { background: var(--inv-bg); color: var(--inv-fg); border-color: var(--inv-bg); }
.choice input:checked + span small { color: var(--inv-fg); opacity: 0.8; }
.choice input[type="checkbox"]:checked + span b::before { content: "✔ "; }
.choice input:focus-visible + span { outline: 3px solid var(--yellow); outline-offset: 2px; }
.scale .choice { flex: 1 1 150px; }
.authenticity .choice input:checked[value="repro"] + span { background: var(--red-bg); border-color: var(--red-bg); color: var(--on-red); }

/* Photos */
.field > label.dropzone {
  position: relative; display: grid; gap: 4px; place-items: center; text-align: center;
  padding: 28px 16px; border: 2px dashed var(--line); background: var(--paper); cursor: pointer;
}
.dropzone b { font-family: var(--f-display); font-weight: 900; text-transform: uppercase; font-size: 1.3rem; }
.dropzone small { color: var(--ink-2); font-size: 0.8rem; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone:hover, .dropzone:focus-within { border-style: solid; background: var(--paper-2); }
.dropzone:focus-within { outline: 3px solid var(--yellow); }
.photo-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.photo-list:empty { display: none; }
.photo-list li { position: relative; border: 1px solid var(--line); aspect-ratio: 1; background: var(--paper-2); }
.photo-list img { width: 100%; height: 100%; object-fit: cover; }
.photo-list button {
  position: absolute; top: 4px; right: 4px; font: inherit; font-size: 0.72rem; font-family: var(--f-mono);
  background: var(--card); color: var(--ink); border: 1px solid var(--line); padding: 1px 5px; cursor: pointer;
}
.photo-list .main-badge {
  position: absolute; left: 0; bottom: 0; font-family: var(--f-mono); font-size: 0.65rem; text-transform: uppercase;
  background: var(--yellow); color: var(--on-yellow); padding: 1px 5px;
}
.photo-tips { margin-top: 14px; font-size: 0.9rem; }
.photo-tips p { margin: 0 0 4px; }
.photo-tips ul { margin: 0 0 10px; padding-left: 20px; color: var(--ink-2); }
.privacy { border-left: 4px solid var(--green); padding-left: 10px; color: var(--ink-2); }

/* Price + place */
.price-input { display: flex; align-items: stretch; max-width: 220px; }
.price-input input { font-family: var(--f-display) !important; font-weight: 900; font-size: 1.6rem !important; padding-block: 4px !important; }
.price-input span {
  display: grid; place-items: center; padding: 0 12px; border: 2px solid var(--line); border-left: 0;
  font-family: var(--f-display); font-weight: 900; font-size: 1.2rem; background: var(--yellow); color: var(--on-yellow);
}
.price-hint { margin-top: 12px; border: 1px dashed var(--rule); padding: 10px 12px; font-size: 0.88rem; display: flex; gap: 10px; align-items: flex-start; }
.price-hint p { margin: 0; color: var(--ink-2); }
.soon {
  flex: none; font-family: var(--f-mono); font-size: 0.65rem; text-transform: uppercase; font-weight: 600;
  border: 1px solid var(--ink-2); color: var(--ink-2); padding: 1px 5px; margin-top: 2px;
}
.zip-row { display: flex; gap: 12px; align-items: center; }
.zip-row input { max-width: 110px; font-family: var(--f-mono) !important; }

.submit-row { display: grid; gap: 12px; padding: 8px 0 0; }
.submit-row .buttons { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.form-status { margin: 0; font-weight: 700; }
.form-status:empty { display: none; }
.form-status.error { color: var(--red); }
.form-status.ok { color: var(--green); }

/* Preview column */
.preview-sticky { position: sticky; top: 16px; display: grid; gap: 20px; }
.preview-label { font-family: var(--f-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); margin: 0 0 8px; }
.preview-card { max-width: 320px; }
.preview-card .ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-type { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--red); font-weight: 600; }
.tag.repro { background: var(--red-bg); border-color: var(--red-bg); color: var(--on-red); }
.checklist ul { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); background: var(--card); }
.checklist li { padding: 6px 10px 6px 34px; position: relative; font-size: 0.92rem; border-top: 1px dashed var(--rule); color: var(--ink-2); }
.checklist li:first-child { border-top: 0; }
.checklist li::before {
  content: ""; position: absolute; left: 10px; top: 50%; width: 14px; height: 14px; transform: translateY(-50%);
  border: 2px solid var(--line);
}
.checklist li.done { color: var(--ink); }
.checklist li.done::before { background: var(--green-bg); border-color: var(--green-bg); }
.checklist li.done::after { content: "✔"; position: absolute; left: 12px; top: 50%; transform: translateY(-52%); font-size: 0.7rem; color: #fff; }

@media (max-width: 900px) {
  .form-layout { grid-template-columns: 1fr; }
  .form-layout .listing-form, .form-layout .preview-col, .form-layout .submit-row { grid-column: 1; grid-row: auto; }
  .form-layout .preview-col { margin-bottom: 16px; }
  .preview-sticky { position: static; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
}
@media (max-width: 560px) {
  .preview-sticky { grid-template-columns: 1fr; }
  .preview-col .checklist { display: none; }
  .step > .field { padding: 14px 12px; }
  .scale .choice { flex-basis: 100%; }
  .submit-row .buttons .btn { flex: 1; }
}

/* ---------- Header count badge ---------- */
.nav .count {
  display: inline-block; min-width: 20px; text-align: center; font-family: var(--f-mono); font-size: 0.72rem;
  background: var(--red-bg); color: var(--on-red); padding: 1px 5px; margin-left: 2px; vertical-align: 2px;
}

/* ---------- Profile ---------- */
.profile-head {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start;
  border-bottom: 3px solid var(--line); padding-bottom: 24px;
}
/* The membership card: a club card from the magazine days. Square corners,
   a hard offset shadow, faint diagonal print lines. */
.member-card {
  border: 3px solid var(--line); box-shadow: 5px 5px 0 var(--line);
  background: repeating-linear-gradient(135deg, var(--stripe) 0 2px, transparent 2px 9px), var(--card);
}
.member-card-strip {
  display: flex; justify-content: space-between; gap: 12px; margin: 0; padding: 5px 14px;
  background: var(--inv-bg); color: var(--inv-fg); font-family: var(--f-mono); font-size: 0.74rem;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.member-card-strip span:last-child { background: var(--yellow); color: var(--on-yellow); font-weight: 700; padding: 0 6px; }
.member-card-body { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; padding: 18px; }
.member-card-facts { font-size: 0.8rem; color: var(--ink-2); }
.member-card-stamps { margin: 0; padding: 10px 18px 14px; border-top: 1px dashed var(--rule); }
.avatar-lg { width: 96px; height: 96px; font-size: 3.2rem; border-width: 3px; }
.profile-id h1 {
  font-family: var(--f-display); font-weight: 900; text-transform: uppercase;
  font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 0.95;
}
.profile-id > p { margin: 6px 0 0; }
.badges { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.badges li {
  font-family: var(--f-mono); font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
  border: 1px solid var(--line); padding: 2px 8px;
}
.badges li.ok { border-color: var(--green); color: var(--green); }
.badges li.ok::before { content: "✔ "; }
.badges li.trade { border-color: var(--red); color: var(--red); }
.bio { max-width: 60ch; margin-top: 14px !important; }
.profile-side { display: grid; gap: 12px; border: 1px solid var(--line); background: var(--card); padding: 16px; }

.subnav {
  display: flex; gap: 4px; flex-wrap: wrap; margin-top: 24px; position: sticky; top: 0; z-index: 2;
  background: var(--paper); padding-block: 8px; border-bottom: 1px solid var(--rule);
}
.subnav a {
  font-family: var(--f-display); font-weight: 700; text-transform: uppercase; font-size: 1.05rem; letter-spacing: 0.03em;
  text-decoration: none; padding: 6px 12px; border: 1px solid transparent;
}
.subnav a:hover { border-color: var(--line); color: var(--ink); }
.subnav a span { font-family: var(--f-mono); font-size: 0.75rem; color: var(--ink-2); margin-left: 4px; }
.section[id] { scroll-margin-top: 64px; }

.wishlist { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); background: var(--card); }
.wishlist li { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: space-between; padding: 10px 12px; border-top: 1px dashed var(--rule); }
.wishlist li:first-child { border-top: 0; }

.stars { color: var(--yellow); letter-spacing: 2px; font-size: 1.05rem; -webkit-text-stroke: 0.5px var(--on-yellow); }
.stars .off { color: var(--rule); -webkit-text-stroke: 0; }
.rating-summary { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; }
.rating-summary .big { font-family: var(--f-display); font-weight: 900; font-size: 3.2rem; line-height: 1; }
.rating-summary p { margin: 2px 0 0; font-size: 0.88rem; }
.reviews { list-style: none; margin: 0; padding: 0; }
.reviews li { border-top: 1px solid var(--rule); padding: 12px 0; }
.review-top { display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; }
.reviews p { margin: 6px 0 0; }
.reviews .by { font-size: 0.85rem; color: var(--ink-2); }
.reviews .reply { font-size: 0.9rem; border-left: 4px solid var(--rule); padding-left: 10px; color: var(--ink-2); }
.reviews .reply b { color: var(--ink); }

.card.sold .ph img { filter: grayscale(0.85); opacity: 0.75; }
.stamp {
  position: absolute; top: 34%; left: 50%; z-index: 1; transform: translate(-50%, -50%) rotate(-12deg);
  font-family: var(--f-display); font-weight: 900; font-size: 2rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--red); border: 4px solid var(--red); padding: 2px 14px 0; background: var(--card); opacity: 0.92;
}

/* ---------- Inbox ---------- */
.inbox {
  display: grid; grid-template-columns: 340px minmax(0, 1fr); border: 2px solid var(--line); background: var(--card);
  min-height: 640px;
}
.inbox-list { border-right: 2px solid var(--line); }
.inbox-filter { display: flex; border-bottom: 1px solid var(--line); }
.inbox-filter a {
  flex: 1; text-align: center; padding: 8px 4px; text-decoration: none; font-family: var(--f-mono); font-size: 0.78rem;
  text-transform: uppercase; border-right: 1px solid var(--rule);
}
.inbox-filter a:last-child { border-right: 0; }
.inbox-filter a[aria-current] { background: var(--inv-bg); color: var(--inv-fg); }
.inbox-list ul { list-style: none; margin: 0; padding: 0; }
.convo a {
  display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; padding: 12px; text-decoration: none;
  border-bottom: 1px solid var(--rule); position: relative;
}
.convo a:hover { background: var(--paper); color: var(--ink); }
.convo.active a { background: var(--paper-2); box-shadow: inset 5px 0 0 var(--red-bg); }
.convo.unread a::after {
  content: ""; position: absolute; top: 14px; right: 12px; width: 9px; height: 9px; background: var(--red-bg);
}
.convo.unread .c-top b { font-weight: 700; }
.convo .c-top .mono { margin-right: 16px; }
.thumb { display: block; aspect-ratio: 1; border: 1px solid var(--line); background: var(--paper-2); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.c-body { display: grid; gap: 1px; min-width: 0; }
.c-top { display: flex; justify-content: space-between; gap: 8px; font-size: 0.95rem; }
.c-top b { font-weight: 400; }
.c-top .mono { font-size: 0.72rem; color: var(--ink-2); padding-top: 3px; }
.c-item { font-family: var(--f-mono); font-size: 0.72rem; text-transform: uppercase; color: var(--red); }
.c-last { font-size: 0.88rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo.done .c-item { color: var(--green); }

.thread { display: flex; flex-direction: column; min-width: 0; }
.thread-head {
  display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 2px solid var(--line);
}
.thread-head .back { display: none; font-family: var(--f-mono); font-size: 0.85rem; width: 100%; }
.thread-listing { display: flex; gap: 12px; align-items: center; }
.thread-listing .thumb { width: 56px; }
.thread-listing h2 { font-family: var(--f-display); font-weight: 900; text-transform: uppercase; font-size: 1.5rem; line-height: 1; }
.thread-listing h2 a { text-decoration: none; }
.thread-listing p { margin: 4px 0 0; font-size: 0.78rem; }
.status-active { color: var(--green); font-weight: 600; }
.thread-with { display: grid; text-align: right; font-size: 0.95rem; }
.thread-with .mono { font-size: 0.75rem; }

.messages { list-style: none; margin: 0; padding: 16px; display: flex; flex-direction: column; gap: 12px; flex: 1; background: var(--paper); }
.msg { max-width: 72%; border: 1px solid var(--line); background: var(--card); padding: 8px 12px; }
.msg p { margin: 0; }
.msg p + p { margin-top: 4px; }
.msg .meta { font-family: var(--f-mono); font-size: 0.7rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.03em; }
.msg.me { align-self: flex-end; background: var(--inv-bg); color: var(--inv-fg); border-color: var(--inv-bg); }
.msg.me .meta { color: var(--inv-fg); opacity: 0.75; }
.msg.flagged { border-left: 6px solid var(--yellow); }
.msg .link { font-family: var(--f-mono); font-size: 0.88rem; text-decoration: underline dotted; }
.msg .flag { font-size: 0.8rem; color: var(--ink-2); border-top: 1px dashed var(--rule); padding-top: 6px; margin-top: 8px !important; }
.attachments { display: flex; gap: 6px; margin-top: 8px; }
.attachments .thumb { width: 88px; border-color: var(--inv-fg); }
.system {
  align-self: center; max-width: 560px; text-align: center; font-size: 0.85rem; color: var(--ink-2);
  border: 1px dashed var(--rule); padding: 8px 14px; background: var(--card);
}
.system p { margin: 0; }
.system b { color: var(--ink); }
.system.deal { border: 2px solid var(--green); color: var(--ink); }
.deal-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; }
.deal-actions .btn { font-size: 0.95rem; padding: 6px 12px; }

/* Advice above the messages: one plain line, not a box among them. */
.thread-note { margin: 0; padding: 7px 16px; border-bottom: 1px dashed var(--rule); font-size: 0.82rem; line-height: 1.45; color: var(--ink-2); }
.thread-note a { color: inherit; white-space: nowrap; }
.thread-note.is-new { border-left: 6px solid var(--red); padding-left: 10px; color: var(--ink); }
.composer { border-top: 2px solid var(--line); padding: 12px 16px 0; display: grid; gap: 8px; }
.composer textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper); border: 2px solid var(--line);
  padding: 10px 12px; resize: vertical; border-radius: 0;
}
.composer textarea:focus { outline: 3px solid var(--yellow); outline-offset: 0; }
.composer textarea:focus-visible { background-color: var(--paper); color: var(--ink); }
/* Below the text box: what the member can do with the deal to the left, Send to the right. */
.composer-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 16px 0; }
.composer-row .btn { font-size: 0.95rem; padding: 7px 12px; }
.composer-row .btn-red { font-size: 1rem; padding: 8px 14px; margin-left: auto; }
.composer-why { margin: 0; padding: 6px 16px 0; font-size: 0.8rem; color: var(--ink-2); max-width: 70ch; }
.composer-why a { color: inherit; }
.thread-foot { padding: 8px 16px 12px; font-size: 0.8rem; color: var(--ink-2); font-family: var(--f-mono); }
.thread-foot a { color: var(--ink-2); }

@media (max-width: 900px) {
  .profile-head { grid-template-columns: minmax(0, 1fr); }
  .inbox { grid-template-columns: 1fr; min-height: 0; }
  .inbox-list { display: none; border-right: 0; }
  .inbox-list:target { display: block; }
  .inbox-list:target + .thread { display: none; }
  .thread-head .back { display: block; }
  .msg { max-width: 88%; }
}
@media (max-width: 560px) {
  .profile-head { gap: 18px; }
  .member-card-body { gap: 14px; padding: 14px; }
  .member-card-stamps { padding-inline: 14px; }
  .avatar-lg { width: 72px; height: 72px; font-size: 2.4rem; }
  .thread-with { text-align: left; }
  .stamp { font-size: 1.4rem; }
}
.logo { white-space: nowrap; }
@media (max-width: 400px) {
  .logo { font-size: 1.6rem; }
  .nav .btn { padding: 8px 10px; }
}

/* ---------- Django views (replace prototype inline styles; CSP forbids them) ---------- */
.seller-sub { font-size: 0.9rem; }
.filters .spaced { margin-top: 8px; }
.sort-links { display: flex; flex-wrap: wrap; gap: 4px; font-family: var(--f-mono); font-size: 0.8rem; }
.sort-links a, .sort-links span { padding: 4px 8px; border: 1px solid var(--line); text-decoration: none; background: var(--card); }
.sort-links span[aria-current] { background: var(--inv-bg); color: var(--inv-fg); border-color: var(--inv-bg); }
a.chip { text-decoration: none; padding: 2px 8px; }
a.chip:hover { background: var(--inv-bg); color: var(--inv-fg); }
.empty { color: var(--ink-2); font-style: italic; }
.empty-state { border: 2px dashed var(--rule); padding: 32px 16px; text-align: center; margin-top: 16px; }
.row .price.trade-only { background: var(--card); color: var(--red); border-color: var(--red); }
.thumbs a.ph { display: block; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn[disabled]:hover { background: var(--red-bg); color: var(--on-red); border-color: var(--red-bg); }
.threads li > span { grid-column: 1 / -1; }
.classifieds h3 a { text-decoration: none; }
.classifieds h3 a:hover { text-decoration: underline; }

.spec .auth-original { color: var(--green); }
.spec .auth-original::before { content: "✔ "; }
.spec .auth-repro { color: var(--red); }
.spec .auth-unsure { color: var(--ink-2); }

.status-banner {
  font-family: var(--f-display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  font-size: 1.15rem; padding: 8px 14px; margin: 0 0 16px; border: 2px solid var(--line); background: var(--card);
}
.status-banner.status-sold, .status-banner.status-traded { border-color: var(--red); color: var(--red); }
.status-banner.status-reserved { background: var(--yellow); color: var(--on-yellow); border-color: var(--on-yellow); }
.filters summary .n-active { font-family: var(--f-mono); font-size: 0.8rem; font-weight: 400; text-transform: none; }

/* ---------- Flash notices ("Profilen er lagret") ---------- */
.flash { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 6px; }
.flash li { border: 2px solid var(--line); background: var(--card); padding: 8px 14px; font-weight: 700; }
.flash .msg-success { border-color: var(--green); color: var(--green); }
.flash .msg-error, .flash .msg-warning { border-color: var(--red); color: var(--red); }

/* ---------- Login, signup and account pages ---------- */
.auth-page { max-width: 520px; margin: 32px auto 0; }
.page-title {
  font-family: var(--f-display); font-weight: 900; text-transform: uppercase;
  font-size: clamp(2rem, 5vw, 2.8rem); line-height: 0.95; margin: 0 0 12px;
}
.sub-title { font-family: var(--f-display); font-weight: 900; text-transform: uppercase; font-size: 1.4rem; margin: 24px 0 8px; }
.auth-page p, .account-main > p { max-width: 60ch; }
.auth-form { display: grid; gap: 14px; margin-top: 16px; border: 2px solid var(--line); background: var(--card); padding: 18px; }
.auth-form p { margin: 0; display: grid; gap: 6px; }  /* Django's as_p rendering */
.auth-form label { font-weight: 700; }
.auth-form input[type="text"], .auth-form input[type="email"], .auth-form input[type="password"],
.auth-form input[type="number"], .auth-form input[type="url"], .auth-form input[type="date"],
.auth-form input[type="time"], .auth-form select, .auth-form textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper);
  border: 2px solid var(--line); padding: 10px 12px; border-radius: 0;
}
.auth-form input:focus, .auth-form select:focus, .auth-form textarea:focus { outline: 3px solid var(--yellow); outline-offset: 0; }
.auth-form input[type="checkbox"] { accent-color: var(--ink); width: 18px; height: 18px; vertical-align: -3px; margin-right: 6px; }
.auth-form .field { display: grid; gap: 6px; }
.auth-form .field > label { margin: 0; }
.auth-form .check { font-weight: 400; }
.auth-form .helptext, .auth-form .hint { font-size: 0.85rem; color: var(--ink-2); font-weight: 400; }
.auth-form ul:not(.errorlist) { margin: 0; padding-left: 18px; font-size: 0.85rem; color: var(--ink-2); }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.form-actions:empty { display: none; }
.errorlist { list-style: none; margin: 0; padding: 0; color: var(--red); font-weight: 700; font-size: 0.9rem; }
.errorlist.nonfield { border-left: 5px solid var(--red); padding: 6px 10px; background: var(--paper); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--red) !important; }
.alert { border: 2px solid var(--line); background: var(--card); padding: 10px 14px; margin: 12px 0; }
.alert p { margin: 0; }
.alert-danger { border-color: var(--red); }
.btn-danger { background: var(--card); color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: var(--red-bg); color: var(--on-red); border-color: var(--red-bg); }
.btn-small { font-size: 0.95rem; padding: 5px 10px; }
.text-link { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
.button-group { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.button-group.vertical { flex-direction: column; }
.rule { border: 0; border-top: 1px dashed var(--rule); margin: 24px 0 12px; }
.panel { border: 1px solid var(--line); background: var(--card); padding: 12px 16px; margin: 16px 0; }

.account-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; margin-top: 32px; align-items: start; }
.account-nav ul { list-style: none; margin: 0 0 12px; padding: 0; border: 2px solid var(--line); background: var(--card); }
.account-nav li a { display: block; padding: 8px 12px; text-decoration: none; border-top: 1px dashed var(--rule); font-weight: 700; }
.account-nav li:first-child a { border-top: 0; }
.account-nav a[aria-current] { background: var(--inv-bg); color: var(--inv-fg); }
.account-main { max-width: 620px; }
.account-main .auth-form { margin-top: 12px; }

@media (max-width: 700px) {
  .account-layout { grid-template-columns: 1fr; gap: 16px; }
}
/* Django's as_p puts a checkbox after its label; show them on one line, box first. */
.auth-form p:has(> input[type="checkbox"]) { display: flex; flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 8px; }

/* The hidden attribute must always win over layout rules (used by form JS). */
[hidden] { display: none !important; }

/* ---------- Listing form (Django) ---------- */
.listing-form .errorlist { margin-top: 6px; }
.has-error .choices .choice > span { border-color: var(--red); }
#title-hint.linked { color: var(--green); }
#title-hint.linked::before { content: "✔ Koblet til katalogen. "; font-weight: 700; }
.photo-list.existing .del {
  position: absolute; left: 0; right: 0; bottom: 0; background: var(--card); font-size: 0.75rem;
  font-family: var(--f-mono); padding: 2px 6px; display: flex; gap: 4px; align-items: center; cursor: pointer;
}
.listing-form input[type="number"] { width: 100%; font: inherit; color: var(--ink); background: var(--paper); border: 2px solid var(--line); padding: 10px 12px; }

/* ---------- My listings ---------- */
.page-head-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: end; }
.mine-rows .row { grid-template-columns: 110px 1fr; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.inline-form { display: inline; margin: 0; }
.status-tag.status-active { background: var(--green-bg); border-color: var(--green-bg); color: #fff; }
.status-tag.status-reserved { background: var(--yellow); color: var(--on-yellow); border-color: var(--on-yellow); }
.status-tag.status-draft { border-style: dashed; }
.status-tag.status-sold, .status-tag.status-traded { border-color: var(--red); color: var(--red); }

/* ---------- Messages (Django) ---------- */
.inbox-empty { padding: 16px; }
.thread-placeholder { display: grid; place-items: center; min-height: 300px; }
.msg .deleted { font-style: italic; color: var(--ink-2); }
.msg.me .deleted { color: var(--inv-fg); opacity: 0.75; }
.msg p + p { margin-top: 6px; }
.composer.closed { margin: 0; padding: 14px 16px; color: var(--ink-2); font-style: italic; border-top: 2px solid var(--line); }
.thread-foot .text-link { color: var(--ink-2); font-family: var(--f-mono); font-size: 0.8rem; }
.start-listing { margin: 8px 0 4px; border: 1px solid var(--line); background: var(--card); padding: 10px; }
.start-listing .thumb { width: 64px; }
.start-listing h2 { font-family: var(--f-display); font-weight: 900; text-transform: uppercase; font-size: 1.3rem; line-height: 1; }
.start-listing h2 a { text-decoration: none; }
.start-listing p { margin: 4px 0 0; font-size: 0.8rem; }
.messages .errorlist, .composer .errorlist { margin: 0; }

/* Phones: the inbox page shows the list; a conversation shows only the thread.
   (Replaces the prototype's :target trick now that they are separate pages.) */
@media (max-width: 900px) {
  .inbox .inbox-list { display: block; }
  .inbox .thread-placeholder { display: none; }
  .inbox.has-thread .inbox-list { display: none; }
  .inbox.has-thread .thread { display: flex; }
}

/* Header: "Legg ut" is its own grid item so it stays visible on phones,
   with the account links on their own row below the search box. */
.masthead .wrap { grid-template-columns: auto minmax(0, 1fr) auto auto; }
@media (max-width: 900px) {
  .masthead .wrap { grid-template-columns: 1fr auto auto; }
  .masthead .search { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 560px) {
  .masthead .wrap { grid-template-columns: 1fr auto; gap: 12px 16px; }
  .masthead .post-btn { grid-column: 2; grid-row: 1; }
  .masthead .nav { grid-column: 1 / -1; grid-row: 3; justify-content: flex-start; flex-wrap: wrap; gap: 4px 16px; font-size: 0.95rem; }
  .masthead .nav:empty { display: none; }
}


/* ---------- Trades and reviews ---------- */
.choices.stacked { flex-direction: column; }
.choices.stacked .choice > span { min-height: 0; }
.trade-rows .row { grid-template-columns: 110px 1fr; }
.trade-state { margin-top: 8px; display: grid; gap: 6px; }
.trade-state p { margin: 0; }
.their-review { border-left: 4px solid var(--rule); padding-left: 10px; }
.reply-form summary { cursor: pointer; font-family: var(--f-mono); font-size: 0.8rem; text-decoration: underline; }
.reply-form form { display: grid; gap: 6px; margin-top: 6px; max-width: 520px; }
.reply-form textarea { width: 100%; font: inherit; color: var(--ink); background: var(--paper); border: 2px solid var(--line); padding: 8px 10px; }
.page-head-row .row-actions { margin: 0; }
.error-summary ul { margin: 6px 0 0; padding-left: 20px; }
.error-summary a { color: var(--red); font-weight: 700; }

/* ---------- Listing gallery and full-screen viewer ---------- */
.gallery-main { display: grid; position: relative; cursor: zoom-in; }
.gallery-main img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--card); }
.zoom-hint {
  position: absolute; right: 8px; bottom: 8px; z-index: 1; font-family: var(--f-mono); font-size: 0.72rem;
  background: var(--card); border: 1px solid var(--line); padding: 2px 6px; opacity: 0; transition: opacity 0.15s;
}
.gallery-main:hover .zoom-hint, .gallery-main:focus-visible .zoom-hint { opacity: 1; }
.thumbs a.ph { cursor: pointer; }
.thumbs a.ph.active { border: 2px solid var(--ink); }

.lightbox {
  width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: transparent; color: #fff; overflow: hidden;
}
.lightbox::backdrop { background: rgba(10, 9, 7, 0.92); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox-img { max-width: calc(100vw - 32px); max-height: calc(100vh - 96px); object-fit: contain; background: #fff; }
.lightbox-count { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); margin: 0; font-size: 0.85rem; }
.lightbox button {
  position: fixed; border: 2px solid #fff; background: rgba(0, 0, 0, 0.55); color: #fff; cursor: pointer;
  font-family: var(--f-display); font-weight: 900; font-size: 2rem; line-height: 1; width: 52px; height: 52px;
}
.lightbox button:hover, .lightbox button:focus-visible { background: #fff; color: #111; outline: none; }
.lightbox-close { top: 12px; right: 12px; }
.lightbox-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 12px; top: 50%; transform: translateY(-50%); }
@media (max-width: 560px) {
  .lightbox-img { max-width: 100vw; max-height: calc(100vh - 140px); }
  .lightbox-prev, .lightbox-next { top: auto; bottom: 16px; transform: none; }
}

/* Platform and item type above card/row titles ("PLAYSTATION 2 · SPILL"). */
.card-kicker {
  font-family: var(--f-mono); font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--red); line-height: 1.3;
}
.row .card-kicker { margin-bottom: 2px; }
.report-link { margin: 6px 0 0; font-family: var(--f-mono); font-size: 0.75rem; }
.report-link a { color: var(--ink-2); }
.thread-foot a { color: var(--ink-2); }

/* ---------- Information pages (about, rules, privacy) ---------- */
.info-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 40px; align-items: start; margin-top: 8px; }
.info-nav ul { list-style: none; margin: 0; padding: 0; border: 2px solid var(--line); background: var(--card); position: sticky; top: 16px; }
.info-nav a { display: block; padding: 8px 12px; text-decoration: none; font-weight: 700; border-top: 1px dashed var(--rule); }
.info-nav li:first-child a { border-top: 0; }
.info-nav a[aria-current] { background: var(--inv-bg); color: var(--inv-fg); }
.info-page { max-width: 68ch; }
.info-page h1 { font-family: var(--f-display); font-weight: 900; text-transform: uppercase; font-size: clamp(2.2rem, 5vw, 3.2rem); line-height: 0.95; margin: 0 0 16px; }
.info-page h3 { font-size: 1.05rem; margin: 20px 0 4px; }
.info-page ol, .info-page ul { padding-left: 22px; margin: 0 0 12px; }
.info-page li { margin: 6px 0; }
.info-page code { font-family: var(--f-mono); font-size: 0.9em; background: var(--paper-2); padding: 0 4px; }
mark.todo, mark.todo-contact { background: var(--yellow); color: var(--on-yellow); padding: 0 4px; font-weight: 700; }
@media (max-width: 800px) {
  .info-layout { grid-template-columns: 1fr; gap: 16px; }
  .info-nav ul { position: static; display: flex; flex-wrap: wrap; }
  .info-nav li { flex: 1 1 50%; }
  .info-nav li a { border-top: 1px dashed var(--rule); }
}

/* Wanted listings must never look like something for sale: an outlined
   "maks" sticker instead of the yellow price sticker. */
.sticker.sticker-wanted { background: var(--card); color: var(--ink); border: 2px dashed var(--line); }
.sticker.sticker-wanted small { font-weight: 700; }
.sticker.sticker-offer { font-size: 1rem; }
.l-head .sticker.sticker-offer { font-size: 1.4rem; }
.row .price.offer { font-size: 1.1rem; }
.price-open { margin-top: 10px; }
.card-kicker.kicker-wanted { color: var(--ink-2); }

/* ---------- Forum ---------- */
.board-list { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 16px; }
/* Rows fill the width: five sections become 3 + 2 on a wide screen. */
.board-list > li { flex: 1 1 300px; }
.board-list li { border: 2px solid var(--line); background: var(--card); padding: 14px 16px; display: grid; gap: 4px; }
.board-list p { margin: 0; font-size: 0.92rem; }
.board-name { font-family: var(--f-display); font-weight: 900; text-transform: uppercase; font-size: 1.5rem; line-height: 1; text-decoration: none; }
.board-stats { font-size: 0.75rem; color: var(--ink-2); }
.thread-list { list-style: none; margin: 0; padding: 0; }
.thread-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); align-items: center; }
.thread-row.is-hidden { opacity: 0.55; }
/* Forum search */
.forum-search { max-width: 520px; margin: 0 0 20px; }
.forum-search-full { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 0 0 16px; }
.forum-search-full .search { flex: 1 1 320px; max-width: 620px; }
.forum-search-section { display: flex; gap: 8px; align-items: center; font-weight: 700; }
.forum-search-section select { font: inherit; font-weight: 400; background: var(--card); border: 2px solid var(--line); padding: 8px 10px; border-radius: 0; }
.search-snippet { margin: 4px 0 6px; font-size: 0.92rem; color: var(--ink-2); max-width: 75ch; }
.search-snippet mark { background: var(--yellow); color: var(--on-yellow); padding: 0 2px; }
.thread-title { font-weight: 700; font-size: 1.05rem; text-decoration: none; }
.thread-title:hover { text-decoration: underline; }
.thread-flags { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: 2px; }
.thread-flags .tag { font-size: 0.65rem; }
.thread-meta { font-size: 0.85rem; color: var(--ink-2); margin-top: 2px; }
.thread-stats { text-align: right; font-family: var(--f-mono); font-size: 0.78rem; white-space: nowrap; }
.thread-stats b { font-family: var(--f-display); font-size: 1.3rem; }
.thread-list.compact .thread-stats { display: none; }
.thread-heading { font-size: clamp(1.8rem, 4vw, 2.6rem) !important; }
.post-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 14px; }
.post { border: 1px solid var(--line); background: var(--card); padding: 12px 16px; scroll-margin-top: 16px; }
.post.by-op { border-left: 5px solid var(--red-bg); }
.post.is-hidden { opacity: 0.6; border-style: dashed; }
.post-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; border-bottom: 1px dashed var(--rule); padding-bottom: 6px; margin-bottom: 8px; }
.post-author { font-weight: 700; }
.post-author .op { font-family: var(--f-mono); font-size: 0.7rem; font-weight: 400; color: var(--red); text-transform: uppercase; margin-left: 8px; }
.post-date { font-size: 0.75rem; color: var(--ink-2); text-decoration: none; }
.post-body { max-width: 75ch; overflow-wrap: anywhere; margin-bottom: 10px; }
/* Posts look like the text box they were written in: each empty line is one
   line (1.5em, the body line-height) of space; see forum_text. */
.post-body p { margin: 0; }
.post-body .quote { margin: 0; border-left: 4px solid var(--rule); padding: 4px 12px; color: var(--ink-2); background: var(--paper); }
.post-body .quote p { margin: 0; }
/* After .quote, so the gaps win over its margin: 0. */
.post-body .gap-1 { margin-top: 1.5em; }
.post-body .gap-2 { margin-top: 3em; }
.post-body .gap-3 { margin-top: 4.5em; }
.post-body .gap-4 { margin-top: 6em; }
.post-body .gap-5 { margin-top: 7.5em; }
.post-photos { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.post-photos img { width: 160px; height: 120px; object-fit: cover; border: 1px solid var(--line); background: var(--paper-2); }
.post-actions { display: flex; gap: 14px; font-family: var(--f-mono); font-size: 0.75rem; }
.post-actions a { color: var(--ink-2); }
/* "2 nye svar – vis": a yellow strip, like a price sticker, that stays at the
   bottom of the screen while you read further up the thread. */
.new-replies { position: sticky; bottom: 12px; z-index: 5; margin: 12px 0 0; }
.new-replies-button {
  display: block; width: 100%; cursor: pointer;
  background: var(--yellow); color: var(--on-yellow); border: 2px solid var(--on-yellow);
  font-family: var(--f-display); font-weight: 700; font-size: 1.25rem;
  text-transform: uppercase; letter-spacing: 0.05em; padding: 10px 16px;
  box-shadow: 4px 4px 0 var(--on-yellow);
}
.new-replies-button::after { content: " ↓" / ""; }  /* decoration, not read aloud */
.new-replies-button:hover { background: var(--inv-bg); color: var(--inv-fg); }
.new-replies-button:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.new-replies-button:disabled { opacity: 0.7; cursor: progress; }
.thread-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.reply-form-box { max-width: 760px; }
.forum-hint { font-size: 0.88rem; margin: 10px 0 0; }
@media (max-width: 560px) {
  .thread-row { grid-template-columns: 1fr; }
  .thread-stats { text-align: left; }
  .post-photos img { width: calc(50% - 4px); height: 110px; }
}

/* ---------- Forum sections: colour + pixel icon per section ---------- */
/* Light-mode colours keep at least 3:1 against the card (icons, stripes). */
:root { --c-prat: #5b4b9e; --c-verkstedet: #b8281b; --c-verdt: #8f6c00; --c-funn: #2d6a3a; --c-guider: #1d5f8a; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --c-prat: #a597ea; --c-verkstedet: #ec6a55; --c-verdt: #f2bf1a; --c-funn: #7cc68a; --c-guider: #6fb3e0; }
}
:root[data-theme="dark"] { --c-prat: #a597ea; --c-verkstedet: #ec6a55; --c-verdt: #f2bf1a; --c-funn: #7cc68a; --c-guider: #6fb3e0; }
.board-prat { --c: var(--c-prat); }
.board-verkstedet { --c: var(--c-verkstedet); }
.board-hva-er-det-verdt { --c: var(--c-verdt); }
.board-funn-og-samlinger { --c: var(--c-funn); }
.board-guider { --c: var(--c-guider); }

.board-list li.board-card { border-left: 8px solid var(--c, var(--line)); grid-template-columns: 44px 1fr; column-gap: 14px; align-items: start; align-content: start; }
.board-list li.board-card > * { grid-column: 2; }
.board-icon {
  grid-column: 1 !important; grid-row: 1 / span 4; width: 44px; height: 44px; display: grid; place-items: center;
  background: var(--paper); border: 2px solid var(--c, var(--line)); color: var(--c, var(--ink));
}
.forum-icon { width: 32px; height: 32px; display: block; }
.board-latest { font-size: 0.85rem; border-top: 1px dashed var(--rule); padding-top: 6px; margin-top: 4px !important; }
.board-latest a { font-weight: 700; text-decoration: none; }
.board-latest a:hover { text-decoration: underline; }
.board-heading { display: flex; gap: 14px; align-items: center; }
.board-heading .board-icon { flex: none; }

.pill {
  display: inline-flex; align-items: center; gap: 5px; font-family: var(--f-mono); font-size: 0.68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.03em; color: var(--c, var(--ink)); border: 1px solid var(--c, var(--line));
  padding: 1px 6px 1px 4px; text-decoration: none; line-height: 1.5;
}
.pill:hover { background: var(--c); color: var(--paper); }
.pill .forum-icon { width: 12px; height: 12px; }
.thread-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.thread-flags { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.post-photos a { cursor: zoom-in; display: block; }
.post-photos a:hover img { box-shadow: 0 0 0 2px var(--ink); }

/* ---------- Profile pictures ---------- */
.avatar.has-image { padding: 0; overflow: hidden; background: var(--paper-2); }
.avatar.has-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-sm { width: 28px; height: 28px; font-size: 1rem; border-width: 1px; vertical-align: middle; margin-right: 6px; display: inline-grid; }
.avatar-settings { margin: 16px 0 8px; }
.avatar-row { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.avatar-row > div { flex: 1; min-width: 240px; display: grid; gap: 8px; }
.avatar-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.avatar-form label { font-weight: 700; width: 100%; }
.post-author { display: inline-flex; align-items: center; gap: 0; flex-wrap: wrap; }

/* Listing cards: every line stays on one line (long text ends in "…"), so the
   cards in a row line up. The full title is in the title attribute. */
.card-body { min-width: 0; }
.card-kicker, .card-title, .card-meta span {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
/* Tags that don't fit wrap onto a hidden second row, so none is cut in half. */
.card .tags { overflow: hidden; height: calc(0.72rem * 1.4 + 4px); }
.card .tag { line-height: 1.4; }
.grid > .card { min-width: 0; }

/* "Nye annonser" on the front page: a single row. Cards that don't fit end up
   in zero-height rows below and are clipped away ("Se alle" shows the rest).
   Only the vertical axis is clipped, so the price stickers can still stick out
   on the right. */
.grid-one-row { grid-template-rows: auto; grid-auto-rows: 0; row-gap: 0; overflow-x: visible; overflow-y: clip; }
/* Phones: a sideways-scrolling strip instead, so there's more than two to see. */
@media (max-width: 560px) {
  .grid-one-row {
    grid-auto-flow: column; grid-auto-columns: 44%; grid-auto-rows: auto; grid-template-columns: none; grid-template-rows: auto;
    overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory;
    scrollbar-width: thin; scrollbar-color: var(--rule) transparent;
    padding: 0 8px 8px 0; margin-right: -16px; padding-right: 16px;
  }
  .grid-one-row > .card { scroll-snap-align: start; }
}

/* ---------- Moderator tools (only moderators see these) ----------
   Dashed yellow frame, like a sticky note on the page: clearly not part of
   what ordinary visitors see. */
.mod-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
  border: 2px dashed var(--yellow); background: var(--card); padding: 10px 12px; margin: 0 0 20px;
}
.mod-label {
  font-family: var(--f-mono); font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  background: var(--yellow); color: var(--on-yellow); padding: 2px 6px;
}
.mod-box { display: block; margin-top: 16px; }
.mod-box .mod-label { display: inline-block; margin-bottom: 8px; }
.mod-box p { margin: 0 0 8px; font-size: 0.9rem; }
.mod-details > summary { cursor: pointer; font-weight: 600; font-size: 0.95rem; }
.mod-details[open] { flex-basis: 100%; }
.mod-details form { display: flex; flex-wrap: wrap; align-items: end; gap: 6px 8px; margin-top: 8px; }
.mod-details label { flex-basis: 100%; font-size: 0.85rem; color: var(--ink-2); }
.mod-details input[type="text"], .mod-details select {
  flex: 1 1 220px; min-width: 0; font: inherit; padding: 5px 8px;
  border: 2px solid var(--line); background: var(--paper); color: var(--ink);
}
.mod-inline { display: inline-block; }
.mod-inline[open] { display: block; margin-top: 6px; }
.mod-inline > summary { font-weight: 400; color: var(--ink-2); text-decoration: underline; }
.link-button {
  background: none; border: 0; padding: 0; font: inherit; color: var(--ink-2); text-decoration: underline; cursor: pointer;
}
.mod-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 16px; margin: 0 0 8px; }
.mod-facts dt { font-family: var(--f-mono); font-size: 0.72rem; text-transform: uppercase; color: var(--ink-2); }
.mod-facts dd { margin: 0; font-weight: 700; }
.post-actions { flex-wrap: wrap; align-items: baseline; }
.post-actions .mod-inline[open] { flex-basis: 100%; }
.post-actions .mod-details form { font-family: var(--f-body); font-size: 0.95rem; }

/* Two-step login setup */
.steps { padding-left: 1.3em; margin: 0 0 8px; }
.steps > li { margin-bottom: 18px; }
.steps > li::marker { font-family: var(--f-display); font-weight: 900; font-size: 1.2rem; }
.qr-code { background: #fff; border: 2px solid var(--line); width: 200px; padding: 10px; margin: 8px 0 12px; }
.qr-code svg { display: block; width: 100%; height: auto; }
.secret {
  font-family: var(--f-mono); font-size: 0.95rem; letter-spacing: 0.08em; word-break: break-all;
  background: var(--paper-2); padding: 4px 8px; display: inline-block;
}
.recovery-codes { columns: 2; padding-left: 2.2em; font-family: var(--f-mono); font-size: 1.05rem; letter-spacing: 0.06em; }

/* "Gjelder" on forum threads: which console and game */
.catalog-link { border: 1px dashed var(--rule); padding: 12px 14px 4px; margin: 0 0 18px; }
.catalog-link legend { font-weight: 700; padding: 0 6px; }
.catalog-link > .hint { margin-top: 0; }
.catalog-link [data-title-hint].linked { color: var(--green); }
.catalog-link [data-title-hint].linked::before { content: "✔ Koblet til katalogen. "; font-weight: 700; }
.thread-about { margin: 10px 0 0; font-size: 0.95rem; }
.thread-about a { font-weight: 700; }
.thread-row .thread-about { margin: 2px 0 0; font-family: var(--f-mono); font-size: 0.75rem; color: var(--ink-2); }
.forum-threads { margin: 14px 0 0; padding: 0; list-style: none; font-size: 0.92rem; }
.forum-threads li { padding: 5px 0; border-top: 1px dashed var(--rule); }

/* Error pages */
.error-page .error-code {
  display: inline-block; background: var(--inv-bg); color: var(--inv-fg);
  font-size: 0.85rem; letter-spacing: 0.1em; padding: 2px 8px; margin: 0 0 6px;
}

/* Game page (one catalogue title) */
.game-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 24px 32px; align-items: start; padding-top: 20px; }
.game-head .page-title { margin: 4px 0 6px; }
.game-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.price-box { border: 2px solid var(--line); background: var(--card); padding: 14px 16px; }
.price-box .sub-title { margin-top: 0; }
.price-table { width: 100%; border-collapse: collapse; margin: 4px 0 8px; }
.price-table th, .price-table td { text-align: left; padding: 8px 6px; border-top: 1px dashed var(--rule); vertical-align: top; }
.price-table thead th { font-family: var(--f-mono); font-size: 0.72rem; text-transform: uppercase; color: var(--ink-2); border-top: 0; }
.price-table td b { font-family: var(--f-display); font-size: 1.6rem; line-height: 1; }
.price-table td .muted { font-size: 0.85rem; }
@media (max-width: 800px) { .game-head { grid-template-columns: 1fr; } }
.catalog-hits { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; margin: 0 0 14px; font-size: 0.95rem; }
.catalog-hits .mono { font-size: 0.75rem; text-transform: uppercase; color: var(--ink-2); }
.catalog-hits a { font-weight: 700; }
.catalog-hits a .muted { font-weight: 400; }
.game-link {
  display: flex; flex-direction: column; gap: 2px; margin: 14px 0 0; padding: 12px 14px;
  border: 2px solid var(--line); border-left: 6px solid var(--red-bg); background: var(--card);
  color: var(--ink); text-decoration: none;
}
.game-link .card-kicker { margin: 0; }
.game-link b { font-size: 1.05rem; text-decoration: underline; text-underline-offset: 3px; }
.game-link span:last-child { font-size: 0.92rem; color: var(--ink-2); }
.game-link:hover { background: var(--inv-bg); color: var(--inv-fg); }
.game-link:hover span:last-child, .game-link:hover .card-kicker { color: var(--inv-fg); }

/* Alerts */
.alert-list { list-style: none; margin: 0 0 8px; padding: 0; }
.alert-list li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 8px 0; border-top: 1px dashed var(--rule); }
.alert-list li.is-off > a { opacity: 0.6; }
.alert-list .alert-actions { margin-left: auto; display: flex; gap: 12px; font-size: 0.9rem; }

/* Events calendar */
.event-list { list-style: none; margin: 0; padding: 0; }
.event-row { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 14px; align-items: start; padding: 12px 0; border-top: 1px dashed var(--rule); }
.event-row:first-child { border-top: 0; }
.event-date {
  display: flex; flex-direction: column; align-items: center; align-self: start; text-decoration: none; color: var(--ink);
  border: 2px solid var(--line); background: var(--card); padding: 4px 0 0; line-height: 1;
}
.event-date b { font-family: var(--f-display); font-weight: 900; font-size: 1.7rem; }
.event-date span { font-family: var(--f-mono); font-size: 0.7rem; text-transform: uppercase; background: var(--red-bg); color: var(--on-red); width: 100%; text-align: center; margin-top: 4px; padding: 2px 0; }
.event-date.big { width: 88px; }
.event-date.big b { font-size: 2.8rem; }
.event-title { font-weight: 700; font-size: 1.1rem; }
.event-meta { margin: 2px 0 0; color: var(--ink-2); font-size: 0.92rem; }
.event-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 8px; }
.event-filter select { font: inherit; padding: 5px 8px; border: 2px solid var(--line); background: var(--card); color: var(--ink); }
.event-page { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 24px; padding-top: 16px; max-width: 820px; }
.event-facts { display: grid; gap: 6px; margin: 0 0 16px; }
.event-facts div { display: grid; grid-template-columns: 90px 1fr; gap: 8px; }
.event-facts dt { font-family: var(--f-mono); font-size: 0.75rem; text-transform: uppercase; color: var(--ink-2); padding-top: 3px; }
.event-facts dd { margin: 0; font-weight: 700; }
.event-moderate { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 8px; }
@media (max-width: 560px) { .event-page { grid-template-columns: 1fr; } .event-date.big { width: 72px; } }
.event-list-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); column-gap: 24px; }
.event-list-cols .event-row:first-child, .event-list-cols .event-row { border-top: 1px dashed var(--rule); }
.event-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.event-buttons:empty { display: none; }

/* Next event in the home page intro: one line, only when there is one */
.intro .next-event { display: flex; align-items: center; gap: 14px; max-width: none; margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--rule); font-size: 1rem; }
.next-event-link { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); min-width: 0; flex: 1; }
.next-event-link:hover b { text-decoration: underline; }
.next-event .event-date { width: 44px; flex: none; }
.next-event .event-date b { font-size: 1.3rem; }
.next-event .event-date span { font-size: 0.62rem; }
.next-event-link > span:last-child { display: grid; min-width: 0; line-height: 1.3; }
.next-label { font-family: var(--f-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--red); font-weight: 600; }
.next-event-link b, .next-when { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next-when { font-size: 0.88rem; color: var(--ink-2); }
.next-event .more { flex: none; font-family: var(--f-mono); font-size: 0.8rem; }

/* "Ønskes kjøpt" on the home page: the same cards as "Nye annonser", smaller
   and without tags, one row (a sideways strip on phones). */
.grid-sm { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.grid-sm .card-body { padding: 8px 9px 10px; gap: 4px; }
.grid-sm .card-title { font-size: 0.92rem; }
.grid-sm .card-kicker { font-size: 0.64rem; }
.grid-sm .card .tags { display: none; }
.grid-sm .card-meta { font-size: 0.78rem; padding-top: 6px; }
.grid-sm .sticker { font-size: 1rem; top: 6px; right: -4px; padding: 4px 7px 3px; }
.grid-sm .sticker small { font-size: 0.65rem; }
.grid-sm .ph span { font-size: 0.68rem; }
.section-sm .sec-head h2 { font-size: 1.5rem; }
@media (max-width: 560px) {
  .grid-sm.grid-one-row { grid-template-columns: none; grid-auto-columns: 36%; }
  .grid-sm .card-meta { flex-direction: row; justify-content: space-between; }
}

/* ---------- News ---------- */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.news-grid-sm { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.news-card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--ink); min-width: 0; }
.news-card:hover { color: inherit; box-shadow: 0 0 0 2px var(--ink); }
.news-card:hover h3 { text-decoration: underline; }
.news-card .ph { aspect-ratio: 16 / 9; }
.news-card-body { padding: 12px 14px 14px; }
.news-card-body .card-kicker { margin: 0 0 4px; }
.news-card-body h3 { font-family: var(--f-body); font-size: 1.1rem; line-height: 1.25; margin: 0 0 6px; }
.news-card-body p:last-child { margin: 0; font-size: 0.92rem; color: var(--ink-2); }
.news-grid-sm .news-card-body h3 { font-size: 1rem; }
/* Front page: news next to the forum, so the cards are stacked rows (photo left). */
.two-col.single { grid-template-columns: 1fr; }
.news-forum:not(.single) .news-grid { grid-template-columns: 1fr; gap: 12px; }
.news-forum:not(.single) .news-card { flex-direction: row; }
.news-forum:not(.single) .news-card .ph { flex: none; width: 150px; aspect-ratio: 4 / 3; }

.article { max-width: 70ch; margin: 0 auto; padding-top: 20px; }
.article h1 { font-family: var(--f-display); font-weight: 900; text-transform: uppercase; font-size: clamp(2rem, 5vw, 3.2rem); line-height: 0.95; margin: 6px 0 14px; }
.article-lead { font-size: 1.2rem; line-height: 1.5; margin: 0 0 10px; }
.article-byline { font-family: var(--f-mono); font-size: 0.8rem; color: var(--ink-2); margin: 0 0 18px; }
.article-body { font-size: 1.05rem; line-height: 1.65; overflow-wrap: anywhere; }
.article-body p { margin: 0 0 1em; }
.article-body h2 { font-family: var(--f-display); font-weight: 900; text-transform: uppercase; font-size: 1.6rem; line-height: 1; margin: 1.4em 0 0.5em; }
.article-body .quote { margin: 0 0 1em; border-left: 4px solid var(--red); padding: 4px 14px; font-style: italic; }
.article-body .quote p { margin: 0; }
.article-figure { margin: 1.2em 0; }
.article-figure img { display: block; max-width: 100%; width: auto; height: auto; max-height: 70vh; margin: 0 auto; border: 1px solid var(--line); }
.article-cover { margin-top: 0; }
.article-extra { margin: 1em 0; }
.article-discuss { margin: 1.6em 0 0; padding-top: 1em; border-top: 1px dashed var(--rule); }
.article-tools { max-width: 70ch; margin: 24px auto 0; }
.write-page { max-width: 760px; margin: 0 auto; }
.write-page .photo-list.existing li { display: grid; gap: 4px; aspect-ratio: auto; padding-bottom: 4px; }
.write-page .photo-list.existing img { aspect-ratio: 1; height: auto; }
.write-page .photo-list.existing .mono { font-size: 0.72rem; padding: 0 4px; }
.write-page code { font-size: 0.85em; background: var(--paper-2); padding: 0 4px; }
.write-page .auth-form p.hint { display: block; }
/* "Siste nytt" uses the same line as "Neste arrangement", with a small cover image. */
.next-thumb {
  width: 44px; height: 44px; flex: none; border: 2px solid var(--line); overflow: hidden;
  background: repeating-linear-gradient(135deg, transparent 0 6px, var(--stripe) 6px 12px), var(--paper-2);
}
.next-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.intro .next-event + .next-event { margin-top: 10px; padding-top: 10px; }

/* ---------- Collection ("Samlingen min") ---------- */
.shelf-group { margin: 20px 0 8px; }
.shelf-group .sub-title .muted { font-size: 0.8rem; }
.shelf { list-style: none; margin: 0; padding: 0; }
/* Name and tags take the room (tags wrap under the name); the buttons stay
   on the right, and only drop to their own line on phones. */
.shelf-row { display: flex; gap: 6px 16px; align-items: baseline; justify-content: space-between; padding: 8px 0; border-top: 1px dashed var(--rule); }
.shelf-main { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 0; flex: 1 1 auto; }  /* name, then the tags */
@media (max-width: 600px) {
  .shelf-row { flex-wrap: wrap; }
  .shelf-row .shelf-actions { flex: 1 0 100%; justify-content: flex-end; }   /* always their own line */
}
.shelf-name { font-weight: 700; }
.shelf-note { flex-basis: 100%; margin: 2px 0 0; font-size: 0.88rem; color: var(--ink-2); }
.shelf-actions { display: flex; gap: 12px; font-size: 0.9rem; margin-left: auto; flex: none; }
.shelf-actions a, .shelf-actions .link-button { color: var(--ink-2); }
.shelf-visibility { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.shelf-filter input[type="search"] { font: inherit; padding: 5px 8px; border: 2px solid var(--line); background: var(--card); color: var(--ink); min-width: 0; flex: 1 1 180px; }
.shelf-contents { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.shelf-contents legend { font-weight: 700; margin-bottom: 6px; padding: 0; }
.auth-form [data-title-picker] { display: grid; gap: inherit; }
.import-columns { font-size: 0.8rem; background: var(--paper-2); padding: 6px 8px; overflow-wrap: anywhere; }
.import-skipped { font-size: 0.92rem; padding-left: 1.2em; }
.who-has { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 6px 20px; }
.who-has li { padding: 6px 0; border-top: 1px dashed var(--rule); }
.who-has .who-ask { font-size: 0.9rem; white-space: nowrap; }
.trade-list { list-style: none; margin: 0; padding: 0; }
.trade-list li { padding: 10px 0; border-top: 1px dashed var(--rule); }
.trade-list li:first-child { border-top: 0; }
.trade-list p { margin: 0 0 8px; }
.deal-note { border: 2px solid var(--green); background: var(--card); padding: 10px 14px; margin: 8px 0 16px; max-width: 70ch; }
.radio-list { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; } .radio-list legend { font-weight: 700; margin-bottom: 6px; padding: 0; }
.auth-form input[type="radio"] { accent-color: var(--ink); width: 16px; height: 16px; vertical-align: -2px; margin-right: 6px; }
.catalog-search input[type="search"] { font: inherit; padding: 5px 8px; border: 2px solid var(--line); background: var(--card); color: var(--ink); flex: 1 1 220px; min-width: 0; }
.catalog-count { margin: 12px 0 4px; }
.catalog-hits .catalog-all { font-weight: 400; font-family: var(--f-mono); font-size: 0.85rem; }

/* Related games and genres */
.game-genres { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.game-genres .tag { text-decoration: none; }
.game-genres .tag:hover { background: var(--inv-bg); color: var(--inv-fg); }
.series-nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin: 12px 0 0; font-weight: 700; max-width: 60ch; }
.series-nav .series-next { margin-left: auto; }
.game-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0 24px; }
.game-list li { padding: 7px 0; border-top: 1px dashed var(--rule); display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
.game-list .mono { font-size: 0.8rem; }
.genre-cloud { list-style: none; margin: 16px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.genre-platforms { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 12px; font-size: 0.92rem; }
.genre-platforms a[aria-current] { font-weight: 700; text-decoration: none; background: var(--inv-bg); color: var(--inv-fg); padding: 0 6px; }
.letter-bar { font-family: var(--f-mono); gap: 4px 10px; margin: 8px 0 16px; }
/* "Del annonsen": link, e-mail, Facebook (a plain link), the phone's share menu */
.share { margin: 12px 0 0; }
.share summary { cursor: pointer; font-weight: 700; display: inline-block; }
.share summary::-webkit-details-marker { display: none; }
.share summary::before { content: "↗ "; }
.share-panel { margin-top: 8px; padding: 12px; border: 2px solid var(--line); background: var(--card); }
.share-panel input { width: 100%; font: inherit; font-size: 0.9rem; padding: 6px 8px; border: 2px solid var(--line); background: var(--paper); color: var(--ink); }
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
/* "Varsle meg": saved searches and wishlist alerts, where people look */
.alert-cta { margin: 14px 0; padding: 12px 14px; border: 2px solid var(--line); border-left: 6px solid var(--red-bg); background: var(--card); }
.alert-cta form { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.alert-cta p { margin: 0; }
/* "Erfaren handler": 5+ trades confirmed by both sides, good reviews (trades/reputation.py) */
.experienced { margin: 10px 0 0; font-size: 0.85rem; color: var(--ink-2); }
.experienced-mark { display: inline-block; font-family: var(--f-mono); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 1px 6px; border: 2px solid var(--green); color: var(--green); margin-right: 4px; vertical-align: 1px; }
.alert-cta .feed-link { margin-top: 8px; font-size: 0.85rem; }
.share-actions [hidden] { display: none; }

/* ---------- Samlingen: the shelf ("Hylla") ----------
   Games lie flat in stacks of up to 10 on a wooden board, text horizontal so
   it's easy to read. Generated look: console colour, no cover art
   (copyright). Each stack carries its own piece of board (padding included),
   so the pieces meet in one board under a line of stacks. */
.view-switch { display: flex; gap: 6px; margin: 0 0 14px; font-family: var(--f-mono); font-size: 0.9rem; }
.view-switch a { padding: 2px 10px; border: 2px solid var(--line); text-decoration: none; color: var(--ink); background: var(--card); }
.view-switch a[aria-current] { background: var(--inv-bg); color: var(--inv-fg); }

.spines { margin: 8px 0 24px; display: flex; flex-wrap: wrap; align-items: flex-end; row-gap: 22px; }
.stack { list-style: none; margin: 0; padding: 0 14px 0 10px; width: 272px; box-sizing: border-box;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 1px;   /* A–Z from the top */
  border-bottom: 10px solid #6b4a2b; box-shadow: 0 3px 0 #4a3220; }
.spine-slot { display: block; width: 100%; }
.spine {
  --bg: #3a3a3a; --fg: #f4efe4; --band: transparent;
  position: relative; display: flex; align-items: center; gap: 6px;
  width: 100%; height: 30px; padding: 0 6px 0 8px; box-sizing: border-box; overflow: hidden;
  background: linear-gradient(to bottom, rgba(255,255,255,.08), transparent 30%, transparent 70%, rgba(0,0,0,.25)), var(--bg);
  border-left: 6px solid var(--band); color: var(--fg); text-decoration: none;
  transition: transform .12s ease;
}
a.spine:hover, a.spine:focus-visible { transform: translateX(6px); }
a.spine:focus-visible { outline: 3px solid var(--yellow); outline-offset: 1px; }
.spine-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-family: var(--f-display); font-weight: 700; font-size: 1rem; letter-spacing: 0.02em; line-height: 1; }
.spine-mark { flex: none; font-family: var(--f-mono); font-size: 0.66rem; font-weight: 700; opacity: .9; }

/* Shapes: thickness and length say what it is */
.spine-box { height: 30px; }                               /* big cardboard boxes */
.spine-case { height: 22px; width: 94%; }                  /* DVD/Blu-ray style cases */
.spine-case .spine-title { font-size: 0.88rem; }
.spine-small { height: 24px; width: 74%; }                 /* handheld game boxes */
.spine-small .spine-title { font-size: 0.88rem; }
.spine-loose { height: 26px; width: 64%; border-left-width: 10px; border-radius: 0 3px 3px 0; }  /* accessories, parts */
.spine-loose .spine-title { font-size: 0.86rem; }
.spine-wide { height: 46px; }                              /* consoles and bundles */
.spine-book { height: 18px; width: 88%; padding-left: 6px; }  /* magazines and guides */
.spine-book .spine-title { font-size: 0.78rem; }

/* Sealed: a shine across it */
.spine.sealed::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.28) 42%, transparent 54%); pointer-events: none; }

/* Colours: by manufacturer, then by console (inspired by PAL boxes and cases) */
.mf-nintendo { --bg: #2c2c2c; --band: #c8281e; }
.mf-sega { --bg: #1b1b1b; --band: #1f5fae; }
.mf-sony { --bg: #151515; --band: #d8d8d8; }
.mf-microsoft { --bg: #1d1d1d; --band: #2f8f3a; }
.mf-hjemmedata { --bg: #cfc3a4; --fg: #2a241a; --band: #6b4a2b; }
.mf-annet { --bg: #5a4a3a; --band: #c9a24a; }
.pf-super-nintendo { --bg: #dcd8cf; --fg: #26231e; --band: #6a5f8c; }
.pf-nintendo-64 { --bg: #1a1a1a; --band: #e0b31a; }
.pf-gamecube { --bg: #202028; --band: #5b57a6; }
.pf-wii, .pf-nintendo-ds, .pf-nintendo-3ds { --bg: #f1f1ee; --fg: #26231e; --band: #1f9bd1; }
.pf-nintendo-3ds { --band: #c8281e; }
.pf-wii-u { --bg: #1d6fb0; --band: #0f4a7a; }
.pf-game-boy { --bg: #b8b7ad; --fg: #26231e; --band: #3d3a8c; }
.pf-game-boy-color { --bg: #d6c9a1; --fg: #26231e; --band: #c8281e; }
.pf-game-boy-advance { --bg: #26345e; --band: #9aa7d6; }
.pf-master-system { --bg: #f0efea; --fg: #26231e; --band: #c8281e; }
.pf-dreamcast { --bg: #1257a0; --band: #f08a24; }
.pf-playstation-2 { --bg: #121620; --band: #2a55a8; }
.pf-psp { --bg: #1a1a1a; --band: #7f7f7f; }
.pf-ps-vita { --bg: #1f4f99; --band: #0e2f63; }
.pf-xbox-360 { --bg: #f0f0ec; --fg: #1f3b12; --band: #6fae2b; }
.pf-neo-geo { --bg: #111; --band: #c9a24a; }
.pf-pc-engine { --bg: #efefe9; --fg: #26231e; --band: #d05a1e; }
.pf-atari { --bg: #3b2a1c; --band: #b3793c; }

@media (max-width: 600px) {
  .stack { width: 50%; padding: 0 8px 0 4px; }
  .spine-title { font-size: 0.9rem; }
}

/* Dark mode: dark spines need an edge to stand out from the page */
:root[data-theme="dark"] .spine { box-shadow: 0 0 0 1px rgba(244,239,228,.18); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .spine { box-shadow: 0 0 0 1px rgba(244,239,228,.18); }
}

/* Completion per console: "12 av 1 395 spill i katalogen" */
.completion { display: flex; align-items: center; gap: 10px; margin: -4px 0 6px; font-size: 0.9rem; color: var(--ink-2); }
.completion progress { width: 160px; height: 10px; appearance: none; border: 2px solid var(--line); background: var(--card); }
.completion progress::-webkit-progress-bar { background: var(--card); }
.completion progress::-webkit-progress-value { background: var(--red-bg); }
.completion progress::-moz-progress-bar { background: var(--red-bg); }

/* Controller buttons at the end of each spine, where the logo sits on a PAL
   case: every console's buttons in their colours and places, our own drawing,
   never a logo's shape or lettering (see CLAUDE.md). Generated from a small
   table: round buttons, lighter in the middle with a thin dark rim, all
   within 22 x 16 px so they fit the thinnest spines. */
.spine { padding-right: 34px; }  /* room for the buttons */
.spine::before { content: none; position: absolute; right: 6px; top: 50%; width: 23px; height: 16px; margin-top: -8px; }
/* PlayStation: the logo's colours as a cluster (the owner's sketch) */
.pf-playstation::before { content: "";
  background:
    radial-gradient(circle closest-side, color-mix(in srgb, #e3261b, white 38%) 0, #e3261b 62%, color-mix(in srgb, #e3261b, black 45%) 82%, transparent 96%) 6px 5px / 7px 7px no-repeat,
    radial-gradient(circle closest-side, color-mix(in srgb, #e3261b, white 38%) 0, #e3261b 62%, color-mix(in srgb, #e3261b, black 45%) 82%, transparent 96%) 6px 0px / 7px 7px no-repeat,
    radial-gradient(circle closest-side, color-mix(in srgb, #f2b90f, white 38%) 0, #f2b90f 62%, color-mix(in srgb, #f2b90f, black 45%) 82%, transparent 96%) 0px 8px / 7px 7px no-repeat,
    radial-gradient(circle closest-side, color-mix(in srgb, #1f63d6, white 38%) 0, #1f63d6 62%, color-mix(in srgb, #1f63d6, black 45%) 82%, transparent 96%) 12px 8px / 7px 7px no-repeat; }
/* Later PlayStations: the face buttons, triangle, square, circle, cross */
.pf-playstation-2::before, .pf-playstation-3::before, .pf-psp::before, .pf-ps-vita::before { content: "";
  background:
    radial-gradient(circle closest-side, color-mix(in srgb, #2aa36a, white 38%) 0, #2aa36a 62%, color-mix(in srgb, #2aa36a, black 45%) 82%, transparent 96%) 6px 0px / 6px 6px no-repeat,
    radial-gradient(circle closest-side, color-mix(in srgb, #e46fae, white 38%) 0, #e46fae 62%, color-mix(in srgb, #e46fae, black 45%) 82%, transparent 96%) 0px 5px / 6px 6px no-repeat,
    radial-gradient(circle closest-side, color-mix(in srgb, #e3261b, white 38%) 0, #e3261b 62%, color-mix(in srgb, #e3261b, black 45%) 82%, transparent 96%) 12px 5px / 6px 6px no-repeat,
    radial-gradient(circle closest-side, color-mix(in srgb, #3a78d8, white 38%) 0, #3a78d8 62%, color-mix(in srgb, #3a78d8, black 45%) 82%, transparent 96%) 6px 10px / 6px 6px no-repeat; }
/* Super Nintendo: X, Y, A, B in the PAL controller's colours */
.pf-super-nintendo::before { content: "";
  background:
    radial-gradient(circle closest-side, color-mix(in srgb, #2f5fc4, white 38%) 0, #2f5fc4 62%, color-mix(in srgb, #2f5fc4, black 45%) 82%, transparent 96%) 6px 0px / 6px 6px no-repeat,
    radial-gradient(circle closest-side, color-mix(in srgb, #2e8b45, white 38%) 0, #2e8b45 62%, color-mix(in srgb, #2e8b45, black 45%) 82%, transparent 96%) 0px 5px / 6px 6px no-repeat,
    radial-gradient(circle closest-side, color-mix(in srgb, #c8281e, white 38%) 0, #c8281e 62%, color-mix(in srgb, #c8281e, black 45%) 82%, transparent 96%) 12px 5px / 6px 6px no-repeat,
    radial-gradient(circle closest-side, color-mix(in srgb, #e6b41c, white 38%) 0, #e6b41c 62%, color-mix(in srgb, #e6b41c, black 45%) 82%, transparent 96%) 6px 10px / 6px 6px no-repeat; }
/* NES: B and A */
.pf-nes::before { content: "";
  background:
    radial-gradient(circle closest-side, color-mix(in srgb, #c8281e, white 38%) 0, #c8281e 62%, color-mix(in srgb, #c8281e, black 45%) 82%, transparent 96%) 0px 4px / 8px 8px no-repeat,
    radial-gradient(circle closest-side, color-mix(in srgb, #c8281e, white 38%) 0, #c8281e 62%, color-mix(in srgb, #c8281e, black 45%) 82%, transparent 96%) 11px 4px / 8px 8px no-repeat; }
/* Game Boy: B and A on a slant */
.pf-game-boy::before, .pf-game-boy-color::before { content: "";
  background:
    radial-gradient(circle closest-side, color-mix(in srgb, #a3155f, white 38%) 0, #a3155f 62%, color-mix(in srgb, #a3155f, black 45%) 82%, transparent 96%) 0px 7px / 8px 8px no-repeat,
    radial-gradient(circle closest-side, color-mix(in srgb, #a3155f, white 38%) 0, #a3155f 62%, color-mix(in srgb, #a3155f, black 45%) 82%, transparent 96%) 10px 2px / 8px 8px no-repeat; }
/* Game Boy Advance: B and A */
.pf-game-boy-advance::before { content: "";
  background:
    radial-gradient(circle closest-side, color-mix(in srgb, #c9c9d6, white 38%) 0, #c9c9d6 62%, color-mix(in srgb, #c9c9d6, black 45%) 82%, transparent 96%) 0px 7px / 8px 8px no-repeat,
    radial-gradient(circle closest-side, color-mix(in srgb, #c9c9d6, white 38%) 0, #c9c9d6 62%, color-mix(in srgb, #c9c9d6, black 45%) 82%, transparent 96%) 10px 2px / 8px 8px no-repeat; }
/* DS: four small grey buttons */
.pf-nintendo-ds::before, .pf-nintendo-3ds::before { content: "";
  background:
    radial-gradient(circle closest-side, color-mix(in srgb, #9d9d95, white 38%) 0, #9d9d95 62%, color-mix(in srgb, #9d9d95, black 45%) 82%, transparent 96%) 6px 0px / 6px 6px no-repeat,
    radial-gradient(circle closest-side, color-mix(in srgb, #9d9d95, white 38%) 0, #9d9d95 62%, color-mix(in srgb, #9d9d95, black 45%) 82%, transparent 96%) 0px 5px / 6px 6px no-repeat,
    radial-gradient(circle closest-side, color-mix(in srgb, #9d9d95, white 38%) 0, #9d9d95 62%, color-mix(in srgb, #9d9d95, black 45%) 82%, transparent 96%) 12px 5px / 6px 6px no-repeat,
    radial-gradient(circle closest-side, color-mix(in srgb, #9d9d95, white 38%) 0, #9d9d95 62%, color-mix(in srgb, #9d9d95, black 45%) 82%, transparent 96%) 6px 10px / 6px 6px no-repeat; }
/* N64: a big blue A, green B, a yellow C */
.pf-nintendo-64::before { content: "";
  background:
    radial-gradient(circle closest-side, color-mix(in srgb, #2f5fc4, white 38%) 0, #2f5fc4 62%, color-mix(in srgb, #2f5fc4, black 45%) 82%, transparent 96%) 0px 6px / 9px 9px no-repeat,
    radial-gradient(circle closest-side, color-mix(in srgb, #2aa152, white 38%) 0, #2aa152 62%, color-mix(in srgb, #2aa152, black 45%) 82%, transparent 96%) 9px 0px / 7px 7px no-repeat,
    radial-gradient(circle closest-side, color-mix(in srgb, #e6b41c, white 38%) 0, #e6b41c 62%, color-mix(in srgb, #e6b41c, black 45%) 82%, transparent 96%) 14px 9px / 6px 6px no-repeat; }
/* GameCube: a big green A, a small red B */
.pf-gamecube::before { content: "";
  background:
    radial-gradient(circle closest-side, color-mix(in srgb, #2aa152, white 38%) 0, #2aa152 62%, color-mix(in srgb, #2aa152, black 45%) 82%, transparent 96%) 5px 1px / 11px 11px no-repeat,
    radial-gradient(circle closest-side, color-mix(in srgb, #c8281e, white 38%) 0, #c8281e 62%, color-mix(in srgb, #c8281e, black 45%) 82%, transparent 96%) 0px 10px / 6px 6px no-repeat; }
/* Wii: a light blue ring */
.pf-wii::before, .pf-wii-u::before { content: "";
  background:
    radial-gradient(circle closest-side, transparent 0 42%, #1b6e98 46%, #3aa7e0 56% 74%, #1b6e98 84%, transparent 94%) 4px 1px / 14px 14px no-repeat; }
/* Buttons 1 and 2 */
.pf-master-system::before, .pf-game-gear::before, .pf-pc-engine::before { content: "";
  background:
    radial-gradient(circle closest-side, color-mix(in srgb, #555555, white 38%) 0, #555555 62%, color-mix(in srgb, #555555, black 45%) 82%, transparent 96%) 0px 4px / 8px 8px no-repeat,
    radial-gradient(circle closest-side, color-mix(in srgb, #555555, white 38%) 0, #555555 62%, color-mix(in srgb, #555555, black 45%) 82%, transparent 96%) 11px 4px / 8px 8px no-repeat; }
/* Mega Drive: A, B, C on a slant */
.pf-mega-drive::before { content: "";
  background:
    radial-gradient(circle closest-side, color-mix(in srgb, #bdbdbd, white 38%) 0, #bdbdbd 62%, color-mix(in srgb, #bdbdbd, black 45%) 82%, transparent 96%) 0px 10px / 6px 6px no-repeat,
    radial-gradient(circle closest-side, color-mix(in srgb, #bdbdbd, white 38%) 0, #bdbdbd 62%, color-mix(in srgb, #bdbdbd, black 45%) 82%, transparent 96%) 6px 5px / 6px 6px no-repeat,
    radial-gradient(circle closest-side, color-mix(in srgb, #bdbdbd, white 38%) 0, #bdbdbd 62%, color-mix(in srgb, #bdbdbd, black 45%) 82%, transparent 96%) 12px 0px / 6px 6px no-repeat; }
/* Saturn: two rows of three */
.pf-saturn::before { content: "";
  background:
    radial-gradient(circle closest-side, color-mix(in srgb, #bdbdbd, white 38%) 0, #bdbdbd 62%, color-mix(in srgb, #bdbdbd, black 45%) 82%, transparent 96%) 0px 10px / 5px 5px no-repeat,
    radial-gradient(circle closest-side, color-mix(in srgb, #bdbdbd, white 38%) 0, #bdbdbd 62%, color-mix(in srgb, #bdbdbd, black 45%) 82%, transparent 96%) 6px 9px / 5px 5px no-repeat,
    radial-gradient(circle closest-side, color-mix(in srgb, #bdbdbd, white 38%) 0, #bdbdbd 62%, color-mix(in srgb, #bdbdbd, black 45%) 82%, transparent 96%) 12px 8px / 5px 5px no-repeat,
    radial-gradient(circle closest-side, color-mix(in srgb, #bdbdbd, white 38%) 0, #bdbdbd 62%, color-mix(in srgb, #bdbdbd, black 45%) 82%, transparent 96%) 1px 2px / 5px 5px no-repeat,
    radial-gradient(circle closest-side, color-mix(in srgb, #bdbdbd, white 38%) 0, #bdbdbd 62%, color-mix(in srgb, #bdbdbd, black 45%) 82%, transparent 96%) 7px 1px / 5px 5px no-repeat,
    radial-gradient(circle closest-side, color-mix(in srgb, #bdbdbd, white 38%) 0, #bdbdbd 62%, color-mix(in srgb, #bdbdbd, black 45%) 82%, transparent 96%) 13px 0px / 5px 5px no-repeat; }
/* Dreamcast: Y, X, B, A */
.pf-dreamcast::before { content: "";
  background:
    radial-gradient(circle closest-side, color-mix(in srgb, #2aa152, white 38%) 0, #2aa152 62%, color-mix(in srgb, #2aa152, black 45%) 82%, transparent 96%) 6px 0px / 6px 6px no-repeat,
    radial-gradient(circle closest-side, color-mix(in srgb, #f2b90f, white 38%) 0, #f2b90f 62%, color-mix(in srgb, #f2b90f, black 45%) 82%, transparent 96%) 0px 5px / 6px 6px no-repeat,
    radial-gradient(circle closest-side, color-mix(in srgb, #2f5fc4, white 38%) 0, #2f5fc4 62%, color-mix(in srgb, #2f5fc4, black 45%) 82%, transparent 96%) 12px 5px / 6px 6px no-repeat,
    radial-gradient(circle closest-side, color-mix(in srgb, #e3261b, white 38%) 0, #e3261b 62%, color-mix(in srgb, #e3261b, black 45%) 82%, transparent 96%) 6px 10px / 6px 6px no-repeat; }
/* Xbox: Y, X, B, A */
.pf-xbox::before, .pf-xbox-360::before { content: "";
  background:
    radial-gradient(circle closest-side, color-mix(in srgb, #f2b90f, white 38%) 0, #f2b90f 62%, color-mix(in srgb, #f2b90f, black 45%) 82%, transparent 96%) 6px 0px / 6px 6px no-repeat,
    radial-gradient(circle closest-side, color-mix(in srgb, #2f5fc4, white 38%) 0, #2f5fc4 62%, color-mix(in srgb, #2f5fc4, black 45%) 82%, transparent 96%) 0px 5px / 6px 6px no-repeat,
    radial-gradient(circle closest-side, color-mix(in srgb, #e3261b, white 38%) 0, #e3261b 62%, color-mix(in srgb, #e3261b, black 45%) 82%, transparent 96%) 12px 5px / 6px 6px no-repeat,
    radial-gradient(circle closest-side, color-mix(in srgb, #2aa152, white 38%) 0, #2aa152 62%, color-mix(in srgb, #2aa152, black 45%) 82%, transparent 96%) 6px 10px / 6px 6px no-repeat; }
/* Neo Geo: A, B, C, D in an arc */
.pf-neo-geo::before { content: "";
  background:
    radial-gradient(circle closest-side, color-mix(in srgb, #e3261b, white 38%) 0, #e3261b 62%, color-mix(in srgb, #e3261b, black 45%) 82%, transparent 96%) 0px 10px / 6px 6px no-repeat,
    radial-gradient(circle closest-side, color-mix(in srgb, #f2b90f, white 38%) 0, #f2b90f 62%, color-mix(in srgb, #f2b90f, black 45%) 82%, transparent 96%) 5px 5px / 6px 6px no-repeat,
    radial-gradient(circle closest-side, color-mix(in srgb, #2aa152, white 38%) 0, #2aa152 62%, color-mix(in srgb, #2aa152, black 45%) 82%, transparent 96%) 11px 3px / 6px 6px no-repeat,
    radial-gradient(circle closest-side, color-mix(in srgb, #2f6bd0, white 38%) 0, #2f6bd0 62%, color-mix(in srgb, #2f6bd0, black 45%) 82%, transparent 96%) 17px 3px / 6px 6px no-repeat; }
/* A joystick's red fire button */
.pf-atari::before, .pf-commodore-64::before, .pf-amiga::before, .pf-retro-pc::before { content: "";
  background:
    radial-gradient(circle closest-side, color-mix(in srgb, #e3261b, white 38%) 0, #e3261b 62%, color-mix(in srgb, #e3261b, black 45%) 82%, transparent 96%) 4px 2px / 12px 12px no-repeat; }

/* Super Nintendo: four round dots in the colours of the controller's buttons */

/* Series in the collection: "Resident Evil: 4 av 9 spill" */
.series-progress { margin: 28px 0; }
.series-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.series-card { border: 2px solid var(--line); background: var(--card); padding: 10px 12px; }
.series-card.is-complete { border-color: var(--green); }
.series-name { margin: 0 0 6px; }
.series-card .completion { margin: 0; }
.series-card .completion progress { width: 110px; }
.series-consoles { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 2px 12px; font-family: var(--f-mono); font-size: 0.75rem; color: var(--ink-2); }
.series-consoles .done { color: var(--green); font-weight: 700; }

/* Samlingen: members' own photos and "Favoritter" */
.photo-upload { display: grid; gap: 6px; margin: 10px 0; max-width: 520px; }
.photo-upload .hint { margin: 0; }
.photo-upload .btn { justify-self: start; }
.item-photo { margin-top: 28px; }
.item-photo-img { max-width: 100%; max-height: 360px; border: 2px solid var(--line); }
.favorites, .shelf-photos { margin: 20px 0 28px; }
.favorite-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.favorite-card { border: 2px solid var(--line); background: var(--card); display: flex; flex-direction: column; }
.favorite-photo { display: block; aspect-ratio: 4 / 3; background: var(--paper-2); border-bottom: 2px solid var(--line); overflow: hidden; }
.favorite-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* No photo: the console's colours (the pf-/mf- classes set --bg, --fg, --band) */
.favorite-blank { display: flex; align-items: flex-end; padding: 10px;
  background: var(--bg, #3a3a3a); border-left: 8px solid var(--band, transparent); color: var(--fg, #f4efe4); }
.favorite-blank span { font-family: var(--f-display); font-weight: 800; font-size: 1.3rem; line-height: 1.05; text-transform: uppercase; }
.favorite-text { padding: 8px 10px 10px; }
.favorite-text p { margin: 0 0 3px; }
.favorite-name { font-weight: 700; }
.favorite-actions { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 0.85rem; margin-top: 6px; }
.favorite-actions .link-button { font-size: inherit; }
.shelf-photo-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.shelf-photo-list img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; border: 2px solid var(--line); }
.shelf-thumb { flex: none; align-self: center; }
.shelf-thumb img { width: 44px; height: 44px; object-fit: cover; border: 1px solid var(--line); display: block; }
.favorite-blank { position: relative; }
.favorite-blank::before { position: absolute; right: 12px; top: 12px; width: 23px; height: 16px; transform: scale(1.7); transform-origin: top right; }

/* Comparing with your own collection */
.compare { border: 2px solid var(--line); background: var(--card); padding: 12px 16px; margin: 16px 0 24px; }
.compare .sub-title { margin-top: 0; }
.compare p { margin: 0 0 6px; }
.compare-list { margin: 0 0 10px; padding-left: 20px; columns: 2 260px; }
.compare-list li { margin: 2px 0; break-inside: avoid; }
.completion-note { margin: -2px 0 8px; font-size: 0.82rem; }

/* ---------- Utgaveregisteret (editions) ---------- */
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
.tag.tag-scn { background: var(--inv-bg); color: var(--inv-fg); border-color: var(--inv-bg); }
.edition-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.edition { background: var(--card); border: 2px solid var(--line); padding: 14px 16px; }
.edition.is-pending { border-style: dashed; }
.edition-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.edition-head h3 { margin: 0; font-size: 1.1rem; }
.edition-facts { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 10px 0 0; }
.edition-facts dt { font-family: var(--f-mono); font-size: 0.72rem; text-transform: uppercase; color: var(--ink-2); }
.edition-facts dd { margin: 0; }
.edition-notes { margin: 10px 0 0; max-width: 75ch; overflow-wrap: anywhere; }
.edition-credit { margin: 10px 0 0; font-size: 0.85rem; color: var(--ink-2); overflow-wrap: anywhere; }
.edition-photos { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.edition-photos a { position: relative; display: block; cursor: zoom-in; }
.edition-photos img { width: 140px; height: 105px; object-fit: cover; border: 1px solid var(--line); background: var(--paper-2); display: block; }
.edition-photos a:hover img { box-shadow: 0 0 0 2px var(--ink); }
.photo-pending { position: absolute; left: 4px; bottom: 4px; background: var(--yellow); color: var(--on-yellow); font-family: var(--f-mono); font-size: 0.7rem; padding: 1px 5px; }
.edition-actions { display: flex; gap: 14px; margin: 10px 0 0; font-family: var(--f-mono); font-size: 0.8rem; }
.check-line { display: flex; gap: 10px; align-items: flex-start; font-weight: 400 !important; line-height: 1.4; }
.check-line input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.register-intro { margin-bottom: 8px; }
.queue-item { border-bottom: 1px solid var(--rule); padding: 12px 0; }
.queue-item p { margin: 0 0 6px; }
.queue-photo { display: flex; gap: 14px; align-items: flex-start; }
.queue-photo img { width: 160px; height: 120px; object-fit: cover; border: 1px solid var(--line); }
.decide-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.decide-form input[type="text"] { flex: 1 1 260px; max-width: 420px; font: inherit; padding: 6px 10px; border: 2px solid var(--line); background: var(--paper); color: var(--ink); }
@media (max-width: 600px) {
  .edition-photos a { width: calc(50% - 4px); }
  .edition-photos img { width: 100%; height: auto; aspect-ratio: 4 / 3; }
  .queue-photo { flex-direction: column; }
}
.change-table { border-collapse: collapse; margin: 8px 0; font-size: 0.92rem; }
.change-table th, .change-table td { text-align: left; padding: 4px 14px 4px 0; border-top: 1px dashed var(--rule); vertical-align: top; overflow-wrap: anywhere; }
.change-table thead th { font-family: var(--f-mono); font-size: 0.72rem; text-transform: uppercase; color: var(--ink-2); border-top: 0; }
/* The game's picture from the register, beside the heading. */
.game-cover { float: left; width: 150px; margin: 4px 20px 10px 0; }
.game-cover img { display: block; width: 100%; height: auto; border: 1px solid var(--line); background: var(--paper-2); }
.game-cover figcaption { font-size: 0.7rem; color: var(--ink-2); margin-top: 4px; }
.game-intro::after { content: ""; display: block; clear: both; }
@media (max-width: 600px) { .game-cover { width: 110px; margin-right: 14px; } }
.edition-notice { border-left: 4px solid var(--yellow); background: var(--card); padding: 8px 12px; margin: 0 0 12px; }
.main-photo-tools { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; font-family: var(--f-mono); font-size: 0.75rem; }
.main-photo-tools .link-button { color: var(--ink-2); }
/* Cropping a register photo (crop.js) */
.crop-page { max-width: 900px; margin: 0 auto; }
/* The stage is exactly the size of the image, so corner fractions match it. */
.crop-stage { position: relative; width: fit-content; max-width: calc(100% - 64px); margin: 40px 32px 40px; touch-action: none; user-select: none; }
.crop-img { display: block; max-width: 100%; max-height: 75vh; width: auto; height: auto; }
.crop-outline { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.crop-shade { fill: rgba(0, 0, 0, 0.5); }
.crop-edge { fill: none; stroke: var(--yellow); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.crop-leg { stroke: var(--yellow); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
/* The exact corner: a thin crosshair with a dark edge so it shows on any background. */
.crop-pin { position: absolute; width: 0; height: 0; pointer-events: none; }
.crop-pin::before, .crop-pin::after {
  content: ""; position: absolute; background: var(--yellow); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.7);
}
.crop-pin::before { left: -9px; top: -0.5px; width: 18px; height: 1px; }
.crop-pin::after { left: -0.5px; top: -9px; width: 1px; height: 18px; }
/* The handle you drag sits outside the area, joined by a line. */
.crop-handle {
  position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; padding: 0; cursor: grab;
  border: 3px solid var(--on-yellow); background: var(--yellow); border-radius: 50%; box-shadow: 0 0 0 2px var(--paper);
  touch-action: none;
}
.crop-handle:active { cursor: grabbing; }
.crop-handle:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.crop-stage:not(.is-ready) .crop-handle, .crop-stage:not(.is-ready) .crop-pin { display: none; }
.photo-guide { margin-bottom: 8px; }
/* "Beskjeder": notes from the site */
.notice-list { list-style: none; margin: 0; padding: 0; max-width: 760px; }
.notice-row { display: flex; gap: 16px; justify-content: space-between; align-items: baseline; padding: 12px 0 12px 12px; border-bottom: 1px solid var(--rule); border-left: 4px solid transparent; }
.notice-row.is-unread { border-left-color: var(--yellow); background: var(--card); }
.notice-row.is-unread .notice-text { font-weight: 700; }
.notice-when { font-size: 0.78rem; color: var(--ink-2); white-space: nowrap; }
.post-btn { white-space: nowrap; }
/* "Hvilken utgave?" (edition-picker.js) */
.edition-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.edition-choice > span { flex-direction: row; align-items: center; gap: 10px; justify-content: flex-start; flex-wrap: wrap; min-height: 56px; }
.edition-choice img { width: 44px; height: 56px; object-fit: cover; border: 1px solid var(--line); flex: none; }
.edition-choice b { flex: 1 1 120px; }
.edition-choice small { flex-basis: 100%; }
.edition-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0 0; }
.edition-sale { font-weight: 700; }
.wish-region { display: inline-flex; gap: 6px; align-items: center; margin-left: 10px; }
.wish-region select { font: inherit; font-size: 0.9rem; padding: 3px 6px; border: 2px solid var(--line); background: var(--paper); color: var(--ink); }
.maybe-results { margin-top: 32px; border-top: 2px dashed var(--rule); padding-top: 16px; }
.wish-originals { display: inline-flex; gap: 4px; align-items: center; font-size: 0.85rem; }
.wanted-originals { margin-top: 10px; }
.price-editions { margin-top: 10px; }
.price-editions th a { font-weight: 700; }
.completion-scn { font-size: 0.88rem; margin-top: -4px; }

/* ---------- Titles and Erfaren handler ---------- */
/* Contribution titles: small, shaped like a cartridge label (cut top corners). */
.profile-titles { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.mtitle { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 2px; font-family: var(--f-mono); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; line-height: 1.3; clip-path: polygon(5px 0, calc(100% - 5px) 0, 100% 5px, 100% 100%, 0 100%, 0 5px); }
/* The wrapper carries the tooltip (the sticker's clip-path would cut it off).
   The tip is in the page for screen readers and shows on hover, focus or tap. */
.mtitle-wrap { position: relative; display: inline-block; vertical-align: 1px; cursor: help; }
.mtitle-wrap:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; background: none; }
.mtitle-tip {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.mtitle-wrap:hover .mtitle-tip, .mtitle-wrap:focus .mtitle-tip {
  width: max-content; max-width: min(280px, 80vw); height: auto; clip: auto; overflow: visible; white-space: normal;
  left: 0; top: calc(100% + 6px); z-index: 5; padding: 6px 9px;
  background: var(--inv-bg); color: var(--inv-fg); border: 2px solid var(--line);
  font-family: var(--f-body); font-size: 0.82rem; font-weight: 400; line-height: 1.35; text-transform: none; letter-spacing: 0;
}
.mtitle-gra, .mtitle-gra:hover { background: var(--cart-gra); color: var(--on-cart-gra); }
.mtitle-svart, .mtitle-svart:hover { background: var(--cart-svart); color: var(--on-cart-svart); box-shadow: inset 0 0 0 1px var(--cart-svart-edge); }
.mtitle-gull, .mtitle-gull:hover { background: var(--cart-gull); color: var(--on-cart-gull); }
.mtitle-forsteopplag, .mtitle-forsteopplag:hover { background: var(--red-bg); color: var(--on-red); }
.mtitle-aeresmedlem, .mtitle-aeresmedlem:hover { background: var(--yellow); color: var(--on-yellow); }
.mtitle .pips { display: inline-flex; gap: 2px; }
.mtitle .pips i { display: block; width: 5px; height: 5px; background: currentColor; }
.title-levels { border-collapse: collapse; margin: 8px 0 16px; }
.title-levels th, .title-levels td { text-align: left; padding: 6px 14px 6px 0; border-top: 1px dashed var(--rule); }
.title-levels thead th { font-family: var(--f-mono); font-size: 0.72rem; text-transform: uppercase; color: var(--ink-2); border-top: 0; }

/* Erfaren handler: a trust signal for trading, so it is bigger, filled and
   square, and never looks like a contribution title. */
.trust { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 12px 0 0; font-size: 0.85rem; color: var(--ink-2); }
.trust-mark { display: inline-block; padding: 3px 10px 2px; font-family: var(--f-display); font-size: 1.05rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; line-height: 1.2; background: var(--green-bg); color: #ffffff; border: 2px solid var(--line); box-shadow: 3px 3px 0 var(--line); }
.thread-with .trust-mark { font-size: 0.9rem; padding: 1px 7px 0; box-shadow: 2px 2px 0 var(--line); }
.post-author .mtitle-wrap { margin-left: 8px; }
.title-levels td.mono { font-size: 0.85rem; }

/* "Bidrag" on a profile: the numbers in a box like a game review's score box. */
.score-box { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 8px; border: 3px solid var(--line); background: var(--card); max-width: 560px; }
.score-box div { padding: 8px 10px 10px; border-left: 1px solid var(--line); display: flex; flex-direction: column-reverse; }
.score-box div:first-child { border-left: 0; }
.score-box dt { font-family: var(--f-mono); font-size: 0.7rem; text-transform: uppercase; color: var(--ink-2); }
.score-box dd { margin: 0; font-family: var(--f-display); font-weight: 900; font-size: 2.2rem; line-height: 1; }
.contrib-threads { list-style: none; margin: 0; padding: 0; max-width: 820px; }
.contrib-threads li { padding: 8px 0; border-top: 1px dashed var(--rule); overflow-wrap: anywhere; }
.contrib-threads li:first-child { border-top: 0; }
.contrib-threads .tag { margin-right: 4px; }
.contrib-threads .mono { font-size: 0.8rem; }
.profile-empty { margin-top: 24px; }

/* A piece of the shelf on a profile: one stack on a phone, more when there's room. */
.profile-shelf-strip .spines { margin-bottom: 12px; }
@media (max-width: 600px) { .profile-shelf-strip .stack:nth-child(n+2) { display: none; } }

/* "Nytt i bua" on the front page: dated lines like a magazine's news column. */
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: grid; grid-template-columns: 2.8rem 5.6rem minmax(0, 1fr); gap: 4px 10px; align-items: baseline; padding: 8px 0; border-top: 1px dashed var(--rule); }
.activity li:first-child { border-top: 0; }
.activity-when { font-size: 0.78rem; color: var(--ink-2); }
.activity-tag { justify-self: start; font-family: var(--f-mono); font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 1px 5px; border: 1px solid var(--line); white-space: nowrap; }
.activity-text { overflow-wrap: anywhere; }
.activity-text .muted { display: block; font-size: 0.82rem; }

/* /rss/abonner/: the feed address to copy into a reader. */
.feed-copy { margin: 18px 0; }
.feed-copy label { display: block; font-weight: 700; margin-bottom: 6px; }
.feed-copy-row { display: flex; flex-wrap: wrap; gap: 8px; }
.feed-copy-row input { flex: 1 1 260px; min-width: 0; font-family: var(--f-mono); font-size: 0.9rem; padding: 8px 10px; border: 2px solid var(--line); background: var(--card); color: var(--ink); }

/* Photos placed in a forum post with "[bilde N]" (forum_text). */
.post-figure { margin: 0; }
.post-figure + .post-figure, p + .post-figure, .quote + .post-figure { margin-top: 1em; }
.post-figure + p, .post-figure + .quote { margin-top: 1em; }
.post-figure a { display: inline-block; }
.post-figure img { display: block; max-width: min(100%, 560px); height: auto; border: 1px solid var(--rule); background: var(--paper-2); }
.post-figure figcaption { margin-top: 4px; font-size: 0.85rem; color: var(--ink-2); }
.photo-markers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.edit-photos ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 8px; }
.edit-photos li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.edit-photos img { width: 64px; height: 64px; object-fit: cover; border: 1px solid var(--rule); }
.edit-photos legend { font-weight: 700; }

/* "Ønskes kjøpt" showing the edition's photo from the register. */
.edition-photo { margin: 0; }
.edition-photo .ph img { width: 100%; height: 100%; object-fit: contain; }
.edition-photo figcaption { margin-top: 6px; font-size: 0.85rem; color: var(--ink-2); }

/* A wanted listing's card with the edition's photo from the register: shown
   whole (it's a cut-out box), with a note so nobody takes it for a photo of
   something for sale. */
.ph img.ph-edition { object-fit: contain; background: var(--card); padding: 6px; box-sizing: border-box; }
.ph .ph-note { position: absolute; left: 6px; bottom: 6px; z-index: 1; font-family: var(--f-mono); font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 1px 5px; background: var(--inv-bg); color: var(--inv-fg); }

/* Utgaveregisteret: how many editions so far, under the heading. */
.register-count { margin: 10px 0 0; font-family: var(--f-mono); font-size: 0.95rem; }
.register-count b { font-family: var(--f-display); font-weight: 900; font-size: 1.6rem; line-height: 1; margin-right: 2px; }
