@font-face {
  font-family: 'Golos Text';
  src: url('/fonts/golos-text-cyrillic-wght-normal.woff2') format('woff2');
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Golos Text';
  src: url('/fonts/golos-text-latin-wght-normal.woff2') format('woff2');
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/ibm-plex-mono-cyrillic-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/ibm-plex-mono-cyrillic-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/ibm-plex-mono-latin-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;
  --bg: #f5f5ed;
  --paper: #fffefa;
  --ink: #193c32;
  --on-ink: #f9fff0;
  --muted: #5f6b60;
  --line: #e1e5d9;
  --line-strong: #cfd7c4;
  --soft: #e9eddf;
  --lime: #d4ee94;
  --on-lime: #193c32;
  --lime-muted: #4c5e3b;
  --warn: #b24a24;
  --warn-bg: #fbe9dd;
  --accent: #557a2c;
  --fat: #d49a65;
  --carb: #a3aa6f;
  --protein: #69835f;
  --shadow: 0 10px 22px -16px rgba(38, 60, 37, 0.45);
  --sans: 'Golos Text', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --nav-h: 72px;
  --rail: 216px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1e19;
    --paper: #182b24;
    --ink: #eaf3de;
    --on-ink: #12241e;
    --muted: #a3b5a8;
    --line: #2a4036;
    --line-strong: #3b5448;
    --soft: #223a31;
    --warn: #f0a07c;
    --warn-bg: #3a2a20;
    --accent: #c3e283;
    --shadow: 0 10px 22px -16px rgba(0, 0, 0, 0.8);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 var(--sans);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

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

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

button { cursor: pointer; }

button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }

a { color: inherit; }

:focus-visible { outline: 3px solid #8ba951; outline-offset: 3px; }

#app {
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 20px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Icons and brand */

.ico {
  display: inline-block;
  flex: none;
  width: 22px;
  height: 22px;
  background: currentColor;
  -webkit-mask: var(--i) center / contain no-repeat;
  mask: var(--i) center / contain no-repeat;
}

.ico-camera { --i: url('/icons/camera.svg'); }
.ico-spark { --i: url('/icons/spark.svg'); }
.ico-text { --i: url('/icons/text.svg'); }
.ico-today { --i: url('/icons/today.svg'); }
.ico-progress { --i: url('/icons/progress.svg'); }
.ico-user { --i: url('/icons/user.svg'); }
.ico-up { --i: url('/icons/up.svg'); }
.ico-check { --i: url('/icons/check.svg'); }
.ico-receipt { --i: url('/icons/receipt.svg'); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 25px;
  font-weight: 750;
  line-height: 1;
  letter-spacing: -0.045em;
}

.brand-mark {
  flex: none;
  width: 23px;
  height: 29px;
  background: currentColor;
  -webkit-mask: url('/img/mark.svg') center / contain no-repeat;
  mask: url('/img/mark.svg') center / contain no-repeat;
}

.brand.global { font-size: 20px; letter-spacing: -0.03em; }

.nav-brand { display: none; }

/* Page furniture */

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; }

.pill {
  font: 12px/1 var(--mono);
  color: var(--muted);
  background: var(--soft);
  border-radius: 8px;
  padding: 7px 9px;
  white-space: nowrap;
}

.eyebrow, .section-title {
  font: 11px/1.4 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.notice { font-size: 14px; background: var(--warn-bg); border-radius: 10px; padding: 10px 12px; }

.page { display: flex; flex-direction: column; gap: 18px; }

.footer-line {
  margin-top: 6px;
  text-align: center;
  font: 11px/1.4 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.muted { color: var(--muted); }

.small-text { font-size: 14px; }

.center { text-align: center; }

/* Buttons */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 12px 18px;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  transition: transform 0.26s var(--spring), opacity 0.2s;
}

.btn:disabled { opacity: 0.45; cursor: default; }

.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }

.btn.small { min-height: 46px; padding: 9px 12px; font-size: 15px; }

.btn .grow { flex: 1; text-align: left; }

