/* Checkaut — мобильный интерфейс учёта расходов */

:root {
  color-scheme: dark;
  --bg: #080907;
  --bg-elev: #0d0f0b;
  --surface: #14160f;
  --surface-2: #191c13;
  --surface-3: #21251a;
  --line: rgba(242, 244, 232, 0.075);
  --line-strong: rgba(242, 244, 232, 0.13);
  --text: #f1f3e7;
  --muted: #a2a794;
  --muted-2: #828976;
  --accent: #d9ff5a;
  --accent-text: #d9ff5a;
  --accent-soft: rgba(217, 255, 90, 0.1);
  --accent-ink: #101405;
  --danger: #ff8277;
  --danger-soft: rgba(255, 130, 119, 0.1);
  --warning: #ffc46b;
  --sky: #8fc8ff;
  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ease-out: cubic-bezier(0.22, 0.8, 0.3, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

:root[data-hide-tax='true'] .tax-info {
  display: none !important;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(120% 65% at 50% -18%, rgba(217, 255, 90, 0.085), transparent 55%),
    radial-gradient(80% 55% at 112% 18%, rgba(115, 232, 200, 0.04), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.03;
  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.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

body.has-sheet {
  overflow: hidden;
}

body.has-sheet .bottom-nav {
  opacity: 0.35;
  filter: blur(1px);
  pointer-events: none;
  transition: opacity 0.2s ease, filter 0.2s ease;
}

::selection {
  background: rgba(217, 255, 90, 0.24);
  color: var(--text);
}

button,
a,
input,
textarea,
summary {
  -webkit-tap-highlight-color: transparent;
}

button,
input,
textarea {
  font-family: inherit;
}

a {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-text) 72%, transparent);
  outline-offset: 2px;
}

.icon {
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
}

.app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 540px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 18px calc(112px + var(--safe-bottom));
}

.app--auth {
  padding: 0;
  max-width: none;
}

.page {
  min-height: calc(100dvh - 130px);
  animation: viewIn 0.32s var(--ease-out) both;
}

.view {
  min-height: 100dvh;
}

/* ——— Boot ——— */

.boot-splash {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 100dvh;
}

.boot-mark {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 21px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 27px;
  font-weight: 800;
  box-shadow: 0 20px 46px -18px rgba(217, 255, 90, 0.55);
  transform: rotate(-3deg);
}

.boot-mark .icon {
  width: 29px;
  height: 29px;
  stroke-width: 2;
}

.boot-name {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.055em;
}

.boot-name span {
  color: var(--accent-text);
}

.boot-splash .spinner {
  width: 19px;
  height: 19px;
  margin-top: 8px;
}

.boot-error-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 24px 18px;
}

/* ——— Spinner ——— */

