/* AI Receptionist: client dashboard mockup styles. Tokens only (../tokens.css). Logical properties only. */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: var(--fs-16); line-height: var(--lh-body); color: var(--text-primary); background: #DCD8D0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand-700); }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand-700); outline-offset: 2px; }

/* ---------- review toolbar (outside the product) ---------- */
.tb { position: sticky; top: 0; z-index: 50; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 8px 16px; background: var(--text-primary); color: var(--surface); font-family: var(--font-latin); font-size: 14px; direction: ltr; }
.tb label { display: inline-flex; gap: 6px; align-items: center; }
.tb select { min-height: 36px; border-radius: 8px; border: 0; padding-inline: 8px; background: var(--surface); color: var(--text-primary); font-size: 14px; }
.tb .seg { display: inline-flex; border-radius: 8px; overflow: hidden; border: 1px solid var(--text-muted); }
.tb .seg button { min-height: 36px; padding-inline: 14px; border: 0; background: transparent; color: var(--surface); font-size: 14px; }
.tb .seg button[aria-pressed="true"] { background: var(--surface); color: var(--text-primary); font-weight: 600; }
.tb b { font-weight: 600; margin-inline-end: 4px; }
body.notb .tb { display: none; }

/* ---------- stage + device ---------- */
.stage { display: flex; justify-content: center; padding: 24px 16px 40px; }
body.notb .stage { padding: 0; }
.device { position: relative; width: 390px; height: 844px; max-width: 100%; background: var(--canvas); border-radius: 36px; overflow: hidden; box-shadow: 0 0 0 10px var(--text-primary), 0 20px 50px rgba(14,42,43,.35); flex: none; }
.device.desktop { width: 1280px; height: 800px; border-radius: 12px; box-shadow: 0 0 0 1px var(--line), 0 20px 50px rgba(14,42,43,.25); }
body.notb .device, body.notb .device.desktop { height: 100vh; max-width: none; border-radius: 0; box-shadow: none; }
body.notb .device.desktop { width: 100vw; }
body.notb .device { position: fixed; left: 0; top: 0; }
body.notb .device.mobile { width: 390px; }

