/* Orienterare.nu – grundstil
   Färger från gamla sajten: guldet i loggans "O" (#ddaa00) och länkblått (#2e5bb6). */

@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/source-sans-3-latin-wght-normal.edab84a4f6f5.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/source-sans-3-latin-wght-italic.acce096866ee.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --color-bg: #ffffff;
  --color-surface: #ffffff;
  --color-subtle: #f4f4f1;
  --color-text: #22231f;
  --color-muted: #66675f;
  --color-border: #e2e1db;
  --color-accent: #ddaa00;
  --box-top-from: #f7f7f4;
  --box-top-to: #e4e3dc;
  --box-new-from: #fafaf5;
  --box-new-to: #ebe8d8;
  --color-accent-strong: #b88c00;
  --color-link: #2e5bb6;
  --color-header: #111111;
  --color-header-text: #f4f3ee;
  --radius: 10px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 4px 16px rgb(0 0 0 / 0.04);
  --font: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --max-width: 1120px;
}

/* Mörkt tema: följer datorns inställning (Auto), om man inte valt Ljust eller Mörkt i sidfoten. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #161714;
    --color-surface: #20211d;
    --color-subtle: #161714;
    --color-text: #ecebe5;
    --color-muted: #a5a59b;
    --color-border: #35362f;
    --color-link: #8fb0f0;
    --box-top-from: #2b2c27;
    --box-top-to: #23241f;
    --box-new-from: #2c2c26;
    --box-new-to: #25251f;
    --color-header: #111111;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --color-bg: #161714;
  --color-surface: #20211d;
  --color-subtle: #161714;
  --color-text: #ecebe5;
  --color-muted: #a5a59b;
  --color-border: #35362f;
  --color-link: #8fb0f0;
  --box-top-from: #2b2c27;
  --box-top-to: #23241f;
  --box-new-from: #2c2c26;
  --box-new-to: #25251f;
  --color-header: #111111;
  --shadow: none;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font);
  font-size: 1rem; /* 16 px, som Discourse */
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--color-link); }
a:hover { color: var(--color-accent-strong); }
img { max-width: 100%; height: auto; }

h1, h2, h3 { line-height: 1.2; font-weight: 700; }
h1 { font-size: 1.625rem; margin: 0 0 12px; } /* 26 px */
h2 { font-size: 1.25rem; }
h3 { font-size: 1.0625rem; }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

.muted { color: var(--color-muted); }

/* Miljöbanner för dev/lokalt */
.env-banner {
  background: #b3261e;
  color: #fff;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 4px 16px;
}
.env-banner--local { background: #44608f; }

/* Sidhuvud */
.site-header {
  background: var(--color-header);
  color: var(--color-header-text);
  border-bottom: 4px solid var(--color-accent);
}
.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.site-logo img {
  display: block;
  width: 130px;
  height: auto;
  background: #fff;
  border-radius: 6px;
  padding: 2px;
}
.site-nav { flex: 1; }
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  display: block;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--color-header-text);
  text-decoration: none;
  font-weight: 600;
}
.site-nav a:hover { background: rgb(255 255 255 / 0.1); color: var(--color-accent); }
.site-nav a[aria-disabled="true"] { opacity: 0.6; cursor: default; }
.site-account { display: flex; gap: 12px; font-size: 0.9375rem; }
.site-account a { color: var(--color-accent); }
.site-account .muted { color: #c9c8bf; }

/* Innehåll */
.site-main { padding-top: 24px; padding-bottom: 40px; min-height: 60vh; }

.hero h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin: 0 0 12px; }
.lead { font-size: 1.1875rem; color: var(--color-muted); max-width: 60ch; margin: 0 0 32px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-accent);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card h2 { font-size: 1.25rem; margin: 0 0 8px; }
.card p { margin: 0; color: var(--color-muted); }

.messages { list-style: none; padding: 0; margin: 0 0 24px; }
.message {
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

/* Sidfot */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 24px 0;
  color: var(--color-muted);
  font-size: 0.9375rem;
}
.site-footer__inner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.site-footer__nav { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-left: auto; }
.site-footer__nav a { color: inherit; }

/* ---------- Gemensamt: knappar, formulär, listor ---------- */
/* Nedtonade knappar: tunn grå ram, gult först när man pekar på dem. Ramen blandas från textfärgen,
   så att den syns lagom i både ljust och mörkt tema. */
.button {
  display: inline-block;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid color-mix(in srgb, var(--color-text) 28%, transparent);
  border-radius: 8px;
  padding: 8px 17px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: var(--color-subtle); border-color: var(--color-accent-strong); color: var(--color-text); }
.button:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.button--ghost { background: transparent; border-color: var(--color-border); }
.button--small { padding: 4px 11px; font-size: 0.9375rem; }
.link-button {
  background: none; border: 0; padding: 0; font: inherit; cursor: pointer;
  color: var(--color-accent); text-decoration: underline;
}
.inline-form { display: inline; margin: 0; }
.small { font-size: 0.875rem; }
.narrow { max-width: 560px; }
.breadcrumb { margin: 0 0 4px; font-size: 0.875rem; }
.note {
  margin-top: 24px; padding: 14px 16px; border-radius: var(--radius);
  background: var(--color-surface); border: 1px solid var(--color-border); font-size: 0.9375rem;
}
.list { padding-left: 1.2em; }
.list li { margin-bottom: 6px; }