.link {
  background: none;
  border: 0;
  padding: 8px 0;
  min-height: 44px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link.danger { color: var(--warn); }

/* The subscription card stays light green in dark mode, where --warn turns pale. */
.plan-card .link.danger { color: #a32a14; }

.row { display: flex; gap: 10px; }

.row > * { flex: 1; min-width: 0; }

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

/* Scan card */

.scan-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 216px;
  padding: 20px;
  border-radius: 4px 22px 22px 22px;
  background: var(--lime);
  color: var(--on-lime);
}

.scan-card .eyebrow { position: relative; z-index: 1; color: var(--lime-muted); max-width: 62%; font-size: 10px; }

.scan-card h1, .scan-card h2 {
  position: relative;
  z-index: 1;
  max-width: 62%;
  font-size: 27px;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 600;
}

.scan-card .btn {
  position: relative;
  z-index: 1;
  margin-top: auto;
  background: var(--on-lime);
  border-color: var(--on-lime);
  color: #f9fff0;
}

.plate {
  position: absolute;
  top: 6px;
  right: -26px;
  width: 162px;
  height: 162px;
  transform: rotate(-13deg);
}

/* First visit */

.hero { display: flex; flex-direction: column; gap: 14px; padding-top: 4px; }

.hero-title { font-size: clamp(38px, 11.5vw, 48px); line-height: 1.22; letter-spacing: -0.035em; font-weight: 600; }

.hero-title em {
  font-style: normal;
  background: var(--lime);
  color: var(--on-lime);
  border-radius: 8px;
  padding: 0 0.14em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.hero p { color: var(--muted); }

.hero .fine { font-size: 13px; text-align: center; }

/* Receipt */

.receipt {
  position: relative;
  background: var(--paper);
  padding: 20px 20px 24px;
  margin-bottom: 9px;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.5;
  filter: drop-shadow(0 8px 10px rgba(38, 60, 37, 0.08));
}

.receipt::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -9px;
  height: 10px;
  background:
    linear-gradient(135deg, var(--paper) 7px, transparent 0) 0 0 / 14px 14px repeat-x,
    linear-gradient(225deg, var(--paper) 7px, transparent 0) 0 0 / 14px 14px repeat-x;
}

.receipt .head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.receipt .head .ico { width: 16px; height: 16px; }

.receipt h2, .receipt h3 { font: 600 20px/1.25 var(--sans); letter-spacing: -0.02em; margin: 10px 0 2px; }

.rule { border: 0; border-top: 1px dashed var(--line-strong); margin: 14px 0; }

.line { display: flex; align-items: baseline; gap: 6px; }

.name { overflow-wrap: anywhere; }

.dots { flex: 1; min-width: 12px; border-bottom: 1px dotted var(--line-strong); transform: translateY(-4px); }

.val { white-space: nowrap; font-variant-numeric: tabular-nums; }

.total { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 16px; font-weight: 600; }

.total b { font: 500 34px/1.05 var(--sans); letter-spacing: -0.03em; white-space: nowrap; font-variant-numeric: tabular-nums; }

.range { text-align: right; color: var(--muted); font-size: 13px; }

.macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.macro-label { display: flex; align-items: center; gap: 6px; font: 13px/1.3 var(--sans); color: var(--muted); }

.macro-label i { width: 6px; height: 6px; border-radius: 50%; background: var(--protein); }

.macro.fat .macro-label i { background: var(--fat); }

.macro.carbs .macro-label i { background: var(--carb); }

.macro b { display: block; margin-top: 6px; font: 600 15px/1.2 var(--mono); white-space: nowrap; }

.macro small { font-size: 12px; font-weight: 400; color: var(--muted); }

.mark {
  display: inline-block;
  transform: rotate(-2deg);
  border: 1.5px solid var(--accent);
  color: var(--accent);
  border-radius: 6px;
  padding: 3px 8px;
  font: 600 11px/1.4 var(--mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Today */

.summary { padding-bottom: 22px; }

.big {
  margin-top: 12px;
  font: 500 clamp(64px, 21vw, 84px)/1 var(--sans);
  letter-spacing: -0.055em;
  font-variant-numeric: tabular-nums;
}

.big small { margin-left: 7px; font-size: 16px; font-weight: 450; letter-spacing: -0.01em; }

.big.over { color: var(--warn); }

.summary .cap { margin-top: 6px; font: 15px/1.3 var(--sans); color: var(--muted); }

.meter { height: 7px; margin: 16px 0 9px; border-radius: 3px; background: var(--soft); overflow: hidden; }

.meter i { display: block; height: 100%; border-radius: 3px; background: var(--ink); transition: width 0.4s ease; }

.meter.over i { background: var(--warn); }

.summary .setup { margin-top: 12px; font-family: var(--sans); }

.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.quick button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 62px;
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: transparent;
  text-align: left;
  font-size: 14px;
  font-weight: 550;
  line-height: 1.2;
}

.quick .ico { width: 20px; height: 20px; }

.quick small { display: block; margin-top: 3px; font-size: 12px; font-weight: 400; color: var(--muted); }

.section-head { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; margin-top: 6px; }

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

.meal-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper);
  text-align: left;
}

.meal-text { flex: 1; min-width: 0; }

.meal-title { display: block; font-size: 15px; font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }

.meal-sub { display: block; margin-top: 3px; font: 12px/1.3 var(--mono); color: var(--muted); }

.meal-kcal { flex: none; text-align: right; font: 600 18px/1.1 var(--mono); }

.meal-kcal small { display: block; margin-top: 3px; font: 12px/1 var(--sans); color: var(--muted); }

.empty { color: var(--muted); font-size: 15px; }

/* Bottom navigation */

nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 5;
  transform: translateX(-50%);
  width: min(100%, 480px);
  display: flex;
  gap: 6px;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding: 8px 14px calc(8px + env(safe-area-inset-bottom));
  background: var(--paper);
  border-top: 1px solid var(--line);
}

