/* PN1 full-page paragrafnøgle — privat Dronte-lag */

:root {
  color-scheme: light;
  --paper: #fff;
  --panel: #f6f6f6;
  --ink: #000;
  --muted: #797979;
  --line: #d8d8d8;
  --line-strong: #000;
  --accent: #1a3441;
  --accent-soft: #f4f8f9;
  --status-continued: #5c6b73;
  --status-modified: #7a5c28;
  --status-new: #2b6673;
  --status-repealed: #8a8a8a;
  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --gutter: var(--ab18-page-gutter);
  --page: var(--ab18-page);
}

body.pn1-page {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--ab18-type-ui);
  font-weight: 300;
  line-height: 1.55;
}

body.pn1-page a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.14em;
}

.page-shell {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* —— Header —— */
.page-head {
  padding: 18px 0 16px;
  border-bottom: 1px solid var(--line);
}

.page-kicker {
  margin: 0 0 6px;
  color: var(--muted);
  font: 600 var(--ab18-type-kicker) var(--sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.page-head h1 {
  margin: 0;
  font-weight: 500;
  font-size: clamp(1.25rem, 1.8vw, 1.6rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.lede {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: var(--ab18-type-small);
  line-height: 1.5;
  max-width: 42rem;
}

.pn1-provenance {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.disclaimer {
  margin: 0;
  color: var(--ink);
  font-size: var(--ab18-type-small);
  line-height: 1.5;
}

.source-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: var(--ab18-type-kicker);
  line-height: 1.45;
}

.page-body {
  padding: 16px 0 48px;
}

.pn1-review-obs {
  margin: 0 0 12px;
  padding: 10px 14px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: #faf8f0;
  color: var(--ink);
  font: 500 var(--ab18-type-small) var(--sans);
  line-height: 1.45;
}

/* —— Overblik-stripe —— */
.pn1-overview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 2px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--accent-soft);
}

.pn1-overview-sep {
  color: var(--muted);
  padding: 0 4px;
  user-select: none;
}

.pn1-overview-chip {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 600 var(--ab18-type-kicker) var(--sans);
  cursor: pointer;
}

.pn1-overview-chip:hover {
  background: rgba(255, 255, 255, 0.7);
}

.pn1-overview-chip[aria-pressed="true"] {
  border-color: var(--line-strong);
  background: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.pn1-overview-chip--repealed[aria-pressed="true"] {
  color: var(--status-repealed);
}

.pn1-overview-chip--modified[aria-pressed="true"] {
  color: var(--status-modified);
}

.pn1-overview-chip--new[aria-pressed="true"] {
  color: var(--status-new);
}

.pn1-overview-chip--continued[aria-pressed="true"] {
  color: var(--status-continued);
}

/* —— Toolbar —— */
.toolbar {
  display: grid;
  gap: 12px;
  margin: 0 0 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.toolbar-row-direction {
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.toolbar-row-filters {
  align-items: flex-end;
}

.toolbar-row-search {
  padding-top: 2px;
}

.toolbar label {
  color: var(--muted);
  font-size: var(--ab18-type-kicker);
  font-weight: 500;
}

.toolbar select,
.toolbar input[type="search"] {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  font: 400 var(--ab18-type-ui) var(--sans);
  background: #fff;
}

.toolbar input[type="search"] {
  width: 100%;
  flex: 1 1 auto;
}

.toolbar .count {
  color: var(--muted);
  font-size: var(--ab18-type-kicker);
  white-space: nowrap;
}

/* —— Asymmetrisk retningsvælger —— */
.pn1-direction {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px 14px;
  flex: 1 1 auto;
}

.pn1-direction-primary {
  display: grid;
  gap: 4px;
  flex: 1 1 280px;
  min-width: min(100%, 280px);
}

.pn1-direction-kicker {
  color: var(--accent);
  font: 700 var(--ab18-type-kicker) var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pn1-direction-main,
.pn1-direction-back {
  display: grid;
  gap: 2px;
  text-align: left;
  cursor: pointer;
  font-family: var(--sans);
}

.pn1-direction-main {
  min-height: 56px;
  padding: 10px 14px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  transition: background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

.pn1-direction-main[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.pn1-direction-main[aria-pressed="false"] {
  border-style: dashed;
  border-color: var(--line);
  color: var(--muted);
}

.pn1-direction-back {
  align-self: center;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}

.pn1-direction-back[aria-pressed="true"] {
  border-color: var(--line);
  background: #fff;
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.pn1-direction-back:hover,
.pn1-direction-main[aria-pressed="false"]:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pn1-direction-title {
  font: 600 var(--ab18-type-ui) var(--sans);
  line-height: 1.25;
}

.pn1-direction-sub {
  font-size: var(--ab18-type-kicker);
  font-weight: 400;
  line-height: 1.35;
  opacity: 0.92;
}

.pn1-direction-main[aria-pressed="true"] .pn1-direction-sub {
  opacity: 0.88;
}

.pn1-mode-narrative {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: var(--ab18-type-small);
  line-height: 1.45;
}

.lookup-hint {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: var(--ab18-type-small);
  line-height: 1.45;
}

.pn1-hint-primary {
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  background: var(--accent-soft);
  color: var(--ink);
}

.pn1-hint-secondary {
  border: 1px dashed var(--line);
  background: #fff;
  color: var(--muted);
}

body.pn1-secondary-ab18 .table-panel.is-secondary-view {
  border-style: dashed;
}

body.pn1-secondary-ab18 .table-panel.is-secondary-view thead th {
  color: var(--muted);
}

.clause-filter-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.clause-filter-group[hidden] {
  display: none !important;
}

.pn1-section-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  margin-left: auto;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
}

.pn1-section-switch button {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 650 var(--ab18-type-small) var(--sans);
  cursor: pointer;
}

.pn1-section-switch button:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.75);
}

.pn1-section-switch button[aria-pressed="true"] {
  border-color: var(--line-strong);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.status-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  margin-left: auto;
}

.status-legend button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font: 600 var(--ab18-type-kicker) var(--sans);
  cursor: pointer;
}

.status-legend button:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.status-legend button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.toolbar-help {
  margin: 0;
  color: var(--muted);
  font-size: var(--ab18-type-kicker);
  line-height: 1.45;
}

.toolbar-help summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--muted);
  list-style-position: outside;
}

.toolbar-help[open] summary {
  margin-bottom: 6px;
  color: var(--ink);
}

.toolbar-help p {
  margin: 0;
  padding-left: 1.1em;
  max-width: 42rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* —— Context / hints —— */
.search-parse-hint {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.74rem;
}

.search-parse-hint[hidden] {
  display: none !important;
}

.search-parse-hint strong {
  color: var(--ink);
  font-weight: 600;
}

.context-strip {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  background: var(--accent-soft);
  font-size: 0.82rem;
  line-height: 1.45;
}

.context-strip[hidden] {
  display: none !important;
}

.context-strip strong {
  font-weight: 600;
}

.ab92-hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.76rem;
}

.ab92-hint[hidden] {
  display: none !important;
}

/* —— Table —— */
.table-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
  max-height: calc(100vh - 300px);
  background: #fff;
  scrollbar-gutter: stable;
  box-shadow: inset -12px 0 12px -12px rgba(0, 0, 0, 0.04);
}

.key-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 0.84rem;
  table-layout: fixed;
}

.key-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-strong);
  background: var(--panel);
  font-weight: 600;
  font-size: var(--ab18-type-kicker);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  box-shadow: 0 1px 0 var(--line);
}

