/* ===================================================================
   Satchel — shared design system (web dashboard)
   Used by every Satchel page (dashboard, send, receive, buy, swap, etc.)
   =================================================================== */

:root{
  color-scheme: dark;
  --ink:#0A0A0A;
  --surface:#141414;
  --surface-2:#1C1C1C;
  --surface-3:#262626;
  --border:#272727;
  --accent:#F4C518;
  --accent-ink:#141200;
  --teal:#29D9C2;
  --good:#29D9C2;
  --bad:#FF5C5C;
  --text-primary:#FFFFFF;
  --text-secondary:#9A9A9A;
  --text-muted:#666666;
  --shadow: 0 20px 60px -20px rgba(0,0,0,.7);
  --ring: 0 0 0 3px rgba(244,197,24,.35);
}

*{box-sizing:border-box;}
[hidden]{display:none!important;}
html,body{height:100%;}
body{
  margin:0;
  background:var(--ink);
  color:var(--text-primary);
  font-family: 'Sora', ui-sans-serif, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}
.num{ font-family:'JetBrains Mono', ui-monospace, SFMono-Regular, monospace; font-variant-numeric: tabular-nums; }
a{ color:inherit; }
button{ font-family:inherit; }

/* ===================================================================
   Site shell: sidebar + topbar + content
   =================================================================== */

.shell{ display:flex; min-height:100vh; }

.sidebar{
  flex:none;
  width:240px;
  display:flex; flex-direction:column; gap:26px;
  padding:24px 16px;
  background:var(--surface);
  border-right:1px solid var(--border);
  position:sticky; top:0; height:100vh;
}
.brand{
  display:flex; align-items:center; gap:10px;
  padding:4px 8px;
}
.brand .mark{
  width:34px; height:34px; border-radius:10px; flex:none;
  background:linear-gradient(145deg, var(--accent), color-mix(in srgb, var(--accent) 70%, black));
  display:flex; align-items:center; justify-content:center;
  color:var(--accent-ink); font-weight:800; font-size:15px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
}
.brand b{ font-size:16px; font-weight:800; letter-spacing:-.01em; }

.sidenav{ display:flex; flex-direction:column; gap:2px; }
.sidenav a{
  display:flex; align-items:center; gap:12px;
  padding:10px 12px; border-radius:12px; position:relative;
  color:var(--text-secondary); text-decoration:none; font-size:13.5px; font-weight:600;
}
.sidenav a svg{ width:19px; height:19px; flex:none; }
.sidenav a:hover{ background:var(--surface-2); color:var(--text-primary); }
.sidenav a.active{ background:color-mix(in srgb, var(--accent) 10%, transparent); color:var(--accent); }
.sidenav a.active::before{
  content:""; position:absolute; left:-16px; top:50%; transform:translateY(-50%);
  width:3px; height:18px; border-radius:0 3px 3px 0; background:var(--accent);
}
.sidenav .divider{ height:1px; background:var(--border); margin:10px 4px; }

.sidenav-logout{
  display:flex; align-items:center; gap:12px;
  padding:10px 12px; border-radius:12px; margin-top:auto;
  color:var(--text-muted); text-decoration:none; font-size:13.5px; font-weight:600;
}
.sidenav-logout svg{ width:19px; height:19px; flex:none; }
.sidenav-logout:hover{ color:var(--bad); background:var(--surface-2); }

.sidebar-foot{
  margin-top:auto; display:flex; align-items:center; gap:10px;
  padding:10px 12px; border-radius:14px; background:var(--surface-2); border:1px solid var(--border);
  cursor:pointer;
}
.sidebar-foot:hover{ border-color:color-mix(in srgb, var(--accent) 35%, var(--border)); }
.sidebar-foot div{ min-width:0; text-align:left; }
.sidebar-foot b{ display:block; font-size:12.5px; font-weight:700; }
.sidebar-foot div span{ display:block; font-size:10.5px; color:var(--text-muted); font-family:'JetBrains Mono',monospace; }
.sidebar-foot svg.chev{ width:14px; height:14px; color:var(--text-muted); margin-left:auto; flex:none; }

.main{ flex:1; min-width:0; display:flex; flex-direction:column; }

.topbar{
  position:sticky; top:0; z-index:5;
  display:flex; align-items:center; gap:16px;
  padding:16px clamp(16px,3vw,32px);
  background:color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter:blur(10px);
  border-bottom:1px solid var(--border);
}
.topbar h1{ margin:0; font-size:17px; font-weight:800; letter-spacing:-.01em; flex:none; color:var(--accent); }
.topbar-search{
  flex:1; max-width:360px;
  display:flex; align-items:center; gap:8px;
  background:var(--surface-2); border:1px solid var(--border); border-radius:11px;
  padding:8px 12px; color:var(--text-muted);
}
.topbar-search svg{ width:15px; height:15px; flex:none; }
.topbar-search input{ border:none; background:none; outline:none; font-size:13px; color:var(--text-primary); width:100%; }
.topbar-search input::placeholder{ color:var(--text-muted); }
.topbar-actions{ display:flex; align-items:center; gap:8px; margin-left:auto; }