nav button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--muted);
  font-size: 12px;
}

nav button[aria-current='page'] { background: var(--soft); color: var(--ink); font-weight: 600; }

/* Sheets */

dialog {
  width: min(100%, 480px);
  max-width: 100%;
  max-height: 92dvh;
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: 22px 22px 0 0;
  background: var(--bg);
  color: var(--ink);
  overflow: auto;
}

dialog[open] { animation: rise 0.22s ease-out; }

dialog::backdrop { background: rgba(20, 44, 35, 0.5); }

@keyframes rise { from { transform: translateY(36px); opacity: 0.6; } }

.sheet-body { display: flex; flex-direction: column; gap: 14px; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); }

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

.sheet-head h2 { font-size: 22px; font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; }

.close {
  flex: none;
  width: 44px;
  height: 44px;
  margin: -6px -8px -6px 0;
  border: 0;
  border-radius: 10px;
  background: none;
  font-size: 24px;
  line-height: 1;
  color: var(--muted);
}

.photo-preview { display: block; width: 100%; max-height: 38dvh; object-fit: cover; border-radius: 12px; }

/* Forms */

label.field { display: flex; flex-direction: column; gap: 5px; font-size: 14px; color: var(--muted); }

input[type='number'], input[type='email'], input[type='text'], input[type='password'], select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
}

textarea { min-height: 96px; resize: vertical; }

::placeholder { color: var(--muted); opacity: 0.8; }

.seg { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--soft); }

.seg button {
  flex: 1;
  min-height: 44px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font: 600 15px/1 var(--mono);
}

.seg button[aria-pressed='true'] { background: var(--ink); color: var(--on-ink); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chips button {
  min-height: 44px;
  padding: 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--paper);
  font-size: 15px;
  text-align: left;
}

.chips button[aria-pressed='true'] { border-color: var(--ink); background: var(--lime); color: var(--on-lime); font-weight: 600; }

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

.plan {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 70px;
  padding: 12px 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  background: var(--paper);
  text-align: left;
}

.plan[aria-pressed='true'] { border: 2px solid var(--ink); padding: 11.5px 13.5px; }

.plan b { display: block; font-size: 17px; font-weight: 600; }

.plan small { color: var(--muted); font-size: 13px; }

.plan .price { font: 600 18px/1.1 var(--mono); white-space: nowrap; text-align: right; }

.badge {
  position: absolute;
  top: -10px;
  right: 12px;
  background: var(--lime);
  color: var(--on-lime);
  border-radius: 5px;
  padding: 2px 7px;
  font: 600 11px/1.4 var(--mono);
  text-transform: uppercase;
}

.perks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }

.perks li { display: flex; align-items: center; gap: 8px; }

.perks .ico { width: 16px; height: 16px; color: var(--accent); }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); }

.check input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--ink); }

/* Printing state */

.printing { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 34px 20px 44px; }

.printer { width: 150px; height: 112px; overflow: hidden; position: relative; border-top: 6px solid var(--ink); border-radius: 3px; }

.printer div {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 0;
  height: 200px;
  background: repeating-linear-gradient(var(--paper) 0 12px, var(--line-strong) 12px 14px);
  animation: print 1.6s linear infinite;
}

@keyframes print { from { transform: translateY(-200px); } to { transform: translateY(0); } }

/* Progress and profile */

.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--paper);
}

.card h2 { font-size: 18px; font-weight: 600; letter-spacing: -0.015em; }

.card.plan-card { background: var(--lime); border-color: var(--lime); color: var(--on-lime); }

.card.plan-card .muted { color: var(--lime-muted); }

.card.plan-card .btn { background: var(--on-lime); border-color: var(--on-lime); color: #f9fff0; }

.card.plan-card .btn.ghost { background: transparent; color: var(--on-lime); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.stats div { padding: 14px 10px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); }

.stats div:first-child { background: var(--lime); border-color: var(--lime); color: var(--on-lime); }

.stats b { display: block; font: 500 26px/1.1 var(--sans); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }

.stats span { display: block; margin-top: 4px; font-size: 12px; line-height: 1.25; color: var(--muted); }

.stats div:first-child span { color: var(--lime-muted); }

.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 150px; }

.week .col { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }

.week .col { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }

.week .bar-v { width: 100%; max-width: 26px; min-height: 2px; background: var(--ink); border-radius: 5px 5px 1px 1px; }

.week .bar-v.over { background: var(--warn); }

.week .bar-v.none { background: var(--line-strong); }

.week span { font: 11px/1 var(--mono); color: var(--muted); }

.day-list { margin-top: 16px; }

.weights { display: flex; flex-direction: column; font-family: var(--mono); font-size: 14px; }

/* Demo payment page */

.demo-pay { display: grid; place-items: center; min-height: 100dvh; padding: 16px; }

