/* MR INFO Start.
   Alla färger och mått är variabler här uppe. Mörkt tema är standard;
   ljust tema skriver över färgerna via html[data-theme="light"]
   (sätts av lib/theme.js utifrån prefs.theme). */

:root {
  --bg: #0b0d12;
  --bg-glow: rgba(91, 140, 255, 0.08);
  --surface: #12151c;
  --surface-2: #181c25;
  --surface-3: #1f2430;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #e7eaf0;
  --muted: #8b93a7;
  --accent: #5b8cff;
  --accent-soft: rgba(91, 140, 255, 0.14);
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  --info: #a78bfa;
  --btn-primary-bg: #e7eaf0;
  --btn-primary-fg: #0b0d12;
  --btn-primary-hover: #ffffff;

  --radius: 16px;
  --radius-sm: 10px;
  --gap: 20px;
  --pad: 20px;
  --max: 1440px;

  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;

  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f4f5f8;
  --bg-glow: rgba(47, 107, 255, 0.07);
  --surface: #ffffff;
  --surface-2: #ffffff;
  --surface-3: #eceef3;
  --border: rgba(16, 22, 34, 0.08);
  --border-strong: rgba(16, 22, 34, 0.16);
  --text: #151922;
  --muted: #5c6475;
  --accent: #2f6bff;
  --accent-soft: rgba(47, 107, 255, 0.1);
  --ok: #0f9f6e;
  --warn: #b7791f;
  --err: #dc2626;
  --info: #7c3aed;
  --btn-primary-bg: #151922;
  --btn-primary-fg: #ffffff;
  --btn-primary-hover: #2a303c;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 10% -10%, var(--bg-glow), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  padding: 0 max(16px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(16px, env(safe-area-inset-left));
}

a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; }
p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
[hidden] { display: none !important; }

.icon { width: 1.15em; height: 1.15em; flex: none; }

/* ---------- Header ---------- */

.app-header {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--gap);
  padding: max(24px, env(safe-area-inset-top)) 0 24px;
}

.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-width: 0; }

/* Logotypen: mörkanpassade filer i assets/branding (originalen ligger kvar där).
   Bara höjden sätts, så proportionerna följer bildfilen. */
.brand-logo { display: inline-flex; line-height: 0; border-radius: 6px; }
.logo-wide { display: block; height: 30px; width: auto; }
.logo-on-light { display: none; }
[data-theme="light"] .logo-on-dark { display: none; }
[data-theme="light"] .logo-on-light { display: block; }
.logo-icon { display: none; width: 40px; height: 40px; }
.greeting {
  font: 600 22px/1.25 var(--font-display);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-time { display: flex; flex-direction: column; align-items: center; }
.clock {
  font: 600 34px/1.1 var(--font-display);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.date { color: var(--muted); font-size: 14px; }

.header-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }

/* ---------- Knappar ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 40px; padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  font-weight: 600; font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
}
.btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--btn-primary-bg); color: var(--btn-primary-fg); border-color: transparent; }
.btn-primary:hover:not(:disabled) { background: var(--btn-primary-hover); }
.btn-block { width: 100%; margin-top: auto; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }

/* ---------- Användarmeny ---------- */

.user-menu { position: relative; }
.avatar-btn { padding: 0; border: 0; background: none; cursor: pointer; border-radius: 999px; }
.avatar {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--border-strong);
}
.avatar-fallback { background: var(--accent-soft); color: var(--accent); font-weight: 700; }

.menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px);
  z-index: 20;
  min-width: 240px;
  padding: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
}
.menu-head { display: flex; flex-direction: column; padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-head .muted { font-size: 13px; word-break: break-all; }
.menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0; border-radius: 8px;
  background: none;
  text-align: left;
  cursor: pointer;
}
.menu-item:hover { background: var(--surface-3); }
.menu-item .icon { color: var(--muted); }

/* ---------- Widgetrutnät ---------- */

