/* ============================================================
   BioControl Mini App — design system v2
   Montserrat · neutral grays + orange accent · soft rounded cards
   ============================================================ */

:root {
  color-scheme: light;

  --ink: #1b1b1d;
  --muted: #8a8a8f;
  --bg: #fafafa;

  --card: #f3f3f4;        /* level-1 soft cards / section blocks */
  --hero: #dcdcdc;        /* gray hero block                    */
  --index: #ececec;       /* light summary card                 */
  --item: #ffffff;        /* level-2 items inside a card        */
  --charcoal: #2b2b2b;    /* dark accent cards                  */

  --line: #e7e7ea;
  --accent: #d9a520;      /* brand gold (wordmark, tabs, bars)  */
  --accent-soft: rgba(217, 165, 32, 0.15);
  --flame: #e2641c;       /* orange flame chip (per icon)       */
  --gold: #c98a16;        /* mid-intensity amber                */

  /* Legacy aliases kept so older selectors stay valid */
  --paper: var(--bg);
  --panel: var(--item);
  --surface: var(--card);
  --teal: var(--accent);
  --green: var(--accent);
  --coral: var(--accent);
  --blue: var(--accent);

  --radius-lg: 22px;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.06);

  /* Aptos = body (incl. Cyrillic); Azonix = Latin display (wordmark/numbers). */
  --font: Aptos, "Segoe UI", ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, sans-serif;
  --font-display: Azonix, var(--font);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  touch-action: manipulation;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.app-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 18px 16px 96px;
}

/* ===== Brand header ===== */
.brand {
  margin: 2px 0 16px;
}

.brand-mark {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;        /* Azonix is wide — keep small so it fits the phone width */
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1;
}

.brand-bio {
  color: var(--accent);
}

.brand-control {
  color: var(--ink);
}

.brand-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ===== Summary row: date + health index ===== */
.summary-row {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.date-card {
  display: flex;
  flex-direction: column;
  min-height: 184px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--charcoal);
  color: #fff;
}

.date-top {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.date-day {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 400;
  line-height: 1;
}

.date-month {
  font-size: 22px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.82);
}

.date-label {
  margin-top: 2px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
}

.date-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 10px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.07);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.date-flame {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--flame);
}

.index-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 184px;
  padding: 18px;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--index);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.index-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.index-value {
  margin: 4px 0 2px;
  font-family: var(--font-display);
  font-size: 36px;        /* Azonix digits are wide — keep modest so 2–3 digits fit the card */
  font-weight: 400;
  line-height: 1;
  color: var(--accent);
}

.index-status {
  max-width: 9ch;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.15;
}

.index-arrow {
  position: absolute;
  right: 18px;
  bottom: 16px;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
}

/* ===== Hero block ===== */
.hero-panel {
  border-radius: var(--radius-lg);
  background: var(--hero);
  color: var(--ink);
}

.hero-content {
  padding: 22px;
}

