:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-soft: #f0ece3;
  --ink: #1a222d;
  --muted: #5a6472;
  --border: #ddd7ca;
  --accent: #1d4e4f;
  --accent-hover: #153c3d;
  --hard-bg: #e2f0ec;
  --hard-fg: #145349;
  --princip-bg: #e6ecf7;
  --princip-fg: #1e4279;
  --vag-bg: #f9eed9;
  --vag-fg: #83510d;
  --conflict-bg: #fbe5e3;
  --conflict-fg: #9c251c;
  --ok-bg: #e4f3e7;
  --ok-fg: #1c6330;
  --pin-bg: #dff2ef;
  --pin-border: #8dc3ba;
  --queue-bg: #fff8ea;
  --queue-border: #e7c57c;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(26, 34, 45, 0.05);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1020px;
  margin: 0 auto;
  padding: 0 20px;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  min-height: 68px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.topbar-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-graphic {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1 1 auto;
  min-width: 0;
}

.topbar-graphic .hdr-svg {
  display: none;
  height: 54px;
  width: auto;
  max-width: 340px;
}

.topbar-graphic[data-graphic="christiansborg"] .hdr-svg-christiansborg {
  display: block;
}

.topbar-graphic[data-graphic="tidslinje"] .hdr-svg-tidslinje {
  display: block;
}

.topbar-graphic[data-graphic="horisont"] .hdr-svg-horisont {
  display: block;
}

@media (max-width: 720px) {
  .topbar-graphic {
    display: none;
  }
}

.brand {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.brand-sub {
  font-size: 0.82rem;
  color: var(--muted);
}

.nav-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.pill-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #b86c08;
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 700;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  text-decoration: none;
}

.btn-approve {
  background: var(--ok-fg);
  color: #ffffff;
}

.btn-approve:hover {
  background: #144d24;
  text-decoration: none;
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--surface-soft);
  text-decoration: none;
}

.btn-danger {
  background: transparent;
  color: var(--conflict-fg);
  border-color: #e6b8b4;
  font-size: 0.84rem;
  padding: 6px 12px;
}

.btn-danger:hover {
  background: var(--conflict-bg);
}

main {
  padding: 28px 0 56px;
}

.notice {
  background: var(--pin-bg);
  border: 1px solid var(--pin-border);
  color: var(--hard-fg);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 18px;
  font-weight: 500;
}

.hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}

.hero h1 {
  margin: 0 0 6px;
  font-size: 1.55rem;
  letter-spacing: -0.02em;
}

.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 780px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

a.stat-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

a.stat-link:hover .stat-card {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(26, 34, 45, 0.08);
}

.stat-card.stat-active {
  border: 2px solid var(--accent);
  background: var(--pin-bg);
}

.stat-card.stat-highlight {
  background: var(--queue-bg);
  border-color: var(--queue-border);
}

.person-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 14px;
}

.person-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.person-counts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.person-count-box {
  background: var(--bg);
  border-radius: 8px;
  padding: 8px 6px;
  text-align: center;
}

.person-count-box strong {
  display: block;
  font-size: 1.15rem;
}

.person-count-box span {
  font-size: 0.72rem;
  color: var(--muted);
}

.auth-wrap {
  max-width: 480px;
  margin: 24px auto;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.user-pill:hover {
  background: var(--border);
  text-decoration: none;
}

.status-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
}

.stat-value {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.1;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 4px;
}

.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.filter-bar input[type="search"],
.filter-bar select,
.form-control {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-size: 0.94rem;
  font-family: inherit;
}

.filter-bar input[type="search"] {
  flex: 1 1 200px;
}

.pind-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pind-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}

.pind-card.is-watched {
  border-left: 4px solid var(--accent);
}

.pind-meta-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.badge-pin {
  background: var(--accent);
  color: #ffffff;
}

.badge-queue {
  background: var(--queue-bg);
  color: var(--vag-fg);
  border: 1px solid var(--queue-border);
}

