/*
 * Приход/Разход - публична страница.
 *
 * Палитрата е същата като на приложението (web/src/index.css): кремава хартия,
 * мастилен текст и три акцента, които имат роли, а не настроения - зелено е
 * приход, тухлено е разход, маслинено е внимание. Човек, който дойде от реклама
 * и влезе в приложението, трябва да види същото място.
 *
 * Шрифтовете се сервират оттук, а не от Google. Две причини: CSP на едж-а
 * допуска font-src 'self' data:, и трета страна в ЕС иска обяснение, което една
 * маркетингова страница не печели нищо да дава.
 */

/* ── Шрифтове ─────────────────────────────────────────────────────────────
 * Inter и JetBrains Mono са променливи шрифтове, затова един файл на подмножество
 * покрива всички дебелини. Кирилицата е първа: текстът на страницата е на
 * български и това е файлът, който браузърът реално ще изтегли.
 */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/inter-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/jetbrainsmono-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/jetbrainsmono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Токени ───────────────────────────────────────────────────────────────
 * Светлата палитра се пише върху гол :root, за да важи и в трите състояния на
 * темата. Тъмната се предефинира два пъти: веднъж за системната настройка и
 * веднъж за изричния избор, за да печели превключвателят и в двете посоки.
 */
:root {
  --bg: #eeece2;
  --panel: #faf9f4;
  --panel-alt: #f2ecd9;
  --panel-green: #e4ecdf;
  --rule: #ddd8c8;
  --rule-firm: #c9c2ac;
  --ink: #1e1c15;
  --muted: #7a7360;
  --faint: #a49d87;

  --forest: #2f6b4a;
  --forest-pale: #dfe9da;
  --olive: #866a20;
  --olive-pale: #f1e6c3;
  --brick: #a53a2c;
  --brick-pale: #f6dcd5;
  --on-accent: #ffffff;

  --shadow-lift: 0 1px 2px rgba(30, 28, 21, 0.06);
  /* Две сенки в тона на хартията: тясна за ръба и широка, мека за височината.
     Светлината идва отгоре и за двете. */
  --shadow-float: 0 1px 2px rgba(30, 28, 21, 0.06), 0 18px 40px -18px rgba(62, 52, 24, 0.28);
  /* Зърното е по-слабо на светло, където и малко шум се вижда. */
  --grain-opacity: 0.05;
  --grain-blend: multiply;

  --sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --gutter: 20px;
  --measure: 66ch;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  /* Скала на слоевете, за да не расте никое число на око. */
  --z-grain: 50;
  --z-skip: 100;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17160f;
    --panel: #201e16;
    --panel-alt: #262319;
    --panel-green: #1c2620;
    --rule: #35321f;
    --rule-firm: #4a4630;
    --ink: #ece8d9;
    --muted: #a09877;
    --faint: #6d6753;

    --forest: #7fbe92;
    --forest-pale: #1e3227;
    --olive: #d2b45e;
    --olive-pale: #332c14;
    --brick: #e08573;
    --brick-pale: #38201a;
    --on-accent: #16150f;

    --shadow-lift: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-float: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 40px -18px rgba(0, 0, 0, 0.7);
    --grain-opacity: 0.035;
    --grain-blend: screen;

    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #17160f;
  --panel: #201e16;
  --panel-alt: #262319;
  --panel-green: #1c2620;
  --rule: #35321f;
  --rule-firm: #4a4630;
  --ink: #ece8d9;
  --muted: #a09877;
  --faint: #6d6753;

  --forest: #7fbe92;
  --forest-pale: #1e3227;
  --olive: #d2b45e;
  --olive-pale: #332c14;
  --brick: #e08573;
  --brick-pale: #38201a;
  --on-accent: #16150f;

  --shadow-lift: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-float: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 40px -18px rgba(0, 0, 0, 0.7);
  --grain-opacity: 0.035;
  --grain-blend: screen;

  color-scheme: dark;
}