.toggle-balances{
  display:flex; align-items:center; gap:6px;
  border:1px solid var(--border); background:var(--surface-2); color:var(--text-secondary);
  padding:8px 12px; border-radius:100px; cursor:pointer; font-size:12.5px; font-weight:600;
}
.toggle-balances:hover{ color:var(--text-primary); }
.toggle-balances svg{ width:15px; height:15px; }

.icon-btn{
  width:38px; height:38px; border-radius:50%; border:1px solid var(--border);
  background:var(--surface-2); color:var(--text-secondary);
  display:flex; align-items:center; justify-content:center; cursor:pointer; position:relative; flex:none;
}
.icon-btn:hover{ color:var(--text-primary); border-color:color-mix(in srgb, var(--accent) 40%, var(--border)); }
.icon-btn svg{ width:17px; height:17px; }
.dot{
  position:absolute; top:7px; right:8px; width:6px; height:6px; border-radius:50%;
  background:var(--bad); box-shadow:0 0 0 2px var(--surface-2);
}

.avatar{
  width:30px; height:30px; border-radius:50%;
  background:linear-gradient(145deg, var(--accent), color-mix(in srgb, var(--accent) 70%, black));
  display:flex; align-items:center; justify-content:center;
  color:var(--accent-ink); font-weight:700; font-size:12px; flex:none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
}
.avatar.settings-avatar{ width:64px; height:64px; font-size:22px; }

.menu-btn{ display:none; }
.nav-backdrop{ display:none; }

.content{
  flex:1;
  max-width:1180px; width:100%;
  margin:0 auto;
  padding:28px clamp(16px,3vw,32px) 64px;
  display:flex; flex-direction:column; gap:22px;
}

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

/* Below 900px the sidebar becomes an off-canvas drawer (opened by the topbar's
   menu button) instead of a squeezed inline column, so the page itself keeps
   the full desktop-style layout at full width. */
@media (max-width:900px){
  .menu-btn{
    display:flex; align-items:center; justify-content:center; flex:none;
    width:34px; height:34px; border-radius:10px;
    background:var(--surface-2); border:1px solid var(--border); color:var(--text-primary);
    cursor:pointer;
  }
  .menu-btn svg{ width:18px; height:18px; }

  .sidebar{
    position:fixed; top:0; left:0; bottom:0; z-index:60;
    width:248px; max-width:82vw; height:100%; overflow-y:auto;
    transform:translateX(-100%);
    transition:transform .22s ease;
    box-shadow:0 0 60px rgba(0,0,0,.5);
  }
  .sidebar.open{ transform:translateX(0); }

  .nav-backdrop.show{
    display:block; position:fixed; inset:0; z-index:55;
    background:rgba(0,0,0,.6);
  }

  .topbar{ padding:10px clamp(10px,3vw,14px); gap:6px; }
  .topbar h1{ font-size:13px; }
  .topbar-search{ max-width:none; flex:1 1 auto; min-width:0; padding:6px 9px; gap:5px; }
  .topbar-search input{ font-size:10.5px; }
  .topbar-search input::placeholder{ overflow:hidden; text-overflow:ellipsis; }
  .topbar-actions{ gap:4px; }
  .toggle-balances{ padding:6px 8px; font-size:9.5px; gap:3px; }
  .toggle-balances svg{ width:12px; height:12px; }
  .icon-btn{ width:26px; height:26px; }
  .icon-btn svg{ width:13px; height:13px; }
  .dot{ width:5px; height:5px; top:5px; right:6px; }
  .avatar{ width:24px; height:24px; font-size:9.5px; }

  .content{ padding:14px clamp(10px,3vw,16px) 36px; gap:14px; }

  .balance-row{ gap:10px; }
  .balance-value{ font-size:26px; }
  .balance-stats{ gap:14px; }
  .stat-mini{ gap:3px; }
  .stat-mini .stat-label{ font-size:9px; }
  .stat-mini .stat-val{ font-size:11.5px; gap:2px; }
  .stat-mini .stat-val svg{ width:11px; height:11px; }

  .stack-grid{ grid-template-columns:1fr; }
  .chart-card, .portfolio-card, .card{ padding:12px; border-radius:16px; }
  .chart-price{ font-size:19px; }
  .chart-pair b{ font-size:12px; }
  .seg{ padding:2px; }
  .seg button{ padding:5px 8px; font-size:10px; }
  .section-head h2{ font-size:12.5px; }
}

/* ===================================================================
   Dashboard: balance row, feature cards, portfolio + chart, activity
   =================================================================== */

