/* Tema ovanpå Pico CSS. Färgerna utgår från logotypen. */
html:root[data-theme="light"] {
    --pico-font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --pico-font-size: 106%;
    --pico-border-radius: 8px;
    --pico-primary: #b84a2a;
    --pico-primary-background: #b84a2a;
    --pico-primary-border: #b84a2a;
    --pico-primary-hover: #94381e;
    --pico-primary-hover-background: #94381e;
    --pico-primary-hover-border: #94381e;
    --pico-primary-underline: rgba(184,74,42,.45);
    --pico-primary-inverse: #fff;
    --pico-color: #1d2733;
    --pico-h1-color: #16202b;
    --pico-h2-color: #16202b;
    --pico-h3-color: #16202b;
    --pico-muted-color: #5a6775;
    --pico-form-element-background-color: #fff;
    --pico-form-element-focus-color: var(--pico-primary);
    --pico-primary-focus: rgba(184,74,42,.25);
    --hv-bad:#a32a2a; --hv-warn:#8a5a00; --hv-ok:#1f6b45; --hv-line:#dfe4ea; --hv-bg:#f7f8fa;
}
html, body { background: var(--hv-bg); }
body { min-height: 100vh; }
main.container { max-width: 860px; padding-top: 2.2rem; padding-bottom: 4rem; }
main.narrow { max-width: 440px; }
h1 { font-size: 2rem; letter-spacing: -.02em; margin-bottom: .35rem; }
.lead { color: var(--pico-muted-color); }
.topbar { background: #fff; border-bottom: 1px solid var(--hv-line); }
.topbar nav { max-width: 860px; margin: 0 auto; padding: 0 1rem; }
.topbar a:not(.brand) { color: var(--pico-color); text-decoration: none; font-size: .92rem; }
.topbar a:not(.brand):hover { color: var(--pico-primary); }
.topbar button { font-size: .92rem; color: var(--pico-muted-color) !important; text-decoration: none !important; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; color: var(--pico-color); text-decoration: none; }
.topbar form { margin: 0; }
.topbar button { margin: 0; padding: 0; background: none; border: 0; color: var(--pico-primary); text-decoration: underline; width: auto; font-weight: 400; }
.logo { display: block; margin-bottom: 1rem; }

.niches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin-bottom: 1rem; }
.niches legend { grid-column: 1 / -1; font-weight: 600; margin-bottom: .5rem; }
label.niche:has(input) { position: relative; width: 100%; margin: 0; display: block; }
.niche input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.niche span { display: flex; align-items: center; width: 100%; min-height: 4rem; height: 100%; padding: .7rem 1rem; background: #fff; border: 1px solid var(--hv-line); border-radius: var(--pico-border-radius); font-size: .93rem; line-height: 1.3; transition: border-color .12s, background .12s; }
.niche input:hover + span { border-color: #c9b0a7; }
.niche input:checked + span { border-color: var(--pico-primary); background: #fdf1ec; box-shadow: inset 0 0 0 1px var(--pico-primary); color: #7a2d15; font-weight: 600; }
.niche input:focus-visible + span { outline: 2px solid var(--pico-primary); outline-offset: 2px; }
.search { display: flex; gap: .6rem; }
.search input, .search button { margin: 0; }
.search input { flex: 1; min-width: 0; }
.search button { width: auto; }
.hint, .note, .cost { color: var(--pico-muted-color); font-size: .85rem; }
.hint { margin-top: .6rem; }
.error { color: var(--hv-bad); } .message { color: var(--hv-ok); }

.result-serious h1 { color: var(--hv-bad); } .result-findings h1 { color: var(--hv-warn); } .result-clean h1 { color: var(--hv-ok); }
.company { color: var(--pico-muted-color); margin-bottom: .4rem; }
.meta { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: 1.4rem; color: var(--pico-muted-color); font-size: .85rem; }
.meta form { margin: 0; }
.meta button { margin: 0; width: auto; padding: .35rem .8rem; font-size: .85rem; }
.decision, .facts { background: #fff; border: 1px solid var(--hv-line); border-radius: 10px; padding: 1.1rem 1.25rem; margin-bottom: .9rem; box-shadow: none; }
.decision h2 { font-size: 1rem; margin-bottom: .6rem; }
.finding { margin-bottom: .8rem; } .finding:last-child { margin-bottom: 0; }
.area { font-size: .78rem; font-weight: 600; color: var(--pico-muted-color); text-transform: none; }
blockquote { margin: .35rem 0 0; padding: 0 0 0 .75rem; font-style: normal; font-size: .9rem; color: var(--pico-muted-color); border-inline-start: 3px solid var(--hv-line); }
.facts { margin-bottom: 1.5rem; }
.facts h2 { font-size: 1.05rem; margin-bottom: .7rem; }
.facts h3 { font-size: .95rem; margin: 1rem 0 .25rem; }
.facts ul { margin: 0; padding-left: 1.1rem; font-size: .92rem; }
.facts li { list-style: disc; margin: 0; }
.facts dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem 1.4rem; margin: 0; }
.facts dt { font-size: .78rem; color: var(--pico-muted-color); }
.facts dd { margin: 0; font-size: .92rem; overflow-wrap: anywhere; }
.company-text { font-size: .9rem; color: var(--pico-muted-color); margin: .8rem 0 0; }
h2.section { font-size: 1.1rem; margin: 2rem 0 .5rem; }
.facts h2.section { margin-top: 0; }
.table-wrap { overflow-x: auto; }
table { font-size: .9rem; background: #fff; }
table button { margin: 0; width: auto; padding: .3rem .7rem; font-size: .82rem; }
table form { margin: 0; }
.card { background: #fff; border: 1px solid var(--hv-line); border-radius: 10px; padding: 1.25rem; margin-top: 1.5rem; }
.card h2 { font-size: 1.05rem; }
@media (max-width: 560px) { .niches, .facts dl { grid-template-columns: 1fr; } .search { flex-direction: column; } .search button { width: 100%; } }
@media print { .topbar, .meta form, .no-print { display: none; } body { background: #fff; } .decision, .facts { break-inside: avoid; } }

/* Startsida och inloggning */
.panel { background: #fff; border: 1px solid var(--hv-line); border-radius: 14px; padding: 1.6rem; box-shadow: 0 1px 2px rgba(22,32,43,.04), 0 8px 24px rgba(22,32,43,.05); }
.panel form { margin: 0; }
.panel .niche span { background: var(--hv-bg); }
.panel .niche input:checked + span { background: #fdf1ec; }
main.narrow { padding-top: 4rem; }
main.narrow .panel button { width: 100%; }

/* Resultat */
.verdict { background: #fff; border: 1px solid var(--hv-line); border-left-width: 5px; border-radius: 10px; padding: 1.25rem 1.4rem; margin-bottom: 1.2rem; }
.result-serious .verdict { border-left-color: var(--hv-bad); background: #fdf4f3; }
.result-findings .verdict { border-left-color: var(--hv-warn); background: #fdf8ee; }
.result-clean .verdict { border-left-color: var(--hv-ok); background: #f1f9f4; }
.verdict h1 { font-size: 1.6rem; }
.verdict .meta { margin: .4rem 0 0; }
.verdict .company { margin-bottom: 0; }
.decision { box-shadow: 0 1px 2px rgba(22,32,43,.03); }
.area { display: inline-block; padding: .05rem .5rem; margin-bottom: .2rem; background: #eef1f4; border-radius: 99px; color: #44515e; }

/* Områdesväljaren i menyn */
.topbar nav { flex-wrap: wrap; gap: .4rem 1rem; }
.topbar nav { align-items: center; }
.area-select { flex: 1; max-width: 330px; margin: 0; align-self: center; }
.area-select select { display: block; margin: 0; padding: .4rem 2.2rem .4rem .7rem; height: auto; font-size: .92rem; font-weight: 600; background-color: #fdf1ec; border-color: #eccabd; color: #7a2d15; }
@media (max-width: 760px) { .area-select { order: 3; flex-basis: 100%; max-width: none; } }

/* Pågående kontroll */
.loading { margin: 1rem 0 0; padding: .7rem 1rem; background: #fdf1ec; border: 1px solid #eccabd; border-radius: var(--pico-border-radius); color: #7a2d15; font-size: .92rem; }
.search button { min-width: 9.5rem; }

/* Bedömning per brist */
.area.level-allvarlig { background: #f9e1de; color: #8f2424; }
.area.level-brist { background: #fbefd9; color: #7a4f00; }
.area.level-mindre { background: #eef1f4; color: #44515e; }
.aged { display: inline-block; margin-left: .3rem; padding: 0 .45rem; border-radius: 99px; background: #eef1f4; color: #5a6775; font-size: .75rem; font-weight: 500; vertical-align: middle; }

/* Regler för området */
.rules { margin: 0 0 1.4rem; }
.rules h2 { font-size: 1rem; margin: 0 0 .55rem; }
.rules dl { margin: 0; display: grid; gap: .35rem; }
.rules dl > div { display: grid; grid-template-columns: 7.5rem 1fr; gap: .8rem; }
.rules dt { font-size: .85rem; font-weight: 600; color: #7a2d15; }
.rules dd { margin: 0; font-size: .92rem; color: #3d4a57; }
@media (max-width: 560px) { .rules dl > div { grid-template-columns: 1fr; gap: 0; } }

/* Var handlingen kan begäras ut */
.request { margin: .8rem 0 0; padding-top: .6rem; border-top: 1px solid var(--hv-line); font-size: .85rem; color: var(--pico-muted-color); }

/* Nyheter */
.news .card h2 { font-size: 1.05rem; margin-bottom: .6rem; }
.news .card p { font-size: .95rem; margin-bottom: .6rem; }
.news .card p:last-child { margin-bottom: 0; }
.news ul { margin: 0; padding-left: 1.1rem; }
.news li { font-size: .93rem; margin-bottom: .25rem; list-style: disc; }
.version h3 { font-size: 1rem; margin-bottom: .5rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.version .tag { padding: .05rem .5rem; border-radius: 99px; background: #fdf1ec; color: #7a2d15; font-size: .8rem; }
.version .date { margin-left: auto; color: var(--pico-muted-color); font-size: .82rem; font-weight: 400; }
