/* Экраны: капитал, счета, операции, аналитика, импорт, курсы, настройки. */

/* ---------- Главная: капитал ----------
   Всё, что относится к месяцу, — плотно: месяц и «Всё/Личное/Бизнес» в одной строке,
   итоги мелкими плитками. Капитал виден сразу, без прокрутки. */
.hero { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 32px; }
.hero-label { font-size: 12.5px; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }
.hero-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); margin-top: 2px; }
.hero .amount-xl { font-size: 38px; line-height: 1.1; }
.hero-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.month-nav { display: flex; align-items: center; gap: 2px; }
.month-nav b { padding: 0 6px; text-align: center; font-size: 15px; white-space: nowrap; }
.hero-bar .chart-modes button { padding: 0 9px; }
.month-nav .btn-icon { background: var(--fill); border-color: transparent; }
.hero-month { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.hero-month .tile { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 12px; min-width: 0; }
.hero-month .tile span { font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.hero-month .tile b { font-size: 15.5px; font-weight: 700; font-family: var(--font-num); letter-spacing: -0.02em; white-space: nowrap; }
.hero-month .tile small { font-size: 10.5px; color: var(--text-3); font-family: var(--font-num); white-space: nowrap; }

/* ---------- Главная: данные не обновлялись ---------- */
.stale-card { padding: 8px 8px 8px 12px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 40%, transparent), var(--glass-shadow); }
.stale-head { display: flex; align-items: center; gap: 8px; }
.stale-icon { flex: none; display: grid; place-items: center; color: var(--warn); }
.stale-icon svg { width: 18px; height: 18px; }
.stale-title {
  min-width: 0; display: flex; align-items: center; gap: 4px; text-align: left;
  font-size: 13.5px; font-weight: 650; line-height: 1.3; color: var(--text);
}
.stale-chevron { width: 16px; height: 16px; flex: none; color: var(--text-3); transition: transform var(--dur) var(--ease); }
.stale-title.open .stale-chevron { transform: rotate(180deg); }
.stale-head .btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.stale-head .btn-sm svg { width: 14px; height: 14px; }
.stale-list { display: flex; flex-direction: column; margin: 6px 0 2px 26px; }
.stale-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 7px 4px;
  font-size: 12.5px; text-align: left; border-radius: 8px;
}
.stale-row + .stale-row { border-top: 1px solid var(--line); }
.stale-row:hover { background: var(--fill); }

/* ---------- Карточка счёта ----------
   Шапка, остатки, график и действия — отдельными частями с тонкой линией между ними.
   На широкой карточке остатки и график встают рядом: иначе строки монет тянутся
   на всю ширину и сумму приходится искать глазами на другом краю. */
.acc-card { container-type: inline-size; }
.acc-part { margin-top: 16px; }
.acc-divided { padding-top: 14px; border-top: 1px solid var(--line); }
.acc-card .amount-lg { margin-top: 2px; }

@container (min-width: 820px) {
  .acc-body { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 28px; }
  .acc-body > .acc-part:only-child { max-width: 560px; }
  .acc-history { border-top: 0; padding-top: 0; padding-left: 28px; border-left: 1px solid var(--line); }
  .acc-history .chart-box { height: 220px !important; }
}

/* Полоска состава: доли позиций в оценке счёта. */
.alloc { display: flex; gap: 2px; height: 6px; margin: 14px 0 4px; border-radius: 999px; overflow: hidden; background: var(--fill); }
.alloc > i { display: block; height: 100%; min-width: 3px; }

