/* SafeMeds.am — styles
   Layout: one calm column (max 1120px) — sticky top bar, phone bottom tab bar, the medicine card as the centre of gravity.
   Colour carries meaning: red = danger/never, amber = caution, green = do this, blue = information, purple = tests & review.
   The five WHO Moments each keep their own hue on every card. */

@font-face { font-family: 'SM Display'; font-style: normal; font-display: swap; font-weight: 200 900;
  src: url(../fonts/unbounded-latin-wght-normal.woff2) format('woff2-variations'), url(../fonts/unbounded-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'SM Display'; font-style: normal; font-display: swap; font-weight: 200 900;
  src: url(../fonts/unbounded-cyrillic-wght-normal.woff2) format('woff2-variations'), url(../fonts/unbounded-cyrillic-wght-normal.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'SM Text'; font-style: normal; font-display: swap; font-weight: 400 900;
  src: url(../fonts/golos-text-latin-wght-normal.woff2) format('woff2-variations'), url(../fonts/golos-text-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'SM Text'; font-style: normal; font-display: swap; font-weight: 400 900;
  src: url(../fonts/golos-text-cyrillic-wght-normal.woff2) format('woff2-variations'), url(../fonts/golos-text-cyrillic-wght-normal.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'SM Armenian'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(../fonts/noto-sans-armenian-armenian-wght-normal.woff2) format('woff2-variations'), url(../fonts/noto-sans-armenian-armenian-wght-normal.woff2) format('woff2');
  unicode-range: U+0308,U+0530-058F,U+2010,U+2024,U+25CC,U+FB13-FB17; }

:root {
  --bg: #F3F7F6;
  --surface: #FFFFFF;
  --surface-2: #E9F1EF;
  --ink: #0F2D2B;
  --ink-2: #4B6360;
  --line: #D3E1DE;
  --brand: #0B7A72;
  --brand-2: #095F59;
  --brand-ink: #FFFFFF;
  --brand-soft: #D9F0EC;
  --sun: #FFC93D;
  --danger-strong: #C8261F;
  --on-m: #FFFFFF;

  --danger: #C8261F; --danger-soft: #FDE9E7; --danger-ink: #8A1712;
  --warn: #B86A00;   --warn-soft: #FFF2D9;   --warn-ink: #6E4100;
  --ok: #19864A;     --ok-soft: #E0F4E8;     --ok-ink: #0E5530;
  --info: #1F62CE;   --info-soft: #E4EDFD;   --info-ink: #123F87;
  --review: #7042C2; --review-soft: #EFE8FB; --review-ink: #482383;

  --m1: #1F6FD1; --m2: #19864A; --m3: #D9700A; --m4: #7042C2; --m5: #0E8691;

  --shadow: 0 1px 2px rgba(15,45,43,.06), 0 6px 18px rgba(15,45,43,.07);
  --radius: 18px;
  --radius-sm: 12px;

  --font-display: 'SM Display', 'SM Armenian', 'Noto Sans Armenian', system-ui, sans-serif;
  --font-text: 'SM Text', 'SM Armenian', 'Noto Sans Armenian', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --fs-base: 17px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0C1716; --surface: #13211F; --surface-2: #1A2C2A; --ink: #E5F1EE; --ink-2: #A3BAB6; --line: #2A3E3B;
    --brand: #39C1B3; --brand-2: #5ED3C7; --brand-ink: #04211E; --brand-soft: #123733; --sun: #FFD25C; --danger-strong: #B3261E; --on-m: #0C1716;
    --danger: #FF6A61; --danger-soft: #3B1614; --danger-ink: #FFC9C4;
    --warn: #F4B13F;   --warn-soft: #382A0E;   --warn-ink: #FFE2A8;
    --ok: #4CCB85;     --ok-soft: #0F3020;     --ok-ink: #BDF0D2;
    --info: #6EA2FF;   --info-soft: #142545;   --info-ink: #C9DBFF;
    --review: #B48DFF; --review-soft: #261A3E; --review-ink: #E2D3FF;
    --m1: #6EA2FF; --m2: #4CCB85; --m3: #F59A3E; --m4: #B48DFF; --m5: #4CC9D2;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0C1716; --surface: #13211F; --surface-2: #1A2C2A; --ink: #E5F1EE; --ink-2: #A3BAB6; --line: #2A3E3B;
  --brand: #39C1B3; --brand-2: #5ED3C7; --brand-ink: #04211E; --brand-soft: #123733; --sun: #FFD25C; --danger-strong: #B3261E; --on-m: #0C1716;
  --danger: #FF6A61; --danger-soft: #3B1614; --danger-ink: #FFC9C4;
  --warn: #F4B13F;   --warn-soft: #382A0E;   --warn-ink: #FFE2A8;
  --ok: #4CCB85;     --ok-soft: #0F3020;     --ok-ink: #BDF0D2;
  --info: #6EA2FF;   --info-soft: #142545;   --info-ink: #C9DBFF;
  --review: #B48DFF; --review-soft: #261A3E; --review-ink: #E2D3FF;
  --m1: #6EA2FF; --m2: #4CCB85; --m3: #F59A3E; --m4: #B48DFF; --m5: #4CC9D2;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
  color-scheme: dark;
}
:root[data-size="2"] { --fs-base: 19px; }
:root[data-size="3"] { --fs-base: 21px; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: var(--fs-base); -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-text); font-size: 1rem; line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  min-height: 100vh;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 60; background: var(--surface); }
img, svg { max-width: 100%; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-2); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; text-wrap: balance; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.6rem); font-weight: 700; }
h2 { font-size: clamp(1.3rem, 1.05rem + 1.1vw, 1.75rem); font-weight: 700; }
h3 { font-size: 1.08rem; font-weight: 650; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 14px; border-radius: 10px; }
.skip:focus { left: 12px; }

.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.ico { width: 1.25em; height: 1.25em; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.22em; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 14px; min-height: 64px; padding-block: 8px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--font-display); font-weight: 750; font-size: 1.12rem; letter-spacing: -0.02em; white-space: nowrap; }
.logo:hover { color: var(--ink); }
.logo svg { width: 38px; height: 38px; flex: none; }
.logo .dot-am { color: var(--brand); }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a { white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 560; font-size: .92rem; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-2); }
.top-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.langs { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.langs button { border: 0; background: transparent; padding: 6px 10px; border-radius: 999px; cursor: pointer; font-weight: 650; font-size: .82rem; color: var(--ink-2); letter-spacing: .02em; }
.langs button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); }
.tool-btn { border: 1px solid var(--line); background: var(--surface); color: var(--ink); height: 38px; min-width: 38px; padding: 0 10px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; font-weight: 650; font-size: .85rem; text-decoration: none; }
.tool-btn:hover { background: var(--surface-2); color: var(--ink); }
.sos { background: var(--danger-strong); border-color: var(--danger-strong); color: #fff; }
.sos:hover { background: var(--danger-ink); color: #fff; }

@media (max-width: 1520px) { .nav a .ico { display: none; } .nav a { padding: 8px 10px; } .nav { margin-left: 0; } }
/* ---------- Bottom tab bar (phones) ---------- */
.tabbar { display: none; }
@media (max-width: 1180px) {
  .nav { display: none; }
  .topbar .wrap { min-height: 58px; gap: 10px; }
  .logo { font-size: 1rem; }
  .logo svg { width: 34px; height: 34px; }
  .sos .lbl { display: none; }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
    background: var(--surface); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom, 0px); padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px);
    box-shadow: 0 -6px 20px rgba(0,0,0,.06);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 9px; text-decoration: none; color: var(--ink-2); font-size: .7rem; font-weight: 600; line-height: 1.2; text-align: center; }
  .tabbar a .ico { width: 24px; height: 24px; }
  .tabbar a[aria-current="page"] { color: var(--brand); }
  .tabbar a .count { position: absolute; }
  main { padding-bottom: 92px; }
}
@media (max-width: 440px) { .topbar .wrap { gap: 8px; } .logo { font-size: .9rem; gap: 6px; } .logo svg { width: 28px; height: 28px; } .langs button { padding: 6px 7px; font-size: .74rem; } .tool-btn.size { display: none; } .tool-btn { height: 36px; min-width: 36px; padding: 0 8px; } }