/* ── Основа ───────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Зърното е над всичко и не хваща нищо. Без него кремавото изглежда като
   празен екран, а не като хартия. Шумът е SVG в data: адрес, защото CSP
   допуска img-src 'self' data: и нищо външно. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: var(--grain-blend);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img,
svg {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--forest);
  text-underline-offset: 2px;
}

:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: var(--forest-pale);
  color: var(--ink);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--forest);
  color: var(--on-accent);
  padding: 10px 16px;
  z-index: var(--z-skip);
  font-weight: 600;
  border-radius: 0 0 4px 0;
}
.skip:focus {
  left: 0;
}

.wrap {
  max-width: 74rem;
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.narrow {
  max-width: 52rem;
}

/* ── Типографика ──────────────────────────────────────────────────────────── */
h1,
h2,
h3 {
  text-wrap: balance;
  letter-spacing: -0.02em;
  margin: 0;
}

h1 {
  font-size: clamp(2.4rem, 5.8vw, 4.25rem);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.038em;
}

h2 {
  font-size: clamp(1.6rem, 3.6vw, 2.375rem);
  line-height: 1.1;
  font-weight: 650;
  letter-spacing: -0.03em;
}

h3 {
  font-size: 1.0625rem;
  line-height: 1.32;
  font-weight: 600;
  letter-spacing: -0.008em;
}

p {
  margin: 0;
  max-width: var(--measure);
  text-wrap: pretty;
}

/* Етикетът над заглавието е с малки букви и къса черта, а не с главни: главните
   вече са по плочките, таблицата и бейджовете, и тук само биха викали. */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--forest);
  margin: 0;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
  flex: none;
}

.lede {
  font-size: 1.0625rem;
  color: var(--muted);
  max-width: 58ch;
}

.fine {
  font-size: 0.875rem;
  color: var(--muted);
}

.tag {
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 3px;
  background: var(--olive-pale);
  color: var(--olive);
  white-space: nowrap;
}

/* ── Секции ───────────────────────────────────────────────────────────────── */
section {
  border-top: 1px solid var(--rule);
}

/* Долният отстъп е малко по-голям от горния: на око равните изглеждат
   притиснати към следващата линия. */
.section-inner {
  padding-block: clamp(60px, 10vw, 112px) clamp(68px, 11vw, 128px);
  display: flex;
  flex-direction: column;
  gap: clamp(32px, 5vw, 48px);
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Разделена секция: заглавието стои отляво и върви с текста, съдържанието е
   отдясно. Само за секциите, които са текст - таблото и таблицата искат
   цялата ширина. */
.split-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

@media (min-width: 60rem) {
  .split {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 64px;
    align-items: start;
  }
  .split > .section-head {
    position: sticky;
    top: 32px;
  }
}

/* ── Шапка ────────────────────────────────────────────────────────────────── */
.masthead {
  border-bottom: 1px solid var(--rule);
}

.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 14px;
}

.logo {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}
.logo .in {
  color: var(--forest);
}
.logo .out {
  color: var(--brick);
}
.logo .slash {
  color: var(--faint);
  margin-inline: 1px;
}

.masthead nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.masthead nav a {
  font-size: 0.875rem;
  color: var(--muted);
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) left bottom / 0 1px no-repeat;
  padding-bottom: 2px;
  transition: color 200ms ease, background-size 260ms var(--ease-out);
}
.masthead nav a:hover {
  color: var(--ink);
  background-size: 100% 1px;
}

@media (max-width: 52rem) {
  .masthead nav a.hide-sm {
    display: none;
  }
}

.theme-toggle {
  background: transparent;
  border: 1px solid var(--rule-firm);
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 10px;
  line-height: 1;
  transition: color 200ms ease, border-color 200ms ease;
}
.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* ── Герой ────────────────────────────────────────────────────────────────
 * Текстът отляво, сметката отдясно и малко по-ниско - на широк екран двете
 * не стоят на една линия нарочно. Фонът е два меки радиални петна в цветовете
 * на прихода и на вниманието, не линеен градиент.
 */
.hero {
  background:
    radial-gradient(60% 70% at 88% 18%, color-mix(in srgb, var(--forest-pale) 70%, transparent), transparent 70%),
    radial-gradient(40% 50% at 70% 95%, color-mix(in srgb, var(--olive-pale) 55%, transparent), transparent 70%);
}