.spinner {
  display: inline-block;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(217, 255, 90, 0.22);
  border-top-color: var(--accent-text);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-spinner {
  display: inline-block;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(16, 20, 5, 0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-secondary .btn-spinner,
.btn-ghost .btn-spinner,
.btn-danger-ghost .btn-spinner {
  border-color: rgba(255, 255, 255, 0.18);
  border-top-color: currentColor;
}

/* ——— Topbar ——— */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 0 10px;
}

.topbar--compact {
  padding-bottom: 8px;
}

.brand {
  color: var(--text);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.05em;
  text-decoration: none;
  line-height: 1;
}

.brand span {
  color: var(--accent-text);
}

.avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(217, 255, 90, 0.22);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(217, 255, 90, 0.16), rgba(217, 255, 90, 0.045));
  color: var(--accent-text);
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.icon-btn .icon {
  width: 20px;
  height: 20px;
}

.icon-btn--ghost {
  border-color: transparent;
  background: transparent;
  opacity: 0;
  pointer-events: none;
}

.topbar-title {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

/* ——— Typography / intros ——— */

.eyebrow {
  margin: 0;
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.14em;
  line-height: 1.35;
  text-transform: uppercase;
}

.home-intro {
  padding: 8px 2px 20px;
}

.home-intro h1 {
  margin: 9px 0 0;
  font-size: clamp(26px, 7.5vw, 32px);
  font-weight: 750;
  letter-spacing: -0.045em;
  line-height: 1.15;
}

.page-intro {
  padding: 10px 2px 20px;
}

.page-intro h1 {
  margin: 8px 0 10px;
  font-size: clamp(28px, 8vw, 35px);
  font-weight: 750;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.page-lead {
  max-width: 40ch;
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

/* ——— Hero ——— */

.hero {
  position: relative;
  margin-bottom: 24px;
  padding: 20px;
  overflow: hidden;
  border-radius: 30px;
  background: linear-gradient(145deg, #e9ff9a 0%, #d9ff5a 44%, #c4ef3d 100%);
  color: #111605;
  box-shadow:
    0 28px 62px -32px rgba(217, 255, 90, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.hero::before {
  content: '';
  position: absolute;
  top: -105px;
  right: -80px;
  width: 230px;
  height: 230px;
  border: 1px solid rgba(17, 22, 5, 0.14);
  border-radius: 50%;
  box-shadow:
    0 0 0 30px rgba(17, 22, 5, 0.05),
    0 0 0 62px rgba(17, 22, 5, 0.035);
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(80% 100% at 92% 108%, rgba(255, 255, 255, 0.38), transparent 48%);
}

.hero-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hero-label {
  color: rgba(17, 22, 5, 0.55);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.3;
  text-transform: uppercase;
}

.hero-emblem {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(17, 22, 5, 0.09);
  color: #111605;
}

.hero-emblem .icon {
  width: 18px;
  height: 18px;
}

.hero-amount {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin: 20px 0 18px;
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 0.9;
}

.hero-int {
  font-size: clamp(42px, 12.5vw, 54px);
  font-variant-numeric: tabular-nums;
}

.hero-frac {
  opacity: 0.55;
  font-size: clamp(20px, 5.5vw, 24px);
  font-weight: 750;
}

.hero-cur {
  margin-left: 4px;
  opacity: 0.8;
  font-size: clamp(22px, 6vw, 28px);
  font-weight: 750;
}

.hero-stats {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  border: 1px solid rgba(17, 22, 5, 0.08);
  border-radius: 999px;
  background: rgba(17, 22, 5, 0.085);
  color: rgba(17, 22, 5, 0.72);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
}

.hero-pill b {
  color: #111605;
  font-weight: 800;
}

/* ——— Sections / project cards ——— */

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 28px;
  margin: 0 2px 12px;
}

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
}

.section-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--accent-text);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.section-action .icon {
  width: 15px;
  height: 15px;
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.project-card {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 74px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.project-badge {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  background: var(--surface-3);
  background: color-mix(in srgb, var(--pa) 14%, transparent);
  border-color: color-mix(in srgb, var(--pa) 24%, transparent);
  color: var(--pa);
  font-size: 18px;
  font-weight: 800;
}

.project-badge--lg {
  width: 48px;
  height: 48px;
  font-size: 19px;
}

.project-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.project-name {
  overflow: hidden;
  color: var(--text);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-sub {
  color: var(--muted-2);
  font-size: 11.5px;
}

.project-sum {
  color: var(--text);
  font-size: 14px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.project-chevron {
  display: grid;
  place-items: center;
  color: var(--muted-2);
}

.project-chevron .icon {
  width: 16px;
  height: 16px;
}

.add-project {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  background: rgba(20, 22, 15, 0.35);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.add-project .icon {
  width: 17px;
  height: 17px;
}

.empty-projects {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 20px 22px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(20, 23, 15, 0.6), rgba(14, 16, 11, 0.3));
  text-align: center;
}

.empty-art {
  width: min(180px, 62%);
  margin: -2px auto 0;
}

.empty-art svg {
  display: block;
  width: 100%;
  height: auto;
}

.empty-projects h3 {
  margin: 2px 0 7px;
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.025em;
}

.empty-projects p {
  max-width: 290px;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.empty-projects .btn {
  height: 48px;
  padding: 0 18px;
  font-size: 13.5px;
}

.home-footnote {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 28px 0 0;
  color: var(--muted-2);
  font-size: 10.5px;
  text-align: center;
}

.home-footnote .icon {
  width: 13px;
  height: 13px;
}

/* ——— Project page ——— */

.project-hero {
  position: relative;
  margin-bottom: 14px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-right-color: color-mix(in srgb, var(--pa) 22%, var(--line));
  border-top-color: color-mix(in srgb, var(--pa) 22%, var(--line));
  border-radius: 28px;
  background:
    radial-gradient(130% 105% at 92% -10%, color-mix(in srgb, var(--pa) 22%, transparent), transparent 55%),
    linear-gradient(165deg, #191c13 0%, #12140e 72%);
}

.project-hero::after {
  content: '';
  position: absolute;
  right: -90px;
  bottom: -110px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--pa) 10%, transparent);
  pointer-events: none;
}

.project-hero-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.project-hero-heading {
  min-width: 0;
}

.project-hero-edit {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-left: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.project-hero-edit .icon {
  width: 16px;
  height: 16px;
}

.project-hero-edit:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.project-hero-name {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.project-hero-count {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11.5px;
}

.total-label {
  position: relative;
  z-index: 1;
  margin: 22px 0 4px;
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.project-total {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 2px;
  color: var(--text);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
}

.project-total .money-int {
  font-size: clamp(38px, 10.5vw, 48px);
  font-variant-numeric: tabular-nums;
}

.project-total .money-frac {
  margin-left: 1px;
  opacity: 0.55;
  font-size: 20px;
  font-weight: 700;
}

.project-total .money-cur {
  margin-left: 3px;
  opacity: 0.75;
  font-size: 24px;
  font-weight: 700;
}

.project-meta {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.meta-chip .icon {
  width: 13px;
  height: 13px;
  color: var(--muted-2);
}

.project-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-bottom: 26px;
}

.project-actions .btn {
  height: 52px;
  padding: 0 10px;
  border-radius: 17px;
  font-size: 13px;
  gap: 7px;
}

.project-actions .icon {
  width: 18px;
  height: 18px;
}

.history-section .section-head {
  margin-bottom: 4px;
}

.history-group {
  margin-top: 18px;
}

.history-month {
  margin: 0 2px 8px;
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.expense-row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.expense-icon {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 14px;
  background: var(--surface-3);
  color: var(--muted);
}

.expense-icon .icon {
  width: 19px;
  height: 19px;
}

.expense-icon.is-receipt {
  border-color: rgba(217, 255, 90, 0.12);
  background: var(--accent-soft);
  color: var(--accent-text);
}

.expense-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.expense-title {
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expense-sub {
  overflow: hidden;
  color: var(--muted-2);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expense-amount {
  color: var(--text);
  font-size: 13.5px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.empty-history {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 28px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 24px;
  background: rgba(20, 22, 15, 0.35);
  text-align: center;
}

.empty-history-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 2px;
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--accent-text);
}

.empty-history-icon .icon {
  width: 25px;
  height: 25px;
}

.empty-history h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.empty-history p {
  max-width: 280px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.empty-history .btn {
  height: 46px;
  font-size: 13px;
}

.load-more {
  margin-top: 16px;
  height: 48px;
  font-size: 13px;
}

.load-more-count {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 20px;
  padding: 0 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 10px;
}

/* ——— Buttons ——— */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}

.btn:active {
  transform: scale(0.975);
}

.btn .icon {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 12px 28px -14px rgba(217, 255, 90, 0.55);
}

.btn-secondary {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--text);
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.btn-danger {
  border-color: transparent;
  background: var(--danger);
  color: #230604;
}

.btn-danger-ghost {
  border-color: rgba(255, 130, 119, 0.16);
  background: var(--danger-soft);
  color: var(--danger);
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.48;
  pointer-events: none;
  box-shadow: none;
}

.btn.is-busy {
  opacity: 0.82;
  pointer-events: none;
}

/* ——— Forms ——— */

.form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-label {
  padding-left: 2px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.input {
  width: 100%;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  outline: none;
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.3;
  color-scheme: inherit;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.input::placeholder {
  color: var(--muted-2);
}

.input:focus {
  border-color: rgba(217, 255, 90, 0.55);
  background: var(--surface-3);
  box-shadow: 0 0 0 4px rgba(217, 255, 90, 0.08);
}

textarea.input {
  min-height: 86px;
  resize: vertical;
}

input[type='date'].input {
  min-height: 51px;
}

input[type='date']::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0;
}

.password-wrap {
  position: relative;
}

.password-wrap .input {
  padding-right: 86px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle:hover {
  color: var(--text);
}

.form-error {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 130, 119, 0.16);
  border-radius: 12px;
  background: var(--danger-soft);
  color: #ffb7b0;
  font-size: 12.5px;
  line-height: 1.45;
}

.form-error[hidden] {
  display: none;
}

.field-hint {
  margin: 0;
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.45;
}

.amount-input {
  position: relative;
}

.amount-input .input {
  height: 60px;
  padding-left: 38px;
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.amount-prefix {
  position: absolute;
  top: 50%;
  left: 16px;
  color: var(--muted-2);
  font-size: 20px;
  font-weight: 700;
  pointer-events: none;
  transform: translateY(-50%);
}

.input-icon-wrap {
  position: relative;
}

.input-icon-wrap > .icon {
  position: absolute;
  top: 50%;
  left: 14px;
  z-index: 1;
  width: 17px;
  height: 17px;
  color: var(--muted-2);
  pointer-events: none;
  transform: translateY(-50%);
}

.input-icon-wrap .input {
  padding-left: 42px;
}

.accent-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 4px 2px;
}

.accent-choice {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.accent-choice-dot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border: 1px solid color-mix(in srgb, var(--pa) 35%, transparent);
  border-radius: 13px;
  background: color-mix(in srgb, var(--pa) 20%, transparent);
}

.accent-choice-dot::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--pa);
  transition: transform 0.16s ease;
}

.accent-choice.is-selected {
  border-color: var(--pa);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pa) 14%, transparent);
}

.accent-choice.is-selected .accent-choice-dot::after {
  transform: scale(1.3);
}

/* ——— Auth ——— */

.auth-page {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100dvh;
  padding: calc(28px + env(safe-area-inset-top, 0px)) 18px calc(24px + var(--safe-bottom));
  overflow-x: hidden;
}

.auth-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.auth-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  animation: viewIn 0.45s var(--ease-out) both;
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(50px);
  opacity: 0.55;
}

.auth-orb--one {
  top: -140px;
  left: 50%;
  width: 340px;
  height: 340px;
  background: rgba(217, 255, 90, 0.18);
  transform: translateX(-50%);
}

.auth-orb--two {
  right: -120px;
  bottom: 0;
  width: 260px;
  height: 260px;
  background: rgba(115, 232, 200, 0.07);
}

.auth-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 22%, black, transparent 66%);
  mask-image: radial-gradient(ellipse at 50% 22%, black, transparent 66%);
}

.auth-float {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 74px;
  height: 96px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
  opacity: 0.5;
  transform: rotate(-12deg);
}

.auth-float i {
  display: block;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
}

.auth-float i:first-child {
  width: 50%;
  height: 7px;
  border-radius: 50%;
  background: rgba(217, 255, 90, 0.35);
}

.auth-float--one {
  top: 15%;
  left: -18px;
  animation: floatY 7s ease-in-out infinite;
}

.auth-float--two {
  right: -16px;
  bottom: 18%;
  transform: rotate(14deg);
  animation: floatY 9s ease-in-out infinite reverse;
}

.auth-hero {
  margin-bottom: 24px;
  padding-top: 8px;
  text-align: center;
}

.auth-logo {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin: 0 auto 16px;
  border-radius: 20px;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow:
    0 18px 40px -16px rgba(217, 255, 90, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transform: rotate(-4deg);
}

.auth-logo .icon {
  width: 28px;
  height: 28px;
  stroke-width: 2;
}

.auth-wordmark {
  color: var(--text);
  font-size: 31px;
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 1;
}

.auth-wordmark span {
  color: var(--accent-text);
}

.auth-tagline {
  max-width: 300px;
  margin: 12px auto 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.auth-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(23, 26, 18, 0.92), rgba(16, 18, 13, 0.9));
  box-shadow:
    0 30px 80px -40px rgba(0, 0, 0, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--bg);
}

.auth-tab {
  height: 40px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.auth-tab.is-active {
  background: var(--surface-3);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-submit {
  height: 54px;
  margin-top: 2px;
  border-radius: 17px;
  font-size: 15px;
}

.auth-safe {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 18px 0 0;
  color: var(--muted-2);
  font-size: 10.5px;
  text-align: center;
}

.auth-safe .icon {
  width: 13px;
  height: 13px;
}

/* ——— Sheets ——— */

.sheet-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 4, 2, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.22s ease both;
}

.sheet {
  position: relative;
  width: 100%;
  max-width: 540px;
  max-height: 92dvh;
  padding: 8px 20px calc(22px + var(--safe-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
  background: linear-gradient(180deg, #181b13 0%, #11130d 100%);
  box-shadow: 0 -30px 80px rgba(0, 0, 0, 0.65);
  animation: sheetIn 0.34s var(--ease-out) both;
}

.sheet::-webkit-scrollbar {
  display: none;
}

.sheet-layer.is-closing .sheet {
  animation: sheetOut 0.2s ease-in both;
}

.sheet-layer.is-closing .sheet-backdrop {
  animation: fadeOut 0.2s ease both;
}

.sheet-grabber {
  width: 38px;
  height: 4px;
  margin: 2px auto 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.sheet-headings {
  min-width: 0;
}

.sheet-title {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.sheet-subtitle {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.sheet-close {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease;
}

.sheet-close .icon {
  width: 17px;
  height: 17px;
}

.sheet-close:hover {
  color: var(--text);
  background: var(--surface-3);
}

.sheet-body {
  padding-bottom: 4px;
}

.sheet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}

.sheet-divider {
  height: 1px;
  margin: 20px 0 16px;
  background: var(--line);
}

.confirm-text {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

/* ——— Toasts ——— */

.toast-root {
  position: fixed;
  bottom: calc(94px + var(--safe-bottom));
  left: 50%;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(calc(100% - 28px), 420px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  background: rgba(24, 27, 19, 0.96);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  opacity: 0;
  pointer-events: auto;
  transform: translateY(10px) scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s ease;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast-icon {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent-text);
}

.toast-icon .icon {
  width: 15px;
  height: 15px;
}

.toast--danger .toast-icon {
  background: var(--danger-soft);
  color: var(--danger);
}

.toast--info .toast-icon {
  background: rgba(143, 200, 255, 0.1);
  color: var(--sky);
}

.toast-text {
  flex: 1;
}

/* ——— Skeleton ——— */

.skeleton {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.045), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.5s infinite;
}

.skeleton-line {
  height: 16px;
  border-radius: 7px;
}

.skeleton-line--sm {
  width: 110px;
  height: 12px;
}

.skeleton-line--xs {
  width: 90px;
  height: 12px;
  border: 0;
}

.skeleton-line--name {
  width: 160px;
  height: 22px;
  margin: 4px auto 0;
}

.skeleton-line--email {
  width: 200px;
  height: 12px;
  margin: 8px auto 0;
}

.skeleton-title {
  width: 70%;
  height: 30px;
  margin-top: 12px;
  border-radius: 9px;
}

.skeleton-title--home {
  width: 78%;
  height: 56px;
  margin-top: 12px;
}

.skeleton-hero {
  height: 168px;
  margin-bottom: 24px;
  border-radius: 30px;
  border-color: rgba(217, 255, 90, 0.08);
  background: linear-gradient(145deg, rgba(217, 255, 90, 0.09), rgba(217, 255, 90, 0.03));
}

.skeleton-project {
  height: 74px;
  margin-bottom: 9px;
  border-radius: 20px;
}

.skeleton-project-hero {
  height: 236px;
  margin-bottom: 14px;
  border-radius: 28px;
}

.skeleton-button {
  height: 52px;
  border-radius: 17px;
}

.skeleton-expense {
  height: 66px;
  margin-bottom: 8px;
  border-radius: 18px;
}

.skeleton-avatar {
  width: 76px;
  height: 76px;
  margin-bottom: 14px;
  border-radius: 26px;
}

.skeleton-stat {
  height: 78px;
  border-radius: 18px;
}

.skeleton-stat--wide {
  grid-column: 1 / -1;
  height: 64px;
}

.skeleton-settings {
  height: 128px;
  margin-top: 12px;
  border-radius: 20px;
}

.skeleton-block {
  height: 90px;
  border-radius: 16px;
}

.skeleton-amount {
  width: 55%;
  height: 42px;
  margin: 8px 0;
  border-radius: 10px;
}

.detail-skeleton {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 8px;
}

.detail-skeleton .skeleton-title {
  width: 70%;
  height: 24px;
  margin: 0;
}

/* ——— State / empty ——— */

.state-card {
  margin: 24px 0;
  padding: 28px 22px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--surface);
  text-align: center;
}

.state-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  border-radius: 18px;
  background: var(--danger-soft);
  color: var(--danger);
}

.state-icon .icon {
  width: 26px;
  height: 26px;
}

.state-card h1,
.state-card h2 {
  margin: 0 0 8px;
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -0.025em;
}

.state-card p {
  max-width: 330px;
  margin: 0 auto 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.state-card .btn {
  height: 48px;
}

.state-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
}

.state-actions .btn {
  height: 48px;
  font-size: 13.5px;
}

.inline-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 8px;
  text-align: center;
}

.inline-state-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--danger-soft);
  color: var(--danger);
}

.inline-state p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.inline-state .btn {
  height: 44px;
  font-size: 13px;
}

/* ——— Money ——— */

.money {
  display: inline-flex;
  align-items: baseline;
  font-variant-numeric: tabular-nums;
}

/* ——— Chips ——— */

.chips {
  display: flex;
  gap: 8px;
  margin: 0 -2px;
  padding: 2px 2px 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  height: 40px;
  max-width: 220px;
  padding: 0 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.chip.is-active {
  border-color: rgba(217, 255, 90, 0.55);
  background: var(--accent-soft);
  color: var(--accent-text);
}

.chip-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pa);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pa) 12%, transparent);
}

.chip--new {
  border-style: dashed;
  color: var(--muted);
}

.chip--new .icon {
  width: 15px;
  height: 15px;
}

.context-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  margin: 0 2px 14px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
}

.context-chip-dot {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pa, var(--accent));
}

/* ——— Scan ——— */

.scanner-alert {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 196, 107, 0.2);
  border-radius: 16px;
  background: rgba(255, 196, 107, 0.07);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.scanner-alert-icon {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: rgba(255, 196, 107, 0.1);
  color: var(--warning);
}

.scanner-alert-icon .icon {
  width: 17px;
  height: 17px;
}

.scanner-alert-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.scanner-alert-text b {
  font-size: 12px;
  font-weight: 700;
}

.scanner-alert-text small {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.4;
}

.scanner-alert > .icon {
  width: 16px;
  height: 16px;
  color: var(--muted-2);
}

.scanner-description {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.scanner-help-link {
  display: inline-flex;
  margin-top: 14px;
}

.scan-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  max-height: 380px;
  aspect-ratio: 1 / 0.94;
  margin-bottom: 14px;
  padding: 26px;
  overflow: hidden;
  border: 1.5px dashed rgba(217, 255, 90, 0.3);
  border-radius: 28px;
  background:
    radial-gradient(80% 60% at 50% 42%, rgba(217, 255, 90, 0.07), transparent 62%),
    linear-gradient(160deg, var(--surface-2), var(--surface));
  color: var(--text);
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.scan-frame.is-dragover {
  border-color: var(--accent-text);
  background: rgba(217, 255, 90, 0.06);
}

.scan-corner {
  position: absolute;
  width: 26px;
  height: 26px;
  border: 2px solid rgba(217, 255, 90, 0.6);
  pointer-events: none;
}

.scan-corner--tl {
  top: 16px;
  left: 16px;
  border-right: 0;
  border-bottom: 0;
  border-radius: 8px 0 0 0;
}

.scan-corner--tr {
  top: 16px;
  right: 16px;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0 8px 0 0;
}

.scan-corner--bl {
  bottom: 16px;
  left: 16px;
  border-top: 0;
  border-right: 0;
  border-radius: 0 0 0 8px;
}

.scan-corner--br {
  right: 16px;
  bottom: 16px;
  border-top: 0;
  border-left: 0;
  border-radius: 0 0 8px 0;
}

.scan-camera-icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin-bottom: 4px;
  border-radius: 25px;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 18px 40px -16px rgba(217, 255, 90, 0.5);
}

.scan-camera-icon .icon {
  width: 31px;
  height: 31px;
}

.scan-frame-title {
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.scan-frame-hint {
  max-width: 250px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.scan-frame-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(217, 255, 90, 0.16);
  border-radius: 999px;
  background: rgba(217, 255, 90, 0.07);
  color: var(--accent-text);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.scan-frame-badge .icon {
  width: 13px;
  height: 13px;
}

.scan-actions {
  display: grid;
  gap: 9px;
}

.scan-actions--row {
  grid-template-columns: 1.5fr 1fr;
}

.scan-actions--row .btn {
  min-width: 0;
  padding: 0 12px;
  font-size: 13px;
}

.scan-privacy {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  max-width: 340px;
  margin: 18px auto 0;
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}

.scan-privacy .icon {
  flex-shrink: 0;
  width: 13px;
  height: 13px;
  margin-top: 1px;
}

.manual-qr {
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(20, 22, 15, 0.5);
}

.manual-qr summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 15px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  list-style: none;
  user-select: none;
  cursor: pointer;
}

.manual-qr summary::-webkit-details-marker {
  display: none;
}

.manual-qr summary > span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.manual-qr summary .icon {
  width: 16px;
  height: 16px;
  color: var(--muted-2);
}

.manual-qr summary > .icon {
  transition: transform 0.2s ease;
}

.manual-qr[open] summary > .icon {
  transform: rotate(180deg);
}

.manual-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 2px 15px 16px;
}

.manual-form .btn {
  align-self: flex-start;
  height: 46px;
  font-size: 13px;
}

/* Scan processing */

.processing-stage {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.processing-preview,
.solo-scan {
  position: relative;
  max-height: 380px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: #050604;
  aspect-ratio: 4 / 3.4;
}

.processing-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.52;
  filter: saturate(0.6) blur(0.6px);
}

.processing-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(3, 4, 2, 0.05), rgba(3, 4, 2, 0.55));
}

.solo-scan {
  display: grid;
  place-items: center;
  min-height: 220px;
  background:
    radial-gradient(circle at 50% 45%, rgba(217, 255, 90, 0.09), transparent 60%),
    var(--surface);
}

.solo-scan > .icon {
  width: 64px;
  height: 64px;
  color: var(--accent-text);
  opacity: 0.9;
}

.scan-line {
  position: absolute;
  left: 7%;
  right: 7%;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent) 20%, var(--accent) 80%, transparent);
  box-shadow:
    0 0 18px rgba(217, 255, 90, 0.8),
    0 0 50px rgba(217, 255, 90, 0.35);
  animation: scanLine 2.4s ease-in-out infinite;
}

