@font-face {
  font-family: "Manrope";
  src: url("assets/manrope.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("assets/fraunces.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}

:root {
  --font-ui: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;

  --bg: #f5f1e8;
  --bg-2: #ece6d8;
  --surface: #ffffff;
  --surface-2: #f6f2ea;
  --ink: #18211c;
  --ink-2: #3d4a42;
  --muted: #6e7a72;
  --line: #e2dcc9;
  --line-strong: #cfc7ae;
  --accent: #0c6b57;
  --accent-soft: #d9efe6;
  --accent-ink: #ffffff;
  --teal: #129a74;
  --teal-soft: #dcf3ea;
  --danger: #c0392b;
  --danger-soft: #fbe8e4;
  --warn: #a97b0d;
  --warn-soft: #f7ecd2;
  --shadow: 0 1px 2px rgba(24, 33, 28, 0.05), 0 6px 20px rgba(24, 33, 28, 0.06);
  --shadow-lg: 0 16px 44px rgba(24, 33, 28, 0.14);
  --radius: 16px;
  --radius-sm: 10px;
}

:root[data-theme="dark"] {
  --bg: #0f1311;
  --bg-2: #161b18;
  --surface: #1a201c;
  --surface-2: #202722;
  --ink: #eef2ec;
  --ink-2: #c6cec6;
  --muted: #93a096;
  --line: #2a322d;
  --line-strong: #3a443e;
  --accent: #34bd90;
  --accent-soft: #123a2e;
  --accent-ink: #06130e;
  --teal: #2cc795;
  --teal-soft: #12382c;
  --danger: #ef6a6a;
  --danger-soft: #3a1d1d;
  --warn: #e5b34d;
  --warn-soft: #3a2d12;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
}

:root[data-contrast="1"] {
  --line: currentColor;
  --line-strong: currentColor;
  --muted: var(--ink-2);
}
:root[data-theme="dark"][data-contrast="1"] {
  --bg: #000000;
  --bg-2: #0a0a0a;
  --surface: #101010;
  --surface-2: #161616;
  --ink: #ffffff;
  --ink-2: #ffffff;
  --line: #ffffff;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html.large { font-size: 19px; }

body {
  margin: 0;
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}

.ic {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.ic.sm { width: 16px; height: 16px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.8rem 1.25rem;
  cursor: pointer;
  min-height: 48px;
  text-decoration: none;
  transition: transform 0.12s ease, background-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 18px rgba(12, 107, 87, 0.28); }
.btn-primary:hover { background: var(--ink); }
.btn-accent { background: var(--ink); color: var(--bg); }
.btn-accent:hover { background: var(--ink-2); }
.btn-ghost { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--line-strong); background: var(--surface-2); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { min-height: 40px; padding: 0.45rem 0.9rem; font-size: 0.85rem; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:active { transform: scale(0.94); }
.icon-btn:hover { background: var(--surface-2); }

.appbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  padding-top: calc(0.6rem + env(safe-area-inset-top));
  background: var(--bg);
  backdrop-filter: saturate(1.3) blur(14px);
  -webkit-backdrop-filter: saturate(1.3) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); }
.brand-mark { width: 40px; height: 40px; flex: none; }
.brand-mark svg { width: 100%; height: 100%; display: block; border-radius: 10px; }
.brand-text { font-weight: 800; font-size: 1.02rem; letter-spacing: -0.02em; }
.brand-text em { font-style: normal; color: var(--accent); }
.appbar-actions { display: flex; align-items: center; gap: 0.5rem; }
.install-btn { min-height: 44px; padding: 0.5rem 1rem; font-size: 0.9rem; }

.icon-btn .ic-moon { display: none; }
:root[data-theme="dark"] .icon-btn .ic-moon { display: block; }
:root[data-theme="dark"] .icon-btn .ic-sun { display: none; }

.popover {
  position: absolute;
  top: calc(0.6rem + env(safe-area-inset-top) + 52px);
  right: 1rem;
  z-index: 60;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0.75rem;
  min-width: 240px;
  animation: pop-in 0.18s ease;
}
.popover-head { font-weight: 800; font-size: 0.85rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; padding: 0.25rem 0.5rem 0.5rem; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.5rem; border-radius: 10px; cursor: pointer; }
.switch-row:hover { background: var(--surface-2); }
.switch-row span { font-weight: 600; font-size: 0.92rem; }
.switch { appearance: none; width: 46px; height: 26px; border-radius: 999px; background: var(--line-strong); position: relative; cursor: pointer; transition: background 0.2s ease; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.2s ease; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); }
.switch:checked { background: var(--teal); }
.switch:checked::after { transform: translateX(20px); }

.hero-band {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent-soft), var(--bg) 55%);
  border-bottom: 1px solid var(--line);
}
.hero-band::before {
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  width: 300px;
  height: 300px;
  background-image: radial-gradient(var(--accent) 1.5px, transparent 1.5px);
  background-size: 18px 18px;
  opacity: 0.18;
  pointer-events: none;
}
.hero-band::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--warn), transparent 70%);
  opacity: 0.7;
}
.hero-inner {
  max-width: 920px;
  margin: 0 auto;
  padding: 2.25rem 1rem 2.25rem;
  display: grid;
  gap: 2rem;
  position: relative;
  align-items: center;
}
@media (min-width: 760px) {
  .hero-inner { grid-template-columns: 1.25fr 1fr; }
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.6rem;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.1rem, 7vw, 3.2rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}
.hero-title span { color: var(--accent); }
.hero-summary { color: var(--muted); font-size: 1.02rem; line-height: 1.6; margin: 0 0 1rem; max-width: 58ch; }
.hero-summary .hl {
  color: var(--ink);
  font-weight: 800;
  background: linear-gradient(transparent 58%, var(--accent-soft) 58%);
  padding: 0 0.12em;
  border-radius: 3px;
}
.hero-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1.25rem; padding: 0; list-style: none; }
.hero-chips li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  box-shadow: var(--shadow);
}
.hero-chips li .ic { color: var(--accent); }
.hero-chips li.chip-key { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 12px rgba(12, 107, 87, 0.25); }
.hero-chips li.chip-key .ic { color: var(--accent-ink); }

