:root {
  color-scheme: light dark;
  --brand: #13242b;
  --brand-soft: #1e4b41;
  --accent: #2f8f6f;
  --bg: #f3f6f9;
  --surface: #ffffff;
  --surface-2: #eceff3;
  --surface-3: #e3e8ed;
  --text: #16242b;
  --text-muted: #5d6a72;
  --text-faint: #66727b;
  --text-subtle: #626f77;
  --accent-strong: #177a5c;
  --line: #e4e9ed;
  --line-strong: #d2dade;
  --link: #2563c9;
  --success: #0f6e56;
  --success-bg: #e1f5ee;
  --danger: #b3382a;
  --danger-bg: #fceae7;
  --warn-text: #7a5a07;
  --warn-bg: #fff5d6;
  --warn-line: #ecd9a3;
  --on-brand: #ffffff;
  --on-brand-muted: rgba(255, 255, 255, 0.64);
  --on-brand-line: rgba(255, 255, 255, 0.16);
  --elev: 0 10px 30px rgba(17, 33, 42, 0.12);
  --elev-sm: 0 4px 14px rgba(17, 33, 42, 0.1);
  --radius: 14px;
  --radius-lg: 18px;
  --radius-sm: 10px;
  --tap: 48px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #14333a;
    --brand-soft: #1c5246;
    --accent: #43b58c;
    --bg: #0d1316;
    --surface: #17222a;
    --surface-2: #1f2c34;
    --surface-3: #28363f;
    --text: #e7eef2;
    --text-muted: #9aa7af;
    --text-faint: #869299;
    --text-subtle: #8b979e;
    --accent-strong: #5fd0a8;
    --line: #25323a;
    --line-strong: #33424b;
    --link: #6aa6f2;
    --success: #4cc79f;
    --success-bg: rgba(76, 199, 159, 0.14);
    --danger: #ef7363;
    --danger-bg: rgba(239, 115, 99, 0.14);
    --warn-text: #e9c877;
    --warn-bg: rgba(233, 200, 119, 0.12);
    --warn-line: rgba(233, 200, 119, 0.28);
    --on-brand: #f2fbf8;
    --on-brand-muted: rgba(255, 255, 255, 0.6);
    --on-brand-line: rgba(255, 255, 255, 0.14);
    --elev: 0 12px 32px rgba(0, 0, 0, 0.46);
    --elev-sm: 0 6px 18px rgba(0, 0, 0, 0.4);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

svg {
  display: block;
}

/* ---------- shell ---------- */

.wallet-shell {
  position: relative;
  width: min(100%, 460px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom)) 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

[data-surface="extension"] .wallet-shell {
  width: min(100%, 420px);
  min-height: 580px;
}

.wallet-shell:has(.bottom-tabs) {
  padding-bottom: max(92px, calc(env(safe-area-inset-bottom) + 92px));
}

/* ---------- wallet tabs ---------- */

.bottom-tabs {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: min(calc(100vw - 32px), 388px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--elev-sm);
  backdrop-filter: blur(16px);
}

[data-surface="pwa"] .bottom-tabs {
  width: min(calc(100vw - 32px), 428px);
}

.bottom-tab {
  min-width: 0;
  min-height: 48px;
  border: 0;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  gap: 3px;
  padding: 5px 4px;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
}

.bottom-tab:hover {
  color: var(--text);
  background: var(--surface-2);
}

.bottom-tab.active {
  color: var(--success);
  background: var(--success-bg);
}

.bottom-tab svg {
  width: 18px;
  height: 18px;
}

.bottom-tab span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}

.activity-more {
  margin-top: 10px;
}

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0 2px;
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  overflow: hidden;
  border-radius: 11px;
  background: var(--brand);
  color: var(--on-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 17px;
  flex: none;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-name {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.1;
}

.brand-sub {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-muted);
}

.net-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e0922b;
  flex: none;
}

.icon-btn {
  width: 38px;
  height: 38px;
  min-height: 38px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: var(--surface-2);
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--surface-3);
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

.settings-btn {
  position: relative;
}

.settings-update-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--surface-2);
  border-radius: 50%;
  background: var(--success);
}

/* ---------- buttons ---------- */

.btn {
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: var(--radius);
  padding: 0 18px;
  font-weight: 600;
  font-size: 15px;
  color: var(--on-brand);
  background: var(--brand);
  cursor: pointer;
  transition: transform 0.04s ease, background 0.15s ease, opacity 0.15s ease;
}

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

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

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

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

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-3);
}

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

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
}