.hero-inner {
  padding-block: clamp(48px, 9vw, 104px) clamp(56px, 9vw, 112px);
  display: grid;
  gap: 48px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

@media (min-width: 60rem) {
  .hero-inner {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 56px;
    align-items: start;
  }
  .hero .ledger {
    margin-top: 72px;
  }
}

.hero h1 {
  max-width: 13ch;
}

.hero .lede {
  font-size: clamp(1.0625rem, 2.2vw, 1.25rem);
  max-width: 50ch;
  color: var(--muted);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 6px;
  border: 1px solid var(--forest);
  background: var(--forest);
  color: var(--on-accent);
  text-decoration: none;
  min-height: 46px;
  cursor: pointer;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--forest) 60%, black), 0 8px 20px -10px color-mix(in srgb, var(--forest) 80%, transparent);
  transition: transform 200ms var(--ease-out), background-color 200ms ease, box-shadow 200ms ease;
}
.btn:hover {
  background: color-mix(in srgb, var(--forest) 88%, var(--ink));
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--forest) 60%, black);
}

/* Второто действие е връзка, не втори бутон: един бутон на екран казва
   какво се иска, двата се карат за вниманието. */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  padding-block: 10px;
}
.link-arrow span {
  color: var(--forest);
  transition: transform 220ms var(--ease-out);
}
.link-arrow:hover span {
  transform: translateX(4px);
}

/* ── Сметката в героя ──────────────────────────────────────────────────── */
.ledger {
  margin: 0;
  border: 1px solid var(--rule-firm);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow-float);
  overflow: hidden;
}

.ledger-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  /* Голям минимален отстъп, за да не се слеят двете в един ред на телефон,
     където мястото свършва точно между тях. */
  gap: 6px 24px;
  flex-wrap: wrap;
  padding: 10px 18px;
  background: var(--panel-alt);
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.ledger-rows {
  margin: 0;
  padding: 8px 18px 4px;
}

.ledger-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-block: 12px;
}
.ledger-row + .ledger-row {
  border-top: 1px dashed var(--rule);
}

.ledger-row dt {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.9375rem;
  font-weight: 600;
  min-width: 0;
}

.ledger-note {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--faint);
}

.ledger-row dd {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(1rem, 2.6vw, 1.1875rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

/* Чертата под сметката: двойна, както се подвежда сбор на хартия. */
.ledger-row.ledger-total {
  border-top: 3px double var(--rule-firm);
}
.ledger-total dd {
  font-size: clamp(1.375rem, 3.6vw, 1.75rem);
}

.ledger-split {
  display: flex;
  height: 6px;
  margin: 4px 18px 0;
  border-radius: 999px;
  overflow: hidden;
  gap: 2px;
}
.ledger-split i {
  display: block;
  height: 100%;
}
/* 11 260,50 от 18 400,00 = 61,2%, остатъкът е маржът. */
.split-out {
  width: 61.2%;
  background: var(--brick);
}
.split-net {
  flex: 1;
  background: var(--forest);
}

.ledger .caption {
  padding: 12px 18px 14px;
}

.v-in {
  color: var(--forest);
}
.v-out {
  color: var(--brick);
}
.v-net {
  color: var(--ink);
}

.caption {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  color: var(--faint);
  margin: 0;
}

/* ── Вертикали ────────────────────────────────────────────────────────────── */
/* Браншовете са списък с линии и номер, като редове в тетрадка, а не облак
   от хапчета. */
.trades {
  list-style: none;
  counter-reset: trade;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  column-gap: 32px;
  border-top: 1px solid var(--rule-firm);
}

.trades li {
  counter-increment: trade;
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-size: 1rem;
  font-weight: 500;
  padding-block: 13px;
  border-bottom: 1px solid var(--rule);
}
.trades li::before {
  content: counter(trade, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

/* ── Мрежи ────────────────────────────────────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: 30px 44px;
}

.col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.col p {
  color: var(--muted);
  font-size: 0.9375rem;
}

/* Проблемите са три реда един под друг, с номер отляво в цвета на разхода.
   Подредени така, четат се като списък с оплаквания, а не като три рекламни
   карти. */
.problems {
  counter-reset: problem;
  gap: 0;
}

.problem {
  counter-increment: problem;
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  column-gap: 8px;
  row-gap: 8px;
  padding-block: 22px 26px;
  border-top: 1px solid var(--rule-firm);
}
.problem:last-child {
  border-bottom: 1px solid var(--rule-firm);
}
.problem::before {
  content: counter(problem, decimal-leading-zero);
  grid-row: span 2;
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--brick);
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}
.problem h3 {
  font-size: 1.1875rem;
}
.problem p {
  font-size: 1rem;
}

/* ── Стъпки ───────────────────────────────────────────────────────────────── */
/* Стъпките са вертикална линия с голяма цифра на всяка спирка. Линията
   свършва на последната стъпка, защото после няма стъпки - само въвеждане. */
.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0;
  gap: 0;
}

.steps li {
  counter-increment: step;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 0 0 36px 64px;
}
.steps li:last-child {
  padding-bottom: 0;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -4px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--forest-pale);
  border: 1px solid color-mix(in srgb, var(--forest) 30%, transparent);
  font-family: var(--mono);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--forest);
}
.steps li::after {
  content: "";
  position: absolute;
  left: 20px;
  top: 44px;
  bottom: 4px;
  width: 1px;
  background: linear-gradient(var(--forest), transparent);
  opacity: 0.4;
}
.steps li:last-child::after {
  display: none;
}