/* Tre zoner (se DEFAULT_LAYOUT): vänster = stöd, mitten = nyheter,
   höger = verktyg. Brytpunkterna längst ned i filen. */
.widget-grid {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(0, 2.1fr) minmax(280px, 1fr);
  grid-template-areas: "left main right";
  align-items: stretch;
  gap: var(--gap);
}
.zone { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.zone-left { grid-area: left; }
.zone-main { grid-area: main; }
.zone-right { grid-area: right; }
.zone-main > .card { flex: 1; }
/* Sista kortet i sidokolumnerna fyller ut, så att kolumnerna slutar i linje. */
.zone-left > .card:last-child, .zone-right > .card:last-child { flex: 1; }

.card {
  display: flex; flex-direction: column;
  min-width: 0;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--pad);
}
/* Stödwidgetar är tätare än huvudsektionen. */
.card-sm { padding: 16px 18px; }

.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 16px;
}
.card-sm .card-head { margin-bottom: 12px; }
.card-sm .card-title { font-size: 12px; }
.card-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted);
}
.card-title .icon { color: var(--accent); }
.card-body { display: flex; flex-direction: column; gap: 14px; flex: 1; min-height: 0; }

.badge {
  font-size: 11px; font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--warn);
  background: rgba(251, 191, 36, .1);
  border: 1px solid rgba(251, 191, 36, .25);
  white-space: nowrap;
}
.pill { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.pill-accent { color: var(--accent); background: var(--accent-soft); }

.empty { color: var(--muted); list-style: none; }

/* Laddning */
.skeleton-group { display: flex; flex-direction: column; gap: 10px; }
.skeleton {
  display: block; height: 14px; border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2));
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}
.skeleton-btn { width: 180px; height: 40px; border-radius: 999px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Väder ---------- */

.weather-now { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
.weather-icon { color: var(--warn); }
.weather-icon .icon { width: 40px; height: 40px; stroke-width: 1.4; }
.weather-temp { font: 600 34px/1 var(--font-display); letter-spacing: -0.02em; }
.weather-text { color: var(--muted); font-size: 13px; }
.weather-place { display: flex; flex-direction: column; align-items: flex-end; text-align: right; font-size: 12.5px; }

.weather-notice {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 10px; border-radius: 8px;
  font-size: 12.5px; line-height: 1.4; color: var(--warn);
  background: color-mix(in srgb, var(--warn) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 22%, transparent);
}
.weather-notice .icon { width: 15px; height: 15px; margin-top: 1px; }
.weather-mock { color: var(--warn); font-weight: 600; }

.weather-facts { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; }
.weather-facts > span { display: inline-flex; align-items: center; gap: 6px; }
.weather-facts .icon { color: var(--muted); }

.weather-days {
  list-style: none; margin: auto 0 0; padding: 12px 0 0;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
  border-top: 1px solid var(--border);
}
.weather-days li { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12.5px; }
.weather-days .icon { color: var(--text); opacity: .85; }

/* ---------- Nyheter ---------- */

.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-top: -4px; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 13.5px; font-weight: 500;
  cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); background: var(--accent-soft); border-color: rgba(91, 140, 255, .35); }