/* ---------- app shell ---------- */
.app { position: relative; display: flex; flex-direction: column; height: 100%; background: var(--canvas); }
.app.desktop { flex-direction: row; }
.col { flex: 1; min-inline-size: 0; display: flex; flex-direction: column; min-block-size: 0; }
.main { flex: 1; overflow-y: auto; min-block-size: 0; }
.page { padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-5); }
.desktop .page { padding: var(--s-6) var(--s-8); max-inline-size: var(--content-max); }
.title { font-size: var(--fs-22); font-weight: 600; line-height: 1.25; }
.sub { font-size: var(--fs-14); color: var(--text-secondary); }
.muted { color: var(--text-muted); }
.sec-h { font-size: var(--fs-18); font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.sec-h a, .link { font-size: var(--fs-14); font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; min-block-size: var(--tap); }

.ic { inline-size: 20px; block-size: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.sm { inline-size: 16px; block-size: 16px; }
.ic.lg { inline-size: 24px; block-size: 24px; }
.ic.fill { fill: currentColor; stroke: none; }

/* top bar */
.topbar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-2) var(--s-4); min-block-size: 56px; background: var(--surface); border-block-end: 1px solid var(--line); }
.clinic { font-weight: 600; font-size: var(--fs-16); line-height: 1.25; min-inline-size: 0; }
.clinic small { display: block; font-weight: 400; font-size: var(--fs-12); color: var(--text-muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; min-block-size: 36px; padding-inline: 12px; border-radius: var(--r-pill); border: 0; font-size: var(--fs-14); font-weight: 600; white-space: nowrap; }
.pill.active { background: var(--brand-100); color: var(--brand-700); }
.pill.paused { background: var(--handover-100); color: var(--handover-700); }
.pill.warn { background: var(--danger-100); color: var(--danger-700); }
.dot { inline-size: 8px; block-size: 8px; border-radius: 50%; background: currentColor; flex: none; }

/* tab bar + side nav */
.tabbar { flex: none; block-size: var(--tabbar-h); display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border-block-start: 1px solid var(--line); }
.tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: none; color: var(--text-secondary); font-size: var(--fs-12); font-weight: 600; min-block-size: var(--tap); }
.tab[aria-current="page"] { color: var(--brand-700); }
.tab[aria-current="page"]::before { content: ""; position: absolute; inset-block-start: 0; inline-size: 32px; block-size: 3px; border-radius: 0 0 3px 3px; background: var(--brand-700); }
.badge { position: absolute; inset-block-start: 6px; inset-inline-start: calc(50% + 6px); min-inline-size: 18px; block-size: 18px; padding-inline: 5px; border-radius: 9px; font-size: var(--fs-12); line-height: 18px; font-weight: 600; text-align: center; background: var(--handover-500); color: var(--text-primary); }
.badge.red { inset-inline-start: calc(50% + 8px); inset-block-start: 8px; min-inline-size: 10px; block-size: 10px; padding: 0; border-radius: 50%; background: var(--danger-700); }
.side .badge { position: static; margin-inline-start: auto; }
.side .badge.red { min-inline-size: 10px; }
.side { flex: none; inline-size: 248px; background: var(--surface); border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; padding: var(--s-4) var(--s-3); gap: var(--s-1); overflow-y: auto; }
.side .brand { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2) var(--s-3) var(--s-4); font-weight: 600; }
.side .nav { display: flex; align-items: center; gap: var(--s-3); min-block-size: var(--tap); padding-inline: var(--s-3); border: 0; border-radius: var(--r-md); background: none; color: var(--text-secondary); font-weight: 600; font-size: var(--fs-16); text-align: start; inline-size: 100%; }
.side .nav[aria-current="page"] { background: var(--brand-100); color: var(--brand-700); }
.side .nav:hover { background: var(--brand-050); }
.side .grp { margin: var(--s-4) var(--s-3) var(--s-1); font-size: var(--fs-12); color: var(--text-muted); font-weight: 600; }
.logo { inline-size: 36px; block-size: 36px; border-radius: 10px; background: var(--brand-700); color: var(--surface); display: grid; place-items: center; flex: none; }

