/* WTB: huisstijl van Bouwbureau Nederland (rood, Archivo), overgenomen uit het dartkastportaal en uitgebreid. */
:root {
  --rood: #bb0909;
  --rood-hover: #910909;
  --inkt: #17171a;
  --inkt-zacht: #4f4f51;
  --inkt-licht: #6f6f71;
  --lijn: #d5d5d6;
  --lijn-zacht: #e7e7e8;
  --mist: #f3f5f7;
  --mist-2: #e6eaf0;
  --wit: #fff;
  --focus: 0 0 0 3px rgba(187, 9, 9, .35);
  --schaduw: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .06);
  --schaduw-hoog: 0 2px 4px rgba(0, 0, 0, .06), 0 12px 32px rgba(0, 0, 0, .12);
  --zijbalk: 420px;
  --snel: 150ms;
  font-family: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--inkt);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--mist); font-size: 15px; line-height: 1.5; }
button, input, textarea, select { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: none; box-shadow: var(--focus); }
a { color: var(--rood); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.zacht { color: var(--inkt-zacht); }
.ruimte { flex: 1; }
.merkje { display: inline-grid; place-items: center; height: 26px; padding: 0 8px; border-radius: 6px; background: var(--rood); color: var(--wit); font-size: 13px; font-weight: 700; letter-spacing: .04em; }

/* ---------- losse pagina's (inloggen) ---------- */
body.los { display: grid; place-items: center; padding: 24px; min-height: 100%; }
.kaart-los { background: var(--wit); border: 1px solid transparent; border-radius: 14px; padding: 32px; max-width: 440px; width: 100%; box-shadow: var(--schaduw); }
.kaart-los h1 { font-size: 24px; margin: 0 0 8px; letter-spacing: -.01em; }
.merk { display: flex; align-items: center; gap: 8px; margin: 0 0 20px; font-size: 13px; font-weight: 600; color: var(--inkt-zacht); }
.knoppen { display: grid; gap: 8px; margin-top: 20px; }
.kaart-los button, .knop { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 16px; border: 0; border-radius: 8px; background: var(--rood); color: var(--wit); font-weight: 600; cursor: pointer; text-decoration: none; transition-property: background-color, scale; transition-duration: var(--snel); transition-timing-function: ease-out; }
.melding { background: var(--mist); border-left: 3px solid var(--rood); padding: 10px 12px; border-radius: 4px; }

/* ---------- kopbalk ---------- */
.app { display: grid; grid-template-rows: auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); height: 100%; height: 100dvh; }
.kopbalk { display: flex; align-items: center; gap: 12px; padding: 0 16px; padding-left: max(16px, env(safe-area-inset-left)); height: 52px; background: var(--wit); border-bottom: 1px solid var(--lijn); min-width: 0; }
.thuis { display: inline-flex; text-decoration: none; border-radius: 6px; }
.kruimel { min-width: 0; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kruimel span::before { content: "/"; color: var(--lijn); margin-right: 10px; font-weight: 400; }
.wie { color: var(--inkt-zacht); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 22ch; }
.licht { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 1px solid var(--lijn); border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 14px; transition: background-color var(--snel) ease-out; }
.tabs { display: none; }

/* ---------- startscherm ---------- */
.start { overflow: auto; padding: 32px 24px 48px; }
.start-kop, .projecten { max-width: 1040px; margin: 0 auto; }
.start-kop h1 { font-size: 28px; margin: 0 0 4px; letter-spacing: -.015em; }
.start-kop p { margin: 0 0 24px; }
.projecten { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.projectkaart { display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 20px; background: var(--wit); border: 1px solid transparent; border-radius: 14px; box-shadow: var(--schaduw); color: inherit; text-decoration: none; transition-property: box-shadow, translate; transition-duration: 200ms; transition-timing-function: cubic-bezier(.2, 0, 0, 1); }
.projectkaart h2 { margin: 0; font-size: 19px; letter-spacing: -.01em; }
.uitleg-p { margin: 0; color: var(--inkt-zacht); }
.stand-p { margin: 4px 0 0; padding: 10px 12px; background: var(--mist); border-radius: 8px; font-size: 14px; }
.stand-p .label { display: block; font-size: 12px; font-weight: 600; color: var(--inkt-licht); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.voet { margin: auto 0 0; padding-top: 8px; font-size: 13px; color: var(--inkt-licht); }
.projecten .leeg { color: var(--inkt-zacht); }

/* ---------- Claude-accounts ---------- */
.accounts-link { text-decoration: none; color: inherit; white-space: nowrap; }
.accounts-vlak { max-width: 1040px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); gap: 16px; align-items: start; }
.accountlijst { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.accountkaart, .inlogpaneel { background: var(--wit); border-radius: 14px; box-shadow: var(--schaduw); padding: 18px 20px; }
.accountkaart { display: grid; gap: 6px; }
.account-kop { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.account-kop h2 { margin: 0; font-size: 17px; overflow-wrap: anywhere; }
.etiket { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--mist); color: var(--inkt-zacht); white-space: nowrap; }
.etiket.aan { background: #eef7ef; color: #1f5f2a; }
.etiket.uit { background: #fbeaea; color: var(--rood-hover); }
.etiket.standaard { background: var(--inkt); color: var(--wit); }
.account-info { margin: 0; color: var(--inkt-zacht); font-size: 14px; overflow-wrap: anywhere; }
.account-knoppen { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.account-knoppen .gevaar { color: var(--rood-hover); }
.naam-form { display: flex; gap: 6px; }
.naam-form input, .veld input, .inlog-code input { flex: 1; min-width: 0; border: 1px solid var(--lijn); border-radius: 8px; padding: 8px 10px; background: var(--wit); }
.inlogpaneel h2 { margin: 0 0 8px; font-size: 18px; }
.inlogpaneel p { margin: 0 0 12px; }
.veld { display: grid; gap: 4px; font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.veld .zacht { font-weight: 400; }
.inlogstappen { margin: 0 0 12px; padding-left: 22px; display: grid; gap: 14px; }
.inlogstappen li > strong { display: block; margin-bottom: 6px; }
.inlogstappen .knop { width: fit-content; }
.inlog-code { display: flex; gap: 6px; }
.inlog-wacht { display: flex; align-items: center; gap: 10px; }
.inlog-voet { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.accountkeuze { max-width: 15ch; height: 32px; border: 1px solid var(--lijn); border-radius: 8px; background: var(--wit); font-size: 13px; color: var(--inkt-zacht); padding: 0 6px; text-overflow: ellipsis; }
.accountkeuze:disabled { opacity: .6; }

/* ---------- werkvlak ---------- */
.werkvlak { display: grid; grid-template-columns: minmax(0, 1fr) var(--zijbalk); min-height: 0; }
.blad { position: relative; min-width: 0; min-height: 0; background: var(--wit); }
.blad iframe { width: 100%; height: 100%; border: 0; display: block; }
.vernieuwd { position: absolute; left: 50%; top: 12px; translate: -50% 0; display: flex; align-items: center; gap: 12px; max-width: calc(100% - 24px); padding: 8px 8px 8px 14px; background: var(--inkt); color: var(--wit); border-radius: 10px; box-shadow: var(--schaduw-hoog); font-size: 14px; z-index: 2; }
.vernieuwd button { border: 0; border-radius: 6px; padding: 6px 10px; background: var(--wit); color: var(--inkt); font-weight: 600; cursor: pointer; }

/* ---------- chat ---------- */
.chat { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); min-height: 0; background: var(--wit); border-left: 1px solid var(--lijn); position: relative; }
.chat-kop { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--lijn-zacht); }
.gesprek-keuze { position: relative; flex: 1; min-width: 0; }
.gesprekken-knop { max-width: 100%; border-color: transparent; font-weight: 600; padding-left: 8px; }
.gesprekken-knop span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu { position: absolute; top: calc(100% + 6px); left: 0; width: min(340px, calc(100vw - 32px)); max-height: 60vh; overflow: auto; overscroll-behavior: contain; background: var(--wit); border: 1px solid transparent; border-radius: 12px; box-shadow: var(--schaduw-hoog); padding: 6px; z-index: 5; }
.menu-item { display: grid; gap: 2px; width: 100%; text-align: left; background: transparent; border: 0; border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.menu-item[aria-current="true"] { background: var(--mist); }
.menu-titel { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-tijd { font-size: 12px; color: var(--inkt-licht); }
.menu-leeg { margin: 8px 10px; color: var(--inkt-zacht); font-size: 14px; }

.berichten { overflow-y: auto; overscroll-behavior: contain; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 100%; }
.msg .van { display: block; font-size: 12px; color: var(--inkt-licht); margin-bottom: 4px; }
.msg.eigen { align-self: flex-end; max-width: 88%; }
.msg.eigen .van { text-align: right; }
.msg.eigen .tekst { background: var(--mist-2); border-radius: 14px 14px 4px 14px; padding: 9px 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-bijlagen { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; justify-items: end; font-size: 13px; color: var(--inkt-zacht); }
.msg-bijlagen li::before { content: "📎 "; }
.msg.agent .tekst { overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 10px; }
.md h3, .md h4, .md h5, .md h6, .md h7, .md h8 { font-size: 15px; margin: 14px 0 6px; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 22px; }
.md li { margin: 2px 0; }
.md code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; background: var(--mist); padding: 1px 5px; border-radius: 4px; }
.md pre { background: #1d1f23; color: #e8e8e8; padding: 10px 12px; border-radius: 8px; overflow: auto; font-size: 13px; margin: 0 0 10px; }
.md pre code { background: none; padding: 0; color: inherit; }
.md blockquote { margin: 0 0 10px; padding: 2px 12px; border-left: 3px solid var(--lijn); color: var(--inkt-zacht); }
.md hr { border: 0; border-top: 1px solid var(--lijn); margin: 12px 0; }
.md .tabel { overflow-x: auto; margin: 0 0 10px; }
.md table { border-collapse: collapse; font-size: 14px; }
.md th, .md td { border-bottom: 1px solid var(--lijn-zacht); padding: 5px 8px; text-align: left; vertical-align: top; }
.md th { font-weight: 600; border-bottom-color: var(--lijn); }

.stappen { margin: 4px 0 8px; font-size: 13.5px; color: var(--inkt-zacht); }
.stappen summary { display: flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; padding: 4px 8px; margin-left: -8px; border-radius: 6px; width: fit-content; max-width: 100%; }
.stappen summary::-webkit-details-marker { display: none; }
.stappen summary::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; rotate: -45deg; transition: rotate var(--snel) ease-out; flex: none; }
.stappen[open] summary::before { rotate: 45deg; }
.stappen.loopt summary::before { display: none; }
.stap-nu { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stap-aantal { color: var(--inkt-licht); flex: none; }
.stappen ol { margin: 4px 0 0; padding-left: 26px; display: grid; gap: 2px; }
.draai { width: 12px; height: 12px; flex: none; border-radius: 50%; border: 2px solid var(--lijn); border-top-color: var(--rood); }
.denkt { margin: 0; color: var(--inkt-zacht); font-size: 14px; }
.cursor { display: inline-block; width: 7px; height: 15px; background: var(--rood); vertical-align: -2px; border-radius: 1px; }
.stand { margin: 6px 0 0; font-size: 13.5px; color: var(--inkt-zacht); }
.stand.fout { color: var(--rood-hover); }
.werkblad-gewijzigd { margin: 8px 0 0; padding: 6px 10px; font-size: 13px; background: #eef7ef; color: #1f5f2a; border-radius: 6px; width: fit-content; }
.werkblad-gewijzigd::before { content: "✓ "; }

.leeg { margin: auto 0; padding: 8px 4px; }
.leeg-kop { font-weight: 600; margin: 0 0 4px; }
.leeg .zacht { margin: 0 0 12px; font-size: 14px; }
.voorbeelden { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.voorbeelden button { width: 100%; text-align: left; background: var(--mist); border: 1px solid transparent; border-radius: 10px; padding: 9px 12px; cursor: pointer; font-size: 14px; transition: background-color var(--snel) ease-out; }

/* ---------- invoer ---------- */
.invoer { padding: 8px 12px 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--lijn-zacht); }
.invoer form { border: 1px solid var(--lijn); border-radius: 14px; background: var(--wit); transition: border-color var(--snel) ease-out; }
.invoer form:focus-within { border-color: var(--inkt-licht); }
.invoer textarea { display: block; width: 100%; resize: none; border: 0; background: transparent; padding: 10px 12px 4px; max-height: 200px; min-height: 44px; }
.invoer textarea:focus-visible { box-shadow: none; }
.invoer-balk { display: flex; align-items: center; gap: 4px; padding: 4px 6px 6px; }
.ikoon { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--inkt-zacht); cursor: pointer; transition: background-color var(--snel) ease-out, color var(--snel) ease-out; }
.ikoon:disabled { opacity: .5; cursor: progress; }
#mic .ik-stop { display: none; }
#mic[aria-pressed="true"] { background: var(--rood); color: var(--wit); }
#mic[aria-pressed="true"] .ik-mic { display: none; }
#mic[aria-pressed="true"] .ik-stop { display: block; }
.opname { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--inkt-zacht); padding-left: 4px; }
.opname-punt { width: 8px; height: 8px; border-radius: 50%; background: var(--rood); }
.tekstknop { border: 0; background: none; color: var(--inkt-zacht); text-decoration: underline; cursor: pointer; padding: 4px; font-size: 13px; }
.stuur, .stopknop { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px; border: 0; border-radius: 10px; font-weight: 600; cursor: pointer; transition-property: background-color, scale; transition-duration: var(--snel); transition-timing-function: ease-out; }
.stuur { background: var(--rood); color: var(--wit); }
.stuur:disabled { background: var(--inkt-licht); cursor: not-allowed; }
.stopknop { background: var(--inkt); color: var(--wit); }
.fout { color: var(--rood-hover); font-size: 14px; margin: 8px 2px 0; }
.uitleg { color: var(--inkt-licht); font-size: 12.5px; margin: 6px 2px 0; }
.bijlagen { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.bijlage { display: flex; align-items: center; gap: 8px; max-width: 100%; padding: 4px 4px 4px 6px; background: var(--mist); border-radius: 10px; font-size: 13px; }
.bijlage img { width: 32px; height: 32px; object-fit: cover; border-radius: 6px; outline: 1px solid oklch(0 0 0 / .1); outline-offset: -1px; }
.bijlage-naam { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.bijlage-info { color: var(--inkt-licht); white-space: nowrap; }
.bijlage.fout .bijlage-info { color: var(--rood-hover); }
.bijlage.bezig { opacity: .75; }
.bijlage-weg { width: 26px; height: 26px; border: 0; border-radius: 7px; background: transparent; cursor: pointer; font-size: 18px; line-height: 1; color: var(--inkt-zacht); }
.sleep { position: absolute; inset: 8px; display: grid; place-items: center; border: 2px dashed var(--rood); border-radius: 14px; background: rgba(255, 255, 255, .92); font-weight: 600; color: var(--rood); z-index: 4; pointer-events: none; }

@media (hover: hover) {
  .licht:hover, .ikoon:hover:not(:disabled), .menu-item:hover, .voorbeelden button:hover { background: var(--mist); }
  #mic[aria-pressed="true"]:hover { background: var(--rood-hover); }
  .stuur:hover:not(:disabled), .knop:hover, .kaart-los button:hover { background: var(--rood-hover); }
  .stopknop:hover { background: #000; }
  .projectkaart:hover { box-shadow: var(--schaduw-hoog); }
  .stappen summary:hover { background: var(--mist); }
}
@media (prefers-reduced-motion: no-preference) {
  .stuur:not(:disabled):active, .stopknop:not(:disabled):active, .knop:active, .kaart-los button:not(:disabled):active { scale: .96; }
  .projectkaart:hover { translate: 0 -2px; }
  .draai { animation: draai 800ms linear infinite; }
  .cursor { animation: knipper 1s steps(2, start) infinite; }
  .opname-punt { animation: knipper 1.2s ease-in-out infinite; }
}
@keyframes draai { to { rotate: 360deg; } }
@keyframes knipper { 50% { opacity: .2; } }

/* ---------- telefoon: schermvullend, met de knoppen Model en Chat ---------- */
@media (max-width: 820px) {
  .kopbalk { gap: 8px; padding: 0 10px; }
  .wie, #uitloggen { display: none; }
  .accounts-link span { display: none; }
  .accounts-vlak { grid-template-columns: minmax(0, 1fr); }
  .inlogpaneel { order: -1; }
  .tabs:not([hidden]) { display: flex; margin-left: auto; background: var(--mist); border-radius: 9px; padding: 3px; }
  .tabs button { border: 0; background: transparent; border-radius: 7px; padding: 6px 14px; font-weight: 600; font-size: 14px; color: var(--inkt-zacht); cursor: pointer; }
  .tabs button[aria-selected="true"] { background: var(--wit); color: var(--inkt); box-shadow: 0 1px 2px rgba(0, 0, 0, .1); }
  .werkvlak { grid-template-columns: minmax(0, 1fr); }
  .werkvlak[data-tab="model"] .chat { display: none; }
  .werkvlak[data-tab="chat"] .blad { display: none; }
  .chat { border-left: 0; }
  .start { padding: 20px 14px 40px; }
  .msg.eigen { max-width: 92%; }
  .invoer textarea { font-size: 16px; }
}
