/* Цвета, шрифты и размеры повторяют iOS-приложение (Assets.xcassets/Colors, FontManager). */
@font-face { font-family: "Open Runde"; font-weight: 400; font-display: swap; src: url("fonts/OpenRunde-Regular.woff2") format("woff2"); }
@font-face { font-family: "Open Runde"; font-weight: 500; font-display: swap; src: url("fonts/OpenRunde-Medium.woff2") format("woff2"); }
@font-face { font-family: "Open Runde"; font-weight: 600; font-display: swap; src: url("fonts/OpenRunde-Semibold.woff2") format("woff2"); }
@font-face { font-family: "Open Runde"; font-weight: 700; font-display: swap; src: url("fonts/OpenRunde-Bold.woff2") format("woff2"); }
/* Крупные цифры: открытая замена Steelfish Bold Italic, пока не проверена его лицензия для веба. */
@font-face { font-family: "Numbers"; font-weight: 700; font-style: italic; font-display: swap; src: url("fonts/BarlowCondensed-BoldItalic.woff2") format("woff2"); }

:root {
  --accent: #f61e62;
  --accent-bold: #db1654;
  --accent-opaque: rgba(246, 30, 98, .08);
  --accent-track: rgba(246, 30, 98, .15);
  --step-right: #ff7ebf;
  --beige: #fff8f5;
  --bg-secondary: #f7f3f0;
  --tertiary: #f1ddd4;
  --ink: #200902;
  --muted: rgba(79, 28, 12, .6);
  --line: rgba(79, 28, 12, .12);
  --gray: rgba(0, 0, 0, .3);
  --done: #2e9e1e;
  --warn-bg: rgba(243, 171, 71, .12);
  --warn-ink: #8a5a12;
  --danger: #ff3b30;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: var(--beige);
  color: var(--ink);
  font: 400 15px/1.35 "Open Runde", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.screen { max-width: 560px; margin: 0 auto; padding: 8px 16px 112px; }

h1 { font-size: 24px; font-weight: 700; line-height: 1.2; color: var(--accent); margin: 12px 0 4px; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 10px; }
p { margin: 0 0 10px; }

.muted { color: var(--muted); font-size: 13px; }
.center { text-align: center; padding-top: 40px; }

.header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0 4px; }
.header .hello { display: block; color: var(--muted); font-size: 12px; }
.header .sub { display: block; font-size: 15px; font-weight: 600; margin-top: 2px; }
.round {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--bg-secondary);
  color: var(--muted);
  cursor: pointer;
}
.round svg { width: 22px; height: 22px; fill: currentColor; }

.section-title { font-size: 24px; font-weight: 700; color: var(--accent); margin: 24px 0 12px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-head button { border: 0; background: none; color: var(--muted); font: 500 13px "Open Runde", sans-serif; cursor: pointer; white-space: nowrap; }

.card {
  background: #fff;
  border-radius: 24px;
  padding: 16px;
  margin-top: 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--accent-opaque);
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }

/* Приёмы пищи: строки-«таблетки» с иконкой в круге, как на главной приложения. */
.meal-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 10px;
  padding: 10px 14px 10px 10px;
  border: 0;
  border-radius: 32px;
  background: #fff;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--tertiary);
  font-size: 26px;
}
.meal-row .name { display: block; font-size: 17px; font-weight: 600; }
.meal-row .state { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; font-weight: 700; }
.meal-row .plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  margin-left: auto;
  width: 28px;
  height: 28px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
}
.meal-row.done .plus { background: var(--accent); color: #fff; }

/* Приём пищи на вкладке «Питание»: заголовок как в дневнике приложения. */
.meal-card { padding: 0; overflow: hidden; }
.meal-card .head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--accent);
  font-weight: 600;
  font-size: 17px;
}
.meal-card .segmented { margin: 0; padding: 14px 16px; }