.form { display: grid; gap: 14px; margin-bottom: 20px; }
.field { display: grid; gap: 4px; }
.field label { font-weight: 600; }
.field--checkbox { display: flex; align-items: center; gap: 8px; }
.field--checkbox label { font-weight: 400; }
.field input[type="text"], .field input[type="email"], .field input[type="password"],
.field input[type="file"], .field textarea, .field select, .form--compact textarea {
  width: 100%;
  font: inherit;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 9px 11px;
}
.field textarea:focus, .field input:focus { outline: 2px solid var(--color-accent); outline-offset: 1px; }
.field ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.help { color: var(--color-muted); }
.help ul { margin: 4px 0 0; padding-left: 1.2em; }
.error, .form-errors { color: #b3261e; }
.field--error input, .field--error textarea { border-color: #b3261e; }

.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; }
.page-head h1 { margin-top: 0; }

.pagination { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 16px 0; }
.page-btn {
  display: inline-flex; align-items: center; justify-content: center; min-width: 2.25em; height: 2.25em;
  padding: 0 8px; border: 1px solid var(--color-border); border-radius: 8px;
  background: var(--color-surface); color: var(--color-text); text-decoration: none; font-weight: 600;
}
a.page-btn:hover { border-color: var(--color-accent); color: var(--color-text); }
.page-btn--current { background: var(--color-accent); border-color: var(--color-accent); color: #111; }
.page-gap { padding: 0 4px; color: var(--color-muted); }

.tag {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px;
  background: var(--color-subtle); border: 1px solid var(--color-border); font-size: 0.8125rem;
}
.badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  background: var(--color-accent); color: #1d1a10; font-size: 0.75rem; font-weight: 700;
}

/* ---------- Forum ---------- */
.thread-list { list-style: none; padding: 0; margin: 16px 0; border-top: 1px solid var(--color-border); }
.thread-row { padding: 12px 4px; border-bottom: 1px solid var(--color-border); }
.thread-row__title { font-weight: 600; font-size: 1rem; text-decoration: none; }
.thread-row__title:hover { text-decoration: underline; }
.thread-row--unread .thread-row__title::before { content: "● "; color: var(--color-accent); }
.thread-row__meta { font-size: 0.8125rem; margin-top: 2px; }

/* Inläggen utan ram, bara en tunn linje emellan, som på gamla sajten */
.posts { margin: 12px 0; border-top: 1px solid var(--color-border); }
.post {
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
  scroll-margin-top: 16px;
}
.post--new { padding-left: 12px; border-left: 3px solid var(--color-accent); }
.post:target { padding-left: 12px; background: var(--color-subtle); box-shadow: inset 3px 0 0 var(--color-accent); }
.post__head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px;
  margin-bottom: 8px;
}
.post__number { margin-left: auto; font-size: 0.875rem; }
.post__time { font-size: 0.875rem; text-decoration: none; }
/* Själva texten lite smalare än kolumnen (ca 75 tecken per rad), så att raderna blir lättare att läsa */
/* Lite luftigare radavstånd i inläggen än i resten av sajten (Kompakt-läget har eget, se typo-classic) */
.post__text { overflow-wrap: anywhere; max-width: 38rem; line-height: 1.65; }
.post__quote {
  margin: 0 0 10px; padding: 8px 12px; border-left: 3px solid var(--color-border);
  background: var(--color-subtle); color: var(--color-muted); font-size: 0.875rem; border-radius: 0 8px 8px 0;
}
.post__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 8px; font-size: 0.875rem; }
.post__reply { text-decoration: none; }
.report summary { cursor: pointer; color: var(--color-muted); }
/* Svara till vänster, Anmäl till höger (formuläret fälls ut under, högerställt) */
.post__actions .report { margin-left: auto; text-align: right; }
.form--compact { display: grid; gap: 6px; margin-top: 8px; max-width: 420px; }

.attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.attachment--image img {
  display: block; width: 160px; height: 120px; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--color-border);
}
.attachment--file {
  display: inline-block; padding: 6px 10px; border-radius: 8px;
  border: 1px solid var(--color-border); background: var(--color-subtle); text-decoration: none;
}
.reply-box { margin-top: 24px; }