.badge-hard {
  background: var(--hard-bg);
  color: var(--hard-fg);
}

.badge-princip {
  background: var(--princip-bg);
  color: var(--princip-fg);
}

.badge-vag {
  background: var(--vag-bg);
  color: var(--vag-fg);
}

.badge-spor {
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 600;
}

.badge-demo {
  background: #ece9f6;
  color: #4f3a88;
}

.badge-conflict {
  background: var(--conflict-bg);
  color: var(--conflict-fg);
}

.badge-sender {
  background: #edeae2;
  color: var(--ink);
  border: 1px solid var(--border);
  font-weight: 700;
}

.party-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px 2px 3px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  vertical-align: middle;
}

.party-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}

.party-chip-lg {
  padding: 4px 12px 4px 5px;
  font-size: 0.88rem;
}

.party-chip-lg .party-logo {
  min-width: 26px;
  height: 26px;
  font-size: 0.86rem;
}

.autocomplete-wrap {
  position: relative;
  flex: 1 1 280px;
}

.autocomplete-wrap input {
  width: 100%;
}

.autocomplete-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 26px rgba(26, 34, 45, 0.14);
  z-index: 40;
  max-height: 360px;
  overflow-y: auto;
  display: none;
}

.autocomplete-list.is-open {
  display: block;
}

.autocomplete-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--surface-soft);
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.is-active {
  background: var(--pin-bg);
  text-decoration: none;
}

.autocomplete-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

a.party-chip {
  text-decoration: none;
  transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

a.party-chip:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(26, 34, 45, 0.08);
  text-decoration: none;
}

.org-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin: 14px 0 6px;
}

.org-root {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  border-radius: 14px;
  color: #ffffff;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: 0 6px 16px rgba(26, 34, 45, 0.14);
}

.org-stem {
  width: 2px;
  height: 24px;
  background: var(--border);
}

.org-branch-bar {
  width: 82%;
  max-width: 760px;
  height: 2px;
  background: var(--border);
}

.org-tiers {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.org-tier-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: 10px;
  padding: 14px 16px;
}

.org-tier-card h3 {
  margin: 0 0 8px;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.org-member-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.org-node {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 11px;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.1s ease;
}

.org-node:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  text-decoration: none;
}

.org-node strong {
  display: block;
  font-size: 0.92rem;
}

.org-node span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
}

.comp-bar {
  display: flex;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-soft);
  margin: 10px 0 8px;
}

.spokesman-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.spokesman-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
}

.spokesman-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
}

.version-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  vertical-align: middle;
}

.person-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 50px;
  height: 50px;
}

.person-avatar-wrap.is-lg {
  width: 78px;
  height: 78px;
}

.person-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 22%;
  border: 2px solid var(--border);
  background: var(--surface-soft);
  display: block;
}

.person-avatar-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  color: #ffffff;
  background: var(--accent);
  border: 2px solid var(--border);
}

.person-avatar-wrap.is-lg .person-avatar-fallback {
  font-size: 1.5rem;
}

.person-inline-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}

.person-inline-link:hover {
  text-decoration-style: solid;
}

.wiki-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
}

.wiki-chip:hover {
  border-color: var(--accent);
  background: var(--pin-bg);
  text-decoration: none;
}

.prio-roed {
  background: #fde4e2;
  color: #a61c14;
  border: 1px solid #efb3ae;
}

.prio-gul {
  background: #fdf1d2;
  color: #8a5600;
  border: 1px solid #e9c97a;
}

.prio-groen {
  background: #e3f3e6;
  color: #1b6531;
  border: 1px solid #a9d6b5;
}

.queue-item.prio-border-roed {
  border-left: 4px solid #c92a22;
}

.queue-item.prio-border-gul {
  border-left: 4px solid #c98506;
}

.queue-item.prio-border-groen {
  border-left: 4px solid #237a3c;
}