.processing-preview .scan-line {
  top: 20%;
}

.solo-scan .scan-line {
  top: 50%;
}

.processing-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}

.processing-card h2 {
  margin: 0 0 3px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.processing-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.processing-card .spinner {
  width: 22px;
  height: 22px;
  border-width: 2.5px;
}

/* Scan review */

.review-hero {
  position: relative;
  margin-bottom: 14px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(217, 255, 90, 0.16);
  border-radius: 26px;
  background:
    radial-gradient(130% 100% at 90% -10%, rgba(217, 255, 90, 0.16), transparent 55%),
    linear-gradient(165deg, #1b1f15, #12140e 70%);
}

.review-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid rgba(217, 255, 90, 0.18);
  border-radius: 999px;
  background: rgba(217, 255, 90, 0.1);
  color: var(--accent-text);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.review-status .icon {
  width: 13px;
  height: 13px;
  stroke-width: 2.2;
}

.review-merchant {
  margin: 14px 0 0;
  overflow-wrap: anywhere;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.review-legal,
.review-address {
  margin: 4px 0 0;
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.45;
}

.review-total {
  margin: 16px 0 12px;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
}

.review-total .money-int {
  font-size: clamp(36px, 10vw, 46px);
  font-variant-numeric: tabular-nums;
}

.review-total .money-frac {
  opacity: 0.55;
  font-size: 20px;
  font-weight: 700;
}

.review-total .money-cur {
  margin-left: 4px;
  opacity: 0.75;
  font-size: 23px;
  font-weight: 700;
}

.review-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 11px;
}

.review-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.review-meta .icon {
  width: 13px;
  height: 13px;
  color: var(--muted-2);
}

.review-items-card {
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
}

.review-items-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 16px 11px;
}

.review-items-head h2 {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.review-items-head span {
  color: var(--muted-2);
  font-size: 10.5px;
}

.review-items {
  display: flex;
  flex-direction: column;
  padding: 0 16px;
}

.review-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.review-item-main {
  flex: 1;
  min-width: 0;
}

.review-item-name {
  overflow-wrap: anywhere;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
}

.review-item-sub {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.review-item-side {
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
}

.review-item-total {
  padding-top: 1px;
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.item-toggle {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-3);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

.item-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform 0.18s ease, background 0.18s ease;
}

.item-toggle.is-on {
  border-color: rgba(217, 255, 90, 0.5);
  background: var(--accent);
}

.item-toggle.is-on::after {
  background: var(--accent-ink);
  transform: translateX(16px);
}

.item-toggle:disabled {
  opacity: 0.5;
  cursor: default;
}

.review-item.is-excluded .review-item-name,
.review-item.is-excluded .review-item-total,
.detail-item.is-excluded .detail-item-name,
.detail-item.is-excluded .detail-item-total {
  opacity: 0.45;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.review-item.is-excluded .review-item-sub,
.detail-item.is-excluded .detail-item-sub {
  opacity: 0.55;
}

.items-toggle-hint {
  margin: 0 16px 10px;
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.45;
}

.review-excluded-total {
  margin-top: 5px;
  color: var(--warning);
  font-size: 11px !important;
  font-weight: 650 !important;
}

.detail-amount-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 48px;
}

.detail-amount-row .detail-amount {
  flex: 0 0 auto;
}

.detail-excluded-note {
  flex: 1 1 0;
  min-width: 0;
  max-width: 46%;
  margin: 3px 0 0 auto;
  color: var(--warning);
  font-size: 10px;
  line-height: 1.4;
  text-align: right;
}

.dot-sep {
  margin: 0 4px;
  opacity: 0.6;
}

.review-summary {
  padding: 13px 16px 15px;
  border-top: 1px solid var(--line);
  background: var(--bg-elev);
}

.review-summary > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 700;
}

.review-summary > div > span:first-child {
  color: var(--muted);
}

.review-vat-total {
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 11px !important;
  font-weight: 500 !important;
}

.review-no-items {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.45;
}

.review-no-items .icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  color: var(--muted);
}

.review-no-items p {
  margin: 0;
}

.review-project {
  margin-bottom: 20px;
}

.review-project .section-head {
  margin-bottom: 9px;
}

.review-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.review-actions .btn-primary {
  height: 56px;
  font-size: 15px;
}

.review-actions .btn-ghost {
  height: 46px;
  font-size: 13px;
}

/* Scan error */

.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px 20px;
  text-align: center;
}

