/* ==========================================================================
   مرهم‌یار: design system
   ========================================================================== */
@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --primary: #0b8f7f;
  --primary-600: #087567;
  --primary-50: #e7f6f3;
  --primary-100: #c9ece5;
  --red: #e5484d;
  --red-600: #c9353a;
  --red-50: #fdecec;
  --amber: #e8900c;
  --amber-50: #fdf3e2;
  --green: #1f9d55;
  --green-50: #e6f6ec;
  --sky: #0e8ad6;
  --sky-50: #e5f3fc;
  --indigo: #4f5bd5;
  --indigo-50: #eceefc;
  --violet: #8a4fd8;
  --violet-50: #f3ecfc;
  --rose: #e0436f;
  --rose-50: #fdebf1;
  --orange: #ee6a22;
  --orange-50: #fdefe6;
  --blue: #2563eb;
  --blue-50: #e8effd;

  --bg: #f3f6f8;
  --card: #ffffff;
  --text: #0f1f2a;
  --text-2: #3b4b57;
  --muted: #6b7c88;
  --border: #e3e9ee;
  --border-2: #d3dce3;
  --shadow-sm: 0 1px 2px rgba(15, 31, 42, .06);
  --shadow: 0 1px 2px rgba(15, 31, 42, .04), 0 6px 20px -6px rgba(15, 31, 42, .10);
  --shadow-lg: 0 24px 60px -18px rgba(15, 31, 42, .35);
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --topbar-h: 64px;
  --tabbar-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --maxw: 1180px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1417;
    --card: #121e22;
    --text: #e8f0f2;
    --text-2: #c2d0d5;
    --muted: #8a9da5;
    --border: #1f2f35;
    --border-2: #2a3e45;
    --primary-50: #0f2b28;
    --primary-100: #15403a;
    --red-50: #331a1c;
    --amber-50: #33270f;
    --green-50: #12291c;
    --sky-50: #0f2533;
    --indigo-50: #1b1f3b;
    --violet-50: #251b38;
    --rose-50: #33161f;
    --orange-50: #33200f;
    --blue-50: #142039;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -8px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  font-feature-settings: 'ss01';
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.no-scroll { overflow: hidden; }
img, svg { display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.45; margin: 0; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; border-radius: 8px; }
.skip { position: absolute; right: 8px; top: -80px; background: var(--card); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 8px; }
@media print { .skip { display: none !important; } }
.ico { flex-shrink: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.mt { margin-top: 14px; }
.nowrap { flex-wrap: nowrap !important; }
.noscript { padding: 40px; text-align: center; }
[hidden] { display: none !important; }

/* ---------------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--card) 86%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top, 0px);
}
.topbar-in { max-width: var(--maxw); margin: 0 auto; height: var(--topbar-h); display: flex; align-items: center; gap: 14px; padding: 0 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 19px; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #12b39f, #0a7f71);
  box-shadow: 0 6px 16px -6px rgba(11, 143, 127, .7);
}
.brand-mark.big { width: 72px; height: 72px; border-radius: 22px; }
.topnav { display: none; gap: 4px; margin-inline-start: 12px; }
.topnav a { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 12px; color: var(--text-2); font-weight: 500; font-size: 14.5px; }
.topnav a:hover { background: var(--primary-50); text-decoration: none; color: var(--primary-600); }
.topnav a.active { background: var(--primary-50); color: var(--primary-600); font-weight: 700; }
.top-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 12px; border: 0;
  background: transparent; color: var(--text-2);
}
.icon-btn:hover { background: var(--primary-50); color: var(--primary-600); text-decoration: none; }
.icon-btn.light { background: rgba(255, 255, 255, .18); color: #fff; }
.icon-btn.light:hover { background: rgba(255, 255, 255, .3); color: #fff; }
.sos-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 999px; border: 0;
  background: var(--red); color: #fff; font-weight: 800; font-size: 15px;
  box-shadow: 0 6px 16px -6px rgba(229, 72, 77, .8);
  animation: sosPulse 2.6s infinite;
}
@keyframes sosPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .45); } 50% { box-shadow: 0 0 0 8px rgba(229, 72, 77, 0); } }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: var(--primary-600);
  background: var(--primary-50); border: 2px solid var(--primary-100);
}
.avatar:hover { text-decoration: none; }
.avatar.active { border-color: var(--primary); }
.avatar.big { width: 64px; height: 64px; font-size: 26px; background: rgba(255,255,255,.2); color: #fff; border-color: rgba(255,255,255,.35); }
.login-btn span { display: none; }

/* ---------------- bottom tab bar (mobile) */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--border);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11.5px; font-weight: 600; position: relative; }
.tabbar a:hover { text-decoration: none; }
.tabbar a.active { color: var(--primary); }
.tabbar a.active::before { content: ''; position: absolute; top: 0; width: 34px; height: 3px; border-radius: 0 0 4px 4px; background: var(--primary); }
.offline-bar { background: var(--amber); color: #fff; text-align: center; font-size: 13px; padding: 6px 12px; }

/* ---------------- main view */
.view { max-width: var(--maxw); margin: 0 auto; padding: 18px 16px calc(var(--tabbar-h) + var(--safe-b) + 28px); min-height: 70vh; outline: none; }
.view.enter { animation: viewIn .28s ease both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: center; gap: 10px; margin: 4px 0 18px; }
.page-head h1 { font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.page-head p { color: var(--muted); font-size: 14px; margin-top: 2px; }
.back { flex-shrink: 0; }

.sec { margin-top: 26px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sec-head h2 { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.sec-head h2 .ico { color: var(--primary); }
.sec-head a { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 2px; }
.group-title { font-size: 15px; font-weight: 800; color: var(--text-2); margin: 22px 0 10px; display: flex; align-items: center; gap: 8px; }
.group-title .ico { color: var(--primary); }
.count { margin: 4px 0 10px; font-size: 13px; }

.grid-2, .grid-3 { display: grid; gap: 12px; grid-template-columns: 1fr; }
.align-start { align-items: start; }

/* ---------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 700; font-size: 14.5px; white-space: nowrap;
  background: var(--border); color: var(--text);
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease, opacity .15s;
}
.btn:hover { text-decoration: none; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px -8px rgba(11, 143, 127, .9); }
.btn.primary:hover { background: var(--primary-600); }
.btn.danger { background: var(--red); color: #fff; box-shadow: 0 6px 16px -8px rgba(229, 72, 77, .9); }
.btn.danger:hover { background: var(--red-600); }
.btn.ghost { background: var(--card); border-color: var(--border-2); color: var(--text-2); }
.btn.ghost:hover { border-color: var(--primary); color: var(--primary-600); }
.btn.ghost.off { opacity: .5; }
.btn.small { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; gap: 5px; }
.btn.big { height: 52px; font-size: 15.5px; border-radius: 14px; padding: 0 22px; }
.btn.block { width: 100%; }
.danger-text { color: var(--red) !important; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-top-color: transparent; animation: spin .7s linear infinite; display: inline-block; }
.spinner.big { width: 34px; height: 34px; border-width: 3px; color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- cards & badges */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow-sm); }
a.card { color: inherit; display: block; transition: transform .15s ease, box-shadow .15s ease, border-color .15s; }
a.card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-2); }
a.plain { color: inherit; display: block; }
a.plain:hover { text-decoration: none; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; line-height: 1.9; }
.badge.red { background: var(--red-50); color: var(--red); }
.badge.amber { background: var(--amber-50); color: var(--amber); }
.badge.green { background: var(--green-50); color: var(--green); }
.badge.teal { background: var(--primary-50); color: var(--primary-600); }
.badge.sky { background: var(--sky-50); color: var(--sky); }
.badge.gray { background: var(--border); color: var(--muted); }
.badge.light { background: rgba(255, 255, 255, .2); color: #fff; }

/* ---------------- forms */
.form { display: flex; flex-direction: column; gap: 14px; }
.form h2 { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.form h2 .ico { color: var(--primary); }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
input, select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--border-2);
  background: var(--card); font-size: 15px; font-weight: 500; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 80px; line-height: 1.8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent); }
