/* Главная на один экран (этап 2, блок H). */
.home-screen { max-width: 1160px; margin: 0 auto; }
.home-quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.home-quick .button { min-height: 44px; padding: 10px 16px; font-size: .875rem; }
.home-quick .icon { width: 18px; height: 18px; }

/* Six answers: on a phone blocks 2 and 3 share a row, the rest take the full width. */
.home-answers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; }
.home-wide { grid-column: 1 / -1; }
.home-answer { position: relative; min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); overflow-wrap: anywhere; }
.home-answer p { margin: 0; }
.home-head { margin: 0 0 4px; color: var(--secondary); font-size: .75rem; font-weight: 650; line-height: 1.35; letter-spacing: .04em; text-transform: uppercase; }
.home-head-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; margin-bottom: 4px; }
.home-head-row .home-head { margin: 0; }
.home-head-row a { margin-left: auto; font-size: .8125rem; font-weight: 600; }
/* Small links get a 44 px tall target; the equal negative margin keeps the layout where it was. */
.home-head-row a:not(.home-link), .home-note a { position: relative; z-index: 1; padding: 14px 0; margin: -14px 0; }
.home-go { display: flex; justify-content: space-between; gap: 8px; }
.home-go::after { content: "→"; content: "→" / ""; color: var(--ink); font-size: .9375rem; letter-spacing: 0; text-transform: none; }