/* ---------- buttons, chips, cards ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); min-block-size: 48px; padding-inline: var(--s-5); border-radius: var(--r-md); border: 1.5px solid transparent; font-weight: 600; font-size: var(--fs-16); line-height: 1.2; text-decoration: none; text-align: center; }
.desktop .btn { min-block-size: 40px; }
.btn.primary { background: var(--brand-700); color: var(--surface); }
.btn.primary:hover { background: var(--brand-800); }
.btn.outline { background: var(--surface); border-color: var(--brand-700); color: var(--brand-700); }
.btn.danger { background: var(--danger-700); color: var(--surface); }
.btn.danger-o { background: var(--surface); border-color: var(--danger-700); color: var(--danger-700); }
.btn.ghost { background: none; color: var(--brand-700); }
.btn.block { inline-size: 100%; }
.btn.sm { min-block-size: var(--tap); padding-inline: var(--s-4); font-size: var(--fs-14); }
.btn[disabled], .btn[aria-disabled="true"] { background: var(--line); border-color: transparent; color: var(--text-muted); cursor: not-allowed; }
.iconbtn { display: inline-grid; place-items: center; inline-size: var(--tap); block-size: var(--tap); border: 0; border-radius: var(--r-md); background: none; color: var(--text-primary); }
.iconbtn:hover { background: var(--brand-050); }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px 3px 8px; padding-inline: 8px 10px; border-radius: var(--r-pill); font-size: var(--fs-12); font-weight: 600; white-space: nowrap; line-height: 1.4; }
.chip.bot { background: var(--brand-100); color: var(--brand-700); }
.chip.handover { background: var(--handover-100); color: var(--handover-700); }
.chip.emergency { background: var(--danger-100); color: var(--danger-700); }
.chip.booked { background: var(--booked-100); color: var(--booked-700); }
.chip.success { background: var(--success-100); color: var(--success-700); }
.chip.reason { background: var(--surface); border: 1px solid var(--line); color: var(--text-secondary); font-weight: 400; }
.chip.new { background: var(--brand-050); color: var(--brand-700); border: 1px solid var(--brand-100); }
.closedtxt { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-12); color: var(--text-muted); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-4); box-shadow: var(--shadow-1); }
.stack { display: flex; flex-direction: column; gap: var(--s-3); }
.row { display: flex; align-items: center; gap: var(--s-3); }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-inline-size: 0; }

/* handover cards */
.hcard { position: relative; display: flex; flex-direction: column; gap: var(--s-3); background: var(--surface); border: 1px solid var(--line); border-inline-start: 4px solid var(--handover-500); border-radius: var(--r-lg); padding: var(--s-4); box-shadow: var(--shadow-1); }
.hcard.emergency { background: var(--danger-100); border-color: var(--danger-700); border-inline-start-width: 4px; }
.hcard .who { font-weight: 600; font-size: var(--fs-16); }
.hcard .why { display: flex; align-items: center; gap: 6px; font-size: var(--fs-14); font-weight: 600; color: var(--handover-700); }
.hcard.emergency .why { color: var(--danger-700); }
.hcard .wait { font-size: var(--fs-14); color: var(--text-secondary); }
.hcard .acts { display: flex; gap: var(--s-3); }
.hcard .acts .btn { flex: 1; }
.hcard .resolve { align-self: flex-start; }
.okline { display: flex; align-items: center; gap: var(--s-2); color: var(--success-700); font-weight: 600; font-size: var(--fs-14); padding: var(--s-3) var(--s-4); background: var(--success-100); border-radius: var(--r-md); }
.two { display: grid; gap: var(--s-5); }
.desktop .two { grid-template-columns: 1.15fr 1fr; align-items: start; }

/* timeline */
.tl { display: flex; flex-direction: column; }
.tli { display: grid; grid-template-columns: 52px 16px 1fr; column-gap: var(--s-2); align-items: stretch; min-block-size: 64px; }
.tli .tm { padding-block-start: 10px; font-size: var(--fs-14); font-weight: 600; color: var(--text-secondary); text-align: end; }
.tli .rail { position: relative; }
.tli .rail::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 50%; inline-size: 2px; margin-inline-start: -1px; background: var(--line); }
.tli:first-child .rail::before { inset-block-start: 18px; }
.tli:last-child .rail::before { inset-block-end: calc(100% - 18px); }
.tli .rail i { position: absolute; inset-block-start: 13px; inset-inline-start: 50%; margin-inline-start: -6px; inline-size: 12px; block-size: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--text-muted); }
.tli.next .rail i { background: var(--brand-700); border-color: var(--brand-700); }
.tli .body { margin-block: 4px; padding: 8px 12px; border-radius: var(--r-md); display: flex; flex-direction: column; gap: 4px; min-inline-size: 0; }
.tli.past { color: var(--text-muted); }
.tli.past .nm { color: var(--text-muted); font-weight: 400; }
.tli.next .body { background: var(--booked-100); border: 1px solid var(--booked-700); }
.tli .nm { font-weight: 600; }
.tli .tags { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }

