/* «Бенто»: the screen is a box of tiles in flat colours. Light: lime and black on a pale
   lime ground. Dark: yellow, pink, blue and green tiles on black. Pills everywhere, big
   heavy numbers, a floating black tab bar. */

:root {
  --bg: #eef2e3;
  --surface: #ffffff;
  --text: #141414;
  --muted: #687060;
  --line: #dde3cf;
  --field: #f3f6ea;
  --ink: #141414;
  --on-ink: #f6f9ec;
  --accent: #c5e467;
  --on-accent: #141414;
  --danger: #d9473f;
  /* Tiles take these in turn: background and text. */
  --t1: #ffffff; --on-t1: #141414;
  --t2: #141414; --on-t2: #f6f9ec;
  --t3: #dbe8b2; --on-t3: #141414;
  --t4: #c5e467; --on-t4: #141414;
  --bar: #1c1c1c;
  --chrome: #eef2e3;
  --radius: 26px;
  --font: Manrope, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --safe-top: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
}
[data-scheme="dark"] {
  --bg: #0b0b0b;
  --surface: #171717;
  --text: #f4f4f0;
  --muted: #9a9a94;
  --line: #2b2b2b;
  --field: #202020;
  --ink: #f4f4f0;
  --on-ink: #0b0b0b;
  --accent: #f0de5b;
  --on-accent: #111111;
  --danger: #ff6b5e;
  --t1: #4fd283; --on-t1: #111111;
  --t2: #ee8fc4; --on-t2: #111111;
  --t3: #6197f6; --on-t3: #111111;
  --t4: #f0de5b; --on-t4: #111111;
  --bar: #1d1d1d;
  --chrome: #0b0b0b;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 500 16px/1.35 var(--font); -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
.i { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.i--fill { fill: currentColor; stroke: none; }

.screen { min-height: var(--tg-viewport-stable-height, 100vh); display: flex; flex-direction: column; }
.screen[hidden] { display: none; }
.page { flex: 1; display: flex; flex-direction: column; gap: 12px;
  padding: 4px 14px calc(104px + var(--safe-bottom)); }
.screen:not(:has(.tabbar)) .page { padding-bottom: calc(24px + var(--safe-bottom)); }

/* Header */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px;
  padding: calc(var(--safe-top) + 12px) 14px 10px; background: var(--bg); }
.topbar__text { flex: 1; min-width: 0; }
.topbar__title { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
.topbar__sub { font-size: 14px; color: var(--muted); }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); transition: transform .15s; }
.icon-btn:active { transform: scale(.9); }
.icon-btn--filled { width: 36px; height: 36px; background: var(--ink); color: var(--on-ink); box-shadow: none; }
.icon-btn--filled .i { width: 18px; height: 18px; stroke-width: 2.6; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--accent); color: var(--on-accent); font-weight: 800; }