.btn-danger {
  color: var(--danger);
  background: var(--danger-bg);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  min-height: 38px;
  border-radius: var(--radius-sm);
  padding: 0 13px;
  font-size: 13px;
}

/* ---------- inputs ---------- */

.field {
  display: grid;
  gap: 7px;
}

.field > span {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

input,
select {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0 14px;
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder {
  color: var(--text-faint);
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

select {
  appearance: none;
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 38px;
}

.input-affix {
  position: relative;
  display: flex;
  align-items: center;
}

.input-affix input {
  padding-right: 64px;
}

.input-affix .affix-btn {
  position: absolute;
  right: 8px;
  min-height: 32px;
  border-radius: 8px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 0;
  cursor: pointer;
}

.input-affix .affix-btn.affix-icon {
  width: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.input-affix .affix-btn.affix-icon svg {
  width: 18px;
  height: 18px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

/* ---------- cards ---------- */

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 16px;
}

.section-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 2px 2px 0;
}

/* ---------- balance hero ---------- */

.hero {
  border-radius: var(--radius-lg);
  padding: 20px;
  color: var(--on-brand);
  background: var(--brand);
  box-shadow: var(--elev-sm);
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hero-label {
  font-size: 13px;
  color: var(--on-brand-muted);
}

.hero-refresh {
  width: 34px;
  height: 34px;
  min-height: 34px;
  border-radius: 50%;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--on-brand);
  background: var(--on-brand-line);
  cursor: pointer;
}

.hero-refresh svg {
  width: 17px;
  height: 17px;
}

.hero-refresh:disabled {
  opacity: 0.55;
  cursor: progress;
}

.hero-refresh.spinning svg {
  animation: spin 0.8s linear infinite;
}

.hero-amount {
  margin-top: 10px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.hero-amount strong {
  font-size: clamp(30px, 9vw, 38px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
}

.hero-amount span {
  font-size: 15px;
  color: var(--on-brand-muted);
}

.hero-foot {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--on-brand-line);
  font-size: 12px;
  color: var(--on-brand-muted);
}

.hero-foot svg {
  width: 14px;
  height: 14px;
  flex: none;
}

.hero-pending {
  margin-top: 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--on-brand);
}

.hero-pending > svg {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 1px;
  color: var(--warn-text);
}

.hero-pending div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.hero-pending strong,
.hero-pending span {
  overflow-wrap: anywhere;
}

.hero-pending strong {
  font-size: 12px;
  font-weight: 600;
}

.hero-pending span {
  font-size: 11px;
  color: var(--on-brand-muted);
}

.pill-tag svg {
  width: 13px;
  height: 13px;
  flex: none;
}

.owner-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line));
  border-radius: var(--radius);
  padding: 13px 14px;
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
}

.owner-strip div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.owner-strip span {
  font-size: 12px;
  color: var(--text-muted);
}

.owner-strip strong {
  font-size: 16px;
  font-weight: 650;
  color: var(--text);
  line-height: 1.2;
}

.owner-badge {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--success) !important;
  background: var(--success-bg);
  font-weight: 600;
}

.owner-badge svg {
  width: 14px;
  height: 14px;
}

/* ---------- guidance ---------- */

.guidance-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: var(--radius);
  padding: 13px 14px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}

.guidance-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.guidance-icon svg {
  width: 18px;
  height: 18px;
}

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

.guidance-title {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}