/* tiles + meter */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-3); }
.tile { display: flex; flex-direction: column; gap: 2px; text-align: start; padding: var(--s-3); min-block-size: 96px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.tile b { font-size: var(--fs-28); line-height: 1.15; font-weight: 600; }
.tile span { font-size: var(--fs-12); color: var(--text-secondary); line-height: 1.35; }
.meter { display: flex; flex-direction: column; gap: var(--s-2); }
.meter .bar { block-size: 10px; border-radius: 5px; background: var(--line); overflow: hidden; }
.meter .bar i { display: block; block-size: 100%; border-radius: 5px; background: var(--brand-700); }
.meter.amber .bar i { background: var(--handover-500); }
.meter.red .bar i { background: var(--danger-700); }
.meter .big { display: flex; align-items: baseline; gap: 6px; justify-content: flex-start; font-size: var(--fs-28); font-weight: 600; line-height: 1.15; }
.meter .big small { font-size: var(--fs-16); font-weight: 400; color: var(--text-secondary); }

/* ---------- conversations list ---------- */
.search { position: relative; }
.search .ic { position: absolute; inset-inline-start: 14px; inset-block-start: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.input { inline-size: 100%; min-block-size: 48px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--surface); font-size: var(--fs-16); }
.input:focus-visible { outline-offset: 0; border-color: var(--brand-700); }
.search .input { padding-inline-start: 44px; }
.input.err { border-color: var(--danger-700); }
.chips { display: flex; gap: var(--s-2); overflow-x: auto; padding-block: 2px; scrollbar-width: none; }
.fchip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-block-size: var(--tap); padding-inline: var(--s-4); border-radius: var(--r-pill); border: 1.5px solid var(--line); background: var(--surface); font-size: var(--fs-14); font-weight: 600; color: var(--text-secondary); }
.fchip[aria-pressed="true"] { background: var(--brand-700); border-color: var(--brand-700); color: var(--surface); }
.fchip .n { background: var(--handover-500); color: var(--text-primary); border-radius: 10px; padding-inline: 6px; font-size: var(--fs-12); }
.list { display: flex; flex-direction: column; background: var(--surface); border-block: 1px solid var(--line); }
.page > .list { margin-inline: calc(-1 * var(--s-4)); }
.crow { position: relative; display: grid; grid-template-columns: 44px 1fr auto; column-gap: var(--s-3); align-items: center; min-block-size: 72px; padding: var(--s-3) var(--s-4); border: 0; border-block-end: 1px solid var(--line); background: var(--surface); text-align: start; inline-size: 100%; }
.crow:last-child { border-block-end: 0; }
.crow[aria-current="true"] { background: var(--brand-050); }
.crow.pin::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; inline-size: 4px; background: var(--handover-500); }
.crow.pin.emergency::before { background: var(--danger-700); }
.av { inline-size: 44px; block-size: 44px; border-radius: 50%; background: var(--brand-100); color: var(--brand-700); display: grid; place-items: center; font-weight: 600; font-size: var(--fs-16); }
.av.sm { inline-size: 36px; block-size: 36px; font-size: var(--fs-14); }
.crow .t1 { display: flex; justify-content: space-between; gap: var(--s-2); align-items: baseline; }
.crow .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crow .pre { display: flex; align-items: center; gap: 4px; font-size: var(--fs-14); color: var(--text-secondary); min-inline-size: 0; }
.crow .pre span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-inline-size: 0; }
.crow .mid { min-inline-size: 0; display: flex; flex-direction: column; gap: 2px; }
.crow .end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.crow .tm { font-size: var(--fs-12); color: var(--text-muted); }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s-3); padding: var(--s-10) var(--s-6); color: var(--text-secondary); }
.empty .ill { inline-size: 72px; block-size: 72px; border-radius: 50%; background: var(--brand-100); color: var(--brand-700); display: grid; place-items: center; }
.empty h3 { font-size: var(--fs-18); color: var(--text-primary); }
@keyframes shim { 0% { opacity: 1; } 50% { opacity: .45; } 100% { opacity: 1; } }
.skel { background: var(--line); border-radius: 6px; animation: shim 1.4s ease-in-out infinite; }
.srow { display: grid; grid-template-columns: 44px 1fr 40px; gap: var(--s-3); align-items: center; padding: var(--s-3) var(--s-4); min-block-size: 72px; border-block-end: 1px solid var(--line); }
.srow .skel.c { inline-size: 44px; block-size: 44px; border-radius: 50%; }

