/* The Norwegian tools (tilleggskalkulator, egenmelding, omsorgsdager) on top of site.css, v2.0 (24.11.2026).
   The class names are the ones the pages' scripts write; only their look is defined here.
   The counter sits between two rules, not in a grey box. Notices are a line of text with a mark, not a tinted panel. */
:root { --field: var(--bg); --warn: #8a5a00; --danger: #a3261e; }
@media (prefers-color-scheme: dark) { :root { --warn: #e3b25a; --danger: #ff8a80; } }

.tool { max-width: 44rem; padding-block: clamp(28px, 5vw, 56px) 0; }
.tool h1 { font-size: clamp(28px, 4.2vw, 38px); }
.tool .lead { font-size: 19px; color: var(--muted); margin-top: 12px; }
.tool > h2 { margin-top: 48px; margin-bottom: 10px; }
.tool h3 { margin-top: 22px; margin-bottom: 4px; }
.tool > p, .tool > ul, .tool > dl { max-width: var(--col); }
.tool > p + p { margin-top: 0.8em; }
.note { color: var(--muted); font-size: 14px; }
small.note { display: block; margin-top: 4px; }
.tool > .note { margin-top: 12px; }

/* The counter. */
.calc { margin-top: 28px; padding-block: 20px 22px; border-block: 1px solid var(--fg); }
.calc h2 { font-size: 17px; margin: 26px 0 8px; }
fieldset { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
legend, label.l { display: block; font-size: 14px; font-weight: 600; color: var(--muted); margin: 0 0 6px; padding: 0; }
.choices { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--rule); cursor: pointer; }
.choice input { margin: 5px 0 0; accent-color: var(--fg); }
.choice:has(input:checked) > span { font-weight: 600; }
.choice small { display: block; color: var(--muted); font-size: 14px; font-weight: 400; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: end; }
.grid .wide { grid-column: 1 / -1; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid + .grid { margin-top: 12px; }
input[type="date"], input[type="time"], input[type="text"], select { width: 100%; min-width: 0; min-height: 44px; font: inherit; color: var(--fg); background: var(--field); border: 1px solid var(--rule); border-radius: 6px; padding: 8px 10px; }
input[type="date"] { -webkit-appearance: none; appearance: none; display: block; }
input:hover, select:hover { border-color: var(--muted); }
input:focus-visible, select:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--fg); outline-offset: 1px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; }
.check input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--fg); flex: none; }
.check small { display: block; color: var(--muted); font-size: 14px; }
details { margin-top: 14px; }
summary { cursor: pointer; font-size: 15px; font-weight: 600; min-height: 44px; display: flex; align-items: center; gap: 6px; }
summary::before { content: "+"; width: 1em; } details[open] > summary::before { content: "\2212"; }
summary::-webkit-details-marker { display: none; }
button { font: inherit; min-height: 44px; border-radius: 6px; padding: 8px 16px; cursor: pointer; }
button.primary { background: var(--fg); color: var(--bg); border: 1px solid var(--fg); font-weight: 600; margin-top: 14px; }
button.quiet { background: transparent; color: var(--fg); border: 1px solid var(--rule); }
button.danger { color: var(--danger); }
button.link { background: none; border: 0; padding: 9px 2px 13px 12px; min-height: 0; color: var(--fg); text-decoration: underline; }

/* Result first: the big figure, then one row per figure. */
.result { margin: 0; }
.calc > .result:not(:first-child) { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--rule); }
.total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.total .big { font-size: 40px; line-height: 1.1; font-weight: 650; letter-spacing: -0.02em; }
.total .exact { flex-basis: 100%; text-align: right; color: var(--muted); font-size: 14px; }
.total + .note { margin: 4px 0 8px; }
.sums { margin: 10px 0 6px; }
.sums > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 16px; padding: 3px 0; }
.sums dt { color: var(--muted); }
.sums dd { margin: 0 0 0 auto; text-align: right; }
dl.sums:not(:has(> div)) { display: grid; grid-template-columns: 1fr auto; gap: 3px 0; }
dl.sums:not(:has(> div)) dd { padding-left: 16px; }
.sums .sum, .sums > div.sum { font-weight: 650; border-top: 1px solid var(--rule); padding-top: 5px; margin-top: 5px; color: var(--fg); }
.sums > div.sum dt { color: var(--fg); }
.settings { margin: 16px 0 0; border-block: 1px solid var(--rule); }
.settings > summary { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; min-height: 52px; padding: 8px 0; font-size: 17px; font-weight: 400; }
.settings > summary::before, .settings[open] > summary::before { content: none; }
.settings > summary .st { font-size: 14px; font-weight: 600; color: var(--muted); }
.settings > summary .sv { flex: 1 1 auto; min-width: 0; }
.settings > summary .sx { font-size: 15px; text-decoration: underline; margin-left: auto; }
.settings > summary .sx::after { content: "Endre"; }
.settings[open] > summary .sx::after { content: "Skjul"; }
.settings > form { padding: 4px 0 16px; }
.note.help { margin: 10px 0 0; }

.calc table, .tool table { width: 100%; border-collapse: collapse; font-size: 15px; }
.calc th, .calc td, .tool th, .tool td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.calc th, .tool th { color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; white-space: nowrap; }
td small { display: block; color: var(--muted); }
td small.w { color: var(--warn); }
.log table, .result table { font-size: 14px; }
.log th, .log td, .result th, .result td { padding: 9px 6px; }
.log th:first-child, .log td:first-child, .result th:first-child, .result td:first-child { padding-left: 0; }
.log th:last-child, .log td:last-child, .result th:last-child, .result td:last-child { padding-right: 0; }
.log th:last-child, .log td:last-child { text-align: right; }
.wrapx { overflow-x: auto; }

/* Something to be aware of: a short rule in the warning colour beside ordinary text. */
.flag { position: relative; padding: 2px 0 2px 14px; margin: 10px 0 0; font-size: 15px; color: var(--fg); }
.flag::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 2px; background: var(--warn); }
#adderr.flag { margin-top: 12px; }
.store { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--rule); }
.store p { margin: 0; flex: 1 1 260px; }

/* Rules and sources under the counter: hairline rows, the term left. */
ul.plain { list-style: none; padding: 0; border-top: 1px solid var(--rule); }
ul.plain > li { padding: 11px 0; border-bottom: 1px solid var(--rule); }
ul.plain > li > strong:first-child { font-weight: 600; }
dl.rows dd > q, ul.plain q { color: var(--muted); }
.tool blockquote { margin: 6px 0; padding-left: 14px; border-left: 1px solid var(--rule); color: var(--muted); }
/* "Vår lesing": the counter's own reading of the rule, set apart in words, not a badge. */
.own { font-style: italic; color: var(--muted); white-space: nowrap; }

@media (max-width: 420px) { .total .big { font-size: 32px; } .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Long rule sections fold away under their heading; the text stays on the page for readers and search. */
details.more { margin-top: 36px; border-top: 1px solid var(--rule); }
details.more > summary { min-height: 56px; font-size: inherit; }
details.more > summary h2 { display: inline; font-size: 20px; }
details.more > summary::before { content: "+"; font-size: 20px; font-weight: 400; width: 1.1em; }
details.more[open] > summary::before { content: "\2212"; }
details.more > :not(summary) { margin-top: 8px; }
.tool .rows > div { grid-template-columns: 1fr; gap: 2px; }
.calc > .result:first-child + * { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--rule); }
button.quiet.danger { border: 0; padding-inline: 0; text-decoration: underline; text-underline-offset: 3px; }
details.more { margin-top: 28px; }
details.more > summary { min-height: 52px; }