.guidance-body {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.guidance-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.guidance-actions .btn-sm {
  min-height: 36px;
}

.guidance-actions .btn-sm svg {
  width: 15px;
  height: 15px;
}

.guidance-link {
  width: auto;
  min-height: 36px;
  padding: 0 8px;
}

/* ---------- quick actions ---------- */

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.quick-actions .btn {
  min-height: 52px;
}

/* ---------- account chip ---------- */

.account-chip {
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 11px 12px;
}

.account-chip .ident {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex: none;
  overflow: hidden;
}

.ident svg {
  width: 100%;
  height: 100%;
  display: block;
}

.account-chip code {
  flex: 1;
  min-width: 0;
  font-family: "SF Mono", ui-monospace, monospace;
  font-size: 13.5px;
  color: var(--text);
}

.account-chip .chip-act {
  width: 32px;
  height: 32px;
  min-height: 32px;
  border: 0;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
}

.account-chip .chip-act:hover {
  background: var(--surface-2);
  color: var(--text);
}

.account-chip .chip-act svg {
  width: 17px;
  height: 17px;
}

/* ---------- activity ---------- */

.activity-list {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
}

.activity-item + .activity-item {
  border-top: 1px solid var(--line);
}

.activity-ic {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.activity-ic svg {
  width: 17px;
  height: 17px;
}

.activity-ic.out {
  color: var(--text-muted);
  background: var(--surface-2);
}

.activity-ic.in {
  color: var(--success);
  background: var(--success-bg);
}

.activity-ic.pending {
  color: var(--warn-text);
  background: var(--warn-bg);
}

.activity-main {
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}

.activity-main .a-title {
  font-size: 14px;
  font-weight: 500;
}

.activity-main .a-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
  font-family: "SF Mono", ui-monospace, monospace;
}

.activity-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--warn-bg);
  color: var(--warn-text);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
}

.a-date {
  margin-left: auto;
  color: var(--text-faint);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  white-space: nowrap;
}

.activity-amt {
  font-size: 14px;
  font-weight: 600;
  min-width: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

.activity-amt.in {
  color: var(--success);
}

.activity-amt.pending {
  color: var(--warn-text);
}

.activity-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  flex: none;
}

.activity-empty {
  padding: 22px 16px;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
}

.activity-link {
  color: var(--text-faint);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  margin-top: -8px;
  margin-bottom: -8px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.activity-link + .activity-link {
  margin-left: 0;
}

.activity-link svg {
  width: 16px;
  height: 16px;
}

/* ---------- notifications ---------- */

.notifications-view {
  display: grid;
  gap: 10px;
}

.notifications-toolbar {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.notifications-toolbar p {
  min-width: 0;
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.text-btn {
  min-height: 36px;
  border: 0;
  padding: 0 4px;
  color: var(--accent-strong);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.text-btn:disabled {
  color: var(--text-faint);
  cursor: default;
  opacity: 0.7;
}

.notification-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.notification-item {
  position: relative;
  width: 100%;
  min-height: 84px;
  border: 0;
  padding: 13px 12px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 9px 20px;
  align-items: center;
  gap: 10px;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.notification-item + .notification-item {
  border-top: 1px solid var(--line);
}

.notification-item:hover,
.notification-item:focus-visible {
  background: var(--surface-2);
}

.notification-item.unread {
  background: var(--success-bg);
}

.notification-item.unread:hover,
.notification-item.unread:focus-visible {
  background: color-mix(in srgb, var(--success-bg) 70%, var(--surface-2));
}

.notification-item-icon,
.notification-empty-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: var(--surface-2);
  flex: none;
}

.notification-item-icon.positive,
.notification-detail-modal .modal-icon.positive {
  color: var(--success);
  background: var(--success-bg);
}

.notification-item-icon.negative,
.notification-detail-modal .modal-icon.negative {
  color: var(--danger);
  background: var(--danger-bg);
}

.notification-item-icon svg,
.notification-empty-icon svg {
  width: 18px;
  height: 18px;
}

.notification-item-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.notification-item-title {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-item-body {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.notification-item-date {
  color: var(--text-faint);
  font-size: 11px;
}

.notification-new-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
}

.notification-chevron {
  display: inline-flex;
  color: var(--text-faint);
}

.notification-chevron svg {
  width: 18px;
  height: 18px;
}

.notification-loading,
.notification-empty {
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  background: var(--surface);
  text-align: center;
}

.notification-empty strong {
  color: var(--text);
  font-size: 15px;
}

.notification-empty p {
  max-width: 300px;
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
}

.notification-empty .btn {
  width: auto;
  min-width: 140px;
}

.notification-detail-modal > p {
  margin: 0 0 16px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ---------- view header ---------- */

.view-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 0;
}

.view-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.back-btn {
  width: 38px;
  height: 38px;
  min-height: 38px;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: var(--surface-2);
  cursor: pointer;
  flex: none;
}

.back-btn:hover {
  background: var(--surface-3);
}

.back-btn svg {
  width: 19px;
  height: 19px;
}

/* ---------- apps ---------- */

.apps-store-head {
  padding: 6px 2px 0;
}

.apps-store-head p {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.apps-store-head h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: 0;
}

.apps-store-head span {
  display: block;
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.app-feature-carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 2px 2px 12px;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  touch-action: pan-x;
}

.app-feature-carousel::-webkit-scrollbar {
  display: none;
}

.app-feature-nav {
  display: none;
}

.app-feature-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.app-feature-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding-top: 2px;
}

.app-feature-dot {
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: color-mix(in srgb, var(--text-muted) 48%, transparent);
  transition: background .16s ease, transform .16s ease;
}

.app-feature-dot.active {
  background: var(--accent);
  transform: scale(1.2);
}

@media (hover: hover) and (pointer: fine) {
  .app-feature-nav {
    width: 36px;
    height: 36px;
    border: 1px solid color-mix(in srgb, var(--line-strong) 82%, transparent);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: var(--text);
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    box-shadow: var(--elev-sm);
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, transform .16s ease;
  }

  .app-feature-nav:hover {
    border-color: var(--accent);
    background: var(--surface-2);
    transform: scale(1.06);
  }

  .app-feature-nav:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
  }

  .app-feature-nav svg {
    width: 18px;
    height: 18px;
  }

  .app-feature-nav-next svg {
    transform: rotate(180deg);
  }
}

.app-feature-card {
  position: relative;
  overflow: hidden;
  flex: 0 0 min(88%, 420px);
  min-height: 250px;
  border: 0;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: stretch;
  padding: 0;
  color: #f8fffc;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.18), transparent 23%),
    radial-gradient(circle at 78% 20%, rgba(244, 201, 93, 0.36), transparent 28%),
    linear-gradient(150deg, #0f423f 0%, #102931 52%, #071215 100%);
  box-shadow: var(--elev-sm);
  cursor: pointer;
  scroll-snap-align: start;
  text-align: left;
}

.app-feature-card.app-feature-funafc-vote {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.15), transparent 23%),
    radial-gradient(circle at 78% 20%, rgba(133, 220, 147, 0.32), transparent 28%),
    linear-gradient(150deg, #24422e 0%, #18352f 52%, #081512 100%);
}

.app-feature-card.app-feature-funafc-thanks {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.15), transparent 23%),
    radial-gradient(circle at 78% 20%, rgba(244, 201, 93, 0.3), transparent 28%),
    linear-gradient(150deg, #4a3027 0%, #284137 52%, #0b1714 100%);
}

.app-feature-card.app-feature-funabashi-eleven {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), transparent 23%),
    radial-gradient(circle at 78% 20%, rgba(80, 206, 218, 0.3), transparent 28%),
    linear-gradient(150deg, #123e4c 0%, #17303b 52%, #081418 100%);
}

.app-feature-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 35%, rgba(255,255,255,0.28) 45%, transparent 56%),
    repeating-linear-gradient(118deg, transparent 0 18px, rgba(255,255,255,0.08) 18px 20px);
  opacity: 0.7;
  mix-blend-mode: screen;
}