.timeline-item.prio-border-roed {
  border-left-color: #c92a22;
}

.timeline-item.prio-border-gul {
  border-left-color: #c98506;
}

.timeline-item.prio-border-groen {
  border-left-color: #237a3c;
}

.btn-triage-roed {
  background: #fde4e2;
  color: #9e1a12;
  border-color: #e6a29c;
}

.btn-triage-roed:hover,
.btn-triage-roed.is-suggested {
  background: #c92a22;
  color: #ffffff;
  border-color: #a61c14;
}

.btn-triage-gul {
  background: #fdf1d2;
  color: #7c4c00;
  border-color: #e4be63;
}

.btn-triage-gul:hover,
.btn-triage-gul.is-suggested {
  background: #c98506;
  color: #ffffff;
  border-color: #a66d00;
}

.btn-triage-groen {
  background: #e3f3e6;
  color: #185c2c;
  border-color: #9ed0ac;
}

.btn-triage-groen:hover,
.btn-triage-groen.is-suggested {
  background: #237a3c;
  color: #ffffff;
  border-color: #185c2c;
}

.triage-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  font-size: 0.82rem;
}

.pind-title {
  margin: 0 0 4px;
  font-size: 1.18rem;
}

.pind-title a {
  color: var(--ink);
}

.pind-sender {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.quote-box {
  margin: 10px 0 12px;
  padding: 12px 16px;
  border-left: 3px solid var(--accent);
  background: var(--bg);
  border-radius: 0 8px 8px 0;
  font-style: italic;
}

.missing-box {
  margin: 10px 0;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--vag-bg);
  color: var(--vag-fg);
  font-size: 0.9rem;
}

.pind-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--surface-soft);
  font-size: 0.85rem;
  color: var(--muted);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.pin-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.pin-box.pin-active {
  background: var(--pin-bg);
  border-color: var(--pin-border);
}

.pin-box-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.queue-panel {
  background: var(--queue-bg);
  border: 1px solid var(--queue-border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
}

.queue-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  margin-top: 12px;
}

.queue-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--surface-soft);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.info-tile {
  background: var(--bg);
  border-radius: 8px;
  padding: 12px 14px;
}

.info-tile h3 {
  margin: 0 0 4px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.info-tile p {
  margin: 0;
  font-size: 0.94rem;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.timeline-item {
  border-left: 3px solid var(--border);
  padding: 8px 0 8px 16px;
}

.timeline-item.ev-conflict {
  border-left-color: var(--conflict-fg);
}

.timeline-item.ev-ok {
  border-left-color: var(--ok-fg);
}

.timeline-item.ev-revised {
  border-left-color: var(--vag-fg);
}

.timeline-header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 0.84rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}

.form-group label {
  font-size: 0.88rem;
  font-weight: 600;
}

.form-hint {
  font-size: 0.82rem;
  color: var(--muted);
}

textarea.form-control {
  min-height: 92px;
  resize: vertical;
}

details.manual-fold summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
  padding: 4px 0;
}

.checklist {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.checklist h2 {
  margin: 0 0 6px;
  font-size: 0.98rem;
}

.checklist ul {
  margin: 0;
  padding-left: 18px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

footer {
  border-top: 1px solid var(--border);
  padding: 18px 0;
  font-size: 0.84rem;
  color: var(--muted);
}

/* Mailforslag-side */
.mail-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 18px;
  align-items: start;
}

@media (max-width: 860px) {
  .mail-layout {
    grid-template-columns: 1fr;
  }
}

.recipient-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recipient-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.recipient-card.is-selected {
  border-color: var(--accent);
  background: var(--pin-bg);
}

.recipient-card input[type="checkbox"] {
  margin-top: 4px;
  accent-color: var(--accent);
}

.template-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 8px;
}

.template-tab {
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-family: inherit;
}