/* split (desktop) */
.split { display: grid; grid-template-columns: 360px 1fr; block-size: 100%; min-block-size: 0; }
.split.facts3 { grid-template-columns: 340px 1fr 260px; }
.split > .lst { overflow-y: auto; border-inline-end: 1px solid var(--line); background: var(--canvas); }
.split > .lst .page { padding: var(--s-4); gap: var(--s-3); }
.split > .lst .page > .list { margin-inline: calc(-1 * var(--s-4)); }
.split > .det { display: flex; flex-direction: column; min-inline-size: 0; min-block-size: 0; }
.split > .fp { border-inline-start: 1px solid var(--line); background: var(--surface); padding: var(--s-5); overflow-y: auto; }
.noconv { display: grid; place-items: center; block-size: 100%; color: var(--text-muted); text-align: center; padding: var(--s-8); }

/* ---------- thread ---------- */
.thead { flex: none; display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-3); min-block-size: 64px; background: var(--surface); border-block-end: 1px solid var(--line); }
.thead .who { flex: 1; min-inline-size: 0; line-height: 1.3; }
.thead .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thead .who small { font-size: var(--fs-14); color: var(--text-secondary); }
.callbtn { color: var(--surface); background: var(--brand-700); border-radius: 50%; }
.callbtn:hover { background: var(--brand-800); }
.menu { position: absolute; z-index: 20; inset-block-start: 60px; inset-inline-end: var(--s-3); min-inline-size: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sheet); padding: var(--s-1); }
.menu button { display: flex; align-items: center; gap: var(--s-3); inline-size: 100%; min-block-size: var(--tap); padding-inline: var(--s-3); border: 0; background: none; border-radius: var(--r-sm); text-align: start; font-size: var(--fs-14); font-weight: 600; }
.menu button:hover { background: var(--brand-050); }
.menu button.dg { color: var(--danger-700); }
.facts { flex: none; background: var(--surface); border-block-end: 1px solid var(--line); }
.facts summary { list-style: none; display: flex; align-items: center; gap: var(--s-2); min-block-size: 40px; padding-inline: var(--s-4); font-size: var(--fs-14); font-weight: 600; color: var(--text-secondary); cursor: pointer; }
.facts summary::-webkit-details-marker { display: none; }
.facts summary .ic.chev { margin-inline-start: auto; transition: transform .15s; }
.facts[open] summary .ic.chev { transform: rotate(180deg); }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3) var(--s-4); padding: 0 var(--s-4) var(--s-4); }
.fp .fgrid { grid-template-columns: 1fr; padding: 0; gap: var(--s-4); }
.fact small { display: block; font-size: var(--fs-12); color: var(--text-muted); }
.fact b { font-weight: 600; font-size: var(--fs-14); }
.fact b.red { color: var(--danger-700); }
.fact a { font-weight: 600; font-size: var(--fs-14); }
.msgs { flex: 1; overflow-y: auto; min-block-size: 0; display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-4); background: var(--canvas); }
.day { align-self: center; margin-block: var(--s-2); padding: 2px 12px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); font-size: var(--fs-12); color: var(--text-muted); }
.msg { max-inline-size: 84%; padding: 8px 12px 6px; border-radius: var(--r-lg); display: flex; flex-direction: column; gap: 2px; }
.desktop .msg { max-inline-size: 62%; }
.msg p { font-size: var(--fs-16); overflow-wrap: anywhere; unicode-bidi: plaintext; }
.msg .tm { align-self: flex-end; font-size: var(--fs-12); color: var(--text-muted); }
.msg .lbl { font-size: var(--fs-12); font-weight: 600; color: var(--brand-700); }
.msg.patient { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-end-start-radius: 4px; }
.msg.assistant { align-self: flex-end; background: var(--brand-100); border-end-end-radius: 4px; }
.msg.staff { align-self: flex-end; background: var(--surface); border: 1.5px solid var(--brand-700); border-end-end-radius: 4px; }
.vn { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-14); font-weight: 600; color: var(--text-secondary); }
.vn .ic { color: var(--brand-700); }
.tr { padding-inline-start: var(--s-3); border-inline-start: 3px solid var(--line); }
.unsure { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: var(--r-sm); background: var(--handover-100); color: var(--handover-700); font-size: var(--fs-12); font-weight: 600; }
.sysev { align-self: center; max-inline-size: 92%; display: flex; align-items: center; gap: 6px; text-align: center; font-size: var(--fs-12); color: var(--text-muted); padding: 2px 8px; }
.sysev.booked { color: var(--booked-700); }
.sysev.handover { color: var(--handover-700); }
.sysev.emergency { color: var(--danger-700); }
.bottom { flex: none; background: var(--surface); border-block-start: 1px solid var(--line); padding: var(--s-3) var(--s-4); display: flex; flex-direction: column; gap: var(--s-3); }
.botbar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.botbar span { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-14); color: var(--text-secondary); }
.notice { display: flex; gap: var(--s-2); align-items: flex-start; padding: var(--s-3); border-radius: var(--r-md); background: var(--handover-100); color: var(--handover-700); font-size: var(--fs-14); font-weight: 600; }
.notice .ic { margin-block-start: 2px; }
.notice.dis { background: var(--canvas); color: var(--text-secondary); border: 1px solid var(--line); font-weight: 400; }
.composer { display: flex; gap: var(--s-2); align-items: center; }
.composer .input { border-radius: var(--r-pill); }
.composer .send { flex: none; inline-size: 48px; block-size: 48px; border-radius: 50%; border: 0; background: var(--brand-700); color: var(--surface); display: grid; place-items: center; }
.composer.off .input { background: var(--canvas); color: var(--text-muted); }
.composer.off .send { background: var(--line); color: var(--text-muted); cursor: not-allowed; }