.notice {
  padding: 10px 14px; border-radius: var(--radius);
  background: #fff6d6; color: #5c4700; border: 1px solid #ecd27a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .notice { background: #3a3215; color: #f3e3a6; border-color: #6b5a1d; }
}
:root[data-theme="dark"] .notice { background: #3a3215; color: #f3e3a6; border-color: #6b5a1d; }
.upload-check { display: grid; gap: 2px; }

/* ---------- Startsida, kategorier, notiser ---------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.home-latest h2, .category-card h2 { font-size: 1.125rem; margin: 0 0 4px; }
.home-latest { margin-bottom: 32px; }

/* "Från arkivet": små kort med tråd-tips */
.highlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.highlight-card {
  background: var(--color-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.highlight-card h2 {
  font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--color-muted, inherit); margin: 0 0 8px;
}
.highlight-card p { margin: 0 0 4px; }
.highlight-list { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.highlight-list .small, .highlight-card .small { display: block; }

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.category-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 4px solid var(--cat, var(--color-accent));
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.category-card h2 a { color: var(--color-text); text-decoration: none; }
.category-card h2 a:hover { color: var(--cat, var(--color-accent)); }
.category-card header p { margin: 0; }
.thread-list--compact { margin: 0; border-top: 0; }
.thread-list--compact .thread-row { padding: 8px 0; }
.thread-list--compact .thread-row__title { font-size: 1rem; }
.category-chip {
  display: inline-block; margin-right: 6px; padding: 0 8px; border-radius: 999px;
  border-left: 4px solid var(--cat); background: var(--color-subtle);
  color: var(--color-text); text-decoration: none; font-size: 0.8125rem;
}
.category-head { border-left: 5px solid var(--cat); padding-left: 14px; }
.page-head__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.page-head__actions form { margin: 0; }

.subscription-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 12px; font-size: 0.9375rem; }
.subscription-form select {
  font: inherit; color: var(--color-text); background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: 8px; padding: 5px 8px; max-width: 100%;
}

.bell { position: relative; text-decoration: none; }
.bell__count {
  position: absolute; top: -8px; right: -12px; min-width: 18px; padding: 0 5px;
  border-radius: 999px; background: #b3261e; color: #fff; font-size: 0.6875rem; font-weight: 700; text-align: center;
}
.notification-list { list-style: none; padding: 0; margin: 16px 0; border-top: 1px solid var(--color-border); }
.notification { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 10px 4px; border-bottom: 1px solid var(--color-border); }
.notification--unread { background: color-mix(in srgb, var(--color-accent) 12%, transparent); }
.notification--unread a { font-weight: 700; }
.field ul li label { font-weight: 400; }
#id_email_notifications { flex-direction: column; }

/* ---------- Gäster och Eftersnack ---------- */
.field:has(.hp) { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.guest-badge {
  display: inline-block; padding: 0 7px; border-radius: 999px; font-size: 0.75rem;
  border: 1px solid var(--color-border); color: var(--color-muted); background: var(--color-subtle);
}
.guest-notice {
  margin: 0 0 16px; padding: 12px 16px; border-radius: var(--radius);
  background: var(--color-surface); border: 1px solid var(--color-border); border-left: 4px solid var(--color-link);
  font-size: 0.9375rem;
}
.guest-notice p { margin: 0 0 6px; }
.guest-notice ul { margin: 0 0 8px; padding-left: 1.2em; }
.reply-box--top { margin: 8px 0 24px; padding-bottom: 8px; border-bottom: 1px solid var(--color-border); }

/* ---------- Övergångar ---------- */
.subnav { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin: 0 0 20px; }
.subnav a[aria-current="page"] { font-weight: 600; text-decoration: none; color: var(--color-text); }
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 16px; }
.filter-bar .field { min-width: 160px; }
.transfer-list { list-style: none; padding: 0; margin: 0 0 16px; border-top: 1px solid var(--color-border); }
.transfer-row { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--color-border); }
.transfer-row__name { font-weight: 600; }
.transfer-row__meta { margin-left: auto; }
.badge--rumor { background: var(--color-subtle); border: 1px dashed var(--color-muted); color: var(--color-muted); }
.transfer-detail__route { font-size: 1.25rem; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin: 16px 0 32px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--color-border); }
.plus { color: #2f7d32; } .minus { color: #b3261e; }
.bars { list-style: none; padding: 0; display: grid; gap: 4px; }
.bars li { display: grid; grid-template-columns: 4em 1fr 3em; gap: 8px; align-items: center; }
.bars .bar { height: 12px; width: var(--pct); background: var(--color-accent); border-radius: 3px; }
.club-chain { line-height: 1.6; }

/* ---------- Sök ---------- */
.site-search input { width: 100%; max-width: 220px; padding: 6px 10px; border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-subtle); color: var(--color-text); font: inherit; }
.search-form { margin-bottom: 24px; }
.search-form__main { display: flex; gap: 8px; }
.search-form__main input { flex: 1; font-size: 1.125rem; padding: 8px 12px; }
.search-form__more summary { cursor: pointer; margin: 8px 0; }
.search-threads { margin-bottom: 24px; }
.search-results { list-style: none; padding: 0; margin: 0 0 16px; border-top: 1px solid var(--color-border); }
.search-hit { padding: 12px 0; border-bottom: 1px solid var(--color-border); }
.search-hit__title { font-weight: 600; }
.search-hit__text { margin: 4px 0 0; }
.search-hit mark { background: color-mix(in srgb, var(--color-accent) 35%, transparent); color: inherit; padding: 0 1px; border-radius: 2px; }
.attachment--waiting { display: inline-block; padding: 8px 12px; border: 1px dashed var(--color-border); border-radius: var(--radius); color: var(--color-muted); font-size: 0.875rem; }

