/* DentalCare UI. No build step: plain CSS with design tokens. */
:root {
    --bg: #f4f6fa;
    --surface: #ffffff;
    --border: #e3e8ef;
    --text: #172133;
    --muted: #667085;
    --primary: #0e9384;
    --primary-dark: #0b7568;
    --primary-soft: #e7f6f4;
    --danger: #d92d20;
    --danger-soft: #fef3f2;
    --success: #067647;
    --success-soft: #ecfdf3;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
    --font: "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", "Noto Sans Devanagari", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 20px; font-weight: 700; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: .9rem; }
.brand small { display: block; font-weight: 400; color: var(--muted); font-size: .78rem; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a, .nav .soon { padding: 9px 12px; border-radius: 8px; color: var(--text); font-weight: 500; display: flex; justify-content: space-between; align-items: center; }
.nav a:hover { background: var(--bg); text-decoration: none; }
.nav a.active { background: var(--primary-soft); color: var(--primary-dark); }
.nav .soon { color: var(--muted); cursor: default; }
.nav .soon small { font-size: .7rem; background: var(--bg); padding: 1px 7px; border-radius: 99px; }
.nav-section { margin: 16px 12px 4px; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.sidebar-footer { border-top: 1px solid var(--border); padding: 14px 8px 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-footer .who strong { display: block; font-size: .9rem; }
.sidebar-footer .who span { font-size: .78rem; color: var(--muted); }

.main { padding: 28px 36px 48px; max-width: 1180px; width: 100%; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-header p { margin: 4px 0 0; }
.back { display: inline-block; margin-bottom: 6px; font-size: .9rem; }

/* ---------- Components ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card + .card { margin-top: 18px; }
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: 2fr 1fr; }

.stat .label { color: var(--muted); font-size: .85rem; }
.stat .value { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--bg); text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { color: var(--danger); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { padding: 6px 11px; font-size: .85rem; }
.btn-lg { padding: 14px 22px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-weight: 500; }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert ul { margin: 0; padding-left: 18px; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .75rem; font-weight: 600; background: var(--bg); color: var(--muted); }
.badge-primary { background: var(--primary-soft); color: var(--primary-dark); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }

/* ---------- Tables ---------- */
.table-card { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 12px 18px; border-bottom: 1px solid var(--border); background: #fafbfc; }
.table td { padding: 13px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbfc; }
.table .name { font-weight: 600; color: var(--text); }
.pager { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 16px; }

.empty { text-align: center; padding: 48px 20px; }
.empty p { margin: 6px 0 18px; }

/* ---------- Forms ---------- */
.form { max-width: 720px; }
.field { margin-bottom: 18px; }
.field > label, .field-label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: .82rem; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=time], input[type=search], select, textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; font: inherit; color: var(--text); background: #fff; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.is-invalid { border-color: var(--danger) !important; }
.field-error { color: var(--danger); font-size: .83rem; margin: 5px 0 0; }
.form-footer { display: flex; gap: 10px; justify-content: flex-end; border-top: 1px solid var(--border); padding-top: 18px; margin-top: 6px; }

/* Big tap-friendly choice buttons: "select, don't type". */
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices label { position: relative; }
.choices input { position: absolute; opacity: 0; pointer-events: none; }
.choices span { display: inline-block; padding: 9px 18px; border: 1px solid var(--border); border-radius: 99px; cursor: pointer; font-weight: 500; background: #fff; transition: all .15s; }
.choices span:hover { border-color: var(--primary); }
.choices input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.choices input:focus-visible + span { box-shadow: 0 0 0 3px var(--primary-soft); }

.toggle { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; }
.toggle input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); }

.search { margin-bottom: 16px; }
.search input { max-width: 420px; padding: 11px 14px; }

/* ---------- Detail view ---------- */
.details { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 24px; margin: 0; }
.details dt { color: var(--muted); font-size: .82rem; }
.details dd { margin: 2px 0 0; font-weight: 500; }
.placeholder { border-style: dashed; background: transparent; box-shadow: none; text-align: center; color: var(--muted); }

/* ---------- Working hours ---------- */
.hours td { padding: 10px 14px; }
.hours input[type=time] { width: 120px; padding: 7px 9px; }
.hours tr.off .times { opacity: .35; }

/* ---------- Examination ---------- */
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.card-head h2 { margin: 0; }
.exam-item { display: block; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; margin-top: 8px; color: var(--text); }
.exam-item:hover { border-color: var(--primary); text-decoration: none; background: #fafbfc; }
.exam-date { font-size: .78rem; color: var(--muted); }
.exam-title { font-weight: 600; }

.exam-form .step { margin-bottom: 18px; }
.exam-form .card + .card { margin-top: 0; }
.step-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.step-head h2 { margin: 0; }
.step-head p { margin: 2px 0 0; }
.step-no { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; display: inline-grid; place-items: center; font-weight: 700; font-size: .85rem; }
.exam-summary h2 .step-no { width: 24px; height: 24px; font-size: .78rem; margin-right: 6px; vertical-align: 2px; }
.field.other { margin: 16px 0 0; }

.picker-tools { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.picker-tools input[type=search] { max-width: 460px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter { border: 1px solid var(--border); background: #fff; border-radius: 99px; padding: 5px 12px; font: inherit; font-size: .83rem; cursor: pointer; color: var(--muted); }
.filter:hover { border-color: var(--primary); color: var(--text); }
.filter.active { background: var(--text); border-color: var(--text); color: #fff; }
.complaint-list { max-height: 420px; overflow-y: auto; padding-right: 4px; }

.option-group + .option-group { margin-top: 14px; }
.option-group-title { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; margin-bottom: 7px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { position: relative; }
.chip[hidden] { display: none; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: 7px 13px; border: 1px solid var(--border); border-radius: 99px; background: #fff; cursor: pointer; font-size: .9rem; transition: all .12s; }
.chip span:hover { border-color: var(--primary); }
.chip input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip input:checked + span::before { content: "✓ "; }
.chip input:focus-visible + span { box-shadow: 0 0 0 3px var(--primary-soft); }

/* Tests stay hidden until a diagnosis is chosen (or typed under "Other diagnosis"). */
.exam-form:not(:has(input[name="diagnosisIds"]:checked)):not(:has(#otherDiagnosis:not(:placeholder-shown))) .tests-body { display: none; }
.exam-form:has(input[name="diagnosisIds"]:checked) .tests-hint,
.exam-form:has(#otherDiagnosis:not(:placeholder-shown)) .tests-hint { display: none; }

.teeth-chart { display: flex; flex-direction: column; align-items: center; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.arch { display: flex; }
.arch.lower { border-top: 2px solid var(--border); padding-top: 6px; }
.arch-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.quadrant { display: flex; gap: 4px; padding: 0 8px; }
.quadrant.right { border-right: 2px solid var(--border); }
.tooth { position: relative; }
.tooth input { position: absolute; opacity: 0; pointer-events: none; }
.tooth span { display: grid; place-items: center; width: 38px; height: 42px; border: 1px solid var(--border); border-radius: 10px 10px 14px 14px; background: #fff; cursor: pointer; font-size: .85rem; font-weight: 600; transition: all .12s; }
.tooth span:hover { border-color: var(--primary); }
.tooth input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.tooth input:focus-visible + span { box-shadow: 0 0 0 3px var(--primary-soft); }
.primary-teeth { margin-top: 14px; }
.primary-teeth summary { cursor: pointer; color: var(--primary); font-weight: 600; margin-bottom: 10px; }

.plan-settings { display: grid; grid-template-columns: auto 180px 140px; gap: 16px; align-items: end; }
.planner:has(input[name="treatmentMonths"][value=""]:checked) .plan-settings { display: none; }
.plan-summary { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin: 4px 0 12px; }
.plan-card { border: 1px solid var(--border); border-radius: 10px; overflow-x: auto; }
.plan-table td, .plan-table th { padding: 9px 14px; }
.plan-table .plan-date { font-weight: 600; margin-right: 6px; }
.plan-table input[type=datetime-local] { padding: 6px 8px; font-size: .85rem; width: 210px; }
.plan-table tr.row-error td { background: var(--danger-soft); }
.plan-table .field-error { margin: 2px 0 0; }

.sticky-footer { position: sticky; bottom: 0; background: var(--bg); padding: 14px 0; margin: 0; z-index: 5; }

.exam-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.exam-summary .card + .card { margin-top: 0; }
.exam-summary section:last-child { grid-column: 1 / -1; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 5px 11px; border-radius: 99px; background: var(--primary-soft); color: var(--primary-dark); font-size: .88rem; font-weight: 500; }
.tag-other { background: var(--bg); color: var(--text); border: 1px dashed var(--border); }
.tag-tooth { background: var(--text); color: #fff; font-weight: 700; }
.findings { margin-top: 12px; }
.findings p { margin: 2px 0 0; }

/* ---------- Calendar ---------- */
.main-wide { max-width: 1400px; }
.cal-controls { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.dentist-switch select { width: auto; padding: 8px 10px; }
.tabs { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.tabs a { padding: 7px 14px; border-radius: 7px; color: var(--muted); font-weight: 600; font-size: .9rem; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.active { background: var(--primary); color: #fff; }

.cal-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.legend { display: flex; gap: 14px; font-size: .85rem; color: var(--muted); }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 3px; }
.dot.booked { background: var(--primary); }
.dot.free { background: #fff; border: 1.5px dashed #33b38a; }
.dot.break { background: repeating-linear-gradient(45deg, #eef1f5, #eef1f5 3px, #fff 3px, #fff 6px); border: 1px solid var(--border); }

.cal-card { padding: 0; overflow-x: auto; }
.cal-grid { --row-h: 18px; display: grid; grid-template-columns: 64px repeat(7, minmax(120px, 1fr)); min-width: 920px; }
.cal-corner, .cal-day-head { position: sticky; top: 0; background: #fafbfc; border-bottom: 1px solid var(--border); z-index: 2; }
.cal-day-head { padding: 10px 10px 8px; border-left: 1px solid var(--border); }
.cal-day-head .dow { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.cal-day-head .dom { font-weight: 700; font-size: 1.05rem; }
.cal-day-head .counts { font-size: .75rem; color: var(--muted); }
.cal-day-head.today .dom { color: var(--primary); }
.cal-hours { display: grid; padding-top: 4px; }
.cal-hour { font-size: .72rem; color: var(--muted); text-align: right; padding-right: 8px; border-top: 1px solid var(--border); padding-top: 2px; }
.cal-day { display: grid; grid-template-columns: 1fr; border-left: 1px solid var(--border); padding: 4px 4px 8px; gap: 0;
    background-image: linear-gradient(var(--border) 1px, transparent 1px); background-size: 100% calc(var(--row-h) * 4); background-position: 0 4px; }
.cal-day.today { background-color: #f6fbfa; }
.cal-day.closed { background-color: #f7f8fa; }
.cal-block { grid-column: 1; margin: 1px 2px; border-radius: 7px; padding: 2px 7px; font-size: .75rem; overflow: hidden; line-height: 1.3; }
.cal-block.booked { background: var(--primary); color: #fff; display: flex; flex-direction: column; justify-content: center; z-index: 1; }
.cal-block.booked:hover { background: var(--primary-dark); text-decoration: none; }
.cal-block.booked strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-block.booked span { opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-block.free { border: 1.5px dashed #33b38a; background: #f1fbf6; color: #1d7a57; display: flex; align-items: center; }
.cal-block.break { background: repeating-linear-gradient(45deg, #eef1f5, #eef1f5 4px, #f8f9fb 4px, #f8f9fb 8px); color: var(--muted); display: flex; align-items: center; justify-content: center; }

.month-grid { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 700px; }
.month-grid th { padding: 10px; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #fafbfc; border-bottom: 1px solid var(--border); }
.month-grid td { border: 1px solid var(--border); height: 96px; vertical-align: top; padding: 0; }
.month-grid td.out { background: #fafbfc; }
.month-grid td.out .month-day { opacity: .45; }
.month-grid td.closed { background: #f7f8fa; }
.month-grid td.today .dom { background: var(--primary); color: #fff; border-radius: 99px; padding: 0 8px; }
.month-day { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 8px; height: 100%; color: var(--text); }
.month-day:hover { background: var(--primary-soft); text-decoration: none; }
.month-day .dom { font-weight: 700; }
.pill { font-size: .72rem; padding: 1px 8px; border-radius: 99px; font-weight: 600; }
.pill.booked { background: var(--primary); color: #fff; }
.pill.free { background: #e8f8f0; color: #1d7a57; }
.pill.closed { color: var(--muted); }

/* Booking from a free slot, days off, appointment status */
.cal-block.free { text-decoration: none; justify-content: space-between; gap: 4px; }
.cal-block.free .plus { display: none; font-weight: 700; }
.cal-block.free:hover { background: #33b38a; color: #fff; border-style: solid; text-decoration: none; }
.cal-block.free:hover .plus { display: inline; }
.cal-block.booked.done { background: #475467; }
.cal-block.booked.noshow { background: var(--danger); }
.cal-block.off { background: #fff4e5; border: 1px solid #f5c37a; color: #8a5300; display: flex; align-items: center; justify-content: center; text-align: center; }
.cal-day.off { background-color: #fff8ee; }
.dot.off { background: #fff4e5; border: 1px solid #f5c37a; }
.close-day { font-size: .72rem; }
.closed-reason { color: #8a5300 !important; font-weight: 600; }
.pill.off { background: #fff4e5; color: #8a5300; }
.month-grid td.off { background: #fff8ee; }

.alert-warning { background: #fff8ee; color: #8a5300; border: 1px solid #f5c37a; }
.alert-warning a { color: #8a5300; text-decoration: underline; }
.alert p { margin: 0; }

.patient-results { margin-top: 10px; min-height: 40px; }
.off-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--border); }
form:has(input[name="wholeDay"]:checked) .part-day { display: none; }

.reschedule { display: flex; gap: 10px; flex-wrap: wrap; }
.reschedule input { max-width: 260px; }
.status-actions { display: flex; flex-direction: column; gap: 8px; }
.status-badge { font-size: .9rem; padding: 6px 14px; }
.status-scheduled { background: var(--primary-soft); color: var(--primary-dark); }
.status-confirmed { background: var(--success-soft); color: var(--success); }
.status-completed { background: #eaecf0; color: #344054; }
.status-cancelled, .status-no_show { background: var(--danger-soft); color: var(--danger); }

/* Multiple visits: step-6 options, next-sitting picker, course progress */
.planner .multi-settings { display: none; margin-top: 4px; }
.planner:has(input[name="treatmentMonths"][value="0"]:checked) .multi-settings { display: block; }
.planner:has(input[name="treatmentMonths"][value="0"]:checked) .plan-settings,
.planner:has(input[name="treatmentMonths"][value="0"]:checked) #schedule-preview { display: none; }
.multi-settings:not(:has(input[name="sittings"]:checked)) .next-sitting,
.multi-settings:has(input[name="sittings"][value="1"]:checked) .next-sitting { display: none; }
.next-sitting { border-top: 1px solid var(--border); padding-top: 14px; }
.sub-title { font-size: 1rem; margin: 0 0 4px; }
.sitting-picker { margin-top: 10px; }
.free-times { margin: 6px 0 4px; }
.time-chips .chip span { min-width: 84px; text-align: center; }
.inner-card { margin-top: 14px; box-shadow: none; background: #fafbfc; }

.course-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.progress { height: 8px; border-radius: 99px; background: var(--bg); overflow: hidden; margin-bottom: 12px; }
.progress span { display: block; height: 100%; border-radius: 99px; background: var(--primary); transition: width .4s ease; }
.sittings { list-style: none; margin: 0; padding: 0; }
.sittings li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.sittings .s-no { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem;
    border: 2px solid var(--border); color: var(--muted); background: #fff; }
.sittings li.done .s-no { background: var(--primary); border-color: var(--primary); color: #fff; }
.sittings li.booked .s-no { border-color: var(--primary); color: var(--primary); }
.sittings li.missed .s-no { border-color: var(--danger); color: var(--danger); }
.sittings .s-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.sittings .s-status { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.course-actions { margin-top: 14px; }

.range-switch { display: flex; gap: 6px; align-items: center; margin-bottom: 14px; }
.day-group + .day-group { margin-top: 14px; }
.day-title { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 1rem; }
.appt-row { display: grid; grid-template-columns: 170px 1fr auto; gap: 14px; align-items: center; padding: 11px 0; border-top: 1px solid var(--border); }
.appt-row.compact { grid-template-columns: 80px 1fr; padding: 8px 0; }
.appt-time { font-weight: 700; color: var(--primary-dark); }
.appt-meta { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, var(--primary-soft), var(--bg) 55%); }
.auth .card { width: 100%; max-width: 400px; padding: 32px; }
.auth .brand { padding: 0 0 22px; }

/* Elements that exist only for the phone layout. Hidden on desktop. */
.mobile-only { display: none; }

/* =====================================================================
   PHONE / SMALL TABLET (≤ 900px). Everything below applies only here;
   the desktop layout above is untouched.
   ===================================================================== */
@media (max-width: 900px) {
    :root { --tabbar-h: 64px; }

    /* ---- App shell: compact top bar + bottom tab bar ---- */
    .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
    .sidebar { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; align-items: center;
        padding: 10px 14px; border-right: 0; border-bottom: 1px solid var(--border); }
    .sidebar > .nav, .sidebar-footer { display: none; }
    .brand { padding: 0; }
    .brand-mark { width: 32px; height: 32px; }
    .main { padding: 16px 14px calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom)); }

    .mobile-only { display: block; }
    .tabbar.mobile-only { display: flex; }
    .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--border);
        box-shadow: 0 -2px 10px rgba(16, 24, 40, .05); }
    .tabbar > a, .tab-more > summary { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
        gap: 2px; font-size: .7rem; font-weight: 600; color: var(--muted); list-style: none; cursor: pointer; text-decoration: none; }
    .tabbar > a:hover { text-decoration: none; }
    .tab-more { flex: 1; display: flex; }
    .tab-more > summary::-webkit-details-marker { display: none; }
    .tab-icon { font-size: 1.35rem; line-height: 1; }
    .tabbar > a.active, .tab-more.active > summary, .tab-more[open] > summary { color: var(--primary); }
    .tab-add { color: var(--primary) !important; }
    .tab-add .tab-icon { width: 46px; height: 46px; margin-top: -20px; border-radius: 50%; background: var(--primary); color: #fff;
        display: grid; place-items: center; font-size: 1.7rem; box-shadow: 0 4px 12px rgba(14, 147, 132, .35); }
    .more-sheet { position: fixed; left: 10px; right: 10px; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 8px);
        display: flex; flex-direction: column; padding: 8px; background: var(--surface); border: 1px solid var(--border);
        border-radius: 16px; box-shadow: 0 12px 32px rgba(16, 24, 40, .18); }
    .more-who { display: flex; flex-direction: column; padding: 10px 14px 12px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
    .more-sheet a, .more-logout { display: block; width: 100%; padding: 13px 14px; border: 0; border-radius: 10px; background: none;
        font: inherit; font-size: 1rem; font-weight: 500; color: var(--text); text-align: left; text-decoration: none; }
    .more-sheet a:active, .more-logout:active { background: var(--bg); }
    .more-logout { color: var(--danger); cursor: pointer; }

    /* ---- General sizing: bigger tap targets, no iPhone zoom on focus ---- */
    h1 { font-size: 1.35rem; }
    .page-header { align-items: stretch; margin-bottom: 16px; }
    .page-header > .btn { width: 100%; }
    .page-header .actions { width: 100%; }
    .page-header .actions .btn { flex: 1; }
    .card { padding: 16px; }
    .btn { min-height: 44px; }
    .btn-sm { min-height: 36px; }
    input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=time],
    input[type=search], input[type=datetime-local], select, textarea { font-size: 16px; }
    .search input { max-width: none; }
    .form-footer { flex-direction: column-reverse; }
    .form-footer .btn { width: 100%; }
    .sticky-footer { flex-direction: row; }
    .sticky-footer .btn { width: auto; flex: 1; }
    .grid-2, .row, .details, .exam-summary, .plan-settings { grid-template-columns: 1fr; }

    input[type=datetime-local] { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px;
        font: inherit; font-size: 16px; color: var(--text); background: #fff; }
    .grid > .card + .card { margin-top: 0; }
    .table-card { padding: 0; }
    .card > .table:not(.stack-mobile) td { padding: 10px 6px; white-space: nowrap; }

    /* Dashboard: keep the three numbers side by side */
    .grid-3 { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .card.stat { padding: 12px; }
    .stat .label { font-size: .7rem; line-height: 1.25; }
    .stat .value { font-size: 1.5rem; }

    /* ---- Tables become cards ---- */
    .table-card:has(.stack-mobile) { background: transparent; border: 0; box-shadow: none; overflow: visible; }
    .plan-card { border: 0; }
    .stack-mobile thead { display: none; }
    .stack-mobile, .stack-mobile tbody, .stack-mobile tr { display: block; width: 100%; }
    .stack-mobile tr { position: relative; margin-bottom: 10px; padding: 12px 14px; background: var(--surface);
        border: 1px solid var(--border); border-radius: 12px; }
    .stack-mobile tbody tr:hover { background: var(--surface); }
    .stack-mobile td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0; border: 0; }
    .stack-mobile td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .8rem; font-weight: 500; }
    .stack-mobile td:has(input:not([type=checkbox]):not([type=hidden])) { flex-direction: column; align-items: stretch; gap: 4px; }
    .stack-mobile td.cell-title { font-size: 1.05rem; padding: 0 40px 6px 0; }
    .stack-mobile td.cell-seq { position: absolute; top: 12px; right: 14px; padding: 0; }
    .stack-mobile td.cell-actions { padding-top: 10px; }
    .stack-mobile td.cell-actions .actions { justify-content: flex-start !important; width: 100%; }
    .stack-mobile tr.row-error { background: var(--danger-soft); border-color: #f5b5ae; }
    .stack-mobile tr.row-error td { background: transparent; }
    .plan-table input[type=datetime-local] { width: 100%; }
    .hours input[type=time] { width: 100%; }
    .hours.stack-mobile tr { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; }
    .hours.stack-mobile td.cell-title, .hours.stack-mobile td[data-label="Open"] { grid-column: 1 / -1; }

    /* ---- Examination ---- */
    .chip span { padding: 9px 14px; font-size: .95rem; }
    .choices span { padding: 10px 16px; }
    .filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
    .filter { white-space: nowrap; padding: 7px 13px; }
    .complaint-list { max-height: 55vh; }
    .sticky-footer { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding: 10px 0; }
    .arch { flex-direction: column; align-items: center; gap: 10px; }
    .arch.lower { padding-top: 10px; }
    .quadrant { flex-wrap: wrap; justify-content: center; gap: 3px; padding: 0; }
    .quadrant.right { border-right: 0; }
    .quadrant::before { flex-basis: 100%; text-align: center; font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
    .arch:not(.lower) .quadrant.right::before { content: "Upper right"; }
    .arch:not(.lower) .quadrant.left::before { content: "Upper left"; }
    .arch.lower .quadrant.right::before { content: "Lower right"; }
    .arch.lower .quadrant.left::before { content: "Lower left"; }
    .tooth span { width: 35px; height: 40px; font-size: .8rem; }

    /* ---- Appointment list rows ---- */
    .appt-row { grid-template-columns: 1fr; gap: 4px; }
    .appt-meta { justify-content: flex-start; }
    .reschedule input { max-width: none; }
    .reschedule .btn { width: 100%; }

    /* ---- Calendar: toolbar, one-day agenda instead of the week grid ---- */
    .cal-controls { width: 100%; }
    .dentist-switch, .dentist-switch select { width: 100%; }
    .tabs { width: 100%; overflow-x: auto; }
    .tabs a { flex: 1; text-align: center; white-space: nowrap; padding: 9px 10px; }
    .cal-nav { flex-direction: column; align-items: stretch; }
    .cal-nav .actions .btn { flex: 1; }
    .cal-nav > strong { text-align: center; }
    .cal-nav .legend { justify-content: center; flex-wrap: wrap; }
    .cal-card:has(.cal-grid) { display: none; }

    .day-agenda .agenda-radio { display: none; }
    .day-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 12px; position: sticky;
        top: 53px; z-index: 5; background: var(--bg); padding: 4px 0; }
    .day-strip label { display: flex; flex-direction: column; align-items: center; padding: 7px 0; border-radius: 12px; cursor: pointer;
        background: var(--surface); border: 1px solid var(--border); }
    .day-strip .dow { font-size: .66rem; font-weight: 600; text-transform: uppercase; color: var(--muted); }
    .day-strip .dom { font-size: 1.05rem; font-weight: 700; }
    .day-strip .mini { font-size: .6rem; color: #1d7a57; white-space: nowrap; }
    .day-strip label.closed .mini { color: var(--muted); }
    .day-strip label.today .dom { color: var(--primary); }
    #agenda-0:checked ~ .day-strip label[for="agenda-0"], #agenda-1:checked ~ .day-strip label[for="agenda-1"],
    #agenda-2:checked ~ .day-strip label[for="agenda-2"], #agenda-3:checked ~ .day-strip label[for="agenda-3"],
    #agenda-4:checked ~ .day-strip label[for="agenda-4"], #agenda-5:checked ~ .day-strip label[for="agenda-5"],
    #agenda-6:checked ~ .day-strip label[for="agenda-6"] { background: var(--primary); border-color: var(--primary); }
    #agenda-0:checked ~ .day-strip label[for="agenda-0"] span, #agenda-1:checked ~ .day-strip label[for="agenda-1"] span,
    #agenda-2:checked ~ .day-strip label[for="agenda-2"] span, #agenda-3:checked ~ .day-strip label[for="agenda-3"] span,
    #agenda-4:checked ~ .day-strip label[for="agenda-4"] span, #agenda-5:checked ~ .day-strip label[for="agenda-5"] span,
    #agenda-6:checked ~ .day-strip label[for="agenda-6"] span { color: #fff; }
    .agenda-day { display: none; }
    #agenda-0:checked ~ .agenda-day[data-day="0"], #agenda-1:checked ~ .agenda-day[data-day="1"],
    #agenda-2:checked ~ .agenda-day[data-day="2"], #agenda-3:checked ~ .agenda-day[data-day="3"],
    #agenda-4:checked ~ .agenda-day[data-day="4"], #agenda-5:checked ~ .agenda-day[data-day="5"],
    #agenda-6:checked ~ .agenda-day[data-day="6"] { display: block; }
    .agenda-head { display: flex; flex-direction: column; margin-bottom: 12px; }
    .agenda-item { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 12px; margin-bottom: 8px;
        border-radius: 12px; color: var(--text); text-decoration: none; }
    .agenda-item:hover { text-decoration: none; }
    .agenda-item .a-time { flex: none; width: 74px; font-size: .85rem; font-weight: 700; }
    .agenda-item .a-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
    .agenda-item .a-main strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .agenda-item .a-go { font-size: 1.4rem; color: var(--muted); }
    .agenda-item.booked { background: var(--primary-soft); border-left: 4px solid var(--primary); }
    .agenda-item.free { background: #f1fbf6; border: 1.5px dashed #33b38a; color: #1d7a57; }
    .agenda-item.free:active { background: #33b38a; color: #fff; }
    .agenda-item .a-book { font-weight: 700; }
    .agenda-item.break { min-height: 0; padding: 7px 12px; color: var(--muted);
        background: repeating-linear-gradient(45deg, #eef1f5, #eef1f5 4px, #f8f9fb 4px, #f8f9fb 8px); }
    .agenda-item.off { background: #fff4e5; color: #8a5300; }

    /* Month: compact cells with coloured dots */
    .cal-card:has(.month-grid) { overflow: visible; }
    .month-grid { min-width: 0; }
    .month-grid th { padding: 6px 0; font-size: .65rem; }
    .month-grid td { height: 56px; }
    .month-day { flex-direction: row; flex-wrap: wrap; justify-content: center; align-content: flex-start; gap: 3px; padding: 6px 2px; }
    .month-day .dom { flex-basis: 100%; text-align: center; font-size: .9rem; }
    .month-grid td.today .dom { flex-basis: auto; }
    .pill { font-size: 0; width: 8px; height: 8px; padding: 0; border-radius: 50%; }
    .pill.free { background: #33b38a; }
    .pill.off { background: #f5a524; }
    .pill.closed { background: #d0d5dd; }
}

/* Priority labels: green (low), yellow (medium), red (high) */
.prio-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; vertical-align: 1px; margin-right: 4px; }
.prio-dot.prio-lg { width: 14px; height: 14px; vertical-align: 3px; }
.prio-dot.prio-GREEN { background: #22c55e; }
.prio-dot.prio-YELLOW { background: #eab308; }
.prio-dot.prio-RED { background: #ef4444; }
.cal-block.booked.prio-GREEN { box-shadow: inset 4px 0 0 #22c55e; }
.cal-block.booked.prio-YELLOW { box-shadow: inset 4px 0 0 #eab308; }
.cal-block.booked.prio-RED { box-shadow: inset 4px 0 0 #ef4444; }
.agenda-item.booked.prio-GREEN { border-left-color: #22c55e; }
.agenda-item.booked.prio-YELLOW { border-left-color: #eab308; }
.agenda-item.booked.prio-RED { border-left-color: #ef4444; }
.prio-picker { display: flex; gap: 8px; margin-bottom: 8px; }
.prio-picker form { flex: 1; }
.prio-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px; border-radius: 10px;
    border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.prio-btn.selected.prio-GREEN { border-color: #22c55e; background: rgba(34, 197, 94, .12); }
.prio-btn.selected.prio-YELLOW { border-color: #eab308; background: rgba(234, 179, 8, .14); }
.prio-btn.selected.prio-RED { border-color: #ef4444; background: rgba(239, 68, 68, .12); }
.sittings .prio-dot { margin: 0; }
/* Calendar appointment box: name and time centred; the priority dot stays on the left. */
.cal-block.booked { align-items: stretch; text-align: center; }
.cal-block.booked strong { position: relative; display: block; padding: 0 12px; }
.cal-block.booked strong .prio-dot.on-fill { position: absolute; left: 0; top: 50%; transform: translateY(-50%); margin: 0; }
.prio-dot.on-fill { width: 9px; height: 9px; box-shadow: 0 0 0 1.5px #fff; margin-right: 5px; vertical-align: 0; }

/* Date / time picker (flatpickr) in DentDesk colours, light and dark */
.flatpickr-input[readonly] { cursor: pointer; background: var(--surface); }
[data-theme="dark"] .flatpickr-input[readonly] { background: var(--input-bg); }
.flatpickr-calendar { font-family: var(--font); border-radius: 14px; border: 1px solid var(--border); background: var(--surface);
    box-shadow: 0 12px 32px rgba(16, 24, 40, .16); }
.flatpickr-calendar.arrowTop::before, .flatpickr-calendar.arrowTop::after,
.flatpickr-calendar.arrowBottom::before, .flatpickr-calendar.arrowBottom::after { display: none; }
.flatpickr-months .flatpickr-month, .flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year, span.flatpickr-weekday,
.flatpickr-months .flatpickr-prev-month, .flatpickr-months .flatpickr-next-month { color: var(--text); fill: var(--text); background: transparent; }
.flatpickr-current-month { font-size: 1rem; font-weight: 600; }
span.flatpickr-weekday { color: var(--muted); font-weight: 600; font-size: .75rem; }
.flatpickr-day { color: var(--text); border-radius: 10px; }
.flatpickr-day:hover, .flatpickr-day:focus { background: var(--primary-soft); border-color: transparent; }
.flatpickr-day.today { border-color: var(--primary); }
.flatpickr-day.selected, .flatpickr-day.selected:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.flatpickr-day.flatpickr-disabled, .flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay { color: var(--muted); opacity: .45; }
.flatpickr-time { border-top: 1px solid var(--border) !important; }
.flatpickr-time input, .flatpickr-time .flatpickr-am-pm, .flatpickr-time .flatpickr-time-separator { color: var(--text); background: transparent; }
.flatpickr-time input:hover, .flatpickr-time .flatpickr-am-pm:hover,
.flatpickr-time input:focus, .flatpickr-time .flatpickr-am-pm:focus { background: var(--primary-soft); }
.flatpickr-calendar.hasTime.noCalendar { width: 220px; }
.numInputWrapper span.arrowUp::after { border-bottom-color: var(--muted); }
.numInputWrapper span.arrowDown::after { border-top-color: var(--muted); }

/* Appointments moved out of a closed day */
.moved-card { margin-bottom: 18px; }
.moved-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: baseline; padding: 9px 0; border-top: 1px solid var(--border); }

/* Patient messages */
.msg-item { padding: 10px 0; border-top: 1px solid var(--border); }
.msg-item:first-of-type { border-top: 0; }
.msg-item p { margin: 6px 0 0; }
.msg-cell { max-width: 420px; white-space: normal; }

/* =====================================================================
   LOGO
   ===================================================================== */
img.brand-mark { display: block; object-fit: cover; background: none; box-shadow: 0 1px 3px rgba(16, 24, 40, .15); }
.login-logo { display: block; width: 132px; height: 132px; margin: 0 auto 14px; border-radius: 28px; object-fit: cover;
    box-shadow: 0 8px 24px rgba(14, 147, 132, .25); }
.auth .login-brand { justify-content: center; text-align: center; padding-bottom: 18px; }
.auth h1, .auth .card > p.muted { text-align: center; }

/* =====================================================================
   THEME TOGGLE (top right)
   ===================================================================== */
.theme-toggle { position: fixed; top: 14px; right: 18px; z-index: 40; width: 38px; height: 38px; border-radius: 50%;
    display: grid; place-items: center; cursor: pointer; font-size: 1.1rem; line-height: 1;
    background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow);
    transition: transform .15s, background .15s; }
.theme-toggle:hover { transform: rotate(-15deg); }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
/* Room for the toggle above the page title on desktop. */
.main { padding-top: 60px; }
@media (max-width: 900px) {
    .theme-toggle { top: 10px; right: 12px; width: 34px; height: 34px; }
    .main { padding-top: 16px; }
}

/* =====================================================================
   DARK THEME: active only when <html data-theme="dark">.
   The light theme above is not modified; this block only overrides it.
   ===================================================================== */
[data-theme="dark"] {
    color-scheme: dark;   /* dark native date/time pickers and scrollbars */
    --bg: #0b0d10;
    --surface: #14181d;
    --surface-2: #1b2027;
    --input-bg: #0f1216;
    --border: #262c35;
    --text: #e6eaef;
    --muted: #8d97a5;
    --primary: #12a594;
    --primary-dark: #0e9384;
    --primary-soft: rgba(18, 165, 148, .16);
    --primary-text: #5eead4;
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, .12);
    --success: #4ade80;
    --success-soft: rgba(74, 222, 128, .12);
    --free: #6ee7b7;
    --free-soft: rgba(51, 179, 138, .12);
    --free-border: rgba(51, 179, 138, .55);
    --off: #fbbf24;
    --off-soft: rgba(245, 165, 36, .12);
    --off-border: rgba(245, 165, 36, .45);
    --stripe-a: #1a1f26;
    --stripe-b: #14181e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 1px 3px rgba(0, 0, 0, .35);
}

/* Surfaces that were hard-coded white / off-white */
[data-theme="dark"] .table th,
[data-theme="dark"] .cal-corner, [data-theme="dark"] .cal-day-head,
[data-theme="dark"] .month-grid th,
[data-theme="dark"] .month-grid td.out,
[data-theme="dark"] .inner-card { background: var(--surface-2); }
[data-theme="dark"] .table tbody tr:hover,
[data-theme="dark"] .exam-item:hover { background: var(--surface-2); }
[data-theme="dark"] input[type=text], [data-theme="dark"] input[type=email], [data-theme="dark"] input[type=password],
[data-theme="dark"] input[type=tel], [data-theme="dark"] input[type=date], [data-theme="dark"] input[type=time],
[data-theme="dark"] input[type=search], [data-theme="dark"] input[type=datetime-local],
[data-theme="dark"] select, [data-theme="dark"] textarea { background: var(--input-bg); color: var(--text); border-color: var(--border); }
[data-theme="dark"] .choices span, [data-theme="dark"] .filter, [data-theme="dark"] .chip span,
[data-theme="dark"] .tooth span, [data-theme="dark"] .sittings .s-no { background: var(--surface-2); color: var(--text); }
[data-theme="dark"] .filter { color: var(--muted); }

/* Text on light-on-dark fills */
[data-theme="dark"] .filter.active, [data-theme="dark"] .tag-tooth { background: var(--text); border-color: var(--text); color: var(--bg); }
[data-theme="dark"] .badge-primary, [data-theme="dark"] .tag, [data-theme="dark"] .nav a.active,
[data-theme="dark"] .status-scheduled, [data-theme="dark"] .appt-time { color: var(--primary-text); }
[data-theme="dark"] .tag-other { color: var(--text); }
[data-theme="dark"] .btn-primary, [data-theme="dark"] .cal-block.booked, [data-theme="dark"] .tabs a.active { color: #fff; }
[data-theme="dark"] .status-completed { background: #2a2f37; color: #cbd5e1; }

/* Calendar: today, closed, free slots, break, days off */
[data-theme="dark"] .cal-day.today { background-color: rgba(18, 165, 148, .06); }
[data-theme="dark"] .cal-day.closed, [data-theme="dark"] .month-grid td.closed { background-color: #101317; }
[data-theme="dark"] .cal-block.free, [data-theme="dark"] .agenda-item.free { background: var(--free-soft); border-color: var(--free-border); color: var(--free); }
[data-theme="dark"] .cal-block.free:hover { background: #33b38a; color: #fff; }
[data-theme="dark"] .dot.free { background: transparent; border-color: var(--free-border); }
[data-theme="dark"] .pill.free { background: var(--free-soft); color: var(--free); }
[data-theme="dark"] .cal-block.break, [data-theme="dark"] .agenda-item.break, [data-theme="dark"] .dot.break {
    background: repeating-linear-gradient(45deg, var(--stripe-a), var(--stripe-a) 4px, var(--stripe-b) 4px, var(--stripe-b) 8px); }
[data-theme="dark"] .cal-block.off, [data-theme="dark"] .agenda-item.off, [data-theme="dark"] .pill.off,
[data-theme="dark"] .dot.off, [data-theme="dark"] .alert-warning { background: var(--off-soft); border-color: var(--off-border); color: var(--off); }
[data-theme="dark"] .cal-day.off, [data-theme="dark"] .month-grid td.off { background-color: rgba(245, 165, 36, .06); }
[data-theme="dark"] .closed-reason, [data-theme="dark"] .alert-warning a { color: var(--off) !important; }
[data-theme="dark"] .placeholder { border-color: var(--border); }

/* Login background */
[data-theme="dark"] .auth { background: linear-gradient(160deg, rgba(18, 165, 148, .14), var(--bg) 55%); }

@media (max-width: 900px) {
    [data-theme="dark"] .day-strip .mini { color: var(--free); }
    [data-theme="dark"] .tabbar { box-shadow: 0 -2px 12px rgba(0, 0, 0, .5); }
    [data-theme="dark"] .more-sheet { box-shadow: 0 12px 32px rgba(0, 0, 0, .6); }
    [data-theme="dark"] .pill.free { background: #33b38a; }
    [data-theme="dark"] .pill.off { background: #f5a524; }
    [data-theme="dark"] .pill.closed { background: #4b5563; }
    [data-theme="dark"] .stack-mobile tr.row-error { border-color: rgba(248, 113, 113, .4); }
}