.hero-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.hero-actions .btn { box-shadow: 0 8px 22px rgba(12, 107, 87, 0.32); }

.hero-credit { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.credit-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.45rem 0.7rem;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.2s ease;
}
.credit-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.credit-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex: none;
  background: var(--accent);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
}
.credit-meta { display: grid; line-height: 1.2; }
.credit-meta b { font-weight: 800; font-size: 0.9rem; }
.credit-meta small { color: var(--muted); font-size: 0.7rem; font-weight: 600; }
.credit-card > .ic { color: var(--muted); }
.credit-fb {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.credit-fb .ic { color: #1877f2; }
.credit-fb:hover { border-color: var(--line-strong); }

.hero-visual { position: relative; justify-self: center; width: min(100%, 320px); }
.hero-total { display: flex; align-items: center; justify-content: center; gap: 0.6rem; margin-bottom: 0.6rem; }
.hero-total-label { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.hero-total-amt {
  font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 0.15rem 0.9rem; box-shadow: var(--shadow);
}
.hero-total-amt .t-hover { display: none; }
.hero-visual.is-expanded .hero-total-amt .t-hover { display: inline; }
.hero-visual.is-expanded .hero-total-amt .t-base { display: none; }
.hero-stack { position: relative; width: 100%; height: 380px; }
.hero-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 0.7rem;
  position: absolute;
  width: 48%;
  transition: transform 0.35s ease, opacity 0.35s ease, left 0.35s ease, top 0.35s ease;
}
.hero-card.hc-back { top: 0; left: 0; transform: rotate(-6deg); z-index: 1; }
.hero-card.hc-third { top: 0; left: 52%; transform: rotate(6deg); opacity: 0; z-index: 0; pointer-events: none; }
.hero-card.hc-front { top: 150px; left: 52%; transform: rotate(6deg); z-index: 2; }
.hero-visual.is-expanded .hero-card.hc-third { opacity: 1; z-index: 1; }
.hero-visual.is-expanded .hero-card.hc-front { top: 160px; left: 26%; transform: rotate(0deg); }
.hero-card.is-paid { border-color: var(--teal); }
.hero-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; }
.hero-card-brand { font-weight: 800; font-size: 0.82rem; }
.hero-card-amt { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: var(--accent); }
.hero-card.is-paid .hero-card-amt { color: var(--teal); text-decoration: line-through; opacity: 0.85; }
.hero-qr { background: #fff; border-radius: 10px; padding: 0.5rem; display: flex; align-items: center; justify-content: center; position: relative; }
.hero-qr svg { width: 100%; height: auto; display: block; }
.paid-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  background: rgba(18, 154, 116, 0.16);
  border-radius: 10px;
  color: var(--teal);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.hero-card-hint { display: flex; align-items: center; justify-content: center; gap: 0.4rem; margin: 0.55rem 0 0; font-size: 0.7rem; font-weight: 700; color: var(--muted); }
.hero-card-hint .ic { color: var(--muted); }
.hero-card-hint.paid { color: var(--teal); }
.hero-card-hint.paid .ic { color: var(--teal); }

.tabs {
  position: sticky;
  top: var(--appbar-h, 60px);
  z-index: 40;
  display: flex;
  gap: 0.25rem;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 0.5rem 0.75rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.9rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.tab .ic { width: 18px; height: 18px; }
.tab:hover { background: var(--surface-2); color: var(--ink); }
.tab.is-active { background: var(--ink); color: var(--bg); }

.app { max-width: 860px; margin: 0 auto; padding: 1.25rem 1rem 4rem; }
.panel { display: none; }
.panel.is-active { display: block; animation: panel-in 0.3s ease; }

.panel-intro { margin-bottom: 1.25rem; }
.hero { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.6rem, 5vw, 2.2rem); line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 0.5rem; }
.hero .accent { color: var(--accent); }
.lede { color: var(--muted); font-size: 1rem; margin: 0; max-width: 54ch; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.form-card { padding: 1.1rem; display: grid; gap: 1rem; }
.form-sec { border-top: 1px dashed var(--line); padding-top: 1.1rem; margin-top: 0.2rem; }
.form-sec:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.sec-title { display: flex; align-items: center; gap: 0.6rem; font-size: 1.02rem; font-weight: 800; margin: 0 0 0.9rem; }
.sec-title .num { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 0.85rem; font-weight: 800; }
.sec-title-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }

.field { display: grid; gap: 0.4rem; }
.field label { font-weight: 700; font-size: 0.85rem; color: var(--ink-2); }
.field .hint { font-weight: 500; color: var(--muted); font-size: 0.8rem; }

input[type="text"], input[type="number"] {
  width: 100%;
  font-family: var(--font-ui);
  font-size: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--surface); }
input::placeholder { color: var(--muted); opacity: 0.7; }

.amount-input {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.amount-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--surface); }
.amount-input .cur { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; color: var(--ink); padding: 0 0 0 1rem; display: flex; align-items: center; flex: none; }
.amount-input input { border: none; background: transparent; box-shadow: none; border-radius: 0; padding: 0.8rem 0.9rem 0.8rem 0.5rem; font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }
.amount-input input:focus { border: none; box-shadow: none; background: transparent; }

