:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", sans-serif;
  color-scheme: dark;
  --page: #111113;
  --panel: #1c1c1e;
  --line: #39393f;
  --text: #f6f4f9;
  --muted: #b5b3be;
  --accent: #f8a056;
  --field-surface: #18191b;
  --ink: #100f10;
  --field-border: color-mix(in srgb, var(--accent) 25%, #47494c);
  --edge: #b57b50;
  --glow1: #28201b;
  --glow2: #354e56;
  color: var(--text);
  background: var(--page);
  line-height: 1.5;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}
header, main, footer { width: 100%; min-width: 0; }
header, footer { padding-inline: clamp(1rem, 2vw, 2rem); }
header, .toolbar, .actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
header {
  min-height: 3.75rem;
  padding-block: .75rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: .8125rem;
  background: linear-gradient(110deg, #242428, #19191c 65%);
}
.brand { letter-spacing: -.035em; font-size: 1.125rem; font-weight: 650; color: var(--text); }
main { display: flex; flex-direction: column; }
h1, h2, p { margin: 0; }
h1, h2 { font-weight: 600; line-height: 1.06; letter-spacing: -.04em; }
h1 { font-size: clamp(2.45rem, 5vw, 4.75rem); }
h2 { font-size: 1.5rem; }
#login {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  background: #121212;
}
.identity { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: clamp(1.25rem, 4vw, 4rem); }
.identity img { display: block; width: min(100%, 32rem); height: auto; }
.access, #workspace > section, .profile { padding: clamp(1.25rem, 3.5vw, 3rem); }
.intro { text-wrap: balance; width: min(100%, 32rem); }
.eyebrow { text-transform: uppercase; letter-spacing: .13em; font-size: .75rem; font-weight: 650; color: var(--accent); margin-bottom: .75rem; }
.intro p:last-child, .description, .toolbar p, .note, footer { color: var(--muted); }
.intro p:last-child { margin-top: 1rem; max-width: 36ch; font-size: clamp(1rem, 1.35vw, 1.2rem); }
.access, .profile, #workspace > section { background: var(--panel); }
.access { display: grid; align-content: center; justify-content: center; grid-template-columns: minmax(0, 27rem); border-left: 1px solid var(--line); }
#login-title { font-size: clamp(2rem, 3vw, 3rem); }
.description { margin: .625rem 0 1.5rem; }
label { display: block; margin-bottom: 1rem; font-size: .875rem; font-weight: 600; }
input, select, button { font: inherit; min-height: 2.75rem; border-radius: .625rem; }
input, select {
  width: 100%; margin-top: .375rem; padding: .65rem .875rem;
  color: var(--text); background: #29292d; border: 1px solid #737379; font-size: 1rem;
  font-weight: 450; border-radius: .8rem;
}
button {
  cursor: pointer; padding: .65rem 1.25rem; border: 1px solid transparent;
  color: #21172c; background: linear-gradient(#e0cbfc, #c7a9eb); font-weight: 600;
  border-radius: 999px;
}
button:hover:enabled { background: var(--accent); }
button.secondary { color: var(--text); background: #353539; border-color: #636369; }
button.secondary:hover:enabled { background: #424248; }
button:disabled, input:disabled, select:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
#login button { width: 100%; }
.note, footer { font-size: .875rem; }
.note { margin-block: 1rem; }
.access .note { border-top: 1px solid var(--line); padding-top: 1rem; margin-bottom: 0; }
#workspace { overflow-wrap: anywhere; }
#workspace h1 { font-size: 2rem; }
.profiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: 1rem; }
.profile, #workspace > section { border: 1px solid var(--line); border-radius: 1rem; min-width: 0; }
.profile h2, .toolbar { margin-bottom: 1.25rem; }
.toolbar label { margin: 0; }
.actions { justify-content: flex-start; margin-top: 1.25rem; }
#workspace > section { margin-block: 1.25rem; }
#message:not(:empty) { margin-bottom: 1rem; padding: .875rem 1rem; background: #2c2734; border-left: 3px solid var(--accent); white-space: pre-wrap; overflow-wrap: anywhere; }
pre { background: #101012; padding: 1rem; border-radius: .625rem; min-height: 12rem; max-height: 32rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
#console { height: clamp(16rem, 48vh, 32rem); }
.run-monitor { display: grid; grid-template-columns: minmax(0, 3fr) minmax(15rem, 2fr); gap: 1rem; align-items: start; }
.run-monitor pre { margin: 0; }
.pnl-panel { border: 1px solid var(--line); border-radius: .625rem; padding: 1rem; }
.pnl-panel h3 { margin: 0 0 .4rem; }
#pnl-total { font-size: 1.6rem; }
#pnl-caption, .pnl-position small { display: block; margin-top: .3rem; }
.pnl-position { border-top: 1px solid var(--line); margin-top: .8rem; padding-top: .8rem; }
.pnl-position-title { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem; }
.pnl-panel .profit { color: #59d69e; }
.pnl-panel .loss { color: #ff8383; }
@media (max-width: 850px) { .run-monitor { grid-template-columns: minmax(0, 1fr); } }
#history { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; font-variant-numeric: tabular-nums; }
th, td { padding: .75rem; border-bottom: 1px solid var(--line); text-align: left; }
footer { padding-block: .5rem; border-top: 1px solid var(--line); }
.ansi-red { color: #ff9c94; }
.ansi-green { color: #99dcaf; }
.ansi-yellow { color: #e8d38a; }
.ansi-blue { color: #9fbfff; }
.ansi-cyan { color: #96dfdd; }
[hidden] { display: none !important; }
@media (max-width: 47rem) {
  #login { grid-template-columns: minmax(0, 1fr); }
  .identity { align-items: start; }
  .identity img { width: min(100%, 13rem); }
  .intro p:last-child { display: none; }
  .access { border-left: 0; border-top: 1px solid var(--line); }
}

body:has(#workspace:not([hidden])) {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
main:has(#workspace:not([hidden])) {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-block: 0;
}
main:has(#workspace:not([hidden])) > #message {
  margin: 0;
  max-height: 20vh;
  overflow: auto;
  flex: none;
}
#workspace {
  display: grid;
  grid-template-columns: clamp(10rem, 18vw, 13rem) minmax(0, 1fr);
  background: var(--panel);
  overflow: hidden;
  flex: 1;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr);
}
.workspace-rail { background-image: linear-gradient(155deg, #27242c, #19191c 55%); overflow: auto; padding: 1rem; border-right: 1px solid var(--line); background-color: #19191c; }
.workspace-rail img { display: block; width: 100%; height: auto; margin-bottom: 1.25rem; border-radius: .5rem; }
.workspace-rail nav { display: grid; gap: .375rem; }
.workspace-rail button svg { flex: none; width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.workspace-rail button { display: flex; align-items: center; gap: .65rem; border-radius: .75rem; font-weight: 500; font-size: .9375rem; background: transparent; color: var(--muted); text-align: left; padding-inline: .875rem; }
.workspace-rail button:hover { background: #29272d; }
.workspace-rail button[aria-current] { background: linear-gradient(110deg, #48404f, #37323d); color: #f6eaff; border-color: #58505f; }
#workspace > .task-panel { overflow: auto; min-height: 0; scrollbar-gutter: stable; margin: 0; border: 0; border-radius: 0; }
#account-panel > p:not(.eyebrow) { margin-top: .75rem; color: var(--muted); }
#logout, #configuration-panel .profiles { margin-top: 1.5rem; }
#configuration-panel .profiles { gap: clamp(1.5rem, 3vw, 3rem); }
#workspace .profile {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  align-content: start;
  gap: 1rem;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: 1rem 0 0;
}
#workspace .profile h2 { grid-column: 1 / -1; font-size: 1.125rem; color: var(--accent); }
#workspace .profile :is(h2, label) { margin: 0; }
.task-panel > h2, #history-panel .toolbar h2 { font-size: clamp(1.6rem, 2.5vw, 2.3rem); }

.console-heading { margin-top: 1.75rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.console-heading h3 { margin: 0; }
@media (max-width: 47rem) {
  #workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: fit-content(45%) minmax(0, 1fr); }
  .workspace-rail { border-right: 0; border-bottom: 1px solid var(--line); }
  .workspace-rail img { width: 8rem; margin-bottom: .5rem; }
  .workspace-rail nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: no-preference) {
  button, input, select { transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease; }
}
input:focus-visible, select:focus-visible { box-shadow: 0 0 0 4px #d19a6a2b; }
#login button:active:enabled, .actions button:active:enabled { filter: brightness(.92); }
th { color: var(--muted); font-size: .8125rem; font-weight: 600; }

/* Shared light field behind the edge-to-edge portal surfaces. */
body {
  --glass-edge: rgba(226, 217, 255, .24);
  --glass-rim: inset 0 1px 0 rgba(255, 255, 255, .19);
  background:
    radial-gradient(ellipse at 84% 6%, #645183 0, transparent 46%),
    radial-gradient(ellipse at 6% 87%, #265856 0, transparent 42%),
    #15141c;
}
#login, #workspace {
  background:
    radial-gradient(ellipse 78% 92% at 12% -65%, transparent 77%, #bba3f54a 94%, transparent 100%),
    radial-gradient(ellipse 68% 95% at 100% 135%, transparent 72%, #82bbd12e 90%, transparent 100%);
}
header, .access, .workspace-rail {
  background: linear-gradient(125deg, #e4ddff16, #e4ddff04 48%, #beb3dd12), #1b192566;
  border-color: var(--glass-edge);
  box-shadow: var(--glass-rim);
  -webkit-backdrop-filter: blur(18px) saturate(125%);
  backdrop-filter: blur(18px) saturate(125%);
}
.identity img { mix-blend-mode: lighten; }
#workspace > .task-panel { background: linear-gradient(125deg, #1a1922c9, #191923a6); }
input, select, button.secondary {
  background: linear-gradient(155deg, #ffffff16, #ffffff03 58%), #25232ed9;
  border-color: #80788b;
  box-shadow: inset 0 1px 0 #ffffff12;
}
select option { background: var(--field-surface); color: var(--text); }
.workspace-rail button[aria-current] {
  background: linear-gradient(155deg, #e6d4ff42, #b495f01f 52%, #a9dddc22);
  border-color: #b7a1cc80;
  box-shadow: var(--glass-rim), inset 0 -1px 0 #c5e4e518, 0 3px 12px #09071224;
}
#login button, #save, #start {
  background: linear-gradient(165deg, #f3e9ff 0%, #d4b8f0 48%, #c4a9e2 68%, #ddc9ef);
  border-color: #f0dfff99;
  box-shadow: inset 0 1px 0 #ffffffb3, 0 3px 12px #10091f40;
}
:is(#login button, #save, #start):hover:enabled { filter: brightness(1.07); }
@media (prefers-reduced-transparency: reduce) {
  body, #login, #workspace { background: var(--page); }
  header, .access, .workspace-rail, #workspace > .task-panel {
    background: var(--panel);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  input, select, button.secondary { background: #29292d; }
  .workspace-rail button[aria-current] { background: #46404e; }
}

/* Keep the tint in the reflected light and the primary action. */
body {
  --rim: rgba(232,230,242,.14);
  --reflection: inset 0 1px 0 rgba(255,255,255,.065);
  background: radial-gradient(ellipse at 33% 8%,color-mix(in srgb,var(--glow1) 12%,transparent),transparent 63%),
              radial-gradient(ellipse at 90% 91%,color-mix(in srgb,var(--glow2) 14%,transparent),transparent 58%), #0c0c0f;
}
#login,#workspace {background:transparent}
header,.workspace-rail,footer {background:rgba(19,19,23,.66);border-color:var(--rim);box-shadow:none}
header,.workspace-rail,.access {backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}
.access {
  justify-self:center;align-self:center;width:min(calc(100% - 2.5rem),32rem);
  margin:clamp(1rem,4vh,3rem) 0;padding:clamp(1.25rem,2.5vw,2rem);
  background:linear-gradient(138deg,#ffffff09,transparent 46%,#ffffff04),rgba(29,30,34,.61);
  border:1px solid var(--rim);border-radius:1.25rem;
  box-shadow:var(--reflection),0 18px 54px #0003;
}
#workspace>.task-panel {background:linear-gradient(135deg,#ffffff04,transparent 60%),rgba(25,25,29,.55)}
#login-title {font-size:clamp(1.8rem,3vw,2.4rem)}
input,select {
  background:#131217;border:1px solid #59545f;box-shadow:inset 0 1px 2px #0003;
}
.workspace-rail button[aria-current] {
  color:var(--text);background:color-mix(in srgb,var(--accent) 10%,#16161a);
  border-color:color-mix(in srgb,var(--accent) 25%,#323137);box-shadow:var(--reflection);
}
#login button,#save,#start {
  color:#181518;border-radius:.75rem;border:1px solid color-mix(in srgb,var(--accent) 75%,white);
  background:linear-gradient(165deg,color-mix(in srgb,var(--accent) 65%,white),var(--accent) 51%,var(--edge));
  box-shadow:inset 0 1px 0 #ffffff7a,0 4px 14px #0003;
}
@media(max-width:47rem){.access{width:min(calc(100% - 2rem),32rem);margin:0 auto 1rem}.identity{padding-bottom:1rem}}
@media(prefers-reduced-transparency:reduce){
  header,.workspace-rail,.access,#workspace>.task-panel{background:#1c1c20;backdrop-filter:none;-webkit-backdrop-filter:none}
}

/* Carbon Ember with Smoke Gradient surfaces. */
body {
  background: radial-gradient(ellipse at 83% 15%, var(--glow1), transparent 56%), var(--ink);
}
header, footer { background: color-mix(in srgb, var(--ink) 87%, transparent); border-color: #ffffff12; }
.access, #workspace .profile {
  border: 1px solid #ffffff21;
  background: linear-gradient(155deg, #ffffff0e, #ffffff02 65%, transparent);
  box-shadow: 0 22px 45px #0003;
  -webkit-backdrop-filter: blur(28px);
  backdrop-filter: blur(28px);
}
#workspace .profile { padding: 1.3rem; border-radius: 18px; }
#workspace > .task-panel { background: color-mix(in srgb, var(--field-surface) 38%, transparent); }
.workspace-rail {
  background: color-mix(in srgb, var(--ink) 87%, transparent);
  border-right-color: #ffffff16;
  backdrop-filter: blur(24px);
}
input, select { background: var(--field-surface); border-color: var(--field-border); box-shadow: none; }
#login button, #save, #start {
  background: var(--accent);
  color: #211a15;
  border-color: var(--edge);
  border-radius: 10px;
  box-shadow: none;
}
.workspace-rail button[aria-current] {
  background: #ffffff0c;
  border-color: #ffffff26;
  box-shadow: none;
  color: var(--accent);
}
#workspace .profile h2, .eyebrow { color: var(--accent); }
@media (prefers-reduced-transparency: reduce) {
  header, .access, .workspace-rail, #workspace > .task-panel, #workspace .profile {
    background: var(--panel);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (forced-colors: none) {
  #login-form input { background: var(--field-surface); }
  #login-form input:is(:autofill, :-webkit-autofill) {
    box-shadow: inset 0 0 0 100vmax var(--field-surface);
    color: var(--text);
    -webkit-text-fill-color: var(--text);
    caret-color: var(--text);
  }
}
@supports (appearance: base-select) and selector(::picker(select)) {
  select, ::picker(select) { appearance: base-select; }
  select { align-items: center; cursor: pointer; }
  select:disabled { cursor: default; }
  select::picker-icon { color: var(--accent); }
  ::picker(select) {
    margin-block: .25rem;
    padding: .25rem;
    border: 1px solid var(--field-border);
    border-radius: .8rem;
    background: linear-gradient(155deg, #252426, var(--field-surface) 65%);
    color: var(--text);
    box-shadow: 0 .5rem 1.25rem #0005;
  }
  select option {
    padding: .55rem .75rem;
    border-radius: .5rem;
    background: transparent;
    color: var(--text);
  }
  select option:checked { background: #ffffff12; color: var(--text); }
  select option::checkmark { color: var(--accent); }
  select option:is(:hover, :focus-visible) {
    background: #ffffff1c;
    outline: 1px solid var(--accent);
    outline-offset: -1px;
  }
}
@keyframes pane-arrive {
  from { opacity: .55; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes surface-reveal {
  from { opacity: .62; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: no-preference) {
  .identity .intro, .access {
    animation: pane-arrive 300ms cubic-bezier(.2,.75,.25,1);
  }
  .workspace-rail, #workspace > .task-panel:not([hidden]) {
    animation: surface-reveal 180ms ease-out;
  }
  #workspace .profile, #console-panel:not([hidden]), #message:not(:empty) {
    animation: pane-arrive 190ms ease-out;
  }
  .profile :is([data-label="TRAILING_STEPS"], [data-label="MAX_TAKE_PROFIT"]):not([hidden]) {
    animation: surface-reveal 150ms ease-out;
  }
  button {
    transition: transform 120ms ease-out, filter 140ms ease,
      border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
  }
  button:enabled:active { transform: translateY(1px); }
  @supports (appearance: base-select) and selector(::picker(select)) {
    select:open::picker(select) { animation: surface-reveal 140ms ease-out; }
    select::picker-icon { transition: rotate 140ms ease-out; }
    select:open::picker-icon { rotate: 180deg; }
  }
}