/* Вода: синие акценты, как в приложении. */
.water-top { display: flex; align-items: flex-end; gap: 10px; }
.drop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(94, 137, 255, .12);
  font-size: 22px;
}
.water-top .num { font-size: 44px; line-height: .9; color: var(--ink); }
.water-top .meta { font-size: 13px; font-weight: 600; padding-bottom: 2px; }
.water-top .goal { margin-left: auto; color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; padding-bottom: 2px; }
.track.blue { background: var(--tertiary); }
.track.blue i { background: #5e89ff; }
.water-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.water-btn {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(94, 137, 255, .12);
  color: #5e89ff;
  font: 600 20px "Open Runde", sans-serif;
  cursor: pointer;
}
.water-btn.main { background: #5e89ff; color: #fff; }
.water-actions span { color: var(--muted); font-size: 13px; }
.water-actions .water-btn:last-child { margin-left: auto; }

/* Неделя и кольцо: как в дневнике приложения. */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 3px 4px;
  border-radius: 22px;
  background: var(--bg-secondary);
  font-size: 13px;
  font-weight: 600;
}
.week b { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 1; border-radius: 50%; background: #fff; font-weight: 600; font-variant-numeric: tabular-nums; }
.week .future { opacity: .4; }
.week .on { background: var(--accent); color: #fff; }
.week .on b { background: var(--accent-bold); }
.summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.summary dl { margin: 0; flex: none; }
.summary dt { color: var(--ink); font-size: 13px; }
.summary dd { margin: 2px 0 12px; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.summary dd:last-child { margin-bottom: 0; }
.ring { position: relative; width: 150px; height: 150px; flex: none; }
.ring svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring div { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .num { font-size: 52px; line-height: 1; color: var(--accent); }
.ring span { color: var(--muted); font-size: 11px; font-weight: 500; }

/* Тренировка: карточка с обложкой и подписью, как в каталоге приложения. */
.media-card { padding: 0; overflow: hidden; }
.media-cover { display: flex; align-items: flex-end; height: 180px; padding: 14px; background: linear-gradient(180deg, var(--accent), var(--step-right)); color: #fff; font-size: 13px; font-weight: 500; }
.media-body { padding: 16px; }
.media-body h2 { font-size: 17px; }

/* Главная карточка: как карточка калорий в приложении. */
.hero {
  margin-top: 12px;
  padding: 16px;
  border-radius: 24px;
  background: linear-gradient(180deg, #ff0a64 0%, var(--accent) 12%, var(--step-right) 100%);
  color: #fff;
}
.hero .caption { font-size: 13px; color: rgba(255, 255, 255, .8); margin: 0 0 12px; }
.glass {
  padding: 15px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .25);
}
.num { font-family: "Numbers", "Open Runde", sans-serif; font-style: italic; font-weight: 700; font-variant-numeric: normal; }
.hero-stats { display: flex; justify-content: space-between; gap: 12px; }
.hero-stats span { display: block; font-size: 12px; color: rgba(255, 255, 255, .8); }
.hero-stats b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.big { display: flex; align-items: flex-end; gap: 8px; margin: 10px 0 12px; }
.big b { font-family: "Numbers", "Open Runde", sans-serif; font-style: italic; font-size: 72px; line-height: .9; font-weight: 700; }
.big span { font-size: 12px; line-height: 1.25; padding-bottom: 6px; }
.big span strong { display: block; font-weight: 500; }

.bar {
  height: 20px;
  border-radius: 10px;
  background: repeating-linear-gradient(-55deg, rgba(255, 255, 255, .5) 0 1.5px, transparent 1.5px 6px), rgba(255, 255, 255, .12);
  overflow: hidden;
}
.bar i {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  min-width: 44px;
  padding-right: 8px;
  border-radius: 10px;
  background: #fff;
  color: var(--accent);
  font-style: normal;
  font: 600 11px/1 "Open Runde", sans-serif;
  font-variant-numeric: tabular-nums;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 10px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
}
.row + .row { border-top: 1px solid var(--line); }
button.row { cursor: pointer; }
.row .label { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.row .pts { color: var(--muted); font-size: 13px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--tertiary);
  color: transparent;
  font-size: 13px;
  font-weight: 700;
}
.row.done .tick { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Кнопки как MainButton: высота 50, радиус 12, Semibold 17. */
.btn {
  display: block;
  min-height: 50px;
  padding: 13px 16px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font: 600 17px/24px "Open Runde", sans-serif;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn:active { background: var(--accent-bold); }
.btn.wide { width: 100%; margin-top: 12px; }
.btn.ghost { background: var(--accent-opaque); color: var(--accent); }
.btn:disabled { opacity: .6; }

.counter { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.counter b { font-size: 40px; line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; }
.counter .btn { flex: none; width: 50px; padding: 13px 0; }
.track { height: 8px; margin-top: 14px; border-radius: 4px; background: var(--accent-track); overflow: hidden; }
.track i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 6px 0 14px; }
.segmented button {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  background: var(--bg-secondary);
  color: var(--ink);
  font: 500 13px "Open Runde", sans-serif;
  cursor: pointer;
}
.segmented button.on { background: var(--accent); color: #fff; }

.tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--warn-bg);
  color: var(--warn-ink);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 8px;
}

img.plan { display: block; width: 100%; border-radius: 12px; }

label { display: block; margin-top: 12px; font-size: 13px; font-weight: 500; color: var(--muted); }
input[type="text"], input[type="number"], select {
  display: block;
  width: 100%;
  min-height: 50px;
  margin-top: 6px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: 400 16px "Open Runde", sans-serif;
  appearance: none;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.check { display: flex; gap: 10px; align-items: flex-start; color: var(--ink); font-weight: 400; }
.check input { margin-top: 2px; width: 20px; height: 20px; flex: none; accent-color: var(--accent); }

.error { color: var(--danger); font-size: 13px; margin-top: 10px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 4px; border-top: 1px solid var(--line); text-align: right; }
th:first-child, td:first-child { text-align: left; }
thead th { border-top: 0; color: var(--muted); font-weight: 500; }

/* Меню как CustomTabBar: белая «таблетка» с иконками. */
.tabs {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  max-width: 528px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--accent-opaque);
  border-radius: 150px;
  box-shadow: 0 -2px 24px rgba(0, 0, 0, .06);
}
.tabs[hidden] { display: none; }
.tabs button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 48px;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--gray);
  font: 500 10px "Open Runde", sans-serif;
  cursor: pointer;
}
.tabs svg { width: 24px; height: 24px; }
.tabs svg path { fill: currentColor; }
.tabs button.on { color: var(--accent); }

/* Вход и анкета */
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 12px 0 20px; }
.steps i { height: 6px; border-radius: 3px; background: var(--tertiary); }
.steps i.on { background: var(--accent); }
.choice {
  display: block;
  width: 100%;
  min-height: 64px;
  margin-top: 10px;
  padding: 14px 18px;
  border: 1.5px solid transparent;
  border-radius: 20px;
  background: #fff;
  color: var(--ink);
  font: 600 17px "Open Runde", sans-serif;
  text-align: left;
  cursor: pointer;
}
.choice.on { border-color: var(--accent); background: var(--accent-opaque); color: var(--accent); }
.welcome { margin-bottom: 20px; }
.flush { margin: 0; }
.prewrap { white-space: pre-wrap; }

.back { display: inline-block; border: 0; background: none; color: var(--muted); font: 500 15px "Open Runde", sans-serif; padding: 8px 0; cursor: pointer; }

/* Блюдо и рецепт: как в приложении */
.meal-card .head { justify-content: space-between; }
.dish { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.dish-image { flex: none; width: 76px; height: 76px; border-radius: 16px; object-fit: cover; }
.no-image { display: inline-flex; align-items: center; justify-content: center; background: var(--bg-secondary); font-size: 30px; }
.dish-text { flex: 1; min-width: 0; }
.dish-text .tag { margin-bottom: 4px; }
.dish-title { display: block; font-size: 15px; font-weight: 600; }
.dish-macros { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chev { color: var(--muted); font-size: 20px; }
.dish-empty { margin: 0; padding: 14px 16px 0; }
.recipe-cover { display: flex; align-items: center; justify-content: center; height: 260px; margin: 0 -16px; background: var(--bg-secondary); font-size: 72px; overflow: hidden; }
.recipe-cover img { width: 100%; height: 100%; object-fit: cover; }
.recipe-sheet { position: relative; margin: -24px -16px 0; padding: 20px 16px; border-radius: 24px 24px 0 0; background: #fff; }
.recipe-title { font-size: 19px; line-height: 1.25; }
.kcal-box { display: inline-flex; align-items: center; gap: 12px; padding: 12px 18px 12px 12px; border: 1px solid var(--line); border-radius: 18px; }
.kcal-box b { display: block; color: var(--accent); font-size: 17px; font-weight: 600; }
.kcal-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent-track); }
.macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.macro { padding: 16px 6px; border-radius: 18px; text-align: center; }
.macro b { display: block; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.macro span { color: var(--muted); font-size: 13px; }
.macro.fat { background: rgba(243, 171, 71, .12); }
.macro.fat b { color: #f5a020; }
.macro.protein { background: rgba(255, 120, 103, .12); }
.macro.protein b { color: #ff7867; }
.macro.carb { background: rgba(94, 137, 255, .12); }
.macro.carb b { color: #5e89ff; }
.card.outline { border: 1px solid var(--line); margin-top: 0; }
.steps-head { padding-bottom: 12px; font-weight: 700; font-size: 17px; }
.step { display: flex; align-items: flex-start; gap: 12px; margin: 0; padding: 12px 0; border-top: 1px solid var(--line); color: var(--ink); font-weight: 400; cursor: pointer; }
.step input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--accent); }
.step b { display: block; font-weight: 600; }
.step .muted { display: block; font-size: 14px; }

.media-cover { background-size: cover; background-position: center; }
.chip-btn { min-height: 36px; padding: 6px 12px; border: 0; border-radius: 12px; background: var(--bg-secondary); color: var(--ink); font: 500 13px "Open Runde", sans-serif; cursor: pointer; }
.chip-btn.on { background: var(--accent); color: #fff; }
.test-days { display: flex; flex-wrap: wrap; gap: 6px; }

img.photo { display: block; width: 100%; max-height: 360px; object-fit: contain; border-radius: 16px; background: var(--bg-secondary); }
.file-btn { color: #fff; font-weight: 600; }
.btn.ghost.file-btn { color: var(--accent); }
label.btn { margin-top: 12px; }
a.plus { text-decoration: none; }
