@font-face {
  font-family: "Vazirmatn";
  src: url("./fonts/Vazirmatn.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #e8f0ff;
  --mint: #f2f6ff;
  --ink: #172033;
  --muted: #667085;
  --line: #dce5f2;
  --danger: #b42318;
  --white: #ffffff;
  --shadow: 0 26px 70px rgba(37, 99, 235, 0.13);
  font-family: "Vazirmatn", Tahoma, Arial, sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: #f4f7fb; }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 14%, rgba(96, 165, 250, 0.18), transparent 30%),
    radial-gradient(circle at 92% 90%, rgba(37, 99, 235, 0.10), transparent 28%),
    #f4f7fb;
}

button, input, textarea, select { font: inherit; }
button, a, label { -webkit-tap-highlight-color: transparent; }

.ambient {
  position: fixed;
  z-index: 0;
  width: 340px;
  height: 340px;
  border: 1px solid rgba(13, 118, 110, 0.08);
  border-radius: 42% 58% 63% 37%;
  pointer-events: none;
}
.ambient-one { top: -180px; right: -110px; transform: rotate(18deg); }
.ambient-two { bottom: -220px; left: -80px; transform: rotate(-28deg) scale(1.25); }

.page-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(390px, 0.92fr) minmax(480px, 1.08fr);
  width: min(1180px, calc(100% - 48px));
  min-height: min(760px, calc(100vh - 48px));
  margin: 24px auto;
  overflow: hidden;
  border: 1px solid rgba(13, 118, 110, 0.08);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 710px;
  padding: 52px 48px 42px;
  overflow: hidden;
  color: var(--white);
  background:
    linear-gradient(155deg, rgba(255,255,255,.05), transparent 45%),
    linear-gradient(150deg, #0c7169 0%, #07544f 100%);
}

.brand-panel::before,
.brand-panel::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 50%;
}
.brand-panel::before { width: 430px; height: 430px; left: -230px; top: 170px; }
.brand-panel::after { width: 250px; height: 250px; right: -130px; bottom: -50px; }