.app-feature-label {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  color: rgba(248, 255, 252, 0.74);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-feature-art {
  position: absolute;
  right: -18px;
  top: 24px;
  z-index: 1;
  width: 150px;
  height: 150px;
  border-radius: 36px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.25), transparent 35%),
    linear-gradient(135deg, rgba(96, 221, 176, 0.58), rgba(244, 201, 93, 0.44));
  transform: rotate(12deg);
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.28);
}

.app-feature-crest {
  width: 78px;
  height: 78px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  color: #0a2a28;
  background: rgba(255, 255, 255, 0.82);
  font-size: 40px;
  font-weight: 850;
}

.app-feature-crest svg {
  width: 38px;
  height: 38px;
}

.app-feature-content {
  position: relative;
  z-index: 3;
  min-height: 250px;
  width: 100%;
  display: grid;
  align-content: end;
  gap: 12px;
  padding: 56px 16px 16px;
}

.app-feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #092522;
  background: #74efc4;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.app-feature-icon svg {
  width: 24px;
  height: 24px;
}

.app-feature-copy {
  display: grid;
  gap: 5px;
  max-width: 250px;
}

.app-feature-copy strong {
  color: #ffffff;
  font-size: 27px;
  line-height: 1.02;
  font-weight: 800;
}

.app-feature-copy span {
  color: rgba(248, 255, 252, 0.75);
  font-size: 13px;
  line-height: 1.45;
}

.app-feature-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.app-feature-meta span,
.app-open-pill {
  min-height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 750;
}

.app-feature-meta span {
  color: rgba(248, 255, 252, 0.84);
  background: rgba(255, 255, 255, 0.14);
}

