/* IDOS — one stylesheet for the whole app. Brand: logo purple + cross green. */
:root {
  --brand: #7444f0; --brand-ink: #5a2fd0; --brand-soft: #efe9ff; --green: #2fa51c; --green-soft: #e5f6e1;
  --bg: #f6f5fa; --surface: #ffffff; --surface-2: #f1eff7; --line: #e4e1ee; --text: #1d1a29; --muted: #6b6680;
  --warn: #b26a00; --warn-soft: #fff3dc; --danger: #c62f3a; --danger-soft: #fde8ea; --info: #2a62c9; --info-soft: #e6eefc;
  --shadow: 0 1px 2px rgb(29 26 41 / .05), 0 6px 20px rgb(29 26 41 / .06);
  --r: 14px; --r-s: 10px; --side: 248px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #9b78ff; --brand-ink: #b79cff; --brand-soft: #2a2245; --green: #5bd146; --green-soft: #1d3319;
    --bg: #121019; --surface: #1b1825; --surface-2: #242031; --line: #322d43; --text: #ece9f5; --muted: #a29cb6;
    --warn: #f0b04a; --warn-soft: #3a2c12; --danger: #ff7a84; --danger-soft: #3d1a1f; --info: #7aa6ff; --info-soft: #1a2640;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #9b78ff; --brand-ink: #b79cff; --brand-soft: #2a2245; --green: #5bd146; --green-soft: #1d3319;
  --bg: #121019; --surface: #1b1825; --surface-2: #242031; --line: #322d43; --text: #ece9f5; --muted: #a29cb6;
  --warn: #f0b04a; --warn-soft: #3a2c12; --danger: #ff7a84; --danger-soft: #3d1a1f; --info: #7aa6ff; --info-soft: #1a2640;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .25);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.65 "IBM Plex Sans Arabic", system-ui, sans-serif; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.3; font-weight: 700; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1.02rem; } h4 { font-size: .98rem; }
p { margin: 0 0 .6em; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
code { background: var(--surface-2); padding: .1em .4em; border-radius: 6px; font-size: .9em; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.skip { position: absolute; top: -200px; inset-inline-start: 1rem; z-index: 99; background: var(--surface); padding: .5rem 1rem; border-radius: var(--r-s); } .skip:focus { top: 1rem; }
.i { width: 1.2em; height: 1.2em; flex: none; vertical-align: -.22em; }
.muted { color: var(--muted); } .small { font-size: .86rem; } .center { text-align: center; }
.row { display: flex; align-items: center; } .between { justify-content: space-between; } .wrap { flex-wrap: wrap; }
.gap { gap: .75rem; } .gap-s { gap: .4rem; } .grow { flex: 1; } .spacer { flex: 1; }
[hidden] { display: none !important; }
.warn-text { color: var(--warn); } .danger-text { color: var(--danger) !important; }
.boot { display: grid; place-items: center; min-height: 100vh; } .boot img { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; transform: scale(.95); } }
.fatal { max-width: 560px; margin: 20vh auto; padding: 1rem; text-align: center; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; border: 1px solid transparent; border-radius: 999px;
  padding: .55rem 1.1rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none !important; transition: background .15s, transform .1s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); color: #fff; } .btn.primary:hover { background: var(--brand-ink); }
:root[data-theme="dark"] .btn.primary, :root[data-theme="dark"] .btn.primary:hover { color: #140d2b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #140d2b; } }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--text); } .btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.sm { padding: .32rem .8rem; font-size: .86rem; } .btn.lg { padding: .75rem 1.4rem; font-size: 1.02rem; } .btn.block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 0; background: transparent; color: inherit; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }
.link { background: none; border: 0; padding: 0; color: var(--brand-ink); font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: .25rem; }
:root:not([data-theme="dark"]) .only-dark { display: none; } :root[data-theme="dark"] .only-light { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .only-light { display: none; } :root:not([data-theme]) .only-dark { display: inline; } }

label { display: block; font-weight: 500; font-size: .92rem; margin-bottom: .8rem; }
label small { display: block; color: var(--muted); font-weight: 400; }
.label { font-weight: 600; font-size: .92rem; display: block; margin-bottom: .35rem; }
input, select, textarea { display: block; width: 100%; margin-top: .3rem; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-s); padding: .6rem .8rem; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input:disabled { background: var(--surface-2); color: var(--muted); }
input[type="radio"] { width: auto; display: inline; margin: 0; }
textarea { resize: vertical; }
.input-icon { position: relative; } .input-icon > .i { position: absolute; inset-inline-start: .8rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon input { padding-inline-start: 2.4rem; margin: 0; }
.search { min-width: 220px; }
.form-error { color: var(--danger); background: var(--danger-soft); padding: .5rem .8rem; border-radius: var(--r-s); font-size: .9rem; }

.badge { display: inline-block; padding: .12rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.badge.ok { background: var(--green-soft); color: var(--green); } .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.info { background: var(--info-soft); color: var(--info); } .badge.muted { background: var(--surface-2); color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: .28rem .75rem; font: inherit; font-size: .88rem; cursor: pointer; }
.chip:hover { border-color: var(--brand); }
.chip.on { background: var(--brand-soft); border-color: transparent; color: var(--brand-ink); font-weight: 600; }
.chip button { border: 0; background: none; color: inherit; padding: 0; display: grid; cursor: pointer; opacity: .7; }
.chip.sm { font-size: .8rem; padding: .18rem .6rem; }
.chip.w0 { opacity: .75; } .chip.w2 { border-color: var(--brand); } .chip.w3 { background: var(--brand-soft); border-color: transparent; color: var(--brand-ink); }
span.chip { cursor: default; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1.15rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .6rem; }
.card-head h2 { margin: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1rem; }
.grid2.top { align-items: start; gap: 0 1rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.page-head h1 { margin: 0; } .page-head p { margin: 0; }
.section-title { margin: .4rem 0 .7rem; }
.empty { text-align: center; padding: 1.6rem 1rem; color: var(--muted); }
.empty > .i { width: 40px; height: 40px; color: var(--brand); opacity: .55; margin-bottom: .4rem; }
.empty h3 { color: var(--text); margin-bottom: .2rem; }
.back { display: inline-flex; align-items: center; gap: .3rem; margin-bottom: .7rem; color: var(--muted); }
.back .i, .tabbar .i { transform: none; }
[dir="rtl"] .back .i { transform: scaleX(-1); }
.notice { display: flex; gap: .6rem; align-items: flex-start; background: var(--warn-soft); color: var(--warn); border-radius: var(--r-s); padding: .7rem .9rem; margin-bottom: 1rem; }
.notice p { margin: 0; color: var(--text); }

.tabs { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs button { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: .35rem .9rem; font: inherit; font-size: .9rem; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.tabs em { font-style: normal; opacity: .65; margin-inline-start: .2rem; }

.avatar { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; font-weight: 700; font-size: .9rem;
  background: var(--brand-soft); color: var(--brand-ink); }
.avatar[data-role="doctor"] { background: var(--green-soft); color: var(--green); }
.avatar[data-role="admin"] { background: var(--info-soft); color: var(--info); }
.avatar.lg { width: 64px; height: 64px; font-size: 1.3rem; }

/* ---------- toast + dialog ---------- */
#toasts { position: fixed; z-index: 100; bottom: 1rem; inset-inline: 1rem; display: flex; flex-direction: column; align-items: center; gap: .5rem; pointer-events: none; }
.toast { display: flex; align-items: center; gap: .5rem; background: var(--text); color: var(--bg); padding: .6rem 1rem; border-radius: 999px; box-shadow: var(--shadow);
  animation: up .25s ease; transition: opacity .3s, transform .3s; font-weight: 500; }
.toast.err { background: var(--danger); color: #fff; } .toast.info { background: var(--info); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); }
@keyframes up { from { opacity: 0; transform: translateY(10px); } }
dialog { border: 0; padding: 0; border-radius: var(--r); background: var(--surface); color: var(--text); width: min(480px, calc(100vw - 2rem)); box-shadow: 0 20px 60px rgb(0 0 0 / .3); }
dialog.wide { width: min(640px, calc(100vw - 2rem)); }
dialog::backdrop { background: rgb(15 10 30 / .45); backdrop-filter: blur(2px); }
.dlg header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.2rem .4rem; }
.dlg header h2 { margin: 0; }
.dlg-body { padding: .4rem 1.2rem; max-height: 65vh; overflow: auto; }
.dlg footer { display: flex; justify-content: flex-end; gap: .5rem; padding: .8rem 1.2rem 1.1rem; }

/* ---------- public shell ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem clamp(1rem, 4vw, 3rem); position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .55rem; color: var(--text); text-decoration: none !important; }
.brand img { border-radius: 50%; }
.brand span { display: flex; flex-direction: column; line-height: 1.15; }
.brand b { font-size: 1.1rem; letter-spacing: .04em; } .brand small { font-size: .72rem; color: var(--muted); }
.top-links { display: flex; align-items: center; gap: 1rem; }
.top-links > a:not(.btn) { color: var(--text); font-weight: 500; }
main.public { max-width: 1120px; margin: 0 auto; padding: 1.5rem clamp(1rem, 4vw, 2rem) 3rem; }
.site-foot { border-top: 1px solid var(--line); padding: 1.4rem 1rem; text-align: center; color: var(--muted); font-size: .86rem; }
.site-foot p { margin: .2rem 0; }

.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 2.5rem; align-items: center; padding: 2.5rem 0 2rem; }
.eyebrow { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 600; color: var(--green); background: var(--green-soft); padding: .25rem .7rem; border-radius: 999px; direction: ltr; }
.hero h1 { font-size: clamp(1.9rem, 4.4vw, 2.9rem); margin: .8rem 0; line-height: 1.25; }
.hero h1 em { font-style: normal; color: var(--brand); }
.lead { font-size: 1.08rem; color: var(--muted); max-width: 36em; margin-bottom: 1.4rem; }
.hero-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 1.2rem; box-shadow: var(--shadow); transform: rotate(-1.2deg); }
.mock-input { display: flex; gap: .5rem; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: .65rem .8rem; color: var(--muted); font-size: .92rem; }
.mock-chips { display: flex; gap: .35rem; margin: .8rem 0 1rem; }
.mock-chips span { background: var(--brand-soft); color: var(--brand-ink); border-radius: 999px; padding: .15rem .65rem; font-size: .82rem; font-weight: 600; }
.mock-res { padding: .65rem 0; border-top: 1px solid var(--line); }
.mock-res b { display: block; } .mock-res small { color: var(--muted); font-size: .8rem; }
.mock-res i { display: block; height: 7px; border-radius: 9px; background: linear-gradient(to left, var(--brand) var(--w), var(--surface-2) var(--w)); margin: .35rem 0; }
[dir="rtl"] .mock-res i { background: linear-gradient(to left, var(--brand) var(--w), var(--surface-2) var(--w)); }
.mock-res.dim { opacity: .55; }
.stats-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin: 1rem 0 3rem; }
.stats-strip div { background: var(--surface); padding: 1.1rem; text-align: center; }
.stats-strip b { display: block; font-size: 1.7rem; color: var(--brand); } .stats-strip span { color: var(--muted); font-size: .86rem; }
.features h2, .how h2 { font-size: 1.5rem; margin-bottom: 1.2rem; }
.features .grid3 { gap: 1rem; }
.features article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1.2rem; }
.features article > .i { width: 34px; height: 34px; padding: 7px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); margin-bottom: .6rem; }
.features article p { color: var(--muted); margin: 0; font-size: .93rem; }
.how { margin-top: 3rem; padding: 2rem; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; }
.steps { list-style: none; padding: 0; margin: 0 0 1.4rem; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; counter-reset: s; }
.steps li { counter-increment: s; }
.steps li::before { content: counter(s, arabic-indic); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-weight: 700; margin-bottom: .5rem; }
.steps b { display: block; } .steps span { color: var(--muted); font-size: .92rem; }

.auth { display: grid; place-items: center; padding: 1.5rem 0; }
.auth-card { width: min(460px, 100%); padding: 1.6rem; }
.demo { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px dashed var(--line); font-size: .88rem; color: var(--muted); }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 1rem; padding: 1rem .8rem; background: var(--surface); border-inline-end: 1px solid var(--line); }
.sidebar .brand { padding: .2rem .4rem .6rem; }
.sidebar nav { display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.sidebar nav a { display: flex; align-items: center; gap: .7rem; padding: .6rem .8rem; border-radius: var(--r-s); color: var(--text); font-weight: 500; text-decoration: none; }
.sidebar nav a:hover { background: var(--surface-2); }
.sidebar nav a.active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.count { margin-inline-start: auto; background: var(--brand); color: #fff; font-style: normal; font-size: .74rem; font-weight: 700; min-width: 20px; height: 20px; display: inline-grid; place-items: center; border-radius: 999px; padding: 0 .35rem; }
.me { display: flex; align-items: center; gap: .6rem; padding: .7rem .4rem 0; border-top: 1px solid var(--line); }
.me div { flex: 1; min-width: 0; line-height: 1.3; } .me b { display: block; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .me small { color: var(--muted); font-size: .78rem; }
.app-main { min-width: 0; }
.app-top { display: flex; align-items: center; gap: .3rem; padding: .6rem 1.5rem; }
.app-main main { padding: 0 1.5rem 2.5rem; max-width: 1150px; }
.mobile-brand, .mobile-only, .tabbar { display: none; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.kpi { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .7rem; align-items: center; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: .9rem 1rem; color: var(--text); text-decoration: none !important; box-shadow: var(--shadow); }
.kpi > .i { grid-row: span 2; width: 40px; height: 40px; padding: 9px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
.kpi b { font-size: 1.5rem; line-height: 1.1; } .kpi span { color: var(--muted); font-size: .85rem; }
a.kpi:hover { border-color: var(--brand); }

.appts, .list { list-style: none; margin: 0; padding: 0; }
.appt { display: flex; gap: .9rem; align-items: center; padding: .8rem 0; border-top: 1px solid var(--line); }
.appt:first-child { border-top: 0; }
.appt-date { width: 52px; flex: none; text-align: center; background: var(--surface-2); border-radius: 12px; padding: .35rem 0; line-height: 1.15; }
.appt-date b { display: block; font-size: 1.25rem; } .appt-date small { color: var(--muted); font-size: .75rem; }
.appt-body { flex: 1; min-width: 0; } .appt-body h4 { margin: 0; } .appt-body p { margin: 0; }
.appt-side { display: flex; flex-direction: column; align-items: flex-end; gap: .4rem; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .7rem 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; } .list li p { margin: 0; }
.people li { padding: 0; } .people a { display: flex; align-items: center; gap: .8rem; padding: .7rem .2rem; width: 100%; color: var(--text); text-decoration: none; }
.people a:hover { background: var(--surface-2); } .people a > div { flex: 1; } .people b { display: block; }
.rec-mini b { font-size: 1.05rem; } .rec-mini p { margin: .2rem 0 0; }
.profile-strip { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; } .profile-strip h1, .profile-strip h2 { margin: 0; } .profile-strip p { margin: 0; }
.records { display: grid; gap: .8rem; }
.record { background: var(--surface); border: 1px solid var(--line); border-inline-start: 4px solid var(--green); border-radius: var(--r); padding: 1rem 1.1rem; }
.record h3 { margin: 0; } .record header p { margin: 0; }
.vitals { display: flex; flex-wrap: wrap; gap: .5rem; margin: .7rem 0; }
.vitals span { background: var(--surface-2); border-radius: 8px; padding: .2rem .6rem; font-size: .85rem; color: var(--muted); } .vitals b { color: var(--text); }
.record dl { margin: .6rem 0 0; display: grid; grid-template-columns: auto 1fr; gap: .3rem 1rem; } .record dt { color: var(--muted); font-size: .88rem; } .record dd { margin: 0; }

.bars { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.bars li { display: grid; grid-template-columns: 8.5em 1fr 2.2em; align-items: center; gap: .6rem; font-size: .9rem; }
.bars i { height: 10px; border-radius: 9px; background: var(--surface-2); position: relative; overflow: hidden; }
.bars i::after { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: var(--w); background: var(--brand); border-radius: 9px; }
.bars b { text-align: end; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: start; padding: .7rem 1rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: .8rem; color: var(--muted); font-weight: 600; background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
.who { display: flex; align-items: center; gap: .6rem; } .who b { display: block; } .who small { color: var(--muted); font-size: .78rem; }
.actions { text-align: end; }
.kb { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .8rem; margin-top: 1rem; }
.kb article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem; }
.kb header { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; margin-bottom: .5rem; } .kb h3 { margin: 0; }

/* ---------- booking ---------- */
.book fieldset { border: 0; padding: 0; margin: 0 0 1.2rem; min-inline-size: 0; }
.book legend { font-weight: 700; margin-bottom: .5rem; padding: 0; }
.pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .5rem; }
.pick, .day, .slot { margin: 0; cursor: pointer; position: relative; }
.days { position: relative; }
.pick { display: flex; align-items: center; gap: .6rem; border: 1px solid var(--line); border-radius: var(--r-s); padding: .6rem .8rem; }
.pick span { display: flex; flex-direction: column; line-height: 1.3; } .pick small { color: var(--muted); }
.pick:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.days, .slots { display: flex; gap: .45rem; overflow-x: auto; padding-bottom: .3rem; }
.slots { flex-wrap: wrap; }
.day input, .slot input { position: absolute; opacity: 0; pointer-events: none; }
.day span { display: flex; flex-direction: column; align-items: center; width: 58px; padding: .45rem 0; border: 1px solid var(--line); border-radius: 12px; line-height: 1.2; }
.day small { color: var(--muted); font-size: .76rem; } .day b { font-size: 1.15rem; }
.slot span { display: block; padding: .4rem .9rem; border: 1px solid var(--line); border-radius: 999px; font-size: .9rem; }
.day input:checked + span, .slot input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.day input:checked + span small { color: inherit; }
.day input:focus-visible + span, .slot input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- symptom checker ---------- */
.checker { max-width: 1120px; }
.disclaimer { display: flex; gap: .7rem; align-items: flex-start; background: var(--info-soft); border-radius: var(--r-s); padding: .75rem 1rem; margin-bottom: 1rem; font-size: .92rem; }
.disclaimer > .i { color: var(--info); margin-top: .2rem; } .disclaimer p { margin: 0; }
.checker-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.combo { position: relative; display: flex; gap: .5rem; }
.combo .input-icon { flex: 1; }
.suggest { position: absolute; z-index: 5; top: calc(100% + 4px); inset-inline: 0; list-style: none; margin: 0; padding: .3rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-s); box-shadow: var(--shadow); max-height: 280px; overflow: auto; }
.suggest li { padding: .5rem .7rem; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: .5rem; }
.suggest li small { color: var(--muted); }
.suggest li:hover, .suggest li.active { background: var(--brand-soft); }
.hint { font-size: .88rem; margin: .5rem 0 0; color: var(--muted); }
.chosen { margin: 1rem 0; padding: .8rem; background: var(--surface-2); border-radius: var(--r-s); min-height: 3rem; }
.chosen .label { margin: 0; } .chosen .chips { margin-top: .5rem; } .chosen p { margin: 0; }
.quick summary { cursor: pointer; font-weight: 600; margin-bottom: .6rem; }
.quick-group { margin-bottom: .8rem; } .quick-group h4 { font-size: .82rem; color: var(--muted); font-weight: 600; margin-bottom: .35rem; }
.results { position: sticky; top: 1rem; }
.placeholder { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }
.placeholder > .i { width: 44px; height: 44px; color: var(--brand); opacity: .5; } .placeholder h3 { color: var(--text); }
.alarm { display: flex; gap: .8rem; background: var(--danger-soft); border: 1px solid var(--danger); color: var(--text); border-radius: var(--r); padding: 1rem; margin-bottom: 1rem; }
.alarm > .i { color: var(--danger); width: 28px; height: 28px; } .alarm h3 { color: var(--danger); margin-bottom: .3rem; } .alarm p { margin: 0 0 .2rem; font-size: .92rem; }
.dept { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-color: var(--brand); background: linear-gradient(135deg, var(--brand-soft), var(--surface) 70%); }
.dept h2 { margin: 0; font-size: 1.4rem; color: var(--brand-ink); } .dept p { margin: .2rem 0 0; }
.res-list { list-style: none; padding: 0; margin: 0 0 .8rem; display: grid; gap: .6rem; }
.res { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: .85rem 1rem; }
.res-head { display: flex; align-items: center; gap: .7rem; } .res-head > div { flex: 1; } .res-head h4 { margin: 0; } .res-head small { color: var(--muted); }
.rank { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); font-weight: 700; font-size: .85rem; }
.res.high .rank { background: var(--brand); color: #fff; }
.meter { height: 6px; background: var(--surface-2); border-radius: 9px; margin: .65rem 0 .4rem; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--brand); border-radius: 9px; transition: width .4s; }
.res.mid .meter i { background: color-mix(in srgb, var(--brand) 65%, var(--surface-2)); } .res.low .meter i { background: var(--muted); }
.res details summary { cursor: pointer; font-size: .86rem; color: var(--brand-ink); }
.res details p { font-size: .9rem; margin: .4rem 0; }

/* ---------- messages ---------- */
.chat { display: grid; grid-template-columns: 300px 1fr; gap: 1rem; align-items: stretch; }
.threads ul { list-style: none; margin: 0 -.5rem; padding: 0; }
.threads a { display: flex; align-items: center; gap: .6rem; padding: .6rem .5rem; border-radius: var(--r-s); color: var(--text); text-decoration: none; }
.threads a:hover { background: var(--surface-2); } .threads a.active { background: var(--brand-soft); }
.threads a div { flex: 1; min-width: 0; line-height: 1.35; } .threads a b { display: block; font-size: .92rem; }
.threads a div small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .82rem; }
.thread { display: flex; flex-direction: column; min-height: 60vh; padding: 0; }
.thread > header { display: flex; align-items: center; gap: .6rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); line-height: 1.3; }
.thread > header b { display: block; }
.bubbles { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .5rem; max-height: 60vh; }
.bubble { max-width: 78%; align-self: flex-start; background: var(--surface-2); border-radius: 16px; border-start-start-radius: 4px; padding: .5rem .85rem; }
.bubble.me { align-self: flex-end; background: var(--brand); color: #fff; border-radius: 16px; border-start-end-radius: 4px; }
.bubble p { margin: 0; white-space: pre-wrap; } .bubble small { font-size: .72rem; opacity: .7; }
.composer { display: flex; gap: .5rem; padding: .7rem; border-top: 1px solid var(--line); align-items: flex-end; }
.composer textarea { margin: 0; min-height: 42px; max-height: 140px; }
.composer .btn { width: 44px; height: 44px; padding: 0; flex: none; }
[dir="rtl"] .composer .i { transform: scaleX(-1); }
.thread > .empty { margin: auto; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .checker-grid { grid-template-columns: 1fr; } .results { position: static; }
  .hero { grid-template-columns: 1fr; } .hero-card { transform: none; }
  .steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-brand, .mobile-only { display: inline-flex; }
  .app-top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); padding: .5rem 1rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
  .app-main main { padding: 0 1rem calc(80px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; inset-inline: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .5rem 0 .45rem; color: var(--muted); font-size: .7rem; text-decoration: none; }
  .tabbar a.active { color: var(--brand); font-weight: 600; }
  .tabbar .i { width: 22px; height: 22px; }
  .tabbar .dot { position: absolute; top: 6px; inset-inline-start: 56%; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
  #toasts { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .grid2, .grid2.top { grid-template-columns: 1fr; }
  .chat { grid-template-columns: 1fr; }
  .chat.has-active .threads { display: none; }
  .chat:not(.has-active) .thread { display: none; }
  .features .grid3 { grid-template-columns: 1fr; }
  .stats-strip { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  h1 { font-size: 1.35rem; }
  .top-links { gap: .5rem; } .top-links > a:not(.btn):first-child { display: none; }
  .brand small { display: none; }
  .grid3 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .how { padding: 1.3rem; }
  .appt { flex-wrap: wrap; } .appt-side { flex-direction: row; width: 100%; justify-content: space-between; align-items: center; flex-wrap: wrap; }
  .combo { flex-direction: column; } .combo .btn { width: 100%; }
  .search { min-width: 0; width: 100%; }
  .page-head > .btn { width: 100%; }
  .bars li { grid-template-columns: 6.5em 1fr 2em; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