/* ---------- Startsidan: ämnen och två spalter ---------- */
.topic-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px; margin: 8px 0 28px;
}
.topic {
  display: grid; gap: 2px; padding: 10px 12px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-left: 5px solid var(--cat, var(--color-accent)); border-radius: var(--radius);
  color: var(--color-text); text-decoration: none;
}
.topic:hover { border-color: var(--cat, var(--color-accent)); }
.topic__name { font-weight: 700; }
.topic__meta { font-size: 0.8125rem; }
.topic__latest { font-size: 0.875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-columns { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
@media (min-width: 960px) {
  .home-columns { grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); }
}
.home-latest .thread-list { margin-top: 8px; }
.home-aside .highlight-grid { grid-template-columns: 1fr; margin: 0; }

/* ---------- Trådsidan ---------- */
.opening-post .post { border-top: 1px solid var(--color-border); }
.thread-tools {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
  margin: 24px 0 8px; padding-top: 16px; border-top: 1px solid var(--color-border);
}
.thread-tools__title { margin: 0; font-size: 1.125rem; }
.thread-tools .subscription-form { margin: 0 0 0 auto; }
.segmented { display: inline-flex; border: 1px solid var(--color-border); border-radius: 999px; overflow: hidden; }
.segmented a { padding: 4px 12px; text-decoration: none; color: var(--color-text); font-size: 0.875rem; }
.segmented a + a { border-left: 1px solid var(--color-border); }
.segmented a[aria-current] { background: var(--color-accent); color: #111; font-weight: 600; }

/* Infällbar skrivruta (trådar och Eftersnack) */
.reply-toggle > summary { list-style: none; display: inline-block; cursor: pointer; }
.reply-toggle > summary::-webkit-details-marker { display: none; }
.reply-toggle[open] > summary { margin-bottom: 12px; }
.reply-toggle__body {
  padding: 16px; background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: var(--radius);
}

/* ---------- Trådlistor som i Discourse: rubrik + utdrag, svar, senaste ---------- */
.thread-list--table .thread-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 4.5rem 8.5rem; gap: 4px 16px;
  align-items: center; padding: 12px 8px 12px 12px;
  border-left: 3px solid var(--cat, transparent);
}
.thread-list--table .thread-row:hover { background: color-mix(in srgb, var(--color-surface) 60%, transparent); }
.thread-list__head {
  display: grid; grid-template-columns: minmax(0, 1fr) 4.5rem 8.5rem; gap: 16px;
  padding: 6px 8px 6px 15px; border-bottom: 1px solid var(--color-border);
  font-size: 0.8125rem; color: var(--color-muted); text-transform: uppercase; letter-spacing: 0.04em;
}
.thread-list__head span:nth-child(n + 2) { text-align: center; }
.thread-row__excerpt {
  margin: 2px 0 4px; color: var(--color-muted); font-size: 0.875rem; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.thread-row__stat { display: grid; justify-items: center; line-height: 1.2; }
.thread-row__stat strong { font-size: 1.0625rem; }
.thread-row__stat span { font-size: 0.75rem; }
.thread-row__last { display: grid; justify-items: center; text-align: center; font-size: 0.875rem; line-height: 1.3; }
.thread-row__last .muted { max-width: 8.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-group {
  padding: 16px 4px 6px; font-size: 0.8125rem; font-weight: 700; color: var(--color-muted);
  text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--color-border);
}
.thread-list--table .thread-row:not(:has(.category-chip)) { border-left-color: transparent; }
@media (max-width: 640px) {
  .thread-list__head { display: none; }
  .thread-list--table .thread-row { grid-template-columns: auto 1fr; }
  .thread-list--table .thread-row__main { grid-column: 1 / -1; }
  .thread-row__stat { display: flex; gap: 4px; align-items: baseline; justify-items: start; }
  .thread-row__stat strong { font-size: 0.875rem; }
  .thread-row__last { display: flex; gap: 6px; justify-items: start; text-align: left; }
}

/* Kategorins sidhuvud och flikar */
.category-banner {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px 24px;
  padding: 16px 20px; margin-bottom: 16px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--cat) 12%, var(--color-surface));
  border: 1px solid color-mix(in srgb, var(--cat) 35%, var(--color-border));
  border-left: 6px solid var(--cat);
}
.category-banner h1 { margin: 0 0 4px; }
.category-banner p { margin: 0 0 4px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--color-border); margin-bottom: 4px; }
.tabs a {
  padding: 8px 14px; text-decoration: none; color: var(--color-muted); font-weight: 600;
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--color-text); }
.tabs a[aria-current="page"] { color: var(--color-text); border-bottom-color: var(--color-accent); }

