/* ────────────────────────────────────────────────────────────
   Medicine — Patient app prototype
   Design tokens. Warm, calm, clinical-but-humane.
   Aesthetic system declared up-front:
     · Type: Literata (display, serif, кириллица) +
             Manrope (body, humanist sans). Both Cyrillic-friendly.
     · Color: warm off-white background, sage primary, sand accent.
       Chroma stays low (≤ 0.05) — no saturated UI panic colors.
     · Density: generous. Audience is 40+. Base 17px, CTAs ≥ 20px.
     · No emoji in system voice. Curator voice is allowed warmth.
   ──────────────────────────────────────────────────────────── */

:root {
  /* sage palette (default) */
  --bg:           #f5f1e8;        /* warm sand-white */
  --bg-alt:       #ebe5d6;        /* slightly deeper, section bands */
  --surface:      #fbf8f1;        /* card */
  --surface-2:    #ffffff;        /* elevated card */
  --ink:          #1f1d18;        /* near-black, warm */
  --ink-2:        #45413a;        /* body */
  --ink-muted:    #807a6e;        /* secondary */
  --ink-faint:    #b3ac9f;        /* tertiary, dividers-on-text */
  --divider:      #e6dfcf;        /* hairline */
  --divider-2:    #d8cfba;
  --accent:       #5e7459;        /* sage — calm green */
  --accent-soft:  #e3eadc;        /* sage tint surface */
  --accent-ink:   #2e3a2c;
  --sand:         #b89465;        /* warm pointer, never as panic */
  --safety:       #a85a4a;        /* used ONLY on N (safety) — muted brick */
  --safety-soft:  #f1e2dc;

  /* ── Calm medical status semantics ──────────────────────────
     Color is SECONDARY to text. Low chroma; never alarming.
     · collecting → neutral sage-tinted (data warming up)
     · calm       → sage (steady day)
     · attention  → muted amber (нужно уточнение / «мы учли отметку»)
     · action     → muted brick (важное действие от куратора)        */
  --st-calm:      #5e7459;
  --st-calm-soft: #e3eadc;
  --st-calm-ink:  #2e3a2c;
  --st-attn:      #9c7a3c;        /* calm amber, not panic yellow */
  --st-attn-soft: #f1e7d1;
  --st-attn-ink:  #5c4717;
  --st-act:       #a85a4a;        /* muted brick — only curator action */
  --st-act-soft:  #f1e2dc;
  --st-act-ink:   #6e3024;
  --st-neutral:     #807a6e;
  --st-neutral-soft:#eee8da;
  --st-neutral-ink: #45413a;

  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  --shadow-card: 0 1px 0 rgba(255,255,255,.6) inset,
                 0 1px 2px rgba(31,29,24,.04),
                 0 8px 24px -12px rgba(31,29,24,.12);
  --shadow-lift: 0 1px 0 rgba(255,255,255,.6) inset,
                 0 2px 4px rgba(31,29,24,.05),
                 0 18px 40px -16px rgba(31,29,24,.18);

  --serif:  'Literata', 'Source Serif 4', Georgia, serif;
  --sans:   'Manrope', -apple-system, system-ui, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  background: #efe9d9;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* App shell — outside the device frames */
.stage {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 24px 96px;
  gap: 32px;
  background:
    radial-gradient(1100px 700px at 20% 0%, #f6f0df 0%, transparent 60%),
    radial-gradient(900px 700px at 90% 30%, #ece6d1 0%, transparent 50%),
    #ece5d2;
}

.stage-head {
  width: min(1040px, 100%);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  color: var(--ink-2);
}
.stage-head .crest {
  font-family: var(--serif);
  font-size: 34px;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-weight: 400;
  font-style: italic;
}
.stage-head .crest small {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-left: 12px;
  font-style: normal;
}
.stage-head .meta {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.frames-row {
  display: flex;
  gap: 56px;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: center;
}
.frame-label {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-align: center;
  margin-top: 18px;
  font-weight: 600;
}

.screen-nav {
  width: min(1040px, 100%);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 14px;
  background: rgba(255,255,255,0.5);
  border: 0.5px solid rgba(31,29,24,0.08);
  border-radius: 18px;
  backdrop-filter: blur(20px);
}
.screen-nav button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font: 500 13px/1 var(--sans);
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.screen-nav button:hover { background: rgba(31,29,24,0.05); }
.screen-nav button[aria-current="true"] {
  background: var(--ink);
  color: #f5f1e8;
}
.screen-nav .group-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 10px 8px 10px 12px;
  font-weight: 600;
}

/* Reset for any default button visible inside frames */
.app button { font-family: inherit; }

/* Subtle, dense scrollbar inside the frames */
.app ::-webkit-scrollbar { width: 4px; height: 4px; }
.app ::-webkit-scrollbar-thumb { background: rgba(31,29,24,0.15); border-radius: 999px; }
.app ::-webkit-scrollbar-track { background: transparent; }

/* Stripe placeholder for "imagery here" */
.img-stripe {
  background:
    repeating-linear-gradient(135deg,
      #efe9d9 0 6px, #e6dfcf 6px 12px);
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font: 500 11px/1.2 ui-monospace, 'SF Mono', Menlo, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Press feedback inside the frames */
.tap { transition: transform .12s ease, background-color .15s ease; }
.tap:active { transform: scale(0.985); }
