/* Page shell, the phone, the patient's personal area and the clinic's patient file.
   Loaded after app.css, which holds the tokens, shared controls and the clinic screens. */

/* ---------- top bar views ---------- */
.views { display: flex; gap: 4px; align-self: stretch; }
.views button { display: inline-flex; align-items: center; gap: 7px; padding-inline: 14px; font-weight: 500; font-size: 14px; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s; white-space: nowrap; }
.views button:hover { color: var(--ink); }
.views button[aria-selected="true"] { color: var(--pine-2); border-color: var(--pine); font-weight: 600; }

/* ---------- stage: three clear layouts ---------- */
.stage { display: grid; gap: 40px; padding: 24px 28px; min-height: 0; justify-content: center; }
.stage > * { min-height: 0; min-width: 0; }
.stage[data-view="patient"] { grid-template-columns: minmax(250px, 320px) auto minmax(250px, 340px); }
.stage[data-view="patient"] .clinic-col { display: none; }
.stage[data-view="clinic"] { grid-template-columns: minmax(0, 1fr); padding: 0; }
.stage[data-view="clinic"] > :not(.clinic-col) { display: none; }
.stage[data-view="clinic"] .win { border-radius: 0; border: 0; box-shadow: none; }
.stage[data-view="split"] { grid-template-columns: auto minmax(0, 1fr); gap: 28px; justify-content: stretch; }
.stage[data-view="split"] .guide, .stage[data-view="split"] .live { display: none; }
.clinic-col { display: flex; }

