/* Briso utføring (mobil). Store trykkflater, stor skrift (≥16 px hindrer zoom i iOS), god kontrast ute i sol. */
:root {
  --navy: #0E2948; --accent: #1B6AB0; --accent-dark: #14518A; --bg: #F1F4F8; --card: #fff; --line: #D5DDE7; --text: #14202E; --muted: #5B6775;
  --green: #1E7A45; --green-bg: #DDF1E4; --red: #B83227; --red-bg: #FBE3E0; --yellow: #7A5B00; --yellow-bg: #FFF0B8; --gray-bg: #E7EBF1;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; font-size: 17px; line-height: 1.4; color: var(--text);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0B1623; --card: #14233A; --line: #28405E; --text: #E8EEF6; --muted: #9FB0C5; --green-bg: #17402A; --green: #7FD6A0; --red-bg: #4A1E1A; --red: #FF9A90; --yellow-bg: #4B3D0A; --yellow: #F5D66B; --gray-bg: #20324A; --accent: #5AA3E6; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); }
body { min-height: 100vh; min-height: 100dvh; overscroll-behavior-y: contain; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
h1 { font-size: 1.35rem; margin: 0; } h2 { font-size: 1.1rem; margin: 0 0 .5rem; } h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; padding: 3rem 1rem; }
.err { color: var(--red); font-weight: 600; margin: .6rem 0 0; min-height: 1.2em; }

/* knapper */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 52px; padding: .6rem 1.1rem; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); font-weight: 650; text-decoration: none; color: var(--text); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-ok { background: var(--green); border-color: var(--green); color: #fff; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; }
.btn-sm { min-height: 40px; padding: .35rem .8rem; font-size: .92rem; border-radius: 10px; }
.btn-ghost { background: transparent; border-color: transparent; color: inherit; }

/* innlogging */
.login { max-width: 420px; margin: 0 auto; padding: calc(2rem + var(--safe-t)) 1.2rem 2rem; }
.login .brand { background: var(--navy); border-radius: 16px; padding: 1.4rem; text-align: center; margin-bottom: 1.4rem; }
.login .brand img { max-width: 220px; width: 70%; } .login .brand p { color: #CBDCEF; margin: .6rem 0 0; letter-spacing: .06em; text-transform: uppercase; font-size: .8rem; }
label.field { display: block; margin-bottom: 1rem; } .lbl { display: block; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: .25rem; }
input[type=text], input[type=password], input[type=date], select, textarea { width: 100%; min-height: 52px; padding: .6rem .8rem; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); }
textarea { min-height: 96px; resize: vertical; } input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); border-color: var(--accent); }
.check { display: flex; gap: .6rem; align-items: center; margin: -.3rem 0 1rem; font-size: .95rem; } .check input { width: 22px; height: 22px; }

/* topp */
.top { position: sticky; top: 0; z-index: 20; background: var(--navy); color: #fff; padding: calc(.6rem + var(--safe-t)) .9rem .6rem; display: flex; align-items: center; gap: .6rem; min-height: 60px; }
.top img { height: 28px; } .top .grow { flex: 1; min-width: 0; } .top .title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .top .sub { font-size: .8rem; color: #CBDCEF; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .btn { min-height: 44px; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25); color: #fff; }
.page { padding: .9rem .9rem calc(6.5rem + var(--safe-b)); max-width: 720px; margin: 0 auto; }
.banner { border-radius: 12px; padding: .7rem .9rem; margin-bottom: .8rem; font-size: .95rem; } .banner.warn { background: var(--yellow-bg); color: var(--yellow); } .banner.bad { background: var(--red-bg); color: var(--red); } .banner.good { background: var(--green-bg); color: var(--green); } .banner.info { background: var(--gray-bg); }

/* kort og merker */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: .9rem 1rem; margin-bottom: .8rem; }
.chip { display: inline-block; border-radius: 999px; padding: .1rem .65rem; font-size: .8rem; font-weight: 700; background: var(--gray-bg); white-space: nowrap; }
.chip.green { background: var(--green-bg); color: var(--green); } .chip.red { background: var(--red-bg); color: var(--red); } .chip.yellow { background: var(--yellow-bg); color: var(--yellow); }
.job { display: block; width: 100%; text-align: left; } .job .nr { font-weight: 800; } .job .adr { color: var(--muted); } .job .row { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .5rem; }
.kv { display: grid; grid-template-columns: 7.5rem 1fr; gap: .25rem .6rem; margin: 0; } .kv dt { color: var(--muted); font-size: .9rem; } .kv dd { margin: 0; font-weight: 600; word-break: break-word; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .7rem; } .actions .btn { flex: 1 1 8rem; }
.rad { padding: .55rem 0; border-top: 1px solid var(--line); } .rad:first-of-type { border-top: 0; } .rad b { display: block; } .rad span { color: var(--muted); font-size: .92rem; }

/* sjekkliste */
details.grp { background: var(--card); border: 1px solid var(--line); border-radius: 14px; margin-bottom: .8rem; overflow: hidden; }
details.grp > summary { list-style: none; padding: .85rem 1rem; display: flex; align-items: center; gap: .6rem; font-weight: 700; cursor: pointer; min-height: 56px; } details.grp > summary::-webkit-details-marker { display: none; }
details.grp > summary .grow { flex: 1; } details.grp[open] > summary { border-bottom: 1px solid var(--line); }
.pt { padding: .8rem 1rem; border-top: 1px solid var(--line); } .pt:first-of-type { border-top: 0; } .pt p { margin: 0 0 .55rem; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; } .seg button { min-height: 52px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); font-weight: 700; }
.seg button.on-ok { background: var(--green); border-color: var(--green); color: #fff; } .seg button.on-na { background: var(--gray-bg); border-color: var(--muted); }
.pt .kom { margin-top: .5rem; } .linkbtn { background: none; border: 0; color: var(--accent); padding: .3rem 0; font-weight: 600; }

/* densitet */
.dens .head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .4rem; } .dens .calc { color: var(--muted); font-size: .9rem; margin: 0 0 .5rem; }
.dens .grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; } .dens .grid .wide { grid-column: 1 / -1; }
.malt { font-size: 1.5rem; font-weight: 700; text-align: center; }

