/* Scheduling UI: responsive, semantic and directional. */
.calendar-page{width:100%;max-width:1440px;margin-inline:auto;min-width:0}
.calendar-kicker{color:var(--primary,#087e89);font-size:.7rem;letter-spacing:.12em;font-weight:800}
.calendar-layout{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);align-items:start;gap:16px;margin-top:16px}
.calendar-month-panel,.calendar-agenda-panel{min-width:0;padding:17px}
.calendar-month-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:14px}
.calendar-month-head h2{font-size:1.15rem;margin:0;font-weight:800;text-transform:capitalize}
.calendar-filter{display:flex;align-items:center;gap:12px;margin:0 0 15px}.calendar-filter label{white-space:nowrap;font-size:.85rem}.calendar-filter select{flex:1;min-width:0}
.calendar-month-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px;direction:ltr}
.calendar-weekday{font-weight:800;text-align:center;font-size:.7rem;padding:8px 0;opacity:.7}
.calendar-day,.calendar-pad{min-height:53px;min-width:0}
.calendar-day{appearance:none;background:var(--card-bg,var(--surface,transparent));border:1px solid var(--border,#dae6e9);border-radius:11px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;color:inherit;cursor:pointer;position:relative;font-weight:750}
.calendar-day.selected{outline:2px solid #168793;outline-offset:-2px;background:rgba(15,130,145,.12)}.calendar-day.today{color:#048896}
.calendar-day-total{font-size:.7rem;background:#dceff0;color:#075963;border-radius:8px;padding:1px 6px}.calendar-day i{width:5px;height:5px;border-radius:50%;background:#d7a642;position:absolute;inset-block-start:5px;inset-inline-end:6px}
.calendar-day:focus-visible,.calendar-doc-item:focus-visible{outline:3px solid #36a0db;outline-offset:2px}
.calendar-agenda-head{display:flex;align-items:center;justify-content:space-between;gap:10px;border-bottom:1px solid var(--border,#dce5e7);padding-bottom:14px}
.calendar-agenda-head h2{font-size:1.13rem;text-transform:capitalize;margin:4px 0}.calendar-agenda-head small{font-size:.65rem;letter-spacing:.1em;color:var(--text-muted,#687d88)}
.calendar-appointments{display:flex;flex-direction:column;gap:9px;padding-top:13px}
.calendar-event{display:grid;grid-template-columns:63px minmax(0,1fr) auto;align-items:center;gap:12px;padding:12px;border:1px solid var(--border,#dee7eb);border-inline-start:3px solid #168793;border-radius:11px;background:var(--card-bg,transparent)}
.calendar-event[data-calendar-status=pending]{border-inline-start-color:#d3a23e}.calendar-event[data-calendar-status=cancelled]{opacity:.62;border-inline-start-color:#9ba3aa}
.calendar-hour{font-weight:800;font-variant-numeric:tabular-nums;color:#168793}.calendar-event-main{min-width:0;overflow-wrap:anywhere;display:flex;flex-direction:column;gap:5px}.calendar-event-main strong{font-weight:750}.calendar-event-main small{color:var(--text-muted,#65717b)}
.calendar-meta{display:flex;flex-wrap:wrap;gap:5px}.calendar-meta span{font-size:.67rem;border-radius:8px;padding:3px 7px;background:var(--surface-subtle,#edf3f6);color:var(--text-muted,#526577)}
.calendar-empty{display:flex;flex-direction:column;align-items:center;text-align:center;gap:9px;padding:35px 10px;color:var(--text-muted,#596a76)}.calendar-empty>span{font-size:2rem}.calendar-empty p{margin:0}
.calendar-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.calendar-form .full{grid-column:1/-1}.calendar-patient-results{display:flex;flex-direction:column;max-height:170px;overflow:auto;gap:2px}.calendar-patient-results button{background:transparent;border:1px solid var(--border,#dee4e8);border-radius:6px;text-align:start;padding:10px;color:inherit;cursor:pointer}
.calendar-selected{font-size:.85rem;font-weight:700;color:var(--primary,#168793)}.calendar-help{font-size:.81rem;line-height:1.5;color:var(--text-muted,#607580)}.calendar-treatment-badge{grid-column:1/-1;padding:10px;border-radius:9px;background:rgba(20,130,150,.1)}
.calendar-document-actions{display:flex;flex-wrap:wrap;gap:10px;margin:15px 0}.calendar-approval{display:flex;align-items:flex-start;gap:10px;font-size:.9rem;line-height:1.5}.calendar-approval input{margin-top:5px}
.calendar-doc-group{border-top:1px solid var(--border,#dfe6e8);padding-top:10px;margin-top:14px}.calendar-doc-group h3{font-size:.95rem}.calendar-doc-item{width:100%;display:flex;justify-content:space-between;gap:15px;align-items:center;padding:11px;background:transparent;color:inherit;border:0;border-bottom:1px solid var(--border,#dfe6e8);cursor:pointer;text-align:start}.calendar-followup-entry{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.calendar-followup-entry .clinical-followup-row{flex:1;min-width:200px}
:root[data-theme=dark] .calendar-day-total{background:#1c4e51;color:#b6e5ea}:root[data-theme=dark] .calendar-day.today{color:#7bd9df}
@media(max-width:920px){.calendar-layout{grid-template-columns:1fr}}
@media(max-width:490px){.calendar-month-panel,.calendar-agenda-panel{padding:11px}.calendar-day,.calendar-pad{min-height:44px}.calendar-month-grid{gap:3px}.calendar-day-total{padding:1px 4px}.calendar-event{grid-template-columns:48px minmax(0,1fr);gap:8px}.calendar-event-actions{grid-column:2;justify-self:start}.calendar-form{grid-template-columns:1fr}.calendar-form .full{grid-column:1}.calendar-filter{flex-wrap:wrap}}
html[dir=rtl] .calendar-event{border-inline-start-color:#168793}

.calendar-patient-create{margin:8px 0;border:1px solid var(--border,#dce5eb);padding:10px;border-radius:9px}.calendar-patient-create > summary{cursor:pointer;font-size:.85rem;font-weight:650}.calendar-new-patient{display:flex;flex-direction:column;gap:8px;padding:12px 0 0}.calendar-new-patient input{width:100%}

html[dir=rtl] .calendar-month-grid{direction:rtl}
@media(max-width:640px){
 .calendar-page>.screen-head{display:flex;flex-direction:column;align-items:stretch;gap:12px}
 .calendar-page>.screen-head>div:first-child{width:100%;min-width:0}
 .calendar-page>.screen-head h1{font-size:1.35rem;line-height:1.25}
 .calendar-page>.screen-head .screen-actions{width:100%;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px}
 .calendar-page>.screen-head .screen-actions .btn{font-size:.82rem;min-width:0;white-space:normal;line-height:1.3;padding:10px 7px}
}

/* v1.11: editable appointments, mobile-first editing dialog */
.calendar-event-actions{display:flex;flex-wrap:wrap;gap:6px;align-items:center;justify-content:flex-end}
.calendar-event-actions .btn{min-height:37px;white-space:normal;text-align:center}
.calendar-archive-switch{display:flex;align-items:center;gap:9px;font-size:.81rem;color:var(--text-muted,#536e7c);padding:0 0 12px}
.calendar-archive-switch input{width:18px;height:18px;accent-color:#087f8d}
.calendar-edit-intro{padding:14px;border:1px solid var(--border,#e0e8ee);border-radius:14px;margin-bottom:14px;background:var(--surface-2,#f0f5f6);display:flex;flex-direction:column;gap:3px}
.calendar-edit-intro strong{font-size:1.08rem;overflow-wrap:anywhere}
.calendar-edit-intro small{font-size:.75rem;color:var(--text-muted,#647581)}
.calendar-edit-label{font-size:.64rem;font-weight:800;letter-spacing:.11em;color:var(--primary,#087d8a)}
.calendar-edit-form :is(input,select,textarea){width:100%;min-width:0;min-height:43px;font:inherit;font-size:16px;color:var(--text)}
.calendar-edit-form label{display:block;margin-bottom:5px;font-weight:700;font-size:.81rem}
.calendar-edit-danger{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px;margin-top:18px;border:1px solid color-mix(in srgb,#c75f64 30%,transparent);border-radius:12px}
.calendar-edit-danger>div{display:flex;flex-direction:column;gap:3px;min-width:0}
.calendar-edit-danger strong{font-size:.84rem}
.calendar-edit-danger small{font-size:.75rem;color:var(--text-muted,#647581)}
.calendar-edit-danger .btn{flex-shrink:0}
@media(max-width:620px){
 .calendar-event-actions{grid-column:1/-1;justify-content:flex-start;width:100%}
 .calendar-event-actions .btn{flex:1;min-width:90px}
 .calendar-edit-danger{flex-direction:column;align-items:stretch}
 .calendar-edit-danger .btn{width:100%}
 .calendar-edit-form{grid-template-columns:minmax(0,1fr)}
 .calendar-edit-form .field{min-width:0}
 #modal-root .modal:has(.calendar-edit-form){max-height:min(94dvh,940px);width:100%;min-width:0}
 #modal-root .modal:has(.calendar-edit-form) .modal-body{overflow-y:auto;min-height:0;flex:1}
 #modal-root .modal:has(.calendar-edit-form) .modal-foot{display:grid;grid-template-columns:1fr;gap:8px;position:relative;padding-bottom:calc(12px + env(safe-area-inset-bottom))}
 #modal-root .modal:has(.calendar-edit-form) .modal-foot .btn{min-height:46px;width:100%}
}
@media(max-width:365px){.calendar-event-actions{flex-direction:column}.calendar-event-actions .btn{width:100%}}

/* v1.12 — interactive office timetable, 08:00 through the last 23:30 slot. */
.calendar-layout{grid-template-columns:minmax(235px,.32fr) minmax(0,1fr);gap:14px}
.calendar-month-panel{position:relative}
.calendar-month-summary{display:none;cursor:pointer;font-weight:750;color:var(--text);padding:4px 0 11px}
.calendar-day-toolbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:12px 0 6px}
.calendar-day-toolbar>input[type=date]{max-width:171px;min-height:39px;padding:7px 8px;color:var(--text);background:var(--surface,#fff);border:1px solid var(--border,#ddd);border-radius:9px;font:inherit;font-size:.88rem}
.calendar-doctor-filter{display:flex;align-items:center;gap:6px;min-width:170px;flex:1;font-size:.77rem;color:var(--text-muted,#657687)}
.calendar-doctor-filter select{min-width:0;max-width:100%;flex:1;min-height:39px;padding:5px;background:var(--surface,#fff);color:var(--text);border:1px solid var(--border,#ddd);border-radius:9px}
.calendar-usage-help{font-size:.76rem;color:var(--text-muted,#657687);line-height:1.45;margin:6px 0 12px}
.calendar-timeline-scroller{width:100%;max-height:min(66dvh,790px);min-height:300px;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;border:1px solid var(--border,#e0e5ea);border-radius:13px;scrollbar-gutter:stable}
.calendar-timeline-grid{position:relative;display:grid;grid-template-columns:58px minmax(0,1fr);grid-template-rows:repeat(32,58px);background:var(--surface,#fff);isolation:isolate}
.cal-time-label{grid-column:1;display:flex;align-items:flex-start;justify-content:center;font-size:.74rem;color:var(--text-muted,#5d7180);padding-top:5px;border-top:1px solid var(--border,#e3eaf0);font-weight:750;font-variant-numeric:tabular-nums}
.calendar-slot{grid-column:2;width:100%;min-width:0;display:flex;justify-content:flex-end;align-items:center;min-height:58px;height:58px;padding:5px 12px;border:0;border-block-start:1px solid var(--border,#e3eaf0);background:transparent;color:var(--primary,#168793);cursor:pointer;text-align:end;position:relative}
.calendar-slot:nth-of-type(2n){background:color-mix(in srgb,var(--surface,#fff) 88%,var(--primary,#1595a0) 12%)}
.calendar-slot:hover:not(:disabled),.calendar-slot:focus-visible{background:color-mix(in srgb,var(--primary,#168793) 12%,var(--surface,#fff));outline:2px solid var(--primary,#168793);outline-offset:-2px}
.calendar-slot:disabled{opacity:.32;cursor:not-allowed}
.calendar-slot .slot-plus{font-size:1.1rem;font-weight:800;opacity:.1}.calendar-slot:hover:not(:disabled) .slot-plus,.calendar-slot:focus-visible .slot-plus{opacity:1}
.calendar-event-layer{position:absolute;inset-block:0;inset-inline-start:58px;inset-inline-end:0;pointer-events:none;z-index:2}
.calendar-timed-event{pointer-events:auto;min-width:0;display:flex;flex-direction:column;gap:3px;background:color-mix(in srgb,var(--surface,#fff) 78%,#31a5b4 22%);border:1px solid color-mix(in srgb,#2d8da8 55%,var(--border,#ccc));border-inline-start:4px solid #168caa;border-radius:8px;padding:5px 8px;box-shadow:0 1px 6px rgba(0,0,0,.07);color:var(--text,#243942);overflow:hidden}
.calendar-timed-event.positioned{position:absolute}
.calendar-timed-event[data-calendar-status=pending]{background:color-mix(in srgb,var(--surface,#fff) 80%,#d4ac54 20%);border-inline-start-color:#c99727}
.calendar-timed-event[data-calendar-status=cancelled]{opacity:.57;border-inline-start-color:#999}
.calendar-timed-event strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:800;font-size:.8rem}
.calendar-timed-event small{font-size:.69rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%;color:var(--text-muted,#506473)}
.calendar-timed-top{display:flex;gap:5px;align-items:center;min-height:17px;font-size:.72rem;font-weight:750}
.calendar-status-dot{width:7px;height:7px;border-radius:50%;background:#179e80;flex-shrink:0}
.calendar-timed-event[data-calendar-status=pending] .calendar-status-dot{background:#b28d35}
.calendar-origin{margin-inline-start:auto;font-size:.62rem;white-space:nowrap;color:var(--text-muted,#536876)}
.calendar-drag-handle{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;border:1px solid var(--border,#ddd);border-radius:5px;cursor:grab;touch-action:none;user-select:none;min-height:25px;min-width:30px;background:var(--surface,#fff);font-size:1.1rem;color:var(--text)}
.calendar-drag-handle.drag-active{cursor:grabbing;background:var(--primary,#168793);color:white}
.calendar-timed-actions{display:flex;gap:7px;margin-top:auto;flex-wrap:wrap;align-items:center}
.calendar-event-edit,.calendar-event-pdf{font-size:.72rem;min-height:26px;background:var(--surface,#fff);border-radius:6px;border:1px solid var(--border,#cdd);padding:2px 7px;cursor:pointer;color:var(--text)}
.calendar-event-edit:focus-visible,.calendar-drag-handle:focus-visible{outline:2px solid var(--primary,#168793)}
.calendar-timeline-grid.cal-dragging::after{content:'';position:absolute;inset-inline:58px 0;top:var(--cal-drop-y,0px);height:58px;border:2px dashed #20a09b;box-sizing:border-box;background:rgba(32,160,155,.13);pointer-events:none;z-index:3}
.calendar-timeline-end{font-size:.75rem;color:var(--text-muted,#627786);font-weight:700;text-align:start;margin:4px 4px 0 60px}
.calendar-untimed{padding-top:12px;border-top:1px solid var(--border,#ddd);margin-top:12px;display:flex;flex-direction:column;gap:8px}
.calendar-untimed h3{font-size:.85rem;margin:0}.calendar-untimed .calendar-timed-event{padding:10px;min-height:80px}
.calendar-move-review{display:flex;flex-direction:column;gap:9px}.calendar-move-review p{margin:0}.calendar-move-review small{color:var(--text-muted,#627786)}
html[dir=rtl] .calendar-timeline-grid{direction:ltr} /* time progression is always top-to-bottom; event content retains its own direction */
html[dir=rtl] .calendar-timed-event{direction:rtl}
html[dir=rtl] .calendar-day-toolbar{direction:rtl}
html[lang=fr] .clinic-context-nav,html[lang=fr] .bottom-nav,html[lang=fr] .more-groups{direction:ltr}
@media(max-width:960px){.calendar-layout{grid-template-columns:1fr}.calendar-month-panel{max-width:none}.calendar-month-summary{display:list-item}.calendar-month-panel:not([open]){padding:12px 16px}.calendar-month-panel[open]{padding:12px 16px}.calendar-agenda-panel{padding:12px}}
@media(max-width:720px){.calendar-timeline-scroller{max-height:min(63dvh,630px)}.calendar-day-toolbar{display:grid;grid-template-columns:38px minmax(0,1fr) 38px;gap:6px}.calendar-day-toolbar>input[type=date]{width:100%;max-width:none}.calendar-doctor-filter{grid-column:1/-1;min-width:0}.calendar-timeline-grid{grid-template-columns:48px minmax(0,1fr)}.calendar-event-layer{inset-inline-start:48px}.cal-time-label{font-size:.68rem}.calendar-timeline-grid.cal-dragging::after{inset-inline:48px 0}.calendar-timeline-end{margin-inline-start:50px}.calendar-timed-event{padding:5px;gap:3px}.calendar-timed-top{gap:3px}.calendar-timed-event strong{font-size:.73rem}.calendar-origin{font-size:.58rem}.calendar-drag-handle{min-width:30px}}
@media(max-width:350px){.calendar-origin{display:none}.calendar-timed-event small{display:none}.calendar-event-edit{font-size:.68rem}.calendar-timeline-scroller{scrollbar-gutter:auto}}
@media(prefers-reduced-motion:reduce){.calendar-slot,.calendar-timed-event{transition:none}}
.calendar-slot.calendar-slot-blocked{background:color-mix(in srgb,var(--surface,#fff) 85%,#c06267 15%);color:#b15059;cursor:not-allowed;opacity:.82}
.calendar-slot.calendar-slot-blocked .slot-plus{opacity:.8}
.calendar-timed-event[data-short="1"]{gap:2px;padding:3px 7px}
.calendar-timed-event[data-short="1"] small{display:none}
.calendar-timed-event[data-short="1"] .calendar-timed-top{min-height:14px}
.calendar-timed-event[data-short="1"] strong{font-size:.75rem;line-height:1.1}
.calendar-timed-event[data-short="1"] .calendar-drag-handle{min-height:22px}
.calendar-timed-event[data-short="1"] .calendar-timed-actions{margin-top:0}
.calendar-timed-event[data-short="1"] .calendar-event-edit,.calendar-timed-event[data-short="1"] .calendar-event-pdf{min-height:20px;font-size:.68rem;padding:0 5px}
/* 30-minute appointments fit one fully readable compact card, including actions. */
.calendar-timed-event[data-short="1"]{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:20px 20px;column-gap:5px;row-gap:1px;align-content:center;padding:3px 6px}
.calendar-timed-event[data-short="1"] .calendar-timed-top{grid-column:1/-1;grid-row:1;min-width:0}
.calendar-timed-event[data-short="1"] strong{grid-column:1;grid-row:2;align-self:center;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.calendar-timed-event[data-short="1"] .calendar-timed-actions{grid-column:2;grid-row:2;flex-wrap:nowrap;align-items:center;gap:3px}

/* v1.13.0 — full-width five-day dental office planning board. */
.calendar-planning-page{max-width:none;width:100%;min-width:0}
.calendar-planning-panel{min-width:0;width:100%;padding:14px}
.calendar-range-toolbar{display:flex;align-items:end;flex-wrap:wrap;gap:7px;margin:12px 0 9px}
.calendar-range-toolbar>.btn{min-width:41px;min-height:42px;font-size:1.12rem;font-weight:800}
.calendar-start-date{display:flex;flex-direction:column;gap:3px;min-width:145px;font-size:.74rem;color:var(--text-muted,#637986);font-weight:750}
.calendar-start-date input{width:100%;min-width:0;min-height:40px;padding:6px;border-radius:9px;border:1px solid var(--border,#dce4eb);background:var(--surface,#fff);color:var(--text,#283c45);font:inherit;font-size:.9rem}
.calendar-range-toolbar>.calendar-doctor-filter{min-width:178px;flex:1;max-width:360px}
.calendar-day-jumps{display:none;gap:6px;margin:0 0 10px;overflow-x:auto;scrollbar-width:thin}
.calendar-jump-pill{flex:0 0 auto;min-height:37px;padding:7px 10px;background:var(--surface,#fff);border:1px solid var(--border,#dce4eb);border-radius:11px;color:var(--text,#283c45);cursor:pointer;font-size:.76rem;font-weight:750}
.calendar-jump-pill.selected{border-color:var(--primary,#168b94);background:color-mix(in srgb,var(--primary,#168b94) 12%,var(--surface,#fff))}
.calendar-planning-meta{display:flex;gap:8px 16px;align-items:start;flex-wrap:wrap;margin:0 0 10px}
.calendar-planning-meta .calendar-archive-switch{padding:0;flex:0 0 auto}
.calendar-planning-meta .calendar-usage-help{flex:1 1 310px;margin:0}
.calendar-planning-scroll{width:100%;max-height:min(76dvh,900px);min-height:360px;overflow:auto;overscroll-behavior:contain;border:1px solid var(--border,#dce5ea);border-radius:12px;scrollbar-gutter:stable}
.calendar-planning-grid{display:grid;position:relative;isolation:isolate;direction:ltr;grid-template-columns:60px repeat(5,minmax(0,1fr));grid-template-rows:59px repeat(32,var(--cal-slot-height,54px));min-width:1060px;background:var(--surface,#fff)}
.calendar-planning-corner{position:sticky;top:0;left:0;z-index:8;background:var(--surface-2,#eaf2f4);border-right:1px solid var(--border,#dce5ea);border-bottom:1px solid var(--border,#dce5ea);display:flex;align-items:center;justify-content:center;font-size:.75rem;font-weight:800;color:var(--text-muted,#667987)}
.calendar-planning-day-head{position:sticky;top:0;z-index:6;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:5px;background:var(--surface-2,#f0f5f6);color:var(--text,#20333d);border-bottom:2px solid var(--border,#dce5ea);border-right:1px solid var(--border,#dce5ea);font-size:.9rem;font-weight:800;text-transform:capitalize;white-space:nowrap}
.calendar-planning-day-head.is-today{border-bottom-color:var(--primary,#168793);background:color-mix(in srgb,var(--primary,#168793) 12%,var(--surface,#fff))}
.calendar-planning-day-head small{font-size:.68rem;color:var(--text-muted,#627886);font-weight:650}
.calendar-multi-time{position:sticky;left:0;z-index:3;display:flex;justify-content:center;align-items:flex-start;padding-top:6px;background:var(--surface,#fff);color:var(--text-muted,#647886);font-size:.73rem;font-weight:800;border-top:1px solid var(--border,#e2eaf0);border-right:1px solid var(--border,#dce5ea);font-variant-numeric:tabular-nums}
.calendar-multi-slot{min-width:0;width:100%;height:var(--cal-slot-height,54px);display:flex;align-items:center;justify-content:flex-end;padding-inline:9px;border:0;border-top:1px solid var(--border,#e2eaf0);border-right:1px solid var(--border,#e2eaf0);background:var(--surface,#fff);color:var(--primary,#168793);cursor:pointer}
.calendar-multi-slot:nth-child(2n){background:color-mix(in srgb,var(--surface,#fff) 96%,var(--primary,#168793) 4%)}
.calendar-multi-slot span{opacity:.14;font-size:1.05rem;font-weight:800}
.calendar-multi-slot:hover:not(:disabled),.calendar-multi-slot:focus-visible{background:color-mix(in srgb,var(--primary,#168793) 12%,var(--surface,#fff));outline:2px solid var(--primary,#168793);outline-offset:-2px}
.calendar-multi-slot:hover:not(:disabled) span,.calendar-multi-slot:focus-visible span{opacity:1}
.calendar-multi-slot:disabled{cursor:not-allowed;opacity:.52}
.calendar-multi-slot.calendar-slot-blocked{background:color-mix(in srgb,#c75a61 13%,var(--surface,#fff));color:#a74850}
.calendar-multi-slot.calendar-slot-blocked span{opacity:.8}
.calendar-multi-slot.cal-drop-target{background:color-mix(in srgb,var(--primary,#168793) 25%,var(--surface,#fff));outline:3px dashed var(--primary,#168793);outline-offset:-3px}
.calendar-multi-event-layer{position:relative;min-width:0;z-index:2;pointer-events:none;border-right:1px solid var(--border,#e2eaf0)}
.calendar-multi-event-layer .calendar-timed-event{position:absolute;pointer-events:auto}
.calendar-planning-grid .calendar-timed-event{font-size:.77rem}
.calendar-planning-grid .calendar-timed-event strong{font-size:.76rem}
.calendar-planning-grid .calendar-origin{font-size:.60rem}
.calendar-planning-grid .calendar-drag-handle{touch-action:none}
html[dir=rtl] .calendar-planning-day-head{direction:rtl}
html[dir=rtl] .calendar-planning-grid .calendar-timed-event{direction:rtl}
@media(max-width:1100px){.calendar-planning-panel{padding:11px}.calendar-planning-grid{min-width:1050px}}
@media(max-width:720px){
 .calendar-planning-page>.screen-head{gap:10px}
 .calendar-range-toolbar{display:grid;grid-template-columns:40px 40px minmax(0,1fr) 40px 40px;gap:5px;margin:10px 0}
 .calendar-range-toolbar>.btn{min-width:0;min-height:43px;padding:4px}
 .calendar-range-toolbar>.calendar-doctor-filter{grid-column:1/-1;min-width:0;max-width:none}
 .calendar-range-toolbar>.calendar-start-date{min-width:0}
 .calendar-day-jumps{display:flex}
 .calendar-planning-meta .calendar-usage-help{font-size:.72rem}
 .calendar-planning-scroll{max-height:min(71dvh,710px);min-height:340px;scrollbar-gutter:auto}
 .calendar-planning-panel .calendar-agenda-head h2{font-size:.99rem}
 .calendar-planning-grid{min-width:1120px}
}
@media(max-width:365px){.calendar-planning-panel{padding:8px}.calendar-planning-page>.screen-head h1{font-size:1.18rem}}


/* v1.13.1 — full-height Agenda: one vertical scroll, owned by the appointment grid. */
html.clinic-calendar-focus,body.clinic-calendar-focus{height:100%;overflow:hidden;overscroll-behavior:none}
body.clinic-calendar-focus #app{height:100%;overflow:hidden}
body.clinic-calendar-focus .shell[data-screen="calendar"]{
  height:100dvh;min-height:0;overflow:hidden;grid-template-rows:64px minmax(0,1fr);
}
body.clinic-calendar-focus .shell[data-screen="calendar"] .content{
  width:100%;max-width:none;height:100%;min-height:0;min-width:0;
  margin:0;padding:8px 12px calc(71px + var(--safe-bottom));
  display:flex;flex-direction:column;gap:5px;overflow:hidden;
}
body.clinic-calendar-focus .shell[data-screen="calendar"] #main{
  flex:1 1 0;min-height:0;min-width:0;overflow:hidden;display:flex;flex-direction:column;
}
body.clinic-calendar-focus .calendar-planning-page{
  width:100%;max-width:none;height:100%;min-height:0;min-width:0;
  display:flex;flex-direction:column;gap:5px;overflow:hidden;
}
body.clinic-calendar-focus .calendar-planning-page>.screen-head{flex:0 0 auto;margin:0;min-width:0}
body.clinic-calendar-focus .calendar-planning-panel{
  flex:1 1 0;min-height:0;min-width:0;overflow:hidden;
  display:flex;flex-direction:column;gap:6px;padding:9px 11px;
}
body.clinic-calendar-focus .calendar-planning-panel .calendar-agenda-head{flex:0 0 auto;padding-bottom:5px}
body.clinic-calendar-focus .calendar-planning-panel .calendar-agenda-head h2{margin:2px 0;font-size:1rem}
body.clinic-calendar-focus .calendar-range-toolbar{flex:0 0 auto;margin:3px 0;gap:5px}
body.clinic-calendar-focus .calendar-planning-meta{flex:0 0 auto;margin:0;gap:5px 10px}
body.clinic-calendar-focus .calendar-day-jumps{flex:0 0 auto;margin:0}
body.clinic-calendar-focus #calendar-day-events{
  flex:1 1 0;min-height:0;min-width:0;overflow:hidden;
  display:flex;flex-direction:column;
}
body.clinic-calendar-focus .calendar-planning-scroll{
  flex:1 1 0;min-height:0;max-height:none;height:auto;min-width:0;
  overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;
  -webkit-overflow-scrolling:touch;
}
body.clinic-calendar-focus .calendar-untimed{
  flex:0 0 auto;max-height:min(105px,20dvh);overflow-y:auto;margin-top:5px;padding-top:4px;
}
.calendar-planning-view-actions{display:flex;align-items:center;gap:6px;flex-shrink:0}
.calendar-focus-button{display:flex;align-items:center;gap:5px;white-space:nowrap}
.calendar-focus-button[aria-pressed="true"]{border-color:var(--primary,#168793);color:var(--primary,#168793)}
@media(min-width:850px){
  body.clinic-calendar-focus .shell[data-screen="calendar"]{grid-template-rows:72px minmax(0,1fr)}
  body.clinic-calendar-focus .shell[data-screen="calendar"] .content{padding:10px 15px 10px}
  body.clinic-calendar-focus .calendar-planning-page>.screen-head h1{font-size:22px}
  body.clinic-calendar-focus .calendar-planning-page>.screen-head p{display:none}
  body.clinic-calendar-focus .calendar-planning-meta .calendar-usage-help{font-size:.72rem}
}
@media(max-width:849px){
  body.clinic-calendar-focus .shell[data-screen="calendar"]{grid-template-rows:62px minmax(0,1fr)}
  body.clinic-calendar-focus .shell[data-screen="calendar"] .content{padding:6px 6px calc(66px + var(--safe-bottom))}
  body.clinic-calendar-focus .calendar-planning-panel{padding:6px;gap:4px}
  body.clinic-calendar-focus .calendar-planning-page>.screen-head{gap:5px}
  body.clinic-calendar-focus .calendar-planning-page>.screen-head .calendar-kicker,
  body.clinic-calendar-focus .calendar-planning-page>.screen-head p{display:none}
  body.clinic-calendar-focus .calendar-planning-page>.screen-head h1{font-size:1.07rem}
  body.clinic-calendar-focus .calendar-planning-page>.screen-head .screen-actions .btn{padding:6px 7px;min-height:34px;font-size:.72rem}
  body.clinic-calendar-focus .calendar-planning-meta .calendar-usage-help{display:none}
  body.clinic-calendar-focus .calendar-range-toolbar>.btn{min-height:34px}
  body.clinic-calendar-focus .calendar-range-toolbar .calendar-start-date input{min-height:34px}
  body.clinic-calendar-focus .calendar-day-jumps .calendar-jump-pill{min-height:29px;padding:4px 8px}
  body.clinic-calendar-focus .calendar-focus-button{min-height:32px}
  body.clinic-calendar-focus .calendar-focus-button span{display:none}
}
/* Hide only nonessential application chrome in focus mode; keep the exit button. */
body.calendar-immersive .shell[data-screen="calendar"]{
  grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr);
}
body.calendar-immersive .shell[data-screen="calendar"] .topbar,
body.calendar-immersive .shell[data-screen="calendar"] .bottom-nav,
body.calendar-immersive .shell[data-screen="calendar"] #clinic-active-banner{display:none!important}
body.calendar-immersive .shell[data-screen="calendar"] .content{
  grid-column:1;grid-row:1;padding:6px 8px max(6px,env(safe-area-inset-bottom));
}
body.calendar-immersive .calendar-planning-page>.screen-head .calendar-kicker,
body.calendar-immersive .calendar-planning-page>.screen-head p{display:none}
@media(prefers-reduced-motion:reduce){body.clinic-calendar-focus .calendar-planning-scroll{scroll-behavior:auto}}
/* Comfortable appointment columns on tablets and phones; no second vertical scroller. */
@media(min-width:721px) and (max-width:1100px){
 body.clinic-calendar-focus .calendar-planning-grid{min-width:1410px}
}
@media(max-width:720px){
 body.clinic-calendar-focus .calendar-planning-grid{
  min-width:calc(60px + 5 * max(250px, calc(100vw - 96px)));
 }
 body.clinic-calendar-focus .calendar-planning-panel .calendar-agenda-head{align-items:center;gap:5px}
 body.clinic-calendar-focus .calendar-planning-panel .calendar-agenda-head small{display:none}
 body.clinic-calendar-focus .calendar-planning-panel .calendar-agenda-head>div{min-width:0;flex:1}
 body.clinic-calendar-focus .calendar-planning-panel .calendar-agenda-head h2{
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:.83rem;margin:0;
 }
 body.clinic-calendar-focus .calendar-start-date>span{display:none}
 body.clinic-calendar-focus .calendar-range-toolbar{margin:1px 0}
}

/* v1.13.2 — unobtrusive in-place online booking notification; no blocking modal. */
.calendar-live-alert[hidden]{display:none!important}
.calendar-live-alert{display:flex;align-items:center;gap:9px;flex:0 0 auto;min-width:0;
 border:1px solid color-mix(in srgb,var(--primary,#168793) 35%,var(--border,#d8e3e8));
 border-radius:11px;background:color-mix(in srgb,var(--primary,#168793) 8%,var(--surface,#fff));
 color:var(--text,#20333d);padding:7px 10px;font-size:.78rem}
.calendar-live-indicator{width:8px;height:8px;border-radius:50%;background:#178f70;flex:0 0 auto}
.calendar-live-alert strong{font-size:.79rem}
.calendar-live-summary{flex:1 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.calendar-live-alert button{border:1px solid var(--border,#dce5ea);border-radius:8px;background:var(--surface,#fff);color:var(--text,#20333d);font:inherit;padding:5px 8px;cursor:pointer}
.calendar-live-alert button:focus-visible{outline:2px solid var(--primary,#168793)}
.calendar-live-dismiss{font-size:1.1rem!important;min-width:31px}
@media(max-width:480px){.calendar-live-alert{flex-wrap:wrap;gap:6px;padding:7px}.calendar-live-summary{max-width:100%;order:2;flex-basis:100%}.calendar-live-alert strong{flex:1}}

/* v1.13.3 — Adaptive immersive planning. Desktop fits 08:00–16:00 when the
 * available viewport is tall enough; short displays retain a readable 36px
 * minimum. All five columns, drag targets and timed cards use identical rows.
 */
@media(min-width:850px){
 body.calendar-immersive .calendar-planning-panel{gap:3px;padding:5px 8px}
 body.calendar-immersive .calendar-planning-page>.screen-head{gap:4px}
 body.calendar-immersive .calendar-range-toolbar{margin:1px 0}
 body.calendar-immersive .calendar-planning-meta{margin:0}
 body.calendar-immersive .calendar-agenda-head{padding-bottom:2px}
 body.calendar-immersive .calendar-planning-scroll{min-height:0}
}
/* Compact 30-minute appointment at adaptive slot heights: single readable
 * row with time, patient name and drag/edit control. The drag handle is also
 * clickable for editing; full booking details remain in its title tooltip.
 */
.calendar-planning-grid[data-slot-mode="compact"] .calendar-timed-event[data-short="1"]{
 display:grid;grid-template-columns:39px minmax(0,1fr) 23px;grid-template-rows:minmax(0,1fr);
 column-gap:4px;row-gap:0;padding:2px 4px;align-items:center;align-content:stretch;
}
.calendar-planning-grid[data-slot-mode="compact"] .calendar-timed-event[data-short="1"] .calendar-timed-top{display:contents}
.calendar-planning-grid[data-slot-mode="compact"] .calendar-timed-event[data-short="1"] time{grid-column:1;grid-row:1;font-size:.66rem;font-weight:800;align-self:center}
.calendar-planning-grid[data-slot-mode="compact"] .calendar-timed-event[data-short="1"] strong{
 grid-column:2;grid-row:1;min-width:0;font-size:.68rem;line-height:1.15;
 overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.calendar-planning-grid[data-slot-mode="compact"] .calendar-timed-event[data-short="1"] .calendar-drag-handle{
 grid-column:3;grid-row:1;min-height:23px;min-width:23px;width:23px;
 font-size:.8rem;padding:0;
}
.calendar-planning-grid[data-slot-mode="compact"] .calendar-timed-event[data-short="1"] :is(.calendar-status-dot,.calendar-origin,small,.calendar-timed-actions){display:none}

/* Immersive desktop mode removes duplicate headings and help copy; calendar
 * controls, date navigation, practitioner filter and an Add RDV button stay.
 * This recovers enough vertical space for 08:00–16:00 on common monitors. */
.calendar-focus-create{display:none}
@media(min-width:850px){
 body.calendar-immersive .calendar-planning-page>.screen-head{display:none}
 body.calendar-immersive .calendar-planning-meta{display:none}
 body.calendar-immersive .calendar-focus-create{display:inline-flex;white-space:nowrap}
 body.calendar-immersive .calendar-agenda-head>div:first-child>small{display:none}
 body.calendar-immersive .calendar-planning-page .calendar-planning-panel .calendar-agenda-head{min-height:37px}
}
/* Keep 60/90-minute cards readable when the timetable is compressed.
 * Secondary practitioner/treatment details remain available in the title
 * tooltip and through Modifier, rather than being clipped over action buttons.
 */
.calendar-planning-grid[data-slot-mode="compact"] .calendar-timed-event{
 padding:3px 5px;gap:1px;
}
.calendar-planning-grid[data-slot-mode="compact"] .calendar-timed-event small{display:none}
.calendar-planning-grid[data-slot-mode="compact"] .calendar-timed-event .calendar-timed-top{min-height:16px}
.calendar-planning-grid[data-slot-mode="compact"] .calendar-timed-event .calendar-timed-actions{gap:3px;margin-top:1px}
.calendar-planning-grid[data-slot-mode="compact"] .calendar-timed-event :is(.calendar-event-edit,.calendar-event-pdf){min-height:20px;font-size:.66rem;padding:0 5px}

/* v1.13.4 — Compact semantic legend. Inside the existing planning header,
 * so it does not steal another row from the full-screen time grid. */
.calendar-color-legend{display:flex;align-items:center;justify-content:center;gap:8px;flex:0 1 auto;min-width:0;white-space:nowrap;direction:inherit}
.calendar-legend-item{display:inline-flex;align-items:center;gap:4px;font-size:.71rem;font-weight:680;line-height:1.2;color:var(--text-muted,#607580)}
.calendar-legend-swatch{display:inline-block;flex:0 0 10px;width:10px;height:10px;border-radius:3px;border:1px solid transparent}
.calendar-legend-swatch.confirmed{background:#82c9db;border-color:#168caa}
.calendar-legend-swatch.pending{background:#f2d997;border-color:#c99727}
.calendar-legend-swatch.cancelled{background:#c1c9d0;border-color:#7d8790}
.calendar-legend-swatch.blocked{background:#e9b3b8;border-color:#a74850}
.calendar-planning-grid .calendar-timed-event[data-calendar-status=confirmed] .calendar-status-dot{background:#168caa}
.calendar-color-legend:focus-within{outline-offset:3px}
@media (min-width:850px){
 body.calendar-immersive .calendar-color-legend{gap:6px}
 body.calendar-immersive .calendar-legend-item{font-size:.69rem}
}
@media(max-width:1120px){
 .calendar-color-legend{gap:5px}
 .calendar-legend-item{font-size:.66rem}
}
@media(max-width:849px){
 .calendar-agenda-head{flex-wrap:wrap}
 .calendar-color-legend{order:3;flex:1 0 100%;justify-content:flex-start;overflow-x:auto;padding:1px 0 4px;scrollbar-width:thin}
 html[dir=rtl] .calendar-color-legend{justify-content:flex-start}
}
@media(max-width:849px){
 /* The focused Agenda previously assigned flex:1 to every direct header div.
    Override that legacy selector so the legend always occupies its own line. */
 body.clinic-calendar-focus .calendar-planning-panel .calendar-agenda-head>.calendar-color-legend{
  order:3;flex:0 0 100%;width:100%;min-width:0;max-width:100%;
  justify-content:flex-start;overflow-x:auto;
 }
}

/* v1.13.6 – Details on desktop hover/keyboard focus; tap the card on mobile.
 * A fixed overlay escapes the timetable's overflow clipping. */
.calendar-appointment-tooltip{position:fixed;z-index:10050;pointer-events:none;
  background:var(--surface,#fff);color:var(--text,#20333d);
  border:1px solid var(--border,#d3e1e8);border-radius:13px;
  box-shadow:0 14px 40px rgba(7,41,56,.22);padding:12px 14px;
  font-size:.77rem;line-height:1.45;text-align:start;max-height:calc(100dvh - 20px);overflow:hidden;
  direction:inherit}
.calendar-detail-title{font-size:.96rem;font-weight:850;color:var(--text,#1a3240);margin-bottom:8px;overflow-wrap:anywhere}
.calendar-detail-line{display:flex;gap:12px;align-items:baseline;justify-content:space-between;padding:4px 0;border-bottom:1px solid var(--border,#e1e8ed)}
.calendar-detail-line span{color:var(--text-muted,#617684);flex:0 0 37%}
.calendar-detail-line strong{font-weight:700;flex:1;min-width:0;overflow-wrap:anywhere;text-align:end}
.calendar-detail-warning{font-size:.73rem;margin:9px 0 0;color:var(--danger,#a85434);font-weight:650;line-height:1.5}
.calendar-detail-modal{font-size:.91rem;line-height:1.5}
.calendar-timed-event[data-calendar-card]{cursor:pointer}
.calendar-timed-event[data-calendar-card]:focus-visible{outline:3px solid var(--primary,#14829b);outline-offset:-2px}
.availability-grid .slot.uncertain,.timeslots .slot.uncertain{border-color:#b7803f;background:color-mix(in srgb,#e9c68b 22%,var(--surface,#fff));opacity:.86}
@media(hover:none){.calendar-appointment-tooltip{display:none}}

.calendar-patient-create .calendar-new-patient{display:block}.calendar-patient-create .form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.calendar-patient-create .form-grid>.full{grid-column:1/-1}@media(max-width:530px){.calendar-patient-create .form-grid{grid-template-columns:1fr}.calendar-patient-create .form-grid>.field{grid-column:1}}

/* v1.16.0 — compact single-card calendar appointment workflow */
#modal-root .modal:has(.calendar-new-form){width:min(600px,calc(100vw - 12px));max-height:min(95dvh,830px);border-radius:18px}
#modal-root .modal:has(.calendar-new-form) .modal-head{padding:10px 15px}
#modal-root .modal:has(.calendar-new-form) .modal-body{padding:10px 14px;min-height:0;overflow-y:auto;overscroll-behavior:contain}
#modal-root .modal:has(.calendar-new-form) .modal-foot{padding:9px 14px calc(9px + var(--safe-bottom,0px))}
.calendar-new-form{gap:7px 10px;grid-template-columns:repeat(2,minmax(0,1fr))}
.calendar-new-form .field{gap:3px;min-width:0}
.calendar-new-form .field label{font-size:11px}
.calendar-new-form .field :is(input,select){min-height:34px;height:34px;border-radius:8px;padding:5px 8px;font-size:12px}
.calendar-new-form .calendar-appointment-top{color:var(--muted,#6b7c85);font-size:10px;letter-spacing:.05em;font-weight:850}
.calendar-slot-summary{display:flex;gap:12px;justify-content:space-between;align-items:center;border:1px solid color-mix(in srgb,var(--primary,#168793) 25%,var(--border,#ddd));border-radius:11px;background:color-mix(in srgb,var(--primary,#168793) 7%,var(--surface,#fff));padding:8px 11px}
.calendar-slot-summary small{display:block;font-size:10px;color:var(--text-muted,#617684)}
.calendar-slot-summary strong{font-size:13px;white-space:nowrap}
.calendar-slot-locked{font-size:10px;font-weight:750;white-space:nowrap;color:var(--primary,#168793)}
.calendar-new-form .calendar-patient-block{gap:4px}
.calendar-new-form .calendar-selected{font-size:12px;min-height:31px;display:flex;align-items:center;padding:6px 10px;border:1px dashed var(--border,#dce5eb);border-radius:9px;color:var(--text-muted,#617684);font-weight:650;line-height:1.4;overflow-wrap:anywhere}
.calendar-new-form .calendar-selected.is-selected{font-size:14px;font-weight:850;color:var(--text,#163640);background:color-mix(in srgb,#16803f 10%,var(--surface,#fff));border:1px solid #16803f;box-shadow:inset 3px 0 0 #16803f}
html[dir="rtl"] .calendar-new-form .calendar-selected.is-selected{box-shadow:inset -3px 0 0 #16803f}
.calendar-detail-modal+.modal-foot{gap:9px}
#modal-root .modal:has(.calendar-detail-modal) .modal-foot{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap}
#modal-root .modal:has(.calendar-detail-modal) #calendar-send-waiting{background:#16803f;border-color:#16803f;color:#fff;font-weight:800}
#modal-root .modal:has(.calendar-detail-modal) #calendar-send-waiting:hover{background:#116b33}
@media(max-width:530px){#modal-root .modal:has(.calendar-detail-modal) .modal-foot>*{flex:1;min-width:0}}
.calendar-new-form .calendar-patient-create{padding:0;border:none;margin:1px 0 0}
.calendar-new-form .calendar-patient-create > summary{display:block;list-style:none;width:fit-content;border-radius:9px;padding:7px 12px;font-size:12px;font-weight:850;cursor:pointer;color:white;background:#16803f;border:1px solid #116b33}
.calendar-new-form .calendar-patient-create > summary::-webkit-details-marker{display:none}
.calendar-new-form .calendar-patient-create > summary:hover{background:#106b34}
.calendar-new-form .calendar-patient-create[open]{padding:7px;border:1px solid color-mix(in srgb,#16803f 28%,var(--border,#ddd));border-radius:11px;background:color-mix(in srgb,#16803f 4%,var(--surface,#fff))}
.calendar-new-form .calendar-patient-create[open] > summary{margin-bottom:6px}
.calendar-new-form .calendar-new-patient{padding:0;gap:6px}
.calendar-new-form .calendar-patient-create .form-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.calendar-new-form .calendar-patient-create .form-grid>.field{grid-column:auto}
.calendar-new-form .calendar-patient-create .form-grid>.full{grid-column:1/-1}
.calendar-new-form .calendar-patient-create .form-grid :is(input,select){height:33px;min-height:33px}
.calendar-new-form .calendar-patient-create #calendar-add-patient{margin-top:6px;background:#16803f;border-color:#16803f;color:#fff}
.calendar-new-form .calendar-reason-field #calendar-reason-custom:not([hidden]){margin-top:4px}
.calendar-new-form .calendar-reason-field #calendar-reason-custom[hidden]{display:none}
.calendar-new-form .calendar-patient-results:empty{display:none}
.calendar-new-form .calendar-patient-results{max-height:80px}
.calendar-new-form .calendar-patient-results button{padding:6px;font-size:11px}
@media(max-width:530px){
 #modal-root .modal:has(.calendar-new-form){max-height:calc(100dvh - 8px)}
 .calendar-new-form{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
 .calendar-new-form>.full{grid-column:1/-1}
 .calendar-new-form .calendar-patient-create .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .calendar-slot-summary{padding:6px 8px;gap:5px}
 .calendar-slot-summary strong{font-size:11px}
 .calendar-slot-locked{font-size:9px}
}

/* Optional email is not a creation action: never inherit the green new-patient button. */
.calendar-new-form .calendar-patient-create .clinic-registration-extra > summary{display:list-item;width:auto;border:0;background:transparent;color:var(--text-2,var(--text));padding:3px 0;font-size:11px;font-weight:650;border-radius:0;list-style:disclosure-closed}
.calendar-new-form .calendar-patient-create .clinic-registration-extra[open] > summary{list-style:disclosure-open;margin-bottom:2px}
.calendar-new-form .calendar-patient-create .clinic-registration-extra > summary:hover{background:transparent;color:var(--text)}

/* v1.16.4 — Adaptive Agenda, expanded by default without taking over the app shell. */
body.clinic-calendar-focus .shell[data-screen="calendar"] .content{
  gap:0;
}
body.clinic-calendar-focus .calendar-planning-page{
  gap:0;
}
body.clinic-calendar-focus .calendar-planning-panel{
  padding:clamp(4px,.55vw,8px);gap:5px;border-radius:12px;
}
body.clinic-calendar-focus .calendar-planning-panel>.calendar-agenda-head{
  gap:8px;flex-wrap:nowrap;min-height:35px;align-items:center;
  padding:0 2px 5px;
}
body.clinic-calendar-focus .calendar-agenda-head>div:first-child{flex:1 1 auto;min-width:0}
body.clinic-calendar-focus .calendar-agenda-head h2{font-size:clamp(12px,1vw,16px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0}
body.clinic-calendar-focus .calendar-agenda-head>div:first-child>small{display:none}
body.clinic-calendar-focus .calendar-planning-view-actions{display:flex;align-items:center;justify-content:flex-end;gap:5px;min-width:0;flex-wrap:nowrap}
body.clinic-calendar-focus .calendar-planning-view-actions>.btn{min-height:32px;padding:5px 8px;font-size:11px;white-space:nowrap}
body.clinic-calendar-focus .calendar-focus-create{display:none!important} /* #calendar-create has the live handler */
body.clinic-calendar-focus .calendar-range-toolbar{margin:1px 0 3px;gap:5px;min-height:0}
body.clinic-calendar-focus .calendar-range-toolbar>.btn{min-height:32px;padding:4px 8px}
body.clinic-calendar-focus .calendar-range-toolbar :is(.calendar-start-date input,.calendar-doctor-filter select){min-height:32px;height:32px}
body.clinic-calendar-focus .calendar-start-date>span{display:none}
body.clinic-calendar-focus .calendar-day-jumps{margin:1px 0 3px}
body.clinic-calendar-focus .calendar-planning-scroll{min-height:0;max-height:none}
.calendar-compact-options{position:relative;flex:0 0 auto;z-index:18;font-size:12px}
.calendar-compact-options>summary{list-style:none;display:flex;align-items:center;justify-content:center;gap:4px;cursor:pointer;background:var(--surface-2,#f2f5f7);color:var(--text,#263a43);border:1px solid var(--border,#dce4eb);border-radius:9px;padding:6px 8px;min-height:32px;font-weight:750;white-space:nowrap}
.calendar-compact-options>summary::-webkit-details-marker{display:none}
.calendar-compact-options>summary:focus-visible{outline:2px solid var(--primary,#168793);outline-offset:2px}
.calendar-compact-options-body{position:absolute;inset-inline-end:0;top:calc(100% + 6px);z-index:30;width:min(320px,calc(100vw - 25px));padding:12px;border-radius:12px;border:1px solid var(--border,#dce4eb);background:var(--surface,#fff);box-shadow:0 16px 40px rgba(0,0,0,.2);display:grid;gap:10px;white-space:normal;direction:inherit}
.calendar-compact-options:not([open]) .calendar-compact-options-body{display:none}
.calendar-compact-options .calendar-color-legend{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;white-space:normal;order:initial;width:100%;overflow:visible}
.calendar-compact-options .calendar-legend-item{font-size:11px}
.calendar-compact-options .calendar-planning-meta{display:grid;gap:8px;margin:0}
.calendar-compact-options .calendar-planning-meta .calendar-usage-help{display:block;font-size:11px;line-height:1.35;margin:0}
.calendar-compact-options #calendar-documents{display:inline-flex;justify-self:start;font-size:11px;min-height:31px}
@media(min-width:850px){
 body.clinic-calendar-focus .calendar-planning-panel{gap:3px}
 body.clinic-calendar-focus .calendar-range-toolbar{flex-wrap:nowrap}
 body.clinic-calendar-focus .calendar-range-toolbar>.calendar-doctor-filter{max-width:260px;min-width:145px}
 body.clinic-calendar-focus .calendar-planning-view-actions>.btn{font-size:11px}
}
@media(max-width:849px){
 body.clinic-calendar-focus .calendar-planning-panel>.calendar-agenda-head{flex-wrap:wrap;gap:3px;padding-bottom:3px}
 body.clinic-calendar-focus .calendar-agenda-head>div:first-child{flex:1 1 100%;}
 body.clinic-calendar-focus .calendar-planning-view-actions{width:100%;justify-content:space-between;gap:3px}
 body.clinic-calendar-focus .calendar-planning-view-actions>.btn{flex:0 1 auto;min-height:30px;font-size:10.5px;padding:4px 6px}
 body.clinic-calendar-focus .calendar-compact-options>summary{min-height:30px;font-size:10.5px;padding:4px 6px}
 body.clinic-calendar-focus .calendar-planning-panel{padding:4px;gap:3px}
 body.clinic-calendar-focus .calendar-range-toolbar{margin:1px 0;gap:4px}
 body.clinic-calendar-focus .calendar-range-toolbar>.btn{min-height:32px}
 body.clinic-calendar-focus .calendar-range-toolbar>.calendar-doctor-filter{max-width:none}
 body.clinic-calendar-focus .calendar-day-jumps .calendar-jump-pill{min-height:28px;padding:3px 8px}
}
@media(max-width:390px){
 body.clinic-calendar-focus .calendar-planning-view-actions>.btn{font-size:9.5px;padding:4px 5px}
 body.clinic-calendar-focus .calendar-compact-options>summary{font-size:10px;padding:4px 5px}
}

/* v1.16.5 — clinic arrival is distinct from calendar booking confirmation. */
.calendar-timed-event[data-clinic-arrival]{
 border-inline-start-color:#0d8767;
 background:color-mix(in srgb,var(--surface,#fff) 78%,#33b990 22%);
}
.calendar-arrival-pill{display:inline-flex;align-items:center;max-width:100%;min-width:0;
 padding:1px 5px;border-radius:5px;background:color-mix(in srgb,#0d936e 14%,var(--surface,#fff));
 border:1px solid color-mix(in srgb,#0d936e 45%,transparent);color:var(--text,#1e4b3e);
 font-weight:800;font-size:.61rem;line-height:1.1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.calendar-arrival-detail{padding:7px 10px;border-radius:8px;
 background:color-mix(in srgb,#0d936e 12%,var(--surface,#fff));
 border:1px solid color-mix(in srgb,#0d936e 35%,transparent);
 color:var(--text,#194a3e);font-weight:800;text-align:center}
/* For compact 30-minute tiles, keep a second short line with the arrival
   status while the time, patient and edit handle remain readable above. */
.calendar-planning-grid[data-slot-mode="compact"] .calendar-timed-event[data-short="1"][data-clinic-arrival]{
 grid-template-rows:minmax(0,1fr) 12px;row-gap:0;
}
.calendar-planning-grid[data-slot-mode="compact"] .calendar-timed-event[data-short="1"] .calendar-arrival-pill{
 grid-column:1/-1;grid-row:2;display:block;align-self:center;
 font-size:.59rem;line-height:1;max-width:100%;padding:0 2px;
 background:transparent;border:0;color:var(--text,#124a39);
}
@media(max-width:720px){.calendar-arrival-pill{font-size:.58rem;padding:1px 3px}}
/* v1.16.6 — appointment details: print and email without hunting for an event card's PDF icon. */
.calendar-confirmation-actions{display:flex;flex-wrap:wrap;gap:8px;padding-top:10px;margin-top:10px;border-top:1px solid var(--border)}
.calendar-confirmation-actions .btn{flex:1 1 190px;min-height:36px;white-space:normal;text-align:center}

/* v1.16.9: verified recipient before transmitting appointment / patient PDFs. */
.calendar-recipient-form{display:flex;flex-direction:column;gap:9px;min-width:0}
.calendar-recipient-form p{margin:2px 0}
.calendar-email-patient{display:flex;flex-direction:column;gap:3px;padding:9px 12px;background:var(--surface-2,#edf4f6);border-radius:10px;overflow-wrap:anywhere}
.calendar-email-patient small,.calendar-email-final-review small{color:var(--text-muted,#607580);font-size:.76rem}
.calendar-email-patient strong{font-size:1.08rem}
.calendar-email-label{font-weight:750;font-size:.88rem}
.calendar-recipient-form .calendar-email-input{width:100%;max-width:100%;box-sizing:border-box;min-height:45px;padding:10px 12px;border:1px solid var(--border,#cbdde2);border-radius:9px;background:var(--card-bg,#fff);color:inherit;font-size:16px;text-align:left}
.calendar-recipient-form .calendar-email-input:focus{outline:2px solid #168793;outline-offset:1px}
.calendar-recipient-form .calendar-approval{gap:9px;align-items:center;line-height:1.35}
.calendar-recipient-form .calendar-approval input{width:20px;height:20px;flex:0 0 auto;margin:0;accent-color:#168793}
.calendar-email-final-review{padding:13px;border:1px solid #168793;border-radius:11px;background:color-mix(in srgb,#168793 7%,var(--card-bg,#fff));overflow-wrap:anywhere}
.calendar-email-final-review[hidden]{display:none!important}
.calendar-email-final-review strong{display:block;font-size:1.03rem;margin-top:5px;overflow-wrap:anywhere}
.calendar-email-final-review .calendar-document-actions{margin-bottom:0}
@media(max-width:530px){.calendar-recipient-form .calendar-document-actions{display:grid;grid-template-columns:1fr;margin:8px 0}.calendar-recipient-form .calendar-document-actions .btn{width:100%;min-height:42px}}

/* v1.19.2: unmistakable appointment count within each five-day header. */
.calendar-planning-day-head .calendar-day-rdv{display:inline-flex;align-items:center;gap:5px;font-weight:750;color:var(--text-muted,#627886);font-size:.66rem;line-height:1.2;}
.calendar-planning-day-head .calendar-day-rdv-count{min-width:21px;min-height:20px;padding:2px 6px;display:inline-flex;align-items:center;justify-content:center;border-radius:7px;background:color-mix(in srgb,var(--text-muted,#7c8993) 14%,var(--surface,#fff));font-weight:900;font-size:.76rem;font-variant-numeric:tabular-nums;}
.calendar-planning-day-head .calendar-day-rdv[data-has-rdv="true"]{color:var(--text,#163543)}
.calendar-planning-day-head .calendar-day-rdv[data-has-rdv="true"] .calendar-day-rdv-count{background:#078e93;color:white;box-shadow:0 2px 6px rgba(7,142,147,.22)}
.calendar-planning-day-head .calendar-day-rdv[data-busy="true"] .calendar-day-rdv-count{background:#bf5920;color:white;box-shadow:0 2px 6px rgba(191,89,32,.2)}
.calendar-jump-pill .calendar-jump-count{display:inline-flex;min-width:20px;align-items:center;justify-content:center;border-radius:6px;padding:1px 5px;margin-inline-start:3px;background:#078e93;color:#fff;font-size:.7rem;font-variant-numeric:tabular-nums}
:root[data-theme=dark] .calendar-planning-day-head .calendar-day-rdv[data-has-rdv="true"]{color:#c9f7f2}
:root[data-theme=dark] .calendar-planning-day-head .calendar-day-rdv:not([data-has-rdv="true"]) .calendar-day-rdv-count{background:#30464f;color:#d2e4e6}

/* v1.19.5 — Protected, independently scrollable appointment list dialog. */
.calendar-list-overlay{position:fixed;inset:0;z-index:24000;display:flex;align-items:center;justify-content:center;padding:max(10px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));background:rgba(5,21,31,.75);backdrop-filter:blur(5px);overscroll-behavior:contain}
/* Details/review dialogs must be ABOVE the independent À venir list.
   Promote the parent too, so a browser stacking context cannot trap the dialog. */
body:has(#calendar-list-overlay) #modal-root:has(>.modal-backdrop){position:relative;z-index:24010}
body:has(#calendar-list-overlay) #modal-root>.modal-backdrop{z-index:24020}
.calendar-list-dialog{box-sizing:border-box;display:flex;flex-direction:column;width:min(960px,100%);height:min(89dvh,880px);min-height:0;overflow:hidden;border-radius:18px;border:1px solid var(--border,#d5e2e5);background:var(--surface,#fff);color:var(--text,#17313b);box-shadow:0 22px 85px rgba(0,0,0,.35)}
.calendar-list-header{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:0 0 auto;border-bottom:1px solid var(--border,#d5e2e5);padding:14px 18px}
.calendar-list-header small{color:var(--primary,#148b90);letter-spacing:.09em;font-size:10px;font-weight:800}
.calendar-list-header h2{margin:2px 0 0;font-size:19px;color:var(--text,#17313b)}
.calendar-list-close{flex:0 0 auto;width:42px;height:42px;border:1px solid var(--border,#d5e2e5);border-radius:12px;background:var(--surface-2,#f0f7f8);color:var(--text,#17313b);font-size:25px;line-height:1;cursor:pointer}
.calendar-list-close:focus-visible,.calendar-list-row:focus-visible,.calendar-list-tabs button:focus-visible{outline:2px solid var(--primary,#008d93);outline-offset:2px}
.calendar-list-body{flex:1 1 auto;min-height:0;min-width:0;display:flex;flex-direction:column;gap:10px;padding:12px 17px}
.calendar-list-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;flex:0 0 auto}
.calendar-list-tabs button{min-height:40px;border-radius:10px;background:var(--surface-2,#edf5f6);color:var(--text,#17313b);border:1px solid var(--border,#d5e2e5);font:inherit;font-weight:700;cursor:pointer}
.calendar-list-tabs button.active{background:var(--primary,#008e94);border-color:var(--primary,#008e94);color:#fff}
.calendar-list-filters{display:grid;grid-template-columns:1.4fr 1fr;gap:10px;flex:0 0 auto}
.calendar-list-filters label{min-width:0;display:flex;flex-direction:column;gap:4px;color:var(--text-muted,#566d75);font-size:12px;font-weight:700}
.calendar-list-filters input,.calendar-list-filters select{box-sizing:border-box;width:100%;min-height:41px;border-radius:10px;background:var(--surface,#fff);color:var(--text,#17313b);border:1px solid var(--border,#d5e2e5);padding:8px 10px;font-size:14px}
.calendar-list-context{flex:0 0 auto;min-height:17px;font-size:11px;color:var(--text-muted,#566d75)}
.calendar-list-scroll{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding:1px 2px}
.calendar-list-results{display:grid;gap:7px;padding-bottom:10px}
.calendar-list-row{display:grid;grid-template-columns:140px minmax(0,1fr) 118px 17px;align-items:center;gap:12px;width:100%;min-height:68px;border-radius:12px;border:1px solid var(--border,#d5e2e5);background:var(--surface,#fff);color:var(--text,#17313b);padding:10px;text-align:start;cursor:pointer;font:inherit}
.calendar-list-row:hover{border-color:var(--primary,#148b90);background:color-mix(in srgb,var(--surface,#fff) 92%,var(--primary,#148b90))}
.calendar-list-row-date,.calendar-list-row-main,.calendar-list-row-side{display:flex;flex-direction:column;gap:4px;min-width:0}
.calendar-list-row-date strong{font-size:13px;font-weight:800;font-variant-numeric:tabular-nums}
.calendar-list-row-date span{font-size:12px;color:var(--text-muted,#566d75);font-variant-numeric:tabular-nums}
.calendar-list-row-main strong{font-size:14px;overflow-wrap:anywhere}
.calendar-list-row-main small{font-size:11px;color:var(--text-muted,#566d75);overflow-wrap:anywhere}
.calendar-list-row-side{align-items:flex-start}
.calendar-list-row-side small{font-size:10px;color:var(--text-muted,#566d75)}
.calendar-list-row-arrow{font-size:22px;color:var(--primary,#008e94)}
.calendar-list-status{display:inline-flex;align-items:center;max-width:100%;border-radius:999px;padding:4px 8px;background:color-mix(in srgb,#168f83 13%,var(--surface,#fff));color:var(--text,#17313b);font-size:11px;font-weight:750;white-space:nowrap}
.calendar-list-status[data-status="cancelled"],.calendar-list-status[data-status="canceled"],.calendar-list-status[data-status="rejected"],.calendar-list-status[data-status="no_show"]{background:color-mix(in srgb,#cb6452 18%,var(--surface,#fff))}
.calendar-list-status[data-status="pending"]{background:color-mix(in srgb,#d9a333 22%,var(--surface,#fff))}
.calendar-list-footer{border-top:1px solid var(--border,#d5e2e5);display:flex;align-items:center;justify-content:space-between;gap:12px;flex:0 0 auto;padding:7px 2px;color:var(--text-muted,#566d75);font-size:12px}
.calendar-list-empty{padding:38px 15px;text-align:center;color:var(--text-muted,#566d75);font-size:13px}
html[dir="rtl"] .calendar-list-row-arrow{transform:scaleX(-1)}
@media(max-width:650px){.calendar-list-overlay{padding:6px}.calendar-list-dialog{height:95dvh;width:100%;border-radius:15px}.calendar-list-header{padding:10px 12px}.calendar-list-header h2{font-size:17px}.calendar-list-body{padding:10px;gap:8px}.calendar-list-filters{grid-template-columns:minmax(0,1fr);gap:7px}.calendar-list-row{grid-template-columns:82px minmax(0,1fr) 80px;gap:6px;padding:9px 7px;min-height:76px}.calendar-list-row-arrow{display:none}.calendar-list-row-date strong{font-size:11px}.calendar-list-row-main strong{font-size:12px}.calendar-list-row-main small{font-size:10px}.calendar-list-status{font-size:9px;white-space:normal;padding:4px 5px}.calendar-list-row-side small{font-size:9px}.calendar-list-filters input,.calendar-list-filters select{min-height:36px}.calendar-list-context{font-size:10px}}
@media(max-width:350px){.calendar-list-row{grid-template-columns:77px minmax(0,1fr) 69px;gap:4px}}
.calendar-list-footer button[hidden]{display:none!important}

/* v1.21.19 · Link an online website visit to a verified clinic patient without
   fabricating a second booking; keep the entire workflow usable on phones. */
#modal-root .modal:has(.calendar-link-online){width:min(620px,calc(100vw - 14px));max-height:min(94dvh,890px);min-width:0;display:flex;flex-direction:column}
#modal-root .modal:has(.calendar-link-online) .modal-body{overflow-y:auto;min-height:0;overscroll-behavior:contain;padding:12px 16px}
#modal-root .modal:has(.calendar-link-online) .modal-foot{flex-shrink:0;display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap;padding-bottom:calc(12px + env(safe-area-inset-bottom))}
.calendar-link-online{display:flex;flex-direction:column;gap:11px;min-width:0;font-size:13px}
.calendar-link-online .calendar-slot-summary strong{white-space:normal;overflow-wrap:anywhere}
.calendar-link-online .calendar-slot-summary span{display:block;font-size:12px}
.calendar-link-online :is(input[type=search],input[type=text],input[type=date],input[type=tel],select,textarea){width:100%;min-width:0;box-sizing:border-box}
.calendar-link-online .calendar-patient-create{margin:0}
.calendar-link-online .calendar-patient-create .form-grid{padding-top:10px}
.calendar-link-online .calendar-selected{overflow-wrap:anywhere}
.calendar-phone-suggestions{padding:11px;border:1px solid color-mix(in srgb,var(--primary,#168793) 28%,var(--border,#d5e2e6));border-radius:12px;background:color-mix(in srgb,var(--primary,#168793) 5%,var(--surface,#fff));display:flex;flex-direction:column;gap:7px}
.calendar-phone-suggestions>.calendar-help{margin:0;font-size:12px}
.calendar-phone-suggestions-list{display:flex;flex-direction:column;gap:7px;max-height:210px;overflow:auto}
.calendar-phone-candidate{width:100%;min-width:0;display:flex;align-items:center;justify-content:space-between;gap:8px;border:1px solid var(--border,#d5e2e6);background:var(--surface,#fff);color:var(--text,#152a30);padding:9px;border-radius:10px;text-align:start;cursor:pointer}
.calendar-phone-candidate>span:first-child{display:flex;flex-direction:column;gap:2px;min-width:0;overflow-wrap:anywhere}
.calendar-phone-candidate small{font-size:11px;color:var(--muted,#627681)}
.calendar-phone-candidate.is-picked{border-color:var(--primary,#168793);outline:2px solid color-mix(in srgb,var(--primary,#168793) 28%,transparent)}
.calendar-match-action{font-size:11px;font-weight:700;white-space:nowrap;color:var(--primary,#168793)}
.calendar-link-online .calendar-link-confirm{display:flex;align-items:flex-start;gap:9px;line-height:1.5;font-weight:650}
.calendar-link-online .calendar-link-confirm input{flex:0 0 auto;margin-top:3px}
.calendar-link-online .calendar-detail-warning{margin:0}
.calendar-link-online #calendar-link-mismatch{display:grid;gap:8px}
.calendar-link-online #calendar-link-mismatch[hidden]{display:none}
@media(max-width:530px){
 #modal-root .modal:has(.calendar-link-online){max-height:calc(100dvh - 8px)}
 #modal-root .modal:has(.calendar-link-online) .modal-body{padding:9px 11px}
 #modal-root .modal:has(.calendar-link-online) .modal-foot{display:grid;grid-template-columns:1fr 1fr;padding:9px 11px calc(9px + env(safe-area-inset-bottom))}
 #modal-root .modal:has(.calendar-link-online) .modal-foot .btn{min-width:0;white-space:normal;min-height:42px}
 .calendar-link-online .calendar-patient-create .form-grid{grid-template-columns:1fr}
 .calendar-link-online .calendar-patient-create .form-grid .field{grid-column:1/-1}
}


/* v1.21.21 — one-day, full-width, RTL-safe mobile timetable. Desktop remains
   the original five-day column grid; no horizontal scroll or drag geometry on phones. */
@media(max-width:720px){
 body.clinic-calendar-focus .calendar-planning-panel.calendar-phone-day-mode{padding:7px;gap:7px}
 body.clinic-calendar-focus .calendar-phone-day-mode .calendar-range-toolbar,
 .calendar-phone-day-mode .calendar-range-toolbar{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:end;gap:6px;direction:inherit}
 .calendar-phone-day-mode #calendar-range-prev,.calendar-phone-day-mode #calendar-range-next{display:none!important}
 .calendar-phone-day-mode #calendar-day-prev{grid-column:1;grid-row:1;min-height:42px;min-width:0;font-size:20px}
 .calendar-phone-day-mode .calendar-start-date{grid-column:2;grid-row:1;min-width:0;max-width:none}
 .calendar-phone-day-mode #calendar-day-next{grid-column:3;grid-row:1;min-height:42px;min-width:0;font-size:20px}
 .calendar-phone-day-mode .calendar-doctor-filter{grid-column:1/-1;grid-row:2;min-width:0;max-width:none}
 .calendar-phone-day-mode .calendar-start-date input,.calendar-phone-day-mode .calendar-doctor-filter select{width:100%;min-height:40px}
 .calendar-phone-day-mode .calendar-day-jumps{display:none!important}
 .calendar-phone-day-mode .calendar-planning-view-actions{display:flex;justify-content:space-between;align-items:center;gap:5px;flex-wrap:nowrap;width:100%}
 .calendar-phone-day-mode .calendar-planning-view-actions>.btn{flex:0 0 auto;min-height:37px;font-size:11px;padding:5px 8px}
 .calendar-phone-day-mode .calendar-compact-options>summary{min-height:37px;font-size:11px;padding:5px 7px}
 .calendar-phone-day-mode .calendar-agenda-head{gap:6px}
 .calendar-phone-day-mode .calendar-agenda-head h2{font-size:.88rem}
 .calendar-phone-day-mode .calendar-planning-scroll.calendar-mobile-scroll{direction:inherit;min-width:0;min-height:0;max-height:min(70dvh,750px);width:100%;overflow-x:hidden;overflow-y:auto;scrollbar-gutter:auto;-webkit-overflow-scrolling:touch;background:var(--surface,#fff)}
 body.clinic-calendar-focus .calendar-phone-day-mode .calendar-planning-scroll.calendar-mobile-scroll{height:100%;min-height:0;max-height:none;flex:1 1 0}
 .calendar-mobile-day-head{display:flex;gap:8px;justify-content:space-between;align-items:center;position:sticky;top:0;z-index:6;padding:10px 12px;background:var(--surface-2,#eff5f6);border-bottom:1px solid var(--border,#dce5ea);color:var(--text,#18363e)}
 .calendar-mobile-day-head strong{font-size:.83rem;font-weight:850;min-width:0}
 .calendar-mobile-day-head>span{font-size:.69rem;white-space:nowrap;border-radius:8px;padding:4px 7px;background:color-mix(in srgb,var(--primary,#168793) 11%,var(--surface,#fff));color:var(--text,#19343d)}
 .calendar-mobile-slots{padding:1px 6px 10px;display:flex;flex-direction:column}
 .calendar-mobile-slot{display:grid;grid-template-columns:48px minmax(0,1fr);gap:7px;align-items:start;min-height:43px;padding:6px 0;border-bottom:1px solid var(--border,#e6ecef)}
 .calendar-mobile-slot>time{font-size:.76rem;font-weight:800;font-variant-numeric:tabular-nums;color:var(--text-muted,#647783);text-align:center;padding-top:9px}
 .calendar-mobile-slot-content{min-width:0;display:flex;flex-direction:column;gap:6px}
 .calendar-mobile-add{display:flex;justify-content:flex-start;align-items:center;gap:8px;width:100%;min-height:30px;padding:4px 9px;color:var(--text-muted,#72828b);border:1px dashed transparent;background:transparent;border-radius:8px;cursor:pointer;font-size:.72rem;text-align:start}
 .calendar-mobile-add span{color:var(--primary,#168793);font-size:1.1rem;font-weight:800}
 .calendar-mobile-add:disabled{opacity:.22;cursor:not-allowed}
 .calendar-mobile-add:not(:disabled):is(:hover,:focus-visible){background:color-mix(in srgb,var(--primary,#168793) 8%,var(--surface,#fff));border-color:var(--primary,#168793);outline:none;color:var(--text,#18363e)}
 .calendar-mobile-event{display:flex;flex-direction:column;gap:7px;min-width:0;border:1px solid var(--border,#cfdee4);border-inline-start:4px solid #21839e;border-radius:10px;background:color-mix(in srgb,var(--surface,#fff) 89%,#48acc3 11%);padding:10px 11px;color:var(--text,#20333d);cursor:pointer;box-shadow:0 1px 4px rgba(0,0,0,.04)}
 .calendar-mobile-event[data-calendar-status=pending]{border-inline-start-color:#b78617;background:color-mix(in srgb,var(--surface,#fff) 88%,#dfbd72 12%)}
 .calendar-mobile-event[data-calendar-status=cancelled],.calendar-mobile-event[data-calendar-status=rejected]{border-inline-start-color:#bd6262;opacity:.73}
 .calendar-mobile-event[data-clinic-arrival]{border-inline-start-color:#14866b;background:color-mix(in srgb,var(--surface,#fff) 90%,#40b78a 10%)}
 .calendar-mobile-event[data-needs-link="1"]{border-inline-start-color:#c28724}
 .calendar-mobile-event:is(:focus-visible,:hover){outline:2px solid var(--primary,#168793);outline-offset:-2px}
 .calendar-mobile-event-top{display:flex;align-items:start;gap:8px;justify-content:space-between;min-width:0}
 .calendar-mobile-event-top strong{font-size:.88rem;font-weight:830;white-space:normal;overflow-wrap:anywhere;min-width:0}
 .calendar-mobile-status{display:inline-flex;align-items:center;flex:0 0 auto;max-width:45%;font-size:.65rem;font-weight:750;line-height:1.25;border-radius:7px;padding:4px 6px;background:var(--surface,#fff);border:1px solid var(--border,#d7e4ea);color:var(--text,#293a43);text-align:center}
 .calendar-mobile-event-foot{display:flex;flex-wrap:wrap;align-items:center;gap:5px 10px;font-size:.72rem;color:var(--text-muted,#506976);font-weight:650}
 .calendar-mobile-event-foot time{font-weight:800;color:var(--text,#243a42);font-variant-numeric:tabular-nums}
 .calendar-mobile-to-link{padding:3px 6px;border-radius:6px;color:#735012;background:#f7e5ac;font-size:.68rem}
 .calendar-mobile-blocked{padding:6px 8px;font-size:.72rem;color:#a4574b}
 .calendar-mobile-outside{display:flex;flex-direction:column;gap:7px;padding:10px}
 .calendar-mobile-outside h3{margin:0 0 3px;font-size:.82rem}
 html[dir="rtl"] .calendar-mobile-slot{direction:rtl}
 html[dir="rtl"] .calendar-mobile-slot>time{direction:ltr}
 :root[data-theme="dark"] .calendar-mobile-event{background:color-mix(in srgb,var(--surface,#172930) 87%,#438aa3 13%);border-color:color-mix(in srgb,var(--border,#425b64) 80%,#57b2bd 20%);color:var(--text,#f0f6f7)}
 :root[data-theme="dark"] .calendar-mobile-event[data-calendar-status=pending]{background:color-mix(in srgb,var(--surface,#172930) 86%,#bf9a41 14%)}
 :root[data-theme="dark"] .calendar-mobile-event-foot{color:var(--text-muted,#c1d6de)}
 :root[data-theme="dark"] .calendar-mobile-to-link{background:#604718;color:#ffe2a0}
}
/* Desktop and tablet overlap density: protect names and preserve keyboard/click detail access. */
@media(min-width:721px){
 .calendar-planning-grid .calendar-timed-event[data-overlap="1"]{padding-inline:4px;min-width:0}
 .calendar-planning-grid .calendar-timed-event[data-overlap="1"] .calendar-origin,
 .calendar-planning-grid .calendar-timed-event[data-overlap="1"] small,
 .calendar-planning-grid .calendar-timed-event[data-overlap="1"] .calendar-timed-actions{display:none}
 .calendar-planning-grid .calendar-timed-event[data-overlap="1"] strong{font-size:.72rem;min-width:0}
 .calendar-planning-grid .calendar-timed-event[data-overlap="1"] .calendar-drag-handle{min-width:24px;width:24px}
}
/* Distinguish website bookings that still need patient identity verification. */
.calendar-planning-grid .calendar-timed-event[data-needs-link="1"]{border-inline-start-color:#bb8022;border-inline-start-style:dashed}
.calendar-planning-grid .calendar-timed-event[data-needs-link="1"] .calendar-origin{color:var(--text,#243942);font-weight:850}
:root[data-theme="dark"] .calendar-planning-grid .calendar-timed-event small,
:root[data-theme="dark"] .calendar-planning-grid .calendar-origin{color:var(--text-muted,#c7d7de)}
:root[data-theme="dark"] .calendar-planning-grid .calendar-timed-event{border-color:color-mix(in srgb,var(--primary,#57b5c0) 48%,var(--border,#465a65));background:color-mix(in srgb,var(--surface,#182d34) 84%,#50acbd 16%)}
:root[data-theme="dark"] .calendar-planning-grid .calendar-timed-event[data-calendar-status=pending]{background:color-mix(in srgb,var(--surface,#182d34) 86%,#d0a549 14%)}
:root[data-theme="dark"] .calendar-planning-grid .calendar-timed-event strong{color:var(--text,#f3f7fa)}

/* Dark native date control: the OS calendar icon must stay visible, including RTL. */
:root[data-theme="dark"] .calendar-phone-day-mode input[type="date"]{color-scheme:dark;background:var(--surface,#132832);color:var(--text,#edf7f8)}
html[dir="rtl"] .calendar-phone-day-mode #calendar-day-prev,
html[dir="rtl"] .calendar-phone-day-mode #calendar-day-next{transform:scaleX(-1)}

/* Editing remains a deliberate, accessible action on daily cards; details open by tapping elsewhere. */
@media(max-width:720px){
 .calendar-mobile-event-foot .calendar-mobile-edit{min-height:28px;margin-inline-start:auto;display:inline-flex;gap:3px;align-items:center;padding:4px 7px;border:1px solid var(--border,#cfdee4);border-radius:7px;background:var(--surface,#fff);color:var(--text,#24414b);font-size:.68rem;font-weight:800;cursor:pointer}
 .calendar-mobile-event-foot .calendar-mobile-edit:focus-visible{outline:2px solid var(--primary,#168793);outline-offset:2px}
}

/* v1.21.32 — high-clarity appointment status and consistent practitioner identity.
   Booking state owns the main border; clinic arrival remains a separate green pill.
   Preserve text/status labels, overlap geometry, drag handles and RTL flow. */
:root{
 --cal-confirm:#197a9d;--cal-confirm-bg:#e5f3f9;
 --cal-pending:#966009;--cal-pending-bg:#fff1d5;
 --cal-cancel:#667684;--cal-cancel-bg:#eef1f4;
 --cal-block:#a43e4c;--cal-block-bg:#fce9eb;
 --cal-arrived:#137c59;--cal-arrived-bg:#e0f4eb;
}
:root[data-theme="dark"]{
 --cal-confirm:#85cce5;--cal-confirm-bg:#1d3947;
 --cal-pending:#f0cd82;--cal-pending-bg:#3b2f1a;
 --cal-cancel:#c0cedb;--cal-cancel-bg:#303b46;
 --cal-block:#ffb0b7;--cal-block-bg:#49292e;
 --cal-arrived:#90e7bb;--cal-arrived-bg:#1b3c31;
}
/* Applied to both old agenda rows and five-day timetable, including Arabic. */
.calendar-event[data-calendar-status],
.calendar-timed-event[data-calendar-status],
.calendar-mobile-event[data-calendar-status]{
 --cal-status:var(--cal-confirm);--cal-state-bg:var(--cal-confirm-bg);
 border-inline-start:4px solid var(--cal-status)!important;
 background:color-mix(in srgb,var(--cal-state-bg) 78%,var(--surface,#fff))!important;
 border-color:color-mix(in srgb,var(--cal-status) 24%,var(--border,#d8e0e5));
 border-inline-start-color:var(--cal-status)!important;
 opacity:1;
}
:is(.calendar-event,.calendar-timed-event,.calendar-mobile-event)[data-calendar-status="pending"]{--cal-status:var(--cal-pending);--cal-state-bg:var(--cal-pending-bg)}
:is(.calendar-event,.calendar-timed-event,.calendar-mobile-event):is([data-calendar-status="cancelled"],[data-calendar-status="canceled"],[data-calendar-status="no_show"],[data-calendar-status="rejected"]){--cal-status:var(--cal-cancel);--cal-state-bg:var(--cal-cancel-bg);opacity:.85}
.calendar-timed-event .calendar-status-dot{background:var(--cal-status,#197a9d)!important;height:8px;width:8px}
.calendar-mobile-event .calendar-mobile-status{
 border-color:color-mix(in srgb,var(--cal-status) 35%,var(--border,#dce4e8));
 background:var(--cal-state-bg);color:var(--cal-status);font-weight:820;
}
/* Arrival is a second status, not a replacement for booking confirmation. */
.calendar-timed-event[data-clinic-arrival] .calendar-arrival-pill{
 background:var(--cal-arrived-bg);border-color:color-mix(in srgb,var(--cal-arrived) 38%,var(--border));color:var(--cal-arrived);
}
.calendar-mobile-event[data-clinic-arrival] .calendar-mobile-status{
 background:var(--cal-arrived-bg);color:var(--cal-arrived);
 border-color:color-mix(in srgb,var(--cal-arrived) 38%,var(--border));
}
/* Unlinked online records still have a conspicuous dashed edge. */
.calendar-timed-event[data-needs-link="1"],.calendar-mobile-event[data-needs-link="1"]{border-inline-start-style:dashed!important}
.calendar-legend-swatch.confirmed{background:var(--cal-confirm-bg);border-color:var(--cal-confirm)}
.calendar-legend-swatch.pending{background:var(--cal-pending-bg);border-color:var(--cal-pending)}
.calendar-legend-swatch.cancelled{background:var(--cal-cancel-bg);border-color:var(--cal-cancel)}
.calendar-legend-swatch.blocked{background:var(--cal-block-bg);border-color:var(--cal-block)}
.calendar-multi-slot.calendar-slot-blocked,.calendar-slot.calendar-slot-blocked{
 background:color-mix(in srgb,var(--cal-block-bg) 74%,var(--surface,#fff));color:var(--cal-block);
}
.calendar-mobile-blocked{background:var(--cal-block-bg);color:var(--cal-block);border-inline-start:3px solid var(--cal-block);border-radius:6px;font-weight:750}
/* Same index as the live queue's 0=blue,1=purple,2=teal,3=ochre. */
.calendar-practitioner-label{--cal-doctor:#2867ad;display:inline-flex;align-items:center;gap:5px;min-width:0;max-width:100%;vertical-align:middle;direction:inherit}
.calendar-practitioner-label[data-tone="1"]{--cal-doctor:#8747b3}
.calendar-practitioner-label[data-tone="2"]{--cal-doctor:#087d63}
.calendar-practitioner-label[data-tone="3"]{--cal-doctor:#a66a1e}
:root[data-theme="dark"] .calendar-practitioner-label{--cal-doctor:#b9ddff}
:root[data-theme="dark"] .calendar-practitioner-label[data-tone="1"]{--cal-doctor:#e2b7ff}
:root[data-theme="dark"] .calendar-practitioner-label[data-tone="2"]{--cal-doctor:#a5ebd1}
:root[data-theme="dark"] .calendar-practitioner-label[data-tone="3"]{--cal-doctor:#ffd29e}
.calendar-practitioner-dot{display:block;flex:0 0 7px;width:7px;height:7px;background:var(--cal-doctor);border-radius:50%;box-shadow:0 0 0 1px color-mix(in srgb,var(--cal-doctor) 26%,transparent)}
.calendar-practitioner-label:not([data-tone]) .calendar-practitioner-dot{background:var(--cal-cancel)}
.calendar-practitioner-label>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.calendar-doctor-small{display:block;min-width:0}
.calendar-mobile-event-foot .calendar-practitioner-label{max-width:60%;font-size:inherit}
@media(max-width:380px){.calendar-mobile-event-foot .calendar-practitioner-label{max-width:52%}}

/* Squared practitioner mark stays visible when the five-day grid hides extra text. */
.calendar-timed-top .calendar-practitioner-mark{display:block;flex:0 0 7px;height:7px;width:7px;border-radius:2px;background:#2867ad;outline:1px solid color-mix(in srgb,#2867ad 32%,transparent)}
.calendar-timed-top .calendar-practitioner-mark[data-tone="1"]{background:#8747b3;outline-color:color-mix(in srgb,#8747b3 35%,transparent)}
.calendar-timed-top .calendar-practitioner-mark[data-tone="2"]{background:#087d63;outline-color:color-mix(in srgb,#087d63 35%,transparent)}
.calendar-timed-top .calendar-practitioner-mark[data-tone="3"]{background:#a66a1e;outline-color:color-mix(in srgb,#a66a1e 35%,transparent)}
:root[data-theme="dark"] .calendar-timed-top .calendar-practitioner-mark{background:#b9ddff}
:root[data-theme="dark"] .calendar-timed-top .calendar-practitioner-mark[data-tone="1"]{background:#e2b7ff}
:root[data-theme="dark"] .calendar-timed-top .calendar-practitioner-mark[data-tone="2"]{background:#a5ebd1}
:root[data-theme="dark"] .calendar-timed-top .calendar-practitioner-mark[data-tone="3"]{background:#ffd29e}
/* Compact rows retain one square doctor mark and a round status mark. */
.calendar-planning-grid[data-slot-mode="compact"] .calendar-timed-event[data-short="1"] .calendar-status-dot{display:block}

/* v1.21.94 — Exact upcoming appointments and compact, theme-aware calendar controls. */
.calendar-planning-panel .calendar-planning-view-actions{
 display:flex;flex:1 1 560px;align-items:center;justify-content:flex-end;
 flex-wrap:wrap;gap:6px;min-width:0;
}
.calendar-planning-panel .calendar-planning-view-actions>:is(.btn,.calendar-compact-options){flex:0 0 auto}
.calendar-planning-panel .calendar-planning-view-actions>.btn,
.calendar-planning-panel .calendar-compact-options>summary{
 display:inline-flex;align-items:center;justify-content:center;gap:5px;
 border-radius:10px;border-width:1px;border-style:solid;
 font-weight:780;letter-spacing:0;box-shadow:0 1px 2px rgba(7,34,46,.05);
}
.calendar-planning-panel #calendar-create{background:#117e7b;border-color:#117e7b;color:#fff}
.calendar-planning-panel #calendar-create:is(:hover,:focus-visible){background:#0c6866;border-color:#0c6866}
.calendar-planning-panel .calendar-action-replies{background:color-mix(in srgb,#2872c9 14%,var(--surface,#fff));border-color:color-mix(in srgb,#2872c9 44%,var(--border,#dce4eb));color:var(--text,#193540)}
.calendar-planning-panel .calendar-action-list{background:color-mix(in srgb,#3c8192 14%,var(--surface,#fff));border-color:color-mix(in srgb,#3c8192 40%,var(--border,#dce4eb));color:var(--text,#193540)}
.calendar-planning-panel .calendar-action-upcoming{background:color-mix(in srgb,#e5ad45 20%,var(--surface,#fff));border-color:color-mix(in srgb,#bb8a32 50%,var(--border,#dce4eb));color:var(--text,#193540)}
.calendar-planning-panel .calendar-action-today{background:color-mix(in srgb,#138665 15%,var(--surface,#fff));border-color:color-mix(in srgb,#138665 42%,var(--border,#dce4eb));color:var(--text,#193540)}
.calendar-planning-panel .calendar-action-focus{background:color-mix(in srgb,#7463b7 14%,var(--surface,#fff));border-color:color-mix(in srgb,#7463b7 42%,var(--border,#dce4eb));color:var(--text,#193540)}
.calendar-planning-panel .calendar-action-options>summary{background:color-mix(in srgb,#6b7894 13%,var(--surface,#fff));border-color:color-mix(in srgb,#6b7894 42%,var(--border,#dce4eb));color:var(--text,#193540)}
.calendar-planning-panel :is(.calendar-action-replies,.calendar-action-list,.calendar-action-upcoming,.calendar-action-today,.calendar-action-focus,.calendar-action-options>summary):is(:hover,:focus-visible){filter:brightness(.96);box-shadow:0 0 0 2px color-mix(in srgb,var(--primary,#168793) 20%,transparent)}
.calendar-upcoming-count{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:22px;padding-inline:5px;border-radius:100px;background:#976018;color:#fff;font-size:11px;line-height:1;font-weight:850;font-variant-numeric:tabular-nums;direction:ltr;white-space:nowrap}
.calendar-upcoming-count[hidden]{display:none!important}
.calendar-list-tabs .calendar-upcoming-count{margin-inline-start:5px}
.calendar-jump-highlight{outline:3px solid #e2a22b!important;outline-offset:2px;box-shadow:0 0 0 6px rgba(226,162,43,.22),0 6px 22px rgba(15,72,83,.2)!important;z-index:9!important}
#modal-root .calendar-show-in-planning{background:#136f8c;border-color:#136f8c;color:#fff;font-weight:800}
#modal-root .calendar-show-in-planning:is(:hover,:focus-visible){background:#105b73;border-color:#105b73}

/* In Arabic, the earliest day and the time axis begin on the RIGHT.
   The DOM/order/date and the server's slot data stay chronological. */
html[dir="rtl"] .calendar-planning-scroll:not(.calendar-mobile-scroll){direction:rtl}
html[dir="rtl"] .calendar-planning-grid{direction:rtl}
html[dir="rtl"] .calendar-planning-grid .calendar-planning-corner,
html[dir="rtl"] .calendar-planning-grid .calendar-multi-time{right:0;left:auto;border-right:0;border-left:1px solid var(--border,#dce5ea)}
html[dir="rtl"] .calendar-planning-grid .calendar-planning-day-head,
html[dir="rtl"] .calendar-planning-grid .calendar-multi-slot,
html[dir="rtl"] .calendar-planning-grid .calendar-multi-event-layer{border-right:0;border-left:1px solid var(--border,#dce5ea)}
html[dir="rtl"] .calendar-planning-grid .calendar-multi-time{direction:ltr}
html[dir="rtl"] .calendar-start-date input[type="date"]{direction:ltr;text-align:start}
html[dir="rtl"] #calendar-range-prev,html[dir="rtl"] #calendar-range-next,
html[dir="rtl"] #calendar-day-prev,html[dir="rtl"] #calendar-day-next{direction:ltr;unicode-bidi:isolate}
/* The displayed navigation arrows follow reading direction; the JS still moves dates correctly. */
html[dir="rtl"] #calendar-range-prev,html[dir="rtl"] #calendar-range-next,
html[dir="rtl"] #calendar-day-prev,html[dir="rtl"] #calendar-day-next{transform:scaleX(-1)}
:root[data-theme="dark"] .calendar-planning-panel .calendar-action-replies,
:root[data-theme="dark"] .calendar-planning-panel .calendar-action-list,
:root[data-theme="dark"] .calendar-planning-panel .calendar-action-upcoming,
:root[data-theme="dark"] .calendar-planning-panel .calendar-action-today,
:root[data-theme="dark"] .calendar-planning-panel .calendar-action-focus,
:root[data-theme="dark"] .calendar-planning-panel .calendar-action-options>summary{color:var(--text,#e9f3f6)}
:root[data-theme="dark"] .calendar-upcoming-count{background:#d4a653;color:#162b31}
@media(max-width:849px){
 body.clinic-calendar-focus .calendar-planning-panel .calendar-planning-view-actions{flex:1 1 100%;justify-content:space-between;gap:5px;flex-wrap:wrap}
 body.clinic-calendar-focus .calendar-planning-panel .calendar-planning-view-actions>.btn{flex:0 1 auto;min-width:0;white-space:normal}
}
@media(max-width:720px){
 body.clinic-calendar-focus .calendar-phone-day-mode .calendar-planning-view-actions,
 .calendar-phone-day-mode .calendar-planning-view-actions{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;width:100%;justify-content:stretch
 }
 .calendar-phone-day-mode .calendar-planning-view-actions>:is(.btn,.calendar-compact-options){width:100%;min-width:0;max-width:100%}
 .calendar-phone-day-mode #calendar-create{grid-column:span 2}
 .calendar-phone-day-mode #calendar-patient-replies{grid-column:span 2}
 .calendar-phone-day-mode #calendar-list-btn{grid-column:span 1}
 .calendar-phone-day-mode #calendar-upcoming-btn{grid-column:span 2}
 .calendar-phone-day-mode #calendar-today{grid-column:span 1}
 .calendar-phone-day-mode .calendar-compact-options{grid-column:span 2}
 .calendar-phone-day-mode #calendar-focus-btn{grid-column:span 2}
 body.clinic-calendar-focus .calendar-phone-day-mode .calendar-planning-view-actions>.btn,
 .calendar-phone-day-mode .calendar-planning-view-actions>.btn,
 .calendar-phone-day-mode .calendar-compact-options>summary{min-height:32px;height:100%;padding:6px 5px;font-size:10px;white-space:normal;line-height:1.15;overflow-wrap:anywhere}
 .calendar-phone-day-mode .calendar-compact-options>summary{width:100%}
 .calendar-phone-day-mode .calendar-upcoming-count{min-width:20px;height:20px;font-size:10px}
}
/* Focus mode previously forced nowrap; retain access to every control on all widths. */
body.clinic-calendar-focus .calendar-planning-panel>.calendar-agenda-head{flex-wrap:wrap}
body.clinic-calendar-focus .calendar-planning-panel .calendar-planning-view-actions{flex-wrap:wrap;flex:1 1 560px}


/* v1.21.95 — New patient confirmations/change requests awaiting review. */
.calendar-planning-panel .calendar-action-replies{white-space:normal;line-height:1.2}
.calendar-planning-panel .calendar-action-replies .calendar-replies-label{min-width:0;text-align:center}
.calendar-planning-panel .calendar-replies-count{
 display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;
 min-width:21px;height:21px;padding-inline:6px;border-radius:999px;
 background:#b63d4c;color:#fff;border:1px solid rgba(98,17,36,.22);
 font-size:11px;font-weight:850;line-height:1;font-variant-numeric:tabular-nums;
 direction:ltr;unicode-bidi:isolate;box-shadow:0 1px 3px rgba(98,17,36,.16)
}
.calendar-planning-panel .calendar-replies-count[hidden]{display:none!important}
:root[data-theme="dark"] .calendar-planning-panel .calendar-replies-count{background:#ef7883;color:#321719;border-color:rgba(255,195,200,.36)}
@media(max-width:720px){
 .calendar-phone-day-mode .calendar-planning-view-actions #calendar-patient-replies{gap:4px}
 .calendar-phone-day-mode .calendar-replies-count{min-width:19px;height:19px;padding-inline:4px;font-size:10px}
}

/* v1.21.97 — Fixed-height two-row desktop agenda header. The title, date
   controls and actions share the same compact header, preserving 08–16 view.
   Do not collapse functional buttons into a menu; all stay on screen. */
.calendar-date-short,.calendar-action-short{display:none}
@media(min-width:850px){
 .calendar-planning-panel{container-type:inline-size;container-name:clinic-agenda}
 body.clinic-calendar-focus .calendar-planning-panel>.calendar-agenda-head{
  display:grid;grid-template-columns:minmax(130px,0.8fr) minmax(0,2fr);
  grid-template-areas:"period date-controls" "actions actions";
  align-items:center;column-gap:8px;row-gap:2px;
  min-height:0;margin:0;padding:1px 1px 3px;flex:0 0 auto;
 }
 body.clinic-calendar-focus .calendar-agenda-head>div:first-child{
  grid-area:period;min-width:0;max-width:100%;width:100%;
 }
 body.clinic-calendar-focus .calendar-agenda-head #calendar-day-label{
  font-size:clamp(11px,1vw,15px);line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
 }
 body.clinic-calendar-focus .calendar-agenda-head>.calendar-range-toolbar{
  grid-area:date-controls;display:flex;flex-wrap:nowrap;align-items:center;
  justify-content:flex-end;width:100%;min-width:0;margin:0;gap:3px;
 }
 body.clinic-calendar-focus .calendar-agenda-head>.calendar-range-toolbar>.btn{
  min-width:28px;width:30px;height:29px;min-height:29px;max-height:29px;
  padding:0;flex:0 0 30px;font-size:16px;border-radius:8px;
 }
 body.clinic-calendar-focus .calendar-agenda-head>.calendar-range-toolbar>.calendar-start-date{
  min-width:110px;width:127px;max-width:135px;flex:0 1 127px;
 }
 body.clinic-calendar-focus .calendar-agenda-head>.calendar-range-toolbar .calendar-start-date input{
  height:29px;min-height:29px;padding:2px 4px;font-size:11px;
 }
 body.clinic-calendar-focus .calendar-agenda-head>.calendar-range-toolbar>.calendar-doctor-filter{
  min-width:102px;max-width:170px;flex:1 1 125px;margin:0;
 }
 body.clinic-calendar-focus .calendar-agenda-head>.calendar-range-toolbar>.calendar-doctor-filter select{
  width:100%;min-width:0;height:29px;min-height:29px;padding:2px 4px;font-size:11px;
 }
 body.clinic-calendar-focus .calendar-agenda-head>.calendar-range-toolbar>.calendar-doctor-filter>span{
  position:absolute!important;width:1px;height:1px;clip-path:inset(50%);overflow:hidden;white-space:nowrap;
 }
 body.clinic-calendar-focus .calendar-planning-panel>.calendar-agenda-head>.calendar-planning-view-actions{
  grid-area:actions;display:flex;flex-wrap:nowrap;flex:0 1 auto;width:100%;
  min-width:0;justify-content:flex-start;align-items:center;gap:4px;margin:0;
 }
 body.clinic-calendar-focus .calendar-planning-panel .calendar-planning-view-actions>:is(.btn,.calendar-compact-options){
  flex:0 0 auto;min-width:0;max-width:100%;
 }
 body.clinic-calendar-focus .calendar-planning-panel .calendar-planning-view-actions>.btn,
 body.clinic-calendar-focus .calendar-planning-panel .calendar-compact-options>summary{
  min-height:29px;height:29px;white-space:nowrap;font-size:11px;line-height:1;
  padding:3px 7px;border-radius:8px;gap:4px;
 }
 .calendar-agenda-head .calendar-compact-options>summary{height:29px}
}
@container clinic-agenda (max-width:965px){
 .calendar-planning-view-actions .calendar-action-long{display:none!important}
 .calendar-planning-view-actions .calendar-action-short{display:inline!important}
 .calendar-planning-view-actions #calendar-focus-btn>span{display:none!important}
 .calendar-agenda-head .calendar-date-full{display:none!important}
 .calendar-agenda-head .calendar-date-short{display:inline!important}
 .calendar-planning-view-actions>.btn,.calendar-compact-options>summary{font-size:10.5px!important;padding-inline:5px!important}
}
@container clinic-agenda (max-width:680px){
 .calendar-planning-view-actions .calendar-action-replies .calendar-action-short{display:inline!important}
 .calendar-planning-view-actions #calendar-create .calendar-action-short{display:inline!important}
 .calendar-planning-view-actions .calendar-compact-options>summary>span{display:none}
 .calendar-planning-view-actions .calendar-action-today{font-size:10px!important}
 .calendar-planning-view-actions .calendar-action-list{font-size:10px!important}
 .calendar-planning-view-actions>.btn{padding-inline:4px!important}
 .calendar-planning-view-actions{gap:2px!important}
}
/* Preserve the original vertical scrolling/day controls on phones and tablets.
   Moving the toolbar into the header should not create a new squeezed column. */
@media(max-width:849px){
 body.clinic-calendar-focus .calendar-planning-panel>.calendar-agenda-head{
  display:flex;flex-wrap:wrap;align-items:center;gap:4px;min-width:0;
 }
 body.clinic-calendar-focus .calendar-agenda-head>div:first-child{order:0;flex:1 1 100%}
 body.clinic-calendar-focus .calendar-agenda-head>.calendar-planning-view-actions{order:1;flex:1 1 100%;min-width:0}
 body.clinic-calendar-focus .calendar-agenda-head>.calendar-range-toolbar{order:2;flex:1 1 100%;width:100%;min-width:0;margin:1px 0}
}
/* The legacy phone rule used a higher-specificity flex:1 for every <div>
   in the header. Override it so the toolbar controls never get squeezed into
   two half-width columns after being moved into the compact header. */
@media(max-width:849px){
 body.clinic-calendar-focus .calendar-planning-panel .calendar-agenda-head>.calendar-planning-view-actions,
 body.clinic-calendar-focus .calendar-planning-panel .calendar-agenda-head>.calendar-range-toolbar{
  flex:0 0 100%!important;width:100%!important;max-width:100%;min-width:0;
 }
}

/* v1.21.98 — Primary calendar actions together; other actions toward the far side.
   Keep the original calendar IDs, event handlers and compact two-row header. */
body.clinic-calendar-focus .calendar-planning-panel .calendar-agenda-head>.calendar-planning-view-actions{
 display:flex;align-items:center;justify-content:space-between;flex-wrap:nowrap;gap:8px;min-width:0
}
.calendar-planning-panel .calendar-action-primary,
.calendar-planning-panel .calendar-action-secondary{display:flex;align-items:center;gap:5px;min-width:0;flex-wrap:nowrap}
.calendar-planning-panel .calendar-action-primary{flex:0 0 auto;justify-content:flex-start}
.calendar-planning-panel .calendar-action-secondary{flex:0 1 auto;justify-content:flex-end;margin-inline-start:auto}
.calendar-planning-panel .calendar-focus-create{display:none!important}
.calendar-planning-panel .calendar-action-primary>.btn,
.calendar-planning-panel .calendar-action-secondary>.btn,
.calendar-planning-panel .calendar-action-secondary .calendar-compact-options>summary{display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;gap:4px;min-height:31px;padding:4px 7px;font-size:11px;flex:0 0 auto}
@container clinic-agenda (max-width:800px){
 .calendar-planning-panel .calendar-action-primary>.btn,
 .calendar-planning-panel .calendar-action-secondary>.btn,
 .calendar-planning-panel .calendar-action-secondary .calendar-compact-options>summary{padding-inline:5px;font-size:10px}
 .calendar-planning-panel .calendar-action-primary,.calendar-planning-panel .calendar-action-secondary{gap:3px}
}
@media(max-width:849px){
 body.clinic-calendar-focus .calendar-planning-panel .calendar-agenda-head>.calendar-planning-view-actions{display:flex;flex-wrap:wrap;justify-content:space-between;gap:5px}
 .calendar-planning-panel .calendar-action-primary{width:100%;justify-content:space-between}
 .calendar-planning-panel .calendar-action-secondary{width:100%;margin-inline-start:0;justify-content:space-between;gap:2px}
 .calendar-planning-panel .calendar-action-secondary>.btn,
 .calendar-planning-panel .calendar-action-secondary .calendar-compact-options>summary{padding-inline:4px;font-size:10px}
 .calendar-planning-panel .calendar-action-secondary .calendar-replies-label{display:none!important}
 .calendar-planning-panel .calendar-action-secondary .calendar-action-short{display:inline!important}
}

/* v1.22.33 — reception actions belong in the existing Statut row.
   A native SELECT uses the operating system's option list, so it cannot drift
   away from the dialog; the appointment popup remains its original width. */
.calendar-reception-status-line{align-items:center}
.calendar-reception-status-line .calendar-reception-status-wrap{display:flex;flex:1 1 auto;min-width:0;justify-content:flex-end;align-items:center}
#modal-root .calendar-detail-modal .calendar-reception-status-select{
 appearance:auto;box-sizing:border-box;min-width:118px;width:min(176px,100%);
 height:27px;min-height:0;margin:0;padding:2px 7px;
 border:1px solid var(--border,#c6d8de);border-radius:7px;
 color:var(--text,#1a3441);background:var(--surface,#fff);
 font:inherit;font-size:12px;font-weight:750;line-height:1.1;
 direction:inherit;text-align:start;text-align-last:start;cursor:pointer;
}
#modal-root .calendar-reception-status-select:focus-visible{
 outline:2px solid var(--primary,#138b95);outline-offset:2px;
}
#modal-root .calendar-reception-status-select[data-status="pending"]{color:#87580d;border-color:#caa566;background:color-mix(in srgb,#e5ac4c 12%,var(--surface,#fff))}
#modal-root .calendar-reception-status-select[data-status="confirmed"]{color:#137348;border-color:#72b798;background:color-mix(in srgb,#35ae73 10%,var(--surface,#fff))}
#modal-root .calendar-reception-status-select[data-status="cancelled"],
#modal-root .calendar-reception-status-select[data-status="no_show"]{color:var(--danger,#aa4a35);border-color:color-mix(in srgb,var(--danger,#aa4a35) 40%,var(--border,#ddd))}
#modal-root .modal:has(.calendar-detail-modal) .modal-foot{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:7px}
#modal-root .modal:has(.calendar-detail-modal) .calendar-reception-link{white-space:nowrap}
@media(max-width:530px){
 #modal-root .calendar-detail-modal .calendar-reception-status-select{width:min(165px,100%);min-width:0;font-size:11px}
 #modal-root .modal:has(.calendar-detail-modal) .modal-foot{flex-wrap:wrap;gap:7px}
 #modal-root .modal:has(.calendar-detail-modal) .modal-foot>.btn{flex:1 1 auto;min-width:0;min-height:36px}
}
.calendar-reception-person{margin:0 0 10px;padding:8px 10px;border-radius:9px;background:var(--surface-2,#edf4f5);line-height:1.5}
.calendar-reception-person strong{font-size:14px}.calendar-reception-person small{color:var(--text-muted,#637985)}
.calendar-reception-review{display:grid;gap:9px;max-width:100%;font-size:13px}
.calendar-reception-review .field{min-width:0;gap:5px}
.calendar-reception-review :is(input,select,textarea){box-sizing:border-box;width:100%;min-height:37px;padding:8px;border:1px solid var(--border,#d5e2e7);border-radius:9px;background:var(--surface,#fff);color:var(--text,#1a3441);font:inherit}
.calendar-reception-review textarea{resize:vertical}
.calendar-contact-history{max-height:52dvh;min-width:0;overflow:auto;display:grid;gap:7px;font-size:12px}
.calendar-contact-event{padding:8px 10px;border:1px solid var(--border,#d5e2e7);border-radius:9px;background:var(--surface,#fff)}
.calendar-contact-event strong{font-size:12px}.calendar-contact-event small{display:block;color:var(--text-muted,#687780);font-size:10px}
.calendar-contact-event p{white-space:pre-wrap;overflow-wrap:anywhere;margin:5px 0 0}

/* v1.22.36: practitioner loading is informational; it never delays opening. */
.calendar-new-doctor-status{display:block;min-height:0;margin-top:4px;color:var(--text-muted,#657687);font-size:11px;line-height:1.35}
