/* The front desk schedule. Uses the workbench's own tokens; every block is placed from minutes through custom properties. */
.tone-plan { --tone: var(--faint); --tone-wash: var(--grey-wash); --tone-ink: var(--grey-ink); }
.tone-booked { --tone: var(--accent); --tone-wash: var(--accent-wash); --tone-ink: var(--accent); }
.tone-here { --tone: var(--warn); --tone-wash: var(--warn-wash); --tone-ink: var(--warn); }
.tone-done { --tone: var(--ok); --tone-wash: var(--ok-wash); --tone-ink: var(--ok); }
.tone-missed { --tone: var(--risk); --tone-wash: var(--risk-wash); --tone-ink: var(--risk); }
.tone-off { --tone: var(--faint); --tone-wash: var(--grey-wash); --tone-ink: var(--grey-ink); }
.chip-plan { background: var(--grey-wash); color: var(--grey-ink); }
.chip-booked { background: var(--accent-wash); color: var(--accent); }
.chip-here { background: var(--warn-wash); color: var(--warn); }
.chip-done { background: var(--ok-wash); color: var(--ok); }
.chip-missed { background: var(--risk-wash); color: var(--risk); }
.chip-off { background: var(--grey-wash); color: var(--grey-ink); }

.sch-range { min-width: 220px; text-align: center; }
.sch-scroll { overflow-x: auto; }
.sch-failure { display: flex; align-items: center; gap: 12px; }
.sch-failure .notice { flex: 1 1 auto; }
.sch-corner, .sch-wk-corner { background: var(--grey-wash); }

.sch-day { --m: 1.25px; display: grid; grid-template-columns: 64px repeat(var(--cols), minmax(150px, 1fr)); min-width: calc(64px + var(--cols) * 150px); }
.sch-group { padding: 6px 10px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line-soft); background: var(--grey-wash); color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.sch-colhead { display: flex; flex-direction: column; min-width: 0; padding: 8px 10px; border-left: 1px solid var(--line-soft); border-bottom: 1px solid var(--line); }
.sch-colhead strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sch-gutter, .sch-col { position: relative; height: calc(var(--span) * var(--m)); }
.sch-hour { position: absolute; top: calc(var(--at) * var(--m)); right: 8px; font: 11px var(--mono); color: var(--muted); }
.sch-col { border-left: 1px solid var(--line-soft); background-image: repeating-linear-gradient(to bottom, var(--line-soft) 0, var(--line-soft) 1px, transparent 1px, transparent calc(60 * var(--m))); }

.sch-block { position: absolute; top: calc(var(--from) * var(--m)); height: calc(var(--len) * var(--m) - 1px); left: calc(var(--lane) / var(--lanes) * 100%); width: calc(100% / var(--lanes));
  display: flex; flex-direction: column; min-width: 0; overflow: hidden; padding: 1px 5px; text-align: left; font: inherit; font-size: 12px; line-height: 1.25; color: var(--ink);
  background: var(--tone-wash); border: 1px solid var(--line); border-left: 3px solid var(--tone); border-radius: 4px; cursor: pointer; }
.sch-block:hover { border-color: var(--tone); }
.sch-block.short { flex-direction: row; align-items: center; gap: 6px; white-space: nowrap; }
.sch-block[aria-current], .sch-row[aria-current] { box-shadow: 0 0 0 2px var(--accent); z-index: 1; }
/* The name and its flag share one line. A block of 30 minutes holds two lines, so a flag on a line of its own pushed the name out of sight. */
.sch-b-top { display: flex; align-items: baseline; gap: 6px; min-width: 0; flex-shrink: 0; }
.sch-block.short .sch-b-top { flex-shrink: 1; }
.sch-b-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.sch-b-time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.sch-b-flag { flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--warn); font-size: 11px; font-weight: 600; }
.sch-block.off { background: var(--card); color: var(--muted); }
.sch-block.off .sch-b-name, .sch-row.off .sch-r-name, .sch-row.off .sch-r-time { text-decoration: line-through; }