.demo-pay main { width: min(100%, 380px); display: flex; flex-direction: column; gap: 12px; font-family: var(--sans); }

.demo-sum { font: 600 32px/1.2 var(--mono); text-align: center; }

/* Toast */

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom));
  z-index: 10;
  transform: translateX(-50%);
  width: min(calc(100% - 40px), 440px);
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--on-ink);
  font-size: 15px;
  box-shadow: var(--shadow);
}

/* Legal and admin pages */

.doc { max-width: 680px; margin: 0 auto; padding: 24px 16px 60px; display: flex; flex-direction: column; gap: 12px; }

.doc h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }

.doc h2 { font-size: 18px; font-weight: 600; margin-top: 10px; }

.table-wrap { overflow-x: auto; }

table { border-collapse: collapse; width: 100%; font: 14px/1.4 var(--mono); }

th, td { padding: 8px 10px; border-bottom: 1px dashed var(--line-strong); text-align: right; white-space: nowrap; }

th:first-child, td:first-child { text-align: left; }

/* Installed app */

html { overscroll-behavior-y: none; }

button, a { touch-action: manipulation; }

nav, .btn, .quick, .seg, .chips, .meal-row { -webkit-user-select: none; user-select: none; }

.boot { flex: 1; display: grid; place-items: center; min-height: 70dvh; color: var(--ink); }

.boot .brand-mark { width: 46px; height: 58px; animation: breathe 1.2s ease-in-out infinite alternate; }

@keyframes breathe { from { opacity: 0.35; } to { opacity: 1; } }

.view-enter { animation: enter 0.22s ease-out; }

@keyframes enter { from { opacity: 0.2; transform: translateY(6px); } }

.install-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--paper);
}

.install-card img { border-radius: 11px; }

.install-card h2 { font-size: 16px; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }

.install-card p { margin-top: 3px; font-size: 14px; line-height: 1.3; color: var(--muted); }

.install-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; }

.install-actions .btn { flex: 1; }

.install-actions .link { flex: none; padding: 8px 4px; }

.steps { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0 0 0 22px; }

.steps li { padding-left: 4px; }

.steps li::marker { font: 600 15px var(--mono); color: var(--accent); }

@media (display-mode: standalone) {
  body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

  input, textarea, .receipt { -webkit-user-select: text; user-select: text; }
}

.code-input { font: 600 26px/1.2 var(--mono); letter-spacing: 0.3em; text-align: center; }

.account-email { font: 15px/1.3 var(--mono); overflow-wrap: anywhere; }

.legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; font-size: 13px; }

.legal-links a { color: var(--muted); padding: 6px 2px; text-underline-offset: 3px; }

/* Larger screens */

@media (min-width: 640px) {
  dialog { margin: auto; border-radius: 22px; }
}

@media (min-width: 960px) {
  #app {
    max-width: calc(var(--rail) + 960px);
    margin: 0;
    padding: 32px 44px 40px calc(var(--rail) + 44px);
  }

  nav {
    top: 0;
    left: 0;
    bottom: 0;
    transform: none;
    width: var(--rail);
    height: auto;
    flex-direction: column;
    gap: 8px;
    padding: 30px 18px;
    background: #193c32;
    border: 0;
  }

  .nav-brand { display: flex; margin: 0 8px 34px; color: #f5f5e9; }

  .top .brand { display: none; }

  .top { justify-content: flex-end; }

  nav button {
    flex: none;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    min-height: 50px;
    padding: 12px 14px;
    color: #b9cbbd;
    font-size: 15px;
  }

  nav button[aria-current='page'] { background: #d4ee94; color: #193c32; }

  .page-today { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }

  .page-today > .span { grid-column: 1 / -1; }

  .page-today > .scan-card { min-height: 100%; }

  .scan-card { min-height: 282px; padding: 24px; }

  .scan-card h1, .scan-card h2 { font-size: 30px; max-width: 58%; }

  .plate { top: 16px; width: 192px; height: 192px; right: -22px; }

  .hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px 36px; align-items: start; }

  .hero > * { grid-column: 1; }

  .hero > .receipt { grid-column: 2; grid-row: 1 / span 6; margin-top: 8px; }

  .page-narrow { max-width: 640px; }

  #toast { left: calc(50% + var(--rail) / 2); bottom: 24px; }
}

/* Press feel: quick dip on touch, soft spring on release */

:root { --spring: cubic-bezier(0.34, 1.56, 0.64, 1); }

:is(.quick button, .meal-row, .plan, .chips button, .seg button, nav button, .close) {
  transition: transform 0.26s var(--spring);
}

:is(.btn, .quick button, .chips button, .seg button, nav button, .close):active:not(:disabled) {
  transform: scale(0.97);
  transition: transform 0.06s ease-out, opacity 0.2s;
}

:is(.meal-row, .plan):active:not(:disabled) {
  transform: scale(0.985);
  transition: transform 0.06s ease-out;
}

/* A fresh scan comes out of the printer */