/* fullfør */
.todo { list-style: none; margin: 0 0 1rem; padding: 0; } .todo li { display: flex; gap: .6rem; padding: .5rem 0; border-top: 1px solid var(--line); } .todo li:first-child { border-top: 0; } .todo .ic { font-weight: 800; width: 1.5rem; text-align: center; flex: none; } .todo .ok .ic { color: var(--green); } .todo .no .ic { color: var(--red); }
.progress { height: 10px; border-radius: 999px; background: var(--gray-bg); overflow: hidden; } .progress i { display: block; height: 100%; background: var(--green); transition: width .25s; }

/* bunnmeny */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--navy); padding-bottom: var(--safe-b); }
.tabs button { background: none; border: 0; color: #CBDCEF; min-height: 62px; padding: .35rem .1rem; font-size: .78rem; font-weight: 650; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; }
.tabs button b { font-size: 1.15rem; } .tabs button small { font-size: .72rem; opacity: .85; } .tabs button.on { background: rgba(255,255,255,.14); color: #fff; box-shadow: inset 0 3px 0 var(--accent); }

/* synkstatus */
.sync { font-size: .78rem; font-weight: 700; border-radius: 999px; padding: .15rem .6rem; background: rgba(255,255,255,.16); white-space: nowrap; } .sync.ok { background: #1E7A45; } .sync.work { background: #7A5B00; } .sync.bad { background: #B83227; }
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(5rem + var(--safe-b)); z-index: 50; background: #14202E; color: #fff; padding: .7rem 1.1rem; border-radius: 12px; max-width: 92vw; box-shadow: 0 4px 18px rgba(0,0,0,.35); font-weight: 600; } #toast.bad { background: var(--red); }

/* materiale (Knauf / Isocell) – skal ikke kunne forveksles */
.mat { display: flex; flex-direction: column; gap: .05rem; border-radius: 14px; padding: .7rem 1rem; margin-bottom: .8rem; color: #fff; background: var(--navy); }
.mat .mat-etikett { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; opacity: .85; } .mat .mat-navn { font-size: 1.5rem; font-weight: 800; line-height: 1.15; } .mat .mat-full { font-size: .92rem; opacity: .92; }
.mat.stor .mat-navn { font-size: 2rem; }
.mat-knauf { background: #B85300; } .mat-isocell { background: #2B7A3D; }
.chip.mat-chip { color: #fff; font-weight: 800; }

/* bilder */
.kat { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .7rem; } .kat button { flex: 1 1 0; min-height: 46px; padding: .3rem .1rem; font-size: .92rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); font-weight: 650; } .kat button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.bgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; } .bilde { position: relative; display: flex; flex-direction: column; gap: .2rem; padding: 0; border: 0; background: none; text-align: left; font-size: .72rem; color: var(--muted); }
.bilde img, .bilde .ph { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--gray-bg); display: flex; align-items: center; justify-content: center; font-size: 1.6rem; } .bilde.ko img { opacity: .7; } .bilde.feil span { color: var(--red); font-weight: 700; }
.lysboks { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.92); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; padding: calc(1rem + var(--safe-t)) .5rem calc(1rem + var(--safe-b)); } .lysboks img { max-width: 100%; max-height: 78vh; object-fit: contain; border-radius: 6px; } .lysboks p { color: #cbd5e1; font-size: .8rem; margin: 0; } .lysboks .btn { align-self: flex-end; }
