/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px;
  border-radius: var(--radius-sm); border: 1px solid transparent; font-weight: 600; text-decoration: none; line-height: 1;
  transition: background 0.15s, border-color 0.15s, transform 0.1s; white-space: nowrap; position: relative;
}
.btn svg { width: 20px; height: 20px; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.noscript { padding: 24px; }
.boot-alert { max-width: 420px; margin: 24px; }
.upper { text-transform: uppercase; }
.btn-primary { background: var(--btn-bg); color: var(--btn-ink); }
.btn-primary:hover:not(:disabled) { background: var(--btn-bg-hover); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover:not(:disabled) { border-color: var(--ink-3); }
.btn-ghost { background: transparent; color: var(--ink-2); padding: 0 12px; min-height: 44px; }
.btn-ghost:hover:not(:disabled) { color: var(--ink); background: var(--accent-soft); }
.btn-on-navy { background: rgb(255 255 255 / 0.12); color: var(--on-navy); border-color: rgb(255 255 255 / 0.22); }
.btn-on-navy:hover { background: rgb(255 255 255 / 0.2); }
.btn-on-navy-solid { background: #fff; color: #0b1f3a; }
.btn-on-navy-solid:hover { background: #e9eef6; }
.btn-block { width: 100%; }
.btn-sm { min-height: 44px; padding: 0 14px; font-size: 0.9375rem; }
.btn-link { font: inherit; font-size: 0.9375rem; background: none; border: 0; padding: 0 10px; margin: -12px -10px -12px 0; min-height: 44px; display: inline-flex; align-items: center; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; border-radius: 8px; }
.btn-link:hover { background: var(--accent-soft); }
.btn[aria-busy="true"] { color: transparent !important; pointer-events: none; }
.btn[aria-busy="true"]::after {
  content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid var(--btn-ink); border-right-color: transparent; animation: spin 0.7s linear infinite;
}
.btn-secondary[aria-busy="true"]::after { border-color: var(--ink); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .field .label { font-weight: 600; font-size: 0.9375rem; }
.field .opt { font-weight: 400; color: var(--ink-3); }
.input {
  width: 100%; min-height: 50px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--surface); transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder { color: var(--ink-3); opacity: 1; }
.input:hover { border-color: var(--ink-3); }
.input:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 28%, transparent); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.hint { font-size: 0.875rem; color: var(--ink-2); }
.error-text { font-size: 0.875rem; color: var(--danger); font-weight: 550; display: flex; gap: 6px; align-items: flex-start; }
.error-text svg { width: 16px; height: 16px; margin-top: 2px; }
.affix { position: relative; }
.affix .prefix { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-2); font-weight: 600; pointer-events: none; }
.affix .input { padding-left: 62px; }
.amount-input { font-size: 2rem; font-weight: 600; min-height: 72px; letter-spacing: -0.02em; }
.affix .amount-input { padding-left: 76px; }
.affix .prefix.big { font-size: 1.125rem; left: 18px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 520px) { .row-2 { grid-template-columns: 1fr; } }
.form-stack { display: flex; flex-direction: column; gap: 20px; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23596579' stroke-width='2'%3E%3Cpath d='m1 1 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }

/* Cards / surfaces */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-pad { padding: clamp(18px, 3vw, 28px); }
.alert { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger); font-weight: 500; }
.alert svg { width: 20px; height: 20px; margin-top: 2px; }
.alert .btn { margin-top: 10px; }
.alert.is-info { background: var(--accent-soft); color: var(--ink); }
.alert.is-warn { background: var(--pending-bg); color: var(--pending-ink); }
.alert-body { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.alert-body strong { font-weight: 650; }

/* Status chips: colour plus icon plus text */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 7px; border-radius: 999px; font-size: 0.8125rem; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.chip svg { width: 14px; height: 14px; }
.chip-pending { background: var(--pending-bg); color: var(--pending-ink); }
.chip-settled { background: var(--settled-bg); color: var(--settled-ink); }
.chip-failed { background: var(--failed-bg); color: var(--failed-ink); }
.chip-declined { background: var(--declined-bg); color: var(--declined-ink); }
.chip-active { background: var(--settled-bg); color: var(--settled-ink); }
.chip-frozen { background: #dbeafe; color: #1d3f78; }
.chip-unknown { background: var(--declined-bg); color: var(--declined-ink); }
.chip-reversed { background: var(--declined-bg); color: var(--declined-ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip-frozen { background: #17304f; color: #a9ccff; } }
.chip-pending svg { animation: tick 2.4s linear infinite; }
@keyframes tick { to { transform: rotate(360deg); } }

/* Entity switcher */
.switcher { position: relative; }
.switch-btn {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; text-align: left; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); min-height: 56px;
}
.switch-btn:hover { border-color: var(--ink-3); }
.avatar { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--navy); color: var(--on-navy); font-weight: 700; font-size: 0.875rem; flex: none; }
.switch-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.switch-text strong { font-size: 0.9375rem; font-weight: 600; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.switch-text span { font-size: 0.8125rem; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switch-btn > svg { width: 18px; height: 18px; color: var(--ink-3); }
.switch-menu {
  position: absolute; z-index: 50; left: 0; top: calc(100% + 6px); padding: 6px; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 20px 40px -16px rgb(12 26 48 / 0.35);
  width: max-content; min-width: 100%; max-width: min(340px, calc(100vw - 24px));
}
.switch-menu .switch-text span { white-space: normal; overflow: visible; }
.switch-menu button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px; border: 0; background: transparent; border-radius: 10px; text-align: left; }
.switch-menu button:hover, .switch-menu button:focus-visible { background: var(--accent-soft); }
.switch-menu button[aria-checked="true"] .check { visibility: visible; }
.switch-menu .check { margin-left: auto; width: 18px; height: 18px; color: var(--accent); visibility: hidden; }
.cur-pill { display: none; flex: none; min-width: 40px; height: 32px; padding: 0 6px; border-radius: 10px; place-items: center; background: var(--navy); color: var(--on-navy); font-weight: 700; font-size: 0.8125rem; letter-spacing: 0.02em; }
@media (max-width: 420px) {
  .side .switch-btn .avatar, .side .switch-btn > .switch-text > span { display: none; }
  .side .switch-btn .cur-pill { display: grid; }
  .demo-toggle .demo-short { display: none; }
  .demo-toggle { padding: 4px 8px; }
}
@media (max-width: 768px) {
  .switch-btn { min-height: 48px; padding: 6px 10px; }
  .avatar { width: 32px; height: 32px; }
  .switch-menu { position: fixed; left: 12px; right: 12px; top: 68px; width: auto; max-width: none; }
}

/* Hero balance */
.hero {
  position: relative; border-radius: 24px; padding: clamp(22px, 4vw, 36px); color: var(--on-navy);
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--accent) 24%, transparent) 0%, transparent 52%), var(--navy);
  box-shadow: 0 24px 48px -28px rgb(11 31 58 / 0.7);
}
.hero::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.1); pointer-events: none; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--on-navy-2); font-size: 0.9375rem; flex-wrap: wrap; }
.hero-label { font-size: 0.9375rem; font-weight: 550; letter-spacing: 0.01em; color: inherit; }
.updated { font-size: 0.8125rem; color: var(--on-navy-2); }
.updated.is-stale { color: #ffd27a; }
.hero-amount { margin-top: 10px; font-size: clamp(2.5rem, 1.6rem + 4.2vw, 4rem); line-height: 1.05; font-weight: 600; letter-spacing: -0.035em; display: flex; align-items: baseline; gap: 10px; flex-wrap: nowrap; min-width: 0; min-height: 1.1em; }
.hero-amount .num-main { white-space: nowrap; }
.hero-amount .cur { font-size: 0.4em; font-weight: 600; color: var(--on-navy-2); letter-spacing: 0; }
.hero-amount .dec { font-size: 0.55em; color: var(--on-navy-2); font-weight: 500; }
.hero-stats { margin-top: 26px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; padding-top: 22px; border-top: 1px solid rgb(255 255 255 / 0.14); }
.stat dt { font-size: 0.875rem; color: var(--on-navy-2); font-weight: 550; }
.stat { min-width: 0; }
.stat dd { overflow-wrap: anywhere; margin: 2px 0 0; font-size: 1.375rem; font-weight: 600; letter-spacing: -0.015em; }
.stat .help { display: block; margin-top: 4px; font-size: 0.8125rem; color: var(--on-navy-2); font-weight: 400; letter-spacing: 0; line-height: 1.4; }
.hero-actions { margin-top: 26px; display: flex; gap: 12px; flex-wrap: wrap; }
@media (max-width: 520px) { .hero-stats { grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 20px; padding-top: 18px; } .stat dd { font-size: 1.125rem; } .hero-actions { flex-wrap: nowrap; margin-top: 20px; } .hero-actions .btn { flex: 1; padding: 0 12px; } }

/* Activity list */
.activity { overflow: clip; }
.day-head { position: sticky; top: var(--bar-h, 0px); z-index: 2; padding: 8px clamp(14px, 3vw, 24px); font-size: 0.8125rem; font-weight: 650; letter-spacing: 0.03em; text-transform: uppercase; color: var(--ink-2); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.day-group + .day-group .day-head { border-top: 1px solid var(--line); }
.tx { position: relative; }
.tx + .tx { border-top: 1px solid var(--line); }
.tx-hit, .tx-skel { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px clamp(14px, 3vw, 24px); min-height: 78px; }
.tx-hit { width: 100%; text-align: left; background: transparent; border: 0; color: inherit; font: inherit; }
.tx-hit:hover { background: var(--surface-2); }
.tx-hit:focus-visible { outline-offset: -3px; border-radius: 0; }
.tx-icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.tx-icon svg { width: 20px; height: 20px; }
.tx.dir-in .tx-icon { background: var(--settled-bg); color: var(--settled-ink); border-color: transparent; }
.tx.dir-in.is-failed .tx-icon { background: var(--surface-2); color: var(--ink-2); border-color: var(--line); }
.tx-main { min-width: 0; display: flex; flex-direction: column; }
.tx-main.gap-8 { gap: 8px; }
.tx-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-meta { font-size: 0.875rem; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-hit .tx-meta { display: flex; }
.tx-desc { flex: 0 3 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: pre; }
.tx-hit .tx-meta time { flex: none; white-space: pre; }
.tx-type { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: pre; }
.tx-hit .decline-note { display: block; white-space: normal; }
@media (max-width: 480px) { .tx-desc { display: none; } }
.decline-note { color: var(--declined-ink); font-weight: 550; }
.tx-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.tx-amount { font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; }
.tx.dir-in .tx-amount { color: var(--settled-ink); }
.tx.is-failed .tx-amount, .tx.is-declined .tx-amount, .tx-amount.is-declined { text-decoration: line-through; color: var(--ink-3); font-weight: 550; }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; overflow: hidden; background: transparent; pointer-events: none; }
.progress::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 35%; background: linear-gradient(90deg, transparent, var(--accent), transparent); animation: slide 1.6s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.tx.flash { animation: flash 1.4s ease-out; }
@keyframes flash { from { background: var(--accent-soft); } }
@media (max-width: 420px) { .tx-hit, .tx-skel { grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; } .tx-icon { width: 38px; height: 38px; } }
.more-row { display: flex; justify-content: center; margin-top: 14px; }

.empty { padding: 44px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .art { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.empty .art svg { width: 28px; height: 28px; }
.empty p { color: var(--ink-2); max-width: 36ch; }
.empty .btn { margin-top: 8px; }

/* Skeletons */
.skel { display: block; border-radius: 8px; background: linear-gradient(90deg, var(--line) 0%, var(--surface-2) 50%, var(--line) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.hero .skel { background: linear-gradient(90deg, rgb(255 255 255 / 0.1), rgb(255 255 255 / 0.2), rgb(255 255 255 / 0.1)); background-size: 200% 100%; }

/* Send flow */
.sheet { width: 100%; max-width: 580px; margin-inline: auto; display: flex; flex-direction: column; gap: 22px; }
.sheet-head { display: flex; align-items: center; gap: 8px; }
.back { display: inline-flex; align-items: center; gap: 4px; margin-left: -10px; }
.back svg { width: 18px; height: 18px; }
.steps { display: flex; gap: 8px; margin-left: auto; align-items: center; font-size: 0.875rem; color: var(--ink-2); }
.steps ol { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.steps li { width: 28px; height: 6px; border-radius: 3px; background: var(--line-strong); }
.steps li.done { background: var(--accent); }
.review dl { margin: 0; display: grid; gap: 0; }
.review .line { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.review .line:first-child { border-top: 0; }
.review dt { color: var(--ink-2); }
.review dd { margin: 0; display: flex; align-items: baseline; justify-content: flex-end; gap: 12px; text-align: right; font-weight: 550; overflow-wrap: anywhere; min-width: 0; }
.review .line-val { font-variant-numeric: tabular-nums; }
.review .after dd { font-weight: 500; color: var(--ink-2); }
.review .after dd, .review .total dd { white-space: nowrap; }
.review .line dt { min-width: 0; }
.cta-bar { position: sticky; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 5; display: flex; flex-direction: column; gap: 10px; padding: 14px 0 2px; background: linear-gradient(to bottom, transparent, var(--bg) 16px); }
.review .total dd { font-size: 1.5rem; letter-spacing: -0.02em; font-weight: 650; }
.avail { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 0.9375rem; }
.avail strong { font-weight: 650; }
.btn-row { display: flex; gap: 12px; }
.btn-row .btn { flex: 1; }
.btn-row.full { width: 100%; margin-top: 10px; }
.timeline { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; width: 100%; max-width: 320px; text-align: left; }
.timeline li { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 0.9375rem; }
.timeline svg { width: 18px; height: 18px; }
.timeline .is-done { color: var(--settled-ink); font-weight: 550; }
.timeline .is-current { color: var(--pending-ink); font-weight: 600; }
.timeline .is-failed { color: var(--failed-ink); font-weight: 600; }
.receipt { width: 100%; margin: 6px 0 0; display: grid; border-top: 1px solid var(--line); }
.receipt-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 0.875rem; text-align: left; }
.receipt dt { color: var(--ink-2); }
.receipt dd { margin: 0; display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; text-align: right; }
.receipt-val { overflow-wrap: anywhere; min-width: 0; }
.receipt-id { font-family: var(--mono); letter-spacing: 0.04em; font-size: 0.8125rem; overflow-wrap: anywhere; }
.copy-btn { padding: 0 10px; min-height: 44px; font-size: 0.8125rem; }
.copy-btn svg { width: 16px; height: 16px; }
.result { text-align: center; align-items: center; display: flex; flex-direction: column; gap: 14px; }
.result-icon { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; }
.result-icon svg { width: 38px; height: 38px; }
.result-icon.pending { background: var(--pending-bg); color: var(--pending-ink); position: relative; }
.result-icon.pending::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--pending-ink); border-right-color: transparent; border-bottom-color: transparent; opacity: 0.5; animation: spin 1.6s linear infinite; }
.result-icon.settled { background: var(--settled-bg); color: var(--settled-ink); animation: pop 0.4s ease-out; }
.result-icon.failed { background: var(--failed-bg); color: var(--failed-ink); }
@keyframes pop { from { transform: scale(0.7); opacity: 0; } }
.result p { color: var(--ink-2); max-width: 40ch; }
.result .amount-big { font-size: 2.25rem; font-weight: 650; letter-spacing: -0.03em; }

/* Cards */
.card-wrap { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 860px) { .card-wrap { grid-template-columns: minmax(0, 1fr); } }
.vcard {
  position: relative; aspect-ratio: 1.586; width: 100%; max-width: 400px; border-radius: 22px; padding: 22px 24px; color: #f4f7fb; overflow: hidden;
  background: radial-gradient(90% 120% at 100% 0%, rgb(63 207 170 / 0.28), transparent 55%), linear-gradient(160deg, #0b1f3a, #07142a);
  box-shadow: 0 28px 40px -26px rgb(7 20 42 / 0.9); display: flex; flex-direction: column; justify-content: space-between; transition: filter 0.3s;
}
.vcard::before { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.12); pointer-events: none; }
.vcard-top { display: flex; justify-content: space-between; align-items: center; font-weight: 700; letter-spacing: -0.01em; font-size: 1.125rem; }
.vcard-top .brand-mini { display: flex; align-items: center; gap: 8px; }
.vcard-top svg { width: 22px; height: 22px; color: #5fe0be; }
.vcard-num { font-size: clamp(1.25rem, 5vw, 1.6rem); letter-spacing: 0.12em; font-weight: 500; }
.vcard-bot { display: flex; justify-content: space-between; align-items: end; gap: 10px; font-size: 0.875rem; color: #c9d5e8; }
.vcard-bot strong { display: block; color: #fff; font-size: 1rem; letter-spacing: 0.02em; text-transform: uppercase; }
.vcard.is-frozen { filter: saturate(0.25) brightness(0.72); }
.vcard.is-frozen::before { box-shadow: inset 0 0 0 2px rgb(169 204 255 / 0.7); }
.vcard.is-frozen::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(135deg, rgb(169 204 255 / 0.14) 0 10px, transparent 10px 22px); }
.vcard .chip { background: rgb(255 255 255 / 0.14); color: #fff; }
.control-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.control-row p { color: var(--ink-2); font-size: 0.9375rem; }
.switch { position: relative; width: 56px; height: 32px; border-radius: 999px; border: 0; background: var(--line-strong); padding: 0; transition: background 0.2s; flex: none; }
.switch::before { content: ""; position: absolute; inset: -8px -4px; }
.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.3); transition: transform 0.2s; }
.switch[aria-checked="true"] { background: #3d6fb4; }
.switch[aria-checked="true"]::after { transform: translateX(24px); }
.switch[aria-disabled="true"] { opacity: 0.6; cursor: progress; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.narrow { max-width: 480px; }
.spend { display: flex; flex-direction: column; gap: 10px; }
.spend-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; font-size: 0.9375rem; }
.spend-line strong { font-size: 1.25rem; font-weight: 650; letter-spacing: -0.01em; }
.meter { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.meter-fill { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.meter.is-high .meter-fill { background: var(--danger); }
.limit-clear { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: -8px 0 0 -12px; }
.limit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 520px) { .limit-grid { grid-template-columns: 1fr; } }
.auth { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; padding: 14px clamp(14px, 3vw, 24px); }
.auth + .auth { border-top: 1px solid var(--line); }
.auth .tx-meta { white-space: normal; }
.auth-side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

/* Sign in */
.signin { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.signin-art { background: radial-gradient(90% 80% at 80% 10%, rgb(63 207 170 / 0.22), transparent 60%), var(--navy); color: var(--on-navy); padding: clamp(28px, 5vw, 72px); display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.signin-art .brand { color: #fff; padding: 0; }
.signin-art .brand svg { color: #5fe0be; }
.signin-art .signin-lead { font-size: clamp(1.75rem, 3vw, 2.75rem); line-height: 1.1; letter-spacing: -0.03em; max-width: 14ch; font-weight: 600; }
.signin-art p { color: var(--on-navy-2); max-width: 36ch; margin-top: 14px; }
.signin-art .signin-lead { color: var(--on-navy); margin-top: 0; }
.signin-form:focus { outline: none; }
.signin-points { display: grid; gap: 12px; color: var(--on-navy-2); font-size: 0.9375rem; }
.signin-points li { display: flex; gap: 10px; align-items: center; }
.signin-points svg { width: 18px; height: 18px; color: #5fe0be; }
.signin-form { display: grid; place-items: center; padding: 32px clamp(16px, 5vw, 64px); }
.signin-form form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 20px; }
.demo-note { font-size: 0.875rem; color: var(--ink-2); background: var(--surface-2); border: 1px dashed var(--line-strong); padding: 12px 14px; border-radius: var(--radius-sm); display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
@media (max-width: 860px) {
  .signin { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .signin-art { padding: 24px 20px 28px; gap: 18px; }
  .signin-points { display: none; }
  .signin-art .signin-lead { font-size: 1.5rem; max-width: none; }
  .signin-art p { margin-top: 8px; }
  .signin-form { align-items: start; padding-top: 28px; }
}

/* Demo tools: a quiet control in the sidebar footer (top bar on phones) and a panel that only exists when opened */
.demo-badge { display: inline-block; font-size: 0.6875rem; font-weight: 700; line-height: 1; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 7px; border-radius: 999px; background: var(--pending-bg); color: var(--pending-ink); }
.demo-toggle { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 12px; text-align: left; background: transparent; color: var(--ink-2); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); font-weight: 550; font-size: 0.9375rem; }
.demo-toggle:hover { background: var(--accent-soft); color: var(--ink); }
.demo-toggle svg { width: 18px; height: 18px; flex: none; }
.demo-toggle-text { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.demo-short { display: none; }
.sim-scrim { position: fixed; inset: 0; z-index: 65; background: rgb(9 17 31 / 0.5); }
.sim {
  position: fixed; z-index: 70; left: 16px; bottom: 16px; width: min(340px, calc(100vw - 32px)); max-height: min(82dvh, 700px); overflow: auto;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 16px; font-size: 0.875rem;
  box-shadow: 0 24px 48px -20px rgb(0 0 0 / 0.45);
}
.sim-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sim-head h2 { font-size: 1rem; margin-right: auto; }
.sim-close { display: grid; place-items: center; width: 44px; height: 44px; margin: -8px -8px -8px 0; background: transparent; border: 0; border-radius: 10px; color: var(--ink-2); }
.sim-close:hover { background: var(--accent-soft); color: var(--ink); }
.sim-close svg { width: 20px; height: 20px; }
.sim .sim-note { color: var(--ink-2); margin: 0 0 14px; line-height: 1.5; }
.sim fieldset { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; margin: 0 0 12px; display: flex; flex-direction: column; gap: 10px; }
.sim legend { padding: 0 6px; font-weight: 650; }
.sim label { display: flex; flex-direction: column; gap: 4px; color: var(--ink-2); font-weight: 550; }
.sim .sim-row > *, .sim label { min-width: 0; }
.sim input, .sim select { width: 100%; min-height: 44px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; }
.sim input:focus-visible, .sim select:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.sim .sim-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sim button.sim-btn { width: 100%; min-height: 44px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; }
.sim button.sim-btn:hover:not(:disabled) { background: var(--accent-soft); }
.sim button.sim-btn:disabled, .sim button.sim-btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.sim-out-slot:not(:empty) { margin-bottom: 12px; }
.sim .sim-hint { color: var(--ink-2); margin: 0; line-height: 1.45; }
.sim .sim-hint a { font-weight: 600; }
.sim .sim-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.sim button.sim-chip { flex: 1 1 auto; min-height: 44px; padding: 0 12px; border-radius: 999px; border: 1px dashed var(--line-strong); background: var(--surface-2); color: var(--ink); font: inherit; font-weight: 600; font-size: 0.8125rem; }
.sim button.sim-chip:hover { background: var(--accent-soft); }
.sim .sim-out { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border-left: 4px solid var(--pending-ink); line-height: 1.45; font-weight: 550; }
.sim .sim-out.ok { border-color: var(--settled-ink); }
.sim .sim-out.no { border-color: var(--danger); }
body:has(.sim:not([hidden])[aria-modal="true"]) { overflow: hidden; }
@media (max-width: 768px) {
  .demo-toggle { width: auto; padding: 4px 10px; gap: 6px; }
  .demo-toggle-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .demo-short { display: inline; font-size: 0.8125rem; }
  .sim { left: 0; right: 0; bottom: 0; width: auto; max-height: 86dvh; border-radius: var(--radius) var(--radius) 0 0; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
}

/* Transaction detail: a side sheet on desktop, a bottom sheet on phones (native <dialog>) */
.tx-dialog { border: 0; padding: 0; background: var(--surface); color: var(--ink); width: min(440px, 100%); max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0 0 0 auto; border-radius: var(--radius) 0 0 var(--radius); box-shadow: -24px 0 48px -24px rgb(0 0 0 / 0.4); overflow: auto; }
.tx-dialog::backdrop { background: rgb(9 17 31 / 0.5); }
.tx-dialog[open] { animation: sheet-in 0.22s ease-out; }
@keyframes sheet-in { from { transform: translateX(24px); opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } }
.tx-dialog-body { padding: 20px 24px 28px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.sheet-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; }
.sheet-top h2 { font-size: 1.25rem; overflow-wrap: anywhere; }
.sheet-close { margin-right: -12px; width: 44px; padding: 0; }
.sheet-amount { font-size: 2rem; font-weight: 650; letter-spacing: -0.03em; overflow-wrap: anywhere; }
.sheet-amount.is-void { text-decoration: line-through; color: var(--ink-3); }
.sheet-why { color: var(--ink-2); }
.sheet-rows { width: 100%; margin: 8px 0 0; border-top: 1px solid var(--line); }
.sheet-row { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.sheet-row dt { font-size: 0.8125rem; color: var(--ink-2); font-weight: 550; }
.sheet-row dd { margin: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.sheet-val { overflow-wrap: anywhere; min-width: 0; font-weight: 550; }
body:has(dialog[open]) { overflow: hidden; }
@media (max-width: 768px) {
  .tx-dialog { width: 100%; height: auto; max-height: 88dvh; margin: auto 0 0; border-radius: var(--radius) var(--radius) 0 0; box-shadow: 0 -24px 48px -24px rgb(0 0 0 / 0.4); }
  .tx-dialog[open] { animation-name: sheet-up; }
  .tx-dialog-body { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
}

.r-full { border-radius: 50%; }
.r-card { border-radius: 22px; }

@media (max-width: 768px) { .sheet { padding-bottom: 120px; } }
.receipt-actions { display: flex; justify-content: center; }

@media print {
  .side, .nav, .banner, .mobile-brand, .toasts, .skip-link, .demo-toggle, .sim, .sim-scrim, .result .btn-row, .receipt-actions, .copy-btn { display: none !important; }
  .app { display: block; }
  body { background: #fff; color: #000; }
  .panel, .hero { box-shadow: none; border-color: #999; }
  .content { padding: 0; max-width: none; }
}