.holdings { display: flex; flex-direction: column; }
.hold-row { display: flex; align-items: center; gap: 10px; padding: 9px 2px; }
/* Разделитель — граница, а не inset-тень: тень на дробной координате давала вертикальный штрих. */
.holdings > * + *, .hold-dust > .hold-row { border-top: 1px solid var(--line); }
.hold-row .bold { font-size: 14px; }
.hold-dot { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.hold-vals { align-items: flex-end; text-align: right; gap: 1px; min-width: 0; }
.hold-vals .amount { font-size: 15px; }

.hold-dust > summary { list-style: none; cursor: pointer; border-radius: 10px; transition: background var(--dur) var(--ease); }
.hold-dust > summary::-webkit-details-marker { display: none; }
.hold-dust > summary:hover { background: var(--fill); }
.hold-dust > summary .amount { font-size: 13.5px; color: var(--text-2); }
.hold-chevron, .hold-dust > summary svg { width: 16px; height: 16px; color: var(--text-3); transition: transform var(--dur) var(--ease); }
.hold-dust[open] > summary svg { transform: rotate(180deg); }
/* Внутри «мелочи» строки сдвинуты под название, чтобы было видно, что это раскрытый список. */
.hold-dust > .hold-row { padding-left: 20px; }
.hold-dust > .hold-row .bold { font-size: 13px; font-weight: 600; }
.hold-dust > .hold-row .amount { font-size: 13.5px; font-weight: 600; }

/* ---------- Спросить про свои деньги ---------- */
.ask-form { position: relative; display: flex; align-items: center; }
.ask-form .input { height: 48px; padding-left: 40px; padding-right: 50px; font-size: 15.5px; border-radius: 14px; }
.ask-icon { position: absolute; left: 13px; display: grid; place-items: center; color: var(--accent); pointer-events: none; }
.ask-icon svg { width: 18px; height: 18px; }
.ask-send { position: absolute; right: 6px; width: 36px; height: 36px; border-radius: 11px; color: #fff; border: 0; background: var(--accent-grad); }
.ask-send svg { width: 18px; height: 18px; }
#ask-out:empty { display: none; }
.ask-answer {
  margin-top: 14px; padding: 16px; border-radius: var(--radius-md);
  background: var(--glass-soft); border: 1px solid var(--glass-edge);
}
.ask-understood { font-size: 14px; font-weight: 650; line-height: 1.35; }
.ask-meta { margin-top: 3px; font-size: 12.5px; color: var(--text-3); }
.ask-total { margin-top: 10px; font-size: 34px; font-weight: 760; letter-spacing: -0.035em; line-height: 1.1; }
.ask-currencies { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ask-currencies .pill { font-size: 12.5px; padding: 3px 9px; font-family: var(--font-num); }
.ask-section { margin-top: 16px; }
.ask-section-title { font-size: 12.5px; font-weight: 650; color: var(--text-3); margin: 0 0 4px 2px; }
.ask-group-row { display: flex; align-items: center; gap: 10px; padding: 8px 2px; font-size: 13.5px; }
.ask-group-row + .ask-group-row { border-top: 1px solid var(--line); }
.ask-cats { display: flex; flex-direction: column; }
.ask-cat + .ask-cat { border-top: 1px solid var(--line); }
.ask-cat-row { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 2px; text-align: left; border-radius: 12px; }
.ask-cat-row:hover { background: var(--fill); }
.ask-cat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.ask-cat-line { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 14px; }
.ask-cat-line .amount { font-size: 14px; }
.ask-cat-main .bar { height: 5px; }
.ask-cat-sub { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ask-chevron { flex: none; display: grid; place-items: center; color: var(--text-3); transition: transform var(--dur) var(--ease); }
.ask-chevron svg { width: 18px; height: 18px; }
.ask-cat.open .ask-chevron { transform: rotate(180deg); }
.ask-txns { padding: 0 0 10px 43px; }
@media (max-width: 700px) {
  .ask-answer { padding: 12px; }
  .ask-txns { padding-left: 0; }
}

/* ---------- На что посмотреть ---------- */
.insights { display: flex; flex-direction: column; }
.insight { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; }
.insight + .insight { border-top: 1px solid var(--line); }
.insight-icon {
  flex: none; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center;
  background: var(--fill); color: var(--text-2);
}
.insight-icon svg { width: 16px; height: 16px; }
.insight.is-warn .insight-icon { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.insight.is-danger .insight-icon { background: color-mix(in srgb, var(--expense) 14%, transparent); color: var(--expense); }
.insight-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left; padding-top: 1px; }
.insight-title { font-size: 14px; font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; }
.insight-text { font-size: 12.5px; color: var(--text-3); line-height: 1.35; }
.insight-hide { background: none; border-color: transparent; color: var(--text-3); margin-top: 1px; }
.insight-hide:hover { background: var(--fill); }

/* ---------- Полоска «требует внимания» ---------- */
.inbox-strip { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.inbox-strip::-webkit-scrollbar { display: none; }
.inbox-card {
  flex: none; display: flex; align-items: center; gap: 9px; padding: 10px 13px; border-radius: 14px;
  background: var(--glass-soft); border: 1px solid var(--glass-edge); font-size: 13px; font-weight: 600;
}
.inbox-card svg { width: 16px; height: 16px; color: var(--warn); }
.inbox-card b { font-family: var(--font-num); }

/* ---------- Группы счетов ---------- */
.group-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 8px; }
.group-head h3 { font-size: 14px; }
.group-head .amount { margin-left: auto; font-size: 14px; color: var(--text-2); }
.account-row .sub { font-size: 12.5px; color: var(--text-3); }
/* Длинное название счёта — в две строки, а не «Kaspi, Kaspi …». */
.clamp-2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; line-height: 1.3; }
.account-row { gap: 10px; }
.account-row .row-open { background: none; border: 0; padding: 0; color: inherit; font: inherit; }
.account-row .vals {
  min-width: 0; max-width: 48%; margin-left: auto;
  display: flex; flex-direction: column; gap: 2px; align-items: flex-end; text-align: right;
}
.account-row .vals .amount { font-size: 14.5px; }
.account-row .vals .conv { font-size: 11.5px; color: var(--text-3); font-family: var(--font-num); }
.account-row .deposit-btn { flex: none; }
/* Прогресс к разблокировке кошелька-копилки */
.account-row .goal { display: flex; align-items: center; gap: 8px; margin-top: 4px; width: 100%; max-width: 260px; }
.account-row .goal .bar { flex: 1; height: 5px; }
.account-row .goal .bar > i { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.account-row .goal-label { font-size: 11px; color: var(--text-3); font-family: var(--font-num); white-space: nowrap; }

/* Реквизиты */
.req-list { display: flex; flex-direction: column; }
.req-row { display: flex; align-items: center; gap: 10px; padding: 8px 2px; }
.req-row + .req-row { border-top: 1px solid var(--line); }
.req-val { font-family: var(--font-mono); font-size: 13px; word-break: break-all; line-height: 1.4; }

/* Адрес пополнения */
.qr-box { width: 190px; height: 190px; margin: 0 auto; display: flex; border-radius: 14px; overflow: hidden; background: #fff; padding: 8px; }
.deposit-qr { display: flex; justify-content: center; }

/* ---------- Операции ---------- */
.txn-row { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-radius: 13px; width: 100%; text-align: left; transition: background var(--dur) var(--ease); }
.txn-row:hover { background: var(--fill); }
.txn-row .title { font-weight: 600; font-size: 14.5px; }
.txn-row .sub { font-size: 12.5px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.txn-row .sub .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); flex: none; }
.txn-row .vals { margin-left: auto; text-align: right; }
.txn-row .vals .orig { font-size: 11.5px; color: var(--text-3); font-family: var(--font-num); }
.txn-row.pending .title::after { content: "•"; color: var(--warn); margin-left: 6px; }

/* Значок чека: у операции распознан состав покупки. */
.txn-row .title .mark { display: inline-flex; vertical-align: -2px; margin-left: 5px; color: var(--text-3); }
.txn-row .title .mark svg { width: 13px; height: 13px; }

/* Ручная связка: выбранный кандидат в пару и связанная операция в карточке. */
.link-cand { border: 1px solid transparent; }
.link-cand.active { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.link-cand .vals { flex: none; max-width: 58%; }
.link-cand .vals .orig { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-link { font: inherit; font-weight: 650; color: var(--accent); padding: 0; background: none; border: 0; cursor: pointer; }
.receipt-item { padding: 3px 0; gap: 12px; }
.receipt-item + .receipt-item { border-top: 1px solid var(--glass-edge); }
.day-head { display: flex; align-items: baseline; justify-content: space-between; padding: 14px 6px 4px; font-size: 12.5px; font-weight: 650; color: var(--text-3); }
.day-head .sum { font-family: var(--font-num); }

/* ---------- Категории: строки с долями ---------- */
.cat-row { display: flex; align-items: center; gap: 11px; padding: 9px 4px; width: 100%; text-align: left;
  border-radius: 12px; transition: background var(--dur) var(--ease); }
/* Строка под сектором пончика — подсвечивается и при наведении на график. */
.cat-row.on, button.cat-row:hover { background: var(--fill); }
.cat-row .bar { flex: 1; }
.cat-row .amount { font-size: 14px; }
.cat-line { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 0; }
.cat-line .row-between { font-size: 13.5px; font-weight: 600; }

/* ---------- Импорт ---------- */
.dropzone {
  border: 1.6px dashed var(--glass-border); border-radius: var(--radius-lg); padding: 30px 18px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text-2);
  background: var(--glass-soft); transition: all var(--dur) var(--ease); cursor: pointer;
}
.dropzone.drag { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.dropzone svg { width: 26px; height: 26px; }
.import-result { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 14px; background: var(--glass-soft); border: 1px solid var(--glass-edge); }
.import-result .stats { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Курсы ---------- */
.rate-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 4px; }
.rate-row + .rate-row { box-shadow: inset 0 1px 0 var(--line); }
/* Свой курс — с кнопкой удаления в конце строки. */
.rate-row-manual { grid-template-columns: 1fr auto auto auto; }
.rate-pair { font-weight: 650; }
.rate-val { text-align: right; font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.rate-val small { display: block; font-size: 11px; color: var(--text-3); font-weight: 600; }
.converter { display: grid; gap: 10px; grid-template-columns: 1fr auto 1fr; align-items: end; }
.converter .swap { margin-bottom: 4px; }

/* ---------- Настройки ---------- */
.setting-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; }
.setting-row + .setting-row { border-top: 1px solid var(--line); }
.small.dim + .setting-row { margin-top: 4px; }
.setting-row .label { font-weight: 600; font-size: 14.5px; }
.setting-row .hint { font-size: 12.5px; color: var(--text-3); line-height: 1.35; margin-top: 1px; }
.setting-row .control { margin-left: auto; flex: none; }
.setting-text { min-width: 0; flex: 1; }
/* Широкое управление (тема, списки) — под подписью на всю ширину, а не за краем экрана. */
.setting-row.setting-wide { flex-direction: column; align-items: stretch; gap: 10px; }
/* Несколько полей справа: на узком экране уходят под подпись, а не за край. */
.setting-row.setting-wrap { flex-wrap: wrap; }
.setting-row.setting-wide .segment { width: 100%; }
.setting-link { width: 100%; text-align: left; border-radius: 12px; }
.setting-link:hover { background: var(--fill); }
.setting-link svg { width: 18px; height: 18px; }

/* Список значений чипами с добавлением */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags:empty { display: none; }
.tag {
  display: inline-flex; align-items: center; gap: 2px; height: 32px; padding: 0 4px 0 11px; max-width: 100%;
  border-radius: 10px; background: var(--fill); font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere;
}
.tag button { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; color: var(--text-3); flex: none; }
.tag button:hover { background: var(--fill-2); color: var(--text); }
.tag button svg { width: 14px; height: 14px; }
.tag-add { display: flex; gap: 8px; margin-top: 8px; }
.tag-add .input { flex: 1; min-width: 0; height: 38px; font-size: 14.5px; }
.tag-add .btn { height: 38px; flex: none; }

/* Число дней: − 3 дня + */
.stepper { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 12px; background: var(--fill); }
.stepper button { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: var(--text-2); }
.stepper button:hover { background: var(--surface); color: var(--text); }
.stepper button svg { width: 15px; height: 15px; }
.stepper b { min-width: 18px; text-align: center; font-family: var(--font-num); font-size: 15px; }
.stepper span { font-size: 12.5px; color: var(--text-3); padding-right: 4px; min-width: 30px; }
.code {
  font-family: var(--font-mono); font-size: 12.5px; word-break: break-all;
  background: var(--fill); padding: 10px 12px; border-radius: 10px; color: var(--text-2);
}

/* ---------- Быстрое добавление ---------- */
.qa-modes { margin-bottom: 4px; }

/* Сумма — главное на экране: крупно, по центру, валюта рядом маленькой «таблеткой». */
.qa-hero {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 0 6px; min-height: 84px;
}
.qa-sum {
  min-width: 0; width: 100%; max-width: 100%; padding: 0; border: 0; outline: none; background: transparent;
  font-family: var(--font-num); font-size: 46px; font-weight: 700; letter-spacing: -0.03em;
  color: var(--text); text-align: center; caret-color: var(--accent);
}
.qa-sum::placeholder { color: var(--text-3); opacity: 0.55; }
.qa-hero.income .qa-sum { color: var(--income); }
@supports (field-sizing: content) {
  .qa-sum { field-sizing: content; width: auto; min-width: 1.2ch; text-align: right; }
}
.qa-cur {
  flex: none; height: 38px; padding: 0 12px; border-radius: 999px; border: 0; appearance: none;
  background: var(--fill); color: var(--text-2); font-size: 20px; font-weight: 700; text-align: center; cursor: pointer;
}
.qa-cur:focus { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }

.qa-section { margin-top: 16px; }
.qa-label { font-size: 12.5px; font-weight: 650; color: var(--text-3); margin: 0 0 8px 2px; }
.qa-who { height: 48px; font-size: 16px; }
.qa-suggests { margin-top: 8px; }
.qa-suggests:empty { display: none; }
.qa-sug { height: 34px; font-size: 13.5px; color: var(--text); }
.qa-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

/* Счета — чипы с логотипом: видно сразу, выбор в одно касание, без списка на весь экран. */
.qa-accounts { gap: 8px; }
.qa-acc {
  flex: none; display: inline-flex; align-items: center; gap: 8px; height: 42px; max-width: 220px;
  padding: 0 12px 0 6px; border-radius: 13px; font-size: 13.5px; font-weight: 600; color: var(--text-2);
  background: var(--fill); border: 1px solid transparent; transition: all var(--dur) var(--ease);
}
.qa-acc .avatar { flex: none; }
.qa-acc-cur { color: var(--text-3); font-weight: 600; }
.qa-acc.active { color: var(--text); background: var(--accent-soft); border-color: var(--accent); }
.avatar-xs { width: 28px; height: 28px; border-radius: 9px; font-size: 11px; }
.avatar-xs svg { width: 15px; height: 15px; stroke-width: 2; }

/* Категории: частые сверху, четыре в ряд на телефоне. */
.qa-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 520px) { .qa-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); } }
.qa-cat {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 78px; padding: 8px 4px; border-radius: 14px;
  background: var(--fill); border: 1px solid transparent; color: var(--text-2);
  font-size: 11.5px; font-weight: 600; line-height: 1.2; text-align: center;
  transition: all var(--dur) var(--ease);
}
/* Подпись занимает ровно две строки: иконки во всей сетке встают на одну линию,
   а сама пара «иконка + подпись» остаётся по центру плитки. */
.qa-cat span:not(.avatar) {
  display: flex; align-items: center; justify-content: center;
  height: 2.4em; overflow: hidden; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word;
}
.qa-cat:hover { background: var(--fill-2); color: var(--text); }
.qa-cat:active { transform: scale(0.96); }
.qa-cat.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.qa-more-icon { background: var(--fill-2); color: var(--text-2); }

.qa-extras { display: flex; flex-wrap: wrap; gap: 8px; }
.qa-extras .input { flex: 1 1 100%; }
.qa-foot .btn-primary { height: 50px; font-size: 15.5px; }

/* ---------- Вход ---------- */
.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.login { width: min(400px, 100%); padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.login .brand-mark { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: #fff; background: var(--accent-grad); }

/* ---------- Телефон ---------- */
@media (max-width: 700px) {
  .hero-sub { white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
  .hero-sub::-webkit-scrollbar { display: none; }
  .hero .amount-xl { font-size: 34px; }
  .card { padding: 14px; }
  .content { padding-left: 12px; padding-right: 12px; }
}
