:root {
  color-scheme: dark;
  --bg: #090b10;
  --panel: rgba(18, 21, 28, 0.88);
  --panel-strong: #11141b;
  --line: rgba(255, 255, 255, 0.085);
  --muted: #7d8493;
  --text: #f0f2f5;
  --green: #9df23f;
  --green-soft: rgba(157, 242, 63, 0.12);
  --orange: #ff7b45;
  --red: #ff5864;
  --cyan: #54d3c2;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    var(--bg);
  background-size: 48px 48px;
  color: var(--text);
}

[hidden], .hidden { display: none !important; }

body::before {
  position: fixed;
  inset: 0;
  content: "";
  pointer-events: none;
  background: radial-gradient(circle at 50% -10%, rgba(157,242,63,.075), transparent 35%);
}

button, input, select { font: inherit; }
button { border: 0; }

.ambient {
  position: fixed;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(140px);
  opacity: .06;
  pointer-events: none;
}
.ambient-one { top: -220px; right: -180px; background: var(--green); }
.ambient-two { bottom: -260px; left: -260px; background: #3da9ff; }

.shell { width: min(1440px, calc(100% - 48px)); margin: 0 auto; padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
.topbar { height: 82px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 13px; color: inherit; text-decoration: none; }
.brand-mark { position: relative; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(157,242,63,.55); transform: rotate(45deg); }
.brand-mark i { position: absolute; width: 17px; height: 2px; background: var(--green); }
.brand-mark i:first-child { transform: rotate(90deg); }
.brand b { display: block; font-size: 18px; letter-spacing: .24em; }
.brand small { color: var(--muted); font-size: 9px; letter-spacing: .2em; }
.network-pill { display: flex; align-items: center; gap: 9px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font: 600 11px/1 ui-monospace, monospace; letter-spacing: .06em; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #667; box-shadow: 0 0 0 4px rgba(120,120,140,.1); }
.status-dot.online { background: var(--green); box-shadow: 0 0 0 4px rgba(157,242,63,.1), 0 0 14px rgba(157,242,63,.65); }
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.mini-action, .logout-button { height: 33px; padding: 0 11px; border: 1px solid var(--line); border-radius: 3px; background: rgba(18,21,28,.82); color: #8d94a2; font: 700 9px/1 ui-monospace, monospace; letter-spacing: .06em; cursor: pointer; }
.mini-action { color: var(--green); border-color: rgba(157,242,63,.2); }
.logout-button:hover, .mini-action:hover { color: var(--text); border-color: rgba(255,255,255,.18); }

.login-screen { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 50% 20%, rgba(157,242,63,.07), transparent 33%), rgba(7,9,13,.96); backdrop-filter: blur(18px); }
.login-card { width: min(420px, 100%); padding: 34px; border: 1px solid var(--line); background: rgba(17,20,27,.96); box-shadow: 0 36px 120px rgba(0,0,0,.55); }
.login-logo { margin-bottom: 27px; }
.login-card h1 { margin: 0 0 10px; font-size: 30px; letter-spacing: -.04em; }
.login-card > p:not(.eyebrow):not(.form-error) { margin: 0 0 24px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.login-card .field { margin-bottom: 14px; }
.login-button { width: 100%; height: 48px; border-radius: 3px; font-weight: 750; cursor: pointer; }
.login-card > small { display: block; margin-top: 13px; color: #515866; font-size: 9px; text-align: center; }

.hero { padding: 52px 0 36px; display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; }
.eyebrow { margin: 0 0 13px; color: var(--green); font: 700 10px/1 ui-monospace, monospace; letter-spacing: .22em; }
.hero h1 { margin: 0; font-size: clamp(35px, 5vw, 62px); line-height: 1; letter-spacing: -.045em; font-weight: 680; }
.hero h1 span { color: var(--muted); }
.hero-copy { max-width: 650px; margin: 18px 0 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.hero-state { min-width: 150px; display: flex; align-items: center; gap: 15px; padding: 14px 16px; border: 1px solid var(--line); background: rgba(12,14,18,.7); }
.pulse-ring { width: 30px; height: 30px; border: 1px solid rgba(157,242,63,.32); border-radius: 50%; display: grid; place-items: center; }
.pulse-ring span { width: 8px; height: 8px; border-radius: 50%; background: #545965; }
.hero-state.running .pulse-ring span { background: var(--green); box-shadow: 0 0 16px var(--green); animation: pulse 1.5s infinite; }
.hero-state small, .chain-card small, .last-trade small { display: block; color: var(--muted); font: 700 9px/1.4 ui-monospace, monospace; letter-spacing: .14em; }
.hero-state strong { font-size: 14px; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); background: rgba(12,14,18,.56); margin-bottom: 16px; }
.metrics article { min-height: 104px; padding: 22px 24px; border-right: 1px solid var(--line); position: relative; }
.metrics article:last-child { border-right: 0; }
.metrics small { color: var(--muted); display: block; margin-bottom: 7px; font-size: 11px; }
.metrics strong { font: 520 28px/1 ui-monospace, monospace; }
.metrics strong i { font-style: normal; }
.metrics article > span { float: right; margin-top: 13px; color: #525866; font: 700 8px/1 ui-monospace, monospace; letter-spacing: .13em; }

.wallet-strip { display: grid; grid-template-columns: minmax(240px, 1.25fr) 1fr 1fr auto; align-items: center; gap: 0; min-height: 76px; margin-bottom: 16px; border: 1px solid var(--line); background: rgba(12,14,18,.7); }
.wallet-strip > div { min-width: 0; padding: 15px 20px; border-right: 1px solid var(--line); }
.wallet-strip > div:last-child { border-right: 0; }
.wallet-state { display: flex; align-items: center; gap: 12px; }
.wallet-dot { flex: 0 0 9px; width: 9px; height: 9px; border-radius: 50%; background: #555b68; }
.wallet-dot.ready { background: var(--green); box-shadow: 0 0 12px rgba(157,242,63,.5); }
.wallet-state small, .wallet-balance small { display: block; margin-bottom: 5px; color: #5f6674; font: 700 8px/1 ui-monospace, monospace; letter-spacing: .13em; }
.wallet-state strong { display: block; color: #b3b8c3; font: 10px/1.5 ui-monospace, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wallet-balance strong { color: #d7dae1; font: 13px/1.3 ui-monospace, monospace; }
.wallet-runtime { display: flex; align-items: center; gap: 9px; }
.wallet-runtime span { white-space: nowrap; padding: 6px 8px; color: var(--orange); background: rgba(255,123,69,.07); border: 1px solid rgba(255,123,69,.17); font: 700 8px/1 ui-monospace, monospace; letter-spacing: .08em; }
.wallet-runtime span.live { color: var(--green); background: var(--green-soft); border-color: rgba(157,242,63,.2); }
.wallet-runtime button { padding: 7px 8px; color: #858c99; background: transparent; border: 1px solid var(--line); font-size: 9px; cursor: pointer; }

/* 常驻钱包控制台（原弹窗内容平铺展开） */
.wallet-console { padding: 24px; margin-bottom: 16px; border: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(20px); box-shadow: 0 24px 80px rgba(0,0,0,.2); }
.wallet-console .panel-heading { align-items: center; margin-bottom: 20px; padding-bottom: 18px; }
.wallet-console .vault-status { margin: 0; max-width: 52%; }
.wallet-summary { display: grid; grid-template-columns: minmax(220px, 1.4fr) 1fr 1fr auto; align-items: center; border: 1px solid var(--line); background: rgba(12,14,18,.6); margin-bottom: 20px; }
.wallet-summary > div { min-width: 0; padding: 15px 20px; border-right: 1px solid var(--line); }
.wallet-summary > div:last-child { border-right: 0; }
.wallet-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; align-items: start; }
.wallet-side { display: grid; gap: 16px; }
.wallet-card { padding: 18px; border: 1px solid var(--line); background: #0c0f14; }
.wallet-card h3 { margin: 0 0 12px; font-size: 12px; }
.wallet-card .field { margin-bottom: 12px; }
.wallet-card .vault-actions { grid-template-columns: 1fr 1fr; }
.wallet-console > .form-error { margin-top: 14px; }

@media (max-width: 900px) {
  .wallet-console .vault-status { max-width: none; }
  .wallet-grid { grid-template-columns: 1fr; }
  .wallet-summary { grid-template-columns: 1fr 1fr; }
  .wallet-summary > div:nth-child(2) { border-right: 0; }
}
@media (max-width: 560px) {
  .wallet-summary { grid-template-columns: 1fr; }
  .wallet-summary > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .wallet-summary > div:last-child { border-bottom: 0; }
}

.workspace { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(390px, .65fr); gap: 16px; align-items: start; }
.panel { border: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(20px); box-shadow: 0 24px 80px rgba(0,0,0,.2); }
.control-panel, .activity-panel { padding: 28px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 22px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.panel-heading h2 { margin: 0; font-size: 21px; letter-spacing: -.025em; }
.mode-switch { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.mode-switch input { position: absolute; opacity: 0; }
.mode-switch > span { width: 38px; height: 20px; border-radius: 20px; background: #2a2e38; padding: 3px; transition: .2s; }
.mode-switch > span::before { content: ""; display: block; width: 14px; height: 14px; border-radius: 50%; background: #767d8c; transition: .2s; }
.mode-switch input:checked + span { background: var(--green-soft); box-shadow: inset 0 0 0 1px rgba(157,242,63,.28); }
.mode-switch input:checked + span::before { transform: translateX(18px); background: var(--green); }
.mode-switch b { font: 700 10px/1 ui-monospace, monospace; letter-spacing: .08em; color: var(--muted); }

.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.field, .field-group { display: block; min-width: 0; }
.wide { grid-column: 1 / -1; }
.field > span, .group-title { display: flex; align-items: center; justify-content: space-between; color: #aaaebb; font-size: 11px; font-weight: 650; margin-bottom: 8px; }
.field > span b { color: var(--green); font: 700 10px ui-monospace, monospace; }
.field input, .field select { width: 100%; height: 45px; border: 1px solid var(--line); border-radius: 3px; outline: none; background: #0c0f14; color: var(--text); padding: 0 13px; transition: border-color .2s, box-shadow .2s; }
.field input:focus, .field select:focus { border-color: rgba(157,242,63,.48); box-shadow: 0 0 0 3px rgba(157,242,63,.055); }
.field small { display: block; color: #606674; font-size: 10px; margin-top: 7px; line-height: 1.5; }
.field-group { border: 1px solid var(--line); padding: 14px; background: rgba(9,11,15,.4); }
.interval-help { display: block; margin-top: 9px; color: #5c6370; font-size: 9px; line-height: 1.6; }
.group-title em { color: var(--green); font: normal 700 9px ui-monospace, monospace; letter-spacing: .09em; }
.range-row { display: grid; grid-template-columns: 1fr 17px 1fr; align-items: end; gap: 8px; }
.range-row > i { color: #515764; font-style: normal; text-align: center; padding-bottom: 14px; }
.field.compact > span { color: #666d7b; font-size: 9px; text-transform: uppercase; }
.field.compact input { background: #0a0c11; }
.slider-field { padding: 5px 0 2px; }
.slider-field input { height: 5px; padding: 0; border: 0; appearance: none; background: linear-gradient(90deg, var(--orange), #525866 50%, var(--green)); border-radius: 8px; cursor: pointer; }
.slider-field input::-webkit-slider-thumb { appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--text); border: 4px solid #252a33; box-shadow: 0 0 0 1px #737a88; }
.slider-labels { display: flex; justify-content: space-between; color: #555b68; margin-top: 8px; }
.bias-header { display: flex; align-items: center; justify-content: space-between; }
.bias-lock { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: #7b828f; cursor: pointer; }
.bias-lock input { width: 14px; height: 14px; accent-color: var(--green); cursor: pointer; }
input[type="range"]:disabled { opacity: .45; cursor: not-allowed; }
.field-hint { display: block; color: #6b7280; margin-top: 8px; line-height: 1.5; }
.account-security { padding: 24px; margin-bottom: 16px; border: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(20px); }
.account-security .panel-heading { margin-bottom: 18px; padding-bottom: 16px; }
.pw-grid { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 14px; align-items: end; }
.pw-grid .primary { height: 45px; padding: 0 20px; }
.form-error.ok { color: var(--green); }
@media (max-width: 720px) { .pw-grid { grid-template-columns: 1fr; } }
.custom-token { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 4px; }
.custom-token .wide { grid-column: 1 / -1; }
/* 代币输入：粘贴 CA 自动识别 + 常用币快捷按钮 */
.token-picker { display: flex; gap: 8px; }
.token-picker input { flex: 1; }
.token-picker button { flex: 0 0 auto; padding: 0 16px; height: 45px; border: 1px solid rgba(157,242,63,.3); background: var(--green-soft, rgba(157,242,63,.08)); color: var(--green); cursor: pointer; white-space: nowrap; }
.token-resolved { margin: 10px 0 0; font: 11px/1.5 ui-monospace, monospace; min-height: 1em; }
.token-resolved.ok { color: var(--green); }
.token-resolved.err { color: #ff9b88; }
.input-suffix { position: relative; }
.input-suffix b { position: absolute; right: 13px; top: 13px; color: var(--muted); font-size: 12px; }
.input-suffix input { padding-right: 34px; }

.policy-note { display: flex; gap: 11px; margin-top: 22px; padding: 13px 14px; border-left: 2px solid var(--orange); background: rgba(255,123,69,.055); color: #858b99; }
.policy-note > span { flex: 0 0 20px; width: 20px; height: 20px; display: grid; place-items: center; border: 1px solid rgba(255,123,69,.35); border-radius: 50%; color: var(--orange); font: 700 10px monospace; }
.policy-note p { margin: 0; font-size: 10px; line-height: 1.7; }
.policy-note b { color: #bcc0ca; }
.quick-trade { margin-top: 20px; padding: 14px; border: 1px solid var(--line); background: rgba(9,11,15,.5); }
.quick-trade-grid { display: grid; grid-template-columns: 1fr 84px 1fr 84px; align-items: end; gap: 10px; }
.quick-trade button { height: 45px; border-radius: 3px; font-weight: 750; cursor: pointer; }
.trade-buy { color: #11170a; background: var(--green); }
.trade-sell, .danger { color: #fff; background: #b63d48; }
.task-controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 20px; }
.task-controls article { padding: 14px; border: 1px solid var(--line); background: #0d1015; }
.task-controls article > div:first-child { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; margin-bottom: 13px; }
.task-controls small { grid-column: 1 / -1; color: #5f6674; font: 700 8px/1 ui-monospace, monospace; letter-spacing: .11em; }
.task-controls strong { font-size: 12px; }
.task-controls span { color: #777e8c; font: 700 9px/1.5 ui-monospace, monospace; }
.task-controls span.running { color: var(--green); }
.task-controls span.stopping { color: var(--orange); }
.task-controls article > div:last-child { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.task-controls button { height: 36px; cursor: pointer; font-size: 10px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.actions button { height: 48px; border-radius: 3px; cursor: pointer; font-weight: 750; font-size: 12px; letter-spacing: .04em; transition: .2s; }
.actions button:disabled { cursor: not-allowed; opacity: .35; }
.primary { color: #10140c; background: var(--green); box-shadow: 0 8px 30px rgba(157,242,63,.12); }
.primary:hover:not(:disabled) { background: #b2ff59; transform: translateY(-1px); }
.primary span { margin-right: 6px; }
.secondary { color: #b0b5c0; background: #1b1f27; border: 1px solid var(--line); }
.danger { box-shadow: 0 8px 30px rgba(255,88,100,.1); }
.form-error { min-height: 18px; margin: 10px 0 -8px; color: var(--red); font-size: 11px; line-height: 1.6; }

.activity-panel { position: sticky; top: 16px; }
.api-badge { padding: 7px 9px; border: 1px solid rgba(157,242,63,.2); color: var(--green); background: var(--green-soft); font: 700 9px/1 ui-monospace, monospace; letter-spacing: .08em; }
.chain-card { display: grid; grid-template-columns: 43px 1fr 28px; gap: 13px; align-items: center; padding: 14px; border: 1px solid var(--line); background: #0d1015; }
.chain-icon { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, #ddffb5, var(--green)); color: #14180f; font: 800 17px ui-monospace, monospace; box-shadow: inset 0 0 0 4px rgba(0,0,0,.1); }
.chain-card strong { display: block; margin: 3px 0; font-size: 13px; }
.chain-card span { color: #626977; font: 700 9px ui-monospace, monospace; }
.chain-card a { color: var(--muted); text-decoration: none; font-size: 18px; text-align: center; }
.last-trade { margin-top: 12px; padding: 15px; border: 1px solid var(--line); background: rgba(9,11,15,.46); }
.last-trade p { margin: 7px 0 0; color: #afb4bf; font: 11px/1.6 ui-monospace, monospace; overflow-wrap: anywhere; }
.log-heading { display: flex; align-items: center; justify-content: space-between; margin: 24px 0 10px; color: #b7bbc5; font-size: 11px; font-weight: 700; }
.log-heading small { color: #565d6a; font-weight: 500; }
.logs { min-height: 320px; max-height: 540px; overflow-y: auto; border-top: 1px solid var(--line); scrollbar-width: thin; scrollbar-color: #2b3039 transparent; }
.empty-state { height: 290px; display: grid; place-content: center; text-align: center; color: #4d5360; }
.empty-state span { font-size: 28px; }
.empty-state p { max-width: 240px; font-size: 11px; line-height: 1.7; }
.log-item { display: grid; grid-template-columns: 8px 64px 1fr; gap: 9px; padding: 13px 3px; border-bottom: 1px solid rgba(255,255,255,.055); }
.log-item > i { width: 6px; height: 6px; border-radius: 50%; margin-top: 5px; background: #667; }
.log-item.success > i { background: var(--green); box-shadow: 0 0 8px rgba(157,242,63,.5); }
.log-item.error > i { background: var(--red); }
.log-item.warning > i { background: var(--orange); }
.log-item time { color: #565d69; font: 9px/1.6 ui-monospace, monospace; }
.log-item p { margin: 0; color: #9ca2ae; font-size: 10px; line-height: 1.65; overflow-wrap: anywhere; }

footer { display: flex; justify-content: space-between; padding: 22px 2px 0; color: #404651; font: 700 8px/1 ui-monospace, monospace; letter-spacing: .12em; }
footer #realtimeStatus.online { color: var(--green); }

.wallet-dialog { width: min(560px, calc(100% - 24px)); max-height: min(820px, calc(100vh - 24px)); padding: 0; border: 1px solid var(--line); border-radius: 4px; color: var(--text); background: #11141b; box-shadow: 0 40px 140px rgba(0,0,0,.7); overflow-y: auto; }
.wallet-dialog::backdrop { background: rgba(3,5,8,.82); backdrop-filter: blur(8px); }
.dialog-heading { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; padding: 22px; border-bottom: 1px solid var(--line); background: rgba(17,20,27,.97); }
.dialog-heading h2 { margin: 0; font-size: 20px; }
.dialog-heading button { width: 34px; height: 34px; color: #9298a5; background: #1b1f27; border: 1px solid var(--line); font-size: 20px; cursor: pointer; }
.vault-status { margin: 18px 22px 0; padding: 12px; color: #abb1bd; background: #0c0f14; border: 1px solid var(--line); font: 10px/1.7 ui-monospace, monospace; overflow-wrap: anywhere; }
.vault-section { padding: 20px 22px; border-bottom: 1px solid var(--line); }
.vault-section h3 { margin: 0 0 14px; font-size: 12px; }
.vault-section .field { margin-bottom: 12px; }
.wallet-list { display: grid; gap: 8px; }
.wallet-list-empty { padding: 16px; color: #69717f; border: 1px dashed var(--line); font-size: 10px; text-align: center; }
.wallet-list-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 11px 12px; border: 1px solid var(--line); background: #0c0f14; }
.wallet-flag { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 3px; font: 700 9px/1.5 ui-monospace, monospace; vertical-align: middle; }
.wallet-flag.empty { color: #ff9b88; background: rgba(255,123,69,.1); border: 1px solid rgba(255,123,69,.3); }
.wallet-flag.low { color: #e0c060; background: rgba(224,192,96,.08); border: 1px solid rgba(224,192,96,.25); }
.wallet-pool-check { display: flex; align-items: center; cursor: pointer; }
.wallet-pool-check input { width: 16px; height: 16px; accent-color: var(--green); cursor: pointer; }
.vault-hint { margin: 0 0 10px; color: #7b828f; font-size: 10px; line-height: 1.5; }
.vault-hint strong { color: #aeb4bf; }
.wallet-list-item.active { border-color: rgba(157,242,63,.42); background: rgba(157,242,63,.035); }
.wallet-list-item strong, .wallet-list-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wallet-list-item strong { margin-bottom: 4px; color: #d6dae2; font-size: 11px; }
.wallet-list-item small { color: #626a78; font: 9px/1.4 ui-monospace, monospace; }
.wallet-list-item button { min-width: 62px; height: 32px; color: #9299a6; border: 1px solid var(--line); background: #171b22; cursor: pointer; }
.wallet-list-item.active button { color: var(--green); border-color: rgba(157,242,63,.25); }
.field textarea { width: 100%; resize: vertical; border: 1px solid var(--line); border-radius: 3px; outline: none; background: #0c0f14; color: var(--text); padding: 12px 13px; font: 10px/1.5 ui-monospace, monospace; }
.field textarea:focus { border-color: rgba(157,242,63,.48); box-shadow: 0 0 0 3px rgba(157,242,63,.055); }
.dialog-button { width: 100%; height: 44px; cursor: pointer; }
.vault-actions { display: grid; grid-template-columns: 1fr 70px 92px 82px; gap: 8px; }
.vault-actions button { height: 42px; cursor: pointer; }
.vault-actions .danger { color: #ff9b88; border: 1px solid rgba(255,123,69,.28); background: rgba(255,123,69,.06); }
.wallet-dialog > .form-error { padding: 0 22px 18px; }

@keyframes pulse { 0%,100% { transform: scale(.8); opacity: .6; } 50% { transform: scale(1.25); opacity: 1; } }

@media (max-width: 960px) {
  .workspace { grid-template-columns: 1fr; }
  .activity-panel { position: static; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metrics article:nth-child(2) { border-right: 0; }
  .metrics article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .wallet-strip { grid-template-columns: 1fr 1fr; }
  .wallet-strip > div:nth-child(2) { border-right: 0; }
  .wallet-strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 640px) {
  .shell { width: min(100% - 24px, 1440px); }
  .topbar { height: 68px; }
  .brand small { display: none; }
  .brand b { font-size: 15px; }
  .network-pill { max-width: 160px; }
  .network-pill span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mini-action { display: none; }
  .logout-button { width: 34px; padding: 0; color: transparent; position: relative; }
  .logout-button::after { content: "↪"; position: absolute; inset: 0; display: grid; place-items: center; color: #8d94a2; font-size: 15px; }
  .hero { padding-top: 36px; align-items: flex-start; flex-direction: column; }
  .hero-state { width: 100%; }
  .metrics article { min-height: 90px; padding: 18px; }
  .metrics strong { font-size: 22px; }
  .control-panel, .activity-panel { padding: 20px; }
  .wallet-strip { grid-template-columns: 1fr; }
  .wallet-strip > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .wallet-strip > div:last-child { border-bottom: 0; }
  .field-grid { grid-template-columns: 1fr; }
  .field-grid > * { grid-column: 1; }
  .actions { position: sticky; bottom: max(8px, env(safe-area-inset-bottom)); z-index: 5; grid-template-columns: 78px 1fr 78px; padding: 8px; margin: 20px -8px -8px; background: rgba(10,12,17,.94); border: 1px solid var(--line); backdrop-filter: blur(18px); }
  .actions button { font-size: 10px; }
  .save-button { padding: 0 6px; }
  footer { gap: 14px; flex-direction: column; }
  .login-card { padding: 28px 22px; }
  .quick-trade-grid { grid-template-columns: 1fr 72px; }
  .task-controls { grid-template-columns: 1fr; }
  .task-controls article { display: grid; grid-template-columns: 1fr 150px; align-items: center; }
  .task-controls article > div:first-child { margin-bottom: 0; }
  .actions { grid-template-columns: 1fr 1fr; }
  .vault-actions { grid-template-columns: 1fr; }
}