.steps li h3 {
  font-size: 1.1875rem;
}

.steps li p {
  color: var(--muted);
  font-size: 1rem;
}

/* ── Възможности ──────────────────────────────────────────────────────────── */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
}

.feature {
  background: var(--panel);
  padding: 26px 26px 30px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  transition: background-color 240ms ease;
}
.feature:hover {
  background: color-mix(in srgb, var(--panel) 70%, var(--panel-alt));
}

/* На широк екран шестте не са шест еднакви кутии: широка и тясна се редуват
   на зиг-заг, и широките носят по-едро заглавие. */
@media (min-width: 64rem) {
  .features {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .feature:nth-child(1),
  .feature:nth-child(4),
  .feature:nth-child(5) {
    grid-column: span 2;
  }
  .feature:nth-child(1) h3,
  .feature:nth-child(4) h3,
  .feature:nth-child(5) h3 {
    font-size: 1.375rem;
    letter-spacing: -0.02em;
    max-width: 24ch;
  }
  .feature:nth-child(1) p,
  .feature:nth-child(4) p,
  .feature:nth-child(5) p {
    font-size: 1rem;
    max-width: 52ch;
  }
}

.feature .mark {
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--forest);
}

.feature p {
  color: var(--muted);
  font-size: 0.9375rem;
}

/* ── Таблото на приложението, пресъздадено ───────────────────────────────
 * Следва web/src/features/dashboard/DashboardPage.tsx: трите бързи действия,
 * месецът в зелен панел със стрелки и три блока, и движенията през месеца в
 * една таблица.
 */
/* Приложението е изцяло в JetBrains Mono (web/src/index.css), затова и
   копието му тук, а не в Inter като останалата страница. */
.screen {
  border: 1px solid var(--rule-firm);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
  box-shadow: var(--shadow-float);
  font-family: var(--mono);
}

.screen-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  background: var(--panel-alt);
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  color: var(--faint);
}

.screen-title {
  margin-left: 6px;
}

.screen-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rule-firm);
  flex: none;
}

.screen-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Бързи действия: кръгла значка и надпис, подсказката под него. На телефон
   значката е над надписа и подсказката пада, точно както в приложението. */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.qa {
  border: 2px solid var(--rule);
  border-radius: 8px;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 0;
}
.qa-in {
  border-color: color-mix(in srgb, var(--forest) 30%, transparent);
  background: var(--forest-pale);
}
.qa-out {
  border-color: color-mix(in srgb, var(--brick) 30%, transparent);
  background: var(--brick-pale);
}
.qa-job {
  border-color: color-mix(in srgb, var(--olive) 30%, transparent);
  background: var(--olive-pale);
}

.qa-glyph {
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--on-accent);
  flex: none;
}
.qa-in .qa-glyph {
  background: var(--forest);
}
.qa-out .qa-glyph {
  background: var(--brick);
}
.qa-job .qa-glyph {
  background: var(--olive);
}

