:root {
  color-scheme: light;
  --ink: #172033;
  --ink-soft: #3f4d63;
  --muted: #667085;
  --line: #dce2eb;
  --line-strong: #bcc6d5;
  --surface: #ffffff;
  --surface-alt: #f3f5f8;
  --surface-blue: #edf3ff;
  --sidebar: #111827;
  --sidebar-soft: #1c2638;
  --sidebar-line: #344054;
  --accent: #245fc5;
  --accent-hover: #194fae;
  --accent-soft: #e9f1ff;
  --success: #087a4b;
  --success-soft: #e5f7ee;
  --warning: #8a4f08;
  --warning-soft: #fff3dc;
  --danger: #b42318;
  --danger-soft: #fff0ef;
  --z-topbar: 10;
  --z-backdrop: 20;
  --z-sidebar: 30;
  --z-mobile-nav: 35;
  --z-toast: 50;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--surface-alt); scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--surface-alt); font-family: "Segoe UI Variable", "Segoe UI", ui-sans-serif, system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #82afff; outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3, p { text-wrap: pretty; }

.skip-link { position: fixed; top: 10px; left: 10px; z-index: 100; padding: 10px 14px; color: #fff; background: var(--sidebar); transform: translateY(-160%); transition: transform .16s ease; }
.skip-link:focus { transform: none; }
.startup { padding: 32px; color: var(--ink-soft); text-align: center; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: inherit; font-weight: 780; text-decoration: none; }
.wordmark-light { color: #f8fafc; }
.wordmark-mark { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 10px; color: #fff; background: var(--accent); font-size: 16px; font-weight: 850; }

button { min-height: 44px; border: 0; border-radius: 8px; padding: 10px 16px; color: #fff; background: var(--accent); font-weight: 730; cursor: pointer; transition: background .16s ease, transform .16s ease, opacity .16s ease; }
button:hover { background: var(--accent-hover); }
button:active { transform: translateY(1px); }
button:disabled { cursor: wait; opacity: .58; transform: none; }
label { display: grid; gap: 7px; color: var(--ink-soft); font-size: 13px; font-weight: 690; }
input, select { min-height: 46px; width: 100%; border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px 12px; color: var(--ink); background: #fff; transition: border-color .16s ease, box-shadow .16s ease; }
input::placeholder { color: #667085; opacity: 1; }
input:hover, select:hover { border-color: #8c99ac; }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: 0; }
.secondary-button { border: 1px solid var(--line-strong); color: var(--ink); background: #fff; }
.secondary-button:hover { color: var(--accent); background: var(--accent-soft); }
.danger-button { border: 1px solid #e6aaa5; color: var(--danger); background: #fff; }
.danger-button:hover { background: var(--danger-soft); }
.inline-link, .text-link-button { min-height: 32px; border: 0; padding: 2px; color: var(--accent); background: transparent; font-size: inherit; font-weight: 730; }
.inline-link:hover, .text-link-button:hover { color: var(--accent-hover); background: transparent; text-decoration: underline; }
.full-button { width: 100%; }

/* Authentication */
.auth-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(430px, 1.05fr) minmax(430px, .95fr); background: var(--surface); }
.auth-story { display: flex; min-height: 100vh; padding: clamp(32px, 5vw, 76px); flex-direction: column; justify-content: space-between; color: #f8fafc; background: var(--sidebar); }
.auth-story-copy { max-width: 680px; margin-block: 50px 28px; }
.environment-label { width: max-content; margin: 0 0 18px; border: 1px solid #52627a; border-radius: 999px; padding: 6px 10px; color: #c7d7f2; font-size: 12px; font-weight: 720; }
.auth-story h1 { max-width: 14ch; margin: 0; font-size: clamp(40px, 5vw, 72px); line-height: 1.02; letter-spacing: -.035em; text-wrap: balance; }
.auth-story-copy > p:last-child { max-width: 60ch; margin: 26px 0 0; color: #c3cede; font-size: 17px; line-height: 1.65; }
.auth-benefits { display: grid; max-width: 640px; gap: 0; margin: 0 0 36px; padding: 0; list-style: none; }
.auth-benefits li { display: flex; align-items: center; gap: 15px; padding: 15px 0; border-bottom: 1px solid var(--sidebar-line); color: #e8edf5; }
.auth-benefits li:first-child { border-top: 1px solid var(--sidebar-line); }
.auth-benefits span { color: #91b8ff; font-size: 12px; font-variant-numeric: tabular-nums; }
.auth-story > small { max-width: 68ch; color: #98a6ba; line-height: 1.5; }
.auth-panel { display: grid; min-width: 0; min-height: 100vh; padding: clamp(24px, 5vw, 72px); place-items: center; }
.auth-card { width: min(470px, 100%); min-width: 0; max-width: 100%; }
.mobile-auth-brand { display: none; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 34px; padding: 4px; border-radius: 10px; background: #eef1f5; }
.auth-tabs button { min-height: 40px; padding: 8px 12px; color: var(--muted); background: transparent; }
.auth-tabs button:hover { color: var(--ink); background: #f8fafc; }
.auth-tabs button.active { color: var(--ink); background: #fff; box-shadow: 0 2px 6px rgba(17,24,39,.12); }
.auth-heading { margin-bottom: 28px; }
.auth-heading h2, .register-success h2 { margin: 0 0 8px; font-size: 30px; letter-spacing: -.03em; }
.auth-heading p, .register-success p { margin: 0; color: var(--muted); line-height: 1.55; }
.auth-form { display: grid; gap: 17px; }
.auth-form > button[type="submit"] { min-height: 49px; margin-top: 5px; }
.form-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.consent-row { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.consent-row input { width: 18px; min-height: 18px; margin-top: 1px; accent-color: var(--accent); }
.form-error { min-height: 20px; margin: -3px 0 0; color: var(--danger); font-size: 13px; }
.auth-help { margin: 24px 0 0; color: var(--muted); font-size: 13px; text-align: center; }
.register-success { text-align: center; }
.register-success .success-mark { display: grid; width: 52px; height: 52px; margin: 0 auto 20px; place-items: center; border-radius: 50%; color: #fff; background: var(--success); font-size: 24px; }
.register-success button { margin-top: 24px; }

/* Application shell */
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: var(--z-sidebar); display: flex; width: 260px; padding: 22px 16px; flex-direction: column; color: #ecf1f8; background: var(--sidebar); }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 20px; }
.account-compact { display: flex; align-items: center; gap: 11px; margin: 0 0 18px; padding: 13px; border: 1px solid var(--sidebar-line); border-radius: 12px; background: var(--sidebar-soft); }
.account-compact > span { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #173566; background: #c9dcff; font-weight: 820; }
.account-compact div { min-width: 0; display: grid; gap: 2px; }
.account-compact strong, .account-compact small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-compact strong { font-size: 13px; }
.account-compact small { color: #aab6c8; font-size: 11px; }
.primary-nav { display: grid; gap: 3px; overflow-y: auto; padding-right: 3px; }
.primary-nav > p { margin: 16px 11px 5px; color: #8693a8; font-size: 10px; font-weight: 760; letter-spacing: .07em; text-transform: uppercase; }
.primary-nav > p:first-child { margin-top: 2px; }
.primary-nav button { display: flex; min-height: 42px; align-items: center; justify-content: flex-start; gap: 11px; padding: 8px 11px; color: #cbd4e2; background: transparent; text-align: left; }
.primary-nav button:hover { color: #fff; background: #253249; }
.primary-nav button.active { color: #fff; background: #2c4f86; }
.nav-symbol { display: inline-grid; width: 22px; height: 22px; place-items: center; color: #9fb9e8; font-size: 18px; }
.sidebar-foot { display: grid; gap: 10px; margin-top: auto; padding: 15px 10px 2px; border-top: 1px solid var(--sidebar-line); }
.status-dot { display: flex; align-items: center; gap: 8px; color: #b7c3d4; font-size: 12px; }
.status-dot::before { width: 8px; height: 8px; border-radius: 50%; background: #49c98b; content: ""; }
.text-button { min-height: 32px; padding: 0; color: #fff; background: transparent; text-align: left; }
.text-button:hover { color: #b9d2ff; background: transparent; }
.workspace { min-height: 100vh; margin-left: 260px; }
.topbar { position: sticky; top: 0; z-index: var(--z-topbar); display: flex; min-height: 76px; align-items: center; gap: 16px; padding: 12px clamp(20px, 3.5vw, 48px); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.97); }
.topbar-title { min-width: 0; margin-right: auto; }
.topbar-title p { margin: 0 0 2px; color: var(--muted); font-size: 11px; }
.topbar-title h1 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.topbar-balance { display: grid; gap: 2px; padding-right: 4px; text-align: right; }
.topbar-balance span { color: var(--muted); font-size: 10px; }
.topbar-balance strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.content { width: min(1500px, 100%); margin: 0 auto; padding: 34px clamp(20px, 3.5vw, 48px) 64px; }
.view { animation: view-in .2s cubic-bezier(.22,1,.36,1); }
@keyframes view-in { from { opacity: .55; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.mobile-only, .mobile-nav { display: none; }
.icon-button { min-width: 44px; min-height: 44px; padding: 6px; color: var(--ink); background: transparent; font-size: 20px; }
.icon-button:hover { background: var(--surface-alt); }
.nav-backdrop { position: fixed; inset: 0; z-index: var(--z-backdrop); border-radius: 0; background: rgba(4,10,21,.58); }

/* Dashboard */
.welcome-line, .page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.welcome-line h2, .page-heading h2 { margin: 0 0 7px; font-size: clamp(25px, 2.4vw, 32px); letter-spacing: -.035em; text-wrap: balance; }
.welcome-line p, .page-heading p { max-width: 68ch; margin: 0; color: var(--muted); line-height: 1.55; }
.today-label { margin-bottom: 8px !important; color: var(--accent) !important; font-size: 12px; font-weight: 740; }
.role-badge, .badge { display: inline-flex; min-height: 28px; align-items: center; border-radius: 999px; padding: 5px 10px; color: #225399; background: var(--accent-soft); font-size: 12px; font-weight: 750; white-space: nowrap; }
.page-kpi { display: grid; min-width: 132px; gap: 4px; text-align: right; }
.page-kpi small { color: var(--muted); }
.page-kpi strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.metrics { display: grid; grid-template-columns: 1.2fr repeat(3, 1fr); gap: 1px; overflow: hidden; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--line); }
.metric { min-width: 0; padding: 21px; background: var(--surface); }
.metric span, .metric small { display: block; color: var(--muted); }
.metric span { font-size: 12px; font-weight: 690; }
.metric strong { display: block; margin: 11px 0 7px; font-size: clamp(22px, 2.4vw, 30px); letter-spacing: -.035em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric small { font-size: 11px; line-height: 1.4; }
.metric-primary { color: #fff; background: var(--accent); }
.metric-primary span, .metric-primary small { color: #dce9ff; }
.balance-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 22px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.balance-strip > div { display: grid; gap: 5px; padding: 13px 17px; border-right: 1px solid var(--line); }
.balance-strip > div:last-child { border-right: 0; }
.balance-strip span { color: var(--muted); font-size: 11px; }
.balance-strip strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.overview-grid { display: grid; grid-template-columns: minmax(320px, .8fr) minmax(420px, 1.2fr); gap: 20px; }

.panel { min-width: 0; margin-bottom: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 19px 21px; border-bottom: 1px solid var(--line); }
.panel-heading h3, .panel h3 { margin: 0 0 4px; font-size: 16px; letter-spacing: -.015em; }
.panel-heading p, .withdrawal-form p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.panel-body { padding: 20px; }
.share-block { display: grid; gap: 15px; padding: 20px; }
.share-code { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 9px; background: var(--surface-blue); }
.share-code span { color: var(--ink-soft); font-size: 12px; }
.share-code strong { font-size: 15px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.active-link-box { display: grid; gap: 7px; }
.active-link-box > label { color: var(--muted); font-size: 11px; }
.copy-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.copy-field input { min-width: 0; background: var(--surface-alt); font-size: 12px; }
.activity-list { display: grid; }
.activity-item { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 13px 20px; border-bottom: 1px solid #e9edf3; }
.activity-item:last-child { border-bottom: 0; }
.activity-icon { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; color: var(--success); background: var(--success-soft); font-weight: 800; }
.activity-item.retention .activity-icon { color: var(--warning); background: var(--warning-soft); }
.activity-copy { min-width: 0; }
.activity-copy strong, .activity-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-copy strong { font-size: 13px; }
.activity-copy small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.activity-value { font-size: 13px; font-variant-numeric: tabular-nums; }

.form-panel { overflow: hidden; }
.inline-form { display: grid; grid-template-columns: minmax(220px, 2fr) minmax(180px, 1fr) auto; align-items: end; gap: 14px; }
.inline-form.four-columns { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
.inline-form.four-columns button { grid-column: 4; }
.filters { display: flex; align-items: end; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.filters label { min-width: 180px; }
.filters .search-field { min-width: min(280px, 30vw); }

.table-wrap { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 13px 16px; border-bottom: 1px solid #e8ebf0; text-align: left; white-space: nowrap; }
th { color: #526079; background: #f8f9fb; font-size: 11px; font-weight: 760; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfc; }
td strong { font-weight: 730; }
.cell-subtext { display: block; max-width: 260px; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; }
.empty-state { margin: 0; padding: 30px 20px; color: var(--muted); line-height: 1.5; text-align: center; }
.empty-state.compact { padding: 24px 20px; font-size: 13px; }
.table-action { min-height: 36px; border: 1px solid var(--line-strong); padding: 6px 10px; color: var(--ink); background: #fff; font-size: 12px; }
.table-action:hover { color: var(--accent); background: var(--accent-soft); }
.table-action.danger { color: var(--danger); border-color: #e4ada8; }
.badge-success { color: var(--success); background: var(--success-soft); }
.badge-warning { color: var(--warning); background: var(--warning-soft); }
.badge-danger { color: var(--danger); background: var(--danger-soft); }
.badge-neutral { color: var(--ink-soft); background: #eef1f5; }

.notice { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; border: 1px solid var(--line); border-radius: 10px; padding: 13px 15px; background: #fff; }
.notice strong { font-size: 13px; }
.notice p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.notice-error { border-color: #e4aaa5; background: var(--danger-soft); }
.notice-info { border-color: #bcd1f4; background: var(--accent-soft); }
.withdrawal-layout { display: grid; grid-template-columns: minmax(280px, 350px) minmax(0, 1fr); gap: 20px; }
.withdrawal-form { align-self: start; display: grid; gap: 17px; padding: 21px; }
.withdrawal-form small { color: var(--muted); font-size: 11px; line-height: 1.5; }
.withdrawal-preview { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-radius: 8px; padding: 11px 12px; background: var(--surface-alt); }
.withdrawal-preview span { color: var(--muted); font-size: 11px; }
.withdrawal-preview strong { font-size: 13px; }
.history-panel { min-width: 0; }
.profile-layout { display: grid; grid-template-columns: minmax(260px, .7fr) minmax(380px, 1.3fr); gap: 20px; }
.profile-card { display: flex; align-items: center; gap: 16px; padding: 22px; }
.profile-avatar { display: grid; width: 58px; height: 58px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #fff; background: var(--accent); font-size: 22px; font-weight: 820; }
.profile-card h3 { font-size: 18px; }
.profile-card p { margin: 3px 0 10px; color: var(--muted); overflow-wrap: anywhere; }
.profile-list { padding: 3px 21px; }
.profile-list > div { display: grid; grid-template-columns: minmax(150px, .75fr) minmax(0, 1.25fr) auto; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.profile-list > div:last-child { border-bottom: 0; }
.profile-list span { color: var(--muted); font-size: 12px; }
.profile-list strong { overflow-wrap: anywhere; }
.security-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 21px; }
.security-panel p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }

#toast { position: fixed; right: 24px; bottom: 24px; z-index: var(--z-toast); max-width: min(420px, calc(100vw - 32px)); border-radius: 9px; padding: 13px 16px; color: #fff; background: var(--sidebar); opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .18s ease, transform .18s ease; }
#toast.show { opacity: 1; transform: none; }
#toast.error { background: #8f1d17; }

@media (max-width: 1180px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-grid { grid-template-columns: 1fr; }
  .inline-form.four-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inline-form.four-columns button { grid-column: auto; }
}

@media (max-width: 900px) {
  .auth-layout { grid-template-columns: minmax(320px, .8fr) minmax(390px, 1.2fr); }
  .auth-story { padding: 34px; }
  .auth-story h1 { font-size: 42px; }
  .auth-benefits { font-size: 13px; }
  .sidebar { width: 232px; }
  .workspace { margin-left: 232px; }
  .balance-strip { grid-template-columns: repeat(2, 1fr); }
  .balance-strip > div:nth-child(2) { border-right: 0; }
  .balance-strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .withdrawal-layout, .profile-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  html { background: var(--surface); }
  body { background: var(--surface-alt); }
  .auth-layout { display: block; background: var(--surface); }
  .auth-story { display: none; }
  .auth-panel { min-height: 100svh; padding: 24px 20px 44px; align-content: start; }
  .auth-card { margin-top: 3vh; }
  .mobile-auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 32px; }
  .mobile-auth-brand div { display: grid; gap: 2px; }
  .mobile-auth-brand small { color: var(--muted); font-size: 11px; }
  .auth-tabs { margin-bottom: 28px; }
  .form-split { grid-template-columns: 1fr; }
  .mobile-only { display: inline-grid; place-items: center; }
  .sidebar { width: min(300px, calc(100vw - 42px)); transform: translateX(-103%); transition: transform .2s cubic-bezier(.22,1,.36,1); }
  .sidebar.open { transform: none; }
  .sidebar .icon-button { color: #fff; }
  .workspace { margin-left: 0; }
  .topbar { min-height: 67px; padding: 10px 14px; }
  .topbar-title p { display: none; }
  .topbar-title h1 { font-size: 18px; }
  .topbar-balance { display: none; }
  .topbar .secondary-button { min-height: 40px; padding-inline: 10px; font-size: 12px; }
  .content { padding: 23px 14px calc(92px + env(safe-area-inset-bottom)); }
  .mobile-nav { position: fixed; inset: auto 0 0 0; z-index: var(--z-mobile-nav); display: grid; grid-template-columns: repeat(5, 1fr); min-height: calc(64px + env(safe-area-inset-bottom)); padding: 6px 5px env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: rgba(255,255,255,.98); }
  .mobile-nav button { display: grid; min-width: 0; min-height: 50px; place-items: center; gap: 1px; padding: 4px 2px; color: var(--muted); background: transparent; font-size: 11px; }
  .mobile-nav button span { font-size: 18px; line-height: 1; }
  .mobile-nav button.active { color: var(--accent); }
  .welcome-line, .page-heading { flex-direction: column; gap: 12px; margin-bottom: 20px; }
  .welcome-line h2, .page-heading h2 { font-size: 25px; overflow-wrap: anywhere; }
  .page-kpi { display: flex; min-width: 0; align-items: baseline; gap: 8px; text-align: left; }
  .page-kpi strong { font-size: 18px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { padding: 16px; }
  .metric-primary { grid-column: 1 / -1; }
  .metric:last-child { grid-column: 1 / -1; }
  .metric strong { font-size: 21px; }
  .balance-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .balance-strip > div { min-width: 0; padding: 12px; }
  .balance-strip strong { overflow-wrap: anywhere; }
  .inline-form, .inline-form.four-columns { grid-template-columns: minmax(0, 1fr); }
  .inline-form.four-columns button { grid-column: auto; }
  .filters { align-items: stretch; flex-direction: column; }
  .filters label, .filters .search-field { min-width: 0; }
  .notice, .security-panel { align-items: stretch; flex-direction: column; }
  .profile-list > div { grid-template-columns: 1fr auto; gap: 5px 12px; }
  .profile-list > div > span { grid-column: 1 / -1; }
  .table-wrap { overflow: visible; }
  table, tbody { display: block; }
  thead { display: none; }
  tbody { padding: 4px 14px 14px; }
  tbody tr { display: block; margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 5px 12px; background: #fff; }
  tbody tr:hover { background: #fff; }
  td { display: grid; grid-template-columns: minmax(105px, .75fr) minmax(0, 1.25fr); gap: 10px; padding: 9px 0; border-bottom: 1px solid #edf0f4; white-space: normal; text-align: right; overflow-wrap: anywhere; }
  td:last-child { border-bottom: 0; }
  td::before { align-self: start; color: var(--muted); content: attr(data-label); font-size: 11px; font-weight: 690; text-align: left; }
  .cell-subtext { max-width: none; }
  .table-action { justify-self: end; }
  .empty-state { padding: 26px 16px; }
  #toast { right: 14px; bottom: calc(76px + env(safe-area-inset-bottom)); }
}

@media (max-width: 380px) {
  .content { padding-inline: 10px; }
  .metrics { grid-template-columns: 1fr; }
  .metric-primary { grid-column: auto; }
  .metric:last-child { grid-column: auto; }
  .balance-strip { grid-template-columns: 1fr; }
  .balance-strip > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .balance-strip > div:last-child { border-bottom: 0; }
  .copy-field { grid-template-columns: 1fr; }
  .copy-field button { width: 100%; }
  .mobile-nav button { font-size: 10px; }
}

@media (max-width: 440px) {
  .topbar .secondary-button { width: 42px; min-width: 42px; overflow: hidden; padding: 0; font-size: 0; }
  .topbar .secondary-button::before { content: "↻"; font-size: 18px; }
}

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