@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&family=IBM+Plex+Sans:wght@300;400;500;600;700&display=swap");

:root,
body.theme-dark {
  --bg: #08090b;
  --surface: #0d0f13;
  --surface-2: #12141a;
  --surface-3: #181b23;
  --surface-4: #1e222c;
  --surface-5: #252a36;
  --line: rgba(255, 255, 255, 0.045);
  --line-strong: rgba(255, 255, 255, 0.08);
  --line-max: rgba(255, 255, 255, 0.12);
  --text: #dfe2e9;
  --muted: #878e9f;
  --muted-2: #505766;
  --muted-3: #363c4a;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.1);
  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.1);
  --green-text: #34d399;
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.08);
  --red-text: #f87171;
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.08);
  --cyan: #06b6d4;
  --shadow: none;
  --handle: 5px;
}

body.theme-light {
  --bg: #f4f1eb;
  --surface: #faf9f7;
  --surface-2: #f0eeea;
  --surface-3: #e8e5df;
  --surface-4: #ddd9d2;
  --surface-5: #d0ccc4;
  --line: rgba(0, 0, 0, 0.07);
  --line-strong: rgba(0, 0, 0, 0.12);
  --line-max: rgba(0, 0, 0, 0.18);
  --text: #1a1714;
  --muted: #5c564d;
  --muted-2: #8a847a;
  --muted-3: #b0aaa0;
  --accent: #b45309;
  --accent-soft: rgba(180, 83, 9, 0.08);
  --green: #16a34a;
  --green-soft: rgba(22, 163, 74, 0.08);
  --green-text: #15803d;
  --red: #dc2626;
  --red-soft: rgba(220, 38, 38, 0.06);
  --red-text: #b91c1c;
  --amber: #d97706;
  --amber-soft: rgba(217, 119, 6, 0.06);
  --cyan: #0e7490;
}

body.theme-console {
  --bg: #07110b;
  --surface: #0b1610;
  --surface-2: #0d1a13;
  --surface-3: #12241a;
  --surface-4: #163020;
  --surface-5: #1a3826;
  --line: rgba(82, 135, 106, 0.18);
  --line-strong: rgba(82, 135, 106, 0.28);
  --line-max: rgba(82, 135, 106, 0.4);
  --text: #e8f7eb;
  --muted: #7ca08a;
  --muted-2: #50705c;
  --muted-3: #335041;
  --accent: #49c97d;
  --accent-soft: rgba(73, 201, 125, 0.1);
  --green: #49d98a;
  --green-soft: rgba(73, 217, 138, 0.12);
  --green-text: #80f3ae;
  --red: #ff716f;
  --red-soft: rgba(255, 113, 111, 0.08);
  --red-text: #ff9b99;
  --amber: #d6ac55;
  --amber-soft: rgba(214, 172, 85, 0.1);
  --cyan: #4ddad4;
}

:root {
  --mono: "IBM Plex Mono", monospace;
  --sans: "IBM Plex Sans", sans-serif;
  --radius: 6px;
  --radius-sm: 4px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  display: flex;
  flex-direction: column;
  font-size: 14px;
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel-frame {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.login-shell {
  position: fixed;
  inset: 0;
  z-index: 120;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(91, 135, 255, 0.08), transparent 26%),
    radial-gradient(circle at top right, rgba(39, 208, 143, 0.08), transparent 24%),
    var(--bg);
  overflow: auto;
}

body.auth-locked {
  overflow: hidden;
}

body.auth-locked .app-shell,
body.auth-locked .mobile-tabbar {
  visibility: hidden;
}

.login-card {
  width: min(460px, 100%);
  padding: 28px;
}

.login-brand,
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(91, 135, 255, 0.24), rgba(91, 135, 255, 0.1));
  border: 1px solid rgba(91, 135, 255, 0.24);
  color: #f7fbff;
  font-family: var(--mono);
  font-weight: 700;
}

.brand-eyebrow,
.summary-label,
.panel-count,
.period-button,
.head-toggle,
.utility-button,
.mobile-tab-button,
.field span,
.control-label,
.runtime-item-label,
.status-text,
.doc-chip,
.link-toggle {
  font-family: var(--mono);
}

.brand-eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.73rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand-copy h1,
.panel-head h2,
.modal-head h3,
.login-card h1 {
  margin: 0;
  font-size: 1.36rem;
  letter-spacing: -0.03em;
}