.asset-icon{
  width:36px; height:36px; border-radius:50%; flex:none;
  display:flex; align-items:center; justify-content:center;
  color:#fff; font-weight:700; font-size:13px; font-family:'JetBrains Mono',monospace;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22), 0 2px 6px rgba(0,0,0,.18);
}
.pct{ font-family:'JetBrains Mono',monospace; font-size:11.5px; font-weight:600; display:flex; align-items:center; gap:2px; }
.pct svg{ width:10px; height:10px; }
.pct.up{ color:var(--good); }
.pct.down{ color:var(--bad); }
.pct.flat{ color:var(--text-muted); }

.sensitive.hide-balances{ filter:blur(9px); user-select:none; }

/* ---- balance row ---- */
.balance-row{
  display:flex; align-items:flex-end; justify-content:space-between; flex-wrap:wrap; gap:20px;
  padding:6px 4px 2px;
}
.balance-label{
  font-size:11.5px; letter-spacing:.08em; text-transform:uppercase; color:var(--text-muted); font-weight:700;
}
.balance-value{
  font-family:'JetBrains Mono',monospace; font-weight:700;
  font-size:clamp(34px, 5vw, 46px);
  letter-spacing:-0.015em; margin-top:6px; line-height:1;
  color:var(--text-primary);
}
.balance-value .cents{ color:var(--text-muted); font-weight:600; font-size:.62em; }
.balance-stats{ display:flex; gap:30px; flex-wrap:wrap; }
.stat-mini{ display:flex; flex-direction:column; align-items:flex-end; gap:6px; }
.stat-mini .stat-label{ font-size:11px; letter-spacing:.04em; text-transform:uppercase; color:var(--text-muted); font-weight:700; }
.stat-mini .stat-val{ display:flex; align-items:center; gap:4px; font-family:'JetBrains Mono',monospace; font-weight:700; font-size:14px; }
.stat-mini .stat-val.up{ color:var(--good); }
.stat-mini .stat-val.down{ color:var(--bad); }
.stat-mini .stat-val svg{ width:14px; height:14px; }

/* ---- feature cards ---- */
.live-badge{
  display:flex; align-items:center; gap:6px;
  font-size:11px; font-weight:700; color:var(--text-muted);
  margin:-8px 2px 2px;
}
.live-dot{
  width:6px; height:6px; border-radius:50%; background:var(--good); flex:none;
  box-shadow:0 0 0 0 color-mix(in srgb, var(--good) 60%, transparent);
  animation: live-pulse 2s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce){ .live-dot{ animation:none; } }
@keyframes live-pulse{
  0%{ box-shadow:0 0 0 0 color-mix(in srgb, var(--good) 45%, transparent); }
  70%{ box-shadow:0 0 0 5px color-mix(in srgb, var(--good) 0%, transparent); }
  100%{ box-shadow:0 0 0 0 color-mix(in srgb, var(--good) 0%, transparent); }
}

.feature-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:16px; }