.app-open-pill {
  width: fit-content;
  color: #0b241f;
  background: rgba(255, 255, 255, 0.92);
}

.app-store-section {
  display: grid;
  gap: 8px;
}

.app-store-section-head {
  padding: 0 2px;
}

.app-store-section-head h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
}

.app-row {
  width: 100%;
  min-height: 74px;
  border: 0;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 2px;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.app-row:hover {
  background: color-mix(in srgb, var(--surface-2) 54%, transparent);
}

.app-row-icon {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  color: var(--success);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--success) 20%, transparent), transparent),
    var(--surface-2);
}

.app-row-icon svg {
  width: 24px;
  height: 24px;
}

.app-row-main {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 3px;
}

.app-row-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  line-height: 1.3;
}

.app-row-main span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.app-row-action {
  min-height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  color: var(--link);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 800;
  flex: none;
}

/* ---------- receive ---------- */

.receive-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 22px 18px;
  text-align: center;
}

.qr-frame {
  width: 220px;
  max-width: 70vw;
  margin: 0 auto 16px;
  padding: 14px;
  border-radius: var(--radius);
  background: #ffffff;
  border: 1px solid var(--line);
}

.qr-frame svg {
  width: 100%;
  height: auto;
}

.receive-addr {
  font-family: "SF Mono", ui-monospace, monospace;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  display: grid;
  gap: 4px;
  word-break: normal;
  color: var(--text);
  margin: 0 0 16px;
}

.receive-addr-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.receive-addr-part {
  white-space: nowrap;
}

.receive-addr-accent {
  color: var(--success);
  font-weight: 800;
}

.receive-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.receive-hint {
  margin: 14px 2px 0;
  font-size: 12px;
  color: var(--text-faint);
  text-align: center;
  line-height: 1.5;
}

/* ---------- send / review ---------- */

.summary {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 4px 14px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 13px 0;
}

.summary-row + .summary-row {
  border-top: 1px solid var(--line);
}

.summary-row .k {
  font-size: 13px;
  color: var(--text-muted);
}

.summary-row .v {
  font-size: 14px;
  font-weight: 500;
  text-align: right;
  word-break: break-word;
}

.summary-row .v.amt {
  font-size: 16px;
  font-weight: 600;
}

.summary-row .v.mono {
  font-family: "SF Mono", ui-monospace, monospace;
}

.pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--success);
  background: var(--success-bg);
}

.advanced {
  margin-top: 12px;
}

.x402-balance-note {
  margin-top: 12px;
}

.advanced summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}

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

.advanced[open] summary .chev {
  transform: rotate(180deg);
}

.advanced .chev {
  display: inline-flex;
  transition: transform 0.15s ease;
}

.advanced .chev svg {
  width: 15px;
  height: 15px;
}

.advanced dl {
  display: grid;
  gap: 9px;
  margin: 12px 0 0;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.advanced dt {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.advanced dd {
  margin: 2px 0 0;
  font-family: "SF Mono", ui-monospace, monospace;
  font-size: 12px;
  color: var(--text);
  word-break: break-all;
}

.result-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: var(--radius);
  padding: 16px;
  background: var(--success-bg);
  color: var(--success);
}

.result-banner.neutral {
  color: var(--text-muted);
  background: var(--surface-2);
}

.result-banner.neutral .rb-ic {
  background: color-mix(in srgb, var(--text-muted) 14%, transparent);
}

.result-banner.payment-pending {
  color: var(--warn-text);
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
}

.result-banner.payment-pending .rb-ic {
  background: color-mix(in srgb, var(--warn-text) 14%, transparent);
}

.result-banner.payment-failed {
  color: var(--danger);
  background: var(--danger-bg);
}

.result-banner.payment-failed .rb-ic {
  background: color-mix(in srgb, var(--danger) 14%, transparent);
}

.result-banner .rb-ic {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--success) 22%, transparent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.result-banner .rb-ic svg {
  width: 22px;
  height: 22px;
}

.result-banner strong {
  font-size: 15px;
  font-weight: 600;
}

.result-banner p {
  margin: 2px 0 0;
  font-size: 12px;
  opacity: 0.85;
}

.payment-progress {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.payment-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  font-size: 13px;
}

.payment-progress-head strong {
  font-size: 14px;
}

.payment-progress-head span {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.payment-progress-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 14px 0 12px;
  padding: 0;
  list-style: none;
}

.payment-progress-steps.owner-operation-progress-steps {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.payment-progress-steps li {
  min-width: 0;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.35;
  text-align: center;
}

.payment-progress-steps li.is-current {
  color: var(--text);
  font-weight: 600;
}

.payment-progress-steps li.is-done {
  color: var(--success);
}

.payment-progress-marker {
  display: flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  margin: 0 auto 6px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  font-size: 11px;
}

.payment-progress-marker svg,
.payment-progress-marker .spinner {
  width: 14px;
  height: 14px;
}

.payment-progress-steps li.is-current .payment-progress-marker {
  border-color: var(--primary);
  color: var(--primary);
}

.payment-progress-steps li.is-done .payment-progress-marker {
  border-color: color-mix(in srgb, var(--success) 45%, transparent);
  background: color-mix(in srgb, var(--success) 14%, transparent);
}

.payment-progress > p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.55;
}

.x402-payment-safety {
  margin-top: 14px;
}

/* ---------- setup ---------- */

.setup-head {
  text-align: center;
  padding: 8px 0 2px;
}

.setup-head .brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  font-size: 24px;
  margin: 0 auto 14px;
}