input:disabled { background: var(--bg); color: var(--muted); }
input[dir="ltr"] { text-align: left; }
input[dir="ltr"]::placeholder { text-align: left; }
select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236b7c88' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 12px center; padding-left: 38px; }
label.check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 500; cursor: pointer; }
label.check input { width: 20px; height: 20px; min-height: 0; margin-top: 3px; accent-color: var(--primary); flex-shrink: 0; }
.pw { position: relative; }
.pw input { padding-left: 48px; }
.pw-eye { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); }
.form-error { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; background: var(--red-50); color: var(--red); font-weight: 600; font-size: 14px; }

.search-box { position: relative; display: flex; align-items: center; flex: 1; }
.search-box > .ico { position: absolute; right: 14px; color: var(--muted); pointer-events: none; }
.search-box input { padding-right: 44px; border-radius: 14px; background: var(--card); }
.search-box.big input { min-height: 54px; font-size: 16px; padding-right: 50px; box-shadow: var(--shadow-sm); }
.search-box.big > .ico { right: 16px; }
.search-box + .chips, .search-box { margin-bottom: 12px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1.5px solid var(--border-2); background: var(--card); color: var(--text-2); font-size: 13.5px; font-weight: 600;
}
a.chip:hover { text-decoration: none; border-color: var(--primary); }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------------- home: hero */
.hero {
  position: relative; overflow: hidden; border-radius: var(--r-lg); padding: 26px 20px;
  color: #fff;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(255,255,255,.18) 0%, transparent 45%),
    linear-gradient(140deg, #0fb5a0 0%, #0a8a7b 45%, #0b6d74 100%);
  box-shadow: 0 20px 40px -24px rgba(11, 110, 100, .9);
}
.hero-in { position: relative; z-index: 1; max-width: 640px; }
.hero-hi { font-size: 14px; opacity: .9; font-weight: 600; }
.hero h1 { font-size: 26px; font-weight: 900; margin: 6px 0 8px; letter-spacing: -.3px; }
.hero h1 span { color: #c8fff4; }
.hero-sub { opacity: .92; font-size: 14.5px; max-width: 520px; }
.hero-art { position: absolute; left: -24px; bottom: -36px; opacity: .13; transform: rotate(-12deg); }
.hero-search {
  margin-top: 18px; display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 16px; padding: 6px 6px 6px 6px;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .35);
}
.hero-search > .ico { color: var(--muted); margin-right: 8px; }
.hero-search input { border: 0; min-height: 44px; padding: 0 4px; background: transparent; color: #0f1f2a; box-shadow: none !important; }
.hero-search .btn { height: 44px; }
.hero-search input::placeholder { color: #8a9aa5; }

.em-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.em-chip {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 4px; border-radius: 16px; background: var(--card);
  border: 1px solid var(--border); text-align: center; color: var(--text); box-shadow: var(--shadow-sm);
}
.em-chip:hover { text-decoration: none; transform: translateY(-1px); }
.em-chip b { font-size: 18px; font-weight: 900; line-height: 1.3; }
.em-chip small { font-size: 10.5px; color: var(--muted); line-height: 1.4; }
.em-chip.red .ico, .em-chip.red b { color: var(--red); }
.em-chip.orange .ico, .em-chip.orange b { color: var(--orange); }
.em-chip.blue .ico, .em-chip.blue b { color: var(--blue); }
.em-chip.teal .ico, .em-chip.teal b { color: var(--primary); }
.em-chip.more { font: inherit; }
.em-chip.more b { font-size: 14px; }

.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 4px; border-radius: 18px; background: var(--card); border: 1px solid var(--border); color: var(--text); text-align: center; box-shadow: var(--shadow-sm); transition: transform .15s; }
.quick:hover { text-decoration: none; transform: translateY(-2px); }
.quick > span { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; }
.quick b { font-size: 12.5px; font-weight: 700; line-height: 1.5; }
.quick.red > span { background: var(--red-50); color: var(--red); }
.quick.rose > span { background: var(--rose-50); color: var(--rose); }
.quick.orange > span { background: var(--orange-50); color: var(--orange); }
.quick.amber > span { background: var(--amber-50); color: var(--amber); }
.quick.violet > span { background: var(--violet-50); color: var(--violet); }
.quick.blue > span { background: var(--blue-50); color: var(--blue); }
.quick.teal > span { background: var(--primary-50); color: var(--primary); }

.services { display: grid; gap: 12px; grid-template-columns: 1fr; }
.service { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r); background: var(--card); border: 1px solid var(--border); color: var(--text); box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s; }
.service:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); }
.service h3 { font-size: 15.5px; font-weight: 800; }
.service p { font-size: 13px; color: var(--muted); }
.service > .ico:last-child { margin-inline-start: auto; color: var(--muted); }
.s-ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; flex-shrink: 0; background: var(--primary-50); color: var(--primary); }
.s-drugs .s-ico { background: var(--sky-50); color: var(--sky); }
.s-visits .s-ico { background: var(--primary-50); color: var(--primary); }
.s-courses .s-ico { background: var(--violet-50); color: var(--violet); }
.s-provider .s-ico { background: var(--rose-50); color: var(--rose); }