.error-icon {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 130, 119, 0.16);
  border-radius: 22px;
  background: var(--danger-soft);
  color: var(--danger);
}

.error-icon .icon {
  width: 30px;
  height: 30px;
}

.error-state h1 {
  margin: 8px 0 9px;
  font-size: 25px;
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.error-state .page-lead {
  max-width: 340px;
  margin: 0 auto;
}

.error-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 6px;
}

.setup-panel {
  margin-top: 18px;
  padding: 14px 15px;
  border: 1px solid rgba(217, 255, 90, 0.14);
  border-radius: 18px;
  background: rgba(217, 255, 90, 0.045);
  text-align: left;
}

.setup-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: var(--accent-text);
  font-size: 11.5px;
  font-weight: 750;
}

.setup-title .icon {
  width: 15px;
  height: 15px;
}

.setup-panel p,
.setup-panel li {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.setup-panel ol {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
}

.setup-panel code {
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px;
}

.setup-panel .text-link {
  margin-top: 10px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding-bottom: 1px;
  border-bottom: 1px solid rgba(217, 255, 90, 0.25);
  color: var(--accent-text);
  font-size: 11.5px;
  font-weight: 650;
  text-decoration: none;
}

.text-link .icon {
  width: 13px;
  height: 13px;
}

/* ——— Expense detail ——— */

.detail-hero {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.detail-flags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.source-badge .icon {
  width: 13px;
  height: 13px;
}

.source-badge--accent {
  border-color: rgba(217, 255, 90, 0.16);
  background: var(--accent-soft);
  color: var(--accent-text);
}

.detail-date {
  color: var(--muted-2);
  font-size: 10.5px;
}

.detail-title {
  margin: 16px 0 8px;
  overflow-wrap: anywhere;
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.detail-amount {
  color: var(--text);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
}

.detail-amount .money-int {
  font-size: 40px;
  font-variant-numeric: tabular-nums;
}

.detail-amount .money-frac {
  opacity: 0.55;
  font-size: 20px;
  font-weight: 700;
}

.detail-amount .money-cur {
  margin-left: 3px;
  opacity: 0.75;
  font-size: 23px;
  font-weight: 700;
}

.detail-project {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
}

.detail-project .icon {
  width: 13px;
  height: 13px;
  color: var(--muted-2);
}

.detail-merchant {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-elev);
}

.detail-merchant strong {
  font-size: 12px;
  font-weight: 650;
}

.detail-merchant span {
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.45;
}

.detail-section {
  padding-top: 20px;
}

.detail-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.detail-section-head h4 {
  margin: 0;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.detail-section-head span {
  color: var(--muted-2);
  font-size: 10.5px;
}

.detail-items {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-elev);
}

.detail-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}

.detail-item:last-child {
  border-bottom: 0;
}

.detail-item-main {
  flex: 1;
  min-width: 0;
}

.detail-item-name {
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.detail-item-sub {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 10px;
}

.detail-item-side {
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
}

.detail-item-total {
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.detail-total {
  padding: 13px 14px 2px;
}

.detail-total > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 700;
}

.detail-total span:first-child {
  color: var(--muted);
}

.detail-vat {
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 11px !important;
  font-weight: 500 !important;
}

.detail-no-items {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-elev);
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.5;
}

.detail-no-items .icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  color: var(--muted);
}