.qa-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.qa-label {
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.25;
}
.qa-in .qa-label {
  color: var(--forest);
}
.qa-out .qa-label {
  color: var(--brick);
}
.qa-job .qa-label {
  color: var(--olive);
}

.qa-hint {
  font-size: 0.6875rem;
  color: var(--muted);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 40rem) {
  .qa {
    flex-direction: column;
    gap: 6px;
    padding: 10px 6px;
    text-align: center;
  }
  .qa-hint {
    display: none;
  }
}

/* Месецът */
.month {
  background: var(--panel-green);
  border: 1px solid var(--rule-firm);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.step {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--rule-firm);
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1;
  flex: none;
}
/* Следващият месец още не е дошъл, затова стрелката напред е угаснала. */
.step-off {
  color: var(--faint);
  opacity: 0.5;
}

.step-label {
  min-width: 10rem;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
}

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

.block {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.block-title {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.block-total {
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  margin-top: 2px;
}
.block-total small {
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
  margin-left: 4px;
}

.block-lines {
  list-style: none;
  margin: 10px 0 0;
  padding: 8px 0 0;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.block-lines li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.75rem;
}
.block-lines li span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}
.block-lines li span:first-child b {
  color: var(--ink);
  font-weight: 600;
}
.block-lines li span:last-child {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex: none;
}
.block-lines .line-sub {
  padding-left: 10px;
  font-size: 0.6875rem;
}
.block-lines .line-sub span {
  color: var(--brick) !important;
}

/* Движенията */
.moves {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
}

.moves-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
}

.moves-title {
  font-size: 0.8125rem;
  font-weight: 600;
}
.moves-title small {
  font-size: 0.6875rem;
  font-weight: 400;
  color: var(--muted);
  margin-left: 8px;
}

.moves-filter {
  display: flex;
  gap: 6px;
}

.mf {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 4px 10px;
  border: 1px solid var(--rule-firm);
  border-radius: 6px;
  color: var(--muted);
}
.mf-on {
  border-color: var(--forest);
  background: var(--forest-pale);
  color: var(--forest);
}

/* Таблицата свършва в мъгла: записите са четиринайсет, показани са шест. */
.moves-scroll {
  -webkit-mask-image: linear-gradient(black 70%, transparent);
  mask-image: linear-gradient(black 70%, transparent);
}

.moves-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  font-size: 0.75rem;
  background: transparent;
}

.moves-table th,
.moves-table td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: baseline;
  white-space: nowrap;
}

.moves-table thead th {
  font-family: var(--mono);
  font-size: 0.5625rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--muted);
  background: transparent;
}

.moves-table .num {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

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

/* Телефон: блоковете един под друг, а таблицата пуска категорията и
   контрагента, за да останат дата, сума, обект и основание. */
@media (max-width: 52rem) {
  .blocks {
    grid-template-columns: 1fr;
  }
  .moves-table .opt {
    display: none;
  }
}

/* Най-тесният екран: всеки ред става карта, както в приложението. Основанието
   и сумата горе, датата, обектът и категорията на ред под тях. */
@media (max-width: 40rem) {
  .moves-table thead {
    display: none;
  }
  .moves-table,
  .moves-table tbody {
    display: block;
  }
  .moves-table tr {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--rule);
  }
  .moves-table td {
    display: block;
    padding: 0;
    border: 0;
  }
  .moves-table td:nth-child(4) {
    order: 1;
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
    font-size: 0.8125rem;
  }
  .moves-table td.num {
    order: 2;
    font-size: 0.8125rem;
  }
  .moves-table td:nth-child(1),
  .moves-table td:nth-child(3),
  .moves-table td:nth-child(5) {
    order: 3;
    font-size: 0.6875rem;
    color: var(--muted);
    margin-top: 2px;
  }
  .moves-table td:nth-child(1) {
    flex-basis: auto;
    margin-left: 0;
  }
  .moves-table td:nth-child(1)::after,
  .moves-table td:nth-child(3)::after {
    content: " ·";
  }
  .moves-table td:nth-child(3),
  .moves-table td:nth-child(5) {
    margin-left: -6px;
  }
  .moves-table td:nth-child(5) {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1 1 0;
  }
  /* Редът прекъсва след сумата: празен елемент на цяла ширина между двата. */
  .moves-table tr::after {
    content: "";
    order: 2;
    flex-basis: 100%;
  }
}

