/* Love Attax — zelfde beeldtaal als Love Attax Live: rustig papier, groene accentkleur, statusstroken.
   Kleur volgt de deur: Ollround = groen, Privé = blauw. Oranje = wacht op jou, rood = te laat/vastgelopen.
   Lettertypen zelf gehost (OFL, zie fonts/) — geen verzoeken naar Google. */

@font-face { font-family: "Instrument Sans"; font-style: normal; font-display: swap; font-weight: 400 700; font-stretch: 75% 100%;
  src: url(/fonts/instrument-sans-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-display: swap; font-weight: 400 700; font-stretch: 75% 100%;
  src: url(/fonts/instrument-sans-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-display: swap; font-weight: 400 600;
  src: url(/fonts/jetbrains-mono-latin-wght-normal.woff2) format("woff2"); }

:root {
  --bg: #f3f4f1; --vlak: #ffffff; --inkt: #1d2422; --stil: #5f6b67; --lijn: #dfe3de;
  --groen: #2f6f5e; --groen-bg: #e3f0eb;
  --blauw: #4a5d8a; --blauw-bg: #e6eaf4;
  --wacht: #b86a12; --wacht-bg: #fbeedc;
  --fout: #b23a32; --fout-bg: #f8e3e1;
  --klaar: #6f7a76; --klaar-bg: #eceeec;
  --deur: var(--groen); --deur-bg: var(--groen-bg); --op-deur: #ffffff;
  --display: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --strook: 64px; --dock: 72px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #121615; --vlak: #1a201e; --inkt: #e6ebe8; --stil: #9aa6a1; --lijn: #2a3330;
  --groen: #6cc2a6; --groen-bg: #1d3029; --blauw: #93a8d8; --blauw-bg: #1f2638;
  --wacht: #e5a35a; --wacht-bg: #33281a; --fout: #ef8a80; --fout-bg: #3a2220; --klaar: #8d9894; --klaar-bg: #232a28;
  --op-deur: #0f1513; color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #121615; --vlak: #1a201e; --inkt: #e6ebe8; --stil: #9aa6a1; --lijn: #2a3330;
  --groen: #6cc2a6; --groen-bg: #1d3029; --blauw: #93a8d8; --blauw-bg: #1f2638;
  --wacht: #e5a35a; --wacht-bg: #33281a; --fout: #ef8a80; --fout-bg: #3a2220; --klaar: #8d9894; --klaar-bg: #232a28;
  --op-deur: #0f1513; color-scheme: dark }
body[data-deur="prive"] { --deur: var(--blauw); --deur-bg: var(--blauw-bg); }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--inkt); font-family: var(--display);
  font-size: 15.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--deur); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.shell { max-width: 760px; margin: 0 auto; min-height: 100dvh; position: relative; }
.scherm {
  padding: calc(env(safe-area-inset-top, 0px) + 20px) 16px calc(var(--strook) + var(--dock) + env(safe-area-inset-bottom, 0px) + 12px);
  display: grid; gap: 26px; align-content: start;
}
body.typt .scherm { padding-bottom: 16px; }

/* koppen */
.kop { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.kop-acties { display: flex; gap: 6px; align-items: center; }
h1 { margin: 0; font-size: 1.75rem; line-height: 1.15; font-weight: 700; letter-spacing: -0.015em; text-wrap: balance; }
.sub { margin: 6px 0 0; color: var(--stil); display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; font-size: .9rem; }
.live { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: .76rem; letter-spacing: .04em; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--klaar); }
.live.aan .dot { background: var(--groen); animation: puls 2s infinite; }
@keyframes puls { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--groen) 60%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
h2 { margin: 0 0 10px; font-size: .95rem; font-weight: 650; color: var(--stil); }
.toelichting { margin: -4px 0 10px; color: var(--stil); font-size: .88rem; }
.laden, .leeg-melding { color: var(--stil); margin: 0; }
.leeg-melding.kader { padding: 16px; border: 1px dashed var(--lijn); border-radius: 8px; }

.ronde-knop { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--lijn); background: var(--vlak); display: grid; place-items: center; flex: none; color: var(--stil); }
.ronde-knop svg { width: 18px; height: 18px; }
.pil { border: 1px solid var(--lijn); background: var(--vlak); border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: .88rem; }
.pil.vol { background: var(--deur); border-color: var(--deur); color: var(--op-deur); }
.pil[aria-pressed="true"] { background: var(--inkt); color: var(--bg); border-color: var(--inkt); }