/* ---------- bookings ---------- */
.strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--s-1); }
.dbtn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-block-size: 64px; border: 1.5px solid transparent; border-radius: var(--r-md); background: var(--surface); font-size: var(--fs-12); color: var(--text-secondary); position: relative; padding: 4px 0; }
.dbtn b { font-size: var(--fs-18); color: var(--text-primary); line-height: 1.2; }
.dbtn[aria-pressed="true"] { background: var(--brand-700); color: var(--surface); }
.dbtn[aria-pressed="true"] b { color: var(--surface); }
.dbtn i { inline-size: 6px; block-size: 6px; border-radius: 50%; background: var(--booked-700); }
.dbtn[aria-pressed="true"] i { background: var(--surface); }
.dbtn i.no { visibility: hidden; }
.dbtn.closed { opacity: .65; }
.brow { display: grid; grid-template-columns: 56px 1fr auto; gap: var(--s-3); align-items: center; min-block-size: 72px; padding: var(--s-3) var(--s-4); border: 0; border-block-end: 1px solid var(--line); background: var(--surface); text-align: start; inline-size: 100%; }
.brow:last-child { border-block-end: 0; }
.brow .tm { font-weight: 600; font-size: var(--fs-16); }
.brow .tm small { display: block; font-size: var(--fs-12); font-weight: 400; color: var(--text-muted); }
.brow .nm { font-weight: 600; }
.brow.past .nm, .brow.past .tm { color: var(--text-muted); }
.brow.next { background: var(--booked-100); box-shadow: inset 4px 0 0 var(--booked-700); }
[dir="rtl"] .brow.next { box-shadow: inset -4px 0 0 var(--booked-700); }
.rem { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-12); color: var(--text-secondary); }
.rem.sent { color: var(--success-700); }
.rem.failed { color: var(--danger-700); font-weight: 600; }
.hint { display: flex; gap: var(--s-2); align-items: flex-start; font-size: var(--fs-14); color: var(--text-secondary); padding: var(--s-3); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r-md); }
.hint .ic { color: var(--brand-700); margin-block-start: 2px; }