.detail-no-items p {
  margin: 0;
}

.detail-actions {
  padding-top: 22px;
}

.detail-actions .btn {
  height: 48px;
  font-size: 12.5px;
}

.fiscal-block {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.fiscal-block summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 0;
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 650;
  list-style: none;
  cursor: pointer;
}

.fiscal-block summary::-webkit-details-marker {
  display: none;
}

.fiscal-block summary .icon {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.fiscal-block[open] summary .icon {
  transform: rotate(180deg);
}

.fiscal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  margin-top: 12px;
}

.fiscal-grid > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fiscal-grid span {
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.fiscal-grid b {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  word-break: break-all;
}

/* ——— Profile ——— */

.profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0 22px;
  text-align: center;
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin-bottom: 14px;
  border: 1px solid rgba(217, 255, 90, 0.25);
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(217, 255, 90, 0.2), rgba(217, 255, 90, 0.06));
  color: var(--accent-text);
  font-size: 29px;
  font-weight: 800;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 20px 40px -24px rgba(217, 255, 90, 0.4);
}

.profile-name {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.profile-email {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  word-break: break-word;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-bottom: 9px;
}

.stat-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 78px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.stat-value {
  font-size: 21px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.stat-value--money {
  color: var(--accent-text);
  font-size: 19px;
}

.stat-label {
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.stat-tile--total {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.settings-card {
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 15px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.16s ease;
}

.settings-row:last-child {
  border-bottom: 0;
}

.settings-row--static {
  cursor: default;
}

.settings-row--theme {
  gap: 10px;
}

.theme-switch {
  display: inline-flex;
  flex-shrink: 0;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-elev);
}

.theme-option {
  display: grid;
  place-items: center;
  width: 38px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted-2);
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.theme-option .icon {
  width: 16px;
  height: 16px;
}

.theme-option.is-active {
  background: var(--surface-3);
  color: var(--accent-text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.theme-option:hover {
  color: var(--text);
}

.pref-switch {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-3);
  transition: background 0.18s ease, border-color 0.18s ease;
}

.pref-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform 0.18s ease, background 0.18s ease;
}

.pref-switch.is-on {
  border-color: rgba(217, 255, 90, 0.45);
  background: var(--accent);
}

.pref-switch.is-on::after {
  background: var(--accent-ink);
  transform: translateX(18px);
}

.settings-icon {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--surface-3);
  color: var(--muted);
}

.settings-icon .icon {
  width: 17px;
  height: 17px;
}

.settings-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.settings-title {
  font-size: 12.5px;
  font-weight: 650;
}

.settings-sub {
  color: var(--muted-2);
  font-size: 10px;
}

.status-badge {
  padding: 5px 8px;
  border: 1px solid rgba(255, 196, 107, 0.15);
  border-radius: 999px;
  background: rgba(255, 196, 107, 0.1);
  color: var(--warning);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-badge.is-on {
  border-color: rgba(217, 255, 90, 0.16);
  background: var(--accent-soft);
  color: var(--accent-text);
}

.settings-chevron {
  display: grid;
  place-items: center;
  color: var(--muted-2);
}

.settings-chevron .icon {
  width: 15px;
  height: 15px;
}

.logout-button {
  height: 50px;
  margin-top: 16px;
  font-size: 13px;
}

.profile-footer {
  margin: 26px 0 0;
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: 0.02em;
  text-align: center;
}

.info-sheet p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.info-status {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
}

.info-status.is-on {
  border-color: rgba(217, 255, 90, 0.16);
  background: var(--accent-soft);
}

.info-status-icon {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--warning);
}

.info-status-icon .icon {
  width: 17px;
  height: 17px;
}

.info-status.is-on .info-status-icon {
  color: var(--accent-text);
}

.info-status strong {
  display: block;
  margin-bottom: 2px;
  font-size: 12px;
  font-weight: 700;
}

.info-status span {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.45;
}

.info-note {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  margin-bottom: 0 !important;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: var(--muted-2) !important;
  font-size: 10.5px !important;
}

.info-note .icon {
  flex-shrink: 0;
  width: 13px;
  height: 13px;
  margin-top: 1px;
}

/* ——— Bottom nav ——— */

.bottom-nav {
  position: fixed;
  bottom: calc(12px + var(--safe-bottom));
  left: 50%;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(calc(100% - 24px), 508px);
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 26px;
  background: rgba(15, 17, 11, 0.84);
  box-shadow:
    0 24px 50px -20px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.045);
  transform: translateX(-50%);
  backdrop-filter: blur(24px) saturate(1.25);
  -webkit-backdrop-filter: blur(24px) saturate(1.25);
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.nav-item {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 48px;
  padding: 5px 0 3px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--muted-2);
  font: inherit;
  font-size: 9.5px;
  font-weight: 650;
  cursor: pointer;
  transition: color 0.18s ease;
}

.nav-item .icon {
  width: 22px;
  height: 22px;
  stroke-width: 1.7;
}

.nav-item.is-active {
  color: var(--text);
}

.nav-item.is-active .icon {
  color: var(--accent-text);
}

.nav-scan {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: -20px 10px 0;
  border: 0;
  border-radius: 20px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  box-shadow: 0 14px 30px -10px rgba(217, 255, 90, 0.5);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.nav-scan .icon {
  width: 25px;
  height: 25px;
  stroke-width: 2;
}

.nav-scan.is-active {
  box-shadow:
    0 0 0 4px rgba(217, 255, 90, 0.13),
    0 14px 30px -10px rgba(217, 255, 90, 0.5);
}

.nav-scan:active {
  transform: scale(0.95);
}

/* ——— Media / hover ——— */

@media (hover: hover) {
  .project-card:hover {
    border-color: var(--line-strong);
    background: linear-gradient(160deg, var(--surface-3), var(--surface-2));
    transform: translateY(-1px);
  }

  .expense-row:hover {
    border-color: var(--line-strong);
    background: var(--surface-2);
  }

  .add-project:hover {
    border-color: rgba(217, 255, 90, 0.3);
    background: rgba(217, 255, 90, 0.03);
    color: var(--text);
  }

  .icon-btn:hover {
    border-color: var(--line-strong);
    background: var(--surface-2);
  }

  .settings-row:hover {
    background: rgba(255, 255, 255, 0.025);
  }

  .settings-row--static:hover {
    background: transparent;
  }

  .nav-item:hover {
    color: var(--text);
  }

  .btn-primary:hover {
    background: #e4ff7e;
  }

  .btn-secondary:hover {
    border-color: var(--line-strong);
    background: var(--surface-3);
  }

  .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
  }

  .scan-frame:hover {
    border-color: rgba(217, 255, 90, 0.5);
    background:
      radial-gradient(80% 60% at 50% 42%, rgba(217, 255, 90, 0.1), transparent 62%),
      linear-gradient(160deg, var(--surface-3), var(--surface-2));
  }

  .chip:hover {
    border-color: var(--line-strong);
    color: var(--text);
  }

  .chip.is-active:hover {
    border-color: rgba(217, 255, 90, 0.65);
    color: var(--accent-text);
  }
}

@media (max-width: 380px) {
  .app {
    padding-right: 14px;
    padding-left: 14px;
  }

  .hero {
    padding: 18px;
    border-radius: 26px;
  }

  .hero-amount {
    margin: 16px 0;
  }

  .hero-pill {
    padding: 7px 10px;
    font-size: 10.5px;
  }

  .project-card {
    gap: 11px;
    padding: 12px;
  }

  .project-badge {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 17px;
  }

  .project-sum {
    font-size: 13px;
  }

  .project-actions .btn {
    font-size: 12px;
    padding: 0 8px;
  }

  .auth-card {
    padding: 15px;
  }

  .auth-float {
    display: none;
  }

  .scan-frame {
    border-radius: 24px;
  }

  .sheet {
    padding-right: 16px;
    padding-left: 16px;
  }

  .stat-tile {
    padding: 12px;
  }

  .status-badge {
    display: none;
  }
}

@media (max-height: 740px) {
  .auth-page {
    justify-content: flex-start;
  }

  .auth-hero {
    margin-bottom: 18px;
  }

  .auth-logo {
    width: 52px;
    height: 52px;
    margin-bottom: 12px;
    border-radius: 17px;
  }

  .auth-wordmark {
    font-size: 27px;
  }

  .auth-tagline {
    margin-top: 8px;
    font-size: 11.5px;
  }
}

@media (min-width: 620px) {
  .sheet-layer {
    align-items: center;
    padding: 24px;
  }

  .sheet {
    max-height: 84dvh;
    border-bottom: 1px solid var(--line);
    border-radius: 28px;
  }

  .sheet-grabber {
    display: none;
  }
}

@media (min-width: 760px), (pointer: fine) {
  html {
    overflow-y: scroll;
  }
}

@media (min-width: 760px) {
  .app {
    padding-bottom: 120px;
  }

  .bottom-nav {
    bottom: 18px;
  }
}

/* ——— Light theme ——— */

:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f3f5ec;
  --bg-elev: #f8faf2;
  --surface: #ffffff;
  --surface-2: #e9eee0;
  --surface-3: #dde4d0;
  --line: rgba(24, 33, 12, 0.1);
  --line-strong: rgba(24, 33, 12, 0.17);
  --text: #171b10;
  --muted: #5e6553;
  --muted-2: #737a67;
  --accent-text: #4f6b00;
  --accent-soft: rgba(126, 160, 20, 0.13);
  --danger: #bb3f35;
  --danger-soft: rgba(187, 63, 53, 0.09);
  --warning: #965500;
  --sky: #236c9e;
}