/* telling-chips (zoals Love Attax Live) */
.tally { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { font-size: .8rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.s-bezig { color: var(--groen); background: var(--groen-bg); }
.s-wacht { color: var(--wacht); background: var(--wacht-bg); }
.s-klaar { color: var(--klaar); background: var(--klaar-bg); }
.s-gepland { color: var(--blauw); background: var(--blauw-bg); }
.s-fout { color: var(--fout); background: var(--fout-bg); }

/* briefing */
.briefing { display: grid; gap: 10px; justify-items: start; background: var(--vlak); border: 1px solid var(--lijn); border-radius: 10px; padding: 16px; }
.briefing-tekst { margin: 0; font-size: 1.12rem; line-height: 1.45; text-wrap: pretty; }
.briefing-tekst b { font-weight: 650; }
.briefing-tekst .wacht { color: var(--wacht); }
.briefing-tekst .laat { color: var(--fout); }

/* werkstromen: zelfde kaarten als Love Attax Live */
.werkstromen { display: grid; gap: 10px; }
.stroom { background: var(--vlak); border: 1px solid var(--lijn); border-left: 4px solid var(--klaar); border-radius: 8px; padding: 14px 16px; display: grid; gap: 8px; min-width: 0; }
.stroom.bezig { border-left-color: var(--groen); }
.stroom.wacht { border-left-color: var(--wacht); }
.stroom.gepland { border-left-color: var(--blauw); }
.stroom.fout { border-left-color: var(--fout); }
.stroom-kop { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; justify-content: space-between; }
.stroom-titel { font-weight: 600; font-size: 1rem; }
.deurlabel { display: block; font-family: var(--mono); font-size: .7rem; color: var(--stil); letter-spacing: .03em; margin-top: 2px; }
.stroom p { margin: 0; overflow-wrap: anywhere; }
.stroom .volgende { color: var(--stil); font-size: .9rem; }
.stroom .volgende b { color: var(--inkt); font-weight: 600; }
.voortgang { height: 6px; background: var(--lijn); border-radius: 3px; overflow: hidden; }
.voortgang span { display: block; height: 100%; background: var(--groen); border-radius: 3px; transition: width .4s ease; }
.meta { font-family: var(--mono); font-size: .72rem; color: var(--stil); }
.meer { border: 0; background: none; color: var(--deur); font-weight: 600; padding: 6px 0; justify-self: start; }

/* logboek */
.log { background: var(--vlak); border: 1px solid var(--lijn); border-radius: 8px; padding: 4px 16px; }
.log ol { list-style: none; margin: 0; padding: 0; }
.log li { display: grid; grid-template-columns: 4.2rem 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--lijn); min-width: 0; }
.log li:last-child { border-bottom: 0; }
.log time { font-family: var(--mono); font-size: .76rem; color: var(--stil); padding-top: 2px; }
.log .txt { overflow-wrap: anywhere; }
.log small { display: block; font-size: .75rem; color: var(--stil); }

/* to do */
.todo { list-style: none; margin: 0; padding: 4px 16px; background: var(--vlak); border: 1px solid var(--lijn); border-radius: 8px; }
.todo li { display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--lijn); }
.todo li:last-child { border-bottom: 0; }
.todo .vak { width: 16px; height: 16px; border: 2px solid var(--stil); border-radius: 4px; margin-top: 3px; }
.todo .lijst { display: block; color: var(--stil); font-size: .82rem; }
.todo .wanneer { font-family: var(--mono); font-size: .74rem; color: var(--stil); white-space: nowrap; padding-top: 2px; }
.todo .te-laat .wanneer { color: var(--fout); }
.todo .te-laat .vak { border-color: var(--fout); }
.todo li.laden, .todo li.leeg-melding { display: block; }

/* gesprek */
#scherm-gesprek { gap: 0; grid-template-rows: auto 1fr auto; min-height: 100dvh; padding-bottom: calc(var(--strook) + var(--dock) + env(safe-area-inset-bottom, 0px)); }
body.typt #scherm-gesprek { padding-bottom: 0; }
.gesprek-kop { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0 12px; position: sticky; top: 0; background: var(--bg); z-index: 2; }
.deurkeuze { display: inline-flex; background: var(--vlak); border: 1px solid var(--lijn); border-radius: 999px; padding: 3px; }
.deurkeuze button { border: 0; background: none; border-radius: 999px; padding: 6px 14px; font-weight: 600; color: var(--stil); }
.deurkeuze button[aria-checked="true"][data-deur="ollround"] { background: var(--groen); color: var(--op-deur); }
.deurkeuze button[aria-checked="true"][data-deur="prive"] { background: var(--blauw); color: var(--op-deur); }
.deurkeuze.vast button[aria-checked="false"] { opacity: .45; }