/* ---------- Generic blocks ---------- */
main { display: block; padding-block: 24px 64px; }
.section { margin-top: 48px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.section-head p { color: var(--ink-2); max-width: 60ch; margin-top: 6px; }
.eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.muted { color: var(--ink-2); }
.small { font-size: .88rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 18px; border-radius: 999px; border: 1.5px solid transparent; font-weight: 650; font-size: .95rem; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-2); color: var(--brand-ink); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger { background: var(--danger-strong); color: #fff; }
.btn-on { background: var(--ok-soft); border-color: var(--ok); color: var(--ok-ink); }
.btn-sm { min-height: 38px; padding: 6px 14px; font-size: .88rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .8rem; font-weight: 650; line-height: 1.3; white-space: nowrap; }
.pill-ok { background: var(--ok-soft); color: var(--ok-ink); }
.pill-red { background: var(--danger-soft); color: var(--danger-ink); }
.pill-grey { background: var(--surface-2); color: var(--ink-2); }
.pill-amber { background: var(--warn-soft); color: var(--warn-ink); }
.pill-num { background: var(--surface-2); color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ---------- Search ---------- */
.search { position: relative; }
.search .ico { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; color: var(--ink-2); pointer-events: none; }
.search input { width: 100%; height: 62px; padding: 0 20px 0 54px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); font-size: 1.05rem; box-shadow: var(--shadow); }
.search input:focus { outline: none; border-color: var(--brand); }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); overflow: hidden; max-height: 420px; overflow-y: auto; }
.suggest a, .suggest button { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 14px; text-decoration: none; color: var(--ink); background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.suggest a:last-child, .suggest button:last-child { border-bottom: 0; }
.suggest a:hover, .suggest button:hover, .suggest .on { background: var(--surface-2); }
.suggest .nm { font-weight: 600; }
.suggest .sub { font-size: .82rem; color: var(--ink-2); }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 32px; align-items: center; padding-top: 12px; }
.hero h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.2rem); font-weight: 800; letter-spacing: -0.025em; }
.hero h1 .hl { color: var(--brand); }
.hero .lead { font-size: 1.08rem; color: var(--ink-2); margin: 14px 0 22px; max-width: 58ch; }
.hero .tag { display: inline-flex; gap: 8px; align-items: center; margin-bottom: 14px; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 650; font-size: .88rem; }
.hero .tag .dots { display: inline-flex; gap: 3px; }
.hero .tag .dots i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.hero-art { position: relative; }
.hero-art svg { width: 100%; height: auto; display: block; }
.stats { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; color: var(--ink-2); font-size: .9rem; }
.stats b { color: var(--ink); font-family: var(--font-display); font-weight: 750; font-size: 1.05rem; margin-right: 4px; font-variant-numeric: tabular-nums; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.quick a { padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: .88rem; font-weight: 560; }
.quick a:hover { border-color: var(--brand); color: var(--brand-2); }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; } .hero-art { order: -1; max-width: 340px; margin: 0 auto; } }

