:root {
  --forest: #185f55;
  --forest-dark: #0d453f;
  --sage: #dce8df;
  --ivory: #fbf8f2;
  --champagne: #d8bf91;
  --ink: #26332f;
  --muted: #68746f;
  --line: #dfe5e1;
  --white: #fff;
  --danger: #8c2d21;
  --sand: #f2eadb;
  --sand-ink: #55452b;
  /* Body map of the patient funnel (OUT-20261013-body-map): the clinic designer's palette. */
  --bm-fill: #f4efe9;
  --bm-line: #5b5149;
  --bm-detail: #a89a8e;
  --bm-mid: #b9aea4;
  --bm-ink: #4a413a;
  --bm-muted: #6b6058;
  --bm-soft: #ece5dd;
  --bm-accent: #b4442c;
  --bm-ring: #8a7c70;
  --bm-font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* Patient area (OUT-20261018-visual-batch-2): heading ink of the public site. */
  --patient-heading: #063f3b;
  /* Protocol editor (OUT-20261020-protocol-flow): the red of a point on an image; 6.3:1 on --bm-fill. */
  --protocol-point: #d3261a;
  /* Old versions (OUT-20261029-old-version-zoom): changed points; 4.9:1 on white, the soft fill is decoration. */
  --protocol-changed: #a16207;
  --protocol-changed-soft: #fef3c7;
  /* Space scale (OUT-20261018-compact-patient): the same values as apps/public tokens.css; used by the
     patient screens only (patient.css). The panel keeps its own literal spacing. */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  font-family: Manrope, Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: #f4f6f4; }
a { color: inherit; }
button { font: inherit; }
.button { font: inherit; display: inline-flex; min-height: 46px; align-items: center; justify-content: center; padding: 0 20px; border: 0; border-radius: 14px; text-decoration: none; font-weight: 750; cursor: pointer; }
.eyebrow { margin: 0 0 8px; color: var(--forest); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.brand-mark { display: grid; width: 64px; height: 64px; place-items: center; border-radius: 50%; background: var(--forest); color: var(--ivory); font-size: 32px; font-weight: 800; }
.brand-mark-small { width: 42px; height: 42px; font-size: 21px; }
.button-primary { background: var(--forest); color: white; box-shadow: 0 8px 18px rgb(24 95 85 / 20%); }
.button-wide { width: 100%; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top right, var(--sage), transparent 42%), var(--ivory); }
.login-card { width: min(440px, 100%); padding: 48px; border: 1px solid rgb(24 95 85 / 12%); border-radius: 28px; background: rgb(255 255 255 / 88%); box-shadow: 0 28px 70px rgb(13 69 63 / 12%); }
.login-card h1 { margin: 0; font-size: clamp(32px, 5vw, 44px); line-height: 1.05; }
.login-card .brand-mark { margin-bottom: 30px; }
.login-copy { margin: 16px 0 32px; color: var(--muted); line-height: 1.6; }
.security-note { margin: 20px 0 0; color: var(--muted); font-size: 13px; text-align: center; }
.oauth-confirmation { position: relative; overflow: hidden; }
.oauth-confirmation::before { position: absolute; top: 0; right: 0; left: 0; height: 7px; background: linear-gradient(90deg, var(--forest-dark), var(--forest), var(--champagne)); content: ""; }
.oauth-back-link { display: block; margin-top: 20px; color: var(--forest); font-size: 14px; font-weight: 700; text-align: center; text-decoration: none; }
.logout-page-card { text-align: center; }
.logout-page-card .brand-mark { margin-inline: auto; }
.logout-page-actions, .logout-dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 240px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 16px 6px; background: var(--forest-dark); color: var(--ivory); }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 0 12px; text-decoration: none; }
.sidebar-brand small { display: block; margin-top: 3px; color: rgb(255 255 255 / 60%); }
.sidebar nav { display: grid; gap: 4px; }
.nav-item { display: flex; min-height: 44px; align-items: center; gap: 12px; padding: 4px 12px; border-radius: 12px; color: rgb(255 255 255 / 72%); text-decoration: none; font-weight: 650; line-height: 1.2; }
.nav-item.active { background: rgb(255 255 255 / 12%); color: white; }
.nav-item.disabled { opacity: .45; }
.sidebar-footer { margin-top: auto; padding: 8px 6px 0; color: rgb(255 255 255 / 62%); font-size: 13px; }
.workspace { min-width: 0; padding: 32px clamp(22px, 4vw, 58px) 48px; }
.preview-banner { margin: -32px calc(clamp(22px, 4vw, 58px) * -1) 26px; padding: 9px 22px; background: var(--champagne); color: #3c3323; font-size: 13px; font-weight: 700; text-align: center; }
.workspace-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.workspace-header h1 { margin: 0; font-size: clamp(36px, 4vw, 54px); line-height: 1; }
.toolbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; margin: 34px 0 18px; }
.toolbar h2 { margin: 0; font-size: 18px; }
.date-navigation { display: flex; gap: 4px; }
.view-switch { display: flex; gap: 4px; justify-self: end; }
.view-switch a { display: inline-flex; min-width: 38px; height: 38px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); text-decoration: none; cursor: pointer; width: auto; padding: 0 12px; }
.date-navigation a { min-width: 38px; height: 38px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); text-decoration: none; cursor: pointer; display: grid; place-items: center; font-size: 24px; }
.date-navigation .today-link { padding: 0 12px; font-size: 14px; font-weight: 700; }
.view-switch .selected { border-color: var(--forest); background: var(--sage); color: var(--forest-dark); font-weight: 700; }
.calendar-card { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: 0 12px 32px rgb(18 67 60 / 7%); }
.calendar-grid { display: grid; grid-template-columns: 74px repeat(var(--day-count, 5), minmax(110px, 1fr)); }
.calendar-header { border-bottom: 1px solid var(--line); }
.day-heading { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 72px; border-left: 1px solid var(--line); }
.day-heading span { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.day-heading strong { font-size: 20px; }
.day-heading.today strong { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 50%; background: var(--forest); color: white; }
.calendar-body { position: relative; height: 620px; overflow: auto; }
.calendar-lines { min-height: 888px; }
.time-labels { display: grid; grid-template-rows: repeat(12, 74px); color: var(--muted); font-size: 11px; text-align: center; }
.time-labels span { transform: translateY(-7px); }
.day-column { border-left: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0, transparent 73px, var(--line) 74px); }
.today-column { background-color: rgb(220 232 223 / 28%); }
.calendar-entry { position: absolute; z-index: 2; top: var(--top); left: calc(74px + (100% - 74px) / var(--day-count, 5) * var(--day-index) + 5px); width: calc((100% - 74px) / var(--day-count, 5) - 10px); height: var(--height); padding: 10px 12px; overflow: hidden; border-left: 4px solid var(--forest); border-radius: 10px; background: var(--sage); color: var(--forest-dark); box-shadow: 0 4px 10px rgb(13 69 63 / 10%); }
.calendar-entry strong { display: block; font-size: 12px; }
.calendar-entry span { display: block; font-size: 12px; margin-top: 5px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.calendar-entry small { display: block; margin-top: 3px; font-size: 10px; opacity: .8; }
.calendar-entry.block-entry { border-color: #a98a53; background: var(--sand); color: var(--sand-ink); }
.calendar-entry > a { position: absolute; inset: 0; }
.month-card { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: 0 12px 32px rgb(18 67 60 / 7%); }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month-weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); background: var(--ivory); }
.month-weekdays span { padding: 13px 8px; color: var(--muted); font-size: 12px; font-weight: 800; text-align: center; text-transform: uppercase; }
.month-day { min-height: 126px; padding: 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.month-day:nth-child(7n) { border-right: 0; }
.month-day-number { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; font-size: 13px; font-weight: 800; text-decoration: none; }
.month-day.today .month-day-number { background: var(--forest); color: white; }
.outside-month { background: #f8f7f2; color: #a5aaa6; }
.month-entries { display: grid; gap: 4px; margin-top: 7px; }
.month-entries a { padding: 5px 7px; overflow: hidden; border-radius: 6px; background: var(--sage); color: var(--forest-dark); font-size: 11px; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.month-entries small { display: block; margin-top: 2px; }
.messages { margin: 22px 0 -12px; padding: 1px 16px; border: 1px solid #b9d2c6; border-radius: 12px; background: #edf5f0; color: var(--forest-dark); }
.agenda-tools { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(220px, .7fr) auto; align-items: end; gap: 16px; margin-bottom: 18px; }
.agenda-tools label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 750; }
.agenda-tools form > div { display: flex; gap: 7px; }
.agenda-tools input { min-width: 0; width: 100%; min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; }
.button-secondary { min-height: 44px; border: 1px solid var(--forest); background: white; color: var(--forest); }

.form-page { min-height: 100vh; padding: 36px 20px; background: radial-gradient(circle at top right, var(--sage), transparent 35%), var(--ivory); }
.form-card { width: min(620px, 100%); margin: 0 auto; padding: clamp(26px, 5vw, 48px); border: 1px solid rgb(24 95 85 / 12%); border-radius: 24px; background: white; box-shadow: 0 22px 60px rgb(13 69 63 / 10%); }
.form-card h1 { margin: 0 0 26px; font-size: clamp(32px, 5vw, 46px); }
.back-link { display: inline-block; margin-bottom: 30px; color: var(--forest); font-size: 14px; font-weight: 700; text-decoration: none; }
.form-card form > div { margin-bottom: 18px; }
.form-card label { display: block; margin-bottom: 7px; font-size: 14px; font-weight: 750; }
.form-card input, .form-card select, .protocol-title-field input { width: 100%; min-height: 48px; padding: 0 13px; border: 1px solid #cbd5d0; border-radius: 11px; background: white; color: var(--ink); font: inherit; }
.form-card textarea { border: 1px solid #cbd5d0; border-radius: 11px; background: white; color: var(--ink); font: inherit; width: 100%; max-width: 100%; min-height: 110px; padding: 12px 13px; box-sizing: border-box; resize: vertical; }
.datetime-parts { display: grid; grid-template-columns: minmax(0, 2fr) minmax(90px, .7fr) minmax(90px, .7fr); gap: 10px; }
.datetime-part span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.conditional-fields { margin: -6px 0 20px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--ivory); }
.conditional-fields[hidden] { display: none; }
.conditional-fields > div { margin-bottom: 18px; }
.conditional-fields > div:last-child { margin-bottom: 0; }
.form-card input:focus, .form-card select:focus, .form-card textarea:focus, .protocol-title-field input:focus { border-color: var(--forest); outline: 3px solid rgb(24 95 85 / 12%); }
.form-card .sex-fieldset { min-width: 0; margin: 0 0 14px; padding: 0; border: 0; }
.form-card .sex-fieldset legend { margin-bottom: 8px; padding: 0; font-weight: 700; }
.form-card .sex-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.form-card .sex-options > div { min-width: 0; margin: 0; }
.form-card .sex-options label { display: flex; min-height: 52px; align-items: center; gap: 11px; margin: 0; padding: 10px 14px; border: 1px solid #cbd5d0; border-radius: 999px; background: white; cursor: pointer; }
.form-card .sex-options input { width: 22px; min-height: 22px; margin: 0; padding: 0; accent-color: var(--forest); }
.form-card .sex-options label:has(input:checked) { border-color: var(--forest); background: var(--sage); color: var(--forest-dark); box-shadow: 0 0 0 2px rgb(24 95 85 / 10%); }
.form-card .sex-options label:has(input:focus-visible) { outline: 3px solid rgb(24 95 85 / 20%); outline-offset: 2px; }
@media (max-width: 360px) {
  .form-card .sex-options { grid-template-columns: minmax(0, 1fr); }
}
.errorlist { margin: 0 0 7px; padding: 10px 14px; border-radius: 9px; background: #fff0ed; color: var(--danger); font-size: 13px; list-style: none; }
.errorlist a { color: var(--danger); font-weight: 700; text-decoration: underline; overflow-wrap: anywhere; }
.errorlist .duplicate-links { margin: 4px 0 0; padding: 0; list-style: none; }
.errorlist .duplicate-links a { display: inline-flex; min-height: 44px; align-items: center; }
.errorlist a:focus-visible { outline: 3px solid var(--forest); outline-offset: 2px; }
.danger-zone { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); text-align: center; }
.danger-zone button { border: 0; background: transparent; color: #9d3328; font: inherit; font-weight: 700; cursor: pointer; }
.danger-zone form { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 12px; margin: 10px 0; text-align: left; }
.danger-zone label { margin: 0; font-weight: 500; }
.danger-zone input { width: auto; min-height: auto; }
.recurrence-note { padding: 10px 13px; border-radius: 10px; background: var(--sage); color: var(--forest-dark); font-weight: 700; }
.status-actions { display: flex; justify-content: center; gap: 18px; margin-top: 22px; }
.trash-row { display: flex; align-items: center; justify-content: space-between; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.trash-row small { display: block; margin-top: 4px; color: var(--muted); }
.muted-copy { margin: -12px 0 28px; color: var(--muted); }
.patient-card { width: min(760px, 100%); }
.patient-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.patient-list-heading h1 { margin: 0; }
.patient-list-heading .button { flex-shrink: 0; }
.patient-list { display: grid; gap: 8px; }
.patient-row { display: flex; box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%; align-items: center; justify-content: space-between; gap: 20px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.patient-row:hover { border-color: var(--forest); background: var(--ivory); }
.patient-row-details { min-width: 0; flex: 1; color: inherit; text-decoration: none; }
.patient-row-details:hover strong { color: var(--forest-dark); text-decoration: underline; text-underline-offset: 3px; }
.patient-row .whatsapp-link { flex: 0 0 auto; }
.whatsapp-link-unavailable { background: #eef2ef; color: var(--muted); cursor: not-allowed; }
.patient-card .patient-row { flex-wrap: wrap; gap: 6px 20px; overflow-wrap: anywhere; }
.patient-list span { color: var(--muted); }
.patient-row small { display: block; margin-top: 4px; color: var(--muted); }
.patient-list .patient-mark { display: inline-block; margin: 6px 8px 0 0; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--ivory); color: var(--forest-dark); font-size: 13px; font-weight: 750; line-height: 1.4; }
.patient-list .patient-mark-hint { background: var(--sand); color: var(--sand-ink); }
.portal-facts { margin: 0 0 22px; }
.login-email-row { grid-column: 1 / -1; }
.login-email-row dd { overflow-wrap: anywhere; }
.login-email-state { display: block; color: var(--muted); font-size: 13px; }
.login-email-change { display: inline-flex; min-height: 44px; align-items: center; color: var(--forest); font-weight: 700; }
.portal-form { display: grid; gap: 12px; margin-top: 12px; }
.portal-form .button { min-height: 48px; }
.portal-form select { min-height: 48px; }
.secondary-link { display: inline-block; margin-top: 28px; color: var(--forest); font-weight: 700; }
.patient-phone { margin: -14px 0 22px; color: var(--muted); font-size: 19px; }
.status-pill { display: inline-block; margin: 0 0 22px; padding: 6px 10px; border-radius: 999px; background: var(--sand); color: var(--sand-ink); font-size: 13px; font-weight: 750; }
.action-row { display: flex; gap: 10px; }
.action-row .button { min-height: 48px; padding-block: 8px; }
@media (max-width: 480px) {
  .action-row { flex-direction: column; }
  .action-row .button { width: 100%; }
}
.history-section { margin-top: 38px; }
.history-section h2 { font-size: 22px; }
.history-list { display: grid; gap: 8px; }
.history-list .history-static { display: flex; justify-content: space-between; padding: 14px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; min-height: 48px; align-items: center; gap: 12px; }
.history-list a { display: flex; justify-content: space-between; padding: 14px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; min-height: 48px; align-items: center; gap: 12px; }
.history-list span { color: var(--muted); }
.split-actions { display: flex; justify-content: space-between; gap: 18px; }
.text-button { border: 0; background: transparent; color: var(--forest); font: inherit; font-weight: 750; cursor: pointer; }
.preview-note { margin: 0 0 22px; padding: 11px 14px; border-radius: 10px; background: var(--sand); color: var(--sand-ink); font-size: 0.8125rem; font-weight: 700; }
.patient-phone-nowrap { white-space: nowrap; }
.button:disabled { cursor: not-allowed; opacity: .55; }
/* Busy submit (js/busy.js): same colours and size as the button, a ring before the label and the
   waiting cursor; the button is not disabled (a disabled submitter would not send its value). */
.is-busy, .is-busy:hover { cursor: wait; }
.is-busy::before { content: ""; display: inline-block; box-sizing: border-box; flex: none; vertical-align: -.15em; width: 1em; height: 1em; margin-right: .5em; border: .15em solid currentColor; border-right-color: transparent; border-radius: 50%; animation: busy-spin .8s linear infinite; }
@keyframes busy-spin { to { transform: rotate(360deg); } }
/* Reduced motion: the ring stays, still (a "…" in ::after would change the button's name). */
@media (prefers-reduced-motion: reduce) {
  .is-busy, .is-busy::before { animation: none; }
}

@media (max-width: 820px) {
  .datetime-parts { grid-template-columns: 1fr; }
  .app-shell { grid-template-columns: 1fr; align-content: start; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; padding: 14px 18px; }
  .sidebar-brand { padding: 0; }
  .sidebar nav { display: flex; margin-left: auto; }
  .sidebar-footer { display: none; }
  .sidebar nav { gap: 4px; }
  .sidebar { flex-wrap: wrap; row-gap: 8px; }
  .sidebar nav { flex-wrap: wrap; min-width: 0; max-width: 100%; }
  .nav-item { min-height: 44px; min-width: max-content; padding-inline: 14px; }
  .nav-item span, .nav-item.disabled { display: none; }
  .workspace { padding: 24px 16px 36px; }
  .preview-banner { margin: -24px -16px 22px; }
  .toolbar { grid-template-columns: 1fr auto; }
  .toolbar h2 { grid-column: 1 / -1; grid-row: 1; text-align: center; }
  .view-switch { display: none; }
  .agenda-tools { grid-template-columns: 1fr; }
  .calendar-card { overflow-x: auto; }
  .calendar-grid, .calendar-body { min-width: 760px; }
  .workspace-header .button { min-width: 46px; padding: 0 14px; font-size: 0; }
  .workspace-header .button::after { content: "+"; font-size: 24px; }
  .month-card { overflow-x: auto; }
  .month-weekdays, .month-grid { min-width: 760px; }
}

@media (max-width: 420px) {
  .sidebar { flex-wrap: wrap; padding: 12px 10px; }
  .sidebar nav { width: 100%; margin-left: 0; justify-content: space-between; }
  .sidebar nav { flex-wrap: wrap; }
  .nav-item { flex: 1 1 auto; min-width: max-content; justify-content: center; }
  .sidebar-brand > span:last-child { display: none; }
  .sidebar nav { gap: 2px; }
  .nav-item { padding-inline: 4px; font-size: 13px; }
  .workspace-header { align-items: center; }
  .patient-card { padding-inline: 18px; }
  .patient-list-heading { align-items: center; gap: 8px; }
  .patient-list-heading h1 { min-width: 0; font-size: 28px; }
  .patient-list-heading .button { min-height: 44px; padding-inline: 10px; font-size: 13px; }
}

/* Compact date picker and readable daily schedule. */
.daily-agenda-page { background: var(--ivory); }
.daily-agenda-page .workspace { padding-top: 28px; }
.daily-agenda-page .workspace-header h1 { font-size: 36px; }
.agenda-create-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.agenda-create-actions .button { font-size: 14px; border-radius: 11px; box-shadow: none; }
.daily-agenda-page .messages { margin: 20px 0; }
.mini-calendar { width: min(380px, 100%); margin: 30px auto; padding: 14px; border: 1px solid #ded6c6; border-radius: 16px; background: white; box-shadow: 0 2px 4px #24383008; }
.mini-calendar-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.mini-calendar-heading h2 { margin: 0; font-size: 15px; font-weight: 650; text-transform: capitalize; }
.calendar-arrow { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 9px; font-size: 24px; text-decoration: none; color: var(--muted); }
.calendar-arrow:hover { background: var(--ivory); }
.mini-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.mini-weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; margin-bottom: 7px; color: var(--muted); font-size: 10px; text-align: center; text-transform: uppercase; }
.mini-day { display: grid; place-items: center; min-height: 41px; border: 1px solid transparent; border-radius: 10px; text-decoration: none; font-size: 13px; font-weight: 550; }
.mini-day.past-day { color: #747b79; background: #f6f5f2; }
.mini-day.other-month { color: #8b918d; }
.mini-day:hover { background: var(--sage); color: var(--forest-dark); }
.mini-day.is-today { border-color: var(--forest); color: var(--forest-dark); }
.mini-day.is-selected { background: var(--forest); color: white; border-color: var(--forest); font-weight: 750; box-shadow: 0 2px 5px #185f5530; }
.mini-calendar-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; }
.mini-calendar-footer .button { min-height: 38px; padding: 0 13px; border-color: #ded6c6; background: var(--ivory); font-size: 12px; border-radius: 9px; }
.text-link { color: var(--forest-dark); font-size: 13px; text-underline-offset: 3px; font-weight: 650; }
.mini-calendar-footer .text-link { padding: 10px 7px; text-decoration: none; }
.day-agenda { width: min(800px, 100%); margin: 0 auto; }
.day-agenda-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.day-agenda-heading .eyebrow { font-size: 10px; margin-bottom: 6px; }
.day-agenda-heading h2 { margin: 0; font-size: clamp(18px, 2vw, 22px); line-height: 1.35; font-weight: 650; }
.day-summary { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.day-search { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.day-search input { min-width: 0; flex: 1; width: 100%; min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 14px; background: white; }
.day-search .button { font-size: 13px; padding: 0 14px; border-color: var(--line); box-shadow: none; border-radius: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.day-slots { display: grid; gap: 8px; }
.slot-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 14px; align-items: center; min-height: 72px; padding: 13px 15px; border: 1px solid #dbc790; border-radius: 12px; background: #fffaf0; }
.slot-free { min-height: 64px; background: #f2faf5; border-color: #b9ddc8; }
.slot-free .slot-content > strong { color: #24714a; font-size: 14px; font-weight: 550; }
.slot-block { border-color: #d0d6d1; background: #eff1ee; }
.slot-block.slot-pending { border: 2px dashed #8a6d1f; background: #fbf6e6; }
.slot-completed { border-color: #bed0ca; background: #f0f5f2; }
.slot-past { background: #f4f3ef; border-color: #e1e0d9; color: #68746f; }
.slot-past .slot-content > strong { color: var(--muted); font-weight: 450; }
.slot-time { font-variant-numeric: tabular-nums; }
.slot-time strong { font-family: ui-monospace, monospace; font-size: 14px; }
.slot-time small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.slot-content { min-width: 0; }
.slot-title { display: block; color: var(--ink); font-size: 15px; font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
a.slot-title { margin-block: -6px -21px; padding-block: 6px 21px; box-sizing: border-box; min-height: 44px; } /* 44 px hit area inside its own card: the top sits on the card padding (6 px in Semana), the rest on the lines below */
a.slot-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.slot-content small { display: block; color: #626c65; font-size: 12px; line-height: 1.5; margin-top: 4px; }
.slot-content small.slot-trail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-actions { display: flex; align-items: center; }
.slot-actions .button { min-height: 38px; padding: 0 13px; font-size: 12px; font-weight: 600; border-radius: 8px; box-shadow: none; }
.phone-parts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 16px; align-items: end; }
.phone-parts > div { min-width: 0; }
.phone-parts select, .phone-parts input { width: 100%; min-width: 0; }
.phone-parts dt { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.phone-parts dd { margin: 0; overflow-wrap: anywhere; }
.field-hint { color: var(--muted); font-size: 13px; line-height: 1.5; }
@media (max-width: 600px) { .phone-parts { grid-template-columns: minmax(0, 1fr); gap: 12px; } }
.whatsapp-link { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #23bf62; color: #062c17; }
.whatsapp-link:hover { background: #1daa54; }
.whatsapp-link svg { width: 23px; height: 23px; }
.day-notice, .day-empty { padding: 16px; color: #5b655f; font-size: 14px; line-height: 1.6; border: 1px dashed #d4d9d2; border-radius: 12px; }
.day-history { margin-top: 22px; }
.day-history summary { padding: 12px 0; cursor: pointer; font-weight: 650; font-size: 14px; }
.history-row small { color: var(--muted); }
.history-row a { margin-left: auto; }
.daily-agenda-page .secondary-link { font-size: 13px; display: inline-flex; min-height: 44px; align-items: center; margin-top: 12px; }
.daily-agenda-page a:focus-visible, .daily-agenda-page button:focus-visible { outline: 3px solid #669e92; outline-offset: 3px; }
.entry-dialog { width: min(640px, calc(100% - 24px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line); border-radius: 20px; background: white; color: var(--ink); box-shadow: 0 24px 90px #0d453f50; max-width: none; overscroll-behavior: contain; }
.entry-dialog::backdrop { background: #153c3480; backdrop-filter: blur(3px); }
.dialog-close { position: sticky; float: right; right: 10px; z-index: 1; border: 0; border-radius: 50%; font-size: 26px; background: #edf2ef; color: var(--forest-dark); cursor: pointer; top: 8px; width: 44px; height: 44px; margin: 8px 8px 0 0; }
.dialog-content.form-card { width: 100%; border: 0; box-shadow: none; padding: 36px; }
.dialog-content h1 { font-size: 28px; padding-right: 24px; }
.dialog-content[aria-busy=true] { opacity: .65; }
.dialog-feedback { padding: 30px 0; line-height: 1.6; }
.dialog-open { overflow: hidden; }
.logout-dialog { width: min(440px, calc(100% - 28px)); padding: 0; border: 1px solid var(--line); border-radius: 22px; background: white; color: var(--ink); box-shadow: 0 24px 90px #0d453f50; }
.logout-dialog::backdrop { background: #153c3480; backdrop-filter: blur(3px); }
.logout-dialog-card { padding: clamp(26px, 6vw, 38px); text-align: center; }
.logout-dialog-card h2 { margin: 0; font-size: 30px; }
.logout-dialog-card > p:not(.eyebrow) { margin: 12px 0 28px; color: var(--muted); line-height: 1.5; }
@media (max-width: 390px) {
  .logout-page-actions, .logout-dialog-actions { grid-template-columns: 1fr; }
  .logout-dialog-actions .button-secondary { order: 2; }
}
@media (max-width: 820px) {
  .daily-agenda-page .workspace-header { flex-wrap: wrap; gap: 18px; }
  .daily-agenda-page .workspace-header .button { font-size: 13px; min-height: 44px; }
  .daily-agenda-page .workspace-header .button::after { content: none; }
  .daily-agenda-page .workspace { padding: 22px 16px 36px; }
  .daily-agenda-page .sidebar { gap: 8px; }
  .daily-agenda-page .preview-banner { margin: -22px -16px 22px; }
  .mini-calendar { margin-top: 24px; }
  .day-agenda-heading { align-items: flex-start; }
  .day-agenda-heading .date-navigation { padding-top: 14px; }
}
@media (max-width: 420px) {
  .daily-agenda-page .workspace { padding-inline: 12px; }
  .daily-agenda-page .preview-banner { margin-inline: -12px; }
  .agenda-create-actions { width: 100%; gap: 8px; }
  .agenda-create-actions .button { flex: 1; padding-inline: 10px; white-space: nowrap; }
  .mini-calendar { padding: 10px; }
  .mini-day { min-height: 38px; }
  .slot-row { grid-template-columns: 45px minmax(0, 1fr) auto; padding: 11px 10px; gap: 9px; }
  .slot-title { font-size: 14px; }
  .slot-content small { font-size: 11px; }
  .slot-actions .button { padding-inline: 10px; }
  .day-agenda-heading h2 { font-size: 17px; }
  .day-agenda-heading .date-navigation a { min-width: 30px; height: 34px; }
  .dialog-content.form-card { padding: 26px 18px; }
}


.patient-clinical {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.patient-clinical > div:last-child {
  grid-column: 1 / -1;
}

.patient-clinical div {
  background: #fffaf2;
  border: 1px solid rgba(109, 36, 101, 0.18);
  border-radius: 14px;
  padding: 1rem;
}
.observation-list > div {
  background: #fffaf2;
  border: 1px solid rgba(109, 36, 101, 0.18);
  border-radius: 14px;
  padding: 1rem;
  display: grid;
  gap: 0.45rem;
}

.patient-clinical dt {
  color: #6d2465;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.patient-clinical dd {
  margin: 0.4rem 0 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

.observation-list span {
  line-height: 1.55;
}

@media (max-width: 820px) {
  .patient-clinical { grid-template-columns: 1fr; }
  .patient-clinical > div:last-child { grid-column: auto; }
}

/* Merge preview: the two records side by side, equal width, from 821 px */
.patient-clinical-merge > div:last-child { grid-column: auto; }
.merge-phone { display: inline-block; vertical-align: top; }
.merge-sep { white-space: nowrap; }

/* Merge preview with Inverter: one column of one width (the widest label), capped at the card */
@media (min-width: 481px) {
  .action-row-stack { display: grid; grid-template-columns: fit-content(100%); justify-content: start; }
}

/* Mobile-first operational reports. */
.reports-page { background: var(--ivory); }
.reports-workspace { width: 100%; max-width: 1280px; min-width: 0; }
.patients-workspace { width: 100%; max-width: 860px; }
.reports-heading { align-items: center; }
.report-filters {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(150px, .8fr) auto;
  align-items: end;
  gap: 14px;
  margin: 28px 0 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  box-shadow: 0 8px 24px rgb(13 69 63 / 6%);
}
.report-filters label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 750; }
.report-filters select, .report-filters input { width: 100%; min-height: 46px; padding: 0 12px; border: 1px solid #cbd5d0; border-radius: 11px; background: white; color: var(--ink); font: inherit; }
.report-filters select:focus, .report-filters input:focus { border-color: var(--forest); outline: 3px solid rgb(24 95 85 / 12%); }
.report-filters > .errorlist, .report-filters > ul.errorlist { grid-column: 1 / -1; }
.report-custom-dates { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.report-custom-dates[hidden] { display: none; }
.reports-heading + .report-period { margin-top: 8px; }
.report-period { margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.report-empty { padding: 13px 15px; border-radius: 11px; font-size: 14px; line-height: 1.5; border: 1px dashed #bdcbc4; background: #f7faf8; color: var(--muted); }
.report-warning { padding: 13px 15px; border-radius: 11px; font-size: 14px; line-height: 1.5; margin: 18px 0 0; border: 1px solid #e0c99f; background: #fff8e9; color: #684f24; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.metric-card { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.metric-card span { display: block; color: var(--muted); font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }
.metric-card small { display: block; color: var(--muted); min-height: 2.6em; font-size: 11px; line-height: 1.3; }
.metric-card strong { display: block; margin: 8px 0 4px; color: var(--forest-dark); font-size: clamp(28px, 4vw, 38px); line-height: 1; font-variant-numeric: tabular-nums; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.report-card { min-width: 0; padding: clamp(18px, 3vw, 26px); border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: 0 10px 28px rgb(13 69 63 / 6%); }
.report-card-wide { grid-column: 1 / -1; }
.report-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.report-card h2 { margin: 0; font-size: clamp(20px, 3vw, 26px); }
.report-card > header > strong { color: var(--forest); font-size: 28px; font-variant-numeric: tabular-nums; }
.series-scroll { max-width: 100%; padding: 4px 0 8px; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; }
.series-scroll:focus-visible { outline: 3px solid rgb(24 95 85 / 18%); outline-offset: 4px; }
.bar-chart { display: flex; width: max-content; min-width: 100%; height: 190px; align-items: stretch; gap: 8px; }
.bar-column { width: 46px; min-width: 46px; display: grid; grid-template-rows: 22px 1fr 30px; align-items: end; gap: 5px; text-align: center; }
.bar-column > strong { color: var(--forest-dark); font-size: 12px; font-variant-numeric: tabular-nums; }
.bar-column > small { display: grid; min-height: 2.5em; align-self: start; gap: 1px; color: var(--muted); font-size: 10px; line-height: 1.2; white-space: normal; }
.bar-column > small span { display: block; }
.bar-track { position: relative; height: 100%; min-height: 105px; overflow: hidden; border-radius: 8px 8px 3px 3px; background: #edf2ef; }
.bar-fill { position: absolute; right: 0; bottom: 0; left: 0; height: var(--bar-value); min-height: 0; border-radius: 7px 7px 2px 2px; background: linear-gradient(180deg, #2c8073, var(--forest)); }
.chart-data { margin-top: 12px; font-size: 13px; }
.chart-data summary { margin-block: -13px; padding-block: 13px; line-height: 18px; color: var(--forest); font-weight: 700; cursor: pointer; } /* 44 px hit area, no extra height: a fixed line height (18 + 2 x 13) keeps it 44 in any font */
.chart-data table { width: 100%; margin-top: 10px; border-collapse: collapse; }
.chart-data th, .chart-data td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.chart-data th:last-child, .chart-data td:last-child { text-align: right; }
.pie-layout { display: grid; grid-template-columns: 174px minmax(0, 1fr); align-items: center; gap: 24px; }
.pie-chart { position: relative; width: 174px; height: 174px; border-radius: 50%; background: var(--pie-background); box-shadow: inset 0 0 0 1px rgb(13 69 63 / 8%); }
.pie-chart::before { position: absolute; inset: 45px; border-radius: 50%; background: white; box-shadow: 0 0 0 1px rgb(13 69 63 / 8%); content: ""; }
.pie-chart-empty { background: #edf2ef; }
.pie-center { position: absolute; top: 50%; left: 50%; z-index: 1; width: 72px; transform: translate(-50%, -50%); text-align: center; }
.pie-center strong { display: block; color: var(--forest-dark); font-size: 29px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.pie-center small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.2; }
.pie-slice-label { position: absolute; z-index: 2; top: var(--pie-label-y); left: var(--pie-label-x); transform: translate(-50%, -50%); font-size: 12px; font-weight: 850; line-height: 1; text-shadow: 0 1px 2px rgb(0 0 0 / 16%); font-variant-numeric: tabular-nums; }
.pie-key { display: grid; gap: 11px; margin: 0; padding: 0; list-style: none; }
.pie-key li { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 650; }
.legend-dot { width: 11px; height: 11px; flex: 0 0 auto; border-radius: 50%; }
.status-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.status-comparison div { padding: 17px; border-radius: 14px; background: #f6f3ed; }
.status-comparison span { display: block; min-height: 2.6em; color: var(--muted); font-size: 12px; font-weight: 700; }
.status-comparison strong { display: block; margin-top: 8px; color: #6d2465; font-size: 32px; font-variant-numeric: tabular-nums; }
.report-note { margin: 16px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

@media (max-width: 960px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .reports-workspace { padding: 22px 16px 36px; }
  .reports-heading h1 { font-size: 36px; }
  .report-filters { grid-template-columns: 1fr 1fr; margin-top: 22px; padding: 14px; }
  .report-filters .button { grid-column: 1 / -1; width: 100%; font-size: 15px; }
  .report-grid { grid-template-columns: 1fr; }
  .report-card-wide { grid-column: auto; }
}

@media (max-width: 480px) {
  .reports-page .sidebar-brand > span:last-child { display: none; }
  .reports-page .sidebar { padding: 10px 8px; }
  .reports-page .nav-item { min-height: 44px; }
  .reports-workspace { padding-inline: 12px; }
  .report-filters { grid-template-columns: 1fr; gap: 12px; }
  .report-custom-dates { grid-template-columns: 1fr; }
  .metric-grid { gap: 8px; }
  .metric-card { padding: 14px 12px; }
  .metric-card strong { font-size: 28px; }
  .report-card { padding: 17px 14px; border-radius: 16px; }
  .pie-layout { grid-template-columns: 128px minmax(0, 1fr); gap: 14px; }
  .pie-chart { width: 128px; height: 128px; }
  .pie-chart::before { inset: 33px; }
  .pie-center { width: 58px; }
  .pie-center strong { font-size: 24px; }
  .pie-slice-label { font-size: 10px; }
  .bar-chart { height: 170px; }
  .bar-column { width: 42px; min-width: 42px; }
}

@media (max-width: 360px) {
  .pie-layout { grid-template-columns: 1fr; justify-items: center; }
  .pie-key { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pie-key li { font-size: 12px; }
}

.pending-purchases { max-width: 100%; overflow-x: auto; }
.pending-purchases table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 900px; }
.pending-purchases th, .pending-purchases td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.pending-purchases thead th { color: var(--muted); font-size: 12px; font-weight: 700; }
.pending-purchases th[scope="row"] { min-width: 190px; overflow-wrap: anywhere; }
.pending-purchases td:nth-child(2) { min-width: 240px; overflow-wrap: anywhere; }
.pending-purchases td:nth-child(3), .pending-purchases td:nth-child(4), .pending-purchases td:nth-child(5) { overflow-wrap: normal; white-space: nowrap; }
.pending-purchases:focus-visible { outline: 3px solid var(--forest); outline-offset: 2px; }
.pending-hint { display: none; margin: 0 0 8px; color: var(--muted); font-size: 14px; }
@media (max-width: 900px) { .pending-hint { display: block; } }

/* Cadastros pendentes (OUT-20261030-pending-signups): a table above 820 px, cards at 820 px and below. */
/* Wider than the 860 px of the other patient pages: the table of four columns fits without scrolling. */
.patients-workspace.signup-workspace { max-width: 1100px; }
.signup-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin: 0 0 16px; }
.signup-filter .treatment-field { min-width: 240px; }
.signup-count { margin: 0; min-height: 44px; display: flex; align-items: center; color: var(--muted); font-size: 14px; font-weight: 700; }
.signup-list { overflow-x: auto; }
.signup-table { width: 100%; min-width: 788px; border-collapse: collapse; table-layout: fixed; font-size: 14px; }
.signup-table th, .signup-table td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: break-word; }
.signup-table thead th { color: var(--muted); font-size: 12px; font-weight: 700; }
.signup-table th:nth-child(2) { width: 200px; }
.signup-table th:nth-child(3) { width: 104px; }
.signup-table th:nth-child(4) { width: 264px; }
.signup-person { font-weight: 400; }
.signup-person strong { display: block; font-size: 15px; }
.signup-line { display: block; color: var(--muted); }
.signup-phone { white-space: nowrap; }
.signup-badge { display: inline-block; padding: 5px 10px; border-radius: 999px; background: var(--sage); color: var(--forest-dark); font-size: 13px; font-weight: 750; }
.signup-badge-email, .signup-badge-compra { background: var(--sand); color: var(--sand-ink); }
.signup-mark { display: block; margin-top: 6px; color: var(--sand-ink); font-size: 13px; font-weight: 700; }
.signup-date { white-space: nowrap; }
.signup-buttons { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 8px; }
.signup-buttons > .button, .signup-more > summary { width: 100%; }
.signup-more > summary { padding: 0 12px; white-space: nowrap; }
.signup-buttons > .button { padding: 0 16px; }
.signup-phone-row { align-items: start; }
.signup-field-error { margin: 6px 0 0; color: var(--danger); font-size: 13px; font-weight: 700; }
.panel-form input[aria-invalid="true"] { border: 2px solid var(--danger); }
.signup-more { position: relative; }
.signup-more > summary { list-style: none; }
.signup-more > summary::-webkit-details-marker { display: none; }
.signup-menu { position: relative; width: calc(200% + 8px); min-width: 0; margin: 6px 0 0 calc(-100% - 8px); padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.signup-menu a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--ink); font-weight: 650; text-decoration: none; }
.signup-menu a:hover { background: var(--sage); }
.signup-menu-divider { display: block; margin: 6px 4px; border-top: 1px solid var(--line); }
.signup-menu a.signup-menu-danger { color: var(--danger); }
.signup-trash-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }
.signup-trash { max-width: 980px; }
.signup-trash-table { min-width: 0; }
.signup-trash-table th:nth-child(2) { width: 160px; }
.signup-trash-table th:nth-child(3) { width: 140px; }
.signup-trash-table .signup-actions form { margin: 0; }
.signup-workspace .messages { margin-bottom: 16px; }
.signup-confirm h2 { margin: 18px 0 6px; font-size: 16px; }
.signup-confirm ul:not(.errorlist) { margin: 0 0 6px; padding-left: 20px; }
.signup-confirm-name { overflow-wrap: anywhere; }
.signup-confirm-note { margin: 12px 0; padding: 10px 12px; border-radius: 10px; background: var(--sand); color: var(--sand-ink); font-size: 14px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.teleconsulta-page .signup-confirm .signup-confirm-note { margin: 12px 0; }
.signup-confirm .action-row { margin-top: 16px; }
@media (min-width: 1024px) {
  .signup-table { min-width: 0; }
}
.signup-more > summary:focus-visible, .signup-menu a:focus-visible, .signup-buttons > .button:focus-visible, .signup-trash-table .button:focus-visible, .signup-trash-link:focus-visible { outline: 3px solid var(--forest); outline-offset: 2px; }
@media (max-width: 820px) {
  .signup-table, .signup-table tbody, .signup-table tr, .signup-table th, .signup-table td { display: block; }
  .signup-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .signup-table tr { margin: 0 0 12px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; }
  .signup-table th, .signup-table td { padding: 4px 0; border: 0; }
  .signup-table td.signup-since::before { content: "Desde "; font-weight: 700; }
  .signup-list { overflow-x: visible; }
  .signup-table { min-width: 0; }
  .signup-buttons { margin-top: 8px; }
  .signup-trash-table td.signup-since::before { content: "Na lixeira desde "; }
  .signup-trash-table .signup-actions .button { width: 100%; }
  .signup-trash-table th:nth-child(n) { width: auto; }
}

/* Teleconsulta panel screens (day list, detail, slots): existing tokens only, 44px targets. */
.teleconsulta-page .day-agenda { margin: 22px 0 0; width: min(800px, 100%); }
.teleconsulta-page a:focus-visible, .teleconsulta-page button:focus-visible,
.teleconsulta-page input:focus-visible, .teleconsulta-page summary:focus-visible,
.teleconsulta-page [tabindex="-1"]:focus-visible { outline: 3px solid var(--forest); outline-offset: 3px; }
.teleconsulta-page .nav-item, .teleconsulta-page .button, .teleconsulta-page .button-secondary { min-height: 44px; }
.teleconsulta-page .date-navigation a { min-width: 44px; height: 44px; }
.teleconsulta-page .back-link { display: inline-flex; align-items: center; min-height: 44px; }
.teleconsulta-page .text-link { display: inline-flex; min-height: 44px; align-items: center; }
.teleconsulta-page .workspace-header .button::after { content: none; }
.teleconsulta-page .workspace-header { flex-wrap: wrap; gap: 12px 20px; width: min(800px, 100%); }
.teleconsulta-page .workspace-header .button { font-size: 14px; }
.teleconsulta-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.teleconsulta-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 6px 14px; align-items: center; min-height: 72px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); overflow-wrap: anywhere; }
.teleconsulta-row time { font-variant-numeric: tabular-nums; font-weight: 750; }
.teleconsulta-name { display: inline-flex; min-height: 44px; align-items: center; color: var(--forest-dark); font-weight: 750; }
.teleconsulta-row .pill-row, .teleconsulta-row > .button, .teleconsulta-row > form, .teleconsulta-row > .text-link { grid-column: 2; }
.pill-row { display: flex; flex-wrap: wrap; gap: 6px; }
.pill-row .status-pill, .teleconsulta-facts .status-pill { margin: 0; }
.teleconsulta-detail { width: min(620px, 100%); margin: 22px 0 0; padding-inline: clamp(18px, 4vw, 48px); overflow-wrap: anywhere; }
.teleconsulta-detail h1 { overflow-wrap: anywhere; }
.teleconsulta-detail .plan-title { margin: -6px 0 8px; overflow-wrap: anywhere; }
.teleconsulta-facts { display: grid; gap: 10px; margin: 0 0 14px; }
.teleconsulta-facts dt { color: var(--muted); font-size: 13px; font-weight: 750; }
.teleconsulta-facts dd { margin: 2px 0 0; }
.ficha-flags { margin: 14px 0; padding: 14px 16px; border-left: 4px solid var(--danger); background: var(--ivory); color: var(--ink); }
.ficha-flags h3 { margin: 0 0 8px; }
.ficha-answers { display: grid; gap: 12px; margin: 0 0 14px; }
.ficha-answers dt { color: var(--muted); font-size: 13px; font-weight: 750; }
.ficha-answers dd { margin: 3px 0 0; color: var(--ink); overflow-wrap: anywhere; }
.marked-list { margin: 0 0 10px; padding-left: 20px; overflow-wrap: anywhere; }
.marked-list li { margin: 0 0 4px; }
/* What the patient wrote about the pain: line breaks kept, a long word wraps (no <br>, no |safe). */
.pain-detail { margin: 0 0 8px; white-space: pre-line; overflow-wrap: anywhere; }
.protocol-region { margin: 0 0 18px; }
.protocol-region label { display: block; margin-bottom: 8px; font-size: 22px; font-weight: 750; }
.decision-fieldset { min-width: 0; margin: 0 0 18px; padding: 0; border: 0; }
.decision-fieldset legend { margin-bottom: 10px; padding: 0; font-size: 22px; font-weight: 750; }
.teleconsulta-detail .action-row { flex-wrap: wrap; line-height: 1.3; }
.teleconsulta-page .day-agenda-heading h2 { text-transform: none; }
.teleconsulta-page .day-notice { width: min(800px, 100%); }
.teleconsulta-page .panel-tabs[aria-label="Configurar agenda"] { width: min(800px, 100%); gap: 6px; margin: 8px 0; }
.teleconsulta-page .messages { width: min(800px, 100%); margin-bottom: 20px; }
.teleconsulta-page .workspace:has(.teleconsulta-detail) > .messages { width: min(620px, 100%); }
.reassess-picker .bulk-weekday { background: white; position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; min-height: 44px; margin: 0; padding: 0 6px; border: 1px solid var(--line); border-radius: 10px; font-size: 15px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; text-align: center; }
.reassess-picker .bulk-weekday:has(input:checked) { border-color: var(--forest); background: var(--sage); color: var(--forest-dark); }
.messages .message-error, .messages .message-warning { color: var(--danger); }
.messages:has(.message-error, .message-warning) { background: #fff0ed; border-color: #e8b8b0; color: var(--danger); }
/* Refunds (panel): same frame as the teleconsulta screens; only the overdue pill is new. */
.status-pill-overdue { border: 2px solid var(--danger); color: var(--ink); }
.status-pill-new { background: var(--sage); color: var(--forest-dark); border: 1px solid var(--forest); white-space: nowrap; }
.teleconsulta-page .form-card textarea:focus-visible, .teleconsulta-page .form-card select:focus-visible,
.teleconsulta-page .sex-options input:focus-visible { outline: 3px solid var(--forest); outline-offset: 3px; }
.teleconsulta-page .form-card input[type="date"], .teleconsulta-page .form-card textarea { min-height: 44px; }
.teleconsulta-page .sex-options label { min-height: 44px; }
.teleconsulta-row.refund-row { grid-template-columns: minmax(0, 1fr); }
.teleconsulta-row.reassess-old-row { grid-template-columns: minmax(0, 1fr); min-height: auto; padding: 8px 12px; gap: 2px; }
.teleconsulta-row.refund-row > *, .teleconsulta-row.refund-row .pill-row { grid-column: 1; }
.refund-row .refund-dates { margin: 0; overflow-wrap: anywhere; }
.refund-facts { margin: 0; overflow-wrap: anywhere; margin-bottom: 14px; }
.refund-lead { margin: 0 0 8px; overflow-wrap: anywhere; }
.teleconsulta-page .day-agenda > .day-summary { margin-bottom: 14px; }
.teleconsulta-row.refund-row > .button { justify-self: start; }
.refund-fixed { margin: 0 0 14px; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.teleconsulta-page .sex-options .field-hint { margin: 6px 0 0 14px; }
.teleconsulta-window { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
/* Tratamentos (Wave 4 P1b): the pain table of a plan; tokens only, no chart, state in words. */
.trend-scroll { overflow-x: auto; margin: 0 0 14px; }
.trend-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.trend-table th { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.trend-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.trend-table thead th { color: var(--muted); font-size: 13px; font-weight: 750; }
.trend-table tbody th { font-weight: 750; }
.trend-scroll:focus-visible { outline: 3px solid var(--forest); outline-offset: 2px; }
@media (max-width: 820px) {
  .teleconsulta-page .app-shell { grid-template-rows: auto 1fr; }
  .teleconsulta-page .nav-item.disabled { display: none; }
}
@media (max-width: 600px) {
  .teleconsulta-row { grid-template-columns: minmax(0, 1fr); }
  .teleconsulta-row .pill-row, .teleconsulta-row > .button, .teleconsulta-row > form, .teleconsulta-row > .text-link { grid-column: 1; }
  .teleconsulta-detail .action-row { flex-direction: column; }
  .teleconsulta-detail .action-row .button { width: 100%; }
  .teleconsulta-detail .protocol-release-button { width: 100%; }
  .teleconsulta-row.refund-row > .button { width: 100%; justify-self: stretch; }
  .teleconsulta-detail .sex-options { grid-template-columns: minmax(0, 1fr); }
}

/* Stage-only WhatsApp outbox page (OUT-20261017-journey-pr1b2) */
.wa-outbox { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.wa-bubble { border: 1px solid #cfd9d4; border-radius: 12px; background: #eaf5ee; padding: 12px 14px; }
.wa-bubble .wa-meta { margin: 0 0 6px; font-size: 13px; color: var(--ink); }
.wa-bubble .wa-text { margin: 0; white-space: pre-line; overflow-wrap: anywhere; line-height: 1.5; }
/* Stage e-mail outbox inside the panel shell (OUT-20261028-stage-outbox-shell): messages as cards. */
.outbox-list { display: grid; gap: 12px; margin: 0 0 24px; padding: 0; list-style: none; }
.outbox-demo, .outbox-message { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.outbox-demo { margin: 0 0 12px; }
.outbox-message h2, .outbox-demo h2 { margin: 0 0 8px; font-size: 18px; }
.outbox-demo h3 { margin: 12px 0 4px; font-size: 16px; }
@media (max-width: 600px) { .outbox-demo .button { width: 100%; } }
.order-details { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 16px; margin: 0 0 12px; }
.order-details dt { color: var(--muted); font-weight: 750; }
.order-details dd { margin: 0; overflow-wrap: anywhere; }
.outbox-message .outbox-body { margin: 12px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.outbox-empty { margin: 0 0 24px; padding: 18px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); }
/* "Atualizar" of both outboxes: a 44 px target (OUT-20261028-stage-outbox-polish, #688). */
.outbox-refresh { display: inline-flex; align-items: center; min-height: 44px; }
@media (max-width: 480px) { .order-details { grid-template-columns: minmax(0, 1fr); gap: 2px; } .order-details dd { margin-bottom: 8px; } }
/* Novos pacientes a avaliar (PR1B-6): menu marker, queue rows, request page. Tokens only. */
.nav-item .nav-badge { display: inline-flex; min-width: 22px; height: 22px; align-items: center; justify-content: center; padding: 0 6px; border-radius: 999px; background: var(--champagne); color: var(--forest-dark); font-size: 13px; font-weight: 800; margin-left: auto; flex: none; }
.panel-tab .nav-badge { display: inline-flex; min-width: 22px; height: 22px; align-items: center; justify-content: center; padding: 0 6px; border-radius: 999px; background: var(--champagne); color: var(--forest-dark); font-size: 13px; font-weight: 800; margin-left: 8px; flex: none; }
.button-danger { border: 1px solid var(--danger); background: white; color: var(--danger); }
.request-row { display: block; }
.request-link { display: grid; gap: 4px; min-height: 44px; padding: 10px 2px; color: var(--ink); text-decoration: none; }
.request-link span { color: var(--muted); }
.request-link .pill-row { grid-column: 1; }
.request-link:focus-visible { outline: 3px solid var(--forest); outline-offset: 2px; }
.request-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; margin: 0 0 24px; }
.request-facts dt { color: var(--muted); font-weight: 750; }
.request-facts dd { margin: 0; overflow-wrap: anywhere; }
.request-complaint { white-space: pre-wrap; }
.request-confirm { margin-bottom: 24px; }
.request-duplicate { margin-bottom: 24px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--sage); }
.request-refuse { padding-top: 20px; border-top: 1px solid var(--line); }
.request-preview { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; background: var(--ivory); border: 1px solid var(--line); }
.request-preview small { color: var(--muted); font-style: italic; }
.request-preview p { margin: 6px 0 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { .request-facts { grid-template-columns: minmax(0, 1fr); gap: 2px; } .request-facts dd { margin-bottom: 10px; } }
/* the mobile rule above hides every .nav-item span: keep the badge's screen-reader text */
.nav-item .sr-only { display: block; }

/* OUT-20261018-visual-batch-2, lane C1 (#313, #302): panel only (.app-shell, .login-page, .workspace). */
.sidebar-logout { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; padding: 0 12px; margin-left: -12px; color: inherit; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.sidebar-logout:hover { color: white; }
.sidebar-logout:focus-visible { outline: 3px solid var(--champagne); outline-offset: 2px; border-radius: 8px; }
.login-page .button { min-height: 48px; }
.reassess-picker .bulk-weekday-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.workspace .teleconsulta-list + h3 { margin-top: 24px; }
.request-complaint-line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.request-age { color: var(--muted); }
.request-action { color: var(--forest); font-weight: 750; }
@media (max-width: 820px) {
  .sidebar-footer { display: block; padding: 0; }
  .sidebar-logout { margin-left: 0; }
}
@media (max-width: 600px) {
  .reassess-picker .bulk-weekday-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Protocol editor (OUT-20261020-protocol-flow, S2): desktop only, tokens of the panel. */
.protocol-narrow-note { display: none; padding: 18px; border: 1px solid var(--champagne); border-radius: 12px; background: var(--sand); color: var(--sand-ink); }
.protocol-desktop { max-width: 1180px; }
.protocol-desktop > .back-link { margin-bottom: 4px; }
@media (max-width: 1023px) {
  .protocol-narrow-note { display: block; }
  .protocol-desktop { display: none; }
}
.protocol-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 0 0 16px; }
.protocol-head h1 { margin: 0; font-size: clamp(28px, 3vw, 40px); }
.protocol-saved { display: inline-flex; min-height: 44px; align-items: center; color: var(--forest-dark); font-size: 14px; font-weight: 700; }
.protocol-banner { margin: 0 0 8px; padding: 12px 16px; border-left: 4px solid var(--champagne); border-radius: 8px; background: var(--sand); color: var(--sand-ink); font-weight: 700; }
.protocol-steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; padding: 0; list-style: none; }
.protocol-steps li { display: inline-flex; min-height: 44px; align-items: center; gap: 8px; padding: 0 16px 0 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--ink); font-weight: 700; }
.protocol-steps b { display: inline-grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: var(--sage); color: var(--forest-dark); }
.protocol-steps [aria-current="step"] { border-color: var(--forest); background: var(--forest); color: var(--white); }
.protocol-steps [aria-current="step"] b { background: var(--white); color: var(--forest-dark); }
.protocol-panel { margin: 0 0 18px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.protocol-panel h2 { margin: 0 0 10px; font-size: 20px; }
.protocol-panel .field-hint, .protocol-hint { color: var(--muted); font-size: 14px; }
.protocol-panel h2 small { color: var(--muted); font-size: 14px; font-weight: 500; }
.protocol-note-field { display: grid; gap: 6px; }
.protocol-note-field .field-hint, .protocol-note-field .errorlist { margin: 0; }
.protocol-note-field input[aria-invalid="true"] { border: 2px solid var(--danger); }
.protocol-note-field [data-note-count][data-limit] { color: var(--ink); font-weight: 700; }
.protocol-review { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.protocol-decision { position: sticky; top: 16px; }
.protocol-quote { margin: 0 0 8px; padding: 10px 14px; border-left: 4px solid var(--sage); background: var(--ivory); overflow-wrap: anywhere; white-space: pre-line; }
.protocol-disabled { display: inline-flex; box-sizing: border-box; min-height: 46px; align-items: center; justify-content: center; padding: 0 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); color: var(--muted); font-weight: 700; text-align: center; opacity: .6; cursor: not-allowed; }
.protocol-danger { border-color: var(--danger); color: var(--danger); }
.protocol-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin: 0 0 14px; }
.protocol-filters label { display: grid; gap: 4px; font-size: 14px; font-weight: 750; }
.protocol-filters select { min-height: 44px; padding: 0 10px; border: 1px solid #cbd5d0; border-radius: 10px; background: var(--white); font: inherit; }
.protocol-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin: 0 0 14px; padding: 0; list-style: none; }
.protocol-thumb { display: grid; gap: 6px; min-height: 44px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); color: var(--ink); text-decoration: none; }
.protocol-thumb:hover { border-color: var(--forest); }
.protocol-thumb img { width: 100%; height: 150px; object-fit: contain; background: var(--bm-fill); border-radius: 8px; }
.protocol-thumb-name { font-weight: 750; overflow-wrap: anywhere; }
.protocol-thumb-meta { color: var(--muted); font-size: 13px; }
.protocol-used { justify-self: start; padding: 3px 8px; border-radius: 999px; background: var(--sage); color: var(--forest-dark); font-size: 12px; font-weight: 750; }
.protocol-lowres { justify-self: start; padding: 3px 8px; border-radius: 999px; background: var(--sand); color: var(--sand-ink); font-size: 12px; font-weight: 750; }
.protocol-mark { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.protocol-viewport { position: relative; overflow: auto; max-height: 72vh; border: 1px solid var(--line); border-radius: 12px; background: var(--bm-fill); touch-action: manipulation; }
@media (min-width: 1024px) {
  .workspace:has(.protocol-mark) { padding-top: 16px; }
  .protocol-desktop:has(> .protocol-mark) .protocol-banner { margin-bottom: 4px; padding-block: 6px; }
  .protocol-desktop:has(> .protocol-mark) .protocol-head h1 { font-size: 28px; }
  .protocol-desktop:has(> .protocol-mark) .protocol-head { margin-bottom: 8px; }
  .protocol-desktop:has(> .protocol-mark) .protocol-steps { margin-bottom: 8px; }
  .protocol-viewport { height: clamp(320px, calc(100vh - 448px), 72vh); max-height: clamp(320px, calc(100vh - 448px), 72vh); }
}
.protocol-viewport:focus-visible { outline: 3px solid var(--forest); outline-offset: 2px; }
.protocol-stage { position: relative; display: block; margin: 0 auto; max-width: none; line-height: 0; cursor: crosshair; user-select: none; }
.protocol-stage img { display: block; width: 100%; height: auto; }
.protocol-dot { position: absolute; left: var(--x); top: var(--y); width: 22px; height: 22px; margin: -11px 0 0 -11px; border: 3px solid var(--white); border-radius: 50%; background: var(--protocol-point); box-shadow: 0 0 0 1.5px var(--ink); pointer-events: none; }
.protocol-dot-pending { border-style: dashed; }
.protocol-dot[hidden] { display: none; }
.protocol-zoom { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin: 10px 0; }
.protocol-zoom[hidden] { display: none; }
.protocol-zoom-bar { display: flex; align-items: center; gap: 8px; }
.protocol-zoom-bar label { font-size: 14px; font-weight: 750; }
.protocol-zoom-bar input[type="range"] { flex: 1; min-width: 120px; min-height: 44px; margin: 0; accent-color: var(--forest); }
.protocol-zoom-bar span { width: 4ch; font-variant-numeric: tabular-nums; text-align: right; }
.protocol-zoom .field-hint { margin: 0; color: var(--muted); font-size: 14px; }
.protocol-zoom > button { align-self: flex-start; }
.protocol-zoom button { min-width: 44px; min-height: 44px; border: 1px solid var(--forest); border-radius: 10px; background: var(--white); color: var(--forest); font-weight: 800; cursor: pointer; }
.protocol-zoom [aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.protocol-fields { display: grid; gap: 10px; margin: 12px 0; }
.protocol-fields label { display: grid; gap: 4px; font-size: 14px; font-weight: 750; }
.protocol-fields input { min-height: 44px; padding: 0 12px; border: 1px solid #cbd5d0; border-radius: 10px; font: inherit; }
.protocol-keys { margin: 10px 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.protocol-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin: 0 0 14px; padding: 0; list-style: none; }
.protocol-card { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.protocol-card:target, .protocol-card.is-focus { border-color: var(--forest); box-shadow: 0 0 0 3px rgb(24 95 85 / 20%); }
.protocol-cards-bare { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.protocol-card.protocol-card-point { align-content: start; }
.protocol-card-number { display: inline-grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: var(--forest); color: var(--white); font-weight: 800; }
.protocol-card .protocol-stage { cursor: default; }
.protocol-card .protocol-stage img { max-height: 150px; width: auto; margin: 0 auto; }
.protocol-card-changed { border: 2px solid var(--protocol-changed); background: var(--protocol-changed-soft); }
.protocol-card .protocol-changed-tag { justify-self: start; padding: 2px 10px; border: 1px solid var(--protocol-changed); border-radius: 999px; background: var(--protocol-changed-soft); color: var(--ink); font-size: 13px; font-weight: 750; }
.protocol-card .protocol-card-label { margin: 0; overflow-wrap: anywhere; }
.protocol-card .protocol-zoom { display: grid; gap: 6px; justify-items: center; }
.protocol-card .point-frame { position: relative; overflow: hidden; width: min(100%, 262px); aspect-ratio: var(--ratio, .75); margin: 0 auto; border: 1px solid var(--line); border-radius: 12px; background: var(--white); touch-action: pan-y; }
.protocol-card .point-frame img { display: block; width: 100%; height: 100%; }
.protocol-card .zoom-layer { position: absolute; inset: 0; transform-origin: 0 0; transform: translate(var(--tx, 0px), var(--ty, 0px)) scale(var(--zoom, 1)); }
.protocol-card .point-dot { position: absolute; box-sizing: border-box; width: 20px; height: 20px; border: 3px solid var(--white); border-radius: 50%; background: var(--protocol-point); box-shadow: 0 0 0 1.5px var(--ink), 0 2px 6px rgb(0 0 0 / 30%); transform: translate(-50%, -50%) scale(calc(1 / var(--zoom, 1))); pointer-events: none; }
.protocol-card .zoom-buttons { display: flex; justify-content: center; gap: 6px; }
.protocol-card .zoom-buttons[hidden], .protocol-card .image-state[hidden] { display: none; }
.protocol-card .zoom-button { display: grid; width: 44px; height: 44px; place-items: center; padding: 0; border: 1px solid var(--forest); border-radius: 12px; background: var(--white); color: var(--forest); font-family: inherit; font-size: 22px; font-weight: 800; line-height: 1; cursor: pointer; }
.protocol-card .zoom-button[aria-disabled="true"] { border-color: var(--line); color: var(--muted); }
.protocol-card .zoom-button:focus-visible, .protocol-card .image-state .button:focus-visible { outline: 3px solid var(--forest); outline-offset: 2px; }
.protocol-card .image-state { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 14px; background: var(--ivory); text-align: center; }
.protocol-card .image-state span { display: block; }
.protocol-card .image-state-error { border: 2px solid var(--danger); background: var(--white); }
.protocol-removed { margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--line); border-left: 4px solid var(--protocol-changed); border-radius: 12px; background: var(--ivory); color: var(--ink); font-size: 14px; }
.protocol-card-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.protocol-card-actions .button, .protocol-card-actions button { min-width: 44px; min-height: 44px; padding: 0 10px; }
.protocol-card-actions [aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.protocol-confirm-card { padding: 10px; border: 2px solid var(--danger); border-radius: 10px; background: #fff0ed; }
.protocol-add { display: grid; min-height: 120px; place-items: center; border: 2px dashed var(--forest); border-radius: 12px; color: var(--forest); font-weight: 800; text-align: center; text-decoration: none; padding: 16px; box-sizing: border-box; }
.protocol-add[aria-disabled="true"] { border-color: var(--muted); color: var(--muted); }
.protocol-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.protocol-radios { display: flex; gap: 10px; margin: 0 0 10px; }
.protocol-radios label { display: grid; width: 96px; height: 72px; place-items: center; align-content: center; border: 2px solid var(--line); border-radius: 12px; background: var(--white); font-size: 26px; font-weight: 800; cursor: pointer; }
.protocol-radios label small { font-size: 12px; font-weight: 600; color: var(--muted); }
.protocol-radios input { position: absolute; opacity: 0; }
.protocol-radios label:has(input:checked) { border-color: var(--forest); background: var(--sage); }
.protocol-radios label:has(input:focus-visible) { outline: 3px solid var(--forest); outline-offset: 2px; }
.protocol-locked { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--ivory); }
.protocol-summary dl { display: grid; gap: 8px; margin: 0 0 12px; }
.protocol-summary dt { color: var(--muted); font-size: 13px; font-weight: 750; }
.protocol-summary dd { margin: 0; font-weight: 750; }
.protocol-mini { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; padding: 0; list-style: none; }
.protocol-mini .protocol-stage { width: 64px; }
.protocol-overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: #153c3480; overflow: auto; }
.protocol-dialog { width: min(720px, 100%); max-height: calc(100dvh - 32px); overflow: auto; padding: 26px; border: 1px solid var(--line); border-radius: 20px; background: var(--white); box-shadow: 0 24px 90px #0d453f50; }
.protocol-dialog h2 { margin: 0 0 8px; font-size: 26px; }
.protocol-dialog h2:focus-visible { outline: 3px solid var(--forest); outline-offset: 3px; }
.protocol-dialog dl { display: grid; gap: 8px; }
.protocol-dialog dt { color: var(--muted); font-size: 13px; font-weight: 750; }
.protocol-dialog dd { margin: 0; }
.protocol-title-field { display: grid; gap: 4px; margin: 8px 0 14px; }
.protocol-title-field label { font-weight: 750; }
.protocol-title-field .field-hint, .protocol-title-field .errorlist { margin: 0; }
.protocol-previews { display: flex; flex-wrap: wrap; gap: 16px; margin: 12px 0; }
.protocol-phone { width: 250px; padding: 14px; border: 2px solid var(--ink); border-radius: 22px; background: var(--ivory); }
.protocol-phone h3 { margin: 0 0 6px; }
.protocol-phone .protocol-stage { width: 100%; }
.protocol-preview-zoom { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; }
.protocol-preview-zoom .protocol-stage { transform-origin: 0 0; transform: translate(clamp(-100%, calc(50% - var(--px) * 2%), 0%), clamp(-100%, calc(50% - var(--py) * 2%), 0%)) scale(2); }
.protocol-preview-zoom .protocol-dot { scale: .5; }
.protocol-versions { width: 100%; border-collapse: collapse; overflow-wrap: normal; }
.protocol-versions th { border-bottom: 1px solid var(--line); text-align: left; white-space: normal; padding: 8px 8px; }
.protocol-versions td { border-bottom: 1px solid var(--line); text-align: left; white-space: normal; padding: 8px 8px; }
.protocol-versions caption { text-align: left; font-weight: 750; padding-bottom: 6px; }
.protocol-inuse { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--sage); color: var(--forest-dark); font-size: 12px; font-weight: 750; }
.protocol-pending-head { display: flex; align-items: baseline; gap: 10px; }
.protocol-pending-head h2 span { margin-left: 6px; padding: 2px 10px; border-radius: 999px; background: var(--sage); font-size: 14px; }
.teleconsulta-row.protocol-row { grid-template-columns: minmax(0, 1fr) auto; }
.teleconsulta-row.protocol-row > * { grid-column: 1; }
.teleconsulta-row.protocol-row > .button { grid-column: 2; grid-row: 1 / span 3; align-self: center; justify-self: end; white-space: nowrap; }
@media (prefers-reduced-motion: no-preference) { .protocol-thumb { transition: border-color .12s; } }
@media (forced-colors: active) { .protocol-dot { background: Highlight; border-color: Canvas; } }

/* Tratamentos online: tabela (OUT-20261022-admin-tratamentos-tabela). Tokens only. */
.treatment-list .day-agenda { width: min(1100px, 100%); margin-top: 8px; }
.treatment-intro { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.treatment-list .refund-lead { margin: 0; }
.treatment-list .day-summary { margin: 0; }
.treatment-list .panel-tabs, .patients-page .panel-tabs[aria-label="Seções de Pacientes"] { gap: 6px; margin: 12px 0; }
.treatment-list .panel-tab, .patients-page .panel-tabs[aria-label="Seções de Pacientes"] .panel-tab { min-height: 44px; padding: 0 12px; }
.treatment-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.treatment-field label, .treatment-period legend { color: var(--muted); font-size: 12px; font-weight: 750; line-height: 1.3; align-self: flex-start; }
.treatment-field input, .treatment-field select { width: 100%; min-width: 0; min-height: 44px; padding: 0 10px; border: 1px solid var(--muted); border-radius: 10px; background: var(--white); color: var(--ink); font: inherit; }
/* Filter card (#442): one container grid for /tratamentos/ and /pacientes/. A long count line (class treatment-count-long) stays a bottom line. The card's own width picks the
   tier: S under 600px (1 column), M from 600px (2), W from 700px (3), L from 980px (4 fields and the actions in one row). Field tracks are `auto` (up to their content, then stretched, never wider than the card): a wider font shrinks the longest select, it does not push Filtrar out of the card. */
.treatment-filters { container: filter-card / inline-size; position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.treatment-search { --filter-button: 96px; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) var(--filter-button); gap: 12px; align-items: end; flex: 1 1 0; min-width: 0; }
.treatment-narrow { --filter-button: 96px; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) var(--filter-button); gap: 8px 12px; align-items: end; flex: 1 1 100%; order: 2; min-width: 0; }
.treatment-narrow:has(> .text-link) { grid-template-columns: minmax(0, 1fr) auto var(--filter-button); }
.treatment-search .button { width: 100%; min-height: 44px; padding: 0; border-radius: 10px; box-shadow: none; font-size: 14px; }
.treatment-narrow > .button { width: 100%; min-height: 44px; padding: 0; border-radius: 10px; box-shadow: none; font-size: 14px; grid-column: -2; order: 2; }
.treatment-narrow > .treatment-period { grid-column: 1 / -1; }
.treatment-narrow > .treatment-field { grid-column: 1 / -1; padding-right: 4px; } /* with the calc() width of the select below: 4 px of room, so the longest option clears the arrow */
.treatment-narrow > .treatment-field select { width: calc(100% + 4px); }
.treatment-period { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.treatment-period input[type="date"] { padding: 0 6px; }
.treatment-narrow > .text-link { grid-column: -3; order: 1; justify-self: end; display: inline-flex; align-items: center; min-height: 44px; color: var(--forest); font-size: 14px; font-weight: 700; white-space: nowrap; }
.treatment-hint { grid-column: 1; order: 0; align-self: start; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; contain: inline-size; }
.treatment-narrow:has(> .text-link) > .treatment-hint { grid-column: 1 / -1; order: 3; }
.treatment-count { order: 3; flex: 1 1 100%; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.3; }
@media (max-width: 480px) { .treatment-filters { padding: 10px; } }
@container filter-card (min-width: 600px) {
  .treatment-search, .treatment-narrow { --filter-button: 112px; }
  .treatment-search .button, .treatment-narrow > .button { font-size: 15px; }
  .treatment-narrow, .treatment-narrow:has(> .text-link) { grid-template-columns: repeat(2, auto) var(--filter-button); }
  .treatment-narrow > .treatment-field, .treatment-narrow > .treatment-period { grid-column: auto; }
  .treatment-narrow > .treatment-period, .treatment-narrow > .patient-field-situacao, .treatment-narrow > .patient-field-ordem { grid-column: 2 / -1; }
  .treatment-narrow > .treatment-hint, .treatment-narrow:has(> .text-link) > .treatment-hint { grid-column: 1 / -1; order: 3; }
}
@container filter-card (min-width: 700px) {
  @media (hover: hover) and (pointer: fine) { .treatment-narrow .treatment-field input, .treatment-narrow .treatment-field select { font-size: 14px; } } /* mouse only (a touch screen keeps 16px, no zoom on focus): wide fonts (Linux) still fit the row */
  .treatment-count:not(.treatment-count-long) { position: absolute; top: 12px; right: 12px; max-width: 70%; flex: none; font-size: 13px; line-height: 1.2; white-space: nowrap; text-align: right; }
  .treatment-narrow, .treatment-narrow:has(> .text-link) { grid-template-columns: repeat(3, auto) 100px var(--filter-button); }
  .treatment-narrow > .patient-field-situacao, .treatment-narrow > .patient-field-ordem { grid-column: auto; }
  .treatment-narrow > .patient-field-visit { grid-column: 3 / -1; }
  .treatment-narrow > .treatment-hint, .treatment-narrow:has(> .text-link) > .treatment-hint { grid-column: 2 / -3; order: 0; }
}
@container filter-card (min-width: 980px) {
  .treatment-narrow, .treatment-narrow:has(> .text-link) { grid-template-columns: 232px repeat(3, auto) 100px var(--filter-button); } /* the 100px Limpar track is always there: nothing shifts when the link appears */
  .treatment-narrow > .treatment-period { grid-column: span 2; }
  .treatment-narrow > .patient-field-visit { grid-column: auto; }
  .treatment-narrow > .treatment-hint, .treatment-narrow:has(> .text-link) > .treatment-hint { grid-column: 2 / 5; order: 3; }
}
.treatment-list a:focus-visible, .treatment-list button:focus-visible, .treatment-list input:focus-visible, .treatment-list select:focus-visible, .patients-page .patients-workspace a:focus-visible, .patients-page .patients-workspace button:focus-visible, .patients-page .patients-workspace input:focus-visible, .patients-page .patients-workspace select:focus-visible { outline: 3px solid var(--forest); outline-offset: 2px; }
.treatment-list .day-empty, .patients-page .day-empty { padding: 10px; }
.treatment-list .day-empty p, .patients-page .day-empty p { margin: 0 0 4px; }
.treatment-table { width: 100%; border-collapse: collapse; background: var(--white); line-height: 1.3; }
.treatment-table caption { text-align: left; }
.treatment-table th, .treatment-table td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; font-size: 14px; }
.treatment-table thead th { color: var(--muted); font-size: 12px; font-weight: 750; }
.treatment-table th[aria-sort="ascending"]::after { content: " \25B2"; }
.treatment-table th[aria-sort="descending"]::after { content: " \25BC"; }
.treatment-table .cell-name { min-width: 8rem; overflow-wrap: anywhere; font-weight: 750; }
.treatment-table .cell-action { text-align: right; }
.treatment-table .cell-last { min-width: 15rem; }
.treatment-table .cell-label { display: none; }
.treatment-table .cell-sessions { white-space: nowrap; }
.treatment-table .cell-note { display: block; color: var(--muted); font-size: 12px; }
.treatment-table .treatment-row[data-new] > :first-child { box-shadow: inset 4px 0 0 var(--forest); } /* decoration only: the text "Nova" carries the meaning */
.treatment-table .status-pill { margin: 0; padding: 3px 8px; font-size: 13px; font-weight: 750; }
.treatment-table .cell-action .button { min-height: 44px; padding: 0 12px; font-size: 14px; white-space: nowrap; }
.treatment-table .cell-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: nowrap; gap: 6px; }
.treatment-table .cell-actions form { margin: 0; }
.treatment-table .treatment-icon-button { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--white); color: var(--danger); cursor: pointer; }
.treatment-table .treatment-icon-button svg { width: 20px; height: 20px; }
.treatment-table .treatment-icon-button:hover { border-color: var(--danger); background: var(--sand); }
.treatment-archive-link { display: inline-flex; align-items: center; min-height: 44px; }
.form-card .treatment-draft-option { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0 0 12px; flex-basis: 100%; font-weight: 400; }
.form-card .treatment-draft-option input { width: 18px; height: 18px; min-height: 0; padding: 0; border: 0; flex: none; accent-color: var(--forest); }
.treatment-draft-option:has(input:focus-visible) { outline: 3px solid var(--forest); outline-offset: 2px; }
/* Biblioteca do Especialista (OUT-20261024-points-library, #458): tokens only. */
.points-library .workspace-header { margin-bottom: 12px; }
.points-library .workspace-header h1 { font-size: 36px; }
.points-library .day-empty { margin: 0 0 12px; padding: 10px 12px; line-height: 1.45; }
.points-library .day-empty p { margin: 0 0 4px; }
.points-library .text-link { display: inline-flex; align-items: center; min-height: 44px; }
.points-table td, .points-table th { overflow-wrap: anywhere; }
/* Pontos Tung (OUT-20261024-points-library, #552): the page also carries .points-library; tokens only. */
.tung-source { margin: 0 0 12px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.tung-index { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.tung-all { margin: 0 0 12px; }
.tung-all summary { display: flex; align-items: center; min-height: 44px; color: var(--forest-dark); font-size: 14px; font-weight: 700; cursor: pointer; }
.tung-all ul { margin: 0; padding: 0; list-style: none; }
.tung-tables h2 { margin: 20px 0 6px; font-size: 20px; line-height: 1.2; scroll-margin-top: 16px; }
.tung-tables .treatment-table { scroll-margin-top: 16px; margin: 0 0 6px; }
.tung-tables .treatment-table caption { padding: 0 0 6px; color: var(--ink); font-size: 15px; font-weight: 750; }
.tung-tables .treatment-table thead th { white-space: nowrap; }
/* R6 (#672): the long text columns (Localização, Principais indicações) and the six Sistema columns of the summary
   wrap between words, so the widest table fits the content width from 821 px up; the short columns keep one line.
   library.wraps() marks them by header text (tung-wrap); the first column stays on one line; the phone cards and print keep their own layout. */
@media screen and (min-width: 821px) {
  .tung-tables .treatment-table th.cell-name { width: 1%; min-width: 0; white-space: nowrap; }
  .tung-tables .treatment-table td:not(.tung-wrap) { white-space: nowrap; } /* Nome and Nº: short, one line */
  .tung-tables .treatment-table td { overflow-wrap: break-word; } /* words stay whole: "anywhere" let the Nome column break names */
  .tung-tables .treatment-table td.tung-wrap, .tung-tables .treatment-table thead th.tung-wrap { min-width: 6.5rem; white-space: normal; overflow-wrap: break-word; }
}
@media (max-width: 820px) { .tung-tables .treatment-table caption { display: block; } }
@media (max-width: 600px) {
  .tung-index { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .tung-index .panel-tab { min-height: 44px; padding: 0 8px; justify-content: center; font-size: 14px; text-align: center; }
}
.tung-note { margin: 0 0 8px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.tung-text p { margin: 0 0 6px; line-height: 1.45; }
.tung-unreadable { color: var(--muted); }
.points-library a:focus-visible, .points-library button:focus-visible, .points-library input:focus-visible { outline: 3px solid var(--forest); outline-offset: 2px; }
.treatment-pages { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 12px 0; }
.treatment-pages .button { min-height: 44px; }
.treatment-page-now { color: var(--muted); font-size: 14px; }
@media (min-width: 821px) {
  .treatment-table .cell-alert { max-width: 9rem; }
}
@media (min-width: 1200px) { .treatment-table .cell-last { min-width: 9rem; } } /* the spare width goes to the name column */
@media (max-width: 820px), (min-width: 821px) and (max-width: 1199px) { /* stacked rows: the phone layout, and the band where seven columns do not fit */
  .treatment-table .cell-sessions { white-space: normal; }
  .treatment-table, .treatment-table tbody { display: block; }
  .treatment-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .treatment-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-bottom: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
  .treatment-table .treatment-row > * { display: block; padding: 0; border: 0; }
  .treatment-table .treatment-row[data-new] { border-left: 4px solid var(--forest); }
  .treatment-table .treatment-row[data-new] > :first-child { box-shadow: none; }
  .treatment-table .cell-name { flex: 1 1 0; order: 1; }
  .treatment-table .cell-situation { order: 2; }
  .treatment-table .cell-action { order: 3; margin-left: auto; }
  .treatment-row::after { content: ""; order: 4; flex-basis: 100%; height: 0; margin-top: -4px; }
  .treatment-table .cell-alert { order: 5; flex-basis: 100%; }
  .treatment-table .cell-empty { display: none; }
  .treatment-table .cell-alert:empty { display: none; }
  .treatment-table .cell-sessions { order: 6; }
  .treatment-table .cell-sessions .cell-label { display: none; }
  .treatment-table .cell-last { order: 7; flex: 1 1 auto; min-width: 0; }
  .treatment-table .cell-version { order: 8; }
  .treatment-table .cell-label { display: inline; color: var(--muted); font-size: 12px; }
  .treatment-table .cell-note { display: inline; margin-left: 6px; }
  .points-table .treatment-row { gap: 2px 10px; padding: 8px 10px; }
  .points-table .treatment-row > td { flex-basis: 100%; order: 2; }
}
@media (min-width: 821px) and (max-width: 1199px) { /* the library and Tung tables keep their columns in the band: only the treatment list stacks */
  .points-table { display: table; }
  .points-table tbody { display: table-row-group; }
  .points-table thead { position: static; width: auto; height: auto; overflow: visible; clip-path: none; display: table-header-group; }
  .points-table .treatment-row { display: table-row; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; }
  .points-table .treatment-row > * { display: table-cell; padding: 6px 10px; border-bottom: 1px solid var(--line); }
  .points-table .cell-label { display: none; }
  .points-table .treatment-row::after { content: none; }
}
/* Print: the sheet keeps the title, the source line, the region titles and the tables; each region starts a page. */
@page tung-wide { size: landscape; }
@media print {
  .app-shell:has(.tung-tables) { display: block; }
  .app-shell:has(.tung-tables) .sidebar, .tung-tables .treatment-filters, .tung-tables .treatment-count, .tung-tables .tung-index, .tung-tables .tung-all, .tung-tables .tung-back { display: none; }
  .tung-tables .tung-region { break-before: page; }
  .tung-tables .tung-region-wide { page: tung-wide; }
  .tung-tables .treatment-table { display: table; }
  .tung-tables .treatment-table tbody { display: table-row-group; }
  .tung-tables .treatment-table thead { position: static; width: auto; height: auto; overflow: visible; clip-path: none; display: table-header-group; }
  .tung-tables .treatment-row { display: table-row; margin: 0; padding: 0; border: 0; break-inside: avoid; }
  .tung-tables .treatment-table .treatment-row > * { display: table-cell; padding: 4px 6px; border-bottom: 1px solid var(--line); }
  .tung-tables .treatment-table .cell-label { display: none; }
  .tung-tables .treatment-table caption { display: table-caption; }
}
@media (max-width: 600px) { .points-library .workspace-header h1 { font-size: 28px; line-height: 1.1; } }
@media (max-width: 480px) {
  .treatment-table .cell-action { order: 9; flex-basis: 100%; margin-left: 0; }
  .treatment-table .cell-action .button { width: 100%; }
  .treatment-table .cell-actions { justify-content: flex-start; }
  .treatment-table .cell-actions > .button { flex: 1 1 auto; width: auto; }
}

/* Round 2 (UX review): stacked actions, faded disabled, versions table, dialogs. */
.protocol-mark .action-row, .protocol-decision .action-row { flex-direction: column; align-items: stretch; gap: 10px; }
.protocol-mark .action-row .button, .protocol-decision .action-row .button, .protocol-decision .action-row form, .protocol-decision .action-row .protocol-disabled { width: 100%; }
.protocol-decision .action-row form .button { width: 100%; }
.protocol-mark .button[aria-disabled="true"], .protocol-zoom [data-undo][aria-disabled="true"] { opacity: .55; cursor: not-allowed; box-shadow: none; }
.protocol-mark > * { min-width: 0; }
.protocol-danger-fill, .protocol-danger-fill:hover { background: var(--danger); color: var(--white); box-shadow: none; }
.protocol-add small { display: block; margin-top: 6px; }
fieldset.protocol-panel { min-width: 0; }
fieldset.protocol-panel > legend { float: left; width: 100%; margin: 0 0 10px; padding: 0; }
fieldset.protocol-panel > legend + * { clear: both; }
.protocol-versions-wrap { position: relative; overflow-x: auto; }
.protocol-dialog-close { position: sticky; top: 0; z-index: 1; float: right; display: inline-grid; width: 44px; height: 44px; place-items: center; border-radius: 50%; background: #edf2ef; color: var(--forest-dark); font-size: 26px; text-decoration: none; }
.protocol-dialog-foot { position: sticky; bottom: -26px; margin: 12px -26px -26px; padding: 12px 26px; background: var(--white); border-top: 1px solid var(--line); }
.protocol-phone .protocol-mini .protocol-stage { width: 64px; }
.protocol-mini .protocol-dot { width: 10px; height: 10px; margin: -5px 0 0 -5px; border-width: 2px; }
.protocol-mini li { list-style: none; }

/* Round 3: the versions table gets the room it needs; air in the dialogs; Remover is destructive. */
.teleconsulta-detail.protocol-wide { width: min(980px, 100%); }
.protocol-dialog details { margin: 14px 0 16px; }
.protocol-dialog details + .action-row, .protocol-dialog form.action-row { margin-top: 16px; }
.teleconsulta-page .protocol-confirm-card .button.protocol-danger-fill, .teleconsulta-page .protocol-confirm-card .button.protocol-danger-fill:hover { border: 0; background: var(--danger); color: var(--white); box-shadow: none; }
.protocol-versions td:nth-child(2), .protocol-versions td:nth-child(5), .protocol-versions td:first-child { white-space: nowrap; }
.protocol-versions .text-link { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }
.protocol-versions .cell-label { display: none; }
@media (max-width: 599px) { /* each version is a stacked row, like the treatment rows: label beside value, Ver at the row end */
  .protocol-versions, .protocol-versions tbody, .protocol-versions caption { display: block; }
  .protocol-versions thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .protocol-versions tr { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .protocol-versions td { display: block; flex-basis: 100%; padding: 0; border: 0; white-space: normal; }
  .protocol-versions td:first-child { flex: 1 1 0; order: 1; }
  .protocol-versions td:nth-child(5) { flex: none; order: 2; }
  .protocol-versions td:nth-child(2), .protocol-versions td:nth-child(3), .protocol-versions td:nth-child(4) { order: 3; }
  .protocol-versions .cell-label { display: inline; color: var(--muted); font-size: 12px; }
}

/* OUT-20261022-admin-menu-nav (#425): the Agenda submenu and the two tab bars. Tokens only. */
a.nav-item:hover { background: rgb(255 255 255 / 8%); color: white; }
a.nav-item.active:hover { background: rgb(255 255 255 / 12%); }
.nav-subitem { display: flex; min-height: 44px; align-items: center; padding: 0 14px 0 30px; border-left: 3px solid transparent; color: rgb(255 255 255 / 72%); font-size: 14px; font-weight: 600; text-decoration: none; }
.nav-item + .nav-subitem, .nav-subitem + .nav-subitem { margin-top: -4px; }
.nav-subitem.disabled { opacity: .45; }
a.nav-subitem:hover { color: white; }
.nav-subitem.active { border-left-color: var(--champagne); color: white; font-weight: 750; }
.sidebar a:focus-visible { outline: 3px solid var(--champagne); outline-offset: 2px; border-radius: 8px; }
@media (forced-colors: active) { .nav-subitem:not(.active) { border-left-color: Canvas; } }
.panel-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: var(--space-6) 0; }
.panel-tab { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 0 16px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); font-size: 15px; font-weight: 700; text-decoration: none; }
.panel-tab:hover { border-color: var(--forest); color: var(--forest-dark); }
.panel-tab[aria-current="page"] { border-color: var(--forest); border-bottom-width: 3px; background: var(--sage); color: var(--forest-dark); }
.panel-tab .nowrap, .outbox-demo .nowrap, .workspace-header .nowrap { white-space: nowrap; }
/* a tab with a nowrap word is one text flow (a flex row would split the text and the word into two items) */
.panel-tabs:has(.nowrap) { align-items: stretch; }
.panel-tab:has(.nowrap) { display: block; padding: 12px 16px; line-height: 18px; text-align: center; }
.panel-tab:focus-visible { outline: 3px solid var(--forest); outline-offset: 2px; }
/* Pacientes: the requests history (OUT-20261022-admin-pedidos-pacientes). Tokens only. */
.history-row { flex-wrap: wrap; border-bottom: 1px solid var(--line); font-size: 13px; display: block; }
.history-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-inline: 2px; }
.history-name { min-width: 0; overflow-wrap: anywhere; color: var(--ink); }
.history-meta { padding-inline: 2px; margin: 6px 0 0; color: var(--muted); font-size: 14px; }
/* The three Pacientes tabs: one container width on every tab, so the header does not jump, and a
   label never breaks inside a pill (the tabs wrap as whole pills instead of the 2-column grid). */
.panel-tabs[aria-label="Seções de Pacientes"] .panel-tab { white-space: nowrap; }
.teleconsulta-page .patient-list-heading, .teleconsulta-page .panel-tabs[aria-label="Seções de Pacientes"], .teleconsulta-page .patient-list-heading ~ .day-agenda { width: min(calc(860px - 2 * clamp(22px, 4vw, 58px)), 100%); } /* = the content width of .patients-workspace */
@media (max-width: 820px) {
  .teleconsulta-page .patient-list-heading, .teleconsulta-page .panel-tabs[aria-label="Seções de Pacientes"], .teleconsulta-page .patient-list-heading ~ .day-agenda { width: min(calc(860px - 32px), 100%); }
}
@media (max-width: 480px) {
  .panel-tabs[aria-label="Seções de Pacientes"] { display: flex; }
  .panel-tabs[aria-label="Seções de Pacientes"] .panel-tab { flex: 0 1 auto; }
  .patients-page .panel-tabs[aria-label="Seções de Pacientes"] .panel-tab { flex: 1 1 auto; padding: 0 10px; } /* the first two tabs share a row at 393 as at 402; each row is filled */
}
.history-main .status-pill { flex: none; margin: 0; }
.status-pill-confirmed { background: var(--sage); color: var(--forest-dark); }
.history-pages { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: var(--space-6); }
.history-pages .button { min-height: 44px; }
.slot-actions .slot-evaluate { min-height: 44px; font-size: 13px; white-space: nowrap; }
@media (max-width: 600px) { .history-main { flex-direction: column; gap: 6px; } }
@media (max-width: 420px) { .slot-actions:has(.slot-evaluate), .slot-actions:has(.slot-no-show) { grid-column: 2 / -1; justify-self: start; } }
@media (max-width: 820px) {
  .nav-item + .nav-subitem, .nav-subitem + .nav-subitem { margin-top: 0; }
  .nav-subitem { min-width: max-content; padding: 0 12px; border: 1px solid rgb(255 255 255 / 28%); border-radius: 12px; }
  .nav-subitem.active { border-bottom: 3px solid var(--champagne); }
  .nav-subitem.disabled { display: none; }
}
@media (max-width: 480px) {
  .panel-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-tab { text-align: center; }
}
@media (max-width: 420px) {
  .nav-subitem { flex: 1 1 auto; justify-content: center; padding: 0 4px; font-size: 13px; }
}
/* Agenda: semana e filtro (#429). Tokens only; the density pass and UX-D1 (44 px controls) of the UX spec. */
.agenda-toolbar { display: flex; flex-wrap: wrap; gap: 12px; width: min(800px, 100%); margin: 12px auto 10px; }
.agenda-toolbar [role="group"] { display: flex; gap: 4px; }
.agenda-toolbar a { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--ink); font-size: 14px; font-weight: 700; text-decoration: none; }
.agenda-toolbar a:hover { border-color: var(--forest); color: var(--forest-dark); }
.agenda-toolbar a[aria-current="true"] { border-color: var(--forest); border-bottom-width: 3px; background: var(--sage); color: var(--forest-dark); }
.agenda-toolbar a:focus-visible, .week-day a:focus-visible, .slot-open:focus-visible { outline: 3px solid var(--forest); outline-offset: 2px; }
/* 44 px controls on /agenda/ (UX-D1=A), no extra padding */
.daily-agenda-page .calendar-arrow { width: 44px; height: 44px; }
.daily-agenda-page .mini-day { min-height: 44px; }
.daily-agenda-page .mini-calendar-footer .button { min-height: 44px; }
.daily-agenda-page .mini-calendar-footer .text-link, .daily-agenda-page .day-search .text-link, .daily-agenda-page .history-row a { display: inline-flex; min-height: 44px; align-items: center; }
.daily-agenda-page .day-agenda-heading .date-navigation { gap: 4px; }
.daily-agenda-page .day-agenda-heading .date-navigation a { min-width: 44px; height: 44px; }
.daily-agenda-page .day-search { margin-bottom: 10px; }
.daily-agenda-page .day-search input { min-height: 44px; }
.daily-agenda-page .day-search .button { min-height: 44px; }
.daily-agenda-page .slot-actions .button { min-height: 44px; }
.daily-agenda-page .whatsapp-link { width: 44px; height: 44px; }
.daily-agenda-page .slot-actions .text-link, .daily-agenda-page .slot-actions .text-button { display: inline-flex; min-height: 44px; min-width: 44px; align-items: center; justify-content: center; }
/* density: rows, text, pills, empty states, history */
.daily-agenda-page .day-summary { margin-top: 2px; }
.daily-agenda-page .day-slots { gap: 6px; }
.daily-agenda-page .slot-row { min-height: 60px; gap: 10px; padding: 8px 12px; }
.daily-agenda-page .slot-free { min-height: 52px; }
.daily-agenda-page .slot-title { font-size: 15px; }
.daily-agenda-page .slot-content small { margin-top: 2px; line-height: 1.35; }
.slot-name { display: block; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.daily-agenda-page .slot-content .pill-row { gap: 4px; margin-top: 4px; }
.daily-agenda-page .slot-content .status-pill { padding: 3px 8px; font-size: 12px; font-weight: 750; }
.slot-online { border-color: var(--line); border-left: 3px solid var(--forest); background: var(--white); }
.slot-actions .slot-open { padding: 0 10px; white-space: nowrap; }
.slot-type { display: none; }
.agenda-semana .agenda-toolbar { width: 100%; margin-inline: 0; }
.daily-agenda-page .day-notice, .daily-agenda-page .day-empty { padding: 10px 12px; line-height: 1.45; }
.daily-agenda-page .day-history { margin-top: 12px; }
.daily-agenda-page .day-history summary { display: flex; min-height: 44px; align-items: center; padding: 8px 0; }
.daily-agenda-page .history-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 8px; }
/* Semana: one list per day below 1180 px, seven columns above */
.week-grid { display: grid; gap: 4px; }
.week-day { min-width: 0; }
.week-day h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 4px; font-size: 15px; }
.week-day h3 a { display: inline-flex; min-height: 44px; align-items: center; color: var(--forest-dark); font-weight: 750; text-decoration: none; }
.week-day h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.week-day-short { display: none; }
.week-day-short small { color: var(--muted); font-size: 12px; font-weight: 600; }
.today-pill { padding: 2px 8px; border-radius: 999px; background: var(--forest); color: var(--white); font-size: 12px; font-weight: 750; }
.week-empty { margin: 0; padding: 4px; color: var(--muted); font-size: 13px; }
.week-rows { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin: 0; padding: 0; list-style: none; }
@media (max-width: 600px) {
  .daily-agenda-page .slot-actions:has(.slot-open) { grid-column: 2 / -1; margin-top: 6px; }
  .slot-actions .slot-open { flex: 1; }
}
@media (max-width: 480px) {
  .agenda-toolbar { display: grid; gap: 8px; }
  .agenda-toolbar [role="group"] { display: grid; }
  .agenda-toolbar [role="group"]:first-child { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agenda-toolbar [role="group"]:last-child { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .daily-agenda-page .mini-calendar { padding: 8px; }
  .daily-agenda-page .mini-days, .daily-agenda-page .mini-weekdays { gap: 2px; }
  .daily-agenda-page .slot-row { padding: 8px 10px; }
  .daily-agenda-page .slot-title { font-size: 14px; }
}
@media (min-width: 821px) and (max-width: 1099px) {
  /* Dia, one column: header, messages and tabs share the width of the list */
  .daily-agenda-page:not(.agenda-semana) .workspace > .workspace-header, .daily-agenda-page:not(.agenda-semana) .workspace > .messages { width: min(800px, 100%); margin-inline: auto; }
}
@media (min-width: 821px) and (max-width: 1179px) {
  /* Semana, one column: the same shared width */
  .agenda-semana .workspace > .workspace-header, .agenda-semana .workspace > .messages, .daily-agenda-page.agenda-semana .workspace > .agenda-toolbar { width: min(800px, 100%); margin-inline: auto; }
}
@media (min-width: 1100px) {
  /* Dia: the calendar beside the list, so the first rows are above the fold */
  .daily-agenda-page:not(.agenda-semana) .workspace { display: grid; grid-template-columns: 380px minmax(0, 1fr); align-content: start; column-gap: 32px; }
  .daily-agenda-page:not(.agenda-semana) .workspace > .preview-banner, .daily-agenda-page:not(.agenda-semana) .workspace > .workspace-header, .daily-agenda-page:not(.agenda-semana) .workspace > .messages, .daily-agenda-page:not(.agenda-semana) .workspace > .agenda-toolbar { grid-column: 1 / -1; }
  .daily-agenda-page:not(.agenda-semana) .workspace > .agenda-toolbar { width: 100%; margin-inline: 0; }
  .daily-agenda-page:not(.agenda-semana) .mini-calendar { width: 100%; margin: 0; align-self: start; }
  .daily-agenda-page:not(.agenda-semana) .day-agenda { width: 100%; margin: 0; }
}
@media (min-width: 1180px) {
  /* Semana: the Dia layout on top (calendar left, heading and search right), the grid full width below */
  .agenda-semana .workspace { display: grid; grid-template-columns: 380px minmax(0, 1fr); align-content: start; column-gap: 32px; }
  .agenda-semana .workspace > .preview-banner, .agenda-semana .workspace > .workspace-header, .agenda-semana .workspace > .messages, .agenda-semana .workspace > .agenda-toolbar { grid-column: 1 / -1; }
  .agenda-semana .mini-calendar { width: 100%; margin: 0; align-self: start; }
  .week-agenda { display: contents; }
  .week-top { grid-column: 2; min-width: 0; }
  .week-grid, .week-agenda > .day-history, .week-agenda > .secondary-link { grid-column: 1 / -1; }
  .week-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: start; margin-top: 12px; }
  .week-day { padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
  .week-day.is-today { border-color: var(--forest); border-bottom-width: 3px; }
  .week-day h3 { margin: 0 0 4px; gap: 4px; font-size: 13px; }
  .week-day-short { display: inline; }
  .week-day-long { display: none; }
  .week-rows .slot-row { display: block; min-height: 0; padding: 6px 8px; font-size: 13px; }
  .week-rows .slot-time { display: flex; gap: 4px; align-items: baseline; }
  .week-rows .slot-time strong { font-size: 12px; }
  .week-rows .slot-time small { display: inline; margin: 0; }
  .week-rows .slot-time small::before { content: "–"; margin-right: 4px; }
  .week-rows .slot-content { margin-top: 4px; }
  .week-rows .slot-content > * + * { margin-top: 4px; }
  .slot-type { display: block; color: var(--muted); font-size: 12px; }
  .week-rows .slot-actions { margin-top: 4px; }
  .week-rows .slot-actions .button { width: 100%; font-size: 13px; white-space: normal; text-align: center; }
  .week-rows .whatsapp-link { margin-left: auto; }
}
@media (forced-colors: active) { .agenda-toolbar a[aria-current="true"], .slot-online, .week-day.is-today { border-color: Highlight; } }


/* Devoluções e Relatórios: abas e contador (#430). Tokens only. */
.nav-item-overdue .nav-badge, .panel-tab-overdue .nav-badge { box-shadow: inset 0 0 0 2px var(--forest-dark); }
@media (forced-colors: active) { .nav-item-overdue .nav-badge, .panel-tab-overdue .nav-badge { outline: 2px solid CanvasText; outline-offset: -2px; } }
.panel-tabs[aria-label="Devoluções"], .panel-tabs[aria-label="Relatórios"] { gap: 6px; margin: 12px 0; }
.panel-tabs[aria-label="Devoluções"] .panel-tab, .panel-tabs[aria-label="Relatórios"] .panel-tab { padding: 0 12px; }
.panel-tabs[aria-label="Devoluções"] + .day-agenda { margin-top: 0; }
.panel-tabs[aria-label="Devoluções"] + .day-agenda > .refund-lead { margin: 0 0 4px; }
.panel-tabs[aria-label="Devoluções"] + .day-agenda > .day-summary { margin: 0 0 8px; }
.panel-tabs[aria-label="Devoluções"] + .day-agenda .history-pages { margin-top: 12px; }
.teleconsulta-list:has(> .refund-done-row) { gap: 6px; }
.teleconsulta-row.refund-done-row { min-height: auto; padding: 8px 12px; gap: 2px; }
.refund-done-row .status-pill { padding: 3px 8px; }
.refund-done-row .refund-dates { font-size: 14px; line-height: 1.4; }
.panel-tabs[aria-label="Relatórios"] + .report-filters { margin-top: 0; padding: 14px; }
.panel-tabs[aria-label="Relatórios"] + .pending-hint { margin: 0 0 6px; }
.refund-done-row .teleconsulta-name { align-items: flex-start; }

/* Pacientes: filtros e lista (#431) */
.patients-page .patient-list-heading { margin-bottom: 8px; }
.patients-page .patient-list { gap: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--white); overflow: hidden; }
.patients-page .patient-list:not(:has(.patient-row)) { display: none; }
.patient-list-head { display: grid; grid-template-columns: minmax(0, 1fr) 9rem 10rem 44px; gap: 12px; align-items: center; min-height: 24px; padding: 0 11px; color: var(--muted); font-size: 12px; font-weight: 750; }
.patients-page .patient-row { display: grid; grid-template-columns: minmax(0, 1fr) 9rem 10rem 44px; position: relative; gap: 4px 12px; padding: 6px 10px; overflow: clip; border: 0; border-radius: 0; line-height: 1.3; }
.patients-page .patient-row + .patient-row { border-top: 1px solid var(--line); }
.patients-page .patient-row:hover { border-color: var(--line); }
.patients-page .patient-row-details { margin-block: -12px; padding-block: 12px; overflow-wrap: anywhere; } /* 44 px target; the row clips what the padding adds, so a click near its edge never reaches a neighbour */
.patients-page a.patient-row-details::after { content: ""; position: absolute; inset: 0; } /* the whole row opens the patient, and nothing outside it */
.patients-page .patients-workspace .patient-row-details:focus-visible { outline: 0; }
.patients-page .patient-row:has(.patient-row-details:focus-visible) { outline: 3px solid var(--forest); outline-offset: -3px; } /* the ring sits inside the row: neither the row nor the list clips it */
.patients-page .patient-row-meta { display: contents; }
.patients-page .patient-row-visit, .patients-page .patient-row-type { min-width: 0; color: var(--ink); font-size: 14px; }
.patients-page .patient-list .patient-mark { margin: 2px 6px 0 0; padding: 2px 8px; font-size: 12px; }
.patients-page .patient-row .whatsapp-link { position: relative; z-index: 1; width: 44px; height: 44px; }
.patients-page .patient-row .whatsapp-link svg { width: 22px; height: 22px; }
.patients-page .patient-row .cell-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.patients-page .treatment-filters .text-link, .patients-page .day-empty .text-link { display: inline-flex; align-items: center; min-height: 44px; }
.patients-page .secondary-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 12px; }
@media (max-width: 820px) {
  .patient-list-head { display: none; }
  .patients-page .patient-row { grid-template-columns: minmax(0, 1fr) 44px; }
  .patients-page .patient-row-details { grid-column: 1; grid-row: 1; }
  .patients-page .patient-row-meta { display: flex; flex-wrap: wrap; gap: 0 14px; grid-column: 1; grid-row: 2; }
  .patients-page .patient-row-visit, .patients-page .patient-row-type { white-space: nowrap; }
  .patients-page .patient-row .whatsapp-link { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .patients-page .patient-row .cell-label { position: static; width: auto; height: auto; overflow: visible; clip-path: none; color: var(--muted); font-size: 12px; }
}

/* Menu no celular: gaveta (OUT-20261022-admin-menu-drawer, #427). Tokens only. */
.sidebar-panel { display: contents; }
.menu-head, .menu-backdrop { display: none; }
.menu-toggle { display: none; min-width: 44px; min-height: 44px; padding: 0 12px; border: 1px solid rgb(255 255 255 / 28%); border-radius: 12px; background: transparent; color: var(--white); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.menu-close { display: none; min-width: 44px; min-height: 44px; padding: 0 12px; border: 1px solid rgb(255 255 255 / 28%); border-radius: 12px; background: transparent; color: var(--white); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.menu-toggle:hover, .menu-close:hover { background: rgb(255 255 255 / 8%); }
.menu-toggle:focus-visible, .menu-close:focus-visible { outline: 3px solid var(--champagne); outline-offset: 2px; border-radius: 8px; }
.menu-toggle-count { display: inline-flex; min-width: 22px; height: 22px; align-items: center; justify-content: center; padding: 0 6px; border-radius: 999px; background: var(--champagne); color: var(--forest-dark); font-size: 13px; font-weight: 800; }
@media (max-width: 820px) and (scripting: enabled) {
  .app-shell .sidebar { position: sticky; top: 0; z-index: 20; height: auto; min-height: 56px; flex-flow: row nowrap; align-items: center; justify-content: space-between; gap: 12px; row-gap: 0; padding: 6px 12px; }
  .app-shell .sidebar-brand { min-width: 0; gap: 10px; }
  .app-shell .sidebar-brand > span:last-child { display: block; white-space: nowrap; }
  .app-shell .sidebar-brand strong { font-size: 16px; }
  .app-shell .sidebar-brand small { margin-top: 0; font-size: 12px; }
  .menu-toggle { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; flex: none; }
  .sidebar-panel { position: fixed; top: 0; right: 0; z-index: 2; display: flex; flex-direction: column; box-sizing: border-box; width: min(320px, calc(100% - 56px)); height: 100vh; height: 100dvh; padding: 0 8px 8px; overflow-y: auto; overscroll-behavior: contain; background: var(--forest-dark); transform: translateX(100%); visibility: hidden; }
  .sidebar[data-open] .sidebar-panel { transform: none; visibility: visible; }
  .menu-backdrop { position: fixed; inset: 0; z-index: 1; display: block; background: #153c3480; opacity: 0; visibility: hidden; }
  .sidebar[data-open] .menu-backdrop { opacity: 1; visibility: visible; }
  .menu-head { display: flex; flex: none; align-items: center; justify-content: space-between; min-height: 56px; padding-left: 14px; }
  .menu-title { color: var(--white); font-size: 16px; font-weight: 750; }
  .menu-close { display: inline-flex; align-items: center; gap: 4px; margin-right: 4px; }
  .sidebar-panel nav { display: grid; grid-template-columns: minmax(0, 1fr); justify-content: stretch; width: auto; margin-left: 0; gap: 4px; }
  .sidebar-panel .nav-item { min-width: 0; min-height: 44px; justify-content: flex-start; padding: 8px 14px; font-size: 16px; }
  .sidebar-panel .nav-item .nav-badge { display: inline-flex; margin-left: auto; }
  .sidebar-panel .nav-subitem { min-width: 0; justify-content: flex-start; margin-top: 0; padding: 0 14px 0 30px; border: 0; border-left: 3px solid transparent; border-radius: 0; font-size: 14px; }
  .sidebar-panel .nav-subitem.active { border-left-color: var(--champagne); }
  .sidebar-panel .sidebar-footer { display: block; margin-top: 4px; padding: 4px 14px 0; border-top: 1px solid rgb(255 255 255 / 28%); }
  .sidebar-panel .sidebar-logout { margin-left: -14px; padding: 0 14px; }
  html.menu-open, html.menu-open body { overflow: hidden; }
}
@media (max-width: 420px) and (scripting: enabled) { .app-shell .sidebar-brand small { display: none; } }
@media (forced-colors: active) { .menu-toggle, .menu-close { border-color: ButtonText; } }
/* Menu recolhível no computador (OUT-20261029-admin-menu-collapse, #716): above 820 px with scripting the
   Menu button folds the 240 px menu into a 56 px strip. The state is data-menu on #painel-menu (the
   painel_menu cookie, read by the server); with no choice the strip is the default from 821 to 1279 px. */
@media (min-width: 821px) and (scripting: enabled) {
  .sidebar { overflow-x: clip; }
  .sidebar-brand { padding: 0; }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; align-self: flex-start; gap: 6px; margin: 8px 0 12px; }
  .menu-toggle::before { content: "‹" / ""; font-size: 18px; line-height: 1; }
  .app-shell:has(#painel-menu[data-menu="recolhido"]) { grid-template-columns: 56px minmax(0, 1fr); }
  .app-shell:has(#painel-menu[data-menu="recolhido"]) #painel-menu { display: none; }
  .app-shell:has(#painel-menu[data-menu="recolhido"]) .sidebar-brand { width: 44px; }
  .app-shell:has(#painel-menu[data-menu="recolhido"]) .sidebar-brand > span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .app-shell:has(#painel-menu[data-menu="recolhido"]) .menu-toggle { flex-direction: column; gap: 2px; width: 44px; padding: 4px 0; font-size: 12px; }
  .app-shell:has(#painel-menu[data-menu="recolhido"]) .menu-toggle::before { content: "›" / ""; }
  .app-shell:has(#painel-menu[data-menu="recolhido"]) .menu-toggle-count { min-width: 0; padding: 0 4px; }
}
@media (min-width: 821px) and (max-width: 1279px) and (scripting: enabled) {
  .app-shell:has(#painel-menu:not([data-menu])) { grid-template-columns: 56px minmax(0, 1fr); }
  .app-shell:has(#painel-menu:not([data-menu])) #painel-menu { display: none; }
  .app-shell:has(#painel-menu:not([data-menu])) .sidebar-brand { width: 44px; }
  .app-shell:has(#painel-menu:not([data-menu])) .sidebar-brand > span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .app-shell:has(#painel-menu:not([data-menu])) .menu-toggle { flex-direction: column; gap: 2px; width: 44px; padding: 4px 0; font-size: 12px; }
  .app-shell:has(#painel-menu:not([data-menu])) .menu-toggle::before { content: "›" / ""; }
  .app-shell:has(#painel-menu:not([data-menu])) .menu-toggle-count { min-width: 0; padding: 0 4px; }
}
@media (prefers-reduced-motion: no-preference) {
  @media (min-width: 821px) and (scripting: enabled) {
    .app-shell { transition: grid-template-columns .15s ease-out; }
    html[data-menu-still] .app-shell { transition: none; }
  }
  @media (max-width: 820px) and (scripting: enabled) {
    .sidebar-panel { transition: transform .16s ease-in, visibility 0s .16s; }
    .sidebar[data-open] .sidebar-panel { transition: transform .2s ease-out, visibility 0s; }
    .menu-backdrop { transition: opacity .16s ease-in, visibility 0s .16s; }
    .sidebar[data-open] .menu-backdrop { transition: opacity .2s ease-out, visibility 0s; }
  }
}

/* Configurar agenda: header and tab bar density (#442, #774). Tokens only. */
.teleconsulta-page .workspace-header:has(+ .panel-tabs[aria-label="Configurar agenda"]) { flex-wrap: nowrap; }
.teleconsulta-page .workspace-header:has(+ .panel-tabs[aria-label="Configurar agenda"]) h1 { font-size: 36px; }
.teleconsulta-page .workspace-header:has(+ .panel-tabs[aria-label="Configurar agenda"]) > div { min-width: 0; }
.teleconsulta-page .workspace-header:has(+ .panel-tabs[aria-label="Configurar agenda"]) .button { flex: none; padding: 0 12px; border-radius: 10px; box-shadow: none; font-size: 15px; font-weight: 700; }
.teleconsulta-page .panel-tabs[aria-label="Configurar agenda"] .panel-tab { padding: 0 12px; border-radius: 10px; box-shadow: none; font-size: 15px; font-weight: 700; line-height: 1.2; }
.panel-tabs[aria-label="Configurar agenda"] ~ .day-agenda { margin-top: 0; }
.panel-tabs[aria-label="Configurar agenda"] ~ .day-agenda > .field-hint { margin: 0 0 4px; font-size: 13px; line-height: 1.4; color: var(--ink); }
.panel-tabs[aria-label="Configurar agenda"] ~ .day-agenda > .field-hint:has(+ form) { margin-bottom: 6px; }
.reassess-picker .bulk-weekday input { flex: none; width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0; accent-color: var(--forest); }
.reassess-picker .bulk-weekday input:focus-visible { outline: none; }
.reassess-picker .bulk-weekday:has(input:focus-visible) { outline: 3px solid var(--forest); outline-offset: 2px; }
@media (max-width: 480px) {
  .teleconsulta-page .workspace-header:has(+ .panel-tabs[aria-label="Configurar agenda"]) { flex-wrap: wrap; gap: 6px; }
  .teleconsulta-page .workspace-header:has(+ .panel-tabs[aria-label="Configurar agenda"]) h1 { font-size: 28px; line-height: 1.1; }
  .teleconsulta-page .workspace-header:has(+ .panel-tabs[aria-label="Configurar agenda"]) .button, .teleconsulta-page .panel-tabs[aria-label="Configurar agenda"] .panel-tab { font-size: 14px; }
}

/* Configurar agenda (OUT-20261102-agenda-config, #774): form, preview, result. Tokens only. Field borders use --muted (4.9:1), as the hi-fi asks, on this screen only. */
.cfg-help { max-width: 760px; margin: 0 0 14px; }
.workspace-header + .cfg-help { margin-top: 14px; }
.cfg-card, .cfg-preview { padding: 16px 20px; border: 1px solid var(--line); border-radius: 14px; background: white; margin: 0 0 12px; }
.cfg-preview { padding: 0; border: 0; background: transparent; }
.cfg-fieldset { min-width: 0; margin: 0 0 14px; padding: 0; border: 0; }
.cfg-fieldset legend { margin: 0 0 6px; padding: 0; font-size: 14px; font-weight: 750; }
.cfg-field { min-width: 0; margin: 0 0 14px; }
.cfg-field label { display: block; margin: 0 0 6px; font-size: 14px; font-weight: 750; }
.cfg-field input, .cfg-field select { display: block; width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--muted); border-radius: 10px; background: white; color: var(--ink); font: inherit; }
.cfg-field input[aria-invalid="true"], .cfg-field select[aria-invalid="true"] { border: 2px solid var(--danger); }
.cfg-field input:focus-visible, .cfg-field select:focus-visible, .cfg-reset:focus-visible, .fh-filters > summary:focus-visible, .fh-ck:has(input:focus-visible), #fh-top:focus-visible, #fh-title:focus-visible, .cfg-card summary:focus-visible, .cfg-day > summary:focus-visible, #cfg-title:focus-visible, .cfg-summary:focus-visible { outline: 3px solid var(--forest); outline-offset: 2px; }
.cfg-field .field-hint, .cfg-fieldset .field-hint { margin: 4px 0 0; }
.cfg-field .errorlist, .cfg-fieldset .errorlist { margin: 0 0 6px; padding: 8px 12px; font-size: 13px; font-weight: 650; }
.cfg-minutes { max-width: 372px; }
.cfg-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.cfg-opt { display: inline-flex; min-height: 44px; align-items: center; gap: 8px; margin: 0; padding: 6px 14px; border: 1px solid var(--muted); border-radius: 12px; background: white; font-weight: 650; line-height: 1.2; cursor: pointer; }
.cfg-opt input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--forest); }
.cfg-opt:has(input:checked) { border-color: var(--forest); background: var(--sage); color: var(--forest-dark); box-shadow: inset 0 -3px 0 var(--forest); }
.cfg-opt:has(input:focus-visible) { outline: 3px solid var(--forest); outline-offset: 2px; }
.cfg-reset { display: inline-flex; min-height: 44px; align-items: center; padding: 0; border: 0; background: none; color: var(--forest); font: inherit; font-weight: 750; text-decoration: underline; cursor: pointer; }
.cfg-reset[hidden] { display: none; }
.cfg-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 16px; }
/* A wrapped error above one time input must not push it off the other's line. */
.cfg-grid:has([data-times] .errorlist) > [data-times] { align-self: end; }
.cfg-summary { margin: 0 0 14px; padding: 10px 14px; font-size: 14px; }
.cfg-summary ul { display: grid; gap: 8px; margin: 4px 0 0; padding-left: 18px; }
.cfg-summary a { display: inline-flex; min-height: 44px; align-items: center; }
.cfg-summary-all { margin: 0; }
.cfg-count, .cfg-sum { max-width: 760px; margin: 2px 0 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--ivory); }
.cfg-count:empty { display: none; }
.cfg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cfg-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 0; }
.cfg-kv dt { color: var(--muted); font-size: 14px; }
.cfg-kv dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.cfg-box { margin: 10px 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: white; overflow-wrap: anywhere; }
.cfg-past { background: var(--ivory); }
.cfg-result ul { margin: 0; padding-left: 18px; }
.cfg-lead { margin: 0 0 6px; font-size: 17px; }
.cfg-h2 { margin: 14px 0 4px; font-size: 18px; }
.cfg-bulk { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 10px 0; padding: 6px 10px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.cfg-bulk[hidden] { display: none; }
.cfg-bulk .field-hint { display: inline; }
.cfg-cf { display: grid; grid-template-columns: 200px minmax(0, 1fr) auto; align-items: center; gap: 6px 14px; padding: 8px 0; border-top: 1px solid var(--line); }
.cfg-when { font-weight: 750; }
.cfg-what, .cfg-name { overflow-wrap: anywhere; }
.cfg-name { font-weight: 650; }
.cfg-seg { display: inline-flex; width: max-content; overflow: hidden; border: 1px solid var(--muted); border-radius: 10px; background: white; }
.cfg-seg label { display: inline-flex; min-height: 44px; align-items: center; gap: 6px; padding: 0 14px; font-weight: 650; cursor: pointer; }
.cfg-seg label + label { border-left: 1px solid var(--muted); }
.cfg-seg input { width: 18px; height: 18px; margin: 0; accent-color: var(--forest); }
.cfg-seg label:has(input:checked) { background: var(--sage); color: var(--forest-dark); box-shadow: inset 0 -3px 0 var(--forest); }
.cfg-seg label:has(input:focus-visible) { outline: 3px solid var(--forest); outline-offset: -3px; }
.cfg-only { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--sand); color: var(--sand-ink); font-size: 13px; font-weight: 750; }
.cfg-day { margin: 8px 0; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.cfg-day > summary { display: flex; min-height: 44px; align-items: center; gap: 8px; font-weight: 750; cursor: pointer; }
.cfg-bar { position: sticky; bottom: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 16px 0 0; padding: 10px 16px; border-top: 1px solid var(--line); background: white; box-shadow: 0 -6px 16px rgb(13 69 63 / 8%); }
.cfg-bar .button[aria-disabled="true"] { background: var(--line); color: var(--ink); box-shadow: none; cursor: not-allowed; }
@media (max-width: 820px) {
  .cfg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .cfg-cf { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .cfg-card { padding: 14px; }
  .cfg-grid { grid-template-columns: minmax(0, 1fr); }
  .cfg-types { display: grid; grid-template-columns: 1fr 1fr; }
  .cfg-actions > .button, .cfg-actions > button { flex: 1 1 100%; }
  .cfg-bar { padding: 10px 14px; }
}
/* Horários futuros (PR-5): the list, the selection bar, the filter disclosure and the removal confirm. */
.fh-filters { margin: 14px 0 10px; padding: 0 16px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.fh-filters > summary { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: 12px; list-style: none; font-weight: 750; cursor: pointer; overflow-wrap: anywhere; }
.fh-filters > summary::-webkit-details-marker { display: none; }
.fh-filters > summary::after { content: ""; flex: none; width: 8px; height: 8px; margin-right: 4px; border: solid var(--forest); border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); }
.fh-filters[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.teleconsulta-page .workspace:has(.fh-filters) > :is(.workspace-header, .messages) { width: auto; }
.fh-grid { display: grid; grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.1fr) minmax(0, 1.1fr) minmax(0, 1.95fr) minmax(0, 1.3fr); gap: 0 12px; }
.fh-filter-form .cfg-actions { padding-bottom: 14px; }
.fh-count { margin: 0 0 6px; }
.fh-bar { position: sticky; top: var(--fh-top, 0); z-index: 3; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 10px 0; padding: 6px 10px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.fh-bar .cfg-opt { border: 0; padding: 6px 8px; }
.fh-hint { margin: 0 0 6px; }
.fh-bar .button-danger[aria-disabled="true"] { border-color: var(--line); color: var(--muted); cursor: not-allowed; }
.fh-list { overflow: clip; border: 1px solid var(--line); border-radius: 14px; background: white; }
.fh-row { display: grid; grid-template-columns: 52px 120px 150px minmax(0, 1.6fr) minmax(0, 1fr); align-items: center; gap: 0 10px; min-height: 48px; padding-right: 12px; border-top: 1px solid var(--line); }
.fh-head { min-height: 34px; border-top: 0; color: var(--muted); font-size: 12px; font-weight: 750; }
.fh-on { background: #edf5f0; }
.fh-day { position: sticky; top: calc(var(--fh-top, 0px) + var(--fh-bar, 56px)); z-index: 1; padding: 6px 14px; border-top: 1px solid var(--line); background: var(--ivory); font-size: 14px; font-weight: 750; }
.fh-ck { display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; margin-left: 4px; cursor: pointer; }
.fh-ck input { width: 20px; height: 20px; margin: 0; accent-color: var(--forest); }
.fh-nobox { display: inline-flex; width: 44px; margin-left: 4px; justify-content: center; color: var(--muted); }
.fh-group { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.fh-name { font-weight: 650; overflow-wrap: anywhere; }
.fh-state { min-width: 0; }
.fh-pill { display: inline-block; margin-right: 4px; padding: 2px 9px; border-radius: 999px; font-size: 13px; font-weight: 750; white-space: nowrap; }
.fh-free { background: var(--sage); color: var(--forest-dark); }
.fh-held { background: var(--sand); color: var(--sand-ink); }
.fh-book { background: var(--forest); color: white; }
.fh-pend { border: 2px solid var(--sand-ink); background: white; color: var(--sand-ink); }
.fh-wk { border: 1px solid var(--muted); background: white; color: var(--ink); }
#fh-title { font-size: 32px; line-height: 1.15; overflow-wrap: anywhere; }
.fh-empty { padding: 20px; border: 1px dashed var(--muted); border-radius: 14px; background: white; text-align: center; }
.fh-empty p { margin: 0 0 10px; }
.fh-empty .cfg-actions, .fh-top { justify-content: center; }
.fh-top { margin-top: 10px; }
.fh-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 980px; margin: 0 0 12px; }
.fh-cols .cfg-box { margin: 0; }
.fh-cols ul { margin: 0; padding-left: 18px; }
.fh-cols li { margin: 4px 0; overflow-wrap: anywhere; }
@media (max-width: 820px) {
  .fh-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) and (scripting: enabled) {
  .fh-form { --fh-top: 56px; } /* the menu bar of the phone layout is sticky too (56 px) */
}
@media (max-width: 640px) {
  .fh-row { grid-template-columns: 52px minmax(0, 1fr); align-items: start; padding: 4px 12px 4px 0; }
  .fh-row > :first-child { grid-row: span 4; align-self: center; }
  .fh-head { display: none; }
  .fh-row > :nth-child(n+2) { grid-column: 2; }
  .fh-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  #fh-title { font-size: 28px; line-height: 1.1; }
  .fh-grid { grid-template-columns: minmax(0, 1fr); }
  .fh-bar .cfg-actions, .fh-bar .cfg-actions > .button { width: 100%; }
}
/* Menu em todas as telas (OUT-20261024-admin-menu-everywhere, #448) */
.teleconsulta-page .panel-card { box-sizing: border-box; width: min(800px, 100%); margin: 0; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); box-shadow: none; }
.teleconsulta-page .panel-card.panel-form { width: min(640px, 100%); }
.teleconsulta-page .workspace:has(> .panel-card) > .messages { box-sizing: border-box; width: min(800px, 100%); margin: 0 0 12px; }
.teleconsulta-page .workspace:has(> .panel-form) > .messages { width: min(640px, 100%); }
.teleconsulta-page .panel-card .back-link { margin-bottom: 4px; }
.teleconsulta-page .panel-card .eyebrow { margin: 0 0 4px; }
.teleconsulta-page .panel-card h1 { margin: 0 0 12px; font-size: 32px; line-height: 1.15; overflow-wrap: anywhere; }
.teleconsulta-page .panel-card form > div { margin-bottom: 14px; }
.teleconsulta-page .panel-card label { margin-bottom: 6px; }
.teleconsulta-page .panel-card input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]), .teleconsulta-page .panel-card select { min-height: 44px; }
.teleconsulta-page .panel-card textarea { height: 88px; min-height: 88px; }
.teleconsulta-page .panel-card .button { min-height: 44px; }
.teleconsulta-page .panel-card .button-wide { min-height: 48px; margin-top: 4px; }
.teleconsulta-page .panel-card .sex-options label { min-height: 44px; }
.teleconsulta-page .panel-card .field-hint { margin: 4px 0 14px; }
.teleconsulta-page .panel-card .status-pill, .teleconsulta-page .panel-card .preview-note, .teleconsulta-page .panel-card .recurrence-note { margin: 0 0 8px; }
.teleconsulta-page .panel-card .muted-copy { margin: 0 0 12px; }
.teleconsulta-page .panel-card .portal-facts { margin: 0 0 12px; font-size: 16px; }
.teleconsulta-page .panel-card .patient-phone { margin: 0 0 12px; font-size: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.teleconsulta-page .panel-card > p { margin: 0 0 8px; }
.teleconsulta-page .panel-card .patient-clinical { gap: 8px; margin: 8px 0; }
.teleconsulta-page .panel-card .patient-clinical div, .teleconsulta-page .panel-card .observation-list > div { padding: 10px 12px; }
.teleconsulta-page .panel-card .patient-clinical dd { margin: 4px 0 0; }
.teleconsulta-page .panel-card .action-row { flex-direction: row; flex-wrap: wrap; align-items: center; }
.teleconsulta-page .panel-card .history-section { margin-top: 16px; }
.teleconsulta-page .panel-card .history-section h2 { margin: 0 0 8px; font-size: 18px; }
.teleconsulta-page .patient-record > .history-section + .action-row { margin-top: 16px; }
.teleconsulta-page .panel-card .history-list, .teleconsulta-page .panel-card .patient-list { gap: 6px; }
.teleconsulta-page .panel-card .history-list > p, .teleconsulta-page .panel-card .patient-list > p { margin: 0; }
.teleconsulta-page .panel-card .patient-clinical-merge ~ .history-list + p { margin-top: 8px; }
.teleconsulta-page .panel-card .history-list a, .teleconsulta-page .panel-card .history-list .history-static { min-height: 44px; flex-wrap: wrap; padding: 8px 12px; gap: 4px 12px; }
.teleconsulta-page .panel-card .patient-row, .teleconsulta-page .panel-card .trash-row { display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 8px 12px; }
.teleconsulta-page .panel-card .patient-row > span, .teleconsulta-page .panel-card .trash-row > span { min-width: 0; overflow-wrap: anywhere; }
.teleconsulta-page .panel-card .patient-row form, .teleconsulta-page .panel-card .trash-row form { flex: none; }
.teleconsulta-page .panel-card .text-button { min-height: 44px; padding: 0 8px; }
.teleconsulta-page .panel-card .portal-form { gap: 8px; }
.teleconsulta-page .panel-card .portal-form .button, .teleconsulta-page .panel-card .portal-form select { min-height: 44px; }
.teleconsulta-page .panel-card .danger-zone { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 18px; margin-top: 16px; padding-top: 8px; }
.teleconsulta-page .panel-card .danger-zone button { min-height: 44px; padding: 0 12px; }
.teleconsulta-page .panel-card .danger-zone label { display: inline-flex; align-items: center; min-height: 44px; gap: 8px; }
.teleconsulta-page .panel-card .status-actions { flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; }
.teleconsulta-page .panel-card a:focus-visible, .teleconsulta-page .panel-card button:focus-visible, .teleconsulta-page .panel-card .button:focus-visible { outline: 3px solid var(--forest); outline-offset: 2px; }
@media (max-width: 820px) {
  .teleconsulta-page .panel-card { padding: 16px; }
  .teleconsulta-page .panel-card h1 { font-size: 26px; }
  .teleconsulta-page .panel-card .datetime-parts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .teleconsulta-page .panel-card .datetime-part:first-child { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .teleconsulta-page .panel-card .action-row { flex-direction: column; align-items: stretch; }
  .teleconsulta-page .panel-card .action-row .button { width: 100%; }
  .teleconsulta-page .panel-card .danger-zone form { grid-template-columns: auto auto; }
  .teleconsulta-page .panel-card .danger-zone form button { grid-column: 1 / -1; }
}

/* Notas clínicas no cadastro do paciente (OUT-20261024-clinical-notes) */
.panel-card .note-history { margin-top: 10px; }
.panel-card .note-history + .history-section { margin-top: 16px; }
.panel-card .action-row > .note-history { margin: 0 0 0 auto; align-self: center; flex: 1 1 auto; }
.action-row > .note-history h2 { white-space: nowrap; }
.action-row .note-head .button { width: auto; min-height: 44px; }
.note-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 10px; margin-bottom: 8px; }
.note-head h2 { margin: 0; font-size: 18px; }
.teleconsulta-page .panel-card .note-head h2 { margin: 0; }
.action-row > .note-history .note-head { margin-bottom: 0; }
.note-head .button { min-height: 44px; margin-left: auto; white-space: nowrap; }
.note-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.note-item { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.note-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 14px; }
.note-meta .status-pill { margin: 0; padding: 3px 8px; font-size: 12px; }
.note-author { color: var(--muted); }
.note-corrects { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.note-body { margin: 8px 0 0; overflow-wrap: anywhere; line-height: 1.5; }
.note-correct { display: inline-flex; min-height: 44px; align-items: center; margin-left: auto; padding: 0 4px; color: var(--forest); font-weight: 700; }
.note-clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; line-clamp: 6; overflow: hidden; }
.note-item:has(.note-long[open]) .note-clamp { display: block; -webkit-line-clamp: unset; line-clamp: unset; overflow: visible; }
.note-toggle { display: flex; min-height: 44px; align-items: center; color: var(--forest); font-weight: 700; cursor: pointer; list-style: none; }
.note-toggle::-webkit-details-marker { display: none; }
.note-toggle-less, .note-long[open] .note-toggle-more { display: none; }
.note-long[open] .note-toggle-less { display: inline; }
.note-empty { margin: 0; color: var(--muted); }
.note-pages { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.note-pages .button { min-height: 44px; }
.note-context { margin: 0 0 12px; color: var(--muted); }
.note-original { margin: 0 0 14px; padding: 10px 14px; border-left: 4px solid var(--sage); background: var(--ivory); overflow-wrap: anywhere; }
.note-form-card textarea { min-height: 180px; }
.note-form-card textarea[aria-invalid="true"] { border: 2px solid var(--danger); }
.note-form-card label + .errorlist { margin: 4px 0 7px; }
@media (max-width: 480px) {
  .panel-card .action-row:has(> .note-history .button) { flex-direction: row; flex-wrap: wrap; }
  .panel-card .action-row:has(> .note-history .button) > .button { flex: 1 1 0; width: auto; }
  .panel-card .action-row > .note-history:has(.button) { margin: 0; flex: 1 1 0; }
  .panel-card .action-row > .note-history:not(:has(.button)) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .panel-card .action-row > .note-history h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .panel-card .action-row .note-head .button { width: 100%; }
  .note-pages .button { width: 100%; }
}

/* Agenda: dias com atendimentos, Dia em 768 px, marca 44 px (OUT-20261025-admin-agenda-names). Tokens only. */
.mini-day.has-items { position: relative; font-weight: 750; }
.mini-day.has-items::after { position: absolute; bottom: 5px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--forest); content: ""; }
.mini-day.is-selected.has-items::after { background: var(--white); }
@media (min-width: 700px) and (max-width: 820px) {
  /* Dia: the calendar beside the list, as from 1100 px, so no empty band flanks it */
  .daily-agenda-page:not(.agenda-semana) .workspace { display: grid; grid-template-columns: 360px minmax(0, 1fr); align-content: start; column-gap: 20px; }
  .daily-agenda-page:not(.agenda-semana) .workspace > .preview-banner, .daily-agenda-page:not(.agenda-semana) .workspace > .workspace-header, .daily-agenda-page:not(.agenda-semana) .workspace > .messages, .daily-agenda-page:not(.agenda-semana) .workspace > .agenda-toolbar { grid-column: 1 / -1; }
  .daily-agenda-page:not(.agenda-semana) .workspace > .agenda-toolbar { width: 100%; margin-inline: 0; }
  .daily-agenda-page:not(.agenda-semana) .mini-calendar, .daily-agenda-page:not(.agenda-semana) .day-agenda { width: 100%; margin: 0; align-self: start; }
}
.app-shell .sidebar-brand { min-width: 44px; min-height: 44px; }
.app-shell .sidebar-brand:focus-visible { outline: 3px solid var(--champagne); outline-offset: 2px; border-radius: 8px; }
@media (forced-colors: active) { .mini-day.has-items::after { background: CanvasText; forced-color-adjust: none; } }
/* Popups de bloqueio e cadastro (OUT-20261022-admin-overlays, #443) */
.dialog-close:focus-visible { outline: 3px solid var(--forest); outline-offset: 2px; }
.entry-dialog .dialog-content.form-card { padding: 28px; }
.entry-dialog .dialog-content .eyebrow { margin: 0 0 4px; font-size: 12px; }
.entry-dialog .dialog-content h1 { margin: 0 0 16px; font-size: 24px; line-height: 1.2; }
.entry-dialog .dialog-content .button:focus-visible { outline: 3px solid var(--forest); outline-offset: 2px; }
.entry-dialog .dialog-content form > div { margin-bottom: 14px; }
.entry-dialog .dialog-content label { margin-bottom: 6px; }
.entry-dialog .dialog-content input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]), .entry-dialog .dialog-content select { min-height: 44px; }
.entry-dialog .dialog-content textarea { min-height: 88px; resize: vertical; }
.entry-dialog .dialog-content .sex-options { gap: 10px; }
.entry-dialog .dialog-content .sex-options label { min-height: 44px; padding: 8px 14px; }
.entry-dialog .dialog-content .phone-parts { gap: 12px; margin-bottom: 0; align-items: start; }
.entry-dialog .dialog-content .field-hint { margin: 4px 0 14px; font-size: 13px; line-height: 1.5; }
.entry-dialog .dialog-content .errorlist { margin: 0 0 6px; padding: 8px 12px; scroll-margin-top: 60px; }
.entry-dialog .dialog-content .button-wide { min-height: 48px; margin-top: 4px; }
.entry-dialog .dialog-content .errorlist:focus { outline: 3px solid var(--forest); outline-offset: 2px; }
.entry-dialog .dialog-content .phone-parts > div { display: flex; flex-direction: column; }
.entry-dialog .dialog-content .phone-parts .errorlist { order: 1; margin: 6px 0 0; }
.dialog-close[aria-disabled="true"] { opacity: .65; cursor: not-allowed; }
.patient-record > .messages { margin: 22px 0 16px; }
@media (max-width: 600px) {
  .entry-dialog .dialog-content.form-card { padding: 20px 16px; }
  .entry-dialog .dialog-content h1 { font-size: 22px; }
}
@media (max-width: 420px) {
  .entry-dialog .datetime-parts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entry-dialog .datetime-part:first-child { grid-column: 1 / -1; }
}
@media (forced-colors: active) {
  .dialog-close { border: 1px solid ButtonText; }
}