/* ---------- Artikelarkivet ---------- */
.year-nav { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 12px; }
.year-nav a {
  padding: 3px 10px; border: 1px solid var(--color-border); border-radius: 999px;
  text-decoration: none; color: var(--color-text); font-size: 0.875rem;
}
.year-nav a[aria-current] { background: var(--color-accent); border-color: var(--color-accent); color: #111; font-weight: 600; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag-row .tag { margin: 0; text-decoration: none; color: var(--color-text); }
.tag--active { background: var(--color-accent); border-color: var(--color-accent); color: #111; }
.article-list { list-style: none; padding: 0; margin: 0 0 16px; border-top: 1px solid var(--color-border); }
.article-row {
  display: grid; grid-template-columns: 1fr; gap: 12px; padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
}
.article-row:has(.article-row__img) { grid-template-columns: 140px minmax(0, 1fr); }
.article-row__img { width: 140px; height: 90px; object-fit: cover; border-radius: 8px; }
.article-row__title { font-weight: 700; font-size: 1.0625rem; text-decoration: none; }
.article-row__title:hover { text-decoration: underline; }
.article-row__ingress { margin: 4px 0; color: var(--color-muted); font-size: 0.9375rem; }
.article { max-width: 72ch; }
.article__figure { margin: 16px 0; }
.article__figure img { border-radius: var(--radius); width: 100%; }
.article__ingress { font-size: 1.125rem; font-weight: 600; line-height: 1.5; }
.article__body img { border-radius: 8px; margin: 8px 0; }
.article-nav { display: flex; justify-content: space-between; gap: 16px; margin: 32px 0; padding-top: 16px; border-top: 1px solid var(--color-border); font-size: 0.9375rem; }
.highlight-card--article img { width: 100%; height: 120px; object-fit: cover; border-radius: 8px; margin-bottom: 6px; }
@media (max-width: 640px) {
  .article-row:has(.article-row__img) { grid-template-columns: 96px minmax(0, 1fr); }
  .article-row__img { width: 96px; height: 64px; }
}
.prose p { margin: 0 0 1em; }
.prose a { overflow-wrap: anywhere; }
.prose table { border-collapse: collapse; margin: 1em 0; font-size: 0.9375rem; }
.prose td, .prose th { border: 1px solid var(--color-border); padding: 4px 8px; }
/* ---------- Kompakt läge: gamla Orienterare.nu-typografin ----------
   Väljs med "Kompakt" i sidfoten (sparas i webbläsaren). Värdena är tagna från
   gamla sajtens Style.css/Fonts.css. Roten 14 px gör att allt som anges i rem
   krymper i samma proportion; nedan sätts de exakta värdena där de skiljer sig. */
html.typo-classic { font-size: 14px; }
html.typo-classic body { font-size: 14px; line-height: normal; }
html.typo-classic a { text-decoration: none; }
html.typo-classic h1, html.typo-classic h2, html.typo-classic h3 { line-height: 20px; }
/* Trådrubrik, kategorirubrik: 18 px fet, radhöjd 20 px */
html.typo-classic h1 { font-size: 18px; font-weight: 700; padding: 5px 0; margin: 0 0 8px; }
html.typo-classic h2 { font-size: 15px; font-weight: 700; }
html.typo-classic h3 { font-size: 15px; font-weight: 700; }
/* Inlägg: författare fet, tid och nummer grå, text 14 px – trådstarten 16 px */
html.typo-classic .post__head { font-size: 14px; }
html.typo-classic .post__time, html.typo-classic .post__number { font-size: 14px; }
html.typo-classic .post__text { font-size: 14px; line-height: normal; }
html.typo-classic .opening-post .post__text { font-size: 16px; }
html.typo-classic .post__actions, html.typo-classic .small, html.typo-classic .muted.small { font-size: 12px; }
/* Trådlistor */
html.typo-classic .thread-row__title { font-size: 14px; font-weight: 700; }
html.typo-classic .thread-row__excerpt { font-size: 12px; line-height: 130%; }
/* Artiklar: rubrik 26 px/600, ingress 18 px/600, brödtext 15 px med radavstånd 1,25 */
html.typo-classic .article h1 { font-size: 26px; font-weight: 600; line-height: 1.2; padding: 0; }
html.typo-classic .article__ingress { font-size: 18px; font-weight: 600; line-height: normal; }
html.typo-classic .article__body { font-size: 15px; line-height: 1.25; }
html.typo-classic .article__body h2, html.typo-classic .article__body h3 { font-size: 15px; font-weight: 700; padding: 10px 0 2px; margin: 0; }
html.typo-classic .article-row__title { font-size: 18px; line-height: 20px; }
html.typo-classic .article-row__ingress { font-size: 14px; }

/* Visningsmenyn "Aa" i headern: textstorlek och tema */
.site-account { align-items: center; }
/* Gemensamt för menyerna i headern: Aa, Mer och kontomenyn */
.header-menu { position: relative; }
.header-menu summary { list-style: none; cursor: pointer; }
.header-menu summary::-webkit-details-marker { display: none; }
.header-menu__panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 180px;
  display: grid; gap: 8px; padding: 12px 14px; font-size: 0.9375rem;
  background: var(--color-surface); color: var(--color-text);
  border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: 0 4px 16px rgb(0 0 0 / 0.15);
}
.display-menu summary {
  padding: 2px 8px; border: 1px solid rgb(255 255 255 / 0.3); border-radius: 6px;
  color: var(--color-accent); font-weight: 700; line-height: 1.4;
}
.display-menu[open] summary, .display-menu summary:hover { background: rgb(255 255 255 / 0.1); }
.display-menu__panel {
  min-width: 220px;
}
/* Smal skärm: Aa-knappen kan hamna längst till vänster, så menyn läggs över hela bredden i stället */
@media (max-width: 640px) {
  .display-menu__panel { position: fixed; top: auto; left: 16px; right: 16px; min-width: 0; margin-top: 6px; }
}
.display-settings__row { white-space: nowrap; }
.display-settings button {
  background: none; border: 0; padding: 0 2px; color: inherit; font: inherit; cursor: pointer; text-decoration: underline;
}
.display-settings button[aria-pressed="true"] { font-weight: 700; text-decoration: none; }
.site-footer__inner { flex-wrap: wrap; }

/* ---------- Tråd: sidospalt "Senast kommenterat" (som på gamla sajten) ---------- */
.thread-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
@media (min-width: 960px) {
  .thread-layout { grid-template-columns: minmax(0, 46rem) 300px; justify-content: space-between; gap: 48px; }
  .recent-threads { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
}
.recent-threads { align-self: start; font-size: 0.9375rem; }
.recent-threads__title {
  margin: 0 0 4px; padding-bottom: 6px; font-size: 1rem; border-bottom: 1px solid var(--color-border);
}
.recent-threads__day {
  margin: 10px 0 2px; padding: 2px 0; font-size: 0.875rem; font-weight: 400; color: var(--color-muted);
  border-bottom: 1px solid var(--color-border);
}
.recent-threads ul { list-style: none; margin: 0; padding: 0; }
.recent-threads li {
  display: grid; grid-template-columns: 3.2em minmax(0, 1fr) auto; gap: 8px; padding: 3px 0; line-height: 1.3;
}
.recent-threads time { color: var(--color-muted); font-variant-numeric: tabular-nums; }
.recent-threads li a { text-decoration: none; }
.recent-threads li a:hover { text-decoration: underline; }
.recent-threads li[aria-current] a { font-weight: 700; color: var(--color-text); }
.recent-threads__count { color: var(--color-accent-strong); font-size: 0.8125rem; white-space: nowrap; }
html.typo-classic .recent-threads { font-size: 14px; }
html.typo-classic .recent-threads__title { font-size: 14px; }
html.typo-classic .recent-threads__day { font-size: 14px; }

/* Inläggen hålls lagom smala så att raderna blir lättlästa (ca 75–85 tecken per rad). */
.post, .opening-post, .reply-box, .thread-tools { max-width: 46rem; }

/* ---------- Inlänkat ---------- */
.link-list { list-style: none; padding: 0; margin: 0 0 16px; border-top: 1px solid var(--color-border); max-width: 46rem; }
.link-row { padding: 10px 0; border-bottom: 1px solid var(--color-border); }
.link-row__title { font-weight: 600; text-decoration: none; }
.link-row__title:hover { text-decoration: underline; }
.link-row__meta { font-size: 0.875rem; margin-top: 2px; }
.link-row__domain { font-weight: 600; }
.link-detail { max-width: 46rem; }
.link-detail__url { overflow-wrap: anywhere; }
.home-links { margin-bottom: 24px; }
.home-links h2 { font-size: 1.125rem; margin: 0 0 6px; }
.home-links h2 a { color: inherit; text-decoration: none; }
.home-links ul { list-style: none; margin: 0 0 6px; padding: 0; }
.home-links li { display: grid; padding: 5px 0; border-bottom: 1px solid var(--color-border); line-height: 1.3; }
.home-links li a { text-decoration: none; }
.home-links li a:hover { text-decoration: underline; }

/* Nålade trådar på startsidan */
.pinned { margin-bottom: 20px; padding: 10px 14px; background: var(--color-subtle); border: 1px solid var(--color-border); border-radius: 8px; }
.pinned h2 { font-size: 1.125rem; margin: 0 0 4px; }
.pinned ul { list-style: none; margin: 0; padding: 0; }
.pinned li { display: grid; padding: 5px 0; line-height: 1.3; }
.pinned li + li { border-top: 1px solid var(--color-border); }
.pinned li a { font-weight: 600; text-decoration: none; }
.pinned li a:hover { text-decoration: underline; }

/* Fasta sidor (Om oss, Forumregler, Integritetspolicy, Kontakt) */
.static-page { line-height: 1.6; }
.static-page h2 { font-size: 1.25rem; margin: 1.6em 0 0.4em; }
.static-page ul { padding-left: 1.25rem; }
.static-page li { margin-bottom: 0.4em; }

/* Redigeraren för de fasta sidorna */
.static-page__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.editor { border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-surface); }
.editor__toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border-bottom: 1px solid var(--color-border); background: var(--color-subtle); border-radius: 8px 8px 0 0; }
.editor__toolbar button { font: inherit; font-size: 0.875rem; padding: 4px 8px; border: 1px solid var(--color-border); border-radius: 6px; background: var(--color-surface); color: var(--color-text); cursor: pointer; }
.editor__toolbar button:hover, .editor__toolbar button[aria-pressed="true"] { border-color: var(--color-accent); }
.editor__sep { width: 1px; background: var(--color-border); margin: 0 4px; }
.editor__area { min-height: 24rem; padding: 12px 16px; outline: none; }
.editor__area:focus { box-shadow: inset 0 0 0 2px var(--color-accent); border-radius: 0 0 8px 8px; }
.editor textarea.editor__source { display: block; width: 100%; min-height: 24rem; border: 0; padding: 12px; font-family: ui-monospace, monospace; font-size: 0.875rem; box-sizing: border-box; background: var(--color-surface); color: var(--color-text); }
.editor textarea.editor__source[hidden] { display: none; }

