:root {
  --bg: #f3f5f8;
  --card: #ffffff;
  --ink: #152033;
  --muted: #5c6b80;
  --line: #dbe3ee;
  --accent: #2157d6;
  --danger: #b42318;
  --anna: #0f766e;
  --nika: #4f46e5;
  --stasya: #c2410c;
  --ok: #157347;
  --warn: #b45309;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Manrope, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: clamp(16px, 4.2vw, 17px);
  line-height: 1.45;
  font-weight: 500;
}

.app {
  max-width: 28rem;
  margin: 0 auto;
  min-height: 100dvh;
  padding-bottom: calc(5.25rem + var(--safe-b));
}

.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: calc(0.85rem + var(--safe-t)) 1.1rem 0.6rem;
  position: sticky;
  top: 0;
  z-index: 2;
  background: color-mix(in srgb, var(--bg) 92%, white);
  backdrop-filter: blur(10px);
}
.top__title { font-weight: 800; font-size: 1.35rem; letter-spacing: -0.03em; }

.main { padding: 0.35rem 1.1rem 1.6rem; }
.h2 { font-size: 0.92rem; margin: 1.4rem 0 0.55rem; color: var(--muted); font-weight: 700; }
.eyebrow { color: var(--accent); font-weight: 700; margin: 0 0 0.4rem; }

.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.65rem; }
.card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1.05rem;
  padding: 0.9rem 1rem;
  color: inherit;
  text-decoration: none;
}
.card--row { display: flex; justify-content: space-between; gap: 0.75rem; align-items: center; }
.card__kicker { font-size: 0.82rem; font-weight: 700; margin-bottom: 0.15rem; color: var(--accent); }
.card__title { font-weight: 750; }
.hue-anna { color: var(--anna); }
.hue-nika { color: var(--nika); }
.hue-stasya { color: var(--stasya); }

.muted { color: var(--muted); }
.empty {
  margin: 2.5rem 0.5rem;
  text-align: center;
  color: var(--muted);
  line-height: 1.5;
}

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  background: var(--card);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
  max-width: 28rem;
  margin: 0 auto;
}
.tab {
  min-height: 48px;
  display: grid;
  place-items: center;
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
}
.tab.is-active { color: var(--accent); }

.primary, .danger, .ghost, .text-btn, select, input, button, textarea {
  font: inherit;
}
.primary, .danger, .ghost {
  min-height: 48px;
  border-radius: 0.9rem;
  border: 0;
  padding: 0 1rem;
  width: 100%;
  font-weight: 700;
}
.primary { background: var(--accent); color: white; }
.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.ghost { background: #eef2fb; color: var(--ink); width: auto; }
.text-btn {
  background: none;
  border: 0;
  color: var(--muted);
  min-height: 44px;
  font-weight: 650;
}

.stack { display: grid; gap: 0.75rem; margin-top: 1rem; }
label { display: grid; gap: 0.35rem; font-weight: 650; }
input, select, textarea {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  padding: 0.55rem 0.8rem;
  background: white;
  width: 100%;
}
textarea { min-height: 7rem; }

.facts { display: grid; gap: 0.75rem; margin: 0.4rem 0 1rem; }
.facts dt { color: var(--muted); font-size: 0.82rem; font-weight: 650; }
.facts dd { margin: 0.12rem 0 0; }
.copy { overflow-wrap: anywhere; }

.auth { padding: 3.2rem 0; }
.auth h1 { margin: 0 0 0.4rem; font-size: 1.7rem; letter-spacing: -0.03em; }

.search { margin-bottom: 1rem; }
.week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.3rem;
  margin-bottom: 0.7rem;
}
.day {
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  padding: 0.45rem 0 0.5rem;
  border-radius: 0.8rem;
  min-height: 52px;
  background: var(--card);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 0.72rem;
}
.day strong { font-size: 1rem; }
.day.is-on { background: var(--accent); color: white; border-color: var(--accent); }
.day.is-today:not(.is-on) { border-color: var(--accent); }
.dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; display: block; margin-top: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.8rem 0 1rem; }
.chip {
  min-height: 40px;
  padding: 0 0.85rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.88rem;
}
.chip.is-on { background: var(--ink); color: white; border-color: var(--ink); }

.row-nav { display: flex; gap: 0.5rem; margin: 0.5rem 0 1rem; }
.row-nav .ghost, .row-nav form { flex: 1; }
.row-nav button { width: 100%; }

.errorlist { color: var(--danger); list-style: none; padding: 0; }
a { color: inherit; }

@media (min-width: 640px) {
  body { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