.brand-lockup { position: relative; z-index: 1; display: flex; align-items: center; gap: 15px; }
.brand-lockup h1 { margin: 1px 0 0; font-size: 25px; letter-spacing: -1px; }
.brand-kicker { margin: 0; font: 600 10px/1.2 "Vazirmatn", sans-serif; letter-spacing: 2.2px; text-transform: uppercase; opacity: .68; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 21px;
  background: rgba(255,255,255,.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
}
.brand-mark svg { width: 47px; height: 47px; fill: rgba(255,255,255,.92); }
.brand-mark .lobe-left, .dashboard-logo .lobe-left { fill: #dbeafe; }
.brand-mark .mark-disc, .dashboard-logo .mark-disc { fill: #fff; }
.brand-mark .mark-line { fill: none; stroke: var(--primary); stroke-linecap: round; stroke-width: 6; }

.brand-copy { position: relative; z-index: 1; margin: auto 0; padding: 54px 0 38px; }
.eyebrow { display: inline-block; margin-bottom: 18px; padding: 7px 12px; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; background: rgba(255,255,255,.08); font-size: 12px; }
.brand-copy h2 { margin: 0 0 20px; font-size: clamp(31px, 3.2vw, 47px); line-height: 1.5; letter-spacing: -1.6px; }
.brand-copy p { max-width: 380px; margin: 0; color: rgba(255,255,255,.72); font-size: 14px; line-height: 2; }

.feature-row { position: relative; z-index: 1; display: flex; gap: 24px; padding-top: 28px; border-top: 1px solid rgba(255,255,255,.12); }
.feature-item { display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,.84); font-size: 12px; }
.feature-icon { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 8px; background: rgba(255,255,255,.12); font: 400 20px/1 Arial; }
.calendar-icon::before { content: ""; width: 11px; height: 10px; border: 1.5px solid white; border-radius: 2px; box-shadow: inset 0 3px rgba(255,255,255,.2); }
.shield-icon::before { content: ""; width: 10px; height: 12px; border: 1.5px solid white; border-radius: 6px 6px 7px 7px; }

.auth-panel { display: flex; flex-direction: column; min-width: 0; padding: 42px clamp(34px, 5vw, 80px) 28px; }
.mobile-brand { display: none; }
.auth-card { width: min(100%, 440px); margin: auto; }
.auth-step { position: relative; display: none; animation: step-in .32s ease both; }
.auth-step.active { display: block; }
@keyframes step-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.step-heading { margin-bottom: 32px; }
.step-heading.compact { margin-bottom: 22px; }
.step-badge { display: inline-flex; margin-bottom: 12px; padding: 6px 10px; border-radius: 999px; color: var(--primary); background: var(--primary-soft); font-size: 11px; font-weight: 700; }
.step-heading h2 { margin: 0 0 10px; font-size: clamp(26px, 3vw, 34px); letter-spacing: -1.1px; }
.step-heading p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.9; }

form label { display: block; margin-bottom: 9px; font-size: 12px; font-weight: 700; }
.phone-field { position: relative; display: flex; align-items: center; height: 59px; border: 1.5px solid var(--line); border-radius: 16px; background: #fbfdfc; transition: .2s ease; }
.phone-field:focus-within { border-color: var(--primary); background: var(--white); box-shadow: 0 0 0 4px rgba(13,118,110,.09); }
.phone-field.invalid { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(180,35,24,.07); }
.phone-field input { width: 100%; height: 100%; padding: 0 52px 0 60px; border: 0; outline: 0; color: var(--ink); background: transparent; direction: ltr; text-align: left; font: 600 17px/1 "Vazirmatn", sans-serif; letter-spacing: .5px; }
.phone-field input::placeholder { color: #a5b2ae; font-weight: 400; }
.country-code { position: absolute; left: 16px; padding-right: 12px; border-right: 1px solid var(--line); color: var(--muted); direction: ltr; font: 500 13px/1 "Vazirmatn", sans-serif; }
.input-icon { position: absolute; right: 17px; display: grid; place-items: center; color: var(--primary); }
.input-icon svg { width: 21px; fill: none; stroke: currentColor; stroke-linejoin: round; stroke-width: 1.7; }
.field-hint { display: block; margin-top: 8px; color: #8a9893; font-size: 10.5px; }
.field-error { min-height: 20px; margin: 6px 2px 2px; color: var(--danger); font-size: 11px; }
.field-error.centered { text-align: center; }

.primary-button { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 56px; margin-top: 12px; border: 0; border-radius: 16px; color: var(--white); background: linear-gradient(135deg, var(--primary), var(--primary-dark)); box-shadow: 0 13px 25px rgba(13,118,110,.22); cursor: pointer; font-weight: 700; transition: .2s ease; }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 16px 30px rgba(13,118,110,.26); }
.primary-button:active { transform: translateY(1px); }
.primary-button svg { width: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }

.secure-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 23px; color: var(--muted); font-size: 10.5px; }
.secure-note svg { width: 18px; fill: none; stroke: var(--primary); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.back-button { position: absolute; top: 0; left: 0; display: grid; place-items: center; width: 39px; height: 39px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: var(--white); cursor: pointer; }
.back-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; }

.otp-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; }
.otp-grid input { width: 100%; min-width: 0; aspect-ratio: 1/1.1; border: 1.5px solid var(--line); border-radius: 13px; outline: 0; color: var(--ink); background: #fbfdfc; text-align: center; font: 700 22px/1 "Vazirmatn", sans-serif; transition: .2s; }
.otp-grid input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(13,118,110,.09); }
.test-code { margin: 2px 0 0; color: var(--muted); text-align: center; font-size: 10px; }
.test-code b { color: var(--primary); letter-spacing: 2px; }
.phone-display { display: inline-block; direction: ltr; unicode-bidi: isolate; white-space: nowrap; font-variant-numeric: tabular-nums; }
.resend-row { display: flex; justify-content: center; gap: 8px; margin-top: 22px; color: var(--muted); font-size: 11px; }
.resend-row button { padding: 0; border: 0; color: var(--primary); background: none; cursor: pointer; }
.resend-row button:disabled { color: #9aaaa5; cursor: default; }

.registration-step { padding-top: 2px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-grid label { margin: 0; color: var(--muted); font-size: 10.5px; }
.form-grid input, .form-grid select { width: 100%; height: 46px; margin-top: 6px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; outline: 0; color: var(--ink); background: #fbfdfc; }
.form-grid input:focus, .form-grid select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin: 16px 0 8px; }
.upload-box { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 104px; margin: 0; border: 1px dashed #9bc8c1; border-radius: 14px; color: var(--primary); background: var(--mint); cursor: pointer; }
.upload-box input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-box strong { font-size: 10.5px; }
.upload-box small { margin-top: 4px; color: var(--muted); font-size: 9px; font-weight: 400; }
.upload-icon { display: grid; place-items: center; width: 26px; height: 26px; margin-bottom: 7px; border-radius: 8px; color: white; background: var(--primary); font: 400 19px/1 Arial; }

.auth-footer { display: flex; justify-content: center; gap: 6px; margin-top: 28px; color: var(--muted); font-size: 10.5px; }
.auth-footer a { color: var(--primary); font-weight: 700; text-decoration: none; }
.toast { position: fixed; z-index: 10; right: 50%; bottom: 24px; padding: 12px 18px; border-radius: 13px; color: white; background: #173c38; box-shadow: 0 12px 35px rgba(0,0,0,.18); opacity: 0; pointer-events: none; transform: translate(50%, 20px); transition: .25s; font-size: 12px; }
.toast.show { opacity: 1; transform: translate(50%, 0); }

/* Authenticated home */
.dashboard[hidden], .modal[hidden] { display: none; }
body.modal-open { overflow: hidden; }
.dashboard { position: relative; z-index: 2; min-height: 100vh; background: #f4f8f7; }
.dashboard-header { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; min-height: 82px; padding: 12px max(24px, calc((100% - 1160px) / 2)); border-bottom: 1px solid #e1ebe8; background: rgba(255,255,255,.94); box-shadow: 0 5px 22px rgba(26,65,60,.04); backdrop-filter: blur(14px); }
.dashboard-brand, .dashboard-user { display: flex; align-items: center; }
.dashboard-brand { gap: 11px; color: var(--primary-dark); }
.dashboard-logo { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; background: var(--primary); box-shadow: 0 8px 18px rgba(13,118,110,.2); }
.dashboard-logo svg { width: 35px; fill: white; }
.dashboard-logo .mark-line { fill: none; stroke: var(--primary); stroke-linecap: round; stroke-width: 6; }
.dashboard-brand > span:last-child, .user-copy { display: flex; flex-direction: column; }
.dashboard-brand b { font-size: 17px; }
.dashboard-brand small { color: var(--muted); font-size: 9px; }
.dashboard-user { gap: 10px; }
.user-copy { align-items: flex-end; margin-left: 2px; }
.user-copy small { color: var(--muted); font-size: 9px; }
.user-copy b { font-size: 12px; }
.user-avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; color: var(--primary); background: var(--primary-soft); }
.user-avatar svg { width: 23px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.7; }
.icon-button { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: white; cursor: pointer; }
.icon-button svg { width: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.dashboard-content { width: min(1160px, calc(100% - 48px)); margin: 0 auto; padding: 34px 0 60px; }
.welcome-banner { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 210px; padding: 38px 48px; overflow: hidden; border-radius: 27px; color: white; background: linear-gradient(125deg, #0d766e, #075650); box-shadow: 0 18px 45px rgba(13,96,89,.17); }
.welcome-banner::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 10% 0, rgba(255,255,255,.13), transparent 33%); }
.welcome-banner > div { position: relative; z-index: 1; }
.welcome-kicker { display: inline-block; margin-bottom: 10px; padding: 5px 10px; border: 1px solid rgba(255,255,255,.15); border-radius: 999px; background: rgba(255,255,255,.08); font-size: 10px; }
.welcome-banner h1 { margin: 0 0 9px; font-size: clamp(24px, 3vw, 35px); letter-spacing: -.8px; }
.welcome-banner p { margin: 0; color: rgba(255,255,255,.7); font-size: 12px; }
.welcome-art { display: grid; place-items: center; width: 130px; height: 130px; margin-left: 20px; border: 1px solid rgba(255,255,255,.12); border-radius: 42px; background: rgba(255,255,255,.08); transform: rotate(-5deg); }
.welcome-art svg { width: 77px; fill: rgba(255,255,255,.9); transform: rotate(5deg); }
.welcome-art .art-line { fill: none; stroke: var(--primary); stroke-linecap: round; stroke-width: 5; }
.pulse-ring { position: absolute; width: 180px; height: 180px; border: 1px solid rgba(255,255,255,.07); border-radius: 50%; }
.quick-actions, .request-history { margin-top: 34px; }
.section-heading-row { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 15px; }
.section-heading-row > div > span { color: var(--primary); font-size: 9.5px; font-weight: 700; }
.section-heading-row h2 { margin: 3px 0 0; font-size: 20px; letter-spacing: -.4px; }
.demo-label { padding: 5px 9px; border-radius: 999px; color: #8a6d24; background: #fff7db; font-size: 9px; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.action-card { display: flex; align-items: center; min-height: 108px; padding: 20px 22px; border: 1px solid #e0ebe7; border-radius: 20px; color: var(--ink); background: white; box-shadow: 0 10px 30px rgba(26,69,63,.055); cursor: pointer; text-align: right; transition: .2s ease; }
.action-card:hover { border-color: #b9d9d3; transform: translateY(-2px); box-shadow: 0 14px 32px rgba(26,69,63,.09); }
.action-card.primary-action { color: white; border-color: transparent; background: linear-gradient(135deg, #11837a, #0b6b64); }
.action-icon { display: grid; flex: 0 0 auto; place-items: center; width: 52px; height: 52px; margin-left: 15px; border-radius: 16px; color: var(--primary); background: var(--primary-soft); }
.primary-action .action-icon { color: white; background: rgba(255,255,255,.15); }
.action-icon.support { color: #4865a9; background: #eef2ff; }
.action-icon svg { width: 25px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.action-copy { display: flex; flex: 1; flex-direction: column; }
.action-copy b { margin-bottom: 4px; font-size: 15px; }
.action-copy small { color: var(--muted); font-size: 10px; }
.primary-action .action-copy small { color: rgba(255,255,255,.7); }
.action-arrow, .history-more svg { width: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.action-arrow { opacity: .55; }
.history-list { overflow: hidden; border: 1px solid #e0ebe7; border-radius: 20px; background: white; box-shadow: 0 10px 30px rgba(26,69,63,.04); }
.history-card { display: grid; grid-template-columns: auto minmax(230px, 1fr) 130px 120px auto; align-items: center; gap: 15px; min-height: 88px; padding: 15px 20px; border-bottom: 1px solid #ebf1ef; }
.history-card:last-child { border-bottom: 0; }
.history-icon { display: grid; place-items: center; width: 45px; height: 45px; border-radius: 14px; }
.history-icon svg, .service-icon svg { width: 23px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.medicine { color: #a9612b; background: #fff1e6; }
.imaging { color: #3a66a4; background: #eaf2ff; }
.insurance { color: #7955a5; background: #f3ebff; }
.appointment { color: #19776e; background: #e3f6f2; }
.doctor { color: #337bab; background: #e9f6ff; }
.history-main { display: flex; flex-direction: column; gap: 4px; }
.history-main b { font-size: 12px; }
.history-main span, .history-card time { color: var(--muted); font-size: 9.5px; }
.status { display: inline-flex; align-items: center; width: max-content; gap: 6px; padding: 6px 9px; border-radius: 999px; font-size: 9px; font-weight: 700; }
.status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.pending { color: #a66c13; background: #fff6d8; }
.status.done { color: #16705c; background: #e4f7ef; }
.status.action-needed { color: #a0473c; background: #ffebe8; }
.history-more { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 10px; color: var(--muted); background: #f5f8f7; cursor: pointer; }

/* Request and support dialogs */
.modal { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(9,35,32,.52); backdrop-filter: blur(4px); }
.modal-sheet { position: relative; z-index: 1; width: min(100%, 570px); max-height: calc(100vh - 40px); padding: 30px; overflow: auto; border-radius: 25px; background: white; box-shadow: 0 30px 80px rgba(5,35,32,.25); animation: modal-in .22s ease both; }
.modal-sheet.small-sheet { width: min(100%, 490px); }
@keyframes modal-in { from { opacity: 0; transform: translateY(15px) scale(.98); } }
.modal-close { position: absolute; z-index: 5; top: 18px; left: 18px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); background: white; box-shadow: 0 5px 16px rgba(30,64,175,.08); cursor: pointer; touch-action: manipulation; }
.modal-close svg, .view-back svg { width: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.8; }
.modal-close svg, .modal-close svg * { pointer-events: none; }
.modal-heading { margin-bottom: 22px; padding-left: 46px; }
.modal-heading span { color: var(--primary); font-size: 10px; font-weight: 700; }
.modal-heading h2 { margin: 4px 0 6px; font-size: 22px; }
.modal-heading p { margin: 0; color: var(--muted); font-size: 10px; }
.request-view { display: none; }
.request-view.active { display: block; animation: step-in .2s ease both; }
.service-list { display: grid; gap: 11px; }
.service-card { display: flex; align-items: center; width: 100%; min-height: 78px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 17px; color: var(--ink); background: #fbfdfc; cursor: pointer; text-align: right; transition: .18s; }
.service-card:hover { border-color: #a9d1cb; background: white; transform: translateX(-2px); }
.service-icon { display: grid; flex: 0 0 auto; place-items: center; width: 47px; height: 47px; margin-left: 13px; border-radius: 14px; }
.service-card > span:nth-child(2) { display: flex; flex: 1; flex-direction: column; }
.service-card b { margin-bottom: 3px; font-size: 12px; }
.service-card small { color: var(--muted); font-size: 9px; }
.chevron { width: 18px; fill: none; stroke: #879691; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.view-back { display: inline-flex; align-items: center; gap: 5px; margin: -3px 0 17px; padding: 0; border: 0; color: var(--primary); background: none; cursor: pointer; font-size: 10px; }
.request-view:not(#request-root) .modal-heading { padding-left: 0; }
.imaging-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.imaging-grid button { display: flex; flex-direction: column; min-height: 78px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: #fbfdfc; cursor: pointer; text-align: right; transition: .18s; }
.imaging-grid button:hover { border-color: var(--primary); background: var(--mint); }
.imaging-grid b { font-size: 12px; }
.imaging-grid small { margin-top: 3px; color: var(--muted); font-size: 9px; direction: ltr; text-align: right; }
.support-form label { margin: 13px 0 7px; color: var(--ink); }
.support-form input, .support-form textarea { width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; outline: 0; color: var(--ink); background: #fbfdfc; resize: vertical; }
.support-form input:focus, .support-form textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,118,110,.08); }
.support-form textarea { min-height: 115px; }

@media (max-width: 880px) {
  body { background: #f4faf8; }
  .page-shell { display: block; width: 100%; min-height: 100vh; margin: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .brand-panel { display: none; }
  .auth-panel { min-height: 100vh; padding: max(24px, env(safe-area-inset-top)) 22px max(20px, env(safe-area-inset-bottom)); }
  .mobile-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 30px; color: var(--primary-dark); }
  .brand-mark.small { width: 42px; height: 42px; border: 0; border-radius: 14px; background: var(--primary); }
  .brand-mark.small svg { width: 32px; height: 32px; }
  .mobile-brand strong { font-size: 17px; }
  .auth-card { margin: auto; padding: 30px 24px; border: 1px solid rgba(13,118,110,.08); border-radius: 24px; background: rgba(255,255,255,.96); box-shadow: 0 20px 50px rgba(17,71,65,.1); }
  .auth-footer { margin-top: 26px; }
  .dashboard-content { width: min(100% - 30px, 680px); padding-top: 22px; }
  .dashboard-header { min-height: 72px; padding-inline: 16px; }
  .welcome-banner { min-height: 190px; padding: 30px; }
  .welcome-art { width: 105px; height: 105px; }
  .action-grid { grid-template-columns: 1fr; gap: 12px; }
  .history-card { grid-template-columns: auto 1fr auto; gap: 11px; }
  .history-card time { display: none; }
  .history-card .status { grid-column: 2; }
  .history-more { grid-column: 3; grid-row: 1 / span 2; }
}

@media (max-width: 480px) {
  .auth-panel { padding-inline: 15px; }
  .auth-card { padding: 27px 19px; }
  .step-heading { margin-bottom: 26px; }
  .step-heading h2 { font-size: 27px; }
  .otp-grid { gap: 6px; }
  .otp-grid input { border-radius: 10px; font-size: 19px; }
  .form-grid { grid-template-columns: 1fr; gap: 10px; }
  .registration-step .step-heading p { max-width: 250px; }
  .dashboard-brand small, .user-copy { display: none; }
  .dashboard-logo { width: 42px; height: 42px; border-radius: 14px; }
  .dashboard-brand b { font-size: 14px; }
  .dashboard-user { gap: 7px; }
  .user-avatar { width: 38px; height: 38px; }
  .dashboard-content { width: calc(100% - 24px); padding-bottom: 35px; }
  .welcome-banner { min-height: 174px; padding: 25px 22px; border-radius: 22px; }
  .welcome-banner h1 { max-width: 240px; font-size: 23px; line-height: 1.6; }
  .welcome-banner p { max-width: 225px; line-height: 1.8; }
  .welcome-art { position: absolute !important; left: -27px; bottom: -28px; width: 108px; height: 108px; opacity: .45; }
  .quick-actions, .request-history { margin-top: 27px; }
  .action-card { min-height: 94px; padding: 16px; border-radius: 17px; }
  .action-icon { width: 47px; height: 47px; margin-left: 12px; }
  .action-copy b { font-size: 13px; }
  .action-copy small { font-size: 9px; line-height: 1.7; }
  .history-list { border-radius: 17px; }
  .history-card { padding: 14px 12px; }
  .history-icon { width: 41px; height: 41px; }
  .history-main b { font-size: 10.5px; }
  .modal { align-items: end; padding: 0; }
  .modal-sheet, .modal-sheet.small-sheet { width: 100%; max-height: 90vh; padding: 27px 18px max(24px, env(safe-area-inset-bottom)); border-radius: 25px 25px 0 0; }
  .modal-close { top: 20px; left: 18px; }
  .modal-heading h2 { font-size: 20px; }
  .imaging-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Mobile-only PWA shell */
.page-shell[hidden], .dashboard[hidden] { display: none !important; }
.ambient { display: none; }
body { background: #f4f7fb; }
.page-shell {
  display: block;
  width: 100%;
  max-width: 520px;
  min-height: 100dvh;
  margin: 0 auto;
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, #f7faff 0%, #eef4ff 100%);
  box-shadow: 0 0 60px rgba(30,64,175,.08);
}
.brand-panel { display: none; }
.auth-panel { min-height: 100dvh; padding: max(28px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom)); }
.mobile-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 28px; color: var(--primary-dark); }
.brand-mark.small { width: 44px; height: 44px; border: 0; border-radius: 15px; background: var(--primary); box-shadow: 0 9px 22px rgba(37,99,235,.22); }
.brand-mark.small svg { width: 33px; height: 33px; }
.mobile-brand strong { font-size: 17px; }
.auth-card { width: 100%; max-width: 440px; margin: auto; padding: 29px 22px; border: 1px solid rgba(37,99,235,.09); border-radius: 25px; background: rgba(255,255,255,.97); box-shadow: 0 22px 55px rgba(30,64,175,.10); }
.auth-footer { margin-top: 25px; }
.phone-field:focus-within, .otp-grid input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37,99,235,.09); }
.primary-button { background: linear-gradient(135deg, #3b82f6, #1d4ed8); box-shadow: 0 13px 25px rgba(37,99,235,.23); }
.primary-button:hover { box-shadow: 0 16px 30px rgba(37,99,235,.27); }

#phone-step, #otp-step, #register-step,
#phone-step *, #otp-step *, #register-step * {
  font-family: "Vazirmatn", Tahoma, Arial, sans-serif !important;
}
.login-identity { display: flex; flex-direction: column; align-items: center; margin: 4px 0 38px; text-align: center; }
.login-logo { display: grid; place-items: center; width: 90px; height: 90px; margin-bottom: 15px; border-radius: 29px; background: linear-gradient(145deg, #3b82f6, #1d4ed8); box-shadow: 0 18px 34px rgba(37,99,235,.24); }
.login-logo svg { width: 68px; height: 68px; fill: #fff; }
.login-logo .lobe-left { fill: #dbeafe; }
.login-logo .mark-disc { fill: #fff; }
.login-logo .mark-line { fill: none; stroke: var(--primary); stroke-linecap: round; stroke-width: 5.5; }
.login-identity h1 { margin: 0; color: var(--primary-dark); font-size: 32px; font-weight: 850; letter-spacing: -1.3px; }

.patient-summary { padding: 18px; border: 1px solid #dce6f3; border-radius: 23px; background: #fff; box-shadow: 0 14px 38px rgba(30,64,175,.08); }
.summary-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.summary-icon { display: grid; flex: 0 0 auto; place-items: center; width: 54px; height: 54px; border-radius: 17px; background: linear-gradient(145deg, #3b82f6, #1d4ed8); box-shadow: 0 9px 20px rgba(37,99,235,.20); }
.summary-icon svg { width: 42px; height: 42px; fill: #fff; }
.summary-icon .light-lobe { fill: #dbeafe; }
.summary-icon .summary-plus { fill: none; stroke: var(--primary); stroke-linecap: round; stroke-width: 5.5; }
.summary-heading small { color: var(--primary); font-size: 9px; font-weight: 700; }
.summary-heading h1 { margin: 1px 0 0; color: var(--ink); font-size: 18px; letter-spacing: -.4px; }
.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.summary-item { display: flex; flex-direction: column; justify-content: center; min-height: 70px; padding: 11px 12px; border: 1px solid #e5ecf7; border-radius: 15px; background: #f7faff; }
.summary-item span { margin-bottom: 4px; color: var(--muted); font-size: 8.5px; }
.summary-item b { color: #1e40af; font-size: 11.5px; line-height: 1.65; }
.dashboard-brand > span:last-child { min-width: 0; }
#patient-header-name { display: block; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.profile-form > label, .profile-name-grid label { display: block; margin: 12px 0 0; color: var(--ink); font-size: 10px; font-weight: 700; }
.profile-name-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.profile-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.profile-detail-grid label { display: block; min-width: 0; margin: 0; color: var(--ink); font-size: 9.5px; font-weight: 700; }
.profile-detail-grid input, .profile-detail-grid select { min-width: 0; padding-inline: 10px; font-size: 10.5px; }
.profile-form input, .profile-form select { width: 100%; height: 47px; margin-top: 6px; padding: 0 12px; border: 1px solid var(--line); border-radius: 13px; outline: 0; color: var(--ink); background: #f8faff; }
.profile-form input:focus, .profile-form select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
.profile-form .primary-button { margin-top: 20px; }

.multi-select { min-width: 0; margin: 16px 0 4px; padding: 0; border: 0; }
.multi-select legend { width: 100%; margin-bottom: 9px; color: var(--ink); font-size: 11px; font-weight: 800; }
.multi-select legend small { margin-right: 5px; color: var(--muted); font-size: 8px; font-weight: 500; }
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.choice-grid label { position: relative; display: block; min-width: 0; min-height: 48px; margin: 0; cursor: pointer; }
.choice-grid input { position: absolute; width: 1px !important; height: 1px !important; margin: 0 !important; opacity: 0; pointer-events: none; }
.choice-grid span { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 8px 5px; border: 1px solid var(--line); border-radius: 13px; color: var(--muted); background: #f8faff; font-size: 10px; font-weight: 700; transition: .18s ease; }
.choice-grid input:focus-visible + span { outline: 3px solid rgba(37,99,235,.18); outline-offset: 2px; }
.choice-grid input:checked + span { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-soft); box-shadow: inset 0 0 0 1px rgba(37,99,235,.08); }
.choice-grid input:checked + span::before { content: "✓"; margin-left: 5px; color: var(--primary); font-size: 11px; }
.profile-multi-select { margin-top: 15px; }

/* Larger and safer mobile touch targets */
button, a, input, select, textarea, label { touch-action: manipulation; }
.back-button, .icon-button, .modal-close, .history-more { width: 48px; height: 48px; min-width: 48px; min-height: 48px; }
.form-grid input, .form-grid select, .profile-form input:not([type="checkbox"]), .profile-form select { min-height: 52px; }
.resend-row button, .view-back { min-height: 44px; padding: 8px 4px; }
.mobile-nav .nav-item { min-height: 58px; }
.service-card { min-height: 82px; }

.persian-date-input { padding-left: 42px !important; color: var(--ink); background-color: #f8faff !important; cursor: pointer; caret-color: transparent; }
.persian-date-input::placeholder { color: #7c8aa3; opacity: 1; }
.calendar-sheet { width: min(100%, 520px); }
.calendar-controls { display: grid; grid-template-columns: 48px minmax(0, 1fr) minmax(0, 1fr) 48px; gap: 7px; margin-bottom: 15px; }
.calendar-controls button, .calendar-controls select { height: 48px; min-width: 0; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: #f8faff; }
.calendar-controls button { display: grid; place-items: center; padding: 0; color: var(--primary); cursor: pointer; }
.calendar-controls button:disabled { color: #b8c1d0; background: #f3f5f8; cursor: default; }
.calendar-controls button svg { width: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.9; }
.calendar-controls select { padding: 0 8px; outline: 0; text-align: center; }
.calendar-controls select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.09); }
.calendar-weekdays, .calendar-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.calendar-weekdays { margin-bottom: 6px; color: var(--muted); text-align: center; font-size: 9px; font-weight: 700; }
.calendar-weekdays span { display: grid; place-items: center; min-height: 30px; }
.calendar-days button, .calendar-empty { aspect-ratio: 1 / 1; min-width: 0; border-radius: 12px; }
.calendar-days button { border: 1px solid transparent; color: var(--ink); background: #f7f9fd; cursor: pointer; font-size: 11px; font-weight: 700; transition: .15s ease; }
.calendar-days button:hover { border-color: #bfd2fa; background: var(--primary-soft); }
.calendar-days button.today { border-color: #9bb9f8; color: var(--primary-dark); }
.calendar-days button.selected { border-color: var(--primary); color: white; background: var(--primary); box-shadow: 0 6px 14px rgba(37,99,235,.22); }
.calendar-days button:disabled { color: #c3cad5; background: #fafbfc; cursor: default; }
.calendar-today { width: 100%; min-height: 48px; margin-top: 15px; border: 1px solid #bfd2fa; border-radius: 14px; color: var(--primary-dark); background: var(--primary-soft); cursor: pointer; font-weight: 750; }
.calendar-today[hidden] { display: none; }

@media (max-width: 350px) {
  .calendar-sheet { padding-inline: 12px !important; }
  .calendar-controls { grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr) 44px; gap: 4px; }
  .calendar-weekdays, .calendar-days { gap: 2px; }
  .calendar-days button, .calendar-empty { border-radius: 10px; }
}

/* Full patient profile page */
.dashboard-content[hidden], .profile-page[hidden] { display: none !important; }
.profile-page { width: calc(100% - 24px); margin: 0 auto; padding: 20px 0 36px; animation: step-in .25s ease both; }
.profile-page-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 17px; padding: 4px 2px; }
.profile-back { display: grid; flex: 0 0 auto; place-items: center; width: 48px; height: 48px; padding: 0; border: 1px solid #dce6f3; border-radius: 15px; color: var(--primary); background: white; box-shadow: 0 7px 18px rgba(30,64,175,.07); cursor: pointer; }
.profile-back svg { width: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.profile-page-heading small { color: var(--primary); font-size: 9px; font-weight: 800; }
.profile-page-heading h1 { margin: 1px 0 2px; color: var(--ink); font-size: 22px; }
.profile-page-heading p { margin: 0; color: var(--muted); font-size: 9px; }
.profile-page-form { display: grid; gap: 13px; }
.profile-section { padding: 17px; border: 1px solid #dce6f3; border-radius: 21px; background: white; box-shadow: 0 10px 28px rgba(30,64,175,.05); }
.profile-section-title { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; padding-bottom: 13px; border-bottom: 1px solid #edf1f7; }
.profile-section-title > span { display: grid; flex: 0 0 auto; place-items: center; width: 34px; height: 34px; border-radius: 11px; color: white; background: var(--primary); font-size: 11px; font-weight: 800; }
.profile-section-title h2 { margin: 0 0 2px; font-size: 14px; }
.profile-section-title p { margin: 0; color: var(--muted); font-size: 8px; }
.profile-section > label { display: block; margin: 12px 0 0; color: var(--ink); font-size: 10px; font-weight: 700; }
.profile-save { margin: 3px 0 0; }
.document-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.document-card { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 190px; margin: 0; padding: 9px; border: 1px solid #dce6f3; border-radius: 17px; background: #f8faff; cursor: pointer; transition: .18s ease; }
.document-card:active { border-color: var(--primary); background: var(--primary-soft); transform: scale(.985); }
.document-card > input { position: absolute; width: 1px !important; height: 1px !important; min-height: 1px !important; margin: 0 !important; opacity: 0; pointer-events: none; }
.document-preview { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 1.42 / 1; overflow: hidden; border: 1px dashed #b9c9e4; border-radius: 12px; background: white; }
.document-preview img { width: 100%; height: 100%; object-fit: cover; }
.document-preview img[hidden], .document-placeholder[hidden] { display: none; }
.document-placeholder { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 13px; color: var(--primary); background: var(--primary-soft); }
.document-placeholder svg { width: 24px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.document-copy { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; min-height: 61px; padding-top: 8px; text-align: center; }
.document-copy b { color: var(--ink); font-size: 10px; }
.document-copy small { margin-top: 3px; color: var(--muted); font-size: 7.5px; line-height: 1.6; }
.document-hint { margin: 10px 1px 0; color: var(--muted); font-size: 8px; line-height: 1.8; }

@media (max-width: 340px) {
  .document-grid { grid-template-columns: 1fr; }
  .document-card { min-height: 175px; }
  .profile-section { padding-inline: 13px; }
  .profile-name-grid, .profile-detail-grid { gap: 7px; }
  .profile-detail-grid input, .profile-detail-grid select { padding-inline: 7px; font-size: 9.5px; }
}

/* Compact home transplant duration */
#patient-header-national-id { display: block !important; margin-top: 1px; color: #6f7d93; font-size: 8px; font-weight: 550; direction: rtl; }
.transplant-duration-card { display: flex; align-items: center; gap: 15px; min-height: 112px; padding: 18px 20px; border: 1px solid #cfddf5; border-radius: 22px; background: linear-gradient(135deg, #ffffff, #eef4ff); box-shadow: 0 12px 32px rgba(30,64,175,.08); }
.duration-icon { display: grid; flex: 0 0 auto; place-items: center; width: 58px; height: 58px; border-radius: 18px; color: white; background: linear-gradient(145deg, #3b82f6, #1d4ed8); box-shadow: 0 10px 22px rgba(37,99,235,.22); }
.duration-icon svg { width: 29px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.duration-copy { display: flex; min-width: 0; flex-direction: column; }
.duration-copy span { margin-bottom: 5px; color: var(--muted); font-size: 9.5px; }
.duration-copy b { color: #1e40af; font-size: 23px; line-height: 1.35; letter-spacing: -.7px; }
.transplant-duration-card + .quick-actions { margin-top: 24px; }

@media (max-width: 350px) {
  .transplant-duration-card { min-height: 102px; padding: 15px; }
  .duration-icon { width: 51px; height: 51px; }
  .duration-copy b { font-size: 20px; }
  #patient-header-name { max-width: 112px; }
}

/* Compact mobile home redesign */
.dashboard-header { min-height: 64px; padding: 8px 12px; }
.dashboard-logo { width: 39px; height: 39px; border-radius: 13px; }
.dashboard-logo svg { width: 30px; }
.dashboard-brand { gap: 9px; }
.dashboard-brand b { font-size: 13px; line-height: 1.35; }
#patient-header-national-id { margin-top: 0; font-size: 7.5px; }
.dashboard-user .user-avatar { display: none; }
.dashboard-user .icon-button { width: 44px; height: 44px; min-width: 44px; min-height: 44px; border-radius: 13px; }
.dashboard-content { width: calc(100% - 20px); padding: 12px 0 25px; }

.transplant-duration-card { position: relative; min-height: 88px; gap: 12px; padding: 13px 15px; overflow: hidden; border-radius: 18px; box-shadow: 0 8px 24px rgba(30,64,175,.07); }
.transplant-duration-card::after { content: ""; position: absolute; left: -25px; bottom: -39px; width: 105px; height: 105px; border: 18px solid rgba(37,99,235,.035); border-radius: 50%; pointer-events: none; }
.duration-icon { width: 48px; height: 48px; border-radius: 15px; box-shadow: 0 7px 17px rgba(37,99,235,.19); }
.duration-icon svg { width: 25px; }
.duration-copy span { margin-bottom: 2px; font-size: 8.5px; }
.duration-copy b { font-size: 19px; letter-spacing: -.4px; }

.transplant-duration-card + .quick-actions, .quick-actions { margin-top: 17px; }
.section-heading-row { align-items: center; margin-bottom: 9px; padding-inline: 2px; }
.section-heading-row > div > span { display: none; }
.section-heading-row h2 { margin: 0; font-size: 15px; letter-spacing: -.2px; }
.demo-label { padding: 4px 7px; font-size: 7.5px; }
.action-grid { gap: 9px; }
.action-card { min-height: 94px; gap: 6px; padding: 10px 7px; border-radius: 16px; box-shadow: 0 6px 18px rgba(30,64,175,.045); }
.action-icon { width: 37px; height: 37px; border-radius: 12px; }
.action-icon svg { width: 19px; }
.action-copy b { font-size: 10.5px; }
.action-copy small { max-width: 145px; font-size: 7.5px; line-height: 1.5; }

.request-history { margin-top: 19px; }
.history-list { display: grid; gap: 7px; overflow: visible; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.history-card { grid-template-columns: auto minmax(0, 1fr) auto; min-height: 74px; gap: 9px; padding: 10px; border: 1px solid #e1e9f5 !important; border-radius: 15px; background: white; box-shadow: 0 5px 16px rgba(30,64,175,.035); }
.history-icon { width: 38px; height: 38px; border-radius: 12px; }
.history-icon svg { width: 20px; }
.history-main { gap: 2px; }
.history-main b { font-size: 10px; line-height: 1.55; }
.history-main span { font-size: 8px; }
.history-card .status { grid-column: 2; gap: 4px; padding: 4px 7px; font-size: 7.5px; }
.history-more { grid-column: 3; grid-row: 1 / span 2; width: 44px; height: 44px; min-width: 44px; min-height: 44px; border-radius: 12px; }
.history-more svg { width: 17px; }

@media (max-width: 340px) {
  .dashboard-content { width: calc(100% - 16px); }
  .transplant-duration-card { min-height: 84px; padding: 11px 12px; }
  .duration-icon { width: 44px; height: 44px; }
  .duration-copy b { font-size: 17px; }
  .action-card { min-height: 90px; }
}

/* Home design inspired by the supplied mobile reference */
.dashboard { background: #f3f6fb; }
.dashboard-header {
  position: relative;
  top: auto;
  align-items: flex-end;
  min-height: calc(150px + env(safe-area-inset-top));
  padding: calc(55px + env(safe-area-inset-top)) 18px 27px;
  border: 0;
  border-radius: 0 0 30px 30px;
  color: white;
  background: linear-gradient(155deg, #3478df 0%, #1f58bd 72%, #174aa5 100%);
  box-shadow: none;
  backdrop-filter: none;
}
.dashboard-header::after { content: ""; position: absolute; left: -48px; bottom: -69px; width: 160px; height: 160px; border: 26px solid rgba(255,255,255,.045); border-radius: 50%; pointer-events: none; }
.dashboard-today { position: absolute; top: calc(17px + env(safe-area-inset-top)); right: 18px; display: block; max-width: calc(100% - 92px); overflow: hidden; color: rgba(255,255,255,.82); direction: rtl; unicode-bidi: isolate; font-size: 10px; font-weight: 600; line-height: 1.7; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-brand { position: relative; z-index: 1; gap: 11px; color: white; }
.dashboard-logo { width: 47px; height: 47px; border: 1px solid rgba(255,255,255,.15); border-radius: 16px; background: rgba(255,255,255,.14); box-shadow: none; }
.dashboard-logo svg { width: 36px; }
.dashboard-brand > span:last-child { align-items: flex-start; gap: 0; direction: rtl; text-align: right; }
.header-greeting { display: block; margin-bottom: 1px; color: rgba(255,255,255,.76); font-size: 9px; font-weight: 600; line-height: 1.35; }
.dashboard-brand b { display: block; color: white; font-size: 19px; line-height: 1.45; }
#patient-header-national-id { color: rgba(255,255,255,.72); font-size: 8.5px; }
.dashboard-user { position: absolute; z-index: 2; top: calc(16px + env(safe-area-inset-top)); left: 16px; }
.dashboard-user .icon-button { border-color: rgba(255,255,255,.13); color: white; background: rgba(255,255,255,.14); box-shadow: none; }

.dashboard-content { position: relative; z-index: 2; width: calc(100% - 24px); margin-top: -18px; padding: 0 0 28px; }
.transplant-duration-card { min-height: 96px; gap: 13px; padding: 15px 17px; border-color: #bce8d4; border-radius: 20px; background: linear-gradient(135deg, #e4f8ee, #d8f3e7); box-shadow: 0 9px 25px rgba(34,108,81,.09); }
.transplant-duration-card::after { left: -18px; bottom: -44px; border-color: rgba(16,126,91,.04); }
.duration-icon { width: 52px; height: 52px; color: #087d5b; border-radius: 16px; background: white; box-shadow: 0 7px 18px rgba(16,126,91,.10); }
.duration-copy span { color: #387563; font-size: 9px; }
.duration-copy b { color: #087d5b; font-size: 23px; }

.home-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 11px; padding: 14px 8px; border: 1px solid #e0e7f2; border-radius: 20px; background: white; box-shadow: 0 7px 22px rgba(30,64,175,.055); }
.home-stat { display: flex; min-width: 0; flex-direction: column; align-items: center; padding: 0 4px; border-left: 1px solid #edf1f7; text-align: center; }
.home-stat:last-child { border-left: 0; }
.stat-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 6px; border-radius: 15px; }
.stat-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.stat-pending { color: #2c63ba; background: #e9f1ff; }
.stat-done { color: #087d5b; background: #e1f6ee; }
.stat-action { color: #b57a16; background: #fff0d1; }
.home-stat b { color: var(--ink); font-size: 14px; line-height: 1.2; }
.home-stat small { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 7.5px; text-overflow: ellipsis; white-space: nowrap; }

.home-stats + .quick-actions { margin-top: 15px; }
.quick-actions .section-heading-row { display: none; }
.action-grid { gap: 10px; }
.action-card { min-height: 112px; padding: 13px 10px; border-radius: 19px; box-shadow: 0 7px 22px rgba(30,64,175,.065); }
.action-card.primary-action { border: 0; background: linear-gradient(145deg, #3478df, #2159bd); box-shadow: 0 10px 25px rgba(32,87,185,.22); }
.action-card:not(.primary-action) { border-color: #e0e7f2; background: white; }
.action-icon { width: 42px; height: 42px; border-radius: 13px; }
.action-icon svg { width: 21px; }
.action-copy b { font-size: 12px; }
.action-copy small { max-width: 155px; font-size: 8px; line-height: 1.65; }

.request-history { margin-top: 19px; }
.request-history .section-heading-row { margin-bottom: 10px; padding-inline: 3px; }
.request-history .section-heading-row h2 { font-size: 16px; }
.request-history .demo-label { color: #1d5bb3; background: transparent; font-size: 8.5px; font-weight: 750; }
.history-list { gap: 9px; }
.history-card { min-height: 80px; padding: 11px; border-color: #e0e7f2 !important; border-radius: 17px; box-shadow: 0 6px 19px rgba(30,64,175,.045); }
.history-card:first-child { border-right: 4px solid #2a67c7 !important; }
.history-card:nth-child(2) { border-right: 4px solid #15926d !important; }
.history-card:nth-child(3) { border-right: 4px solid #c58a22 !important; }
.history-main b { font-size: 10.5px; }

@media (max-width: 340px) {
  .dashboard-header { min-height: calc(142px + env(safe-area-inset-top)); padding-inline: 14px; }
  .dashboard-content { width: calc(100% - 18px); }
  .transplant-duration-card { min-height: 90px; padding: 13px; }
  .duration-copy b { font-size: 20px; }
  .home-stats { padding-inline: 4px; }
  .home-stat small { font-size: 7px; }
  .action-card { min-height: 105px; }
  .dashboard-today { right: 14px; max-width: calc(100% - 80px); font-size: 9px; }
}

/* Stable two-row dashboard header */
.dashboard-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  min-height: calc(158px + env(safe-area-inset-top));
  padding: calc(12px + env(safe-area-inset-top)) 17px 25px;
}
.dashboard-header-top { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; }
.dashboard-today { position: static; top: auto; right: auto; max-width: calc(100% - 62px); flex: 1; font-size: 9.5px; line-height: 1.6; }
.dashboard-user { position: static; top: auto; left: auto; flex: 0 0 auto; margin-right: 10px; }
.dashboard-user .icon-button { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
.dashboard-brand { width: 100%; min-width: 0; margin-top: 11px; }
.dashboard-brand > span:last-child { flex: 1; min-width: 0; }
#patient-header-name { max-width: none !important; overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; }
#patient-header-national-id { white-space: nowrap; }

@media (max-width: 340px) {
  .dashboard-header { min-height: calc(154px + env(safe-area-inset-top)); padding-inline: 13px; }
  .dashboard-today { position: static; right: auto; max-width: calc(100% - 58px); font-size: 8.5px; }
  .dashboard-brand { margin-top: 9px; }
  .dashboard-brand b { font-size: 17px; }
}

/* Date card beside transplant duration */
.dashboard-header { min-height: calc(145px + env(safe-area-inset-top)); padding-top: calc(10px + env(safe-area-inset-top)); }
.dashboard-header-top { justify-content: flex-end; }
.dashboard-user { margin-right: 0; }
.dashboard-brand { margin-top: 8px; }
.home-overview-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(105px, .75fr); gap: 9px; }
.home-overview-grid .transplant-duration-card { min-width: 0; height: 100%; }
.home-date-card { display: flex; min-width: 0; min-height: 96px; flex-direction: column; align-items: center; justify-content: center; padding: 10px 7px; border: 1px solid #d8e3f4; border-radius: 20px; color: var(--ink); background: white; box-shadow: 0 8px 23px rgba(30,64,175,.065); text-align: center; }
.home-date-icon { display: grid; place-items: center; width: 35px; height: 35px; margin-bottom: 5px; border-radius: 11px; color: #2862bd; background: #e9f1ff; }
.home-date-icon svg { width: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.home-date-copy { display: flex; min-width: 0; flex-direction: column; align-items: center; }
.home-date-copy small { color: var(--muted); font-size: 9px; }
.home-date-copy b { margin-top: 2px; color: #1f4f9f; font-size: 12.5px; line-height: 1.55; }

@media (max-width: 340px) {
  .dashboard-header { min-height: calc(140px + env(safe-area-inset-top)); padding-inline: 13px; }
  .home-overview-grid { grid-template-columns: minmax(0, 1.3fr) minmax(98px, .7fr); gap: 7px; }
  .home-date-card { min-height: 90px; padding-inline: 5px; border-radius: 17px; }
  .home-date-copy b { font-size: 11px; }
}

/* Compact single-row patient header */
.dashboard-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  min-height: calc(104px + env(safe-area-inset-top));
  padding: calc(13px + env(safe-area-inset-top)) 16px 15px;
}
.dashboard-header::after { left: -58px; bottom: -83px; width: 150px; height: 150px; border-width: 22px; }
.dashboard-brand { order: 1; flex: 1 1 auto; width: auto; min-width: 0; margin: 0; }
.dashboard-header-top { order: 2; flex: 0 0 auto; width: auto; min-height: 44px; margin-right: 12px; }
.dashboard-user { margin: 0; }
.header-greeting { font-size: 8.5px; }
.dashboard-brand b { font-size: 18px; }
#patient-header-national-id { font-size: 8px; }
.dashboard-content { margin-top: -12px; }

@media (max-width: 340px) {
  .dashboard-header { min-height: calc(98px + env(safe-area-inset-top)); padding: calc(10px + env(safe-area-inset-top)) 12px 13px; }
  .dashboard-header-top { margin-right: 7px; }
  .dashboard-logo { width: 43px; height: 43px; }
  .dashboard-logo svg { width: 33px; }
  .dashboard-brand b { font-size: 16px; }
  #patient-header-national-id { font-size: 7.5px; }
  .stat-icon { width: 44px; height: 44px; border-radius: 14px; }
  .stat-icon svg { width: 24px; height: 24px; }
}

/* Latest prescription dates */
.recent-prescriptions { margin-top: 11px; padding: 13px; border: 1px solid #e0e7f2; border-radius: 19px; background: white; box-shadow: 0 7px 22px rgba(30,64,175,.05); }
.recent-prescriptions-title { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.recent-prescriptions-title > span { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 10px; color: #2862bd; background: #e9f1ff; }
.recent-prescriptions-title svg { width: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.recent-prescriptions-title h2 { margin: 0; color: var(--ink); font-size: 14px; }
.prescription-date-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.prescription-date-item { display: flex; min-width: 0; min-height: 61px; flex-direction: column; align-items: center; justify-content: center; padding: 8px 4px; border-radius: 13px; text-align: center; }
.prescription-date-item span { margin-bottom: 4px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.prescription-date-item b { color: var(--ink); font-size: 10.5px; line-height: 1.55; }
.medication-date { background: #fff1e7; }
.medication-date b { color: #9b5726; }
.lab-date { background: #e7f7f0; }
.lab-date b { color: #087d5b; }
.ultrasound-date { background: #eaf1ff; }
.ultrasound-date b { color: #255aa8; }
.recent-prescriptions + .quick-actions { margin-top: 15px; }

@media (max-width: 340px) {
  .recent-prescriptions { padding: 11px 9px; }
  .prescription-date-grid { gap: 5px; }
  .prescription-date-item { min-height: 58px; padding-inline: 2px; }
  .prescription-date-item span { font-size: 8px; }
  .prescription-date-item b { font-size: 9.2px; }
}

.request-history .section-heading-row h2 { font-size: 18px; }
.history-main b { font-size: 12px; line-height: 1.6; }
.history-main span { font-size: 9.5px; }
.history-card .status { font-size: 8.5px; }

@media (max-width: 340px) {
  .request-history .section-heading-row h2 { font-size: 16px; }
  .history-main b { font-size: 11px; }
  .history-main span { font-size: 8.5px; }
}

/* Follow-up countdowns (rules remain internal) */
.followup-countdowns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #edf1f7; }
.countdown-item { display: flex; min-width: 0; min-height: 64px; align-items: center; gap: 8px; padding: 8px; border-radius: 14px; }
.countdown-lab { color: #087d5b; background: #e7f7f0; }
.countdown-ultrasound { color: #255aa8; background: #eaf1ff; }
.countdown-icon { display: grid; flex: 0 0 auto; place-items: center; width: 35px; height: 35px; border-radius: 11px; background: rgba(255,255,255,.78); }
.countdown-icon svg { width: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.countdown-copy { display: flex; min-width: 0; flex-direction: column; }
.countdown-copy small { margin-bottom: 2px; color: var(--muted); font-size: 8px; }
.countdown-copy b { color: currentColor; font-size: 10px; line-height: 1.55; }

@media (max-width: 340px) {
  .followup-countdowns { gap: 5px; }
  .countdown-item { gap: 6px; padding: 7px 6px; }
  .countdown-icon { width: 31px; height: 31px; }
  .countdown-icon svg { width: 18px; }
  .countdown-copy small { font-size: 7px; }
  .countdown-copy b { font-size: 8.8px; }
}

/* Readable home typography */
.header-greeting { font-size: 11px; }
.dashboard-brand b { font-size: 20px; }
#patient-header-national-id { font-size: 10px; }
.duration-copy span { font-size: 11px; }
.duration-copy b { font-size: 24px; }
.home-date-copy small { font-size: 10px; }
.home-date-copy b { font-size: 13px; line-height: 1.65; }
.home-stat b { font-size: 17px; }
.home-stat small { font-size: 10px; line-height: 1.5; white-space: normal; }
.recent-prescriptions-title h2 { font-size: 15px; }
.prescription-date-item { min-height: 70px; }
.prescription-date-item span { font-size: 10.5px; }
.prescription-date-item b { font-size: 11.5px; }
.countdown-item { min-height: 72px; }
.countdown-copy small { font-size: 9.5px; }
.countdown-copy b { font-size: 11.5px; }
.action-copy b { font-size: 13px; }
.action-copy small { font-size: 10px; line-height: 1.6; }
.request-history .section-heading-row h2 { font-size: 18px; }
.request-history .demo-label { font-size: 10px; }
.history-main b { font-size: 12.5px; }
.history-main span { font-size: 10px; }
.history-card .status { font-size: 9.5px; }
.mobile-nav .nav-item { font-size: 10.5px; }

@media (max-width: 340px) {
  .header-greeting { font-size: 10px; }
  .dashboard-brand b { font-size: 18px; }
  #patient-header-national-id { font-size: 9px; }
  .duration-copy span { font-size: 10px; }
  .duration-copy b { font-size: 21px; }
  .home-stat small { font-size: 9px; }
  .prescription-date-item span { font-size: 9px; }
  .prescription-date-item b { font-size: 10px; }
  .countdown-copy small { font-size: 8.5px; }
  .countdown-copy b { font-size: 10px; }
  .action-copy b { font-size: 12px; }
  .action-copy small { font-size: 9px; }
  .history-main b { font-size: 11.5px; }
  .history-main span { font-size: 9px; }
}

/* Larger home typography */
.header-greeting { font-size: 13px; }
.dashboard-brand b { font-size: 23px; }
#patient-header-national-id { font-size: 11.5px; }
.duration-copy span { font-size: 13px; }
.duration-copy b { font-size: 27px; }
.home-date-copy small { font-size: 11.5px; }
.home-date-copy b { font-size: 15px; }
.home-stats { padding-block: 16px; }
.home-stat b { font-size: 20px; }
.home-stat small { font-size: 11.5px; }
.recent-prescriptions-title h2 { font-size: 17px; }
.prescription-date-item { min-height: 78px; padding-block: 10px; }
.prescription-date-item span { font-size: 12px; }
.prescription-date-item b { font-size: 13px; }
.countdown-item { min-height: 80px; }
.countdown-copy small { font-size: 11px; }
.countdown-copy b { font-size: 13px; }
.action-card { min-height: 120px; }
.action-copy b { font-size: 14.5px; }
.action-copy small { font-size: 11.5px; }
.request-history .section-heading-row h2 { font-size: 20px; }
.request-history .demo-label { font-size: 11px; }
.history-card { min-height: 90px; }
.history-main b { font-size: 14px; }
.history-main span { font-size: 11.5px; }
.history-card .status { font-size: 10.5px; }
.mobile-nav .nav-item { font-size: 12px; }

@media (max-width: 340px) {
  .header-greeting { font-size: 11px; }
  .dashboard-brand b { font-size: 20px; }
  #patient-header-national-id { font-size: 10px; }
  .duration-copy span { font-size: 11.5px; }
  .duration-copy b { font-size: 23px; }
  .home-date-copy b { font-size: 13px; }
  .home-stat small { font-size: 10px; }
  .prescription-date-item span { font-size: 10.5px; }
  .prescription-date-item b { font-size: 11.5px; }
  .countdown-copy small { font-size: 9.5px; }
  .countdown-copy b { font-size: 11.5px; }
  .action-copy b { font-size: 13px; }
  .action-copy small { font-size: 10px; }
  .history-main b { font-size: 12.5px; }
  .history-main span { font-size: 10px; }
}

/* Patient-created reminders */
.reminder-action { border-color: #f0dfbd !important; background: linear-gradient(145deg, #fffaf0, #fff4dc) !important; }
.action-icon.reminder { color: #a86f10; background: #ffedc9; }
.support-action { grid-column: 1 / -1; min-height: 82px; flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px; padding: 12px 14px; text-align: right; }
.support-action .action-copy { align-items: flex-start; width: auto; }
.support-action .action-copy small { max-width: none; text-align: right; }

.reminder-form > label { display: block; margin: 13px 0 0; color: var(--ink); font-size: 11px; font-weight: 750; }
.reminder-form > label input, .reminder-form > label select { width: 100%; min-height: 52px; margin-top: 7px; padding: 0 12px; border: 1px solid var(--line); border-radius: 14px; outline: 0; color: var(--ink); background: #f8faff; }
.reminder-form > label input:focus, .reminder-form > label select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.09); }
.reminder-fieldset { margin: 15px 0 0; padding: 0; border: 0; }
.reminder-fieldset legend { margin-bottom: 8px; color: var(--ink); font-size: 11px; font-weight: 750; }
.reminder-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.reminder-choice-grid label { position: relative; min-height: 50px; margin: 0; cursor: pointer; }
.reminder-choice-grid input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.reminder-choice-grid span { display: flex; align-items: center; justify-content: center; min-height: 50px; padding: 9px; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); background: #f8faff; font-size: 11px; font-weight: 700; transition: .18s ease; }
.reminder-choice-grid input:focus-visible + span { outline: 3px solid rgba(37,99,235,.16); outline-offset: 2px; }
.reminder-choice-grid input:checked + span { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-soft); box-shadow: inset 0 0 0 1px rgba(37,99,235,.08); }
.reminder-form .primary-button { margin-top: 18px; }

.upcoming-reminder[hidden] { display: none !important; }
.upcoming-reminder { display: flex; align-items: center; width: 100%; min-height: 82px; margin-top: 11px; padding: 12px 14px; border: 1px solid #ead8ac; border-radius: 18px; color: var(--ink); background: linear-gradient(135deg, #fffaf0, #fff3d5); box-shadow: 0 7px 20px rgba(148,99,13,.07); cursor: pointer; text-align: right; }
.upcoming-reminder-icon { display: grid; flex: 0 0 auto; place-items: center; width: 44px; height: 44px; margin-left: 11px; border-radius: 14px; color: #a86f10; background: #ffe8b8; }
.upcoming-reminder-icon svg { width: 23px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.upcoming-reminder-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.upcoming-reminder-copy small { color: #966819; font-size: 10px; }
.upcoming-reminder-copy b { margin: 2px 0; color: #704d11; font-size: 13px; line-height: 1.55; }
.upcoming-reminder-copy span { color: var(--muted); font-size: 10px; line-height: 1.55; }
.upcoming-reminder-arrow { width: 20px; margin-right: 7px; fill: none; stroke: #b0863d; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

@media (max-width: 340px) {
  .support-action { min-height: 76px; }
  .upcoming-reminder { padding-inline: 11px; }
  .upcoming-reminder-copy b { font-size: 12px; }
  .upcoming-reminder-copy span { font-size: 9px; }
}

/* Three equal home actions */
.action-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.action-card, .support-action { grid-column: auto; min-height: 122px; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 11px 6px; text-align: center; }
.support-action .action-copy { align-items: center; width: 100%; }
.support-action .action-copy small { max-width: 100%; text-align: center; }
.action-card .action-icon { width: 43px; height: 43px; }
.action-card .action-copy b { font-size: 12.5px; line-height: 1.5; }
.action-card .action-copy small { max-width: 100%; font-size: 9px; line-height: 1.55; }
.service-choice-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.reminder-fieldset legend small { margin-right: 4px; color: var(--muted); font-size: 8.5px; font-weight: 500; }

@media (max-width: 340px) {
  .action-grid { gap: 5px; }
  .action-card, .support-action { min-height: 114px; padding-inline: 4px; }
  .action-card .action-icon { width: 39px; height: 39px; }
  .action-card .action-copy b { font-size: 11.5px; }
  .action-card .action-copy small { font-size: 8px; }
  .service-choice-grid { gap: 5px; }
  .service-choice-grid span { padding-inline: 4px; font-size: 9.5px; }
}

/* Force all three primary actions into one row */
.quick-actions .action-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  grid-auto-flow: column;
  width: 100%;
  gap: 7px;
}
.quick-actions .action-grid > .action-card {
  grid-column: span 1 !important;
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
}

@media (max-width: 340px) {
  .quick-actions .action-grid { gap: 4px; }
}

/* Swap primary actions and request statistics */
.dashboard-content { display: flex; flex-direction: column; }
.home-overview-grid { order: 1; }
.quick-actions { order: 2; margin-top: 11px; }
.recent-prescriptions { order: 3; }
.home-stats { order: 4; }
.upcoming-reminder { order: 5; }
.request-history { order: 6; }

/* Full-page support chat */
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.support-chat-page[hidden] { display: none !important; }
.dashboard.chat-mode > .dashboard-header { display: none; }
.support-chat-page { display: flex; height: calc(100dvh - 76px); flex-direction: column; overflow: hidden; background: #f2f6fb; animation: step-in .22s ease both; }
.support-chat-header { display: flex; flex: 0 0 auto; align-items: center; min-height: calc(74px + env(safe-area-inset-top)); padding: calc(12px + env(safe-area-inset-top)) 14px 12px; border-bottom: 1px solid #dce5f2; background: white; box-shadow: 0 5px 18px rgba(30,64,175,.05); }
.chat-back { display: grid; flex: 0 0 auto; place-items: center; width: 46px; height: 46px; margin-left: 10px; padding: 0; border: 1px solid #dce5f2; border-radius: 14px; color: var(--primary); background: #f8faff; cursor: pointer; }
.chat-back svg { width: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.support-chat-avatar { display: grid; flex: 0 0 auto; place-items: center; width: 47px; height: 47px; margin-left: 10px; border-radius: 15px; color: white; background: linear-gradient(145deg, #3b82f6, #1d4ed8); box-shadow: 0 7px 17px rgba(37,99,235,.18); }
.support-chat-avatar svg { width: 25px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.support-chat-title { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.support-chat-title h1 { margin: 0 0 3px; overflow: hidden; color: var(--ink); font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.support-chat-title small { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; }
.support-chat-title i { width: 7px; height: 7px; border-radius: 50%; background: #18a979; box-shadow: 0 0 0 3px rgba(24,169,121,.12); }
.chat-messages { display: flex; flex: 1; flex-direction: column; gap: 10px; padding: 16px 13px 20px; overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth; }
.chat-message { display: flex; width: 100%; }
.chat-message-user { justify-content: flex-start; }
.chat-message-support { justify-content: flex-end; }
.chat-bubble { max-width: 82%; padding: 10px 12px 7px; border-radius: 17px; box-shadow: 0 4px 13px rgba(30,64,175,.06); }
.chat-message-user .chat-bubble { color: white; border-bottom-right-radius: 5px; background: linear-gradient(145deg, #3478df, #225abd); }
.chat-message-support .chat-bubble { color: var(--ink); border: 1px solid #e0e7f2; border-bottom-left-radius: 5px; background: white; }
.chat-bubble p { margin: 0; font-size: 13px; line-height: 1.9; white-space: pre-wrap; }
.chat-bubble time { display: block; margin-top: 3px; color: currentColor; direction: ltr; font-size: 8.5px; opacity: .62; text-align: left; }
.chat-composer { display: flex; flex: 0 0 auto; align-items: flex-end; gap: 8px; padding: 10px 12px 11px; border-top: 1px solid #dce5f2; background: rgba(255,255,255,.97); box-shadow: 0 -6px 18px rgba(30,64,175,.05); }
.chat-composer textarea { flex: 1; min-height: 49px; max-height: 110px; padding: 13px 14px; border: 1px solid #dce5f2; border-radius: 16px; outline: 0; color: var(--ink); background: #f8faff; resize: none; font-size: 13px; line-height: 1.7; }
.chat-composer textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
.chat-composer button { display: grid; flex: 0 0 auto; place-items: center; width: 49px; height: 49px; padding: 0; border: 0; border-radius: 16px; color: white; background: linear-gradient(145deg, #3b82f6, #1d4ed8); box-shadow: 0 7px 16px rgba(37,99,235,.20); cursor: pointer; }
.chat-composer button svg { width: 23px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

/* Requests page and request forms */
.requests-page[hidden] { display: none !important; }
.requests-page { width: calc(100% - 24px); margin: 0 auto; padding: 19px 0 35px; animation: step-in .22s ease both; }
.requests-page-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.requests-page-heading > div { min-width: 0; }
.requests-page-heading small { color: var(--primary); font-size: 13px; font-weight: 750; }
.requests-page-heading h1 { margin: 2px 0; color: var(--ink); font-size: 22px; }
.requests-page-heading p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.requests-page-heading > button { display: flex; flex: 0 0 auto; align-items: center; gap: 6px; min-height: 48px; padding: 0 12px; border: 0; border-radius: 15px; color: white; background: linear-gradient(145deg, #3b82f6, #1d4ed8); box-shadow: 0 8px 18px rgba(37,99,235,.18); cursor: pointer; font-size: 14px; font-weight: 750; }
.requests-page-heading > button svg { width: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 2; }
.request-filters { display: flex; gap: 7px; margin-bottom: 13px; padding-bottom: 2px; overflow-x: auto; scrollbar-width: none; }
.request-filters::-webkit-scrollbar { display: none; }
.request-filters button { flex: 0 0 auto; min-height: 44px; padding: 0 14px; border: 1px solid #dce5f2; border-radius: 13px; color: var(--muted); background: white; cursor: pointer; font-size: 13px; font-weight: 700; }
.request-filters button.active { border-color: var(--primary); color: white; background: var(--primary); box-shadow: 0 5px 13px rgba(37,99,235,.15); }
.all-request-list { display: grid; gap: 9px; }
.request-record-card { padding: 13px; border: 1px solid #dfe7f2; border-radius: 18px; background: white; box-shadow: 0 6px 18px rgba(30,64,175,.04); }
.request-record-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.request-record-top > div { display: flex; min-width: 0; flex-direction: column; }
.request-record-top b { color: var(--ink); font-size: 15px; line-height: 1.6; }
.request-record-top small { margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.request-record-bottom { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 9px; border-top: 1px solid #edf1f7; color: var(--muted); font-size: 12px; }
.request-admin-reply { margin-top: 11px; padding: 10px 12px; border-radius: 13px; color: #075f4b; background: #e8f7f1; }
.request-admin-reply[hidden] { display: none; }
.request-admin-reply b { font-size: 12px; }
.request-admin-reply p { margin: 4px 0 0; font-size: 13px; line-height: 1.8; }
.request-tracking-code { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; padding-top: 8px; border-top: 1px solid rgba(8,125,91,.18); }
.request-tracking-code[hidden] { display: none; }
.request-tracking-code small { font-size: 11px; }
.request-tracking-code strong { direction: ltr; font-size: 16px; letter-spacing: .7px; }
.request-response-file { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; margin-top: 10px; padding: 10px; border: 1px solid rgba(8,125,91,.17); border-radius: 12px; background: rgba(255,255,255,.62); }
.request-response-file[hidden] { display: none; }
.response-file-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; color: white; background: #15926d; font-size: 18px; font-weight: 800; }
.request-response-file > div:nth-child(2) { display: flex; min-width: 0; flex-direction: column; }
.request-response-file > div:nth-child(2) b { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.request-response-file > div:nth-child(2) small { margin-top: 2px; font-size: 9px; opacity: .75; }
.response-file-actions { display: flex; gap: 5px; }
.response-file-actions a { display: flex; min-height: 34px; align-items: center; padding: 0 8px; border-radius: 9px; color: #075f4b; background: white; font-size: 10px; font-weight: 750; text-decoration: none; }
.patient-followup-summary { margin-top: 10px; padding: 10px 12px; border-radius: 13px; color: #31567e; background: #edf5ff; }
.patient-followup-summary b { font-size: 11px; }
.patient-followup-summary p { margin: 4px 0 0; font-size: 12px; line-height: 1.8; }
.patient-followup-summary small { display: block; margin-top: 5px; color: #2463c7; font-size: 10px; font-weight: 700; }
.request-followup-button { width: 100%; min-height: 47px; margin-top: 10px; border: 0; border-radius: 13px; color: white; background: linear-gradient(145deg, #f59e0b, #d97706); box-shadow: 0 7px 16px rgba(217,119,6,.18); font-size: 12px; font-weight: 750; }
.request-empty-state { padding: 35px 15px; border: 1px dashed #cbd7e8; border-radius: 18px; color: var(--muted); background: #f8faff; text-align: center; font-size: 14px; }
.request-empty-state[hidden] { display: none; }

.unavailable-service { border-color: #eadde0 !important; color: #8f7378 !important; background: #faf5f6 !important; cursor: not-allowed !important; opacity: 1 !important; }
.unavailable-service .service-icon { color: #a47d85; background: #f1e3e6; }
.unavailable-service small { color: #a27f85; }
.unavailable-badge { flex: 0 0 auto; padding: 5px 7px; border-radius: 999px; color: #9b5f69; background: #f2dfe3; font-size: 11px; font-weight: 750; }
.request-detail-form > label, .request-two-column label { display: block; margin: 12px 0 0; color: var(--ink); font-size: 14px; font-weight: 750; }
.request-detail-form > label > small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 500; }
.request-detail-form input:not([type="radio"]):not([type="file"]), .request-detail-form select, .request-detail-form textarea { width: 100%; min-height: 50px; margin-top: 7px; padding: 11px 12px; border: 1px solid #dce5f2; border-radius: 14px; outline: 0; color: var(--ink); background: #f8faff; font-size: 14px; }
.request-detail-form textarea { min-height: 88px; resize: vertical; line-height: 1.8; }
.request-detail-form input:focus, .request-detail-form select:focus, .request-detail-form textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
.request-fieldset { margin: 0; padding: 0; border: 0; }
.request-fieldset legend { margin-bottom: 8px; color: var(--ink); font-size: 14px; font-weight: 750; }
.request-option-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.insurance-type-fieldset { margin-top: 2px; }
.insurance-option-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.insurance-option-grid span { min-height: 54px; font-size: 14px; }
.request-option-grid label { position: relative; min-height: 50px; margin: 0; cursor: pointer; }
.request-option-grid input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.request-option-grid span { display: flex; align-items: center; justify-content: center; min-height: 50px; padding: 8px 4px; border: 1px solid #dce5f2; border-radius: 14px; color: var(--muted); background: #f8faff; font-size: 13px; font-weight: 700; }
.request-option-grid input:checked + span { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-soft); }
.request-image-upload { margin-top: 13px !important; cursor: pointer; }
.request-image-upload > input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.request-image-upload > span { display: flex; align-items: center; min-height: 68px; padding: 10px 12px; border: 1px dashed #aebfda; border-radius: 15px; color: var(--primary); background: #f5f8ff; }
.request-image-upload svg { width: 27px; margin-left: 10px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.request-image-upload b { font-size: 14px; }
.request-image-upload small { flex: 1; margin-right: 8px; overflow: hidden; color: var(--muted); font-size: 11px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.request-two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.insurance-documents { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 13px; }
.insurance-documents > label { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; min-height: 62px; margin: 0; padding: 8px; border-radius: 13px; font-size: 12px; font-weight: 700; cursor: pointer; }
.insurance-documents input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.insurance-documents span { display: grid; place-items: center; width: 27px; height: 27px; margin-left: 7px; border-radius: 9px; font-size: 12px; }
.insurance-documents b { align-self: end; font-size: 12px; }
.insurance-documents small { grid-column: 2; align-self: start; color: currentColor; font-size: 10px; font-weight: 500; opacity: .8; }
.insurance-documents .document-ready { color: #087d5b; background: #e5f7ef; }
.insurance-documents .document-ready span { color: white; background: #15926d; }
.insurance-documents .document-missing { color: #a15c64; background: #fae9ec; }
.insurance-documents .document-missing span { color: white; background: #b76b74; }
.profile-documents-link { width: 100%; min-height: 44px; margin-top: 8px; border: 1px solid #e1b9c0; border-radius: 13px; color: #9b5f69; background: #fff6f7; cursor: pointer; font-size: 13px; font-weight: 700; }
.profile-documents-link[hidden] { display: none; }
.request-detail-form .primary-button { margin-top: 16px; }
.service-payment-note { display: flex; min-height: 52px; align-items: center; justify-content: space-between; gap: 10px; margin-top: 13px; padding: 10px 13px; border: 1px solid #d7e4f7; border-radius: 14px; color: var(--ink); background: #f2f7ff; }
.service-payment-note span { font-size: 12px; font-weight: 700; }
.service-payment-note b { color: var(--primary); font-size: 13px; }
.service-payment-note.free { border-color: #cce9dd; background: #edf9f4; }
.service-payment-note.free b { color: var(--care-dark); }
.service-payment-note.paid { border-color: #f0d1d5; background: #fff3f4; }
.service-payment-note.paid b { color: var(--accent-dark); }
.request-payment-summary { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin: 10px 0 0; padding: 9px 11px; border-radius: 12px; font-size: 11px; }
.request-payment-summary span { font-weight: 700; }
.request-payment-summary b { font-size: 11px; }
.request-payment-summary.paid { color: var(--care-dark); background: var(--care-soft); }
.request-payment-summary.free { color: var(--primary); background: var(--primary-soft); }

@media (max-width: 340px) {
  .requests-page { width: calc(100% - 18px); }
  .requests-page-heading h1 { font-size: 19px; }
  .requests-page-heading > button span { display: none; }
  .requests-page-heading > button { width: 48px; justify-content: center; padding: 0; }
  .request-record-top { gap: 7px; }
  .request-record-top .status { font-size: 8px; }
  .request-response-file { grid-template-columns: auto minmax(0, 1fr); }
  .response-file-actions { grid-column: 1 / -1; }
  .response-file-actions a { flex: 1; justify-content: center; }
}

.dashboard { width: 100%; max-width: 520px; min-height: 100dvh; margin: 0 auto; padding-bottom: 90px; background: #f4f7fb; box-shadow: 0 0 60px rgba(30,64,175,.08); }
.dashboard-header { min-height: 72px; padding: 11px 16px; border-bottom-color: #e1e9f5; box-shadow: 0 5px 22px rgba(30,64,175,.04); }
.dashboard-logo { width: 43px; height: 43px; border-radius: 14px; background: var(--primary); box-shadow: 0 8px 18px rgba(37,99,235,.2); }
.dashboard-logo svg { width: 32px; }
.dashboard-brand b { font-size: 15px; }
.dashboard-brand small, .user-copy { display: none; }
.user-avatar { width: 39px; height: 39px; color: var(--primary); background: var(--primary-soft); }
.dashboard-content { width: calc(100% - 24px); margin: 0 auto; padding: 20px 0 32px; }
.welcome-banner { min-height: 178px; padding: 25px 22px; border-radius: 23px; background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 66%, #1e40af 100%); box-shadow: 0 18px 42px rgba(37,99,235,.20); }
.welcome-banner h1 { max-width: 265px; font-size: 23px; line-height: 1.55; }
.welcome-banner p { max-width: 255px; line-height: 1.8; }
.welcome-art { position: absolute !important; left: -25px; bottom: -31px; width: 110px; height: 110px; margin: 0; opacity: .42; }
.welcome-art .art-line { stroke: #2563eb; }
.quick-actions, .request-history { margin-top: 28px; }
.action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; max-width: none; margin: 0; gap: 11px; }
.action-card { position: relative; flex-direction: column; align-items: center; justify-content: center; gap: 8px; aspect-ratio: auto; min-height: 112px; padding: 12px 9px; border-color: #dde7f4; border-radius: 18px; box-shadow: 0 8px 22px rgba(30,64,175,.05); text-align: center; }
.action-card.primary-action { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.action-icon { width: 40px; height: 40px; margin: 0; border-radius: 13px; }
.action-icon svg { width: 21px; }
.action-copy { flex: 0; align-items: center; width: 100%; padding: 0; }
.action-copy b { font-size: 11.5px; }
.action-copy small { max-width: 125px; margin-top: 1px; font-size: 7.8px; line-height: 1.55; text-align: center; }
.action-arrow { display: none; }
.history-list { border-color: #dde7f4; border-radius: 18px; box-shadow: 0 9px 25px rgba(30,64,175,.04); }
.history-card { grid-template-columns: auto 1fr auto; gap: 11px; min-height: 92px; padding: 14px 12px; }
.history-card time { display: none; }
.history-card .status { grid-column: 2; }
.history-more { grid-column: 3; grid-row: 1 / span 2; }

.modal { align-items: end; padding: 0; }
.modal-backdrop { background: rgba(15,23,42,.50); }
.modal-sheet, .modal-sheet.small-sheet { width: min(100%, 520px); max-height: 90dvh; padding: 28px 18px max(24px, env(safe-area-inset-bottom)); border-radius: 27px 27px 0 0; }
.service-card, .imaging-grid button { border-color: #dce6f3; background: #f8faff; }
.service-card:hover, .imaging-grid button:hover { border-color: var(--primary); background: var(--primary-soft); }

.mobile-nav {
  --active-index: 0;
  position: fixed;
  z-index: 12;
  right: 50%;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(520px, 100%);
  min-height: 76px;
  padding: 8px 10px max(8px, env(safe-area-inset-bottom));
  border-top: 1px solid #dce6f3;
  background: rgba(255,255,255,.96);
  box-shadow: 0 -12px 35px rgba(30,64,175,.09);
  backdrop-filter: blur(16px);
  transform: translateX(50%);
}
.mobile-nav::before {
  content: "";
  position: absolute;
  top: 0;
  right: calc((100% / 4) * var(--active-index) + (100% / 8) - 18px);
  width: 36px;
  height: 3px;
  border-radius: 0 0 8px 8px;
  background: var(--primary);
  transition: right .32s cubic-bezier(.2,.8,.2,1);
}
.nav-item { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; padding: 3px; border: 0; color: #8490a5; background: none; cursor: pointer; font-size: 9px; transition: color .22s ease, transform .22s ease; }
.nav-item.active { color: var(--primary); font-weight: 700; transform: translateY(-2px); }
.nav-icon { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 12px; transition: background .25s ease, transform .25s ease; }
.nav-item.active .nav-icon { background: var(--primary-soft); transform: scale(1.06); }
.nav-icon svg { width: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.nav-item.nav-pulse .nav-icon { animation: nav-pulse .32s ease; }
@keyframes nav-pulse { 50% { transform: scale(.82); } }

::view-transition-old(root) { animation: view-out .22s ease both; }
::view-transition-new(root) { animation: view-in .3s ease both; }
@keyframes view-out { to { opacity: 0; transform: translateX(12px); } }
@keyframes view-in { from { opacity: 0; transform: translateX(-12px); } }

/* Blue, green and red clinical theme */
:root {
  --primary: #1559c5;
  --primary-dark: #0f459e;
  --primary-soft: #e9f1ff;
  --care: #15956a;
  --care-dark: #0d7451;
  --care-soft: #e6f7ef;
  --accent: #e34855;
  --accent-dark: #b92e3b;
  --accent-soft: #ffeaed;
  --mint: #e9f8f1;
  --danger: #c73543;
  --shadow: 0 26px 70px rgba(21, 89, 197, .14);
}
body {
  background:
    radial-gradient(circle at 10% 12%, rgba(21, 89, 197, .13), transparent 29%),
    radial-gradient(circle at 92% 18%, rgba(227, 72, 85, .075), transparent 23%),
    radial-gradient(circle at 88% 88%, rgba(21, 149, 106, .11), transparent 28%),
    #f4f7fb;
}
.brand-panel { background: linear-gradient(150deg, #1559c5 0%, #176fba 57%, #138660 100%); }
.brand-mark .lobe-left, .login-logo .lobe-left, .dashboard-logo .lobe-left { fill: #c9f3df; }
.brand-mark .mark-line, .login-logo .mark-line, .dashboard-logo .mark-line { fill: none; stroke: var(--accent); stroke-linecap: round; stroke-width: 6; }
.login-logo { background: linear-gradient(145deg, #1768d2, #0f4da9); box-shadow: 0 18px 34px rgba(21,89,197,.24); }
.dashboard-header { background: linear-gradient(135deg, #1559c5 0%, #176bc3 68%, #14845f 100%); }
.dashboard-header::after { border-color: rgba(201,243,223,.11); }
.dashboard-logo { background: rgba(255,255,255,.14); }
.action-card.primary-action { background: linear-gradient(145deg, #2472da, #1559c5) !important; box-shadow: 0 10px 25px rgba(21,89,197,.24); }
.reminder-action { border-color: #bfe7d6 !important; background: linear-gradient(145deg, #f3fcf8, #e6f7ef) !important; }
.action-icon.reminder { color: var(--care-dark); background: #d6f2e5; }
.support-action { border-color: #f2cbd0 !important; background: linear-gradient(145deg, #fff8f8, #ffeaed) !important; }
.action-icon.support { color: var(--accent-dark); background: #ffdce1; }
.support-action .action-copy b { color: var(--accent-dark); }
.transplant-duration-card { border-color: #bfe7d6; background: linear-gradient(145deg, #e7f8f0, #d9f3e7); }
.duration-icon { color: var(--care) !important; }
.duration-copy b { color: var(--care-dark); }
.stat-done, .document-ready { color: var(--care-dark) !important; background: var(--care-soft) !important; }
.stat-action, .document-missing { color: var(--accent-dark) !important; background: var(--accent-soft) !important; }
.status.action-needed { color: var(--accent-dark); background: var(--accent-soft); }
.request-followup-button { background: linear-gradient(145deg, #ea5a65, #c73543); box-shadow: 0 7px 16px rgba(199,53,67,.19); }
.request-admin-reply { color: var(--care-dark); background: var(--care-soft); }
.mobile-nav::before { background: linear-gradient(90deg, var(--accent), var(--primary), var(--care)); }