.login-copy {
  margin: 16px 0 20px;
  color: var(--muted);
  line-height: 1.6;
}

.login-error {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--red);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field input,
.field select,
.command-bar input {
  width: 100%;
  min-height: 46px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  padding: 0 14px;
}

.field input:focus,
.field select:focus,
.command-bar input:focus {
  outline: none;
  border-color: rgba(91, 135, 255, 0.38);
  box-shadow: 0 0 0 3px rgba(91, 135, 255, 0.12);
}

.topbar{display:flex;align-items:center;background:var(--surface);border-bottom:1px solid var(--line);height:56px;flex-shrink:0;padding:0 12px;gap:8px}
.mg{display:flex;align-items:center;gap:6px;min-width:0;flex:1}
.m{padding:6px 14px;display:flex;flex-direction:column;justify-content:center;gap:1px;background:var(--surface-2);border:1px solid var(--line);border-radius:6px;min-width:0;cursor:default;transition:all .15s;flex:0 1 132px}
.m:hover{background:var(--surface-2)}
.m.primary{border-color:var(--line-strong);min-width:160px}
.m.highlight .v{font-size:18px}
.interactive-metric{appearance:none;border:none;text-align:left;color:inherit;cursor:pointer}
.m .l{font-size:11px;font-weight:500;letter-spacing:.4px;color:var(--muted);font-family:var(--mono);white-space:nowrap}
.m .v{font-size:15px;font-weight:600;font-family:var(--mono);color:var(--text);white-space:nowrap;display:flex;align-items:baseline;gap:3px;line-height:1.2}
.m .v.positive{color:var(--green-text)}
.m .v.negative{color:var(--red-text)}
.msub{display:none}
.tools,.theme-switch,.dots,.panel-tools,.dual-actions,.quad-actions,.inline-field{display:flex;align-items:center;gap:10px}
.tools{gap:2px;padding:0 8px;margin-left:auto;flex-shrink:0}
.seg{display:flex;background:var(--surface-4);border-radius:5px;padding:1px;margin:0 3px}
.seg button{height:26px;padding:0 12px;border:none;background:transparent;color:var(--muted-2);font-size:13px;font-family:var(--sans);font-weight:500;cursor:pointer;border-radius:4px;transition:all .1s}
.seg button:hover{color:var(--muted)}
.seg button.active,.seg button.is-active{background:var(--accent);color:#fff}
.seg.lang button.active,.seg.lang button.is-active{background:var(--surface);color:var(--text)}
.ib,.toolbar-button,.toolbar-icon-button,.period-button,.head-toggle,.utility-button,.primary-button,.danger-button,.wbtn{appearance:none;border:none;background:transparent;color:var(--muted);transition:all .1s}
.ib{width:30px;height:30px;border-radius:5px;display:flex;align-items:center;justify-content:center}
.ib:hover{background:var(--surface-4);color:var(--text)}
.ib svg{width:16px;height:16px}
.ib.is-active{
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.28);
}
body.theme-light .ib.is-active{
  background: rgba(180, 83, 9, 0.10);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(180, 83, 9, 0.22);
}
.wbtn{height:30px;padding:0 14px;border-radius:5px;border:1px solid var(--line-strong);background:var(--surface-4);color:var(--text);font-size:13px;font-family:var(--sans);font-weight:500;cursor:pointer;white-space:nowrap;margin-left:3px}
.wbtn:hover{border-color:var(--accent)}
.wbtn.subtle{background:transparent;color:var(--muted);border-color:transparent}
.danger-button{background:var(--red-text);border-color:var(--red-text);color:#fff}
.dots,.theme-switch{display:flex;align-items:center;gap:5px;margin:0 8px}
.dot,.theme-dot{width:14px;height:14px;border-radius:50%;border:2px solid var(--line-max);background:transparent;cursor:pointer;transition:all .15s}
.dot:hover,.theme-dot:hover{transform:scale(1.2)}
.dot.dark-dot,.theme-dot-dark{background:#1a1a2e}
.dot.light-dot,.theme-dot-light{background:#faf9f7;border-color:#ccc}
.dot.active-dot,.theme-dot.active{border-color:var(--accent);box-shadow:0 0 0 2px var(--accent-soft)}
.sound-icon{display:inline-block;width:16px;height:16px;background:currentColor;-webkit-mask:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M14.857 17.082A23.848 23.848 0 0018 12c0-1.882-.47-3.656-1.143-5.082m-2.953 10.164a23.784 23.784 0 01-3.714 0m3.714 0a3 3 0 11-3.714 0m3.714 0H10.29m4.567 0a24.255 24.255 0 003.472-.504m-11.511.504A24.255 24.255 0 013.472 16.578M6.857 17.082V10a5.143 5.143 0 1110.286 0v7.082M6.857 17.082h10.286'/%3E%3C/svg%3E\") center/contain no-repeat;mask:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M14.857 17.082A23.848 23.848 0 0018 12c0-1.882-.47-3.656-1.143-5.082m-2.953 10.164a23.784 23.784 0 01-3.714 0m3.714 0a3 3 0 11-3.714 0m3.714 0H10.29m4.567 0a24.255 24.255 0 003.472-.504m-11.511.504A24.255 24.255 0 013.472 16.578M6.857 17.082V10a5.143 5.143 0 1110.286 0v7.082M6.857 17.082h10.286'/%3E%3C/svg%3E\") center/contain no-repeat}
.main{flex:1;display:flex;overflow:hidden;min-height:0}
.center{flex:1;display:flex;flex-direction:column;min-width:0;overflow:hidden}
.row-top{display:flex;min-height:120px;overflow:hidden;flex:1 1 0}
.sidebar{width:320px;min-width:280px;max-width:480px;flex-shrink:0;background:var(--surface);border-left:1px solid var(--line);display:flex;flex-direction:column;overflow:hidden}
.rs-h{padding:10px 14px;border-bottom:1px solid var(--line)}
.rs-t{font-size:15px;font-weight:600}
.rs-d{padding:10px 14px;font-size:13px;line-height:1.6;color:var(--muted);border-bottom:1px solid var(--line)}
.sm{padding:12px 14px;overflow-x:auto}
.links-grid{min-width:max-content}
.pnl{min-height:0;display:flex;flex-direction:column;background:var(--surface);border:1px solid var(--line);border-radius:6px;overflow:hidden;flex:1}
.p-new{flex:1 1 0;min-width:120px;min-height:0;display:flex;flex-direction:column;padding:6px 0 6px 6px}
.p-hot{flex:0 0 280px;width:280px;min-width:160px;max-width:450px;min-height:0;display:flex;flex-direction:column;padding:6px 0}
.p-exec{flex:0 0 340px;width:340px;min-width:180px;max-width:550px;min-height:0;display:flex;flex-direction:column;padding:6px 6px 6px 0}
.p-cmd{min-height:96px;display:flex;flex-direction:column;padding:0 6px;overflow:hidden;flex:0.5 1 0}
.p-port{min-height:160px;display:flex;flex-direction:column;padding:0 6px 6px;overflow:hidden;flex:0.4 1 0}
.ph{display:flex;align-items:center;padding:8px 12px;gap:6px;border-bottom:1px solid var(--line);flex-shrink:0}
.pt{font-size:14px;font-weight:600}
.bdg{background:var(--accent);color:#fff;font-size:11px;font-weight:600;min-width:18px;height:18px;border-radius:9px;display:inline-flex;align-items:center;justify-content:center;padding:0 5px;font-family:var(--mono);margin-left:auto}
.bdg.g{background:var(--green)}
.ps{flex:1;overflow:auto;min-height:0}
.ps .tb{min-width:max-content}
.ptabs{display:flex;gap:0}
.ptb{height:26px;padding:0 12px;border:none;background:transparent;color:var(--muted-2);font-size:12px;font-family:var(--sans);font-weight:500;cursor:pointer;border-radius:0;transition:all .1s;border-bottom:2px solid transparent}
.ptb:hover{color:var(--muted)}
.ptb.active,.ptb.is-active{color:var(--accent);border-bottom-color:var(--accent);background:var(--accent-soft)}
.ttabs{display:flex;gap:2px;padding:6px 10px 3px}
.tt{height:24px;padding:0 10px;border-radius:4px;border:1px solid var(--line-strong);background:transparent;color:var(--muted-2);font-size:11px;font-family:var(--mono);font-weight:600;cursor:pointer;transition:all .1s}
.tt:hover{border-color:var(--line-max);color:var(--muted)}
.tt.active,.tt.is-active{background:var(--accent);border-color:var(--accent);color:#fff}
.tb{width:100%;border-collapse:collapse}
.tb th{text-align:left;font-size:11px;font-weight:600;color:var(--muted-3);padding:6px 10px;border-bottom:1px solid var(--line);font-family:var(--mono);position:sticky;top:0;background:var(--surface);z-index:1;white-space:nowrap}
.tb td{padding:6px 10px;color:var(--muted);border-bottom:1px solid var(--line);font-family:var(--mono);white-space:nowrap;font-size:13px}
.tb tr:hover td{background:var(--surface-2)}
.data-table tbody tr.is-selected{background:var(--accent-soft)}
.empty-state,
.loading-cell{padding:18px 10px !important;text-align:center;color:var(--muted-2) !important}
.loading-cell .loading-line,
.loading-cell .loading-chip{
  display:block;
  border-radius:6px;
  background:linear-gradient(90deg, var(--surface-2) 0%, var(--surface-4) 50%, var(--surface-2) 100%);
  background-size:220% 100%;
  animation:loading-shimmer 1.2s ease-in-out infinite;
}
.loading-cell .loading-line{height:12px;margin:0 auto 8px;width:min(88%,480px)}
.loading-cell .loading-line.short{width:min(46%,220px)}
.loading-cell .loading-chip{width:84px;height:20px;margin:0 auto}
@keyframes loading-shimmer{
  0%{background-position:200% 0}
  100%{background-position:-20% 0}
}
.h-resize{width:var(--handle);cursor:col-resize;background:transparent;flex-shrink:0;position:relative;z-index:10}
.h-resize:hover,.h-resize.active{background:var(--accent)}
.h-resize::after{content:'';position:absolute;top:0;bottom:0;left:-2px;right:-2px}
.v-resize{height:var(--handle);cursor:row-resize;background:transparent;flex-shrink:0;position:relative;z-index:10}
.v-resize:hover,.v-resize.active{background:var(--accent)}
.v-resize::after{content:'';position:absolute;left:0;right:0;top:-2px;bottom:-2px}
.bbar{display:flex;align-items:center;padding:4px 6px;gap:4px;border-top:1px solid var(--line);background:var(--surface);flex-shrink:0}
.btabs,.brt{display:flex;gap:3px;align-items:center}
.brt{margin-left:auto}
.btab,.bact{height:32px;padding:0 14px;border-radius:5px;border:1px solid var(--line-strong);background:transparent;color:var(--muted);font-size:13px;font-family:var(--sans);font-weight:500;cursor:pointer;transition:all .1s}
.btab:hover,.bact:hover{border-color:var(--line-max);color:var(--text)}
.btab.active,.btab.is-active{background:var(--accent-soft);border-color:var(--accent);color:var(--accent)}
.bact.buy{color:var(--green-text);border-color:rgba(16,185,129,0.2)}
.bact.buy:hover{background:var(--green-soft)}
.bact.danger{color:var(--red-text);border-color:rgba(239,68,68,0.15)}
.bact.danger:hover{background:var(--red-soft)}
.sbar{display:flex;align-items:center;padding:3px 10px;gap:10px;background:var(--bg);border-top:1px solid var(--line);flex-shrink:0;height:24px}
.status-text{font-size:11px;color:var(--muted);font-family:var(--mono);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.status-text{display:flex;align-items:center;gap:10px;width:100%}
.si{font-size:11px;color:var(--muted);font-family:var(--mono);white-space:nowrap;display:flex;align-items:center;gap:3px}
.stag{padding:1px 5px;border-radius:2px;font-weight:600;font-size:11px;font-family:var(--mono)}
.stag.tui{background:rgba(6,182,212,0.12);color:var(--cyan)}
.stag.web{background:var(--green-soft);color:var(--green-text)}
.si.sim{color:var(--amber);background:var(--amber-soft);padding:1px 6px;border-radius:2px;font-weight:600}
body.resizing{cursor:col-resize;user-select:none}
body.resizing-v{cursor:row-resize;user-select:none}
body.resizing *,body.resizing-v *{pointer-events:none}
body.resizing .h-resize,body.resizing-v .v-resize{pointer-events:auto}

.mono {
  font-family: var(--mono);
}

.positive {
  color: var(--green);
}

.negative {
  color: var(--red);
}

.neutral {
  color: var(--text);
}

.text-soft {
  color: var(--muted);
}

.empty-state {
  color: var(--muted);
  text-align: center;
  padding: 28px 18px;
}

.token-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 180px;
}

.token-avatar-shell {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  position: relative;
}

.token-avatar,
.token-badge {
  width: 34px;
  height: 34px;
  border-radius: 11px;
}

.token-avatar {
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.token-badge {
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(91, 135, 255, 0.16), rgba(91, 135, 255, 0.05));
  border: 1px solid rgba(91, 135, 255, 0.22);
  color: #f7fbff;
  font-family: var(--mono);
  font-weight: 700;
}

.token-badge-fallback {
  display: none;
  position: absolute;
  inset: 0;
}

.token-main {
  font-weight: 700;
}

.token-sub {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.doc-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(91, 135, 255, 0.14);
  color: #d9e6ff;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid rgba(91, 135, 255, 0.26);
}

body.theme-light .doc-chip {
  background: rgba(59, 130, 246, 0.10);
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.26);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-sell-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.quick-sell-button {
  min-height: 28px;
  padding: 0 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.quick-sell-button:hover {
  border-color: rgba(91, 135, 255, 0.35);
  background: rgba(91, 135, 255, 0.14);
}

.quick-sell-button-strong {
  border-color: rgba(255, 122, 122, 0.4);
  background: rgba(255, 122, 122, 0.18);
  color: #ffdada;
}

.panel-note {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.83rem;
}

.links-grid {
  display: grid;
  gap: 5px;
}

.sm-h {
  display: grid;
  grid-template-columns: 38px repeat(8, 44px);
  column-gap: 4px;
  align-items: center;
  padding-left: 0;
  margin-bottom: 6px;
}

.sm-h span {
  width: auto;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--mono);
  color: var(--muted-3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sm-h > :first-child {
  width: auto;
}

.sm-h button {
  width: auto;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--mono);
  color: var(--muted-3);
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sm-hb:hover {
  color: var(--text);
}

.sm-r {
  display: grid;
  grid-template-columns: 38px repeat(8, 44px);
  column-gap: 4px;
  align-items: center;
  margin-bottom: 5px;
}

.sm-l {
  width: auto;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--mono);
  color: var(--muted-2);
}

.sm-c {
  width: 44px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  margin: 0;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
  background: transparent;
}

.sm-c:hover {
  background: var(--surface-4);
}

.sm-c.on,
.link-toggle.is-active {
  background: var(--green-soft);
  border-color: rgba(16, 185, 129, 0.25);
  color: var(--green);
}

.sm-c span {
  font-size: 18px;
  line-height: 1;
}

.links-header,
.links-row,
.links-row-label {
  display: none;
}

.link-toggle {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--muted);
}

.panel-modal {
  position: fixed;
  top: 84px;
  right: 18px;
  z-index: 42;
  width: min(520px, calc(100vw - 36px));
  max-height: calc(100vh - 120px);
  padding: 16px;
  overflow: auto;
}

#profit-modal {
  width: min(920px, calc(100vw - 36px));
}

#cc10-modal {
  width: min(920px, calc(100vw - 36px));
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 41;
  background: rgba(2, 6, 12, 0.55);
  backdrop-filter: blur(6px);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-close {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.form-stack {
  display: grid;
  gap: 14px;
}

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

.sim-account-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.sim-account-row.is-active {
  border-color: rgba(91, 135, 255, 0.34);
  box-shadow: inset 0 0 0 1px rgba(91, 135, 255, 0.14);
}

.sim-account-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.sim-account-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sim-account-title-row strong {
  font-size: 0.98rem;
}

.sim-account-stats {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.sim-stat {
  white-space: nowrap;
}

.sim-account-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sim-fund-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sim-fund-input {
  width: 92px;
  min-width: 92px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 0 10px;
  font-family: var(--mono);
}

.sim-fund-input:focus {
  outline: none;
  border-color: rgba(91, 135, 255, 0.38);
  box-shadow: 0 0 0 3px rgba(91, 135, 255, 0.10);
}

.inline-field {
  align-items: stretch;
}

.inline-field > *:first-child {
  flex: 1;
}

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

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

.wallet-status {
  white-space: pre-line;
  color: var(--muted);
  line-height: 1.6;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.check-row input {
  width: 18px;
  height: 18px;
}

.control-grid,
.runtime-grid,
.profit-metrics {
  display: grid;
  gap: 12px;
}

.control-group,
.metric-block,
.runtime-item {
  padding: 14px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.quad-actions {
  flex-wrap: wrap;
}

.quad-actions .head-toggle,
.dual-actions .head-toggle {
  flex: 1;
}

.runtime-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.runtime-item-label {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.runtime-wallet-block {
  margin-top: 12px;
  padding: 14px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--muted);
  line-height: 1.6;
}

.command-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.command-bar input {
  flex: 1;
}

.console-log {
  min-height: 280px;
  max-height: 420px;
  overflow: auto;
  padding: 14px;
  border-radius: 14px;
  background: rgba(5, 8, 12, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.04);
  font-family: var(--mono);
  font-size: 0.82rem;
  white-space: pre-wrap;
}

.manual-selected-card {
  min-height: 124px;
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.manual-card {
  display: flex;
  gap: 14px;
  align-items: center;
}

.manual-card-copy h4 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.manual-card-copy p {
  margin: 0;
  color: var(--muted);
}

.manual-actual {
  min-height: 22px;
  margin-bottom: 14px;
  color: var(--text);
  font-family: var(--mono);
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.profit-range {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.profit-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

.metric-block span,
.metric-block small {
  display: block;
  color: var(--muted);
}

.metric-block strong {
  display: block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 1.22rem;
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.calendar-head h4 {
  margin: 0;
  font-size: 1.08rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.calendar-cell {
  min-height: 88px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.calendar-cell.is-filler {
  opacity: 0.35;
}

.calendar-day {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8rem;
}

.calendar-pnl {
  display: block;
  margin-top: 8px;
  font-family: var(--mono);
  font-weight: 700;
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 96px;
  z-index: 60;
  display: grid;
  gap: 10px;
}

.toast {
  min-width: 260px;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(91, 135, 255, 0.24);
  background: rgba(9, 17, 28, 0.92);
  box-shadow: var(--shadow);
}

.toast strong {
  display: block;
  margin-bottom: 4px;
}

.toast p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.mobile-tabbar {
  display: none;
}

body.profile-pro .workspace-panel,
body.profile-pro .panel-modal,
body.profile-pro .summary-card {
  border-radius: 14px;
}

body.profile-pro .data-table th,
body.profile-pro .data-table td {
  padding-block: 11px;
}

@media (max-width: 1280px) {
  .sidebar {
    width: 280px;
  }

  .p-hot {
    width: 240px;
  }

  .p-exec {
    width: 300px;
  }
}

@media (max-width: 980px) {
  .app-shell {
    margin-bottom: 88px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .mg {
    width: 100%;
    overflow-x: auto;
  }

  .m {
    min-width: 120px;
  }

  .tools {
    width: 100%;
    justify-content: space-between;
    border-left: none;
    border-top: 1px solid var(--line);
  }

  .main {
    display: block;
  }

  .row-top,
  .p-cmd,
  .p-port {
    display: block;
  }

  .sidebar,
  .p-new,
  .p-hot,
  .p-exec,
  .p-cmd,
  .p-port {
    margin-bottom: 10px;
    height: auto !important;
    width: auto;
    max-width: none;
    padding: 0;
  }

  .mobile-pane.hidden-mobile-pane {
    display: none;
  }

  .panel-modal {
    top: auto;
    right: 8px;
    left: 8px;
    bottom: 82px;
    width: auto;
    max-height: calc(100vh - 140px);
  }

  #profit-modal {
    width: auto;
  }

  .profit-metrics,
  .runtime-grid,
  .two-column {
    grid-template-columns: 1fr;
  }

  .calendar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sim-account-row {
    flex-direction: column;
  }

  .sim-account-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .sim-fund-inline {
    width: 100%;
  }

  .sim-fund-input {
    flex: 1;
    width: auto;
    min-width: 0;
  }

  .mobile-tabbar {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: 8px;
    z-index: 70;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(10, 16, 24, 0.92);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
  }

  .mobile-tab-button {
    min-height: 42px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
  }

  .mobile-tab-button.active {
    color: var(--text);
    background: rgba(91, 135, 255, 0.16);
    border-color: rgba(91, 135, 255, 0.32);
  }

  .h-resize,
  .v-resize,
  .panel-resize-handle {
    display: none;
  }

  .bbar {
    flex-direction: column;
    align-items: stretch;
  }

  .btabs,
  .brt {
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .login-card {
    padding: 22px;
  }

  .tools,
  .profit-range {
    flex-wrap: wrap;
  }

  .seg {
    flex: 1 1 auto;
  }

  .seg button {
    flex: 1 1 0;
  }

  .data-table {
    min-width: 640px;
  }

  .calendar-grid {
    grid-template-columns: 1fr;
  }
}