.h-scroll { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 12px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.h-scroll::-webkit-scrollbar { display: none; }
.course-mini { flex: 0 0 220px; scroll-snap-align: start; border-radius: var(--r); padding: 16px; color: #fff; min-height: 150px; display: flex; flex-direction: column; gap: 8px; transition: transform .15s; }
.course-mini:hover { text-decoration: none; transform: translateY(-2px); }
.course-mini > span { width: 46px; height: 46px; border-radius: 14px; background: rgba(255,255,255,.2); display: grid; place-items: center; }
.course-mini h3 { font-size: 14px; font-weight: 800; line-height: 1.6; }
.course-mini p { font-size: 12.5px; opacity: .9; margin-top: auto; }
.teal.course-mini, .course-hero.teal, .course-card.teal .cc-ico { background: linear-gradient(140deg, #12b39f, #0a7f71); }
.rose.course-mini, .course-hero.rose, .course-card.rose .cc-ico { background: linear-gradient(140deg, #f05d82, #c93460); }
.amber.course-mini, .course-hero.amber, .course-card.amber .cc-ico { background: linear-gradient(140deg, #f5a524, #d77b0a); }
.indigo.course-mini, .course-hero.indigo, .course-card.indigo .cc-ico { background: linear-gradient(140deg, #6f7af0, #4049c2); }
.sky.course-mini, .course-hero.sky, .course-card.sky .cc-ico { background: linear-gradient(140deg, #32a8ef, #0b78c0); }
.violet.course-mini, .course-hero.violet, .course-card.violet .cc-ico { background: linear-gradient(140deg, #a874ec, #7a3fd0); }

.install-card { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r); color: var(--text); background: linear-gradient(135deg, var(--primary-50), var(--card)); border: 1px dashed var(--primary-100); }
.install-card:hover { text-decoration: none; }
.install-card h3 { font-size: 15px; font-weight: 800; }
.install-card p { font-size: 13px; color: var(--muted); }
.install-card > .ico:last-child { margin-inline-start: auto; color: var(--primary); }

.disclaimer { display: flex; gap: 8px; align-items: flex-start; margin-top: 26px; padding: 12px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--border); color: var(--muted); font-size: 12.5px; }
.disclaimer .ico { margin-top: 3px; }

/* ---------------- guides */
.call-banner { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r); background: linear-gradient(135deg, #f0565b, #c9353a); color: #fff; margin-bottom: 14px; box-shadow: 0 14px 30px -18px rgba(201, 53, 58, .9); }
.call-banner:hover { text-decoration: none; }
.call-banner div { display: flex; flex-direction: column; }
.call-banner b { font-size: 15px; }
.call-banner span { font-size: 12.5px; opacity: .9; }
.call-banner > .ico:last-child { margin-inline-start: auto; background: rgba(255,255,255,.2); border-radius: 50%; padding: 8px; width: 40px; height: 40px; }

.guide-card { display: flex !important; align-items: center; gap: 14px; position: relative; border-inline-start: 4px solid var(--primary); }
.guide-card.sev-critical { border-inline-start-color: var(--red); }
.guide-card.sev-urgent { border-inline-start-color: var(--amber); }
.g-ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; flex-shrink: 0; background: var(--primary-50); color: var(--primary); }
.sev-critical .g-ico { background: var(--red-50); color: var(--red); }
.sev-urgent .g-ico { background: var(--amber-50); color: var(--amber); }
.g-body { flex: 1; min-width: 0; }
.g-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.g-title h3 { font-size: 15.5px; font-weight: 800; }
.g-body p { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }
.g-arrow { color: var(--muted); }

.guide-hero, .drug-hero, .course-hero {
  position: relative; border-radius: var(--r-lg); padding: 20px; color: #fff; display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start;
  background: linear-gradient(140deg, #12b39f, #0a7f71); box-shadow: 0 20px 40px -24px rgba(11, 110, 100, .9);
}
.guide-hero .back, .drug-hero .back, .course-hero .back { position: absolute; top: 14px; left: 14px; }
.guide-hero.sev-critical { background: linear-gradient(140deg, #f0565b, #b8262c); box-shadow: 0 20px 40px -24px rgba(184, 38, 44, .9); }
.guide-hero.sev-urgent { background: linear-gradient(140deg, #f5a524, #c86e06); box-shadow: 0 20px 40px -24px rgba(200, 110, 6, .9); }
.drug-hero { background: linear-gradient(140deg, #32a8ef, #0b6aa8); box-shadow: 0 20px 40px -24px rgba(11, 106, 168, .9); }
.gh-ico { width: 62px; height: 62px; border-radius: 18px; background: rgba(255,255,255,.2); display: grid; place-items: center; }
.guide-hero h1, .drug-hero h1, .course-hero h1 { font-size: 23px; font-weight: 900; margin: 6px 0 4px; padding-left: 40px; }
.guide-hero p, .course-hero p { font-size: 14.5px; opacity: .95; }
.en-name { opacity: .9; font-weight: 600; text-align: right; }

.guide-actions { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 14px 0; }

.cpr-tool { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; padding: 18px; border-radius: var(--r); background: var(--card); border: 2px solid var(--red-50); box-shadow: var(--shadow); margin-bottom: 14px; position: relative; }
.cpr-tool h3 { font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 8px; color: var(--red); }
.cpr-tool p { font-size: 13px; color: var(--muted); margin: 4px 0 12px; }
.cpr-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.cpr-beat { width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; align-content: center; background: radial-gradient(circle at 50% 40%, #ff7a7e, #e5484d 70%); color: #fff; box-shadow: 0 0 0 10px var(--red-50); transition: transform .08s; }
.cpr-beat.hit { animation: beat .42s ease-out; }
@keyframes beat { 0% { transform: scale(.86); box-shadow: 0 0 0 18px rgba(229,72,77,.25); } 100% { transform: scale(1); box-shadow: 0 0 0 10px var(--red-50); } }
.cpr-count { font-size: 36px; font-weight: 900; line-height: 1; }
.cpr-beat small { font-size: 10.5px; opacity: .95; text-align: center; padding: 0 8px; line-height: 1.5; margin-top: 4px; }
.cpr-left { grid-row: span 2; }
.cpr-time { grid-column: 2; text-align: center; font-weight: 800; color: var(--muted); font-size: 14px; letter-spacing: 1px; }

.steps { margin-top: 10px; }
.steps h2, .donts h2, .callwhen h2 { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.steps h2 .ico { color: var(--primary); }
.steps ol { list-style: none; margin: 0; padding: 0; position: relative; }
.steps ol::before { content: ''; position: absolute; top: 22px; bottom: 22px; right: 21px; width: 2px; background: var(--primary-100); }
.steps li { position: relative; display: flex; gap: 14px; margin-bottom: 12px; }
.step-n { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: var(--primary); color: #fff; font-weight: 900; font-size: 18px; box-shadow: 0 0 0 5px var(--bg); position: relative; z-index: 1; }
.steps li > div { flex: 1; background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 12px 16px; box-shadow: var(--shadow-sm); }
.steps li h3 { font-size: 15.5px; font-weight: 800; margin-bottom: 2px; }
.steps li p { font-size: 14.5px; color: var(--text-2); }
.donts { margin-top: 20px; background: var(--red-50); border-radius: var(--r); padding: 16px; }
.donts h2 { color: var(--red); }
.donts ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.donts li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; }
.donts li .ico { color: var(--red); margin-top: 4px; background: var(--card); border-radius: 50%; padding: 3px; width: 24px; height: 24px; }
.callwhen { margin-top: 16px; background: var(--amber-50); border-radius: var(--r); padding: 16px; }
.callwhen h2 { color: var(--amber); }
.callwhen p { font-size: 14.5px; }
.cta-course { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 20px; }
.cta-course > div { flex: 1; min-width: 200px; }
.cta-course h3 { font-size: 15px; font-weight: 800; }
.cta-course p { font-size: 13px; color: var(--muted); }

/* ---------------- drugs */
.note-box { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--sky-50); color: var(--text-2); font-size: 13.5px; margin-bottom: 14px; }
.note-box .ico { color: var(--sky); margin-top: 2px; }
.note-box.red { background: var(--red-50); }
.note-box.red .ico { color: var(--red); }
.drug-card { display: flex !important; align-items: flex-start; gap: 12px; position: relative; }
.d-ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; background: var(--sky-50); color: var(--sky); }
.drug-card > div { flex: 1; min-width: 0; }
.drug-card h3 { font-size: 15.5px; font-weight: 800; }
.d-en { font-size: 12.5px; color: var(--muted); text-align: right; }
.d-uses { font-size: 13px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; }
.d-cat { position: absolute; top: 14px; left: 14px; font-size: 11px; color: var(--sky); background: var(--sky-50); padding: 1px 8px; border-radius: 999px; font-weight: 700; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drug-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 14px 0; }
.drug-sec { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; }
.drug-sec h2 { font-size: 15px; font-weight: 800; display: flex; align-items: center; gap: 8px; color: var(--sky); margin-bottom: 6px; }
.drug-sec p { font-size: 14.5px; color: var(--text-2); }
.drug-sec.warn { background: var(--amber-50); border-color: transparent; }
.drug-sec.warn h2 { color: var(--amber); }

/* ---------------- courses */
.info-strip { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--violet-50); color: var(--text-2); font-size: 13.5px; margin-bottom: 14px; }
.info-strip .ico { color: var(--violet); margin-top: 2px; }
.course-card { display: flex !important; flex-direction: column; gap: 8px; }
.cc-top { display: flex; justify-content: space-between; align-items: flex-start; }
.cc-ico { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; color: #fff; }
.course-card h3 { font-size: 16px; font-weight: 800; line-height: 1.6; }
.course-card p { font-size: 13px; color: var(--muted); }
.cc-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12.5px; color: var(--text-2); }
.cc-meta span { display: flex; align-items: center; gap: 4px; }
.cc-cta { margin-top: auto; padding-top: 8px; color: var(--primary); font-weight: 700; font-size: 13.5px; display: flex; align-items: center; gap: 2px; }
.course-layout { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 14px; }
.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.info-item { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 12px; }
.info-item .ico { color: var(--primary); }
.info-item small { display: block; color: var(--muted); font-size: 12px; }
.info-item b { font-size: 13.5px; }
.prose { margin-bottom: 14px; }
.prose h2 { font-size: 16px; font-weight: 800; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.prose h2 .ico { color: var(--primary); }
.prose p { color: var(--text-2); font-size: 14.5px; }
.prose.highlight { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.done-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 18px; }
.done-card > .ico { color: var(--green); }
.done-card h2 { font-size: 18px; font-weight: 800; }
.done-card .kv { width: 100%; text-align: right; }
.login-cta { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 18px; }
.login-cta > .ico { color: var(--primary); }
.login-cta h2 { font-size: 18px; font-weight: 800; }
.login-cta p { color: var(--muted); font-size: 14px; }

/* ---------------- visits */
.how-it { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.how-it > div { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 12px 6px; }
.how-it .ico { color: var(--primary); background: var(--primary-50); border-radius: 12px; padding: 8px; width: 40px; height: 40px; }
.how-it b { font-size: 12.5px; font-weight: 800; }
.how-it span { font-size: 11px; color: var(--muted); line-height: 1.5; }
.filters { margin-bottom: 6px; }
.filter-row { display: grid; grid-template-columns: 1fr; gap: 10px; }
.filter-row .search-box { margin-bottom: 0; }
.session { display: flex; flex-direction: column; gap: 10px; height: 100%; }
.session-wrap { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-sm); overflow: hidden; }
.session-wrap .session { border: 0; box-shadow: none; border-radius: 0; flex: 1; }
.session-act { padding: 0 16px 16px; }
.session-top { display: flex; align-items: center; gap: 12px; }
.prov-ico { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; flex-shrink: 0; background: var(--primary-50); color: var(--primary); }
.prov-ico.dentist { background: var(--sky-50); color: var(--sky); }
.prov-ico.pharmacy { background: var(--green-50); color: var(--green); }
.prov-ico.lab { background: var(--violet-50); color: var(--violet); }
.prov-ico.physio { background: var(--amber-50); color: var(--amber); }
.prov-ico.psych { background: var(--rose-50); color: var(--rose); }
.session-who { flex: 1; min-width: 0; }
.session-who h3 { font-size: 15.5px; font-weight: 800; }
.session-who p { font-size: 12.5px; color: var(--muted); }
.session-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13.5px; font-weight: 600; }
.session-meta span { display: flex; align-items: center; gap: 6px; }
.session-meta .ico { color: var(--primary); }
.session-meta em { font-style: normal; color: var(--primary-600); font-weight: 800; }
.cap-bar { height: 7px; border-radius: 99px; background: var(--border); overflow: hidden; }
.cap-bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #12b39f, #0a7f71); }
.session-addr { display: flex; gap: 6px; font-size: 13px; color: var(--text-2); }
.session-addr .ico { margin-top: 4px; color: var(--muted); }
.session-desc { font-size: 12.5px; color: var(--muted); background: var(--bg); padding: 8px 10px; border-radius: 10px; }

.success-modal { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.success-ico { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: var(--green-50); color: var(--green); animation: pop .4s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.success-modal h2 { font-size: 19px; font-weight: 900; }
.track-code { font-size: 34px; font-weight: 900; letter-spacing: 3px; padding: 12px 22px; border-radius: 16px; background: var(--primary-50); color: var(--primary-600); border: 2px dashed var(--primary-100); }
.kv { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 0; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.kv li { display: flex; justify-content: space-between; gap: 14px; padding: 10px 14px; font-size: 13.5px; }
.kv li + li { border-top: 1px solid var(--border); }
.kv li span { color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.kv li b { text-align: left; font-weight: 700; }
.kv.small li { padding: 8px 12px; font-size: 13px; }

/* ---------------- me / profile */
.profile-card { display: flex; align-items: center; gap: 16px; padding: 20px; border-radius: var(--r-lg); color: #fff; background: linear-gradient(140deg, #12b39f, #0b6d74); box-shadow: 0 20px 40px -24px rgba(11, 110, 100, .9); }
.profile-card h1 { font-size: 20px; font-weight: 900; }
.profile-card p { opacity: .92; text-align: right; }
.profile-card .muted { color: rgba(255,255,255,.85); }
.me-links { display: grid; gap: 10px; margin: 14px 0; }
.me-link { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r); background: var(--card); border: 1px solid var(--border); color: var(--text); font-weight: 700; }
.me-link:hover { text-decoration: none; border-color: var(--primary); }
.me-link > .ico:first-child { color: var(--primary); }
.me-link.admin > .ico:first-child { color: var(--indigo); }
.me-link > .ico:last-child { margin-inline-start: auto; color: var(--muted); }
.tabs { display: flex; gap: 6px; padding: 5px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; margin: 14px 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 10px; color: var(--text-2); font-weight: 700; font-size: 13.5px; white-space: nowrap; border: 0; background: transparent; }
.tabs a:hover { text-decoration: none; }
.tabs .on { background: var(--primary); color: #fff; }
.tabs.small { display: inline-flex; }
.res-card { display: flex; flex-direction: column; gap: 10px; }
.res-card.cancelled, .res-card.no_show { opacity: .75; }
.res-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.res-head h3 { font-size: 15.5px; font-weight: 800; }
.res-code { display: flex; align-items: center; gap: 10px; background: var(--primary-50); border-radius: 14px; padding: 10px 14px; }
.res-code small { color: var(--primary-600); font-weight: 700; }
.res-code b { font-size: 22px; font-weight: 900; letter-spacing: 2px; color: var(--primary-600); margin-inline-start: auto; }

/* ---------------- provider */
.verify-row { display: flex; gap: 8px; }
.verify-row input { font-size: 20px; font-weight: 800; letter-spacing: 3px; text-align: center !important; }
.verify-ok { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: var(--green-50); color: var(--green); margin-bottom: 10px; }
.verify-ok p { color: var(--text-2); font-size: 13px; }
.prov-sess { margin-bottom: 12px; }
.prov-sess-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; }
.prov-sess-head h3 { font-size: 15.5px; font-weight: 800; }
.prov-sess-head p { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.prov-res { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; display: grid; gap: 8px; }
.res-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--bg); align-items: center; }
.res-row.attended { background: var(--green-50); }
.res-row.cancelled { opacity: .6; }
.res-row-main { display: flex; flex-direction: column; gap: 1px; font-size: 13.5px; }
.res-row-main .small { display: flex; align-items: center; gap: 4px; }
.res-row-act { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.prov-admin { display: flex; flex-direction: column; gap: 10px; }

/* ---------------- auth */
.auth { display: grid; grid-template-columns: 1fr; gap: 16px; max-width: 980px; margin: 0 auto; }
.auth-side { display: none; }
.auth-card { padding: 22px; }
.auth-card h1 { font-size: 22px; font-weight: 900; }
.auth-card > .muted { margin: 4px 0 18px; }

/* ---------------- admin */
.admin { display: grid; grid-template-columns: 1fr; gap: 16px; }
.admin-nav { display: flex; gap: 6px; overflow-x: auto; padding: 4px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; scrollbar-width: none; }
.admin-nav::-webkit-scrollbar { display: none; }
.admin-nav a { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px; color: var(--text-2); font-weight: 700; font-size: 13.5px; white-space: nowrap; }
.admin-nav a:hover { text-decoration: none; background: var(--primary-50); }
.admin-nav a.on { background: var(--primary); color: #fff; }
.admin-body { min-width: 0; }
.admin-body .page-head h1 .ico { color: var(--primary); }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
.stat { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r); background: var(--card); border: 1px solid var(--border); color: var(--text); box-shadow: var(--shadow-sm); }
.stat:hover { text-decoration: none; border-color: var(--border-2); transform: translateY(-1px); }
.stat > span { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; }
.stat b { font-size: 22px; font-weight: 900; display: block; line-height: 1.3; }
.stat small { font-size: 12px; color: var(--muted); }
.stat.amber > span { background: var(--amber-50); color: var(--amber); }
.stat.teal > span { background: var(--primary-50); color: var(--primary); }
.stat.rose > span { background: var(--rose-50); color: var(--rose); }
.stat.green > span { background: var(--green-50); color: var(--green); }
.stat.sky > span { background: var(--sky-50); color: var(--sky); }
.stat.indigo > span { background: var(--indigo-50); color: var(--indigo); }
.stat.violet > span { background: var(--violet-50); color: var(--violet); }
.card h2 { font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.card h2 .ico { color: var(--primary); }
.recent { list-style: none; margin: 0; padding: 0; }
.recent li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; }
.recent li + li { border-top: 1px solid var(--border); }
.recent small { display: block; color: var(--muted); font-size: 12px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.toolbar select { width: auto; min-width: 160px; flex: 1; }
.toolbar .search-box { min-width: 200px; margin-bottom: 0; }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 14px; font-size: 13.5px; }

/* responsive table: cards on mobile */
.rtable { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.rtable thead { display: none; }
.rtable tr { display: block; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 8px 12px; margin-bottom: 10px; }
.rtable td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; text-align: left; }
.rtable td + td { border-top: 1px dashed var(--border); }
.rtable td::before { content: attr(data-label); color: var(--muted); font-weight: 600; text-align: right; flex-shrink: 0; }
.rtable td[data-label=""]::before { content: none; }
.rtable td.actions { justify-content: flex-end; flex-wrap: wrap; }
.rtable select { min-height: 36px; padding: 4px 10px; padding-left: 32px; width: auto; font-size: 13px; border-radius: 10px; background-position: left 8px center; }
.card .rtable tr { border: 0; padding: 0; margin: 0; border-radius: 0; background: transparent; }
.card .rtable tr + tr { border-top: 1px solid var(--border); padding-top: 4px; }

.steps-editor { border: 1px solid var(--border); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.steps-editor h3 { font-size: 14.5px; font-weight: 800; }
.step-edit { display: grid; grid-template-columns: 1fr auto; gap: 6px; padding-bottom: 10px; border-bottom: 1px dashed var(--border); }
.step-edit .st-title { grid-column: 1; }
.step-edit .st-text { grid-column: 1; }
.step-edit .icon-btn { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
label.full { grid-column: 1 / -1; }

/* ---------------- loading / empty */
.loading { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 50px 20px; color: var(--muted); }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 44px 20px; color: var(--muted); }
.empty > .ico { color: var(--border-2); margin-bottom: 4px; }
.empty h3 { color: var(--text); font-size: 16px; font-weight: 800; }
.empty p { max-width: 420px; font-size: 14px; }
.empty .btn { margin-top: 10px; }
.empty.err > .ico { color: var(--amber); }
.suggest h3 { font-size: 14px; color: var(--muted); margin: 10px 0; }

/* ---------------- toasts & modal */
.toasts { position: fixed; z-index: 90; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px); display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; background: #10232b; color: #fff; font-weight: 600; font-size: 14px; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(10px); transition: opacity .25s, transform .25s; pointer-events: auto; }
.toast.show { opacity: 1; transform: none; }
.toast.ok .ico { color: #4ade80; }
.toast.err .ico { color: #ff7a7e; }
.modal-wrap { position: fixed; inset: 0; z-index: 80; background: rgba(8, 20, 26, .5); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .2s; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.modal-wrap.show { opacity: 1; }
.modal { position: relative; width: 100%; max-height: 92vh; overflow-y: auto; background: var(--card); border-radius: 24px 24px 0 0; padding: 26px 18px calc(22px + var(--safe-b)); transform: translateY(30px); transition: transform .25s cubic-bezier(.2, .9, .3, 1); overscroll-behavior: contain; }
.modal-wrap.show .modal { transform: none; }
.modal::before { content: ''; position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 42px; height: 4px; border-radius: 4px; background: var(--border-2); }
.modal-x { position: absolute; top: 12px; left: 12px; }
.modal .form h2, .sheet-head h2 { padding-left: 40px; }
.sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.sheet-head h2 { font-size: 19px; font-weight: 900; }
.pulse-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--red); animation: sosPulse 1.6s infinite; }
.em-list { display: grid; gap: 8px; margin-top: 14px; }
.em-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--border); color: var(--text); }
.em-item:hover { text-decoration: none; border-color: var(--border-2); background: var(--bg); }
.em-ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; }
.em-txt { display: flex; flex-direction: column; flex: 1; }
.em-txt b { font-size: 20px; font-weight: 900; line-height: 1.3; }
.em-txt small { color: var(--muted); font-size: 12.5px; }
.em-item > .ico:last-child { color: var(--green); }
.em-item.red .em-ico { background: var(--red-50); color: var(--red); }
.em-item.orange .em-ico { background: var(--orange-50); color: var(--orange); }
.em-item.blue .em-ico { background: var(--blue-50); color: var(--blue); }
.em-item.teal .em-ico { background: var(--primary-50); color: var(--primary); }
.em-item.rose .em-ico { background: var(--rose-50); color: var(--rose); }
.em-item.violet .em-ico { background: var(--violet-50); color: var(--violet); }
.confirm { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 6px; }
.confirm p { font-size: 15px; font-weight: 600; }
.confirm .row-btns { justify-content: center; }
.confirm-ico { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; }
.confirm-ico.red { background: var(--red-50); color: var(--red); }
.confirm-ico.teal { background: var(--primary-50); color: var(--primary); }
.install-steps { padding-right: 20px; margin: 0; display: grid; gap: 8px; color: var(--text-2); }
.install-steps li .ico { display: inline-block; vertical-align: middle; }

/* ==========================================================================
   Larger screens
   ========================================================================== */
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .services { grid-template-columns: repeat(2, 1fr); }
  .quick-grid { grid-template-columns: repeat(8, 1fr); }
  .em-strip { gap: 10px; }
  .guide-actions { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
  .filter-row { grid-template-columns: 1fr 220px; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .info-grid { grid-template-columns: repeat(3, 1fr); }
  .hero { padding: 36px 32px; }
  .hero h1 { font-size: 32px; }
  .login-btn span { display: inline; }
  .modal-wrap { align-items: center; padding: 20px; }
  .modal { width: min(560px, 100%); border-radius: 24px; padding: 28px 24px; max-height: 88vh; }
  .modal.wide { width: min(820px, 100%); }
  .modal::before { display: none; }
  .me-links { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 960px) {
  body { font-size: 15.5px; }
  .topnav { display: flex; }
  .tabbar { display: none; }
  .view { padding: 26px 24px 60px; }
  .toasts { bottom: 24px; }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .services { grid-template-columns: repeat(4, 1fr); }
  .service { flex-direction: column; align-items: flex-start; }
  .service > .ico:last-child { display: none; }
  .em-strip { grid-template-columns: repeat(5, 1fr); }
  .em-chip { flex-direction: row; justify-content: center; gap: 10px; padding: 14px; }
  .em-chip small { font-size: 12px; }
  .hero { padding: 48px 44px; }
  .hero h1 { font-size: 38px; }
  .hero-art { left: 40px; bottom: 50%; transform: translateY(50%) rotate(-8deg); opacity: .16; }
  .hero-art .ico { width: 260px; height: 260px; }
  .guide-hero, .drug-hero, .course-hero { padding: 30px; }
  .guide-hero h1, .drug-hero h1, .course-hero h1 { font-size: 28px; }
  .drug-grid { grid-template-columns: repeat(2, 1fr); }
  .course-layout { grid-template-columns: 1.4fr 1fr; align-items: start; }
  #enrollBox { position: sticky; top: calc(var(--topbar-h) + 16px); }
  .auth { grid-template-columns: 1fr 1.1fr; align-items: stretch; margin-top: 20px; }
  .auth-side { display: flex; flex-direction: column; justify-content: center; gap: 16px; padding: 36px; border-radius: var(--r-lg); color: #fff; background: linear-gradient(150deg, #12b39f, #0b6d74); box-shadow: 0 20px 40px -24px rgba(11, 110, 100, .9); }
  .auth-side .brand-mark { background: rgba(255,255,255,.2); box-shadow: none; }
  .auth-side h2 { font-size: 28px; font-weight: 900; }
  .auth-side ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
  .auth-side li { display: flex; align-items: center; gap: 10px; font-weight: 600; }
  .auth-card { padding: 32px; }
  .admin { grid-template-columns: 230px 1fr; align-items: start; }
  .admin-nav { flex-direction: column; position: sticky; top: calc(var(--topbar-h) + 16px); padding: 8px; }
  .admin-nav a { padding: 11px 14px; }
  .rtable thead { display: table-header-group; }
  .rtable thead th { text-align: right; font-size: 12.5px; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--bg); }
  .rtable thead th:first-child { border-radius: 0 12px 0 0; }
  .rtable thead th:last-child { border-radius: 12px 0 0 0; }
  .rtable tr { display: table-row; border: 0; padding: 0; margin: 0; background: var(--card); }
  .rtable td { display: table-cell; padding: 12px; text-align: right; border-bottom: 1px solid var(--border); vertical-align: middle; }
  .rtable td + td { border-top: 0; }
  .rtable td::before { content: none; }
  .rtable tbody tr:hover td { background: var(--bg); }
  .rtable { background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
  .card .rtable { border: 0; }
  .card .rtable tr + tr { border-top: 0; padding-top: 0; }
  .rtable td.actions { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .topbar, .tabbar, .toasts, .guide-actions, .cpr-tool { display: none !important; }
  .view { padding: 0; }
}

/* ---------------- SMS verification code */
.otp-box { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 14px; background: var(--primary-50); border: 1px dashed var(--primary-100); animation: viewIn .25s ease both; }
.otp-input { font-size: 26px !important; font-weight: 900; letter-spacing: 12px; text-align: center !important; min-height: 56px; }
.otp-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; font-size: 12.5px; color: var(--text-2); }
.otp-actions { display: flex; gap: 12px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--primary-600); font-weight: 700; font-size: 12.5px; }
.link-btn:disabled { color: var(--muted); cursor: default; font-weight: 500; }
input[readonly] { background: var(--bg); color: var(--text-2); }
.toast.info .ico { color: #7dd3fc; }
.stats.three { grid-template-columns: 1fr; }
.stat b.sm { font-size: 15px; }
@media (min-width: 640px) { .stats.three { grid-template-columns: repeat(3, 1fr); } }

/* ==========================================================================
   v1.2: triage, medicine box, medical card + SOS, questions to doctors
   ========================================================================== */
.mb { margin-bottom: 12px; }
.center-row { justify-content: center; margin-top: 14px; }
.chips.wrap { flex-wrap: wrap; overflow: visible; padding-bottom: 2px; }
.chip-x { border: 0; background: rgba(255,255,255,.25); color: inherit; border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center; margin-inline-start: 2px; }
.small-chip { height: 28px; font-size: 13px; padding: 0 10px; }
.topnav a { padding: 8px 10px; font-size: 14px; }
@media (max-width: 1180px) { .topnav a .ico { display: none; } .topnav { gap: 2px; } }
.hero-cta { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; color: #fff; font-weight: 700; font-size: 14px; background: rgba(255,255,255,.16); padding: 8px 14px; border-radius: 999px; }
.hero-cta:hover { text-decoration: none; background: rgba(255,255,255,.26); }

.tools-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tool { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: var(--r); color: var(--text); background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow-sm); transition: transform .15s; }
.tool:hover { text-decoration: none; transform: translateY(-2px); }
.tool > span { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; }
.tool b { font-size: 15px; font-weight: 800; }
.tool small { font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.t-triage > span { background: var(--orange-50); color: var(--orange); }
.t-qa > span { background: var(--rose-50); color: var(--rose); }
.t-meds > span { background: var(--sky-50); color: var(--sky); }
.t-card > span { background: var(--red-50); color: var(--red); }
.s-triage .s-ico { background: var(--orange-50); color: var(--orange); }
.s-card .s-ico { background: var(--red-50); color: var(--red); }
@media (min-width: 640px) { .tools-grid { grid-template-columns: repeat(4, 1fr); } }

/* triage */
.tri-card { display: flex !important; align-items: center; gap: 14px; }
.tri-card > div { flex: 1; min-width: 0; }
.tri-card h3 { font-size: 16px; font-weight: 800; }
.tri-card p { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tri-ico { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; flex-shrink: 0; background: var(--primary-50); color: var(--primary); }
.tri-card.red .tri-ico { background: var(--red-50); color: var(--red); }
.tri-card.sky .tri-ico { background: var(--sky-50); color: var(--sky); }
.tri-card.violet .tri-ico { background: var(--violet-50); color: var(--violet); }
.tri-card.amber .tri-ico { background: var(--amber-50); color: var(--amber); }
.tri-card.orange .tri-ico { background: var(--orange-50); color: var(--orange); }
.tri-card.indigo .tri-ico { background: var(--indigo-50); color: var(--indigo); }
.tri-card.rose .tri-ico { background: var(--rose-50); color: var(--rose); }
.tri-step { display: flex; flex-direction: column; gap: 14px; padding: 20px; animation: viewIn .25s ease both; }
.tri-progress { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--primary-600); font-weight: 800; }
.tri-step h2 { font-size: 18px; font-weight: 900; }
.tri-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tri-items li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--bg); font-size: 14.5px; }
.tri-items li .ico { color: var(--red); margin-top: 4px; }
.tri-opts { display: grid; gap: 10px; }
.tri-result { border-radius: var(--r-lg); padding: 20px; border: 2px solid; background: var(--card); animation: viewIn .25s ease both; }
.tri-result.red { border-color: var(--red); }
.tri-result.orange { border-color: var(--orange); }
.tri-result.amber { border-color: var(--amber); }
.tri-result.teal { border-color: var(--primary); }
.tri-res-head { display: flex; align-items: center; gap: 12px; margin: -20px -20px 14px; padding: 18px 20px; border-radius: 18px 18px 0 0; color: #fff; }
.tri-result.red .tri-res-head { background: linear-gradient(135deg, #f0565b, #c9353a); }
.tri-result.orange .tri-res-head { background: linear-gradient(135deg, #f58a4b, #d9561b); }
.tri-result.amber .tri-res-head { background: linear-gradient(135deg, #f5b041, #d48a0b); }
.tri-result.teal .tri-res-head { background: linear-gradient(135deg, #12b39f, #0a7f71); }
.tri-res-head small { font-weight: 700; opacity: .95; }
.tri-res-head h2 { font-size: 20px; font-weight: 900; }
.tri-res-text { font-size: 15px; font-weight: 600; }
.tri-advice { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.tri-advice li { display: flex; gap: 8px; font-size: 14px; color: var(--text-2); }
.tri-advice li .ico { color: var(--primary); margin-top: 5px; }
.tri-actions { display: grid; gap: 10px; margin-top: 16px; }

/* drug picker + interactions */
.picker { position: relative; }
.suggest-list { position: absolute; top: calc(100% + 4px); right: 0; left: 0; z-index: 20; list-style: none; margin: 0; padding: 6px; background: var(--card); border: 1px solid var(--border-2); border-radius: 14px; box-shadow: var(--shadow-lg); max-height: 300px; overflow-y: auto; }
.suggest-list button { width: 100%; display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; text-align: right; font-weight: 600; font-size: 14px; }
.suggest-list button:hover, .suggest-list button:focus { background: var(--primary-50); }
.suggest-list button .ico { color: var(--sky); }
.suggest-list small { margin-inline-start: auto; color: var(--muted); font-size: 12px; }
.ix { border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; border-inline-start: 4px solid; background: var(--card); box-shadow: var(--shadow-sm); }
.ix.red { border-color: var(--red); background: var(--red-50); }
.ix.amber { border-color: var(--amber); background: var(--amber-50); }
.ix.teal { border-color: var(--primary); }
.ix-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 4px; }
.ix p { font-size: 14px; color: var(--text-2); }
.drug-actions { margin: 14px 0 0; }

/* medicine box */
.sec-tight { margin-bottom: 14px; }
.doses { display: grid; gap: 8px; }
.dose { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "t m b" "a a a"; gap: 6px 12px; align-items: center; padding: 12px; border-radius: 14px; background: var(--bg); }
.dose-time { grid-area: t; font-size: 18px; font-weight: 900; color: var(--primary-600); min-width: 56px; text-align: center; }
.dose-main { grid-area: m; display: flex; flex-direction: column; min-width: 0; }
.dose-main small { color: var(--muted); }
.dose .badge { grid-area: b; }
.dose-act { grid-area: a; display: flex; gap: 6px; justify-content: flex-end; }
.dose.taken { background: var(--green-50); }
.dose.taken .dose-time { color: var(--green); }
.dose.due { background: var(--amber-50); }
.dose.skipped { opacity: .65; }
@media (min-width: 640px) { .dose { grid-template-columns: auto 1fr auto auto; grid-template-areas: "t m b a"; } }
.med-card { display: flex; flex-direction: column; gap: 8px; }
.med-card.inactive { opacity: .7; }
.times-box { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 14px; }
.time-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.time-row input { max-width: 180px; }

/* medical card + SOS */
.sos-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 18px; border-radius: var(--r-lg); margin-bottom: 16px; color: #fff; background: linear-gradient(140deg, #f0565b, #b8262c); box-shadow: 0 20px 40px -24px rgba(184, 38, 44, .9); }
.sos-panel > div { flex: 1; min-width: 200px; }
.sos-panel h2 { font-size: 18px; font-weight: 900; display: flex; align-items: center; gap: 8px; }
.sos-panel p { font-size: 13.5px; opacity: .95; }
.sos-big { width: 96px; height: 96px; border-radius: 50%; border: 5px solid rgba(255,255,255,.6); background: #fff; color: var(--red); font-size: 24px; font-weight: 900; letter-spacing: 1px; box-shadow: 0 0 0 0 rgba(255,255,255,.6); animation: sosRing 2s infinite; }
.sos-big:disabled { opacity: .5; animation: none; cursor: not-allowed; }
@keyframes sosRing { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.55); } 70% { box-shadow: 0 0 0 16px rgba(255,255,255,0); } 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); } }
.sheet-actions { display: grid; gap: 10px; margin-top: 16px; }
.success-ico.warn { background: var(--amber-50); color: var(--amber); }
.qr-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.qr { width: 220px; height: 220px; border-radius: 12px; border: 1px solid var(--border); background: #fff; padding: 6px; }
.mc-head { display: flex; align-items: center; gap: 8px; color: var(--red); font-size: 16px; }
.medcard { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.medcard-head { display: flex; align-items: center; gap: 12px; padding: 20px; border-radius: var(--r-lg); color: #fff; background: linear-gradient(140deg, #f0565b, #b8262c); }
.medcard-head > div:nth-child(2) { flex: 1; }
.medcard-head h1 { font-size: 22px; font-weight: 900; }
.medcard-head small { opacity: .9; font-weight: 700; }
.blood { text-align: center; background: #fff; color: var(--red); border-radius: 16px; padding: 6px 14px; }
.blood b { display: block; font-size: 26px; font-weight: 900; line-height: 1.2; }
.blood small { color: var(--muted); font-size: 11px; }
.medcard-body { display: grid; gap: 10px; }
.mc-row { display: flex; gap: 12px; padding: 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); }
.mc-row .ico { color: var(--primary); margin-top: 3px; }
.mc-row small { color: var(--muted); font-weight: 700; }
.mc-row p { font-size: 15.5px; font-weight: 600; }
.mc-row.alert { background: var(--red-50); border-color: transparent; }
.mc-row.alert .ico { color: var(--red); }
.medcard-contacts h2 { font-size: 15px; font-weight: 800; margin-bottom: 8px; }
.medcard-contacts .em-item { margin-bottom: 8px; background: var(--card); }
.map-links { display: grid; gap: 10px; }

/* questions to doctors */
.qa-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 14px; }
.qa-cta > div:nth-child(2) { flex: 1; min-width: 200px; }
.qa-cta h3 { font-size: 16px; font-weight: 800; }
.qa-cta p { font-size: 13px; color: var(--muted); }
.qa-cta .s-ico { background: var(--rose-50); color: var(--rose); }
.q-card { display: flex !important; flex-direction: column; gap: 6px; }
.q-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.q-card h3 { font-size: 15.5px; font-weight: 800; }
.q-card p { font-size: 13px; color: var(--text-2); }
.q-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); }
.q-meta span { display: flex; align-items: center; gap: 4px; }
.q-detail { display: flex; flex-direction: column; gap: 10px; }
.q-detail h1 { font-size: 20px; font-weight: 900; }
.q-body { white-space: pre-line; font-size: 14.5px; color: var(--text-2); overflow-wrap: anywhere; }
.answer { margin-bottom: 12px; border-inline-start: 4px solid var(--primary); }
.answer p { font-size: 14.5px; margin-top: 10px; }
.ans-who { display: flex; align-items: center; gap: 10px; }
.ans-who b { display: flex; align-items: center; gap: 4px; }
.ans-who small { display: block; color: var(--muted); font-size: 12px; }
.verified { color: var(--sky); }
.pq { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.pq h3 { font-size: 15.5px; font-weight: 800; }
.answer-form textarea { min-height: 90px; }
.count-dot { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; }
.adm-answer { display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--bg); }
.adm-answer p { margin-top: 4px; }
.pq .row-btns select { width: auto; min-height: 36px; padding: 4px 10px 4px 32px; font-size: 13px; border-radius: 10px; background-position: left 8px center; }
.me-tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.me-tools a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); color: var(--text); text-align: center; font-size: 12px; font-weight: 700; line-height: 1.5; }
.me-tools a:hover { text-decoration: none; border-color: var(--primary); }
.me-tools .ico { color: var(--primary); }

@media print {
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .print-area { position: absolute; top: 0; left: 0; right: 0; border: 2px solid #c9353a; }
  .no-print { display: none !important; }
}

/* ---------------- waitlist */
.wait-btn { background: var(--amber-50); color: #9a5a00; border: 1px solid #f3d29a; font-weight: 800; flex-wrap: wrap; }
.wait-btn:hover { background: #fbe8c6; }
.wait-btn small { font-weight: 600; font-size: 11.5px; opacity: .85; margin-inline-start: 6px; }
.wait-pos { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: var(--amber-50); color: #8a5200; font-size: 13.5px; margin: 0; }
.wait-pos .ico { color: var(--amber); flex-shrink: 0; }
.wait-pos .link-btn { margin-inline-start: auto; }
.wait-offer { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: var(--green-50); border: 1px solid #bfe6cd; margin-bottom: 8px; animation: viewIn .25s ease both; }
.wait-offer .ico { color: var(--green); flex-shrink: 0; animation: ring 1.6s ease-in-out infinite; transform-origin: 50% 10%; }
.wait-offer b { display: block; font-size: 13.5px; color: #126b3a; }
.wait-offer small { font-size: 12.5px; color: var(--text-2); }
.wait-card.offered { border-color: #9fdcb5; box-shadow: 0 0 0 3px var(--green-50); }
.wait-card .wait-pos { margin-top: 6px; }
.wait-card.expired, .wait-card.left, .wait-card.closed { opacity: .7; }
@keyframes ring { 0%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(-14deg); } 20%, 40% { transform: rotate(14deg); } 50% { transform: rotate(0); } }

/* ---------------- survey */
.survey-form { gap: 20px; }
.sv-q h2 { font-size: 16px; font-weight: 800; margin-bottom: 12px; }
.star-pick { display: flex; justify-content: center; gap: 6px; direction: ltr; flex-direction: row-reverse; }
.star-pick label { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; color: var(--border); padding: 4px; border-radius: 12px; transition: transform .12s; }
.star-pick label:hover { transform: scale(1.08); }
.star-pick label, .choice { position: relative; }
.star-pick input, .choice input { position: absolute; inset: 0; width: 1px !important; height: 1px !important; min-height: 0 !important; margin: 0; padding: 0; opacity: 0; pointer-events: none; }
.star-pick label .ico { color: #d5dde3; fill: #eef2f5; transition: color .12s, fill .12s; }
.star-pick label.on .ico { color: #f2a20c; fill: #fcc419; }
.star-pick input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 8px; }
.star-pick small { font-size: 11.5px; color: var(--muted); direction: rtl; }
.choice-row { display: flex; gap: 8px; flex-wrap: wrap; }
.choice { flex: 1; min-width: 90px; }
.choice span { display: block; text-align: center; padding: 11px 10px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--card); font-weight: 700; cursor: pointer; transition: all .12s; }
.choice input:checked + span { border-color: var(--primary); background: var(--primary-50); color: var(--primary-600); }
.choice input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.stars-view { display: inline-flex; gap: 1px; vertical-align: middle; direction: ltr; }
.stars-view .ico { color: #d5dde3; }
.stars-view .ico.on { color: #f2a20c; fill: #fcc419; }
.survey-done { display: flex; align-items: center; gap: 6px; color: var(--green); font-size: 13px; font-weight: 700; margin-top: 8px; flex-wrap: wrap; }
.survey-thanks .ico { color: var(--rose); }
.fb-card { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.fb-card p { font-size: 14px; }

/* ---------------- scarce-drug finder */
.dreq-card h3 { display: flex; align-items: center; gap: 6px; }
.dreq-card h3 .ico { color: var(--rose); }
.dreq-card.closed, .dreq-card.expired { opacity: .8; }
.offers { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; padding: 10px; border-radius: 12px; background: var(--green-50); }
.offers-title { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: #126b3a; }
.offer { display: flex; align-items: center; gap: 10px; justify-content: space-between; background: var(--card); border-radius: 10px; padding: 10px; border: 1px solid #cfeedb; }
.offer > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.offer small { font-size: 12px; color: var(--text-2); }
.offer-note { display: flex; align-items: center; gap: 4px; color: var(--primary-600) !important; }
.waiting-line { display: flex; align-items: flex-start; gap: 6px; padding: 8px 10px; border-radius: 10px; background: var(--amber-50); color: #8a5200 !important; }
.hint { display: block; font-size: 12px; color: var(--primary-600); margin-top: 4px; font-weight: 600; min-height: 1em; }
.note-box.amber { background: var(--amber-50); }
.note-box.amber .ico { color: var(--amber); }
.tab-host { display: flex; flex-direction: column; gap: 12px; }

/* ---------------- bars + impact report */
.hbars { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.hbar { display: grid; grid-template-columns: minmax(70px, 30%) 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.hbar-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.hbar-t { height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.hbar-t i { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.hbar-t i.amber { background: #f2a20c; } .hbar-t i.sky { background: var(--sky); } .hbar-t i.rose { background: var(--rose); }
.hbar b { min-width: 2.5em; text-align: left; font-weight: 800; }
.report { display: flex; flex-direction: column; gap: 14px; }
.report-head { display: flex; align-items: center; gap: 12px; padding: 18px; border-radius: var(--r); background: linear-gradient(135deg, var(--primary-600), var(--primary)); color: #fff; }
.report-head .brand-mark { background: rgba(255, 255, 255, .18); color: #fff; }
.report-head h2 { font-size: 18px; font-weight: 900; }
.report-head p { opacity: .9; font-size: 13px; }
.report-head small { margin-inline-start: auto; color: rgba(255, 255, 255, .85) !important; font-size: 12px; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: var(--r); background: var(--card); border: 1px solid var(--border); }
.kpi span { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 4px; }
.kpi b { font-size: 21px; font-weight: 900; line-height: 1.35; }
.kpi small { font-size: 12px; color: var(--muted); }
.kpi.teal span { background: var(--primary-50); color: var(--primary); } .kpi.sky span { background: var(--sky-50); color: var(--sky); }
.kpi.green span { background: var(--green-50); color: var(--green); } .kpi.amber span { background: var(--amber-50); color: var(--amber); }
.kpi.rose span { background: var(--rose-50); color: var(--rose); } .kpi.indigo span { background: var(--indigo-50); color: var(--indigo); }
.report-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.report .card h3 { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 800; margin-bottom: 10px; }
.report .card h3 .ico { color: var(--primary); }
.quotes { display: grid; grid-template-columns: 1fr; gap: 10px; }
.quotes blockquote { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--bg); border-inline-start: 4px solid var(--primary); display: flex; flex-direction: column; gap: 4px; }
.quotes blockquote p { font-size: 14px; }
.quotes blockquote small { color: var(--muted); font-size: 12px; }
.report-foot { display: flex; align-items: flex-start; gap: 4px; }
@media (min-width: 720px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .report-grid { grid-template-columns: repeat(2, 1fr); }
  .quotes { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1100px) { .report-grid:last-of-type { grid-template-columns: repeat(3, 1fr); } }
@media print {
  .print-area.report-print { border: 0; padding: 0; }
  .report { gap: 10px; font-size: 12px; }
  .report .card, .kpi { box-shadow: none !important; break-inside: avoid; border: 1px solid #d9e1e6; }
  .report-head { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .report-grid { grid-template-columns: repeat(2, 1fr); }
  .hbar-t, .hbar-t i, .kpi span, .stars-view .ico.on { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media print {
  body.print-report .topbar, body.print-report .tabbar, body.print-report .admin-nav, body.print-report .admin-body > .page-head,
  body.print-report .no-print, body.print-report .offline-bar, body.print-report .toasts { display: none !important; }
  body.print-report { background: #fff; }
  .view, .view.enter { animation: none !important; transform: none !important; }
  body.print-report .view { max-width: none; padding: 0; margin: 0; min-height: 0; }
  body.print-report .admin { display: block; }
  body.print-report .print-area.report-print { position: static !important; width: auto; }
  body.print-report .rtable { font-size: 11px; }
}
@page { margin: 12mm; }
