:root {
  --bg: #FFF7FA; --card: #ffffff; --text: #3a2a45; --muted: #7a6a85;
  --pink: #F7A8C8; --pink-dark: #d98aab; --pink-soft: #FFD6E7;
  --lav: #D9C8F5; --lav-soft: #EFE7FB; --mint: #BFEBDD; --mint-dark: #6fc9a8;
  --warn: #f0a040; --alert-bg: #FBEFEF; --alert-border: #C46A75; --alert-text: #6e2a35;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 17px; }
body { overflow-x: hidden; padding-bottom: 96px; min-height: 100vh; }
header.top { position: sticky; top: 0; z-index: 9; text-align: center; font-weight: 800; font-size: 20px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px; color: var(--text);
  background: linear-gradient(90deg, var(--pink-soft), var(--lav-soft), #DDF5EC); box-shadow: 0 2px 10px rgba(120, 60, 100, .1); }
main { max-width: 560px; margin: 0 auto; padding: 16px; }
h1 { font-size: 22px; margin: 0 0 8px; }
h2 { font-size: 19px; margin: 18px 0 8px; }
.hero { display: flex; align-items: center; gap: 8px; }
.hero img { width: 120px; flex: none; }
.hello { font-size: 20px; font-weight: 700; }
.hello small { display: block; font-size: 15px; font-weight: 400; color: var(--muted); margin-top: 4px; }
.card { background: var(--card); border-radius: 20px; padding: 14px 16px; margin-top: 12px;
  box-shadow: 0 3px 12px rgba(120, 60, 100, .09); }
.card.ok { border-left: 6px solid var(--mint); }
.card.warn { border-left: 6px solid var(--warn); }
.alert { background: var(--alert-bg); color: var(--alert-text); border: 2px solid var(--alert-border);
  border-radius: 18px; padding: 14px 16px; margin-top: 12px; font-weight: 600; }
.btn { display: block; width: 100%; border: 0; border-radius: 22px; padding: 15px; font-size: 18px; font-weight: 700;
  background: var(--pink); color: var(--text); box-shadow: 0 4px 0 var(--pink-dark); cursor: pointer; margin-top: 14px; }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--pink-dark); }
.btn.sec { background: var(--lav); box-shadow: 0 4px 0 #b9a4e0; }
.btn.small { display: inline-block; width: auto; padding: 10px 16px; font-size: 16px; }
.tracker { margin: 10px 0 2px; }
.tracker .name { font-weight: 600; margin-bottom: 6px; }
.days { display: flex; gap: 6px; }
.day { flex: 1; min-width: 0; aspect-ratio: 1; max-width: 46px; border-radius: 50%; background: var(--lav-soft); border: 0; font-size: 13px;
  color: var(--text); cursor: pointer; padding: 0; }
.day.on { background: var(--mint); font-weight: 700; }
.day.today { outline: 3px solid var(--pink); }
.streak { color: var(--muted); font-size: 14px; }
label { display: block; font-weight: 600; margin: 12px 0 4px; }
input, select, textarea { width: 100%; font: inherit; padding: 12px; border-radius: 14px; border: 2px solid var(--lav);
  background: #fff; color: var(--text); }
textarea { min-height: 80px; }
.row { display: flex; gap: 10px; align-items: flex-end; }
.row > * { flex: 1; min-width: 0; }
details { background: var(--card); border-radius: 20px; padding: 6px 16px 14px; margin-top: 12px;
  box-shadow: 0 3px 12px rgba(120, 60, 100, .09); }
summary { font-weight: 700; font-size: 18px; padding: 10px 0; cursor: pointer; }
.chk { display: flex; align-items: center; gap: 10px; font-weight: 500; margin: 8px 0; }
.chk input { width: 26px; height: 26px; flex: none; accent-color: var(--pink-dark); }
.hint { font-size: 14px; color: var(--muted); margin-top: 4px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 13px; background: var(--lav-soft); margin: 2px 4px 2px 0; }
.pill.pain { background: #FFE3EC; }
.pill.chest { background: var(--alert-bg); border: 1px solid var(--alert-border); color: var(--alert-text); }
.run { cursor: pointer; }
.run .top { display: flex; justify-content: space-between; font-weight: 700; }
.run .sub { color: var(--muted); font-size: 15px; margin-top: 2px; }
.run.flag { border-left: 6px solid var(--pink); }
nav { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; display: flex; justify-content: space-around;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 16px rgba(120, 60, 100, .12); z-index: 10; }
nav button { flex: 1; border: 0; background: none; font-size: 12px; color: var(--muted); padding: 4px; cursor: pointer; }
nav button span { display: block; font-size: 24px; }
nav button.active { color: var(--text); font-weight: 700; }
.disclaimer { font-size: 12px; color: var(--muted); text-align: center; margin-top: 18px; }
.empty { text-align: center; color: var(--muted); padding: 24px 0; }

/* Быстрая форма: крупные поля, смайлики и «таблетки» */
input.big { font-size: 24px; font-weight: 700; text-align: center; padding: 14px 8px; }
.faces { display: flex; gap: 8px; }
.face { flex: 1; margin: 0; }
.face input, .chip input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.face span { display: block; text-align: center; font-size: 30px; padding: 8px 0; border-radius: 16px; background: var(--lav-soft); border: 2px solid transparent; cursor: pointer; }
.face input:checked + span { background: var(--mint); border-color: var(--mint-dark); transform: scale(1.06); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { margin: 0; font-weight: 500; }
.chip span { display: inline-block; padding: 11px 16px; border-radius: 22px; background: var(--lav-soft); border: 2px solid transparent; cursor: pointer; font-size: 16px; }
.chip input:checked + span { background: #FFD6E7; border-color: var(--pink-dark); font-weight: 700; }
.chip.soft span { background: var(--alert-bg); }
.chip.soft input:checked + span { background: var(--alert-bg); border-color: var(--alert-border); color: var(--alert-text); }
.chest-sym { display: none; margin-top: 8px; }
form:has(input[name="chest"]:checked) .chest-sym { display: block; }

.voice textarea { margin-top: 10px; }
.voice .row { margin-top: 10px; align-items: stretch; }
.voice .row .btn { margin-top: 0; width: 100%; }
