/* App shell: one top bar (menu + user) that turns into a bottom tab bar on phones; full-width panels */
.topbar__in { gap: 18px; }
.nav { display: flex; gap: 4px; align-items: center; }
.nav a { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 12px; position: relative; }
.nav a .ico { width: 19px; height: 19px; }
.nav a.is-active { background: var(--accent-soft, #e2f0f5); color: var(--accent-ink, #0a4d66); }
.nav a .count { margin-inline-start: 2px; }
.who { display: inline-flex; align-items: center; gap: 10px; padding: 4px 14px 4px 6px; border-radius: 12px; background: #fff; box-shadow: 0 0 0 1px var(--line); color: var(--ink); }
.who:hover { color: var(--ink); box-shadow: 0 0 0 1px var(--accent); }
.who__av { width: 36px; height: 36px; border-radius: 12px; object-fit: cover; flex: none; }
.who__av--txt { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-weight: 800; }
.who__txt { display: grid; line-height: 1.35; text-align: start; }
.who__txt small { color: var(--ink-3); font-size: .74rem; }

/* signed-in: the bar spans the page like the panels do */
body:not(.role-guest) .topbar .wrap { width: calc(100% - 32px); max-width: none; }

/* panels: full width, no inner side menu */
.wrap.panel { display: block; width: calc(100% - 48px); max-width: none; padding: 22px 0 64px; }
.wrap.panel > .side { display: none; }

/* mobile: the menu moves to the bottom */
@media (max-width: 900px) {
    .nav { display: flex; position: fixed; inset: auto 0 0 0; z-index: 40; justify-content: space-around; gap: 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .96); backdrop-filter: blur(14px); box-shadow: 0 -1px 0 var(--line), 0 -12px 30px -18px rgba(18, 52, 70, .35); overflow: visible; }
    .nav a { flex: 1 1 0; flex-direction: column; gap: 3px; padding: 6px 4px; border-radius: 12px; font-size: .68rem; text-align: center; min-width: 0; }
    .nav a .ico { width: 22px; height: 22px; }
    .nav__txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
    .nav a .count { position: absolute; top: 2px; inset-inline-end: 22%; margin: 0; min-width: 18px; text-align: center; }
    body { padding-bottom: 76px; }
    .topbar__in { justify-content: space-between; }
    .who__txt { display: none; }
    .who { padding: 3px; }
    .wrap.panel { width: calc(100% - 28px); padding-top: 14px; }
    .foot { padding-bottom: 90px; }
}

/* floating "health file" button on the patient profile (phones) */
.fab-health { display: none; }
@media (max-width: 900px) {
    .fab-health { display: inline-flex; position: fixed; z-index: 45; inset-inline-start: 14px; bottom: 90px; align-items: center; gap: 8px; padding: 12px 18px 12px 14px; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 700; font-size: .9rem; box-shadow: 0 14px 28px -12px var(--accent); }
    .fab-health:hover { color: #fff; }
    .fab-health .ico { width: 22px; height: 22px; }
}

/* Patient profile (doctor panel): chat half / sidebar half; phones: identity, chat, then the rest */
.pp-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "chat patient" "chat rest"; gap: 16px; align-items: start; }
.pp-chatcol { grid-area: chat; display: grid; gap: 16px; min-width: 0; }
@media (max-width: 900px) {
    .pp-layout { grid-template-columns: 1fr; grid-template-areas: "patient" "chat" "rest"; }
}
.pp-patient { gap: 10px; }
.pp-patient .cx-person { flex-wrap: wrap; }
.pp-patient .cx-person > div { flex: 1; min-width: 0; }
.pp-hfile { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); font-size: .8rem; font-weight: 700; box-shadow: inset 0 0 0 1px #cfe5f6; }
.pp-hfile:hover { background: var(--accent); color: #fff; }
.pp-hfile .ico { width: 15px; height: 15px; }
.pp-id { display: flex; gap: 8px; flex-wrap: wrap; }
.pp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 12px; background: var(--sky-bg); font-size: .8rem; color: var(--ink-2); }
.pp-chip .ico { width: 15px; height: 15px; stroke: var(--accent); } .pp-chip b { color: var(--ink); }

/* medical info tiles */
.mi { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mi__cell { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--tone-bg); }
.mi__cell small { color: var(--ink-2); font-size: .74rem; grid-column: 2; }
.mi__cell b { grid-column: 2; font-size: 1.02rem; }
.mi__cell .mi__ico { grid-row: 1 / 3; }
.mi__ico { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; background: #fff; color: var(--tone); flex: none; }
.mi__ico .ico { width: 18px; height: 18px; }
.mi__cell--blue, .mi__wide--blue { --tone: #0a78c2; --tone-bg: #e5f2fc; }
.mi__cell--rose { --tone: #d6204f; --tone-bg: #ffe9ef; }
.mi__cell--violet { --tone: #5b3df5; --tone-bg: #efebff; }
.mi__cell--green { --tone: #0f8a63; --tone-bg: #e2f6ee; }
.mi__wide--amber { --tone: #b86e00; --tone-bg: #fff3d9; }
.mi__wide--teal { --tone: #0c8f9c; --tone-bg: #def5f7; }
.mi__wide { grid-column: 1 / -1; display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--tone-bg); }
.mi__wide div { display: grid; line-height: 1.55; } .mi__wide small { color: var(--ink-2); font-size: .74rem; } .mi__wide b { font-weight: 600; font-size: .92rem; }

/* visit accordion (FAQ style) */
.faq { display: grid; gap: 8px; }
.faq__item { border-radius: 12px; background: var(--sky-bg); box-shadow: inset 0 0 0 1px var(--sky-line); overflow: hidden; }
.faq__item[open] { background: #fff; box-shadow: 0 0 0 1px #b9d9f0; }
.faq__item > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; }
.faq__item > summary::-webkit-details-marker { display: none; }
.faq__date { display: grid; line-height: 1.5; }
.faq__chev { color: var(--ink-3); font-size: 1.2rem; transition: transform .3s var(--spring); }
.faq__item[open] .faq__chev { transform: rotate(180deg); }
.faq__body { display: grid; gap: 8px; padding: 0 16px 14px; }
.faq__row { display: flex; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--tone-bg); }
.faq__row > div { display: grid; min-width: 0; } .faq__row small { color: var(--ink-2); font-size: .74rem; }
.faq__row p { margin: 0; overflow-wrap: anywhere; } .faq__rx { white-space: pre-line; }
.faq__row--amber { --tone: #b86e00; --tone-bg: #fff6e3; } .faq__row--blue { --tone: #0a78c2; --tone-bg: #eaf4fd; } .faq__row--green { --tone: #0f8a63; --tone-bg: #e8f7f1; }

/* minimal complaint list */
.pp-min { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pp-min li { display: grid; gap: 1px; padding: 8px 12px; border-radius: 12px; background: #fff8e8; font-size: .88rem; }
.pp-min time { color: #a15c07; font-size: .74rem; font-weight: 700; }
.cx-docs { grid-template-columns: repeat(3, 1fr); }

/* public doctor page: chat half, sidebar half */
.dp-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 900px) { .dp-grid { grid-template-columns: 1fr; } }

/* Payment request: one compact row — label, amount chip, slider, custom, submit */
.cx-tariff-box { padding: 0; border: 0; background: transparent; }
.pay-req { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--sky-line); background: var(--sky-bg); }
.pay-req__lbl { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .88rem; color: var(--ink-2); white-space: nowrap; }
.pay-req__lbl .ico { width: 18px; height: 18px; stroke: var(--accent); }
.pay-req__range { flex: 1 1 140px; min-width: 120px; height: 20px; margin: 0; }
.pay-req .tf-chip { font-size: .78rem; }
.pay-req .tf-custom { gap: 6px; flex-wrap: nowrap; }
.pay-req .tf-custom__field .input { width: 110px; padding: 4px 8px; }
.pay-req .btn { white-space: nowrap; }

/* Chat thread: soft medical pattern (crosses + pulse line) behind the bubbles */
.cx-thread, .theme-sky .cx-thread {
    background-color: #f3f8fc;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180' fill='none' stroke='%230a78c2' stroke-opacity='.07' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M30 18v16M22 26h16'/%3E%3Cpath d='M118 112v14M111 119h14'/%3E%3Cpath d='M12 96h22l6-16 10 32 8-16h22'/%3E%3Ccircle cx='140' cy='36' r='9'/%3E%3Cpath d='M136 36h8M140 32v8'/%3E%3Cpath d='M96 150c-10-9-18-14-18-23a9 9 0 0118-3 9 9 0 0118 3c0 9-8 14-18 23z'/%3E%3Cpath d='M150 150l12-12M154 134l8 8'/%3E%3C/svg%3E");
    background-size: 180px 180px;
}

/* dialogs */
.dlg { border: 0; border-radius: 12px; padding: 22px 24px; width: min(560px, calc(100% - 28px)); box-shadow: 0 30px 80px -20px rgba(10, 40, 70, .5); }
.dlg::backdrop { background: rgba(14, 40, 60, .45); backdrop-filter: blur(3px); }
.dlg .form { gap: 12px; } .dlg h3 { margin-bottom: 4px; }
.dlg__actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.dlg__del { margin-inline-start: auto; }

/* records: read-only cards, edit in a dialog (layout never shifts) */
.pp-sechead { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.pp-recs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.pp-rec { border-radius: 12px; padding: 14px 16px; background: #fff; box-shadow: inset 0 0 0 1px var(--sky-line); display: grid; gap: 6px; align-content: start; }
.pp-rec header { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.pp-rec header > div { display: grid; line-height: 1.5; } .pp-rec time { font-size: .78rem; }
.pp-rec p { margin: 0; font-size: .92rem; overflow-wrap: anywhere; } .pp-rec__rx { white-space: pre-line; }
.pp-rec__edit { border: 0; width: 32px; height: 32px; border-radius: 12px; background: var(--tint); cursor: pointer; display: grid; place-items: center; color: var(--ink-2); transition: background .2s, color .2s; }
.pp-rec__edit:hover { background: var(--accent-soft); color: var(--accent-ink); } .pp-rec__edit .ico { width: 17px; height: 17px; }

/* payments list */
.pay-list { list-style: none; margin: 0; padding: 0; display: grid; }
.pay-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--tint); }
.pay-list li:first-child { border-top: 0; }
.pay-list li div { display: grid; line-height: 1.5; } .pay-list li div b { font-size: .92rem; } .pay-list li div small { font-size: .76rem; }
.pay-list__amt { font-size: .95rem; } .pay-list__amt small { font-size: .72rem; font-weight: 500; color: var(--ink-3); }
.pp-total { margin: 0; display: flex; justify-content: space-between; align-items: baseline; padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); }
.pp-total b { color: var(--accent-ink); }

/* patient profile: sidebar is its own column on desktop and dissolves on phones */
.pp-layout { grid-template-areas: "chat side"; }
.pp-side { grid-area: side; display: grid; gap: 14px; align-content: start; min-width: 0; }
.pp-rest { display: grid; gap: 14px; min-width: 0; grid-area: auto; }
.pp-patient { grid-area: auto; }
@media (max-width: 900px) {
    .pp-layout { grid-template-areas: "patient" "chat" "rest"; }
    .pp-side { display: contents; }
    .pp-patient { grid-area: patient; }
    .pp-rest { grid-area: rest; }
}

/* pending appointments on the dashboard */
.ib-row--appt { grid-template-columns: 76px minmax(0, 1fr) auto auto auto; }
.ib-appt { display: grid; gap: 4px; min-width: 0; }
.ib-appt__when { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .92rem; }
.ib-appt__when .ico { width: 17px; height: 17px; stroke: var(--accent); }
.ib-appt__meta { display: flex; gap: 8px; align-items: center; min-width: 0; }
.ib-row--appt .btn .ico { width: 15px; height: 15px; }
@media (max-width: 720px) { .ib-row--appt { grid-template-columns: 60px minmax(0, 1fr); } }

/* patients list */
.pt-name { color: var(--ink); } .pt-name:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.pt-meta { margin: 4px 0 0; display: flex; gap: 8px 18px; flex-wrap: wrap; font-size: .86rem; color: var(--ink-2); }
.pt-meta__i { display: inline-flex; align-items: center; gap: 7px; }
.pt-meta__i .hd__ico { width: 26px; height: 26px; border-radius: 12px; } .pt-meta__i .ico { width: 15px; height: 15px; }

/* Health file: seven expandable sections, each with a faint icon in the background */
.hx-list { display: grid; gap: 12px; }
.hx { position: relative; overflow: hidden; background: #fff; border-radius: 12px; box-shadow: 0 0 0 1px var(--sky-line), 0 14px 30px -26px rgba(10, 80, 130, .35); transition: box-shadow .3s; }
.hx[open] { box-shadow: 0 0 0 1px #b9d9f0, 0 20px 40px -26px rgba(10, 80, 130, .45); }
.hx__bg { position: absolute; inset-inline-end: -14px; top: 50%; transform: translateY(-50%) rotate(-12deg); width: 150px; height: 150px; color: var(--tone, #0a78c2); opacity: .07; pointer-events: none; transition: opacity .4s, transform .5s var(--spring); }
.hx[open] .hx__bg { opacity: .1; transform: translateY(-50%) rotate(-6deg) scale(1.08); }
.hx__bg .ico { width: 100%; height: 100%; stroke-width: 1.1; }
.hx--rose { --tone: #d6204f; } .hx--amber { --tone: #b86e00; } .hx--blue { --tone: #0a78c2; } .hx--violet { --tone: #5b3df5; } .hx--green { --tone: #0f8a63; } .hx--teal { --tone: #0c8f9c; }
.hx > summary { position: relative; list-style: none; cursor: pointer; display: flex; align-items: center; gap: 16px; padding: 16px 22px; }
.hx > summary::-webkit-details-marker { display: none; }
.hx__title { display: grid; flex: 1; line-height: 1.55; } .hx__title b { font-size: 1.08rem; } .hx__title small { color: var(--ink-3); }
.hx__chev { color: var(--ink-3); font-size: 1.4rem; transition: transform .35s var(--spring); }
.hx[open] .hx__chev { transform: rotate(180deg); }
.hx__body { position: relative; display: grid; gap: 12px; padding: 0 22px 20px; animation: hx-in .35s var(--spring); }
@keyframes hx-in { from { opacity: 0; transform: translateY(-8px); } }
.hx__items { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hx__items li { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--tone) 7%, #fff); }
.hx__items li p { margin: 2px 0 0; color: var(--ink-2); font-size: .88rem; }
.hx__items time { color: var(--ink-3); font-size: .8rem; white-space: nowrap; }
.hx__items form { margin: 0; }
.hx__del { border: 0; background: transparent; cursor: pointer; color: var(--ink-3); width: 28px; height: 28px; border-radius: 12px; font-size: .9rem; }
.hx__del:hover { background: #ffe4ec; color: #b3123f; }
.hx__form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 12px; border-radius: 12px; background: var(--sky-bg); }
.hx__form .field { flex: 1 1 150px; } .hx__form .input { padding: 8px 12px; border-radius: 12px; }
.hx__form--add .input { flex: 1 1 160px; width: auto; }
.hx__big { font-size: 1.5rem !important; color: var(--tone); }
@media (max-width: 700px) { .hx > summary { padding: 14px 16px; } .hx__body { padding: 0 16px 16px; } .hx__bg { width: 110px; height: 110px; } }

/* Chat: pinned-looking (but not pin-styled) files strip + modal */
.cx-files { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: #fff; padding: 8px 16px; cursor: pointer; font: inherit; text-align: start; border-bottom: 1px solid var(--sky-line); transition: background .2s; }
.cx-files:hover { background: var(--sky-bg); }
.cx-files .hd__ico { width: 34px; height: 34px; border-radius: 12px; } .cx-files .ico { width: 18px; height: 18px; }
.cx-files__txt { display: grid; line-height: 1.45; flex: 1; min-width: 0; } .cx-files__txt b { font-size: .88rem; } .cx-files__txt small { color: var(--ink-3); font-size: .76rem; }
.cx-files__thumbs { display: flex; } .cx-files__thumbs img { width: 30px; height: 30px; border-radius: 12px; object-fit: cover; box-shadow: 0 0 0 2px #fff; margin-inline-start: -8px; }
.cx-files__go { color: var(--ink-3); font-size: 1.3rem; }
.dlg--wide { width: min(860px, calc(100% - 28px)); max-height: calc(100dvh - 40px); }
.dlg__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.files-card { display: grid; gap: 8px; padding: 10px; border-radius: 12px; background: var(--sky-bg); box-shadow: inset 0 0 0 1px var(--sky-line); align-content: start; }
.files-card__img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; display: block; }
.files-card__voice { display: grid; gap: 8px; justify-items: start; } .files-card__voice audio { width: 100%; height: 38px; }
.files-card__meta { display: grid; line-height: 1.5; } .files-card__meta b { font-size: .88rem; } .files-card__meta small { color: var(--ink-3); font-size: .76rem; }

/* Payment bar: slider with minimal ticks, past-payments toggle at the far end, collapsible list */
.pay-req { padding: 8px 14px; gap: 8px 12px; }
.pay-req__slider { flex: 1 1 200px; min-width: 150px; display: grid; gap: 1px; }
.pay-req__ticks { display: flex; justify-content: space-between; font-size: .62rem; color: var(--ink-3); line-height: 1; padding-inline: 2px; }
.pay-req__hist { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 6px; border: 0; background: #fff; box-shadow: inset 0 0 0 1px var(--sky-line); border-radius: 12px; padding: 5px 12px; font: inherit; font-size: .8rem; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; transition: background .2s, color .2s; }
.pay-req__hist:hover { background: var(--accent-soft); color: var(--accent-ink); }
.pay-req__chev { transition: transform .35s var(--spring); display: inline-block; }
.pay-req__hist[aria-expanded="true"] .pay-req__chev { transform: rotate(180deg); }
.pay-hist { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .4s var(--spring); background: var(--sky-bg); }
.pay-hist.is-open { grid-template-rows: 1fr; border-top: 1px solid var(--sky-line); }
.pay-hist__in { overflow: hidden; min-height: 0; display: grid; gap: 8px; padding: 0 16px; }
.pay-hist.is-open .pay-hist__in { padding-block: 12px; max-height: 260px; overflow-y: auto; }

/* ===== Patient profile: four equal panels (desktop 2x2, phones: accordion) ===== */
.pp4 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "chat info" "course meds"; gap: 16px; align-items: stretch; }
.pp-panel--chat { grid-area: chat; } .pp-panel--info { grid-area: info; } .pp-panel--course { grid-area: course; } .pp-panel--meds { grid-area: meds; }
.pp-panel { display: flex; flex-direction: column; min-width: 0; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--sky-line, #d7e6ee), 0 12px 30px -22px rgba(18, 52, 70, .3); overflow: hidden; }
.pp-panel__head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 14px 18px; border: 0; background: transparent; font: inherit; text-align: start; cursor: default; border-bottom: 1px solid var(--sky-line, #d7e6ee); }
.pp-panel__title { font-weight: 800; font-size: 1.02rem; flex: 1; min-width: 0; }
.pp-panel__chev { display: none; transition: transform .3s var(--spring, ease); font-size: 1.2rem; color: var(--ink-2); }
.pp-panel__body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pp-panel__in { flex: 1; min-height: 0; padding: 16px 18px; display: grid; gap: 12px; align-content: start; overflow: hidden auto; }
.pp-panel--chat .pp-panel__in { padding: 0; display: flex; flex-direction: column; align-content: stretch; }
.pp-panel--chat .dp-chat { flex: 1; box-shadow: none; border-radius: 0; }
.pp-panel--chat .dp-chat .cx-thread { height: 340px; }
.pp-empty { padding: 8px 0; display: grid; gap: 10px; justify-items: start; }
.pp-empty p { margin: 0; }
.pp-rule { border: 0; border-top: 1px solid var(--sky-line, #d7e6ee); margin: 4px 0; width: 100%; }
.pp-info { gap: 12px; }
.pp-info .cx-person { flex-wrap: wrap; }
.pp-info .cx-person > div { flex: 1; min-width: 0; }
.mi--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mi--3 .mi__cell { grid-template-columns: 1fr; text-align: center; justify-items: center; row-gap: 2px; padding: 10px 6px; }
.mi--3 .mi__cell small, .mi--3 .mi__cell b { grid-column: 1; }
.mi--3 .mi__cell .mi__ico { grid-row: auto; }
.mi__cell--teal { --tone: #0c8f9c; --tone-bg: #def5f7; }
.mi--3 .mi__cell b { font-size: .88rem; overflow-wrap: anywhere; }
.pp-recs--col { grid-template-columns: 1fr; }
.sum { display: grid; gap: 8px; }
.sum__item { border-radius: 12px; background: #f6fafc; box-shadow: inset 0 0 0 1px var(--sky-line, #d7e6ee); overflow: hidden; }
.sum__head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: transparent; font: inherit; cursor: pointer; text-align: start; }
.sum__head b { flex: 1; font-size: .94rem; }
.sum__chev { transition: transform .3s var(--spring, ease); color: var(--ink-2); }
.sum__item.is-open .sum__chev, .pp-panel.is-open .pp-panel__chev { transform: rotate(180deg); }
.sum__count { min-width: 22px; padding: 1px 7px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); font-size: .76rem; font-weight: 800; text-align: center; }
.sum__body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s var(--spring, ease); }
.sum__item.is-open .sum__body { grid-template-rows: 1fr; }
.sum__in { overflow: hidden; min-height: 0; padding: 0 14px; display: grid; gap: 8px; }
.sum__item.is-open .sum__in { padding-block: 4px 14px; }
.sum__meta { margin: 0; display: flex; gap: 6px; align-items: center; font-size: .8rem; color: var(--ink-2); flex-wrap: wrap; }
.sum__meta .ico { width: 14px; height: 14px; }
.sum__line { padding: 8px 12px; border-radius: 12px; background: #fff; border-inline-start: 3px solid var(--c, #0a78c2); }
.sum__line small { color: var(--ink-2); font-size: .74rem; } .sum__line p { margin: 2px 0 0; font-size: .9rem; white-space: pre-line; overflow-wrap: anywhere; }
.sum__line--blue { --c: #0a78c2; } .sum__line--amber { --c: #d98a00; } .sum__line--green { --c: #0f8a63; }
.med-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.med-list li { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: #fff8e8; }
.med-list li div { display: grid; line-height: 1.5; min-width: 0; } .med-list p { margin: 0; font-size: .86rem; }

@media (max-width: 900px) {
    .pp4 { grid-template-columns: 1fr; grid-template-areas: "chat" "info" "course" "meds"; gap: 12px; }
    .pp-panel__head { cursor: pointer; border-bottom: 0; }
    .pp-panel__chev { display: block; }
    .pp-panel.is-open .pp-panel__head { border-bottom: 1px solid var(--sky-line, #d7e6ee); }
    .pp-panel__body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .4s var(--spring, ease); }
    .pp-panel.is-open .pp-panel__body { grid-template-rows: 1fr; }
    .pp-panel__body > .pp-panel__in { min-height: 0; overflow: hidden; padding-block: 0; }
    .pp-panel.is-open .pp-panel__body > .pp-panel__in { padding-block: 16px; overflow: hidden auto; }
    .pp-panel--chat.is-open .pp-panel__body > .pp-panel__in { padding-block: 0; }
    .pp-panel__body { visibility: hidden; transition: grid-template-rows .4s var(--spring, ease), visibility 0s .4s; }
    .pp-panel.is-open .pp-panel__body { visibility: visible; transition: grid-template-rows .4s var(--spring, ease), visibility 0s; }
    .mi--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* phones: the pill's backdrop-filter would trap the fixed bottom menu inside it, hiding the guest login button */
@media (max-width: 900px) {
    .topbar, .topbar__in { backdrop-filter: none; -webkit-backdrop-filter: none; }
    .topbar__in { background: rgba(255, 255, 255, .96); }
    .nav { z-index: 40; }
    .topbar__in .btn, .topbar__in .nav__guest { position: relative; z-index: 41; }
}

/* two independent columns: equal widths, heights follow content (no empty gaps) */
.pp4 { grid-template-areas: none; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.pp4__col { display: grid; gap: 16px; min-width: 0; align-content: start; }
.pp-panel--chat, .pp-panel--info, .pp-panel--course, .pp-panel--meds { grid-area: auto; }
.pp-panel { display: block; }
.pp-panel--chat .dp-chat .cx-thread { height: 340px; }
@media (max-width: 900px) {
    .pp4 { grid-template-columns: 1fr; gap: 12px; }
    .pp4__col { display: contents; }
    .pp-panel--chat { order: 1; } .pp-panel--info { order: 2; } .pp-panel--course { order: 3; } .pp-panel--meds { order: 4; }
}

/* ===== round 3: Telegram-like chat, tags, quick edit, mobile shell ===== */
.cx-thread, .theme-sky .cx-thread { overscroll-behavior: auto; padding: 14px 16px; gap: 3px; }
.dp-chat .cx-thread { height: 400px; }
.pp-panel--chat { border-radius: 12px; overflow: hidden; }
.pp-panel--chat > .pp-chatbody { padding: 0; display: block; overflow: visible; }
.pp-panel--chat .dp-card { box-shadow: none; border-radius: 0; margin: 0; }

.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--sky-line, #d7e6ee); background: #fff; position: sticky; top: 0; z-index: 3; }
.chat-head__st { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .88rem; color: var(--ink-2); }
.chat-head__st i { width: 10px; height: 10px; border-radius: 50%; background: #aab8c2; box-shadow: 0 0 0 3px #e7edf1; }
.chat-head__st.is-on { color: #0f8a63; }
.chat-head__st.is-on i { background: #1fc47f; box-shadow: 0 0 0 3px #d4f5e5, 0 0 10px 1px #1fc47f; animation: pulse-dot 2.4s ease-in-out infinite; }
@keyframes pulse-dot { 50% { box-shadow: 0 0 0 5px #d4f5e5, 0 0 12px 2px #1fc47f; } }
.chat-head__acts { display: inline-flex; gap: 8px; }
.chat-head__btn { width: 38px; height: 38px; border-radius: 12px; border: 0; display: grid; place-items: center; background: var(--tone-bg); color: var(--tone); cursor: pointer; transition: transform .2s var(--spring, ease), filter .2s; }
.chat-head__btn:hover { transform: translateY(-2px); filter: brightness(.96); color: var(--tone); }
.chat-head__btn:active { transform: scale(.94); }
.chat-head__btn .ico { width: 20px; height: 20px; }
.chat-head__btn--green { --tone: #0f8a63; --tone-bg: #e2f6ee; } .chat-head__btn--blue { --tone: #0a78c2; --tone-bg: #e5f2fc; } .chat-head__btn--amber { --tone: #b86e00; --tone-bg: #fff3d9; } .chat-head__btn--violet { --tone: #5b3df5; --tone-bg: #efebff; }

/* bubbles */
.tg { position: relative; max-width: min(80%, 440px); padding: 6px 11px 5px; border-radius: 12px; background: #fff; box-shadow: 0 1px 1.5px rgba(18, 52, 70, .16); font-size: .95rem; line-height: 1.75; margin-bottom: 4px; }
.tg--me { align-self: flex-start; background: #dff0fc; border-end-end-radius: 12px; }
.tg--them { align-self: flex-end; border-end-start-radius: 12px; }
.tg__txt { overflow-wrap: anywhere; white-space: pre-wrap; }
.tg__txt::after { content: ""; display: block; clear: both; }
.tg__meta { float: inline-end; display: inline-flex; align-items: center; gap: 4px; margin-inline-start: 12px; margin-top: 7px; font-size: .68rem; color: #7d93a3; line-height: 1; white-space: nowrap; }
.tg__tick { font-style: normal; color: #8fa5b4; letter-spacing: -.35em; font-size: .78rem; }
.tg__tick--read { color: #2f9be0; }
.tg__img { display: block; margin: 0 -5px 3px; border-radius: 12px; overflow: hidden; }
.tg__img img { display: block; width: 100%; max-width: 280px; max-height: 320px; object-fit: cover; }
.tg__txt--bare { position: absolute; inset-block-end: 11px; inset-inline-end: 16px; padding: 3px 8px; border-radius: 12px; background: rgba(15, 30, 40, .5); }
.tg__txt--bare .tg__meta, .tg__txt--bare .tg__tick { margin: 0; color: #fff; }
.tg__txt--bare .tg__tick--read { color: #9fe0ff; }
.tg__voice { display: flex; align-items: center; gap: 8px; }
.tg__voice audio { width: 230px; max-width: 100%; height: 38px; }
.tg__voice small { color: #7d93a3; }
.cx-day { position: sticky; top: 4px; z-index: 1; margin: 8px 0 6px; }
.cx-day span { background: rgba(255, 255, 255, .92); box-shadow: 0 1px 2px rgba(18, 52, 70, .12); }
.cx-empty-thread { margin: auto; text-align: center; }

/* composer */
.cx-composer, .theme-sky .cx-composer { padding: 8px 10px; border-top: 0; background: #fff; }
.tgbar { display: flex; align-items: flex-end; gap: 6px; }
.tgbar .cx-input, .theme-sky .tgbar .cx-input { flex: 1; min-width: 0; border-radius: 12px; background: #f0f4f7; border: 0; padding: 10px 16px; min-height: 42px; }
.tgbar .cx-tool { width: 42px; height: 42px; background: transparent; }
.tgbar .cx-tool svg { stroke: #7d93a3; }
.tgbar .cx-tool:hover svg { stroke: var(--accent); }
.tgbar .cx-sendbtn { display: none; width: 42px; height: 42px; place-items: center; }
.cx-composer.has-text .cx-sendbtn { display: grid; }
.cx-composer.has-text .cx-mic { display: none; }
.cx-sendbtn svg { transform: scaleX(-1); }

/* payment row: one line on desktop */
.pay-req { flex-wrap: nowrap; }
.pay-req__slider { flex: 1 1 auto; min-width: 150px; }
.pay-req__go { flex: none; }
.pay-req__hist { margin-inline-start: 0; flex: none; }
.pay-req__ticks span { transition: color .2s; }
.pay-req__ticks span.is-on { color: var(--accent-ink); font-weight: 800; }
@media (max-width: 900px) { .pay-req { flex-wrap: wrap; } .pay-req__slider { flex-basis: 100%; order: -1; } }

/* identity header + tags */
.pp-person { gap: 12px; }
.pp-person .avatar { width: 46px; height: 46px; border-radius: 12px; object-fit: cover; flex: none; }
.pp-person__txt { display: grid; line-height: 1.5; flex: 1; min-width: 0; }
.pp-person__txt b { font-size: 1.02rem; }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border-radius: 12px; background: var(--tone-bg); font-size: .8rem; line-height: 1.4; }
.tag small { color: var(--ink-2); font-size: .72rem; }
.tag b { font-weight: 700; color: var(--ink); }
.tag__ico { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--tone); flex: none; }
.tag__ico .ico { width: 13px; height: 13px; }
.tag--blue { --tone: #0a78c2; --tone-bg: #e5f2fc; } .tag--rose { --tone: #d6204f; --tone-bg: #ffe9ef; } .tag--violet { --tone: #5b3df5; --tone-bg: #efebff; }
.tag--green { --tone: #0f8a63; --tone-bg: #e2f6ee; } .tag--amber { --tone: #b86e00; --tone-bg: #fff3d9; } .tag--teal { --tone: #0c8f9c; --tone-bg: #def5f7; }

.status-box { display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: #fff8e8; box-shadow: inset 0 0 0 1px #f4e3b8; }
.status-box label { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: .9rem; color: #8a5a07; }
.status-box label .ico { width: 18px; height: 18px; }
.status-box textarea { background: #fff; resize: vertical; min-height: 96px; }
.status-box__foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* quick edit */
.pp-rec { position: relative; }
.pp-rec__edit { opacity: 0; transition: opacity .2s; width: 30px; height: 30px; border-radius: 12px; border: 0; background: var(--accent-soft); color: var(--accent-ink); cursor: pointer; display: grid; place-items: center; flex: none; }
.pp-rec__edit .ico { width: 16px; height: 16px; }
.pp-rec:hover .pp-rec__edit, .pp-rec__edit:focus-visible { opacity: 1; }
@media (hover: none) { .pp-rec__edit { opacity: 1; } }
.pp-rec__form { display: none; gap: 8px; }
.pp-rec.is-editing .pp-rec__form { display: grid; }
.pp-rec.is-editing .pp-rec__view { display: none; }
.pp-rec__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pp-rec__actions .btn--danger { margin-inline-start: auto; }

/* panels: chat has no accordion; complaints is the last, full-width panel */
.pp-panel__head { text-align: start; }
.pp-panel--complaints { grid-column: 1 / -1; }
.pp-hfile { flex: none; }
.nav .m-only { display: none; }
@media (max-width: 900px) {
    .in-panel .nav .m-only { display: flex; }
    .pp-panel--chat { order: 1; } .pp-panel--complaints { order: 5; }
    .tg { max-width: 86%; }
    .dp-chat .cx-thread { height: 62dvh; max-height: 480px; }
    /* no top bar on phones: the bottom menu carries everything, incl. login / logout */
    .in-panel .topbar, .in-panel .topbar__in { height: 0; min-height: 0; padding: 0; border: 0; background: none; box-shadow: none; overflow: visible; }
    .in-panel .topbar__in > .brand, .in-panel .topbar__in > .topbar__end { display: none; }
    .crumbs { display: none; }
    .wrap.panel { padding-top: 12px; }
}

/* ===== round 4 ===== */
/* header buttons with labels */
.chat-head__acts { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.chat-head__btn { width: auto; height: 36px; padding: 0 12px 0 10px; gap: 6px; display: inline-flex; align-items: center; font: inherit; font-size: .8rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.chat-head__btn .ico { width: 18px; height: 18px; }
@media (max-width: 560px) { .chat-head { padding: 8px 10px; gap: 6px; } .chat-head__btn { padding: 0 9px 0 7px; font-size: .72rem; height: 34px; } .chat-head__btn .ico { width: 16px; height: 16px; } .chat-head__st { font-size: .78rem; } }

/* Telegram-style composer: input pill with the paperclip inside + one round mic / send button */
.cx-composer, .theme-sky .cx-composer { padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); background: #e9f0f5; }
.tgbar { align-items: flex-end; gap: 8px; }
.tgbar__pill { flex: 1; min-width: 0; display: flex; align-items: flex-end; background: #fff; border-radius: 12px; padding-inline: 4px 2px; box-shadow: 0 1px 2px rgba(18, 52, 70, .12); }
.tgbar__pill .cx-input, .theme-sky .tgbar__pill .cx-input { flex: 1; background: transparent; box-shadow: none; border: 0; border-radius: 0; padding: 11px 12px; min-height: 44px; max-height: 130px; outline: none; }
.tgbar__pill .cx-tool { width: 44px; height: 44px; flex: none; }
.tgbar .cx-sendbtn { display: grid; width: 46px; height: 46px; flex: none; place-items: center; background: var(--accent); }
.tgbar .cx-sendbtn svg { transform: none; stroke: #fff; width: 22px; height: 22px; }
.tgbar .cx-go { display: none; }
.tgbar .cx-go svg { transform: scaleX(-1); }
.cx-composer.has-text .cx-go { display: grid; }
.cx-composer.has-text .cx-mic { display: none; }
.cx-composer.cx-composer--off .cx-sendbtn { background: #9db8cc; }

/* doctor's patient label */
.ptag { display: inline-flex; align-items: center; gap: 6px; flex: none; border: 1px dashed #b9cbd8; background: #fff; color: var(--ink-3); border-radius: 12px; padding: 5px 12px 5px 10px; font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; transition: transform .2s, background .2s; }
.ptag .ico { width: 14px; height: 14px; }
.ptag:hover { background: var(--accent-soft); color: var(--accent-ink); }
.ptag--on { border-style: solid; border-color: transparent; background: #e5f2fc; color: #0a78c2; }
.ptag--rose { background: #ffe9ef; color: #d6204f; } .ptag--amber { background: #fff3d9; color: #b86e00; } .ptag--teal { background: #def5f7; color: #0c8f9c; } .ptag--violet { background: #efebff; color: #5b3df5; }
.tag-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-pick__opt { border: 0; border-radius: 12px; padding: 8px 16px; background: #eef4f8; font: inherit; font-weight: 700; font-size: .88rem; cursor: pointer; }
.tag-pick__opt:hover, .tag-pick__opt.is-on { background: var(--accent); color: #fff; }

/* phones: past-payments button on the left; the chat header stays fixed while scrolling the page */
@media (max-width: 900px) {
    .pay-req__hist { margin-inline-start: auto; }
    .fab-health { display: none !important; }
    .pp-panel--chat { display: contents; }
    .pp-panel--chat .chat-head { order: 1; position: sticky; top: 0; z-index: 30; border-radius: 12px; box-shadow: 0 6px 16px -10px rgba(18, 52, 70, .5); margin-bottom: -12px; }
    .pp-panel--chat > .pp-chatbody { order: 1; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--sky-line, #d7e6ee); }
    .pp-panel--chat .dp-chat { border-radius: 0; }
    .pp4 { padding-top: 0; }
}

/* round 5: multiple doctor labels */
.ptags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ptags .ptag { position: relative; border-style: solid; border-color: transparent; padding: 3px 10px; gap: 4px; font-size: .74rem; cursor: default; }
.ptag--blue { background: #e5f2fc; color: #0a78c2; }
.ptags .ptag--add { background: #fff; border: 1px dashed #b9cbd8; color: var(--ink-3); padding: 3px 8px; cursor: pointer; }
.ptags .ptag--add:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.ptag--add svg, .ptag__del svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ptag__del { display: none; border: 0; background: transparent; color: inherit; padding: 0; margin-inline-start: 2px; cursor: pointer; line-height: 0; }
.ptag__del:hover { color: #d6204f; }
.ptags .ptag:hover .ptag__del, .ptags .ptag:focus-within .ptag__del { display: inline-flex; }
@media (hover: none) { .ptags .ptag .ptag__del { display: inline-flex; } }
.tag-custom { display: flex; gap: 8px; }
.tag-custom .input { flex: 1; }
.tag-pick__opt[hidden] { display: none; }

/* login / register: one minimal centered card */
.auth--solo, .auth { display: grid; grid-template-columns: 1fr; place-items: center; min-height: calc(100dvh - 140px); padding: 32px 16px; background: none; }
.auth__art { display: none !important; }
.auth__card, .auth .auth__panel { width: min(100%, 400px); max-width: 400px; margin: 0 auto; padding: 32px 28px; border-radius: 12px; background: #fff; box-shadow: 0 0 0 1px rgba(15, 107, 138, .08), 0 30px 60px -34px rgba(18, 52, 70, .35); display: grid; gap: 18px; }
.auth__brand { display: inline-flex; align-items: center; gap: 8px; justify-self: center; font-weight: 800; font-size: 1.05rem; color: var(--ink); }
.auth__card h1 { margin: 0; text-align: center; font-size: 1.5rem; letter-spacing: -.01em; }
.auth__card .form { display: grid; gap: 14px; }
.auth__card .btn { width: 100%; justify-content: center; }
.auth__alt { margin: 0; text-align: center; font-size: .9rem; color: var(--ink-3); }
.auth__demo { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; padding-top: 14px; border-top: 1px solid var(--line); font-size: .8rem; }
.auth__demo button { border: 0; border-radius: 12px; padding: 4px 12px; background: #eef4f8; font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; transition: background .2s; }
.auth__demo button:hover { background: var(--accent-soft); color: var(--accent-ink); }
@media (max-width: 900px) { .auth--solo, .auth { padding: 20px 14px 40px; min-height: 0; } .auth__card, .auth .auth__panel { padding: 26px 20px; } }

/* login / register: no navigation bar at all */
.page-auth .topbar { display: none; }
.page-auth { padding-bottom: 0; }
.page-auth .auth, .page-auth .auth--solo { min-height: calc(100dvh - 70px); }
.page-auth .foot { padding-bottom: 20px; }

/* round 6: labels on the name row (left end); softer, lighter info tags */
.pp-person .ptags { margin: 0; justify-content: flex-end; flex: 0 1 auto; max-width: 60%; }
@media (max-width: 560px) { .pp-person { flex-wrap: wrap; } .pp-person .ptags { max-width: 100%; flex-basis: 100%; justify-content: flex-start; } }
.tag { background: color-mix(in srgb, var(--tone-bg) 45%, #fff); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 14%, transparent); }
.tag__ico { background: var(--tone-bg); }
.tag b { color: #1b2b36; }
.tag small { color: #6b7f8d; }

/* ===== round 7: label-less chips on the name row, call bar + call screen ===== */
.pp-person__txt { flex: none; }
.pp-chips { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pp-chips .ptags { display: contents; }
.pp-person .pp-chips .ptags { max-width: none; }
.pp-chips .tag { padding: 3px 10px 3px 5px; font-size: .78rem; }
.pp-chips .tag__ico { width: 20px; height: 20px; }
@media (max-width: 560px) { .pp-chips { flex-basis: 100%; } }

.cx-callbar { padding: 8px 14px; border-top: 1px solid var(--sky-line, #d7e6ee); background: #f6fafc; }
.cx-callbar:has(.cx-callbar__in:empty) { display: none; }
.cx-callbar__in { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.cx-callbar__ask { display: inline-flex; gap: 8px; margin-inline-start: auto; }
.cx-callbar__note { font-size: .84rem; color: var(--ink-2); }
.cx-callbar__txt { display: grid; line-height: 1.5; flex: 1 1 180px; min-width: 0; font-size: .9rem; }
.cx-callbar__txt small { color: var(--ink-3); font-size: .76rem; }
.cx-callbar__ring b { animation: ring-blink 1s ease-in-out infinite; color: #0f8a63; }
@keyframes ring-blink { 50% { opacity: .35; } }
.cx-callbtn { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 12px; padding: 6px 14px 6px 10px; background: #fff; box-shadow: inset 0 0 0 1px var(--sky-line, #d7e6ee); font: inherit; font-size: .82rem; font-weight: 700; color: var(--ink-2); cursor: pointer; transition: background .2s, color .2s; }
.cx-callbtn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cx-callbtn:hover { background: var(--accent-soft); color: var(--accent-ink); }
.btn--ok { background: #1fa971; color: #fff; } .btn--ok:hover { background: #178a5c; color: #fff; }
.cx-callbar .pay-req__slider { flex: 1 1 200px; min-width: 150px; display: grid; gap: 1px; }

.call-ov { position: fixed; inset: 0; z-index: 100; background: #0d1b26; color: #fff; display: grid; place-items: center; }
.call-ov__remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #0d1b26; }
.call-ov__local { position: absolute; inset-block-end: 110px; inset-inline-start: 16px; width: 120px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; background: #1b2f3f; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); transform: scaleX(-1); }
.call-ov__voice { position: relative; display: grid; justify-items: center; gap: 14px; }
.call-ov__pulse { width: 110px; height: 110px; border-radius: 50%; display: grid; place-items: center; background: #1fa971; animation: call-pulse 1.8s ease-out infinite; }
.call-ov__pulse svg { width: 48px; height: 48px; fill: none; stroke: #fff; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
@keyframes call-pulse { 0% { box-shadow: 0 0 0 0 rgba(31, 169, 113, .55); } 100% { box-shadow: 0 0 0 38px rgba(31, 169, 113, 0); } }
.call-ov__top { position: absolute; inset-block-start: 0; inset-inline: 0; padding: 18px 20px; display: flex; justify-content: space-between; background: rgba(0, 0, 0, .55); font-size: .95rem; }
.call-ov__ctl { position: absolute; inset-block-end: 0; inset-inline: 0; padding: 20px 20px calc(24px + env(safe-area-inset-bottom, 0px)); display: flex; justify-content: center; gap: 18px; background: rgba(0, 0, 0, .6); }
.call-ctl { width: 56px; height: 56px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .16); color: #fff; display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(6px); transition: transform .2s, background .2s; }
.call-ctl:hover { background: rgba(255, 255, 255, .28); } .call-ctl:active { transform: scale(.92); }
.call-ctl svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.call-ctl.is-off { background: #fff; color: #0d1b26; }
.call-ctl--end { background: #e0314b; } .call-ctl--end:hover { background: #c2253d; } .call-ctl--end svg { transform: rotate(135deg); }

/* round 8: call box as a visible card */
.cx-callbar { margin: 10px 14px; padding: 12px 14px; border-radius: 12px; border: 0; background: #fff; box-shadow: inset 0 0 0 1px #cfe9dd, 0 8px 20px -16px rgba(15, 138, 99, .5); position: relative; z-index: 2; }
.cx-callbar::before { content: ""; position: absolute; inset-block: 10px; inset-inline-start: 0; width: 3px; border-radius: 3px; background: #1fa971; }
.cx-callbar__in { flex-wrap: wrap; gap: 10px 12px; }
.cx-callbar__ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #e2f6ee; color: #0f8a63; flex: none; }
.cx-callbar__ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cx-callbar--off { display: flex; align-items: center; gap: 12px; opacity: .75; }
.cx-callbar--off::before { background: #b9c8d2; } .cx-callbar--off .cx-callbar__ico { background: #eef2f5; color: #7d93a3; }
.cx-callbar__txt b { font-size: .95rem; }
.cx-callbtn { padding: 9px 16px 9px 12px; font-size: .88rem; background: #f1faf6; box-shadow: inset 0 0 0 1px #cfe9dd; color: #0f6e4e; }
.cx-callbtn:hover { background: #1fa971; color: #fff; }
@media (max-width: 560px) { .cx-callbar__ask { width: 100%; } .cx-callbar__ask .cx-callbtn { flex: 1; justify-content: center; } }

/* round 9: toasts (top-left) + call tap-to-hear */
.toasts { position: fixed; top: 14px; left: 14px; z-index: 120; display: grid; gap: 10px; width: min(360px, calc(100vw - 28px)); pointer-events: none; direction: rtl; }
.toast { position: relative; pointer-events: auto; display: flex; align-items: flex-start; gap: 12px; padding: 12px 12px 14px 14px; border-radius: 12px; background: rgba(255, 255, 255, .97); box-shadow: 0 0 0 1px rgba(15, 107, 138, .1), 0 18px 40px -16px rgba(18, 52, 70, .45); overflow: hidden; opacity: 0; transform: translateX(-24px) scale(.97); transition: opacity .28s var(--spring, ease), transform .28s var(--spring, ease); }
.toast.is-in { opacity: 1; transform: none; }
.toast__ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--tb); color: var(--tc); }
.toast__ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.toast__txt { flex: 1; min-width: 0; display: grid; gap: 1px; color: var(--ink); text-decoration: none; line-height: 1.55; }
.toast__txt b { font-size: .92rem; }
.toast__txt span { font-size: .84rem; color: var(--ink-2); overflow-wrap: anywhere; }
.toast__txt small { font-size: .7rem; color: var(--ink-3); }
.toast__x { border: 0; background: transparent; color: var(--ink-3); cursor: pointer; font-size: .9rem; padding: 2px 4px; border-radius: 12px; }
.toast__x:hover { background: #eef2f5; color: var(--ink); }
.toast__bar { position: absolute; inset-inline: 0; bottom: 0; height: 3px; background: var(--tc); opacity: .55; transform-origin: right; }
@keyframes toast-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.toast--blue { --tb: #e5f2fc; --tc: #0a78c2; } .toast--amber { --tb: #fff3d9; --tc: #b86e00; } .toast--green { --tb: #e2f6ee; --tc: #0f8a63; }
.toast--violet { --tb: #efebff; --tc: #5b3df5; } .toast--rose { --tb: #ffe9ef; --tc: #d6204f; }
@media (max-width: 900px) { .toasts { top: 10px; left: 10px; } }
@media (prefers-reduced-motion: reduce) { .toast { transition: opacity .2s; transform: none; } }
.call-ov__tap { position: absolute; inset-block-end: 130px; inset-inline: 0; margin-inline: auto; width: max-content; max-width: 90%; border: 0; border-radius: 12px; padding: 10px 20px; background: #fff; color: #0d1b26; font: inherit; font-weight: 700; cursor: pointer; z-index: 3; }

/* call screen controls: icon + label, slashed icon and white pill when off */
.call-ov__ctl { gap: 14px; flex-wrap: wrap; }
.call-ctl { width: 76px; height: auto; min-height: 72px; border-radius: 12px; padding: 10px 6px 8px; gap: 5px; align-content: center; justify-items: center; font: inherit; }
.call-ctl span { font-size: .7rem; font-weight: 600; line-height: 1.2; text-align: center; }
.call-ctl svg { width: 26px; height: 26px; }
.call-ctl.is-off { background: #fff; color: #0d1b26; }
.call-ctl.is-off svg { color: #d6204f; }
.call-ctl--end { background: #e0314b; } .call-ctl--end svg { transform: none; }
.call-ov__local.is-hidden { opacity: 0; }

/* round 10: icon-only call buttons, identity header (photo+name on top, chips below), one-line sliders on phones */
.cx-callbtn { width: 42px; height: 42px; padding: 0; justify-content: center; border-radius: 12px; }
.cx-callbtn svg { width: 22px; height: 22px; }
.cx-callbar__ask .cx-callbtn { flex: none; }
@media (max-width: 560px) { .cx-callbar__ask { width: auto; } .cx-callbar__ask .cx-callbtn { flex: none; } }

.pp-person { flex-wrap: wrap; row-gap: 10px; align-items: center; }
.pp-person .pp-chips { order: 5; flex: 1 1 100%; justify-content: flex-start; gap: 5px; }
.pp-person .pp-panel__chev { margin-inline-start: auto; }
.pp-chips .tag { font-size: .72rem; padding: 2px 8px 2px 4px; gap: 4px; }
.pp-chips .tag__ico { width: 18px; height: 18px; }
.pp-chips .tag__ico .ico { width: 11px; height: 11px; }
.pp-chips .ptags { display: contents; }
.pp-chips .ptag { font-size: .72rem; }
@media (max-width: 560px) { .pp-person .pp-chips { flex-basis: 100%; } }

@media (max-width: 900px) {
    .pay-req { flex-wrap: nowrap; gap: 8px; padding: 8px 10px; }
    .pay-req__slider { flex: 1 1 auto; order: 0; min-width: 90px; }
    .pay-req .btn { padding: 6px 10px; font-size: .78rem; }
    .pay-req__hist { font-size: .72rem; padding: 5px 9px; margin-inline-start: 0; }
    .pay-req__ticks { font-size: .55rem; }
    .cx-callbar__in { flex-wrap: wrap; }
    .cx-callbar .pay-req__slider { flex: 1 1 100px; min-width: 90px; }
    .cx-callbar .btn { padding: 6px 10px; }
}
@media (max-width: 560px) { .cx-callbar__txt { flex-basis: 120px; } .cx-callbar__ask { margin-inline-start: auto; } }

/* round 11: chips live in the (collapsible) body; chat header never wraps */
.pp-panel--info > .pp-panel__head, .pp-panel--info.is-open > .pp-panel__head { border-bottom: 0; }
.pp-info .pp-chips { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding-bottom: 12px; border-bottom: 1px solid var(--sky-line, #d7e6ee); }
.pp-info .pp-chips .ptags { display: contents; }
.chat-head, .chat-head__acts { flex-wrap: nowrap; }
.chat-head__st { flex: none; white-space: nowrap; }
.chat-head__acts { min-width: 0; }
.chat-head__btn { flex: 0 1 auto; min-width: 0; }
@media (max-width: 440px) {
    .chat-head { padding: 8px 8px; gap: 4px; }
    .chat-head__acts { gap: 4px; }
    .chat-head__btn { padding: 0 7px 0 6px; gap: 3px; font-size: .68rem; height: 32px; border-radius: 12px; }
    .chat-head__btn .ico { width: 15px; height: 15px; }
    .chat-head__st { font-size: .72rem; gap: 5px; }
    .chat-head__st i { width: 8px; height: 8px; }
}
@media (max-width: 350px) { .chat-head__btn { padding: 0 5px; } .chat-head__btn .ico { display: none; } }

/* round 12: results panel + report dialog */
.rep-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rep-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; border-radius: 12px; background: #f3fafb; box-shadow: inset 0 0 0 1px #d6eef0; font: inherit; text-align: start; cursor: pointer; transition: background .2s, transform .2s; }
.rep-row:hover { background: #e4f5f7; transform: translateY(-1px); }
.rep-row__txt { flex: 1; min-width: 0; display: grid; line-height: 1.5; }
.rep-row__txt b { font-size: .92rem; } .rep-row__txt small { font-size: .74rem; overflow-wrap: anywhere; }
.rep-scroll { overflow-x: auto; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--sky-line, #d7e6ee); }
.rep-table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 460px; }
.rep-table th { text-align: start; padding: 9px 12px; background: #f3f8fb; font-size: .76rem; color: var(--ink-2); font-weight: 700; }
.rep-table td { padding: 9px 12px; border-top: 1px solid var(--sky-line, #d7e6ee); }
.rep-table tr.is-odd td { background: #fff8e8; }
.rep-table tr.is-odd td:last-child { color: #b86e00; font-weight: 700; }
@media (max-width: 900px) {
    .pp-panel--results { order: 4; } .pp-panel--meds { order: 5; } .pp-panel--complaints { order: 6; }
}


/* round 13: health hub — one full-width card per row, content opens right underneath */
.hl-grid { grid-template-columns: 1fr !important; gap: 12px; }
.hl-item { display: grid; gap: 0; min-width: 0; }
.hl-tile__go { transition: transform .3s var(--spring, ease); }
.hl-tile[aria-expanded="true"] { box-shadow: 0 0 0 1px var(--accent, #0a78c2), 0 14px 30px -20px rgba(10, 120, 194, .5); }
.hl-tile[aria-expanded="true"] .hl-tile__go { transform: rotate(-90deg); }
.hl-pane { height: 0; overflow: hidden; transition: height .4s var(--spring, ease); }
.hl-pane__in { display: grid; gap: 14px; align-content: start; }
.hl-pane.is-open .hl-pane__in { padding: 14px 4px 6px; }
.hl-pane.is-open { margin-bottom: 4px; }
.hl-skel { display: grid; gap: 10px; }
.hl-skel i { height: 54px; border-radius: 12px; background: #eef3f7; background-size: 200% 100%; animation: hl-shimmer 1.2s linear infinite; }
@keyframes hl-shimmer { to { background-position: -200% 0; } }


/* round 14: private notes */
.status-box__priv { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; color: #6b4a00; cursor: pointer; }
.status-box__priv .ico { width: 14px; height: 14px; }
.status-box__foot { flex-wrap: wrap; }
.status-box.is-private { background: #f1edff; box-shadow: inset 0 0 0 1px #d9d0fb; }
.status-box.is-private .status-box__priv { color: #5b3df5; }
.pp-rec--note { background: #faf8ff; box-shadow: inset 0 0 0 1px #e3dcfb; }
@media (max-width: 900px) { .pp-panel--notes { order: 6; } .pp-panel--complaints { order: 7; } }

/* round 15: notes page, articles, access accounts, wallet, tools grid */
.nt-list { display: grid; gap: 12px; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-bottom: 20px; }
.tool-tile { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--sky-line, #d7e6ee); color: var(--ink); text-decoration: none; transition: transform .2s var(--spring, ease), box-shadow .2s; }
.tool-tile:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--accent, #0a78c2), 0 14px 26px -20px rgba(10, 120, 194, .6); }
.tool-tile span:last-child { display: grid; line-height: 1.5; } .tool-tile small { color: var(--ink-3); font-size: .76rem; }
.ar-layout, .ac-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .ar-layout, .ac-layout { grid-template-columns: 1fr; } }
.ar-pub { display: flex; gap: 8px; align-items: center; font-size: .9rem; }
.ar-list, .ac-list { display: grid; gap: 12px; }
.ar-item { display: grid; gap: 6px; } .ar-item__top, .ac-item__top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ar-item p { margin: 0; font-size: .88rem; } .ar-item__acts, .ac-item__acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ar-item__acts form, .ac-item__acts form { margin: 0; }
.ar-pub-list { display: grid; gap: 10px; }
a.ar-pub { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; background: #f3fafb; box-shadow: inset 0 0 0 1px #d6eef0; color: var(--ink); text-decoration: none; }
a.ar-pub:hover { background: #e4f5f7; } a.ar-pub span { font-size: .85rem; color: var(--ink-2); }
.ar-read__body { white-space: pre-line; line-height: 2; font-size: 1.02rem; max-width: 68ch; }
.ac-perms { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.ac-perms legend { font-weight: 700; font-size: .88rem; margin-bottom: 6px; }
.ac-perms label { display: flex; align-items: flex-start; gap: 8px; font-size: .88rem; }
.ac-perms label span { display: grid; } .ac-perms small { color: var(--ink-3); font-size: .76rem; }
.ac-perms--row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.ac-item { display: grid; gap: 12px; } .ac-item.is-off { opacity: .7; }
.ac-item__top small { display: block; }
.ac-pw { display: flex; gap: 6px; } .ac-pw .input { width: 150px; padding: 6px 10px; }
.wl-bal { margin-inline-start: auto; font-size: .9rem; color: var(--ink-2); } .wl-bal b { color: #0f8a63; font-size: 1.05rem; }
.wl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.wl-list li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--sky-line, #d7e6ee); }
.wl-list li div { flex: 1; display: grid; line-height: 1.5; font-size: .9rem; min-width: 0; } .wl-list li div small { font-size: .74rem; }
.wl-in { color: #0f8a63; } .wl-out { color: #d6204f; }
@media (max-width: 900px) { .pp-panel--results { order: 4; } }

/* round 16: compact chat header (call icons live here), call box only while a call is going on */
.chat-head__lead { display: inline-flex; align-items: center; gap: 8px; min-width: 0; flex: none; }
.chat-head__lbl { font-style: normal; }
.chat-head__calls { display: inline-flex; gap: 6px; }
.chat-head__call { width: 34px; height: 34px; border-radius: 50%; border: 0; display: grid; place-items: center; background: #e2f6ee; color: #0f8a63; cursor: pointer; transition: transform .2s var(--spring, ease), background .2s, color .2s; }
.chat-head__call:hover:not(:disabled) { background: #1fa971; color: #fff; transform: translateY(-1px); }
.chat-head__call:active:not(:disabled) { transform: scale(.92); }
.chat-head__call:disabled { opacity: .4; cursor: default; }
.chat-head__call .ico, .chat-head__call svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 560px) {
    .chat-head__lbl { display: none; }
    .chat-head__lead { gap: 6px; }
    .chat-head__calls { gap: 4px; }
    .chat-head__call { width: 30px; height: 30px; }
    .chat-head__call svg { width: 16px; height: 16px; }
}
@media (max-width: 440px) {
    .chat-head { padding: 6px 7px; gap: 3px; }
    .chat-head__acts { gap: 3px; }
    .chat-head__btn { padding: 0 6px 0 5px; gap: 3px; font-size: .64rem; height: 30px; border-radius: 12px; }
    .chat-head__btn .ico { width: 14px; height: 14px; }
}
@media (max-width: 370px) { .chat-head__btn .ico { display: none; } }

/* round 17: access accounts + permission picker */
.ac-card { background: #fff; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--sky-line, #d7e6ee), 0 14px 34px -26px rgba(18, 52, 70, .35); padding: 20px 22px; }
.ac-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 14px; }
.ac-head__txt { flex: 1 1 360px; display: grid; gap: 6px; } .ac-head__txt p { margin: 0; font-size: .86rem; line-height: 1.8; max-width: 70ch; }
.ac-head__acts { display: flex; align-items: center; gap: 14px; }
.ac-count { font-size: .84rem; color: var(--ink-2); } .ac-count b { color: #0f8a63; font-size: 1rem; }
.ac-empty { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 34px 10px; border-radius: 12px; background: #f6fafc; } .ac-empty p { margin: 0; }
.ac-table { border-radius: 12px; box-shadow: inset 0 0 0 1px var(--sky-line, #d7e6ee); overflow: hidden; }
.ac-row { display: grid; grid-template-columns: minmax(180px, 1.2fr) minmax(200px, 1.8fr) 110px 100px auto; gap: 14px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--sky-line, #d7e6ee); transition: background .2s; }
.ac-row:first-child { border-top: 0; } .ac-row:not(.ac-row--head):hover { background: #f7fbfd; }
.ac-row--head { background: #f3f8fb; font-size: .74rem; font-weight: 700; color: var(--ink-2); padding-block: 9px; }
.ac-row.is-off .ac-who, .ac-row.is-off .ac-perms-chips { opacity: .55; }
.ac-who { display: flex; align-items: center; gap: 10px; min-width: 0; } .ac-who span:last-child { display: grid; line-height: 1.5; min-width: 0; } .ac-who small { color: var(--ink-3); font-size: .76rem; }
.ac-av { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: #dbeafe; color: #0a5aa8; font-weight: 800; flex: none; }
.ac-perms-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.ac-perms-chips i { font-style: normal; font-size: .72rem; padding: 2px 9px; border-radius: 12px; background: #eef4f8; color: var(--ink-2); white-space: nowrap; }
.ac-perms-chips .ac-more { background: #e5f2fc; color: #0a78c2; cursor: help; } .ac-perms-chips .ac-none { background: #fff3d9; color: #b86e00; }
.ac-last { display: grid; line-height: 1.5; font-size: .82rem; } .ac-last small { color: var(--ink-3); }
.ac-sw-form { display: flex; align-items: center; gap: 8px; margin: 0; } .ac-sw-form small { font-size: .74rem; color: var(--ink-3); }
.sw { position: relative; width: 40px; height: 23px; border-radius: 12px; border: 0; background: #c4d1da; cursor: pointer; transition: background .25s; flex: none; padding: 0; }
.sw i { position: absolute; top: 3px; inset-inline-start: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .25s var(--spring, ease); }
.sw.is-on { background: #1fa971; } .sw.is-on i { transform: translateX(-17px); }
.ac-acts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 900px) {
    .ac-row { grid-template-columns: 1fr auto; row-gap: 10px; }
    .ac-row--head { display: none; }
    .ac-perms-chips { grid-column: 1 / -1; order: 3; } .ac-last { order: 4; } .ac-acts { grid-column: 1 / -1; order: 6; justify-content: flex-start; }
    .ac-row > span[role="cell"]:nth-child(4) { order: 2; }
}
.ac-new-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } @media (max-width: 700px) { .ac-new-grid { grid-template-columns: 1fr; } }

.pm { display: grid; gap: 18px; }
.pm-group--clinical { background: #f3f4ff; border-radius: 12px; padding: 16px; box-shadow: inset 0 0 0 1px #dfe2fb; display: grid; gap: 12px; }
.pm-group--clinical header { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.pm h4 { margin: 0; font-size: .95rem; display: inline-flex; align-items: center; gap: 8px; color: #2c2f7a; } .pm h4 small { font-weight: 500; color: #5b5fa8; }
.pm h4 .ico { width: 20px; height: 20px; }
.pm-group--general h4 { color: var(--ink); font-size: .88rem; margin-bottom: 10px; }
.pm-tag { font-size: .72rem; font-weight: 700; padding: 3px 11px; border-radius: 12px; background: #dfe2fb; color: #3b3fa0; }
.pm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } @media (max-width: 640px) { .pm-grid { grid-template-columns: 1fr; } }
.pm-card, .pm-row { position: relative; display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 12px; box-shadow: inset 0 0 0 1px #e2e7ee; padding: 12px 14px; cursor: pointer; transition: box-shadow .2s, background .2s; }
.pm-card:hover, .pm-row:hover { box-shadow: inset 0 0 0 1px #9ec9ea; }
.pm-card:has(input:checked), .pm-row:has(input:checked) { box-shadow: inset 0 0 0 1.5px #0a78c2; background: #f6fbff; }
.pm input[type=checkbox] { width: 20px; height: 20px; accent-color: #0a78c2; flex: none; margin: 0; cursor: pointer; }
.pm-card__ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.pm-card__ico .ico { width: 20px; height: 20px; }
.pm-card__txt, .pm-row__txt { display: grid; line-height: 1.5; min-width: 0; flex: 1; } .pm-card__txt b, .pm-row__txt b { font-size: .9rem; }
.pm-card__txt small, .pm-row__txt small { color: var(--ink-3); font-size: .74rem; }
.pm-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } @media (max-width: 640px) { .pm-rows { grid-template-columns: 1fr; } }
.pm-row { padding: 10px 14px; border-radius: 12px; background: #f7f9fb; }
.pm-sens { font-style: normal; color: #d6204f; font-size: .76rem; margin-inline-start: 6px; font-weight: 700; }
.pm-soon { font-style: normal; font-size: .66rem; padding: 1px 8px; border-radius: 12px; background: #eef2f5; color: #6b7f8d; margin-inline-start: 6px; white-space: nowrap; }
.pm-card .pm-soon { position: absolute; top: 8px; inset-inline-end: 10px; margin: 0; }


/* round 18: health hub as one table-like card (no gaps, hairlines between rows, arrow opens the data in place) */
.hl-table { display: block !important; background: #fff; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--sky-line, #d7e6ee), 0 16px 34px -28px rgba(18, 52, 70, .4); overflow: hidden; }
.hl-table .hl-item { display: block; border-top: 1px solid var(--sky-line, #d7e6ee); }
.hl-table .hl-item:first-child { border-top: 0; }
.hl-table .hl-row { border-radius: 0; box-shadow: none; padding: 14px 20px; gap: 14px; min-height: 68px; background: transparent; transform: none; transition: background .2s; }
.hl-table .hl-row:hover { background: #f4f9fd; transform: none; box-shadow: none; }
.hl-table .hl-row .hd__ico { width: 42px; height: 42px; border-radius: 12px; flex: none; }
.hl-table .hl-row .hd__ico .ico { width: 22px; height: 22px; }
.hl-table .hl-tile__body { gap: 2px; } .hl-table .hl-tile__body b { font-size: 1rem; } .hl-table .hl-tile__body small { font-size: .8rem; line-height: 1.6; }
.hl-table .hl-chip { margin: 0; flex: none; white-space: nowrap; }
.hl-table .hl-tile__go { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #eef4f8; color: var(--ink-2); font-size: 1.1rem; flex: none; transition: transform .35s var(--spring, ease), background .2s, color .2s; }
.hl-table .hl-row:hover .hl-tile__go { background: var(--accent-soft); color: var(--accent-ink); }
.hl-table .hl-tile__go.is-page { font-size: 1.4rem; padding-bottom: 3px; }
.hl-table .hl-tile[aria-expanded="true"] { box-shadow: none; background: #f4f9fd; }
.hl-table .hl-tile[aria-expanded="true"] .hl-tile__go { transform: rotate(180deg); background: var(--accent); color: #fff; }
.hl-table .hl-pane { background: #f8fbfd; box-shadow: inset 0 1px 0 var(--sky-line, #d7e6ee); }
.hl-table .hl-pane.is-open .hl-pane__in { padding: 16px 20px 20px; }
@media (max-width: 700px) { .hl-table .hl-row { padding: 12px 14px; gap: 10px; } .hl-table .hl-tile__body small { display: none; } .hl-table .hl-chip { font-size: .7rem; padding: 1px 8px; } .hl-table .hl-pane.is-open .hl-pane__in { padding: 12px 12px 16px; } }
.pm-row__t { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; } .pm-row__t .pm-sens, .pm-row__t .pm-soon { margin: 0; }
/* a single history list opened from the hub: no collapsible card chrome */
.hl-pane__in .hx-list > .hx { box-shadow: none; background: transparent; padding: 0; } .hl-pane__in .hx-list > .hx .hx__bg { display: none; }


/* round 19: login tabs */
.lg-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 12px; background: #eef3f7; }
.lg-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 12px; padding: 9px 6px; background: transparent; font: inherit; font-size: .82rem; font-weight: 700; color: var(--ink-2); cursor: pointer; transition: background .25s, color .25s, box-shadow .25s; white-space: nowrap; }
.lg-tabs button .ico { width: 16px; height: 16px; }
.lg-tabs button.is-active { background: #fff; color: var(--accent-ink); box-shadow: 0 1px 3px rgba(18, 52, 70, .18); }
.lg-roles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lg-roles label { cursor: pointer; } .lg-roles input { position: absolute; opacity: 0; pointer-events: none; }
.lg-roles span { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px; border-radius: 12px; background: #f4f7fa; box-shadow: inset 0 0 0 1px var(--line, #dbe5ec); font-weight: 600; font-size: .9rem; transition: background .2s, box-shadow .2s, color .2s; }
.lg-roles span .ico { width: 18px; height: 18px; }
.lg-roles input:checked + span { background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 0 0 1.5px var(--accent); }
.lg-roles input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.lg-centers { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 14px 4px 6px; } .lg-centers p { margin: 0; font-size: .88rem; line-height: 1.8; }
[hidden] { display: none !important; }


/* round 20: reminders page */
.rm-add { display: grid; gap: 12px; padding: 16px; margin-bottom: 18px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--sky-line, #d7e6ee); }
.rm-add__kinds { display: flex; flex-wrap: wrap; gap: 8px; }
.rm-add__kinds label { cursor: pointer; } .rm-add__kinds input { position: absolute; opacity: 0; pointer-events: none; }
.rm-add__kinds label > span { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border-radius: 12px; background: #f4f7fa; box-shadow: inset 0 0 0 1px var(--line, #dbe5ec); font-size: .84rem; font-weight: 600; transition: background .2s, box-shadow .2s; }
.rm-add__kinds .hd__ico { width: 28px; height: 28px; border-radius: 50%; } .rm-add__kinds .hd__ico .ico { width: 15px; height: 15px; }
.rm-add__kinds input:checked + span { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent-ink); }
.rm-add__kinds input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.rm-add__row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, .8fr) minmax(0, 1fr); gap: 12px; }
@media (max-width: 800px) { .rm-add__row { grid-template-columns: 1fr 1fr; } .rm-add__title { grid-column: 1 / -1; } }
.rm-add .btn { justify-self: start; }
.rm-section { margin-bottom: 22px; } .rm-section h2 { font-size: 1.05rem; margin: 0 0 12px; }
.rm-empty { margin: 0 0 8px; font-size: .88rem; line-height: 1.9; }
.rm-list { list-style: none; margin: 0; padding: 0; background: #fff; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--sky-line, #d7e6ee); overflow: hidden; }
.rm-list:empty { display: none; }
.rm-list li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--sky-line, #d7e6ee); }
.rm-list li:first-child { border-top: 0; } .rm-list li form { margin: 0; }
.rm-list li.is-overdue { background: #fff6f4; } .rm-list li.is-overdue .rm-list__txt small:first-of-type { color: #d6204f; font-weight: 700; }
.rm-list__txt { flex: 1; min-width: 0; display: grid; line-height: 1.6; } .rm-list__txt b { font-size: .95rem; } .rm-list__txt small { font-size: .78rem; color: var(--ink-3); }
.rm-list--done li { opacity: .65; } .rm-list--done b { text-decoration: line-through; }
.rm-list--auto li { background: #f8fbfd; }
.rm-btn { width: 36px; height: 36px; border-radius: 12px; border: 0; display: grid; place-items: center; cursor: pointer; transition: background .2s, transform .2s; }
.rm-btn svg, .rm-btn .ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rm-btn--ok { background: #e2f6ee; color: #0f8a63; } .rm-btn--ok:hover { background: #1fa971; color: #fff; }
.rm-btn--del { background: transparent; color: var(--ink-3); } .rm-btn--del:hover { background: #ffe9ef; color: #d6204f; }
.rm-btn:active { transform: scale(.92); }


/* round 21: patient panel — compact top, appointment cards */
.pp-top__out { display: none; }
.kpis--compact .kpi { padding: 12px 14px; } .kpis--compact .kpi b { font-size: 1.25rem; }
.pp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.pp-btn .ico { width: 18px; height: 18px; }
.ap-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: #eef3f7; margin-bottom: 14px; max-width: 100%; }
.ap-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border-radius: 12px; font-size: .86rem; font-weight: 700; color: var(--ink-2); text-decoration: none; transition: background .2s, color .2s; }
.ap-tabs a b { font-size: .74rem; background: #dde6ed; color: var(--ink-2); border-radius: 12px; padding: 0 7px; min-width: 20px; text-align: center; }
.ap-tabs a.is-active { background: #fff; color: var(--accent-ink); box-shadow: 0 1px 3px rgba(18, 52, 70, .16); } .ap-tabs a.is-active b { background: var(--accent-soft); color: var(--accent-ink); }
.ap-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.ap-card { display: grid; gap: 10px; padding: 14px 16px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--sky-line, #d7e6ee); border-inline-start: 4px solid #0a78c2; }
.ap-card--confirmed { border-inline-start-color: #1fa971; } .ap-card--pending { border-inline-start-color: #e0a100; } .ap-card--completed { border-inline-start-color: #5b3df5; } .ap-card--cancelled { border-inline-start-color: #d6204f; opacity: .85; }
.ap-card header { display: flex; align-items: center; gap: 10px; }
.ap-card__av { width: 42px; height: 42px; border-radius: 12px; object-fit: cover; flex: none; }
.ap-card__doc { flex: 1; min-width: 0; display: grid; line-height: 1.5; } .ap-card__doc a { font-weight: 800; font-size: 1rem; color: var(--ink); text-decoration: none; } .ap-card__doc small { color: var(--ink-3); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-card__when { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: .86rem; color: var(--ink-2); }
.ap-card__when span { display: inline-flex; align-items: center; gap: 5px; } .ap-card__when .ico { width: 15px; height: 15px; color: var(--ink-3); }
.ap-card__note { margin: 0; font-size: .8rem; color: #8a5a07; background: #fff8e8; border-radius: 12px; padding: 6px 10px; } .ap-card__note--bad { color: #a31939; background: #fff0f3; }
.ap-card footer { display: flex; gap: 8px; flex-wrap: wrap; } .ap-card footer form { margin: 0; }

@media (max-width: 900px) {
    .portal-head.pp-top { padding: 12px 14px; gap: 12px; margin-bottom: 14px; align-items: stretch; }
    .pp-top .overline, .pp-top .hello, .pp-top__txt p { display: none; }
    .pp-top__who { display: flex; align-items: center; gap: 12px; width: 100%; }
    .pp-top .avatar--xl { width: 46px; height: 46px; border-radius: 12px; }
    .pp-top__txt h1 { font-size: 1.15rem; margin: 0; }
    .pp-top__out { display: inline-flex; align-items: center; gap: 5px; margin-inline-start: auto; padding: 6px 12px; border-radius: 12px; background: rgba(255, 255, 255, .8); box-shadow: inset 0 0 0 1px var(--line, #dbe5ec); font-size: .76rem; font-weight: 700; color: var(--ink-2); text-decoration: none; }
    .pp-top__out .ico { width: 14px; height: 14px; }
    .pp-top__btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
    .pp-top__btns .pp-btn { padding: 11px 8px; border-radius: 12px; font-size: .86rem; white-space: nowrap; }
    .kpis.kpis--compact { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 18px; }
    .kpis--compact .kpi { padding: 8px 6px; border-radius: 12px; text-align: center; }
    .kpis--compact .kpi b { font-size: .95rem !important; line-height: 1.5 !important; } .kpis--compact .kpi b small { font-size: .6rem; }
    .kpis--compact .kpi span { font-size: .62rem; line-height: 1.4; display: block; }
    .ap-list { grid-template-columns: 1fr; }
    .ap-tabs { display: flex; } .ap-tabs a { flex: 1; justify-content: center; padding-inline: 8px; }
}


/* round 22: doctor calendar */
.cal-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-bar__nav { display: inline-flex; align-items: center; gap: 8px; } .cal-bar__nav b { min-width: 190px; text-align: center; font-size: .92rem; }
.cal-legend { display: inline-flex; align-items: center; gap: 8px; font-size: .76rem; color: var(--ink-2); flex-wrap: wrap; }
.cal-legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; margin-inline-start: 6px; }
.cal-wrap { overflow-x: auto; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--sky-line, #d7e6ee), 0 14px 32px -26px rgba(18, 52, 70, .4); }
.cal { min-width: 860px; --gut: 54px; }
.cal__head { display: grid; grid-template-columns: var(--gut) repeat(7, minmax(0, 1fr)); position: sticky; top: 0; background: #f6fafc; border-bottom: 1px solid var(--sky-line, #d7e6ee); }
.cal__dayhead { position: relative; display: grid; justify-items: center; gap: 1px; padding: 9px 4px; border-inline-start: 1px solid var(--sky-line, #d7e6ee); line-height: 1.4; }
.cal__dayhead b { font-size: .86rem; } .cal__dayhead small { font-size: .72rem; color: var(--ink-3); }
.cal__dayhead.is-today { background: #e7f3fc; } .cal__dayhead.is-today b { color: #0a78c2; }
.cal__more { position: absolute; top: 4px; inset-inline-start: 4px; width: 24px; height: 24px; border: 0; border-radius: 12px; background: transparent; color: var(--ink-3); font-size: 1.1rem; line-height: 1; cursor: pointer; } .cal__more:hover { background: #dde8f0; color: var(--ink); }
.cal__cnt { position: absolute; top: 6px; inset-inline-end: 6px; font-style: normal; font-size: .64rem; min-width: 18px; text-align: center; background: #0a78c2; color: #fff; border-radius: 12px; padding: 0 5px; }
.cal__body { display: grid; grid-template-columns: var(--gut) repeat(7, minmax(0, 1fr)); }
.cal__gutter { display: grid; grid-template-rows: repeat(var(--rows), var(--hr)); }
.cal__gutter span { font-size: .68rem; color: var(--ink-3); text-align: center; padding-top: 4px; border-top: 1px solid #eef3f7; }
.cal__col { position: relative; height: calc(var(--hr) * var(--rows)); border-inline-start: 1px solid var(--sky-line, #d7e6ee); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='100' preserveAspectRatio='none'%3E%3Crect y='99' width='10' height='1' fill='%23eef3f7'/%3E%3C/svg%3E"); background-repeat: repeat-y; background-size: 100% var(--hr); }
.cal__col.is-today { background-color: #f6fbff; } .cal__col.is-past { background-color: #fafbfc; }
.cal__work { position: absolute; inset-inline: 0; background: rgba(31, 169, 113, .07); border-block: 1px dashed rgba(31, 169, 113, .25); pointer-events: none; }
.cal-ap { position: absolute; inset-inline: 3px; display: flex; flex-direction: column; justify-content: center; gap: 0; overflow: hidden; padding: 2px 8px; border: 0; border-radius: 12px; font: inherit; text-align: start; cursor: pointer; line-height: 1.35; border-inline-start: 3px solid var(--c); background: var(--bg); color: #1b2b36; transition: transform .15s, box-shadow .15s; }
.cal-ap:hover { transform: scale(1.02); box-shadow: 0 6px 14px -8px rgba(18, 52, 70, .5); z-index: 2; }
.cal-ap b { font-size: .74rem; color: var(--c); } .cal-ap span { font-size: .76rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .cal-ap em { position: absolute; top: 2px; inset-inline-end: 6px; font-style: normal; font-size: .7rem; color: #0f8a63; }
.cal-ap--pending, .cal-legend i.cal-ap--pending { --c: #d98a00; --bg: #fff3d9; } .cal-ap--confirmed, .cal-legend i.cal-ap--confirmed { --c: #0f8a63; --bg: #dff5ea; }
.cal-ap--completed, .cal-legend i.cal-ap--completed { --c: #5b3df5; --bg: #ebe7ff; } .cal-ap--cancelled, .cal-legend i.cal-ap--cancelled { --c: #d6204f; --bg: #ffe6ec; }
.cal-legend i { background: var(--bg); box-shadow: inset 0 0 0 2px var(--c); position: static; }
.cal-ap--cancelled span { text-decoration: line-through; opacity: .7; }
.ap-dl { display: grid; gap: 6px; margin-bottom: 12px; } .ap-dl p { margin: 0; }
.ap-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; } .ap-acts form { margin: 0; }
.ap-cancel { display: flex; gap: 8px; margin-bottom: 8px; } .ap-cancel .input { flex: 1; }
.ap-range__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .ap-sep { border: 0; border-top: 1px solid var(--sky-line, #d7e6ee); margin: 16px 0; }
.dlg h4 { margin: 0 0 6px; font-size: .92rem; }
@media (max-width: 900px) { .cal { --gut: 42px; min-width: 760px; } .cal-bar__nav b { min-width: 0; } }


/* round 23: calendar on phones — day pills + one column at a time */
.cal-pills { display: none; }
@media (max-width: 900px) {
    .cal-bar { gap: 8px; margin-bottom: 10px; } .cal-bar__nav { width: 100%; justify-content: space-between; } .cal-bar__nav b { flex: 1; font-size: .84rem; }
    .cal-legend { font-size: .7rem; gap: 6px; }
    .cal-pills { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-bottom: 10px; }
    .cal-pill { position: relative; display: grid; justify-items: center; gap: 1px; padding: 7px 2px 9px; border: 0; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--sky-line, #d7e6ee); font: inherit; cursor: pointer; transition: background .2s, box-shadow .2s, color .2s; }
    .cal-pill small { font-size: .6rem; color: var(--ink-3); line-height: 1.2; white-space: nowrap; }
    .cal-pill b { font-size: 1rem; line-height: 1.4; }
    .cal-pill em { position: absolute; bottom: 3px; width: 6px; height: 6px; border-radius: 50%; background: #0a78c2; font-size: 0; }
    .cal-pill em.is-zero { background: transparent; }
    .cal-pill.is-today small { color: #0a78c2; font-weight: 700; }
    .cal-pill.is-sel { background: var(--accent); color: #fff; box-shadow: none; } .cal-pill.is-sel small { color: rgba(255, 255, 255, .85); } .cal-pill.is-sel em { background: #fff; }
    .cal-wrap { overflow: visible; border-radius: 12px; }
    .cal { min-width: 0; --gut: 44px; }
    .cal__head, .cal__body { grid-template-columns: var(--gut) minmax(0, 1fr); }
    .cal__dayhead:not(.is-sel), .cal__col:not(.is-sel) { display: none; }
    .cal__dayhead { grid-template-columns: auto auto; justify-content: center; gap: 8px; padding: 10px 12px; } .cal__dayhead b { font-size: .95rem; }
    .cal__more { inset-inline-start: 8px; top: 8px; background: #eef3f7; width: 30px; height: 30px; }
    .cal__cnt { display: none; }
    .cal-ap { flex-direction: row; align-items: center; gap: 10px; padding: 4px 12px; border-radius: 12px; }
    .cal-ap b { font-size: .82rem; flex: none; } .cal-ap span { font-size: .9rem; }
}
@media (max-width: 560px) {
    .cx-tabs--4 { gap: 3px; } .cx-tabs--4 a { font-size: .74rem; padding: 8px 4px; line-height: 1.5; text-align: center; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
}


/* round 24: patient profile */
.pf { display: grid; gap: 18px; padding-bottom: 30px; }
.pf-id { position: relative; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 22px 24px; border-radius: 12px; background: #e3f1fb; box-shadow: inset 0 0 0 1px var(--sky-line, #d7e6ee), 0 20px 40px -32px rgba(18, 52, 70, .5); }
.pf-id__av { position: relative; width: 92px; height: 92px; flex: none; }
.pf-id__av img, .pf-id__av > span { width: 100%; height: 100%; border-radius: 12px; object-fit: cover; display: grid; place-items: center; background: #cfe3f6; color: #0a5aa8; font-size: 2rem; font-weight: 800; box-shadow: 0 0 0 4px #fff, 0 10px 24px -12px rgba(18, 52, 70, .5); }
.pf-id__cam { position: absolute; bottom: -6px; inset-inline-end: -6px; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 0 0 3px #fff; transition: transform .2s var(--spring, ease); }
.pf-id__cam:hover { transform: scale(1.1); } .pf-id__cam .ico { width: 17px; height: 17px; }
.pf-id__dot { position: absolute; top: 4px; inset-inline-start: 4px; width: 14px; height: 14px; border-radius: 50%; background: #1fc47f; box-shadow: 0 0 0 3px #fff; }
.pf-id__txt { flex: 1 1 320px; min-width: 0; display: grid; gap: 10px; }
.pf-id__name { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .pf-id__name h1 { margin: 0; font-size: 1.5rem; }
.pf-meta { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .86rem; color: var(--ink-2); }
.pf-meta li { display: inline-flex; align-items: center; gap: 6px; } .pf-meta .ico { width: 15px; height: 15px; color: var(--ink-3); } .pf-meta b { color: var(--ink); } .pf-ok { color: #0f8a63 !important; }
.pf-id__acts { display: flex; gap: 8px; flex-wrap: wrap; } .pf-id__acts .btn { display: inline-flex; align-items: center; gap: 6px; } .pf-id__acts .ico { width: 16px; height: 16px; }

.pf-card { padding: 22px 24px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--sky-line, #d7e6ee), 0 16px 34px -28px rgba(18, 52, 70, .4); display: grid; gap: 18px; }
.pf-card__head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid var(--sky-line, #d7e6ee); }
.pf-card__head > div { flex: 1 1 260px; min-width: 0; } .pf-card__head h2 { margin: 0; font-size: 1.08rem; } .pf-card__head p { margin: 2px 0 0; font-size: .82rem; color: var(--ink-3); }
.pf-card__act { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; margin-inline-start: auto; } .pf-card__act .ico { width: 16px; height: 16px; }
.pf-req { color: #d6204f; }
.pf-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; } .pf-form--dlg { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 6px 0 4px; }
.pf-form .field small { display: block; margin-top: 4px; font-size: .74rem; }
.pf-form__foot { grid-column: 1 / -1; display: flex; }
@media (max-width: 700px) { .pf-form, .pf-form--dlg { grid-template-columns: 1fr; } .pf-card { padding: 16px; } .pf-id { padding: 16px; } .pf-id__acts { width: 100%; } .pf-id__acts .btn { flex: 1; justify-content: center; } }

.pf-switch { display: flex; align-items: flex-start; gap: 16px; padding: 16px 18px; border-radius: 12px; background: #fff6f7; box-shadow: inset 0 0 0 1px #fbd5dc; transition: background .25s, box-shadow .25s; margin: 0; }
.pf-switch.is-on { background: #ffeef1; box-shadow: inset 0 0 0 1.5px #f2a3b2; }
.pf-switch > div { display: grid; gap: 4px; } .pf-switch p { margin: 0; font-size: .84rem; line-height: 1.9; color: var(--ink-2); } .pf-rose { color: #d6204f; }
.pf-switch .sw { margin-top: 2px; } .pf-switch .sw.is-on { background: #e0314b; }

.pf-empty { padding: 20px; text-align: center; border-radius: 12px; background: #f6fafc; } .pf-empty p { margin: 0; color: var(--ink-3); }
.pf-fam { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.pf-fam__card { display: grid; gap: 12px; padding: 14px 16px; border-radius: 12px; background: #faf9ff; box-shadow: inset 0 0 0 1px #e6e1fb; }
.pf-fam__card header { display: flex; align-items: center; gap: 10px; } .pf-fam__card header > div { flex: 1; display: grid; line-height: 1.5; min-width: 0; } .pf-fam__card header form { margin: 0; }
.pf-fam__card small { color: var(--ink-3); font-size: .76rem; } .pf-rel { font-style: normal; background: #e6e1fb; color: #4a33c9; border-radius: 12px; padding: 0 8px; font-weight: 700; }
.pf-fam__card dl { margin: 0; display: grid; gap: 6px; } .pf-fam__card dl div { display: flex; justify-content: space-between; gap: 10px; font-size: .82rem; } .pf-fam__card dt { color: var(--ink-3); } .pf-fam__card dd { margin: 0; font-weight: 600; }

.pf-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; } @media (max-width: 900px) { .pf-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } } @media (max-width: 560px) { .pf-tiles { grid-template-columns: 1fr; } }
.pf-tile { --tc: #0a78c2; --tb: #eef6fd; display: grid; gap: 6px; align-content: start; padding: 16px; border-radius: 12px; background: var(--tb); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tc) 16%, transparent); color: var(--ink); text-decoration: none; transition: transform .25s var(--spring, ease), box-shadow .25s; }
.pf-tile:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px var(--tc), 0 18px 32px -24px var(--tc); }
.pf-tile__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; } .pf-tile__top em { font-style: normal; font-size: .7rem; font-weight: 700; color: var(--tc); }
.pf-tile b { font-size: 1rem; } .pf-tile small { font-size: .78rem; line-height: 1.8; color: var(--ink-2); }
.pf-tile__go { margin-top: 6px; display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; color: var(--tc); } .pf-tile__go i { font-style: normal; transition: transform .25s; } .pf-tile:hover .pf-tile__go i { transform: translateX(-4px); }
.pf-tile--blue { --tc: #0a78c2; --tb: #e8f3fd; } .pf-tile--violet { --tc: #5b3df5; --tb: #efebff; } .pf-tile--amber { --tc: #b86e00; --tb: #fff3d9; }
.pf-tile--green { --tc: #0f8a63; --tb: #e2f6ee; } .pf-tile--teal { --tc: #0c8f9c; --tb: #def5f7; } .pf-tile--rose { --tc: #d6204f; --tb: #ffe9ef; }
.pp-top__edit { font-size: .78rem; color: var(--accent-ink); font-weight: 700; text-decoration: none; }
.pf-form { align-items: start; } .pf-form .field { align-content: start; }


/* round 25: my doctors */
.md-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.md-card { display: grid; gap: 12px; padding: 16px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--sky-line, #d7e6ee); }
.md-card__top { display: flex; align-items: center; gap: 12px; }
.md-card__av { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; flex: none; display: grid; place-items: center; }
.md-card__av--txt { background: #cfe3f6; color: #0a5aa8; font-weight: 800; font-size: 1.2rem; }
.md-card__who { flex: 1; min-width: 0; display: grid; line-height: 1.5; } .md-card__who a { font-weight: 800; color: var(--ink); text-decoration: none; } .md-card__who small { color: var(--ink-3); font-size: .78rem; }
.md-card__rate { display: inline-flex; align-items: center; gap: 4px; font-size: .84rem; font-weight: 700; color: #b86e00; } .md-card__rate .ico { width: 15px; height: 15px; fill: #f5b301; stroke: #f5b301; }
.md-card__facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; } .md-card__facts li { display: flex; justify-content: space-between; font-size: .84rem; } .md-card__facts span { color: var(--ink-3); }
.md-card__acts { display: flex; gap: 8px; flex-wrap: wrap; } .md-card__acts .btn { display: inline-flex; align-items: center; gap: 6px; } .md-card__acts .ico { width: 15px; height: 15px; }
.pp-timeline--page { margin-top: 4px; }


/* round 26: directory (doctors + centers) */
.dr { padding-block: 22px 60px; }
.dr-head h1 { margin: 0 0 4px; font-size: 1.6rem; } .dr-head p { margin: 0 0 18px; }
.dr-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 22px; align-items: start; }
.dr-filters { position: sticky; top: 84px; }
.dr-filters__box { background: #fff; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--sky-line, #d7e6ee), 0 16px 34px -28px rgba(18, 52, 70, .4); overflow: hidden; }
.dr-filters__box > summary { list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; font-weight: 800; cursor: pointer; border-bottom: 1px solid transparent; }
.dr-filters__box > summary::-webkit-details-marker { display: none; }
.dr-filters__box[open] > summary { border-bottom-color: var(--sky-line, #d7e6ee); }
.dr-filters__box summary span { display: inline-flex; align-items: center; gap: 8px; } .dr-filters__box summary .ico { width: 18px; height: 18px; }
.dr-filters__box summary b { background: var(--accent); color: #fff; border-radius: 12px; font-size: .72rem; min-width: 22px; text-align: center; padding: 0 6px; }
.dr-form { display: grid; gap: 14px; padding: 16px 18px 18px; }
.dr-form .field { margin: 0; } .dr-form label, .dr-need legend { font-size: .8rem; font-weight: 700; color: var(--ink-2); }
.dr-near { display: grid; gap: 8px; } .dr-near .btn { display: inline-flex; align-items: center; gap: 6px; justify-self: start; } .dr-near .ico { width: 16px; height: 16px; } .dr-near small { font-size: .72rem; line-height: 1.7; }
.dr-near__on { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); font-size: .82rem; font-weight: 600; } .dr-near__on span { flex: 1; } .dr-near__on a { text-decoration: none; color: inherit; font-weight: 800; }
.dr-need { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; } .dr-need legend { width: 100%; margin-bottom: 6px; padding: 0; }
.dr-chip { cursor: pointer; } .dr-chip input { position: absolute; opacity: 0; pointer-events: none; }
.dr-chip span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 12px; background: #f2f6f9; box-shadow: inset 0 0 0 1px var(--line, #dbe5ec); font-size: .8rem; font-weight: 600; color: var(--ink-2); transition: background .2s, color .2s, box-shadow .2s; }
.dr-chip span .ico { width: 14px; height: 14px; }
.dr-chip input:checked + span { background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 0 0 1.5px var(--accent); }
.dr-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.dr-mine { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: .76rem; font-weight: 700; color: #0f8a63; text-decoration: none; } .dr-mine .ico { width: 14px; height: 14px; }
.dr-note { margin: 0; font-size: .72rem; line-height: 1.8; }

.dr-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.dr-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: #eef3f7; }
.dr-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border-radius: 12px; font-size: .86rem; font-weight: 700; color: var(--ink-2); text-decoration: none; transition: background .2s, color .2s; }
.dr-tabs a b { font-size: .72rem; background: #dde6ed; border-radius: 12px; padding: 0 7px; min-width: 20px; text-align: center; }
.dr-tabs a.is-active { background: #fff; color: var(--accent-ink); box-shadow: 0 1px 3px rgba(18, 52, 70, .16); } .dr-tabs a.is-active b { background: var(--accent-soft); color: var(--accent-ink); }
.dr-sort { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--ink-3); } .dr-sort .input { padding: 6px 10px; width: auto; }
.dr-active { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.dr-active a { font-size: .76rem; font-weight: 700; padding: 4px 12px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); text-decoration: none; } .dr-active a:hover { background: var(--accent); color: #fff; }
.dr-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.dr-card { display: grid; gap: 12px; padding: 16px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--sky-line, #d7e6ee); transition: transform .2s var(--spring, ease), box-shadow .2s; }
.dr-card:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px #b6d6ee, 0 18px 30px -24px rgba(10, 80, 130, .5); }
.dr-card--center { border-inline-start: 4px solid #0c8f9c; } .dr-card--doctor { border-inline-start: 4px solid #0a78c2; }
.dr-card__top { display: flex; align-items: center; gap: 12px; }
.dr-card__av { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; flex: none; display: grid; place-items: center; }
.dr-card__av--txt { background: #cfe3f6; color: #0a5aa8; font-weight: 800; font-size: 1.2rem; }
.dr-card__av--center { background: #def5f7; color: #0c8f9c; } .dr-card__av--center .ico { width: 26px; height: 26px; }
.dr-card__who { flex: 1; min-width: 0; display: grid; line-height: 1.55; } .dr-card__who a { font-weight: 800; color: var(--ink); text-decoration: none; font-size: 1rem; } .dr-card__who small { color: var(--ink-3); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-card__rate { display: inline-flex; align-items: center; gap: 4px; font-size: .84rem; font-weight: 700; color: #b86e00; } .dr-card__rate .ico { width: 15px; height: 15px; fill: #f5b301; stroke: #f5b301; }
.dr-card__badges { display: flex; flex-wrap: wrap; gap: 6px; } .dr-card__badges .badge { display: inline-flex; align-items: center; gap: 4px; } .dr-card__badges .ico { width: 13px; height: 13px; }
.dr-card__foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: .84rem; }
.dr-card__tel { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); text-decoration: none; font-size: .84rem; } .dr-card__tel .ico { width: 15px; height: 15px; }
@media (max-width: 900px) {
    .dr-layout { grid-template-columns: 1fr; gap: 14px; } .dr-filters { position: static; }
    .dr-list { grid-template-columns: 1fr; } .dr-head h1 { font-size: 1.3rem; } .dr-head p { font-size: .86rem; margin-bottom: 12px; }
    .dr-tabs { width: 100%; } .dr-tabs a { flex: 1; justify-content: center; padding-inline: 6px; } .dr-sort { width: 100%; justify-content: space-between; }
}

/* round 27: doctor access to the health file */
.ax-intro { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; margin-bottom: 14px; border-radius: 12px; background: #e4f6f6; box-shadow: inset 0 0 0 1px #cdeaea; }
.ax-intro b { font-size: 1rem; } .ax-intro p { margin: 4px 0 0; font-size: .86rem; line-height: 1.9; color: var(--ink-2); } .ax-intro p b { font-size: inherit; color: var(--ink); }
.ax-card { background: #fff; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--sky-line, #d7e6ee); padding: 18px 20px; margin-bottom: 14px; display: grid; gap: 14px; }
.ax-card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; } .ax-card__head h2 { margin: 0; font-size: 1.05rem; }
.ax-empty { margin: 0; padding: 10px 0; }
.ax-list { display: grid; gap: 0; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--sky-line, #d7e6ee); overflow: hidden; }
.ax-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--sky-line, #d7e6ee); border-inline-start: 4px solid var(--c, #b9c8d2); flex-wrap: wrap; transition: background .2s; }
.ax-row:first-child { border-top: 0; } .ax-row:hover { background: #f7fbfd; }
.ax-row--ok { --c: #1fa971; } .ax-row--warn { --c: #e0a100; } .ax-row--bad { --c: #d6204f; } .ax-row--info { --c: #0a78c2; } .ax-row--muted { --c: #9aa9b4; }
.ax-row__av { width: 46px; height: 46px; border-radius: 12px; object-fit: cover; flex: none; display: grid; place-items: center; }
.ax-row__av--txt { background: #cfe3f6; color: #0a5aa8; font-weight: 800; }
.ax-row__who { flex: 1 1 220px; min-width: 0; display: grid; line-height: 1.55; } .ax-row__who small { color: var(--ink-3); font-size: .76rem; } .ax-row__detail { color: var(--ink-2) !important; }
.ax-pill { font-size: .74rem; font-weight: 800; padding: 3px 12px; border-radius: 12px; background: color-mix(in srgb, var(--c, #888) 14%, #fff); color: color-mix(in srgb, var(--c, #888) 85%, #000); }
.ax-pill--ok { --c: #1fa971; } .ax-pill--warn { --c: #c58a00; } .ax-pill--bad { --c: #d6204f; } .ax-pill--info { --c: #0a78c2; } .ax-pill--muted { --c: #7d8f9c; }
.ax-row__acts { display: flex; gap: 8px; flex-wrap: wrap; } .ax-row__acts form { margin: 0; }
.ax-add { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) auto; gap: 14px; align-items: end; } .ax-add .field { margin: 0; }
@media (max-width: 800px) { .ax-add { grid-template-columns: 1fr; } .ax-add .btn { justify-self: start; } .ax-row__acts { width: 100%; } }
.dur { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dur__opt { cursor: pointer; } .dur__opt input { position: absolute; opacity: 0; pointer-events: none; }
.dur__opt span { display: grid; gap: 2px; justify-items: center; text-align: center; padding: 12px 8px; border-radius: 12px; background: #f4f7fa; box-shadow: inset 0 0 0 1px var(--line, #dbe5ec); transition: background .2s, box-shadow .2s; }
.dur__opt b { font-size: .95rem; } .dur__opt small { font-size: .7rem; color: var(--ink-3); }
.dur__opt input:checked + span { background: #e4f6f6; box-shadow: inset 0 0 0 2px #0c8f9c; } .dur__opt input:checked + span b { color: #0a6f7a; }
.dur__opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }


/* ===== round 28: notification bell + notifications page ===== */
.bell { position: relative; }
.bell__btn { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid #e3e8ee; background: #fff; color: #334155; cursor: pointer; }
.bell__btn:hover { background: #f1f5f9; }
.bell__btn .ico { width: 20px; height: 20px; }
.bell.has-new .bell__btn { color: #0f6b8a; }
.bell__dot { position: absolute; top: -5px; inset-inline-start: -5px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 12px; background: #e11d48; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; line-height: 1; }
.bell__dot[hidden] { display: none; }
.bell__menu { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; width: min(360px, calc(100vw - 24px)); background: #fff; border: 1px solid #e3e8ee; border-radius: 12px; box-shadow: 0 18px 40px -12px rgba(15,23,42,.28); z-index: 60; overflow: hidden; }
.bell__menu[hidden] { display: none; }
.bell__menu header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid #eef2f6; }
.bell__all { border: 0; background: none; color: #0f6b8a; font: inherit; font-size: 12.5px; cursor: pointer; }
.bell__menu ul { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow: auto; }
.bell__menu li a { display: grid; gap: 2px; padding: 10px 14px; color: inherit; text-decoration: none; border-bottom: 1px solid #f3f5f8; }
.bell__menu li a:hover { background: #f8fafc; }
.bell__menu li.is-new a { background: #f0f9ff; }
.bell__menu li b { font-size: 13.5px; }
.bell__menu li small { color: #64748b; font-size: 12.5px; line-height: 1.5; }
.bell__menu li time { color: #94a3b8; font-size: 11.5px; }
.bell__empty { padding: 18px 14px; color: #64748b; text-align: center; font-size: 13px; }
.bell__more { display: block; text-align: center; padding: 10px; font-size: 13px; color: #0f6b8a; text-decoration: none; background: #f8fafc; }
@media (max-width: 760px) { .bell__menu { position: fixed; top: 64px; inset-inline: 12px; width: auto; } }
.nf-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 14px; }
.nf-head h1 { font-size: 22px; margin: 0; }
.nf-empty { padding: 28px 0; text-align: center; }
.nf-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.nf-item a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #fff; border: 1px solid #e8edf3; border-radius: 12px; color: inherit; text-decoration: none; }
.nf-item.is-new a { background: #f0f9ff; border-color: #bae0f5; }
.nf-item__ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: #e8f3f8; color: #0f6b8a; flex: none; }
.nf-item__ico .ico { width: 18px; height: 18px; }
.nf-item__txt { flex: 1; display: grid; gap: 2px; min-width: 0; }
.nf-item__txt small { color: #64748b; }
.nf-item time { color: #94a3b8; font-size: 12px; white-space: nowrap; }

/* ===== round 29: sharing (modal, manager, viewers) ===== */
.btn-share { display: inline-flex; align-items: center; gap: 4px; border: 1px solid #cfe3ec; background: #f1f8fb; color: #0f6b8a; border-radius: 12px; padding: 3px 8px; font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
.btn-share:hover { background: #e0f0f6; }
.btn-share .ico { width: 14px; height: 14px; }
.dlg--share { max-width: 520px; }
.sh-tabs { display: flex; gap: 6px; margin: 4px 0 12px; padding: 4px; background: #f1f5f9; border-radius: 12px; }
.sh-tabs button { flex: 1; border: 0; background: none; padding: 8px 6px; border-radius: 12px; font: inherit; font-size: 13px; color: #475569; cursor: pointer; }
.sh-tabs button.is-on { background: #fff; color: #0f6b8a; font-weight: 600; box-shadow: 0 1px 3px rgba(15,23,42,.12); }
.dlg--share form[hidden] { display: none; }
.sh-manage { display: inline-block; margin-top: 12px; font-size: 13px; color: #0f6b8a; }
.sh-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sh-new { display: grid; gap: 8px; padding: 14px; margin-bottom: 14px; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 12px; }
.sh-copy { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.sh-copy .input { flex: 1; min-width: 0; font-size: 12.5px; }
.sh-renew { display: flex; gap: 6px; align-items: center; }
.sh-renew .input { width: auto; padding: 6px 8px; font-size: 12.5px; }
.sh-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sh-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #fff; border: 1px solid #e8edf3; border-radius: 12px; }
.sh-row__body { flex: 1; display: grid; gap: 2px; min-width: 0; }
.sh-row__body small { color: #64748b; }
.sv-head { display: flex; gap: 14px; align-items: center; padding: 16px; margin: 8px 0 14px; background: #fff; border: 1px solid #e8edf3; border-radius: 12px; }
.sv-head h1 { margin: 0 0 4px; font-size: 20px; }
.sv-head p { margin: 0; }
.sv-block { padding: 14px 16px; margin-bottom: 12px; background: #fff; border: 1px solid #e8edf3; border-radius: 12px; }
.sv-block .hd { margin: 0 0 8px; font-size: 16px; }
.sv-lines { list-style: none; margin: 0; padding: 0; display: grid; }
.sv-lines li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid #f1f4f8; }
.sv-lines li:first-child { border-top: 0; }
.sv-lines li > div { flex: 1; display: grid; gap: 2px; min-width: 0; }
.sv-lines small { color: #64748b; }
.sv-lines time { color: #64748b; font-size: 12.5px; white-space: nowrap; }
.sv-tag { padding: 2px 8px; border-radius: 12px; background: #e8f3f8; color: #0f6b8a; font-size: 12px; white-space: nowrap; }
.sv-foot { text-align: center; font-size: 12.5px; margin-top: 16px; }

/* ===== round 30: hub tools, history list, compact prescriptions ===== */
.hl-tools { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.hx-link { display: flex; align-items: center; gap: 12px; padding: 14px 16px; text-decoration: none; color: inherit; --tone: #2563eb; }
.hx__chev--go { margin-inline-start: auto; font-size: 1.3rem; color: #94a3b8; }
.hx summary .btn-share { margin-inline-start: auto; }
.hx summary .btn-share + .hx__chev { margin-inline-start: 8px; }
.hx__items li .btn-share { justify-self: end; }
.hx__items li { grid-template-columns: 1fr auto auto auto; }
.hi-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.hi-tabs { display: inline-flex; gap: 6px; padding: 4px; background: #f1f5f9; border-radius: 12px; }
.hi-tab { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 12px; color: #475569; text-decoration: none; font-size: 13.5px; }
.hi-tab i { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.hi-tab--blue i { background: #2563eb; } .hi-tab--red i { background: #dc2626; }
.hi-tab.is-on { background: #fff; color: #0f172a; font-weight: 600; box-shadow: 0 1px 3px rgba(15,23,42,.14); }
.hi-tab--blue.is-on { color: #1d4ed8; } .hi-tab--red.is-on { color: #b91c1c; }
.hi-search { display: flex; gap: 6px; align-items: center; }
.hi-search .input { padding: 7px 10px; font-size: 13px; width: auto; min-width: 0; }
.hi-empty { text-align: center; padding: 22px 0; }
.hi-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.hi-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; border: 1px solid transparent; border-inline-start-width: 5px; }
.hi-item--blue { background: #eff6ff; border-color: #dbeafe; border-inline-start-color: #2563eb; }
.hi-item--red { background: #fef2f2; border-color: #fee2e2; border-inline-start-color: #dc2626; }
.hi-item__kind { font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 12px; white-space: nowrap; }
.hi-item--blue .hi-item__kind { background: #dbeafe; color: #1d4ed8; } .hi-item--red .hi-item__kind { background: #fee2e2; color: #b91c1c; }
.hi-item__body { flex: 1; min-width: 0; } .hi-item__body p { margin: 2px 0 0; color: #475569; font-size: 13px; }
.hi-item time { color: #64748b; font-size: 12.5px; white-space: nowrap; }
.hi-item form { margin: 0; }
.hi-add { grid-template-columns: 120px 1.2fr 1.4fr 150px auto; }
@media (max-width: 760px) { .hi-add { grid-template-columns: 1fr; } .hi-item { flex-wrap: wrap; } .hi-search { width: 100%; } .hi-search .input { flex: 1; } }
.rx-list { display: grid; gap: 6px; margin-bottom: 16px; }
.rx { background: #fff; border: 1px solid #e8edf3; border-radius: 12px; }
.rx--old { opacity: .78; }
.rx > summary { display: grid; grid-template-columns: minmax(130px,1.1fr) minmax(90px,1fr) minmax(120px,1.8fr) auto auto auto 20px; gap: 10px; align-items: center; padding: 8px 12px; cursor: pointer; list-style: none; font-size: 13.5px; }
.rx > summary::-webkit-details-marker { display: none; }
.rx__who { display: grid; line-height: 1.3; } .rx__who small { color: #64748b; font-size: 12px; }
.rx__diag, .rx__drugs { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #334155; }
.rx__drugs { color: #64748b; font-size: 12.5px; }
.rx time { color: #64748b; font-size: 12.5px; white-space: nowrap; }
.rx[open] .hx__chev { transform: rotate(180deg); }
.rx__body { padding: 4px 14px 12px; border-top: 1px solid #f1f4f8; }
.rx__tbl { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
.rx__tbl th { text-align: start; color: #64748b; font-weight: 500; padding: 6px 8px; border-bottom: 1px solid #eef2f6; }
.rx__tbl td { padding: 6px 8px; border-bottom: 1px solid #f5f7fa; vertical-align: top; }
@media (max-width: 760px) { .rx > summary { grid-template-columns: 1fr auto auto 20px; } .rx__diag, .rx__drugs { display: none; } .rx time { grid-column: 1; } }

/* ===== round 31: vitals mini boxes ===== */
.hl-vitals--mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin-bottom: 12px; }
.vb { position: relative; background: #fff; border: 1px solid #e8edf3; border-radius: 12px; }
.vb.is-active { border-color: #0f6b8a; box-shadow: 0 0 0 2px rgba(15,107,138,.14); background: #f4fafc; }
.vb__main { display: grid; gap: 3px; padding: 8px 9px; text-decoration: none; color: inherit; }
.vb__top { display: flex; align-items: center; gap: 6px; font-size: 12px; padding-inline-end: 22px; }
.vb__top b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vb__top .hd__ico { width: 22px; height: 22px; border-radius: 12px; flex: none; }
.vb__top .hd__ico .ico { width: 13px; height: 13px; }
.vb__val { font-size: 1.05rem; font-weight: 700; line-height: 1.2; }
.vb__val small { font-size: 10.5px; font-weight: 400; color: #64748b; margin-inline-start: 3px; }
.vb .hl-flag { font-size: 10.5px; padding: 1px 7px; justify-self: start; }
.vb__edit { position: absolute; top: 6px; inset-inline-end: 6px; width: 22px; height: 22px; border: 0; border-radius: 12px; background: transparent; color: #94a3b8; cursor: pointer; display: grid; place-items: center; padding: 0; }
.vb__edit:hover { background: #eef2f6; color: #0f6b8a; }
.vb__edit .ico { width: 13px; height: 13px; }
.vb--new { display: grid; place-items: center; gap: 2px; border-style: dashed; color: #0f6b8a; cursor: pointer; font: inherit; font-size: 12px; min-height: 76px; }
.vb--new:hover { background: #f1f8fb; }
.vb--new .ico { width: 18px; height: 18px; }
.vb-hidden { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -2px 0 12px; }
.vb-hidden form { margin: 0; }
.vb-chip { border: 1px dashed #cbd5e1; background: #fff; border-radius: 12px; padding: 3px 10px; font: inherit; font-size: 12px; color: #475569; cursor: pointer; }

/* ===== round 32: directory «mine» boxes + excel-like tables ===== */
.dr-mine-boxes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
.dr-mbox { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; background: #fff; border: 1.5px solid #e3e9ef; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s, background .15s; }
.dr-mbox span:last-child { display: grid; gap: 2px; }
.dr-mbox small { color: #64748b; font-size: 12.5px; }
.dr-mbox:hover { border-color: #b8d3e0; }
.dr-mbox.is-active { border-color: #0f6b8a; background: #eef8fc; box-shadow: 0 0 0 3px rgba(15,107,138,.14); }
.dr-mbox--teal.is-active { border-color: #0d9488; background: #effcf9; box-shadow: 0 0 0 3px rgba(13,148,136,.15); }
.mt-card { background: #fff; border: 1px solid #e8edf3; border-radius: 12px; padding: 14px; }
.mt-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 8px; }
.mt-filters .field { min-width: 150px; flex: 1 1 150px; max-width: 260px; }
.mt-count { font-size: 12.5px; margin: 4px 2px 8px; }
.mt-wrap { overflow: auto; border: 1px solid #dfe6ee; border-radius: 12px; }
.mt-tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 760px; }
.mt-tbl th { position: sticky; top: 0; background: #f1f5f9; text-align: start; font-weight: 600; color: #334155; padding: 9px 12px; border-bottom: 1px solid #dfe6ee; white-space: nowrap; }
.mt-tbl td { padding: 8px 12px; border-bottom: 1px solid #edf1f5; vertical-align: middle; }
.mt-tbl tbody tr:nth-child(even) td { background: #fafbfd; }
.mt-tbl tbody tr:hover td { background: #f0f7fb; }
.mt-tbl th + th, .mt-tbl td + td { border-inline-start: 1px solid #f0f3f7; }
.mt-tbl a { color: #0f6b8a; text-decoration: none; font-weight: 600; }
.mt-note { color: #64748b; max-width: 260px; }
@media (max-width: 560px) { .dr-mine-boxes { grid-template-columns: 1fr; } }

/* ===== round 33: patient panel looks like the phone layout on every screen ===== */
.panel.pp { max-width: 640px; margin-inline: auto; }
.pp .portal-head.pp-top { padding: 12px 14px; gap: 12px; margin-bottom: 14px; align-items: stretch; flex-direction: column; }
.pp .pp-top .overline, .pp .pp-top .hello, .pp .pp-top__txt p { display: none; }
.pp .pp-top__who { display: flex; align-items: center; gap: 12px; width: 100%; }
.pp .pp-top .avatar--xl { width: 46px; height: 46px; border-radius: 12px; }
.pp .pp-top__txt h1 { font-size: 1.15rem; margin: 0; }
.pp .pp-top__out { display: inline-flex; align-items: center; gap: 5px; margin-inline-start: auto; padding: 6px 12px; border-radius: 12px; background: rgba(255,255,255,.8); box-shadow: inset 0 0 0 1px var(--sky-line, #d7e6ee); font-size: .78rem; font-weight: 700; color: var(--ink-2); text-decoration: none; }
.pp .pp-top__out .ico { width: 14px; height: 14px; }
.pp .pp-top__btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.pp .pp-top__btns .pp-btn { padding: 11px 8px; border-radius: 12px; font-size: .86rem; white-space: nowrap; }
.pp .kpis.kpis--compact { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 18px; }
.pp .kpis--compact .kpi { padding: 8px 6px; border-radius: 12px; text-align: center; font: inherit; }
.pp .kpis--compact .kpi b { font-size: .95rem !important; line-height: 1.5 !important; } .pp .kpis--compact .kpi b small { font-size: .6rem; }
.pp .kpis--compact .kpi span { font-size: .62rem; line-height: 1.4; display: block; }
.kpis--links .kpi { display: block; text-decoration: none; color: inherit; cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; }
.kpis--links .kpi:hover { transform: translateY(-2px); box-shadow: 0 8px 18px -10px rgba(15,107,138,.45); border-color: #9fcbe0; }
.kpis--links button.kpi { appearance: none; width: 100%; }
.pp .ap-list { grid-template-columns: 1fr; }
.pp .ap-tabs { display: flex; } .pp .ap-tabs a { flex: 1; justify-content: center; padding-inline: 8px; }
.pp .grid { grid-template-columns: 1fr; }

.cq-btn { margin-inline-start: auto; }
.cal-bar .cq-btn { order: 3; }
a.kpi { display: block; text-decoration: none; color: inherit; }

/* ===== round 34: doctor profile — my history with this doctor ===== */
.dp-unread { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 10px; border-radius: 12px; background: #fff7e6; border: 1px solid #f5d28a; color: #7a4b00; text-decoration: none; }
.dp-unread .ico { width: 18px; height: 18px; } .dp-unread span { flex: 1; } .dp-unread em { font-style: normal; font-weight: 700; color: #0f6b8a; }
.dp-sub { border-top: 1px solid #eef2f6; padding: 8px 0; }
.dp-sub > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; } .dp-sub > summary::-webkit-details-marker { display: none; }
.dp-mini { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.dp-mini li { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; padding: 6px 10px; background: #f8fafc; border-radius: 12px; }
.dp-mini__txt { flex: 1; min-width: 120px; } .dp-mini__txt small { color: #64748b; }
@media (max-width: 760px) {
    .rx > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
    .rx__who { flex: 1 1 0; min-width: 0; }
    .rx__diag { display: block; order: 9; flex: 1 1 100%; font-size: 12.5px; }
    .rx__drugs { display: none; }
}
.hl-vitals--mini { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
@media (max-width: 760px) { .hl-vitals--mini { gap: 6px; } .vb__main { padding: 6px 7px; } .vb__top { font-size: 11px; gap: 4px; padding-inline-end: 18px; } .vb__top .hd__ico { width: 18px; height: 18px; } .vb__val { font-size: .95rem; } .vb--new { min-height: 64px; } }

/* ===== round 35: accordion rows (medical file + health hub) ===== */
details.hx, .hl-item, .rx { scroll-margin-top: 84px; }
.hx-list { display: grid; gap: 12px; }
details.hx { border-radius: 12px; border: 1px solid #e6edf3; border-inline-start: 5px solid var(--tone, #0f6b8a); background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.04); transition: box-shadow .25s, transform .25s, border-color .25s; }
details.hx:hover { box-shadow: 0 10px 24px -14px rgba(15,23,42,.35); transform: translateY(-1px); }
details.hx[open] { box-shadow: 0 16px 34px -18px rgba(15,107,138,.5); border-color: color-mix(in srgb, var(--tone, #0f6b8a) 40%, #e6edf3); transform: none; }
details.hx > summary { cursor: pointer; padding: 14px 16px; }
details.hx .hx__chev { transition: transform .3s; }
details.hx[open] .hx__chev { transform: rotate(180deg); }
details.hx .hx__body { transition: height .3s ease; }
details.hx[open] > .hx__body { animation: hx-in .35s ease both; }
@keyframes hx-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.hl-item { transition: transform .2s; }
.hl-row { border-inline-start: 5px solid transparent; transition: border-color .25s, background .25s, box-shadow .25s; }
.hl-row[aria-expanded="true"] { border-inline-start-color: #0f6b8a; background: #f2f9fc; box-shadow: 0 10px 26px -16px rgba(15,107,138,.55); }
.hl-row:hover { background: #f7fbfd; }
.hl-row .hl-tile__go { transition: transform .3s; } .hl-row[aria-expanded="true"] .hl-tile__go { transform: rotate(180deg); }

/* ===== round 36: desktop sidebar for panels (phones keep the bottom menu) ===== */
.shell { display: block; }
@media (min-width: 901px) {
    .has-side .shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); align-items: start; max-width: 1560px; margin-inline: auto; }
    .has-side .topbar .nav { display: none; }
    .has-side .topbar__in { justify-content: space-between; }
    .side { position: sticky; top: 76px; align-self: start; display: flex; flex-direction: column; gap: 10px; margin: 18px 0 18px 0; margin-inline-start: 18px; padding: 12px; border-radius: 12px; background: rgba(255,255,255,.92); box-shadow: inset 0 0 0 1px var(--sky-line, #d7e6ee), 0 18px 36px -26px rgba(15,60,90,.35); max-height: calc(100dvh - 96px); overflow: auto; }
    .side__nav { display: grid; gap: 2px; }
    .side__a { position: relative; display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 12px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .92rem; transition: background .2s, color .2s, transform .15s; }
    .side__a .ico { width: 19px; height: 19px; flex: none; opacity: .85; }
    .side__a:hover { background: #f1f7fa; color: var(--ink); }
    .side__a:active { transform: scale(.98); }
    .side__a.is-on { background: var(--accent-soft, #e3f3f7); color: var(--accent-ink, #0a5f78); }
    .side__a.is-on::before { content: ""; position: absolute; inset-block: 9px; inset-inline-start: -12px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent, #0f6b8a); }
    .side__n { margin-inline-start: auto; min-width: 20px; padding: 1px 6px; border-radius: 12px; background: #e11d48; color: #fff; font-size: .7rem; text-align: center; }
    .side__out { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid #edf1f5; margin-top: 4px; border-radius: 12px; color: #a31939; text-decoration: none; font-size: .88rem; font-weight: 600; }
    .side__out .ico { width: 18px; height: 18px; }
    .side__out:hover { background: #fff0f3; }
    .has-side main#main { min-width: 0; }
    .has-side .wrap.panel { max-width: none; padding-inline: 24px; }
}
@media (max-width: 900px) { .side { display: none; } }
/* patient panel: full-width on desktop (the sidebar sits beside it) */
@media (min-width: 901px) {
    .panel.pp { max-width: none; margin-inline: 0; }
    .pp .portal-head.pp-top { flex-direction: row; align-items: center; justify-content: space-between; padding: 22px 28px; margin-bottom: 20px; border-radius: 12px; background: #e9f6f4; }
    .pp .pp-top .overline, .pp .pp-top__txt p { display: block; }
    .pp .pp-top .hello { display: inline; }
    .pp .pp-top__who { width: auto; gap: 18px; }
    .pp .pp-top .avatar--xl { width: 72px; height: 72px; border-radius: 12px; }
    .pp .pp-top__txt h1 { font-size: 1.7rem; }
    .pp .pp-top__out { display: none; }
    .pp .pp-top__btns { display: flex; width: auto; gap: 10px; }
    .pp .pp-top__btns .pp-btn { padding: 12px 20px; font-size: .95rem; }
    .pp .kpis.kpis--compact { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 28px; }
    .pp .kpis--compact .kpi { padding: 20px 22px; border-radius: 12px; text-align: start; }
    .pp .kpis--compact .kpi b { font-size: 2rem !important; line-height: 1.3 !important; }
    .pp .kpis--compact .kpi span { font-size: .9rem; }
    .pp .ap-list { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
    .pp .ap-tabs { display: inline-flex; } .pp .ap-tabs a { flex: none; padding-inline: 20px; }
    .pp .grid { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
    .pp .notice-board { border-radius: 12px; }
}

/* ===== round 37: info tooltips + admin ===== */
.ti { position: relative; display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; margin-inline-start: 8px; border-radius: 50%; background: #e7eef3; color: #52667a; font: italic 700 12px/1 Georgia, serif; cursor: help; vertical-align: middle; transition: background .2s, color .2s; }
.ti:hover, .ti:focus-visible { background: var(--accent, #0f6b8a); color: #fff; outline: none; }
.ti::after { content: attr(data-tip); position: absolute; z-index: 90; left: 50%; top: calc(100% + 8px); translate: -50% 4px; width: max-content; max-width: min(300px, 70vw); padding: 9px 12px; border-radius: 12px; background: #14303d; color: #eaf3f7; font: normal 500 12.5px/1.8 inherit; text-align: start; white-space: normal; box-shadow: 0 14px 30px -14px rgba(0,0,0,.5); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .18s, translate .18s; }
.ti:hover::after, .ti:focus-visible::after, .ti.is-open::after { opacity: 1; visibility: visible; translate: -50% 0; }
.adm-head h1 { display: flex; align-items: center; margin: 4px 0 18px; font-size: 1.5rem; }
.adm-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.adm-kpis .kpi { padding: 16px 18px; border-radius: 12px; }
.adm-kpis .kpi b { font-size: 1.6rem; }
.adm-alerts { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.adm-alerts a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; background: #fff6e6; border: 1px solid #f3d28b; color: #7a4b00; text-decoration: none; }
.adm-alerts .ico { width: 18px; height: 18px; }
.adm-grid-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 24px; }
.adm-tile { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; background: #fff; border: 1px solid #e6edf3; text-decoration: none; color: inherit; transition: transform .2s, box-shadow .2s, border-color .2s; }
.adm-tile:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -18px rgba(15,60,90,.5); border-color: #b9d6e3; }
.adm-tile b { flex: 1; font-size: .95rem; }
.adm-card { padding: 16px 18px; margin-bottom: 18px; background: #fff; border: 1px solid #e6edf3; border-radius: 12px; }
.adm-card .hd { margin: 0 0 12px; font-size: 1.05rem; }
.adm-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; }
.adm-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.adm-filter .input { width: auto; min-width: 150px; padding: 8px 12px; }
.adm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.adm-chips a { display: inline-flex; gap: 6px; align-items: center; padding: 6px 14px; border-radius: 12px; background: #eef3f7; color: var(--ink-2); text-decoration: none; font-size: .86rem; font-weight: 600; }
.adm-chips a b { background: #dde6ed; border-radius: 12px; padding: 0 7px; font-size: .74rem; }
.adm-chips a.is-on { background: var(--accent, #0f6b8a); color: #fff; } .adm-chips a.is-on b { background: rgba(255,255,255,.25); }
.adm-acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; } .adm-acts form { margin: 0; }
.adm-pw { display: flex; gap: 4px; } .adm-pw .input { width: 110px; padding: 5px 8px; font-size: .8rem; }
.adm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; align-items: end; }
.adm-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.adm-bars li { display: grid; grid-template-columns: 120px 1fr auto; gap: 10px; align-items: center; font-size: .86rem; }
.adm-bars i { display: block; height: 10px; border-radius: 12px; background: #edf2f6; position: relative; overflow: hidden; }
.adm-bars i::after { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: var(--w); border-radius: 12px; background: var(--accent, #0f6b8a); }
.adm-log { list-style: none; margin: 0; padding: 0; display: grid; }
.adm-log li { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid #f1f4f8; font-size: .88rem; } .adm-log li:first-child { border-top: 0; }
.adm-log span { flex: 1; color: #64748b; } .adm-log time { color: #94a3b8; font-size: .8rem; } .adm-log form { margin: 0; }
.tk { border-inline-start: 4px solid #e0a100; } .tk--answered { border-inline-start-color: #1fa971; } .tk--closed { border-inline-start-color: #cbd5e1; opacity: .8; }
.tk header { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; } .tk header small { margin-inline-start: auto; }
.tk p { margin: 0 0 8px; line-height: 1.9; } .tk__reply { background: #f1f8f4; padding: 8px 12px; border-radius: 12px; }
.tk__form { display: flex; gap: 8px; flex-wrap: wrap; } .tk__form .input { flex: 1; min-width: 220px; }

/* admin sidebar groups */
.side__g { border-radius: 12px; }
.side__g > summary { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 12px; cursor: pointer; list-style: none; color: var(--ink-2); font-weight: 700; font-size: .92rem; transition: background .2s, color .2s; }
.side__g > summary::-webkit-details-marker { display: none; }
.side__g > summary .ico { width: 19px; height: 19px; opacity: .85; flex: none; }
.side__g > summary:hover { background: #f1f7fa; color: var(--ink); }
.side__g.has-on > summary { color: var(--accent-ink, #0a5f78); }
.side__chev { margin-inline-start: auto; font-style: normal; transition: transform .25s; color: #94a3b8; }
.side__g[open] > summary .side__chev { transform: rotate(180deg); }
.side__sub { display: grid; gap: 2px; margin: 2px 0 6px; padding-inline-start: 14px; border-inline-start: 2px solid #e5edf2; margin-inline-start: 22px; animation: hx-in .25s ease both; }
.side__a--sub { padding: 8px 10px; font-size: .88rem; font-weight: 600; }
.side__a--sub .ico { width: 17px; height: 17px; }
.side__a--sub.is-on::before { inset-inline-start: -16px; }
.side__chev { display: inline-block; line-height: 1; align-self: center; font-size: 1rem; }
.side__g > summary > span { flex: 1; }

.foot--panel .foot__in { justify-content: center; }
.foot__credit a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.foot__credit a:hover { color: var(--accent, #0f6b8a); }

/* sidebar: full viewport height, 10px from top / bottom / start edge; the page makes room for it */
@media (min-width: 901px) {
    .has-side { --side-w: 252px; --side-gap: 10px; }
    .has-side .side { position: fixed; top: var(--side-gap); bottom: var(--side-gap); inset-inline-start: var(--side-gap); width: var(--side-w); height: calc(100dvh - var(--side-gap) * 2); max-height: none; margin: 0; z-index: 40; overflow: hidden; }
    .has-side .side__nav { flex: 1; min-height: 0; overflow-y: auto; align-content: start; }
    .has-side .side__out { margin-top: auto; flex: none; }
    .has-side .topbar, .has-side .shell, .has-side .foot { margin-inline-start: calc(var(--side-w) + var(--side-gap) * 2); }
    .has-side .shell { display: block; max-width: none; }
}

/* filter / tab bars inside the page header (far end) */
.head--tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.head--tabs > [data-moved] { margin-inline-start: auto; margin-block: 0; }
.adm-head.head--tabs h1 { margin: 4px 0 0; }
.adm-head.head--tabs { margin-bottom: 18px; }
.adm-head.head--tabs > .adm-chips { margin-bottom: 0; }
.hl-head.head--tabs > .hl-tabs, .hl-head.head--tabs > .hi-tabs { flex: none; }
#appts.head--tabs { align-items: center; }
/* logout: red button */
.side__out { background: #d6204f; color: #fff !important; border-radius: 12px; justify-content: center; border-top: 0; margin-top: auto; font-weight: 700; transition: background .2s, transform .15s; }
.side__out:hover { background: #b81a42; } .side__out:active { transform: scale(.98); }

/* tooltip bubbles must not widen the page: they do not exist until hovered */
.ti::after { display: none; }
.ti:hover::after, .ti:focus-visible::after, .ti.is-open::after { display: block; animation: ti-in .18s ease both; }
@keyframes ti-in { from { opacity: 0; translate: -50% 4px; } to { opacity: 1; translate: -50% 0; } }
.has-side main#main { overflow-x: clip; }
/* sidebar content fills the sidebar (site.css centered it) */
.has-side .side { align-items: stretch; padding: 10px; }
.has-side .side__nav { width: 100%; }
.has-side .side .side__a, .has-side .side .side__out { padding: 10px 12px; justify-content: flex-start; }
.has-side .side .side__out { justify-content: center; }
.has-side .side__g > summary { padding: 10px 12px; }

/* footer sticks to the bottom of the screen when the page is short */
body { min-height: 100dvh; display: flex; flex-direction: column; }
body > .shell, body > main { flex: 1 0 auto; }
body > .foot { flex: none; margin-top: auto; }

/* patient panel (desktop): minimal one-line KPI boxes, full-width record card */
@media (min-width: 901px) {
    .pp .kpis.kpis--compact { gap: 12px; margin-bottom: 22px; }
    .pp .kpis--compact .kpi { display: flex; flex-direction: row-reverse; align-items: baseline; justify-content: flex-end; gap: 10px; padding: 12px 18px; border-radius: 12px; text-align: start; }
    .pp .kpis--compact .kpi b { display: inline; font-size: 1.25rem !important; line-height: 1.4 !important; }
    .pp .kpis--compact .kpi b small { font-size: .72rem; margin-inline-start: 4px; font-weight: 600; }
    .pp .kpis--compact .kpi span { display: inline; font-size: .92rem; color: var(--ink-2); }
    .pp .grid { grid-template-columns: 1fr; }
    .pp .grid .card { width: 100%; }
}

/* patient panel: appointments as a minimal list, 25x25 doctor photo */
.pp .ap-list { grid-template-columns: 1fr !important; gap: 6px !important; }
.pp .ap-card { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 8px 14px; border-radius: 12px; }
.pp .ap-card header { display: contents; }
.pp .ap-card__av { width: 25px; height: 25px; border-radius: 12px; font-size: .7rem; flex: none; }
.pp .ap-card .avatar.ap-card__av { display: grid; place-items: center; }
.pp .ap-card__doc { flex: 1 1 200px; display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.pp .ap-card__doc a { font-size: .92rem; white-space: nowrap; } .pp .ap-card__doc small { font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp .ap-card__when { flex: 0 1 auto; gap: 4px 12px; font-size: .84rem; }
.pp .ap-card > .badge { order: 5; }
.pp .ap-card__note { flex: 1 1 100%; order: 8; padding: 4px 10px; font-size: .78rem; }
.pp .ap-card footer { order: 6; margin: 0; }
.pp .ap-card footer .btn { padding: 4px 12px; font-size: .8rem; }
.pp .ap-card header > .badge { order: 5; }

/* ===== dashboard spacing rule: the gap between boxes / sections is 10px (inner padding stays 8px) ===== */
.has-side main#main :where(*) { gap: 10px !important; row-gap: 10px !important; column-gap: 10px !important; }
.has-side main#main .wrap.panel { padding: 10px !important; }
.has-side main#main .panel { gap: 10px !important; }
.has-side main#main :is(.card, .kpi, .ap-card, .hl-card, .adm-card, .mt-card, .hx, .hx__body, .rx__body, .adm-tile, .notice-board, .notice-row, .pf-card, .pf-card__head, .pf-id, .portal-head, .dp-card, .empty, .hl-head, .adm-alerts a, .nf-item a, .sv-block, .sv-head, .ax-card, .ax-row, .hi-item, .sh-row, .hl-pane__in, .pp-panel, .tk, .hl-tile) { padding: 8px !important; }
.has-side main#main .hx > summary, .has-side main#main .rx > summary { padding: 8px !important; }
.has-side main#main :is(.mt-tbl th, .mt-tbl td) { padding: 8px !important; }
.has-side main#main :is(.kpis, .adm-kpis, .adm-grid-tiles, .section__head, .adm-head, .adm-chips, .adm-filter, .hl-tools, .hl-bar, .hx-list, .ap-list, .rx-list, .hi-bar, .hi-list, .dr-bar, .pp-top, .notice, .form-error, .hl-card__head, .pf-card__head, .adm-card .hd, .adm-two, .sv-lines, .hl-grid, .grid, .tools-grid, .ap-tabs, .mt-wrap, .mt-filters, .hl-vitals, .vb-hidden) { margin-block: 0 10px !important; }
.has-side main#main :is(.adm-head h1, .adm-card .hd, .hl-head h1, h1, h2, h3) { margin-block: 0 !important; }
.has-side main#main .section__head { margin-top: 10px !important; }
.has-side main#main .portal-head.pp-top { margin-bottom: 10px !important; }
/* sections stacked in a page: 10px between them, everywhere */
.has-side main#main :is(.pf-card, .adm-card, .hl-card, .dp-card, .mt-card, .pp-panel, .tw, .sv-block, .ax-card, .notice-board, .hl-table, .hl-item, .tk, .pf-id, .portal-head, .empty) { margin-block: 0 10px !important; }
.has-side main#main :is(.pf, .hl, .adm, .pf-fam, .pp4, .pp4__col, .dp-pp4, .panel, .wrap.panel > div) { row-gap: 10px !important; }
.has-side main#main .pf-card, .has-side main#main .pf-id { margin-top: 0 !important; }
/* patient header: minimal */
.pp .portal-head.pp-top { padding: 8px !important; border-radius: 12px; }
.pp .pp-top .avatar--xl { width: 40px; height: 40px; border-radius: 12px; }
.pp .pp-top__txt h1 { font-size: 1.15rem; line-height: 1.4; }
.pp .pp-top__txt .pf-link, .pp .pp-top__edit { font-size: .78rem; }
.pp .pp-top__btns .pp-btn { padding: 6px 14px; font-size: .86rem; border-radius: 12px; }
.pp .pp-top__who { gap: 10px; }
@media (min-width: 901px) { .has-side .shell { margin-inline-end: 0; width: auto; } }

/* searchable doctor dropdown + full-width directory tables */
.cb { position: relative; min-width: 260px; max-width: 420px; flex: 1 1 280px; display: grid; gap: 4px; }
.cb label { font-size: .84rem; font-weight: 600; }
.cb__box { position: relative; }
.cb__box .input { width: 100%; padding-inline-end: 34px; }
.cb__x { position: absolute; inset-block: 0; inset-inline-end: 8px; border: 0; background: none; color: #94a3b8; cursor: pointer; }
.cb__list { position: absolute; z-index: 60; inset-inline: 0; top: calc(100% + 4px); max-height: 280px; overflow: auto; margin: 0; padding: 4px; list-style: none; background: #fff; border-radius: 12px; box-shadow: 0 18px 36px -14px rgba(15,23,42,.35), 0 0 0 1px #e3e8ee; }
.cb__list[hidden] { display: none; }
.cb__list li { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 12px; cursor: pointer; font-size: .9rem; }
.cb__list li:hover, .cb__list li.is-on { background: #eef6f9; }
.cb__list li small { color: #64748b; }
.cb__list li[hidden], .cb__none[hidden] { display: none; }
.cb__none { color: #64748b; cursor: default !important; }
.has-side .dr.wrap, .has-side section.dr { max-width: none !important; width: auto !important; margin-inline: 0 !important; padding-inline: 8px !important; }
.has-side .dr .mt-card { width: 100%; }
.has-side .dr .mt-tbl { min-width: 0; width: 100%; }

/* treatment wizard */
.tw { display: grid; gap: 8px; }
.tw__form { max-width: 520px; }
.tw-steps { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.tw-step { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 12px; background: #eef2f5; color: #6b7f86; font-size: .86rem; font-weight: 600; }
.tw-step i { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 12px; background: #d9e1e6; color: #51606b; font-style: normal; font-size: .75rem; }
.tw-step.is-done { background: #e3f4ee; color: #0b6f52; } .tw-step.is-done i { background: #0f8a63; color: #fff; }
.tw-step.is-on { background: var(--accent, #0f6b8a); color: #fff; } .tw-step.is-on i { background: rgba(255,255,255,.25); color: #fff; }
.tw-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tw-choice form { margin: 0; }
.tw-opt { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 16px; border: 1.5px solid #dbe4e8; border-radius: 12px; background: #fff; font: inherit; cursor: pointer; transition: border-color .2s, background .2s, transform .15s; }
.tw-opt .ico { width: 20px; height: 20px; } .tw-opt:active { transform: scale(.98); }
.tw-opt--yes:hover { border-color: #0f8a63; background: #eefaf5; } .tw-opt--no:hover { border-color: #d6204f; background: #fff3f6; }
.tw-meds { display: grid; gap: 8px; }
.tw-med { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 8px; }
.tw-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tw-radios { display: grid; gap: 8px; max-width: 520px; }
.tw-radios label { cursor: pointer; } .tw-radios input { position: absolute; opacity: 0; }
.tw-radios span { display: block; padding: 12px 14px; border-radius: 12px; background: #f4f7f8; box-shadow: inset 0 0 0 1px #e1e7ea; font-weight: 600; transition: background .2s, box-shadow .2s; }
.tw-radios input:checked + span { background: #e8f3f8; box-shadow: inset 0 0 0 2px var(--accent, #0f6b8a); }
.tw-radios input:focus-visible + span { outline: 2px solid var(--accent, #0f6b8a); outline-offset: 2px; }
.tw-done { display: flex; align-items: center; gap: 12px; } .tw-done h2 { margin: 0 0 4px; font-size: 1.1rem; } .tw-done p { margin: 0; }
@media (max-width: 560px) { .tw-med { grid-template-columns: 1fr 1fr; } .tw-med input:first-child { grid-column: 1 / -1; } .tw-choice { grid-template-columns: 1fr; } }
/* system message of the treatment report in the chat */
.cx-system--treat { display: block; text-align: start; white-space: pre-line; padding: 10px 14px; border-radius: 12px; background: #eaf6ef; color: #0b5238; box-shadow: inset 0 0 0 1px #bfe3d0; border-inline-start: 4px solid #0f8a63; font-size: .86rem; line-height: 1.9; }

.adm-chips__x { margin-inline-start: auto; background: #0f8a63 !important; color: #fff !important; }

/* AI assistant panel (doctor, patient page) */
.aic { display: grid; gap: 8px; }
.aic__log { display: grid; gap: 8px; max-height: 260px; overflow: auto; padding: 8px; background: #f6f4fc; border-radius: 12px; }
.aic__m { margin: 0; padding: 8px 12px; border-radius: 12px; font-size: .9rem; line-height: 1.9; max-width: 92%; display: flex; gap: 8px; }
.aic__m .ico { flex: none; width: 16px; height: 16px; margin-top: 6px; color: #5b3df5; }
.aic__m--ai { background: #fff; box-shadow: inset 0 0 0 1px #e4def8; justify-self: end; }
.aic__m--me { background: #5b3df5; color: #fff; justify-self: start; }
.aic__form { display: flex; gap: 8px; } .aic__form .input { flex: 1; min-width: 0; }

/* mobile: the chat panel on the doctor's patient page must stay inside the screen */
.pp4, .pp4__col, .pp-panel, .pp-panel__body, .pp-panel__in, .dp-chat { min-width: 0; max-width: 100%; box-sizing: border-box; }
.dp-chat > *, .dp-chat .cx-thread, .dp-chat .cx-files, .dp-chat .cx-tools, .dp-chat .chat-head, .dp-chat form { max-width: 100%; min-width: 0; box-sizing: border-box; }
.dp-chat .cx-files { width: 100%; }
.pp-panel__in.pp-chatbody { overflow: hidden; }
@media (max-width: 900px) { .pp4 { grid-template-columns: minmax(0, 1fr) !important; } .pp4 > *, .pp4__col > * { min-width: 0; } }
/* doctor profile (patient view) uses the same two-column panel structure as the patient page of the doctor */
.dp-pp4 { align-items: start; }
.dp-pp4 > .pp4__col > .dp-card.pp-panel, .dp-pp4 .dp-card.pp-panel { padding: 8px; }
.dp-pp4 .dp-chat { padding: 0; }
@media (max-width: 1000px) { .dp-pp4 > .dp-side { order: 2 !important; } .dp-pp4 > .pp4__col:not(.dp-side) > * { order: 0; } }
@media (max-width: 1000px) { .dp-pp4 > .dp-side > * { order: 2 !important; } }

/* treatment: visits list (dates come from the system) */
.tw-visits { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tw-visit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px #e8edf3; }
.tw-visit__av { width: 25px; height: 25px; border-radius: 12px; object-fit: cover; flex: none; background: #e3f1ee; display: grid; place-items: center; font-size: .7rem; color: #0b5d52; }
.tw-visit__who { flex: 1 1 200px; display: flex; align-items: baseline; gap: 8px; min-width: 0; } .tw-visit__who small { color: #64748b; font-size: .8rem; }
.tw-visit__when { color: #475569; font-size: .86rem; } .tw-visit form { margin: 0; }

/* treatment stepper: dots joined by a dashed line, no numbers */
.tw-steps { display: flex; flex-wrap: nowrap; gap: 0; margin-bottom: 8px; overflow-x: auto; padding: 8px 4px; }
.tw-step { position: relative; flex: 1 1 0; min-width: 72px; display: grid; justify-items: center; gap: 6px; padding: 0; background: none !important; color: #6b7f86; font-size: .8rem; font-weight: 600; text-align: center; }
.tw-step i { width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 2px #c5d0d6; position: relative; z-index: 1; font-size: 0; }
.tw-step + .tw-step::before { content: ""; position: absolute; top: 7px; inset-inline-start: calc(50% + 12px); inset-inline-end: calc(-50% + 12px); border-top: 2px dashed #c5d0d6; }
.tw-step.is-done { color: #0b6f52; background: none !important; } .tw-step.is-done i { background: #0f8a63; box-shadow: none; }
.tw-step.is-done + .tw-step::before, .tw-step.is-on::before { border-top-color: #0f8a63; }
.tw-step.is-on { color: var(--accent, #0f6b8a); background: none !important; } .tw-step.is-on i { background: #fff; box-shadow: inset 0 0 0 5px var(--accent, #0f6b8a); }

/* treatment wizard stepper v2: icon nodes joined by a line (solid when passed, dashed ahead) */
.tw-steps { padding: 12px 4px 8px; margin-bottom: 8px; }
.tw-step { min-width: 84px; gap: 8px; font-size: .82rem; }
.tw-step b { font-weight: 700; }
.tw-step i { width: 40px; height: 40px; display: grid; place-items: center; background: #fff; color: #94a3b8; box-shadow: inset 0 0 0 2px #d3dce1; font-size: 0; transition: background .3s, color .3s, box-shadow .3s; }
.tw-step i .ico { width: 19px; height: 19px; }
.tw-step + .tw-step::before { top: 19px; inset-inline-start: calc(50% + 26px); inset-inline-end: calc(-50% + 26px); border-top: 2.5px dashed #cbd5db; }
.tw-step.is-done i { background: #0f8a63; color: #fff; box-shadow: 0 8px 14px -8px #0f8a63; }
.tw-step.is-done + .tw-step::before, .tw-step.is-on::before { border-top: 2.5px solid #0f8a63; }
.tw-step.is-on i { background: var(--accent, #0f6b8a); color: #fff; box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent, #0f6b8a) 22%, transparent); animation: tw-pulse 2s ease-in-out infinite; }
@keyframes tw-pulse { 0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent, #0f6b8a) 22%, transparent); } 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent, #0f6b8a) 10%, transparent); } }
@media (prefers-reduced-motion: reduce) { .tw-step.is-on i { animation: none; } }
@media (max-width: 560px) { .tw-step { min-width: 64px; font-size: .74rem; } .tw-step i { width: 34px; height: 34px; } .tw-step + .tw-step::before { top: 16px; inset-inline-start: calc(50% + 22px); inset-inline-end: calc(-50% + 22px); } }

/* tag dialog: header, 2-column preset grid, one aligned input row */
.dlg--tag { width: min(92vw, 460px); padding: 0; }
.tagd { display: grid; gap: 10px; padding: 16px; }
.tagd__head { display: flex; align-items: center; gap: 10px; }
.tagd__head > div { flex: 1; min-width: 0; } .tagd__head h3 { margin: 0; font-size: 1.05rem; } .tagd__head p { margin: 0; font-size: .82rem; color: var(--ink-3); }
.tagd__x { width: 34px; height: 34px; border: 0; border-radius: 12px; background: #eef2f6; color: #51606b; cursor: pointer; font: inherit; }
.tagd__x:hover { background: #dde6ee; }
.tag-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tag-pick__opt { display: flex; align-items: center; gap: 8px; justify-content: flex-start; width: 100%; padding: 12px; min-height: 46px; border: 1.5px solid #dbe4e8; border-radius: 12px; background: #fff; font: inherit; font-weight: 700; font-size: .88rem; color: var(--ink); text-align: start; transition: border-color .2s, background .2s; }
.tag-pick__opt i { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--tg, #2563eb); }
.tag-pick__opt--teal { --tg: #0e9f93; } .tag-pick__opt--amber { --tg: #2563eb; } .tag-pick__opt--violet { --tg: #0b7f8a; } .tag-pick__opt--rose { --tg: #14b8a6; }
.tag-pick__opt:hover { border-color: var(--tg); background: color-mix(in srgb, var(--tg) 10%, #fff); color: var(--ink); }
.tagd__sep { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: .8rem; } .tagd__sep::before, .tagd__sep::after { content: ""; flex: 1; height: 1px; background: #e1e8ee; }
.tag-custom { display: flex; gap: 10px; align-items: stretch; } .tag-custom .input { flex: 1; min-width: 0; height: 46px; } .tag-custom .btn { height: 46px; padding-inline: 20px; }

/* patient profile (v2): photo inside the first card, label + field on one line, switch in the title row */
.pf-card__head--photo, .pf-card__head--row { flex-wrap: nowrap; }
.pf-ph { flex: none; width: 56px; height: 56px; border-radius: 12px; overflow: hidden; display: grid; place-items: center; background: #dbe7ff; color: #1d4ed8; font-weight: 800; font-size: 1.3rem; }
.pf-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-card__head--photo h2, .pf-card__head--row h2 { flex: 1; min-width: 0; display: flex; align-items: center; }
.pf-card__sw { margin: 0; flex: none; }
.pf-form { grid-template-columns: 1fr; gap: 10px; }
.pf-form .field { display: grid; grid-template-columns: minmax(96px, 170px) minmax(0, 1fr); align-items: center; gap: 10px; }
.pf-form .field > label { margin: 0; width: auto !important; }
.pf-form .field > label small { display: block; margin: 0; }
.pf-form .field > small { grid-column: 2; margin: 0; }
.pf-form--dlg .field { grid-template-columns: 1fr; }
.pf-form__foot { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
@media (max-width: 560px) { .pf-form .field { grid-template-columns: 92px minmax(0, 1fr); gap: 8px; } .pf-form .field > label { font-size: .8rem; } }

/* patient panel: open conversations */
.chl { display: grid; gap: 10px; }
.chl__row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px #d3e1ec; color: inherit; text-decoration: none; flex-wrap: wrap; }
.chl__row.has-new { box-shadow: inset 0 0 0 2px #2563eb; }
.chl__av { width: 25px; height: 25px; border-radius: 12px; object-fit: cover; flex: none; background: #d3f2ee; display: grid; place-items: center; font-size: .7rem; color: #0b8479; }
.chl__row small { color: var(--ink-3); } .chl__row time { margin-inline-start: auto; color: var(--ink-3); font-size: .8rem; }
.chl__go { font-weight: 700; color: #1d4ed8; font-size: .84rem; }
/* mobile: appointments smaller, the three tabs on the title line */
@media (max-width: 900px) {
    #appts.head--tabs { flex-wrap: nowrap; align-items: center; }
    #appts .ap-tabs { margin-inline-start: auto; padding: 2px; gap: 2px; display: inline-flex; flex: none; }
    #appts .ap-tabs a { padding: 3px 8px; font-size: .74rem; flex: none; }
    #appts .ap-tabs a b { font-size: .66rem; padding: 0 5px; min-width: 16px; }
    .pp .ap-card { padding: 6px 10px; gap: 4px 8px; } .pp .ap-card__doc a { font-size: .84rem; } .pp .ap-card__doc small { font-size: .72rem; } .pp .ap-card__when { font-size: .76rem; gap: 2px 8px; }
    .pp .ap-card .badge { font-size: .68rem; padding: 1px 7px; } .pp .ap-card footer .btn { padding: 3px 10px; font-size: .74rem; }
}

/* own medicines */
.sm { display: grid; gap: 10px; }
.sm__form { display: grid; grid-template-columns: 1.4fr 1.2fr 1.4fr auto; gap: 10px; }
.sm__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sm__list li { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 12px; background: #f1f7fb; }
.sm__dose { flex: 1; color: var(--ink-3); font-size: .84rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .sm__list time { color: var(--ink-3); font-size: .78rem; } .sm__list form { margin: 0; }
@media (max-width: 760px) { .sm__form { grid-template-columns: 1fr 1fr; } .sm__form .btn { grid-column: 1 / -1; } }

/* health file: prescriptions bar on one line, history list inside its card, open rows highlighted, items = title + (i) on one line */
.hl-bar { display: flex; flex-wrap: nowrap; align-items: center; gap: 10px; }
.hl-bar .hl-tabs { flex: none; flex-wrap: nowrap; padding: 3px; } .hl-bar .hl-tabs a { padding: 6px 12px; font-size: .86rem; white-space: nowrap; }
.hl-bar .hl-search { flex: 1; min-width: 0; } .hl-bar .hl-search .input { padding-block: 8px; }
@media (max-width: 700px) { .hl-bar { gap: 6px; } .hl-bar .hl-tabs a { padding: 4px 8px; font-size: .72rem; gap: 4px; } .hl-bar .hl-search .input { font-size: .8rem; padding-inline-start: 34px; } .hl-search .ico { inset-inline-start: 10px; width: 15px; height: 15px; } }
.hl, .hi-list, .hi-item { min-width: 0; max-width: 100%; } .hi-item { flex-wrap: wrap; overflow-wrap: anywhere; } .hi-item__body { flex: 1 1 140px; min-width: 0; }
.hx__items li { grid-template-columns: 1fr auto auto; }
.hx__t { display: flex; align-items: center; gap: 6px; min-width: 0; } .hx__t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details.hx[open] { box-shadow: inset 0 0 0 2px var(--tone, #2563eb); border-color: var(--tone, #2563eb); }
details.hx[open] > summary { background: color-mix(in srgb, var(--tone, #2563eb) 9%, #fff); border-radius: 12px 12px 0 0; }
@media (max-width: 900px) {
    #appts .hd { white-space: nowrap; font-size: .98rem; } #appts .hd__ico { width: 30px; height: 30px; }
    .pp .ap-card { padding: 5px 8px; } .pp .ap-card__doc small { display: none; } .pp .ap-card__doc { flex: 1 1 auto; }
    .pp .ap-card__av { width: 22px; height: 22px; }
}
/* card heads: the title always sits beside its icon, never under it */
.pf-card__head { flex-wrap: nowrap; }
.pf-card__head > div { flex: 1 1 0; }
.pf-card__head .hd__ico--lg { width: 40px; height: 40px; } .pf-card__head .hd__ico--lg .ico { width: 20px; height: 20px; }
.pf-card__head h2 { display: flex; align-items: center; min-width: 0; }
/* patient panel on phones: the KPI boxes two per row */
@media (max-width: 900px) { .pp .kpis.kpis--compact { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }
/* phones: an appointment = two lines (doctor + status, then date/time/type) */
@media (max-width: 900px) {
    .pp .ap-card { display: grid !important; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 2px 8px; }
    .pp .ap-card header { display: contents; }
    .pp .ap-card__av { grid-column: 1; grid-row: 1; } .pp .ap-card__doc { grid-column: 2; grid-row: 1; min-width: 0; }
    .pp .ap-card header > .badge { grid-column: 3; grid-row: 1; order: 0; }
    .pp .ap-card__when { grid-column: 1 / -1; grid-row: 2; }
    .pp .ap-card__note, .pp .ap-card footer { grid-column: 1 / -1; }
}
/* history page on phones: nothing may be wider than the screen */
.hl { max-width: 100%; overflow-x: clip; }
.hi-bar { flex-wrap: wrap; } .hi-tabs { flex-wrap: wrap; max-width: 100%; }
.hi-search { width: 100%; min-width: 0; } .hi-search .input { min-width: 0; flex: 1; } .hi-search select.input { flex: 0 1 110px; }
@media (min-width: 701px) { .hi-search { width: auto; } }
.hi-list { grid-template-columns: minmax(0, 1fr); } .hi-search { flex-wrap: wrap; } .hi-search .btn { flex: none; }
.rx-list, .hx-list, .md-list { grid-template-columns: minmax(0, 1fr); }

/* an open medical-file row keeps its title bar pinned at the top, so it can always be closed */
details.hx > summary { scroll-margin-top: 8px; }
@media (min-width: 901px) { details.hx[open] > summary { top: 76px; } details.hx > summary { scroll-margin-top: 84px; } }
details.hx { overflow: visible; }
.hx__body { overflow: visible; }

/* ===== mobile batch: labs scroll, red logout, compact share/access pages ===== */
.table-wrap { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
.table-wrap .hl-table { min-width: 560px; }
.hl-card { min-width: 0; max-width: 100%; }
.nav a[href="/Account/Logout"], .pp .pp-top__out { background: #e5384f !important; color: #fff !important; border-radius: 12px; }
.nav a[href="/Account/Logout"] .ico, .nav a[href="/Account/Logout"] .nav__txt, .pp .pp-top__out :is(.ico, span) { color: #fff !important; stroke: #fff; }
@media (max-width: 700px) {
    .hl-tools { flex-wrap: nowrap; gap: 6px; } .hl-tools .btn { padding: 5px 8px; font-size: .7rem; white-space: nowrap; gap: 4px; flex: 1 1 auto; justify-content: center; min-width: 0; } .hl-tools .btn .ico { width: 14px; height: 14px; }
    .ax-intro { display: none; }
    .ax-card { padding: 8px; } .ax-card__head { flex-wrap: wrap; gap: 6px; } .ax-card__head .sh-actions { width: 100%; flex-wrap: nowrap; gap: 6px; } .ax-card__head .sh-actions .btn { flex: 1; font-size: .7rem; padding: 5px 6px; white-space: nowrap; }
    .ax-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 8px; }
    .ax-row__av { width: 25px; height: 25px; flex: none; } .ax-row__who { flex: 1 1 0; min-width: 0; } .ax-row__who b { font-size: .88rem; } .ax-row__who small { font-size: .72rem; line-height: 1.5; }
    .ax-row .ax-pill { flex: none; font-size: .68rem; padding: 2px 8px; order: 3; }
    .ax-row__acts { order: 4; flex: 1 1 auto; display: flex; flex-wrap: nowrap; justify-content: flex-end; gap: 6px; } .ax-row__acts form { margin: 0; } .ax-row__acts .btn { padding: 4px 8px; font-size: .7rem; white-space: nowrap; }
    .ax-row__who { flex-basis: calc(100% - 40px); } .ax-row .ax-row__detail { display: none; }
    .sh-renew { gap: 4px; } .sh-renew .input { padding: 3px 6px; font-size: .7rem; } .sh-renew .btn { padding: 4px 8px; font-size: .7rem; }
    .sh-link .sh-copy { margin-top: 2px; } .sh-copy .input { font-size: .68rem; padding: 4px 8px; height: 30px; } .sh-copy .btn { padding: 4px 8px; font-size: .7rem; }
}

/* phone «منو» sheet */
.nav__menu { appearance: none; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
.msheet { position: fixed; inset-inline: 8px; bottom: calc(72px + env(safe-area-inset-bottom, 0px)); z-index: 70; display: grid; gap: 4px; padding: 8px; background: #fff; border-radius: 12px; box-shadow: 0 0 0 1px #d3e1ec, 0 18px 36px -12px rgba(16, 36, 79, .45); }
.msheet[hidden] { display: none; }
.msheet a { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; color: var(--ink, #10244f); text-decoration: none; font-weight: 600; background: #f1f6fb; }
.msheet a .ico { width: 20px; height: 20px; color: #2563eb; } .msheet a.is-on { background: #2563eb; color: #fff; } .msheet a.is-on .ico { color: #fff; }
.msheet .count { margin-inline-start: auto; background: #0e9f93; color: #fff; border-radius: 12px; padding: 0 8px; font-size: .75rem; }
@media (min-width: 901px) { .msheet, .nav__menu { display: none !important; } }

/* directory (patient): compact tabs next to the title, 2 tiles per row, calm cards on phones */
.dr-chip--near { cursor: pointer; } .dr-chip--near span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 12px; background: #eef4f8; font-weight: 600; font-size: .84rem; } .dr-chip--near.is-on span { background: #2563eb; color: #fff; }
.dr-chip--near { border: 0; background: none; padding: 0; font: inherit; text-decoration: none; color: inherit; }
@media (max-width: 760px) {
    .dr-head.head--tabs { display: flex; align-items: center; flex-wrap: nowrap; gap: 8px; } .dr-head h1 { font-size: 1.05rem; white-space: nowrap; }
    .dr-head .dr-tabs { margin-inline-start: auto; padding: 2px; gap: 2px; } .dr-head .dr-tabs a { padding: 3px 8px; font-size: .74rem; } .dr-head .dr-tabs a b { font-size: .64rem; padding: 0 5px; min-width: 16px; }
    .dr-mine-boxes { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px; } .dr-mbox { padding: 8px; gap: 8px; flex-direction: column; align-items: flex-start; text-align: start; } .dr-mbox b { font-size: .86rem; } .dr-mbox small { font-size: .7rem; line-height: 1.5; }
    .dr-card { gap: 6px; padding: 10px; }
    .dr-card__top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; }
    .dr-card__who { min-width: 0; } .dr-card__who a { font-size: .95rem; } .dr-card__who small { font-size: .72rem; color: var(--ink-3); }
    .dr-card__badges .badge { background: #eef3f8 !important; color: #5a6b86 !important; font-weight: 500; font-size: .7rem; }
    .dr-card__foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; color: var(--ink-3); font-size: .74rem; }
    .dr-card__foot .btn--solid, .dr-card__foot .btn--line { background: #2563eb !important; color: #fff !important; border: 0; box-shadow: none; }
    .dr-card__rate { color: #7c8fb0 !important; font-size: .76rem; }
}

/* reminders: equal kind chips (max two lines on phones), note + repeat on one row */
.rm-add__kinds { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.rm-add__kinds label > span { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 6px; width: 100%; font-size: .84rem; white-space: nowrap; }
.rm-add__row--note { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 8px; }
@media (max-width: 700px) { .rm-add__kinds { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; } .rm-add__kinds label > span { font-size: .72rem; padding: 4px; gap: 4px; } .rm-add__kinds .hd__ico { width: 22px; height: 22px; } .rm-add__kinds .hd__ico .ico { width: 12px; height: 12px; } .rm-add__row--note { grid-template-columns: minmax(0, 1fr) 120px; } }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* labels are placeholders now: profile forms are one column of plain fields */
.pf-form .field { display: block; } .pf-form .field > small { margin-top: 2px; }
@media (max-width: 700px) {
    .dr-head { flex-wrap: wrap; row-gap: 6px; }
    .dr-head .dr-tabs { max-width: 100%; margin-inline-start: 0; flex: 1 1 auto; min-width: 0; }
    .dr-head .dr-tabs a { flex: 1 1 auto; min-width: 0; justify-content: center; padding: 3px 6px; gap: 3px; }
}
.rm-add__row--note .rm-add__title { grid-column: auto; }
.rm-add__kinds label { display: block; min-width: 0; } .rm-add__kinds label > span { display: flex; align-items: center; justify-content: center; width: 100%; min-width: 0; text-align: center; line-height: 1.3; }
@media (max-width: 700px) { .rm-add__kinds { grid-template-columns: repeat(3, minmax(0, 1fr)); } .rm-add__kinds label > span { flex-direction: column; gap: 3px; padding: 6px 2px; min-height: 58px; white-space: normal; } .rm-add__row--note { grid-template-columns: minmax(0, 1fr) 128px; } }
/* directory cards: light grey inner items on every screen size; only the main action stays strong */
.dr-card__badges .badge { background: #eef3f8 !important; color: #5a6b86 !important; font-weight: 500; }
.dr-card__rate { color: #7c8fb0 !important; }
.dr-card__foot { color: var(--ink-3); }
.dr-card__foot .btn--solid, .dr-card__foot .btn--line { background: #2563eb !important; color: #fff !important; border: 0; box-shadow: none; }
/* directory tabs: inactive tabs stand out from the page background */
.dr-tabs { background: #d3e0ee; box-shadow: inset 0 0 0 1px #bfd1e3; }
.dr-tabs a:not(.is-active) { background: #e9f0f8; color: #34507a; box-shadow: inset 0 0 0 1px #c3d4e6; }
.dr-tabs a:not(.is-active):hover { background: #f3f7fc; color: #1d4ed8; }
.dr-tabs a:not(.is-active) b { background: #c9d9ea; color: #34507a; }
/* selects: custom arrow, 10px from the left edge */
select.input, select.dr-sel, .field select { -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2312306e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 10px center; background-size: 12px 8px; padding-inline-start: 10px; padding-inline-end: 34px; }
/* need chips: compact so the five fit on two lines */
.dr-chip span, .dr-chip--near span { gap: 3px; padding: 5px 8px; font-size: .74rem; white-space: nowrap; }
.dr-chip span .ico, .dr-chip--near span .ico { width: 13px; height: 13px; }
.dr-chips, .dr-need { gap: 5px !important; }
/* filters summary: visible chevron that flips when open (phones) */
@media (max-width: 900px) {
    .dr-filters__box > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
    .dr-filters__box > summary::-webkit-details-marker { display: none; }
    .dr-filters__box > summary::after { content: ""; margin-inline-start: auto; width: 12px; height: 8px; flex: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2312306e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center; transition: transform .2s; }
    .dr-filters__box[open] > summary::after { transform: rotate(180deg); }
}
@media (max-width: 900px) { body.theme-panel .nav .m-only, body.has-side .nav .m-only { display: flex; } }
/* reminder form on desktop: title | date | time, then note | repeat | add (add on the left) */
@media (min-width: 801px) {
    .rm-add__row { grid-template-columns: minmax(0, 2fr) 190px 130px; align-items: end; }
    .rm-add__row--note { grid-template-columns: minmax(0, 1fr) 190px auto; align-items: end; }
    .rm-add__row--note .rm-add__go { height: 100%; min-height: 44px; white-space: nowrap; }
    .rm-add__kinds { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 800px) { .rm-add__row--note .rm-add__go { grid-column: 1 / -1; } }
/* medical file hub: opened pane gets its own tint; inner sections are slim, borderless, 15px from the sides */
.hl-pane__in:has(> .hx-list), .hl-pane__in .hx-list:has(> .hx) { }
.hl-pane__in .hx-list { padding: 10px 15px; gap: 8px; background: #e2ecf8; border-radius: 12px; }
.hl-pane__in .hx-list > details.hx { border: 0 !important; border-inline-start: 0 !important; box-shadow: none !important; background: #f6faff !important; border-radius: 12px; transform: none; }
.hl-pane__in .hx-list > details.hx:hover { transform: none; box-shadow: none !important; background: #fff !important; }
.hl-pane__in .hx-list > details.hx > summary { padding: 6px 12px !important; min-height: 0; gap: 10px; background: transparent !important; position: static; }
.hl-pane__in .hx-list > details.hx[open] { background: #fff !important; }
.hl-pane__in .hx-list > details.hx[open] > summary { display: flex; border-bottom: 0; }
.hl-pane__in .hx-list > details.hx .hx__title b { font-size: .95rem; } .hl-pane__in .hx-list > details.hx .hx__title small { font-size: .72rem; }
.hl-pane__in .hx-list > details.hx .hd__ico, .hl-pane__in .hx-list > details.hx summary > .hx__ico { width: 34px; height: 34px; }
.hl-pane__in .hx-list > details.hx .hx__body { padding: 0 12px 12px !important; }
.hl-pane__in .hx-list > details.hx .hx__items li { background: #eef4fb; border: 0; box-shadow: none; }
main#main .hl-pane__in .hx-list > details.hx > summary { padding: 4px 10px !important; }
.hl-pane__in .hx-list > details.hx .hx__title { line-height: 1.3; } .hl-pane__in .hx-list > details.hx .hx__chev { font-size: 1rem; line-height: 1; margin-inline: 4px; }
.hl-pane__in .hx-list > details.hx .btn-share { padding: 3px 9px; }
#appts.section__head { margin-top: 10px; padding-top: 10px; }
@media (max-width: 700px) { #appts.section__head { margin-top: 10px; padding-top: 12px; } }