/* week grid (desktop) */
.wk { display: grid; grid-template-columns: 56px repeat(6, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.wk .hd { padding: var(--s-2); text-align: center; font-size: var(--fs-14); font-weight: 600; border-block-end: 1px solid var(--line); border-inline-start: 1px solid var(--line); }
.wk .hd small { display: block; font-weight: 400; color: var(--text-muted); font-size: var(--fs-12); }
.wk .hd.today { background: var(--brand-100); color: var(--brand-700); }
.wk .hrs { position: relative; }
.wk .hrs span { position: absolute; inset-inline-end: 8px; font-size: var(--fs-12); color: var(--text-muted); transform: translateY(-50%); }
.wk .dc { position: relative; border-inline-start: 1px solid var(--line); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 55px, var(--line) 55px, var(--line) 56px); }
.wk .blk { position: absolute; inset-inline: 3px; border-radius: 6px; background: var(--booked-100); border: 0; border-inline-start: 3px solid var(--booked-700); padding: 2px 6px; font-size: var(--fs-12); line-height: 1.3; color: var(--booked-700); text-align: start; overflow: hidden; }
.wk .blk { white-space: nowrap; text-overflow: ellipsis; }
.wk .blk b { color: var(--text-primary); display: inline; font-weight: 600; margin-inline-end: 6px; }
.wk .blk.busy { background: var(--line); border-inline-start-color: var(--text-muted); color: var(--text-secondary); }
.wk .blk.lunch { inset-inline: 0; border-radius: 0; background: var(--canvas); border: 0; color: var(--text-muted); }

/* sheets */
.scrim { position: absolute; inset: 0; z-index: 30; background: rgba(14, 42, 43, .45); }
.sheet { position: absolute; z-index: 31; inset-inline: 0; inset-block-end: 0; max-block-size: 90%; overflow-y: auto; background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: var(--shadow-sheet); padding: var(--s-6) var(--s-4) var(--s-4); display: flex; flex-direction: column; gap: var(--s-4); }
.sheet::before { content: ""; position: absolute; inset-block-start: 8px; inset-inline-start: 50%; margin-inline-start: -20px; inline-size: 40px; block-size: 4px; border-radius: 2px; background: var(--line); }
.desktop .sheet { inset-inline: auto 0; inset-block: 0; inline-size: 420px; max-block-size: none; border-radius: 0; padding-block-start: var(--s-6); }
.desktop .sheet::before { display: none; }
.sheet h2 { font-size: var(--fs-18); }
.sheet .kv { display: grid; grid-template-columns: 110px 1fr; gap: var(--s-2) var(--s-3); font-size: var(--fs-14); }
.sheet .kv dt { color: var(--text-muted); }
.sheet .kv dd { margin: 0; font-weight: 600; }
.sheet .acts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.sheet .acts .full { grid-column: 1 / -1; }
.sheet .acts .btn[disabled] { opacity: 1; }
.gok { display: flex; align-items: center; gap: 6px; color: var(--success-700); font-size: var(--fs-14); font-weight: 600; }
.preview { padding: var(--s-3); border-radius: var(--r-md); background: var(--brand-100); font-size: var(--fs-14); }
.chk { display: flex; align-items: flex-start; gap: var(--s-3); min-block-size: var(--tap); font-size: var(--fs-16); }
.chk input { inline-size: 24px; block-size: 24px; accent-color: var(--brand-700); margin: 0; flex: none; margin-block-start: 0; }

/* toast */
.toast { position: absolute; z-index: 40; inset-inline: var(--s-4); inset-block-end: calc(var(--tabbar-h) + var(--s-4)); display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--text-primary); color: var(--surface); font-size: var(--fs-14); }
.desktop .toast { inset-inline: auto; inset-inline-start: 50%; inset-block-end: var(--s-6); max-inline-size: 420px; transform: translateX(-50%); }
[dir="rtl"] .desktop .toast { transform: translateX(50%); }
.toast button { margin-inline-start: auto; border: 0; background: none; color: var(--surface); font-weight: 600; text-decoration: underline; min-block-size: var(--tap); padding-inline: var(--s-2); }

