/* Work application layout (025 Stijlboek, chapter 6). */
.top {
  background: var(--grad-h); color: var(--chrome-fg); height: 46px;
  display: flex; align-items: center; gap: 12px;
  padding-left: max(12px, env(safe-area-inset-left, 0px));
  padding-right: max(12px, env(safe-area-inset-right, 0px));
}
.top .brand { font-weight: 700; font-size: 17px; letter-spacing: -.2px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.logo { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: #fff; flex: none; }
.logo::after { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 3px solid #1d4ed8; }
.top .sep { width: 1px; height: 20px; background: var(--chrome-line); }
.top .crumb { color: rgba(255, 255, 255, .78); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.top .spacer { margin-left: auto; }
.top .ico { background: none; border: 0; color: var(--chrome-fg); padding: 6px; border-radius: 4px; display: grid; place-items: center; }
.top .ico:hover { background: var(--chrome-2); }
.mode-tag { font-size: 10px; font-weight: 700; letter-spacing: .6px; background: #fff; color: #1d4ed8; border-radius: 4px; padding: 1px 6px; }

.shell { display: flex; min-height: calc(100% - 46px); }
.rail {
  width: 52px; flex: none; background: var(--grad-v); color: var(--chrome-fg);
  padding: 8px 0; padding-left: env(safe-area-inset-left, 0px);
  display: flex; flex-direction: column; gap: 2px; transition: width .15s;
}
.rail.open { width: 210px; }
.rail a {
  display: flex; align-items: center; gap: 12px; padding: 8px 18px;
  color: rgba(255, 255, 255, .88); text-decoration: none; white-space: nowrap; overflow: hidden;
  border-left: 3px solid transparent;
}
.rail a:hover { background: var(--chrome-2); color: #fff; }
.rail a[aria-current="page"] { background: rgba(255, 255, 255, .16); border-left-color: #fff; color: #fff; font-weight: 700; }
.rail .lbl { opacity: 0; transition: opacity .1s; }
.rail.open .lbl { opacity: 1; }
.rail .grp { font-size: 10px; text-transform: uppercase; letter-spacing: .7px; color: rgba(255, 255, 255, .55); padding: 12px 18px 2px; white-space: nowrap; overflow: hidden; height: 26px; }
.rail:not(.open) .grp { visibility: hidden; height: 8px; padding: 0; }

main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cmd {
  background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 2px; padding: 4px 8px; overflow-x: auto; scrollbar-width: none;
}
.cmd button, .cmd a { display: flex; align-items: center; gap: 6px; background: none; border: 0; padding: 6px 8px; border-radius: 4px; color: var(--fg); text-decoration: none; white-space: nowrap; }
.cmd svg { color: var(--accent); }
.cmd button:hover, .cmd a:hover { background: var(--line-2); }
.view { padding: 10px max(12px, env(safe-area-inset-right, 0px)) 16px 12px; display: flex; flex-direction: column; gap: 10px; }
/* Block editor of landing pages: the full height under the command bar. */
.page-editor-view { height: calc(100vh - 112px); min-height: 480px; }
.page-editor { flex: 1; min-height: 0; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
/* Code screen of the editor (HTML and CSS). */
.ap-code { display: flex; flex-direction: column; gap: 6px; }
.ap-code label { font-weight: 600; margin-top: 6px; }
.ap-code .CodeMirror { height: 240px; font-size: 13px; }
.ap-code-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.ap-code-cancel { opacity: .8; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: start; }

.rec-head {
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: var(--r);
  padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center;
}
.rec-head .avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--grad-d); color: #fff; font-weight: 700; }
.rec-head h1 { font-size: 18px; font-weight: 600; }
.eyebrow { font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: var(--fg-2); }

/* Full screen with gradient (sign-in screens, error pages, administration) */
.full {
  min-height: 100%; background: var(--grad-d); color: #fff;
  display: grid; place-items: center;
  padding: max(24px, env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-right, 0px)) max(24px, env(safe-area-inset-bottom, 0px)) max(24px, env(safe-area-inset-left, 0px));
}
.full .panel {
  background: var(--surface); color: var(--fg); border-radius: 18px; box-shadow: var(--shadow-dialog);
  padding: 32px; max-width: 520px; width: 100%;
}
.full .panel h1 { font-size: 24px; letter-spacing: -.4px; margin-bottom: 10px; }
.full .panel p { margin: 0 0 10px; font-size: 14px; color: var(--fg-2); }
.full .release { margin: 14px 0 0; text-align: center; font-size: 11px; color: rgba(255, 255, 255, .7); font-variant-numeric: tabular-nums; }
.full .brandline { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; margin-bottom: 18px; color: #fff; }

@media (max-width: 1100px) { .rail.open { width: 52px; } .rail.open .lbl { opacity: 0; } }
@media (max-width: 720px) { .cols { grid-template-columns: minmax(0, 1fr); } .top .crumb, .top .sep { display: none; } }

/* Sign-in screens (025, chapter 11) */
.login {
  min-height: 100%; background: var(--grad-d); color: #fff;
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; gap: 32px;
  padding: max(24px, env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-right, 0px)) max(24px, env(safe-area-inset-bottom, 0px)) max(24px, env(safe-area-inset-left, 0px));
}
.login .hero { padding-left: 6vw; }
.login .hero .big { display: flex; align-items: center; gap: 16px; font-size: clamp(40px, 6vw, 76px); font-weight: 700; letter-spacing: -1.5px; line-height: 1; }
.login .hero .logo { width: clamp(48px, 6vw, 80px); height: clamp(48px, 6vw, 80px); border-radius: 16px; }
.login .hero .logo::after { width: 46%; height: 46%; border-width: clamp(5px, .8vw, 9px); }
.login .hero p { font-size: 17px; color: rgba(255, 255, 255, .82); max-width: 30ch; margin: 18px 0 0; }
.login .side { justify-self: center; width: 100%; max-width: 420px; }
.lcard { background: var(--surface); color: var(--fg); border-radius: 18px; box-shadow: var(--shadow-dialog); padding: 32px; width: 100%; }
.lcard h1 { font-size: 28px; margin: 0 0 14px; letter-spacing: -.5px; }
.lcard p { color: var(--fg-2); margin: 0 0 8px; }
.lcard label { display: block; font-weight: 700; font-size: 13px; margin: 12px 0 6px; }
.lcard .in { padding: 10px 12px; font-size: 14px; border-radius: 8px; }
.lcard .btn { width: 100%; padding: 12px; font-size: 15px; border-radius: 8px; margin-top: 18px; }
.lcard .btn.ghost { margin-top: 8px; }
.lcard .link { display: block; margin: 14px auto 0; font-size: 13px; text-align: center; }
.lcard .code { letter-spacing: 8px; text-align: center; font-family: var(--f-mono); font-size: 18px; }
.lcard .tlist { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.lcard .tlist button { display: flex; align-items: center; gap: 10px; text-align: left; width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--fg); }
.lcard .tlist button:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.lcard .tlist button:disabled { opacity: .55; cursor: not-allowed; }
.lcard .tlist .avatar { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--grad-d); color: #fff; font-size: 12px; font-weight: 700; }
.lcard .tlist small { display: block; color: var(--fg-2); }
.lcard .choice { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 8px 0 0; font-weight: 400; cursor: pointer; }
.lcard .choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.lcard .choice input { margin-top: 3px; accent-color: var(--accent); }
.lcard .choice b { display: block; }
.login .release { margin: 14px 0 0; text-align: center; font-size: 11px; color: rgba(255, 255, 255, .7); font-variant-numeric: tabular-nums; }
.login .langs { margin: 10px 0 0; text-align: center; font-size: 12px; }
.login .langs a { color: rgba(255, 255, 255, .85); margin: 0 6px; }
.login .langs a[aria-current] { color: #fff; font-weight: 700; text-decoration: none; }
@media (max-width: 820px) { .login { grid-template-columns: minmax(0, 1fr); } .login .hero { padding-left: 0; } .login .hero .big { font-size: 40px; } }

/* User menu in the top bar */
.top .who { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.top .who a { color: var(--chrome-fg); text-decoration: none; display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 4px; }
.top .who a:hover { background: var(--chrome-2); }
.top .who form { margin: 0; }
.top .tenant-sw { color: rgba(255, 255, 255, .85); font-size: 12px; }
.app-foot { margin-top: auto; padding: 8px 12px; font-size: 11px; color: var(--fg-3); }
@media (max-width: 720px) { .top .who .nm { display: none; } }
.top .langs { display: flex; gap: 2px; font-size: 11px; }
.top .langs a { padding: 3px 5px; color: rgba(255, 255, 255, .75); }
.top .langs a[aria-current] { color: #fff; font-weight: 700; background: var(--chrome-2); }

/* Record screen (025 Stijlboek, 6.5 and 6.8): three columns 1 : 1.25 : 1 */
.cols3 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr); gap: 10px; align-items: start; }
.cols3 .col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.rec-head .head-vals { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-left: auto; }
.rec-head .head-vals div { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
/* Same height for a value and a pill (status), so the labels line up. */
.rec-head .head-vals b { display: flex; align-items: center; min-height: 20px; font-size: 13px; line-height: 20px; font-weight: 600; }
.rec-head .head-vals b .pill { line-height: 18px; }
.rec-head .head-vals small { font-size: 11px; line-height: 14px; color: var(--fg-2); }
@media (max-width: 1100px) { .cols3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols3 .col:last-child { grid-column: 1 / -1; } }
@media (max-width: 720px) { .cols3 { grid-template-columns: minmax(0, 1fr); } .rec-head .head-vals { margin-left: 0; } }
/* Passport photo of a patient (030 Functionaliteit, Pasfoto) */
.rec-head .avatar.photo { width: 56px; height: 56px; padding: 0; overflow: hidden; background: var(--line); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line); }
.rec-head .avatar.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rec-head .avatar.photo:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.photo-field { display: flex; gap: 12px; align-items: flex-start; }
.photo-field > div { display: grid; gap: 4px; min-width: 0; }
.photo-thumb { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none; border: 1px solid var(--line); }
.photo-dialog { max-width: 460px; }
.photo-dialog .content { display: grid; place-items: center; }
.photo-large { width: 100%; max-width: 400px; height: auto; border-radius: 8px; user-select: none; -webkit-user-drag: none; }
/* Phone number with country calling code (020 DataModel, Telefoonnummer) */
.phone-in { display: flex; gap: 6px; min-width: 0; }
.phone-in select { flex: 0 0 auto; width: 9.5em; }
.phone-in input { flex: 1 1 auto; min-width: 0; }
/* Longer text in a line list (for example the note of a completed task) */
.lines .line-text { display: block; white-space: pre-wrap; margin: 2px 0; }
.fr.stack { display: grid; grid-template-columns: 1fr; gap: 6px; }
img.initials.photo { object-fit: cover; padding: 0; border-radius: 50%; }

/* Portal and tablet pages (patient, no sign-in): calm, large touch targets. */
.portal { min-height: 100vh; background: var(--bg); }
.portal-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--grad-v, #1d4ed8); color: #fff; }
.portal-head .logo { width: 26px; height: 26px; }
.portal-head .langs { margin-left: auto; display: flex; gap: 10px; }
.portal-head .langs a { color: rgba(255,255,255,.85); }
.portal-main { max-width: 760px; margin: 0 auto; padding: 18px 16px 40px; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; font-size: 15px; }
.pcard h1 { font-size: 20px; margin: 0 0 6px; }
.pcard .btn { padding: 10px 18px; font-size: 15px; }
.pcard .in { font-size: 15px; padding: 9px 12px; }
.pcard form > * + * { margin-top: 12px; }
.consent-text { border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 10px 0; margin: 12px 0; max-height: 50vh; overflow: auto; }
.checks.big { font-size: 15px; font-weight: 600; }
.sign-pad { width: 100%; max-width: 600px; height: auto; aspect-ratio: 3 / 1; border: 1px dashed var(--fg-3); border-radius: 10px; background: #fff; touch-action: none; }
.sign-pad.err { border-color: var(--bad); }
.camera .cam-frame { position: relative; width: 100%; max-width: 420px; aspect-ratio: 1; margin: 10px 0; border-radius: 14px; overflow: hidden; background: #000; }
.camera video, .camera img { width: 100%; height: 100%; object-fit: cover; display: block; }
.camera video { transform: scaleX(-1); }
.cam-square { position: absolute; inset: 8%; border: 2px solid rgba(255,255,255,.8); border-radius: 50%; pointer-events: none; }
.file-alt { position: relative; overflow: hidden; }
.file-alt input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
/* QR dialog: text left-aligned, the code as its own centered block, the
   link below it (never over the code). */
/* The general .qr box (two-step verification) is 180px; here the box follows the code. */
.tablet-qr .qr { display: flex; justify-content: center; width: auto; height: auto; padding: 0; background: none; margin: 14px 0 10px; }
.tablet-qr .qr svg { display: block; flex: none; width: 200px; height: 200px; padding: 8px; background: #fff; border-radius: 8px; }
.tablet-qr .mono { text-align: center; word-break: break-all; font-size: 10px; margin: 0 0 10px; }
.tablet-qr .tablet-status { text-align: center; margin: 0; }

/* Rotating tagline on the login screen: lines on top of each other, the
   current one visible; no animation with reduced motion. */
.tagline { display: grid; }
.tagline span { grid-area: 1 / 1; opacity: 0; transform: translateY(6px); transition: opacity .5s ease, transform .5s ease; }
.tagline span.on { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .tagline span { transition: none; transform: none; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