.news-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
/* På desktop styr sidokolumnerna kortets höjd. Listan scrollar inuti. */
.card-lg .news-list {
  flex: 1 1 0;
  min-height: 560px;
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}
.news-item { display: flex; gap: 16px; padding: 16px 0; border-top: 1px solid var(--border); }
.news-item:first-child { border-top: 0; padding-top: 6px; }
.news-thumb { width: 112px; height: 74px; border-radius: 8px; object-fit: cover; flex: none; background: var(--surface-3); }
.news-main { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.news-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; }
.news-source { color: var(--accent); font-weight: 600; }
.news-title { font: 600 18px/1.35 var(--font-display); letter-spacing: -0.005em; }
.news-title a { text-decoration: none; }
.news-title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.news-title .icon { width: .8em; height: .8em; margin-left: 6px; color: var(--muted); vertical-align: baseline; }
.news-summary { color: var(--muted); font-size: 14.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Polisfilter: rad under flikarna och en panel som fälls ut i kortet. */
.police-filter { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; margin-top: -4px; }
.police-filter-label { font-weight: 600; color: var(--accent); }
.police-filter-value { color: var(--muted); min-width: 0; }
.police-panel { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); padding: 14px; }
.police-panel-inner { display: flex; flex-direction: column; gap: 12px; }
.police-scope { max-width: 320px; grid-template-columns: repeat(2, 1fr); }
.police-group { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.police-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 12px; }
.police-places { max-height: 180px; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
.police-option { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 14px; cursor: pointer; }
.police-option input { width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.police-search {
  width: 100%; max-width: 320px; height: 38px; padding: 0 12px;
  font: inherit; font-size: 16px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
.link-btn { padding: 0; border: 0; background: none; color: var(--muted); font-size: 12.5px; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; flex: none; }
.link-btn:hover { color: var(--text); }

.news-status { font-size: 12px; color: var(--muted); }
.news-status:empty { display: none; }
.news-status.has-error { color: var(--warn); }

/* ---------- Agenda ---------- */

.agenda-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.agenda-item {
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px;
  padding: 7px 10px;
  font-size: 14px;
  border-radius: 8px;
  border-left: 2px solid transparent;
}
.agenda-time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }
.agenda-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-item.is-past { opacity: .45; }
.agenda-item.is-now { background: var(--accent-soft); border-left-color: var(--accent); }

/* ---------- Snabblänkar ---------- */

.links-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.link-tile {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 2px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  font-size: 11px;
  letter-spacing: -0.01em;
  text-align: center;
  transition: border-color .15s, transform .15s, background .15s;
}
.link-tile > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.link-tile:hover { border-color: var(--border-strong); background: var(--surface-3); transform: translateY(-1px); }
.link-tile.is-disabled { opacity: .45; cursor: not-allowed; }
.link-mark {
  display: grid; place-items: center;
  width: 30px; height: 30px;
  border-radius: 8px;
  font-weight: 700; font-size: 14px;
  color: var(--link-color);
  background: color-mix(in srgb, var(--link-color) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--link-color) 30%, transparent);
}

/* ---------- Status ---------- */

.status-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.status-item {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px;
  padding: 6px 0;
  font-size: 14px;
}
.status-item + .status-item { border-top: 1px solid var(--border); }
[data-widget="status"] .card-body { gap: 8px; }
[data-widget="status"] .small { font-size: 11.5px; }
.status-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-ms { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.status-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--muted); }
.status-label { font-size: 12.5px; font-weight: 600; }
.is-up { --c: var(--ok); }
.is-degraded { --c: var(--warn); }
.is-down { --c: var(--err); }
.is-planned { --c: var(--info); }
.is-unknown { --c: var(--muted); }
.status-dot { background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }
.status-label { color: var(--c); }

/* ---------- Inställningar ---------- */

.settings-dialog {
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 24px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}
.settings-dialog::backdrop { background: rgba(5, 6, 10, .6); backdrop-filter: blur(3px); }
.settings-head { display: flex; justify-content: space-between; align-items: center; }
.settings-head h2 { font-size: 18px; }
.settings-form { display: flex; flex-direction: column; }
.settings-account { font-size: 13px; margin: 2px 0 8px; word-break: break-all; }
.settings-field { display: flex; flex-direction: column; gap: 8px; padding: 16px 0; border-top: 1px solid var(--border); }
.settings-label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.settings-hint { font-size: 12.5px; color: var(--muted); }
.settings-static { font-size: 15px; }
.settings-actions {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding-top: 16px; border-top: 1px solid var(--border);
}
.settings-status { margin-right: auto; font-size: 13px; color: var(--muted); }