/* illustration parts */
.ill-surface { fill: var(--surface); }
.ill-surface2 { fill: var(--surface-2); }
.ill-line { stroke: var(--line); }
.ill-ink { fill: var(--ink); }
.ill-ink2 { fill: var(--ink-2); }
.ill-brand { fill: var(--brand); }
.ill-brandsoft { fill: var(--brand-soft); }

/* ---------- Know / Check / Ask ---------- */
.kca { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.kca .card { padding: 20px; display: grid; gap: 10px; align-content: start; border-top: 5px solid var(--c); }
.kca .ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--c); color: #fff; }
.kca .ic .ico { width: 28px; height: 28px; }
.kca h3 { font-size: 1.35rem; }
.kca p { color: var(--ink-2); }
@media (max-width: 760px) { .kca { grid-template-columns: 1fr; } }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; counter-reset: st; }
.steps li { position: relative; padding: 18px 16px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.steps li::before { counter-increment: st; content: counter(st); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--bg); font-family: var(--font-display); font-weight: 750; margin-bottom: 10px; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .steps { grid-template-columns: 1fr; } }

/* ---------- Five moments strip ---------- */
.moments { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.moment-tile { padding: 16px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 8px; align-content: start; position: relative; }
.moment-tile .n { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--mc); color: var(--on-m); font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; }
.moment-tile h3 { color: var(--mc); }
.moment-tile p { font-size: .88rem; color: var(--ink-2); }
@media (max-width: 900px) { .moments { grid-template-columns: 1fr; } .moment-tile { grid-template-columns: 44px 1fr; column-gap: 12px; } .moment-tile .n { grid-row: span 2; } }

