:root {
    --pwa-bg: #edf5f3;
    --pwa-surface: #ffffff;
    --pwa-surface-soft: #f5faf9;
    --pwa-primary: #08766f;
    --pwa-primary-strong: #07534f;
    --pwa-primary-soft: #dff5f1;
    --pwa-text: #132522;
    --pwa-muted: #5d706c;
    --pwa-border: #d6e4e1;
    --pwa-danger: #b42318;
    --pwa-danger-soft: #fff1f0;
    --pwa-warning: #8a4b08;
    --pwa-warning-soft: #fff7df;
    --pwa-success: #157347;
    --pwa-success-soft: #e5f7ed;
    --pwa-radius: 20px;
    --pwa-shadow: 0 10px 30px rgba(20, 64, 57, .08);
    --pwa-safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--pwa-bg); -webkit-text-size-adjust: 100%; }
html[lang^='ar'] { font-variant-numeric: lining-nums tabular-nums; }
html, body { margin: 0; padding: 0; }
body {
    min-height: 100dvh;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 100% 0, rgba(36, 175, 157, .12), transparent 260px),
        var(--pwa-bg);
    color: var(--pwa-text);
    font-family: Tahoma, "Segoe UI", system-ui, sans-serif;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
body.sheet-open { overflow: hidden; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }

.wrap {
    width: min(100%, 600px);
    min-height: 100dvh;
    margin: 0 auto;
    padding: max(18px, env(safe-area-inset-top)) 16px calc(96px + var(--pwa-safe-bottom));
}
.app {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 2px 2px 18px;
}
.app > div:last-child { min-width: 0; }
.logo {
    display: grid;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    place-items: center;
    border-radius: 15px;
    background: linear-gradient(145deg, var(--pwa-primary), #16a394);
    box-shadow: 0 8px 20px rgba(8, 118, 111, .2);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 800;
}
.app h1, .app .app-title {
    overflow-wrap: anywhere;
    margin: 0;
    color: var(--pwa-text);
    font-size: clamp(1.08rem, 4.8vw, 1.3rem);
    font-weight: 800;
    line-height: 1.25;
}
.app p { margin: 2px 0 0; color: var(--pwa-muted); font-size: .84rem; }

.card {
    min-width: 0;
    margin-bottom: 14px;
    padding: 18px;
    overflow-wrap: anywhere;
    border: 1px solid rgba(171, 202, 196, .72);
    border-radius: var(--pwa-radius);
    background: var(--pwa-surface);
    box-shadow: var(--pwa-shadow);
}
.card h2 { margin: 0 0 12px; color: var(--pwa-primary-strong); font-size: 1rem; line-height: 1.35; }
.muted { color: var(--pwa-muted); font-size: .9rem; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.row > * { min-width: 0; }

.btn, .btn-secondary, .icon-btn, .link-btn {
    min-width: 44px;
    min-height: 44px;
    cursor: pointer;
}
.btn {
    display: inline-flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: 0;
    border-radius: 14px;
    background: var(--pwa-primary);
    box-shadow: 0 8px 18px rgba(8, 118, 111, .18);
    color: #fff;
    font-size: .95rem;
    font-weight: 750;
    text-align: center;
    text-decoration: none;
}
.btn:active { background: var(--pwa-primary-strong); transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { cursor: wait; opacity: .62; box-shadow: none; }
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border: 1px solid var(--pwa-border);
    border-radius: 13px;
    background: #fff;
    color: var(--pwa-text);
    font-size: .9rem;
    font-weight: 700;
}
.appointment-actions { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 14px; }
.appointment-actions .file-action { min-height: 44px; border: 0; background: transparent; cursor: pointer; }
#appointment-change-panel { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--pwa-border); }
#appointment-change-panel.is-open { display: block; }
#appointment-change-panel[hidden] { display: none !important; }
.appointment-cancel-confirm {
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #fecaca;
  background: #fff7f7;
}
.appointment-cancel-confirm[hidden] { display: none !important; }
.portal-sticky-pay {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--pwa-border);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
}
.portal-sticky-pay__copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.portal-sticky-pay__label {
  font-size: 0.75rem;
  color: var(--pwa-muted, #64748b);
}
.portal-sticky-pay .btn {
  flex-shrink: 0;
  margin: 0;
}
body.has-sticky-pay .pwa-shell,
body.has-sticky-pay #portal-root,
body.has-sticky-pay main {
  padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
}
#appointment-primary-actions[hidden],
#appointment-reschedule-hint[hidden] { display: none !important; }
.reschedule-hint { margin: 8px 0 0; font-size: .9rem; }
.appointment-reminders {
    margin-top: 16px;
    padding-top: 15px;
    border-top: 1px solid var(--pwa-border);
}
.appointment-reminders h3 {
    margin: 0 0 9px;
    color: var(--pwa-primary-strong);
    font-size: .82rem;
    font-weight: 800;
}
.appointment-reminder-list {
    display: grid;
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.appointment-reminder-item {
    display: grid;
    gap: 3px;
    padding: 10px 11px;
    border: 1px solid rgba(171, 202, 196, .72);
    border-radius: 13px;
    background: rgba(255, 255, 255, .78);
}
.appointment-reminder-main {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
}
.appointment-reminder-main strong { min-width: 0; font-size: .84rem; }
.appointment-reminder-channel {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: #e8f1ff;
    color: #205493;
    font-size: .68rem;
    font-weight: 800;
}
.appointment-reminder-channel--whatsapp { background: #e4f7ed; color: #11683d; }
.appointment-reminder-item time { color: var(--pwa-muted); font-size: .74rem; }
.care-plan-card {
    position: relative;
    overflow: hidden;
    border-color: #8dcfc5;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(231, 247, 243, .92)),
        var(--pwa-surface);
}
.care-plan-card::before {
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    width: 5px;
    background: linear-gradient(var(--pwa-primary), #5cc4b4);
    content: "";
}
.care-plan-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.care-plan-head > div { min-width: 0; }
.care-plan-head h2 { margin-bottom: 3px; font-size: 1.08rem; }
.care-plan-mark {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    place-items: center;
    border: 1px solid #9bd8cf;
    border-radius: 14px;
    background: rgba(255, 255, 255, .84);
    box-shadow: 0 7px 16px rgba(8, 118, 111, .1);
    color: var(--pwa-primary);
}
.care-plan-mark svg { width: 24px; height: 24px; }
.care-plan-date { margin: 0; color: var(--pwa-muted); font-size: .8rem; }
.care-plan-sections {
    display: grid;
    gap: 9px;
    margin-top: 15px;
}
.care-plan-section {
    min-width: 0;
    padding: 13px 14px;
    border: 1px solid rgba(141, 207, 197, .72);
    border-radius: 15px;
    background: rgba(255, 255, 255, .82);
}
.care-plan-section h3 {
    margin: 0 0 5px;
    color: var(--pwa-primary);
    font-size: .74rem;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.care-plan-section p {
    margin: 0;
    color: var(--pwa-text);
    font-size: .9rem;
    line-height: 1.65;
    white-space: pre-line;
}
.prescription-card { border-color: rgba(141, 207, 197, .72); }
.portal-card--queue-empty .state--compact { padding: 8px 0 0; }
.portal-card--queue-empty .state-title { font-size: 1rem; }
.articles-search {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}
.articles-search .fld { width: 100%; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
#appointment-new-date { width: 100%; min-height: 48px; margin: 8px 0 12px; padding: 10px 12px; border: 1px solid var(--pwa-border); border-radius: 13px; background: #fff; color: var(--pwa-text); font: inherit; }
#appointment-slots .slot-grid { margin-top: 8px; }
.error-text { color: #b42318; font-size: .9rem; }
:focus-visible { outline: 3px solid rgba(8, 118, 111, .35); outline-offset: 3px; }

.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.section-head h2 { margin-bottom: 4px; }
.section-kicker {
    display: block;
    margin-bottom: 4px;
    color: var(--pwa-muted);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.portal-card--priority { border-color: #83d5ca; background: linear-gradient(145deg, #fff, #f2fbf9); }
.queue-pos { color: var(--pwa-primary); font-size: clamp(1.75rem, 10vw, 2.55rem); font-weight: 850; line-height: 1.15; }
.queue-status { display: flex; align-items: center; gap: 10px; }
.status-dot { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; background: #19a974; box-shadow: 0 0 0 6px rgba(25, 169, 116, .12); }
.med { padding: 13px 0; border-top: 1px solid var(--pwa-border); }
.med:first-of-type { border-top: 0; }
.med .name { color: var(--pwa-text); font-weight: 750; }
.med .meta { margin-top: 3px; color: var(--pwa-muted); font-size: .82rem; }
.qr { display: grid; place-items: center; padding: 10px 0 2px; }
.qr img { display: block; width: min(200px, 62vw); height: auto; aspect-ratio: 1; }
.file {
    display: flex;
    min-height: 52px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--pwa-border);
}
.file:first-of-type { border-top: 0; }
.file > :first-child { min-width: 0; overflow-wrap: anywhere; }
.file a, a.file { color: inherit; text-decoration: none; }
.file .file-action { display: inline-flex; min-height: 44px; align-items: center; color: var(--pwa-primary); font-size: .86rem; font-weight: 750; }

.banner {
    position: fixed;
    z-index: 35;
    inset-inline: 12px;
    bottom: calc(12px + var(--pwa-safe-bottom));
    max-width: 560px;
    min-height: 44px;
    margin-inline: auto;
    padding: 11px 16px;
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(19, 37, 34, .18);
    font-size: .85rem;
    font-weight: 700;
    text-align: center;
}
.banner.offline { background: var(--pwa-warning-soft); color: var(--pwa-warning); }
.banner.online { background: var(--pwa-success-soft); color: var(--pwa-success); }

.skeleton {
    border-radius: 9px;
    background: linear-gradient(90deg, #dce8e5 25%, #edf4f2 42%, #dce8e5 64%);
    background-size: 400% 100%;
    animation: pwa-skeleton 1.35s ease infinite;
}
@keyframes pwa-skeleton { from { background-position: 100% 50%; } to { background-position: 0 50%; } }
.sk-line { height: 14px; margin: 9px 0; }
.state { padding: 30px 10px; text-align: center; }
.state-icon {
    display: grid;
    width: 58px;
    height: 58px;
    margin: 0 auto 14px;
    place-items: center;
    border-radius: 18px;
    background: var(--pwa-primary-soft);
    color: var(--pwa-primary);
}
.state-icon svg { width: 28px; height: 28px; }
.state-icon--warn { background: var(--pwa-warning-soft); color: var(--pwa-warning); }
.state-icon--error { background: var(--pwa-danger-soft); color: var(--pwa-danger); }
.state-icon--empty { background: #edf2f1; color: var(--pwa-muted); }
.state-title { margin: 0; color: var(--pwa-text); font-weight: 700; }
.state-copy { margin: 6px auto 0; color: var(--pwa-muted); font-size: .88rem; }
.state-action { width: auto; min-width: 160px; margin-top: 18px; }
.badge { display: inline-flex; min-height: 32px; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: .76rem; font-weight: 800; }
.badge.ok { background: var(--pwa-success-soft); color: var(--pwa-success); }
.badge.bad { background: var(--pwa-danger-soft); color: var(--pwa-danger); }
.verify-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.verify-head .state-icon { width: 44px; height: 44px; flex: 0 0 44px; margin: 0; border-radius: 14px; }
.verify-head p { margin: 4px 0 0; }

/* Help launcher and accessible bottom sheet. */
.help-fab {
    position: fixed;
    z-index: 40;
    inset-inline-end: max(16px, env(safe-area-inset-right));
    bottom: calc(16px + var(--pwa-safe-bottom));
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border: 0;
    border-radius: 18px;
    background: var(--pwa-primary-strong);
    box-shadow: 0 10px 24px rgba(7, 83, 79, .28);
    color: #fff;
    cursor: pointer;
}
.help-fab svg { width: 24px; height: 24px; }
.help-tip {
    position: fixed;
    z-index: 39;
    /* Sit above the ? FAB so tips never cover booking slot grids / primary CTAs. */
    inset-inline-end: 16px;
    bottom: calc(76px + var(--pwa-safe-bottom));
    display: none;
    max-width: min(260px, calc(100vw - 32px));
    min-height: 46px;
    align-items: center;
    gap: 6px;
    padding: 8px 8px 8px 12px;
    border-radius: 14px;
    background: var(--pwa-text);
    box-shadow: var(--pwa-shadow);
    color: #fff;
    font-size: .8rem;
}
[dir="rtl"] .help-tip { padding: 8px 12px 8px 8px; }
.help-tip button, .help-close {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    place-items: center;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: inherit;
    cursor: pointer;
}
.help-tip button svg, .help-close svg { width: 22px; height: 22px; }
.help-backdrop {
    position: fixed;
    z-index: 50;
    inset: 0;
    visibility: hidden;
    background: rgba(11, 30, 27, .56);
    opacity: 0;
    transition: opacity .2s ease, visibility .2s;
}
.help-backdrop.is-open { visibility: visible; opacity: 1; }
.help-sheet {
    position: fixed;
    z-index: 60;
    inset-inline: 0;
    bottom: 0;
    width: min(100%, 600px);
    max-height: min(82dvh, 680px);
    margin: 0 auto;
    padding: 8px 16px calc(18px + var(--pwa-safe-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--pwa-border);
    border-bottom: 0;
    border-radius: 24px 24px 0 0;
    background: var(--pwa-surface);
    box-shadow: 0 -18px 44px rgba(19, 37, 34, .2);
    transform: translateY(105%);
    transition: transform .24s ease;
}
.help-sheet.is-open { transform: translateY(0); }
.help-grip { width: 42px; height: 5px; margin: 4px auto 7px; border-radius: 999px; background: var(--pwa-border); }
.help-head {
    position: sticky;
    z-index: 1;
    top: -8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 0;
    background: var(--pwa-surface);
}
.help-head h2 { margin: 0; color: var(--pwa-primary-strong); font-size: 1.05rem; }
.help-close { color: var(--pwa-muted); }
.help-item { border-top: 1px solid var(--pwa-border); }
.help-item summary {
    display: flex;
    min-height: 54px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 2px;
    cursor: pointer;
    font-size: .92rem;
    font-weight: 750;
    list-style: none;
}
.help-item summary::-webkit-details-marker { display: none; }
.help-item summary::after { content: "+"; color: var(--pwa-primary); font-size: 1.25rem; font-weight: 500; }
.help-item[open] summary::after { content: "−"; }
.help-a { margin: -2px 2px 15px; color: var(--pwa-muted); font-size: .88rem; }

/* Booking */
.booking-header { padding-bottom: 8px; }
.booking-eyebrow { font-weight: 700; }
.booking-steps {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin: 4px 0 16px;
    padding-top: 6px;
}
.booking-step-track { position: absolute; z-index: 0; top: 20px; inset-inline: 12%; height: 3px; border-radius: 99px; background: var(--pwa-border); }
.booking-step-fill { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--pwa-primary); transition: width .24s ease; }
.booking-step { position: relative; z-index: 1; display: flex; min-width: 0; flex-direction: column; align-items: center; gap: 6px; color: var(--pwa-muted); font-size: .7rem; font-weight: 700; line-height: 1.25; text-align: center; }
.booking-step-num { display: grid; width: 31px; height: 31px; place-items: center; border: 2px solid var(--pwa-border); border-radius: 50%; background: var(--pwa-bg); font-size: .78rem; }
.booking-step.is-active { color: var(--pwa-primary-strong); }
.booking-step.is-active .booking-step-num { border-color: var(--pwa-primary); background: var(--pwa-primary); color: #fff; }
.booking-step.is-done { color: var(--pwa-success); }
.booking-step.is-done .booking-step-num { border-color: #8fd6ad; background: var(--pwa-success-soft); color: var(--pwa-success); }
.doctor-hero { display: flex; align-items: center; gap: 14px; background: linear-gradient(145deg, #fff, #effaf8); border-color: #9ddbd2; }
.doctor-avatar { display: grid; width: 68px; height: 68px; flex: 0 0 68px; place-items: center; overflow: hidden; border-radius: 20px; background: var(--pwa-primary); color: #fff; font-size: 1.35rem; font-weight: 800; }
.doctor-avatar--brand,
.doctor-avatar--photo { padding: 0; border: 1px solid var(--pwa-border); background: #fff; }
.doctor-avatar img { display: block; width: 100%; height: 100%; border-radius: 14px; object-fit: cover; }
.doctor-meta { min-width: 0; }
.doctor-clinic-name { margin: 0 0 2px; color: var(--pwa-muted); font-size: .74rem; font-weight: 700; }
.doctor-name { margin: 0; overflow-wrap: anywhere; font-size: 1.12rem; font-weight: 850; line-height: 1.3; }
.doctor-specialty-badge { display: inline-flex; margin-top: 7px; padding: 4px 10px; border-radius: 99px; background: var(--pwa-primary-soft); color: var(--pwa-primary-strong); font-size: .76rem; font-weight: 750; }
.doctor-bio, .about-text { margin: 9px 0 0; color: var(--pwa-muted); font-size: .84rem; }
.about-title { margin: 0 0 6px; color: var(--pwa-primary); font-size: .75rem; letter-spacing: .05em; text-transform: uppercase; }
.about-text { color: var(--pwa-text); white-space: pre-line; }
.booking-panel { scroll-margin-top: max(12px, env(safe-area-inset-top)); }
.panel-head h2 { margin-bottom: 3px; }
.section-hint { margin: 0 0 14px; }
.date-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 15px; padding: 8px; border: 1px solid var(--pwa-border); border-radius: 16px; background: var(--pwa-surface-soft); }
.date-nav-center { flex: 1; min-width: 0; text-align: center; }
.date-nav-weekday { margin: 0; color: var(--pwa-primary-strong); font-weight: 850; }
.date-nav-sub, .date-nav-count { margin: 2px 0 0; font-size: .75rem; }
.date-nav-btn { display: grid; width: 44px; height: 44px; flex: 0 0 44px; place-items: center; border: 1px solid var(--pwa-border); border-radius: 13px; background: #fff; color: var(--pwa-primary-strong); cursor: pointer; }
.date-nav-btn svg { width: 20px; height: 20px; }
[dir="rtl"] .date-nav-btn svg { transform: scaleX(-1); }
.date-nav-btn:disabled { cursor: not-allowed; opacity: .35; }
.booking-slots .loading-label { margin: 12px 0 0; text-align: center; }
.booking-slots.is-loaded .slot-skeleton, .booking-slots.is-loaded .loading-label { display: none; }
.slot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.slot-skeleton-cell { height: 48px; }
.slot-btn { min-width: 0; min-height: 48px; padding: 10px 8px; border: 1px solid var(--pwa-border); border-radius: 13px; background: #fff; color: var(--pwa-text); cursor: pointer; font-size: .88rem; font-weight: 750; }
.slot-btn.active { border-color: var(--pwa-primary); background: var(--pwa-primary); color: #fff; box-shadow: 0 7px 16px rgba(8, 118, 111, .2); }
.selected-banner { margin-bottom: 5px; padding: 13px 14px; border: 1px solid #9ddbd2; border-radius: 15px; background: var(--pwa-primary-soft); }
.selected-label { margin: 0 0 3px; color: var(--pwa-primary); font-size: .7rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.selected-value { margin: 0; color: var(--pwa-primary-strong); font-weight: 850; }
.link-btn { display: inline-flex; align-items: center; margin: 2px 0 12px; padding: 0 4px; border: 0; background: transparent; color: var(--pwa-primary); font-size: .86rem; font-weight: 750; text-decoration: underline; text-underline-offset: 3px; }
.form-grid { display: grid; gap: 15px; }
.form-row { display: grid; gap: 15px; }
.form-field label, .gender-field legend { display: block; margin-bottom: 6px; color: var(--pwa-text); font-size: .82rem; font-weight: 750; }
.gender-field { margin: 0; padding: 0; border: 0; }
.gender-pills { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gender-pill { position: relative; cursor: pointer; }
.gender-pill input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.gender-pill span { display: flex; min-height: 48px; align-items: center; justify-content: center; padding: 10px; border: 1px solid var(--pwa-border); border-radius: 13px; background: #fff; font-size: .9rem; font-weight: 750; }
.gender-pill input:checked + span { border-color: var(--pwa-primary); background: var(--pwa-primary-soft); color: var(--pwa-primary-strong); }
.gender-pill input:focus-visible + span { outline: 3px solid rgba(8, 118, 111, .35); outline-offset: 2px; }
.fld {
    width: 100%;
    min-height: 50px;
    padding: 12px 14px;
    border: 1px solid var(--pwa-border);
    border-radius: 13px;
    background: #fff;
    color: var(--pwa-text);
    font-size: 1rem;
}
.fld:focus { border-color: var(--pwa-primary); outline: 3px solid rgba(8, 118, 111, .15); }
.field-hint { margin: 5px 0 0; font-size: .76rem; }
.form-error { padding: 12px 14px; border: 1px solid #f3b4af; border-radius: 13px; background: var(--pwa-danger-soft); color: var(--pwa-danger); font-size: .86rem; font-weight: 700; }
.btn-primary { min-height: 52px; }
.success-card { padding-block: 30px; text-align: center; }
.success-card .state-icon { background: var(--pwa-success-soft); color: var(--pwa-success); }
.success-title { margin: 0; font-size: 1.08rem; font-weight: 850; }
.success-detail { margin: 7px 0 0; color: var(--pwa-muted); font-size: .9rem; }

/* Health tips */
.article-card { display: block; padding: 0; overflow: hidden; color: inherit; text-decoration: none; }
.article-cover { display: block; width: 100%; height: auto; aspect-ratio: 16 / 8; object-fit: cover; }
.article-card-body { padding: 16px 18px 18px; }
.article-card h2 { margin: 0 0 6px; color: var(--pwa-text); font-size: 1.05rem; }
.article-card h2 a { display: inline-flex; min-height: 44px; align-items: center; color: inherit; text-decoration: none; }
.article-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 10px 0 0; color: var(--pwa-muted); font-size: .76rem; }
.article-back { display: inline-flex; min-height: 44px; align-items: center; color: var(--pwa-primary); font-size: .86rem; font-weight: 750; text-decoration: none; }
.article-title { margin: 4px 0 8px; color: var(--pwa-text); font-size: clamp(1.35rem, 6vw, 1.8rem); line-height: 1.25; }
.article-lead { color: #40534f; font-size: 1rem; }
.article-body { margin-top: 18px; line-height: 1.75; }
.article-body img, .article-inline-image { display: block; width: auto; max-width: 100%; height: auto; margin: 1rem 0; border-radius: 14px; }
.article-body iframe, .article-body video, .article-body table { max-width: 100%; }
.article-body table { display: block; overflow-x: auto; }
.article-body blockquote { margin-inline: 0; padding-inline-start: 1rem; border-inline-start: 3px solid #2baf9f; color: var(--pwa-muted); }
.engagement-row { display: flex; align-items: center; gap: 12px; }
.like-btn { display: grid; width: 48px; height: 48px; flex: 0 0 48px; place-items: center; border: 1px solid var(--pwa-border); border-radius: 16px; background: #fff; color: var(--pwa-muted); cursor: pointer; }
.like-btn[aria-pressed="true"] { border-color: #f2aaa4; background: var(--pwa-danger-soft); color: var(--pwa-danger); }
.like-btn svg { width: 23px; height: 23px; }
.comment { padding: 12px 0; border-bottom: 1px solid var(--pwa-border); }
.comment-author { margin: 0; font-size: .88rem; font-weight: 750; }
.comment-body { margin: 4px 0 0; color: #40534f; font-size: .86rem; }
.comment-compose { display: grid; gap: 9px; margin-top: 14px; }
.comment-input { width: 100%; min-height: 96px; resize: vertical; padding: 12px 13px; border: 1px solid var(--pwa-border); border-radius: 13px; color: var(--pwa-text); font-size: 1rem; }
.comment-input:focus { border-color: var(--pwa-primary); outline: 3px solid rgba(8, 118, 111, .15); }
.comment-status { min-height: 22px; margin: 0; color: var(--pwa-danger); font-size: .8rem; }

@media (min-width: 480px) {
    .wrap { padding-inline: 20px; }
    .card { padding: 20px; }
    .care-plan-sections { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .slot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .form-row { grid-template-columns: 1fr 1fr; }
    .comment-compose { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
    .comment-compose .btn { width: auto; }
}
@media (max-width: 359px) {
    .wrap { padding-inline: 12px; }
    .card { padding: 15px; border-radius: 17px; }
    .doctor-avatar { width: 58px; height: 58px; flex-basis: 58px; }
    .help-tip { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
