:root {
  color-scheme: light;
  --paper:#f5f7f7; --white:#fff; --ink:#22343a; --muted:#536870;
  --line:#dae3e5; --deep:#174752; --accent:#9b4d2b; --focus:#187894;
  --radius:14px; --face:"Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif;
  font: 15px/1.48 var(--face); color:var(--ink); background:var(--paper);
}
*, *::before, *::after { box-sizing:border-box; }
body { margin:0; }
button, input, select { font:inherit; color:inherit; }
button { cursor:pointer; }
button:disabled { opacity:.56; cursor:default; }
a { color:var(--deep); text-underline-offset:3px; }
:focus-visible { outline:2px solid var(--focus); outline-offset:3px; }
::selection { background:#dcf0f3; color:#133642; }
input { caret-color:var(--focus); }
* { scrollbar-color:#a0b6bd transparent; }
h1,h2,p { margin:0; }
.sprite { position:absolute; width:0; height:0; pointer-events:none; overflow:hidden; }
.icon { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.75; stroke-linecap:round; stroke-linejoin:round; vertical-align:middle; flex:0 0 auto; }
.boot { margin:22vh auto; width:max-content; color:var(--muted); }
.shell { display:grid; grid-template-columns:210px minmax(0,1fr); min-height:100dvh; }
.rail { display:flex; flex-direction:column; position:sticky; top:0; height:100dvh; background:#fbfcfc; border-right:1px solid var(--line); padding:26px 14px 18px; }
.brand { display:flex; align-items:center; gap:10px; white-space:nowrap; }
.brand img { flex:none; }
.brand strong { display:block; font-size:14px; letter-spacing:-.025em; }
.brand span { display:flex; gap:6px; align-items:center; font-size:11px; color:var(--muted); }
.brand i { background:var(--accent); width:4px; height:4px; border-radius:50%; }
.rail nav { display:grid; gap:5px; margin-top:48px; }
.nav-button { display:flex; gap:11px; align-items:center; border:1px solid transparent; background:transparent; padding:10px 12px; text-align:left; border-radius:8px; font-weight:650; color:var(--muted); min-height:44px; }
.nav-button:hover { background:#eff4f4; }
.nav-button[aria-current] { background:#e3eff0; border-color:#d1e4e6; color:var(--deep); }
.rail-person { display:flex; gap:9px; align-items:center; margin-top:auto; padding-top:16px; border-top:1px solid var(--line); min-width:0; }
.rail-person div { flex:1; min-width:0; }
.rail-person strong, .rail-person small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; }
.rail-person small { color:var(--muted); }
.avatar { display:grid; place-items:center; width:31px; height:31px; border-radius:50%; color:#713b27; background:#f4e7dc; font-size:11px; font-weight:800; flex:none; }
.top { min-height:63px; padding:10px clamp(18px,3vw,48px); background:#fbfcfc; border-bottom:1px solid var(--line); display:flex; justify-content:space-between; align-items:center; gap:12px; font-size:12px; color:var(--muted); }
.top > span { display:flex; align-items:center; gap:7px; }
.top strong { color:var(--ink); }
.top .icon { width:14px; height:14px; }
.demo { padding:5px 9px; border:1px solid #e9d9ce; border-radius:7px; color:#753e24; background:#faf3ed; font-weight:650; }
.content { padding:30px clamp(18px,3vw,48px) 20px; max-width:1700px; margin:auto; }
.page-head { display:flex; justify-content:space-between; align-items:center; gap:16px; margin:0 0 25px; }
h1 { font-size:clamp(25px, 2.9vw, 42px); line-height:1.12; font-weight:720; letter-spacing:-.035em; text-wrap:balance; }
h2 { font-size:16px; line-height:1.25; letter-spacing:-.02em; }
.page-head p { color:var(--muted); margin-top:8px; }
.primary, .plain, .icon-button { display:inline-flex; justify-content:center; align-items:center; gap:7px; padding:9px 12px; min-height:39px; border-radius:8px; border:1px solid var(--line); background:var(--white); font-weight:650; }
.icon-button { border-color:transparent; padding:5px; min-height:34px; min-width:34px; background:transparent; }
.framed { border-color:var(--line); }
.primary { color:#fff; background:var(--deep); border-color:var(--deep); padding:10px 15px; white-space:nowrap; }
.primary:hover { background:#235d68; }
.plain:hover, .icon-button:hover { background:#edf4f5; }
.toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin-bottom:14px; }
.filter { display:flex; align-items:center; flex-wrap:wrap; gap:7px; min-height:40px; padding:4px 8px 4px 10px; color:var(--muted); border:1px solid var(--line); border-radius:8px; background:var(--white); font-size:12px; }
.filter select { display:block; width:auto; min-height:30px; padding:2px; border:0; background:transparent; color:var(--ink); font-size:13px; font-weight:650; }
.filter select:disabled { opacity:1; appearance:none; }
.switch { display:flex; margin-left:auto; background:#eaf0f1; padding:3px; border-radius:8px; }
.switch button { min-height:33px; padding:5px 13px; border:1px solid transparent; border-radius:6px; background:transparent; color:var(--muted); font-weight:650; font-size:13px; }
.switch [aria-pressed=true] { background:#fff; color:var(--deep); border-color:#dce6e8; }
.agenda-layout, .admin-layout { display:grid; gap:15px; grid-template-columns:minmax(0,1fr) 238px; align-items:start; }
.surface { background:var(--white); border:1px solid var(--line); border-radius:var(--radius); min-width:0; }
.calendar-panel { overflow:hidden; }
.datebar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:9px; padding:12px 14px; font-size:15px; }
.datebar strong::first-letter, .flow-head p::first-letter { text-transform:uppercase; }
.date-actions { display:flex; gap:4px; align-items:center; }
.date-actions .plain { min-height:34px; padding:4px 10px; margin-right:3px; font-size:12px; }
.schedule-scroll { overflow:auto; border-block:1px solid var(--line); }
.schedule-scroll:focus-visible { outline-offset:-2px; }
.calendar { --hour:60px; min-width:670px; display:grid; grid-template-columns:50px repeat(7,minmax(88px,1fr)); }
.corner { display:grid; place-items:center; font-size:10px; color:var(--muted); border-bottom:1px solid var(--line); background:#fbfcfc; }
.day-head { display:flex; align-items:center; justify-content:center; gap:4px; min-height:47px; text-transform:capitalize; border:0; border-left:1px solid var(--line); border-bottom:1px solid var(--line); background:#fbfcfc; font-size:12px; color:var(--muted); }
.day-head:focus-visible { outline-offset:-3px; }
.day-head:hover { background:#eff6f6; }
.day-head b { color:var(--ink); padding:3px 5px; }
.day-head[aria-pressed=true] { background:#eaf4f4; color:var(--deep); }
.day-head[aria-pressed=true] b { background:var(--deep); color:#fff; border-radius:6px; min-width:21px; }
.time-axis { display:grid; grid-auto-rows:var(--hour); color:var(--muted); font-size:10px; background:#fbfcfc; }
.time-axis span { padding:3px 0 0 9px; font-variant-numeric:tabular-nums; }
.day-column {
  position:relative; min-height:calc(var(--hours) * var(--hour)); border-left:1px solid var(--line);
  background:repeating-linear-gradient(to bottom,transparent 0 calc(var(--hour) - 1px),#e6ecee calc(var(--hour) - 1px) var(--hour));
}
.day-column.weekend { background-color:#f8fafb; }
.day-column.selected { background-color:#f0f8f8; }
.event {
  --tag-fill:#e8eff5; --tag-ink:#274e67; --tag-border:#d4e2ec;
  display:flex; flex-direction:column; justify-content:center; min-width:0; text-align:left;
  border:1px solid var(--tag-border); border-radius:7px; background:var(--tag-fill); color:var(--tag-ink);
  padding:5px 6px; gap:1px; line-height:1.15;
}
.event:hover { border-color:currentColor; }
.event > span, .event > strong { display:block; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.event strong { font-size:11px; }
.event-time { font-size:10px; font-weight:750; font-variant-numeric:tabular-nums; }
.event-service { font-size:10px; }
.day-column .event {
  position:absolute; left:3px; right:3px; top:calc(var(--start) * var(--hour) / 60 + 2px);
  height:max(13px, calc(var(--duration) * var(--hour) / 60 - 4px)); overflow:hidden; padding-block:2px;
}
.day-column .event[style$="--duration:15"] .event-time, .day-column .event[style$="--duration:15"] .event-service, .day-column .event[style$="--duration:30"] .event-service { display:none; }
.day-column .event:focus-visible { z-index:1; }
.tag {
  --tag-fill:#e8eff5; --tag-ink:#274e67; --tag-border:#d4e2ec;
  display:inline-block; max-width:100%; padding:3px 6px; border:1px solid var(--tag-border); border-radius:6px;
  background:var(--tag-fill); color:var(--tag-ink); font-size:10px; font-weight:750; line-height:1.18;
}
.confirmed { --tag-fill:#dcefea; --tag-ink:#1c574e; --tag-border:#c4e1d8; }
.arrived { --tag-fill:#faedcf; --tag-ink:#745111; --tag-border:#efdcad; }
.in_progress { --tag-fill:#eae4f5; --tag-ink:#5b3d7a; --tag-border:#e1d3ef; }
.done { --tag-fill:#edf2ed; --tag-ink:#426348; --tag-border:#dce7dd; }
.cancelled, .no_show { --tag-fill:#faece8; --tag-ink:#863f34; --tag-border:#f0d6d1; }
.multi { --tag-fill:#e4eff0; --tag-ink:#174752; --tag-border:#c7dce0; }
.legend { display:flex; flex-wrap:wrap; gap:5px; padding:10px 12px; }
.flow-head { display:flex; align-items:center; justify-content:space-between; gap:9px; padding:16px 14px 12px; border-bottom:1px solid var(--line); }
.flow-head p { color:var(--muted); font-size:11px; margin-top:4px; }
.day-count { color:var(--deep); background:#e7f1f2; border-radius:7px; padding:4px 8px; font-size:12px; font-weight:780; }
.flow-list { max-height:540px; overflow:auto; }
.flow-row { display:grid; grid-template-columns:37px minmax(0,1fr); align-items:start; gap:7px; width:100%; border:0; border-bottom:1px solid var(--line); background:transparent; padding:10px 12px; text-align:left; }
.flow-row:hover { background:#f3f8f8; }
.flow-time { padding-top:2px; font-size:11px; font-weight:760; color:var(--deep); font-variant-numeric:tabular-nums; }
.flow-row strong, .flow-row small { display:block; font-size:12px; }
.flow-row small { color:var(--muted); font-size:11px; margin:1px 0 4px; }
.flow-link { display:flex; justify-content:space-between; align-items:center; width:100%; color:var(--deep); border:0; border-radius:0 0 var(--radius) var(--radius); padding:10px 12px; text-align:left; background:#f8fbfb; font-weight:700; font-size:12px; }
.flow-link:hover { background:#edf5f6; }
.empty { color:var(--muted); padding:16px 14px; font-size:13px; }
.daily { display:grid; padding:10px 14px; gap:8px; border-block:1px solid var(--line); }
.daily .event { display:grid; grid-template-columns:100px minmax(0,1fr) minmax(0,1fr) max-content; align-items:center; gap:9px; min-height:44px; padding:8px; }
.daily .event > strong, .daily .event-service { font-size:13px; }
.reception-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); border-top:1px solid var(--line); }
.lane { min-width:0; min-height:250px; padding:10px; }
.lane + .lane { border-left:1px solid var(--line); }
.lane h2 { display:flex; justify-content:space-between; align-items:center; gap:3px; font-size:13px; margin:4px 0 11px; }
.lane h2 span { color:var(--muted); font-size:11px; }
.lane .event { width:100%; padding:9px; min-height:72px; margin:0 0 8px; gap:4px; }
.lane .tag { align-self:start; }
.admin-layout { grid-template-columns:minmax(0,1.35fr) minmax(0,1fr); }
.list h2 { padding:14px; border-bottom:1px solid var(--line); }
.user-row, .log-row { padding:10px 14px; border-bottom:1px solid var(--line); min-width:0; }
.user-row:last-child, .log-row:last-child { border-bottom:0; }
.user-row { display:grid; grid-template-columns:minmax(0,1fr) max-content max-content; align-items:center; gap:7px; }
.user-row .plain { font-size:12px; min-height:32px; padding:5px 8px; }
.list small { display:block; color:var(--muted); overflow-wrap:anywhere; }
.foot { display:flex; align-items:center; gap:6px; color:var(--muted); font-size:11px; margin:19px 0 0; }
.foot .icon { width:13px; height:13px; }
#drawer { position:fixed; inset:0 0 0 auto; margin:0; padding:0; width:min(100%,435px); max-width:100%; height:100dvh; max-height:100dvh; border:none; box-shadow:-16px 0 55px #0002; color:var(--ink); background:#fff; }
#drawer[open] { animation:sheet-reveal 280ms cubic-bezier(.16,1,.3,1) both; }
#drawer::backdrop { background:#1c353d66; }
@keyframes sheet-reveal {
  from { clip-path:polygon(100% 0,100% 0,100% 100%,82% 100%); }
  to { clip-path:polygon(0 0,100% 0,100% 100%,0 100%); }
}
.drawer-head { display:flex; justify-content:space-between; align-items:center; gap:9px; padding:16px 21px; border-bottom:1px solid var(--line); }
.drawer-head h2 { font-size:20px; }
.drawer-content { padding:20px 21px; display:grid; gap:14px; }
.drawer-content > .tag { justify-self:start; font-size:12px; }
.drawer-content .two { display:grid; grid-template-columns:1fr 1fr; gap:9px; }
.drawer-actions { display:flex; align-items:center; flex-wrap:wrap; gap:7px; border-top:1px solid var(--line); padding-top:12px; }
.detail-service { color:var(--muted); }
.detail-grid { display:grid; grid-template-columns:1fr 1fr; gap:13px; margin:0; }
.detail-grid div:first-child { grid-column:1/-1; }
.detail-grid dt { color:var(--muted); font-size:12px; }
.detail-grid dd { margin:3px 0 0; font-weight:650; }
form label { display:grid; gap:6px; font-weight:650; font-size:13px; }
form input, form select { width:100%; min-width:0; min-height:42px; padding:9px; border:1px solid #bdcdd1; border-radius:7px; background:#fff; }
.form-hint { color:var(--muted); font-size:13px; }
.form-error { color:#8c3228; font-size:13px; }
.form-error:empty { display:none; }
#notice:not(:empty) { position:fixed; z-index:5; bottom:20px; right:20px; max-width:min(360px,calc(100% - 40px)); background:#164650; color:#fff; border-radius:8px; padding:11px 15px; }
.sign-in { min-height:100dvh; display:grid; grid-template-columns:minmax(360px, .95fr) 1fr; }
.sign-card { align-self:center; justify-self:center; width:min(420px,calc(100% - 48px)); padding:30px 0; }
.sign-copy { margin:43px 0 24px; }
.sign-copy p { margin-top:10px; color:var(--muted); }
.sign-card form { display:grid; gap:13px; }
.sign-card form button { margin-top:4px; justify-content:space-between; }
.demo-note { margin-top:19px; color:var(--muted); font-size:12px; }
.demo-note .icon { width:15px; height:15px; }
.sign-art { display:grid; place-items:center; background:#174752; }
.sign-art svg { width:min(74%,470px); }
@media (max-width:1170px) {
  .agenda-layout { grid-template-columns:minmax(0,1fr); }
  .flow-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(168px,1fr)); max-height:none; }
  .flow-row:not(:last-child) { border-right:1px solid var(--line); }
}
@media (max-width:830px) {
  .shell { grid-template-columns:minmax(0,1fr); }
  .rail { position:static; height:auto; display:grid; grid-template-columns:1fr auto; gap:10px; padding:10px 14px 0; border:0; border-bottom:1px solid var(--line); }
  .rail nav { grid-row:2; grid-column:1/-1; display:flex; margin:0; overflow:auto; }
  .rail-person { margin:0; border:0; padding:0; }
  .rail-person div { display:none; }
  .nav-button { gap:5px; min-height:38px; padding:6px 8px; border-radius:6px 6px 0 0; font-size:13px; }
  .top { min-height:45px; }
  .content { padding-top:19px; }
  .page-head { margin-bottom:16px; }
  .reception-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .lane { min-height:150px; }
  .lane:nth-child(3) { border-left:0; }
  .lane:nth-child(n+3) { border-top:1px solid var(--line); }
}
@media (max-width:550px) {
  .sign-in { grid-template-columns:1fr; min-height:100svh; }
  .sign-art { display:none; }
  .sign-copy { margin-top:30px; }
  .page-head { flex-direction:column; align-items:flex-start; gap:11px; }
  .page-head p { margin-top:5px; font-size:13px; }
  .toolbar { gap:6px; }
  .switch { margin-left:0; }
  .daily .event { grid-template-columns:minmax(0,1fr) max-content; }
  .daily .event .event-time, .daily .event .event-service { grid-column:1; }
  .daily .event .tag { grid-column:2; grid-row:1; }
  .admin-layout { grid-template-columns:1fr; }
  .flow-list { grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); }
}
@media (prefers-reduced-motion:reduce) {
  #drawer[open] { animation:none; }
}
.demo-controls {
  padding:9px clamp(18px,3vw,48px); border-bottom:1px solid var(--line);
  display:flex; align-items:center; gap:8px 13px; flex-wrap:wrap; background:#edf4f4;
}
.demo-controls p { color:var(--muted); font-size:12px; }
.sign-card a.primary { text-decoration:none; }
.clinical-layout { display:grid; grid-template-columns:minmax(230px,.82fr) minmax(0,2fr); gap:15px; align-items:start; }
.clinical-list h2, .clinical-history header { padding:15px 17px; border-bottom:1px solid var(--line); }
.clinical-list ul, .clinical-history ol { list-style:none; margin:0; padding:0; }
.clinical-list ul { max-height:min(530px,64dvh); overflow:auto; }
.clinical-list li + li, .clinical-history li + li { border-top:1px solid var(--line); }
.patient-choice { width:100%; min-height:58px; padding:10px 16px; display:flex; align-items:center; justify-content:space-between; gap:8px; border:0; background:transparent; text-align:left; }
.patient-choice:hover { background:#f3f8f8; }
.patient-choice[aria-pressed=true] { background:#eaf4f4; color:var(--deep); }
.patient-choice:focus-visible { outline-offset:-3px; }
.patient-choice strong, .patient-choice small, .clinical-history time, .clinical-history strong, .clinical-history small { display:block; }
.patient-choice small, .clinical-history small, .clinical-history header p { color:var(--muted); font-size:.875rem; }
.clinical-history header h2 { font-size:1.2rem; margin-bottom:4px; }
.clinical-history li { padding:14px 17px; display:grid; grid-template-columns:minmax(0,1fr) auto auto; align-items:center; gap:12px; }
.clinical-history time { font-size:.875rem; font-variant-numeric:tabular-nums; color:var(--deep); margin-bottom:2px; }
.clinical-history .tag, .note-meta .tag, .patient-choice .tag { font-size:.75rem; }
.neutral { --tag-fill:#eff3f4; --tag-ink:#42565e; --tag-border:#dbe5e7; }
.clinical-when { font-size:.9rem; color:var(--muted); }
.note-meta { display:flex; gap:8px; align-items:center; flex-wrap:wrap; color:var(--muted); font-size:.82rem; }
.clinical-warning { background:#faf3ed; color:#753e24; border:1px solid #e9d9ce; border-radius:8px; padding:10px 12px; font-size:.875rem; }
#evolution-form .example-note { justify-self:start; font-size:.875rem; }
#evolution-form textarea, #patient-form textarea { width:100%; min-height:80px; resize:vertical; padding:8px; border:1px solid #bdcdd1; border-radius:7px; font:inherit; font-weight:450; caret-color:var(--focus); color:var(--ink); }
#evolution-form label { font-size:.9375rem; }
#evolution-form .fictional-check, #patient-form .fictional-check { display:flex; gap:8px; align-items:center; font-size:.875rem; }
#evolution-form input[type=checkbox], #patient-form input[type=checkbox] { width:18px; height:18px; min-height:0; margin:0; accent-color:var(--deep); flex:none; }
.note-read { margin:0; }
.note-read dt { border-top:1px solid var(--line); padding-top:10px; font-weight:700; }
.note-read dd { margin:5px 0 13px; color:var(--muted); white-space:pre-wrap; overflow-wrap:anywhere; }
.clinical-history li.history-visit { grid-template-columns:minmax(0,1fr); align-items:start; gap:11px; }
.visit-records { display:flex; flex-wrap:wrap; gap:7px; }
.visit-records .record-button { justify-content:flex-start; flex-wrap:wrap; white-space:normal; font-size:.875rem; text-align:left; }
.agenda-records h3 { margin:0 0 8px; font-size:1rem; }
.form-answers, .preview-paper { display:grid; gap:13px; }
.answer-field { min-width:0; }
.answer-field[hidden] { display:none; }
.answer-field label { font-size:.9375rem; }
.answer-field > label { display:block; margin-bottom:5px; font-weight:670; }
.required-label, .field-help { color:var(--muted); font-size:.84rem; font-weight:450; }
.field-help { display:block; margin-top:4px; }
.choice-set { min-width:0; border:1px solid var(--line); border-radius:8px; padding:6px 9px; margin:0; }
.choice-set legend { font-weight:670; }
.choice-set label, .toggle-check { display:flex; align-items:center; gap:7px; font-weight:550; min-height:31px; }
.choice-set input[type="checkbox"], .toggle-check input[type="checkbox"] { flex:none; min-width:0; width:17px; height:17px; min-height:0; margin:0; accent-color:var(--deep); }
.answer-field h3, .drawer-content > h3 { margin:7px 0 0; padding-top:8px; border-top:1px solid var(--line); font-size:1rem; }
.saved-model { padding:10px 12px; border:1px solid var(--line); border-radius:8px; background:#f4f8f8; display:grid; gap:3px; }
.saved-model small, .saved-model p { color:var(--muted); font-size:.875rem; }
.builder-tabs { display:flex; flex-wrap:wrap; gap:7px; margin-bottom:14px; }
.builder-tabs [aria-pressed="true"] { color:var(--deep); background:#e3eff0; border-color:#bbd4d8; }
.builder-layout { display:grid; grid-template-columns:minmax(205px,.64fr) minmax(0,2fr); gap:14px; align-items:start; }
.model-catalog header, .model-work header { padding:13px 15px; border-bottom:1px solid var(--line); }
.model-catalog header, .model-edit > header { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:8px; }
.model-catalog ul { list-style:none; padding:0; margin:0; max-height:60vh; overflow:auto; }
.model-catalog li + li { border-top:1px solid var(--line); }
.model-work { min-width:0; display:grid; grid-template-columns:minmax(0,1.25fr) minmax(210px,.85fr); gap:14px; align-items:start; }
.model-work header p { color:var(--muted); font-size:.875rem; margin-top:4px; }
.model-config, .preview-paper { display:grid; gap:12px; padding:14px; min-width:0; }
.model-config textarea, .preview-paper textarea, .preview-paper input:not([type="checkbox"]), .preview-paper select { width:100%; min-width:0; border:1px solid #bdcdd1; border-radius:7px; font:inherit; padding:7px; background:white; color:var(--ink); }
.model-config textarea, .preview-paper textarea { resize:vertical; }
.model-config .toggle-check { display:flex; }
.builder-field-head { display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; gap:5px; }
.builder-field-head h3, .preview-paper h3 { margin:0; font-size:1rem; overflow-wrap:anywhere; }
.builder-field-head small { color:var(--muted); }
.builder-field { border:1px solid var(--line); border-radius:8px; background:#fbfcfc; }
.builder-field summary { cursor:pointer; display:list-item; padding:9px 11px; }
.builder-field summary strong { overflow-wrap:anywhere; }
.builder-field summary span { color:var(--muted); font-size:.82rem; margin-left:7px; }
.field-config { display:grid; gap:10px; padding:10px; border-top:1px solid var(--line); }
.field-grid, .field-actions { display:flex; flex-wrap:wrap; gap:8px; }
.field-grid > label { flex:1 1 135px; }
.field-actions button { font-size:.84rem; padding:6px 8px; min-height:32px; }
.model-config > [data-action="field-add"] { justify-self:start; }
.model-preview { position:sticky; top:12px; }
.preview-paper { background:#f6f9f9; border-radius:0 0 var(--radius) var(--radius); }
.preview-paper .choice-set label { display:flex; }
.registration-builder { grid-template-columns:minmax(0,1fr); }
.page-actions { display:flex; flex-wrap:wrap; gap:7px; }
.registry-toolbar { align-items:end; }
.registry-search { display:grid; gap:4px; min-width:min(230px,100%); font-size:.84rem; font-weight:650; color:var(--muted); }
.registry-search input { min-height:39px; width:100%; min-width:0; border:1px solid var(--line); background:#fff; border-radius:8px; color:var(--ink); padding:6px 10px; font-size:.95rem; }
.registry-list header { display:flex; flex-wrap:wrap; gap:6px 14px; align-items:baseline; justify-content:space-between; padding:13px 15px; border-bottom:1px solid var(--line); }
.registry-list header p, .registry-list small { color:var(--muted); font-size:.875rem; }
.registry-list ol { list-style:none; padding:0; margin:0; }
.registry-list li { display:grid; grid-template-columns:minmax(0,1fr) 70px auto; align-items:center; gap:9px; padding:11px 15px; }
.registry-list li[hidden] { display:none; }
.registry-list li + li { border-top:1px solid var(--line); }
.registry-list strong, .registry-list small { display:block; }
.registry-list li .tag { justify-self:start; }
.registry-row-actions { display:flex; flex-wrap:wrap; gap:6px; }
.registry-row-actions button { font-size:.875rem; }
.registry-id div:first-child { grid-column:auto; }
[data-patient-results]:empty { display:none; }
.series-info { background:#eef5f5; border-radius:8px; color:var(--deep); font-size:.88rem; padding:9px 10px; }
#appointment-form .repeat-toggle { display:flex; align-items:flex-start; gap:9px; border-top:1px solid var(--line); padding:10px 0 0; font-size:.93rem; }
.repeat-toggle small { display:block; color:var(--muted); font-size:.84rem; font-weight:450; margin-top:3px; }
#appointment-form input[type=checkbox] { width:17px; height:17px; margin:2px 0 0; min-height:0; flex:none; accent-color:var(--deep); }
.weekly-settings { min-width:0; display:grid; gap:11px; border:1px solid var(--line); padding:9px; margin:0; border-radius:8px; }
.weekly-settings legend { padding:0 4px; font-weight:680; font-size:.9rem; }
.weekday-list { display:grid; gap:5px; }
.weekday-row { border:1px solid var(--line); border-radius:6px; padding:6px 8px; background:#fbfdfd; }
.weekday-row:has(input:checked) { background:#edf6f7; border-color:#c7dade; }
#appointment-form .week-select { display:flex; align-items:center; gap:8px; min-height:27px; }
.week-times { margin-top:6px; }
.week-times label { font-size:.83rem; color:var(--muted); }
.weekly-settings[hidden], .week-times[hidden], [data-single-time][hidden] { display:none; }
.repeat-count { color:var(--deep); font-size:.88rem; font-weight:650; min-height:1.15em; }
.series-scope { border:1px solid var(--line); border-radius:8px; padding:8px 10px; margin:0; min-width:0; }
.series-scope legend { color:var(--deep); font-weight:700; padding:0 5px; font-size:.92rem; }
form .series-scope label { display:flex; flex-wrap:wrap; align-items:center; gap:8px; min-height:34px; font-size:.9rem; }
form .series-scope input[type=radio] { width:17px; height:17px; min-height:0; margin:0; flex:none; accent-color:var(--deep); }
.series-scope .form-hint { padding:5px 0; }
.agenda-observation { width:100%; min-height:75px; resize:vertical; background:white; color:var(--ink); padding:8px; border:1px solid #bdcdd1; border-radius:7px; font:inherit; font-weight:450; }
.schedule-note { margin:0; background:#f4f8f8; border:1px solid var(--line); border-radius:8px; padding:10px; }
.schedule-note dt { font-weight:700; }
.schedule-note dd { white-space:pre-wrap; overflow-wrap:anywhere; margin:4px 0 0; color:var(--muted); }
.settings-back { margin-bottom:12px; }
.config-list ul, .audit-list ol { list-style:none; margin:0; padding:0; }
.config-list li+li, .audit-list li+li { border-top:1px solid var(--line); }
.config-list button { display:flex; align-items:center; gap:14px; min-height:63px; width:100%; padding:12px 15px; background:transparent; border:0; text-align:left; }
.config-list button:hover { background:#eef5f5; }
.config-list button:focus-visible { outline-offset:-3px; }
.config-list small, .audit-list small { display:block; color:var(--muted); font-size:.875rem; }
.audit-list header, .audit-pagination { display:flex; justify-content:space-between; flex-wrap:wrap; gap:9px; align-items:center; padding:12px 15px; }
.audit-list header { border-bottom:1px solid var(--line); }
.audit-list header p, .audit-pagination span { color:var(--muted); font-size:.875rem; }
.audit-list li { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(0,.7fr) max-content; gap:10px; padding:10px 15px; align-items:start; overflow-wrap:anywhere; }
.audit-list time { color:var(--muted); font-variant-numeric:tabular-nums; font-size:.875rem; }
.audit-pagination { justify-content:center; border-top:1px solid var(--line); }
@media (max-width:640px) {
  .audit-list li { grid-template-columns:minmax(0,1fr) max-content; }
  .audit-list li>div:first-child { grid-column:1/-1; }
}
@media (max-width:620px) {
  .registry-list li { grid-template-columns:minmax(0,1fr) auto; }
  .registry-row-actions { grid-column:1/-1; }
}
@media (max-width:1210px) {
  .model-work { grid-template-columns:minmax(0,1fr); }
  .model-preview { position:static; }
}
@media (max-width:670px) {
  .builder-layout { grid-template-columns:minmax(0,1fr); }
  .model-catalog ul { max-height:230px; }
}
@media (max-width:630px) {
  .clinical-layout { grid-template-columns:minmax(0,1fr); }
  .clinical-list ul { max-height:238px; }
  .clinical-history li { grid-template-columns:minmax(0,1fr) auto; gap:7px; }
  .clinical-history li button { grid-column:1 / -1; justify-self:start; }
}