.receipt.fresh { animation: print-out 0.55s cubic-bezier(0.22, 1, 0.36, 1); }

@keyframes print-out {
  from { clip-path: inset(0 -20px 100% -20px); transform: translateY(-14px); }
  to { clip-path: inset(0 -20px -20px -20px); transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Career receipt: the original paper/printer visual language is preserved. */
.hero-badge { display: inline-block; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 99px; font-size: 13px; font-weight: 700; }
.resume-symbol { display: grid; place-items: center; gap: 8px; margin: 16px auto; color: var(--ink); font: 88px/1 'IBM Plex Mono', monospace; transform: rotate(-7deg); }
.resume-symbol small { font-size: 13px; letter-spacing: .15em; }
.hr-score { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 22px 0; padding: 18px; background: var(--soft); border: 1px solid var(--line-strong); border-radius: 12px; }
.hr-score > span { flex: 1 1 160px; font-size: 14px; font-weight: 700; }
.hr-score > b { font: 700 48px/1 'Golos Text', sans-serif; }
.hr-score.risk { color: var(--warn); background: var(--warn-bg); border-color: currentColor; }
.risk-badge { flex-basis: 100%; font-size: 12px; font-weight: 700; }
.salary-block { display: grid; gap: 12px; padding: 16px 0; }
.salary-block p { margin: 0; font-size: 14px; }
.salary-block b { display: block; margin-top: 4px; font-size: 21px; }
.salary-loss { color: var(--warn); font-weight: 700; }
.resume-metrics { display: grid; gap: 14px; margin: 20px 0; }
.resume-metric > div:first-child { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; margin-bottom: 6px; }
.resume-metric .meter { height: 8px; }
.resume-fix { margin: 0; padding: 18px 0; border-bottom: 1px dashed var(--line-strong); overflow-wrap: anywhere; }
.resume-fix p { margin: 0 0 10px; font-size: 14px; line-height: 1.6; white-space: pre-wrap; }
.resume-fix small { color: var(--accent); font: 12px/1.6 'IBM Plex Mono', monospace; }
.recruiter-verdict { border-left: 3px solid var(--ink); padding: 6px 0 6px 14px; font-size: 14px; line-height: 1.6; }
.locked-receipt { position: relative; isolation: isolate; min-height: 350px; margin-top: 12px; }
.locked-blur-box { filter: blur(6px); user-select: none; pointer-events: none; opacity: 0.65; }
.unlock-overlay { position: absolute; z-index: 1; top: 50%; left: -10px; right: -10px; transform: translateY(-50%); padding: 24px 20px; border: 2px solid var(--ink); border-radius: 16px; background: var(--paper); color: var(--ink); box-shadow: 0 14px 40px #0002; text-align: center; }
.unlock-overlay h3 { margin: 0 0 12px; font: 800 20px/1.35 'Golos Text', sans-serif; }
.unlock-overlay p { margin: 0 0 18px; font: 14px/1.6 'Golos Text', sans-serif; }
.unlock-button { width: 100%; white-space: normal; background: var(--lime); color: var(--on-lime); border-color: var(--ink); }
.sample-resume .sample-salary { font-weight: 700; font-size: 15px; line-height: 1.6; }
.sample-replacement { color: var(--accent); }
.advice-copy { white-space: pre-wrap; line-height: 1.7; overflow-wrap: anywhere; }
.vacancy-card h2 { font-size: 19px; }
.vacancy-flags { border-color: var(--warn); }
.vacancy-entry { margin-top: 12px; white-space: normal; }
.resume-receipt h2, .sample-resume h3 { overflow-wrap: anywhere; }
@media (max-width: 420px) {
  .unlock-overlay { padding: 18px 12px; left: -8px; right: -8px; }
  .unlock-overlay h3 { font-size: 18px; }
  .unlock-button { font-size: 14px; padding-inline: 12px; }
  .hr-score > b { font-size: 40px; }
}
.scan-card .resume-symbol { position: absolute; top: 26px; right: 14px; width: 90px; margin: 0; font-size: 92px; pointer-events: none; }
.scan-card .resume-symbol small { font-size: 10px; }
.locked-blur-box { -webkit-user-select: none; }

/* Чекни Резюме: career studio identity */
:root {
  color-scheme: light;
  --bg: #f5f4f0;
  --paper: #fff;
  --ink: #191c2a;
  --on-ink: #fff;
  --muted: #71717c;
  --line: #e5e4e7;
  --line-strong: #d8d8df;
  --soft: #eeeef4;
  --lime: #e8ebff;
  --on-lime: #283dd1;
  --lime-muted: #626b9a;
  --warn: #c3492c;
  --warn-bg: #fff0e9;
  --accent: #3347db;
  --protein: #354ae1;
  --fat: #eea487;
  --carb: #aaaee8;
  --shadow: 0 16px 44px rgba(34, 39, 65, .09);
  --rail: 0px;
}
body { background: var(--bg); }
::selection { background: #c6ff80; color: #191c2a; }
:focus-visible { outline-color: #4358ed; }
#app { max-width: 600px; gap: 20px; }
.brand { font-size: 21px; font-weight: 800; letter-spacing: -.045em; gap: 9px; }
.brand-mark { width: 34px; height: 34px; padding: 6px; border-radius: 10px; background: #3347db; -webkit-mask: none; mask: none; position: relative; }
.brand-mark::after { content: ''; display: block; width: 100%; height: 100%; background: white; -webkit-mask: url('/img/mark.svg') center / contain no-repeat; mask: url('/img/mark.svg') center / contain no-repeat; }
.pill { border: 1px solid #dcdff5; border-radius: 99px; padding: 8px 12px; background: #fff; color: #59618c; font: 600 10px/1 var(--mono); }
.btn { min-height: 56px; border-radius: 12px; border-color: var(--ink); font-weight: 700; }
.btn:not(.ghost):hover { filter: brightness(1.08); }
.btn.ghost:hover { background: #edecf0; }
.link { color: #68708d; }
.notice { border-radius: 12px; }

/* A focused first screen, with a sample review instead of a food receipt. */
.hero.hero-career { display: flex; flex-direction: column; gap: 0; padding-top: 12px; }
.hero-intro { display: flex; flex-direction: column; align-items: stretch; }
.hero-badge { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; margin: 0 0 22px; padding: 8px 11px; background: #fff; border: 1px solid #e1e3ef; border-radius: 6px; color: #4c59aa !important; font: 600 10px/1.2 var(--mono); letter-spacing: .02em; text-transform: uppercase; }
.live-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: #4860ef; box-shadow: 0 0 0 3px #e9ebff; }
.hero-title { max-width: 720px; color: #171a2b; font-size: clamp(40px, 10.4vw, 64px); line-height: 1.04; letter-spacing: -.055em; font-weight: 750; }
.hero-title em { background: none; color: #3548d5; padding: 0; border-radius: 0; }
.hero .hero-lead { margin-top: 20px; max-width: 580px; color: #636571; font-size: 16px; line-height: 1.6; }
.hero-actions { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 28px; }
.hero-actions .btn { justify-content: flex-start; min-height: 60px; padding: 14px 16px; text-align: left; line-height: 1.3; }
.hero-actions .btn > span:not(.action-arrow) { flex: 1; }
.hero-actions .ico { width: 20px; height: 20px; }
.hero-primary { background: #3348df; border-color: #3348df; color: white; }
.hero-secondary { background: #fff; border-color: #e0e0e6; color: #222438; }
.hero-vacancy { background: transparent; border-color: #d5d6df; color: #33364d; }
.hero-actions .action-arrow { margin-left: auto; font: 400 22px/1 var(--sans); }
.hero .hero-fine { margin-top: 15px; color: #8a8991; font-size: 12px; line-height: 1.45; }
.hero-login { align-self: flex-start; min-height: 32px; font-size: 12px; }
.hero-preview { position: relative; margin-top: 36px; padding: 18px; overflow: hidden; background: #222a72; border-radius: 18px; color: white; }
.hero-preview::before { content: ''; position: absolute; width: 270px; height: 270px; right: -120px; top: -160px; border: 1px solid rgba(255,255,255,.19); border-radius: 50%; box-shadow: 0 0 0 45px rgba(255,255,255,.025), 0 0 0 90px rgba(255,255,255,.025); }
.preview-topline, .preview-footer { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 10px; color: #d5d9ff; font: 600 10px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.preview-topline { margin-bottom: 14px; }
.preview-footer { justify-content: flex-start; margin-top: 15px; letter-spacing: 0; text-transform: none; }
.preview-cross { color: #c6ff80; font-size: 20px; }
.hero-preview .sample-resume { color: #191c2a; }
.hero-preview .sample-resume h3 { max-width: 310px; font-size: 20px; }
.hero-preview .sample-resume .head { color: #777b92; }
.hero-preview .sample-resume .sample-salary { color: #282c42; }
.hero-preview .sample-resume .sample-replacement { color: #3348d2; }
.hero-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 34px; border-top: 1px solid #d9d9e1; border-bottom: 1px solid #d9d9e1; }
.hero-step { padding: 16px 8px 16px 0; }
.hero-step + .hero-step { padding-left: 12px; border-left: 1px solid #d9d9e1; }
.hero-step span { display: block; margin-bottom: 7px; color: #4054e1; font: 600 10px/1 var(--mono); }
.hero-step b { color: #3a3c4b; font-size: 11px; font-weight: 650; line-height: 1.3; }
.hero-legal { margin-top: 25px; }

/* Shared screens, receipt, paywall and navigation. */
.receipt { border: 1px solid #e6e6eb; border-radius: 14px; box-shadow: 0 12px 38px rgba(25, 28, 42, .07); filter: none; }
.receipt::after { display: none; }
.receipt .head { color: #888a99; font-size: 10px; letter-spacing: .1em; }
.receipt h2, .receipt h3 { font-weight: 750; }
.rule { border-top-style: solid; }
.hr-score { border: 0; border-radius: 10px; background: #edf0ff; }
.hr-score.risk { color: #b9482e; background: #fff0eb; border: 0; }
.hr-score > b { font-weight: 800; letter-spacing: -.06em; }
.risk-badge { font-family: var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.salary-block { padding: 16px; border-radius: 10px; background: #f6f6fa; }
.salary-block b { font-family: var(--sans); font-weight: 750; letter-spacing: -.03em; }
.salary-loss { font-size: 12px !important; }
.resume-metric .meter { margin-top: 8px; background: #e8e9f1; }
.resume-metric .meter i { background: #4054e1; }
.recruiter-verdict { border-left-color: #4054e1; }
.resume-fix { border-bottom-color: #e4e4eb; }
.resume-fix small { color: #4659d6; }
.unlock-overlay { left: 0; right: 0; border: 1px solid #d9dbec; background: #fff; box-shadow: 0 20px 55px rgba(32,38,86,.19); }
.unlock-button { background: #3348df; border-color: #3348df; color: #fff; }
.card, .meal-row, .stats div { border-color: #e4e4eb; border-radius: 14px; box-shadow: 0 5px 20px rgba(30, 33, 55, .035); }
.card.plan-card, .stats div:first-child { background: #e9ecff; border-color: #e9ecff; color: #202e91; }
.card.plan-card .btn { background: #3348df; border-color: #3348df; color: #fff; }
.card.plan-card .btn.ghost { background: transparent; color: #273aaf; }
.plan[aria-pressed='true'] { border-color: #4054e1; background: #f7f8ff; }
.plan .badge { background: #3348df; color: #fff; }
.check input { accent-color: #3348df; }
.scan-card { min-height: 240px; border-radius: 16px; background: #2835a0; color: #fff; }
.scan-card .eyebrow { color: #c0c8ff; }
.scan-card .btn { background: #fff; border-color: #fff; color: #2835a0; }
.scan-card .resume-symbol { color: #c6ff80; opacity: .95; }
.chips button[aria-pressed='true'] { border-color: #5262d8; background: #edf0ff; color: #263bb1; }
nav { width: min(calc(100% - 28px), 572px); bottom: 12px; height: 66px; padding: 6px; border: 1px solid #e5e5ed; border-radius: 16px; box-shadow: 0 12px 35px rgba(29,33,64,.13); background: rgba(255,255,255,.97); }
nav button { border-radius: 11px; font-weight: 600; }
nav button[aria-current='page'] { background: #eef0ff; color: #3348df; }
dialog { background: #f5f4f0; }
dialog::backdrop { background: rgba(20,22,42,.66); }
.sheet-head h2 { font-weight: 750; }
input[type='number'], input[type='email'], input[type='text'], input[type='password'], select, textarea { border-color: #dddde6; border-radius: 10px; }
textarea { min-height: 150px; }

@media (min-width: 960px) {
  #app { max-width: 1370px; margin: 0 auto; padding: 104px 54px 54px; gap: 8px; }
  nav { top: 0; bottom: auto; left: 0; transform: none; width: 100%; height: 72px; padding: 0 max(54px, calc((100vw - 1262px) / 2)); flex-direction: row; align-items: center; gap: 6px; border: 0; border-bottom: 1px solid #e4e3e7; border-radius: 0; box-shadow: none; background: rgba(245,244,240,.96); }
  .nav-brand { display: flex; flex: none; margin: 0 auto 0 0; color: #191c2a; }
  nav button { min-height: 43px; flex: none; padding: 10px 14px; color: #737484; font-size: 13px; }
  nav button[aria-current='page'] { background: #e9ebff; color: #3348df; }
  .top { position: fixed; z-index: 6; top: 22px; right: max(54px, calc((100vw - 1262px) / 2)); min-height: 0; }
  nav { padding-right: max(190px, calc((100vw - 1262px) / 2 + 135px)); }
  .hero.hero-career { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .8fr); gap: 0 70px; align-items: center; padding-top: 18px; }
  .hero.hero-career > * { grid-column: auto; }
  .hero-intro { grid-column: 1; grid-row: 1; }
  .hero-preview { grid-column: 2; grid-row: 1; margin: 0; padding: 24px; }
  .hero-steps { grid-column: 1 / -1 !important; margin-top: 48px; }
  .hero-legal { grid-column: 1 / -1 !important; }
  .hero-title { font-size: clamp(46px, 5vw, 70px); }
  .hero .hero-lead { font-size: 17px; }
  .hero-actions { grid-template-columns: 1fr 1fr; }
  .hero-primary, .hero-vacancy { grid-column: 1 / -1; }
  .hero-preview .sample-resume { padding: 25px; }
  .hero-preview .sample-resume h3 { font-size: 23px; }
  .page-today { max-width: 1100px; }
  #toast { left: 50%; }
}
@media (max-width: 420px) {
  #app { padding-inline: 16px; }
  .brand { font-size: 19px; }
  .hero-title { font-size: clamp(37px, 10.2vw, 44px); }
  .hero-preview { padding: 14px; }
  .hero-steps { gap: 0; }
  .hero-step b { font-size: 10px; }
}

/* A payment mode must be selected before the provider shows its methods. */
.payment-modes { display: flex; flex-direction: column; gap: 8px; }
.payment-modes .section-title { margin-bottom: 2px; }
.payment-mode { width: 100%; display: flex; align-items: flex-start; gap: 10px; padding: 13px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: var(--paper); text-align: left; }
.payment-mode[aria-pressed='true'] { border-color: var(--accent); background: var(--soft); }
.payment-mode b, .payment-mode small { display: block; }
.payment-mode b { font-size: 15px; line-height: 1.3; }
.payment-mode small { margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.mode-check { width: 19px; height: 19px; flex: none; margin-top: 1px; border: 1.5px solid var(--line-strong); border-radius: 50%; }
.payment-mode[aria-pressed='true'] .mode-check { border: 5px solid var(--accent); background: white; }

/* Keep the sample review easy to read at a glance. */
.hero-preview .sample-resume { font-family: var(--sans); font-size: 14px; line-height: 1.5; }
.hero-preview .sample-resume .head { font-family: var(--sans); font-size: 11px; font-weight: 650; letter-spacing: .06em; }
.hero-preview .sample-resume .risk-badge { font-family: var(--sans); font-size: 11px; letter-spacing: .04em; }
.hero-preview .sample-resume .sample-salary { font-size: 14px; line-height: 1.5; }
.hero-preview .sample-resume .resume-fix { font-size: 14px; line-height: 1.55; }
.hero-preview .preview-topline, .hero-preview .preview-footer { font-family: var(--sans); font-size: 11px; }

/* Scanning state: a CV is inspected instead of a receipt being printed. */
.scanning { display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 34px 24px 38px; text-align: center; }
.scanning p { max-width: 310px; color: var(--ink); font-size: 16px; font-weight: 600; line-height: 1.45; }
.scan-visual { position: relative; display: grid; place-items: center; width: 174px; height: 184px; }
.scan-document { position: relative; width: 120px; height: 148px; overflow: hidden; padding: 18px 14px; border: 1px solid #dfe3f4; border-radius: 10px; background: #fff; box-shadow: 0 12px 30px rgba(44, 58, 144, .11); }
.scan-profile { display: flex; align-items: center; gap: 9px; }
.scan-avatar { width: 29px; height: 29px; flex: none; border-radius: 9px; background: #e9ecff; }
.scan-avatar::after { content: ''; display: block; width: 11px; height: 11px; margin: 7px auto; border-radius: 50%; background: #8e9bef; }
.scan-heading-lines { flex: 1; display: grid; gap: 5px; }
.scan-heading-lines i, .scan-lines i { display: block; height: 4px; border-radius: 9px; background: #d8ddf2; }
.scan-heading-lines i:first-child { width: 100%; background: #919de7; }
.scan-heading-lines i:last-child { width: 66%; }
.scan-rule { height: 1px; margin: 13px 0; background: #ebedf7; }
.scan-lines { display: grid; gap: 9px; }
.scan-lines i:nth-child(2) { width: 78%; }
.scan-lines i:nth-child(3) { width: 91%; }
.scan-lines i:nth-child(4) { width: 55%; }
.scan-beam { position: absolute; z-index: 1; top: 10px; left: 0; right: 0; height: 2px; background: #4055ef; box-shadow: 0 0 12px 4px rgba(80, 103, 255, .35); animation: cv-scan-pass 2.3s ease-in-out infinite alternate; }
.scan-corner { position: absolute; width: 17px; height: 17px; border: 2px solid #98a4f2; }
.scan-corner-tl { left: 9px; top: 0; border-right: 0; border-bottom: 0; border-radius: 4px 0 0 0; }
.scan-corner-tr { right: 9px; top: 0; border-left: 0; border-bottom: 0; border-radius: 0 4px 0 0; }
.scan-corner-bl { left: 9px; bottom: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 4px; }
.scan-corner-br { right: 9px; bottom: 0; border-left: 0; border-top: 0; border-radius: 0 0 4px 0; }
.scan-pulse { display: flex; gap: 6px; }
.scan-pulse i { width: 6px; height: 6px; border-radius: 50%; background: #6e7eec; animation: cv-scan-pulse 1.2s ease-in-out infinite; }
.scan-pulse i:nth-child(2) { animation-delay: .15s; }
.scan-pulse i:nth-child(3) { animation-delay: .3s; }
@keyframes cv-scan-pass { to { transform: translateY(125px); } }
@keyframes cv-scan-pulse { 50% { opacity: .3; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .scan-beam, .scan-pulse i { animation: none; } }
