/* Минимализм in the manner of Apple and Linear: black, white and greys, hairlines instead of
   fills and shadows, tight confident type, numbers that line up, quick quiet motion. */

:root {
  --bg: #ffffff;
  --surface: #fafafa;
  --raised: #ffffff;
  --text: #0a0a0a;
  --muted: #737373;
  --faint: #a3a3a3;
  --line: #e5e5e5;
  --line-strong: #d4d4d4;
  --ink: #0a0a0a;
  --on-ink: #ffffff;
  --accent: #4f5bd5;
  --danger: #dc2626;
  --press: rgba(0, 0, 0, 0.04);
  --chrome: #ffffff;
  --radius: 10px;
  --font: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, 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: #0a0a0a;
  --surface: #111111;
  --raised: #161616;
  --text: #ededed;
  --muted: #a1a1a1;
  --faint: #6b6b6b;
  --line: #222222;
  --line-strong: #333333;
  --ink: #ededed;
  --on-ink: #0a0a0a;
  --accent: #8b93f8;
  --danger: #f87171;
  --press: rgba(255, 255, 255, 0.05);
  --chrome: #0a0a0a;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 15px/1.45 var(--font); letter-spacing: -0.006em; -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
  font-feature-settings: "cv11", "ss01";
}
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5;
  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: 14px;
  padding: 8px 20px calc(84px + 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) + 14px) 20px 12px; background: var(--bg); }
.topbar__text { flex: 1; min-width: 0; }
.topbar__title { font-size: 24px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; }
.topbar__sub { font-size: 13px; color: var(--muted); }
.icon-btn { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; flex: none;
  color: var(--muted); border: 1px solid var(--line); transition: background .12s, color .12s; }
.icon-btn:active { background: var(--press); color: var(--text); }
.icon-btn--filled { width: 30px; height: 30px; border-radius: 7px; border-color: var(--line-strong); color: var(--text); }
.icon-btn--filled .i { width: 16px; height: 16px; stroke-width: 2; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; }

/* Cards: a hairline, no shadow; the main card is inverted */
.card { background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card--accent { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.hero__label { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; opacity: .6; }
.hero__value { font-size: 44px; font-weight: 600; letter-spacing: -0.045em; line-height: 1.1; margin: 6px 0 16px;
  font-variant-numeric: tabular-nums; }
.hero__value small { font-size: 22px; font-weight: 500; opacity: .5; }
.hero__hint { font-size: 13px; opacity: .6; margin-top: 10px; }
.progress { height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.card--accent .progress { background: color-mix(in srgb, var(--on-ink) 18%, transparent); }
.progress > span { display: block; height: 100%; background: currentColor; }

.section-title { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); padding-top: 14px; margin-bottom: -4px; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--raised); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; transition: background .12s; }
.row + .row { border-top: 1px solid var(--line); }
.row:active { background: var(--press); }
.row__icon { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; flex: none;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.row__icon .i { width: 18px; height: 18px; }
.row__body { flex: 1; min-width: 0; }
.row__title { font-weight: 500; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.row__sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__end { display: flex; align-items: center; gap: 10px; color: var(--faint); }
.price { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.chev { width: 16px; height: 16px; }
.badge { font-size: 11px; font-weight: 500; padding: 0 6px; line-height: 18px; border-radius: 5px;
  color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); }

/* Segmented control, chips */
.segmented { display: flex; padding: 3px; gap: 3px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line); }
.segmented > * { flex: 1; height: 30px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--muted);
  transition: background .12s, color .12s; }
.segmented > .is-active { background: var(--raised); color: var(--text); box-shadow: 0 0 0 1px var(--line-strong), 0 1px 2px rgba(0, 0, 0, .06); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chip { height: 30px; padding: 0 12px; border-radius: 8px; white-space: nowrap; font-size: 13px; font-weight: 500;
  color: var(--muted); border: 1px solid var(--line); transition: background .12s, color .12s, border-color .12s; }
.chip.is-active { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }

/* Fields */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 13px; font-weight: 500; }
.input { width: 100%; min-height: 40px; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--bg); font-size: 16px; outline: none; resize: none; transition: border-color .12s, box-shadow .12s; }
.input::placeholder { color: var(--faint); }
.input:focus { border-color: var(--text); box-shadow: 0 0 0 3px var(--press); }
.search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--faint); }
.search .i { width: 16px; height: 16px; }
.search .input { border: 0; background: none; padding: 0; min-height: 40px; box-shadow: none; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 28px; font-weight: 500; }
.switch { appearance: none; -webkit-appearance: none; margin: 0; flex: none; position: relative; cursor: pointer;
  width: 38px; height: 22px; border-radius: 11px; background: var(--line-strong); transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .15s ease-out; }