/* The whole card opens its page; buttons and links inside stay on top of it. */
.home-link { color: inherit; }
.home-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
@supports selector(:has(*)) {
  .home-link:focus-visible { outline: none; box-shadow: none; }
  .home-answer:has(.home-link:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }
  .home-answer:has(.home-link):hover { border-color: #999; }
}
.home-over, .home-answer .button, .home-row, .home-task a { position: relative; z-index: 1; }

.home-amounts { display: flex; flex-wrap: wrap; gap: 0 8px; }
.home-amount { font-size: .875rem; font-weight: 550; line-height: 1.35; font-variant-numeric: tabular-nums lining-nums; }
.home-amount strong { font-size: 1.1875rem; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.home-amount .home-unknown { font-size: 1rem; letter-spacing: 0; white-space: normal; }
/* The dot between two sums ends the first line, never opens the second; a partly known currency takes its own line. */
.home-amounts .home-amount.is-known:has(+ .home-amount.is-known)::after { content: "·"; content: "·" / ""; margin-left: 8px; color: var(--secondary); }
.home-amounts .home-amount.is-partial { flex-basis: 100%; }
.home-answer .home-note { margin-top: 2px; color: var(--secondary); font-size: .8125rem; line-height: 1.4; }
.home-note a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.home-empty { font-size: .9375rem; font-weight: 600; line-height: 1.4; }
.home-answer .button.home-over { min-height: 44px; margin-top: 8px; }

/* «На сегодня»: who, when, how much and the one button to record it. */
.home-task { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main button" "amount button"; align-items: center; column-gap: 12px; padding: 4px 0; border-top: 1px solid var(--line); }
.home-head-row + .home-task { padding-top: 0; border-top: 0; }
.home-task-main { grid-area: main; font-size: .9375rem; line-height: 1.35; }
.home-task-main a { display: inline-block; min-width: 44px; min-height: 44px; padding: 12px 0; margin: -12px 0; font-weight: 650; }
.home-due { color: var(--secondary); font-size: .8125rem; white-space: nowrap; }
.home-due.is-overdue { color: var(--red); font-weight: 600; }
.home-task-amount { grid-area: amount; font-size: .875rem; line-height: 1.35; font-variant-numeric: tabular-nums lining-nums; }
.home-task-amount strong { font-weight: 650; white-space: nowrap; }
.home-task .button { grid-area: button; min-height: 44px; padding: 8px 14px; font-size: .875rem; }

/* «Не закончено» and «Не разобрано»: one line each, the whole line is the link. */
.home-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 4px 0; border-top: 1px solid var(--line); color: var(--ink); font-size: .875rem; font-weight: 550; line-height: 1.35; }
.home-head + .home-row { border-top: 0; }
.home-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; margin-left: 6px; padding: 0 7px; border-radius: 11px; background: var(--accent); color: var(--ink); font-size: .75rem; letter-spacing: 0; vertical-align: 1px; }
.home-more { display: flex; flex-wrap: wrap; gap: 0 24px; margin: 0 0 8px; }
.home-more a { display: inline-flex; align-items: center; min-height: 44px; font-size: .875rem; font-weight: 600; }

/* On a phone «Мне должны» and «Я должен» are half wide: a long sum gets a smaller font, and past that it breaks
   between digit groups; the indent shows the second line continues the same number. */
@media (max-width: 1000px) {
  .home-answer:not(.home-wide) .home-amount { padding-left: .75em; text-indent: -.75em; text-wrap: wrap; }
  .home-answer:not(.home-wide) .home-amount strong { font-size: clamp(1rem, 4.6vw, 1.1875rem); white-space: normal; }
  /* A sum of 12–13 digits stays one number: a smaller type instead of a break between its digit groups. */
  .home-answer:not(.home-wide) .home-amount strong.home-long { font-size: clamp(.8125rem, 3.9vw, 1rem); white-space: nowrap; }
}
/* A computer: answers 1–4 in a 2×2 grid, «На сегодня» and «Не закончено» side by side below. */
@media (min-width: 1001px) {
  .home-answers { gap: 16px; margin-bottom: 16px; }
  .home-wide { grid-column: auto; }
  .home-answer { padding: 18px 22px; }
  .home-head { font-size: .8125rem; }
  .home-amount { font-size: .9375rem; }
  .home-amount strong { font-size: 1.5rem; }
}
/* Баннер «Первого дня»: одна-две строки на каждое «не указано», вся строка ведёт к короткой форме. */
.everyday-start.everyday-missing { display: grid; padding: 4px 14px; }
.everyday-missing-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 12px; min-height: 44px; padding: 8px 0; color: var(--ink); font-size: .9375rem; line-height: 1.35; }
.everyday-missing-row + .everyday-missing-row { border-top: 1px solid var(--line); }
.everyday-missing-row span { margin-left: auto; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.everyday-missing .everyday-missing-row, .everyday-missing-row:hover { text-decoration: none; }
/* «указать» в «Деньги сейчас» стоит над ссылкой карточки, цель — 44 px. */
.home-say { display: inline-block; min-width: 44px; padding: 13px 0; margin: -13px 0; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* «Кто мне должен» и «Кому я должен» (из карточек главной): человек и его сумма, под ней каждый долг со своей кнопкой. */
.debts-page { max-width: 760px; }
.debts-page .page-head { margin-bottom: 12px; }
.debts-page h1 { margin-bottom: 4px; }
.debts-totals { margin: 0; color: var(--secondary); font-size: .9375rem; font-variant-numeric: tabular-nums lining-nums; }
.debts-totals strong { color: var(--ink); white-space: nowrap; }
.debts-list { padding-top: 4px; padding-bottom: 4px; }
.debts-currency { margin: 12px 0 0; color: var(--secondary); font-size: .8125rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.debt-person { padding: 8px 0; border-top: 1px solid var(--line); }
.debts-currency + .debt-person, .debts-list > .debt-person:first-child { border-top: 0; }
.debt-person-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 12px; }
.debt-person-name { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; font-size: 1.0625rem; font-weight: 650; }
.debt-person-amount { margin-left: auto; font-size: .9375rem; font-variant-numeric: tabular-nums lining-nums; }
.debt-person-amount strong { font-size: 1.1875rem; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.debt-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 2px 0; }
.debt-what { color: var(--secondary); font-size: .875rem; line-height: 1.4; }
.debt-what strong { color: var(--ink); font-weight: 650; white-space: nowrap; }
.debt-line .button { min-height: 44px; padding: 8px 14px; font-size: .875rem; }
/* «Люди и компании»: остаток назван под именем, раньше реквизитов. */
.list-row small.party-debt { color: var(--ink); font-weight: 600; }

/* «Деньги»: счёт — одна строка, подпись слева, остаток справа; под движениями — ссылка на все. */
.account-list { padding-top: 4px; padding-bottom: 4px; }
.account-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 12px; min-height: 48px; padding: 6px 0; border-bottom: 1px solid var(--line); color: var(--ink); font-size: .9375rem; }
.account-row:last-child { border-bottom: 0; }
.account-row:hover { text-decoration: none; }
.account-row:hover span { text-decoration: underline; }
.account-row strong { margin-left: auto; font-weight: 650; white-space: nowrap; }
/* Movement and expected debt: two lines each, the amount or the button on the right. */
.list-row.money-move, .list-row.money-debt { flex-wrap: nowrap; align-items: center; gap: 12px; padding: 10px 0; }
.list-row.money-move > div, .list-row.money-debt > div { flex: 1 1 auto; }
.list-row.money-move small, .list-row.money-debt small { margin-top: 2px; }
.list-row.money-move > strong { flex: none; white-space: nowrap; }
.list-row.money-debt small b { color: var(--ink); font-weight: 650; white-space: nowrap; }
.list-row.money-debt > .button { flex: none; }
.money-more { margin: 8px 0 0; }
.money-more a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }

/* A phone has the «Записать» button in its menu instead of the row of actions. */
@media (max-width: 700px) {
  .home-quick { display: none; }
}