.template-tab strong {
  font-size: 0.88rem;
}

.template-tab span {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.3;
}

.template-tab.is-active {
  border: 2px solid var(--accent);
  background: var(--pin-bg);
}

.mail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.copy-toast {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

.activity-title-link {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.12s ease;
}

.activity-title-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.emne-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--pin-bg);
  border: 1px solid var(--pin-border);
  color: var(--accent);
  font-size: 1.05rem;
  font-weight: 700;
}

.emne-icon-badge.is-lg {
  min-width: 52px;
  height: 52px;
  font-size: 1.45rem;
}

.quick-keyword-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* Aktivt menupunkt i topbaren */
.nav-actions .btn-nav-active {
  background: var(--pin-bg);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--accent);
}

.nav-actions .btn-primary.btn-nav-active {
  background: var(--accent-hover);
  color: #ffffff;
  box-shadow: 0 0 0 2px var(--pin-border);
}

.user-pill.nav-pill-active {
  background: var(--pin-bg);
  color: var(--accent);
  box-shadow: inset 0 0 0 2px var(--accent);
}

/* Ens korthøjde + nyt-markering på fulgte kort */
.person-grid .stat-link {
  display: flex;
}

.person-grid .person-card {
  width: 100%;
  height: 100%;
  justify-content: center;
  position: relative;
}

.person-card.has-unread {
  background: #fffcf3 !important;
  border-color: #d99b26;
}

.unread-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #c2410c;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.unread-corner {
  position: absolute;
  top: 8px;
  right: 10px;
}

.timeline-item.is-new-item {
  background: #fffcf3;
  border-radius: 0 8px 8px 0;
  padding-right: 12px;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 10px;
}

/* Temavælger under Profil */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.theme-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.theme-card.is-selected {
  border: 2px solid var(--accent);
  background: var(--pin-bg);
}

.theme-card input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--accent);
}

.theme-swatches {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.theme-swatch {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  display: inline-block;
}

/* === PERSONLIGE TEMAER === */

/* 1. Nordisk Notesbog */
body[data-theme="notesbog"] {
  --bg: #faf5eb;
  --surface: #fffdf9;
  --surface-soft: #f2eadc;
  --ink: #26231f;
  --muted: #6b6359;
  --border: #e5dac8;
  --accent: #245249;
  --accent-hover: #1a3e37;
  --pin-bg: #e4f0ec;
  --pin-border: #8ebcb1;
  --queue-bg: #fdf5e6;
  --queue-border: #e3be7b;
  --radius: 14px;
  --shadow: 0 3px 14px rgba(58, 44, 24, 0.06);
}

body[data-theme="notesbog"] .topbar {
  background: #fffbf2;
}

body[data-theme="notesbog"] h1,
body[data-theme="notesbog"] h2,
body[data-theme="notesbog"] h3,
body[data-theme="notesbog"] .brand-title,
body[data-theme="notesbog"] .pind-title {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -0.01em;
}

body[data-theme="notesbog"] .quote-box {
  background: #f5efe2;
  border-left-color: #245249;
}

body[data-theme="notesbog"] .unread-badge {
  background: #c97a24;
}

/* 2. Varm Dagligstue */
body[data-theme="dagligstue"] {
  --bg: #f6efe6;
  --surface: #ffffff;
  --surface-soft: #efe4d6;
  --ink: #2e241e;
  --muted: #766356;
  --border: #e8d9c8;
  --accent: #b85c42;
  --accent-hover: #9a4932;
  --hard-bg: #e5efe7;
  --hard-fg: #34593e;
  --pin-bg: #faeae4;
  --pin-border: #dfa391;
  --queue-bg: #fdf5e8;
  --queue-border: #e4be82;
  --radius: 18px;
  --shadow: 0 4px 18px rgba(74, 46, 30, 0.06);
}

body[data-theme="dagligstue"] .topbar {
  background: #fdf9f3;
}

body[data-theme="dagligstue"] .btn,
body[data-theme="dagligstue"] .nav-actions .btn {
  border-radius: 999px;
}

body[data-theme="dagligstue"] .quote-box {
  background: #fbf5ee;
  border-left-color: #b85c42;
  border-radius: 0 14px 14px 0;
}

body[data-theme="dagligstue"] .unread-badge {
  background: #4e7358;
}

/* 3. Søndagsavis & Salvie */
body[data-theme="avis"] {
  --bg: #f3f5f2;
  --surface: #ffffff;
  --surface-soft: #e7ede6;
  --ink: #1e2926;
  --muted: #5a6b65;
  --border: #d8e0d7;
  --accent: #3b6b5c;
  --accent-hover: #2c5246;
  --pin-bg: #e6efea;
  --pin-border: #96b9ab;
  --queue-bg: #fdf7e9;
  --queue-border: #e2c179;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(24, 42, 36, 0.05);
}

body[data-theme="avis"] .topbar {
  background: #fafbfa;
}

body[data-theme="avis"] h1,
body[data-theme="avis"] h2,
body[data-theme="avis"] h3,
body[data-theme="avis"] .brand-title,
body[data-theme="avis"] .pind-title,
body[data-theme="avis"] .quote-box {
  font-family: Georgia, "Times New Roman", serif;
}

body[data-theme="avis"] .quote-box {
  background: #f7f9f6;
  border-left-color: #8ab0a0;
}

body[data-theme="avis"] .unread-badge {
  background: #c88a1e;
}

/* Hurtige hover-forklaringer (tooltips) */
.has-tip {
  position: relative;
}

span.has-tip {
  cursor: help;
}

.has-tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  width: max-content;
  max-width: 280px;
  padding: 8px 11px;
  border-radius: 9px;
  background: var(--ink);
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.77rem;
  font-weight: 400;
  line-height: 1.4;
  white-space: normal;
  text-align: left;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s ease;
  pointer-events: none;
  z-index: 60;
}

