/* Opslagseffekt – alt er afgrænset til .opse-app, så temaet ikke påvirkes */
.opse-app {
  --opse-ink: #1c2433;
  --opse-muted: #566072;
  --opse-line: #d8dee8;
  --opse-surface: #f4f6fa;
  --opse-paper: #ffffff;
  --opse-direct: #0a7c72;
  --opse-direct-soft: #e2f1ee;
  --opse-posts: #5b3fd6;
  --opse-posts-soft: #ece8fb;
  --opse-ns: #9aa3b2;
  --opse-danger: #b42318;
  --opse-radius: 10px;
  box-sizing: border-box;
  max-width: 900px;
  margin: 2em auto;
  color: var(--opse-ink);
  background: var(--opse-paper);
  border: 1px solid var(--opse-line);
  border-radius: var(--opse-radius);
  padding: clamp(18px, 3.5vw, 36px);
  font-size: 16px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}
.opse-app *, .opse-app *::before, .opse-app *::after { box-sizing: inherit; }
.opse-app [hidden] { display: none !important; }
:where(.opse-app) :where(h2, h3, p, ol, ul, li) { margin: 0; padding: 0; }
:where(.opse-app) :where(button, select, input) { font: inherit; color: inherit; }
.opse-app :focus-visible { outline: 2px solid var(--opse-posts); outline-offset: 2px; }

/* Indledning */
.opse-head { max-width: 62ch; margin-bottom: 28px; }
.opse-title { font-size: clamp(1.45rem, 3vw, 1.85rem); line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 10px; }
.opse-lede { color: var(--opse-ink); margin-bottom: 8px; }
.opse-privacy { color: var(--opse-muted); font-size: 0.9rem; }

