/* Хлебопечка: коричневая тема по утверждённым макетам.
   Фон #3A241A, текст #F0EAE2, голубой акцент только на 1-2 элемента экрана.
   Шрифты свои, с нашего сервера: Oswald (заголовки капсом) и Marck Script (рукописный акцент). */

@font-face { font-family: "Oswald"; font-weight: 500; font-display: swap; src: url("fonts/oswald-cyrillic-500-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Oswald"; font-weight: 600; font-display: swap; src: url("fonts/oswald-cyrillic-600-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Oswald"; font-weight: 700; font-display: swap; src: url("fonts/oswald-cyrillic-700-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Oswald"; font-weight: 500; font-display: swap; src: url("fonts/oswald-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2212; }
@font-face { font-family: "Oswald"; font-weight: 600; font-display: swap; src: url("fonts/oswald-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2212; }
@font-face { font-family: "Oswald"; font-weight: 700; font-display: swap; src: url("fonts/oswald-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2212; }
@font-face { font-family: "Oswald"; font-weight: 500; font-display: swap; src: url("fonts/oswald-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+20A0-20C0; }
@font-face { font-family: "Oswald"; font-weight: 600; font-display: swap; src: url("fonts/oswald-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+20A0-20C0; }
@font-face { font-family: "Marck Script"; font-display: swap; src: url("fonts/marck-script-cyrillic-400-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Marck Script"; font-display: swap; src: url("fonts/marck-script-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }

:root {
  --bg: #3A241A;
  --plate: #4f3426;
  --photo: #5c3d2e;
  --text: #F0EAE2;
  --dim: rgba(240, 234, 226, 0.78);
  --line: rgba(240, 234, 226, 0.25);
  --blue: #BED2E4;
  --hand: #B4D2F0;          /* рукописное слово: чуть насыщеннее, с карандашным зерном */
  --head: "Oswald", "Arial Narrow", sans-serif;
  --script: "Marck Script", cursive;
  --body: "Helvetica Neue", "Helvetica Neue Cyr", Helvetica, Arial, sans-serif;
  --pad: 22px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); color-scheme: dark; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--bg); color: var(--text); font-family: var(--body);
  font-size: 16px; line-height: 1.4; -webkit-font-smoothing: antialiased;
}
/* зерно плёнки поверх фона, как в макетах */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 50; opacity: 0.1; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
a { color: var(--text); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: transparent; border: 0; padding: 0; }
button:disabled { opacity: 0.4; cursor: default; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

#app { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; }
.screen { position: relative; padding: calc(18px + var(--safe-t)) var(--pad) calc(170px + var(--safe-b)); display: flex; flex-direction: column; gap: 16px; }
.screen.home { padding-top: calc(26px + var(--safe-t)); gap: 20px; }
.screen.nobar { padding-bottom: calc(40px + var(--safe-b)); }

/* ---------- шапка ---------- */
.top { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.top.split { justify-content: space-between; }
.back { width: 44px; height: 44px; display: grid; place-items: center; margin-left: -10px; flex: none; }
.pill { font-size: 14px; border: 1.5px solid var(--text); border-radius: 999px; padding: 7px 14px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pill-btn { height: 44px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 999px; font-size: 14px; position: relative; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.dot { min-width: 22px; height: 22px; border-radius: 11px; border: 1.5px solid var(--blue); color: var(--blue); font-size: 12px; display: inline-grid; place-items: center; padding: 0 6px; }

/* ---------- заголовки ---------- */
.title { position: relative; margin-top: 6px; }
h1, .h1 { margin: 0; font-family: var(--head); text-transform: uppercase; font-weight: 600; font-size: 50px; line-height: 0.92; letter-spacing: -0.2px; text-wrap: balance; overflow-wrap: anywhere; }
.home h1 { font-size: 66px; letter-spacing: -0.5px; }
h2 { margin: 2px 0 0; font-family: var(--head); text-transform: uppercase; font-size: 28px; font-weight: 600; line-height: 1; }
h3 { margin: 0; font-family: var(--head); text-transform: uppercase; font-size: 22px; font-weight: 500; line-height: 1.05; }
.hand {
  font-family: var(--script); font-weight: 400; text-transform: none; color: var(--hand);
  font-size: 36px; line-height: 1; transform: rotate(-8deg); display: inline-block; white-space: nowrap;
  filter: url(#pgrain) saturate(1.5); pointer-events: none;
}
.title .hand { position: absolute; right: 6px; bottom: -22px; }
.home .title .hand { font-size: 40px; bottom: -30px; }
.title { margin-bottom: 14px; }
.title + * { margin-top: 14px; }

p { margin: 0; }
.dim { color: var(--dim); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.center { text-align: center; }
.lead { font-size: 15px; line-height: 1.45; }

/* ---------- главная кнопка и нижняя панель (правило высоты) ----------
   Нижний край главной кнопки всегда в 84 px от низа экрана, под ней 56 px под ссылку. */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 14px var(--pad) calc(28px + var(--safe-b));
  background: linear-gradient(to top, var(--bg) calc(100% - 14px), rgba(58, 36, 26, 0));
}
.bar-in { max-width: 436px; margin: 0 auto; display: flex; flex-direction: column; }
.bar .slot { height: 56px; display: flex; align-items: center; justify-content: center; }
.bar .note { margin: 0 0 10px; font-size: 12px; color: var(--dim); text-align: center; }
.main-btn {
  height: 64px; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 10px 0 24px; border: 2.5px solid var(--text); border-radius: 999px; font-size: 17px;
  text-align: left; text-decoration: none; color: var(--text); background: transparent;
}
.main-btn > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arrow { width: 44px; height: 44px; border: 1.5px solid var(--text); border-radius: 50%; display: grid; place-items: center; flex: none; }
.link { height: 48px; font-size: 15px; color: var(--dim); text-decoration: underline; text-underline-offset: 4px; background: none; border: 0; }
.link.inline { height: auto; }
.row-links { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--dim); }
.row-links a, .row-links button { color: var(--dim); text-decoration: underline; font-size: 12px; }

/* ---------- главная ---------- */
.now-card { display: flex; align-items: center; gap: 14px; text-decoration: none; border: 2.5px solid var(--text); border-radius: 999px; padding: 10px 10px 10px 20px; width: 100%; text-align: left; margin-top: 26px; }
.now-card .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.now-card .a { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-card .b { font-size: 16px; font-variant-numeric: tabular-nums; }
.list { display: flex; flex-direction: column; }
.list > * { border-top: 1px solid var(--line); }
.list > *:last-child { border-bottom: 1px solid var(--line); }
.rcp { display: flex; align-items: center; gap: 14px; padding: 12px 0; text-decoration: none; width: 100%; text-align: left; }
.rcp img, .rcp .ph { width: 64px; height: 64px; flex: none; border-radius: 14px; object-fit: cover; background: var(--photo); }
.rcp .grow { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rcp .name { font-family: var(--head); text-transform: uppercase; font-size: 26px; font-weight: 500; line-height: 1; }
.rcp .sub { font-size: 13px; color: var(--dim); }
.epi { font-size: 13px; line-height: 1.5; color: var(--dim); margin-top: 8px; }

/* ---------- рецепт ---------- */
.screen.recipe { padding-top: 0; gap: 12px; }
.hero { position: relative; height: min(330px, 39vh); margin: 0 calc(-1 * var(--pad)); background: var(--photo); overflow: hidden; }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 100%; max-width: none; }
.hero .back { position: absolute; left: var(--pad); top: calc(18px + var(--safe-t)); margin: 0; border: 1.5px solid rgba(240, 234, 226, 0.8); border-radius: 50%; background: rgba(58, 36, 26, 0.45); }
.recipe .title { margin-top: 4px; }
.recipe .title h1 { font-size: 46px; }
.recipe .title { margin-bottom: 0; }
.recipe .title .hand { right: 4px; top: -48px; bottom: auto; text-shadow: 0 1px 10px rgba(58, 36, 26, 0.55); }
.recipe .title + * { margin-top: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--dim); }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; }
button.chip { color: var(--dim); }
.choose { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.opt { height: 52px; border: 1.5px solid var(--line); border-radius: 999px; font-size: 15px; padding: 0 8px; }
.opt.on { border: 2.5px solid var(--text); }
.custom { display: flex; gap: 8px; align-items: center; }
.more { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.more details { flex: 0 1 auto; }
.more details[open] { flex-basis: 100%; }
.more ol, .more ul { margin: 0; padding-left: 20px; font-size: 15px; line-height: 1.45; display: flex; flex-direction: column; gap: 6px; }
details > summary { list-style: none; cursor: pointer; color: var(--dim); text-decoration: underline; text-underline-offset: 4px; font-size: 15px; }
details > summary::-webkit-details-marker { display: none; }
details[open] > summary { margin-bottom: 10px; }

/* ---------- поля ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--dim); }
.input, textarea.input {
  width: 100%; height: 52px; border: 1.5px solid var(--line); border-radius: 999px; background: transparent;
  padding: 0 18px; font-size: 16px; color: var(--text);
}
.input:focus { border-color: var(--text); outline: none; }
textarea.input { height: auto; min-height: 96px; border-radius: 22px; padding: 14px 18px; resize: vertical; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.4; color: var(--dim); }
.check input { width: 22px; height: 22px; accent-color: #F0EAE2; flex: none; margin: 0; }
.err { color: #f3b4a4; font-size: 14px; min-height: 1em; }

/* ---------- замес ---------- */
.stages { list-style: none; margin: 0; padding: 0; display: flex; gap: 14px; font-size: 13px; color: var(--dim); overflow-x: auto; scrollbar-width: none; }
.stages::-webkit-scrollbar { display: none; }
.stages li { white-space: nowrap; }
.stages .done { text-decoration: line-through; }
.stages .now { color: var(--text); font-weight: 700; }
.bake .title { margin-top: 8px; }
.timer { position: relative; margin-top: 22px; width: 100%; aspect-ratio: 346 / 300; max-height: 300px; background: var(--plate); border-radius: 28px; }
.timer svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.timer .in { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; padding: 0 14px; text-align: center; }
.timer .clock { font-family: var(--head); font-size: 128px; font-weight: 600; line-height: 0.9; letter-spacing: -2px; font-variant-numeric: tabular-nums; }
.timer .clock.long { font-size: 96px; }
.timer .clock.due { font-size: 92px; }
.timer .at { font-size: 14px; color: rgba(240, 234, 226, 0.8); }
.ings { display: flex; flex-direction: column; }
.ing { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.ing:last-child { border-bottom: 1px solid var(--line); }
.tick { width: 36px; height: 36px; border: 1.5px solid var(--line); border-radius: 50%; display: grid; place-items: center; flex: none; }
.ing.on .tick { border: 2px solid var(--text); }
.ing .name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ing .name b { font-weight: 400; font-size: 16px; }
.ing .name small { color: var(--dim); font-size: 12px; }
.ing input { width: 84px; height: 40px; border: 1.5px solid var(--line); border-radius: 999px; background: transparent; padding: 0 12px; font-size: 15px; text-align: center; }
.ing .no { margin-top: 6px; align-self: flex-start; font-size: 12px; padding: 4px 10px; }
.ing .no.on { border-color: var(--text); color: var(--text); }
.hours { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.photo-big { width: 100%; border-radius: 22px; aspect-ratio: 4 / 3; object-fit: cover; background: var(--plate); }

/* ---------- уведомление-подсказка ---------- */
.notice { border: 1.5px solid var(--line); border-radius: 22px; padding: 14px 16px; font-size: 14px; line-height: 1.45; display: flex; flex-direction: column; gap: 8px; }
.notice b { font-weight: 600; font-size: 15px; }
.notice ol { margin: 0; padding-left: 20px; }
.notice .link { height: auto; align-self: flex-start; font-size: 14px; }

/* ---------- кабинет ---------- */
.status-card { display: flex; flex-direction: column; gap: 10px; text-decoration: none; border: 2.5px solid var(--text); border-radius: 24px; padding: 16px 12px 16px 18px; width: 100%; text-align: left; margin-top: 6px; }
.status-card .row { display: flex; align-items: center; gap: 14px; }
.status-card .grow { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.progress { display: flex; gap: 4px; padding-right: 6px; }
.progress span { height: 3px; border-radius: 2px; background: var(--line); }
.progress span.full { background: var(--text); }
.menu-row { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 6px 0; text-decoration: none; width: 100%; text-align: left; }
.menu-row .grow { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.menu-row .grow > span:first-child { font-size: 16px; }
.menu-row .grow > span + span { font-size: 12px; color: var(--dim); }
.foot { margin-top: 20px; }

/* ---------- подписка ---------- */
.checks { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.35; }
.checks svg { flex: none; margin-top: 1px; }
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 6px; }
.plan { text-align: left; border: 1.5px solid var(--line); border-radius: 22px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.plan.on { border: 2.5px solid var(--text); padding: 13px 15px; }
.plan.wide { grid-column: 1 / -1; }
.plan .k { font-size: 13px; color: var(--dim); }
.plan .v { font-family: var(--head); text-transform: uppercase; font-size: 26px; font-weight: 600; line-height: 1; }
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1.5px solid var(--line); border-radius: 999px; padding: 4px; gap: 4px; }
.seg button { height: 40px; border-radius: 999px; font-size: 14px; color: var(--dim); }
.seg button.on { border: 1.5px solid var(--text); color: var(--text); }

/* ---------- чат ---------- */
.screen.chat { padding: calc(18px + var(--safe-t)) 0 0; gap: 0; min-height: 100vh; min-height: 100dvh; }
.chat .top { padding: 0 var(--pad) 14px; border-bottom: 1px solid var(--line); }
.ava { width: 40px; height: 40px; border-radius: 50%; background: var(--photo); display: grid; place-items: center; font-family: var(--head); text-transform: uppercase; font-size: 18px; font-weight: 600; flex: none; }
.msgs { flex: 1; padding: 16px var(--pad) calc(190px + var(--safe-b)); display: flex; flex-direction: column; gap: 10px; }
.day { align-self: center; font-size: 12px; color: var(--dim); }
.msg { max-width: 78%; font-size: 15px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.her { align-self: flex-start; background: var(--plate); border-radius: 20px 20px 20px 6px; padding: 12px 14px; }
.msg.me { align-self: flex-end; border: 1.5px solid var(--text); border-radius: 20px 20px 6px 20px; padding: 10px 14px; }
.msg img { width: 200px; max-width: 100%; border-radius: 14px; margin: -2px -6px 8px; }
.compose { display: flex; flex-direction: column; gap: 10px; }
.compose .quick { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.compose .quick button { flex: none; height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; }
.compose form { display: flex; align-items: center; gap: 8px; margin: 0; }
.compose .input { height: 48px; border-color: var(--text); flex: 1; min-width: 0; }
.round { width: 48px; height: 48px; flex: none; border: 1.5px solid var(--text); border-radius: 50%; display: grid; place-items: center; }
.round.soft { border-color: var(--line); }
.attached { font-size: 12px; color: var(--dim); }

/* ---------- история ---------- */
.hist { display: flex; gap: 14px; align-items: center; padding: 12px 0; }
.hist img, .hist .ph { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; background: var(--photo); flex: none; }
.hist-body { padding: 0 0 14px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.hist-body ul { margin: 0; padding-left: 18px; color: var(--dim); }

/* ---------- прочее ---------- */
.toggle { width: 56px; height: 32px; border-radius: 999px; border: 1.5px solid var(--line); position: relative; flex: none; }
.toggle::after { content: ""; position: absolute; top: 4px; left: 4px; width: 21px; height: 21px; border-radius: 50%; background: var(--dim); transition: transform 0.15s; }
.toggle.on { border-color: var(--text); }
.toggle.on::after { transform: translateX(24px); background: var(--text); }
.rules { white-space: pre-wrap; font-size: 15px; line-height: 1.5; }
.code { font-family: var(--head); font-size: 28px; letter-spacing: 1px; font-weight: 600; }
#toast {
  position: fixed; left: 50%; top: calc(14px + var(--safe-t)); transform: translateX(-50%) translateY(-20px); z-index: 60;
  background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-size: 14px;
  opacity: 0; transition: 0.2s; pointer-events: none; max-width: calc(100% - 40px); text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.loading { display: grid; place-items: center; min-height: 60vh; color: var(--dim); }

@media (max-width: 370px) {
  h1, .h1 { font-size: 42px; }
  .home h1 { font-size: 54px; }
  .recipe .title h1 { font-size: 40px; }
  .timer .clock { font-size: 104px; }
  .rcp .name { font-size: 22px; }
}
