:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-soft: #f8faff;
  --text: #172033;
  --muted: #6f7c91;
  --line: #e5eaf2;
  --blue: #2f6bdc;
  --blue-dark: #174ea7;
  --blue-soft: #eaf2ff;
  --green: #159b69;
  --green-soft: #e7f8f1;
  --red: #d94c55;
  --red-soft: #fff0f1;
  --amber: #d48a11;
  --amber-soft: #fff6df;
  --violet: #7657d6;
  --violet-soft: #f1edff;
  --navy: #0d1b34;
  --shadow: 0 18px 50px rgba(28, 48, 83, 0.09);
  --shadow-small: 0 8px 24px rgba(28, 48, 83, 0.08);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --sidebar: 254px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--blue); text-decoration: none; }
button { color: inherit; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); }
.brand-mark { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--blue-soft); flex: 0 0 auto; }
.brand-mark img { width: 34px; height: 34px; object-fit: contain; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 19px; letter-spacing: -0.03em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.brand-light { color: white; }
.brand-light .brand-mark { background: rgba(255,255,255,.12); }
.brand-light small { color: rgba(255,255,255,.58); }

.eyebrow { margin: 0 0 7px; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.primary-button, .secondary-button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; gap: 10px; padding: 0 20px; border-radius: 12px; border: 1px solid transparent; font-weight: 750; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.primary-button { color: white; background: linear-gradient(135deg, var(--blue), #4f81e2); box-shadow: 0 12px 22px rgba(47, 107, 220, .23); }
.primary-button:hover:not(:disabled), .secondary-button:hover:not(:disabled) { transform: translateY(-1px); }
.primary-button:disabled, .secondary-button:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.primary-button svg { width: 18px; height: 18px; }
.primary-button.is-loading svg { animation: nudge 1s ease-in-out infinite; }
.secondary-button { color: var(--blue); background: var(--blue-soft); border-color: #d6e4fb; }
.text-button, .danger-text-button { border: 0; background: transparent; cursor: pointer; font-weight: 750; padding: 6px 0; }
.text-button { color: var(--blue); }
.danger-text-button { color: var(--red); }
.danger-text-button:disabled { opacity: .45; cursor: not-allowed; }
.icon-button { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: var(--surface); cursor: pointer; }

.field { display: grid; gap: 8px; color: var(--text); font-size: 13px; font-weight: 700; }
.field > span:first-child { padding-left: 2px; }
.field input, .field select, .field textarea { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid #dce3ed; border-radius: 12px; outline: none; color: var(--text); background: #fff; transition: border .18s ease, box-shadow .18s ease; }
.field textarea { padding-top: 13px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(47, 107, 220, .1); }
.field input:disabled { color: #8290a6; background: #f2f5f9; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > svg { position: absolute; left: 15px; z-index: 1; width: 20px; height: 20px; color: #8c98aa; }
.input-wrap input { padding-left: 47px; padding-right: 48px; }
.input-wrap .icon-button { position: absolute; right: 5px; width: 38px; height: 38px; border: 0; background: transparent; }

/* Login */
.login-page { overflow-x: hidden; background: #fff; }
.login-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(430px, .9fr) minmax(520px, 1.1fr); }
.login-story { position: relative; display: flex; overflow: hidden; flex-direction: column; justify-content: space-between; min-height: 100vh; padding: clamp(32px, 5vw, 68px); color: white; background: radial-gradient(circle at 72% 25%, rgba(73, 132, 230, .45), transparent 32%), linear-gradient(145deg, #0b1a34 0%, #143d78 60%, #1b61bc 100%); }
.login-story::before { content: ""; position: absolute; inset: 0; opacity: .18; background-image: linear-gradient(rgba(255,255,255,.18) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.18) 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(to bottom right, black, transparent 68%); }
.login-story > * { position: relative; z-index: 2; }
.story-copy { max-width: 610px; margin: auto 0; padding: 80px 0; }
.story-copy .eyebrow { color: #87b8ff; }
.story-copy h1 { margin: 0; max-width: 660px; font-size: clamp(48px, 5vw, 80px); line-height: .98; letter-spacing: -.06em; }
.story-copy > p:last-child { max-width: 520px; margin: 28px 0 0; color: rgba(255,255,255,.7); font-size: 17px; line-height: 1.7; }
.story-status { display: flex; flex-wrap: wrap; gap: 22px; color: rgba(255,255,255,.64); font-size: 12px; font-weight: 650; }
.story-status span { display: flex; align-items: center; gap: 8px; }
.story-status i { width: 8px; height: 8px; border-radius: 50%; background: #4de0ac; box-shadow: 0 0 0 5px rgba(77,224,172,.12); }
.grid-orbit { position: absolute; right: -150px; bottom: 2%; z-index: 0; width: 480px; height: 480px; border: 1px solid rgba(255,255,255,.11); border-radius: 50%; }
.grid-orbit span { position: absolute; left: 50%; top: 50%; border: 1px solid rgba(255,255,255,.11); border-radius: 50%; transform: translate(-50%, -50%); }
.grid-orbit span:nth-child(1) { width: 82%; height: 82%; }.grid-orbit span:nth-child(2) { width: 64%; height: 64%; }.grid-orbit span:nth-child(3) { width: 46%; height: 46%; }.grid-orbit span:nth-child(4) { width: 28%; height: 28%; }.grid-orbit span:nth-child(5) { width: 10%; height: 10%; background: rgba(255,255,255,.08); }
.login-panel { display: grid; place-items: center; padding: 42px; background: #f8fafc; }
.login-card { width: min(100%, 470px); padding: 48px; border: 1px solid var(--line); border-radius: 28px; background: #fff; box-shadow: var(--shadow); }
.mobile-brand { display: none; align-items: center; gap: 12px; margin-bottom: 34px; }
.mobile-brand strong, .mobile-brand small { display: block; }.mobile-brand strong { font-size: 20px; }.mobile-brand small { color: var(--muted); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.login-heading h2 { margin: 0; font-size: 31px; letter-spacing: -.045em; }
.login-heading > p:last-child { margin: 12px 0 0; color: var(--muted); line-height: 1.6; }
.login-card form { display: grid; gap: 20px; margin-top: 34px; }
.form-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; color: var(--muted); font-size: 13px; }
.forgot-row { justify-content: flex-end; }
.remember { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.remember input { width: 16px; height: 16px; accent-color: var(--blue); }
.login-card .primary-button { width: 100%; margin-top: 2px; }
.account-link { margin: 28px 0 0; text-align: center; color: var(--muted); font-size: 14px; }
.login-footnote { margin: 24px 0 0; padding-top: 22px; border-top: 1px solid var(--line); text-align: center; color: #94a0b2; font-size: 11px; }
.alert { margin: 22px 0 -12px; padding: 13px 15px; border: 1px solid #ffcfd3; border-radius: 11px; color: #a7333c; background: var(--red-soft); font-size: 13px; line-height: 1.5; }

/* App shell */
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; display: flex; width: var(--sidebar); flex-direction: column; padding: 27px 20px 22px; border-right: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(18px); }
.sidebar .brand { padding: 0 8px 24px; }
.main-nav { display: grid; flex: 1 1 auto; min-height: 0; align-content: start; gap: 7px; margin-top: 18px; padding-right: 2px; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 13px; width: 100%; min-height: 48px; padding: 0 14px; border: 0; border-radius: 13px; color: #748197; background: transparent; font-size: 14px; font-weight: 700; cursor: pointer; text-align: left; transition: color .16s ease, background .16s ease, transform .16s ease; }
.nav-item:hover { color: var(--blue); background: var(--blue-soft); transform: translateX(2px); }
.nav-item.is-active { color: white; background: linear-gradient(135deg, var(--blue), #5a87de); box-shadow: 0 10px 22px rgba(47,107,220,.2); }
.nav-item svg { width: 20px; height: 20px; }
.sidebar-bottom { display: grid; gap: 10px; margin-top: auto; padding-top: 24px; border-top: 1px solid var(--line); }
.profile-mini { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 8px; border: 0; border-radius: 14px; background: var(--surface-soft); cursor: pointer; text-align: left; }
.profile-mini strong, .profile-mini small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.profile-mini strong { font-size: 13px; }.profile-mini small { margin-top: 3px; color: var(--muted); font-size: 10px; }.profile-mini > svg { width: 17px; height: 17px; color: #9ba6b6; }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: white; background: linear-gradient(135deg, #2f6bdc, #6c90db); font-size: 14px; font-weight: 800; }
.logout-link { display: flex; align-items: center; gap: 11px; padding: 10px 14px; border-radius: 12px; color: #8b97a9; font-size: 13px; font-weight: 700; }.logout-link:hover { color: var(--red); background: var(--red-soft); }.logout-link svg { width: 19px; height: 19px; }
.workspace { min-height: 100vh; margin-left: var(--sidebar); padding: 0 clamp(24px, 3.2vw, 54px) 70px; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; height: 92px; align-items: center; gap: 22px; background: rgba(243,246,251,.88); backdrop-filter: blur(18px); }
.page-title { margin-right: auto; }.page-title p { margin: 0 0 3px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }.page-title h1 { margin: 0; font-size: 24px; letter-spacing: -.04em; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.connection-pill { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 13px; border: 1px solid #ecdcae; border-radius: 999px; color: #9a6c0a; background: var(--amber-soft); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.connection-pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(212,138,17,.12); }.connection-pill.is-live { color: var(--green); border-color: #cbeade; background: var(--green-soft); }.connection-pill.is-error { color: var(--red); border-color: #ffd0d4; background: var(--red-soft); }
.avatar-button { border: 0; cursor: pointer; }
.mobile-menu { display: none; }
.view { display: none; animation: viewIn .2s ease both; }.view.is-active { display: block; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin: 14px 0 25px; }.section-head h2 { margin: 0; font-size: clamp(28px, 3vw, 38px); letter-spacing: -.055em; }.section-head > div > p:last-child { max-width: 670px; margin: 9px 0 0; color: var(--muted); line-height: 1.6; }
.welcome-card { position: relative; display: flex; overflow: hidden; align-items: center; justify-content: space-between; gap: 24px; min-height: 210px; padding: clamp(28px, 4vw, 46px); border-radius: var(--radius-xl); color: white; background: radial-gradient(circle at 70% 20%, rgba(115,165,242,.6), transparent 28%), linear-gradient(125deg, #0e2040, #194a91 65%, #2874d9); box-shadow: 0 22px 48px rgba(16, 47, 97, .18); }
.welcome-card::after { content: ""; position: absolute; right: -60px; bottom: -125px; width: 330px; height: 330px; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; box-shadow: 0 0 0 38px rgba(255,255,255,.04), 0 0 0 76px rgba(255,255,255,.03); }
.welcome-card > * { position: relative; z-index: 2; }.welcome-card .eyebrow { color: #88baff; }.welcome-card h2 { margin: 0; font-size: clamp(30px, 4vw, 46px); letter-spacing: -.055em; }.welcome-card > div:first-child > p:last-child { max-width: 650px; margin: 15px 0 0; color: rgba(255,255,255,.67); line-height: 1.6; }
.welcome-badge { display: grid; min-width: 154px; justify-items: end; padding-right: 12px; }.welcome-badge span { color: #b7d3ff; font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }.welcome-badge strong { margin: 6px 0 1px; font-size: 30px; }.welcome-badge small { color: rgba(255,255,255,.55); }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin: 18px 0; }
.metric-card { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-small); }.metric-card p { margin: 15px 0 6px; color: var(--muted); font-size: 12px; font-weight: 700; }.metric-card strong { display: block; overflow: hidden; font-size: 26px; letter-spacing: -.045em; text-overflow: ellipsis; white-space: nowrap; }.metric-card small { display: block; margin-top: 6px; color: #95a0b1; font-size: 10px; }
.metric-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; font-size: 15px; font-weight: 850; }.metric-icon.blue { color: var(--blue); background: var(--blue-soft); }.metric-icon.green { color: var(--green); background: var(--green-soft); }.metric-icon.violet { color: var(--violet); background: var(--violet-soft); }.metric-icon.amber { color: var(--amber); background: var(--amber-soft); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(280px,.7fr); gap: 18px; }.recent-activity { grid-column: 1 / -1; }
.panel { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-small); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px 17px; }.panel-head h3 { margin: 0; font-size: 18px; letter-spacing: -.03em; }.panel-head .eyebrow { margin-bottom: 5px; }
.table-wrap { overflow: auto; width: 100%; }.table-wrap.compact { max-height: 380px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; } th { padding: 12px 18px; color: #8793a5; background: #fafbfd; font-size: 10px; font-weight: 800; letter-spacing: .11em; text-align: left; text-transform: uppercase; white-space: nowrap; } td { padding: 15px 18px; border-top: 1px solid #edf0f5; vertical-align: middle; white-space: nowrap; } tbody tr:hover { background: #fbfcff; }
.coin-cell { display: flex; align-items: center; gap: 11px; }.coin-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; color: var(--blue); background: var(--blue-soft); font-size: 11px; font-weight: 850; }.coin-cell strong, .coin-cell small { display: block; }.coin-cell small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.positive { color: var(--green) !important; }.negative { color: var(--red) !important; }.muted { color: var(--muted); }
.status-dot { display: inline-flex; align-items: center; gap: 7px; color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }.status-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }.status-dot.is-off { color: var(--muted); }.status-dot.neutral { color: var(--amber); }
.bot-overview { padding-bottom: 22px; }.bot-overview > p { margin: 0 24px 18px; color: var(--muted); font-size: 13px; line-height: 1.6; }.bot-overview .secondary-button { margin: 0 24px; }
.bot-illustration { position: relative; height: 110px; margin: 2px 24px 16px; overflow: hidden; border-radius: 17px; background: linear-gradient(135deg, #eef4ff, #f7f9fd); }.bot-illustration span { position: absolute; left: 20px; right: 20px; bottom: 25px; height: 2px; background: #d6e2f5; }.bot-illustration i, .bot-illustration b { position: absolute; bottom: 26px; width: 24px; border-radius: 6px 6px 0 0; background: #87abe4; transform-origin: bottom; }.bot-illustration i { left: 28%; height: 32px; box-shadow: 40px -15px 0 #5b89d4, 80px -3px 0 #2f6bdc; }.bot-illustration b { right: 16%; height: 68px; background: var(--green); }
.activity-list { display: grid; padding: 0 24px 20px; }.activity-row { display: grid; grid-template-columns: minmax(150px,1.2fr) repeat(3,minmax(90px,.7fr)); align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid #edf0f5; font-size: 12px; }.activity-row:first-child { border-top: 0; }.activity-row strong, .activity-row small { display: block; }.activity-row small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.skeleton-line { display: block; width: 100%; height: 18px; border-radius: 8px; background: linear-gradient(90deg, #eef1f5, #fafbfc, #eef1f5); background-size: 220% 100%; animation: shimmer 1.4s linear infinite; }
.empty-state { display: grid; min-height: 180px; place-items: center; align-content: center; gap: 12px; color: var(--muted); text-align: center; }.empty-state.small { min-height: 110px; }.empty-state p { margin: 0; }.loader { width: 27px; height: 27px; border: 3px solid #dce6f6; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 20px 22px; border-bottom: 1px solid var(--line); }.search-box { position: relative; width: min(100%, 360px); }.search-box svg { position: absolute; left: 13px; top: 50%; width: 18px; height: 18px; color: #94a0b1; transform: translateY(-50%); }.search-box input { width: 100%; min-height: 42px; padding: 0 15px 0 42px; border: 1px solid var(--line); border-radius: 12px; outline: none; }.search-box input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(47,107,220,.08); }
.segmented { display: inline-flex; padding: 4px; border-radius: 11px; background: #f0f3f8; }.segmented button { min-height: 34px; padding: 0 13px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 800; cursor: pointer; }.segmented button.is-active { color: var(--blue); background: white; box-shadow: 0 3px 10px rgba(28,48,83,.08); }
.freshness { color: var(--muted); font-size: 11px; font-weight: 700; }
.bot-master { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font-size: 12px; font-weight: 800; }
.switch-button { position: relative; width: 46px; height: 26px; padding: 0; border: 0; border-radius: 999px; background: #cbd3df; cursor: pointer; transition: background .2s ease; }.switch-button span { position: absolute; left: 4px; top: 4px; width: 18px; height: 18px; border-radius: 50%; background: white; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .2s ease; }.switch-button[aria-checked="true"] { background: var(--green); }.switch-button[aria-checked="true"] span { transform: translateX(20px); }.switch-button:disabled { opacity: .55; cursor: not-allowed; }
.bot-config-grid { display: grid; grid-template-columns: minmax(300px,.8fr) minmax(450px,1.2fr); gap: 18px; }.config-panel { padding-bottom: 23px; }.selector-grid { display: grid; gap: 16px; padding: 0 24px; }.compact-field { gap: 7px; }.compact-field input, .compact-field select { min-height: 44px; }
.settings-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 0 24px; }.span-two { grid-column: 1 / -1; }
.mode-help { margin: 18px 24px 0; padding: 14px 16px; border: 1px solid #cfe0fb; border-radius: 12px; background: #f3f7ff; }.mode-help strong { display: block; color: var(--blue); font-size: 12px; }.mode-help p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }.compact-field small { color: var(--muted); font-size: 10px; line-height: 1.45; }.is-context-muted { opacity: .68; }
.launch-panel { margin-top: 18px; }.launch-panel .panel-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }.launch-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)) auto; gap: 12px; align-items: stretch; padding: 0 24px 18px; }.launch-grid > div { min-width: 0; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }.launch-grid small, .launch-grid strong { display: block; }.launch-grid small { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }.launch-grid strong { margin-top: 6px; overflow: hidden; color: var(--ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }.launch-button { min-width: 150px; }.launch-note { margin: 0 24px 22px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.table-action { min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--blue); cursor: pointer; font: inherit; font-size: 10px; font-weight: 800; }.table-action:disabled { cursor: wait; opacity: .55; }.grid-state { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 800; }.grid-state::before { width: 7px; height: 7px; border-radius: 50%; background: var(--green); content: ''; }.grid-state.paused { color: var(--amber); }.grid-state.paused::before { background: var(--amber); }.grid-state.running { color: var(--green); }
.trade-manager { width: min(920px, calc(100vw - 32px)); max-height: min(880px, calc(100vh - 32px)); padding: 0; border: 0; border-radius: 22px; color: var(--ink); background: var(--surface); box-shadow: 0 28px 80px rgba(15,32,61,.28); }.trade-manager::backdrop { background: rgba(15,27,48,.58); backdrop-filter: blur(4px); }.trade-manager-shell { max-height: inherit; overflow: auto; }.trade-manager-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 24px 26px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(14px); }.trade-manager-head h2 { margin: 5px 0 0; font-size: 25px; letter-spacing: -.04em; }.trade-manager-head > div > p:last-child { margin: 6px 0 0; color: var(--muted); font-size: 11px; }.trade-manager-head .icon-button { flex: 0 0 auto; color: var(--muted); font-size: 25px; line-height: 1; }.trade-manager-loading { display: grid; min-height: 300px; place-items: center; align-content: center; gap: 12px; color: var(--muted); }.trade-manager-content { padding: 22px 26px 28px; }.trade-detail-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 11px; }.trade-detail-grid > div { min-width: 0; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }.trade-detail-grid small, .trade-detail-grid strong { display: block; }.trade-detail-grid small { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }.trade-detail-grid strong { margin-top: 6px; overflow-wrap: anywhere; font-size: 13px; }.trade-scope-note { margin: 14px 0 0; padding: 12px 14px; border: 1px solid #cfe0fb; border-radius: 11px; color: #315a99; background: var(--blue-soft); font-size: 11px; line-height: 1.55; }.trade-control-section { margin-top: 18px; padding: 19px; border: 1px solid var(--line); border-radius: 15px; }.trade-control-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }.trade-control-heading h3, .trade-danger-zone h3 { margin: 4px 0 0; font-size: 17px; }.trade-control-heading > p { max-width: 310px; margin: 1px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; text-align: right; }.trade-control-buttons { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 16px; }.trade-control-buttons button { width: 100%; }.trade-settings-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; margin-top: 17px; }.trade-danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 18px; padding: 19px; border: 1px solid #f1c9cf; border-radius: 15px; background: #fff9fa; }.trade-danger-zone > div:first-child { max-width: 610px; }.trade-danger-zone p:last-child { margin: 8px 0 0; color: #7b5360; font-size: 11px; line-height: 1.55; }.trade-danger-actions { display: grid; flex: 0 0 150px; gap: 9px; }.danger-button, .danger-outline-button { min-height: 42px; padding: 0 15px; border: 1px solid var(--red); border-radius: 11px; cursor: pointer; font: inherit; font-size: 11px; font-weight: 850; }.danger-button { color: #fff; background: var(--red); }.danger-outline-button { color: var(--red); background: #fff; }.danger-button:disabled, .danger-outline-button:disabled { cursor: wait; opacity: .55; }
.table-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px 20px; border-top: 1px solid var(--line); }.table-pagination button { min-width: 88px; min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--blue); background: #fff; cursor: pointer; font: inherit; font-size: 11px; font-weight: 800; }.table-pagination button:hover:not(:disabled) { border-color: #abc5ef; background: var(--blue-soft); }.table-pagination button:disabled { color: #aeb7c5; background: #f7f8fa; cursor: not-allowed; }.table-pagination span { min-width: 150px; color: var(--muted); font-size: 11px; font-weight: 800; text-align: center; }
.advanced-panel { margin-top: 18px; }.advanced-panel details > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px; cursor: pointer; list-style: none; }.advanced-panel summary::-webkit-details-marker { display: none; }.advanced-panel summary strong, .advanced-panel summary small { display: block; }.advanced-panel summary small { margin-top: 5px; color: var(--muted); font-weight: 500; }.advanced-panel summary svg { transition: transform .2s ease; }.advanced-panel details[open] summary svg { transform: rotate(180deg); }.advanced-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 24px; border-top: 1px solid var(--line); }.advanced-actions p { margin: 0; color: var(--muted); font-size: 12px; }
.advanced-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; max-height: 520px; overflow: auto; padding: 0 24px 20px; }.advanced-row { display: grid; grid-template-columns: 34px 1fr 1fr; grid-column: span 2; align-items: end; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }.advanced-row > span { align-self: center; color: var(--muted); font-size: 11px; font-weight: 800; }.advanced-row label { display: grid; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }.advanced-row input { width: 100%; min-height: 36px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; }.advanced-panel form > .primary-button { margin: 0 24px 24px; }
.wallet-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; margin-bottom: 18px; }.balance-card { position: relative; overflow: hidden; min-height: 150px; padding: 25px; border-radius: var(--radius-lg); color: white; box-shadow: var(--shadow-small); }.balance-card::after { content: ""; position: absolute; right: -45px; bottom: -70px; width: 170px; height: 170px; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; box-shadow: 0 0 0 26px rgba(255,255,255,.06); }.balance-card.binance { background: linear-gradient(135deg, #a36b00, #e4a51d); }.balance-card.huobi { background: linear-gradient(135deg, #1d529b, #3b83d8); }.balance-card.profit { background: linear-gradient(135deg, #167653, #20aa79); }.balance-card p { margin: 0 0 17px; color: rgba(255,255,255,.7); font-size: 12px; font-weight: 750; }.balance-card strong { position: relative; z-index: 1; display: block; font-size: 30px; letter-spacing: -.04em; }.balance-card small { color: rgba(255,255,255,.65); }
.support-grid { display: grid; grid-template-columns: minmax(330px,.8fr) minmax(420px,1.2fr); gap: 18px; }.ticket-form { display: grid; gap: 17px; padding: 0 24px 24px; }.ticket-list { display: grid; gap: 11px; padding: 0 24px 24px; }.ticket-item { padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }.ticket-item header { display: flex; justify-content: space-between; gap: 12px; }.ticket-item h4 { margin: 0; font-size: 14px; }.ticket-item span { color: var(--blue); font-size: 10px; font-weight: 800; text-transform: uppercase; }.ticket-item p { margin: 9px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.profile-grid { display: grid; grid-template-columns: minmax(240px,.65fr) minmax(390px,1.2fr) minmax(270px,.75fr); gap: 18px; }.profile-card { display: grid; place-items: center; align-content: center; min-height: 320px; padding: 28px; text-align: center; }.profile-avatar { display: grid; place-items: center; width: 86px; height: 86px; border-radius: 28px; color: white; background: linear-gradient(135deg, var(--blue), #7ca0e7); font-size: 29px; font-weight: 850; box-shadow: 0 14px 30px rgba(47,107,220,.25); }.profile-card h3 { margin: 20px 0 5px; font-size: 22px; }.profile-card > p { margin: 0 0 16px; color: var(--muted); }.verified-badge { padding: 7px 11px; border-radius: 999px; color: var(--green); background: var(--green-soft); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.details-list { margin: 0; padding: 0 24px 24px; }.details-list > div { display: grid; grid-template-columns: minmax(100px,.5fr) 1fr; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }.details-list dt { color: var(--muted); font-size: 11px; font-weight: 750; }.details-list dd { margin: 0; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.security-card { padding-bottom: 24px; }.security-card ul { display: grid; gap: 13px; margin: 0 24px 24px; padding: 0; list-style: none; color: var(--muted); font-size: 12px; }.security-card li { display: flex; align-items: center; gap: 10px; }.security-card li i { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }.security-card .secondary-button { width: calc(100% - 48px); margin: 8px 24px 0; }
.binding-grid { display: grid; grid-template-columns: minmax(320px,.8fr) minmax(480px,1.2fr); gap: 18px; }.binding-guide { padding-bottom: 24px; }.step-list { display: grid; gap: 18px; margin: 0; padding: 2px 24px 24px; list-style: none; }.step-list li { display: grid; grid-template-columns: 32px 1fr; gap: 13px; align-items: start; }.step-list li > span { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 10px; color: var(--blue); background: var(--blue-soft); font-size: 11px; font-weight: 850; }.step-list strong { display: block; font-size: 13px; }.step-list p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }.security-note { margin: 0 24px; padding: 16px; border: 1px solid #f3dfa8; border-radius: 13px; color: #6f5113; background: #fffaf0; }.security-note strong { font-size: 12px; }.security-note p { margin: 6px 0 0; font-size: 11px; line-height: 1.55; }.binding-form { display: grid; gap: 17px; padding: 0 24px 24px; }.field > small { color: var(--muted); font-size: 10px; font-weight: 550; line-height: 1.45; }.inline-field { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 9px; }.inline-button { min-width: 100px; border: 1px solid #d6e4fb; border-radius: 12px; color: var(--blue); background: var(--blue-soft); font-size: 11px; font-weight: 800; cursor: pointer; }.check-field { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); font-size: 11px; font-weight: 650; line-height: 1.45; }.check-field input { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; accent-color: var(--blue); }
.portal-section-head .secondary-button { flex: 0 0 auto; }
.portal-service-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.portal-card { display: grid; grid-template-columns: auto minmax(0,1fr); align-content: start; column-gap: 16px; padding: 24px; }
.portal-card-icon { display: grid; grid-row: span 1; width: 42px; height: 42px; place-items: center; border-radius: 13px; font-size: 14px; font-weight: 900; }
.portal-card-icon.blue { color: var(--blue); background: var(--blue-soft); }.portal-card-icon.green { color: var(--green); background: var(--green-soft); }.portal-card-icon.violet { color: var(--violet); background: var(--violet-soft); }.portal-card-icon.amber { color: var(--amber); background: var(--amber-soft); }.portal-card-icon.red { color: var(--red); background: var(--red-soft); }.portal-card-icon.slate { color: #58667b; background: #edf1f6; }
.portal-card-copy h3 { margin: 0; font-size: 19px; letter-spacing: -.035em; }.portal-card-copy > p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.portal-links { display: grid; grid-column: 1 / -1; gap: 8px; margin-top: 21px; }
.portal-links a { position: relative; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; min-height: 64px; padding: 12px 42px 12px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: var(--surface-soft); transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.portal-links a:hover { border-color: #c9d9f3; background: var(--blue-soft); transform: translateX(2px); }.portal-links span, .portal-links small { display: block; }.portal-links span { font-size: 13px; font-weight: 800; }.portal-links small { grid-column: 1; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.4; }.portal-links b { position: absolute; right: 16px; color: var(--blue); font-size: 18px; }
.portal-footnote { margin: 18px 2px 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.toast-region { position: fixed; right: 28px; top: 100px; z-index: 100; display: grid; gap: 9px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }.toast { display: flex; gap: 11px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: var(--shadow); font-size: 12px; line-height: 1.5; animation: toastIn .2s ease both; }.toast::before { content: ""; width: 9px; height: 9px; margin-top: 4px; border-radius: 50%; background: var(--blue); }.toast.success::before { background: var(--green); }.toast.error::before { background: var(--red); }
.mobile-nav, .sidebar-backdrop { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -220% 0; } }
@keyframes viewIn { from { opacity: 0; transform: translateY(5px); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }
@keyframes nudge { 50% { transform: translateX(3px); } }

@media (max-width: 1180px) {
  :root { --sidebar: 220px; }
  .brand strong { font-size: 17px; }
  .metric-grid { grid-template-columns: repeat(2,1fr); }
  .profile-grid { grid-template-columns: .7fr 1.3fr; }.security-card { grid-column: 1 / -1; }
  .advanced-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 920px) {
  .login-shell { grid-template-columns: 1fr; }.login-story { display: none; }.login-panel { min-height: 100vh; padding: 28px 18px; }.mobile-brand { display: flex; }
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow); }.sidebar.is-open { transform: translateX(0); }.sidebar-backdrop { position: fixed; inset: 0; z-index: 35; background: rgba(9,20,39,.35); backdrop-filter: blur(2px); }.sidebar-backdrop.is-open { display: block; }
  .workspace { margin-left: 0; padding: 0 22px 96px; }.mobile-menu { display: grid; }.dashboard-grid, .bot-config-grid, .support-grid, .binding-grid, .portal-service-grid { grid-template-columns: 1fr; }.launch-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }.launch-button { grid-column: 1 / -1; }.profile-grid { grid-template-columns: 1fr 1.4fr; }.security-card { grid-column: 1 / -1; }
  .mobile-nav { position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 34; display: grid; grid-template-columns: repeat(5,1fr); padding: 7px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.95); box-shadow: 0 18px 40px rgba(25,45,80,.2); backdrop-filter: blur(16px); }.mobile-nav button { display: grid; place-items: center; gap: 3px; min-height: 50px; border: 0; border-radius: 12px; color: #8a96a8; background: transparent; font-size: 9px; font-weight: 800; cursor: pointer; }.mobile-nav button.is-active { color: var(--blue); background: var(--blue-soft); }.mobile-nav svg { width: 19px; height: 19px; }
}

@media (max-width: 680px) {
  .login-card { padding: 30px 24px; border-radius: 22px; }.login-heading h2 { font-size: 27px; }
  .workspace { padding-inline: 14px; }.topbar { height: 78px; }.topbar .connection-pill { display: none; }.page-title h1 { font-size: 21px; }.topbar-actions { gap: 7px; }
  .welcome-card { align-items: flex-start; min-height: 230px; }.welcome-badge { position: absolute; right: 22px; bottom: 22px; }.metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }.metric-card { padding: 17px; }.metric-card strong { font-size: 21px; }.metric-card small { white-space: normal; }
  .section-head { align-items: flex-start; flex-direction: column; margin-top: 8px; }.section-head .segmented { width: 100%; overflow: auto; }.section-head .segmented button { flex: 1; }
  .toolbar { align-items: stretch; flex-direction: column; }.search-box { width: 100%; }.toolbar .segmented { width: 100%; }.toolbar .segmented button { flex: 1; }
  .wallet-grid { grid-template-columns: 1fr; }.balance-card { min-height: 125px; }.settings-form { grid-template-columns: 1fr; }.span-two { grid-column: auto; }.launch-grid { grid-template-columns: 1fr; }.launch-button { grid-column: auto; }.advanced-row { grid-column: 1 / -1; }.advanced-grid { grid-template-columns: 1fr; }.profile-grid { grid-template-columns: 1fr; }.security-card { grid-column: auto; }
  .activity-row { grid-template-columns: 1fr 1fr; }.form-row { align-items: flex-start; flex-direction: column; }.forgot-row { align-items: flex-end; }
  .inline-field { grid-template-columns: 1fr; }.inline-button { min-height: 42px; }
  .trade-manager { width: min(100vw - 18px, 920px); max-height: calc(100vh - 18px); border-radius: 18px; }.trade-manager-head { padding: 19px; }.trade-manager-content { padding: 17px; }.trade-detail-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }.trade-control-heading, .trade-danger-zone { align-items: stretch; flex-direction: column; }.trade-control-heading > p { max-width: none; text-align: left; }.trade-control-buttons, .trade-settings-form { grid-template-columns: 1fr; }.trade-settings-form .span-two { grid-column: auto; }.trade-danger-actions { width: 100%; flex-basis: auto; grid-template-columns: 1fr 1fr; }
  .portal-section-head .secondary-button { width: 100%; }.portal-card { padding: 20px; }
  th, td { padding-inline: 14px; }.toast-region { right: 16px; top: 82px; }
}

@media (max-width: 410px) {
  .metric-grid { grid-template-columns: 1fr; }.welcome-card { padding: 25px; }.welcome-card h2 { font-size: 31px; }.login-panel { padding: 15px; }.login-card { padding: 28px 20px; }.mobile-nav { left: 7px; right: 7px; bottom: 7px; }.trade-detail-grid, .trade-danger-actions { grid-template-columns: 1fr; }
}

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