/* Byggis formspråk: tumstocken. Kalkvitt papper, grafit och en enda signalfärg, måttbandsgul. */
@font-face { font-family: 'Familjen Grotesk'; font-weight: 400; font-display: swap; src: url('/fonter/familjen-grotesk-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Familjen Grotesk'; font-weight: 500; font-display: swap; src: url('/fonter/familjen-grotesk-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Familjen Grotesk'; font-weight: 600; font-display: swap; src: url('/fonter/familjen-grotesk-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Familjen Grotesk'; font-weight: 700; font-display: swap; src: url('/fonter/familjen-grotesk-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 500; font-display: swap; src: url('/fonter/ibm-plex-mono-latin-500-normal.woff2') format('woff2'); }

:root {
  color-scheme: light;
  --papper: #f6f3ec; --kort: #fffdf8; --bladk: #1f2326; --dampad: #63686a; --linje: #dfdace; --band: #f2b705; --band-text: #1f2326;
  --scen: #e6e2d8; --plan: #fffdf8; --lyft: #fbf0c9; --fel: #b3321d; --ok: #2b7a4b; --skugga: 0 1px 2px rgba(31,35,38,.06), 0 8px 28px rgba(31,35,38,.07);
  --r: 14px; --sans: 'Familjen Grotesk', system-ui, sans-serif; --mono: 'IBM Plex Mono', ui-monospace, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --papper: #15171a; --kort: #1f2226; --bladk: #f1eee6; --dampad: #a4a8a8; --linje: #33373c; --scen: #26292e; --plan: #1f2226; --lyft: #3a3210; --fel: #ee7a64; --ok: #72c893; --skugga: 0 1px 2px rgba(0,0,0,.3), 0 8px 28px rgba(0,0,0,.28);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--papper); color: var(--bladk); font: 400 17px/1.45 var(--sans); min-height: 100dvh; overflow-x: hidden; }
h1, h2, h3 { line-height: 1.12; margin: 0; letter-spacing: -.012em; font-weight: 700; }
h1 { font-size: clamp(30px, 6vw, 44px); }
h2 { font-size: 23px; }
h3 { font-size: 18px; }
p { margin: 0; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
.dampad { color: var(--dampad); }
.mono, .matt { font-family: var(--mono); font-weight: 500; letter-spacing: -.02em; }
.fel { color: var(--fel); }
[hidden] { display: none !important; }

/* Tumstocken */
.band { height: 9px; background: var(--band) repeating-linear-gradient(90deg, #1f2326 0 1px, transparent 1px 10px); background-size: 10px 40%; background-repeat: repeat-x; background-position: 0 0; position: relative; }
.band::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, #1f2326 0 1.5px, transparent 1.5px 50px); background-size: 50px 75%; background-repeat: repeat-x; }

.prototyp { background: #1f2326; color: #f6f3ec; font-size: 13px; text-align: center; padding: 4px 12px; }
header.topp { background: var(--kort); border-bottom: 1px solid var(--linje); position: sticky; top: 0; z-index: 20; }
header.topp .inner { max-width: 1240px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; min-height: 56px; }
.ordmarke { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 20px; text-decoration: none; letter-spacing: -.02em; }
.ordmarke svg { width: 28px; height: 28px; flex: none; }
.topp .hoger { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.sparstatus { font-size: 13px; color: var(--dampad); white-space: nowrap; }
main { max-width: 1240px; margin: 0 auto; padding: 20px 16px 110px; }
.tillbaka { display: inline-flex; gap: 6px; align-items: center; color: var(--dampad); font-size: 15px; text-decoration: none; background: none; border: 0; padding: 4px 0; cursor: pointer; }

.knapp { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; min-height: 46px; border-radius: 11px; border: 1px solid transparent; background: var(--bladk); color: var(--papper); font-weight: 600; cursor: pointer; text-decoration: none; }
.knapp.gul { background: var(--band); color: var(--band-text); }
.knapp.linjerad { background: transparent; color: var(--bladk); border-color: var(--linje); }
.knapp.liten { min-height: 36px; padding: 6px 12px; font-size: 15px; border-radius: 9px; }
.knapp.fara { background: transparent; color: var(--fel); border-color: currentColor; }
.knapp:disabled { opacity: .5; cursor: default; }
.knapp:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 2.5px solid var(--band); outline-offset: 2px; }
.lank { background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; color: inherit; }
.rad { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: grid; gap: 14px; }
.kort { background: var(--kort); border: 1px solid var(--linje); border-radius: var(--r); padding: 16px; }
.lyft { background: var(--lyft); border-radius: var(--r); padding: 14px 16px; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 13px; background: var(--papper); border: 1px solid var(--linje); white-space: nowrap; }
.pill.gul { background: var(--band); border-color: var(--band); color: var(--band-text); font-weight: 600; }
.pill.ok { color: var(--ok); border-color: currentColor; background: transparent; }
label.falt { display: grid; gap: 4px; font-size: 14px; color: var(--dampad); }
input[type=text], input[type=number], input[type=password], textarea, select { width: 100%; padding: 11px 12px; background: var(--kort); border: 1px solid var(--linje); border-radius: 10px; color: var(--bladk); font-size: 17px; min-height: 46px; }
textarea { min-height: 90px; resize: vertical; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 7px 12px; border-radius: 99px; background: var(--kort); border: 1px solid var(--linje); cursor: pointer; font-size: 15px; min-height: 36px; }
.chip[aria-pressed="true"] { background: var(--bladk); color: var(--papper); border-color: var(--bladk); }

/* Projektlistan */
.hero { display: grid; gap: 8px; margin-bottom: 20px; }
.projektrutnat { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.projektkort { display: grid; gap: 10px; text-decoration: none; background: var(--kort); border: 1px solid var(--linje); border-radius: var(--r); padding: 16px; transition: transform .12s, box-shadow .12s; }
.projektkort:hover { transform: translateY(-1px); box-shadow: var(--skugga); }
.miniplaner { display: flex; gap: 6px; align-items: end; height: 58px; overflow: hidden; }
.miniplaner svg { height: 100%; width: auto; max-width: 96px; flex: 0 1 auto; }
.tomt { text-align: center; padding: 38px 18px; display: grid; gap: 12px; justify-items: center; }

/* Rum i projekt */
.rumrutnat { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
@media (max-width: 460px) { .rumrutnat { grid-template-columns: repeat(2, 1fr); } }
.rumkort { display: grid; grid-template-rows: 112px auto; background: var(--kort); border: 1px solid var(--linje); border-radius: var(--r); text-decoration: none; overflow: hidden; }
.rumkort .bild { background: var(--papper); display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 4px; }
.rumkort .bild svg { max-width: 100%; max-height: 100%; height: 100%; }
.rumkort .bild img { width: 100%; height: 100%; object-fit: cover; }
.rumkort .text { padding: 9px 11px 11px; display: grid; gap: 1px; }
.rumkort b { font-size: 15.5px; line-height: 1.2; overflow-wrap: anywhere; }
.rumkort .matt { font-size: 13px; color: var(--dampad); }
.nytt-rum { border-style: dashed; display: flex; align-items: center; justify-content: center; min-height: 170px; color: var(--dampad); cursor: pointer; width: 100%; }
.snabbval { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 22px; }
.snabbval button, .snabbval a { display: grid; justify-items: center; gap: 3px; padding: 12px 6px; background: var(--kort); border: 1px solid var(--linje); border-radius: 12px; cursor: pointer; text-decoration: none; font-size: 14.5px; font-weight: 500; position: relative; line-height: 1.2; text-align: center; }
.snabbval svg { width: 24px; height: 24px; }
.markor { position: absolute; top: 6px; right: 6px; background: var(--band); color: var(--band-text); min-width: 21px; height: 21px; border-radius: 99px; font-size: 13px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }

/* Rumsvy */
.rumlayout { display: grid; gap: 14px; }
@media (min-width: 900px) { .rumlayout { grid-template-columns: minmax(0, 1.5fr) minmax(360px, 1fr); align-items: start; } .scenplats { position: sticky; top: 74px; } }
.scen { position: relative; background: var(--scen); border-radius: var(--r); overflow: hidden; height: min(46vh, 430px); min-height: 280px; touch-action: none; }
@media (min-width: 900px) { .scen { height: calc(100dvh - 180px); max-height: 720px; } }
.scen canvas { display: block; width: 100%; height: 100%; outline: none; }
.scenknappar { position: absolute; left: 10px; top: 10px; display: flex; gap: 4px; background: color-mix(in srgb, var(--kort) 88%, transparent); border-radius: 10px; padding: 3px; backdrop-filter: blur(6px); }
.scenknappar button { border: 0; background: none; padding: 6px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500; }
.scenknappar button[aria-pressed="true"] { background: var(--bladk); color: var(--papper); }
.scenhjalp { position: absolute; right: 10px; bottom: 8px; font-size: 12.5px; color: #55595a; pointer-events: none; background: rgba(255,255,255,.55); padding: 1px 7px; border-radius: 6px; }
.ingen3d { display: grid; place-items: center; height: 100%; padding: 20px; text-align: center; }
.rumtitel { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.flikrad { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--linje); scrollbar-width: none; margin-bottom: 14px; }
.flikrad::-webkit-scrollbar { display: none; }
.flikrad button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 9px 11px; cursor: pointer; font-weight: 500; white-space: nowrap; color: var(--dampad); }
.flikrad button[aria-selected="true"] { color: var(--bladk); border-bottom-color: var(--band); font-weight: 600; }

.yt-rad { display: grid; grid-template-columns: 48px 1fr auto; gap: 11px; align-items: center; width: 100%; text-align: left; background: var(--kort); border: 1px solid var(--linje); border-radius: 12px; padding: 8px 10px; cursor: pointer; }
.yt-rad small { display: block; color: var(--dampad); font-size: 13px; }
.prov { width: 48px; height: 48px; border-radius: 9px; border: 1px solid rgba(0,0,0,.14); display: block; flex: none; }
.provgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.provval { display: grid; grid-template-columns: 42px 1fr; gap: 8px; align-items: center; padding: 7px; text-align: left; background: var(--kort); border: 1px solid var(--linje); border-radius: 11px; cursor: pointer; font-size: 14.5px; line-height: 1.15; }
.provval .prov { width: 42px; height: 42px; }
.provval[aria-pressed="true"] { border: 2px solid var(--bladk); padding: 6px; font-weight: 600; }

.lista { display: grid; gap: 0; }
.listrad { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--linje); }
.listrad:last-child { border-bottom: 0; }
.ta-bort { background: none; border: 0; cursor: pointer; color: var(--dampad); width: 34px; height: 34px; border-radius: 8px; font-size: 20px; line-height: 1; }
.ta-bort:hover { background: var(--papper); color: var(--fel); }
select.litet { padding: 4px 6px; min-height: 34px; font-size: 14px; width: auto; max-width: 128px; }

.plan { display: block; width: 100%; height: auto; max-height: 380px; }
.plan.redigera { touch-action: none; user-select: none; }
.plansak { cursor: grab; }
.plansak.vald rect, .plansak.vald ellipse { stroke: var(--band) !important; }
.galleri { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.galleri figure { margin: 0; position: relative; border-radius: 10px; overflow: hidden; background: var(--scen); }
.galleri img { width: 100%; aspect-ratio: 3/2; object-fit: cover; display: block; cursor: zoom-in; }
.galleri figcaption { position: absolute; left: 6px; bottom: 6px; font-size: 12px; background: rgba(0,0,0,.65); color: #fff; padding: 1px 7px; border-radius: 99px; }
.galleri .ta-bort { position: absolute; right: 4px; top: 4px; background: rgba(0,0,0,.6); color: #fff; }

/* Ark och dialoger */
dialog { color: inherit; border: 0; padding: 0; background: var(--kort); }
dialog::backdrop { background: rgba(20,22,24,.55); }
dialog.ark { width: min(620px, 100%); max-height: 92dvh; border-radius: 18px 18px 0 0; margin: auto auto 0; }
@media (min-width: 700px) { dialog.ark { border-radius: 18px; margin: auto; } }
.arkhuvud { position: sticky; top: 0; background: var(--kort); padding: 14px 16px 10px; display: flex; justify-content: space-between; align-items: center; gap: 8px; z-index: 2; border-bottom: 1px solid var(--linje); }
.arkkropp { padding: 14px 16px 22px; display: grid; gap: 14px; }
dialog.las { width: min(400px, calc(100% - 32px)); border-radius: 16px; margin: auto; }
dialog.las form { padding: 20px; display: grid; gap: 12px; }
dialog.bildvisare { background: transparent; max-width: 96vw; max-height: 94dvh; margin: auto; }
dialog.bildvisare img { max-width: 96vw; max-height: 92dvh; display: block; border-radius: 10px; }

/* Mikrofonen */
.fab { position: fixed; right: 16px; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 30; display: inline-flex; align-items: center; gap: 9px; padding: 0 22px 0 18px; height: 62px; border-radius: 99px; border: 0; background: var(--band); color: var(--band-text); font-weight: 700; font-size: 18px; cursor: pointer; box-shadow: 0 8px 26px rgba(31,35,38,.3); }
.fab svg { width: 26px; height: 26px; }
@media (max-width: 899px) { .rumsida .fab { width: 60px; height: 60px; padding: 0; justify-content: center; } .rumsida .fab span { display: none; } }

.diktera { position: fixed; inset: 0; z-index: 40; background: var(--papper); display: grid; grid-template-rows: auto minmax(180px, 38dvh) minmax(0, 1fr) auto; }
@media (min-width: 900px) { .diktera { grid-template-columns: 1.3fr 1fr; grid-template-rows: auto minmax(0, 1fr) auto; } .diktera .dikthuvud { grid-column: 1 / -1; } .diktera .scen { grid-row: 2 / 4; height: auto; border-radius: 0; max-height: none; } }
.dikthuvud { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; background: var(--kort); border-bottom: 1px solid var(--linje); }
.diktera .scen { height: 100%; min-height: 0; border-radius: 0; max-height: none; }
.diktmitt { overflow: auto; padding: 14px 16px; display: grid; gap: 14px; align-content: start; }
.utskrift { font-size: 21px; line-height: 1.35; min-height: 62px; }
.utskrift .pre { color: var(--dampad); }
.utskrift:empty::before { content: 'Börja prata. Säg rummets namn och mått, till exempel: "WC, en komma åtta gånger en meter, klinker på golvet".'; color: var(--dampad); font-size: 17px; }
.uppfattat { display: grid; gap: 5px; }
.uppfattat div { display: flex; gap: 8px; align-items: center; font-size: 15px; animation: in .22s ease-out; }
.uppfattat .prov { width: 22px; height: 22px; border-radius: 5px; }
.bock { width: 22px; height: 22px; display: grid; place-items: center; color: var(--ok); font-weight: 700; }
@keyframes in { from { opacity: 0; transform: translateY(5px); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.diktfot { padding: 12px 16px max(14px, env(safe-area-inset-bottom)); background: var(--kort); border-top: 1px solid var(--linje); display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.mikknapp { width: 72px; height: 72px; flex: none; border-radius: 50%; border: 0; background: var(--band); color: var(--band-text); display: grid; place-items: center; cursor: pointer; position: relative; }
.mikknapp svg { width: 32px; height: 32px; position: relative; }
.mikknapp.pa { background: var(--fel); color: #fff; }
.mikknapp .niva { position: absolute; inset: 0; border-radius: 50%; background: var(--fel); opacity: .28; transform: scale(calc(1 + var(--n, 0) * .55)); transition: transform .09s; }
.motor { font-size: 13px; color: var(--dampad); }

/* Kundsidan */
.kundhero { background: #1f2326; color: #f6f3ec; }
.kundhero .inner { max-width: 1240px; margin: 0 auto; padding: 24px 16px 22px; display: grid; gap: 6px; }
.kundhero h1 { font-size: clamp(32px, 7vw, 56px); }
.kundhero .firma { font-weight: 600; opacity: .84; }
.kundrumflik { display: flex; gap: 6px; overflow-x: auto; padding: 12px 16px; max-width: 1240px; margin: 0 auto; scrollbar-width: none; }
.kundrumflik button { flex: none; padding: 8px 14px; background: var(--kort); border: 1px solid var(--linje); border-radius: 99px; cursor: pointer; font-weight: 500; }
.kundrumflik button[aria-selected="true"] { background: var(--band); border-color: var(--band); color: var(--band-text); font-weight: 600; }
.nyckeltal { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--linje); border: 1px solid var(--linje); border-radius: 12px; overflow: hidden; }
.nyckeltal div { background: var(--kort); padding: 9px 11px; }
.nyckeltal small { display: block; color: var(--dampad); font-size: 13px; }
.nyckeltal b { font: 500 18px var(--mono); letter-spacing: -.03em; white-space: nowrap; }
.arbete h3 { font-size: 16px; margin: 10px 0 4px; }
.arbete ul { margin: 0; padding-left: 18px; }

/* Tjänstägaren */
.kpirad { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.kpi { background: var(--kort); border: 1px solid var(--linje); border-radius: var(--r); padding: 13px 15px; }
.kpi .fraga { font-size: 14px; color: var(--dampad); }
.kpi .v { font: 500 34px/1.15 var(--mono); letter-spacing: -.04em; margin-top: 2px; }
.kpi .n { font-size: 13.5px; color: var(--dampad); }
.tabell { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th { text-align: left; font-weight: 600; color: var(--dampad); font-size: 13.5px; }
th, td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--linje); white-space: nowrap; }
td.bryt { white-space: normal; min-width: 160px; }
.behovkort { display: grid; grid-template-columns: 54px 1fr; gap: 12px; padding: 13px 14px; background: var(--kort); border: 1px solid var(--linje); border-radius: 12px; }
.rost { display: grid; justify-items: center; align-content: center; gap: 0; background: var(--papper); border: 1px solid var(--linje); border-radius: 10px; cursor: pointer; min-height: 56px; font-size: 13px; }
.rost b { font: 500 19px var(--mono); }
footer.fot { text-align: center; color: var(--dampad); padding: 24px 16px 92px; font-size: 14px; }
.laddar { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--linje), var(--band), var(--linje)); background-size: 200% 100%; animation: svep 1.2s linear infinite; }
@keyframes svep { to { background-position: -200% 0; } }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: var(--bladk); color: var(--papper); padding: 9px 15px; border-radius: 10px; z-index: 60; max-width: calc(100% - 32px); text-align: center; font-size: 15.5px; animation: in .2s; }
.varning { border-left: 4px solid var(--band); padding: 8px 12px; background: var(--lyft); border-radius: 0 9px 9px 0; font-size: 15px; }
@media print { .prototyp, .fab { display: none; } }