.has-tip::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 2px);
  left: 14px;
  border: 6px solid transparent;
  border-top-color: var(--ink);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease, visibility 0.12s ease;
  pointer-events: none;
  z-index: 60;
}

.has-tip:hover::after,
.has-tip:hover::before,
.has-tip:focus-visible::after,
.has-tip:focus-visible::before {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}


/* Partiprogram & kernemærkesager + inline periode-scan */
.party-ext-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.program-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.maerkesag-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: calc(var(--radius) - 2px);
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
}

.maerkesag-actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.btn-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.btn-chip:hover {
  border-color: var(--accent);
  background: var(--pin-bg);
  text-decoration: none;
}

.scan-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0;
}


/* Kant-sikre tooltips og bløde anker-spring */
html {
  scroll-behavior: smooth;
}

.has-tip-right::after {
  left: auto;
  right: 0;
}

.has-tip-right::before {
  left: auto;
  right: 14px;
}

.has-tip-below::after {
  bottom: auto;
  top: calc(100% + 7px);
}

.has-tip-below::before {
  bottom: auto;
  top: calc(100% + 2px);
  border-top-color: transparent;
  border-bottom-color: var(--ink);
}

.jump-target {
  scroll-margin-top: 86px;
  transition: box-shadow 0.25s ease;
}

.jump-target:target {
  box-shadow: 0 0 0 3px var(--accent), var(--shadow);
}

.badge-jump {
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.badge-jump:hover {
  transform: translateY(-1px);
  opacity: 0.92;
  text-decoration: none;
}


/* Fast øverst-til-højre pind/nål-mærke i kort */
.pind-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.pind-meta-row .pind-meta-top {
  margin-bottom: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.pind-pin-corner {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-pin {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.pin-svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  display: inline-block;
}

@media (max-width: 600px) {
  .pind-meta-row {
    flex-wrap: wrap;
  }
}
