/* «Матеріали аптечки» — the app's palette (medication-tracker/theme/palette.js).
   Colour means alarm: the normal state is not painted, and there is no "all good" green. */
:root {
  --paper: #F5F2EC;
  --surface: #FFFDF9;
  --ink: #16171A;
  --muted: #5F5E5A;
  --faint: #9C978D;
  --line: #D9D3C7;
  --line-soft: #ECE6DA;
  --input-border: #CFC8BA;
  --danger: #C4281C;
  --danger-bg: #FBE7E4;
  --danger-text: #8E1D14;
  --seal: #1F3FBF;
  --on-ink: #FFFFFF;

  --sans: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --radius: 12px;
  --gutter: 20px;
}

/* Self-hosted: no request leaves moiliki.app (the privacy policy promises no trackers). */
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/onest-cyrillic-400-normal.woff2) format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/onest-latin-400-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+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 600; font-display: swap; src: url(/assets/fonts/onest-cyrillic-600-normal.woff2) format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 600; font-display: swap; src: url(/assets/fonts/onest-latin-600-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+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 800; font-display: swap; src: url(/assets/fonts/onest-cyrillic-800-normal.woff2) format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 800; font-display: swap; src: url(/assets/fonts/onest-latin-800-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+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url(/assets/fonts/ibm-plex-mono-cyrillic-500-normal.woff2) format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url(/assets/fonts/ibm-plex-mono-latin-500-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+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.55 var(--sans);
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--seal); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; font-weight: 800; letter-spacing: -0.01em; }
h1 { font-size: clamp(34px, 6vw, 56px); }
h2 { font-size: clamp(24px, 3.4vw, 32px); }
h3 { font-size: 19px; font-weight: 600; letter-spacing: 0; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 var(--gutter); }
.overline {
  font: 500 13px/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  margin: 0 0 12px;
}
.muted { color: var(--muted); }

/* Header & footer */
.site-header { padding: 18px 0; }
.site-header__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; text-decoration: none; }
.brand img { width: 32px; height: 32px; }
.lang {
  font: 500 13px/1 var(--mono);
  letter-spacing: .12em;
  text-decoration: none;
  padding: 10px 12px;
  border: 1px solid var(--input-border);
  border-radius: 10px;
}
.site-footer { margin-top: 72px; padding: 32px 0 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-bottom: 14px; }
.site-footer nav a { color: var(--ink); }
.site-footer p { margin: 0 0 6px; }
.site-footer .lang { border: 0; padding: 0; font: inherit; letter-spacing: 0; text-decoration: underline; text-underline-offset: 3px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 20px;
  border-radius: var(--radius);
  background: var(--ink); color: var(--on-ink);
  font: 600 16px/1.2 var(--sans);
  text-decoration: none;
  border: 1px solid var(--ink);
}
.btn:hover { background: #2A2B2F; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--input-border); }
.btn--ghost:hover { background: var(--line-soft); }
.btn--disabled { background: transparent; color: var(--muted); border: 1px dashed var(--input-border); cursor: default; }
.btn--disabled:hover { background: transparent; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Landing */
section { padding: 56px 0 0; }
.hero { padding-top: 32px; display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: center; }
.hero h1 { margin-bottom: 16px; }
.hero .note { margin: 14px 0 0; font-size: 15px; color: var(--muted); }
.hero .lead { font-size: 20px; color: var(--muted); max-width: 34em; margin-bottom: 28px; }
.phone {
  width: 280px; padding: 10px;
  background: var(--ink);
  border-radius: 44px;
  box-shadow: 0 30px 60px -30px rgba(22, 23, 26, .45);
}
.phone img { border-radius: 34px; width: 100%; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card h3 { margin-bottom: 8px; }
.card p { margin: 0; color: var(--muted); font-size: 16px; }
.card--alarm { border-color: var(--danger); background: var(--danger-bg); }
.card--alarm h3 { color: var(--danger-text); }
.card--alarm p { color: var(--danger-text); }
.card--alarm .icon { color: var(--danger); }
.icon { width: 28px; height: 28px; margin-bottom: 12px; }
.questions { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.questions li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; font-weight: 600; }
.band { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 32px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.band h2 { margin-bottom: 6px; }
.band p { margin: 0; color: var(--muted); }
.attribution { font-size: 14px; color: var(--muted); }

/* Long-form pages */
.prose { max-width: 720px; }
/* Long single words («конфіденційності») must fit a 320px screen without breaking mid-word. */
.prose h1 { margin-top: 16px; font-size: clamp(26px, 8vw, 48px); }
.prose h2 { margin-top: 1.8em; font-size: 24px; }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: .4em; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.2em; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th { font-weight: 600; background: var(--line-soft); }
.updated { font: 500 13px/1.4 var(--mono); color: var(--muted); letter-spacing: .04em; }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin: 24px 0 8px; }
.toc ol { margin: 0; }
.notice { background: var(--danger-bg); border: 1px solid var(--danger); color: var(--danger-text); border-radius: var(--radius); padding: 18px 22px; margin: 0 0 1.2em; }
.notice h2 { color: var(--danger-text); margin-top: 0; }
.notice p:last-child { margin-bottom: 0; }
.steps { counter-reset: step; list-style: none; padding: 0 !important; }
.steps li { counter-increment: step; position: relative; padding-left: 44px; margin-bottom: 14px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -2px;
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid var(--seal); color: var(--seal);
  font: 600 15px/26px var(--sans); text-align: center;
}
details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 20px; margin-bottom: 10px; }
summary { font-weight: 600; cursor: pointer; }
details[open] summary { margin-bottom: 8px; }
details p:last-child { margin-bottom: 0; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 36px; }
  .hero .phone { justify-self: center; }
  .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  :root { --gutter: 16px; }
  body { font-size: 16px; }
  section { padding-top: 44px; }
  .hero .lead { font-size: 18px; }
  .grid-2 { grid-template-columns: 1fr; }
  .phone { width: 240px; }
  .band { padding: 24px; }
  .actions .btn { flex: 1 1 100%; }
}