.status-line {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.hero-content h2 {
  margin-bottom: 10px;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.hero-content p:last-of-type {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.hero-divider {
  height: 2px;
  margin: 18px 0;
  border-radius: 2px;
  background: var(--accent);
}

.hero-progress-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.hero-progress-label {
  font-size: 17px;
  font-weight: 700;
}

.hero-progress-value {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.hero-progress {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.14);
}

.hero-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 200ms ease;
}

/* ===== Tab bar ===== */
.tabbar {
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0;
  padding: 8px 0;
  background: var(--bg);
}

.tab {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--item);
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.tab.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

/* ===== Section blocks (top-level cards) ===== */
.section-block,
.coach-note,
.radar-panel,
.metric-list {
  margin-top: 12px;
  border-radius: var(--radius-lg);
  background: var(--card);
}

.section-block,
.coach-note,
.radar-panel {
  padding: 18px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.section-head span {
  color: var(--accent);
  font-weight: 800;
  text-align: right;
}

.section-hint {
  margin: -6px 0 12px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

/* ===== Today: key tasks ===== */
.check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.task-card {
  display: grid;
  gap: 6px;
  min-height: 150px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--item);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.task-icon {
  font-size: 28px;
}

.task-card strong {
  font-size: 16px;
  font-weight: 700;
}

.task-card small {
  color: var(--muted);
  line-height: 1.25;
}

.task-state {
  align-self: end;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.task-card.is-done {
  border-color: rgba(217, 165, 32, 0.6);
  background: var(--accent-soft);
}

.task-card.is-done .task-state {
  background: var(--accent);
  color: #fff;
}

/* ===== Exercise rows ===== */
.exercise-list,
.program-list,
.slider-stack {
  display: grid;
  gap: 10px;
}

.exercise-row {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  align-items: start;
  width: 100%;
  min-height: 58px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--item);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.exercise-row strong,
.program-day strong {
  display: block;
  margin-bottom: 3px;
  font-weight: 700;
}

.exercise-row small {
  color: var(--muted);
  line-height: 1.28;
}

.exercise-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.check-dot {
  width: 22px;
  height: 22px;
  border: 2px solid var(--line);
  border-radius: 7px;
  background: var(--card);
}

.exercise-row.is-done {
  border-color: rgba(217, 165, 32, 0.6);
  background: var(--accent-soft);
}

.exercise-row.is-done .check-dot {
  border-color: var(--accent);
  background:
    linear-gradient(45deg, transparent 42%, #fff 42% 58%, transparent 58%),
    linear-gradient(-45deg, transparent 45%, #fff 45% 60%, transparent 60%),
    var(--accent);
}

.intensity-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}

/* Intensity stays in the gold family (no stray orange) — тяж solid, сред tint, легк gray. */
.intensity-tag.i-hard {
  background: var(--accent);
  color: #fff;
}

.intensity-tag.i-mid {
  background: var(--accent-soft);
  color: #8a6712;
}

.intensity-tag.i-easy {
  background: var(--card);
  color: var(--muted);
}

.video-link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  margin-top: 4px;
  padding: 3px 11px;
  border: 1px solid rgba(217, 165, 32, 0.5);
  border-radius: 999px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.video-link:active {
  background: var(--accent-soft);
}

/* ===== Nutrition targets / trackers ===== */
.target-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.target-grid-large {
  gap: 10px;
}

.target-card {
  min-height: 80px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--item);
}

.target-card span,
.tracker-card span,
.settings-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.target-card strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.05;
}

.tracker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.tracker-card {
  display: grid;
  gap: 10px;
  min-height: 128px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--item);
}

.tracker-card strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
  font-weight: 700;
}

.mini-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--card);
}

.mini-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.stepper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stepper button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}

/* ===== Mood sliders + notes ===== */
.slider-stack label {
  display: grid;
  gap: 8px;
}

.slider-stack label span {
  color: var(--muted);
  font-weight: 700;
}

.slider-stack input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

textarea {
  width: 100%;
  min-height: 92px;
  margin-top: 12px;
  padding: 12px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--item);
  color: var(--ink);
  line-height: 1.4;
}

/* ===== Buttons + sticky actions ===== */
.primary-button,
.ghost-button {
  min-height: 46px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  border: 0;
  background: var(--accent);
  color: #fff;
}

.ghost-button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}