/* ---------- High alert ---------- */
.hi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.hi { padding: 18px; border-radius: var(--radius); background: var(--danger-soft); border: 1.5px solid color-mix(in srgb, var(--danger) 35%, transparent); display: grid; gap: 8px; align-content: start; }
.hi .hd { display: flex; align-items: center; gap: 10px; color: var(--danger-ink); }
.hi .hd .ico { width: 26px; height: 26px; color: var(--danger); }
.hi p { color: var(--danger-ink); font-size: .93rem; }
.hi .links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.hi .links a { font-size: .82rem; font-weight: 650; padding: 4px 10px; border-radius: 999px; background: var(--surface); color: var(--danger-ink); text-decoration: none; border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent); }
@media (max-width: 900px) { .hi-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .hi-grid { grid-template-columns: 1fr; } }

/* ---------- Legend ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.legend span { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 999px; font-size: .85rem; font-weight: 600; }
.legend i { width: 14px; height: 14px; border-radius: 50%; display: block; }

/* ---------- Categories ---------- */
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.cat { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); min-width: 0; }
.cat:hover { border-color: var(--cc); color: var(--ink); }
.cat .nm { font-weight: 600; font-size: .92rem; line-height: 1.3; min-width: 0; }
.cat .ct { margin-left: auto; font-size: .8rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tile { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--cc); color: #fff; flex: none; }
.tile .ico { width: 24px; height: 24px; }
.tile.lg { width: 72px; height: 72px; border-radius: 22px; }
.tile.lg .ico { width: 40px; height: 40px; }
.tile.sm { width: 34px; height: 34px; border-radius: 10px; }
.tile.sm .ico { width: 20px; height: 20px; }

/* ---------- Ready cards chips ---------- */
.ready { display: flex; flex-wrap: wrap; gap: 8px; }
.ready a { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 560; font-size: .9rem; }
.ready a:hover { border-color: var(--cc); color: var(--ink); }
.ready .tile { width: 28px; height: 28px; border-radius: 50%; }
.ready .tile .ico { width: 16px; height: 16px; }
.ready a.hi-alert { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }

/* ---------- Medicines list ---------- */
.list-head { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip-f { border: 1.5px solid var(--line); background: var(--surface); padding: 7px 14px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; }
.chip-f[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.filters select { border: 1.5px solid var(--line); background: var(--surface); padding: 7px 12px; border-radius: 999px; font-weight: 600; font-size: .88rem; max-width: 100%; }
.count-line { color: var(--ink-2); font-size: .9rem; }
.mlist { display: grid; gap: 8px; margin-top: 8px; }
.mrow { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); min-width: 0; }
.mrow:hover { border-color: var(--cc); color: var(--ink); }
.mrow .txt { min-width: 0; }
.mrow .nm { font-weight: 650; font-size: 1.02rem; overflow-wrap: anywhere; }
.mrow .sub { font-size: .84rem; color: var(--ink-2); overflow-wrap: anywhere; }
.mrow .badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 600px) { .mrow { grid-template-columns: auto 1fr; } .mrow .badges { grid-column: 2; justify-content: flex-start; } }
.more { display: flex; justify-content: center; margin-top: 14px; }

/* ---------- Medicine page ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 600; color: var(--ink-2); margin-bottom: 14px; font-size: .92rem; }
.med-head { position: relative; overflow: hidden; display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start; padding: 22px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.med-head::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: var(--cc); }
.med-head::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: var(--cc); opacity: .08; pointer-events: none; }
.med-head h1 { overflow-wrap: anywhere; }
.med-head .alt { margin-top: 6px; color: var(--ink-2); font-size: .98rem; overflow-wrap: anywhere; }
.med-head .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.med-titles { min-width: 0; }
@media (max-width: 560px) { .med-head { grid-template-columns: 1fr; padding: 18px; } .tile.lg { width: 58px; height: 58px; border-radius: 18px; } .tile.lg .ico { width: 32px; height: 32px; } }

.alert { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 16px 18px; border-radius: var(--radius); font-weight: 600; margin-top: 16px; }
.alert .ico { width: 28px; height: 28px; margin-top: 1px; }
.alert-red { background: var(--danger-strong); color: #fff; }
.alert-amber { background: var(--warn-soft); color: var(--warn-ink); border: 1.5px solid color-mix(in srgb, var(--warn) 45%, transparent); }
.alert-amber .ico { color: var(--warn); }
.alert .lbl { display: block; font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; opacity: .9; margin-bottom: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px; border-radius: 999px; font-weight: 650; font-size: .9rem; border: 1.5px solid currentColor; }
.chip .ico { width: 20px; height: 20px; }
.c-red { color: var(--danger-ink); background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.c-red .ico { color: var(--danger); }
.c-amber { color: var(--warn-ink); background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.c-amber .ico { color: var(--warn); }
.c-green { color: var(--ok-ink); background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.c-green .ico { color: var(--ok); }
.c-blue { color: var(--info-ink); background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 35%, transparent); }
.c-blue .ico { color: var(--info); }
.c-purple { color: var(--review-ink); background: var(--review-soft); border-color: color-mix(in srgb, var(--review) 35%, transparent); }
.c-purple .ico { color: var(--review); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.mstack { display: grid; gap: 14px; margin-top: 22px; }
.msec { display: grid; grid-template-columns: 56px 1fr; gap: 0 16px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); border-left: 6px solid var(--mc); }
.msec .num { grid-row: span 2; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--mc); color: var(--on-m); }
.msec .num .ico { width: 26px; height: 26px; }
.msec .mh { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.msec .mh h2 { font-size: 1.25rem; color: var(--mc); }
.msec .mh .q { color: var(--ink-2); font-size: .9rem; }
.msec .body { display: grid; gap: 14px; margin-top: 10px; min-width: 0; }
.msec .sub { font-weight: 700; font-size: .95rem; margin-bottom: 6px; }
@media (max-width: 560px) { .msec { grid-template-columns: 1fr; padding: 16px; } .msec .num { grid-row: auto; width: 40px; height: 40px; margin-bottom: 8px; } }

.bl { display: grid; gap: 7px; }
.bl li { position: relative; padding-left: 28px; }
.bl li::before { content: ""; position: absolute; left: 6px; top: .62em; width: 8px; height: 8px; border-radius: 50%; background: var(--mk, var(--ink-2)); }
.bl.check li::before { width: 16px; height: 16px; left: 2px; top: .3em; border-radius: 50%; background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.6 2.5L12 5.5' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat; }
.box { padding: 14px 16px; border-radius: var(--radius-sm); }
.box .bh { display: flex; align-items: center; gap: 8px; font-weight: 750; margin-bottom: 8px; }
.box .bh .ico { width: 22px; height: 22px; }
.box-red { background: var(--danger-soft); color: var(--danger-ink); border: 1.5px solid color-mix(in srgb, var(--danger) 30%, transparent); --mk: var(--danger); }
.box-red .bh .ico { color: var(--danger); }
.box-amber { background: var(--warn-soft); color: var(--warn-ink); --mk: var(--warn); }
.box-amber .bh .ico { color: var(--warn); }
.box-blue { background: var(--info-soft); color: var(--info-ink); --mk: var(--info); }
.box-blue .bh .ico { color: var(--info); }
.box-purple { background: var(--review-soft); color: var(--review-ink); --mk: var(--review); }
.box-purple .bh .ico { color: var(--review); }
.box-green { background: var(--ok-soft); color: var(--ok-ink); --mk: var(--ok); }
.box-green .bh .ico { color: var(--ok); }
.box-grey { background: var(--surface-2); color: var(--ink); }
.call { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-weight: 750; color: #fff; background: var(--danger-strong); padding: 6px 14px; border-radius: 999px; text-decoration: none; }
.call:hover { color: #fff; background: var(--danger-ink); }

.rule { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); }
.rule .ico { width: 24px; height: 24px; margin-top: 2px; }
.rule.red { background: var(--danger-soft); color: var(--danger-ink); border: 1.5px solid color-mix(in srgb, var(--danger) 35%, transparent); }
.rule.red .ico { color: var(--danger); }
.rule.amber { background: var(--warn-soft); color: var(--warn-ink); border: 1.5px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.rule.amber .ico { color: var(--warn); }
.rule .rt { font-weight: 700; }
.rule .rr { margin-top: 2px; }
.rule .rd { margin-top: 4px; font-weight: 600; }

.sources { margin-top: 22px; padding: 18px 20px; display: grid; gap: 10px; }
.sources ul { display: grid; gap: 6px; }
.sources li { display: flex; gap: 8px; align-items: baseline; }
.draft { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--warn-ink); font-size: .9rem; }
.draft .ico { color: var(--warn); }

.soon { padding: 20px; margin-top: 18px; display: grid; gap: 14px; }
.qlist { display: grid; gap: 10px; counter-reset: q; }
.qlist li { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.qlist li .n { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--mc); color: var(--on-m); font-weight: 800; font-family: var(--font-display); }

/* ---------- My medicines ---------- */
.my-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .my-grid { grid-template-columns: 1fr; } }
.my-list { display: grid; gap: 10px; }
.my-item { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); min-width: 0; }
.my-item.flag { border-color: var(--danger); box-shadow: inset 4px 0 0 var(--danger); }
.my-item .nm { font-weight: 700; text-decoration: none; color: var(--ink); overflow-wrap: anywhere; }
.my-item .sub { font-size: .84rem; color: var(--ink-2); overflow-wrap: anywhere; }
.my-item input { width: 100%; margin-top: 6px; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 7px 10px; font-size: .9rem; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { color: var(--danger); border-color: var(--danger); }
.empty { padding: 28px 20px; text-align: center; display: grid; gap: 12px; justify-items: center; }
.empty svg.art { width: 150px; height: auto; }
.example-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--info-soft); color: var(--info-ink); font-weight: 600; font-size: .9rem; }
.side { display: grid; gap: 14px; }
.side .card { padding: 18px; display: grid; gap: 10px; }
.confirm { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger-ink); font-weight: 600; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 18px; padding: 22px; }
.field { display: grid; gap: 6px; }
.field > label, .field > .lbl { font-weight: 700; }
.field input[type=text], .field input[type=date], .field textarea, .field select { width: 100%; border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px 14px; font-size: 1rem; }
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--brand); }
.radios { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.radios label { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); cursor: pointer; font-weight: 600; background: var(--surface); }
.radios label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.radios input { accent-color: var(--brand); width: 18px; height: 18px; }
.radios .ico { color: var(--rc, var(--ink-2)); }
.hint { font-size: .86rem; color: var(--ink-2); }
.result textarea { width: 100%; min-height: 240px; font-family: var(--font-text); font-size: .9rem; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--bg); }