/* Cards */
.card { background: var(--surface); border-radius: var(--radius); padding: 18px; }
[data-scheme="dark"] .card { box-shadow: inset 0 0 0 1px var(--line); }
.card--accent { background: var(--t2); color: var(--on-t2); }
[data-scheme="dark"] .card--accent { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.hero__label { font-size: 15px; font-weight: 700; }
.hero__value { font-size: 44px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; margin: 6px 0 16px; }
.hero__value small { font-size: 24px; opacity: .6; }
.hero__hint { font-size: 14px; font-weight: 600; opacity: .75; margin-top: 12px; }
.progress { height: 12px; border-radius: 6px; background: color-mix(in srgb, currentColor 18%, transparent); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
[data-scheme="dark"] .card--accent .progress > span, .card:not(.card--accent) .progress > span { background: currentColor; }

.section-title { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; padding: 10px 4px 0; margin-bottom: -2px; }

/* Lists: each row is its own rounded block */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 10px; min-height: 64px;
  border-radius: 22px; background: var(--surface); transition: transform .15s; }
[data-scheme="dark"] .row { box-shadow: inset 0 0 0 1px var(--line); }
.row:active { transform: scale(.98); }
.row__icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--t3); color: var(--on-t3); }
.row:nth-child(3n+2) .row__icon { background: var(--t4); color: var(--on-t4); }
.row:nth-child(3n) .row__icon { background: var(--t2); color: var(--on-t2); }
.row__icon .i { width: 20px; height: 20px; }
.row__body { flex: 1; min-width: 0; }
.row__title { font-weight: 700; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.row__sub { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__end { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.price { color: var(--text); font-weight: 800; font-variant-numeric: tabular-nums; }
.chev { width: 20px; height: 20px; }
.badge { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--ink); color: var(--accent); }
[data-scheme="dark"] .badge { background: var(--accent); color: var(--on-accent); }

/* Segmented control, chips: black pills */
.segmented { display: flex; padding: 4px; border-radius: 999px; background: var(--surface); }
[data-scheme="dark"] .segmented { box-shadow: inset 0 0 0 1px var(--line); }
.segmented > * { flex: 1; height: 40px; border-radius: 999px; font-size: 15px; font-weight: 700; color: var(--muted);
  transition: background .2s, color .2s; }
.segmented > .is-active { background: var(--ink); color: var(--on-ink); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.chip { height: 38px; padding: 0 16px; border-radius: 999px; white-space: nowrap; font-size: 14px; font-weight: 700;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); transition: background .2s, color .2s; }
.chip.is-active { background: var(--ink); color: var(--on-ink); box-shadow: none; }

/* Fields */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 13px; font-weight: 700; color: var(--muted); padding-left: 6px; }
.input { width: 100%; min-height: 50px; padding: 13px 18px; border: 0; border-radius: 18px; background: var(--field);
  font-size: 16px; font-weight: 500; outline: none; resize: none; transition: box-shadow .15s; }
.input::placeholder { color: var(--muted); }
.input:focus { box-shadow: inset 0 0 0 2px var(--ink); }
.search { display: flex; align-items: center; gap: 8px; padding: 0 18px; border-radius: 999px; background: var(--surface);
  color: var(--muted); }
[data-scheme="dark"] .search { box-shadow: inset 0 0 0 1px var(--line); }
.search .input { background: none; padding: 0; min-height: 50px; color: var(--text); box-shadow: none; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; font-weight: 600; }
.switch { appearance: none; -webkit-appearance: none; margin: 0; flex: none; position: relative; cursor: pointer;
  width: 56px; height: 32px; border-radius: 16px; background: var(--field); box-shadow: inset 0 0 0 1px var(--line);
  transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--muted); transition: transform .25s cubic-bezier(.3, .7, .4, 1.3), background .2s; }
.switch:checked { background: var(--accent); box-shadow: none; }
.switch:checked::after { transform: translateX(24px); background: #141414; }

/* Buttons: pills; the main one is ink */
.actions { display: flex; flex-direction: column; gap: 8px; }
.actions__row { display: flex; gap: 8px; }
.actions__row > .btn { flex: 1; min-width: 0; padding: 0 12px; }
.btn { height: 54px; padding: 0 22px; border-radius: 999px; font-size: 16px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  transition: transform .15s, opacity .15s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; }
.btn--primary { background: var(--ink); color: var(--on-ink); }
.btn--secondary { background: var(--accent); color: var(--on-accent); }
.btn--ghost { box-shadow: inset 0 0 0 1.5px var(--line); }
.btn--danger { color: var(--danger); }
.btn--block { width: 100%; }

/* Empty state */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 32px 24px; }
.empty__icon { width: 80px; height: 80px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 6px;
  background: var(--accent); color: var(--on-accent); }