.sticky-actions {
  display: grid;
  grid-template-columns: minmax(118px, 0.8fr) minmax(170px, 1.2fr);
  gap: 10px;
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

/* ===== Plan: program days ===== */
.plan-source {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.plan-source[data-mode="backend"] {
  border-color: rgba(217, 165, 32, 0.45);
  color: var(--ink);
}

.plan-source[data-mode="empty"] {
  border-color: rgba(224, 135, 30, 0.5);
  color: var(--ink);
}

.program-day {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--item);
  overflow: hidden;
}

.program-day-head {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.program-day-head span {
  display: grid;
  place-items: center;
  min-height: 38px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.exercise-lines {
  margin: 0;
  padding: 12px 14px 14px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.exercise-lines li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.ex-main {
  font-weight: 700;
}

.ex-sub {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.program-day ul {
  margin: 0;
  padding: 12px 16px 14px 30px;
  color: var(--muted);
  line-height: 1.45;
}

/* ===== Plan: training style, reminders, supplements ===== */
.plain-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.plain-list li {
  list-style: disc;
}

.done-toggle {
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.done-toggle.is-done {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.reminder-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reminder-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.reminder-row:last-child {
  border-bottom: none;
}

.reminder-time {
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  min-width: 46px;
}

.reminder-text {
  font-size: 13px;
  line-height: 1.4;
}

.protocol-note {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.45;
}

.protocol-disclaimer {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.supplement-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.supplement-card {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--item);
}

.supplement-card.is-mandatory {
  border-color: rgba(255, 90, 31, 0.45);
}

.supplement-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.supplement-head strong {
  font-weight: 700;
}

.supplement-tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
}

.supplement-card.is-mandatory .supplement-tag {
  color: var(--accent);
}

.supplement-dose {
  margin: 6px 0 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.supplement-cond {
  margin: 2px 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.supplement-reason {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}

.coach-note {
  padding: 18px;
  border-left: 5px solid var(--accent);
}

.coach-note strong {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
}

.coach-note p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

/* ===== Calorie counter ===== */
.food-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.food-form input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--item);
  color: var(--ink);
}

.food-form input::placeholder {
  color: var(--muted);
}

.food-form-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: stretch;
}

.food-form-row .primary-button {
  padding: 0 22px;
}

.food-result {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--item);
}

.food-result-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.food-result-head strong {
  font-weight: 700;
}

.food-approx {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.food-macros {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 14px;
}

.food-kcal {
  color: var(--accent);
  font-weight: 800;
}

.food-add {
  width: 100%;
}

/* ===== Progress ===== */
.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.day {
  display: grid;
  place-items: center;
  min-height: 42px;
  border-radius: var(--radius-sm);
  background: var(--item);
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 800;
}

.day.done {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.day.active {
  background: var(--charcoal);
  border-color: var(--charcoal);
  color: #fff;
}

.day.soft {
  background: var(--accent-soft);
  border-color: transparent;
  color: #8a6712;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  align-items: end;
  min-height: 170px;
}

.bar-item {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.bar-track {
  position: relative;
  width: 100%;
  height: 128px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--item);
  border: 1px solid var(--line);
}

.bar-track span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 8px;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--gold), var(--accent));
}

.bar-item small {
  color: var(--muted);
  font-weight: 700;
}

.metric-list {
  overflow: hidden;
}

.metric-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.metric-list div:last-child {
  border-bottom: 0;
}

.metric-list span {
  color: var(--muted);
}

.metric-list strong {
  text-align: right;
  font-weight: 700;
}

/* ===== Profile ===== */
.profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.profile-header h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
}

.profile-rank-badge {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: var(--card);
}

.profile-rank-badge[data-tier="novice"] { background: var(--muted); }
.profile-rank-badge[data-tier="fighter"] { background: var(--accent); }
.profile-rank-badge[data-tier="athlete"] { background: var(--accent); }
.profile-rank-badge[data-tier="master"] { background: var(--gold); color: #1b1b1d; }
.profile-rank-badge[data-tier="elite"] { background: var(--accent); }
.profile-rank-badge[data-tier="champion"] { background: linear-gradient(90deg, var(--gold), var(--accent)); color: #fff; }

.radar-panel {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 18px;
  align-items: center;
}

.radar-copy h3 {
  margin-bottom: 8px;
  font-size: 22px;
  font-weight: 800;
}

.radar-copy p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.48;
}

.radar {
  position: relative;
  width: min(100%, 300px);
  aspect-ratio: 1;
  margin: 0 auto;
}

.ring {
  position: absolute;
  inset: 58px;
  border-radius: 50%;
  background:
    conic-gradient(from 218deg, #06b6d4 0 80deg, #f06449 80deg 145deg, #f59e0b 145deg 230deg, #3b82f6 230deg 315deg, #22c55e 315deg 360deg);
  box-shadow:
    inset 0 0 0 30px var(--card),
    inset 0 0 0 32px var(--line),
    var(--shadow);
}

.ring::after {
  content: var(--score, "84");
  position: absolute;
  inset: 50px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--charcoal);
  color: #fff;
  font-size: 34px;
  font-weight: 900;
}

.p {
  position: absolute;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--item);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.p1 { left: 50%; top: 8px; transform: translateX(-50%); color: #06b6d4; }
.p2 { right: 0; top: 32%; color: #f06449; }
.p3 { right: 22px; bottom: 18px; color: #f59e0b; }
.p4 { left: 18px; bottom: 18px; color: #3b82f6; }
.p5 { left: 0; top: 32%; color: #22c55e; }

/* ===== Pledge + rank ===== */
.pledge-gate {
  display: flex;
  justify-content: center;
}

.pledge-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 24px 20px;
  border-radius: var(--radius-lg);
  background: var(--card);
}

.pledge-emblem {
  font-size: 44px;
  line-height: 1;
}

.pledge-card h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
}

.pledge-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.pledge-oath {
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--ink) !important;
  font-style: italic;
}

.pledge-card .primary-button {
  width: 100%;
  margin-top: 4px;
}

.pledge-card small {
  color: var(--muted);
  font-size: 12px;
}

.rank-content {
  margin-top: 12px;
}

.rank-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--card);
}

.rank-badge {
  font-size: 40px;
  line-height: 1;
}

.rank-meta {
  flex: 1;
}

.rank-meta h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}

.rank-meta p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.rank-place {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
}

.rank-progress {
  margin-top: 14px;
  height: 12px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.rank-progress span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.4s ease;
}

.rank-next {
  margin: 8px 2px 0;
  color: var(--muted);
  font-size: 13px;
}

.leaderboard {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.leader-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--item);
}

.leader-row.is-me {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.leader-place {
  width: 28px;
  font-weight: 800;
  text-align: center;
}

.leader-name {
  flex: 1;
  font-size: 14px;
}

.leader-points {
  font-weight: 800;
  color: var(--accent);
}

.leader-empty {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* ===== Settings ===== */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.settings-grid label {
  display: grid;
  gap: 7px;
}

.settings-grid select {
  min-height: 44px;
  width: 100%;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--item);
  color: var(--ink);
  font-weight: 700;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 9;
  transform: translateX(-50%) translateY(90px);
  width: min(420px, calc(100% - 28px));
  padding: 13px 16px;
  border-radius: var(--radius);
  background: var(--charcoal);
  color: #fff;
  box-shadow: var(--shadow);
  font-weight: 700;
  opacity: 0;
  transition: transform 180ms ease, opacity 180ms ease;
}

.toast.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* English headings + display numbers use Azonix; Cyrillic auto-falls back to Aptos
   (Azonix has no Cyrillic glyphs), so Russian headings keep their Aptos look/weight. */
.hero-content h2,
.section-head h3,
.profile-header h2,
.radar-copy h3,
.pledge-card h3,
.rank-meta h3,
#tasksCounter,
#weekCounter {
  font-family: var(--font-display);
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .app-shell {
    padding: 14px 12px 96px;
  }

  .hero-content {
    padding: 20px;
  }

  .hero-content h2 {
    font-size: 26px;
  }

  .tabbar {
    gap: 6px;
  }

  .tab {
    min-height: 42px;
    font-size: 13px;
  }

  .check-grid,
  .tracker-grid,
  .settings-grid,
  .radar-panel {
    grid-template-columns: 1fr;
  }

  .target-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-card {
    min-height: 124px;
  }

  .program-day-head {
    grid-template-columns: 68px 1fr;
  }

  .radar {
    width: min(100%, 300px);
    margin: 0 auto;
  }

  .sticky-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .tab {
    font-size: 12px;
  }

  .summary-row {
    gap: 10px;
  }
}

@media (max-width: 360px) {
  .brand-mark {
    font-size: 20px;
  }

  .date-day {
    font-size: 42px;
  }

  .index-value {
    font-size: 50px;
  }
}
