/* Kontrollpanelen – ljust, luftigt och lättläst */
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/AtkinsonHyperlegible-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/AtkinsonHyperlegible-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/AtkinsonHyperlegible-Italic.ttf") format("truetype"); font-style: italic; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible Mono"; src: url("fonts/AtkinsonHyperlegibleMono.ttf") format("truetype"); font-weight: 200 800; font-display: swap; }

:root {
  --ink: #17242c;
  --ink-soft: #4a5b66;
  --bg: #f3f6f8;
  --surface: #ffffff;
  --line: #d3dde3;
  --lake: #1f5a80;
  --lake-deep: #154361;
  --lake-wash: #e2edf4;
  --pine: #2d6a4f;
  --pine-wash: #e3f0e8;
  --brick: #a3402a;
  --brick-wash: #f7e6e1;
  --sun-wash: #fbf1dc;
  --focus: #e0a526;
  --font: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Atkinson Hyperlegible Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.5625rem;
  --step-3: 2.441rem;
  --radius: 6px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: var(--step-0)/1.5 var(--font); }
a { color: var(--lake-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--lake); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 20; border-radius: var(--radius); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-soft); }
.small { font-size: var(--step--1); }

/* ---------- Huvud ---------- */
.masthead { background: var(--lake-deep); color: #fff; padding: 20px 0 32px; }
.masthead-note { display: inline-block; margin: 0 0 18px; padding: 2px 10px; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; font-size: var(--step--1); color: rgba(255,255,255,.85); }
.brand { margin: 0; font-size: var(--step-3); line-height: 1.15; font-weight: 700; letter-spacing: -.01em; }
.tagline { margin: 8px 0 0; font-size: var(--step-1); color: rgba(255,255,255,.85); }

/* ---------- Navigering som chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 20px 0 4px; }
.chip { display: inline-flex; align-items: center; min-height: 34px; padding: 5px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: var(--step--1); text-decoration: none; }
.chip:hover { border-color: var(--lake); color: var(--lake-deep); }
.chip.is-active { background: var(--lake); border-color: var(--lake); color: #fff; font-weight: 700; }

/* ---------- Sidlayout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 254px; gap: 32px; align-items: start; padding-top: 16px; padding-bottom: 48px; }
.layout-wide { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 820px) { .layout { grid-template-columns: 1fr; } }
main { min-width: 0; }

/* ---------- Kort och rubriker ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 20px; margin: 0 0 16px; }
.card-accent { border-top: 4px solid var(--pine); }
.card > h2:first-child, .card > input + h2, .card > input + input + h2 { margin-top: 0; }
h2 { font-size: var(--step-1); line-height: 1.25; margin: 0 0 12px; }
h3 { font-size: var(--step-0); margin: 16px 0 8px; }
p { margin: 0 0 12px; }
.empty { color: var(--ink-soft); margin: 0; }

/* ---------- Formulär ---------- */
label { display: block; font-weight: 700; font-size: var(--step--1); margin: 14px 0 4px; color: var(--ink); }
.card > label:first-of-type { margin-top: 4px; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: var(--step-0); margin: 12px 0 0; cursor: pointer; }
label.check input { margin: 4px 0 0; width: 18px; height: 18px; accent-color: var(--lake); flex: none; }
.hint { font-size: var(--step--1); color: var(--ink-soft); margin-top: 4px; }
input[type=text], input[type=url], input[type=password], input[type=number], input[type=time], input[type=email], input[type=search], select, textarea {
  width: 100%; min-height: 42px; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px;
}
input:hover, select:hover { border-color: #b9c8d1; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--focus); outline-offset: 0; border-color: var(--lake); }
input[type=file] { font: inherit; font-size: var(--step--1); max-width: 100%; }
input[type=file]::file-selector-button { font: inherit; font-weight: 700; color: var(--lake-deep); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 12px; margin-right: 10px; cursor: pointer; }
.input-short { max-width: 140px; }
.color-input { width: 56px; height: 40px; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-top: 8px; cursor: pointer; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.grid2 > .card { margin-bottom: 16px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------- Knappar ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 14px; font: inherit; font-size: var(--step--1); font-weight: 700; color: var(--lake-deep); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--lake); color: var(--lake); }
.btn-primary { background: var(--lake); border-color: var(--lake); color: #fff; }
.btn-primary:hover { background: var(--lake-deep); border-color: var(--lake-deep); color: #fff; }
.btn-small { min-height: 32px; padding: 4px 10px; }
.btn-danger { color: var(--brick); }
.btn-danger:hover { background: var(--brick-wash); border-color: var(--brick); color: var(--brick); }
.btn.busy { opacity: .6; pointer-events: none; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.actions.sticky { position: sticky; bottom: 0; z-index: 5; margin: 0 0 16px; padding: 12px 0; background: linear-gradient(to top, var(--bg) 75%, rgba(243,246,248,0)); }
.actions select { width: auto; }

/* ---------- Meddelanden och märken ---------- */
.notice { border: 1px solid var(--line); border-left: 4px solid var(--lake); background: var(--surface); border-radius: var(--radius); padding: 12px 14px; margin: 0 0 16px; }
.notice-ok { border-left-color: var(--pine); background: var(--pine-wash); border-color: #c6ddd0; }
.notice-err { border-left-color: var(--brick); background: var(--brick-wash); border-color: #ebc9c0; }
.notice-warn { border-left-color: var(--focus); background: var(--sun-wash); border-color: #efdcb0; }
.notice p { margin: 0 0 10px; }
.notice p:last-child { margin: 0; }
.notice form { margin: 0; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--pine-wash); background: color-mix(in srgb, var(--pine) 13%, #fff); color: var(--pine); font-size: 0.8125rem; font-weight: 700; line-height: 1.6; vertical-align: 1px; white-space: nowrap; }
.badge-lake { background: var(--lake-wash); color: var(--lake-deep); }
.badge-muted { background: #eef2f4; color: var(--ink-soft); font-weight: 400; }
.badge-warn { background: var(--sun-wash); color: #7a5308; }
pre { font: 0.8125rem/1.55 var(--mono); background: #f7f9fa; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin: 0 0 12px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 300px; overflow: auto; }

/* ---------- Tidningslistor i agendastil ---------- */
.days { list-style: none; margin: 0; padding: 0; }
.day { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.day:first-child { padding-top: 0; }
.day:last-child { border-bottom: 0; padding-bottom: 0; }
.day-date { display: flex; flex-direction: column; }
.day-num { font: 300 2.25rem/1 var(--mono); color: var(--ink); }
.day-name { font-size: var(--step--1); color: var(--ink-soft); margin-top: 4px; }
.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.item { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-left-width: 3px; border-radius: var(--radius); padding: 10px 14px; }
.item:hover { border-left-color: var(--lake); }
.item-time { font: 0.9375rem var(--mono); color: var(--ink-soft); flex: none; }
.item-main { flex: 1; min-width: 0; }
.item-title { font-size: var(--step-1); font-weight: 700; color: var(--ink); text-decoration: none; margin-right: 6px; }
.item-title:hover { color: var(--lake); text-decoration: underline; }
.item-meta { display: block; font-size: var(--step--1); color: var(--ink-soft); }
.item-action { margin: 0; }
@media (max-width: 560px) { .day { grid-template-columns: 1fr; } .day-date { flex-direction: row; gap: 10px; align-items: baseline; } .item { flex-wrap: wrap; } }

.plain-list { list-style: none; margin: 0 0 12px; padding: 0; }
.plain-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.plain-list li:last-child { border-bottom: 0; }
.archive { list-style: none; padding: 0; margin: 0 0 16px; }
.archive li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.archive .meta { font-size: var(--step--1); color: var(--ink-soft); display: inline-flex; align-items: center; gap: 8px; }
.archive .meta form { margin: 0; }

/* ---------- Flöden ---------- */
.feed-list { display: grid; gap: 10px; }
.feed { display: grid; grid-template-columns: 58px minmax(0, 2.4fr) minmax(0, 1.2fr) 74px auto auto; gap: 10px; align-items: end; border: 1px solid var(--line); border-left-width: 3px; border-radius: var(--radius); padding: 10px 12px 12px; background: var(--surface); }
.feed label { margin-top: 0; }
.feed-new { border-style: dashed; border-left-style: solid; border-left-color: var(--pine); background: #fbfdfc; }
.feed-order input { text-align: center; }
.feed-flags { display: flex; flex-direction: column; gap: 2px; padding-bottom: 4px; }
.feed-flags label.check { margin: 0; font-size: var(--step--1); white-space: nowrap; }
.feed-flags label.check input { margin-top: 2px; width: 16px; height: 16px; }
.feed-test { padding-bottom: 4px; }
@media (max-width: 760px) {
  .feed { grid-template-columns: 58px 1fr 74px; }
  .feed-url { grid-column: 2 / 4; }
  .feed-section { grid-column: 1 / 3; }
  .feed-flags { flex-direction: row; gap: 14px; grid-column: 1 / 3; }
}

/* ---------- Statuspanel ---------- */
.side-panel { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--pine); border-radius: var(--radius); padding: 16px 18px 12px; position: sticky; top: 16px; }
.side-panel h2 { margin-bottom: 8px; }
.status { margin: 0; }
.status > div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.status dt { font-size: var(--step--1); color: var(--ink-soft); }
.status dd { margin: 2px 0 0; }
.status a { font-weight: 700; color: var(--lake-deep); }
.side-actions { display: grid; gap: 8px; margin: 14px 0 6px; }
.side-actions .btn { width: 100%; }
.side-foot { margin: 10px 0 4px; font-size: var(--step--1); }
.side-foot a { font-weight: 700; }
@media (max-width: 820px) { .side-panel { position: static; } }

/* ---------- Sidfot ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 24px 0 40px; font-size: var(--step--1); color: var(--ink-soft); }
.site-footer p { max-width: 520px; margin: 0 0 10px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }

/* ---------- Inloggning ---------- */
.login { max-width: 460px; padding-top: 32px; padding-bottom: 48px; }

/* ---------- Laddningsruta ---------- */
.overlay { position: fixed; inset: 0; background: rgba(21, 67, 97, .55); display: none; align-items: center; justify-content: center; padding: 16px; z-index: 30; }
.overlay.on { display: flex; }
.overlay-card { background: var(--surface); border-radius: var(--radius); border-top: 4px solid var(--pine); padding: 24px 28px; text-align: center; max-width: 320px; box-shadow: 0 12px 40px rgba(0,0,0,.18); }
.overlay-card p { margin: 0 0 4px; }
.spinner { width: 34px; height: 34px; margin: 0 auto 14px; border: 3px solid var(--lake-wash); border-top-color: var(--lake); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* ---------- Layoutväljare ---------- */
.themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 4px; }
@media (max-width: 640px) { .themes { grid-template-columns: 1fr; } }
.theme { position: relative; display: block; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; font-weight: 400; }
.theme:hover { border-color: var(--lake); }
.theme:has(input:checked) { border: 2px solid var(--lake); padding: 11px; background: var(--lake-wash); }
.theme input { position: absolute; opacity: 0; }
.theme:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.theme strong { display: block; font-size: var(--step-0); margin-top: 8px; }
.theme-prev { display: block; height: 88px; background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 8px; }
.theme-prev b { display: block; height: 12px; margin-bottom: 8px; border-radius: 2px; }
.theme-prev i { display: inline-block; width: 28%; height: 48px; margin-right: 4%; background: repeating-linear-gradient(#c5d0d6 0 2px, transparent 2px 6px); }
.theme-prev i:last-child { margin-right: 0; }
.theme-klassisk b { background: #222; width: 70%; margin-left: 15%; }
.theme-modern b { background: #111; width: 80%; box-shadow: 0 6px 0 -4px #d7261e; }
.theme-magasin b { background: #a4472f; width: 50%; margin-left: 25%; height: 10px; }
.theme-magasin i { width: 46%; }
.theme-magasin i:nth-child(4) { display: none; }

/* ---------- Design-fliken ---------- */
.design-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; align-items: start; }
@media (max-width: 900px) { .design-grid { grid-template-columns: 1fr; } .design-side { order: -1; } }
.design-side { position: sticky; top: 16px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { margin: 0; font-weight: 400; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; align-items: center; min-height: 34px; padding: 5px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: var(--step--1); cursor: pointer; }
.seg span:hover { border-color: var(--lake); }
.seg input:checked + span { background: var(--lake); border-color: var(--lake); color: #fff; font-weight: 700; }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.logo-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 16px; }
@media (max-width: 520px) { .logo-row { grid-template-columns: 1fr; } }
.logo-row label { margin-top: 0; }
.logo-box { height: 104px; border: 1px dashed #b9c8d1; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; background: repeating-conic-gradient(#eef2f4 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.logo-box img { max-width: 90%; max-height: 88px; }
.diag { margin: 14px 0 4px; border: 1px solid var(--line); border-radius: var(--radius); background: #fafbfc; }
.diag summary { cursor: pointer; padding: 9px 12px; font-weight: 700; font-size: var(--step--1); }
.diag-list { list-style: none; margin: 0; padding: 0 12px 10px; font-size: var(--step--1); }
.diag-list li { padding: 5px 0 5px 24px; position: relative; border-top: 1px solid var(--line); }
.diag-list li::before { position: absolute; left: 2px; top: 5px; font-weight: 700; }
.diag-ok::before { content: "✓"; color: var(--pine); }
.diag-warn::before { content: "!"; color: #9a6a0a; left: 6px !important; }
.diag-err::before { content: "×"; color: var(--brick); }
.palettes { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.pal { display: inline-flex; align-items: center; gap: 0; min-height: 36px; padding: 4px 12px 4px 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; font-size: var(--step--1); cursor: pointer; }
.pal:hover { border-color: var(--lake); }
.pal span { width: 16px; height: 26px; display: inline-block; border: 1px solid rgba(0,0,0,.08); }
.pal span:first-child { border-radius: 999px 0 0 999px; width: 20px; }
.pal em { font-style: normal; margin-left: 8px; }
.colors { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }
@media (max-width: 600px) { .colors { grid-template-columns: 1fr; } }
.color { display: flex; gap: 10px; align-items: center; margin: 0; font-weight: 400; }
.color input[type=color] { width: 44px; height: 38px; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); flex: none; cursor: pointer; }
.color strong { display: block; font-size: var(--step--1); }
.color .hint { margin: 0; }
iframe.pdf { width: 100%; height: 80vh; min-height: 520px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }

.mock { background: #fff; color: #111; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 18px rgba(23, 36, 44, .08); font-size: 12px; line-height: 1.4; overflow: hidden; }
.mock-mast { display: flex; align-items: center; gap: 10px; border-radius: 3px; }
.mock-logo img { height: 36px; width: auto; display: block; }
.mock-title { font-size: 34px; line-height: .95; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; }
.mock-info { display: flex; justify-content: space-between; gap: 8px; font-size: 10px; margin: 6px 0; }
.mock-info span:last-child { white-space: nowrap; }
.mock-info span:first-child { opacity: .7; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mock-bar { border-top: 3px solid #111; }
.mock-nav { display: flex; gap: 18px; font-size: 9px; padding: 5px 0; border-bottom: 1px solid #ccc; margin-bottom: 12px; }
.mock-nav b { font-weight: bold; }
.mock-kicker { font-size: 9px; font-weight: bold; margin-bottom: 3px; }
.mock-h1 { font-size: 26px; line-height: 1; font-weight: bold; margin-bottom: 8px; }
.mock-img { height: 90px; background: linear-gradient(135deg, #8a5a3c, #c99a6b 45%, #3b2a20); margin-bottom: 6px; }
.mock-meta { font-size: 8.5px; margin-bottom: 6px; }
.mock-p { margin: 0 0 6px; font-size: 11.5px; }
.mock-ref { font-weight: bold; font-size: 10px; }

/* ---------- Publika sidan ---------- */
.kicker { font-size: var(--step--1); font-weight: 700; color: var(--pine); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 6px; }
.issue-title { font-size: var(--step-2); margin: 0 0 6px; }
.issue-meta { color: var(--ink-soft); margin: 0; }
.side-h { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.side-panel .hint { margin-bottom: 8px; }
textarea { resize: vertical; line-height: 1.45; }

/* ---------- Webbplatsens block ---------- */
.brand a { color: inherit; text-decoration: none; }
.site-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.site-nav a { color: #fff; text-decoration: none; font-size: var(--step--1); font-weight: 700; padding: 5px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.35); }
.site-nav a:hover { background: rgba(255,255,255,.12); }
.site-nav a[aria-current="page"] { background: #fff; color: var(--lake-deep); border-color: #fff; }
.layout-single { grid-template-columns: minmax(0, 1fr); }
.layout-single main { max-width: 760px; }
main.narrow { max-width: 620px; }
.side-col { display: grid; gap: 16px; align-content: start; }
.block { margin: 0 0 16px; }
.side-col .block { margin: 0; }
.block.style-card, .block.style-accent { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 20px; }
.block.style-accent { border-top: 4px solid var(--pine); }
.block.style-plain { padding: 4px 0; }
.block > h2:first-child, .block > .issue-cover + .kicker, .block > p.kicker:first-child { margin-top: 0; }
.block .status > div:last-child { border-bottom: 0; }
.issue-cover { display: block; margin: -18px -20px 16px; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
.block.style-accent .issue-cover { margin-top: -18px; border-radius: 0; }
.block.style-plain .issue-cover { margin: 0 0 16px; border-radius: var(--radius); }
.issue-cover img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; }
.issue-lead { font-size: var(--step-1); line-height: 1.35; margin: 0 0 6px; }
.prose { line-height: 1.6; }
.prose h2 { font-size: var(--step-1); margin: 22px 0 8px; }
.prose h3 { font-size: var(--step-0); margin: 18px 0 6px; }
.prose h4 { font-size: var(--step-0); margin: 14px 0 4px; }
.prose ul, .prose ol { margin: 0 0 12px; padding-left: 22px; }
.prose li { margin: 3px 0; }
.prose blockquote { margin: 0 0 12px; padding: 4px 0 4px 14px; border-left: 3px solid var(--pine); color: var(--ink-soft); }
.prose hr, hr.divider { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.spacer { height: 24px; }
.figure { margin: 0; }
.figure img { display: block; width: 100%; height: auto; border-radius: var(--radius); }
.style-card .figure img, .style-accent .figure img { border-radius: 4px; }
.figure figcaption { font-size: var(--step--1); color: var(--ink-soft); margin-top: 8px; }
.actions.align-center { justify-content: center; }
.actions.align-right { justify-content: flex-end; }
.block-html iframe, .block-html video, .block-html img { max-width: 100%; }

/* ---------- Prenumerationsformulär ---------- */
.sub-form label:first-of-type { margin-top: 4px; }
.sub-form .choice, .choice { border: 0; padding: 0; margin: 14px 0 0; }
.choice legend { font-weight: 700; font-size: var(--step--1); padding: 0; margin-bottom: 2px; }
.choice label.check { margin-top: 6px; }
label.check.consent { font-size: var(--step--1); color: var(--ink-soft); margin-top: 14px; }
label.check.consent a { color: var(--lake-deep); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.side-col .side-actions .btn, .sub-form .side-actions .btn { width: 100%; }
.side-actions { margin-top: 14px; }

/* ---------- Samtycke ---------- */
.consent-bar { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 40; max-width: 560px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--lake); border-radius: var(--radius); padding: 14px 16px; box-shadow: 0 10px 30px rgba(23,36,44,.18); }
.consent-bar p { margin: 0; font-size: var(--step--1); }
.consent-bar .actions { margin-top: 10px; }
.consent-bar[hidden] { display: none; }

/* ---------- Kontrollpanelen: nya delar ---------- */
.subnav { display: flex; flex-wrap: wrap; gap: 4px 18px; border-bottom: 1px solid var(--line); margin: 0 0 16px; }
.subnav a { padding: 8px 0 10px; color: var(--ink-soft); text-decoration: none; font-weight: 700; font-size: var(--step--1); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.subnav a:hover { color: var(--lake-deep); }
.subnav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--lake); }
.subnav .subnav-right { margin-left: auto; font-weight: 400; }
.chips-small { padding: 0 0 12px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; }
.stat-num { font: 300 1.75rem/1.1 var(--mono); color: var(--ink); }
.stat-label { font-size: var(--step--1); color: var(--ink-soft); margin-top: 4px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar input[type=search], .toolbar input[type=text] { flex: 1 1 220px; width: auto; }
.toolbar select { width: auto; }
.toolbar label.check { margin: 0; font-size: var(--step--1); align-items: center; }
.toolbar label.check input { margin: 0; }
.table-wrap { overflow-x: auto; margin: 14px 0 0; }
.table { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.table th { text-align: left; font-weight: 700; color: var(--ink-soft); padding: 8px 10px 8px 0; border-bottom: 2px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.table td strong { font-size: var(--step-0); overflow-wrap: anywhere; }
.table tr.subrow td { border-bottom: 0; padding-top: 0; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.select-small { min-height: 32px; padding: 3px 6px; width: auto; font-size: var(--step--1); }
.pager { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 6px; }
.pager a { min-width: 34px; text-align: center; padding: 4px 8px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; background: var(--surface); }
.pager a[aria-current="page"] { background: var(--lake); border-color: var(--lake); color: #fff; font-weight: 700; }
.badge-err { background: var(--brick-wash); color: var(--brick); }
.progress { height: 10px; background: var(--lake-wash); border-radius: 999px; overflow: hidden; margin: 6px 0 10px; }
.progress span { display: block; height: 100%; background: var(--pine); transition: width .3s ease; }
.span2 { grid-column: 1 / -1; }
.grid2.tight { gap: 0 10px; }
.input-mid { max-width: 260px; }
.actions .input-mid { flex: 0 1 220px; min-height: 40px; }
.input-prefix { display: flex; align-items: stretch; }
.input-prefix span { display: inline-flex; align-items: center; padding: 0 10px; border: 1px solid var(--line); border-right: 0; border-radius: var(--radius) 0 0 var(--radius); background: #f7f9fa; color: var(--ink-soft); font-size: var(--step--1); white-space: nowrap; }
.input-prefix input { border-radius: 0 var(--radius) var(--radius) 0; }
code { font: 0.8125rem var(--mono); background: #eef2f4; border-radius: 4px; padding: 1px 5px; }
textarea.code { font: 0.8125rem/1.55 var(--mono); tab-size: 2; white-space: pre; overflow-wrap: normal; overflow-x: auto; }
textarea.code-text { white-space: pre-wrap; }

/* Mallredigeraren */
.tpl-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 980px) { .tpl-grid { grid-template-columns: 1fr; } }
.tpl-grid > .card { margin: 0 0 16px; }
.tpl-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.tpl-head h2 { margin: 0; }
.seg-small span { min-height: 30px; padding: 3px 12px; }
.mail-preview { width: 100%; height: 640px; border: 1px solid var(--line); border-radius: var(--radius); background: #f3f6f8; }
.codes { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.codes li { display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr); align-items: baseline; gap: 10px; }
.codes li .small { line-height: 1.35; }
.code-chip { justify-self: start; white-space: nowrap; font: 0.8125rem var(--mono); color: var(--lake-deep); background: var(--lake-wash); border: 1px solid transparent; border-radius: 4px; padding: 2px 6px; cursor: pointer; }
.code-chip:hover { border-color: var(--lake); }

/* Sidor och blockbyggaren */
.page-list { list-style: none; margin: 0; padding: 0; }
.page-list li { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
.page-list li:first-child { padding-top: 0; }
.page-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.page-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.page-tools form { margin: 0; }
.icon-btn { min-width: 34px; min-height: 32px; padding: 2px 8px; font: inherit; font-size: 1rem; line-height: 1; color: var(--lake-deep); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.icon-btn:hover:not(:disabled) { border-color: var(--lake); color: var(--lake); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-danger { color: var(--brick); }
.icon-danger:hover:not(:disabled) { border-color: var(--brick); color: var(--brick); background: var(--brick-wash); }
.blocks { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.bl { border: 1px solid var(--line); border-left: 3px solid var(--lake); border-radius: var(--radius); background: var(--surface); }
.bl.is-hidden { border-left-color: #b9c8d1; background: #fafbfc; }
.bl.is-hidden .bl-title { opacity: .65; }
.bl.is-open { border-color: var(--lake); box-shadow: 0 2px 10px rgba(23,36,44,.06); }
.bl-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px; cursor: default; }
.bl-handle { color: #b9c8d1; letter-spacing: -2px; user-select: none; }
.bl-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-tools { display: flex; gap: 4px; flex: none; }
.bl-body { padding: 4px 16px 16px; border-top: 1px solid var(--line); }
.block-common { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
.thumb { max-width: 90%; max-height: 88px; }
.add-block { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.add-block select { flex: 1 1 300px; }
@media (max-width: 560px) { .bl-head { flex-wrap: wrap; } .bl-title { white-space: normal; } }

/* ---------- Godkännande krävs ---------- */
.cookie-wall { position: fixed; inset: 0; z-index: 50; background: rgba(23, 36, 44, .72); display: flex; align-items: center; justify-content: center; padding: 16px; }
.cookie-wall[hidden] { display: none; }
.cookie-wall-card { background: var(--surface); border-top: 4px solid var(--lake); border-radius: var(--radius); max-width: 480px; width: 100%; padding: 22px 24px; box-shadow: 0 16px 48px rgba(0,0,0,.25); }
.cookie-wall-card h2 { margin-top: 0; }
.cookie-wall-card .btn { width: 100%; }
html.cw-open, html.cw-open body { overflow: hidden; }
.radio-list label.check { margin-top: 10px; }