.sch-week { display: grid; grid-template-columns: minmax(170px, 230px) repeat(7, minmax(96px, 1fr)); min-width: 900px; }
.sch-wk-corner, .sch-wk-res, .sch-wk-day, .sch-cell { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); }
.sch-wk-day, .sch-cell, .sch-mo-cell { font: inherit; color: var(--ink); text-align: left; background: var(--card); border: 0; cursor: pointer; }
.sch-wk-day, .sch-cell { border-left: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 6px; }
.sch-wk-day { border-bottom-color: var(--line); background: var(--grey-wash); }
.sch-wk-res { display: flex; flex-direction: column; min-width: 0; }
.sch-wk-group { grid-column: 1 / -1; padding: 6px 10px; background: var(--grey-wash); color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; border-bottom: 1px solid var(--line-soft); }
.sch-wk-day:hover, .sch-cell:hover, .sch-mo-cell:hover { background: var(--focus-wash); }
.sch-wk-day.today, .sch-cell.today, .sch-mo-cell.today { box-shadow: inset 0 3px 0 var(--accent); }
.sch-track { position: relative; display: block; height: 8px; border-radius: 4px; background: var(--line-soft); }
.sch-track span { position: absolute; top: 0; bottom: 0; border-radius: 4px; background: var(--accent); }

.sch-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); min-width: 780px; }
.sch-mo-head { padding: 6px 10px; background: var(--grey-wash); color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; border-bottom: 1px solid var(--line); }
.sch-mo-cell { display: flex; flex-direction: column; gap: 3px; min-height: 112px; min-width: 0; padding: 8px 10px; border-left: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); font-size: 12px; }
.sch-mo-cell.blank { background: var(--focus-wash); cursor: default; }
.sch-mo-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.sch-mo-res { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); }
.sch-mo-res > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sch-hour-group { display: grid; grid-template-columns: 72px minmax(0, 1fr); border-bottom: 1px solid var(--line-soft); }
.sch-hour-group:last-child { border-bottom: 0; }
.sch-hour-group.past { opacity: .7; }
.sch-hour-group.current { background: var(--focus-wash); box-shadow: inset 3px 0 0 var(--accent); }
.sch-hour-label { margin: 0; padding: 10px 12px; font: 12px var(--mono); color: var(--muted); }
.sch-row { display: grid; grid-template-columns: 190px minmax(140px, 1.4fr) minmax(120px, 1fr) minmax(100px, 1fr) auto; align-items: center; gap: 12px; width: 100%; padding: 8px 12px;
  font: inherit; color: var(--ink); text-align: left; background: none; border: 0; border-top: 1px solid var(--line-soft); cursor: pointer; }
.sch-row:first-child { border-top: 0; }
.sch-row:hover { background: var(--focus-wash); }
.sch-wl-row { grid-template-columns: 180px minmax(150px, 1fr) minmax(200px, 2fr) auto; }
.sch-wl-who { display: flex; flex-direction: column; min-width: 0; }
.sch-wl-who .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sch-wl-why { color: var(--muted); }
.sch-row.off { color: var(--muted); }