/* Rullista. Minst 16px text, annars zoomar iOS in vid fokus. */
.select {
  width: 100%; height: 44px; padding: 0 40px 0 14px;
  font: inherit; font-size: 16px; color: var(--text);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%238b93a7' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 14px center;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  appearance: none; cursor: pointer;
}

/* Av/på-reglage för nyhetskategorier. Den riktiga kryssrutan ligger osynlig
   ovanpå, så att tangentbord och skärmläsare fungerar som vanligt. */
.switch-list { display: flex; flex-direction: column; }
.switch-row {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 0; font-size: 15px; cursor: pointer;
}
.switch-input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch {
  position: relative; flex: none;
  width: 40px; height: 24px; border-radius: 999px;
  background: var(--surface-3); border: 1px solid var(--border-strong);
  transition: background .15s, border-color .15s;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 999px;
  background: var(--muted); transition: transform .15s, background .15s;
}
.switch-input:checked + .switch { background: var(--accent); border-color: var(--accent); }
.switch-input:checked + .switch::after { transform: translateX(16px); background: #fff; }
.switch-input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Nyhetskällor i inställningarna: grupperade efter kategori. */
.source-actions { display: flex; gap: 16px; margin-bottom: 4px; }
.source-list { display: flex; flex-direction: column; gap: 6px; }
.source-group-label { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }

/* Tre-vals-knapp för tema. */
.segmented {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  padding: 4px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border);
}
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span {
  display: block; padding: 8px 0; border-radius: 8px;
  text-align: center; font-size: 14px; font-weight: 500; color: var(--muted);
}
.segmented input:checked + span { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- Toast och sidfot ---------- */

.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 50;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
  font-size: 14px;
}

.app-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px 0 24px;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px;
  color: var(--muted); font-size: 12.5px;
}
.footer-icon { width: 18px; height: 18px; }

/* ---------- Responsivt ---------- */

/* Mellanbred desktop: nyheter till vänster, alla stödwidgetar i en kolumn till höger. */
@media (max-width: 1280px) {
  .widget-grid {
    grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
    grid-template-areas: "main left" "main right";
    align-items: start;
  }
  .zone-main { align-self: stretch; }
  .zone-left > .card:last-child, .zone-right > .card:last-child { flex: none; }
}

/* Surfplatta: zonerna löses upp och korten flödar i två kolumner.
   Nyheter och dashboard tar hela bredden. */
@media (max-width: 1024px) {
  .widget-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: none; align-items: stretch; }
  .zone { display: contents; }
  .card-lg, .card[data-widget="dashboard"] { grid-column: 1 / -1; }
  .card-lg .news-list { flex: none; min-height: 0; max-height: 640px; }
  .card[data-widget="dashboard"] .btn-block { width: auto; align-self: flex-start; }
}

@media (max-width: 760px) {
  :root { --gap: 14px; --pad: 16px; }
  .app-header { grid-template-columns: 1fr auto; row-gap: 14px; padding-bottom: 18px; }
  .header-time { grid-column: 1 / -1; grid-row: 2; flex-direction: row; align-items: baseline; gap: 12px; }
  .clock { font-size: 28px; }
  .greeting { font-size: 18px; }
  .brand { gap: 8px; }
  .logo-wide { height: 22px; }
  .widget-grid { grid-template-columns: minmax(0, 1fr); }
  .card[data-widget="dashboard"] .btn-block { width: 100%; }
  .news-title { font-size: 16px; }
  .police-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .police-counties { max-height: 200px; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
  .police-scope, .police-search { max-width: none; }
  .news-thumb { width: 72px; height: 52px; }
  .btn-primary span { white-space: nowrap; }
}

@media (max-width: 420px) {
  .header-actions .btn span { display: none; } /* bara Google-ikonen på smala skärmar */
  .header-actions .btn { padding: 0 12px; }
}

/* Mycket smala skärmar: den runda ikonen i stället för den liggande loggan. */
@media (max-width: 340px) {
  .brand-logo .logo-wide { display: none; }
  .logo-icon { display: block; width: 36px; height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