.setup-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.setup-head p {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

.note {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  border: 1px solid var(--warn-line);
  border-radius: var(--radius);
  padding: 12px 13px;
  color: var(--warn-text);
  background: var(--warn-bg);
  font-size: 13px;
  line-height: 1.5;
}

.note svg {
  width: 17px;
  height: 17px;
  flex: none;
  margin-top: 1px;
}

.note > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.note strong,
.note span {
  display: block;
}

.dev-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--warn-line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--warn-bg);
}

.dev-code span {
  font-size: 12px;
  color: var(--warn-text);
}

.dev-code button {
  min-height: 34px;
  border: 0;
  border-radius: 9px;
  padding: 0 12px;
  font-family: "SF Mono", ui-monospace, monospace;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--warn-text);
  background: color-mix(in srgb, var(--warn-line) 38%, transparent);
  cursor: pointer;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0;
  color: var(--text-faint);
  font-size: 12px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.link-btn {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px;
  text-align: center;
  width: 100%;
}

.link-btn:hover {
  color: var(--text);
}

/* ---------- settings ---------- */

.settings-group {
  margin-top: 4px;
}

.settings-group + .settings-group {
  margin-top: 18px;
}

.settings-row {
  align-items: center;
  color: var(--text-muted);
  display: flex;
  font-size: 14px;
  justify-content: space-between;
  margin: 8px 0 12px;
}

.settings-row strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.settings-helper {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
  margin: -2px 0 12px;
}

.settings-actions {
  display: grid;
  gap: 10px;
}

.updates-list {
  display: grid;
  gap: 10px;
}

.updates-empty {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 14px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
}

.update-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 14px;
  background: var(--surface);
}

.update-note {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
  margin-top: 8px;
}

.update-note + .update-note {
  margin-top: 10px;
}

.unread-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--bg);
}

.icon-btn {
  position: relative;
}

.update-head {
  display: grid;
  gap: 8px;
}

.update-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 750;
  line-height: 1.25;
}