/* guide and live panels share one quiet card style */
.guide, .live { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 16px; overflow-y: auto; scrollbar-width: thin; display: flex; flex-direction: column; gap: 4px; align-self: center; max-height: 100%; }
.g-head { padding-inline: 6px; margin-bottom: 4px; }
.g-head h2 { font-size: 17px; display: flex; align-items: center; gap: 8px; }
.g-head p { color: var(--ink-2); font-size: 13px; margin-top: 3px; line-height: 1.45; }
.guide h3, .live h3, .tour h3 { font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 12px 6px 4px; letter-spacing: .01em; }
.g-list { display: flex; flex-direction: column; }
.g-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; text-align: start; font-size: 14px; font-weight: 500; color: var(--ink); transition: background .14s, color .14s; }
.g-row .ic { color: var(--ink-3); transition: color .14s; }
.g-row:hover { background: var(--surface-2); }
.g-row:hover .ic, .g-row.on .ic { color: var(--pine); }
.g-row.on { background: var(--mint); color: var(--pine-2); font-weight: 600; }
.g-reset { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin: 12px 6px 0; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.g-reset:hover { color: var(--pine); }
.l-ap { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; margin-inline: 6px; flex-wrap: wrap; }
.l-ap strong { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.l-ap div { display: flex; flex-direction: column; line-height: 1.35; flex: 1; min-width: 120px; }
.l-ap b { font-weight: 600; }
.l-ap span { font-size: 12.5px; color: var(--ink-2); }
.l-empty { margin-inline: 6px; padding: 12px; border: 1px dashed var(--line-2); border-radius: var(--r); color: var(--ink-2); font-size: 13px; }
.live .feed { padding-inline: 6px; }
.live .muted { padding-inline: 6px; }
.l-acts { display: flex; gap: 8px; padding: 12px 6px 0; flex-wrap: wrap; }
.l-acts .btn { flex: 1; }

/* ---------- the phone ---------- */
.device-col { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.phone { flex: 1; min-height: 0; max-height: 790px; aspect-ratio: 390 / 800; position: relative; padding: 10px; border-radius: 56px;
  background: linear-gradient(150deg, #4B524E 0%, #1B201E 22%, #0C0F0E 60%, #2A302D 100%);
  box-shadow: inset 0 0 0 1.5px #5B635F, inset 0 0 0 4px #0A0D0C, 0 30px 60px -18px rgba(22, 33, 30, .45), 0 10px 24px -8px rgba(22, 33, 30, .25); }
.phone::before, .phone::after { content: ""; position: absolute; width: 3px; background: #2B312E; border-radius: 2px; }
.phone::before { inset-inline-end: -3px; top: 150px; height: 74px; }
.phone::after { inset-inline-start: -3px; top: 120px; height: 34px; box-shadow: 0 54px 0 #2B312E, 0 104px 0 #2B312E; }
.phone-notch { position: absolute; top: 21px; left: 50%; transform: translateX(-50%); width: 96px; height: 27px; background: #050706; border-radius: 20px; z-index: 6; }
.phone-screen { height: 100%; border-radius: 46px; overflow: hidden; background: var(--surface); position: relative; isolation: isolate; }
.statusbar { position: absolute; inset: 0 0 auto; height: 48px; padding: 5px 30px 0; display: flex; align-items: center; justify-content: space-between; z-index: 5; color: #fff; pointer-events: none; direction: ltr; }
.statusbar b { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.statusbar span { display: flex; align-items: center; gap: 5px; }
.phone-screen[data-mode="app"] .statusbar { color: var(--ink); }
.homebar { position: absolute; bottom: 7px; left: 50%; transform: translateX(-50%); width: 128px; height: 5px; border-radius: 5px; background: rgba(10, 14, 12, .82); z-index: 9; pointer-events: none; }

/* chat */
.chat { display: flex; flex-direction: column; height: 100%; background-color: #EDE7DD; background-image: radial-gradient(rgba(60, 50, 30, .055) 1px, transparent 1.3px), radial-gradient(rgba(60, 50, 30, .04) 1px, transparent 1.3px); background-size: 22px 22px, 22px 22px; background-position: 0 0, 11px 11px; }
.chat-head { display: flex; align-items: center; gap: 9px; padding: 52px 12px 9px; background: var(--pine); color: #fff; }
.chat-head > .ic:first-child { opacity: .9; margin-inline-end: -4px; }
.chat-head div { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.chat-head b { font-size: 15.5px; font-weight: 600; display: flex; align-items: center; gap: 5px; }
.chat-head span { font-size: 12px; opacity: .82; }
.verified { width: 15px; height: 15px; border-radius: 50%; background: #39C07F; display: inline-grid; place-items: center; color: #fff; font-style: normal; }
.verified .ic { stroke-width: 3.2; }
.chat-av, .web-logo { width: 36px; height: 36px; border-radius: 50%; background: #fff; color: var(--pine); display: grid; place-items: center; font-weight: 700; font-size: 17px; flex: none; }
.chat-ic { opacity: .9; display: flex; padding-inline: 4px; }
.chat-body { flex: 1; overflow-y: auto; padding: 12px 12px 6px; display: flex; flex-direction: column; gap: 5px; scrollbar-width: none; }
.msg { max-width: 84%; padding: 6px 9px 4px; border-radius: 10px; font-size: 14.5px; line-height: 1.45; box-shadow: 0 1px .5px rgba(11, 20, 26, .13); animation: msgIn .22s var(--ease); position: relative; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } }
.msg.bot { align-self: flex-start; background: #fff; border-start-start-radius: 0; }
.msg.me { align-self: flex-end; background: #D9FDD3; border-start-end-radius: 0; }
.msg.bot::before, .msg.me::before { content: ""; position: absolute; top: 0; width: 0; height: 0; border-top: 9px solid #fff; }
.msg.bot::before { inset-inline-start: -7px; border-inline-start: 8px solid transparent; }
.msg.me::before { inset-inline-end: -7px; border-top-color: #D9FDD3; border-inline-end: 8px solid transparent; }
.msg.me .msg-text { display: inline-flex; align-items: center; gap: 5px; }
.msg-meta { display: flex; align-items: center; justify-content: flex-end; gap: 3px; font-size: 11px; color: #667781; margin-top: 1px; }
.msg.me .msg-meta .ic { color: #53BDEB; }
.msg-from { font-size: 12.5px; font-weight: 600; color: #C2410C; margin-bottom: 1px; }
.msg.day { align-self: center; background: rgba(255, 255, 255, .92); box-shadow: 0 1px .5px rgba(11, 20, 26, .1); font-size: 12px; color: #54656F; padding: 4px 11px; border-radius: 8px; margin-block: 5px; }
.msg.day::before { display: none; }
.msg.typing { display: flex; gap: 4px; padding: 12px 13px; }
.msg.typing i { width: 6px; height: 6px; border-radius: 50%; background: #8696A0; animation: blink 1.1s infinite; }
.msg.typing i:nth-child(2) { animation-delay: .15s; } .msg.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-2px); } }
.slot-list, .price-list, .plan-list { margin: 6px 0 4px; display: flex; flex-direction: column; }
.slot-list { gap: 6px; }
.slot-list li { display: flex; flex-direction: column; padding-inline-start: 9px; border-inline-start: 2px solid var(--mint-2); line-height: 1.35; }
.slot-list span { font-size: 12.5px; color: var(--ink-2); }
.price-list li, .plan-list li { display: flex; justify-content: space-between; gap: 12px; padding-block: 6px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.price-list li:last-child, .plan-list li:last-child { border-bottom: 0; }
.price-list b, .plan-list b { font-weight: 500; }
.price-list span, .plan-list span { color: var(--ink-2); white-space: nowrap; font-size: 13px; }
.plan-list li { align-items: center; }
.plan-list li b { display: flex; align-items: center; gap: 8px; }
.plan-list li b::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--line-2); flex: none; }
.plan-list li.done b { color: var(--ink-2); }
.plan-list li.done b::before { background: var(--pine) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 9px no-repeat; border-color: var(--pine); }

.acard { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; margin-top: 7px; display: flex; flex-direction: column; gap: 5px; min-width: 216px; font-size: 13px; }
.acard-top { display: flex; align-items: center; gap: 7px; }
.acard-top span:last-child { margin-inline-start: auto; color: var(--ink-3); font-size: 12px; }
.acard-when { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-weight: 500; padding-block: 2px; }
.acard-when strong { font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.acard-row { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 12.5px; }
.acard-acts { display: flex; margin: 5px -11px -10px; border-top: 1px solid var(--line); }
.acard-acts button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 9px 6px; color: var(--pine); font-weight: 600; font-size: 13px; transition: background .15s; }
.acard-acts button + button { border-inline-start: 1px solid var(--line); }
.acard-acts button:hover:not(:disabled) { background: var(--mint); }
.acard-acts button.danger { color: var(--coral); }
.acard-acts button.danger:hover { background: var(--coral-bg); }
.acard-acts.solo { margin: 8px 0 2px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--surface-2); }
.acard.cx { border-color: var(--coral); background: #FFF6F2; }
.tdot { width: 9px; height: 9px; border-radius: 3px; background: var(--c-edge); flex: none; display: inline-block; }
td .tdot, .visits .tdot { margin-inline-end: 8px; }
.doc { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; margin-top: 6px; }
.doc .ic { color: var(--coral); }
.doc div { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.doc b { font-size: 13.5px; font-weight: 600; }
.doc span { font-size: 12px; color: var(--ink-3); }
.img-msg { display: flex; flex-direction: column; gap: 5px; margin-top: 7px; text-align: start; width: 100%; }
.img-msg img { width: 100%; border-radius: 8px; display: block; background: #000; }
.img-msg span { font-size: 12.5px; color: var(--ink-2); }

.chat-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 10px 8px; }
.chat-chips:empty { display: none; }
.chip { background: #fff; border: 1px solid var(--mint-2); color: var(--pine-2); padding: 7px 13px; border-radius: 99px; font-size: 13.5px; font-weight: 500; box-shadow: var(--sh-1); animation: chipIn .25s var(--ease) backwards; transition: background .15s, border-color .15s, transform .12s; }
.chip:hover { background: var(--mint); border-color: var(--pine); }
.chip:active { transform: scale(.97); }
.chip-quiet { color: var(--ink-2); border-color: var(--line); }
@keyframes chipIn { from { opacity: 0; transform: translateY(6px); } }
.chat-input { display: flex; align-items: center; gap: 6px; padding: 6px 8px 24px; }
.chat-input input { flex: 1; min-width: 0; border: 0; background: #fff; border-radius: 99px; padding: 10px 16px; font-size: 14.5px; outline: none; box-shadow: 0 1px .5px rgba(11, 20, 26, .1); }
.chat-input input:focus { box-shadow: 0 0 0 2px var(--mint-2); }
.chat-menu, .chat-send { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; transition: background .15s, transform .12s; }
.chat-menu { background: #fff; color: var(--pine); box-shadow: 0 1px .5px rgba(11, 20, 26, .1); }
.chat-menu:hover { background: var(--mint); }
.chat-send { background: var(--pine); color: #fff; }
.chat-send:hover { background: var(--pine-2); }
.chat-send .ic { transform: scaleX(-1); }
.chat-menu:active, .chat-send:active { transform: scale(.94); }

/* sheets inside the phone */
.sheet { position: absolute; inset: 0; background: rgba(18, 24, 22, .45); display: flex; align-items: flex-end; z-index: 7; animation: fade .2s; }
.sheet-card { background: var(--surface); width: 100%; max-height: 86%; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 10px 16px 28px; display: flex; flex-direction: column; gap: 4px; animation: up .28s var(--ease); scrollbar-width: none; }
.sheet-grip { width: 38px; height: 4px; border-radius: 4px; background: var(--line-2); align-self: center; margin-bottom: 8px; flex: none; }
.sheet-card h3 { font-size: 17px; }
.sheet-card > p { color: var(--ink-2); font-size: 13px; margin-bottom: 6px; }
.sheet-card .btn { margin-top: 12px; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(100%); } }
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 4px; }
.menu-grid button { display: flex; align-items: center; gap: 9px; padding: 11px 10px; border-radius: 11px; background: var(--surface-2); text-align: start; font-size: 13.5px; font-weight: 500; transition: background .14s; }
.menu-grid button:hover { background: var(--mint); }
.menu-grid .ic { color: var(--pine); }
.pay-sum { font-size: 36px; font-weight: 600; letter-spacing: -.02em; text-align: center; padding-block: 6px 10px; }
.pay-methods { display: flex; flex-direction: column; gap: 6px; }
.pay-methods label { cursor: pointer; }
.pay-methods input { position: absolute; opacity: 0; }
.pay-methods span { display: flex; align-items: center; gap: 9px; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 11px; font-weight: 500; transition: border-color .15s, background .15s; }
.pay-methods input:checked + span { border-color: var(--pine); background: var(--mint); }
.pay-methods input:focus-visible + span { outline: 2px solid var(--pine); outline-offset: 2px; }
.viewer { position: absolute; inset: 0; background: #0A0D0C; z-index: 8; display: flex; flex-direction: column; justify-content: center; gap: 14px; animation: fade .2s; }
.viewer img { width: 100%; display: block; }
.viewer-x { position: absolute; top: 52px; inset-inline-end: 14px; width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; display: grid; place-items: center; }
.viewer-cap { color: #fff; padding-inline: 18px; display: flex; flex-direction: column; gap: 3px; }
.viewer-cap span { color: rgba(255, 255, 255, .78); font-size: 13.5px; }
.viewer-cap small { color: rgba(255, 255, 255, .5); font-size: 11px; margin-top: 6px; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 9px; cursor: pointer; }
.switch-row > span { display: flex; flex-direction: column; min-width: 0; }
.switch-row small { color: var(--ink-3); font-size: 12.5px; font-weight: 400; }
.switch-row input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-row i { width: 36px; height: 21px; border-radius: 99px; background: var(--line-2); position: relative; flex: none; transition: background .18s; }
.switch-row i::after { content: ""; position: absolute; top: 2.5px; inset-inline-start: 2.5px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .18s var(--ease); }
.switch-row input:checked + i { background: var(--pine); }
.switch-row input:checked + i::after { transform: translateX(-15px); }
.switch-row input:focus-visible + i { outline: 2px solid var(--pine); outline-offset: 2px; }

/* ---------- the personal area ---------- */
.web { height: 100%; background: var(--surface); display: flex; flex-direction: column; }
.web-head { padding: 54px 16px 12px; border-bottom: 1px solid var(--line); background: var(--surface); flex: none; }
.web-brand { display: flex; align-items: center; gap: 10px; }
.web-brand div, .side-clinic div, .side-user div { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.web-brand span, .side-clinic span, .side-user span { font-size: 12px; color: var(--ink-3); }
.web-logo { background: var(--pine); color: #fff; border-radius: 11px; }
.web-main { flex: 1; overflow-y: auto; padding: 16px 16px 20px; display: flex; flex-direction: column; gap: 10px; scrollbar-width: none; }
.web-main h3 { font-size: 20px; margin-bottom: 2px; }
.web-main h4 { font-size: 13px; color: var(--ink-3); font-weight: 600; margin-top: 12px; }
.web-main .acard { margin-top: 0; background: var(--surface); box-shadow: var(--sh-1); }
.app-nav { flex: none; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); padding: 6px 8px 22px; background: var(--surface); }
.app-nav button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px; border-radius: 10px; color: var(--ink-3); font-size: 11.5px; font-weight: 500; transition: color .15s; }
.app-nav button.on { color: var(--pine); font-weight: 600; }
.app-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 26px 16px; border: 1px dashed var(--line-2); border-radius: 14px; color: var(--ink-3); }
.app-empty b { color: var(--ink); }
.app-empty span { font-size: 13px; }
.app-list { display: flex; flex-direction: column; }
.app-list li { display: flex; align-items: center; gap: 10px; padding-block: 10px; border-bottom: 1px solid var(--line); }
.app-list li:last-child { border-bottom: 0; }
.app-list li[role="button"] { cursor: pointer; }
.app-list div { display: flex; flex-direction: column; line-height: 1.35; flex: 1; min-width: 0; }
.app-list b { font-weight: 600; font-size: 14px; }
.app-list span { font-size: 12.5px; color: var(--ink-3); }
.app-list .ic { color: var(--ink-3); }
.app-me { display: flex; align-items: center; gap: 12px; }
.app-me div { display: flex; flex-direction: column; line-height: 1.4; }
.app-me b { font-size: 18px; font-weight: 600; }
.app-me span { font-size: 13px; color: var(--ink-2); text-align: start; }
.app-alert, .alert-row { display: flex; align-items: center; gap: 8px; background: var(--coral-bg); color: #8E2A10; font-weight: 600; font-size: 13.5px; padding: 8px 11px; border-radius: 9px; }
.app-pay, .bal { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; flex-wrap: wrap; }
.app-pay div, .bal > div:first-child { display: flex; flex-direction: column; line-height: 1.3; }
.app-pay span, .bal span { font-size: 12.5px; color: var(--ink-2); }
.app-pay b, .bal b { font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.app-pay.ok, .bal:not(.due) { color: var(--pine); }
.app-pay.ok b, .bal:not(.due) b { font-size: 16px; }
.bal.due { border-color: var(--amber); background: #FFFBF0; }
.bal-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.app-imgs { display: flex; gap: 8px; overflow-x: auto; margin-inline: -16px; padding-inline: 16px; scrollbar-width: none; }
.app-imgs button { flex: none; width: 168px; text-align: start; display: flex; flex-direction: column; gap: 5px; }
.app-imgs img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 10px; background: #000; display: block; }
.app-imgs span { font-size: 13px; font-weight: 600; display: flex; flex-direction: column; }
.app-imgs small { font-weight: 400; color: var(--ink-3); font-size: 12px; }
.web-steps { display: flex; gap: 5px; margin-bottom: 4px; }
.web-steps li { flex: 1; text-align: center; font-size: 11.5px; color: var(--ink-3); padding-top: 7px; border-top: 3px solid var(--surface-3); font-weight: 500; }
.web-steps li.past { border-color: var(--mint-2); color: var(--ink-2); }
.web-steps li.on { border-color: var(--pine); color: var(--pine-2); font-weight: 600; }
.web-back { display: inline-flex; align-items: center; gap: 2px; color: var(--ink-2); font-size: 13px; align-self: flex-start; font-weight: 500; }
.web-back:hover { color: var(--pine); }
.web-card { display: flex; flex-direction: column; gap: 5px; text-align: start; border: 1px solid var(--line); border-radius: 14px; padding: 14px; transition: border-color .15s, box-shadow .15s; }
.web-card:hover { border-color: var(--pine); box-shadow: var(--sh-2); }
.web-card-t { font-size: 17px; font-weight: 600; }
.web-card-s { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13px; }
.web-tag { align-self: flex-start; background: var(--mint); color: var(--pine-2); font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; margin-top: 4px; }
.web-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; flex: none; }
.web-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; text-align: start; transition: background .15s; }
.web-row + .web-row { border-top: 1px solid var(--line); }
.web-row:hover { background: var(--surface-2); }
.web-row-t { font-weight: 600; flex: 1; }
.web-row-s { font-size: 12.5px; color: var(--ink-3); }
.web-row .ic { color: var(--ink-3); }
.web-days { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-inline: -16px; padding-inline: 16px; scrollbar-width: none; flex: none; }
.web-day { flex: none; width: 48px; display: flex; flex-direction: column; align-items: center; padding: 7px 0 5px; border: 1px solid var(--line); border-radius: 12px; transition: border-color .15s, background .15s; }
.web-day span { font-size: 11.5px; color: var(--ink-3); }
.web-day b { font-size: 17px; font-weight: 600; }
.web-day i { font-style: normal; font-size: 10px; color: var(--ink-3); height: 13px; }
.web-day:hover:not(:disabled) { border-color: var(--pine); }
.web-day.on { background: var(--pine); border-color: var(--pine); color: #fff; }
.web-day.on span { color: rgba(255, 255, 255, .8); }
.web-day:disabled { opacity: .5; cursor: default; background: var(--surface-2); }
.web-date { font-weight: 600; font-size: 13.5px; }
.web-group { display: flex; flex-direction: column; gap: 6px; }
.web-group > span { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.web-times { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.web-times:has(> :only-child) { grid-template-columns: 1fr; }
.web-time { border: 1px solid var(--line); border-radius: 10px; padding: 7px 4px 6px; display: flex; flex-direction: column; align-items: center; line-height: 1.25; transition: border-color .15s, background .15s; }
.web-times > :only-child { flex-direction: row; justify-content: space-between; align-items: center; padding: 14px 16px; }
.web-time b { font-size: 15px; font-weight: 600; }
.web-time span { font-size: 12px; color: var(--ink-3); }
.web-time:hover { border-color: var(--pine); background: var(--mint); }
.web-empty { color: var(--ink-3); padding-block: 20px; text-align: center; }
.web-field { display: flex; flex-direction: column; gap: 4px; }
.web-field label { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.web-field input, .web-field select, .hr select { border: 1px solid var(--line-2); border-radius: 9px; padding: 9px 11px; background: var(--surface); outline: none; width: 100%; transition: border-color .15s, box-shadow .15s; }
.web-field input:focus, .web-field select:focus, .hr select:focus { border-color: var(--pine); box-shadow: 0 0 0 3px var(--mint); }
.web-fine { font-size: 12px; color: var(--ink-3); text-align: center; }
.web-done { display: flex; flex-direction: column; align-items: center; gap: 4px; padding-block: 14px 6px; text-align: center; }
.web-done p { color: var(--ink-2); }
.web-check { width: 60px; height: 60px; border-radius: 50%; background: var(--mint); color: var(--pine); display: grid; place-items: center; margin-bottom: 6px; animation: popIn .45s var(--ease); }
@keyframes popIn { from { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.08); } }

/* ---------- the clinic's patient file ---------- */
.crumb { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.crumb:hover { color: var(--pine); }
.pf-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.pf-id { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 5px; }
.pf-id h1 { font-size: 24px; letter-spacing: -.01em; }
.pf-id p { color: var(--ink-2); font-size: 13.5px; }
.pf-id .pill .ic { margin-inline-end: 4px; }
.pf-acts { display: flex; gap: 8px; }
.pf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.pf-grid.wide-first { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.next-ap { display: flex; align-items: center; gap: 14px; padding-block: 6px 10px; flex-wrap: wrap; }
.next-ap strong { font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.next-ap div { display: flex; flex-direction: column; line-height: 1.35; flex: 1; min-width: 150px; }
.next-ap span:not(.pill) { font-size: 13px; color: var(--ink-2); }
.panel .d-row + .d-row, .panel .next-ap + .d-row, .panel .alert-row + .d-row, .panel .muted + .d-row, .panel .plan-list + .d-row { border-top: 1px solid var(--line); }
.panel .alert-row { margin-block: 4px; }
.visits { display: flex; flex-direction: column; }
.visits li { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 14px; padding-block: 12px; border-bottom: 1px solid var(--line); }
.visits li:last-child { border-bottom: 0; }
.visits time { font-size: 13px; color: var(--ink-2); font-weight: 500; padding-top: 1px; }
.visits div { display: flex; flex-direction: column; gap: 2px; line-height: 1.45; }
.visits b { font-weight: 600; display: flex; align-items: center; }
.visits p { font-size: 13.5px; color: var(--ink); max-width: 68ch; }
.visits div > span { font-size: 12.5px; color: var(--ink-3); }
.chart { width: 100%; height: auto; display: block; max-width: 720px; margin-inline: auto; }
.chart .tb { fill: var(--surface); stroke: var(--line-2); stroke-width: 1.2; }
.chart .tb.gone { fill: var(--surface-2); stroke-dasharray: 3 3; }
.chart .tx { stroke: var(--ink-3); stroke-width: 1.4; stroke-linecap: round; opacity: .6; }
.chart .ts { fill: transparent; stroke: var(--line-2); stroke-width: .8; }
.chart .ts.f { fill: #4A8FD3; stroke: #2F6FB0; }
.chart .ts.w { fill: #F6D77A; stroke: #C99A1B; }
.chart .tcrown { fill: none; stroke: #C9A13F; stroke-width: 3; }
.chart .troot { fill: var(--coral); }
.chart .timpl { stroke: var(--ink-2); stroke-width: 1.6; fill: none; stroke-linecap: round; }
.chart .tn { font: 500 10px var(--font); fill: var(--ink-3); text-anchor: middle; }
.chart .tmid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.chart .thit { fill: transparent; transition: fill .14s; }
.chart .tooth { cursor: pointer; outline: none; }
.chart .tooth:hover .thit, .chart .tooth:focus-visible .thit { fill: var(--mint); }
.chart .tooth.sel .thit { fill: var(--mint); stroke: var(--pine); stroke-width: 1.5; }
.chart .tooth.sel .tn { fill: var(--pine-2); font-weight: 700; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12.5px; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 6px; }
.lg { width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--line-2); display: inline-block; }
.lg.f { background: #4A8FD3; border-color: #2F6FB0; } .lg.r { background: var(--coral); border-color: var(--coral); border-radius: 50%; } .lg.c { border: 2.5px solid #C9A13F; } .lg.w { background: #F6D77A; border-color: #C99A1B; } .lg.g { background: var(--surface-2); border-style: dashed; }
.chart-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 236px; gap: 20px; align-items: center; padding-block: 8px; }
.chart-wrap aside { border-inline-start: 1px solid var(--line); padding-inline-start: 20px; align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.tooth-d { display: flex; flex-direction: column; gap: 8px; }
.tooth-d h4 { font-size: 18px; font-weight: 600; }
.tooth-d .link { display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; }
.xr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.xr { display: flex; flex-direction: column; gap: 7px; text-align: start; }
.xr img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; background: #0A0D0C; display: block; transition: filter .15s, box-shadow .15s; }
.xr:hover img { filter: brightness(1.12); box-shadow: 0 0 0 2px var(--pine); }
.xr span { display: flex; flex-direction: column; line-height: 1.35; }
.xr b { font-size: 13.5px; font-weight: 600; }
.xr small { font-size: 12px; color: var(--ink-3); }
.docs { display: flex; flex-direction: column; }
.docs li { display: flex; align-items: center; gap: 10px; padding-block: 10px; border-bottom: 1px solid var(--line); }
.docs .ic { color: var(--ink-3); }
.docs div { display: flex; flex-direction: column; line-height: 1.35; }
.docs b { font-weight: 600; font-size: 13.5px; }
.docs span { font-size: 12.5px; color: var(--ink-3); }
.lightbox { position: absolute; inset: 0; z-index: 12; background: #0B0E0D; color: #fff; display: flex; flex-direction: column; animation: fade .2s; }
.lb-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.lb-bar div:first-child { display: flex; flex-direction: column; line-height: 1.35; }
.lb-bar span { font-size: 12.5px; color: rgba(255, 255, 255, .65); }
.lb-tools { display: flex; gap: 6px; }
.lightbox .btn-icon { background: rgba(255, 255, 255, .1); border-color: transparent; color: #fff; }
.lightbox .btn-icon:hover { background: rgba(255, 255, 255, .2); }
.lb-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px; overflow: hidden; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; transition: transform .25s var(--ease), filter .2s; }
.lightbox.inv img { filter: invert(1); }
.lightbox.zoom img { transform: scale(1.7); }
.lb-nav { width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .1); color: #fff; display: grid; place-items: center; flex: none; z-index: 1; }
.lb-nav:hover { background: rgba(255, 255, 255, .22); }
.lb-cap { padding: 12px 18px 16px; border-top: 1px solid rgba(255, 255, 255, .1); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: baseline; }
.lb-cap small { color: rgba(255, 255, 255, .45); font-size: 11.5px; }
.tour .t-sec { font-size: 13px; color: var(--ink); padding-top: 14px; border-top: 1px solid var(--line); margin-top: 6px; }
.tour .t-sec:first-of-type { border-top: 0; margin-top: 0; }

/* ---------- responsive ---------- */
@container win (max-width: 900px) {
  .cal-wrap { grid-template-columns: minmax(0, 1fr); }
  .cal-side { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-wrap { grid-template-columns: minmax(0, 1fr); }
  .chart-wrap aside { border-inline-start: 0; padding-inline-start: 0; border-top: 1px solid var(--line); padding-top: 12px; }
}
@container win (max-width: 760px) {
  .two, .how, .pf-grid, .pf-grid.wide-first { grid-template-columns: minmax(0, 1fr); }
}
@container win (max-width: 700px) {
  .side { padding-inline: 8px; }
  .side-clinic div, .side-user div, .side-btn span { display: none; }
  .side-btn { justify-content: center; position: relative; padding: 10px; }
  .side-btn em { position: absolute; top: 2px; inset-inline-end: 2px; min-width: 15px; height: 15px; font-size: 10px; padding-inline: 3px; }
  .side-btn em.quiet { display: none; }
  .side-clinic, .side-user { justify-content: center; padding: 0; }
}
@container win (max-width: 560px) {
  .cal-scroll { --colmin: 168px; }
  .visits li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .pf-acts { width: 100%; }
  .pf-acts .btn { flex: 1; }
}
@media (max-width: 1179px) {
  .views [data-view="split"] { display: none; }
  .stage[data-view="patient"] { grid-template-columns: minmax(0, 1fr); padding: 14px 16px 16px; }
  .stage[data-view="patient"] .guide, .stage[data-view="patient"] .live { display: none; }
}
@media (max-width: 700px) {
  .top { padding-inline: 12px; height: 52px; gap: 6px; }
  .brand-for, .hide-sm, .views .ic { display: none; }
  .views button { padding-inline: 10px; }
  .stage[data-view="patient"] { padding: 10px 10px 12px; }
  .device-col { gap: 8px; }
  /* a real phone does not need a drawn phone around it */
  .phone { aspect-ratio: auto; width: 100%; max-width: 520px; max-height: none; padding: 0; border-radius: 16px; background: none; box-shadow: 0 0 0 1px var(--line), var(--sh-2); }
  .phone::before, .phone::after, .phone-notch, .statusbar, .homebar { display: none; }
  .phone-screen { border-radius: 16px; }
  .chat-head { padding-top: 10px; }
  .web-head { padding-top: 14px; }
  .chat-input { padding-bottom: 8px; }
  .app-nav { padding-bottom: 6px; }
  .viewer-x { top: 12px; }
  .win { grid-template-columns: 52px minmax(0, 1fr); }
  .view { padding: 14px 12px; }
  .vh h1 { font-size: 17px; }
  .search { min-width: 0; width: 100%; }
  .cal-who .av { display: none; }
  .cal-who { padding: 7px 6px; }
  .kpi b { font-size: 24px; }
  .hours li { grid-template-columns: 96px minmax(0, 1fr); }
  .pf-id h1 { font-size: 20px; }
  .toasts { top: 58px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* children of the scrolling column keep their natural height */
.web-main > * { flex: none; }
/* notifications sit in the bottom corner, clear of the phone and the calendar */
.toasts { top: auto; bottom: 20px; left: 20px; transform: none; align-items: flex-start; flex-direction: column-reverse; max-width: min(420px, calc(100vw - 40px)); }
@media (max-width: 700px) { .toasts { left: 10px; right: 10px; bottom: 12px; top: auto; align-items: stretch; } }
.g-row { padding-block: 6px; }
.pf-grid .xr img { aspect-ratio: auto; height: 190px; }
.guide h3, .live h3 { padding-top: 10px; }
.g-row { padding-block: 5px; font-size: 13.5px; }

/* ---------- design round 3 (Codex critique): clearer type hierarchy, calmer calendar ---------- */
.g-head h2 { font-size: 18px; line-height: 1.3; }
.g-row { font-size: 14.5px; padding-block: 6px; }
.feed-i b { font-size: 14px; }
.feed-i span { font-size: 13px; }
.panel-h h3, .side-h h3 { font-size: 15.5px; }
.vh h1 { font-size: 22px; }
.pf-id h1 { font-size: 27px; }
.tbl { font-size: 14px; }
.d-row { font-size: 14px; }
.side-btn { font-size: 14px; }
.guide, .live { max-height: 100%; }
/* pending appointments: solid fill and a dashed outline; hatching is reserved for closed time */
.ap.s-pending { background: var(--c-bg); outline: 1.5px dashed var(--c-edge); outline-offset: -1.5px; }
/* profile overview: two independent stacks, no dead space */
.pf-grid:not(.wide-first) { display: block; columns: 2; column-gap: 16px; }
.pf-grid:not(.wide-first) > .panel { break-inside: avoid; margin-bottom: 16px; }
.pf-grid .xr img { aspect-ratio: auto; height: 190px; object-fit: cover; }
@container win (max-width: 760px) { .pf-grid:not(.wide-first) { columns: 1; } }
/* tooth chart: stronger outlines and numbers */
.chart .ts { stroke: #9AA79F; stroke-width: 1; }
.chart .tb { stroke: #9AA79F; }
.chart .tn { font-size: 11.5px; fill: var(--ink-2); }
.chart .tooth.sel .thit { stroke-width: 2; }
/* on a phone, one notification at a time, under the header */
@media (max-width: 700px) {
  .toasts { top: 60px; bottom: auto; left: 12px; right: 12px; }
  .toasts .toast:not(:last-child) { display: none; }
  .toast { padding: 12px 16px; }
}