.key-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid #ececec;
  vertical-align: top;
  line-height: 1.45;
}

.key-table tbody tr:hover td {
  background: #fafafa;
}

.key-table tbody tr.is-focused td {
  background: var(--accent-soft);
}

.key-table tbody tr.is-focused td.col-from {
  box-shadow: inset 3px 0 0 var(--accent);
}

.key-table .col-from {
  font-weight: 600;
}

.key-table .col-to .pn1-int-link {
  font-weight: 600;
}

.key-table.is-ab92-lookup thead .col-to {
  color: var(--accent);
}

.key-table.is-ab18-lookup thead .col-from {
  color: var(--accent);
}

.col-ab92 {
  width: 22%;
}

.col-ab18 {
  width: 22%;
}

.col-change {
  width: 56%;
}

/* —— Links & refs —— */
.pn1-ref-cell {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.pn1-int-link,
.pn1-ext-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.12em;
  font-weight: 500;
}

.pn1-int-link:hover,
.pn1-ext-link:hover {
  color: var(--ink);
}

.pn1-int-link::after {
  content: " →";
  font-size: 0.85em;
  font-weight: 400;
}

.pn1-ext-link::after {
  content: " ↗";
  font-size: 0.85em;
  font-weight: 400;
}

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

.pn1-filter-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font: 600 0.62rem var(--sans);
  letter-spacing: 0.02em;
  text-decoration: none;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.key-table tbody tr:hover .pn1-filter-link,
.key-table tbody tr:focus-within .pn1-filter-link,
.pn1-filter-link:focus-visible {
  opacity: 1;
}

.pn1-filter-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

@media (hover: none) {
  .pn1-filter-link {
    opacity: 1;
  }
}

/* —— Change column —— */
.pn1-change-cell {
  display: grid;
  gap: 5px;
}

.pn1-change-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.status {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  line-height: 1.35;
}

.status-continued {
  border-color: #d5dbe0;
  background: #f5f7f8;
  color: var(--status-continued);
}

.status-modified {
  border-color: #ddd4c4;
  background: #faf8f4;
  color: var(--status-modified);
}

.status-new {
  border-color: #c5dde2;
  background: #f3f8f9;
  color: var(--status-new);
}

.status-repealed {
  border-color: #e0e0e0;
  background: #f7f7f7;
  color: var(--status-repealed);
}

.pn1-change-action {
  margin: 0;
}

.pn1-action-link {
  display: inline-block;
  font-size: var(--ab18-type-kicker);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.14em;
}

.pn1-change-note {
  margin: 0;
  color: var(--ink);
  font-size: 0.8rem;
  line-height: 1.45;
}

.pn1-change-note--muted {
  color: var(--muted);
}

.pn1-change-rationale {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.4;
}

.pn1-change-forarbejder {
  display: inline-block;
  margin-top: 2px;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.pn1-change-forarbejder::after {
  content: " ↗";
  font-size: 0.85em;
  font-weight: 400;
}

.empty {
  padding: 24px 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.empty[hidden] {
  display: none !important;
}

/* —— Mobile —— */
@media (max-width: 720px) {
  .toolbar-row-direction {
    flex-direction: column;
    align-items: stretch;
  }

  .pn1-direction {
    flex-direction: column;
    width: 100%;
  }

  .pn1-direction-back {
    align-self: stretch;
  }

  .toolbar .count {
    text-align: right;
  }

  .status-legend {
    margin-left: 0;
    width: 100%;
  }

  .table-panel {
    max-height: none;
  }

  .key-table thead {
    display: none;
  }

  .key-table tbody tr {
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
  }

  .key-table tbody td {
    display: block;
    padding: 0;
    border: 0;
  }

  .key-table tbody td::before {
    display: block;
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 3px;
  }

  .key-table tbody td[data-col-label]::before {
    content: attr(data-col-label);
  }

  .pn1-filter-link {
    opacity: 1;
  }
}