/* Nytt sedan senast: länk i trådlistan och ruta överst i tråden */
.unread-link { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; line-height: 1.6; vertical-align: middle; background: var(--color-accent); color: #1d1a10; text-decoration: none; }
.unread-link:hover { background: var(--color-accent-strong); }
.unread-jump { max-width: 46rem; margin: 0 0 12px; padding: 8px 12px; border-left: 4px solid var(--color-accent); background: var(--color-subtle); border-radius: 0 8px 8px 0; }
.unread-jump[hidden] { display: none; }

/* Citat i inlägg (rader som börjar med >) och knappen Citera */
.post__citation { margin: 6px 0 10px; padding: 6px 12px; border-left: 3px solid var(--color-accent); background: var(--color-subtle); border-radius: 0 8px 8px 0; color: var(--color-muted); }
.quote-button { position: absolute; z-index: 20; padding: 5px 12px; border: 0; border-radius: 999px; background: var(--color-accent); color: #1d1a10; font: inherit; font-size: 0.875rem; font-weight: 700; box-shadow: 0 2px 8px rgb(0 0 0 / 25%); cursor: pointer; }
.quote-button[hidden] { display: none; }

/* Ändrat inlägg */
.post__edited { font-size: 0.8125rem; }

/* Startsidan som på gamla sajten: rutor med senast startade trådar, "Senast kommenterat" till höger */
.home-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
@media (min-width: 960px) {
  .home-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; }
}
.home-layout__main > section + section { margin-top: 32px; }
.home-layout__aside > * + * { margin-top: 28px; }
/* Smal skärm: allt i en kolumn med "Senast kommenterat" överst, sedan trådrutorna och resten */
@media (max-width: 959.98px) {
  .home-layout { display: flex; flex-direction: column; gap: 32px; }
  .home-layout__main, .home-layout__aside { display: contents; }
  .home-layout__main > section + section, .home-layout__aside > * + * { margin-top: 0; }
  .recent-threads--home { order: -1; }
}
.section-title { font-size: 1.125rem; margin: 0 0 10px; padding-bottom: 4px; border-bottom: 1px solid var(--color-border); }
.thread-boxes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 640px) {
  .thread-boxes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.thread-box { border: 1px solid var(--color-border); border-radius: 6px; overflow: hidden; background: var(--color-surface); font-size: 0.9375rem; line-height: 1.35; }
.thread-box__top { display: flex; align-items: baseline; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--color-border); background: linear-gradient(to bottom, var(--box-top-from), var(--box-top-to)); }
.thread-box--new .thread-box__top { --box-top-from: var(--box-new-from); --box-top-to: var(--box-new-to); }
.thread-box__title { flex: 1; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.thread-box__title:hover { text-decoration: underline; }
.thread-box__meta { flex: none; display: flex; gap: 8px; color: var(--color-muted); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.thread-box--new .thread-box__meta { color: var(--color-accent-strong); font-weight: 700; }
.thread-box__by { padding: 5px 10px 0; color: var(--color-muted); font-size: 0.8125rem; }
.thread-box__by:last-child { padding-bottom: 6px; }
.thread-box__last { padding: 0 10px 6px; color: var(--color-muted); font-size: 0.8125rem; }
.home-more { margin: 10px 0 0; }
.recent-threads--home { position: static; max-height: none; overflow: visible; }

/* YouTube i inlägg: en ruta med uppspelningsknapp, spelaren laddas först vid klick (js/embed.js) */
.video-embed { position: relative; max-width: 560px; aspect-ratio: 16 / 9; margin: 10px 0 4px; border-radius: 8px; overflow: hidden; background: #111; }
.video-embed__play { display: flex; height: 100%; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px; color: #f4f3ee; text-align: center; text-decoration: none; }
.video-embed__play:hover, .video-embed__play:focus-visible { color: #fff; background: #222; }
.video-embed__icon { display: grid; width: 64px; height: 44px; place-items: center; border-radius: 12px; background: #c4302b; color: #fff; font-size: 1.4rem; }
.video-embed__note { color: #a5a59b; font-size: 0.8125rem; }
.video-embed iframe { display: block; width: 100%; height: 100%; border: 0; }

/* Strava och Livelox: ett kort under inlägget (Strava laddas vid klick, Livelox är en länk) */
.embed-card { max-width: 560px; margin: 10px 0 4px; }
.embed-card__link { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--color-border); border-left: 4px solid var(--embed-color); border-radius: 8px; background: var(--color-subtle); color: var(--color-text); text-decoration: none; }
.embed-card__link:hover, .embed-card__link:focus-visible { border-color: var(--embed-color); }
.embed-card--strava { --embed-color: #fc5200; }
.embed-card--livelox { --embed-color: #2e8b57; }
.embed-card__icon { flex: none; font-size: 1.5rem; }
.embed-card__text { display: flex; min-width: 0; flex-direction: column; }
.embed-card__text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.embed-card__note { color: var(--color-muted); font-size: 0.8125rem; }
.post__text iframe[src*="strava-embeds.com"] { max-width: 560px !important; margin: 10px 0 4px; }

/* Länkar till kända tjänster får en liten ikon framför */
.post__text a[href*="livelox.com"]::before { content: "🗺️ "; }
.post__text a[href*="strava.com"]::before, .post__text a[href*="strava.app.link"]::before { content: "🏃 "; }
.post__text a[href*="eventor.orientering.se"]::before { content: "📅 "; }

/* Formatering i inlägg (**fet**, *kursiv*, listor) och knapparna ovanför textrutan */
.post__list { margin: 4px 0 8px; padding-left: 1.5em; }
.post__list li { margin: 2px 0; }
.format-bar { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.format-bar__button { min-width: 32px; padding: 3px 9px; border: 1px solid var(--color-border); border-radius: 6px; background: var(--color-surface); color: var(--color-text); font: inherit; font-size: 0.875rem; line-height: 1.4; cursor: pointer; }
.format-bar__button:hover, .format-bar__button:focus-visible { border-color: var(--color-accent); background: var(--color-subtle); }
.format-bar__bold { font-weight: 700; }
.format-bar__italic { font-style: italic; font-family: Georgia, serif; }

/* Profilbilder */
.avatar { flex: none; border-radius: 50%; object-fit: cover; background: var(--color-subtle); }
.avatar--small { width: 32px; height: 32px; align-self: center; }
.avatar--large { width: 96px; height: 96px; }
.profile__head { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.profile__head h1 { margin: 0; }
.profile__head p { margin: 4px 0 0; }
.settings-avatar { margin: 8px 0; }

/* Liknande trådar under tråden, och förslag när man skriver rubriken till en ny tråd */
.similar-threads { max-width: 46rem; margin: 24px 0 8px; padding-top: 12px; border-top: 1px solid var(--color-border); }
.similar-threads h2 { margin: 0 0 8px; font-size: 1.0625rem; }
.similar-threads ul, .suggest ul { list-style: none; margin: 0; padding: 0; }
.similar-threads li, .suggest li { padding: 4px 0; }
.suggest { margin: -4px 0 12px; padding: 10px 14px; border-left: 3px solid var(--color-accent); background: var(--color-subtle); border-radius: 0 8px 8px 0; }
.suggest[hidden] { display: none; }
.suggest__title { margin: 0 0 4px; font-weight: 600; }

/* Annonser */
.kop-list, .kop-mine { list-style: none; margin: 0; padding: 0; }
.kop-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--color-border); }
.kop-row__image { display: block; width: 72px; height: 72px; border-radius: 6px; overflow: hidden; background: var(--color-subtle); }
.kop-row__image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kop-row__noimage { display: grid; place-items: center; height: 100%; font-size: 1.5rem; opacity: 0.6; }
.kop-row__title { font-weight: 600; text-decoration: none; }
.kop-row__title:hover { text-decoration: underline; }
.kop-row__meta { margin-top: 2px; }
.kop-row__price { font-weight: 700; white-space: nowrap; }
.kop-kind { font-size: 0.75rem; vertical-align: 2px; }
.kop-kind--kopes { background: var(--color-subtle); border: 1px solid var(--color-border); color: var(--color-text); }
.kop-detail h1 { margin-bottom: 6px; }
.kop-detail__facts { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; margin: 0 0 16px; }
.kop-detail__price { font-size: 1.25rem; }
.kop-gallery { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.kop-gallery img { display: block; max-height: 240px; max-width: 100%; border-radius: 6px; }
.kop-detail__text { max-width: 70ch; }
.kop-detail__owner { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--color-border); }
.kop-contact { max-width: 560px; margin-top: 32px; }
.kop-contact h2 { font-size: 1.125rem; }
.kop-mine__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--color-border); }
.kop-mine__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.kop-edit-images { display: flex; flex-wrap: wrap; gap: 12px; border: 0; padding: 0; }
.kop-edit-images legend { font-weight: 600; margin-bottom: 6px; }
.kop-edit-images__item { display: grid; gap: 4px; font-weight: normal; }
.kop-edit-images__item img { width: 120px; height: 90px; object-fit: cover; border-radius: 6px; }
@media (max-width: 520px) {
  .kop-row { grid-template-columns: 56px minmax(0, 1fr); }
  .kop-row__image { width: 56px; height: 56px; }
  .kop-row__price { grid-column: 2; }
}

/* +1 på inlägg: en liten knapp bland Svara/Anmäl, siffran bara när någon har gett +1 */
.plus-one { display: inline; margin: 0; }
.plus-one__button {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border: 1px solid var(--color-border);
  border-radius: 999px; background: none; color: var(--color-muted); font: inherit; font-weight: 700; cursor: pointer;
}
.plus-one__button:hover { border-color: var(--color-accent); color: var(--color-text); }
.plus-one__button[aria-pressed="true"] {
  border-color: var(--color-accent); color: var(--color-text);
  background: color-mix(in srgb, var(--color-accent) 15%, var(--color-surface));
}
.plus-one__count:empty { display: none; }
.plus-one__count { font-weight: 600; }
.plus-one__total { font-weight: 600; }

/* ---------- Mobilmenyn: logga, 🔔, Aa och ☰ Meny på en rad, resten fälls ut ---------- */
.menu-toggle, .site-nav__account { display: none; }
@media (max-width: 760px) {
  .site-header__inner { gap: 10px 12px; padding-top: 8px; padding-bottom: 8px; }
  .site-logo img { width: 92px; }
  .site-nav, .site-search { flex-basis: 100%; }
  .site-search input { max-width: none; }

  html.js .menu-toggle {
    display: inline-flex; align-items: center; gap: 6px; order: 2; padding: 5px 12px;
    border: 1px solid rgb(255 255 255 / 0.3); border-radius: 6px; background: none;
    color: var(--color-header-text); font: inherit; font-weight: 600; cursor: pointer;
  }
  html.js .menu-toggle[aria-expanded="true"] { background: rgb(255 255 255 / 0.1); }
  html.js .site-account { order: 1; margin-left: auto; }
  html.js .site-account__more { display: none; }
  html.js .site-nav { order: 3; }
  html.js .site-search { order: 4; }
  html.js .site-header:not(.is-open) .site-nav,
  html.js .site-header:not(.is-open) .site-search { display: none; }

  /* Utfälld: menyvalen som en lista med stora ytor att trycka på */
  html.js .site-nav ul { flex-direction: column; gap: 0; }
  html.js .site-nav a, html.js .site-nav .link-button {
    display: block; width: 100%; padding: 10px 4px; border-radius: 0; text-align: left;
    border-bottom: 1px solid rgb(255 255 255 / 0.1); color: var(--color-header-text); font-weight: 600;
  }
  html.js .site-nav a[aria-current="page"] { color: var(--color-accent); }
  html.js .site-nav__account { display: block; }
  html.js .site-nav__account a, html.js .site-nav__account .link-button { font-weight: 400; color: var(--color-accent); }
  html.js .site-nav__account--first { margin-top: 12px; }
  html.js .site-nav__account form { margin: 0; }
}

/* ---------- Sidhuvudet på större skärmar ----------
   Loggan till vänster över två rader: överst sök, Aa, notiser och kontomenyn, under dem menyvalen.
   Blir inte högre än loggan och radbryts inte huller om buller. */
.site-nav__more { display: none; }
@media (min-width: 761px) {
  .site-header__inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "logo search account" "logo nav nav";
    gap: 6px 20px;
    align-items: center;
  }
  .site-logo { grid-area: logo; }
  .site-search { grid-area: search; justify-self: end; width: 100%; max-width: 240px; }
  .site-search input { max-width: none; }
  .site-account { grid-area: account; }
  .site-nav { grid-area: nav; margin-left: -10px; } /* första valets text i linje med sökrutan ovanför */
  .site-nav ul { flex-wrap: nowrap; }
  .site-nav a, .nav-more summary { white-space: nowrap; }
}
/* Mellanbredd: lite tätare, och de minst använda valen under "Mer" */
@media (min-width: 761px) and (max-width: 920px) {
  .site-nav { font-size: 0.9375rem; }
  .site-nav a, .nav-more summary { padding: 6px 8px; }
  .site-nav__extra { display: none; }
  .site-nav__more { display: block; }
}
.nav-more summary {
  display: block; padding: 6px 10px; border-radius: 999px; font-weight: 600; color: var(--color-header-text);
}
.nav-more summary:hover, .nav-more[open] summary { background: rgb(255 255 255 / 0.1); color: var(--color-accent); }
.nav-more:has(a[aria-current="page"]) summary { color: var(--color-accent); }
.site-nav .nav-more__panel { display: grid; gap: 2px; left: 0; right: auto; padding: 6px; }
.site-nav .nav-more__panel a { color: var(--color-text); font-weight: 600; border-radius: 6px; }
.site-nav .nav-more__panel a:hover { background: var(--color-subtle); color: var(--color-link); }

/* Kontomenyn: användarnamnet med profil, inställningar och utloggning under */
.account-menu summary { display: flex; align-items: center; gap: 4px; color: var(--color-accent); padding: 2px 4px; }
.account-menu summary:hover .account-menu__name { text-decoration: underline; }
.account-menu__name { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-account .account-menu__panel a, .account-menu__panel .link-button { color: var(--color-link); }
.account-menu__panel form { margin: 0; }
.account-menu__panel .link-button { text-align: left; }