/* ---------- About ---------- */
.prose { max-width: 70ch; display: grid; gap: 14px; }
.prose h2 { margin-top: 18px; }
.prose ul { display: grid; gap: 6px; }
.prose li { padding-left: 22px; position: relative; }
.prose li::before { content: ""; position: absolute; left: 4px; top: .65em; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin: 6px 0; }
.facts div { padding: 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }
.facts b { display: block; font-family: var(--font-display); font-size: 1.5rem; color: var(--brand); font-variant-numeric: tabular-nums; }
.std { display: flex; flex-wrap: wrap; gap: 6px; }
.std span { font-size: .82rem; font-weight: 700; padding: 4px 10px; border-radius: 8px; background: var(--surface-2); font-variant-numeric: tabular-nums; }

/* ---------- Staff tools ---------- */
.labels-sheet { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; background: #fff; color: #111; border: 1px dashed var(--line); width: 100%; max-width: 760px; }
.label { display: grid; grid-template-columns: 30mm 1fr; gap: 6px; align-items: center; height: 37mm; padding: 3mm; border: 1px dashed #ccc; overflow: hidden; font-family: var(--font-text); }
.label svg { width: 28mm; height: 28mm; }
.label > div { min-width: 0; }
.label .ln { font-weight: 800; font-size: 10.5pt; line-height: 1.15; overflow-wrap: break-word; hyphens: auto; }
.label .li { font-size: 8pt; color: #333; margin-top: 2px; }
.label .lu { font-size: 7.5pt; color: #0B7A72; font-weight: 700; margin-top: 3px; }
.label .le { font-size: 7pt; color: #555; }
@media (max-width: 620px) { .labels-sheet { grid-template-columns: 1fr 1fr; } }
.picked { display: flex; flex-wrap: wrap; gap: 6px; }
.picked button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); padding: 5px 10px; border-radius: 999px; cursor: pointer; font-size: .86rem; font-weight: 600; }

.poster { width: 100%; max-width: 620px; aspect-ratio: 210 / 297; margin: 0 auto; background: #fff; color: #10302E; border-radius: 6px; box-shadow: var(--shadow); padding: 6%; display: grid; grid-template-rows: auto auto 1fr auto; gap: 3.5%; font-family: var(--font-text); overflow: hidden; }
.poster .pt { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: clamp(14px, 3.6vw, 24px); }
.poster .pt svg { width: 12%; height: auto; }
.poster .pk { display: grid; gap: 2%; }
.poster .pk div { display: flex; align-items: center; gap: 4%; font-family: var(--font-display); font-weight: 800; font-size: clamp(18px, 6vw, 40px); line-height: 1.05; }
.poster .pk i { width: 14%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; }
.poster .pk i svg { width: 60%; height: 60%; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.poster .pq { display: grid; grid-template-columns: 46% 1fr; gap: 5%; align-items: center; }
.poster .pq svg { width: 100%; height: auto; }
.poster .pq p { font-size: clamp(10px, 2.3vw, 15px); line-height: 1.4; }
.poster .pq p b { display: block; font-size: 1.25em; margin-bottom: 2px; }
.poster .pf { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: clamp(9px, 2vw, 13px); border-top: 2px solid #E3ECEA; padding-top: 3%; }
.poster .pf .s { background: #C8261F; color: #fff; padding: 4px 10px; border-radius: 999px; font-weight: 800; white-space: nowrap; }

/* ---------- Modal & toast ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(5, 20, 18, .55); }
.modal .sheet { background: var(--surface); color: var(--ink); border-radius: 22px; padding: 22px; width: min(440px, 100%); display: grid; gap: 14px; justify-items: center; text-align: center; max-height: 90vh; overflow: auto; }
.modal .qr { background: #fff; padding: 12px; border-radius: 16px; width: min(280px, 80vw); }
.modal .qr svg { display: block; width: 100%; height: auto; }
.modal .url { font-size: .82rem; color: var(--ink-2); overflow-wrap: anywhere; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 90; background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 600; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
@media (max-width: 1180px) { .toast { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); } }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--line); background: var(--surface); padding-block: 28px 32px; margin-top: 40px; }
.foot .wrap { display: grid; gap: 18px; }
.foot .row { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; justify-content: space-between; }
.foot .disc { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: .92rem; }
.foot .disc .ico { color: var(--brand); width: 24px; height: 24px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .9rem; }
.foot .fine { font-size: .82rem; color: var(--ink-2); }
.partners-wrap { display: grid; gap: 10px; padding-top: 4px; }
.partners-wrap .eyebrow { margin: 0; }
.partners { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; }
.partner { display: flex; align-items: center; justify-content: center; height: 64px; padding: 8px 14px; border-radius: var(--radius-sm); background: #fff; border: 1px solid var(--line); transition: transform .15s ease, box-shadow .15s ease; }
.partner:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.10); }
.partner img { display: block; max-height: 46px; width: auto; max-width: 220px; }
.partner-moh { background: #465B88; border-color: #465B88; padding: 6px 10px; }
.partner-moh img { max-height: 52px; }
/* prototype strip */
.protostrip { background: linear-gradient(90deg, #0B3C8C, #0C5A78 60%, #0E6B6E); color: #fff; font-size: .82rem; line-height: 1.35; }
.protostrip .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding-block: 7px; }
.protostrip a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.proto-tag { flex: none; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.22); border: 1px solid rgba(255,255,255,.45); }
.proto-txt { flex: 1 1 320px; min-width: 0; }
.protostrip a.proto-in { flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: #fff; color: #0A66C2; text-decoration: none; font-weight: 700; }
.proto-in .ico { width: 15px; height: 15px; }
.reg-hint { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; color: var(--ink-2); font-size: .9em; }
.reg-hint code { font-family: inherit; font-weight: 700; color: var(--ink); background: var(--surface-2); padding: 1px 7px; border-radius: 6px; }
@media print { .protostrip { display: none !important; } }
@media (max-width: 1180px) { .foot { padding-bottom: 110px; } }

.print-only { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .fade { animation: fade .28s ease both; }
  @keyframes fade { from { opacity: .4; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}

/* ---------- Print ---------- */
@media print {
  @page { size: A4; margin: 12mm; }
  @page labels { size: A4; margin: 0.5mm 0; }
  :root { --fs-base: 12pt; color-scheme: light; }
  body { background: #fff !important; color: #000 !important; }
  body::before, .topbar, .tabbar, .foot, .actions, .back, .no-print, .toast, .modal, .skip { display: none !important; }
  main { padding: 0 !important; }
  .card, .msec, .med-head { box-shadow: none !important; break-inside: avoid; }
  .msec { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
  body[data-print="labels"] main > *:not(.print-labels), body[data-print="poster"] main > *:not(.print-poster), body[data-print="my"] main .wrap > *:not(.print-my) { display: none !important; }
  body[data-print="labels"] .print-labels > *:not(.labels-sheet) { display: none !important; }
  body[data-print="labels"] .labels-sheet { border: 0; max-width: none; width: 210mm; grid-template-columns: repeat(3, 70mm); page: labels; }
  body[data-print="labels"] .label { border: 0; }
  body[data-print="poster"] .print-poster > *:not(.poster) { display: none !important; }
  body[data-print="poster"] .poster { box-shadow: none; max-width: none; width: 186mm; border-radius: 0; padding: 12mm; }
  body[data-print="my"] .print-my { display: block !important; }
  body[data-print="label1"] main > *:not(.print-label1) { display: none !important; }
  body[data-print="label1"] .print-label1 { display: block !important; }
  .print-my table { width: 100%; border-collapse: collapse; font-size: 14pt; }
  .print-my th, .print-my td { border: 1px solid #999; padding: 8px; text-align: left; vertical-align: top; }
  .print-my h1 { font-size: 22pt; margin-bottom: 8px; }
  .print-my .pf { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; margin: 10px 0 14px; font-size: 13pt; }
  .print-my .pf div { border-bottom: 1px solid #999; padding: 8px 0; }
}