.vpa-suggest { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; animation: pop-in 0.15s ease; }
.vpa-item { display: flex; align-items: center; gap: 0.6rem; padding: 0.7rem 0.9rem; cursor: pointer; font-size: 0.92rem; }
.vpa-item:hover { background: var(--surface-2); }
.vpa-item .avatar { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 0.8rem; flex: none; }
.vpa-item b { display: block; }
.vpa-item small { color: var(--muted); }

.stepper { display: flex; align-items: center; gap: 0.6rem; }
.stepper input { text-align: center; font-weight: 700; max-width: 84px; }
.step-btn { width: 48px; height: 48px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-size: 1.4rem; font-weight: 700; cursor: pointer; transition: transform 0.12s ease, background 0.2s ease; }
.step-btn:active { transform: scale(0.94); }
.step-btn:disabled, .stepper input:disabled { opacity: 0.45; cursor: not-allowed; }

.auto-split-toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.85rem 0.9rem;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.auto-split-toggle:hover { border-color: var(--accent); }
.auto-split-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.ast-check {
  width: 22px; height: 22px; flex: none; margin-top: 1px;
  border: 2px solid var(--line-strong); border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: transparent; transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.auto-split-toggle input:checked ~ .ast-check { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.ast-body { display: grid; gap: 0.15rem; }
.ast-title { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 800; font-size: 0.9rem; }
.ast-title .ic { color: var(--accent); }
.ast-hint { color: var(--muted); font-size: 0.78rem; line-height: 1.4; }

.split-rows { display: grid; gap: 0.6rem; }
.split-row { display: flex; align-items: center; gap: 0.6rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.5rem 0.7rem; }
.split-row .idx { font-weight: 800; color: var(--muted); width: 1.4rem; flex: none; font-size: 0.9rem; }
.split-row .lbl { flex: 1; min-width: 0; padding: 0.55rem 0.7rem; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--ink); font-family: var(--font-ui); font-size: 0.92rem; }
.split-row .lbl:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.split-row .amt { width: 7rem; flex: none; text-align: right; padding: 0.55rem 0.7rem; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--ink); font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; }
.split-row .amt:focus { outline: none; border-color: var(--accent); background: var(--surface); }