.berichten { display: flex; flex-direction: column; gap: 16px; padding: 8px 0 16px; }
.leeg { margin: auto 0; padding: 24px 0; }
.leeg-titel { font-size: 1.4rem; font-weight: 650; letter-spacing: -0.01em; margin: 0 0 14px; }
.suggesties { display: flex; flex-wrap: wrap; gap: 8px; }
.suggesties button { border: 1px solid var(--lijn); background: var(--vlak); border-radius: 10px; padding: 9px 12px; text-align: left; font-size: .92rem; }
.bericht { max-width: 92%; overflow-wrap: anywhere; }
.bericht.ik { align-self: flex-end; background: var(--deur); color: var(--op-deur); padding: 9px 13px; border-radius: 14px 14px 4px 14px; white-space: pre-wrap; }
.bericht.ik.geweigerd { background: var(--lijn); color: var(--stil); text-decoration: line-through; }
.bericht.claude { align-self: flex-start; border-left: 3px solid var(--deur); padding-left: 12px; }
.bericht.claude p { margin: 0 0 8px; }
.bericht.claude p:last-child { margin-bottom: 0; }
.bericht.claude ul, .bericht.claude ol { margin: 0 0 8px; padding-left: 1.2em; }
.bericht.claude code { font-family: var(--mono); background: var(--deur-bg); padding: 1px 5px; border-radius: 4px; font-size: .86em; }
.bericht.claude pre { background: var(--vlak); padding: 10px; border-radius: 8px; overflow-x: auto; }
.bericht.claude h4 { margin: 10px 0 6px; font-size: 1rem; }
.bericht.claude table { border-collapse: collapse; font-size: .9rem; margin: 0 0 8px; display: block; overflow-x: auto; }
.bericht.claude th, .bericht.claude td { border-bottom: 1px solid var(--lijn); padding: 4px 8px; text-align: left; }
.bericht.fout { color: var(--fout); }
.bericht.cdt { background: var(--wacht-bg); color: var(--inkt); padding: 10px 13px; border-radius: 10px; border-left: 4px solid var(--wacht); }
.tools { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tool { font-family: var(--mono); font-size: .72rem; padding: 3px 9px; border-radius: 999px; background: var(--deur-bg); color: var(--deur); }
.tool.bezig::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--deur); margin-right: 6px; vertical-align: middle; animation: knipper 1s infinite; }
.tool.fout { background: var(--fout-bg); color: var(--fout); }
.denkt { color: var(--stil); margin: 0; }
.denkt::after { content: "…"; animation: knipper 1s infinite; }
@keyframes knipper { 50% { opacity: .3; } }
.kosten { font-family: var(--mono); font-size: .7rem; color: var(--stil); margin-top: 8px; }

.invoer { display: flex; gap: 8px; align-items: flex-end; position: sticky; bottom: calc(var(--strook) + var(--dock) + env(safe-area-inset-bottom, 0px)); background: var(--bg); padding: 8px 0; z-index: 3; }
body.typt .invoer { bottom: 0; padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
.invoer textarea { flex: 1; resize: none; border: 1px solid var(--lijn); background: var(--vlak); border-radius: 20px; padding: 10px 14px; max-height: 140px; line-height: 1.35; }
.verstuur { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--deur); color: var(--op-deur); display: grid; place-items: center; flex: none; }
.verstuur:disabled { opacity: .4; }

