:root {
  --bg: #F3F0E8;
  --fg: #121212;
  --muted: #55534E;
  --line: #D9D4C7;
  --surface: #FFFFFF;
  --accent: #2E3CF0;
  --accent-soft: #E3E5FD;
  --on-accent: #FFFFFF;
  --display: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --body: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111114;
    --fg: #EEEAE0;
    --muted: #B7B3AA;
    --line: #34343C;
    --surface: #1A1A20;
    --accent: #A9AFFF;
    --accent-soft: #23264A;
    --on-accent: #0B0B12;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
body:has(dialog[open]) { overflow: hidden; }
.wrap { max-width: 1240px; margin-inline: auto; padding-inline: max(24px, env(safe-area-inset-left, 0px)) max(24px, env(safe-area-inset-right, 0px)); }
a { color: inherit; }
button, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; }
em { color: var(--accent); }
.secondary { color: var(--muted); font-size: .9rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; top: -100px; left: 16px; z-index: 2; background: var(--surface); padding: 12px; }
.skip-link:focus { top: 12px; }
.site-header { border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 19px; }
.logo { font-family: var(--display); font-size: 30px; line-height: 1; text-decoration: none; letter-spacing: -.015em; white-space: nowrap; }
.header-inner nav { display: flex; align-items: center; gap: 28px; font-size: .9rem; }
.header-inner nav a { text-decoration: none; }
.header-inner nav a[aria-current] { color: var(--accent); }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: 10px 18px; border: 1px solid var(--fg); border-radius: 0; background: var(--fg); color: var(--bg); font-size: .9rem; font-weight: 500; text-decoration: none; }
.button:hover:enabled { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.secondary-button { color: var(--fg); background: transparent; border-color: var(--line); }
.intro { padding-block: clamp(56px, 8vw, 104px) clamp(48px, 6vw, 72px); }
.intro h1 { font-size: clamp(3.2rem, 7.4vw, 6rem); letter-spacing: -.025em; line-height: 1; text-wrap: balance; margin-bottom: 28px; }
.intro p { max-width: 42em; font-size: clamp(1.0625rem, 1.6vw, 1.25rem); }
.intro p + p { margin-top: 20px; }
#register { scroll-margin-top: 24px; }
.register-toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; padding-bottom: 24px; }
.register-toolbar h2 { font-size: 2rem; line-height: 1.15; margin-bottom: 8px; }
.period-field { display: grid; gap: 5px; flex-shrink: 0; }
.period-field label { font-size: .875rem; }
select { min-height: 46px; width: 240px; padding: 10px 40px 10px 14px; color: var(--fg); background-color: var(--surface); border: 1px solid var(--line); border-radius: 0; appearance: none; }
.period-field { position: relative; }
.period-field::after { content: ''; position: absolute; width: 8px; height: 8px; border-right: 1.5px solid var(--fg); border-bottom: 1.5px solid var(--fg); transform: rotate(45deg); right: 17px; bottom: 20px; pointer-events: none; }
.notice { padding: 24px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 16px; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th { padding: 15px 12px; text-align: left; font-size: .875rem; font-weight: 500; border-top: 1px solid var(--fg); border-bottom: 1px solid var(--fg); }
th:first-child { width: 49%; padding-left: 0; }
th:nth-child(2) { width: 18%; }
th:nth-child(3) { width: 17%; }
th:last-child { width: 16%; padding-right: 0; }
td { padding: 24px 12px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
td:first-child { padding-left: 0; }
td:last-child { padding-right: 0; }
.finding-title { display: block; padding: 0; border: 0; background: transparent; color: var(--fg); text-align: left; font-family: var(--display); font-size: 1.65rem; line-height: 1.18; }
.finding-title:hover { color: var(--accent); }
.finding-reference { display: block; font-size: .875rem; color: var(--muted); margin-top: 8px; }
.source-names { display: grid; gap: 5px; font-size: .9rem; }
.source-names a { text-decoration-color: var(--line); text-underline-offset: 4px; }
.source-names a:hover { color: var(--accent); }
.published-date { font-size: .9rem; }
.severity { display: inline-block; padding: 4px 9px; border: 1px solid var(--line); font-size: .875rem; font-weight: 500; line-height: 1.5; }
.severity-critical { background: #FAD4D0; border-color: #FAD4D0; color: #79180E; }
.severity-high { background: #FCE4B1; border-color: #FCE4B1; color: #653C00; }
.severity-medium { background: #F4EFB9; border-color: #F4EFB9; color: #5B5100; }
.severity-low { background: #DAE7F7; border-color: #DAE7F7; color: #194C82; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 24px; }
.register-note { color: var(--muted); font-size: .875rem; margin-top: 20px; max-width: 52em; }
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; border-top: 1px solid var(--line); margin-top: clamp(64px, 8vw, 104px); padding-block: 48px 72px; }
.about h2 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.05; max-width: 12ch; }
.about p { margin-bottom: 18px; }
.text-link { font-weight: 500; text-decoration-color: var(--accent); text-underline-offset: 5px; }
footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 24px; padding-block: 32px; }
.footer-inner .logo { font-size: 24px; }
.footer-inner > div { display: flex; flex-wrap: wrap; gap: 12px 24px; font-size: .875rem; color: var(--muted); }
dialog { width: min(760px, calc(100% - 32px)); max-height: calc(100dvh - 48px); padding: 0; color: var(--fg); background: var(--surface); border: 1px solid var(--line); }
dialog::backdrop { background: rgba(0, 0, 0, .5); }
.dialog-header { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 14px 28px; border-bottom: 1px solid var(--line); background: var(--surface); font-size: .875rem; }
.close-button { border: 1px solid var(--line); min-height: 44px; padding: 8px 16px; color: var(--fg); background: transparent; }
.dialog-content { padding: 32px; }
.dialog-content h2 { font-size: clamp(2rem, 4vw, 2.75rem); line-height: 1.1; overflow-wrap: anywhere; }
#detail-status:not(:empty) { margin-top: 24px; }
.detail-description { margin-block: 28px; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-properties { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; padding-block: 24px; border-block: 1px solid var(--line); margin: 0 0 28px; }
.detail-properties dt { color: var(--muted); font-size: .875rem; margin-bottom: 6px; }
.detail-properties dd { margin: 0; overflow-wrap: anywhere; }
.dialog-content h3 { font-size: 1.75rem; margin-bottom: 16px; }
.source-list { list-style: none; margin: 0; padding: 0; }
.source-list li { padding-block: 16px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.source-list a { color: var(--accent); font-weight: 500; }
.source-list p { margin-top: 8px; font-size: .875rem; color: var(--muted); }

@media (max-width: 860px) {
  th:first-child { width: 44%; }
  th:nth-child(2) { width: 19%; }
  th:nth-child(3) { width: 19%; }
  th:last-child { width: 18%; }
  .finding-title { font-size: 1.5rem; }
}

@media (max-width: 620px) {
  .wrap { padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px)); }
  .header-inner { gap: 12px; }
  .header-inner .button { padding-inline: 12px; font-size: .875rem; }
  .register-toolbar { align-items: stretch; flex-direction: column; gap: 20px; }
  .period-field { align-self: flex-start; width: 100%; }
  select { width: 100%; }
  table, tbody { display: block; }
  thead { display: none; }
  tr { display: grid; grid-template-columns: 1fr auto; gap: 14px 18px; padding-block: 24px; border-top: 1px solid var(--line); }
  tr:last-child { border-bottom: 1px solid var(--line); }
  td, td:first-child, td:last-child { padding: 0; border: 0; }
  td:first-child { grid-column: 1 / -1; }
  td:nth-child(2) { grid-column: 2; grid-row: 2; text-align: right; }
  td:nth-child(3) { grid-column: 1; grid-row: 2; }
  td:last-child { grid-column: 1 / -1; }
  .published-date::before { content: 'Senast publicerat '; color: var(--muted); }
  .pagination { flex-wrap: wrap; gap: 12px; }
  #page-number { order: -1; width: 100%; }
  .pagination .button { flex: 1; padding-inline: 10px; }
  .about { grid-template-columns: 1fr; gap: 24px; }
  .about h2 { max-width: 100%; }
  .dialog-header { padding-inline: 20px; }
  .dialog-content { padding: 24px 20px; }
  .detail-properties { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .intro { padding-block: 24px 20px; }
  .intro h1 { font-size: 2.85rem; margin-bottom: 14px; }
  .intro p { font-size: 1rem; line-height: 1.5; }
  .intro p + p { margin-top: 12px; }
}