.switch:checked { background: var(--ink); }
.switch:checked::after { transform: translateX(16px); background: var(--on-ink); }

/* Buttons */
.actions { display: flex; flex-direction: column; gap: 8px; }
.actions__row { display: flex; gap: 8px; }
.actions__row > .btn { flex: 1; }
.btn { height: 44px; padding: 0 16px; border-radius: 8px; font-size: 15px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  transition: opacity .12s, background .12s; }
.btn:active { opacity: .8; }
.btn:disabled { opacity: .4; }
.btn--primary { background: var(--ink); color: var(--on-ink); }
.btn--secondary { border: 1px solid var(--line-strong); background: var(--raised); }
.btn--secondary:active, .btn--ghost:active { background: var(--press); opacity: 1; }
.btn--ghost { color: var(--muted); }
.btn--danger { color: var(--danger); }
.btn--block { width: 100%; }

/* Empty state: a dashed outline where the content will be */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 32px 24px;
  border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty__icon { color: var(--faint); margin-bottom: 6px; }
.empty__icon .i { width: 28px; height: 28px; stroke-width: 1.3; }
.empty__title { font-size: 15px; font-weight: 600; }
.empty__text { color: var(--muted); font-size: 13px; max-width: 260px; margin-bottom: 10px; }

/* Bottom navigation */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex;
  padding: 8px 12px calc(8px + var(--safe-bottom)); border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 500;
  color: var(--faint); padding: 4px 0; transition: color .12s; }
.tab.is-active { color: var(--text); }
.tab .i { width: 22px; height: 22px; }

/* Tiles: hairline boxes; the accent one is inverted like the main card */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
  display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tile--wide { grid-column: 1 / -1; }
.tile--accent { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.tile__label { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.tile--accent .tile__label, .tile--accent .tile__sub { color: inherit; opacity: .6; }
.tile__value { font-size: 30px; font-weight: 600; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.tile__value small { font-size: 16px; font-weight: 500; opacity: .5; }
.tile__sub { font-size: 12px; color: var(--muted); }

/* Ring: --value is 0–100, a thin line */
.ring { --track: var(--line); position: relative; width: 84px; height: 84px; margin: 8px auto 0;
  display: grid; place-items: center; color: var(--ink); }
.ring::before { content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(currentColor calc(var(--value, 0) * 1%), var(--track) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px)); }
.ring > span { position: relative; font-size: 18px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.tile--accent .ring { color: var(--on-ink); --track: color-mix(in srgb, var(--on-ink) 20%, transparent); }

/* Bars: --value is 0–100 */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 110px; 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%; height: calc(var(--value, 0) * 0.8%); border-radius: 3px; background: var(--line-strong); }
.bar.is-active::before { background: var(--ink); }
.bar > span { font-size: 11px; font-weight: 500; color: var(--faint); }
.bar.is-active > span { color: var(--text); }

/* Days */
.days { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.day { flex: 1 0 46px; height: 60px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--raised); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; transition: background .12s; }
.day small { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.day.is-active { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.day.is-active small { color: inherit; opacity: .6; }
.day:disabled { color: var(--faint); background: none; border-style: dashed; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 4px 0 0 2px; }
.step { position: relative; padding: 0 0 18px 26px; }
.step:last-child { padding-bottom: 0; }
.step::before { content: ""; position: absolute; left: 0; top: 6px; width: 9px; height: 9px; border-radius: 50%;
  border: 1.5px solid var(--line-strong); background: var(--bg); z-index: 1; }
.step::after { content: ""; position: absolute; left: 4px; top: 6px; bottom: -6px; width: 1px; background: var(--line); }
.step:last-child::after { display: none; }
.step.is-done::before { background: var(--ink); border-color: var(--ink); }
.step.is-now::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px var(--accent); }
.step__time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.step__title { font-weight: 500; }
.step:not(.is-done):not(.is-now) .step__title { color: var(--muted); }
.step__text { font-size: 13px; color: var(--muted); }

/* Picture cards */
.media { position: relative; display: flex; flex-direction: column; min-width: 0; }
.media__img { display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--faint); }
.media__img .i { width: 32px; height: 32px; stroke-width: 1.2; }
.media__body { padding: 8px 2px 0; }
.media__title { font-weight: 500; }
.media__sub { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.media__tag { position: absolute; top: 8px; left: 8px; font-size: 11px; font-weight: 500; padding: 0 6px;
  line-height: 20px; border-radius: 5px; background: var(--raised); color: var(--text); border: 1px solid var(--line); }
.media--cover .media__img { aspect-ratio: 16 / 10; }
.media--cover .media__body { padding-top: 10px; }
.media--cover .media__title { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }

/* Options: one of a few */
.options { display: flex; flex-direction: column; gap: 6px; }
.option { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 12px 44px 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--raised);
  text-align: left; transition: border-color .12s; }
.option:disabled { color: var(--faint); background: none; border-style: dashed; }
.option.is-active { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.option::after { content: ""; position: absolute; right: 14px; top: 50%; width: 16px; height: 16px; margin-top: -8px;
  border-radius: 50%; border: 1px solid var(--line-strong); }
.option.is-active::after { border: 5px solid var(--ink); }
.option__title { font-weight: 500; }
.option__sub { font-size: 13px; color: var(--muted); }
.option:disabled .option__sub { color: inherit; }

/* Notice */
.notice { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface); font-size: 14px; }
.notice > .i { width: 18px; height: 18px; margin-top: 1px; color: var(--muted); }
.notice--danger { border-color: color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger); }
.notice--danger > .i { color: inherit; }

/* Stepper */
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 8px; }
.qty > button { width: 32px; height: 32px; font-size: 17px; color: var(--muted); }
.qty > button:active { color: var(--text); }
.qty > output { min-width: 20px; text-align: center; font-weight: 500; font-variant-numeric: tabular-nums; }