/* Trin */
.opse-steps { list-style: none; counter-reset: opse; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.opse-step {
  counter-increment: opse; position: relative; background: var(--opse-surface);
  border-radius: 8px; padding: 18px 16px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0;
}
.opse-step h3 { font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.opse-step h3::before {
  content: counter(opse); display: inline-grid; place-items: center; width: 26px; height: 26px; flex: none;
  border-radius: 50%; background: var(--opse-ink); color: #fff; font-size: 0.85rem; font-weight: 700;
}
.opse-step > p { font-size: 0.92rem; color: var(--opse-muted); }

.opse-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  gap: 2px; padding: 18px 12px; border: 1.5px dashed #b7c0cf; border-radius: 8px; background: var(--opse-paper);
  cursor: pointer; transition: border-color .15s, background-color .15s;
}
.opse-drop:hover, .opse-drop.is-over { border-color: var(--opse-posts); background: var(--opse-posts-soft); }
.opse-drop:focus-within { outline: 2px solid var(--opse-posts); outline-offset: 2px; }
.opse-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.opse-drop-main { font-weight: 600; color: var(--opse-posts); }
.opse-drop-sub { font-size: 0.85rem; color: var(--opse-muted); }

.opse-filestatus:empty { display: none; }
.opse-filestatus { font-size: 0.86rem; padding: 8px 10px; border-radius: 6px; overflow-wrap: anywhere; }
.opse-filestatus p + p { margin-top: 4px; }
.opse-filestatus.is-ok { background: var(--opse-direct-soft); color: #064e48; }
.opse-filestatus.is-error { background: #fdecea; color: var(--opse-danger); }

.opse-link {
  align-self: flex-start; background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--opse-posts); text-decoration: underline; text-underline-offset: 3px; font-size: 0.92rem;
}
.opse-howto { font-size: 0.88rem; }
.opse-howto summary { cursor: pointer; color: var(--opse-posts); }
.opse-howto ol { margin: 8px 0 0 1.2em; display: grid; gap: 4px; color: var(--opse-muted); }

.opse-label { font-size: 0.92rem; font-weight: 600; }
.opse-select {
  width: 100%; padding: 8px 10px; border: 1px solid #b7c0cf; border-radius: 6px; background: var(--opse-paper);
}
.opse-check { display: flex; align-items: center; gap: 8px; font-size: 0.92rem; }
.opse-check input { width: 18px; height: 18px; accent-color: var(--opse-posts); margin: 0; }
.opse-run {
  margin-top: auto; padding: 11px 16px; border: 0; border-radius: 8px; cursor: pointer;
  background: var(--opse-posts); color: #fff; font-weight: 700;
}
.opse-run:hover:not(:disabled) { background: #4a2fc2; }
.opse-run:disabled { background: #c3c8d2; cursor: not-allowed; }

.opse-msg { margin-top: 18px; padding: 12px 14px; border-radius: 8px; background: #fdecea; color: var(--opse-danger); }

/* Resultater */
.opse-results { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--opse-line); display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; outline: none; }
.opse-meta { color: var(--opse-muted); font-size: 0.92rem; }

.opse-verdict {
  border-left: 6px solid var(--opse-direct); background: var(--opse-direct-soft);
  padding: 22px 24px; border-radius: 0 var(--opse-radius) var(--opse-radius) 0; display: grid; gap: 10px; max-width: 70ch;
}
.opse-verdict.is-ns { border-left-color: var(--opse-ns); background: var(--opse-surface); }
.opse-verdict-main { font-size: clamp(1.25rem, 2.6vw, 1.6rem); line-height: 1.3; font-weight: 700; letter-spacing: -0.01em; }
.opse-verdict.is-sig .opse-verdict-main { color: #06574f; }
.opse-verdict-extra { color: var(--opse-muted); font-size: 0.95rem; }

.opse-block { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; }
.opse-block h3 { font-size: 1.1rem; font-weight: 700; }
.opse-block-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 20px; }
.opse-note { font-size: 0.88rem; color: var(--opse-muted); max-width: 70ch; }
.opse-inline { display: flex; align-items: center; gap: 8px; font-size: 0.92rem; }
.opse-inline .opse-select { width: auto; min-width: 180px; }

.opse-toggle { display: inline-flex; border: 1px solid #b7c0cf; border-radius: 8px; overflow: hidden; }
.opse-toggle button { border: 0; background: var(--opse-paper); padding: 6px 12px; cursor: pointer; font-size: 0.88rem; }
.opse-toggle button + button { border-left: 1px solid #b7c0cf; }
.opse-toggle button[aria-pressed="true"] { background: var(--opse-ink); color: #fff; }

.opse-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.opse-forest { display: block; width: 100%; height: auto; }
.opse-series { display: block; width: 100%; min-width: 560px; height: auto; }
.opse-app svg text { font-family: inherit; fill: var(--opse-ink); }
.opse-grid { stroke: var(--opse-line); stroke-width: 1; }
.opse-zero { stroke: var(--opse-ink); stroke-width: 1.25; }
.opse-month { stroke: var(--opse-line); stroke-dasharray: 2 3; }
.opse-axis { font-size: 12px; fill: var(--opse-muted) !important; }
.opse-panel-label { font-size: 12.5px; fill: var(--opse-muted) !important; }
.opse-rowlabel { font-size: 14px; }
.opse-rowval { font-size: 13px; }
.opse-row .opse-ci { stroke-width: 2; stroke: currentColor; }
.opse-row .opse-pt { fill: currentColor; }
.opse-row.is-sig { color: var(--opse-ink); }
.opse-row.is-ns { color: var(--opse-ns); }
.opse-row.is-ns .opse-rowval, .opse-row.is-ns .opse-rowlabel { fill: var(--opse-muted); }
.opse-row.is-direct { color: var(--opse-direct); }
.opse-row.is-direct .opse-rowlabel, .opse-row.is-direct .opse-rowval { font-weight: 700; fill: #06574f; }
.opse-rowbg { fill: var(--opse-direct-soft); }

.opse-line-raw { fill: none; stroke: #b7c0cf; stroke-width: 1; }
.opse-line-ma { fill: none; stroke: var(--opse-ink); stroke-width: 2.25; stroke-linejoin: round; }
.opse-line-raw.is-direct { stroke: #9fd0c9; }
.opse-line-ma.is-direct { stroke: var(--opse-direct); }
.opse-bar { fill: var(--opse-posts); }
.opse-hit { fill: transparent; }
.opse-hit:hover { fill: rgba(91, 63, 214, 0.08); }

.opse-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.opse-table th, .opse-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--opse-line); white-space: nowrap; }
.opse-table thead th { font-size: 0.8rem; color: var(--opse-muted); font-weight: 600; border-bottom: 1.5px solid var(--opse-ink); vertical-align: bottom; }
.opse-table .num { text-align: right; }
.opse-table tbody th { font-weight: 600; }
.opse-table tr.is-direct th, .opse-table tr.is-direct td { background: var(--opse-direct-soft); }
.opse-table tr.is-direct th { color: #06574f; }
.opse-table td.is-sig { font-weight: 700; }
.opse-table .opse-muted { color: var(--opse-muted); white-space: normal; }

.opse-details summary { cursor: pointer; color: var(--opse-posts); font-size: 0.92rem; margin-top: 4px; }
.opse-details[open] summary { margin-bottom: 8px; }
.opse-details .opse-note { margin-bottom: 8px; }

.opse-caveat { background: var(--opse-surface); border-radius: 8px; padding: 18px 20px; }
.opse-caveat ul { margin-left: 1.1em; display: grid; gap: 6px; font-size: 0.92rem; max-width: 72ch; }

.opse-actions { display: flex; gap: 12px; }
.opse-secondary {
  padding: 9px 14px; border: 1.5px solid var(--opse-ink); border-radius: 8px; background: var(--opse-paper);
  cursor: pointer; font-weight: 600;
}
.opse-secondary:hover { background: var(--opse-surface); }

@media (max-width: 780px) {
  .opse-steps { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .opse-app * { transition: none !important; }
}

/* Adstock, effektkurve og samlet søgegruppe */
.opse-howto-h { margin-top: 10px !important; font-weight: 600; color: var(--opse-ink); }
.opse-verdict-timing { font-weight: 600; color: #06574f; }
.opse-verdict.is-ns .opse-verdict-timing { color: var(--opse-ink); }
.opse-aggline { stroke: var(--opse-line); stroke-dasharray: 4 3; }
.opse-row.is-agg .opse-rowlabel { font-style: italic; }
.opse-table tr.is-agg th { font-style: italic; }
.opse-table tr.is-agg th, .opse-table tr.is-agg td { border-top: 1.5px dashed var(--opse-line); }
.opse-curve { margin-top: 18px; display: grid; gap: 6px; }
.opse-cbar rect { fill: #b9c9e6; }
.opse-cbar.is-peak rect { fill: var(--opse-posts); }
.opse-cwhisk { stroke: var(--opse-ink); stroke-width: 1.25; }
