:root {
  --ink: #20283b;
  --muted: #657083;
  --line: #dce2e7;
  --paper: #ffffff;
  --canvas: #f4f6f4;
  --green: #247a72;
  --green-dark: #175f59;
  --green-soft: #e4f1ef;
  --blue: #1a4d8f;
  --orange: #a25d26;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: "Lato", Arial, sans-serif; }
a { color: inherit; }
button, input { font: inherit; }

.topbar { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.97); }
.topbar-inner { display: flex; max-width: 1120px; min-height: 64px; margin: auto; padding: .65rem 1.25rem; gap: 1rem; align-items: center; justify-content: space-between; }
.brand { font-weight: 900; text-decoration: none; white-space: nowrap; }
.topbar nav { display: flex; flex-wrap: wrap; gap: .45rem; justify-content: flex-end; }
.topbar nav a { padding: .54rem .68rem; border: 1px solid var(--line); border-radius: 5px; font-size: .8rem; font-weight: 700; text-decoration: none; }
.topbar nav a:hover, .topbar nav a:focus-visible { border-color: var(--green); color: var(--green-dark); background: #eef7f5; }
.topbar nav a[aria-current="page"] { border-color: var(--ink); color: #fff; background: var(--ink); }

.page-shell { max-width: 1120px; margin: 0 auto; padding: 3rem 1.25rem 4rem; }
.hero { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(250px,.55fr); gap: 2rem; align-items: end; padding-bottom: 2rem; border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--green); font-size: .72rem; font-weight: 900; text-transform: uppercase; }
h1, h2, h3 { font-family: "Playfair Display", Georgia, serif; }
h1 { max-width: 17ch; margin: .45rem 0 .8rem; font-size: clamp(2.55rem,6vw,5rem); line-height: .98; }
.hero p { max-width: 64ch; color: var(--muted); font-size: 1.05rem; line-height: 1.65; }
.hero-note { padding: 1rem; border-left: 4px solid var(--green); background: var(--paper); color: var(--muted); font-size: .88rem; line-height: 1.55; }

.toolbar { display: grid; grid-template-columns: minmax(220px,1fr) auto; gap: .7rem; align-items: center; padding: 1.2rem 0; }
.search-field { width: 100%; min-height: 44px; padding: 0 .85rem; border: 1px solid #b9c4cc; border-radius: 5px; color: var(--ink); background: var(--paper); }
.filter-row { display: flex; flex-wrap: wrap; gap: .42rem; }
.filter-row button { min-height: 40px; padding: 0 .7rem; border: 1px solid #bdc8cf; border-radius: 5px; color: var(--ink); background: var(--paper); font-size: .79rem; font-weight: 900; cursor: pointer; }
.filter-row button.is-active { border-color: var(--green); color: #fff; background: var(--green); }
.result-count { margin: 0 0 1rem; color: var(--muted); font-size: .84rem; font-weight: 700; }

.resource-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .85rem; }
.resource-card { display: flex; min-width: 0; min-height: 260px; flex-direction: column; padding: 1.1rem; border: 1px solid var(--line); border-top: 4px solid var(--green); border-radius: 7px; background: var(--paper); }
.resource-card[data-category="standards"] { border-top-color: var(--blue); }
.resource-card[data-category="downloads"] { border-top-color: var(--orange); }
.resource-card[data-category="norway"] { border-top-color: #7a4e91; }
.resource-card .tag { width: fit-content; padding: .2rem .42rem; border-radius: 3px; color: var(--green-dark); background: var(--green-soft); font-size: .7rem; font-weight: 900; text-transform: uppercase; }
.resource-card h2 { margin: .7rem 0 .45rem; font-size: 1.28rem; line-height: 1.25; }
.resource-card p { margin: 0 0 1rem; color: #596174; font-size: .9rem; line-height: 1.55; }
.resource-card a { margin-top: auto; color: var(--blue); font-size: .84rem; font-weight: 900; text-decoration: none; }
.resource-card a:hover { text-decoration: underline; }
.empty-state { padding: 2rem; border: 1px dashed #adb8c0; color: var(--muted); text-align: center; }

.guide-layout { display: grid; grid-template-columns: minmax(0,1fr) 255px; gap: 2.25rem; align-items: start; margin-top: 2rem; }
.article { min-width: 0; padding: clamp(1.2rem,3vw,2.2rem); border: 1px solid var(--line); border-radius: 7px; background: var(--paper); }
.article h2 { margin: 2rem 0 .65rem; font-size: 1.65rem; }
.article h2:first-child { margin-top: 0; }
.article h3 { margin: 1.25rem 0 .4rem; font-size: 1.15rem; }
.article p, .article li { color: #4e596c; line-height: 1.7; }
.article li + li { margin-top: .42rem; }
.article code { padding: .1rem .28rem; border-radius: 3px; background: #eef1f3; font-size: .9em; }
.article table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .9rem; }
.article th, .article td { padding: .7rem; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.article th { background: #eef3f2; }
.callout { margin: 1.2rem 0; padding: 1rem; border-left: 4px solid var(--green); background: #eef7f5; color: #40505b; line-height: 1.6; }
.checklist { padding: 1rem 1rem 1rem 2.2rem; border: 1px solid var(--line); border-radius: 6px; background: #fafbfb; }
.article-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1.5rem; }
.button-link { display: inline-flex; min-height: 42px; padding: 0 .8rem; align-items: center; border-radius: 5px; color: #fff; background: var(--ink); font-size: .84rem; font-weight: 900; text-decoration: none; }
.button-link.secondary { border: 1px solid var(--line); color: var(--ink); background: #fff; }
.toc { position: sticky; top: 84px; padding: 1rem; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); }
.toc strong { display: block; margin-bottom: .65rem; }
.toc a { display: block; padding: .36rem 0; color: var(--blue); font-size: .84rem; text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.related { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .75rem; margin-top: 2rem; }
.related a { padding: 1rem; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); font-weight: 900; line-height: 1.35; text-decoration: none; }
.related a:hover { border-color: var(--green); }
.site-footer { max-width: 1120px; margin: 0 auto; padding: 1.5rem 1.25rem 2.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; line-height: 1.6; }
.site-footer a { color: var(--blue); }

@media (max-width: 900px) {
  .hero, .guide-layout { grid-template-columns: 1fr; }
  .resource-grid, .related { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .toc { position: static; }
}
@media (max-width: 680px) {
  .topbar-inner { align-items: flex-start; flex-direction: column; gap: .65rem; }
  .topbar nav { width: 100%; justify-content: flex-start; }
  .topbar nav a { flex: 1 1 auto; text-align: center; }
  .page-shell { padding-top: 2rem; }
  .toolbar { grid-template-columns: 1fr; }
  .resource-grid, .related { grid-template-columns: 1fr; }
  .resource-card { min-height: 0; }
  .article { padding: 1.1rem; }
  .article table { display: block; overflow-x: auto; }
}