/* The find field: its results hang under the field, over the schedule. */
.sch-find { position: relative; flex: 1 1 320px; max-width: 460px; min-width: 220px; }
.sch-find-input { width: 100%; }
.sch-find-pop { position: absolute; z-index: 15; top: calc(100% + 6px); left: 0; width: max(100%, 460px); max-width: 90vw; max-height: 70vh; overflow: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .14); }
.sch-find-head { padding: 8px 12px; border-bottom: 1px solid var(--line-soft); background: var(--grey-wash); color: var(--muted); font-size: 12px; }
.sch-find-note { padding: 10px 12px; }
.sch-find-row { display: flex; align-items: center; gap: 8px; padding: 0 12px 0 0; border-top: 1px solid var(--line-soft); }
.sch-find-head + .sch-find-row, .sch-find-matches .lbl + div > .sch-find-row { border-top: 0; }
.sch-find-main { display: flex; flex: 1 1 auto; flex-direction: column; gap: 1px; min-width: 0; padding: 8px 12px; font: inherit; color: var(--ink); text-align: left; background: none; border: 0; }
button.sch-find-main { cursor: pointer; }
button.sch-find-main:hover { background: var(--focus-wash); }
.sch-find-visit { font-size: 12px; color: var(--accent); }
.sch-find-visit.none { color: var(--muted); }
.sch-find-cerner { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--focus-wash); }
.sch-find-cerner .sch-find-row { padding-right: 0; }
.sch-find-row > .btn, .sch-find-held { flex: none; }
.sch-find-held { white-space: nowrap; }
.sch-find-ask { height: 32px; padding: 0 12px; text-align: left; font: inherit; font-weight: 500; color: var(--accent); background: #fff; border: 1px solid var(--accent); border-radius: 6px; cursor: pointer; }
.sch-find-ask[disabled] { color: var(--faint); border-color: var(--line); cursor: not-allowed; }
.sch-find-matches { display: flex; flex-direction: column; }
.sch-find-matches .lbl { padding-top: 4px; }

.sch-find-register { align-self: flex-start; margin-top: 6px; }
.sch-book-patient { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: var(--grey-wash); border-radius: 8px; }
.sch-reg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.sch-reg-grid .field.wide { grid-column: 1 / -1; }
.sch-reg-grid input, .sch-reg-grid select { width: 100%; }
.sch-reg-confirm { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; font-weight: 500; }
.sch-reg-confirm input { height: auto; margin-top: 3px; }
.sch-reg-match { padding-left: 0; border-top: 1px solid var(--line-soft); }
.sch-reg-error { color: var(--risk); }
.sch-reg-search { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.sch-reg-blocker { min-width: 0; }
.sch-reg-tag { color: var(--accent); }
.sch-reg-phone { display: flex; flex-direction: column; gap: 6px; }
.sch-reg-phone .row { align-items: center; flex-wrap: wrap; gap: 8px; }
.sch-reg-same { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.sch-reg-same-match { display: flex; flex-direction: column; gap: 4px; }
.sch-reg-same .sch-reg-confirm { margin-top: 0; }
.sch-find-shared { margin: 4px 0; }
.sch-slot-day { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.sch-slot-day .filt .sub { font-size: 11px; }
.drawer-b .notice .row { margin-top: 8px; }

.sch-flow { display: grid; grid-template-columns: repeat(5, minmax(140px, 1fr)); gap: 12px; padding: 12px; align-items: start; }
.sch-lane { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 8px; background: var(--grey-wash); border-radius: 8px; }
.sch-lane-h { display: flex; justify-content: space-between; margin: 0; padding: 2px 4px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.sch-lane-empty { padding: 4px; }
.sch-card { display: flex; flex-direction: column; gap: 8px; padding: 8px 10px; background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--tone); border-radius: 6px; }
.sch-card-main { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; min-width: 0; padding: 0; font: inherit; color: var(--ink); text-align: left; background: none; border: 0; cursor: pointer; }
.sch-card-main[aria-current] { box-shadow: 0 0 0 2px var(--accent); border-radius: 4px; }
.sch-card-note { margin: 0; font-size: 12px; }
.sch-card-note .btn { margin-top: 6px; }
.sch-card-top { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.sch-flow-note { margin: 0; padding: 10px 12px; }
.sch-marks { gap: 6px; }
.sch-room { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.sch-room-pop { display: flex; flex-direction: column; gap: 6px; padding: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; }
.sch-room-pop .row { gap: 6px; }
.sch-room-pop input { flex: 1 1 auto; min-width: 0; height: 28px; font-size: 12px; }
.sch-room-choice { display: flex; justify-content: space-between; gap: 8px; padding: 4px 8px; font: inherit; font-size: 12px; color: var(--ink); text-align: left; background: none; border: 1px solid var(--line-soft); border-radius: 6px; cursor: pointer; }
.sch-room-choice:hover, .sch-room-choice.on { background: var(--focus-wash); }
.sch-r-tags { display: flex; align-items: center; gap: 6px; }
.sch-kv { display: grid; gap: 14px; margin: 0; }
.sch-kv dd { margin: 2px 0 0; word-break: break-word; }

@media (max-width: 640px) {
  .sch-row, .sch-wl-row { grid-template-columns: 1fr auto; }
  .sch-wl-why { grid-column: 1 / -1; }
  .sch-range { min-width: 0; flex: 1 1 100%; order: -1; }
}

.sch-copay { display: flex; flex-direction: column; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.sch-copay input { width: 100%; max-width: 200px; }

/* The insurance step: one bordered row per coverage, the removed ones greyed. */
.sch-cov-source { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sch-cov-row { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.sch-cov-row.off { background: var(--grey-wash); color: var(--muted); }
.sch-cov-row .row { margin-top: 6px; }
.sch-cov-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sch-cov-head select { height: 28px; font-size: 12px; }
