/* Praatbord familie. Alle kleuren, lettertypen en maten staan hier bovenaan,
   zodat de vormgeving later in één keer kan worden bijgewerkt. */
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-display: swap; src: url(/fonts/AtkinsonHyperlegible-400.woff2) format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-display: swap; src: url(/fonts/AtkinsonHyperlegible-700.woff2) format("woff2"); }
@font-face { font-family: "Lexend"; font-weight: 600; font-display: swap; src: url(/fonts/Lexend-600.woff2) format("woff2"); }

:root {
  --paper: #E9F0F4; --surface: #FFFFFF; --sunk: #D5E2EB;
  --ink: #0F2233; --muted: #475C6E; --line: #B8C8D4;
  --accent: #0B5CAD; --on-accent: #FFFFFF;
  --dad: #FFF4C2; --on-dad: #2A2100; --dad-line: #E2C44A;
  --mine: #D4E6F7;
  --ok: #0E7A4B; --on-ok: #FFFFFF; --warn: #8A5A00; --warn-bg: #FFE9B8;
  --urgent: #B3261E; --on-urgent: #FFFFFF; --urgent-bg: #FDE3E0;
  --font-ui: "Atkinson Hyperlegible", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Lexend", "Atkinson Hyperlegible", Roboto, Arial, sans-serif;
  --text: 18px;
  --radius: 14px;
  --radius-sm: 10px;
  --gap: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0D171F; --surface: #15232E; --sunk: #203241;
    --ink: #EEF4F8; --muted: #A5B7C4; --line: #33495A;
    --accent: #66B2F5; --on-accent: #06233D;
    --dad: #3A3000; --on-dad: #FFF1B0; --dad-line: #8F7A16;
    --mine: #1D3B55;
    --ok: #43D096; --on-ok: #05291A; --warn: #F5C63C; --warn-bg: #2E2500;
    --urgent: #FF9A8F; --on-urgent: #3F0B07; --urgent-bg: #3D1411;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-ui); font-size: var(--text); line-height: 1.35;
}
h1, h2 { font-family: var(--font-head); font-weight: 600; line-height: 1.15; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.primary { background: var(--accent); color: var(--on-accent); font-weight: 700; border-radius: var(--radius-sm); padding: 12px 18px; min-height: 48px; }
.primary:disabled { opacity: .5; }
.ghost { background: var(--sunk); font-weight: 700; border-radius: var(--radius-sm); padding: 10px 14px; min-height: 44px; }
.danger { background: var(--urgent); color: var(--on-urgent); font-weight: 700; border-radius: var(--radius-sm); padding: 10px 14px; min-height: 44px; }
.link { color: var(--accent); text-decoration: underline; padding: 8px 0; text-align: left; }
.wide { width: 100%; }
input, textarea, select {
  width: 100%; min-width: 0; padding: 12px; border-radius: var(--radius-sm);
  border: 2px solid var(--line); background: var(--surface);
}
input::placeholder, textarea::placeholder { color: var(--muted); }
label { display: block; font-weight: 700; margin-bottom: 6px; }
.error { color: var(--urgent); font-weight: 700; }

.boot { display: grid; place-items: center; height: 100%; color: var(--muted); }

/* Uitnodiging en geen toegang */
.page { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.card { width: 100%; max-width: 460px; background: var(--surface); border-radius: var(--radius); padding: 22px 18px; display: flex; flex-direction: column; gap: 14px; }
.card h1 { margin: 0; font-size: 28px; }
.card p { margin: 0; }
.card form { display: flex; flex-direction: column; gap: 12px; }
.steps { display: flex; flex-direction: column; gap: 10px; background: var(--sunk); border-radius: var(--radius-sm); padding: 14px; }
.steps ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }

/* Berichten */
.main { height: 100%; display: flex; flex-direction: column; max-width: 760px; margin: 0 auto; }
.top {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.who { min-width: 0; }
.who h1 { margin: 0; font-size: 24px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; color: var(--muted); }
.pill::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.pill.on::before { background: var(--ok); }
.pill.off { color: var(--warn); }
.pill.off::before { background: var(--warn); }

.banner { flex: 0 0 auto; margin: 10px 16px 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--warn-bg); display: flex; flex-direction: column; gap: 10px; }
.banner p { margin: 0; }
.banner .row { display: flex; flex-wrap: wrap; gap: 8px; }
.banner.urgent { background: var(--urgent); color: var(--on-urgent); }
.banner.urgent .ackbar button { background: var(--on-urgent); color: var(--urgent); }

.list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.empty { margin: auto; text-align: center; color: var(--muted); max-width: 340px; }
.day { align-self: center; font-size: 14px; font-weight: 700; color: var(--muted); padding: 6px 0 2px; }
.msg { max-width: 88%; align-self: flex-start; background: var(--surface); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); }
.msg.dad { background: var(--dad); color: var(--on-dad); border-color: var(--dad-line); }
.msg.dad .text { font-size: 21px; font-family: var(--font-head); font-weight: 600; }
.msg.mine { align-self: flex-end; background: var(--mine); border-color: transparent; }
.msg.urgent { border: 3px solid var(--urgent); }
.msg.flash { outline: 4px solid var(--accent); outline-offset: 2px; }
.meta { font-size: 14px; color: inherit; opacity: .8; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.meta strong { opacity: 1; }
.tag { background: var(--urgent); color: var(--on-urgent); border-radius: 6px; padding: 1px 7px; font-weight: 700; font-size: 13px; }
.text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.status { font-size: 14px; opacity: .85; }
.acks { font-weight: 700; color: var(--ok); }
.msg.dad .acks { color: inherit; }
.ackbar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.ackbar button { background: var(--accent); color: var(--on-accent); font-weight: 700; border-radius: var(--radius-sm); padding: 10px 14px; min-height: 44px; }
.ackbar button.quiet { background: var(--sunk); color: var(--ink); }
.pending { opacity: .6; }

.composer {
  flex: 0 0 auto; display: flex; gap: 8px; align-items: flex-end;
  padding: 10px 16px max(10px, env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line);
}
.composer textarea { resize: none; max-height: 40vh; line-height: 1.3; }
.composer .primary { flex: 0 0 auto; }

/* Instellingen */
.sheet { position: fixed; inset: 0; z-index: 20; background: var(--paper); overflow-y: auto; padding: max(14px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom)); }
.sheet .inner { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.sheet header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sheet h1 { margin: 0; font-size: 26px; }
.sheet h2 { margin: 14px 0 0; font-size: 20px; }
.box { background: var(--surface); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.box p { margin: 0; }
.box small, .hint { color: var(--muted); font-size: 15px; }
.inline { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline > div { flex: 1 1 120px; min-width: 0; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 400; margin: 0; }
.check input { width: 24px; height: 24px; flex: 0 0 auto; }
.person { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); }
.person:first-of-type { border-top: 0; }
.person .tools { display: flex; gap: 6px; flex-wrap: wrap; }
.person .tools button { min-height: 40px; padding: 8px 12px; }
.linkbox { background: var(--sunk); border-radius: var(--radius-sm); padding: 10px; overflow-wrap: anywhere; font-size: 15px; user-select: all; }
.code { font-family: var(--font-head); font-size: 44px; letter-spacing: .12em; text-align: center; font-variant-numeric: tabular-nums; }

/* Videobellen */
.topbtns { display: flex; gap: 8px; flex: 0 0 auto; }
.callbtn { background: var(--ok); color: var(--on-ok); font-weight: 700; border-radius: var(--radius-sm); padding: 10px 16px; min-height: 44px; }
.callbtn:disabled { opacity: .45; }
.banner.calling { background: var(--ok); color: var(--on-ok); }
.banner.calling .ghost { background: var(--on-ok); color: var(--ok); }
.callview { position: fixed; inset: 0; z-index: 30; background: #000; color: #fff; display: flex; flex-direction: column; }
.callhead { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: max(12px, env(safe-area-inset-top)) 16px 10px; text-align: center; }
.callhead strong { font-family: var(--font-head); font-size: 26px; }
.callhead span { font-size: 16px; opacity: .85; }
.callview.ringing .callhead { flex: 1 1 auto; justify-content: center; }
.callview.ringing .callhead strong { font-size: 36px; }
.callstage { flex: 1 1 auto; min-height: 0; position: relative; }
.callview.ringing .callstage:empty { display: none; }
.callstage iframe, .callframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.proefbeeld { position: absolute; inset: 12px; display: grid; place-items: center; text-align: center; border: 2px dashed #888; border-radius: var(--radius); padding: 16px; font-size: 18px; }
.callbar { flex: 0 0 auto; display: flex; gap: 12px; justify-content: center; padding: 12px 16px max(16px, env(safe-area-inset-bottom)); }
.callbar button { flex: 1 1 0; max-width: 260px; min-height: 64px; border-radius: 32px; font-size: 20px; font-weight: 700; }
.callbar .answer { background: #1E9E5A; color: #fff; }
.callbar .hangup { background: #D93025; color: #fff; }

.toast { position: fixed; z-index: 40; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--paper); border-radius: var(--radius-sm); padding: 12px 16px; max-width: calc(100% - 32px); }