/* ── Таблица ──────────────────────────────────────────────────────────────── */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 6px;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 40rem;
  font-size: 0.9375rem;
  background: var(--panel);
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 13px 16px;
  border-bottom: 1px solid var(--rule);
}

thead th {
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--panel-alt);
  white-space: nowrap;
}

tbody th {
  font-weight: 600;
  font-size: 0.9375rem;
  white-space: nowrap;
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

td.yes {
  color: var(--forest);
}
td.no {
  color: var(--muted);
}

.cell-mark {
  font-family: var(--mono);
  font-weight: 700;
  margin-right: 7px;
}

/* ── Списъци ──────────────────────────────────────────────────────────────── */
.ticks {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ticks li {
  position: relative;
  padding-left: 24px;
  font-size: 0.9375rem;
  max-width: var(--measure);
}

.ticks li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--forest);
  font-weight: 700;
  font-size: 0.875rem;
}

.ticks.crosses li::before {
  content: "\00D7";
  color: var(--brick);
  font-size: 1rem;
  top: -2px;
}

.ticks strong {
  font-weight: 600;
}

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

/* ── Пилот ────────────────────────────────────────────────────────────────── */
.pilot {
  background: var(--panel);
}

.pilot-card {
  border: 1px solid var(--rule-firm);
  border-left: 3px solid var(--forest);
  border-radius: 0 10px 10px 0;
  box-shadow: var(--shadow-float);
  padding: clamp(22px, 4vw, 34px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: var(--bg);
}

.pilot-card .lede {
  color: var(--ink);
}

.pilot-terms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 18px 30px;
  padding-top: 4px;
}

.term {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.term dt {
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--forest);
}

.term dd {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--muted);
}

/* ── Въпроси ──────────────────────────────────────────────────────────────── */
.faq {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--rule);
  max-width: 54rem;
}

details {
  border-bottom: 1px solid var(--rule);
}

summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding-block: 17px;
  font-weight: 500;
  font-size: 1.0625rem;
  transition: color 200ms ease;
}
summary:hover {
  color: var(--forest);
}

summary::-webkit-details-marker {
  display: none;
}

summary::before {
  content: "+";
  font-family: var(--mono);
  font-weight: 700;
  color: var(--forest);
  flex: none;
  font-size: 1rem;
  line-height: 1;
}

details[open] summary::before {
  content: "\2013";
}

details[open] summary {
  color: var(--ink);
}

details .answer {
  padding: 0 0 18px 24px;
}

details .answer p {
  color: var(--muted);
  font-size: 0.9375rem;
}

details .answer p + p {
  margin-top: 10px;
}

/* ── Подвал ───────────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--rule);
  background: var(--panel);
}

.footer-inner {
  padding-block: 34px 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px 40px;
  justify-content: space-between;
  align-items: flex-start;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.footer-note {
  font-size: 0.8125rem;
  color: var(--muted);
  max-width: 40ch;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-size: 0.875rem;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 200ms ease;
}
.footer-links a:hover {
  color: var(--ink);
}

.colophon {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  color: var(--faint);
  padding-bottom: 30px;
}

/* ── Движение ──────────────────────────────────────────────────────────────
 * Само за хора, които не са поискали покой. Героят влиза на стъпала при
 * зареждане. Останалото се показва при скрол, но само в браузъри, които могат
 * да вържат анимация към скрола без скрипт - другите просто показват всичко,
 * без да чакат нещо, което няма да дойде.
 */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-copy > *,
  .hero .ledger {
    animation: rise 700ms var(--ease-out) both;
  }
  .hero-copy > :nth-child(2) {
    animation-delay: 70ms;
  }
  .hero-copy > :nth-child(3) {
    animation-delay: 140ms;
  }
  .hero-copy > :nth-child(4) {
    animation-delay: 210ms;
  }
  .hero .ledger {
    animation-delay: 300ms;
    animation-duration: 900ms;
  }

  @supports (animation-timeline: view()) {
    .section-head,
    .split-body > *,
    .feature,
    .screen,
    .table-scroll,
    .pilot-card {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 35%;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Видимо само за екранни четци и за краулерите - <caption> на таблицата. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