.empty__icon .i { width: 34px; height: 34px; }
.empty__title { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.empty__text { color: var(--muted); font-size: 15px; max-width: 280px; margin-bottom: 8px; }

/* Bottom navigation: a floating dark capsule; the chosen tab opens into a pill with its name */
.tabbar { position: fixed; z-index: 5; left: 14px; right: 14px; bottom: calc(10px + var(--safe-bottom));
  display: flex; gap: 4px; padding: 6px; border-radius: 999px; background: var(--bar); }
.tab { flex: 1; height: 50px; border-radius: 999px; display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 14px; font-weight: 800; color: rgba(255, 255, 255, .6); transition: background .25s, color .25s, flex .25s; }
.tab > span { display: none; }
.tab.is-active { flex: 1.8; background: var(--accent); color: #141414; }
[data-scheme="dark"] .tab.is-active { background: #f4f4f0; }
.tab.is-active > span { display: inline; }
.tab .i { width: 22px; height: 22px; }

/* Tiles: the bento box. Plain tiles take the four tones in turn. */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0;
  background: var(--t1); color: var(--on-t1); }
.grid > .tile:nth-child(4n+2) { background: var(--t2); color: var(--on-t2); }
.grid > .tile:nth-child(4n+3) { background: var(--t3); color: var(--on-t3); }
.grid > .tile:nth-child(4n) { background: var(--t4); color: var(--on-t4); }
.grid > .tile.tile--accent { background: var(--accent); color: var(--on-accent); }
.tile--wide { grid-column: 1 / -1; }
.tile--accent { background: var(--accent); color: var(--on-accent); }
.tile__label { font-size: 14px; font-weight: 700; opacity: .75; }
.tile__value { font-size: 40px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.tile__value small { font-size: 18px; opacity: .6; }
.tile__sub { font-size: 13px; font-weight: 600; opacity: .7; }

/* Ring: --value is 0–100 */
.ring { position: relative; width: 92px; height: 92px; margin: 6px auto 0; display: grid; place-items: center; }
.ring::before { content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(currentColor calc(var(--value, 0) * 1%), color-mix(in srgb, currentColor 16%, transparent) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 13px), #000 calc(100% - 12px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 13px), #000 calc(100% - 12px)); }
.ring > span { position: relative; font-size: 20px; font-weight: 800; }

/* Bars: --value is 0–100 */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding-top: 8px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.bar::before { content: ""; width: 100%; max-width: 30px; height: calc(var(--value, 0) * 0.78%); border-radius: 999px;
  background: color-mix(in srgb, currentColor 18%, transparent); }
.bar.is-active::before { background: currentColor; }
.bar > span { font-size: 11px; font-weight: 700; opacity: .7; }

/* Days */
.days { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.day { flex: 1 0 48px; height: 70px; border-radius: 999px; background: var(--surface); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1px; font-size: 19px; font-weight: 800; transition: background .2s, color .2s; }
[data-scheme="dark"] .day { box-shadow: inset 0 0 0 1px var(--line); }
.day small { font-size: 12px; font-weight: 700; color: var(--muted); }
.day.is-active { background: var(--ink); color: var(--on-ink); box-shadow: none; }
.day.is-active small { color: inherit; opacity: .7; }
.day:disabled { opacity: .35; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 18px; background: var(--surface); border-radius: var(--radius); }
[data-scheme="dark"] .timeline { box-shadow: inset 0 0 0 1px var(--line); }
.step { position: relative; padding: 0 0 18px 32px; }
.step:last-child { padding-bottom: 0; }
.step::before { content: ""; position: absolute; left: 0; top: 2px; width: 18px; height: 18px; border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--line); background: var(--surface); }
.step::after { content: ""; position: absolute; left: 8px; top: 24px; bottom: 2px; width: 2px; border-radius: 1px; background: var(--line); }
.step:last-child::after { display: none; }
.step.is-done::before { background: var(--ink); box-shadow: none; }
.step.is-done::after { background: var(--ink); }
.step.is-now::before { background: var(--accent); box-shadow: inset 0 0 0 2px var(--ink); }
.step__time { font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.step__title { font-weight: 800; }
.step:not(.is-done):not(.is-now) .step__title { color: var(--muted); }
.step__text { font-size: 14px; color: var(--muted); }

/* Picture cards */
.media { position: relative; display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden;
  min-width: 0; background: var(--surface); }
[data-scheme="dark"] .media { box-shadow: inset 0 0 0 1px var(--line); }
.media__img { display: grid; place-items: center; width: 100%; aspect-ratio: 1; object-fit: cover;
  background: var(--t3); color: var(--on-t3); }
.grid > .media:nth-child(2n) .media__img, .rail > .media:nth-child(2n) .media__img { background: var(--t4); color: var(--on-t4); }
.media__img .i { width: 42px; height: 42px; stroke-width: 1.6; }
.media__body { padding: 12px 14px 14px; }
.media__title { font-weight: 800; }
.media__sub { font-size: 14px; font-weight: 600; color: var(--muted); }
.media__tag { position: absolute; top: 12px; left: 12px; font-size: 12px; font-weight: 800; padding: 4px 10px;
  border-radius: 999px; background: var(--ink); color: var(--on-ink); }
.media--cover { background: var(--t2); color: var(--on-t2); box-shadow: none; }
[data-scheme="dark"] .media--cover { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.media--cover .media__img { aspect-ratio: 16 / 10; background: var(--accent); color: var(--on-accent); border-radius: 0 0 var(--radius) var(--radius); }
.media--cover .media__body { padding: 14px 18px 18px; }
.media--cover .media__title { font-size: 22px; letter-spacing: -0.02em; }
.media--cover .media__sub { color: inherit; opacity: .7; }

/* Options: each a rounded block; the chosen one turns accent */
.options { display: flex; flex-direction: column; gap: 8px; }
.option { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  min-height: 62px; padding: 11px 54px 11px 18px; border-radius: 22px; background: var(--surface); text-align: left;
  transition: background .2s, transform .15s; }
[data-scheme="dark"] .option { box-shadow: inset 0 0 0 1px var(--line); }
.option:active { transform: scale(.98); }
.option:disabled { opacity: .4; }
.option.is-active { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.option::after { content: ""; position: absolute; right: 16px; top: 50%; width: 26px; height: 26px; margin-top: -13px;
  border-radius: 50%; box-shadow: inset 0 0 0 2px var(--line); }
.option.is-active::after { background: #141414; box-shadow: inset 0 0 0 7px #141414, inset 0 0 0 26px var(--accent); }
.option__title { font-weight: 800; }
.option__sub { font-size: 14px; font-weight: 600; opacity: .7; }

/* Notice */
.notice { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; border-radius: 22px; font-size: 15px;
  font-weight: 600; background: var(--t3); color: var(--on-t3); }
.notice--danger { background: var(--surface); color: var(--danger); box-shadow: inset 0 0 0 1.5px currentColor; }

/* Stepper */
.qty { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border-radius: 999px; background: var(--field); }
.qty > button { width: 34px; height: 34px; border-radius: 50%; font-size: 19px; font-weight: 800; background: var(--ink);
  color: var(--on-ink); transition: transform .15s; }
.qty > button:active { transform: scale(.88); }
.qty > output { min-width: 24px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }

/* Dock: a floating capsule with the screen's action */
.dock { position: fixed; z-index: 5; left: 14px; right: 14px; bottom: calc(10px + var(--safe-bottom)); display: flex;
  align-items: center; gap: 12px; padding: 6px 6px 6px 22px; border-radius: 999px; background: var(--bar); color: #f4f4f0; }
.dock > .btn { flex: 1; background: var(--accent); color: #141414; }
.dock__info { display: flex; flex-direction: column; }
.dock__label { font-size: 12px; font-weight: 700; opacity: .6; }
.dock__value { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.screen:has(.dock) .page { padding-bottom: calc(100px + var(--safe-bottom)); }

/* Greeting and a picture drawn for the app: .art__tint, .art__fill, .art__line in its SVG */
.intro { display: flex; flex-direction: column; gap: 6px; padding: 8px 4px 4px; }
.intro__title { font-size: 34px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; }
.intro__text { color: var(--muted); font-weight: 600; }
.art { width: 112px; height: 112px; margin-bottom: 4px; }
.art svg { display: block; width: 100%; height: 100%; }
.art__tint { fill: var(--t3); }
.art__fill { fill: var(--accent); }
.art__line { fill: none; stroke: var(--text); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

/* A row that scrolls sideways */
.rail { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  margin: 0 -14px; padding: 0 14px; scroll-padding-left: 14px; }
.rail > * { flex: 0 0 62%; scroll-snap-align: start; }

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

/* app */
.hero__value { font-size: clamp(32px, 10.5vw, 44px); margin-bottom: 6px; }
.hero__hint { margin-top: 6px; }
.spark { display: block; width: 100%; height: 44px; margin: 4px 0 2px; color: currentColor; }
.spark .line { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.spark .area { fill: color-mix(in srgb, currentColor 14%, transparent); stroke: none; }
.tile__value { font-size: clamp(26px, 8.6vw, 40px); }
.row[data-server] { cursor: pointer; }
.topbar .icon-btn[hidden], .notice[hidden] { display: none; }
.empty[hidden] { display: none; }