/* ---------- login ---------- */
.login { display: flex; flex-direction: column; gap: var(--s-6); padding: var(--s-4) var(--s-6) var(--s-8); min-block-size: 100%; }
.desktop .login { max-inline-size: 440px; margin-inline: auto; justify-content: center; }
.lang2 { align-self: flex-end; display: inline-flex; border: 1.5px solid var(--line); border-radius: var(--r-pill); background: var(--surface); overflow: hidden; }
.lang2 button { min-block-size: var(--tap); min-inline-size: 56px; padding-inline: var(--s-3); border: 0; background: none; font-weight: 600; color: var(--text-secondary); }
.lang2 button[aria-pressed="true"] { background: var(--brand-700); color: var(--surface); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: var(--fs-14); }
.field .pw { position: relative; }
.field .pw .iconbtn { position: absolute; inset-inline-end: 2px; inset-block-start: 2px; }
.field .pw .input { padding-inline-end: 52px; }
.errline { display: flex; gap: 6px; align-items: center; color: var(--danger-700); font-size: var(--fs-14); font-weight: 600; padding: var(--s-3); background: var(--danger-100); border-radius: var(--r-md); }

/* ---------- usage ---------- */
.chart { direction: ltr; }
.chart svg { display: block; inline-size: 100%; block-size: auto; }
.chart text { font-family: var(--font-latin); font-size: 12px; fill: var(--text-muted); }
.chart .bar { fill: var(--brand-700); opacity: .55; cursor: pointer; }
.chart .bar.today { opacity: 1; }
.chart .bar.sel { opacity: 1; stroke: var(--text-primary); stroke-width: 1.5; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.readout { font-size: var(--fs-14); color: var(--text-secondary); min-block-size: 22px; }
.readout b { color: var(--text-primary); }
.res { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.res > div { padding: var(--s-3); background: var(--canvas); border-radius: var(--r-md); }
.res b { display: block; font-size: var(--fs-22); line-height: 1.2; }
.res span { font-size: var(--fs-12); color: var(--text-secondary); }
.tip { position: relative; }
.tipbtn { inline-size: 28px; block-size: 28px; border-radius: 50%; border: 1.5px solid var(--text-muted); background: none; color: var(--text-secondary); font-weight: 600; font-size: var(--fs-14); display: inline-grid; place-items: center; }
.tipbody { margin-block-start: var(--s-2); padding: var(--s-3); border-radius: var(--r-md); background: var(--text-primary); color: var(--surface); font-size: var(--fs-14); }
.warnbox { display: flex; gap: var(--s-2); align-items: flex-start; font-size: var(--fs-14); color: var(--text-secondary); }

/* ---------- more menu + D9 ---------- */
.mlist { display: flex; flex-direction: column; background: var(--surface); border-block: 1px solid var(--line); }
.page > .mlist { margin-inline: calc(-1 * var(--s-4)); }
.mrow { display: flex; align-items: center; gap: var(--s-3); min-block-size: 56px; padding-inline: var(--s-4); border: 0; border-block-end: 1px solid var(--line); background: var(--surface); font-size: var(--fs-16); text-align: start; inline-size: 100%; }
.mrow:last-child { border-block-end: 0; }
.mrow .ic:first-child { color: var(--brand-700); }
.mrow .lang2 { margin-inline-start: auto; align-self: auto; }
.mrow.dg { color: var(--danger-700); }
.mrow.dg .ic:first-child { color: var(--danger-700); }
.dsum { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-4); border-radius: var(--r-md); background: var(--danger-100); }
.dsum li { margin-inline-start: var(--s-5); }
.dsum ul { margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.receipt { display: flex; flex-direction: column; gap: var(--s-3); }
.steps { display: flex; gap: var(--s-2); }
.steps i { flex: 1; block-size: 4px; border-radius: 2px; background: var(--line); }
.steps i.on { background: var(--brand-700); }

.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.facts summary .grow { font-weight: 600; color: var(--text-primary); }
.wk .hrs span:first-child { transform: none; }
.wk .hrs span:last-child { transform: translateY(-100%); }
[dir="rtl"] .meter .big { justify-content: flex-end; }