.update-meta {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--surface-2);
  color: var(--text-subtle);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.update-summary {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.update-section {
  margin-top: 11px;
}

.update-section-title {
  display: block;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.update-items {
  margin: 6px 0 0;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.update-items li + li {
  margin-top: 4px;
}

.toggle-row {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
}

.toggle-row > span:first-child {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.toggle-row input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  min-height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  pointer-events: none;
}

.toggle-ui {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  flex: none;
  background: var(--surface-3);
  transition: background 0.15s ease, opacity 0.15s ease;
}

.toggle-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--elev-sm);
  transition: transform 0.15s ease;
}

.toggle-row input:checked + .toggle-ui {
  background: var(--success);
}

.toggle-row input:checked + .toggle-ui::after {
  transform: translateX(20px);
}

.toggle-row input:focus-visible + .toggle-ui {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.toggle-row input:disabled + .toggle-ui {
  opacity: 0.55;
}

.danger-zone {
  border: 1px solid var(--danger-bg);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--danger-bg);
}

.danger-zone p {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.app-version {
  margin-top: 22px;
  color: var(--text-subtle);
  font-size: 12px;
  text-align: center;
}

.settings-legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 18px;
  margin-top: 20px;
}

.settings-legal-link {
  color: var(--text-muted);
  display: inline-block;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.settings-legal-link:hover {
  color: var(--text);
}

/* ---------- toast ---------- */

.toast-host {
  position: fixed;
  left: 0;
  right: 0;
  bottom: max(88px, calc(env(safe-area-inset-bottom) + 88px));
  display: flex;
  justify-content: center;
  padding: 0 16px;
  pointer-events: none;
  z-index: 40;
}

.toast {
  max-width: 420px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius);
  padding: 13px 15px;
  font-size: 14px;
  font-weight: 500;
  color: var(--on-brand);
  background: var(--brand);
  box-shadow: var(--elev);
  animation: toast-in 0.2s ease;
  pointer-events: auto;
}

.toast svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.toast.error {
  background: var(--danger);
}

.toast.success {
  background: var(--success);
}

/* ---------- qr scanner ---------- */

.scanner {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #000;
  display: flex;
  flex-direction: column;
}

.scanner-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scanner-mask {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 24px;
}

.scanner-frame {
  width: min(70vw, 280px);
  aspect-ratio: 1 / 1;
  border-radius: 24px;
  outline: 3px solid rgba(255, 255, 255, 0.92);
  outline-offset: -3px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
}

.scanner-hint {
  margin: 0;
  max-width: 320px;
  text-align: center;
  color: #ffffff;
  font-size: 14px;
  line-height: 1.5;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.scanner-actions {
  position: relative;
  z-index: 1;
  padding: 14px 18px max(18px, env(safe-area-inset-bottom));
}

.scanner-cancel {
  width: 100%;
  min-height: var(--tap);
  border: 0;
  border-radius: var(--radius);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}

.scanner-cancel:hover {
  background: rgba(255, 255, 255, 0.26);
}

.scanner-failed .scanner-frame {
  outline-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.82);
}

/* ---------- misc ---------- */

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

.hidden {
  display: none !important;
}

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

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

button:focus-visible,
a:focus-visible,
select:focus-visible,
summary:focus-visible,
.bottom-tab:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- login & settings additions ---------- */

.setup-head .brand-mark svg {
  width: 26px;
  height: 26px;
}

.setup-links {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 4px;
}

.setup-links .link-btn {
  width: auto;
  margin: 0;
}

.passkey-intro {
  text-align: center;
  padding: 14px 6px 4px;
}

.passkey-fallback-link {
  margin-top: 2px;
}

.passkey-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 8px auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--success);
  background: var(--success-bg);
}

.passkey-icon svg {
  width: 30px;
  height: 30px;
}

.passkey-intro h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.passkey-intro p {
  margin: 8px 6px 0;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}

.passkey-intro .btn {
  margin-top: 18px;
}

.passkey-intro .passkey-what {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 12px;
}

.passkey-intro .note {
  margin-top: 16px;
  text-align: left;
}

.account-id {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}

.account-id-main {
  font-size: 14px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.account-id-sub {
  font-size: 12px;
  color: var(--success);
}

.settings-group > .btn {
  margin-top: 14px;
}

.logout-reassure {
  margin: 10px 4px 0;
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.6;
}

.toast-msg {
  flex: 1;
}

/* ---------- modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(4, 10, 13, 0.58);
  animation: fade-in 0.14s ease;
}

.modal {
  width: min(100%, 420px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--elev);
  animation: modal-in 0.16s ease;
}

.modal-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: var(--surface-2);
}

.modal-icon svg {
  width: 20px;
  height: 20px;
}

.modal h2 {
  margin: 14px 0 0;
  color: var(--text);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
}

.modal p {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

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

.modal-actions.single {
  grid-template-columns: 1fr;
}

.modal-actions .btn {
  min-height: 46px;
}

.detail-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
}

.detail-list div {
  display: grid;
  gap: 3px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.detail-list dt {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.detail-list dd {
  margin: 0;
  color: var(--text);
  font-family: "SF Mono", ui-monospace, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.activity-proof {
  margin-top: 12px;
}

.activity-proof pre {
  max-height: 180px;
  overflow: auto;
  margin: 10px 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.toast-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.toast-btn {
  min-height: 30px;
  border: 0;
  border-radius: 8px;
  padding: 0 11px;
  font-size: 13px;
  font-weight: 600;
  color: var(--on-brand);
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
}

.toast-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.toast-icon-btn {
  width: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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