/* verbruik */
.meter-blok { background: var(--vlak); border: 1px solid var(--lijn); border-radius: 10px; padding: 16px; }
.meter-getal { margin: 0; font-size: 2.2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.meter-getal .van { font-size: .95rem; font-weight: 500; color: var(--stil); letter-spacing: 0; }
.meter { height: 8px; background: var(--lijn); border-radius: 4px; overflow: hidden; margin: 14px 0 12px; }
.meter span { display: block; height: 100%; width: 0; background: var(--groen); transition: width .5s ease; }
.meter.warm span { background: var(--wacht); }
.meter.vol span { background: var(--fout); }
.limiet label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .9rem; }
.rij { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rij input, .rij select { border: 1px solid var(--lijn); background: var(--vlak); border-radius: 8px; padding: 7px 10px; min-width: 0; }
.rij input { width: 8rem; }
.dagen { display: flex; align-items: flex-end; gap: 3px; height: 80px; border-bottom: 1px solid var(--lijn); }
.dagen span { flex: 1; max-width: 14px; background: var(--groen); opacity: .8; border-radius: 2px 2px 0 0; min-height: 2px; }
.dagen span.leeg { opacity: .2; }
.dagen span.vandaag { opacity: 1; }
.dagen-as { display: flex; justify-content: space-between; font-family: var(--mono); color: var(--stil); font-size: .72rem; margin-top: 4px; }
.tabel { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tabel th { text-align: left; color: var(--stil); font-weight: 600; padding: 6px 0; border-bottom: 1px solid var(--lijn); }
.tabel td { padding: 8px 0; border-bottom: 1px solid var(--lijn); }
.tabel .num { text-align: right; font-variant-numeric: tabular-nums; }
.schakel { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.schakel input { width: 20px; height: 20px; accent-color: var(--deur); }

/* strook (status) + dock (navigatie met microfoon in het midden) */
.strook {
  position: fixed; left: 0; right: 0; bottom: calc(var(--dock) + env(safe-area-inset-bottom, 0px));
  max-width: 760px; margin: 0 auto; z-index: 5; height: var(--strook);
  display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 8px; padding: 6px 16px 0;
  background: linear-gradient(to top, var(--bg) 60%, transparent); pointer-events: none;
}
.strook > * { pointer-events: auto; }
.spreek-tekst { margin: 0; text-align: center; color: var(--stil); font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-top: 6px; }
.handsfree, .stil { border: 1px solid var(--lijn); background: var(--vlak); border-radius: 999px; padding: 5px 11px; font-size: .78rem; font-weight: 600; color: var(--stil); }
.handsfree[aria-pressed="true"] { background: var(--deur); border-color: var(--deur); color: var(--op-deur); }
.stil { grid-column: 3; }
body:not([data-scherm="gesprek"]) .handsfree:not([aria-pressed="true"]) { visibility: hidden; }
body.typt .strook, body.typt .dock { display: none; }

.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; max-width: 760px; margin: 0 auto;
  height: calc(var(--dock) + env(safe-area-inset-bottom, 0px)); padding: 0 24px env(safe-area-inset-bottom, 0px);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  background: var(--vlak); border-top: 1px solid var(--lijn);
}
.dock-knop { border: 0; background: none; color: var(--stil); display: grid; justify-items: center; gap: 2px; font-size: .74rem; font-weight: 600; padding: 6px 18px; justify-self: center; border-radius: 10px; }
.dock-knop svg { width: 22px; height: 22px; }
.dock-knop[aria-current="page"] { color: var(--deur); }
.mic {
  width: 72px; height: 72px; border-radius: 50%; border: 0; position: relative; display: grid; place-items: center;
  margin-top: -30px; background: var(--deur); color: var(--op-deur); touch-action: none; user-select: none; -webkit-user-select: none;
  box-shadow: 0 0 0 6px var(--bg), 0 0 0 7px var(--lijn); transition: transform .15s ease, box-shadow .2s ease;
}
.mic svg { width: 28px; height: 28px; position: relative; }
.mic canvas { position: absolute; inset: -44px; width: 160px; height: 160px; pointer-events: none; }
.mic.luistert { transform: scale(1.06); box-shadow: 0 0 0 6px var(--bg), 0 0 0 12px var(--deur-bg); }
.mic.denkt { animation: adem 1.6s ease-in-out infinite; }
.mic.spreekt { box-shadow: 0 0 0 6px var(--bg), 0 0 0 12px color-mix(in srgb, var(--deur) 35%, transparent); }
.mic:disabled { opacity: .45; }
@keyframes adem { 50% { box-shadow: 0 0 0 6px var(--bg), 0 0 0 16px var(--deur-bg); } }

/* historie */
.historie { border: 0; border-radius: 14px; padding: 16px; width: min(560px, calc(100vw - 24px)); max-height: 80vh; background: var(--vlak); color: var(--inkt); }
.historie::backdrop { background: rgb(0 0 0 / .4); }
.historie-kop { display: flex; justify-content: space-between; align-items: center; }
.historie ul { list-style: none; padding: 0; margin: 8px 0 0; }
.historie li { display: flex; gap: 8px; align-items: center; border-top: 1px solid var(--lijn); }
.historie li button.open { flex: 1; text-align: left; border: 0; background: none; padding: 11px 0; }
.historie li small { display: block; color: var(--stil); font-family: var(--mono); font-size: .72rem; }
.historie .weg { border: 0; background: none; color: var(--stil); padding: 8px; }
.deur-merk { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--groen); }
.deur-merk.prive { background: var(--blauw); }

/* login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-kaart { max-width: 360px; display: grid; gap: 18px; }
.login h1 { font-size: 2.2rem; }
.login .knop { display: inline-flex; gap: 10px; align-items: center; justify-content: center; padding: 13px 18px; border-radius: 10px; background: var(--inkt); color: var(--bg); text-decoration: none; font-weight: 650; }
.login .fout { color: var(--fout); margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