/* Dock: the screen's action, on a hairline */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 16px;
  padding: 12px 16px calc(12px + var(--safe-bottom)); background: var(--bg); border-top: 1px solid var(--line); }
.dock > .btn { flex: 1; }
.dock__info { display: flex; flex-direction: column; }
.dock__label { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.dock__value { font-size: 20px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.screen:has(.dock) .page { padding-bottom: calc(92px + 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 2px 4px; }
.intro__title { font-size: 32px; font-weight: 600; letter-spacing: -0.045em; line-height: 1.1; }
.intro__text { color: var(--muted); }
.art { width: 112px; height: 112px; margin-bottom: 4px; }
.art svg { display: block; width: 100%; height: 100%; }
.art__tint { fill: var(--surface); }
.art__fill { fill: var(--line-strong); }
.art__line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

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

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

/* app */
:root {
  --accent: #d92d20;
  --accent-ink: #ffffff;
}
[data-scheme="dark"] {
  --accent: #ff7b72;
  --accent-ink: #1a0a08;
}

/* The red mark: one primary button, badges, the active tab and a thin edge on the
   main cards. Everything else stays black, white and grey. */
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.tab.is-active .i { color: var(--accent); }
.row__icon--star { color: var(--accent); }
.badge--solid { background: var(--ink); color: var(--on-ink); box-shadow: none; }
.badge--muted { color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-strong); }

.card--accent,
.summary { position: relative; overflow: hidden; }
.card--accent::before,
.summary::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
}

/* The chosen package: a star, two lines and the price. */
.summary { display: flex; align-items: center; gap: 12px; }
.summary__icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--accent);
}
.summary__icon .i { width: 22px; height: 22px; }
.summary__body { flex: 1; min-width: 0; }
.summary__title { font-size: 20px; font-weight: 600; letter-spacing: -0.03em; }
.summary__sub { font-size: 13px; color: var(--muted); }
.summary__price {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.field__hint { font-size: 12px; color: var(--muted); }

.kv {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  font-size: 14px;
}
.kv + .kv { border-top: 1px solid var(--line); }
.kv > span:first-child { color: var(--muted); flex: none; }
.kv > span:last-child { font-weight: 500; text-align: right; overflow-wrap: anywhere; }

.empty .btn { min-width: 190px; }