:root[data-theme='light'] body {
  background:
    radial-gradient(120% 65% at 50% -18%, rgba(176, 205, 58, 0.2), transparent 55%),
    radial-gradient(80% 55% at 112% 18%, rgba(84, 181, 150, 0.08), transparent 60%),
    var(--bg);
}

:root[data-theme='light'] body::after {
  opacity: 0.018;
}

:root[data-theme='light'] ::selection {
  background: rgba(79, 107, 0, 0.18);
  color: var(--text);
}

:root[data-theme='light'] .avatar {
  border-color: rgba(79, 107, 0, 0.2);
  background: linear-gradient(145deg, rgba(177, 208, 57, 0.28), rgba(177, 208, 57, 0.08));
  color: var(--accent-text);
}

:root[data-theme='light'] .hero {
  box-shadow:
    0 24px 50px -34px rgba(84, 108, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

:root[data-theme='light'] .skeleton {
  background: var(--surface);
}

:root[data-theme='light'] .skeleton::after {
  background: linear-gradient(90deg, transparent, rgba(24, 33, 12, 0.05), transparent);
}

:root[data-theme='light'] .skeleton-hero {
  border-color: rgba(79, 107, 0, 0.1);
  background: linear-gradient(145deg, rgba(181, 214, 55, 0.22), rgba(181, 214, 55, 0.06));
}

:root[data-theme='light'] .project-card {
  background: linear-gradient(160deg, #ffffff, #f7f9f1);
}

:root[data-theme='light'] .project-card:hover {
  border-color: var(--line-strong);
  background: linear-gradient(160deg, #ffffff, #eef3e4);
}

:root[data-theme='light'] .project-badge {
  border-color: color-mix(in srgb, var(--pa) 32%, transparent);
  background: color-mix(in srgb, var(--pa) 20%, #ffffff);
  color: color-mix(in srgb, var(--pa) 55%, #182006);
}

:root[data-theme='light'] .add-project {
  background: rgba(255, 255, 255, 0.55);
}

:root[data-theme='light'] .add-project:hover {
  border-color: rgba(79, 107, 0, 0.3);
  background: #ffffff;
}

:root[data-theme='light'] .empty-projects {
  background: linear-gradient(180deg, #ffffff, #f6f9ee);
}

:root[data-theme='light'] .project-hero {
  border-color: color-mix(in srgb, var(--pa) 25%, var(--line));
  background:
    radial-gradient(130% 105% at 92% -10%, color-mix(in srgb, var(--pa) 32%, transparent), transparent 55%),
    linear-gradient(165deg, #ffffff 0%, #f4f7ea 72%);
  box-shadow: 0 18px 44px -36px rgba(31, 42, 12, 0.35);
}

:root[data-theme='light'] .project-hero::after {
  background: color-mix(in srgb, var(--pa) 12%, transparent);
}

:root[data-theme='light'] .project-hero-edit {
  background: rgba(255, 255, 255, 0.72);
}

:root[data-theme='light'] .project-hero-edit:hover {
  background: #ffffff;
}

:root[data-theme='light'] .meta-chip {
  background: rgba(24, 33, 12, 0.04);
}

:root[data-theme='light'] .expense-row {
  background: var(--surface);
}

:root[data-theme='light'] .expense-row:hover {
  background: var(--bg-elev);
}

:root[data-theme='light'] .expense-icon {
  border-color: rgba(24, 33, 12, 0.04);
}

:root[data-theme='light'] .expense-icon.is-receipt {
  border-color: rgba(79, 107, 0, 0.12);
}

:root[data-theme='light'] .empty-history {
  background: rgba(255, 255, 255, 0.55);
}

:root[data-theme='light'] .load-more-count {
  background: rgba(24, 33, 12, 0.06);
}

:root[data-theme='light'] .btn-primary {
  box-shadow: 0 12px 28px -16px rgba(84, 108, 0, 0.5);
}

:root[data-theme='light'] .btn-secondary {
  background: #ffffff;
}

:root[data-theme='light'] .btn-secondary:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

:root[data-theme='light'] .btn-ghost:hover {
  background: rgba(24, 33, 12, 0.045);
}

:root[data-theme='light'] .btn-danger {
  color: #ffffff;
}

:root[data-theme='light'] .input {
  background: #f7f9f2;
}

:root[data-theme='light'] .input:focus {
  border-color: rgba(79, 107, 0, 0.5);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(79, 107, 0, 0.08);
}

:root[data-theme='light'] .form-error {
  border-color: rgba(187, 63, 53, 0.16);
  color: #8d2a22;
}

:root[data-theme='light'] .auth-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 240, 0.94));
  box-shadow:
    0 30px 70px -40px rgba(31, 42, 12, 0.35),
    inset 0 1px 0 #ffffff;
}

:root[data-theme='light'] .auth-tabs {
  background: #e9eee0;
}

:root[data-theme='light'] .auth-tab.is-active {
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(31, 42, 12, 0.08);
}

:root[data-theme='light'] .auth-grid {
  background-image:
    linear-gradient(rgba(24, 33, 12, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 33, 12, 0.04) 1px, transparent 1px);
}

:root[data-theme='light'] .auth-orb--one {
  background: rgba(174, 204, 46, 0.22);
}

:root[data-theme='light'] .auth-orb--two {
  background: rgba(84, 181, 150, 0.08);
}

:root[data-theme='light'] .auth-float {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 34px -26px rgba(31, 42, 12, 0.4);
}

:root[data-theme='light'] .auth-float i {
  background: rgba(24, 33, 12, 0.1);
}

:root[data-theme='light'] .auth-float i:first-child {
  background: rgba(126, 160, 20, 0.35);
}

:root[data-theme='light'] .auth-logo {
  box-shadow:
    0 18px 40px -20px rgba(84, 108, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

:root[data-theme='light'] .sheet {
  border-color: var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f7f9f1 100%);
  box-shadow: 0 -30px 80px rgba(31, 42, 12, 0.18);
}

:root[data-theme='light'] .sheet-backdrop {
  background: rgba(22, 29, 12, 0.32);
}

:root[data-theme='light'] .sheet-grabber {
  background: rgba(24, 33, 12, 0.18);
}

:root[data-theme='light'] .sheet-close {
  background: #ffffff;
}

:root[data-theme='light'] .sheet-close:hover {
  background: var(--surface-2);
}

:root[data-theme='light'] .toast {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 40px -24px rgba(31, 42, 12, 0.32);
}

:root[data-theme='light'] .bottom-nav {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.88);
  box-shadow:
    0 24px 50px -24px rgba(31, 42, 12, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

:root[data-theme='light'] .nav-scan {
  box-shadow: 0 14px 30px -14px rgba(84, 108, 0, 0.55);
}

:root[data-theme='light'] .scanner-alert {
  border-color: rgba(150, 85, 0, 0.18);
  background: rgba(255, 244, 224, 0.85);
}

:root[data-theme='light'] .scanner-alert-icon {
  background: rgba(150, 85, 0, 0.08);
}

:root[data-theme='light'] .scan-frame {
  border-color: rgba(79, 107, 0, 0.32);
  background:
    radial-gradient(80% 60% at 50% 42%, rgba(126, 160, 20, 0.14), transparent 62%),
    linear-gradient(160deg, #ffffff, #f5f8ed);
}

:root[data-theme='light'] .scan-frame:hover {
  border-color: rgba(79, 107, 0, 0.5);
  background:
    radial-gradient(80% 60% at 50% 42%, rgba(126, 160, 20, 0.18), transparent 62%),
    linear-gradient(160deg, #ffffff, #f0f5e4);
}

:root[data-theme='light'] .scan-corner {
  border-color: rgba(79, 107, 0, 0.55);
}

:root[data-theme='light'] .scan-frame-badge {
  border-color: rgba(79, 107, 0, 0.16);
  background: var(--accent-soft);
}

:root[data-theme='light'] .scan-camera-icon {
  box-shadow: 0 18px 40px -20px rgba(84, 108, 0, 0.4);
}

:root[data-theme='light'] .manual-qr {
  background: rgba(255, 255, 255, 0.7);
}

:root[data-theme='light'] .chip.is-active {
  border-color: rgba(79, 107, 0, 0.45);
}

:root[data-theme='light'] .chip.is-active:hover {
  border-color: rgba(79, 107, 0, 0.6);
  color: var(--accent-text);
}

:root[data-theme='light'] .processing-card {
  background: var(--surface);
}

:root[data-theme='light'] .solo-scan {
  background:
    radial-gradient(circle at 50% 45%, rgba(126, 160, 20, 0.12), transparent 60%),
    var(--surface);
}

:root[data-theme='light'] .review-hero {
  border-color: rgba(79, 107, 0, 0.16);
  background:
    radial-gradient(130% 100% at 90% -10%, rgba(174, 204, 46, 0.2), transparent 55%),
    linear-gradient(165deg, #ffffff, #f5f8ed);
}

:root[data-theme='light'] .review-status {
  border-color: rgba(79, 107, 0, 0.18);
  background: var(--accent-soft);
}

:root[data-theme='light'] .review-items-card {
  background: var(--surface);
}

:root[data-theme='light'] .review-summary {
  background: var(--bg-elev);
}

:root[data-theme='light'] .setup-panel {
  border-color: rgba(79, 107, 0, 0.16);
  background: rgba(126, 160, 20, 0.07);
}

:root[data-theme='light'] .setup-panel code {
  background: rgba(24, 33, 12, 0.06);
}

:root[data-theme='light'] .text-link {
  border-bottom-color: rgba(79, 107, 0, 0.3);
}

:root[data-theme='light'] .detail-merchant,
:root[data-theme='light'] .detail-items,
:root[data-theme='light'] .detail-no-items {
  background: var(--bg-elev);
}

:root[data-theme='light'] .source-badge {
  background: var(--surface-2);
}

:root[data-theme='light'] .source-badge--accent {
  background: var(--accent-soft);
}

:root[data-theme='light'] .profile-avatar {
  border-color: rgba(79, 107, 0, 0.25);
  background: linear-gradient(145deg, rgba(177, 208, 57, 0.3), rgba(177, 208, 57, 0.1));
  color: var(--accent-text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 20px 40px -26px rgba(84, 108, 0, 0.35);
}

:root[data-theme='light'] .settings-icon {
  background: var(--surface-2);
}

:root[data-theme='light'] .settings-row:hover {
  background: rgba(24, 33, 12, 0.03);
}

:root[data-theme='light'] .settings-row--static:hover {
  background: transparent;
}

:root[data-theme='light'] .status-badge {
  background: rgba(150, 85, 0, 0.08);
}

:root[data-theme='light'] .status-badge.is-on {
  background: var(--accent-soft);
}

:root[data-theme='light'] .info-status {
  background: var(--bg-elev);
}

:root[data-theme='light'] .info-status.is-on {
  background: var(--accent-soft);
}

:root[data-theme='light'] .info-status-icon {
  background: rgba(24, 33, 12, 0.05);
}

:root[data-theme='light'] .theme-switch {
  background: var(--surface-2);
}

:root[data-theme='light'] .theme-option.is-active {
  background: #ffffff;
  color: var(--accent-text);
  box-shadow: 0 1px 4px rgba(31, 42, 12, 0.12);
}

:root[data-theme='light'] .theme-option:hover {
  color: var(--text);
}

/* ——— Animations ——— */

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes sheetIn {
  from {
    opacity: 0.4;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sheetOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0.3;
    transform: translateY(40%);
  }
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes scanLine {
  0% {
    transform: translateY(0);
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  50% {
    transform: translateY(190px);
    opacity: 1;
  }
  88% {
    opacity: 1;
  }
  100% {
    transform: translateY(0);
    opacity: 0;
  }
}

@keyframes floatY {
  0%,
  100% {
    transform: translateY(0) rotate(-12deg);
  }
  50% {
    transform: translateY(-12px) rotate(-8deg);
  }
}

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