.validation-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; padding: 0.7rem 0.9rem; border-radius: var(--radius-sm); font-size: 0.88rem; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); }
.validation-bar .vb-item b { font-family: var(--font-display); }
.validation-bar.ok { background: var(--teal-soft); border-color: var(--teal); color: var(--teal); }
.validation-bar.bad { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.vb-diff { margin-left: auto; font-weight: 800; }

.qr-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-top: 1rem; }
@media (min-width: 560px) { .qr-grid { grid-template-columns: 1fr 1fr; } }
.qr-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; display: grid; gap: 0.9rem; position: relative; animation: rise 0.35s ease backwards; }
.qr-card.paid { background: var(--teal-soft); border-color: var(--teal); }
.qr-card .card-head { display: flex; align-items: center; gap: 0.6rem; }
.qr-card .card-name { font-weight: 800; font-size: 1.02rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-card .card-amount { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; color: var(--accent); }
.qr-card.paid .card-amount { color: var(--teal); text-decoration: line-through; opacity: 0.7; }
.qr-frame { background: #fff; border-radius: var(--radius-sm); padding: 0.75rem; display: flex; justify-content: center; position: relative; aspect-ratio: 1 / 1; max-width: 240px; margin: 0 auto; width: 100%; }
.qr-frame svg, .qr-frame img { width: 100%; height: 100%; }
.qr-frame .paid-stamp { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(18, 154, 116, 0.18); border-radius: var(--radius-sm); opacity: 0; pointer-events: none; transition: opacity 0.25s ease; }
.qr-card.paid .qr-frame .paid-stamp { opacity: 1; }
.paid-stamp .stamp { border: 3px solid var(--teal); color: var(--teal); font-weight: 800; font-size: 1.4rem; padding: 0.3rem 1rem; border-radius: 12px; transform: rotate(-8deg); letter-spacing: 0.06em; text-transform: uppercase; }
.card-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.5rem 0.8rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; font-size: 0.82rem; cursor: pointer; text-decoration: none; transition: background 0.2s ease, border-color 0.2s ease; -webkit-tap-highlight-color: transparent; }
.chip:hover { background: var(--surface-2); border-color: var(--line-strong); }
.chip.wa { background: #e7f8ec; border-color: #c4ecd7; color: #128a5b; }
:root[data-theme="dark"] .chip.wa { background: #0f2a20; border-color: #17553d; color: #4fd4a4; }
.paid-toggle { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.2rem; cursor: pointer; font-weight: 700; font-size: 0.9rem; }
.paid-toggle input { width: 22px; height: 22px; accent-color: var(--teal); cursor: pointer; }

.summary-bar { position: sticky; top: calc(var(--appbar-h, 60px) + var(--tabs-h, 52px)); z-index: 30; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 0.9rem 1rem; margin: 1rem 0; }
.sb-main { display: flex; gap: 0.5rem; }
.sb-stat { flex: 1; display: grid; gap: 0.1rem; }
.sb-label { font-size: 0.75rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.sb-stat b { font-family: var(--font-display); font-size: 1.25rem; }
.sb-stat b.ok { color: var(--teal); }
.sb-stat b.warn { color: var(--warn); }
.sb-progress { height: 8px; border-radius: 999px; background: var(--surface-2); margin-top: 0.7rem; overflow: hidden; }
.sb-progress-fill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--teal), #34d09a); transition: width 0.4s ease; }
.result-actions { display: flex; gap: 0.6rem; margin: 0.75rem 0; flex-wrap: wrap; }

.history-toolbar { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.history-list { display: grid; gap: 0.8rem; }
.history-item { display: flex; align-items: center; gap: 0.9rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1rem; box-shadow: var(--shadow); }
.history-item .hi-ico { width: 46px; height: 46px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; flex: none; }
.history-item .hi-body { flex: 1; min-width: 0; }
.history-item .hi-title { font-weight: 800; font-size: 0.98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item .hi-meta { color: var(--muted); font-size: 0.8rem; }
.history-item .hi-amount { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; flex: none; }
.history-item .hi-actions { display: flex; gap: 0.3rem; }
.hi-actions .icon-btn { width: 38px; height: 38px; }

.payee-form { margin-bottom: 1.2rem; }
.payee-list { display: grid; gap: 0.7rem; }
.payee-item { display: flex; align-items: center; gap: 0.8rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.7rem 0.9rem; }
.payee-item .avatar { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; flex: none; }
.payee-item .pi-body { flex: 1; min-width: 0; }
.payee-item .pi-name { font-weight: 800; }
.payee-item .pi-vpa { color: var(--muted); font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.color-pick { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.color-swatch { width: 34px; height: 34px; border-radius: 50%; cursor: pointer; border: 3px solid transparent; transition: transform 0.12s ease, border-color 0.12s ease; }
.color-swatch.sel { border-color: var(--ink); transform: scale(1.1); }

.split-templates { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tpl-chip { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.5rem 0.9rem; border-radius: 999px; background: var(--surface); border: 1.5px dashed var(--line-strong); color: var(--ink); font-weight: 700; font-size: 0.85rem; cursor: pointer; transition: background 0.2s ease, border-color 0.2s ease; }
.tpl-chip:hover { background: var(--surface-2); border-color: var(--accent); }
.tpl-chip .x { color: var(--muted); margin-left: 0.2rem; }
.tpl-chip .x:hover { color: var(--danger); }

.seo-section { background: var(--bg-2); border-top: 1px solid var(--line); padding: 2.5rem 1rem 2rem; }
.seo-wrap { max-width: 760px; margin: 0 auto; }
.seo-h { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; letter-spacing: -0.01em; margin: 1.6rem 0 0.7rem; }
.seo-wrap > .seo-h:first-child { margin-top: 0; }
.seo-h3 { font-size: 1.05rem; font-weight: 800; margin: 0 0 0.35rem; }
.seo-p { color: var(--muted); margin: 0 0 0.9rem; font-size: 0.95rem; }
.seo-cols { display: grid; gap: 1.2rem; margin: 1.2rem 0; }
@media (min-width: 640px) { .seo-cols { grid-template-columns: 1fr 1fr 1fr; } }
.faq-item { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); margin-bottom: 0.6rem; padding: 0.2rem 1rem; }
.faq-item summary { cursor: pointer; font-weight: 700; padding: 0.7rem 0; }
.faq-item .seo-p { padding: 0 0 0.8rem; margin: 0; }

.footer { max-width: 860px; margin: 0 auto; padding: 1.5rem 1rem 2.5rem; text-align: center; }
.footer-privacy { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 800; color: var(--teal); margin-bottom: 0.7rem; }
.footer-note { color: var(--muted); font-size: 0.82rem; max-width: 56ch; margin: 0 auto 0.5rem; }
.footer-copy { color: var(--muted); font-size: 0.8rem; margin: 0; }
.footer-copy a { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--ink); font-weight: 700; text-decoration: none; }
.footer-copy a:hover { color: var(--accent); }
.footer-copy a .ic { width: 14px; height: 14px; }

.toast { position: fixed; bottom: calc(84px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 0.7rem 1.2rem; border-radius: 999px; font-weight: 700; font-size: 0.9rem; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity 0.25s ease, transform 0.25s ease; z-index: 100; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(4px); }
.modal[hidden] { display: none; }
.modal-card { position: relative; width: 100%; max-width: 420px; background: var(--surface); border-radius: 24px 24px 0 0; padding: 1.6rem 1.4rem calc(1.4rem + env(safe-area-inset-bottom)); animation: sheet-up 0.28s ease; text-align: center; }
@media (min-width: 640px) { .modal { align-items: center; } .modal-card { border-radius: 24px; } }
.modal-close { position: absolute; top: 0.9rem; right: 0.9rem; }
.modal-icon { margin: 0.2rem auto 0.7rem; width: 72px; height: 72px; }
.modal-title { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; margin: 0 0 0.4rem; }
.modal-text { color: var(--muted); margin: 0 0 1.2rem; }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }

.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty .ic { width: 44px; height: 44px; stroke-width: 1.4; opacity: 0.4; margin-bottom: 0.7rem; }
.empty h3 { color: var(--ink); font-weight: 800; margin: 0 0 0.3rem; }

@keyframes panel-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.96) translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes sheet-up { from { transform: translateY(40px); } to { transform: none; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.tab .ic { transform-origin: center; }
.tab.is-active .ic { animation: wiggle 0.4s ease; }
@keyframes wiggle { 0% { transform: rotate(0) scale(1); } 40% { transform: rotate(-6deg) scale(1.08); } 100% { transform: rotate(0) scale(1); } }

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

@media (min-width: 720px) {
  .app { padding-top: 1.5rem; }
  .tabs { top: auto; position: relative; border: 1px solid var(--line); border-radius: 999px; margin: 1rem auto 0; max-width: 860px; padding: 0.25rem; width: calc(100% - 2rem); }
  .summary-bar { top: var(--appbar-h, 60px); }
}