.feature-card{
  position:relative; overflow:hidden; min-width:0;
  background:var(--surface); border:1px solid var(--border); border-radius:18px; padding:16px;
  transition: border-color .15s ease;
}
.feature-card:hover{ border-color:color-mix(in srgb, var(--accent) 30%, var(--border)); }
.trend-badge{
  position:absolute; top:14px; right:14px; width:26px; height:26px; border-radius:50%; flex:none;
  display:flex; align-items:center; justify-content:center;
}
.trend-badge.up{ background:var(--good); color:#04211D; }
.trend-badge.down{ background:var(--bad); color:#2B0A0A; }
.trend-badge svg{ width:13px; height:13px; }

.fc-head{ display:flex; align-items:center; gap:10px; margin-bottom:16px; padding-right:30px; min-width:0; }
.fc-head .asset-id{ min-width:0; }
.fc-head .asset-id b{ display:block; font-size:13px; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.fc-head .asset-id span{ font-size:11px; color:var(--text-muted); }
.fc-price{ font-family:'JetBrains Mono',monospace; font-weight:700; font-size:19px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.fc-pct{ margin-top:4px; }
.fc-spark{ width:100%; height:36px; margin-top:12px; display:block; }

/* Keep all 4 feature cards in one row even on phones — shrink them instead
   of stacking, so the row stays fully visible like the rest of the page. */
@media (max-width:900px){
  .feature-grid{ gap:8px; }
  .feature-card{ padding:9px; border-radius:14px; }
  .trend-badge{ top:7px; right:7px; width:16px; height:16px; }
  .trend-badge svg{ width:8px; height:8px; }
  .fc-head{ gap:6px; margin-bottom:8px; padding-right:18px; }
  .fc-head .asset-icon{ width:20px; height:20px; font-size:9px; }
  .fc-head .asset-id b{ display:none; }
  .fc-head .asset-id span{ display:block; font-size:10.5px; font-weight:800; color:var(--text-primary); }
  .fc-price{ font-size:11px; }
  .fc-pct{ font-size:9.5px; gap:1px; margin-top:2px; }
  .fc-pct svg{ width:8px; height:8px; }
  .fc-spark{ height:20px; margin-top:6px; }
}

/* ---- portfolio + chart row ---- */
.stack-grid{ display:grid; grid-template-columns:1fr 1.5fr; gap:16px; align-items:start; }
@media (max-width:860px){ .stack-grid{ grid-template-columns:1fr; } }

.section-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; }
.section-head h2{ font-size:14px; letter-spacing:.01em; color:var(--text-primary); font-weight:800; margin:0; }
.section-head .count{ color:var(--text-muted); font-weight:500; }
.section-head .see-all{ font-size:12.5px; color:var(--teal); font-weight:600; background:none; border:none; cursor:pointer; }

.portfolio-card{ background:var(--accent); color:var(--accent-ink); border-radius:22px; padding:20px; }
.portfolio-card .section-head{ margin-bottom:2px; }
.portfolio-card .section-head h2{ color:var(--accent-ink); }
.portfolio-card .section-head .see-all{ color:var(--accent-ink); opacity:.55; font-weight:800; }

.portfolio-head{
  display:flex; align-items:center; gap:12px;
  padding:10px 8px 8px;
  font-size:10px; letter-spacing:.07em; text-transform:uppercase; font-weight:800;
  color:var(--accent-ink); opacity:.5;
}
.portfolio-head .h-asset{ flex:1; min-width:0; }
.portfolio-head .h-price{ flex:none; width:88px; text-align:right; }
.portfolio-head .h-holdings{ flex:none; width:118px; text-align:right; }

.portfolio-row{
  display:flex; align-items:center; gap:12px;
  padding:11px 8px; margin:0 -8px; border-radius:12px;
  border-bottom:1px solid rgba(10,10,10,.10);
  transition:background .15s ease;
}
.portfolio-row:last-child{ border-bottom:none; }
.portfolio-row:hover{ background:rgba(10,10,10,.08); }
.portfolio-row .asset-icon{ width:32px; height:32px; font-size:12px; }
.portfolio-row .p-id{ flex:1; min-width:0; }
.portfolio-row .p-id b{
  display:block; font-size:13px; font-weight:800; line-height:1.25;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.portfolio-row .p-id span{ display:block; font-size:10.5px; opacity:.6; font-family:'JetBrains Mono',monospace; margin-top:1px; }
.portfolio-row .p-price{
  flex:none; width:88px; text-align:right;
  font-family:'JetBrains Mono',monospace; font-variant-numeric:tabular-nums;
  font-size:12px; font-weight:600; opacity:.75;
}
.portfolio-row .p-amounts{ text-align:right; flex:none; width:118px; }
.portfolio-row .p-value{
  display:block; font-family:'JetBrains Mono',monospace; font-variant-numeric:tabular-nums;
  font-weight:800; font-size:13.5px; line-height:1.25;
}
.portfolio-row .p-qty{
  display:block; font-family:'JetBrains Mono',monospace; font-variant-numeric:tabular-nums;
  font-size:10.5px; opacity:.65; margin-top:1px;
}

@media (max-width:520px){
  .portfolio-head .h-price, .portfolio-row .p-price{ display:none; }
  .portfolio-head .h-holdings{ width:auto; }
}

.chart-card{ background:var(--surface); border:1px solid var(--border); border-radius:22px; padding:18px; display:flex; flex-direction:column; gap:14px; }
.chart-head{ display:flex; align-items:flex-start; justify-content:space-between; flex-wrap:wrap; gap:12px; }
.chart-pair{ display:flex; align-items:center; gap:6px; background:none; border:none; cursor:pointer; color:var(--text-primary); padding:0; }
.chart-pair b{ font-size:13px; font-weight:700; }
.chart-pair svg{ width:14px; height:14px; color:var(--text-muted); }
.chart-price{ font-family:'JetBrains Mono',monospace; font-weight:800; font-size:24px; margin-top:4px; }

.seg{
  display:inline-flex; background:var(--surface-2); border:1px solid var(--border);
  border-radius:10px; padding:3px; gap:2px;
}
.seg button{
  border:none; background:none; padding:6px 13px; border-radius:7px;
  font-family:'JetBrains Mono',monospace; font-size:11.5px; font-weight:700;
  color:var(--text-muted); cursor:pointer;
}
.seg button.active{ background:var(--accent); color:var(--accent-ink); }

.chart-svg-wrap svg{ width:100%; height:auto; display:block; overflow:visible; }

@media (prefers-reduced-motion: reduce){ .chart-dot-ring{ animation:none !important; } }
.chart-dot-ring{ animation: pulse 2.6s ease-in-out infinite; transform-origin:center; }
@keyframes pulse{ 0%,100%{ opacity:.55; } 50%{ opacity:.05; } }

.activity{
  display:flex; align-items:center; gap:11px;
  padding:11px 8px; margin:0 -8px; border-radius:14px;
  border-bottom:1px solid var(--border);
  transition: background .15s ease;
}
.activity:hover{ background:var(--surface-2); }
.activity:last-child{ border-bottom:none; }
.activity-icon{
  width:36px; height:36px; border-radius:50%; flex:none;
  display:flex; align-items:center; justify-content:center; border:1px solid var(--border); background:var(--surface-2);
}
.activity-icon svg{ width:16px; height:16px; }
.activity-icon.recv{ color:var(--good); }
.activity-icon.send{ color:var(--bad); }
.activity-icon.swap{ color:var(--teal); }
.activity-id{ min-width:0; flex:1; }
.activity-id b{ font-size:13px; font-weight:600; display:block; }
.activity-id span{ font-size:11.5px; color:var(--text-muted); font-family:'JetBrains Mono',monospace; }
.activity-amt{ text-align:right; flex:none; }
.activity-amt .amt{ font-family:'JetBrains Mono',monospace; font-size:13px; font-weight:600; display:block; }
.activity-amt .amt.pos{ color:var(--good); }
.activity-amt .amt.neg{ color:var(--bad); }
.activity-amt .time{ font-size:11px; color:var(--text-muted); display:block; margin-top:1px; }

footer.note{ text-align:center; font-size:11px; color:var(--text-muted); padding-top:4px; }

/* ===================================================================
   Task pages: Send / Receive / Buy / Swap
   =================================================================== */

.task-header{ display:flex; flex-direction:column; gap:14px; max-width:900px; margin:0 auto; width:100%; }
.back-link{
  display:inline-flex; align-items:center; gap:6px; align-self:flex-start;
  color:var(--text-muted); text-decoration:none; font-size:12.5px; font-weight:600;
}
.back-link:hover{ color:var(--text-primary); }
.back-link svg{ width:14px; height:14px; }
.task-header h1{ margin:0; font-size:22px; font-weight:800; letter-spacing:-.01em; }
.task-header p{ margin:0; color:var(--text-secondary); font-size:13.5px; }

.task-grid{
  display:grid; grid-template-columns:1.3fr 1fr; gap:20px; align-items:start;
  max-width:900px; margin:0 auto; width:100%;
}
@media (max-width:860px){ .task-grid{ grid-template-columns:1fr; } }

.task-card{
  width:100%;
  display:flex; flex-direction:column; gap:20px;
}

.summary-card{
  position:sticky; top:20px;
  display:flex; flex-direction:column; gap:14px;
}
.summary-card h2{ margin:0; font-size:13px; font-weight:800; color:var(--text-primary); }
.summary-asset{ display:flex; align-items:center; gap:10px; }
.summary-asset b{ display:block; font-size:13.5px; font-weight:700; }
.summary-asset span{ display:block; font-size:11px; color:var(--text-muted); }
.summary-note{
  display:flex; gap:8px; font-size:11.5px; line-height:1.5; color:var(--text-muted);
  padding-top:10px; border-top:1px solid var(--border);
}
.summary-note svg{ width:14px; height:14px; color:var(--accent); flex:none; margin-top:1px; }
@media (max-width:860px){ .summary-card{ position:static; } }

.field{ display:flex; flex-direction:column; gap:8px; }
.field-label{ font-size:11px; letter-spacing:.08em; text-transform:uppercase; color:var(--text-muted); font-weight:700; }

.asset-select{
  display:flex; align-items:center; gap:10px;
  background:var(--surface-2); border:1px solid var(--border);
  border-radius:14px; padding:10px 12px; cursor:pointer; width:100%; text-align:left;
  color:var(--text-primary);
}
.asset-select:hover{ border-color:color-mix(in srgb, var(--accent) 35%, var(--border)); }
.asset-select .asset-icon{ width:32px; height:32px; font-size:12px; }
.asset-select .asset-select-text{ flex:1; min-width:0; }
.asset-select .asset-select-text b{ display:block; font-size:13.5px; font-weight:600; }
.asset-select .asset-select-text span{ display:block; font-size:11.5px; color:var(--text-muted); }
.asset-select svg.chev{ width:16px; height:16px; color:var(--text-muted); flex:none; }

.input-row{
  display:flex; align-items:center; gap:6px;
  background:var(--surface-2); border:1px solid var(--border);
  border-radius:14px; padding:4px 6px 4px 14px;
}
.input-row:focus-within{ border-color:color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow:var(--ring); }
.input-row input[type="text"], .input-row input[type="email"], .input-row input[type="password"],
.input-row input[type="tel"], .input-row input[type="date"], .input-row input[type="number"]{
  flex:1; min-width:0; width:100%; border:none; background:none; outline:none;
  font-family:'JetBrains Mono',monospace; font-size:13px; color:var(--text-primary);
  padding:10px 0;
}
.input-row input::placeholder{ color:var(--text-muted); font-family:'Sora',sans-serif; }
.input-row input[type="date"]{ color-scheme:dark; }
:root[data-theme="light"] .input-row input[type="date"]{ color-scheme:light; }
.input-row select{
  flex:1; min-width:0; width:100%; border:none; background:none; outline:none;
  font-family:'Sora',sans-serif; font-size:13px; color:var(--text-primary);
  padding:10px 0; cursor:pointer; appearance:none;
}
.input-row select option{ background:var(--surface-2); color:var(--text-primary); }
.input-row svg.chev{ width:15px; height:15px; color:var(--text-muted); flex:none; margin-right:2px; }
.input-row .ghost-btn{
  width:32px; height:32px; border-radius:50%; flex:none; border:none;
  background:var(--surface-3); color:var(--text-secondary); cursor:pointer;
  display:flex; align-items:center; justify-content:center;
}
.input-row .ghost-btn:hover{ color:var(--text-primary); }
.input-row .ghost-btn svg{ width:15px; height:15px; }
.input-row.file-row{ padding:10px 10px; }
.input-row input[type="file"]{
  flex:1; min-width:0; width:100%; border:none; background:none; outline:none;
  font-family:'Sora',sans-serif; font-size:12.5px; color:var(--text-secondary);
}
.input-row input[type="file"]::file-selector-button{
  background:var(--surface-3); color:var(--text-primary); border:1px solid var(--border);
  padding:7px 12px; border-radius:8px; margin-right:10px; cursor:pointer; font-size:12px; font-weight:600;
}
.input-row input[type="file"]::file-selector-button:hover{ border-color:color-mix(in srgb, var(--accent) 40%, var(--border)); }

.checkbox-row{ display:flex; align-items:center; gap:10px; }
.checkbox-row input[type="checkbox"]{ width:18px; height:18px; accent-color:var(--accent); cursor:pointer; flex:none; }
.checkbox-row label{ font-size:13px; color:var(--text-secondary); cursor:pointer; }

.badge-valid{ display:inline-flex; align-items:center; gap:5px; font-size:12px; font-weight:600; color:var(--good); }
.badge-valid svg{ width:13px; height:13px; }

.amount-block{
  background:var(--surface-2); border:1px solid var(--border); border-radius:18px;
  padding:18px 18px 16px; display:flex; flex-direction:column; gap:4px;
}
.amount-line{ display:flex; align-items:baseline; gap:10px; }
.amount-line input{
  flex:1; min-width:0; border:none; background:none; outline:none;
  font-family:'JetBrains Mono',monospace; font-weight:700; font-size:clamp(26px,4vw,34px);
  color:var(--text-primary); letter-spacing:-.01em; padding:0;
}
.amount-line .unit{
  font-family:'JetBrains Mono',monospace; font-weight:700; font-size:15px; color:var(--text-secondary);
  background:var(--surface-3); border:1px solid var(--border); padding:5px 10px; border-radius:100px; flex:none;
}
.amount-sub{ display:flex; align-items:center; justify-content:space-between; font-size:12px; color:var(--text-muted); font-family:'JetBrains Mono',monospace; }
.max-btn{ background:none; border:none; color:var(--teal); font-weight:700; cursor:pointer; font-family:'Sora',sans-serif; font-size:12px; padding:0; }

.row-kv{ display:flex; align-items:center; justify-content:space-between; gap:10px; padding:11px 0; border-bottom:1px solid var(--border); font-size:13px; }
.row-kv:last-child{ border-bottom:none; }
.row-kv .k{ display:flex; align-items:center; gap:5px; color:var(--text-secondary); }
.row-kv .k svg{ width:13px; height:13px; color:var(--text-muted); }
.row-kv .v{ font-family:'JetBrains Mono',monospace; font-weight:600; text-align:right; }
.row-kv .v small{ display:block; font-weight:500; color:var(--text-muted); font-size:11px; margin-top:1px; }
.row-kv.total{ font-size:14px; }
.row-kv.total .k{ color:var(--text-primary); font-weight:700; font-family:'Sora',sans-serif; }
.kv-card{ background:var(--surface-2); border:1px solid var(--border); border-radius:16px; padding:2px 14px; }

.notice{
  display:flex; gap:10px; align-items:flex-start;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-2));
  border:1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  border-radius:14px; padding:12px 14px; font-size:12px; line-height:1.5; color:var(--text-secondary);
}
.notice svg{ width:16px; height:16px; color:var(--accent); flex:none; margin-top:1px; }

.action-row{ display:flex; gap:10px; }
.btn-primary{
  flex:1; border:none; cursor:pointer; text-decoration:none;
  display:flex; align-items:center; justify-content:center; gap:8px;
  background:var(--accent);
  color:var(--accent-ink); font-weight:800; font-size:14.5px;
  padding:15px 18px; border-radius:16px;
  box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--accent) 60%, transparent);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn-primary:hover{ transform:translateY(-1px); box-shadow:0 14px 28px -10px color-mix(in srgb, var(--accent) 65%, transparent); }
.btn-primary:active{ transform:translateY(0); }
.btn-primary svg{ width:17px; height:17px; }
.btn-secondary{
  border:1px solid var(--border); background:var(--surface-2); color:var(--text-primary);
  cursor:pointer; text-decoration:none; font-weight:700; font-size:14.5px;
  display:flex; align-items:center; justify-content:center; gap:8px;
  padding:15px 18px; border-radius:16px;
}
.btn-secondary:hover{ background:var(--surface-3); }
.btn-secondary svg{ width:17px; height:17px; }

/* ---------- Receive: QR + address ---------- */
.qr-card{
  background:var(--surface-2); border:1px solid var(--border); border-radius:22px;
  padding:22px; display:flex; flex-direction:column; align-items:center; gap:14px;
}
.qr-wrap{ width:100%; max-width:220px; aspect-ratio:1; background:#fff; border-radius:14px; padding:14px; box-shadow:0 10px 26px -14px rgba(0,0,0,.3); }
.qr-wrap svg{ width:100%; height:100%; display:block; }
.addr-box{
  width:100%; display:flex; align-items:center; gap:8px;
  background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:10px 12px;
}
.addr-box span{ flex:1; min-width:0; font-family:'JetBrains Mono',monospace; font-size:12px; color:var(--text-secondary); word-break:break-all; line-height:1.4; }
.addr-box button{ flex:none; border:none; background:var(--surface-3); color:var(--text-primary); width:32px; height:32px; border-radius:50%; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.addr-box button svg{ width:14px; height:14px; }

/* ---------- Buy: quick chips + payment row ---------- */
.chip-row{ display:flex; gap:8px; flex-wrap:wrap; }
.quick-chip{
  border:1px solid var(--border); background:var(--surface-2); color:var(--text-secondary);
  padding:7px 14px; border-radius:100px; font-size:12.5px; font-weight:700; cursor:pointer;
  font-family:'JetBrains Mono',monospace;
}
.quick-chip:hover{ border-color:color-mix(in srgb, var(--accent) 40%, var(--border)); color:var(--text-primary); }
.quick-chip.active{ background:var(--accent); border-color:var(--accent); color:var(--accent-ink); }

.payment-row{
  display:flex; align-items:center; gap:12px; width:100%;
  background:var(--surface-2); border:1px solid var(--border); border-radius:14px; padding:12px 14px;
  cursor:pointer; color:var(--text-primary); text-align:left;
}
.payment-row:hover{ border-color:color-mix(in srgb, var(--accent) 35%, var(--border)); }
.payment-row .pay-icon{ width:36px; height:28px; border-radius:6px; flex:none; background:#1A1F71; display:flex; align-items:center; justify-content:center; color:#fff; }
.payment-row .pay-icon svg{ width:20px; height:20px; }
.payment-row .pay-text{ flex:1; min-width:0; }
.payment-row .pay-text b{ display:block; font-size:13.5px; font-weight:600; }
.payment-row .pay-text span{ display:block; font-size:11.5px; color:var(--text-muted); font-family:'JetBrains Mono',monospace; }
.payment-row svg.chev{ width:16px; height:16px; color:var(--text-muted); flex:none; }

/* ---------- Swap: stacked cards + flip button ---------- */
.swap-stack{ position:relative; display:flex; flex-direction:column; gap:8px; }
.swap-card{ background:var(--surface-2); border:1px solid var(--border); border-radius:18px; padding:16px; display:flex; flex-direction:column; gap:10px; }
.swap-card .swap-card-head{ display:flex; align-items:center; justify-content:space-between; }
.swap-card .swap-card-head .tag{ font-size:11px; letter-spacing:.08em; text-transform:uppercase; color:var(--text-muted); font-weight:700; }
.swap-card .swap-card-head .bal{ font-size:11px; color:var(--text-muted); font-family:'JetBrains Mono',monospace; }
.swap-card .swap-card-body{ display:flex; align-items:center; gap:10px; }
.swap-card input{
  flex:1; min-width:0; border:none; background:none; outline:none;
  font-family:'JetBrains Mono',monospace; font-weight:700; font-size:clamp(22px,4vw,28px);
  color:var(--text-primary); letter-spacing:-.01em; padding:0;
}
.swap-card .readout{
  flex:1; min-width:0; font-family:'JetBrains Mono',monospace; font-weight:700; font-size:clamp(22px,4vw,28px);
  color:var(--text-primary); letter-spacing:-.01em;
}
.swap-asset-chip{
  display:flex; align-items:center; gap:8px; flex:none;
  background:var(--surface); border:1px solid var(--border); border-radius:100px; padding:6px 12px 6px 6px;
  cursor:pointer; color:var(--text-primary);
}
.swap-asset-chip:hover{ border-color:color-mix(in srgb, var(--accent) 40%, var(--border)); }
.swap-asset-chip .asset-icon{ width:26px; height:26px; font-size:11px; }
.swap-asset-chip b{ font-size:13.5px; font-weight:700; }
.swap-asset-chip svg{ width:14px; height:14px; color:var(--text-muted); }

.swap-flip{
  position:absolute; left:50%; top:50%; transform:translate(-50%,-50%);
  width:40px; height:40px; border-radius:50%; z-index:2;
  background:var(--surface); border:3px solid var(--ink);
  display:flex; align-items:center; justify-content:center; color:var(--accent);
  cursor:pointer; box-shadow:0 4px 10px rgba(0,0,0,.15);
  transition: transform .2s ease;
}
.swap-flip:hover{ transform:translate(-50%,-50%) rotate(180deg); }
.swap-flip svg{ width:18px; height:18px; }

button:focus-visible, a:focus-visible, input:focus-visible{ outline:none; box-shadow:var(--ring); }

/* ===================================================================
   Auth pages (login / register), flash messages, admin user list
   =================================================================== */

.auth-shell{ min-height:100vh; display:flex; align-items:center; justify-content:center; padding:40px 16px; }
.auth-card{ width:100%; max-width:400px; display:flex; flex-direction:column; gap:14px; }
.auth-brand{ padding:0; margin-bottom:2px; }
.auth-card h1{ margin:0; font-size:20px; font-weight:800; letter-spacing:-.01em; }
.auth-sub{ margin:0; color:var(--text-secondary); font-size:13px; }
.auth-form{ display:flex; flex-direction:column; gap:14px; }
.auth-switch{ text-align:center; font-size:12.5px; color:var(--text-muted); margin:2px 0 0; }
.auth-switch a{ color:var(--accent); font-weight:700; text-decoration:none; }
.auth-hint{ text-align:center; font-size:11px; color:var(--text-muted); margin:0; }

.flash{ padding:10px 14px; border-radius:12px; font-size:12.5px; font-weight:600; }
.flash-error{ background:color-mix(in srgb, var(--bad) 15%, var(--surface-2)); color:var(--bad); border:1px solid color-mix(in srgb, var(--bad) 35%, var(--border)); }
.flash-success{ background:color-mix(in srgb, var(--good) 15%, var(--surface-2)); color:var(--good); border:1px solid color-mix(in srgb, var(--good) 35%, var(--border)); }

.admin-table-head{
  display:grid; grid-template-columns: 2fr 1.2fr 1fr .9fr auto; gap:10px;
  padding:0 8px 8px; font-size:10.5px; letter-spacing:.06em; text-transform:uppercase; color:var(--text-muted); font-weight:700;
  border-bottom:1px solid var(--border);
}
.admin-row{
  display:grid; grid-template-columns: 2fr 1.2fr 1fr .9fr auto; gap:10px; align-items:center;
  padding:11px 8px; margin:0 -8px; border-radius:12px; border-bottom:1px solid var(--border);
}
.admin-row:hover{ background:var(--surface-2); }
.admin-row:last-child{ border-bottom:none; }
.admin-user{ display:flex; align-items:center; gap:10px; min-width:0; }
.admin-user b{ display:block; font-size:13px; font-weight:700; }
.admin-user span > span{ display:block; font-size:11px; color:var(--text-muted); }
.admin-addr{ font-size:12px; color:var(--text-secondary); }
.admin-balance{ font-size:13px; font-weight:700; }
.admin-joined{ font-size:12px; color:var(--text-muted); }
.admin-fund-btn{ padding:8px 14px; font-size:12px; display:inline-flex; }

.account-name-inline{ font-size:12.5px; color:var(--text-secondary); margin-right:4px; white-space:nowrap; }
@media (max-width:700px){ .account-name-inline{ display:none; } }

@media (max-width:760px){
  .admin-table-head{ display:none; }
  .admin-row{ grid-template-columns: 1fr auto; grid-template-areas: "user fund" "addr addr" "balance joined"; row-gap:4px; }
  .admin-user{ grid-area:user; }
  .admin-fund-btn{ grid-area:fund; }
  .admin-addr{ grid-area:addr; }
  .admin-balance{ grid-area:balance; }
  .admin-joined{ grid-area:joined; text-align:right; }
}
