/* Trading Dashboard — v2 direction.
   Base stays a dark console (numbers need to read like a terminal), but the
   status language changes: TRADING is vivid solid green (alive, moving),
   STANDBY is a calm outlined green (ready, not asleep — no more amber
   "napping" look), BLOCKED is red, OFFLINE is neutral gray. */

:root {
  color-scheme: dark;
  --bg:        #0a0e15;
  --panel:     #121826;
  --panel-2:   #161d2e;
  --line:      #232d40;
  --line-soft: #1a2233;
  --txt:       #e8edf6;
  --txt-dim:   #8b98ae;
  --txt-faint: #576079;

  --trading:   #2be08a;   /* vivid green — actively trading now */
  --trading-glow: #2be08a55;
  --standby:   #4fd1c5;   /* calm teal-green — authorized, ready, waiting */
  --standby-bg: #10302c;
  --blocked:   #ff5c6c;
  --blocked-bg:#331519;
  --offline:   #576079;
  --offline-bg:#1a2233;
  --closed:    #a78bfa;   /* market closed — distinct purple, not an error state */
  --backtest:  #ff8a1f;   /* bright orange — running in the Strategy Tester, not live */
  --backtest-bg: #3a2410;
  --closed-bg: #241a3a;
  --up:        #2fe0a0;
  --down:      #ff6b7a;
  --radius:    14px;
  --body-bg-image: radial-gradient(1200px 600px at 80% -10%, #16203300, #0a0e15 60%);
  --sunken:    #0e1420;   /* input fields, stat cards */
  --hover:     #1a2436;   /* row/list hover */
  --trading-bg:#0f3324;
  --up-bg:     #0f2318; --up-border: #1c4a30;
  --down-bg:   #2a1418; --down-border: #4a1e28;
  --buy-bg: #10283a; --buy-fg: #57b6f0;
  --sell-bg: #331b28; --sell-fg: #f07db0;
}

[data-theme="light"] {
  color-scheme: light;
  --bg:        #f3f5f9;
  --panel:     #ffffff;
  --panel-2:   #f7f9fc;
  --line:      #dbe1ec;
  --line-soft: #e8ecf3;
  --txt:       #182135;
  --txt-dim:   #4d5877;
  --txt-faint: #8992a8;

  --trading:   #0f9d63;
  --trading-glow: #0f9d6333;
  --standby:   #0d8f86;
  --standby-bg: #e2f6f3;
  --blocked:   #d92d3f;
  --blocked-bg:#fce6e8;
  --offline:   #97a1b5;
  --offline-bg:#eef1f6;
  --closed:    #7c4fd6;
  --backtest:  #d9660a;
  --backtest-bg: #f7e4d0;
  --closed-bg: #efe7fb;
  --up:        #0f9d63;
  --down:      #d92d3f;
  --body-bg-image: radial-gradient(1200px 600px at 80% -10%, #ffffff00, #f3f5f9 60%);
  --sunken:    #eef1f7;
  --hover:     #e6eaf2;
  --trading-bg:#dcf6ea;
  --up-bg:     #e3f8ee; --up-border: #b8ead2;
  --down-bg:   #fbe7e9; --down-border: #f2bcc2;
  --buy-bg: #dbeeff; --buy-fg: #0d6fc4;
  --sell-bg: #fde3ee; --sell-fg: #c23a80;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* Full-viewport sizes have to be divided by the UI zoom factor: a zoomed root
   scales these lengths too, so a plain 100dvh at 90% only reaches 90% of the
   screen and leaves a blank strip along the bottom. Dividing first means the
   scaled result lands exactly on the real viewport, while every other element
   still shrinks normally. */
:root { --ui-zoom: 1; --vh100: calc(100dvh / var(--ui-zoom, 1)); --vw100: calc(100vw / var(--ui-zoom, 1)); }
/* Repaint isolation for the regions that update on a timer (clock, ping,
   latency, balances). Without this a one-character text change can invalidate
   a much larger area — especially inside a CSS-zoomed root, where the browser
   tends to repaint the whole zoomed layer. `contain: content` tells it the
   damage can't escape these boxes. */
/* `paint` only, not `content`: layout containment would make these elements
   containing blocks and could interfere with the sticky mobile header, while
   paint containment alone is enough to stop the damage escaping. */
/* .mapwrap is deliberately NOT contained: paint containment around Leaflet's
   transformed tile layers made mobile browsers render the map as a grid of
   grey squares. */
.fleet, .detail { contain: paint; }
html { height: 100%; height: var(--vh100); background: var(--bg); }
/* iOS Safari has ignored user-scalable=no since iOS 10, so the viewport meta
   tag alone doesn't stop pinch-zoom — restricting touch-action to panning is
   what actually keeps this feeling like an app rather than a web page. */
html, body { touch-action: pan-x pan-y; }
body.modal-open { overflow: hidden; position: fixed; width: 100%; }
.hidden { display: none !important; }

body {
  background: var(--body-bg-image), var(--bg);
  color: var(--txt);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  min-height: var(--vh100);
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation; /* removes the classic ~300ms mobile tap delay */
  /* A long press on touch devices normally selects text and/or opens the
     native "Copy / Look Up" callout — over a status chip or an uptime bar
     that's just noise, not a useful action. Disabled dashboard-wide; any
     element that DOES want to be selectable (EA IDs, backup codes, 2FA
     manual-entry keys) already carries its own `user-select: all/text`
     class, which is more specific than this element selector and wins. */
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
}
/* Actual text-entry fields must stay normally selectable/editable — the
   dashboard-wide disable above is for read-only chrome, not for typing. */
input, textarea { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }

/* Floating touch-hold tooltip (see the touchstart handler in app.js) —
   mirrors what a mouse :hover + native title would show on desktop. */
.touch-tip {
  position: fixed; z-index: 100000; max-width: 220px;
  background: var(--txt); color: var(--bg);
  font-size: 11.5px; line-height: 1.35; padding: 7px 10px; border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.22);
  opacity: 0; transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  pointer-events: none;
}
.touch-tip.show { opacity: 1; transform: translateY(0); }

/* Account warnings banner: red, sits above everything else on the account
   page. Deliberately not a dismissible toast — it should keep showing on
   every visit until the underlying issue (not authorized, disabled, algo
   off, wrong timeframe...) is actually fixed. */
.account-warn-banner {
  display: flex; gap: 10px; align-items: flex-start;
  background: color-mix(in srgb, var(--blocked) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--blocked) 35%, transparent);
  color: var(--blocked); border-radius: 10px; padding: 12px 14px; margin-bottom: 16px;
}
.account-warn-banner svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.account-warn-lines { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; line-height: 1.4; }
.account-warn-lines b { font-weight: 700; }

/* Belt-and-braces against the iOS status-bar blur: an opaque strip pinned over
   the safe-area inset. With apple-mobile-web-app-status-bar-style="black" the
   inset resolves to 0 and this is a no-op, but if a future iOS reinstates the
   translucent behaviour the page content still can't end up smeared under the
   system blur. */
.safe-top-cover {
  position: fixed; top: 0; left: 0; right: 0;
  height: env(safe-area-inset-top, 0px);
  background: var(--bg); z-index: 9999; pointer-events: none;
}

/* Account status beside the account name in the panel header. */
.title-row .title-status { margin-left: 2px; align-self: center; }
.title-row .solo-gear { margin-left: auto; }

/* Version too old for this dashboard: amber, not red — it still runs, it
   just needs recompiling. */
.ver-outdated.ver-update {
  color: #e0a010; border-color: color-mix(in srgb, #e0a010 45%, transparent);
}
.ea-sub-upd {
  flex-shrink: 0; font-family: 'JetBrains Mono', monospace; font-size: 8.5px; font-weight: 700;
  letter-spacing: 0.04em; color: #e0a010; padding: 1px 4px; border-radius: 4px; line-height: 1.4;
  border: 1px solid color-mix(in srgb, #e0a010 45%, transparent);
  background: color-mix(in srgb, #e0a010 10%, transparent);
}

/* ---- Switch: a checkbox drawn as an on/off pill (notification settings) ---- */
input[type=checkbox].switch {
  appearance: none; -webkit-appearance: none; margin: 0; flex-shrink: 0; cursor: pointer;
  width: 36px; height: 21px; border-radius: 999px; position: relative;
  background: var(--line); border: none; transition: background 0.15s ease;
  touch-action: manipulation;
}
input[type=checkbox].switch::after {
  content: ''; position: absolute; top: 2.5px; left: 2.5px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.25); transition: transform 0.15s ease;
}
input[type=checkbox].switch:checked { background: var(--trading); }
input[type=checkbox].switch:checked::after { transform: translateX(15px); }
input[type=checkbox].switch:disabled { opacity: 0.5; cursor: default; }
input[type=checkbox].switch:focus-visible { outline: 2px solid var(--standby); outline-offset: 2px; }

/* ---- Profile notifications card (Settings → This Account) ---- */
.push-card {
  border: 1px solid var(--line-soft); border-radius: 12px; background: var(--sunken);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 12px;
}
.push-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.push-card-title { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 700; color: var(--txt); }
.push-card-title svg { width: 18px; height: 18px; color: var(--txt-dim); }
.push-pill {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 3px 8px; border-radius: 999px; color: var(--txt-faint); background: var(--panel); border: 1px solid var(--line-soft);
}
.push-pill.on { color: var(--trading); border-color: color-mix(in srgb, var(--trading) 40%, transparent); background: color-mix(in srgb, var(--trading) 10%, transparent); }
.push-pill.warn { color: #e0a010; border-color: color-mix(in srgb, #e0a010 40%, transparent); }
.push-card-note { font-size: 11.5px; color: var(--txt-faint); margin: -4px 0 0; }
.push-type-list { display: flex; flex-direction: column; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--panel); overflow: hidden; }
.push-type-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 14px; cursor: pointer; }
.push-type-row + .push-type-row { border-top: 1px solid var(--line-soft); }
.push-type-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.push-type-text b { font-size: 13px; font-weight: 600; color: var(--txt); }
.push-type-text small { font-size: 11px; color: var(--txt-faint); line-height: 1.35; }
.push-card-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.push-test-msg { font-size: 11.5px; color: var(--txt-faint); }

/* ---- Admin Notifications tab: one card per concern ---- */
.notif-admin { display: flex; flex-direction: column; gap: 14px; }
.na-card { border: 1px solid var(--line-soft); border-radius: 12px; background: var(--sunken); padding: 16px 18px; }
.na-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.na-card-head h4 { font-size: 14px; font-weight: 700; color: var(--txt); margin: 0; display: inline-flex; align-items: center; gap: 9px; }
.na-card-head h4 svg { width: 18px; height: 18px; color: var(--txt-dim); }
.na-card-sub { font-size: 11px; color: var(--txt-faint); }
.na-card .field-hint { margin-top: 10px; }
.na-card .field-row + .field-row { margin-top: 12px; }
.na-time-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.na-time-row input[type=time] { width: 130px; }
/* Recipients: a light grid (profile | three switches) instead of a table. */
.na-grid { border: 1px solid var(--line-soft); border-radius: 10px; background: var(--panel); overflow: hidden; }
.na-grid-row { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 76px); align-items: center; gap: 8px; padding: 10px 14px; }
.na-grid-row + .na-grid-row { border-top: 1px solid var(--line-soft); }
.na-grid-head { padding-top: 8px; padding-bottom: 8px; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--txt-faint); }
.na-grid-head span:not(:first-child), .na-cell { text-align: center; display: flex; justify-content: center; }
.na-user { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; min-width: 0; }
.na-user b { font-size: 13px; font-weight: 600; color: var(--txt); }
.na-user small { flex-basis: 100%; font-size: 11px; color: var(--txt-faint); }
.na-user small.none { color: #e0a010; }
@media (max-width: 600px) {
  .na-grid-row { grid-template-columns: minmax(0, 1fr) repeat(3, 54px); gap: 4px; padding: 10px 10px; }
  .na-grid-head { font-size: 8.5px; letter-spacing: 0.03em; }
  .na-card { padding: 14px; }
}
/* Devices: one list, a small header row per profile, its devices under it. */
.na-dev-list { border: 1px solid var(--line-soft); border-radius: 10px; background: var(--panel); overflow: hidden; }
.na-dev-owner {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px;
  background: color-mix(in srgb, var(--sunken) 60%, var(--panel)); border-bottom: 1px solid var(--line-soft);
}
.na-dev-owner:not(:first-child) { border-top: 1px solid var(--line-soft); }
.na-dev-owner b { font-size: 12.5px; font-weight: 700; color: var(--txt); }
.na-dev-owner small { font-size: 11px; color: var(--txt-faint); margin-left: auto; }
.um-avatar.sm { width: 22px; height: 22px; font-size: 10.5px; }
.na-device { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.na-device + .na-device { border-top: 1px solid var(--line-soft); }
.na-device.off .na-device-text, .na-device.off .na-device-ic { opacity: 0.5; }
.na-device-ic { display: inline-flex; color: var(--txt-dim); flex-shrink: 0; }
.na-device-ic svg { width: 18px; height: 18px; }
.na-device-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1 1 auto; }
.na-device-text b { font-size: 13px; font-weight: 600; color: var(--txt); }
.na-device-text small { font-size: 11px; color: var(--txt-faint); overflow-wrap: anywhere; }
.na-device-ctl { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; }
.na-dev-x {
  background: none; border: none; color: var(--txt-faint); flex-shrink: 0;
  font-size: 17px; line-height: 1; cursor: pointer; padding: 4px 7px; border-radius: 6px;
}
.na-dev-x:hover { color: var(--blocked); background: var(--hover); }
/* Test: recipients as selectable chips. */
#na-title, #na-body { width: 100%; box-sizing: border-box; }
.na-to-head { display: flex; align-items: center; justify-content: space-between; }
.na-link {
  background: none; border: none; padding: 2px 0; cursor: pointer;
  font: inherit; font-size: 11.5px; color: var(--standby);
}
.na-link:hover { text-decoration: underline; }
.na-recipients { display: flex; flex-wrap: wrap; gap: 8px; }
.field-row label.na-chip {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 7px 12px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--panel); color: var(--txt);
  font-size: 12.5px; text-transform: none; letter-spacing: 0;
  transition: border-color 0.12s ease, background 0.12s ease;
  touch-action: manipulation;
}
.na-chip input { margin: 0; accent-color: var(--standby); }
.na-chip-name { font-weight: 600; }
.na-chip-sub { font-size: 11px; color: var(--txt-faint); }
.field-row label.na-chip:has(input:checked) {
  border-color: var(--standby);
  background: color-mix(in srgb, var(--standby) 10%, var(--panel));
}
.na-send-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.na-send-row .btn { padding: 9px 16px; font-size: 12.5px; font-weight: 600; }

/* ---- login screen ---- */
.login-screen {
  min-height: var(--vh100); display: flex; align-items: center; justify-content: center;
  background: var(--body-bg-image), var(--bg); overflow: hidden;
}
.login-card {
  width: 340px; background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 28px;
  display: flex; flex-direction: column; gap: 14px;
}
.login-brand { display: flex; align-items: center; gap: 10px; }
.login-brand h1 { font-size: 18px; font-weight: 700; }
.login-sub { font-size: 12px; color: var(--txt-faint); margin-top: -8px; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--txt-dim); }
.login-card input {
  background: var(--sunken); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px;
  color: var(--txt); font-family: 'Space Grotesk'; font-size: 14px;
}
.login-card input:focus { outline: none; border-color: var(--standby); }
.login-card button {
  margin-top: 4px; background: var(--standby); color: #04211c; border: none;
  border-radius: 8px; padding: 10px; font-weight: 700; font-size: 14px; cursor: pointer;
}
.login-error { color: var(--blocked); font-size: 12px; min-height: 14px; }
/* Staged login: "Signing in as X · not you?" row, then the method choice. */
.login-as-row {
  font-size: 12.5px; color: var(--txt-faint); text-align: center;
  padding: 9px 12px; border-radius: 8px; background: var(--sunken);
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
}
.login-as-row b { color: var(--txt); font-weight: 700; }
#login-step-username, #login-step-password { display: flex; flex-direction: column; gap: 10px; }
#login-step-method { display: flex; flex-direction: column; gap: 14px; }

/* Biometric option: a proper two-line card (icon + title + supported methods)
   rather than a cramped single-line button — it's the primary action on this
   step, so it gets the room to look like one. */
.btn-passkey {
  margin-top: 2px !important; padding: 13px 14px !important;
  background: var(--sunken) !important; color: var(--txt) !important;
  border: 1px solid var(--line) !important; border-radius: 10px;
  font-weight: 600 !important; font-size: 13px !important; cursor: pointer;
  display: flex !important; align-items: center; justify-content: flex-start; gap: 12px;
  text-align: left; transition: border-color 0.15s, background 0.15s;
}
.btn-passkey:hover {
  background: var(--hover) !important;
  border-color: color-mix(in srgb, var(--standby) 55%, transparent) !important;
}
.btn-passkey-ic {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 34px; height: 34px; border-radius: 9px;
  background: color-mix(in srgb, var(--standby) 16%, transparent); color: var(--standby);
}
.btn-passkey-ic svg { width: 19px; height: 19px; }
.btn-passkey-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.btn-passkey-title { font-size: 13.5px; font-weight: 700; color: var(--txt); }
.btn-passkey-sub { font-size: 10.5px; font-weight: 500; color: var(--txt-faint); letter-spacing: 0.01em; }

/* "or" divider between the two sign-in methods. */
.login-or { display: flex; align-items: center; gap: 10px; color: var(--txt-faint); font-size: 11px; }
.login-or::before, .login-or::after { content: ''; flex: 1; height: 1px; background: var(--line-soft); }

/* Password path on the choice step: clearly secondary to the biometric card. */
.btn-secondary {
  margin-top: 0 !important; background: none !important; color: var(--txt-dim) !important;
  border: 1px solid var(--line) !important; border-radius: 9px; padding: 10px !important;
  font-weight: 600 !important; font-size: 13px !important; cursor: pointer;
}
.btn-secondary:hover { background: var(--hover) !important; color: var(--txt) !important; }

.brand-icon { width: 34px; height: 34px; color: var(--trading); flex-shrink: 0; }
.brand-icon svg { width: 100%; height: 100%; }

/* ---- app shell ---- */
#app { max-width: 1560px; margin: 0 auto; padding: 22px; display: flex; flex-direction: column; min-height: var(--vh100); }

.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 6px 4px 22px; border-bottom: 1px solid var(--line-soft); }
/* Layout-transparent on desktop: brand and the right-hand controls behave as
   direct flex children of .topbar exactly as before. The wrapper only becomes
   a real box on mobile, where it's what gets pinned to the top. */
.topbar-main { display: contents; }
.brand { order: 1; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-line1 { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; color: var(--txt-faint); text-transform: uppercase; }
.brand-line2 { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }

.topstats { display: flex; align-items: center; gap: 18px; margin: 0 auto; order: 2; }
/* Appears when the account list is hidden (classic stats fallback) — eased in
   so it doesn't pop. */
#topstats:not(.hidden) .topstat-pills { animation: statsIn 0.26s ease both; }
@keyframes statsIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  #topstats:not(.hidden) .topstat-pills { animation: none; }
}
.topstat-pills { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 12px; background: var(--sunken); border: 1px solid var(--line-soft); }
.topstat {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 12px; border-radius: 9px;
  background: transparent; border: 1px solid transparent;
  transition: background 0.15s, opacity 0.15s;
}
.topstat-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.topstat .v { font-family: 'JetBrains Mono', monospace; font-size: 15px; font-weight: 700; line-height: 1; }
.topstat .l { font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--txt-faint); white-space: nowrap; }
/* Colour only the dot + number; label stays neutral for readability. */
.topstat.trading { color: var(--trading); }
.topstat.standby { color: var(--standby); }
.topstat.blocked { color: var(--blocked); }
.topstat.offline { color: var(--offline); }
.topstat.closed  { color: var(--closed); }
/* Non-zero statuses get only a subtle tinted fill — no border — so the row
   reads as one calm control rather than five competing chips. */
.topstat.trading:not(.is-zero) { background: color-mix(in srgb, var(--trading) 12%, transparent); }
.topstat.standby:not(.is-zero) { background: color-mix(in srgb, var(--standby) 12%, transparent); }
.topstat.blocked:not(.is-zero) { background: color-mix(in srgb, var(--blocked) 12%, transparent); }
.topstat.closed:not(.is-zero)  { background: color-mix(in srgb, var(--closed) 12%, transparent); }
/* A zero count is de-emphasised — no fill, dimmed number, so the eye lands on
   the statuses that actually have EAs. */
.topstat.is-zero { opacity: 0.45; }
.topstat.is-zero .v { color: var(--txt-faint); }
.topstat.is-zero .topstat-dot { background: var(--txt-faint); }
/* Fleet-health mini bar */
.topstat-health { display: flex; flex-direction: column; gap: 4px; min-width: 92px; }
/* Fleet-panel footer holds the online/total bar on desktop. */
.fleet-footer { padding: 12px 14px 12px; margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fleet-footer:empty { display: none; }
.fleet-footer .topstat-health { min-width: 0; flex: 1 1 auto; }
.fleet-footer .topstat-health-lbl { text-align: left; }
/* Minimal fleet stats: one compact line, non-zero statuses only, sharing the
   footer row with the expand/collapse control — never wrapping to a second
   line, hence the small type and nowrap. */
.ministats { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; overflow: hidden; white-space: nowrap; }
.ministat { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; color: var(--txt-dim); }
.ministat i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.ministat.trading { color: var(--trading); }
.ministat.standby { color: var(--standby); }
.ministat.closed  { color: var(--closed); }
.ministat.blocked { color: var(--blocked); }
.ministat.offline { color: var(--offline); }
.fleet-footer-min { align-items: center; gap: 8px; }
@media (max-width: 600px) {
  /* The footer carries the stats in minimal mode, so it must stay visible. */
  .fleet-footer.fleet-footer-min { display: flex; }
  .ministats { gap: 7px; }
  .ministat { font-size: 9.5px; }
  .fleet-footer-min .fleet-toggle-all { padding: 6px 9px; font-size: 9.5px; }
}
.fleet-toggle-all {
  display: flex; align-items: center; gap: 7px; flex-shrink: 0;
  padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line-soft);
  background: var(--sunken); color: var(--txt-dim); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  cursor: pointer; touch-action: manipulation; white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.fleet-toggle-all:hover {
  background: color-mix(in srgb, var(--trading) 12%, var(--sunken));
  color: var(--trading); border-color: color-mix(in srgb, var(--trading) 40%, transparent);
}
.fleet-toggle-all:active { box-shadow: inset 0 1px 3px rgba(0,0,0,0.15); }
.fleet-toggle-all .chevrons { width: 12px; height: 12px; flex-shrink: 0; transition: transform 0.25s ease; }
.fleet-toggle-all.all-expanded .chevrons { transform: rotate(180deg); }
/* The header keeps a copy only on mobile; hidden on desktop. */
.topstat-health-mobile { display: none; }
.topstat-health-bar { height: 5px; border-radius: 3px; background: var(--sunken); overflow: hidden; border: 1px solid var(--line-soft); }
.topstat-health-bar > span { display: block; height: 100%; background: var(--trading); border-radius: 3px; transition: width 0.4s ease; }
.topstat-health-lbl { font-size: 9px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--txt-faint); font-family: 'JetBrains Mono', monospace; text-align: right; }

.topbar-right { display: flex; align-items: center; gap: 16px; padding-left: 20px; border-left: 1px solid var(--line-soft); order: 3; margin-left: auto; flex-shrink: 0; }
/* Signed-in user chip in the desktop topbar. Sits clearly apart from the icon
   row via its own gap; hidden on mobile, where the same info lives in the
   dropdown menu (.user-menu-who). */
.topbar-user { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--txt-dim); white-space: nowrap; padding-right: 4px; }
.topbar-user svg { width: 16px; height: 16px; opacity: 0.6; flex-shrink: 0; }
.topbar-user.hidden { display: none; }
.clock { text-align: left; display: flex; flex-direction: column; line-height: 1.35; gap: 2px; }
.clock #clock { font-family: 'JetBrains Mono', monospace; font-size: 14px; color: var(--txt-dim); font-weight: 600; }
.clock #clock-tz { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--txt-faint); }
.icon-btn {
  background: none; border: 1px solid var(--line); border-radius: 8px; width: 34px; height: 34px;
  cursor: pointer; font-size: 15px; touch-action: manipulation; color: var(--txt);
}

.menu-wrap { position: relative; }
.user-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 9000;
  background: linear-gradient(180deg, var(--panel), var(--panel-2)); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px; min-width: 220px; box-shadow: 0 10px 30px #000a;
  display: flex; flex-direction: column; gap: 4px;
}
.user-menu-who { font-size: 11px; color: var(--txt-faint); padding: 6px 8px 8px; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
.user-menu-who b { color: var(--txt-dim); font-weight: 600; }
.user-menu-item {
  background: none; border: none; color: var(--txt); text-align: left; font-family: 'Space Grotesk';
  font-size: 13px; padding: 8px; border-radius: 6px; cursor: pointer; touch-action: manipulation;
  display: flex; align-items: center; gap: 10px;
}
.menu-icon { width: 17px; height: 17px; flex-shrink: 0; }
.user-menu-item:hover { background: var(--hover); }
[hidden] { display: none !important; }
.theme-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px; }
.theme-row-label { font-size: 11px; color: var(--txt-faint); flex-shrink: 0; }
.theme-switch { display: inline-flex; width: fit-content; gap: 2px; background: var(--sunken); border-radius: 8px; padding: 2px; }
.tz-select {
  background: var(--sunken); border: 1px solid var(--line); color: var(--txt); font-family: 'Space Grotesk';
  font-size: 11px; padding: 5px 6px; border-radius: 6px; width: 100%; max-width: 280px; min-width: 0; color-scheme: dark; cursor: pointer;
}
[data-theme="light"] .tz-select { color-scheme: light; }
.theme-switch button {
  background: none; border: none; color: var(--txt-faint); font-size: 13px; padding: 5px 8px;
  border-radius: 6px; cursor: pointer; touch-action: manipulation;
}
.theme-switch button.on { background: var(--panel-2); color: var(--txt); }
/* Display-size stepper: −/+ in 1% steps with the current value between them. */
.zoom-control { display: inline-flex; align-items: center; gap: 6px; }
.zoom-btn {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: 8px;
  background: var(--sunken); border: 1px solid var(--line); color: var(--txt-dim);
  font-size: 15px; font-weight: 700; line-height: 1; cursor: pointer;
  touch-action: manipulation; user-select: none;
}
.zoom-btn:hover { background: var(--hover); color: var(--txt); }
.zoom-btn:active { background: var(--panel-2); }
.zoom-value {
  min-width: 52px; text-align: center;
  font-family: 'JetBrains Mono', monospace; font-size: 12.5px; font-weight: 600; color: var(--txt);
}
.zoom-reset { margin-left: 4px; }
/* Dev mode I/O switch — same segmented shape as the theme picker, but the
   selected side is unmistakable: green when on, a heavier neutral chip when
   off (rather than a faint label that reads as "nothing is selected"). */
.io-switch { display: inline-flex; width: fit-content; gap: 2px; background: var(--sunken); border-radius: 8px; padding: 2px; }
.io-switch button {
  background: none; border: none; color: var(--txt-faint);
  font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700;
  min-width: 30px; padding: 5px 10px; border-radius: 6px; cursor: pointer;
  touch-action: manipulation; transition: background 0.15s, color 0.15s;
}
.io-switch button.on {
  background: color-mix(in srgb, var(--trading) 22%, var(--panel-2));
  color: var(--trading);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--trading) 45%, transparent);
}
.io-switch button.off { background: var(--panel-2); color: var(--txt); box-shadow: inset 0 0 0 1px var(--line); }
.user-menu-version {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  font-size: 10px; color: var(--txt-faint); padding: 6px 8px 2px;
  border-top: 1px solid var(--line-soft); margin-top: 4px; font-family: 'JetBrains Mono', monospace;
}
.menu-clock-wrap { white-space: nowrap; }
.menu-clock-wrap #menu-clock-tz { opacity: .75; }
/* Desktop already shows a clock in the header — the one inside the dropdown
   would just repeat it. Mobile hides the header clock instead (see the
   max-width:600px rule further down) and needs this one, so it's untouched. */
@media (min-width: 601px) {
  .menu-clock-wrap { display: none; }
  .user-menu-version { justify-content: flex-end; }
  #btn-menu { display: none; }
  .menu-wrap { position: static; }
  #user-menu {
    position: static; display: flex !important; flex-direction: row; align-items: center; gap: 6px;
    background: none; border: none; border-radius: 0; padding: 0; min-width: 0; box-shadow: none;
  }
  .user-menu-who { display: none; }
  .user-menu-version { display: none; }
  .user-menu-item {
    width: 34px; height: 34px; padding: 0; justify-content: center; border-radius: 8px;
    color: var(--txt-dim);
  }
  .user-menu-item:hover { background: var(--hover); color: var(--txt); }
  .menu-label { display: none; }
  .topbar-divider { width: 1px; align-self: stretch; margin: 2px 10px; background: var(--line-soft); }
}
@media (max-width: 600px) {
  .topbar-divider { display: none; }
}

/* ---- layout ---- */
.layout {
  display: grid; grid-template-columns: 392px 1fr; grid-template-rows: auto 1fr;
  grid-template-areas: "fleet detail" "fleet map"; gap: 16px; margin-top: 18px; flex: 1;
  align-items: stretch;
  /* Animate the column width so hiding/showing the account list glides rather
     than snapping. Only the track width transitions; the panel's own contents
     fade separately below. */
  transition: grid-template-columns 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
@media (prefers-reduced-motion: reduce) {
  .layout { transition: none; }
}
/* Sticky, and sized to the space actually left below the top bar so the panel
   is never cut off at the bottom of the screen; its list scrolls internally.
   `align-self: start` is required — a stretched grid item fills its whole
   grid area and then has no travel left to stick with. */
.fleet  {
  grid-area: fleet; align-self: start;
  display: flex; flex-direction: column; min-height: 0;
  /* Sizes to its own content, capped to the viewport. A forced full-viewport
     height left a tall empty panel running past the end of the page (well
     below the map) whenever there were only a few accounts. */
  height: auto; max-height: calc(var(--vh100) - 24px);
  position: sticky; top: 12px;
}
.fleet > .panel-head { flex: 0 0 auto; }
.detail { grid-area: detail; min-height: 380px; overflow: visible; }
.mapwrap{ grid-area: map; display: flex; flex-direction: column; min-height: 0; align-self: start; }
/* Fixed, compact height: just enough to place the markers. It used to grow
   to fill whatever space the grid row had, which left a huge empty map. */
.mapwrap #map { flex: 0 0 auto; height: 260px; min-height: 0; }
.layout.no-selection {
  grid-template-areas: "fleet map";
  grid-template-rows: 1fr;
}
.layout.no-selection .detail { display: none; }
/* Nothing selected: the map is the only content, so it may take more room —
   still capped rather than unbounded. */
.layout.no-selection .mapwrap #map { height: 420px; min-height: 0; }
/* Solo view (1 account, 1 EA — nothing to pick from): the sidebar would just
   duplicate the merged account+EA header above the stats, so it's dropped
   entirely and the detail/map column takes the full page width. */
.layout.solo-view {
  grid-template-columns: 1fr;
  grid-template-areas: "detail" "map";
}
.layout.solo-view .fleet { display: none; }
/* Safety net for the same case: if both classes ever land together, the
   layout must still be a single full-width column, not a 40px dead gutter. */
.layout.solo-view.fleet-collapsed { grid-template-columns: 1fr; }
/* Collapsed sidebar: the panel's chrome disappears and only a small round
   button remains. The column keeps a narrow width on purpose — .fleet uses
   `contain: paint`, so anything overflowing a zero-width column gets clipped
   and stops receiving clicks, which would leave no way to reopen the list. */
.layout.fleet-collapsed { grid-template-columns: 40px 1fr; }
.layout.fleet-collapsed .fleet {
  background: none; border: none; box-shadow: none;
  height: auto; max-height: none; overflow: visible;
}
/* Fade the panel's contents out as the column closes (and in as it opens),
   instead of them disappearing the instant the class flips. */
.fleet > .bot-list, .fleet > .fleet-footer, .fleet #fleet-title, .fleet #fleet-count {
  transition: opacity 0.2s ease;
}
.layout.fleet-collapsed .fleet > .bot-list,
.layout.fleet-collapsed .fleet > .fleet-footer,
.layout.fleet-collapsed .fleet #fleet-title,
.layout.fleet-collapsed .fleet #fleet-count { display: none; }
.layout.fleet-collapsed .fleet > .panel-head {
  padding: 0; border: none; background: none; justify-content: flex-start;
}
.layout.fleet-collapsed .fleet-collapse-btn {
  width: 36px; height: 36px; margin: 0; border-radius: 50%;
  background: var(--panel); border: 1px solid var(--line);
  box-shadow: 0 1px 4px rgba(0,0,0,0.10);
}
.layout.fleet-collapsed .fleet-collapse-btn:hover { background: var(--hover); color: var(--txt); }
.fleet-collapse-btn {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; flex-shrink: 0; margin-left: 8px;
  background: none; border: none; border-radius: 7px;
  color: var(--txt-faint); cursor: pointer; transition: color 0.15s, background 0.15s;
}
.fleet-collapse-btn:hover { background: var(--hover); color: var(--txt); }
.fleet-collapse-btn svg { width: 16px; height: 16px; transition: transform 0.2s ease; }
.fleet-collapse-btn.is-collapsed svg { transform: rotate(180deg); }
/* No room for it on a phone, where the panel stacks above the detail anyway. */
@media (max-width: 980px) { .fleet-collapse-btn { display: none; } }

.panel { background: linear-gradient(180deg, var(--panel), var(--panel-2)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--line-soft); }
.panel-head h2 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--txt-dim); font-weight: 600; }
/* "Locate me" button in the map header — centres the map on the device's
   IP-derived location. */
.map-locate-btn {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; border-radius: 8px;
  background: none; border: none; color: var(--txt-dim);
  cursor: pointer; touch-action: manipulation; transition: color 0.15s;
}
.map-locate-btn:hover { color: var(--trading); }
.map-locate-btn svg { width: 16px; height: 16px; }
.map-locate-btn.busy { opacity: 0.5; pointer-events: none; }
.counter { display: inline-flex; align-items: center; gap: 12px; }
.count-pair { display: inline-flex; align-items: baseline; gap: 4px; }
.count-pair b {
  font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 700; color: var(--txt-dim);
}
.count-pair i {
  font-style: normal; font-size: 9.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--txt-faint);
}

/* ---- account/bot list ---- */
/* Trailing space roughly one row tall, so the last account/EA never sits
   flush against the footer strip below it. */
.bot-list { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-bottom: 12px; }
.empty-fleet { padding: 40px 22px; text-align: center; color: var(--txt-faint); font-size: 13px; }
.empty-fleet .hint { margin-top: 10px; line-height: 1.6; font-size: 12px; }

.account-group { border-bottom: 1px solid var(--line-soft); }
.account-head {
  display: flex; align-items: center; gap: 10px; padding: 13px 18px; cursor: pointer;
  transition: background .15s;
}
.account-head:hover { background: var(--hover); }
.account-head.active { background: var(--hover); box-shadow: inset 3px 0 0 var(--txt-dim); }
.account-head .chev { font-size: 10px; color: var(--txt-faint); transition: transform .15s; }
.account-head.expanded .chev { transform: rotate(90deg); }
/* Account name outranks its EAs typographically, so the hierarchy is obvious
   at a glance (previously both sat at 13px and the EA name looked equal). */
.account-head .acct-name { font-size: 14px; font-weight: 700; flex: 1; }
.account-head .acct-sub { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--txt-faint); }
/* Same status treatment the EA rows use (a coloured bar), instead of a small
   dot in a different shade of green — one visual language for both levels. */
.acct-status-bar { width: 4px; align-self: stretch; min-height: 18px; border-radius: 3px; background: var(--offline); flex-shrink: 0; }
.acct-status-bar.trading { background: var(--trading); }
.acct-status-bar.standby { background: var(--standby); }
.acct-status-bar.closed  { background: var(--closed); }
.acct-status-bar.blocked { background: var(--blocked); }
.acct-status-bar.algo_off { background: var(--blocked); }
.acct-status-bar.offline { background: var(--line); }
.acct-status-bar.algo_off { background: var(--blocked); }
.acct-status-chip { flex-shrink: 0; }
/* Trial countdown next to the account status. Neutral for most of the trial,
   amber in the last three days, red once it has run out. */
.expiry-badge {
  /* Same typography as the status chip beside it (uppercase, tracked), so the
     two read as a matched pair rather than a lowercase note next to a badge. */
  flex-shrink: 0; font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; line-height: 1.4; padding: 2px 7px; border-radius: 5px;
  color: var(--txt-faint); background: var(--sunken); border: 1px solid var(--line-soft);
  white-space: nowrap;
}
.expiry-badge.soon {
  color: #e0a010;
  border-color: color-mix(in srgb, #e0a010 40%, transparent);
  background: color-mix(in srgb, #e0a010 10%, transparent);
}
.expiry-badge.expired {
  color: var(--blocked);
  border-color: color-mix(in srgb, var(--blocked) 45%, transparent);
  background: color-mix(in srgb, var(--blocked) 12%, transparent);
}
/* EA children under each account: a status dot, the name, and (for admins)
   the symbol. Indented and quieter than the account row so the hierarchy is
   obvious without extra chrome. */
.ea-sub-list { padding: 0 0 6px; }
.ea-sub-row {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  padding: 5px 16px 5px 34px; cursor: pointer; transition: background 0.12s;
}
.ea-sub-row:hover { background: var(--hover); }
.ea-sub-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; background: var(--offline); }
.ea-sub-dot.trading { background: var(--trading); }
.ea-sub-dot.standby { background: var(--standby); }
.ea-sub-dot.closed  { background: var(--closed); }
.ea-sub-dot.blocked, .ea-sub-dot.algo_off { background: var(--blocked); }
.ea-sub-name {
  font-size: 11.5px; color: var(--txt-dim); flex: 0 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Name shrinks to its text so the badge can sit right beside it; the spacer
   then pushes the latency to the right edge, keeping those figures aligned. */
.ea-sub-spacer { flex: 1 1 auto; min-width: 6px; }
.ea-sub-vps {
  flex-shrink: 0; font-family: 'JetBrains Mono', monospace; font-size: 8.5px;
  font-weight: 700; letter-spacing: 0.04em; color: var(--trading);
  border: 1px solid color-mix(in srgb, var(--trading) 40%, transparent);
  background: color-mix(in srgb, var(--trading) 10%, transparent);
  border-radius: 4px; padding: 1px 4px; line-height: 1.4;
}
.ea-sub-meta {
  font-family: 'JetBrains Mono', monospace; font-size: 9.5px; color: var(--txt-faint); flex-shrink: 0;
}

/* A subtle rail down the left edge of the EA list makes the parent/child
   relationship explicit, rather than relying on indentation alone. */
.bot-sub-list { padding: 0 0 6px; position: relative; }
.bot-sub-list::before {
  content: ''; position: absolute; left: 32px; top: 0; bottom: 6px;
  width: 1px; background: var(--line-soft);
}
.bot-row {
  /* Indented past the account's chevron+bar so each EA reads as a child of
     the account above it rather than a sibling. */
  display: grid; grid-template-columns: 4px 1fr auto; gap: 12px; align-items: stretch;
  padding: 10px 18px 10px 52px; cursor: pointer; transition: background 0.15s;
}
.bot-row > .bot-meta, .bot-row > .bot-right { align-self: center; }
.bot-bar { width: 4px; align-self: stretch; min-height: 30px; border-radius: 3px; background: var(--offline); }
.bot-bar.online { background: var(--trading); }
.bot-bar.offline { background: var(--line); }
.bot-row:hover { background: var(--hover); }
.bot-row.active { background: var(--sunken); }
.bot-row.active .name { color: var(--txt); }

.pulse { width: 9px; height: 9px; border-radius: 50%; position: relative; }
.pulse.offline  { background: var(--offline); }
.pulse.closed   { background: var(--closed); }
.pulse.standby { background: var(--standby); box-shadow: 0 0 8px var(--standby); }
.pulse.trading { background: var(--trading); }
.pulse.trading::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--trading); animation: ping 1.5s cubic-bezier(0,0,.2,1) infinite;
}
.pulse.blocked { background: var(--blocked); }
@keyframes ping { 0% { transform: scale(0.7); opacity: 1; } 100% { transform: scale(2.2); opacity: 0; } }

.bot-meta { min-width: 0; }
.bot-meta .name { font-size: 12.5px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bot-meta .sub { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--txt-faint); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bot-right { text-align: right; display: flex; align-items: center; justify-content: flex-end; gap: 5px; flex-shrink: 0; }
.bot-right .chip { white-space: nowrap; }
/* Latency shown in place of a standby badge: plain monospace text, so it
   reads as a measurement rather than a status. */
/* Fixed width + right alignment + tabular figures so "2.04 ms" and
   "42.94 ms" line up down the column instead of drifting, and so the VPS
   chip beside them always starts from the same place. */
.row-latency {
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
  color: var(--txt-faint); white-space: nowrap; letter-spacing: -0.01em;
  min-width: 64px; text-align: right; font-variant-numeric: tabular-nums;
}
.bot-right .bal { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 500; }
.chip { display: inline-block; margin-top: 4px; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; padding: 2px 7px; border-radius: 5px; }
.chip.trading { background: var(--trading-bg); color: var(--trading); }
.chip.standby { background: var(--standby-bg); color: var(--standby); }
.chip.blocked { background: var(--blocked-bg); color: var(--blocked); }
.chip.algo_off { background: var(--blocked-bg); color: var(--blocked); }
.chip.offline { background: var(--offline-bg); color: var(--offline); }
.chip.closed { background: var(--closed-bg); color: var(--closed); }
.chip.backtest { background: var(--backtest-bg); color: var(--backtest); }

/* ---- detail ---- */
.detail-inner { padding: 20px; }
.empty-state { padding: 60px 24px; text-align: center; color: var(--txt-faint); font-size: 14px; }

.detail-head { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--line-soft); position: relative; }
.detail-head .title h3 { font-size: 20px; letter-spacing: -0.02em; }
.detail-head .title { min-width: 0; }
.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
/* The symbol chip belongs beside the EA name, not on its own line. */
.title-row:has(.symbol-chip) { flex-wrap: nowrap; min-width: 0; }
.title-row:has(.symbol-chip) h3 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title-row .symbol-chip { flex: 0 0 auto; margin-left: 6px; }
@media (max-width: 600px) {
  .detail-head .title h3 { font-size: 17px; }
  .title-row { gap: 10px; }
  /* The action buttons are pinned to the right of .detail-head, so the title
     block must stay inside the padding they reserve. */
  .detail-head .title { width: 100%; }
}
.meta-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px; margin-top: 12px; max-width: 480px;
}
.meta-grid.cols3 { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 640px; }
.meta-grid.cols2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* No dividing lines — alignment comes from the grid alone. */
.meta-grid > div {
  display: flex; flex-direction: column; gap: 3px; min-width: 0;
}
.meta-grid .meta-full { grid-column: 1 / -1; flex-direction: row !important; align-items: baseline; gap: 8px !important; }
@media (min-width: 601px) { .meta-grid .meta-full { display: none; } }
.meta-grid label { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--txt-faint); }
.meta-grid span { font-family: 'JetBrains Mono', monospace; font-size: 12.5px; color: var(--txt-dim); overflow-wrap: break-word; }
.meta-grid .ea-name-val { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detail-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.last-ping-inline { font-size: 11px; color: var(--txt-faint); font-family: 'JetBrains Mono', monospace; white-space: nowrap; }
/* The relative-time value updates every second and its width varies wildly
   ("now" vs "10 minutes ago"). Give the value a fixed min-width so the block
   keeps a constant footprint (the action buttons never jump), but left-align
   the text so the value sits right next to its "Last ping:" label rather than
   drifting toward the buttons. */
.last-ping-inline #live-lastping-top { display: inline-block; min-width: 58px; text-align: left; }
.meta-grid .meta-full #live-lastping { display: inline-block; min-width: 96px; text-align: left; }

.status-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 20px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
}
.status-pill.trading { background: var(--trading-bg); color: var(--trading); }
.status-pill.standby { background: var(--standby-bg); color: var(--standby); }
.status-pill.blocked { background: var(--blocked-bg); color: var(--blocked); }
.status-pill.algo_off { background: var(--blocked-bg); color: var(--blocked); }
.status-pill.offline { background: var(--offline-bg); color: var(--offline); }
.status-pill.closed { background: var(--closed-bg); color: var(--closed); }
.status-pill.backtest { background: var(--backtest-bg); color: var(--backtest); }
.status-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.toggle {
  --w: 50px; width: var(--w); height: 27px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--sunken); position: relative; cursor: pointer; transition: background 0.2s, border-color 0.2s;
  touch-action: manipulation;
}
.toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 21px; height: 21px; border-radius: 50%;
  background: var(--txt-dim); transition: transform 0.2s, background 0.2s;
}
.toggle.on { background: var(--trading-bg); border-color: var(--trading); }
.toggle.on::after { transform: translateX(23px); background: var(--trading); }

/* Icon-only affordances: no surrounding box or border, so the params/settings
   glyphs read as icons rather than chunky buttons. */
.gear-btn { background: none; border: none; border-radius: 8px; width: 32px; height: 32px; cursor: pointer; font-size: 13px; color: var(--txt-dim); touch-action: manipulation; transition: color 0.15s; }
.gear-btn:hover { color: var(--txt); }

.stat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin: 20px 0; }
@media (max-width: 1200px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
.stat { background: var(--sunken); border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px 14px; }
.stat .l { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--txt-faint); }
.stat .v { font-family: 'JetBrains Mono', monospace; font-size: 18px; font-weight: 700; margin-top: 5px; }
.v.up { color: var(--up); } .v.down { color: var(--down); }

.chart-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 8px; flex-wrap: wrap; gap: 8px; }
.chart-head .l { color: var(--txt); }
.range-tabs { display: flex; gap: 4px; }
.range-tabs button {
  background: var(--sunken); border: 1px solid var(--line-soft); color: var(--txt-faint);
  font-size: 11px; padding: 4px 11px; border-radius: 7px; cursor: pointer; font-family: 'Space Grotesk';
}
.range-tabs button.on { color: var(--standby); border-color: var(--standby); background: var(--standby-bg); }

/* Compact segmented control — one connected pill group, much smaller footprint
   than the old row of large buttons. */
.analytics-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 10px 0 10px; }
.seg { display: inline-flex; width: fit-content; align-self: flex-start; background: var(--sunken); border: 1px solid var(--line-soft); border-radius: 8px; padding: 2px; gap: 2px; }
.seg button {
  background: none; border: none; color: var(--txt-faint); cursor: pointer; font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 11px; padding: 4px 12px; border-radius: 6px; line-height: 1.2; text-transform: capitalize;
}
.seg button.on { background: var(--standby-bg); color: var(--standby); }
/* Global (shared-by-all-admins) settings tabs use amber rather than the
   default green, so it's obvious at a glance that these panes edit
   everyone's configuration, not just your own. */
/* Account settings tab bar: General plus one tab per EA. Wraps when an
   account runs several EAs rather than squeezing them to nothing. */
.acct-settings-tabs { flex-wrap: wrap; }
.acct-settings-tabs button { white-space: nowrap; }

.settings-tab-seg button.global-tab.on {
  background: color-mix(in srgb, #f5b544 20%, transparent);
  color: #f5b544;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #f5b544 42%, transparent);
}
.seg-sm button { font-size: 10px; padding: 3px 9px; }
.seg-right { display: flex; margin: 0 0 12px auto; width: fit-content; }
.period-label { font-size: 11px; color: var(--txt-faint); font-family: 'JetBrains Mono', monospace; margin-bottom: 6px; }
.info-btn {
  width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line); background: var(--sunken);
  color: var(--txt-dim); font-size: 11px; font-style: italic; font-family: Georgia, serif; cursor: pointer;
  line-height: 1; display: inline-flex; align-items: center; justify-content: center; margin-left: 8px;
}
.info-btn:hover { color: var(--txt); border-color: var(--txt-dim); }
.chart-help { font-size: 10.5px; color: var(--txt-faint); font-family: 'JetBrains Mono', monospace; margin: 2px 0 6px; }
.cal-day.in-window { box-shadow: inset 0 0 0 1px var(--standby); }
.sort-th { cursor: pointer; user-select: none; white-space: nowrap; }
.sort-th:hover { color: var(--txt); }
.sort-ind { color: var(--standby); font-size: 10px; }
#chart, #acct-chart { width: 100%; height: 150px; display: block; cursor: crosshair; }
.upnl { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.upnl-label { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--txt-faint); }
.upnl-value { font-family: 'JetBrains Mono', monospace; font-size: 16px; font-weight: 700; }
.chart-foot { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: space-between; align-items: baseline; margin-top: 6px; }
.chart-hint { font-size: 10px; color: var(--txt-faint); font-family: 'JetBrains Mono', monospace; }
.link-btn { background: none; border: none; color: var(--standby); cursor: pointer; font-size: 10px; font-family: 'JetBrains Mono', monospace; padding: 0; text-decoration: underline; }
.chart-caption { font-size: 10.5px; color: var(--txt-faint); font-family: 'JetBrains Mono', monospace; }

.trades-block { margin-top: 20px; }
.trades { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.trades-block > .trades { margin-top: 0; }
.trades table { width: 100%; min-width: 660px; border-collapse: collapse; font-family: 'JetBrains Mono', monospace; font-size: 11.5px; }
.trades th { text-align: left; font-family: 'Space Grotesk'; font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--txt-faint); padding: 8px 9px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
/* Headers follow their data's alignment: numbers right, side arrow centred. */
.trades th[data-col="open_price"], .trades th[data-col="close_price"],
.trades th[data-col="pips"], .trades th[data-col="mae"],
.trades th[data-col="mfe"], .trades th[data-col="profit"],
.trades th[data-col="volume"] { text-align: right; }
.trades th[data-col="side"], .trades th[data-col="src"], .trades th[data-col="symbol"] { text-align: center; }
.trades td.col-symbol { text-align: center; }
.trades td.profit-cell { text-align: right; font-variant-numeric: tabular-nums; }
.trades td:last-child, .trades th:last-child { padding-right: 12px; }
.trades td { padding: 7px 9px; border-bottom: 1px solid var(--line-soft); color: var(--txt-dim); white-space: nowrap; vertical-align: middle; line-height: 1.5; height: 32px; box-sizing: border-box; }
.p-up { color: var(--up) !important; } .p-down { color: var(--down) !important; }
.trades .tag { font-size: 9.5px; padding: 1px 6px; border-radius: 4px; }
.tag.buy { background: var(--buy-bg); color: var(--buy-fg); } .tag.sell { background: var(--sell-bg); color: var(--sell-fg); }
td.dim { color: var(--txt-faint); font-family: 'Space Grotesk'; font-size: 12px; }
td.dim code { color: var(--standby); font-size: 11px; }

/* ---- calendar ---- */
.calendar-wrap { margin-top: 28px; }
.cal-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cal-nav button { background: var(--sunken); border: 1px solid var(--line-soft); color: var(--txt-dim); border-radius: 7px; width: 28px; height: 28px; cursor: pointer; }
.cal-nav .cal-title {
  /* Fixed width: the arrows stay put whatever the month name's length. */
  width: 150px; min-width: 150px; height: 28px; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 13px; font-weight: 600; text-align: center; color: var(--txt); font-family: inherit;
  background: none; border: 1px solid transparent; border-radius: 7px; cursor: pointer; transition: background .15s, border-color .15s;
}
.cal-nav .cal-title:hover, .cal-nav .cal-title[aria-expanded="true"] { background: var(--sunken); border-color: var(--line-soft); }
.calendar-wrap { position: relative; }
.cal-picker {
  position: absolute; z-index: 30; width: 236px; padding: 10px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(0,0,0,.22);
  animation: cal-picker-in .16s ease both;
}
@keyframes cal-picker-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.cal-picker-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-picker-year { font-weight: 700; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.cal-picker-step { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--line-soft); background: var(--sunken); color: var(--txt-dim); cursor: pointer; }
.cal-picker-step:disabled { opacity: .35; cursor: default; }
.cal-picker-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cal-picker-m { height: 34px; border-radius: 8px; border: 1px solid var(--line-soft); background: var(--sunken); color: var(--txt); font-size: 12px; font-family: inherit; cursor: pointer; }
.cal-picker-m:hover:not(:disabled) { border-color: var(--standby); }
.cal-picker-m.cur { box-shadow: inset 0 0 0 1px var(--txt-dim); }
.cal-picker-m.on { background: var(--standby-bg); border-color: var(--standby); color: var(--standby); font-weight: 600; }
.cal-picker-m:disabled { opacity: .35; cursor: default; }
.cal-picker-foot { display: flex; justify-content: center; margin-top: 8px; }
.cal-picker-foot .link-btn { font-size: 11px; }
@media (prefers-reduced-motion: reduce) { .cal-picker { animation: none; } }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-dow { font-size: 9.5px; text-transform: uppercase; color: var(--txt-faint); text-align: center; padding-bottom: 4px; }
.cal-day {
  aspect-ratio: 1.05; border-radius: 8px; border: 1px solid var(--line-soft); background: var(--sunken);
  padding: 6px 7px; cursor: default; display: flex; flex-direction: column; gap: 3px; min-width: 0; overflow: hidden;
}
.cal-day .dpl, .cal-day .dn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-day.has-trades { cursor: pointer; }
.cal-day.has-trades:hover { border-color: var(--standby); }
.cal-day.today { border-color: var(--txt-dim); }
.cal-day.empty-cell { background: transparent; border: none; }
.cal-day .dnum { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--txt-faint); }
.cal-day.up { background: var(--up-bg); border-color: var(--up-border); }
.cal-day.down { background: var(--down-bg); border-color: var(--down-border); }
.cal-day .dpl { font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700; }
.cal-day.up .dpl { color: var(--up); }
.cal-day.down .dpl { color: var(--down); }
.cal-day .dn { font-size: 9px; color: var(--txt-faint); }
.cal-day.selected { outline: 2px solid var(--standby); }

/* ---- settings/users modal ---- */
/* Counter-zoom the full-screen layer so it covers and centres against the
   real viewport, then re-zoom the panel inside it so its contents still
   follow the user's display-size setting. */
.modal-backdrop {
  position: fixed; top: 0; left: 0; width: var(--vw100); height: var(--vh100);
  background: #05070bcc; display: flex; align-items: center; justify-content: center; z-index: 9500;
}
.params-scroll { max-height: 62vh; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line-soft); border-radius: 8px; }
.params-table { font-size: 11.5px; }
.params-table thead th { position: sticky; top: 0; background: var(--panel-2); z-index: 1; }
.params-table .param-val { font-family: 'JetBrains Mono', monospace; color: var(--txt); word-break: break-all; }
.params-table .param-group td {
  background: var(--sunken); color: var(--txt-dim); font-size: 9.5px; text-transform: uppercase;
  letter-spacing: 0.08em; font-weight: 700; padding-top: 8px; padding-bottom: 8px;
}
.modal { width: 420px; max-width: 92vw; background: linear-gradient(180deg, var(--panel), var(--panel-2)); border: 1px solid var(--line); border-radius: var(--radius); max-height: 84vh; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: var(--line-soft) transparent; }
.modal::-webkit-scrollbar { width: 6px; }
.modal::-webkit-scrollbar-thumb { background: var(--line-soft); border-radius: 3px; }
.modal::-webkit-scrollbar-track { background: transparent; }
.modal-wide { width: 640px; }
/* Tabbed Settings window: ONE fixed footprint for every tab, so switching
   between General / Manage Users / Copy Trade never resizes or reflows the
   window. Sized for the widest+tallest tab (Manage Users), with the body
   scrolling internally rather than the whole box growing. Height is a fixed
   viewport fraction so a sparse tab doesn't collapse the box either. */
.modal.settings-tabbed { width: 640px; max-height: 84vh; display: flex; flex-direction: column; overflow: hidden; }
.modal.settings-tabbed .modal-head { flex: 0 0 auto; }
.modal.settings-tabbed .modal-body { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; }
@media (max-width: 600px) {
  .modal.settings-tabbed { width: 94vw; }
}
.modal-code { width: 860px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line-soft); }
.modal-head h3 { font-size: 14px; display: flex; align-items: center; gap: 8px; }
.modal-title-icon {
  width: 9px; height: 9px; min-height: 0; border-radius: 50%; flex-shrink: 0;
  align-self: center;
}
/* Menu icon shown before a menu-opened window's title (Settings, Economic
   calendar, Download EA, Manual trading, Users) — same glyph as the header
   menu, sized to sit inline with the title text. */
.modal-title-svg {
  width: 15px; height: 15px; flex-shrink: 0; align-self: center;
  color: var(--accent, currentColor); opacity: 0.9;
}
.modal-close { background: none; border: none; color: var(--txt-faint); font-size: 20px; cursor: pointer; line-height: 1; touch-action: manipulation; padding: 6px; margin: -6px; }
.modal-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.field-row { display: flex; flex-direction: column; gap: 6px; }
.field-row.tight { margin-top: -6px; }
.field-row label { font-size: 11px; color: var(--txt-faint); text-transform: uppercase; letter-spacing: 0.06em; }
/* textarea gets the same treatment as input — it was left out, so a message
   box rendered with the browser's own border and font next to a styled
   input. Every font stack carries fallbacks: a bare 'Space Grotesk' made
   controls fall back to the browser's serif whenever the web font hadn't
   loaded. */
.field-row input, .field-row select, .field-row textarea {
  background: var(--sunken); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  color: var(--txt); font-family: 'Space Grotesk', system-ui, sans-serif; font-size: 13px;
}
.field-row textarea { resize: vertical; line-height: 1.4; }
.field-row select { color-scheme: dark; cursor: pointer; }
.field-inline { display: flex; gap: 8px; align-items: center; }
.code-field {
  display: flex; align-items: center; gap: 4px;
  background: var(--sunken); border: 1px solid var(--line); border-radius: 10px; padding: 6px 6px 6px 12px;
}
.code-value {
  font-family: 'JetBrains Mono', monospace; font-size: 16px; letter-spacing: 0.16em;
  color: var(--txt); flex: 1; user-select: all; min-width: 0; overflow: hidden; text-overflow: ellipsis;
}
.code-value.masked { color: var(--txt-dim); }
.icon-action {
  background: none; border: none; color: var(--txt-dim); cursor: pointer; font-size: 14px;
  padding: 6px 7px; border-radius: 7px; line-height: 1; touch-action: manipulation;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-action:hover { background: var(--hover); color: var(--txt); }
.icon-action.danger:hover { background: var(--blocked-bg); color: var(--blocked); }
.field-hint { font-size: 11px; color: var(--txt-faint); margin-top: 5px; min-height: 14px; }
.btn { background: var(--sunken); border: 1px solid var(--line); color: var(--txt); border-radius: 8px; padding: 8px 14px; font-size: 12px; cursor: pointer; font-family: 'Space Grotesk', system-ui, sans-serif; touch-action: manipulation; }
.btn:disabled { opacity: 0.45; cursor: default; filter: none; }
.btn.primary { background: var(--standby-bg); border-color: var(--standby); color: var(--standby); }
.btn.danger { background: var(--blocked-bg); border-color: var(--down-border); color: var(--blocked); }
.btn:hover { filter: brightness(1.15); }

.users-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.users-table th { text-align: left; font-size: 10px; text-transform: uppercase; color: var(--txt-faint); padding: 10px 10px; border-bottom: 1px solid var(--line); }
.users-table td { padding: 12px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
/* Assigned-account chip + remove button, and the plain <select> used to add
   another account. Replaces the old all-accounts on/off toggle row. */
.acct-assign { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.acct-assign-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.acct-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
  background: var(--sunken); border: 1px solid var(--line-soft);
  padding: 3px 5px 3px 9px; border-radius: 6px; color: var(--txt-dim);
}
.acct-chip-x {
  background: none; border: none; color: var(--txt-faint); cursor: pointer;
  font-size: 13px; line-height: 1; padding: 2px 4px; border-radius: 4px;
  touch-action: manipulation;
}
.acct-chip-x:hover { background: var(--hover); color: var(--blocked); }
.acct-assign-picker {
  font-size: 11px; padding: 5px 8px; border-radius: 6px;
  border: 1px solid var(--line-soft); background: var(--sunken); color: var(--txt-dim);
  width: fit-content; max-width: 100%;
}
.users-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.role-badge { font-size: 9.5px; text-transform: uppercase; padding: 2px 7px; border-radius: 5px; font-weight: 700; }
.role-badge.admin { background: var(--standby-bg); color: var(--standby); }
.role-badge.user { background: var(--offline-bg); color: var(--txt-dim); }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.status-dot.connected { background: var(--trading); box-shadow: 0 0 5px var(--trading); }
.status-dot.pending { background: #f5b544; }
.status-dot.idle { background: var(--txt-faint); }

/* ---- map ---- */
#map { height: 260px; }
.leaflet-container { background: #0d1420; }
.map-pin { display: flex; align-items: center; justify-content: center; }
/* "You are here" marker — a blue pulsing dot, clearly distinct from the
   status-coloured EA pins. */
.map-pin-me { display: flex; align-items: center; justify-content: center; }
.map-pin-me i {
  width: 14px; height: 14px; border-radius: 50%;
  background: #3b82f6; border: 2px solid #fff;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.35); position: relative;
}
.map-pin-me i::after {
  content: ''; position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid rgba(59,130,246,0.5); animation: me-pulse 1.8s ease-out infinite;
}
@keyframes me-pulse {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(1.7); opacity: 0; }
}
.map-pin i {
  width: 12px; height: 12px; border-radius: 50%; border: 2px solid #0a0e15;
  display: flex; align-items: center; justify-content: center; position: relative;
}
.map-pin i b {
  position: absolute; top: -6px; right: -8px; background: #0a0e15; color: var(--txt);
  font-size: 9px; font-family: 'JetBrains Mono', monospace; border-radius: 50%;
  width: 14px; height: 14px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
}
.map-popup-row { display: flex; align-items: center; gap: 6px; font-size: 11px; padding: 2px 0; }

/* ---- live position cards ---- */
#live-position-wrap:not(:empty) { margin-bottom: 24px; }
.pos-card {
  background: var(--sunken); border: 1px solid var(--line-soft); border-left: 3px solid var(--line-soft);
  border-radius: 12px; padding: 14px 16px; margin: 10px 0; transition: border-left-color .2s;
}
.pos-card.up { border-left-color: var(--up); }
.pos-card.down { border-left-color: var(--down); }
.warn-chip {
  font-size: 10px; background: var(--closed-bg); color: var(--closed);
  padding: 3px 9px; border-radius: 6px; font-weight: 600;
}
.pos-card-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pos-card-top b { font-size: 14.5px; letter-spacing: -0.01em; }
.pos-total { margin-left: auto; font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 15px; }
.pos-card-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px;
}
.pos-card-grid > div { display: flex; flex-direction: column; gap: 2px; }
.pos-card-grid label {
  font-size: 9px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--txt-faint);
  display: flex; align-items: center; gap: 4px;
}
.pos-card-grid span { font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.tpsl-edit {
  background: none; border: none; color: var(--txt-faint); cursor: pointer; font-size: 10px;
  padding: 0; line-height: 1; touch-action: manipulation;
}
.tpsl-edit:hover { color: var(--standby); }
.pos-card-footer { display: flex; justify-content: flex-end; margin-top: 12px; }
.close-btn-modern {
  background: var(--blocked-bg); border: 1px solid var(--blocked); color: var(--blocked);
  border-radius: 8px; padding: 7px 16px; font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: 'Space Grotesk'; transition: background .15s; touch-action: manipulation;
}
.close-btn-modern:hover { background: var(--blocked); color: #fff; }
.close-btn-modern.pending { opacity: .55; cursor: default; }
.close-btn-modern.pending:hover { background: var(--blocked-bg); color: var(--blocked); }
@media (max-width: 600px) { .pos-card-grid { grid-template-columns: repeat(2, 1fr); } }
.leaflet-tooltip.map-label {
  background: var(--sunken); border: 1px solid var(--line); color: var(--txt);
  font-family: 'Space Grotesk', sans-serif; font-size: 11px; padding: 3px 8px;
  border-radius: 6px; box-shadow: 0 2px 8px #0008;
}
.leaflet-tooltip.map-label::before { border-top-color: var(--line); }

/* ---- chart tooltip ---- */
.chart-tooltip {
  position: fixed; z-index: 100; background: var(--sunken); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--txt); pointer-events: none; box-shadow: 0 8px 24px #000a; min-width: 160px;
}
.chart-tooltip .tt-row { display: flex; justify-content: space-between; gap: 14px; padding: 1px 0; }
.chart-tooltip .tt-label { color: var(--txt-faint); }

/* ---- footer ---- */
.app-footer {
  display: flex; justify-content: space-between; padding: 16px 4px calc(4px + env(safe-area-inset-bottom, 0px)); margin-top: 8px;
  font-size: 11px; color: var(--txt-faint); border-top: 1px solid var(--line-soft);
}
.footer-version { font-family: 'JetBrains Mono', monospace; display: none; }
@media (min-width: 601px) {
  .footer-version { display: inline; }
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #263149; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }
@media (max-width: 600px) {
  * { scrollbar-width: none; }
  *::-webkit-scrollbar { display: none; width: 0; height: 0; }
  /* Only the brand/clock/menu row stays pinned; the stats row below it
     scrolls away with the rest of the page.
     .topbar becomes layout-transparent here on purpose: a sticky element can
     only float within its own parent's box, and .topbar is only as tall as
     its own content — leaving it in place would let the pinned row scroll
     off after a few hundred pixels. Promoting topbar-main to a direct child
     of the (full-height) #app container is what keeps it pinned. */
  .topbar { display: contents; }
  .topbar-main {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    position: sticky; top: 0; z-index: 200; background: var(--bg);
    margin: 0 -10px;
    /* Installed as a home-screen app the page runs under the status bar
       viewport-fit=cover, which this app no longer sets — iOS insets the
       webview itself, so the inset resolves to 0 and the constant below is
       simply the header's own breathing room. Kept for the case where a
       platform does report an inset. */
    padding: calc(14px + env(safe-area-inset-top, 0px)) 10px 12px;
    order: -2; /* both header rows now sit in #app's flex column — keep them first */
  }
  #topstats { order: -1; padding-bottom: 14px; border-bottom: 1px solid var(--line-soft); }
}

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; grid-template-areas: "fleet" "detail" "map"; grid-template-rows: auto auto auto; }
  .layout.no-selection { grid-template-areas: "fleet" "map"; }
  /* Stacked layout: the account list is a picker, not the main event — it sits
     above the detail and is capped so it can never dominate the first screen.
     The sticky/full-height desktop behaviour is undone here too. */
  .fleet { position: static; height: auto; max-height: none; }
  /* Height is fitted to five accounts by fitFleetListHeight(); 34vh is only
     the fallback before the script has measured. */
  .bot-list { flex: 0 1 auto; max-height: 34vh; overflow-y: auto; position: relative; }
  .fleet > .panel-head { padding: 11px 14px; }
  .fleet #fleet-title { font-size: 11px; }
  .account-head { padding: 10px 14px; }
  .account-head .acct-name { font-size: 13px; }
  .account-head .acct-sub { font-size: 10px; }
  /* The 3-column admin grid reflows to 2 here; drop the spacer cells that only
     exist to pad the third column, otherwise fields land out of alignment. */
  .meta-grid > div:empty:not(.meta-gap) { display: none; }
  .topbar { flex-wrap: wrap; row-gap: 10px; }
  .topstats {
    order: 3; width: 100%; margin-left: 0; flex-direction: column; align-items: stretch;
    gap: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft);
  }
  .topstat-pills { flex-wrap: wrap; gap: 6px; }
  .topstat { flex: 1 1 auto; justify-content: center; padding: 7px 8px; }
  .topstat .v { font-size: 15px; }
  .topstat .l { font-size: 8px; }
  .topstat-health { min-width: 0; }
  .topstat-health-lbl { text-align: left; }
}
@media (max-width: 600px) {
  #app { padding: 0 10px 10px; }
  .topbar { gap: 10px; padding-bottom: 12px; }
  .brand { gap: 10px; }
  .brand-icon { width: 28px; height: 28px; }
  .brand-line1 { font-size: 10px; }
  .brand-line2 { font-size: 15px; }
  .topbar-right { padding-left: 0; border-left: none; gap: 10px; }
  .topbar-user { display: none; } /* mobile shows the user in the dropdown menu */
  .topbar-right > .clock { display: none; } /* redundant with the phone's own status-bar clock; shown in the menu instead */
  .app-footer { padding-top: 20px; gap: 8px; }
  .detail-inner { padding: 14px; }
  .detail-head { padding-right: 90px; } /* room for the pinned action buttons */
  /* ...except on the account view, whose gear sits inside the summary card —
     without this the reserved gutter stopped the card reaching full width. */
  .detail-head.acct-head { padding-right: 0; }
  .detail-actions { position: absolute; top: 0; right: 0; margin-left: 0; gap: 6px; }
  .detail-actions .gear-btn { width: 30px; height: 30px; font-size: 13px; }
  .last-ping-inline { display: none; }
  /* On mobile the online/total bar stays in the header block, so hide the
     footer's copy of it — but keep the expand/collapse-all button, which only
     lives in the footer. */
  .fleet-footer { padding: 10px 14px; justify-content: flex-end; }
  .fleet-footer .topstat-health { display: none; }
  .topstat-health-mobile { display: block; width: 100%; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .meta-grid, .meta-grid.cols3, .meta-grid.cols2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* .meta-gap cells only exist to pad the desktop 3-column layout. In the
     2-column phone layout they'd push Location and Timeframe onto separate
     rows, leaving a visible hole; dropping them lets the fields pair up
     naturally (EA/EA version, MQH/Account, Location/Timeframe). */
  .meta-grid .meta-gap { display: none; }
  /* Breakout status ("Not checked yet") needs the full row on a phone so the
     pill isn't squeezed into an ellipsis inside a half-width grid cell. */
  .meta-grid .breakout-cell { grid-column: 1 / -1; }
  .meta-grid .breakout-cell .breakout-val { white-space: nowrap; max-width: none; overflow: visible; text-overflow: clip; width: fit-content; }
  .meta-grid .meta-full { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
  .modal { width: 94vw; }
  .modal-wide { width: 94vw; }
  .modal-code { width: 94vw; }
  .cal-grid { gap: 4px; }
  .cal-day { aspect-ratio: 0.8; padding: 4px 2px; }
  .cal-day .dnum { font-size: 10px; }
  /* 4-figure P/L (e.g. 1.234,00) has to fit inside a narrow phone cell —
     it was being ellipsised at the old size. */
  .cal-day .dpl { font-size: 7.5px; letter-spacing: -0.03em; }
  .cal-day .dn { font-size: 7.5px; }
  .users-table { font-size: 11px; }
  .user-menu { right: -4px; }
  /* Nothing selected: fleet list + map should fit the current screen. Give the
     map a bounded, viewport-relative height rather than the 450px desktop
     minimum, so the whole page is visible without scrolling. */
  .layout.no-selection .mapwrap #map { height: 300px; min-height: 0; max-height: none; }
}
@media (prefers-reduced-motion: reduce) { .pulse.trading::after { animation: none; } }
.param-input {
  background: var(--sunken); border: 1px solid var(--line); border-radius: 6px; padding: 3px 7px;
  color: var(--txt); font-family: 'JetBrains Mono', monospace; font-size: 11.5px; width: 90px;
}
.param-input:focus { outline: none; border-color: var(--standby); }

/* Days belonging to the previous/next month, shown so a week that straddles a
   month boundary stays whole — dimmed to make clear they're outside it. */
.cal-day.adjacent { opacity: 0.4; }
.cal-day.adjacent .dnum { color: var(--txt-faint); }
.cal-day.in-window { box-shadow: inset 0 0 0 1.5px var(--standby); }
.cal-day.today .dnum { color: var(--standby); font-weight: 700; }

.info-banner {
  padding: 8px 12px; border-radius: 8px; font-size: 12px; margin-bottom: 14px;
  border: 1px solid; display: flex; align-items: center; gap: 8px;
}
.info-banner.backtest { background: var(--backtest-bg); color: var(--backtest); border-color: var(--backtest); }
.info-banner.algo-off { background: var(--blocked-bg); color: var(--blocked); border-color: var(--blocked); font-weight: 600; }

.notif-section { background: var(--sunken); border: 1px solid var(--line-soft); border-radius: 10px; padding: 10px 12px; }
.notif-head { font-size: 12px; font-weight: 600; color: var(--txt); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.notif-actions { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 400; }
.notif-actions .sep { color: var(--txt-faint); }
.link-btn { background: none; border: none; padding: 0; color: var(--standby); font-size: 11px; cursor: pointer; font-family: inherit; }
.link-btn:hover { text-decoration: underline; }
.notif-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.notif-toggle { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--txt-dim); cursor: pointer; }
.notif-toggle input { accent-color: var(--standby); width: 15px; height: 15px; cursor: pointer; }
@media (max-width: 600px) { .notif-grid { grid-template-columns: 1fr; } }
.notif-toggle.acct-silenced span { color: var(--closed); }
.notif-toggle.acct-silenced span::after { content: ' ⊘'; font-size: 10px; }

/* Compact, single-scroll params summary (the modal itself scrolls, no nested box) */
.params-table.compact { font-size: 11px; margin-top: 6px; width: 100%; table-layout: fixed; border-collapse: collapse; }
.params-table.compact td { padding: 4px 4px; vertical-align: middle; }
.params-table.compact td:first-child { color: var(--txt-dim); width: 60%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.params-table.compact td:last-child { text-align: right; width: 40%; }
.params-table.compact .param-group td {
  background: var(--sunken); color: var(--txt-dim); font-size: 9px; text-transform: uppercase;
  letter-spacing: 0.08em; font-weight: 700; padding-top: 7px; padding-bottom: 7px;
}
.params-table.compact .param-val { font-family: 'JetBrains Mono', monospace; color: var(--txt); }

.safety-block { background: var(--sunken); border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px; margin-top: 6px; }
.safety-toggle { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--txt-dim); cursor: pointer; margin-top: 8px; }
.safety-toggle input { accent-color: var(--standby); width: 15px; height: 15px; margin-top: 1px; flex-shrink: 0; }
.safety-block input[type="number"], .safety-block input[type="date"] {
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px;
  color: var(--txt); font-family: 'JetBrains Mono', monospace; font-size: 12px;
}
.param-select {
  background: var(--sunken); border: 1px solid var(--line); border-radius: 6px; padding: 3px 7px;
  color: var(--txt); font-family: 'Space Grotesk'; font-size: 11px; cursor: pointer; color-scheme: dark;
}

/* Every day is its own <table>, and with the default auto layout each one
   sized its columns from its own content — so the time, dot and title columns
   landed at a different x on every day. A fixed layout with explicit widths
   gives all of them identical columns, regardless of what's in the rows. */
.cal-events-table { font-size: 12px; width: 100%; table-layout: fixed; }
.cal-events-table td.cal-time   { width: 64px; }
.cal-events-table td.cal-impact { width: 22px; text-align: center; padding-left: 0; padding-right: 0; }
/* Inside the table the dot is centred in its own column: no side margins.
   The generic .imp-dot rules below carry margins for inline use elsewhere
   (and gave the medium dot an extra 8px the high dot didn't have), which is
   what pushed amber dots out of line with red ones. */
.cal-events-table .imp-dot,
.cal-events-table .imp-dot.imp-high { margin: 0; vertical-align: middle; }
.cal-events-table td:last-child { overflow-wrap: anywhere; }
.cal-events-table .cal-time { font-family: 'JetBrains Mono', monospace; color: var(--txt-dim); white-space: nowrap; }
.cal-cur { font-weight: 700; font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--sunken); }
.imp-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.imp-high { background: #e5484d; }
.imp-med { background: #ff8a1f; }
.imp-low { background: #f5d90a; }
.imp-hol { background: var(--txt-faint); }

.cal-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cal-day-head { font-size: 11px; font-weight: 700; color: var(--txt-dim); text-transform: uppercase;
  letter-spacing: 0.06em; margin: 14px 0 4px; padding-bottom: 3px; border-bottom: 1px solid var(--line-soft); }
.cal-events-table tbody tr td { padding: 4px 8px; }

/* Compact safety section */







/* Small muted info footer: connected-since + EA ID, divided from settings */
.settings-meta {
  margin-top: 16px; padding-top: 10px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 6px 24px;
}
.settings-meta > div { display: flex; flex-direction: column; gap: 1px; }
.settings-meta span { font-size: 9px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--txt-faint); }
.settings-meta b { font-size: 11px; color: var(--txt-dim); font-weight: 500; }
.settings-meta .mono { font-family: 'JetBrains Mono', monospace; font-size: 10px; }
.notif-toggle.local-off span { color: var(--txt-faint); }
.notif-toggle.local-off span::after { content: ' (EA)'; font-size: 9px; color: var(--txt-faint); }
.cal-cur-fixed { font-size: 11px; font-weight: 700; color: var(--standby); padding: 4px 10px;
  background: var(--sunken); border-radius: 6px; letter-spacing: 0.03em; }
.cal-day-head.past { color: var(--txt-faint); }
.cal-events-table.past { opacity: 0.55; }

/* Minimal safety section */
.safety-title { font-size: 12px; font-weight: 600; color: var(--txt); margin-bottom: 6px; }
.safety-block { padding: 10px 12px; }
.safety-toggle { margin-top: 6px; }
.safety-detail { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 4px 23px; }
.safety-detail input[type="number"] { width: 100px; }
.safety-detail input[type="date"] { width: auto; }
.safety-detail .field-hint { flex-basis: 100%; margin: 0; }

/* Calendar: impact dot + label always on one line; title may wrap */
.cal-impact { white-space: nowrap; }
.cal-events-table td:last-child { white-space: normal; }
.cal-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line);
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--txt-faint);
}

/* Keep the Leaflet map and its panes/controls below the header dropdown menu */
.leaflet-pane, .leaflet-top, .leaflet-bottom { z-index: 400 !important; }
.mapwrap, #map { position: relative; z-index: 0; }
/* Dark-theme map: CARTO's separate dark_all raster style now needs the same
   API key as the light one, so instead of a second key-gated tile source,
   ordinary OSM tiles get inverted + hue-rotated back to a legible dark map.
   Applied to the tile PANE only (not labels/markers), toggled by
   applyMapTileTheme(). */
/* Monochrome map. OSM's default tiles are colourful (green parks, yellow
   roads, blue water), which fights the dashboard's palette and makes the
   markers harder to pick out. Desaturating leaves a single-tone basemap that
   reads as background; the dark theme also inverts it first. */
/* Muted basemap. The filter goes on the tile PANE, not on each tile.
   Filtering every tile individually promotes each one to its own compositing
   layer, and the browser then leaves a hairline of background visible where
   those layers meet — the pale grid seen across the map. One filtered layer
   has no internal seams to show.

   Nothing here resizes or repositions tiles any more. Earlier attempts grew
   each tile by a pixel to paper over those seams, which only worked at one
   specific zoom level and tore the mosaic apart at the others; the seams were
   never a sizing problem in the first place. Leaflet's own geometry is left
   untouched. */
/* The tiles' colours are filtered once each, in a canvas — see
   makeMapTileLayer() in app.js. No CSS filter on the moving tile pane. */
.leaflet-container img.leaflet-tile { max-width: none !important; max-height: none !important; }

/* Small, unobtrusive attribution — required by OSM's usage policy, but no
   reason for it to compete visually with the dashboard's own chrome. */
.leaflet-control-attribution {
  background: color-mix(in srgb, var(--panel) 85%, transparent) !important;
  color: var(--txt-faint) !important; font-size: 9.5px !important; padding: 1px 6px !important;
}
.leaflet-control-attribution a { color: var(--txt-dim) !important; }
.topbar { position: relative; z-index: 8000; }

/* Period + scope controls stack together, right-aligned, in both account & bot views */
.analytics-head { align-items: flex-start; }
.analytics-controls { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; margin-left: auto; }

/* Users modal on phones: stack each user as a card instead of a horizontally
   scrolling 4-column table (removes the scroll-in-scroll). */
@media (max-width: 600px) {
  .users-table-wrap { overflow-x: visible; }
  .users-modal-mobile .users-table,
  .users-modal-mobile .users-table tbody,
  .users-modal-mobile .users-table tr,
  .users-modal-mobile .users-table td { display: block; width: 100%; }
  .users-modal-mobile .users-table thead { display: none; }
  .users-modal-mobile .users-table tr {
    background: var(--sunken); border: 1px solid var(--line-soft);
    border-radius: 10px; padding: 10px; margin-bottom: 10px;
  }
  .users-modal-mobile .users-table td { padding: 3px 0; border: none; }
  .users-modal-mobile .users-table td[style*="nowrap"] { white-space: normal !important; display: flex; gap: 8px; margin-top: 6px; }
  .users-modal-mobile .acct-assign-chips { flex-wrap: wrap; }
}
@media (max-width: 600px) {
  .users-modal-mobile .field-inline { flex-wrap: wrap; }
  .users-modal-mobile .field-inline > input,
  .users-modal-mobile .field-inline > select { flex: 1 1 100%; min-width: 0; }
  .users-modal-mobile .field-inline > .btn { flex: 0 0 auto; }
}

/* Modern users modal — card list, works the same on desktop and mobile */
/* Each dot+label is one <span> item, so the gap applies BETWEEN legend
   entries only — previously the bare text nodes became their own flex items
   and inherited the same 14px gap, pushing every label away from its dot. */
.users-legend { font-size: 11px; color: var(--txt-faint); margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.users-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.users-legend .status-dot { margin-right: 0; }
.users-cards { display: flex; flex-direction: column; gap: 7px; }
.user-card { background: var(--sunken); border: 1px solid var(--line-soft); border-radius: 9px; padding: 8px 10px; }
.user-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.user-name { font-size: 12.5px; font-weight: 600; color: var(--txt); }
.user-card .acct-assign-chips { gap: 4px; }
.user-card .acct-chip { font-size: 10px; }
.user-card-actions { display: flex; gap: 6px; }
.btn-sm { font-size: 10.5px; padding: 3px 10px; }
.users-add { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.users-add-title { font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--txt-faint); margin-bottom: 8px; }
.users-add-row { display: flex; gap: 8px; align-items: center; }
.users-add-row input { flex: 1 1 auto; min-width: 0; }
.users-add-row select { flex: 0 0 auto; }
@media (max-width: 600px) {
  .users-add-row { flex-wrap: wrap; }
  .users-add-row input, .users-add-row select { flex: 1 1 100%; }
  .users-add-row .btn { flex: 1 1 100%; }
}
.login-version { position: fixed; bottom: 14px; right: 16px; font-size: 11px; color: var(--txt-faint);
  font-family: 'JetBrains Mono', monospace; letter-spacing: 0.03em; }

/* Polished add-user inputs */
.users-add-row input, .users-add-row select {
  background: var(--sunken); border: 1px solid var(--line-soft); border-radius: 8px;
  padding: 8px 11px; font-size: 13px; color: var(--txt); font-family: 'Space Grotesk';
  transition: border-color 0.15s, box-shadow 0.15s;
}
.users-add-row input::placeholder { color: var(--txt-faint); }
.users-add-row input:focus, .users-add-row select:focus {
  outline: none; border-color: var(--standby); box-shadow: 0 0 0 3px var(--standby-bg);
}
.users-add-row select { cursor: pointer; }
/* The ⚙ emoji renders smaller than 📋; bump it so both action icons match */
.gear-cog, .detail-actions .gear-btn.gear-cog { font-size: 19px; line-height: 1; }

/* Account statistics title wraps to two lines on phones so the day/week/month/all
   controls keep their full width and functional layout */
@media (max-width: 600px) {
  .acct-stats-title { line-height: 1.15; }
  .acct-stats-title .asw { display: block; }
}
.cal-controls { display: flex; align-items: center; gap: 10px; }
#cal-refresh { margin-left: auto; }

/* Field label + sub-hint on its own line, label a touch more prominent */
.field-label { display: block; font-size: 12px; font-weight: 600; color: var(--txt-dim); margin-bottom: 2px; }
/* Inside the tabbed Settings window each field-row is a distinct setting, so
   its label acts as a section heading — heavier and full-contrast so you can
   see at a glance which setting you're looking at, with generous spacing so
   the panes don't feel cramped. */
.settings-tabbed .modal-body .field-row { gap: 8px; }
.settings-tabbed #settings-tab-content { display: flex; flex-direction: column; gap: 16px; }
/* Two settings side by side on desktop; single column once there isn't room,
   so nothing gets squeezed on a phone. */
.settings-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 24px; align-items: start; }
.settings-pair:has(> .field-row:only-child) { grid-template-columns: 1fr; }
@media (max-width: 700px) { .settings-pair { grid-template-columns: 1fr; } }
.settings-tabbed .modal-body .field-label {
  font-size: 13px; font-weight: 700; color: var(--txt); letter-spacing: 0.01em; margin-bottom: 4px;
}
.field-sub { font-size: 11px; color: var(--txt-faint); margin-bottom: 6px; line-height: 1.3; }

/* Connectivity dot shown next to a Blocked chip so online/offline stays visible */
.bot-right { display: flex; align-items: center; gap: 6px; }
.conn-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.conn-dot.on { background: var(--up); box-shadow: 0 0 0 2px color-mix(in srgb, var(--up) 25%, transparent); }
.conn-dot.off { background: var(--txt-faint); }
.user-login-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 8px; font-size: 10.5px; color: var(--txt-faint); }

/* Blocked bot connectivity mini-chip */
.chip.mini { font-size: 8.5px; padding: 1px 6px; text-transform: uppercase; letter-spacing: 0.05em; }
.chip.mini.online { background: color-mix(in srgb, var(--up) 18%, transparent); color: var(--up); }
.chip.mini.offlinechip { background: var(--sunken); color: var(--txt-faint); }

/* Max daily drawdown strip */
.dd-strip { display: flex; align-items: baseline; gap: 10px; margin-top: 10px; padding: 8px 12px;
  background: var(--sunken); border: 1px solid var(--line-soft); border-radius: 9px; flex-wrap: wrap; }
.dd-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--txt-faint); }
.dd-value { font-family: 'JetBrains Mono', monospace; font-size: 15px; font-weight: 600; }
.dd-sub { font-size: 10px; color: var(--txt-faint); }

/* Dev-mode application log */
.devlog-block .chart-head { display: flex; align-items: center; justify-content: space-between; }
.dev-toggle { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--txt-dim); cursor: pointer; }
.dev-toggle input { accent-color: var(--standby); width: 14px; height: 14px; }
.devlog-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 0; }
.devlog-easel { background: var(--sunken); border: 1px solid var(--line-soft); border-radius: 7px; padding: 5px 9px; font-size: 11px; color: var(--txt); font-family: 'Space Grotesk'; }
.devlog-cats { display: flex; gap: 12px; flex-wrap: wrap; }
.dev-cat { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--txt-dim); cursor: pointer; text-transform: capitalize; }
.dev-cat input { accent-color: var(--standby); width: 13px; height: 13px; }
.devlog-stream { max-height: 320px; overflow-y: auto; border: 1px solid var(--line-soft); border-radius: 9px; background: var(--bg); font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.devlog-line { display: flex; gap: 10px; align-items: baseline; padding: 4px 10px; border-bottom: 1px solid var(--line-soft); }
.devlog-line:last-child { border-bottom: none; }
.devlog-line.warn { background: color-mix(in srgb, var(--standby) 6%, transparent); }
.devlog-line.error { background: color-mix(in srgb, var(--down) 8%, transparent); }
.devlog-ts { color: var(--txt-faint); white-space: nowrap; }
.devlog-cat { text-transform: uppercase; font-size: 8.5px; letter-spacing: 0.05em; padding: 1px 6px; border-radius: 4px; white-space: nowrap; align-self: center; }
.devlog-cat.cat-ea { background: color-mix(in srgb, var(--standby) 18%, transparent); color: var(--standby); }
.devlog-cat.cat-network { background: color-mix(in srgb, #5b8def 18%, transparent); color: #5b8def; }
.devlog-cat.cat-trade { background: color-mix(in srgb, var(--up) 18%, transparent); color: var(--up); }
.devlog-cat.cat-system { background: var(--sunken); color: var(--txt-dim); }
.devlog-ea { color: var(--txt-faint); white-space: nowrap; }
.devlog-msg { color: var(--txt-dim); word-break: break-word; }
.user-dev-toggle { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; font-size: 11px; color: var(--txt-dim); cursor: pointer; }
.user-dev-toggle input { accent-color: var(--standby); width: 14px; height: 14px; flex-shrink: 0; }

/* Waiting-for-authorization status (brand-new bot, blue) */
.chip.waiting { background: color-mix(in srgb, #5b8def 16%, transparent); color: #5b8def; }
.status-pill.waiting { color: #5b8def; }
.status-pill.waiting .dot { background: #5b8def; }

/* Remove-all: centered modern pill; PC copy on desktop, mobile copy under map */
.remove-all-wrap { display: flex; justify-content: center; padding: 12px 4px 6px; margin-top: 4px; }
.remove-all-btn { display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600;
  padding: 7px 22px; border-radius: 8px; letter-spacing: 0.01em; min-width: 160px;
  background: color-mix(in srgb, var(--down) 10%, transparent);
  color: var(--down); border: 1px solid color-mix(in srgb, var(--down) 35%, transparent);
  transition: background .14s, border-color .14s; }
.remove-all-btn:hover { background: color-mix(in srgb, var(--down) 16%, transparent); border-color: var(--down); }
.remove-all-btn:active { background: color-mix(in srgb, var(--down) 22%, transparent); }
.remove-all-btn:disabled { opacity: .55; }
.dev-switch { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--txt-dim); cursor: pointer; }
.dev-switch input { accent-color: var(--standby); width: 14px; height: 14px; }

/* Calendar header bar — title+subtitle left, chip and refresh grouped right */
.cal-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; margin-bottom: 12px; background: var(--sunken); border: 1px solid var(--line-soft); border-radius: 11px; }
.cal-bar-left { display: flex; flex-direction: column; gap: 2px; }
.cal-bar-title { font-size: 14px; font-weight: 700; color: var(--txt); }
.cal-bar-sub { font-size: 11px; color: var(--txt-faint); }
.cal-bar-right { display: flex; align-items: center; gap: 10px; }
.cal-chip { display: flex; align-items: center; gap: 8px; padding: 4px 10px; background: var(--bg);
  border: 1px solid var(--line-soft); border-radius: 8px; }
.cal-chip-cur { font-size: 12px; font-weight: 800; color: var(--standby); letter-spacing: 0.04em; }
.cal-chip-imp { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--txt-dim); }
.imp-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-left: 8px; }
.imp-dot.imp-high { background: var(--down); margin-left: 0; }
.imp-dot.imp-med { background: #e0a63c; }
.cal-refresh-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  padding: 6px 12px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line);
  color: var(--txt-dim); cursor: pointer; line-height: 1; transition: color .15s, border-color .15s; }
.cal-refresh-btn:hover { color: var(--standby); border-color: var(--standby); }
.cal-refresh-ic { font-size: 14px; }
@media (max-width: 600px) {
  /* Title and the colour legend stay on ONE row — stacking them wasted
     vertical space above a list that's already tall on a phone. */
  .cal-bar { flex-direction: row; align-items: center; gap: 8px; flex-wrap: wrap; }
  .cal-bar-left { flex: 1 1 auto; min-width: 0; }
  .cal-bar-sub { font-size: 10.5px; }
  .cal-bar-right { flex: 0 0 auto; gap: 6px; }
  .cal-chip { padding: 3px 8px; gap: 6px; }
  .cal-chip-cur { font-size: 11px; }
  .cal-chip-imp { font-size: 10px; gap: 3px; }
}

/* Prominent enable hero for the basic-user settings modal */
.enable-hero { display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 18px; border-radius: 12px; border: 1px solid var(--line-soft); }
.enable-hero.on { background: var(--standby-bg); border-color: color-mix(in srgb, var(--standby) 40%, transparent); }
.enable-hero.off { background: var(--sunken); }
.enable-hero-text { display: flex; flex-direction: column; gap: 3px; }
.enable-hero-label { font-size: 16px; font-weight: 700; color: var(--txt); }
.enable-hero-sub { font-size: 12px; color: var(--txt-faint); }
.toggle.big { transform: scale(1.35); transform-origin: right center; }
.gear-btn.sm { width: 30px; height: 30px; }

/* Calendar top bar — titled, filter chip left, refresh button right */
.cal-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; background: var(--sunken); border: 1px solid var(--line-soft); border-radius: 10px; flex-wrap: wrap; }
.cal-bar-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cal-bar-title { font-size: 13px; font-weight: 600; color: var(--txt); }
.cal-refresh-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 6px 12px; }
.cal-refresh-ic { font-size: 14px; line-height: 1; }

/* Clearer visual separation between the major detail sections (admin + user) */
.section-block { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line-soft); }
.section-block:first-of-type { border-top: none; padding-top: 0; }
@media (max-width: 600px) { .section-block { margin-top: 22px; padding-top: 18px; } }
/* User's own disabled state — neutral, not an error like 'blocked' */
.chip.disabled { background: var(--sunken); color: var(--txt-dim); }
.status-pill.disabled { color: var(--txt-dim); }
.status-pill.disabled .dot { background: var(--txt-faint); }
.ssb-display { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 8px 11px; background: var(--bg); border: 1px solid var(--line-soft); border-radius: 8px; margin-bottom: 8px; }
.ssb-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--txt-faint); }
.ssb-value { font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 600; color: var(--txt); }
/* Single-account user: EA list flush without the account-group header indent */
.bot-sub-list.flush { margin-left: 0; padding-left: 0; border-left: none; }
/* Single-account users see no account header, so there's no parent to nest
   under — the rail would be pointing at nothing. */
.bot-sub-list.flush::before { display: none; }
.bot-sub-list.flush .bot-row { padding-left: 13px; padding-right: 13px; }
.uac-ea-label { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--txt-faint); margin: 0 13px 7px; }
/* Small glyph before the "My account" heading and "My EA(s)" label, so each
   section reads at a glance. Inherits the heading's colour via currentColor. */
#fleet-title { display: flex; align-items: center; gap: 7px; }
.uac-ea-label { display: flex; align-items: center; gap: 6px; }
.section-title-icon { flex-shrink: 0; opacity: 0.75; }
#fleet-title .section-title-icon { width: 16px; height: 16px; }
.uac-ea-label .section-title-icon { width: 13px; height: 13px; }
/* Profit-cap field: full-width, readable placeholder */
.mp-field-label { flex-basis: 100%; font-size: 11px; color: var(--txt-dim); margin: 2px 0 0; }
.mp-input { flex: 1 1 100%; width: 100% !important; min-width: 0; }
/* Condition-timeframe control: compact, not full-width */
.tf-seg { display: inline-flex; width: fit-content; max-width: 100%; align-self: flex-start; }
.tf-seg button { padding: 6px 16px; white-space: nowrap; }

/* Calendar bar: keep left content left-aligned, right group right-aligned on all sizes */
.cal-bar-left { align-items: flex-start; }

/* ── Modern single-account user view ─────────────────────────────────────── */
.user-acct-card { background: var(--sunken);
  border: 1px solid var(--line-soft); border-radius: 11px; padding: 12px 13px; margin-bottom: 12px;
  cursor: pointer; transition: border-color .15s, background .15s; }
.user-acct-card:hover { border-color: var(--standby); background: var(--hover); }
.user-acct-card.active { border-color: var(--txt-dim); box-shadow: 0 0 0 2px var(--hover); }
.uac-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.uac-status { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; }
.uac-status.trading { color: var(--trading); } .uac-status.standby { color: var(--standby); }
.uac-status.blocked { color: var(--blocked); } .uac-status.offline { color: var(--offline); }
.uac-status.closed { color: var(--closed); } .uac-status.waiting { color: #5b8def; }
.uac-status.disabled { color: var(--txt-dim); }
.uac-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.uac-count { font-size: 10.5px; color: var(--txt-faint); }
.uac-figures { display: flex; gap: 26px; margin-bottom: 10px; }
.uac-figures > div { display: flex; flex-direction: column; gap: 3px; }
.uac-lbl { font-size: 9px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--txt-faint); }
.uac-val { font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 600; color: var(--txt); }
.uac-cta { font-size: 10.5px; color: var(--standby); font-weight: 600; }
.users-section-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--txt-faint); font-weight: 700; margin: 16px 2px 8px; }
.users-section-title:first-child { margin-top: 0; }
/* Finished calendar events (start + 6h in the past) */
.cal-ev-done { opacity: 0.42; }
.cal-done-tag { font-size: 9px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--txt-faint); border: 1px solid var(--line-soft); border-radius: 4px; padding: 0 4px; margin-left: 6px; }
.safety-save-row { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 14px; }
.safety-save-row .field-hint { margin: 0; flex: 1; }
.gen-field { margin-bottom: 14px; }
.gen-field > label { display: block; font-size: 11px; color: var(--txt-dim); margin-bottom: 5px; }
.gen-field .param-select { width: 100%; }
.lots-input {
  width: 120px; flex: 0 0 auto;
  padding: 9px 12px;
  background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--txt);
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.lots-input:focus {
  outline: none;
  border-color: var(--standby);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--standby) 18%, transparent);
}
/* Trim the native number spinners for a cleaner look */
.lots-input::-webkit-outer-spin-button,
.lots-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#news-mode-hint:empty { display: none; }
.param-group-block { margin-bottom: 14px; }
.param-group-block:last-child { margin-bottom: 0; }
.param-group-title { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: var(--standby); margin: 0 0 6px; padding-bottom: 4px; border-bottom: 1px solid var(--line-soft); }
.user-lots-row { margin-top: 14px; }
.user-lots-row > label { display: block; font-size: 11px; color: var(--txt-dim); margin-bottom: 5px; }
.notif-mt5-note { margin-top: 10px; padding: 9px 11px; background: var(--sunken); border: 1px solid var(--line-soft); border-radius: 8px; font-size: 11px; color: var(--txt-dim); line-height: 1.5; }
.ver-outdated { font-size: 9px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--down); border: 1px solid color-mix(in srgb, var(--down) 40%, transparent); border-radius: 4px; padding: 0 4px; margin-left: 5px; }
/* Children inherit the same label/span styling as the rest of the grid. */
.title-sub-id { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--txt-faint); align-self: center; }
.close-btn-modern.disabled { opacity: .5; cursor: not-allowed; background: var(--sunken); color: var(--txt-faint); border-color: transparent; }

/* EA update modal */
.source-card-group { display: flex; flex-direction: column; gap: 8px; }
.source-card {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; border-radius: 10px; background: var(--sunken); border: 1px solid var(--line-soft);
}
.source-card-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.source-card-name { font-family: 'Space Grotesk'; font-size: 13px; font-weight: 600; color: var(--txt); }
.source-card-file { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--txt-faint); }
.source-card-actions { display: flex; gap: 6px; flex-wrap: wrap; flex-shrink: 0; }
.btn.small { padding: 5px 12px; font-size: 12px; }
.uac-idline { font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--txt); font-weight: 600; }
.uac-broker { font-size: 12px; color: var(--txt-dim); margin-top: -6px; margin-bottom: 10px; }
.uac-balance { display: flex; flex-direction: column; gap: 3px; margin-bottom: 12px; }
.uac-balance .uac-lbl { font-size: 9px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--txt-faint); }
.uac-bal-val { font-family: 'JetBrains Mono', monospace; font-size: 20px; font-weight: 700; color: var(--txt); line-height: 1.1; }
.update-step { padding: 10px 12px; border-radius: 8px; background: var(--sunken); }
.update-step-title { font-size: 12px; font-weight: 700; color: var(--txt); margin-bottom: 3px; }

/* Read-only enable status (users monitor only, no toggle) */
.enable-hero.readonly { cursor: default; }
.status-ind { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.status-ind.on { background: var(--trading); box-shadow: 0 0 0 4px color-mix(in srgb, var(--trading) 20%, transparent); }
.status-ind.off { background: var(--offline); box-shadow: 0 0 0 4px color-mix(in srgb, var(--offline) 20%, transparent); }

/* Compact side-by-side Trading + Authorization toggles (admin) */
.toggle-pair { display: flex; gap: 28px; }
.toggle-cell { display: flex; flex-direction: column; gap: 6px; }
.toggle-cell > label { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--txt-faint); }

/* Easter egg: hidden in the footer, same color as the background — reveals on selection/hover */
.egg { color: var(--bg); user-select: text; transition: color .3s; }
.egg:hover { color: var(--txt-faint); }

/* Global admin config block in Manage users */
.users-global-cfg { background: var(--sunken); border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.ugc-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.ugc-label { font-size: 12px; font-weight: 600; color: var(--txt); }
.ugc-sub { font-size: 11px; color: var(--txt-faint); margin-top: 2px; }
.users-global-cfg select { padding: 7px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; color: var(--txt); font-family: inherit; font-size: 13px; }

/* Night-breakout row (admin): Symbol / Timeframe / Breakout as 3 equal columns */
.breakout-val.hit { color: var(--blocked); font-weight: 600; }
.breakout-val.none { color: var(--trading); }
.breakout-val.unknown { color: var(--txt-faint); }

/* Trade table: compact side arrow + right-aligned numeric cells */
.side-cell { text-align: center; width: 26px; }
.side-arrow { font-weight: 700; font-size: 15px; line-height: 1; }
.side-arrow.up { color: var(--trading); }
.side-arrow.down { color: var(--blocked); }
td.num { text-align: right; font-variant-numeric: tabular-nums; font-family: 'JetBrains Mono', monospace; font-size: 12px; }

/* Exact date range shown beside the period label */
.period-dates { color: var(--txt-faint); font-weight: 400; }
.period-dates::before { content: '· '; }

/* Symbol chip beside the status pill in the EA header */
.symbol-chip {
  display: inline-flex; align-items: center;
  padding: 5px 12px; border-radius: 8px;
  background: var(--sunken); border: 1px solid var(--line);
  font-family: 'JetBrains Mono', monospace; font-size: 12.5px; font-weight: 600;
  color: var(--txt); letter-spacing: 0.02em; white-space: nowrap;
}
/* Secondary tag (VPS): same shape, quieter weight so the symbol chip stays
   the primary identifier next to the title. */
/* Sidebar VPS marker: sits left of the status chip, quieter so the status
   stays the row's primary signal. */
.chip.vps-mini {
  background: color-mix(in srgb, var(--standby) 13%, transparent);
  color: var(--standby);
  border: 1px solid color-mix(in srgb, var(--standby) 34%, transparent);
  font-size: 8.5px; font-weight: 800; letter-spacing: 0.06em; padding: 2px 6px;
}
.symbol-chip.vps-chip {
  padding: 5px 10px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--standby);
  background: color-mix(in srgb, var(--standby) 14%, transparent);
  border-color: color-mix(in srgb, var(--standby) 38%, transparent);
}

/* --- Account detail summary card (desktop + mobile) -----------------------
   Mirrors the sidebar's single-account card: the balance is the headline
   number (large, green), equity sits beside it smaller/dimmer, and the
   remaining details (account id, broker, mode, EA count) become compact
   chips instead of a label/value grid — far easier to scan than the old
   uniform meta-grid where the balance had no more weight than "Mode". */
.acct-summary-card {
  /* Full-width card (was capped at 460px): the account view has the room and
     a stretched card reads as a proper header panel rather than a floating
     box. */
  margin-top: 10px; padding: 16px 18px; border-radius: 12px;
  background: var(--sunken); border: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: 14px; width: 100%;
}
/* The gear now lives inside the card (top-right, beside the status), so the
   old external actions slot isn't needed on this view. */
.acct-head .detail-actions { display: none; }
.acct-sum-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.acct-sum-gear {
  flex-shrink: 0;
  /* Sits inside the card, so it drops the button chrome (box + border) and
     reads as a plain icon affordance. */
  background: none; border: none; width: auto; height: auto; padding: 2px;
  color: var(--txt-faint);
}
.acct-sum-gear:hover { color: var(--txt); }
/* Account number leads the identity line, with the status pill beside it. */
.acct-sum-ident { display: flex; align-items: center; gap: 10px; min-width: 0; }
.acct-sum-num {
  font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 600;
  color: var(--txt-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.acct-sum-status {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 3px 9px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--line-soft); color: var(--txt-faint);
}
.acct-sum-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.acct-sum-status.trading { color: var(--trading); }
.acct-sum-status.standby { color: var(--standby); }
.acct-sum-status.closed  { color: var(--closed); }
.acct-sum-status.blocked { color: var(--blocked); }
.acct-sum-status.offline { color: var(--offline); }
.acct-sum-status.algo_off { color: var(--blocked); }
.acct-sum-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--txt-faint); }
/* Balance is the headline figure on this card and the card is tall (it
   stretches to the EA stack beside it), so both numbers are scaled up —
   previously they left the card looking mostly empty. */
.acct-sum-balance { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; padding: 2px 0 4px; }
.acct-sum-bal-val {
  font-family: 'JetBrains Mono', monospace; font-size: 30px; font-weight: 600;
  color: var(--trading); line-height: 1.05; letter-spacing: -0.015em;
}
.acct-sum-eq-line { display: inline-flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.acct-sum-eq-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--txt-faint); }
.acct-sum-eq-val { font-family: 'JetBrains Mono', monospace; font-size: 16px; font-weight: 500; color: var(--txt-dim); line-height: 1.1; }
/* Remaining identifiers as a labelled grid — scannable in a fixed order
   rather than a wrapping row of chips whose positions shift about. */
.acct-sum-facts {
  /* Broker names are long; Mode and EAs are a word or a digit. Splitting the
     row 44/28/28 instead of evenly stops the broker wrapping while the short
     fields sit in mostly empty space. Falls back to auto-fit when the EAs
     fact isn't present (single-EA accounts). */
  display: grid; grid-template-columns: 44% 28% 28%; gap: 12px 16px;
  padding-top: 12px; border-top: 1px solid var(--line-soft);
}
.acct-sum-facts:has(> .acct-fact:nth-child(2):last-child) { grid-template-columns: 62% 38%; }
.acct-fact { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.acct-fact-lbl { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--txt-faint); }
.acct-fact-ic { width: 12px; height: 12px; flex-shrink: 0; opacity: 0.8; }
/* EA detail reuses the account card shell, with denser facts (there are more
   of them) and its action icons inside the card. */
/* "This EA mirrors trades from account X" — shown on a copy-trade target
   (usually an MT4 agent, which runs no strategy of its own). */
.ea-mirror-note {
  font-size: 10.5px; color: var(--txt-faint); margin: 2px 0 8px;
  display: flex; align-items: center; gap: 4px;
}
.ea-mirror-note b { color: var(--txt-dim); font-family: 'JetBrains Mono', monospace; font-weight: 600; }

/* EA card: the facts are the whole content, so they get the room. A fixed
   two-column grid keeps labels aligned down the card (auto-fit reflowed them
   into ragged rows), and the grid grows to fill the card so the bottom edge
   isn't left empty. */
.ea-card .acct-sum-facts { border-top: none; padding-top: 2px; }
.ea-card { display: flex; flex-direction: column; }
.ea-card .acct-sum-facts { flex: 1 1 auto; align-content: space-between; }
.ea-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }
/* Values readable but not shouting; labels lifted out of near-invisibility so
   you can tell what you're looking at. Previously the values were bold and
   full-contrast while their labels sat at the faintest tone on the palette. */
.ea-facts .acct-fact-val { font-size: 13.5px; font-weight: 500; color: var(--txt-dim); }
.ea-facts .acct-fact-lbl { font-size: 10px; font-weight: 600; letter-spacing: 0.06em; color: var(--txt-faint); }
.ea-facts .acct-fact-ic { width: 13px; height: 13px; }
.ea-card-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.ea-ping {
  display: inline-flex; align-items: baseline; gap: 5px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--txt-faint);
}
.ea-ping-lbl { font-size: 8.5px; text-transform: uppercase; letter-spacing: 0.07em; }
/* The pill is inline-flex inside a column flex cell, so it stretched to the
   full cell width and trailed a long empty tail past its text. Shrink it to
   its content. */
.ea-facts .breakout-val { font-size: 12.5px; align-self: flex-start; width: fit-content; max-width: 100%; }
.acct-fact-val {
  font-family: 'JetBrains Mono', monospace; font-size: 12.5px; font-weight: 500; color: var(--txt-dim);
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  /* Broker names are long and Mode is always short ("demo"/"real"), so split
     the row ~65/35 instead of evenly — otherwise the broker wrapped to two
     lines while Mode sat in mostly empty space. */
  .acct-sum-facts { grid-template-columns: 1.9fr 1fr; gap: 10px 12px; }
  .acct-sum-facts .fact-wide { grid-column: span 1; }
  .acct-sum-facts .breakout-cell { grid-column: 1 / -1; }
  /* The EA card's facts stay an even 2-up grid (its values are short), so
     Location and Breakout pair on the second row directly under
     EA / EA version instead of Breakout claiming a full row of its own. */
  .ea-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ea-facts .breakout-cell { grid-column: span 1; }
  .ea-facts .breakout-val { white-space: nowrap; max-width: none; overflow: visible; text-overflow: clip; width: fit-content; font-size: 10.5px; }
  .acct-sum-num { font-size: 12px; }
  .acct-sum-ident { flex-wrap: wrap; gap: 6px 8px; }
  .acct-summary-card { padding: 13px 14px; }
  .acct-sum-bal-val { font-size: 25px; }
  .acct-sum-eq-val { font-size: 14px; }
}
/* ---- Account panel: one full-width surface, EAs nested inside it ---------
   Reads as "these EAs belong to this account" rather than two unrelated
   cards side by side. */
.acct-panel {
  width: 100%; border: 1px solid var(--line); border-radius: 14px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  overflow: hidden;
}
.acct-panel-top { padding: 20px 22px 18px; }
.acct-panel-top .title-row { margin-bottom: 14px; }
/* Nested EA area: visually recessed so it reads as contained by the account. */
.acct-panel-eas {
  padding: 16px 22px 20px; background: var(--sunken);
  border-top: 1px solid var(--line-soft);
}
.acct-panel-eas-lbl {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--txt-faint); margin-bottom: 12px;
}
/* Several EAs sit side by side and wrap; one fills the row. Each .ea-item is
   a single grid cell holding that EA's heading AND its card. */
.acct-panel-eas .ea-stack {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px; align-items: stretch;
}
/* Uptime strips: one row per EA, one bar per day. */
.uptime-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; min-width: 0; }
.uptime-row + .uptime-row { border-top: 1px solid var(--line-soft); }
.uptime-row.no-name .uptime-bars { margin-left: 0; }
.uptime-name {
  flex: 0 0 190px; font-size: 12px; color: var(--txt-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.uptime-bars { display: flex; gap: 3px; flex: 1 1 auto; min-width: 0; }
.uptime-bar { flex: 1 1 0; height: 22px; border-radius: 3px; background: var(--line); cursor: default; }
.uptime-bar.good   { background: var(--trading); }
.uptime-bar.warn   { background: #e0a010; }
.uptime-bar.bad    { background: var(--blocked); }
.uptime-bar.nodata { background: var(--line); opacity: 0.55; }
.uptime-pct {
  flex: 0 0 auto; font-family: 'JetBrains Mono', monospace; font-size: 12px;
  font-weight: 600; color: var(--txt-dim); min-width: 62px; text-align: right;
}
@media (max-width: 600px) {
  .uptime-name { flex-basis: 110px; font-size: 11px; }
  .uptime-bar { height: 18px; }
}

.ea-item { display: flex; flex-direction: column; min-width: 0; }
.ea-item > .acct-summary-card { flex: 1 1 auto; }
.acct-panel-eas .ea-card { background: var(--panel); border: 1px solid var(--line-soft); }
.acct-panel-eas .title-row { margin-bottom: 8px; gap: 8px; }
/* Long EA names must not squeeze the chips out of the row. */
.acct-panel-eas .title-row h3 { font-size: 15px; min-width: 0; }
.acct-panel-eas .title-row .symbol-chip { flex: 0 0 auto; }
.acct-panel-eas .title-row .solo-gear { margin-left: auto; }
.acct-summary-card.bare { border: none; background: none; padding: 0; }
@media (max-width: 600px) {
  .acct-panel-top { padding: 16px 15px 14px; }
  .acct-panel-eas { padding: 14px 15px 16px; }
  .acct-panel-eas .ea-stack { grid-template-columns: 1fr; }
}

/* Solo (1 account, 1 EA) merged header: account card left, EA card right. */
/* Columns stretch so the account card runs the full height of the EA stack
   beside it — with a single EA that makes the two cards exactly equal. */
.solo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: stretch; width: 100%; }
.solo-grid > .title { display: flex; flex-direction: column; min-width: 0; }
.solo-grid > .title > .acct-summary-card { flex: 1 1 auto; }
/* Two EAs: pin the account facts to the bottom edge instead of leaving a gap
   under them (see factsAtBottom in accountCardHtml). */
.acct-summary-card.facts-bottom .acct-sum-facts { margin-top: auto; }
/* Let the last EA card take any slack in its column, so with a single EA it
   ends up exactly as tall as the account card beside it. With two or more the
   EA column is the taller one, so there's no slack and nothing stretches. */
.ea-stack > .ea-item:last-child > .acct-summary-card { flex: 1 1 auto; }
.solo-grid > .title { width: auto; }
/* Left card's title row: name + id chip on the left, the single merged
   settings gear pinned to the far right of the same line. */
/* Fixed-height title rows so both cards start at the same y, regardless of
   whether one side's title wraps or carries an extra chip. */
.solo-grid > .title > .title-row { display: flex; align-items: center; gap: 8px; min-height: 34px; }
.solo-gear { margin-left: auto; flex-shrink: 0; }
/* More than one EA on the account: their cards stack down the right column. */
/* No flex `gap` here: it would sit between an EA's title and its own card and
   eat exactly the slack the last card needs to stretch to the account card's
   height. Spacing between EA groups is a margin on each following title row
   instead. */
.ea-stack { display: flex; flex-direction: column; gap: 0; min-width: 0; }
/* Both columns space their title the same way, so the two cards start at the
   same y and end up the same height when there's one EA. */
.solo-grid .title-row { margin-bottom: 10px; }

@media (max-width: 900px) { .solo-grid { grid-template-columns: 1fr; } }

/* --- Unified section headings (statistics / calendar / trades) --- */
.section-block { margin-top: 30px; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin: 0 0 10px;
}
/* One shared look for every section heading — Statistics, Trade calendar,
   Trades and EA Location(s). They previously came from three different rules
   (.analytics-head .l, .section-title and .panel-head h2) at three different
   sizes and weights. */
.section-title,
.chart-head .l,
.analytics-head > .l,
.mapwrap .panel-head h2 {
  font-size: 15px; font-weight: 700; text-transform: none;
  letter-spacing: -0.01em; color: var(--txt); line-height: 1.2;
}

/* --- Modal backdrop must cover the whole screen on mobile --- */
.modal-backdrop { z-index: 99999; height: var(--vh100); }
/* The mobile header is sticky with its own opaque background; drop it behind
   the backdrop while a modal is open, or it shows through at the top. */
body.modal-open .topbar-main { z-index: 0; }
.ro-badge { font-size: 10px; padding: 2px 7px; border-radius: 6px; background: var(--sunken); border: 1px solid var(--line); color: var(--txt-faint); margin-left: 6px; }

/* Equity sits at the far right of the balance row, labelled above its value
   the same way the balance is, just smaller and dimmer. */
.uac-bal-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.uac-eq { display: flex; flex-direction: column; gap: 3px; align-items: flex-end; text-align: right; }
.uac-eq-lbl { font-size: 9px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--txt-faint); }
.uac-eq-val { font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--txt-dim); line-height: 1.1; }

/* Number input with a trailing unit (e.g. "k" for thousands) */
.suffix-input { position: relative; display: inline-flex; width: fit-content; align-self: flex-start; align-items: center; }
.suffix-input input { width: 82px; padding-right: 22px; }
.suffix-input-unit { position: absolute; right: 9px; font-size: 12px; color: var(--txt-faint); pointer-events: none; }

/* Breakout reads as a small status badge rather than plain text */
.breakout-val { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px; font-size: 11px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.breakout-val::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.breakout-val.hit { color: var(--blocked); background: color-mix(in srgb, var(--blocked) 12%, transparent); font-weight: 600; }
.breakout-val.none { color: var(--trading); background: color-mix(in srgb, var(--trading) 12%, transparent); }
.breakout-val.unknown { color: var(--txt-faint); background: var(--sunken); }

/* Balance on the user's account card should carry the eye */
.uac-bal-val { color: var(--trading) !important; }

/* Small warning icon next to an account's status dot when any of its EAs
   has algo trading disabled — admin-only. */
.algo-warn { color: var(--blocked); font-size: 12px; margin-left: -2px; }
/* Amber: an EA is waiting for authorization. Deliberately a different colour
   from the red algo-off marker — this needs an admin action, not a fix. */
.auth-warn { color: #e0a010; font-size: 12px; margin-left: -2px; }
/* MT4 Agent without a copy mapping: a filled "!" disc, so it can't be
   mistaken for the outline ⚠ markers above. */
.map-warn {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 50%; margin-left: -2px;
  background: #e0a010; color: #fff; font-size: 10px; font-weight: 800; line-height: 1;
}

/* --- Manual trading modal: platform badges, copy-mapping cards, colored side buttons --- */
.plat-chip {
  display: inline-block; font-size: 9.5px; font-weight: 700; letter-spacing: 0.04em;
  padding: 2px 6px; border-radius: 5px; margin-right: 6px; vertical-align: middle;
}
.plat-chip.mt5 { background: color-mix(in srgb, var(--standby) 18%, transparent); color: var(--standby); }
.plat-chip.mt4 { background: color-mix(in srgb, #f5b544 22%, transparent); color: #c9860a; }

.copy-card {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  background: var(--sunken); border: 1px solid var(--line-soft); border-radius: 10px;
  padding: 10px 14px; margin-bottom: 8px;
}
/* Source and target always land on their own lines (the labels are long), so
   the connector points DOWN between them — a right-pointing arrow implied a
   value to its right that was never actually there. */
.copy-card-row { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.copy-ea-line { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.copy-role {
  flex: 0 0 auto; width: 30px; font-size: 9px; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--txt-faint);
}
.copy-arrow { color: var(--txt-faint); font-size: 12px; line-height: 1; padding-left: 9px; }
.copy-ea { font-family: 'JetBrains Mono', monospace; min-width: 0; overflow-wrap: anywhere; }
.copy-card-controls { display: flex; align-items: center; gap: 10px; }
.copy-scale-edit {
  display: inline-flex; align-items: center; gap: 3px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700;
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px;
}
.copy-scale-input {
  width: 42px; background: none; border: none; color: var(--txt); font: inherit;
  padding: 0; text-align: right;
}
.copy-scale-input:focus { outline: none; color: var(--standby); }
/* Desired-lot-size control: shows the master EA's current lot size, then the
   editable lot size the target should trade. Wider than the old scale input
   because it holds a real lot value plus the "master: N lots →" prefix. */
.copy-lots-edit {
  display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700;
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px;
}
.copy-lots-input {
  width: 56px; background: none; border: none; color: var(--txt); font: inherit;
  padding: 0; text-align: right;
}
.copy-lots-input:focus { outline: none; color: var(--standby); }
.copy-card-controls { flex-wrap: wrap; row-gap: 8px; }
.copy-add-form {
  margin-top: 10px; padding: 12px 14px; background: var(--sunken);
  border: 1px solid var(--line-soft); border-radius: 10px;
  display: flex; flex-direction: column; gap: 14px;
}

.mini-switch { position: relative; display: inline-block; width: 34px; height: 19px; }
.mini-switch input { opacity: 0; width: 0; height: 0; }
.mini-switch span {
  position: absolute; inset: 0; background: var(--line); border-radius: 999px;
  transition: background .15s; cursor: pointer;
}
.mini-switch span::before {
  content: ''; position: absolute; width: 15px; height: 15px; left: 2px; top: 2px;
  background: #fff; border-radius: 50%; transition: transform .15s;
}
.mini-switch input:checked + span { background: var(--trading); }
.mini-switch input:checked + span::before { transform: translateX(15px); }

.side-toggle-row { display: flex; flex-direction: row; gap: 10px; }
.field-row-inline { display: flex; flex-direction: row; gap: 10px; }
.field-row-inline > div { min-width: 0; }
.field-row-inline input { width: 100%; box-sizing: border-box; }
.side-btn {
  flex: 1; padding: 10px; border-radius: 8px; border: 1.5px solid var(--line);
  background: var(--sunken); color: var(--txt); font-weight: 700; font-size: 13px;
  cursor: pointer; transition: all .12s;
}
.side-btn.buy.on { background: color-mix(in srgb, var(--trading) 18%, transparent); border-color: var(--trading); color: var(--trading); }
.side-btn.sell.on { background: color-mix(in srgb, var(--blocked) 18%, transparent); border-color: var(--blocked); color: var(--blocked); }

/* Signal-only mapping indicator and its inline toggle label */
.signal-only-chip {
  font-size: 10px; padding: 2px 7px; border-radius: 6px;
  background: color-mix(in srgb, #f5b544 22%, transparent); color: #c9860a; font-weight: 600;
}
.mini-switch-label { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--txt-dim); }

/* Read-only source-code viewer inside the Download EA modal */
.source-view {
  width: 100%; height: 480px; resize: vertical;
  font-family: 'JetBrains Mono', monospace; font-size: 11.5px; line-height: 1.55;
  white-space: pre; overflow: auto; background: var(--sunken); color: var(--txt);
  border: 1px solid var(--line); border-radius: 8px; padding: 12px;
}

/* 2FA login step */
.btn-link-plain {
  background: none !important; border: none !important; color: var(--txt-faint) !important;
  font-size: 12px !important; font-weight: 400 !important; margin-top: 0 !important;
  cursor: pointer; padding: 4px 0; text-align: center; text-decoration: underline;
}
.btn-link-plain:hover { color: var(--txt-dim) !important; }
.login-2fa-hint { font-size: 11px; color: var(--txt-faint); text-align: center; margin-top: 2px; }
.otp-input, #login-2fa-code, #login-2fa-setup-code {
  letter-spacing: 0.5em; font-family: 'JetBrains Mono', monospace; text-align: center;
  font-size: 22px; font-weight: 700; padding: 12px 10px 12px 16px !important;
}
.otp-input:focus, #login-2fa-code:focus, #login-2fa-setup-code:focus {
  outline: none; border-color: var(--standby) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--standby) 22%, transparent);
}

/* Two-factor authentication (Settings + enrollment flow) */
.twofa-status-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* Status pill — same look as the other small status tags (--online/-bg were
   never defined, so this used to render as bare text with odd padding). */
.twofa-status {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line-soft); line-height: 1.4;
}
.twofa-status.on { color: var(--trading); border-color: color-mix(in srgb, var(--trading) 40%, transparent); background: color-mix(in srgb, var(--trading) 10%, transparent); }
.twofa-status.off { background: var(--sunken); color: var(--txt-faint); }
.twofa-qr { display: flex; justify-content: center; padding: 14px; background: #fff; border-radius: 10px; width: fit-content; }
.twofa-manual-key {
  font-family: 'JetBrains Mono', monospace; font-size: 15px; font-weight: 600; letter-spacing: 0.04em;
  background: var(--sunken); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 14px; word-break: break-word; user-select: all;
  text-align: center; line-height: 1.7;
}
.twofa-backup-codes {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
  font-family: 'JetBrains Mono', monospace; font-size: 13px; margin-top: 8px;
}
.twofa-backup-codes span {
  background: var(--sunken); border: 1px solid var(--line); border-radius: 6px;
  padding: 7px 10px; text-align: center; user-select: all;
}

/* The account panel draws its own border, so the head's divider doubled up
   with the uptime section's top border — one line is enough. */
.acct-panel-head { border-bottom: none; padding-bottom: 0; }
/* Statistics is its own section: same divider and breathing room as the
   calendar and trades blocks, instead of sitting right under the uptime bars. */
.uptime-block + .analytics-head { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line-soft); }
@media (max-width: 600px) { .uptime-block + .analytics-head { margin-top: 24px; padding-top: 18px; } }

/* Basic-user greeting beside the menu button — shown on phones as well. */
.topbar-user.greet { font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.topbar-user.greet svg { display: none; }
.topbar-user.greet b { font-weight: 700; color: var(--txt); }
.user-menu-who.hidden { display: none; }
@media (max-width: 980px) { .topbar-user.greet { display: flex; font-size: 13px; max-width: 46vw; } }

/* Manage users: which account a user lands on after signing in. */
.user-landing { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 8px; }
.user-landing-lbl { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--txt-faint); }
.user-landing .user-landing-picker { flex: 0 1 auto; min-width: 0; }

/* v2.6.3 — basic user's Settings: trading banner on top, then groups. */
.trade-hero {
  display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--sunken);
}
.trade-hero + .trade-hero { margin-top: -10px; }
.trade-hero.on { border-color: color-mix(in srgb, var(--trading) 45%, transparent); background: color-mix(in srgb, var(--trading) 9%, var(--panel)); }
.trade-hero.partial { border-color: color-mix(in srgb, #e0a010 45%, transparent); background: color-mix(in srgb, #e0a010 8%, var(--panel)); }
.trade-hero-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; background: var(--offline); box-shadow: 0 0 0 5px color-mix(in srgb, var(--offline) 20%, transparent); }
.trade-hero.on .trade-hero-dot { background: var(--trading); box-shadow: 0 0 0 5px color-mix(in srgb, var(--trading) 22%, transparent); }
.trade-hero.partial .trade-hero-dot { background: #e0a010; box-shadow: 0 0 0 5px color-mix(in srgb, #e0a010 22%, transparent); }
.trade-hero-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 auto; }
.trade-hero-label { font-size: 17px; font-weight: 700; color: var(--txt); letter-spacing: -0.01em; }
.trade-hero-sub { font-size: 12px; color: var(--txt-dim); }
.trade-hero-acct { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; text-align: right; flex-shrink: 0; }
.trade-hero-acct small { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--txt-faint); }
.trade-hero-acct b { font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--txt); }
.trade-hero-acct span { font-size: 11px; color: var(--txt-faint); }
@media (max-width: 600px) {
  .trade-hero { flex-wrap: wrap; padding: 16px; gap: 12px 14px; }
  .trade-hero-acct { flex-basis: 100%; flex-direction: row; align-items: baseline; gap: 8px; text-align: left;
    padding-top: 10px; border-top: 1px solid var(--line-soft); }
}
/* ---- Settings cards: same shape as the Notifications card ----
   An icon + title header, then the settings as a list of rows on a lighter
   panel: name and hint on the left, the control on the right, every control
   centred on its row. */
.set-card {
  border: 1px solid var(--line-soft); border-radius: 12px; background: var(--sunken);
  padding: 14px 18px 16px; display: flex; flex-direction: column; gap: 12px;
}
.set-card-head { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 700; color: var(--txt); }
.set-card-head svg { width: 18px; height: 18px; color: var(--txt-dim); flex-shrink: 0; }
.set-card-head small { font-size: 11px; font-weight: 500; color: var(--txt-faint); }
.set-card-list { border: 1px solid var(--line-soft); border-radius: 10px; background: var(--panel); overflow: hidden; }
.settings-tabbed .set-card-list > .field-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "label control" "hint control";
  align-items: center; column-gap: 18px; row-gap: 2px; padding: 12px 14px; margin: 0;
}
/* No hint: one line, so the label sits level with its control. */
.settings-tabbed .set-card-list > .field-row:not(:has(> .field-hint)) { grid-template-areas: "label control"; }
.set-card-list > .field-row + .field-row { border-top: 1px solid var(--line-soft); }
.settings-tabbed .set-card-list > .field-row > .field-label {
  grid-area: label; margin: 0; align-self: end;
  font-size: 13px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--txt);
}
.settings-tabbed .set-card-list > .field-row:not(:has(> .field-hint)) > .field-label { align-self: center; }
.set-card-list > .field-row > .field-hint { grid-area: hint; margin: 0; align-self: start; font-size: 11px; color: var(--txt-faint); line-height: 1.35; }
.set-card-list > .field-row > :not(.field-label):not(.field-hint) { grid-area: control; justify-self: end; align-self: center; margin: 0; }
.set-card-list .field-inline input { width: 190px; }
.set-card-list .tz-select { max-width: 230px; }
.set-card-list .twofa-status-row { margin: 0; }
@media (max-width: 600px) {
  .set-card { padding: 12px 12px 14px; }
  .settings-tabbed .set-card-list > .field-row,
  .settings-tabbed .set-card-list > .field-row:not(:has(> .field-hint)) {
    grid-template-columns: 1fr; grid-template-areas: "label" "control" "hint"; row-gap: 8px;
  }
  .settings-tabbed .set-card-list > .field-row:not(:has(> .field-hint)) { grid-template-areas: "label" "control"; }
  .set-card-list > .field-row > :not(.field-label):not(.field-hint) { justify-self: start; }
  .set-card-list .field-inline { width: 100%; }
  .set-card-list .field-inline input { width: auto; flex: 1 1 auto; min-width: 0; }
  .set-card-list .tz-select { max-width: none; width: 100%; }
}

/* Basic user's EA card: a header naming the object and its status, a divider,
   then its three facts side by side. */
.user-ea-card { gap: 0; }
.user-ea-head { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.user-ea-icon {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 30px; height: 30px; border-radius: 8px; background: var(--sunken); color: var(--txt-dim);
  border: 1px solid var(--line-soft);
}
.user-ea-icon .acct-fact-ic { width: 19px; height: 19px; margin: 0; opacity: 1; }
.user-ea-name { font-size: 14px; font-weight: 700; color: var(--txt); min-width: 0; }
/* Status sits right after the name it describes — not pushed to the far edge
   of a wide card — and the facts keep a readable width on large screens. */
.user-ea-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; max-width: 560px; }
.user-ea-facts .acct-fact-val { font-size: 13px; }
@media (max-width: 380px) { .user-ea-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Settings tab bar on phones: five admin tabs don't fit one line, so the bar
   takes the full width and wraps into even rows instead of being cut off. */
@media (max-width: 600px) {
  #settings-tab-seg { display: flex; flex-wrap: wrap; width: 100%; align-self: stretch; }
  #settings-tab-seg button { flex: 1 1 auto; white-space: nowrap; padding: 6px 10px; text-align: center; }
}
/* Wide screens: the EA card is one row — identity + status on the left,
   then its facts — instead of a header stretched across the whole width. */
@media (min-width: 901px) {
  /* Wide screens: identity + status on the left, the three facts grouped on
     the right as tidy columns (thin dividers between them) — instead of being
     spread across the card with a large empty area behind them. */
  .user-ea-card { flex-direction: row; align-items: center; gap: 24px; }
  .user-ea-card .user-ea-head { border-bottom: none; margin: 0; padding: 0; flex: 0 0 auto; }
  .user-ea-card .user-ea-facts { display: flex; margin-left: auto; gap: 0; max-width: none; padding: 0; }
  .user-ea-card .user-ea-facts .acct-fact { min-width: 128px; padding: 0 0 0 22px; margin-left: 22px; border-left: 1px solid var(--line-soft); }
  .user-ea-card .user-ea-facts .acct-fact:first-child { border-left: none; margin-left: 0; padding-left: 0; }
  /* Account facts above it follow the same right edge: broker on the left,
     mode on the right, aligned with the EA facts' last column. */
  .acct-panel.user-view .acct-panel-top .acct-sum-facts { display: flex; justify-content: space-between; }
  /* 19px = the EA card's padding + border, so Mode sits exactly over Latency. */
  .acct-panel.user-view .acct-panel-top .acct-sum-facts .fact-narrow { min-width: 128px; margin-right: 19px; }
}

/* ---- Manage users (v2.6.4): one card per profile ---- */
.um, .um-list { display: flex; flex-direction: column; gap: 12px; }
.um-section {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--txt-faint); margin: 6px 2px -4px;
}
.um-section span { margin-left: 4px; color: var(--txt-dim); }
.um-card {
  border: 1px solid var(--line-soft); border-radius: 12px; background: var(--sunken);
  padding: 14px 18px 14px; display: flex; flex-direction: column; gap: 12px;
}
.um-head { display: flex; align-items: center; gap: 12px; }
.um-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; display: inline-flex;
  align-items: center; justify-content: center; font-size: 14px; font-weight: 700;
  background: var(--panel); color: var(--txt-dim); border: 1px solid var(--line-soft);
}
.um-avatar.admin { background: var(--standby-bg); color: var(--standby); border-color: transparent; }
.um-avatar.add { color: var(--txt-faint); font-size: 18px; font-weight: 500; }
.um-ident { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1 1 auto; }
.um-ident b { font-size: 14px; font-weight: 700; color: var(--txt); }
.um-ident small { font-size: 11px; color: var(--txt-faint); }
.um-you { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--txt-faint); margin-left: 4px; }
.um-rows { border: 1px solid var(--line-soft); border-radius: 10px; background: var(--panel); overflow: hidden; }
.um-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto); align-items: center; gap: 8px 18px; padding: 11px 14px; }
.um-row + .um-row { border-top: 1px solid var(--line-soft); }
.um-row-lbl { display: flex; flex-direction: column; gap: 2px; font-size: 13px; font-weight: 600; color: var(--txt); }
.um-row-lbl small { font-size: 11px; font-weight: 400; color: var(--txt-faint); line-height: 1.35; }
.um-row-ctl { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; justify-content: flex-end; min-width: 0; }
.um-accts .acct-chip { font-size: 11px; }
.um-none { font-size: 12px; color: var(--txt-faint); }
.um-select {
  font-size: 12px; padding: 6px 10px; border-radius: 8px; width: auto; max-width: 240px;
  border: 1px solid var(--line); background: var(--sunken); color: var(--txt); cursor: pointer;
}
.um-meta { font-size: 11.5px; color: var(--txt-faint); }
.um-ip { font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.um-tag {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line-soft); color: var(--txt-faint);
}
.um-tag.ok { color: var(--trading); border-color: color-mix(in srgb, var(--trading) 40%, transparent); background: color-mix(in srgb, var(--trading) 9%, transparent); }
.um-tag.warn { color: #e0a010; border-color: color-mix(in srgb, #e0a010 40%, transparent); }
.um-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.um-actions .um-danger { margin-left: auto; color: var(--blocked); border-color: color-mix(in srgb, var(--blocked) 35%, transparent); }
.um-actions .um-danger:hover { background: color-mix(in srgb, var(--blocked) 10%, transparent); }
.um-add-row { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 8px; }
.um-add-row input, .um-add-row select {
  min-width: 0; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel); color: var(--txt); font-family: inherit; font-size: 13px;
}
.um .users-legend { margin: 0 2px; }
@media (max-width: 600px) {
  .um-card { padding: 12px; }
  .um-row:not(.um-row-inline) { grid-template-columns: 1fr; }
  .um-row:not(.um-row-inline) .um-row-ctl { justify-content: flex-start; }
  .um-select { max-width: 100%; }
  .um-add-row { grid-template-columns: 1fr 1fr; }
  .um-actions .um-danger { margin-left: 0; }
}

/* Admin Notifications: the test sender is an occasional tool → a dialog. */
.na-test-open-row { display: flex; justify-content: flex-end; }
.na-test-open-row .btn { display: inline-flex; align-items: center; gap: 7px; color: var(--txt-dim); }
.na-test-open-row .btn svg { width: 14px; height: 14px; }
.na-test-dialog {
  margin: auto;   /* the global reset zeroes margins, which un-centres a dialog */
  width: min(520px, 92vw); max-height: 86vh; padding: 0; border: 1px solid var(--line); border-radius: 14px;
  background: var(--panel); color: var(--txt); box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.na-test-dialog::backdrop { background: rgba(10, 14, 22, 0.55); }
.na-test-dialog-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--line-soft); font-size: 14px;
}
.na-test-dialog-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.na-test-dialog-body .field-row { display: flex; flex-direction: column; gap: 6px; }
.na-test-dialog-body .field-label { font-size: 12px; font-weight: 600; color: var(--txt); text-transform: none; letter-spacing: 0; }
.na-test-dialog-body input[type=text], .na-test-dialog-body textarea {
  padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--sunken);
  color: var(--txt); font-family: inherit; font-size: 13px;
}
.na-test-dialog-body .na-send-row { margin-top: 4px; }

/* ---- v2.6.5 — phones ----------------------------------------------------
   Basic EA card: on the stacked phone layout the status sits at the right
   end of the header (on wide screens it stays next to the name). */
@media (max-width: 900px) {
  .user-ea-head .acct-sum-status { margin-left: auto; }
}

/* Settings on a phone: lighter and tighter. The outer card chrome goes (the
   section title + icon is enough to group), leaving one surface per group
   instead of a card inside a card; rows are shorter; and settings with a
   compact control (switch, status, theme) keep it on the right of the name
   instead of each taking three stacked lines. Only wide controls — text
   fields, selects, segmented choices, the zoom stepper — drop below. */
@media (max-width: 600px) {
  .settings-tabbed #settings-tab-content { gap: 18px; }
  /* Each group keeps its own framed card, as on desktop — that frame is what
     separates the sections — just with tighter padding on a phone. */
  .set-card, .push-card, .na-card { padding: 12px 12px 14px; gap: 10px; border-radius: 12px; }
  .set-card-head, .push-card-title { font-size: 13px; gap: 8px; }
  .na-card-head { margin-bottom: 8px; }
  .na-card-head h4 { font-size: 13px; gap: 8px; }
  .set-card-head svg, .push-card-title svg, .na-card-head h4 svg { width: 16px; height: 16px; }
  .set-card-head, .push-card-head, .na-card-head { padding: 0 2px; }
  .push-card-note, .push-card-foot, .na-card > .field-hint { padding: 0 2px; }

  .settings-tabbed .set-card-list > .field-row,
  .settings-tabbed .set-card-list > .field-row:not(:has(> .field-hint)) {
    grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label control" "hint control";
    column-gap: 12px; row-gap: 2px; padding: 10px 12px;
  }
  .settings-tabbed .set-card-list > .field-row:not(:has(> .field-hint)) { grid-template-areas: "label control"; }
  .set-card-list > .field-row > :not(.field-label):not(.field-hint) { justify-self: end; }
  .settings-tabbed .set-card-list > .field-row:has(.field-inline, .tz-select, .zoom-control, .seg, #twofa-enable-btn) {
    grid-template-columns: 1fr; grid-template-areas: "label" "hint" "control"; row-gap: 4px;
  }
  .set-card-list > .field-row:has(.field-inline, .tz-select, .zoom-control, .seg) > :not(.field-label):not(.field-hint) {
    justify-self: stretch; margin-top: 6px;
  }
  .set-card-list > .field-row:has(.zoom-control, .seg, #twofa-enable-btn) > :not(.field-label):not(.field-hint) { justify-self: start; }
  .settings-tabbed .set-card-list > .field-row > .field-label { font-size: 13px; }
  .set-card-list > .field-row > .field-hint { font-size: 10.5px; }
  .set-card-list .twofa-status-row { gap: 8px; }

  .push-type-row { padding: 10px 12px; }
  .push-type-text b { font-size: 13px; }
  .push-type-text small { font-size: 10.5px; }

  .trade-hero { padding: 14px; }
  .trade-hero-label { font-size: 15px; }

  /* Tabs: smaller, still wrapping so none is cut off. */
  #settings-tab-seg button { font-size: 11.5px; padding: 6px 8px; }
  .um-card { padding: 12px; gap: 10px; }
  .um-row { padding: 10px 12px; }
  .na-device, .na-dev-owner { padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 600px) { .modal.settings-tabbed .modal-body { padding: 14px; } }
/* Phone: Settings uses nearly the whole screen. vw/vh are divided by the UI
   zoom (--vw100/--vh100), otherwise a 85% display size shrank the window to
   ~80% of the width and left large empty bands above and below it. One fixed
   height for every tab, so switching tabs doesn't make the window jump. */
@media (max-width: 600px) {
  .modal.settings-tabbed {
    width: calc(var(--vw100) * 0.95); max-width: none;
    height: calc(var(--vh100) * 0.88) !important; max-height: none;
  }
}

.na-dialog-x {
  background: none; border: none; color: var(--txt-faint); flex-shrink: 0;
  font-size: 17px; line-height: 1; cursor: pointer; padding: 4px 7px; border-radius: 6px;
}
.na-dialog-x:hover { color: var(--txt); background: var(--hover); }

/* Advanced tab: each tool's own content sits on the lighter inner panel. */
.adv-pane { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 600px) { .adv-pane { padding: 12px; } }

.adv-foot { padding: 12px 14px; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 8px; }
.adv-foot-row { display: flex; align-items: center; gap: 12px; }
.adv-foot .field-hint { margin: 0; font-size: 11px; color: var(--txt-faint); }
.adv-pane > p:not(.field-hint) { font-size: 13px; color: var(--txt-dim); }
.adv-pane p.dim { font-size: 13px; color: var(--txt-faint); }

/* ===================== v2.6.9 — motion, onboarding, tour ===================== */
@keyframes cc-fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes cc-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cc-pop { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }

/* App appears after sign-in; the account view eases in when it changes
   (sections one after another, a few ms apart). */
#app.app-enter { animation: cc-fade 0.35s ease both; }
.login-card { animation: cc-pop 0.35s cubic-bezier(.2,.8,.2,1) both; }
.detail-inner.view-enter > * { animation: cc-fade-up 0.38s cubic-bezier(.2,.8,.2,1) both; }
.detail-inner.view-enter > *:nth-child(2) { animation-delay: 0.03s; }
.detail-inner.view-enter > *:nth-child(3) { animation-delay: 0.06s; }
.detail-inner.view-enter > *:nth-child(4) { animation-delay: 0.09s; }
.detail-inner.view-enter > *:nth-child(5) { animation-delay: 0.12s; }
.detail-inner.view-enter > *:nth-child(n+6) { animation-delay: 0.15s; }
.stat-grid > * { animation: cc-fade 0.3s ease both; }
.account-head, .ea-sub-row { transition: background-color 0.18s ease; }

/* Modals: backdrop fades, the window rises in; tab content cross-fades. */
.modal-backdrop:not(.hidden) { animation: cc-fade 0.2s ease both; }
.modal-backdrop:not(.hidden) > .modal { animation: cc-pop 0.26s cubic-bezier(.2,.8,.2,1) both; }
#settings-tab-content { animation: cc-fade 0.22s ease both; }
.na-test-dialog[open] { animation: cc-pop 0.24s cubic-bezier(.2,.8,.2,1) both; }

/* Thin progress bar at the very top for waits the user caused. */
#page-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0; z-index: 200001; pointer-events: none;
  background: linear-gradient(90deg, var(--standby), var(--trading)); opacity: 0;
  box-shadow: 0 0 8px color-mix(in srgb, var(--trading) 60%, transparent);
}
#page-progress.run { opacity: 1; width: 70%; transition: width 1.6s cubic-bezier(.1,.6,.2,1), opacity 0.2s; }
#page-progress.run.done { width: 100%; opacity: 0; transition: width 0.25s ease, opacity 0.3s ease 0.2s; }

/* First sign-in: display name card, in the style of the sign-in screen. */
.onb-overlay {
  position: fixed; inset: 0; z-index: 200000; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 0.25s ease;
}
.onb-overlay.in { opacity: 1; }
.onb-card {
  width: 360px; max-width: 100%; background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line); border-radius: 16px; padding: 28px 26px 22px;
  display: flex; flex-direction: column; gap: 12px; box-shadow: 0 24px 60px rgba(0,0,0,0.25);
  transform: translateY(12px) scale(0.98); transition: transform 0.3s cubic-bezier(.2,.8,.2,1);
}
.onb-overlay.in .onb-card { transform: none; }
.onb-badge { font-size: 28px; line-height: 1; }
.onb-card h2 { font-size: 19px; font-weight: 700; color: var(--txt); letter-spacing: -0.01em; }
.onb-sub { font-size: 12.5px; color: var(--txt-dim); line-height: 1.5; margin-top: -4px; }
.onb-card label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--txt-dim); margin-top: 4px; }
.onb-card input {
  background: var(--sunken); border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px;
  color: var(--txt); font-family: inherit; font-size: 15px;
}
.onb-card input:focus { outline: none; border-color: var(--standby); box-shadow: 0 0 0 3px color-mix(in srgb, var(--standby) 18%, transparent); }
.onb-error { color: var(--blocked); font-size: 12px; min-height: 14px; margin: -4px 0 -2px; }
.onb-primary {
  background: var(--standby); color: #04211c; border: none; border-radius: 9px; padding: 11px;
  font-weight: 700; font-size: 14px; cursor: pointer; font-family: inherit;
}
.onb-link { background: none; border: none; color: var(--txt-faint); font-size: 12px; cursor: pointer; padding: 4px; font-family: inherit; }
.onb-link:hover { color: var(--txt-dim); text-decoration: underline; }

/* Guided tour: an animated spotlight + an explanation card. */
.tour-layer { position: fixed; inset: 0; z-index: 200000; opacity: 0; transition: opacity 0.3s ease; }
.tour-layer.in { opacity: 1; }
.tour-spot {
  position: fixed; border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(5, 7, 11, 0.62), 0 0 0 2px color-mix(in srgb, var(--standby) 70%, transparent);
  transition: top 0.45s cubic-bezier(.2,.8,.2,1), left 0.45s cubic-bezier(.2,.8,.2,1),
              width 0.45s cubic-bezier(.2,.8,.2,1), height 0.45s cubic-bezier(.2,.8,.2,1), box-shadow 0.3s;
}
.tour-spot.none { box-shadow: 0 0 0 9999px rgba(5, 7, 11, 0.62); }
.tour-tip {
  position: fixed; width: 340px; max-width: calc(100vw - 16px); z-index: 1;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.3); display: flex; flex-direction: column; gap: 8px;
  transition: top 0.45s cubic-bezier(.2,.8,.2,1), left 0.45s cubic-bezier(.2,.8,.2,1);
}
.tour-tip.swap .tour-title, .tour-tip.swap .tour-text { animation: cc-fade-up 0.3s ease both; }
.tour-tip.centered { top: 50%; left: 50%; transform: translate(-50%, -50%); width: 380px; transition: none; }
/* Phones: docked above the bottom edge — clear of the rounded corners and
   the home indicator — with tighter spacing so it covers less. */
.tour-tip.docked {
  left: 12px; right: 12px; top: auto; width: auto; max-width: none; transition: none;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px)); padding: 14px 16px 12px; gap: 6px; border-radius: 16px;
}
.tour-tip.docked .tour-title { font-size: 15px; }
.tour-tip.docked .tour-text { font-size: 12.5px; line-height: 1.45; }
.tour-tip-head { display: flex; align-items: center; justify-content: space-between; }
.tour-count { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; color: var(--txt-faint); text-transform: uppercase; }
.tour-skip { background: none; border: none; color: var(--txt-faint); font-size: 11.5px; cursor: pointer; font-family: inherit; padding: 2px 0; }
.tour-skip:hover { color: var(--txt); }
.tour-title { font-size: 16px; font-weight: 700; color: var(--txt); letter-spacing: -0.01em; }
.tour-text { font-size: 13px; color: var(--txt-dim); line-height: 1.5; }
.tour-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.tour-dots { display: flex; gap: 5px; flex-wrap: wrap; }
.tour-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); transition: background 0.2s, width 0.25s; }
.tour-dots i.on { width: 16px; border-radius: 3px; background: var(--standby); }
.tour-btns { display: flex; gap: 6px; flex-shrink: 0; }
.tour-back, .tour-next { border-radius: 8px; padding: 7px 14px; font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit; }
.tour-back { background: none; border: 1px solid var(--line); color: var(--txt-dim); }
.tour-next { background: var(--standby); border: 1px solid var(--standby); color: #04211c; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; }
}

/* ---- Account list: offline section + expired accounts (v2.7.0) ---- */
.fleet-divider {
  display: flex; align-items: center; gap: 8px; padding: 9px 18px 7px; margin-top: 4px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--txt-faint);
  background: color-mix(in srgb, var(--sunken) 70%, transparent);
  border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
}
.fleet-divider-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--offline); }
.fleet-divider-n {
  margin-left: auto; font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0;
  padding: 1px 7px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line-soft);
}
.account-group.is-offline .acct-name, .account-group.is-offline .ea-sub-name { opacity: 0.72; }
/* Expired: the row itself turns red (fading out to the right) and says so
   in the middle, instead of one more small badge. */
.account-head.expired {
  background: linear-gradient(90deg, color-mix(in srgb, var(--blocked) 22%, transparent), color-mix(in srgb, var(--blocked) 4%, transparent) 75%, transparent);
}
.account-head.expired:hover { background: linear-gradient(90deg, color-mix(in srgb, var(--blocked) 28%, transparent), color-mix(in srgb, var(--blocked) 7%, transparent) 75%, transparent); }
.account-head.expired .acct-name { flex: 0 1 auto; min-width: 0; }
.acct-expired-label {
  flex: 1; text-align: center; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--blocked);
}

.tour-hint {
  display: flex; gap: 8px; align-items: flex-start; margin-top: 2px; padding: 9px 11px; border-radius: 10px;
  font-size: 12px; line-height: 1.45; color: var(--txt-dim);
  background: color-mix(in srgb, var(--standby) 9%, var(--sunken)); border: 1px solid color-mix(in srgb, var(--standby) 22%, transparent);
}
.tour-hint b {
  flex-shrink: 0; font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--standby);
  padding: 2px 6px; border-radius: 5px; background: color-mix(in srgb, var(--standby) 14%, transparent); margin-top: 1px;
}
.tour-tip.swap .tour-hint { animation: cc-fade-up 0.3s ease 0.05s both; }
.tour-tip.docked .tour-hint { font-size: 11.5px; padding: 8px 10px; }

@media (max-width: 600px) { body.tour-running #settings-modal .modal-body { padding-bottom: 60vh; } }

/* ---- v2.7.1: account rows — trial status beside the name, status per EA ---- */
.account-head .acct-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-head-spacer { flex: 1 1 auto; }
.account-head .expiry-badge { margin-left: 2px; }
.ea-sub-status { margin: 0 8px 0 0; font-size: 8.5px; padding: 2px 6px; flex-shrink: 0; }
/* Expired: the whole row is tinted red, and a solid pill with an hourglass
   says so right next to the account it concerns. */
.account-head.expired {
  background: linear-gradient(90deg, color-mix(in srgb, var(--blocked) 16%, transparent), color-mix(in srgb, var(--blocked) 3%, transparent) 70%, transparent);
  box-shadow: inset 3px 0 0 var(--blocked);
}
.account-head.expired:hover { background: linear-gradient(90deg, color-mix(in srgb, var(--blocked) 22%, transparent), color-mix(in srgb, var(--blocked) 5%, transparent) 70%, transparent); }
.account-head.expired .acct-name { color: var(--blocked); }
.acct-expired-pill {
  display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; margin-left: 2px;
  font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; line-height: 1;
  padding: 4px 8px 4px 7px; border-radius: 999px; color: #fff; background: var(--blocked);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--blocked) 35%, transparent);
}
.acct-expired-pill svg { width: 11px; height: 11px; }
/* Offline divider: slimmer, label only. */
.fleet-divider { padding: 5px 18px 4px; margin-top: 2px; font-size: 9px; letter-spacing: 0.12em; }
.fleet-divider-dot { width: 6px; height: 6px; }


/* ===================== v2.7.3 — sign-in screen =====================
   The earlier card layout (brand mark + title, staged steps), in the same
   palette as the rest of the dashboard, with a few refinements. */
.login-screen { padding: 24px; }
.login-card {
  width: 360px; max-width: 100%; padding: 30px 28px 24px; border-radius: 16px; gap: 14px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.18);
  animation: cc-pop 0.4s cubic-bezier(.2,.8,.2,1) both;
}
.login-brand .brand-icon { width: 34px; height: 34px; color: var(--trading); flex-shrink: 0; }
.login-brand h1 { font-size: 19px; letter-spacing: -0.01em; }
.login-card input { padding: 11px 12px; border-radius: 9px; transition: border-color 0.15s, box-shadow 0.15s; }
.login-card input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--standby) 20%, transparent); }
.login-card button[type="submit"], #login-continue-btn, #login-2fa-backup-continue {
  position: relative; padding: 11px; border-radius: 9px; transition: filter 0.15s ease, transform 0.12s ease;
}
.login-card button[type="submit"]:hover, #login-continue-btn:hover { filter: brightness(1.07); }
.login-card button[type="submit"]:active, #login-continue-btn:active { transform: scale(0.99); }
#login-step-username:not(.hidden), #login-step-password:not(.hidden), #login-step-method:not(.hidden), #login-as-row:not(.hidden) {
  animation: cc-fade-up 0.28s cubic-bezier(.2,.8,.2,1) both;
}
/* Loading spinner, error shake, password reveal, Caps Lock hint. */
.login-card button.is-loading { color: transparent !important; pointer-events: none; }
.login-card button.is-loading::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border-radius: 50%; border: 2px solid rgba(4, 33, 28, 0.25); border-top-color: #04211c; animation: lg-spin 0.7s linear infinite;
}
@keyframes lg-spin { to { transform: rotate(360deg); } }
.login-card.shake { animation: lg-shake 0.42s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes lg-shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(3px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 44px; box-sizing: border-box; }
.login-card .pw-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); margin: 0; width: 32px; height: 32px; padding: 6px;
  background: none; border: none; border-radius: 7px; color: var(--txt-faint); box-shadow: none; cursor: pointer;
}
.login-card .pw-eye:hover { color: var(--txt); background: var(--hover); }
.login-card .pw-eye svg { width: 19px; height: 19px; }
.caps-hint { font-size: 11px; font-weight: 600; color: #e0a010; margin-top: -4px; }

/* v2.7.1 tour card: next to its target, with a pointer, and a little more
   presence (accent edge, soft glow, pulsing outline on the spotlight). */
.tour-tip { border-top: 3px solid var(--standby); box-shadow: 0 22px 60px rgba(0,0,0,0.38), 0 0 0 1px color-mix(in srgb, var(--standby) 25%, transparent); }
.tour-tip.arrow-up::before, .tour-tip.arrow-down::before {
  content: ''; position: absolute; left: var(--arrow-x, 40px); width: 14px; height: 14px; margin-left: -7px;
  background: var(--panel); transform: rotate(45deg);
}
.tour-tip.arrow-up::before { top: -9px; border-left: 3px solid var(--standby); border-top: 3px solid var(--standby); }
.tour-tip.arrow-down::before { bottom: -8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tour-spot:not(.none) { animation: tour-pulse 2.2s ease-in-out infinite; }
@keyframes tour-pulse {
  0%, 100% { box-shadow: 0 0 0 9999px rgba(5, 7, 11, 0.62), 0 0 0 2px color-mix(in srgb, var(--standby) 75%, transparent); }
  50% { box-shadow: 0 0 0 9999px rgba(5, 7, 11, 0.62), 0 0 0 6px color-mix(in srgb, var(--standby) 30%, transparent); }
}
@media (max-width: 600px) { .tour-tip { padding: 14px 16px 12px; gap: 6px; } .tour-tip .tour-title { font-size: 15px; } .tour-tip .tour-text { font-size: 12.5px; } }

/* Latency column has a fixed width, so every EA's status chip lines up no
   matter whether the latency reads 2.48 ms or 27.54 ms. */
.ea-sub-meta { min-width: 8.5ch; text-align: right; }
/* No empty strip at the bottom of the sign-in card while there's no error. */
.login-card .login-error:empty { display: none; }

/* ---- trade import (admin) ---- */
.import-modal { width: min(1080px, 96vw); }
.imp-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 1.5px dashed var(--line); border-radius: 12px; background: var(--sunken);
  padding: 34px 18px; cursor: pointer; text-align: center; transition: border-color .15s, background .15s, transform .15s;
}
.imp-drop svg { width: 34px; height: 34px; color: var(--standby); }
.imp-drop:hover, .imp-drop.over { border-color: var(--standby); background: var(--standby-bg); }
.imp-drop.over { transform: scale(1.01); }
.imp-drop.busy { cursor: progress; opacity: .8; }
.imp-drop.busy svg { animation: imp-pulse 1s ease-in-out infinite; }
@keyframes imp-pulse { 50% { transform: translateY(-3px); opacity: .6; } }
.imp-drop-title { font-size: 14px; font-weight: 600; color: var(--txt); }
.imp-drop-sub { font-size: 12px; color: var(--txt-dim); }
.imp-drop-sub u { color: var(--standby); text-decoration-thickness: 1px; }
.imp-msg { margin-top: 12px; font-size: 12.5px; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line); line-height: 1.5; }
.imp-msg.err { background: var(--blocked-bg); border-color: var(--down-border); color: var(--blocked); }
.imp-msg.ok { background: var(--up-bg); border-color: var(--up-border); color: var(--up); }
.imp-msg.warn { background: var(--backtest-bg); border-color: color-mix(in srgb, var(--backtest) 40%, transparent); color: var(--backtest); }
.imp-file { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.imp-file-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 240px; }
.imp-file-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-file-meta { font-size: 11.5px; color: var(--txt-dim); }
.imp-file-figs { display: flex; gap: 12px; align-items: baseline; font-size: 12.5px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.imp-file-figs .up { color: var(--up); } .imp-file-figs .down { color: var(--down); }
.imp-net { font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.imp-net.ok { background: var(--up-bg); color: var(--up); }
.imp-net.bad { background: var(--backtest-bg); color: var(--backtest); }
.imp-controls { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.imp-field { display: flex; flex-direction: column; gap: 5px; flex: 1 1 260px; min-width: 0; }
.imp-field > span:first-child { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--txt-faint); }
.imp-field select { width: 100%; }
.imp-hint { font-size: 11.5px; color: var(--txt-dim); margin: 8px 0 10px; line-height: 1.5; }
.imp-table-wrap { max-height: 46vh; overflow: auto; border: 1px solid var(--line-soft); border-radius: 10px; transition: opacity .2s; }
.imp-table-wrap.loading { opacity: .45; pointer-events: none; }
.imp-table { width: 100%; min-width: 760px; border-collapse: collapse; font-family: 'JetBrains Mono', monospace; font-size: 11.5px; }
.imp-table th { position: sticky; top: 0; background: var(--panel); text-align: left; font-family: 'Space Grotesk'; font-size: 9.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--txt-faint); padding: 8px 9px; border-bottom: 1px solid var(--line); white-space: nowrap; z-index: 1; }
.imp-table td { padding: 6px 9px; border-bottom: 1px solid var(--line-soft); color: var(--txt-dim); white-space: nowrap; }
.imp-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.imp-table td.up { color: var(--up); } .imp-table td.down { color: var(--down); }
.imp-table tr.on td { color: var(--txt); }
.imp-table tr.is-dup td { opacity: .5; }
.imp-st { font-family: 'Space Grotesk'; font-size: 10px; padding: 2px 7px; border-radius: 999px; }
.imp-st.new { background: var(--standby-bg); color: var(--standby); }
.imp-st.ea { background: var(--offline-bg); color: var(--txt-dim); }
.imp-st.re { background: var(--backtest-bg); color: var(--backtest); }
.imp-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.imp-foot-sum { font-size: 12px; color: var(--txt-dim); font-variant-numeric: tabular-nums; }
.imp-foot-sum .up { color: var(--up); } .imp-foot-sum .down { color: var(--down); }
.imp-hist-head { margin: 22px 0 8px; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--txt-faint); }
.imp-hist { display: flex; flex-direction: column; border: 1px solid var(--line-soft); border-radius: 10px; overflow: hidden; }
.imp-hist-empty { font-size: 12px; color: var(--txt-faint); padding: 4px 2px; }
.imp-hist-item { border-bottom: 1px solid var(--line-soft); }
.imp-hist-item:last-child { border-bottom: none; }
.imp-hist-item.open { background: var(--panel-2); }
.imp-hist-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 12px; font-size: 12px; }
.imp-hist-main, .imp-hist-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.imp-hist-acct { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-hist-file { color: var(--txt-dim); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-hist-n { color: var(--txt-dim); white-space: nowrap; font-variant-numeric: tabular-nums; }
.imp-hist-n .up { color: var(--up); } .imp-hist-n .down { color: var(--down); }
.imp-hist-when { color: var(--txt-faint); white-space: nowrap; font-size: 11px; }
.imp-hist-actions { display: flex; align-items: center; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.imp-expand { display: inline-flex; align-items: center; gap: 5px; }
.imp-chev { display: inline-block; font-size: 10px; transition: transform .18s ease; }
.imp-hist-item.open .imp-chev { transform: rotate(180deg); }
.imp-inbal { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--txt-dim); cursor: pointer; white-space: nowrap; }
.imp-hist-trades { padding: 0 12px 10px; display: flex; flex-direction: column; gap: 4px; }
.imp-hist-trades[hidden] { display: none; }
.imp-loading { font-size: 11.5px; padding: 4px 0; }
.imp-trade {
  display: grid; grid-template-columns: 18px minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1.2fr) auto 28px;
  gap: 10px; align-items: center; padding: 6px 10px; border-radius: 8px; background: var(--sunken);
  font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--txt-dim); transition: opacity .2s;
}
.imp-trade.single { margin: 0 12px 10px; grid-template-columns: 18px minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1.2fr) auto; }
.imp-trade.removing { opacity: .35; }
.imp-trade-when, .imp-trade-sym, .imp-trade-px { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-trade-pl { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.imp-trade-pl.up { color: var(--up); } .imp-trade-pl.down { color: var(--down); }
.imp-trade-del { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; border: none; background: none; color: var(--txt-faint); cursor: pointer; }
.imp-trade-del svg { width: 13px; height: 13px; }
.imp-drop-btn { display: none; }
@media (max-width: 640px) {
  .imp-hist-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; }
  .imp-hist-meta { grid-column: 1; }
  .imp-hist-main { grid-column: 1; }
  .imp-hist-actions { grid-column: 2; grid-row: 1 / span 2; flex-direction: column; align-items: stretch; }
  .imp-hist-actions .btn { text-align: center; justify-content: center; }
  .imp-trade, .imp-trade.single {
    grid-template-columns: 18px minmax(0, 1fr) auto;
    grid-template-areas: "side when pl" "side sym del" "side px del";
    row-gap: 2px;
  }
  .imp-trade.single { grid-template-areas: "side when pl" "side sym sym" "side px px"; }
  .imp-trade-side { grid-area: side; align-self: start; }
  .imp-trade-when { grid-area: when; }
  .imp-trade-sym { grid-area: sym; }
  .imp-trade-px { grid-area: px; }
  .imp-trade-pl { grid-area: pl; }
  .imp-trade-del { grid-area: del; justify-self: end; }
  /* On a phone the admin mostly reviews and tidies imports; adding a report
     (done from the PC that runs MT5) shrinks to a single button. */
  .imp-drop { flex-direction: row; padding: 10px 14px; gap: 8px; border-style: solid; border-width: 1px; width: fit-content; }
  .imp-drop svg { width: 18px; height: 18px; }
  .imp-drop-title, .imp-drop-sub { display: none; }
  .imp-drop-btn { display: inline; font-size: 13px; font-weight: 600; color: var(--standby); }
  .imp-hist-head { margin-top: 16px; }
  .imp-field-lots, .imp-field-bal { flex: 1 1 100%; }
}

/* Manual-entry mark: trades added from a report onto a real demo account. */
.manual-mark, .manual-mark-inline {
  display: inline-block; margin-left: 6px; font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 9px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; line-height: 1;
  padding: 3px 5px; border-radius: 4px; vertical-align: 1px;
  background: var(--backtest-bg); color: var(--backtest);
}
.manual-mark-inline { margin-left: 0; }
.cal-day { position: relative; }
.cal-marks { position: absolute; top: 4px; right: 4px; display: inline-flex; gap: 3px; }
.cal-manual, .cal-live {
  width: 15px; height: 15px; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; line-height: 1; font-family: 'Space Grotesk', system-ui, sans-serif;
  background: var(--backtest-bg); color: var(--backtest);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--backtest) 45%, transparent);
}
.imp-field .param-select { padding: 8px 10px; font-size: 12.5px; border-radius: 8px; }
[data-theme="light"] .imp-field .param-select { color-scheme: light; }

/* Data swap on the account view: the structure stays put, only the figures
   change — they settle in with a short fade instead of a hard repaint. */
.swap-fade { animation: swap-fade .34s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes swap-fade {
  from { opacity: .18; transform: translateY(4px); filter: blur(1.5px); }
  to   { opacity: 1; transform: none; filter: none; }
}
.detail-inner > * { transition: opacity .18s ease; }
.detail-inner.is-swapping > :not(#acct-head):not(#account-warnings):not(.analytics-head) { opacity: .55; }
@media (prefers-reduced-motion: reduce) {
  .swap-fade { animation: none; }
  .detail-inner > * { transition: none; }
}
.imp-field-lots { flex: 0 1 180px; }
.imp-field-bal { flex: 0 1 240px; }
.imp-field-lots input { width: 100%; box-sizing: border-box; }
.imp-lots-hint { margin-bottom: 0; }
.imp-lots-hint b { color: var(--txt); font-weight: 600; }

/* Lot size of an import: shown as an editable value. */
.imp-lots-edit {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px; margin: 0 -2px;
  border: 1px dashed transparent; border-radius: 5px; background: none; color: inherit; font: inherit; cursor: pointer;
}
.imp-lots-edit svg { width: 11px; height: 11px; opacity: .6; }
.imp-lots-edit:hover { border-color: var(--line); color: var(--txt); }
.imp-lots-edit:hover svg { opacity: 1; }
.imp-lots-form { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; }
.imp-lots-form[hidden] { display: none; }
.imp-lots-form input { width: 78px; padding: 5px 7px; font-size: 12px; border-radius: 6px; }
@media (max-width: 640px) {
  /* Mobile: the import button spans the full width, with room around it. */
  .imp-drop { width: 100%; box-sizing: border-box; justify-content: center; padding: 14px 16px; border-radius: 12px; }
  .imp-hist-head { margin: 22px 2px 10px; }
  .imp-hist-row { padding: 12px 14px; }
  .imp-hist-trades { padding: 0 14px 12px; gap: 6px; }
  .imp-trade.single { margin: 0 14px 12px; }
  .imp-lots-form { flex-wrap: wrap; }
}

/* Uptime bar detail: when exactly the EA was offline. */
.uptime-bar { transition: transform .12s ease, filter .12s ease; }
/* The bar whose details are shown stands out clearly: taller, ringed, and
   its neighbours step back while one is selected. */
.uptime-bars { touch-action: pan-y; }
.uptime-bar { position: relative; transition: transform .12s ease, filter .12s ease, opacity .12s ease, box-shadow .12s ease; }
.uptime-bar:hover, .uptime-bar:focus-visible { transform: scaleY(1.22); filter: brightness(1.08); outline: none; }
.uptime-bars.has-sel .uptime-bar { opacity: .5; }
.uptime-bars.has-sel .uptime-bar.tip-on {
  opacity: 1; z-index: 1; transform: scaleY(1.5) scaleX(1.25);
  box-shadow: 0 0 0 2px var(--panel), 0 0 0 3.5px var(--txt-dim);
  filter: brightness(1.05);
}
.uptime-bars.scrubbing .uptime-bar { transition-duration: .06s; }
.ut-count { margin-top: 6px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--txt-faint); }
.uptime-tip {
  position: fixed; z-index: 120; min-width: 190px; max-width: 280px; padding: 10px 12px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: 0 10px 28px rgba(0,0,0,.25);
  font-size: 12px; color: var(--txt); pointer-events: none; animation: cal-picker-in .14s ease both;
}
.uptime-tip[hidden] { display: none; }
.ut-head { font-weight: 600; margin-bottom: 2px; }
.ut-sub { color: var(--txt-dim); font-size: 11.5px; }
.ut-sub b { color: var(--txt); }
.ut-list { margin-top: 4px; display: flex; flex-direction: column; gap: 3px; font-family: 'JetBrains Mono', monospace; font-size: 11px; max-height: 230px; overflow-y: auto; overscroll-behavior: contain; }
.ut-range { display: flex; justify-content: space-between; gap: 12px; padding: 3px 6px; border-radius: 5px; background: var(--blocked-bg); color: var(--blocked); }
.ut-range.ongoing { box-shadow: inset 0 0 0 1px var(--blocked); }
.ut-dur { color: var(--txt-dim); white-space: nowrap; }
.ut-more { color: var(--txt-faint); padding: 2px 6px; }
.ut-ok { margin-top: 6px; color: var(--up); font-size: 11.5px; }
.cal-day.locked { opacity: .35; cursor: not-allowed; background: transparent; }
.cal-nav button:disabled { opacity: .35; cursor: default; }
.ut-total { color: var(--txt-faint); margin-left: 4px; }
.ut-range { align-items: baseline; }

/* Live: a real trade (copied from another account or from a History report),
   as opposed to a Strategy Tester backtest. */
.live-mark {
  display: inline-block; margin-left: 4px; font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 9px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; line-height: 1;
  padding: 3px 5px; border-radius: 4px; vertical-align: 1px; background: var(--trading-bg); color: var(--trading);
}
.imp-hist-file .live-mark, .imp-file-meta .live-mark { margin-left: 0; margin-right: 4px; }
.cal-live {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; line-height: 1; font-family: 'Space Grotesk', system-ui, sans-serif;
  background: var(--trading-bg); color: var(--trading);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--trading) 45%, transparent);
}
.imp-copy { margin-top: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.imp-copy-head { display: flex; gap: 10px; align-items: flex-start; }
.imp-copy-head svg { width: 20px; height: 20px; color: var(--standby); flex: 0 0 auto; margin-top: 1px; }
.imp-copy-head span { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.imp-copy-head small { font-size: 11.5px; color: var(--txt-dim); }
.imp-copy-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 12px; }
.imp-copy-row .imp-field { flex: 1 1 220px; }
.imp-copy-row .imp-field-date { flex: 0 1 150px; }
.imp-copy-row input[type="date"] { width: 100%; box-sizing: border-box; padding: 7px 9px; font-size: 12.5px; border-radius: 8px; }
.imp-copy-go { height: 34px; }
@media (max-width: 640px) {
  .imp-copy-row .imp-field, .imp-copy-row .imp-field-date { flex: 1 1 100%; }
  .imp-copy-go { width: 100%; }
}

/* ===================== v2.8.1 ===================== */
/* Users → Sign-in: session info on the left, the 2FA tag at its right end —
   on a phone too, where the row stacks under its label. */
.um-signin { flex-wrap: nowrap; gap: 10px 14px; }
.um-sess { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; min-width: 0; }
.um-tags { display: inline-flex; gap: 6px; flex-shrink: 0; }
@media (max-width: 600px) {
  .um-row:not(.um-row-inline) .um-row-ctl.um-signin { justify-content: space-between; width: 100%; }
  .um-sess { flex-direction: column; align-items: flex-start; }
}

/* Briefing time: hour : minute as one compact control, the same on every OS. */
.tpick {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px 6px 3px 10px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--sunken);
  font-family: 'JetBrains Mono', monospace; font-size: 15px; font-weight: 600; color: var(--txt);
  transition: border-color .15s;
}
.tpick:focus-within { border-color: var(--standby); }
.tpick svg { width: 15px; height: 15px; color: var(--txt-faint); margin-right: 4px; flex-shrink: 0; }
.tpick-part {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background: transparent; border: none; border-radius: 6px; color: inherit; font: inherit;
  padding: 5px 6px; margin: 0; cursor: pointer; text-align: center; text-align-last: center; color-scheme: dark;
}
[data-theme="light"] .tpick-part { color-scheme: light; }
.tpick-part:hover { background: var(--hover); }
.tpick-part:focus-visible { outline: 2px solid var(--standby); outline-offset: -1px; }
.tpick-part option { background: var(--panel); color: var(--txt); font-weight: 500; }
.tpick-colon { color: var(--txt-faint); padding: 0 1px; }
/* Save sits at the right end of these rows — on a phone too. */
.na-time-row { justify-content: space-between; }
.na-time-end { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; }
.adv-foot-row { justify-content: flex-end; }
.adv-foot-row .field-hint:empty { display: none; }

/* Settings gear: an outlined icon button in the style of the top-bar buttons,
   quieter than the old emoji. */
.gear-btn.gear-ico {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 32px; height: 32px; padding: 0; font-size: 0;
  border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--txt-faint);
  transition: color .15s, border-color .15s, background .15s;
}
.gear-btn.gear-ico svg { width: 16px; height: 16px; transition: transform .35s ease; }
.gear-btn.gear-ico:hover { color: var(--txt); border-color: var(--txt-faint); background: var(--hover); }
.gear-btn.gear-ico:hover svg { transform: rotate(45deg); }
.gear-btn.gear-ico:focus-visible { outline: 2px solid var(--standby); outline-offset: 1px; }
.gear-btn.gear-ico.sm { width: 28px; height: 28px; }
.gear-btn.gear-ico.sm svg { width: 14px; height: 14px; }
@media (max-width: 600px) {
  .gear-btn.gear-ico, .detail-actions .gear-btn.gear-ico { width: 30px; height: 30px; border-color: var(--line-soft); }
  .gear-btn.gear-ico svg { width: 15px; height: 15px; }
}
@media (prefers-reduced-motion: reduce) { .gear-btn.gear-ico svg { transition: none; } }

/* Import trades: report drop zone and "Copy trades" side by side (PC) or
   stacked as two buttons (phone); the copy form opens under them. */
.imp-start { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
button.imp-drop { font: inherit; color: inherit; width: 100%; }
.imp-copy-toggle { border-style: solid; }
.imp-copy-toggle.on { border-color: var(--standby); background: var(--standby-bg); }
.imp-copy[hidden] { display: none; }
.imp-copy-row .imp-msg { margin-top: 10px; }
/* Preview: the trades as traded; their size on the target in its own column. */
.imp-table th.imp-at-col, .imp-table td.imp-at-col { background: color-mix(in srgb, var(--standby) 6%, transparent); }
.imp-table th.imp-at-col { background: color-mix(in srgb, var(--standby) 6%, var(--panel)); color: var(--standby); }
.imp-foot-at { color: var(--txt-dim); white-space: nowrap; }

/* Lot size: −/+ step by a whole lot, any decimal can be typed. */
.lot-step {
  display: inline-flex; align-items: stretch; height: 34px; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 8px; background: var(--sunken); overflow: hidden; transition: border-color .15s;
}
.lot-step:focus-within { border-color: var(--standby); }
.lot-step input {
  width: 64px; min-width: 0; flex: 1 1 auto; border: none; border-radius: 0; background: transparent; outline: none; box-shadow: none;
  padding: 0 4px; text-align: center; font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--txt);
}
.lot-step-btn {
  flex: 0 0 32px; border: none; background: transparent; color: var(--txt-dim); cursor: pointer;
  font-size: 17px; line-height: 1; font-family: inherit; touch-action: manipulation; transition: background .12s, color .12s;
}
.lot-step-btn:first-child { border-right: 1px solid var(--line-soft); }
.lot-step-btn:last-child { border-left: 1px solid var(--line-soft); }
.lot-step-btn:hover:not(:disabled) { background: var(--hover); color: var(--txt); }
.lot-step-btn:disabled { opacity: .35; cursor: default; }
.lot-step-btn:focus-visible { outline: 2px solid var(--standby); outline-offset: -2px; }
.lot-step.is-disabled { opacity: .6; }
.imp-field-lots .lot-step { width: 100%; }

/* Settings → Advanced → Accounts in database */
.dba-pad { padding: 10px 14px; margin: 0; }
.dba-sum { padding: 9px 14px; font-size: 11.5px; color: var(--txt-faint); background: var(--sunken); border-bottom: 1px solid var(--line-soft); }
.dba-sum b { color: var(--txt-dim); font-weight: 600; }
.dba-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 86px; gap: 12px; align-items: center; padding: 10px 14px; transition: opacity .25s, transform .25s; }
.dba-row + .dba-row { border-top: 1px solid var(--line-soft); }
.dba-row.gone { opacity: 0; transform: translateX(8px); }
.dba-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dba-name { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 13px; color: var(--txt); }
.dba-id { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--txt-faint); }
.dba-state { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line-soft); }
.dba-state.on { color: var(--trading); border-color: color-mix(in srgb, var(--trading) 40%, transparent); }
.dba-state.off { color: var(--txt-faint); }
.dba-meta { font-size: 11px; color: var(--txt-faint); line-height: 1.4; }
.dba-pl { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.dba-pl.up { color: var(--up); } .dba-pl.down { color: var(--down); }
.dba-act { display: flex; justify-content: flex-end; }
.dba-act .btn { width: 100%; justify-content: center; }
.dba-hint { font-size: 11px; color: var(--txt-faint); }
.dba-row.removed .dba-name b { color: var(--txt-dim); }
.dba-foot { border-top: 1px solid var(--line-soft); font-size: 11px; color: var(--txt-faint); }
@media (max-width: 600px) {
  .dba-row { grid-template-columns: minmax(0, 1fr) 80px; grid-template-areas: "main act" "pl act"; row-gap: 2px; }
  .dba-main { grid-area: main; } .dba-pl { grid-area: pl; text-align: left; } .dba-act { grid-area: act; }
}

/* ===================== v2.8.2 — import window ===================== */
/* Every part of the window sits in its own box, as in Settings. */
#import-body { display: flex; flex-direction: column; gap: 14px; }
#imp-main { display: flex; flex-direction: column; gap: 14px; }
#imp-main:empty { display: none; }
.imp-card {
  border: 1px solid var(--line-soft); border-radius: 12px; background: var(--sunken);
  padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0;
}
.imp-card-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.imp-card-head > svg { width: 18px; height: 18px; color: var(--txt-dim); flex-shrink: 0; }
.imp-card-title { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1 1 auto; }
.imp-card-title b { font-size: 14px; font-weight: 700; color: var(--txt); }
.imp-card-title small { font-size: 11.5px; color: var(--txt-faint); line-height: 1.4; }
.imp-card-title small b { font-size: inherit; font-weight: 600; }
.imp-card-title small .up { color: var(--up); } .imp-card-title small .down { color: var(--down); }
.imp-card-right { margin-left: auto; flex-shrink: 0; display: flex; align-items: center; gap: 8px; }
.imp-card .imp-hint { margin: 0; }
.imp-card .imp-msg { margin-top: 0; }
.imp-card .imp-controls { margin-top: 0; }
.imp-card .imp-file { padding: 0; border: none; background: none; border-radius: 0; }
.imp-file-ic { width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: var(--panel); border: 1px solid var(--line-soft); color: var(--standby); }
.imp-file-ic svg { width: 19px; height: 19px; }
.imp-card .imp-table-wrap { background: var(--panel); }
.imp-card .imp-table th { background: var(--panel); }
.imp-card .imp-foot { margin-top: 0; }
.imp-card .imp-copy { margin: 0; padding: 14px 0 0; border: none; border-top: 1px solid var(--line-soft); border-radius: 0; background: none; display: flex; flex-direction: column; gap: 10px; }
.imp-card .imp-copy[hidden] { display: none; }
.imp-card .imp-drop { background: var(--panel); }
.imp-card .imp-drop:hover, .imp-card .imp-drop.over { background: var(--standby-bg); }
.imp-card .imp-copy-toggle.on { background: var(--standby-bg); }
/* The "At N lots" column only when the size differs from the source. */
.imp-table:not(.show-at) .imp-at-col { display: none; }
.bt-mark {
  display: inline-block; font-family: 'Space Grotesk', system-ui, sans-serif; font-size: 9px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; line-height: 1; padding: 3px 5px; border-radius: 4px; vertical-align: 1px;
  background: var(--offline-bg); color: var(--txt-dim);
}
.imp-file-meta .bt-mark { margin-right: 4px; }

/* Previous imports: one card per import, its controls in one toolbar. */
.imp-hist-sec .imp-hist { display: flex; flex-direction: column; gap: 8px; border: none; border-radius: 0; overflow: visible; }
.imp-hist-sec .imp-hist-empty { padding: 2px 0 0 28px; }
.imp-hist-filter { padding: 6px 10px; font-size: 12px; border-radius: 8px; max-width: 220px; }
.imp-hist-sec .imp-hist-item {
  border: 1px solid var(--line-soft); border-radius: 10px; background: var(--panel);
  transition: opacity .2s, transform .2s, border-color .15s;
}
.imp-hist-sec .imp-hist-item:last-child { border-bottom: 1px solid var(--line-soft); }
.imp-hist-sec .imp-hist-item.open { background: var(--panel); border-color: var(--line); }
.imp-hist-item.gone { opacity: 0; transform: translateY(-4px); }
.ih-top { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px 10px; }
.ih-ic { width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--sunken); color: var(--txt-dim); }
.ih-ic.copy { color: var(--trading); background: var(--trading-bg); }
.ih-ic svg { width: 17px; height: 17px; }
.ih-id { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ih-acct { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 13px; color: var(--txt); }
.ih-acct b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ih-acct .live-mark, .ih-acct .bt-mark { margin: 0; flex-shrink: 0; }
.ih-src { font-size: 11.5px; color: var(--txt-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ih-when { font-size: 11px; color: var(--txt-faint); }
.ih-res { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.ih-pl { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ih-pl.up { color: var(--up); } .ih-pl.down { color: var(--down); }
.ih-res small { font-size: 11px; color: var(--txt-faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ih-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; padding: 8px 10px 8px 14px;
  border-top: 1px solid var(--line-soft); background: color-mix(in srgb, var(--sunken) 55%, transparent); border-radius: 0 0 10px 10px;
}
.imp-hist-item.open .ih-bar { border-radius: 0; }
.ih-tool { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--txt-dim); }
.ih-spacer { flex: 1 1 auto; }
.ih-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 8px;
  border: 1px solid transparent; background: none; color: var(--txt-dim); font: inherit; font-size: 12px; cursor: pointer;
  transition: background .12s, color .12s, border-color .12s; white-space: nowrap;
}
.ih-btn svg { width: 14px; height: 14px; }
.ih-btn:hover:not(:disabled) { background: var(--hover); color: var(--txt); border-color: var(--line-soft); }
.ih-btn.danger { color: var(--blocked); }
.ih-btn.danger:hover:not(:disabled) { background: var(--blocked-bg); border-color: color-mix(in srgb, var(--blocked) 30%, transparent); color: var(--blocked); }
.ih-btn:disabled { opacity: .5; cursor: default; }
.ih-btn[hidden] { display: none; }
.ih-fixed { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--txt-faint); padding: 0 4px; }
.ih-fixed svg { width: 14px; height: 14px; }
.ih-switch { cursor: pointer; padding: 0 4px; user-select: none; }
.imp-hist-item .imp-lots-form { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 0; border: none; background: none; }
.imp-hist-item .imp-lots-form[hidden] { display: none; }
.imp-hist-item .imp-lots-form .lot-step { height: 30px; }
.imp-hist-item .imp-expand .imp-chev { transition: transform .18s ease; }
.imp-hist-item.open .imp-expand .imp-chev { transform: rotate(180deg); }
.imp-hist-sec .imp-hist-trades { padding: 10px 12px 12px; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 4px; }
.imp-hist-sec .imp-hist-trades[hidden] { display: none; }
.imp-hist-sec .imp-trade { background: var(--sunken); }
@media (max-width: 640px) {
  #import-body, #imp-main { gap: 12px; }
  .imp-card { padding: 12px 12px 14px; border-radius: 12px; }
  .imp-start { grid-template-columns: 1fr; gap: 10px; }
  .imp-card-head { flex-wrap: wrap; }
  .imp-card-right { margin-left: 28px; }
  .imp-hist-filter { max-width: 100%; }
  .ih-top { grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; padding: 11px 12px 9px; }
  .ih-ic { width: 30px; height: 30px; }
  .ih-bar { padding: 6px 8px 6px 10px; gap: 4px 4px; }
  .ih-btn { padding: 0 8px; }
  .ih-btn.danger span { display: none; }
  .imp-hist-item .imp-lots-form { flex-wrap: wrap; width: 100%; }
}
@media (max-width: 640px) {
  .imp-card-title { flex: 1 1 0; }
  .imp-card-right { margin-left: 28px; flex-basis: 100%; }
  .ih-top { grid-template-columns: 30px minmax(0, 1fr); row-gap: 6px; }
  .ih-res { grid-column: 2; flex-direction: row; align-items: baseline; gap: 8px; text-align: left; }
  .ih-spacer { flex-basis: 100%; height: 0; }
  .ih-bar .ih-btn.danger { margin-left: auto; }
}

/* Accounts in database: a row opens its detail window. */
.dba-row { cursor: pointer; }
.dba-row:hover { background: var(--hover); }
.dba-row:focus-visible { outline: 2px solid var(--standby); outline-offset: -2px; }
.dba-dialog { width: min(760px, 94vw); }
.dba-dialog .na-test-dialog-head b { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; }
.dba-dialog .na-test-dialog-body { max-height: calc(86vh - 60px); overflow-y: auto; gap: 14px; }
.dba-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dba-fact { background: var(--sunken); border: 1px solid var(--line-soft); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dba-fact > span { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--txt-faint); }
.dba-fact b { font-size: 15px; font-weight: 700; color: var(--txt); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dba-fact b.up { color: var(--up); } .dba-fact b.down { color: var(--down); }
.dba-fact small { font-size: 11px; color: var(--txt-faint); line-height: 1.35; }
.dba-sec { display: flex; flex-direction: column; gap: 6px; }
.dba-sec-h { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--txt-faint); }
.dba-months, .dba-imps { border: 1px solid var(--line-soft); border-radius: 10px; overflow: hidden; }
.dba-month { display: grid; grid-template-columns: 76px minmax(0, 1fr) 34px 110px; gap: 10px; align-items: center; padding: 6px 12px; font-size: 12px; }
.dba-month + .dba-month, .dba-imp + .dba-imp { border-top: 1px solid var(--line-soft); }
.dba-month b { text-align: right; font-variant-numeric: tabular-nums; }
.dba-month .dim { text-align: right; font-size: 11px; }
.dba-bar { height: 6px; border-radius: 3px; background: var(--sunken); overflow: hidden; }
.dba-bar i { display: block; height: 100%; border-radius: 3px; }
.dba-bar i.up { background: var(--up); } .dba-bar i.down { background: var(--down); }
.dba-month b.up, .dba-imp b.up { color: var(--up); } .dba-month b.down, .dba-imp b.down { color: var(--down); }
.dba-imp { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "n pl" "s pl"; gap: 1px 12px; padding: 8px 12px; font-size: 12.5px; }
.dba-imp > span { grid-area: n; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dba-imp small { grid-area: s; font-size: 11px; color: var(--txt-faint); }
.dba-imp b { grid-area: pl; align-self: center; font-variant-numeric: tabular-nums; }
.dba-trades { max-height: 300px; overflow: auto; border: 1px solid var(--line-soft); border-radius: 10px; }
.dba-trades table { width: 100%; border-collapse: collapse; font-family: 'JetBrains Mono', monospace; font-size: 11.5px; }
.dba-trades th { position: sticky; top: 0; background: var(--panel); text-align: left; font-family: 'Space Grotesk', system-ui, sans-serif; font-size: 9.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--txt-faint); padding: 7px 9px; border-bottom: 1px solid var(--line); }
.dba-trades td { padding: 5px 9px; border-bottom: 1px solid var(--line-soft); color: var(--txt-dim); white-space: nowrap; }
.dba-trades .num { text-align: right; }
.dba-trades td.up { color: var(--up); } .dba-trades td.down { color: var(--down); }
.dba-foot-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.dba-foot-row .field-hint { margin: 0; font-size: 11.5px; }
.dba-foot-row .btn { margin-left: auto; }
@media (max-width: 600px) {
  .dba-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dba-month { grid-template-columns: 64px minmax(0, 1fr) 26px 92px; gap: 8px; padding: 6px 10px; }
}

/* ===================== v2.8.2 — marks, calendar events, day tips ===================== */
:root { --mark-manual: #9d8cff; --ev-dot: #ff8a1f; }
[data-theme="light"] { --mark-manual: #6d5ce0; --ev-dot: #e07000; }
/* Trades added by hand: a small dot-and-word chip (a dot only on a phone). */
.tmark {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; padding: 2px 6px 2px 5px; border-radius: 999px;
  font-family: 'Space Grotesk', system-ui, sans-serif; font-size: 9.5px; font-weight: 600; letter-spacing: .02em; line-height: 1.2;
  vertical-align: 1px; white-space: nowrap; border: 1px solid transparent;
}
.tmark i { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.tmark.manual { color: var(--mark-manual); background: color-mix(in srgb, var(--mark-manual) 11%, transparent); border-color: color-mix(in srgb, var(--mark-manual) 28%, transparent); }
.tmark.manual i { box-shadow: inset 0 0 0 1.5px var(--mark-manual); }
.tmark.live { color: var(--trading); background: color-mix(in srgb, var(--trading) 11%, transparent); border-color: color-mix(in srgb, var(--trading) 28%, transparent); }
.tmark.live i { background: var(--trading); }
@media (max-width: 600px) {
  .tmark { padding: 3px; margin-left: 4px; }
  .tmark > span { display: none; }
}
/* Calendar day: corner dots instead of letters. */
.cal-day { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.cal-day .cal-marks { position: absolute; top: auto; bottom: 5px; right: 5px; display: inline-flex; gap: 3px; }
.cm { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.cm.manual { box-shadow: inset 0 0 0 1.6px var(--mark-manual); }
.cm.live { background: var(--trading); }
.cal-ev-dot { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--ev-dot); }
.cal-ev-dot.high { box-shadow: 0 0 0 2.5px color-mix(in srgb, var(--ev-dot) 28%, transparent); }
@media (max-width: 600px) {
  .cal-day .cal-marks { bottom: 3px; right: 3px; gap: 2px; }
  .cm, .cal-ev-dot { width: 5px; height: 5px; }
  .cm.manual { box-shadow: inset 0 0 0 1.3px var(--mark-manual); }
  .cal-ev-dot { top: 4px; right: 4px; }
  .cal-ev-dot.high { box-shadow: 0 0 0 2px color-mix(in srgb, var(--ev-dot) 28%, transparent); }
}
/* Day tip (hover, or hold on a phone). */
.cal-tip { min-width: 210px; max-width: 300px; }
.cal-tip .ut-sub b.up { color: var(--up); } .cal-tip .ut-sub b.down { color: var(--down); }
.ct-mark { display: flex; align-items: center; gap: 7px; margin-top: 5px; font-size: 11.5px; color: var(--txt-dim); }
.ct-evs { margin-top: 4px; display: flex; flex-direction: column; gap: 3px; max-height: 220px; overflow-y: auto; }
.ct-ev { display: grid; grid-template-columns: 44px 8px minmax(0, 1fr); gap: 7px; align-items: center; font-size: 11.5px; }
.ct-ev-t { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--txt-dim); }
.ct-ev .imp-dot { margin: 0; }
.ct-ev-n { color: var(--txt); line-height: 1.3; }

/* Account / EA settings: boxed cards like the main Settings window. */
.es-cards { display: flex; flex-direction: column; gap: 12px; }
.es-card { padding: 12px 14px 14px; gap: 10px; }
.es-card .set-card-head { font-size: 13.5px; }
.es-card-right { margin-left: auto; font-size: 11.5px; font-weight: 500; }
.es-body { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 14px; }
.es-body > .field-row { margin: 0; }
.es-body > .field-row + .field-row { padding-top: 14px; border-top: 1px solid var(--line-soft); }
.es-body .field-hint { margin: 4px 0 0; }
.es-body .settings-meta { margin: 0; }
.es-body .notif-grid { margin: 0; }
.es-danger { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.es-danger .field-hint { margin: 0; flex: 1 1 220px; }
@media (max-width: 600px) {
  .es-card { padding: 10px 10px 12px; }
  .es-body { padding: 10px 12px; }
  .es-card-right { flex-basis: 100%; margin-left: 27px; }
  .es-card .set-card-head { flex-wrap: wrap; }
}

/* Day / week uptime: outages drawn grey at their place in each bar
   (left edge = start of the hour/day, right edge = its end). */
.uptime-bar.has-segs { overflow: hidden; }
.ub-out { position: absolute; top: 0; bottom: 0; min-width: 2px; background: #8b93a3; pointer-events: none; }
[data-theme="light"] .ub-out { background: #aab1bf; }
.ub-out.ongoing { background: repeating-linear-gradient(135deg, #8b93a3 0 3px, #6f7787 3px 6px); }

/* ===================== v2.8.3 ===================== */
/* Settings: the tab row stays visible while the content scrolls. */
.modal.settings-tabbed .settings-tabbar {
  position: sticky; top: -18px; z-index: 6; margin: -18px -18px 0; padding: 14px 18px 10px;
  background: var(--panel); border-bottom: 1px solid var(--line-soft);
}
.modal.settings-tabbed .settings-tabbar + #settings-tab-content { margin-top: 2px !important; }
@media (max-width: 600px) {
  .modal.settings-tabbed .settings-tabbar { top: -14px; margin: -14px -14px 0; padding: 10px 14px 8px; }
}
/* Account / EA settings: both tab rows on one sticky line. */
.es-tabbar {
  position: sticky; top: 0; z-index: 6; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px;
  margin: -18px -18px 0; padding: 10px 18px; background: var(--panel); border-bottom: 1px solid var(--line-soft);
}
.es-tabbar .settings-tab-seg { margin: 0 !important; }
/* Account / EA settings cards: compact. */
.es-cards { gap: 8px; }
.es-card { padding: 8px 10px 10px; gap: 6px; border-radius: 10px; }
.es-card .set-card-head { font-size: 12.5px; gap: 7px; }
.es-card .set-card-head svg { width: 15px; height: 15px; }
.es-card-right { font-size: 11px; }
.es-body { padding: 8px 10px; gap: 8px; border-radius: 8px; }
.es-body > .field-row + .field-row { padding-top: 8px; }
.es-body .field-row { gap: 4px; }
.es-body .field-row > label, .es-body .toggle-cell > label { font-size: 9.5px; margin-bottom: 2px; }
.es-body .field-inline { gap: 6px; }
.es-body input:not([type=checkbox]):not([type=radio]) { padding: 5px 9px; font-size: 12.5px; min-height: 0; height: 30px; box-sizing: border-box; }
.es-body .btn { padding: 0 11px; height: 30px; font-size: 12px; }
.es-body .field-hint, .es-body .field-sub { font-size: 10.5px; margin-top: 2px; }
.es-body .toggle-pair { gap: 8px 16px; }
.es-body .notif-grid { gap: 4px 12px; }
.es-body .notif-toggle { font-size: 12px; }
.es-danger { padding-top: 8px; gap: 8px; }
.es-danger .btn { height: 30px; }
@media (max-width: 600px) {
  .es-tabbar { margin: -18px -18px 0; padding: 8px 14px; }
  .es-card { padding: 7px 8px 8px; }
  .es-body { padding: 7px 9px; }
}

/* Accounts in database: rows only open the detail window. */
.dba-row { grid-template-columns: minmax(0, 1fr) auto 14px; }
.dba-go { color: var(--txt-faint); font-size: 18px; line-height: 1; text-align: right; }
.dba-row:hover .dba-go { color: var(--txt); }
@media (max-width: 600px) {
  .dba-row { grid-template-columns: minmax(0, 1fr) 14px; grid-template-areas: "main go" "pl go"; }
  .dba-go { grid-area: go; align-self: center; }
}
/* Smaller switches and a two-column notification list inside these cards. */
.es-body .toggle { width: 38px; height: 22px; }
.es-body .toggle::after { width: 16px; height: 16px; }
.es-body .toggle.on::after { transform: translateX(16px); }
@media (max-width: 600px) {
  .es-body .notif-grid { grid-template-columns: 1fr 1fr; gap: 4px 8px; }
  .es-body .notif-toggle { font-size: 11.5px; }
  .es-body .toggle-pair { display: grid; grid-template-columns: 1fr 1fr; }
}
.es-body #notif-hint:empty { display: none; }
@media (max-width: 600px) {
  .es-card .set-card-head { flex-wrap: nowrap; }
  .es-card-right { flex-basis: auto; margin-left: auto; white-space: nowrap; }
}
/* Wednesday as a non-trading day (Settings → Dashboard). */
.cal-day.dead { opacity: 0.4; }
.cal-day.dead .dnum { color: var(--txt-faint); }
/* Detail window: the mark's word stays visible on a phone too. */
.dba-trades .tmark > span { display: inline; }
.dba-trades .tmark { padding: 2px 6px 2px 5px; }
/* About card: no stray rule above the facts; delete row on one line. */
.es-body .settings-meta { margin: 0; padding: 0; border-top: none; }
.es-danger { flex-wrap: nowrap; }
.es-danger .field-hint { flex: 1 1 auto; }
.es-danger .btn { flex-shrink: 0; }

/* ===================== v2.8.9 — Breakout detector ===================== */
.breakout-modal { width: min(980px, 96vw); }
#breakout-body { display: flex; flex-direction: column; gap: 14px; }
.bd-top { display: flex; gap: 12px; flex-wrap: wrap; }
.bd-top .imp-field { flex: 1 1 320px; }
.bd-top .bd-days { flex: 0 1 180px; }
.bd-today { gap: 14px; }
.bd-today-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.bd-dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 18px; flex-shrink: 0; background: var(--txt-faint); }
.bd-dot.clear { background: var(--up); box-shadow: 0 0 0 4px var(--up-bg); }
.bd-dot.break { background: var(--down); box-shadow: 0 0 0 4px var(--blocked-bg); }
.bd-dot.restricted { background: #e0a010; box-shadow: 0 0 0 4px color-mix(in srgb, #e0a010 18%, transparent); }
.bd-dot.pending { background: var(--standby); box-shadow: 0 0 0 4px var(--standby-bg); animation: bd-pulse 1.6s ease-in-out infinite; }
@keyframes bd-pulse { 50% { opacity: .45; } }
.bd-today-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 300px; }
.bd-today-txt small { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--txt-faint); }
.bd-today-txt b { font-size: 17px; font-weight: 700; color: var(--txt); }
.bd-today.clear .bd-today-txt b { color: var(--up); }
.bd-today.break .bd-today-txt b { color: var(--down); }
.bd-today.restricted .bd-today-txt b { color: #d38f00; }
.bd-today-txt span { font-size: 12px; color: var(--txt-dim); }
.bd-next { margin-left: auto; align-self: center; font-size: 12px; font-weight: 600; padding: 6px 11px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line-soft); color: var(--txt); white-space: nowrap; }
.bd-levels { display: flex; gap: 8px; flex-wrap: wrap; }
.bd-levels span { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border-radius: 9px; background: var(--panel); border: 1px solid var(--line-soft); min-width: 120px; }
.bd-levels small { font-size: 9.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--txt-faint); }
.bd-levels b { font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--txt); }
.bd-today-trades { font-size: 12px; color: var(--txt-dim); }
.bd-today-trades .up, .bd-row-pl.up, .bd-stats .up { color: var(--up); }
.bd-today-trades .down, .bd-row-pl.down, .bd-stats .down { color: var(--down); }
.bd-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.bd-stats > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--sunken); border: 1px solid var(--line-soft); }
.bd-stats small { font-size: 9.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--txt-faint); }
.bd-stats b { font-size: 17px; font-weight: 700; color: var(--txt); font-variant-numeric: tabular-nums; }

/* Timeline of one day: 00:00 at the left edge, 24:00 at the right. */
.tl { position: relative; }
.tl-track { position: relative; height: 18px; border-radius: 6px; background: var(--panel); border: 1px solid var(--line-soft); overflow: hidden; }
.tl.big .tl-track { height: 34px; border-radius: 8px; }
.tl-span { position: absolute; top: 0; bottom: 0; }
.tl-night { background: color-mix(in srgb, #7c8cff 28%, transparent); }
.tl-am, .tl-pm { background: color-mix(in srgb, var(--up) 26%, transparent); top: 22%; bottom: 22%; border-radius: 3px; }
.tl-pm.cond { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--up) 26%, transparent) 0 5px, color-mix(in srgb, var(--up) 10%, transparent) 5px 10px); }
.tl-am.off, .tl-pm.off { background: color-mix(in srgb, #e0a010 22%, transparent); }
.tl-am.unknown, .tl-pm.unknown { background: color-mix(in srgb, var(--txt-faint) 18%, transparent); }
.tl-blocked { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--down) 22%, transparent) 0 5px, color-mix(in srgb, var(--down) 8%, transparent) 5px 10px); }
.tl-trade { top: 30%; bottom: 30%; min-width: 3px; border-radius: 2px; z-index: 2; }
.tl-trade.up { background: var(--up); } .tl-trade.down { background: var(--down); }
.tl-mark { position: absolute; top: 0; bottom: 0; width: 0; z-index: 3; }
.tl-mark::before { content: ''; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; }
.tl-check::before { background: var(--txt-dim); }
.tl-check.due::before { background: repeating-linear-gradient(180deg, var(--txt-dim) 0 3px, transparent 3px 6px); }
.tl-break::after, .tl-go::after { content: ''; position: absolute; top: 50%; left: -5px; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; border: 2px solid var(--panel); }
.tl-break::after { background: var(--down); }
.tl-go::after { background: var(--up); border-radius: 2px; transform: rotate(45deg); }
.tl.big .tl-break::after, .tl.big .tl-go::after { width: 14px; height: 14px; left: -7px; margin-top: -7px; }
.tl-now::before { background: var(--standby); width: 2px; }
.tl-now::after { content: ''; position: absolute; top: -1px; left: -4px; border: 4px solid transparent; border-top-color: var(--standby); }
.tl-ticks { position: relative; height: 16px; margin-top: 3px; }
.tl-ticks span { position: absolute; transform: translateX(-50%); font-family: 'JetBrains Mono', monospace; font-size: 9.5px; color: var(--txt-faint); }
.tl-ticks span:first-child { transform: none; }
.tl-ticks span:last-child { transform: translateX(-100%); }

/* History rows */
.bd-list { display: flex; flex-direction: column; gap: 6px; }
.bd-row { padding: 9px 12px 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 7px; }
.bd-row-head { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; min-width: 0; }
.bd-date { font-size: 12.5px; font-weight: 650; color: var(--txt); min-width: 92px; }
.bd-chip { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line-soft); color: var(--txt-faint); white-space: nowrap; }
.bd-chip.clear { color: var(--up); background: var(--up-bg); border-color: color-mix(in srgb, var(--up) 35%, transparent); }
.bd-chip.break { color: var(--down); background: var(--blocked-bg); border-color: color-mix(in srgb, var(--down) 35%, transparent); }
.bd-chip.restricted { color: #c98500; background: color-mix(in srgb, #e0a010 12%, transparent); border-color: color-mix(in srgb, #e0a010 35%, transparent); }
.bd-row-sub { font-size: 11.5px; color: var(--txt-dim); flex: 1 1 200px; min-width: 0; }
.bd-row-pl { margin-left: auto; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bd-row.none .bd-row-sub, .bd-row.none .bd-date { color: var(--txt-faint); }
.bd-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 11px; color: var(--txt-dim); }
.bd-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { display: inline-block; width: 16px; height: 9px; border-radius: 3px; position: relative; }
.lg.tl-am { top: 0; bottom: 0; }
.lg-check { width: 2px; height: 12px; background: var(--txt-dim); border-radius: 0; }
.lg-break { width: 9px; height: 9px; border-radius: 50%; background: var(--down); }
.lg-go { width: 8px; height: 8px; border-radius: 2px; background: var(--up); transform: rotate(45deg); }
.lg-trade { width: 12px; height: 5px; border-radius: 2px; background: var(--up); }
@media (max-width: 640px) {
  .bd-next { margin-left: 24px; white-space: normal; }
  .bd-today-txt b { font-size: 15px; }
  .bd-date { min-width: 0; }
  .bd-row-sub { flex-basis: 100%; order: 5; }
  .bd-levels span { min-width: 0; flex: 1 1 30%; padding: 7px 9px; }
  .tl.big .tl-track { height: 28px; }
  .tl-ticks span:nth-child(even) { display: none; }
}
@media (max-width: 640px) {
  .bd-today-head { flex-wrap: wrap; gap: 8px 10px; }
  .bd-dot { margin-top: 20px; }
  .bd-today-txt { flex: 1 1 0; }
  .bd-next { margin-left: 22px; flex-basis: auto; }
  .bd-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .bd-stats > div { padding: 8px 9px; }
  .bd-stats b { font-size: 15px; }
  .bd-stats small { font-size: 8.5px; letter-spacing: .04em; }
  .bd-row { padding: 8px 10px 9px; gap: 6px; }
  .bd-row-sub { font-size: 11px; }
}
@media (max-width: 640px) {
  .bd-today-head { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 8px 10px; }
  .bd-today-txt { flex: none; }
  .bd-dot { margin-top: 4px; }
  .bd-next { grid-column: 2; margin-left: 0; justify-self: start; }
}

/* ===================== v2.9.0 ===================== */
.imp-st.real { background: color-mix(in srgb, var(--trading) 14%, transparent); color: var(--trading); }
.imp-st.bt { background: color-mix(in srgb, var(--mark-manual) 14%, transparent); color: var(--mark-manual); }
/* Calendar: trades added by hand as small letter badges (bottom right). */
.cb {
  display: inline-flex; align-items: center; justify-content: center; min-width: 14px; height: 14px; padding: 0 3px; box-sizing: border-box;
  border-radius: 4px; font-family: 'Space Grotesk', system-ui, sans-serif; font-size: 8.5px; font-weight: 700; line-height: 1; letter-spacing: 0;
}
.cb.manual { color: var(--mark-manual); background: color-mix(in srgb, var(--mark-manual) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mark-manual) 35%, transparent); }
.cb.copied { color: var(--trading); background: color-mix(in srgb, var(--trading) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--trading) 35%, transparent); }
.cb.hist { color: var(--standby); background: color-mix(in srgb, var(--standby) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--standby) 35%, transparent); }
.cal-day .cal-marks { gap: 2px; }
.ct-mark .cb { flex-shrink: 0; }
@media (max-width: 600px) {
  .cb { min-width: 11px; height: 11px; font-size: 7px; padding: 0 2px; border-radius: 3px; }
}
/* Breakout detector: every break of yesterday's high / low. */
:root { --brk-hi: #3b82f6; --brk-lo: #e08a00; }
[data-theme="light"] { --brk-hi: #2563eb; --brk-lo: #c26f00; }
.tl-ev { z-index: 2; opacity: .9; }
.tl-ev.hi { top: 0; bottom: auto; height: 22%; background: var(--brk-hi); }
.tl-ev.lo { top: auto; bottom: 0; height: 22%; background: var(--brk-lo); }
.tl-evm { z-index: 4; }
.tl-evm.hi::before { content: ''; position: absolute; left: -4px; top: 0; border: 4px solid transparent; border-top-color: var(--brk-hi); border-bottom: 0; width: 0; height: 0; background: none; }
.tl-evm.lo::before { content: ''; position: absolute; left: -4px; top: auto; bottom: 0; border: 4px solid transparent; border-bottom-color: var(--brk-lo); border-top: 0; width: 0; height: 0; background: none; }
.tl.big .tl-evm.hi::before, .tl.big .tl-evm.lo::before { border-width: 6px; left: -6px; }
.tl.big .tl-evm.hi::before { border-bottom: 0; }
.tl.big .tl-evm.lo::before { border-top: 0; }
.bd-evc { display: inline-flex; gap: 6px; font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bd-evc .hi, .bd-ev.hi b, .bd-ph .hi { color: var(--brk-hi); }
.bd-evc .lo, .bd-ev.lo b, .bd-ph .lo { color: var(--brk-lo); }
.lg-hi { width: 16px; height: 4px; border-radius: 1px; background: var(--brk-hi); }
.lg-lo { width: 16px; height: 4px; border-radius: 1px; background: var(--brk-lo); }
.bd-evlist { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; }
.bd-ev { display: grid; grid-template-columns: 16px 118px minmax(0, 1fr) auto; gap: 8px; align-items: baseline; padding: 6px 10px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line-soft); font-size: 12px; color: var(--txt-dim); }
.bd-ev-t { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: var(--txt); }
.bd-ev small { font-size: 10.5px; color: var(--txt-faint); white-space: nowrap; }
/* By hour: stacked columns (high on top of low). */
.bd-hist { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 3px; align-items: end; height: 120px; padding: 10px 10px 0; border-radius: 10px; background: var(--panel); border: 1px solid var(--line-soft); }
.bd-hcol { display: flex; flex-direction: column; align-items: stretch; height: 100%; min-width: 0; }
.bd-hbar { flex: 1 1 auto; display: flex; flex-direction: column-reverse; justify-content: flex-start; border-radius: 3px 3px 0 0; overflow: hidden; background: color-mix(in srgb, var(--line-soft) 40%, transparent); }
.bd-hbar i { display: block; width: 100%; }
.bd-hbar i.hi { background: var(--brk-hi); }
.bd-hbar i.lo { background: var(--brk-lo); }
.bd-hcol small { height: 16px; line-height: 16px; text-align: center; font-family: 'JetBrains Mono', monospace; font-size: 9px; color: var(--txt-faint); overflow: visible; white-space: nowrap; }
.bd-insights { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.bd-insights > div { display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line-soft); }
.bd-insights b { font-size: 15px; font-weight: 700; color: var(--txt); }
.bd-insights span { font-size: 11.5px; color: var(--txt-dim); line-height: 1.35; }
.bd-phases { border-radius: 10px; border: 1px solid var(--line-soft); background: var(--panel); overflow: hidden; }
.bd-ph { display: grid; grid-template-columns: minmax(0, 1fr) 64px 64px 92px; gap: 8px; padding: 6px 12px; font-size: 12px; color: var(--txt); font-variant-numeric: tabular-nums; }
.bd-ph + .bd-ph { border-top: 1px solid var(--line-soft); }
.bd-ph.head { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--txt-faint); background: var(--sunken); }
.bd-ph.head .hi, .bd-ph.head .lo { color: inherit; }
.bd-ph > span:not(:first-child) { text-align: right; }
.bd-ph small { color: var(--txt-faint); font-size: 10.5px; }
.bd-ph.empty { color: var(--txt-faint); }
@media (max-width: 640px) {
  .bd-ev { grid-template-columns: 14px minmax(0, 1fr); grid-template-areas: "s t" "s d" "s m"; row-gap: 1px; }
  .bd-ev b { grid-area: s; } .bd-ev-t { grid-area: t; } .bd-ev > span:not(.bd-ev-t) { grid-area: d; } .bd-ev small { grid-area: m; }
  .bd-hist { height: 96px; gap: 2px; padding: 8px 6px 0; }
  .bd-hcol small { font-size: 8px; }
  .bd-ph { grid-template-columns: minmax(0, 1fr) 44px 44px 64px; padding: 6px 10px; font-size: 11.5px; }
}
.bd-ev { grid-template-columns: 16px 160px minmax(0, 1fr) auto; }
@media (max-width: 640px) {
  .bd-ev { grid-template-columns: 14px minmax(0, 1fr); }
  .bd-insights { grid-template-columns: 1fr 1fr; gap: 6px; }
  .bd-insights > div { padding: 8px 10px; }
  .bd-insights b { font-size: 13.5px; }
  .bd-insights span { font-size: 10.5px; }
}

/* ===================== v2.9.1 ===================== */
/* Import preview: sortable columns. */
.imp-table th.imp-sort { cursor: pointer; user-select: none; }
.imp-table th.imp-sort:hover { color: var(--txt); }
.imp-table th.imp-sort.on { color: var(--standby); }
.imp-sort-ind { display: inline-block; width: 10px; margin-left: 3px; }
.imp-table th.imp-sort.on.asc .imp-sort-ind::after { content: '↑'; }
.imp-table th.imp-sort.on.desc .imp-sort-ind::after { content: '↓'; }
/* Segmented controls: a sliding highlight (see the click handler in app.js). */
.seg { position: relative; }
.seg > button { position: relative; z-index: 1; }
.seg-pill { position: absolute; z-index: 0; pointer-events: none; }
.seg.seg-anim > button.on { background: transparent !important; box-shadow: none !important; }
/* Calendar: one moving outline for the selected day / week. */
.cal-grid { position: relative; }
.cal-sel {
  position: absolute; z-index: 3; pointer-events: none; border-radius: 8px;
  box-shadow: inset 0 0 0 1.5px var(--standby), 0 0 0 3px color-mix(in srgb, var(--standby) 14%, transparent);
}
.cal-grid.has-bubble .cal-day.in-window { box-shadow: none; }
/* Phone menu: drops in, fades out. */
@media (max-width: 600px) {
  #user-menu { transform-origin: top right; }
  #user-menu.opening { animation: menu-in .2s cubic-bezier(.2,.8,.2,1) both; }
  #user-menu.opening .user-menu-item { animation: menu-item-in .26s cubic-bezier(.2,.8,.2,1) both; }
  #user-menu.opening .user-menu-item:nth-child(2) { animation-delay: .02s; }
  #user-menu.opening .user-menu-item:nth-child(3) { animation-delay: .04s; }
  #user-menu.opening .user-menu-item:nth-child(4) { animation-delay: .06s; }
  #user-menu.opening .user-menu-item:nth-child(5) { animation-delay: .08s; }
  #user-menu.opening .user-menu-item:nth-child(6) { animation-delay: .10s; }
  #user-menu.opening .user-menu-item:nth-child(7) { animation-delay: .12s; }
  #user-menu.opening .user-menu-item:nth-child(8) { animation-delay: .14s; }
  #user-menu.opening .user-menu-item:nth-child(n+9) { animation-delay: .16s; }
  #user-menu.closing { animation: menu-out .15s ease both; }
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes menu-out { to { opacity: 0; transform: translateY(-4px) scale(.97); } }
@keyframes menu-item-in { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  #user-menu.opening, #user-menu.opening .user-menu-item, #user-menu.closing { animation: none !important; }
}
/* Breakout detector: price chart of a day. */
.bd-row-head { cursor: pointer; }
.bd-row-chev { color: var(--txt-faint); font-size: 11px; transition: transform .18s ease; margin-left: 2px; }
.bd-row:not(:has(.bd-row-pl)) .bd-row-chev { margin-left: auto; }
.bd-row.open .bd-row-chev { transform: rotate(180deg); }
.bd-row:hover .bd-row-chev { color: var(--txt); }
.bd-chart-host:empty { display: none; }
.bd-chart-empty { font-size: 11.5px; color: var(--txt-faint); padding: 8px 2px 2px; }
.bd-chart { margin-top: 4px; }
.bc-plot { position: relative; height: 240px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line-soft); overflow: hidden; touch-action: pan-y; }
.bd-today .bc-plot { height: 260px; }
.bc-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.bc-night { fill: color-mix(in srgb, #7c8cff 16%, transparent); }
.bc-win { fill: color-mix(in srgb, var(--up) 8%, transparent); }
.bc-ex.hi { fill: color-mix(in srgb, var(--brk-hi) 14%, transparent); }
.bc-ex.lo { fill: color-mix(in srgb, var(--brk-lo) 14%, transparent); }
.bc-band { fill: color-mix(in srgb, var(--txt-dim) 16%, transparent); stroke: none; }
.bc-line { fill: none; stroke: var(--txt); stroke-width: 1.4; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.bc-lvl { stroke-width: 1.2; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.bc-lvl.hi { stroke: var(--brk-hi); } .bc-lvl.lo { stroke: var(--brk-lo); }
.bc-check { stroke: var(--txt-dim); stroke-width: 1; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }
.bc-trade { stroke-width: 2.2; vector-effect: non-scaling-stroke; }
.bc-trade.up { stroke: var(--up); } .bc-trade.down { stroke: var(--down); }
.bc-mk { position: absolute; width: 0; height: 0; transform: translate(-6px, -50%); border: 6px solid transparent; z-index: 2; }
.bc-mk.hi { border-bottom: 9px solid var(--brk-hi); border-top: 0; transform: translate(-6px, -100%); }
.bc-mk.lo { border-top: 9px solid var(--brk-lo); border-bottom: 0; transform: translate(-6px, 0); }
.bc-entry { position: absolute; width: 8px; height: 8px; border-radius: 50%; transform: translate(-50%, -50%); background: var(--panel); border: 2px solid var(--txt); z-index: 2; }
.bc-entry.buy { border-color: var(--up); } .bc-entry.sell { border-color: var(--down); }
.bc-lab { position: absolute; right: 6px; transform: translateY(-115%); font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 600; padding: 0 4px; border-radius: 3px; background: var(--panel); }
.bc-lab.hi { color: var(--brk-hi); } .bc-lab.lo { color: var(--brk-lo); transform: translateY(15%); }
.bc-y { position: absolute; left: 6px; transform: translateY(-50%); font-family: 'JetBrains Mono', monospace; font-size: 9.5px; color: var(--txt-faint); background: color-mix(in srgb, var(--panel) 80%, transparent); padding: 0 3px; border-radius: 3px; }
.bc-cross { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--txt-dim); opacity: .6; z-index: 3; pointer-events: none; }
.bc-cross[hidden], .bc-tip[hidden] { display: none; }
.bc-tip { position: absolute; top: 6px; transform: translateX(8px); z-index: 4; pointer-events: none; padding: 5px 8px; border-radius: 7px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(0,0,0,.18); font-size: 11.5px; white-space: nowrap; display: flex; flex-direction: column; gap: 1px; }
.bc-tip.flip { transform: translateX(calc(-100% - 8px)); }
.bc-tip b { font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.bc-tip small { color: var(--txt-faint); font-size: 10.5px; }
@media (max-width: 640px) {
  .bc-plot { height: 190px; }
  .bd-today .bc-plot { height: 200px; }
}
.tl-ticks span.first { transform: none; }
.tl-ticks span.last { transform: translateX(-100%); }
.tl-ticks span:first-child:not(.first) { transform: translateX(-50%); }
.tl-ticks span:last-child:not(.last) { transform: translateX(-50%); }

/* ===== v2.9.2 — Breakout detector: layout that breathes ===== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
#breakout-body { gap: 18px; }
/* Period belongs to what it filters: statistics and history. */
.bd-period { display: flex; align-items: center; gap: 12px; padding: 4px 2px 0; }
.bd-period-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.bd-period-txt b { font-size: 15px; font-weight: 700; color: var(--txt); letter-spacing: -0.01em; }
.bd-period-txt small { font-size: 11.5px; color: var(--txt-faint); line-height: 1.4; }
.bd-period-sel { flex: 0 0 auto; }
.bd-period-sel select { min-width: 150px; }
/* History rows: [date + verdict] [breaks + windows] [P/L + chevron]. */
.bd-list { gap: 8px; }
.bd-row { padding: 12px 14px; gap: 10px; border-radius: 12px; transition: border-color .15s ease, box-shadow .15s ease; }
.bd-row:hover { border-color: var(--line); }
.bd-row.open { box-shadow: 0 6px 22px rgba(0,0,0,.08); }
.bd-row-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "main sub side"; align-items: center; gap: 6px 14px; }
.bd-rh-main { grid-area: main; display: flex; align-items: center; gap: 10px; min-width: 0; }
.bd-rh-sub { grid-area: sub; display: flex; align-items: center; gap: 10px; min-width: 0; }
.bd-rh-sub .bd-row-sub { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; order: 0; }
.bd-rh-side { grid-area: side; display: flex; align-items: center; gap: 10px; justify-self: end; }
.bd-row-pl { margin-left: 0; font-size: 12.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--sunken); border: 1px solid var(--line-soft); }
.bd-row-pl.up { background: var(--up-bg); border-color: color-mix(in srgb, var(--up) 30%, transparent); }
.bd-row-pl.down { background: var(--blocked-bg); border-color: color-mix(in srgb, var(--down) 30%, transparent); }
svg.bd-row-chev { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-left: 0 !important; flex-shrink: 0; }
.bd-date { min-width: 0; white-space: nowrap; font-size: 13px; }
/* Chart: plot + a price-axis gutter; the timeline and the time ticks keep
   the same right margin so every line of the day stays aligned. */
.bd-today, .bd-row { --bc-gut: 66px; }
.bd-today:has(.bd-chart) .tl, .bd-row.open:has(.bd-chart) .tl, .bd-chart > .tl-ticks { margin-right: var(--bc-gut); }
.bd-row .tl { transition: margin-right .2s ease; }
.bc-wrap { display: grid; grid-template-columns: minmax(0, 1fr) var(--bc-gut); }
.bc-wrap .bc-plot { border-radius: 8px 0 0 8px; }
.bc-axis { position: relative; border: 1px solid var(--line-soft); border-left: none; border-radius: 0 8px 8px 0; background: var(--panel); }
.bc-axis .bc-y { left: 6px; right: auto; background: none; padding: 0; font-size: 9.5px; }
.bc-tag { position: absolute; left: -1px; right: 2px; transform: translateY(-50%); font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 700; color: #fff; padding: 2px 4px; border-radius: 0 4px 4px 0; white-space: nowrap; overflow: hidden; text-overflow: clip; z-index: 1; }
.bc-tag.hi { background: var(--brk-hi); } .bc-tag.lo { background: var(--brk-lo); }
.bc-grid { stroke: var(--line-soft); stroke-width: 1; vector-effect: non-scaling-stroke; opacity: .7; }
.bd-chart > .tl-ticks { margin-top: 5px; }
@media (max-width: 640px) {
  #breakout-body { gap: 16px; }
  .bd-today, .bd-row { --bc-gut: 54px; }
  .bc-tag { font-size: 8.5px; padding: 2px 3px; }
  .bc-axis .bc-y { font-size: 8.5px; left: 5px; }
  .bd-period { flex-wrap: wrap; gap: 10px; padding-top: 2px; }
  .bd-period-sel { flex: 1 1 100%; }
  .bd-period-sel select { width: 100%; }
  .bd-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .bd-stats > div { padding: 10px 12px; }
  /* Rows: date + verdict and P/L on the first line, the day's breaks and
     windows below. */
  .bd-row { padding: 12px; gap: 10px; }
  .bd-row-head { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main side" "sub sub"; gap: 6px 10px; }
  .bd-rh-main { gap: 8px; }
  .bd-rh-sub .bd-row-sub { white-space: normal; font-size: 11.5px; }
  .bd-row-pl { font-size: 12px; padding: 2px 8px; }
  /* One level of cards, not three: on a phone the history rows sit right on
     the page. */
  .breakout-modal .bd-histcard { background: none; border: none; padding: 0; gap: 10px; }
  .breakout-modal .bd-histcard > .imp-card-head { padding: 0 2px; }
}
/* Phone: the big data windows (Import trades, Breakout detector) open as a
   full-screen sheet with a header that stays put while the content scrolls. */
@media (max-width: 600px) {
  .modal.import-modal, .modal.breakout-modal {
    width: var(--vw100); max-width: none; height: var(--vh100); max-height: none;
    border-radius: 0; border: none; display: flex; flex-direction: column; overflow: hidden;
  }
  .modal.import-modal .modal-head, .modal.breakout-modal .modal-head {
    flex: 0 0 auto; padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 14px;
    background: var(--panel);
  }
  .modal.import-modal .modal-body, .modal.breakout-modal .modal-body {
    flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
    padding: 16px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  }
  .modal-backdrop:not(.hidden) > .modal.import-modal, .modal-backdrop:not(.hidden) > .modal.breakout-modal { animation: cc-sheet .28s cubic-bezier(.2,.8,.2,1) both; }
}
@keyframes cc-sheet { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.bd-period-sel .param-select { padding: 8px 10px; font-size: 12.5px; border-radius: 8px; }
@media (max-width: 640px) {
  /* Touch-sized controls; 16px keeps iOS from zooming in on focus. */
  .breakout-modal .param-select, .import-modal .param-select { min-height: 44px; font-size: 16px; padding: 9px 12px; border-radius: 10px; }
}

/* ===== v2.9.2 — planned maintenance on the uptime strips ===== */
.ub-out.maint { background: var(--maint); }
.ub-out.maint.ongoing { background: repeating-linear-gradient(135deg, var(--maint) 0 3px, color-mix(in srgb, var(--maint) 60%, #000) 3px 6px); }
:root { --maint: #6d7fe0; --maint-bg: color-mix(in srgb, #6d7fe0 14%, transparent); }
.ut-range.maint { background: var(--maint-bg); color: var(--maint); }
.ut-range em { font-style: normal; font-family: 'Space Grotesk', system-ui, sans-serif; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; opacity: .85; margin-left: 4px; }

/* ===== v2.9.2 — Settings → Advanced → Connection downtime ===== */
.dt-pane { gap: 14px; }
.dt-pad { margin: 0; }
.dt-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.dt-eas { display: flex; flex-direction: column; gap: 8px; }
.dt-ea { border: 1px solid var(--line-soft); border-radius: 12px; background: var(--sunken); transition: border-color .15s ease, box-shadow .15s ease; }
.dt-ea:hover { border-color: var(--line); }
.dt-ea.open { box-shadow: 0 6px 22px rgba(0,0,0,.08); }
.dt-ea-head { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 18px; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; }
.dt-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--offline); }
.dt-dot.on { background: var(--trading); box-shadow: 0 0 0 3px color-mix(in srgb, var(--trading) 20%, transparent); }
.dt-dot.maint { background: var(--maint); box-shadow: 0 0 0 3px var(--maint-bg); }
.dt-ea-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dt-ea-name b { font-size: 13px; font-weight: 650; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dt-ea-name small { font-size: 11.5px; color: var(--txt-faint); }
.dt-ea-name small.on { color: var(--up); } .dt-ea-name small.maint { color: var(--maint); }
.dt-kpis { display: grid; grid-template-columns: repeat(3, minmax(76px, auto)); gap: 16px; }
.dt-kpis > span { display: flex; flex-direction: column; gap: 1px; text-align: right; }
.dt-kpis small { font-size: 9.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--txt-faint); }
.dt-kpis b { font-size: 14px; font-weight: 700; color: var(--txt); font-variant-numeric: tabular-nums; }
.dt-kpis b.warn { color: #d38f00; } .dt-kpis b.maint { color: var(--maint); }
.dt-kpis i { font-style: normal; font-size: 10.5px; color: var(--txt-faint); white-space: nowrap; }
.dt-chev svg { width: 16px; height: 16px; color: var(--txt-faint); transition: transform .18s ease; display: block; }
.dt-ea.open .dt-chev svg { transform: rotate(180deg); }
.dt-ea-body { display: flex; flex-direction: column; gap: 12px; padding: 2px 14px 14px; animation: cc-fade .2s ease both; }
.dt-suggest { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--maint-bg); border: 1px solid color-mix(in srgb, var(--maint) 35%, transparent); }
.dt-suggest > svg { width: 18px; height: 18px; color: var(--maint); flex-shrink: 0; }
.dt-suggest > span { display: flex; flex-direction: column; gap: 1px; flex: 1 1 auto; min-width: 0; }
.dt-suggest b { font-size: 12.5px; color: var(--txt); } .dt-suggest small { font-size: 11.5px; color: var(--txt-dim); }
.dt-now { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line-soft); }
.dt-now-lbl { font-size: 12px; font-weight: 600; color: var(--txt-dim); margin-right: 2px; }
.dt-now-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.dt-now-on { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; }
.dt-now-on svg { width: 18px; height: 18px; color: var(--maint); flex-shrink: 0; }
.dt-now-on > span { display: flex; flex-direction: column; gap: 1px; }
.dt-now-on b { font-size: 12.5px; color: var(--maint); } .dt-now-on small { font-size: 11.5px; color: var(--txt-dim); }
.dt-ea-wins { display: flex; flex-wrap: wrap; gap: 6px; }
.dt-wchip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; border-radius: 10px; border: 1px solid var(--line-soft); background: var(--panel); color: var(--txt); font: inherit; font-size: 12px; cursor: pointer; text-align: left; transition: border-color .15s ease, background .15s ease; }
.dt-wchip:hover { border-color: var(--line); }
.dt-wchip svg { width: 15px; height: 15px; color: var(--maint); flex-shrink: 0; }
.dt-wchip > span { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.dt-wchip small { font-size: 10.5px; color: var(--txt-faint); }
.dt-wchip.off { opacity: .55; }
.dt-wchip.add { border-style: dashed; color: var(--txt-dim); }
.dt-outs { display: flex; flex-direction: column; gap: 4px; }
.dt-outs-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; padding: 2px 2px 4px; }
.dt-outs-head b { font-size: 12.5px; color: var(--txt); } .dt-outs-head small { font-size: 11px; color: var(--txt-faint); }
.dt-closed { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--txt-dim); cursor: pointer; }
.dt-pane { container-type: inline-size; }
.dt-out { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "when dur" "chip tag"; align-items: center; gap: 8px 12px; padding: 10px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line-soft); border-left: 3px solid var(--offline); }
.dt-out-when { grid-area: when; } .dt-out-dur { grid-area: dur; } .dt-out .dt-chip { grid-area: chip; } .dt-out .dt-tag, .dt-out .dt-tag-none { grid-area: tag; justify-self: end; }
.dt-out.down { border-left-color: var(--down); } .dt-out.maint { border-left-color: var(--maint); }
.dt-out.partial { border-left-color: #e0a010; } .dt-out.closed { border-left-color: var(--line); opacity: .8; }
.dt-out.ongoing { background: color-mix(in srgb, var(--down) 5%, var(--panel)); }
.dt-out-when { display: flex; align-items: baseline; gap: 8px; min-width: 0; font-size: 12px; color: var(--txt-dim); }
.dt-out-when b { font-weight: 650; color: var(--txt); white-space: nowrap; }
.dt-out-when > span { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; white-space: nowrap; }
.dt-out-dur { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--txt); display: flex; flex-direction: column; text-align: right; }
.dt-out-dur small { font-family: 'Space Grotesk', system-ui, sans-serif; font-size: 10px; color: #c98500; }
.dt-chip { justify-self: start; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line-soft); color: var(--txt-faint); white-space: nowrap; }
.dt-chip.down { color: var(--down); background: var(--blocked-bg); border-color: color-mix(in srgb, var(--down) 30%, transparent); }
.dt-chip.maint { color: var(--maint); background: var(--maint-bg); border-color: color-mix(in srgb, var(--maint) 35%, transparent); }
.dt-chip.partial { color: #c98500; background: color-mix(in srgb, #e0a010 12%, transparent); border-color: color-mix(in srgb, #e0a010 35%, transparent); }
.dt-tag.seg { align-self: center; }
.dt-tag.seg button { min-width: 54px; }
.dt-empty { font-size: 12px; color: var(--txt-faint); padding: 8px 2px; }
.dt-more { align-self: center; margin-top: 4px; }
.dt-sec { display: flex; flex-direction: column; gap: 2px; padding: 6px 2px 0; }
.dt-sec b { font-size: 13.5px; color: var(--txt); } .dt-sec small { font-size: 11.5px; color: var(--txt-faint); }
.dt-wins { display: flex; flex-direction: column; gap: 6px; }
.dt-win { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-soft); background: var(--sunken); }
.dt-win.off, .dt-win.past { opacity: .6; }
.dt-win.live { border-color: color-mix(in srgb, var(--maint) 45%, transparent); background: color-mix(in srgb, var(--maint) 6%, var(--sunken)); }
.dt-win-ic { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--maint-bg); color: var(--maint); }
.dt-win-ic svg { width: 17px; height: 17px; }
.dt-win-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.dt-win-main b { font-size: 13px; color: var(--txt); } .dt-win-main > span { font-size: 12px; color: var(--txt-dim); }
.dt-win-main small { font-size: 11px; color: var(--txt-faint); }
.dt-win.live .dt-win-main small { color: var(--maint); }
.dt-win-act { display: flex; align-items: center; gap: 8px; }
.dt-ib { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line-soft); background: var(--panel); color: var(--txt-dim); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.dt-ib:hover { color: var(--txt); border-color: var(--line); }
.dt-ib svg { width: 15px; height: 15px; }
.dt-wins-empty { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px; border-radius: 12px; border: 1px dashed var(--line); }
.dt-wins-empty > span { flex: 1 1 100%; font-size: 12px; color: var(--txt-dim); }
/* Editor */
.mw-dialog { width: min(560px, 94vw); }
.mw-dialog .na-test-dialog-head b { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; }
.mw-dialog .na-test-dialog-head b svg { width: 18px; height: 18px; color: var(--maint); }
.mw-form { gap: 14px; max-height: calc(86vh - 60px); overflow-y: auto; }
.mw-f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mw-f > span:first-child { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--txt-faint); font-weight: 600; }
.mw-f[hidden], .mw-row[hidden] { display: none; }
.mw-form .text-input, .mw-form .param-select { width: 100%; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line); background: var(--sunken); color: var(--txt); font-family: 'Space Grotesk', system-ui, sans-serif; font-size: 13px; min-height: 40px; }
.mw-form .text-input:focus, .mw-form .param-select:focus { outline: none; border-color: var(--standby); box-shadow: 0 0 0 3px var(--standby-bg); }
.mw-row { display: grid; grid-template-columns: 1fr 1fr 1.6fr; gap: 10px; align-items: end; }
.mw-once { grid-template-columns: 1fr 1fr; }
.mw-once .mw-chk { grid-column: 1 / -1; }
.mw-chk { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--txt-dim); cursor: pointer; }
.mw-kind { align-self: stretch; width: auto; }
.mw-kind button { flex: 1 1 0; }
.mw-daychips { display: flex; gap: 6px; flex-wrap: wrap; }
.mw-day { min-width: 46px; padding: 7px 0; border-radius: 9px; border: 1px solid var(--line); background: var(--sunken); color: var(--txt-dim); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.mw-day.on { background: var(--maint-bg); border-color: color-mix(in srgb, var(--maint) 50%, transparent); color: var(--maint); }
.mw-grace-in { display: flex; align-items: center; gap: 10px; }
.mw-grace-in .text-input { width: 90px; }
.mw-grace-in em { font-style: normal; font-size: 12px; color: var(--txt-dim); }
.mw-preview { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--maint-bg); color: var(--txt); font-size: 12.5px; }
.mw-preview:empty { display: none; }
.mw-preview svg { width: 16px; height: 16px; color: var(--maint); flex-shrink: 0; margin-top: 1px; }
.mw-preview span { display: flex; flex-direction: column; gap: 2px; } .mw-preview small { color: var(--txt-dim); font-size: 11.5px; }
.mw-err { font-size: 12px; color: var(--down); }
.mw-err[hidden] { display: none; }
.mw-actions { display: flex; align-items: center; gap: 8px; padding-top: 4px; }
.mw-actions .btn { display: inline-flex; align-items: center; gap: 6px; }
.mw-actions .btn svg { width: 14px; height: 14px; }
.mw-sp { flex: 1 1 auto; }
@media (max-width: 640px) {
  .dt-ea-body { padding: 0 12px 12px; }
  .dt-suggest { flex-wrap: wrap; } .dt-suggest .btn { margin-left: 30px; }
  .dt-now-btns { flex: 1 1 100%; } .dt-now-btns .btn { flex: 1 1 auto; }
  .dt-out-when { flex-direction: column; gap: 1px; }
  .dt-tag.seg button { min-height: 32px; padding: 4px 10px; }
  /* One frame less on a phone: the EA cards sit right on the settings card. */
  .dt-pane.adv-pane { background: none; border: none; padding: 0; }
  .dt-win { align-items: start; }
  .dt-win-act { flex-direction: column; gap: 10px; }
  .mw-dialog { width: 100%; max-width: 100%; max-height: 92vh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  .mw-row { grid-template-columns: 1fr 1fr; } .mw-row .mw-tz { grid-column: 1 / -1; }
  .mw-form .text-input, .mw-form .param-select { font-size: 16px; min-height: 44px; }
  .mw-form { padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
}

/* The card's own width decides (Settings is a 640px window on a desktop). */
@container (max-width: 620px) {
  .dt-ea-head { grid-template-columns: 10px minmax(0, 1fr) 18px; grid-template-areas: "dot name chev" "kpi kpi kpi"; gap: 10px; padding: 12px; }
  .dt-dot { grid-area: dot; } .dt-ea-name { grid-area: name; } .dt-chev { grid-area: chev; }
  .dt-kpis { grid-area: kpi; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .dt-kpis > span { text-align: left; padding: 7px 10px; border-radius: 9px; background: var(--panel); border: 1px solid var(--line-soft); }
  .dt-kpis b { font-size: 13.5px; }
}

/* ===== v2.9.3 — Breakout detector: one market, EAs below, chart layers ===== */
.bd-top { align-items: flex-end; }
.bd-sym { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.bd-sym > b { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; color: var(--txt); }
.bd-sym > small { font-size: 11.5px; color: var(--txt-faint); }
.bd-lyr-btn { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; align-self: center; }
.bd-lyr-btn svg { width: 15px; height: 15px; }
.bd-lyr-btn.on { border-color: var(--standby); color: var(--standby); background: var(--standby-bg); }
.bd-layers { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px; border-radius: 12px; background: var(--sunken); border: 1px solid var(--line-soft); }
.bd-layers[hidden] { display: none; }
.bd-lyr { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--txt-faint); font: inherit; font-size: 12px; cursor: pointer; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.bd-lyr i { width: 10px; height: 10px; border-radius: 3px; background: var(--line); transition: background .15s ease; }
.bd-lyr.on { color: var(--txt); border-color: var(--line); }
.bd-lyr.on.lyr-night i { background: color-mix(in srgb, #7c8cff 55%, transparent); }
.bd-lyr.on.lyr-check i { background: var(--txt-dim); width: 3px; border-radius: 1px; }
.bd-lyr.on.lyr-windows i { background: color-mix(in srgb, var(--up) 45%, transparent); }
.bd-lyr.on.lyr-high i { background: var(--brk-hi); height: 3px; }
.bd-lyr.on.lyr-low i { background: var(--brk-lo); height: 3px; }
.bd-lyr.on.lyr-breaks i { background: linear-gradient(var(--brk-hi) 50%, var(--brk-lo) 50%); }
.bd-lyr.on.lyr-band i { background: color-mix(in srgb, var(--txt-dim) 35%, transparent); }
.bd-lyr.on.lyr-last i { background: var(--txt); height: 3px; }
.bd-lyr.on.lyr-trades i { background: var(--up); border-radius: 50%; }
.bd-lyr.on.lyr-grid i { background: repeating-linear-gradient(180deg, var(--line) 0 2px, transparent 2px 4px); }
.bc-last { stroke: var(--txt); stroke-width: 1; stroke-dasharray: 1 3; vector-effect: non-scaling-stroke; opacity: .7; }
.bc-tag.last { background: var(--txt); color: var(--panel); }
/* Source of the market data. */
.bd-src { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: var(--sunken); border: 1px solid var(--line-soft); font-size: 12.5px; }
.bd-src > svg { width: 16px; height: 16px; color: var(--txt-faint); flex-shrink: 0; margin-top: 1px; }
.bd-src > span:not(.bd-src-note) { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; min-width: 0; flex: 1 1 auto; }
.bd-src small { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--txt-faint); font-weight: 600; margin-right: 2px; }
.bd-src b { font-weight: 650; color: var(--txt); }
.bd-src b small { font-size: 11px; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--up); margin: 0 0 0 2px; }
.bd-src i { font-style: normal; font-size: 11px; color: var(--txt-faint); }
.bd-src em { font-style: normal; color: var(--txt-faint); }
.bd-src-note { flex: 1 1 100%; font-size: 11px; color: var(--txt-faint); padding-left: 26px; }
.bd-src.empty b { color: var(--txt-dim); font-weight: 500; }
.bd-today-src { font-size: 11px !important; color: var(--txt-faint) !important; }
.bd-warn { font-size: 12px; color: #c98500; padding: 8px 10px; border-radius: 9px; background: color-mix(in srgb, #e0a010 10%, transparent); border: 1px solid color-mix(in srgb, #e0a010 30%, transparent); }
.bd-next { display: inline-flex; align-items: center; gap: 7px; }
.bd-next svg { width: 14px; height: 14px; color: var(--txt-faint); flex-shrink: 0; }
/* Each EA on the instrument. */
.bd-eas { display: flex; flex-direction: column; gap: 8px; }
.bd-ea { border: 1px solid var(--line-soft); border-radius: 12px; background: var(--panel); transition: border-color .15s ease, box-shadow .15s ease; }
.bd-ea:hover { border-color: var(--line); }
.bd-ea.open { box-shadow: 0 6px 22px rgba(0,0,0,.08); }
.bd-ea-head { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 16px; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; }
.bd-ea-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bd-ea-name b { font-size: 13px; font-weight: 650; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-ea-name small { font-size: 11.5px; color: var(--txt-faint); }
.bd-ea-name small .warn { color: #c98500; }
.bd-ea-kpi { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.bd-ea-kpi small { font-size: 10.5px; color: var(--txt-faint); }
.bd-ea-kpi b { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bd-ea-kpi .up { color: var(--up); } .bd-ea-kpi .down { color: var(--down); }
.bd-ea.open > .bd-ea-head svg.bd-row-chev { transform: rotate(180deg); }
.bd-ea-body { display: flex; flex-direction: column; gap: 8px; padding: 0 12px 12px; animation: cc-fade .2s ease both; }
.bd-ea-body .bd-row { background: var(--sunken); }
svg.bd-row-chev { color: var(--txt-faint); transition: transform .18s ease; }
.bd-row.open > .bd-row-head svg.bd-row-chev { transform: rotate(180deg); }
@media (max-width: 640px) {
  .bd-sym > b { font-size: 16px; }
  /* "Check in 1 h 28 min" sits under the verdict, flush with the card. */
  .bd-today-head { grid-template-columns: 12px minmax(0, 1fr); }
  .bd-next { grid-column: 1 / -1; justify-self: stretch; margin: 2px 0 0; padding: 8px 12px; border-radius: 10px; white-space: normal; }
  .bd-ea-head { grid-template-columns: 10px minmax(0, 1fr) auto 16px; gap: 10px; padding: 12px; }
  .bd-src-note { padding-left: 0; }
  .breakout-modal .bd-eacard { background: none; border: none; padding: 0; gap: 10px; }
  .breakout-modal .bd-eacard > .imp-card-head { padding: 0 2px; }
  .bd-ea-body { padding: 0 10px 10px; }
}

/* ===== v2.9.3 — selection animations visible on a phone ===== */
.cal-sel {
  background: color-mix(in srgb, var(--standby) 12%, transparent);
  box-shadow: inset 0 0 0 2px var(--standby), 0 0 0 3px color-mix(in srgb, var(--standby) 18%, transparent);
}
.seg-pill { box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 55%, transparent), 0 2px 10px color-mix(in srgb, currentColor 28%, transparent); }
.seg button.on { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--standby) 40%, transparent); }

/* ===== v2.9.3 — Settings as a full-screen sheet on a phone ===== */
@media (max-width: 600px) {
  .modal.settings-tabbed {
    width: var(--vw100); max-width: none; height: var(--vh100) !important; max-height: none;
    border-radius: 0; border: none;
  }
  .modal.settings-tabbed .modal-head { padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 14px; background: var(--panel); }
  .modal.settings-tabbed .modal-body { padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .modal-backdrop:not(.hidden) > .modal.settings-tabbed { animation: cc-sheet .28s cubic-bezier(.2,.8,.2,1) both; }
}
.imp-hist-more { align-self: center; display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--txt-dim); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: color .15s ease, border-color .15s ease; }
.imp-hist-more:hover { color: var(--txt); border-color: var(--txt-faint); }
.imp-hist-more .imp-chev { transition: transform .18s ease; }
.imp-hist-more[aria-expanded="true"] .imp-chev { transform: rotate(180deg); }
.dt-flt { margin: 0 0 4px; }
.dt-flt button span { opacity: .65; margin-left: 2px; font-variant-numeric: tabular-nums; }
.dt-more small { font-weight: 500; color: var(--txt-faint); }

/* ===== v2.9.3 — Import: the trade already on the account, side by side ===== */
.imp-table tr:has(+ tr.imp-cmp) td { border-bottom-color: transparent; }
.imp-table tr.imp-cmp td { padding-top: 2px; padding-bottom: 8px; font-size: 11px; color: var(--txt-faint); background: color-mix(in srgb, var(--sunken) 60%, transparent); }
.imp-table tr.imp-cmp td.diff { color: #c98500; font-weight: 600; }
.imp-table tr.imp-cmp td small { display: inline-block; margin-left: 5px; font-size: 10px; color: #c98500; }
.imp-table tr.imp-cmp td.up { color: color-mix(in srgb, var(--up) 75%, var(--txt-faint)); }
.imp-table tr.imp-cmp td.down { color: color-mix(in srgb, var(--down) 75%, var(--txt-faint)); }
.imp-cmp-lbl { display: inline-block; padding-left: 26px; color: var(--txt-faint); font-size: 13px; }
.imp-cmp-kind { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line-soft); color: var(--txt-dim); max-width: 220px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.imp-cmp.ea .imp-cmp-kind, .imp-cmp.copied .imp-cmp-kind, .imp-cmp.manual .imp-cmp-kind { color: var(--up); border-color: color-mix(in srgb, var(--up) 30%, transparent); background: var(--up-bg); }
.imp-cmp-delta { font-size: 10.5px; font-weight: 700; white-space: nowrap; color: var(--txt-faint); }
.imp-cmp-delta.up { color: var(--up); } .imp-cmp-delta.down { color: var(--down); }

/* ===== v2.9.4 — Settings → Advanced: a menu, each tool on its own page ===== */
.adv-menu { display: flex; flex-direction: column; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--panel); overflow: hidden; }
.adv-item { display: grid; grid-template-columns: 36px minmax(0, 1fr) 18px; align-items: center; gap: 14px; padding: 13px 16px; border: none; background: none; color: var(--txt); font: inherit; text-align: left; cursor: pointer; transition: background .15s ease; }
.adv-item + .adv-item { border-top: 1px solid var(--line-soft); }
/* Hover only where there is a pointer: on a phone the row under the finger
   kept looking selected after a swipe back to this menu. */
@media (hover: hover) { .adv-item:hover { background: var(--hover, color-mix(in srgb, var(--txt) 4%, transparent)); } }
.adv-item:active { background: color-mix(in srgb, var(--txt) 7%, transparent); }
.adv-ic { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--standby-bg); color: var(--standby); flex-shrink: 0; }
.adv-ic svg { width: 18px; height: 18px; }
.adv-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.adv-txt b { font-size: 14px; font-weight: 650; }
.adv-txt small { font-size: 12px; color: var(--txt-faint); }
.adv-go svg { width: 16px; height: 16px; color: var(--txt-faint); display: block; }
.adv-page { display: flex; flex-direction: column; gap: 14px; }
.adv-page-head { display: flex; flex-direction: column; gap: 12px; }
.adv-back { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px 6px 6px; border-radius: 999px; border: 1px solid var(--line-soft); background: var(--panel); color: var(--standby); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.adv-back svg { width: 18px; height: 18px; }
.adv-back:hover { border-color: var(--line); }
.adv-page-title { display: flex; align-items: center; gap: 12px; }
.adv-page-title > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.adv-page-title b { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; color: var(--txt); }
.adv-page-title small { font-size: 12px; color: var(--txt-faint); }
.adv-brief-hint { padding: 0 14px 14px; margin: 0; }
@media (max-width: 600px) {
  .adv-item { padding: 14px; gap: 12px; }
  .adv-page-title b { font-size: 16px; }
}

/* ===== v2.9.4 — Manage users: profiles start folded ===== */
.um-fold { gap: 0; padding: 0; transition: border-color .15s ease, box-shadow .15s ease; }
.um-fold:hover { border-color: var(--line); }
.um-fold > .um-head { padding: 12px 16px; cursor: pointer; }
.um-fold .um-ident { flex: 1 1 auto; min-width: 0; }
.um-fold .um-ident small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.um-sum { display: flex; gap: 6px; flex-shrink: 0; }
.um-chev { width: 16px; height: 16px; fill: none; stroke: var(--txt-faint); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; transition: transform .18s ease; }
.um-fold.open .um-chev { transform: rotate(180deg); }
.um-fold > .um-body { display: none; flex-direction: column; gap: 12px; padding: 0 16px 14px; }
.um-fold.open > .um-body { display: flex; }
.um-fold.open { box-shadow: 0 6px 22px rgba(0,0,0,.08); }
@media (max-width: 600px) {
  .um-fold > .um-head { flex-wrap: wrap; gap: 8px 10px; padding: 12px; }
  .um-fold .um-ident { flex: 1 1 calc(100% - 140px); }
  .um-sum { order: 5; flex: 1 1 100%; padding-left: 44px; }
  .um-fold > .um-body { padding: 0 12px 12px; }
}

/* ===== v2.9.4 — Breakout detector: chart first, simpler header ===== */
/* No strip above a chart: the chart shows the same, in full. */
.bd-today:has(.bd-chart) > .tl, .bd-row.open > .tl { display: none; }
.bd-row.open { gap: 6px; }
.bc-win.blocked { fill: color-mix(in srgb, var(--down) 7%, transparent); }
.bc-win.off { fill: color-mix(in srgb, #e0a010 9%, transparent); }
.bc-win.unknown { fill: color-mix(in srgb, var(--txt-faint) 7%, transparent); }
.bd-lyr.on.lyr-am i, .bd-lyr.on.lyr-pm i { background: color-mix(in srgb, var(--up) 45%, transparent); }
.bd-lyr.on.lyr-pm i { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--up) 45%, transparent) 0 2px, transparent 2px 4px); }
/* Instrument + where its data comes from, on one line. */
.bd-sym { gap: 3px; }
.bd-src { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 3px 7px; padding: 0; border: none; background: none; font-size: 12px; min-width: 0; }
.bd-src small { font-size: 9.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--txt-faint); font-weight: 700; margin: 0; }
.bd-src b { font-weight: 600; color: var(--txt-dim); }
.bd-src em { font-style: normal; color: var(--txt-faint); }
.bd-src.empty b { color: var(--txt-faint); font-weight: 500; }
.bd-sym-src { margin-top: -6px; }
.bd-ea-name small .src { color: var(--standby); font-weight: 600; }
.bd-ea-name small .old { color: #c98500; }
.bd-top:has(.bd-sym) { flex-wrap: nowrap; align-items: center; }
.bd-top:has(.bd-sym) .bd-lyr-btn { flex-shrink: 0; }
@media (max-width: 420px) { .bd-lyr-btn { padding: 7px 10px; } }

/* ===== v2.9.5 — chart layers: a short list that says what each one is ===== */
.bd-layers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 8px; }
.bd-layers .bd-lyr { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line-soft); background: var(--panel); color: var(--txt); cursor: pointer; font-size: 12.5px; }
.bd-layers .bd-lyr > span { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.bd-layers .bd-lyr b { font-weight: 650; font-size: 12.5px; }
.bd-layers .bd-lyr small { font-size: 11px; color: var(--txt-faint); line-height: 1.35; }
.bd-layers .bd-lyr > i { width: 26px; height: 18px; border-radius: 4px; background: var(--sunken); border: 1px solid var(--line-soft); position: relative; overflow: hidden; }
.bd-lyr.lyr-night > i { background: linear-gradient(90deg, color-mix(in srgb, #7c8cff 35%, transparent) 0 70%, transparent 70%); }
.bd-lyr.lyr-night > i::after { content: ''; position: absolute; left: 70%; top: 0; bottom: 0; border-left: 1.5px dashed var(--txt-dim); }
.bd-lyr.lyr-window > i { background: linear-gradient(90deg, transparent 20%, color-mix(in srgb, var(--up) 30%, transparent) 20% 80%, transparent 80%); }
.bd-lyr.lyr-levels > i { background: linear-gradient(transparent 25%, var(--brk-hi) 25% 33%, transparent 33% 67%, var(--brk-lo) 67% 75%, transparent 75%); }
.bd-lyr.lyr-breaks > i::before { content: '▲'; position: absolute; left: 4px; top: 0; font-size: 9px; color: var(--brk-hi); }
.bd-lyr.lyr-breaks > i::after { content: '▼'; position: absolute; right: 4px; bottom: 0; font-size: 9px; color: var(--brk-lo); }
.bd-lyr.lyr-trades > i::after { content: ''; position: absolute; left: 4px; right: 4px; top: 50%; height: 2px; background: var(--up); transform: rotate(-20deg); }
.bd-lyr.lyr-trades > i::before { content: ''; position: absolute; left: 3px; top: 9px; width: 5px; height: 5px; border-radius: 50%; border: 1.5px solid var(--up); background: var(--panel); z-index: 1; }
.bd-lyr.lyr-last > i::after { content: ''; position: absolute; left: 2px; right: 2px; top: 50%; border-top: 1.5px dotted var(--txt); }
@media (max-width: 640px) { .bd-layers { grid-template-columns: 1fr; } }

/* ===== v2.9.5 — uptime details: stay open, scroll, no sideways scrolling ===== */
#uptime-tip { pointer-events: auto; max-width: min(340px, calc(100vw - 16px)); }
#uptime-tip .ut-list { overflow-x: hidden; scrollbar-width: thin; scrollbar-color: var(--line) transparent; padding-right: 2px; }
#uptime-tip .ut-list::-webkit-scrollbar { width: 5px; }
#uptime-tip .ut-list::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
#uptime-tip .ut-range { flex-wrap: wrap; row-gap: 1px; }
#uptime-tip .ut-when { white-space: normal; min-width: 0; flex: 1 1 140px; }
#uptime-tip .ut-dur { margin-left: auto; }

/* ===== v2.9.5 — Downloads ===== */
.dl-wrap { display: flex; flex-direction: column; gap: 18px; }
.dl-sec { display: flex; flex-direction: column; gap: 8px; }
.dl-sec-head { display: flex; align-items: center; gap: 10px; }
.dl-sec-head > span:not(.fl-ic) { display: flex; flex-direction: column; gap: 1px; }
.dl-sec-head b { font-size: 14px; color: var(--txt); }
.dl-sec-head small { font-size: 11.5px; color: var(--txt-faint); }
.dl-sec-head.plain { flex-direction: row; align-items: baseline; gap: 8px; padding: 0 2px; }
.dl-list { display: flex; flex-direction: column; gap: 8px; }
.fl-card { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; grid-template-areas: "ic main lock" "ic fmts fmts"; align-items: center; gap: 6px 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-soft); background: var(--sunken); }
.fl-card:not([data-file]) { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main fmts"; }
.fl-ic { grid-area: ic; width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--standby-bg); color: var(--standby); flex-shrink: 0; }
.fl-ic svg { width: 19px; height: 19px; }
.fl-ic.diagram { background: var(--maint-bg); color: var(--maint); }
.fl-ic.readme { background: var(--up-bg); color: var(--up); }
.fl-main { grid-area: main; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fl-main b { font-size: 13.5px; font-weight: 650; color: var(--txt); }
.fl-main small { font-size: 11.5px; color: var(--txt-faint); line-height: 1.35; }
.fl-lock { grid-area: lock; display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 700; letter-spacing: .05em; padding: 3px 8px; border-radius: 999px; color: #c98500; background: color-mix(in srgb, #e0a010 12%, transparent); border: 1px solid color-mix(in srgb, #e0a010 32%, transparent); }
.fl-lock svg { width: 12px; height: 12px; }
.fl-fmts { grid-area: fmts; display: flex; flex-wrap: wrap; gap: 6px; }
.fl-fmt { font: inherit; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--txt); cursor: pointer; transition: border-color .15s ease, color .15s ease, background .15s ease; }
.fl-fmt:hover, .fl-fmt.on { border-color: var(--standby); color: var(--standby); background: var(--standby-bg); }
.fl-fmt.ghost { font-weight: 600; letter-spacing: 0; }
.fl-code { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line-soft); font-size: 12.5px; color: var(--txt-dim); }
.fl-code[hidden] { display: none; }
.fl-code input { width: 120px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--sunken); color: var(--txt); font-family: 'JetBrains Mono', monospace; font-size: 15px; letter-spacing: .12em; }
.fl-err { flex: 1 1 100%; font-style: normal; font-size: 12px; color: var(--down); }
.fl-err[hidden] { display: none; }
/* manager */
.fla-list { display: flex; flex-direction: column; gap: 8px; }
.fla-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; border: 1px solid var(--line-soft); background: var(--sunken); }
.fla-row.off { opacity: .6; }
.fla-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fla-main b { font-size: 13px; color: var(--txt); }
.fla-main small { font-size: 11px; color: var(--txt-faint); line-height: 1.4; }
.fla-fmts { display: flex; flex-wrap: wrap; gap: 4px; }
.fla-fmts i { font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: .05em; padding: 2px 6px; border-radius: 5px; background: var(--panel); border: 1px solid var(--line-soft); color: var(--txt-dim); }
.fl-vars { display: flex; flex-direction: column; gap: 4px; }
.fl-var { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; background: var(--sunken); border: 1px solid var(--line-soft); font-size: 12px; color: var(--txt); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fl-var b { font-size: 9.5px; letter-spacing: .05em; padding: 2px 6px; border-radius: 5px; background: var(--panel); border: 1px solid var(--line-soft); }
.fl-var small { color: var(--txt-faint); }
.fl-var.new { border-style: dashed; }
.fl-var button { margin-left: auto; border: none; background: none; color: var(--txt-faint); font-size: 16px; cursor: pointer; padding: 0 4px; }
.fl-pick { align-self: flex-start; cursor: pointer; }
.fl-users { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-radius: 10px; background: var(--sunken); border: 1px solid var(--line-soft); margin-top: 4px; }
.fl-users[hidden] { display: none; }
.fl-users small { color: var(--txt-faint); }
.fl-sw { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--sunken); border: 1px solid var(--line-soft); cursor: pointer; }
.fl-sw > span { display: flex; flex-direction: column; gap: 1px; }
.fl-sw b { font-size: 12.5px; color: var(--txt); } .fl-sw small { font-size: 11px; color: var(--txt-faint); }
.fl-recent { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; color: var(--txt-dim); font-family: 'JetBrains Mono', monospace; }
.fl-row2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) {
  .fl-card { padding: 12px; }
  .fl-fmt { padding: 8px 14px; }
}
@media (max-width: 600px) {
  .modal.sheet { width: var(--vw100); max-width: none; height: var(--vh100); max-height: none; border-radius: 0; border: none; display: flex; flex-direction: column; overflow: hidden; }
  .modal.sheet .modal-head { flex: 0 0 auto; padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 14px; background: var(--panel); }
  .modal.sheet .modal-body { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 16px 16px calc(24px + env(safe-area-inset-bottom, 0px)); }
  .modal-backdrop:not(.hidden) > .modal.sheet { animation: cc-sheet .28s cubic-bezier(.2,.8,.2,1) both; }
}

/* ===== v2.9.6 — breakout chart: the night decides, the rest informs ===== */
.bc-mk.key { transform: translate(-7px, -100%); border-left-width: 7px; border-right-width: 7px; }
.bc-mk.hi.key { border-bottom-width: 11px; filter: drop-shadow(0 0 0 var(--panel)) drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.bc-mk.lo.key { border-top-width: 11px; transform: translate(-7px, 0); filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.bc-mk.info { opacity: .45; transform: translate(-4px, -100%) scale(.75); }
.bc-mk.lo.info { transform: translate(-4px, 0) scale(.75); }
.tl-evm.info { opacity: .4; }
.bc-night { fill: color-mix(in srgb, #7c8cff 11%, transparent); }
.bc-win { fill: color-mix(in srgb, var(--up) 6%, transparent); }
.bc-trade.manual { stroke-dasharray: 4 3; }
.bc-entry.manual { border-style: dashed; }
.bd-evc i { font-style: normal; font-weight: 500; color: var(--txt-faint); font-size: 11px; }
.bd-evgrp { display: flex; flex-direction: column; gap: 6px; }
.bd-evgrp > small, .bd-evgrp > summary { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--txt-faint); font-weight: 600; }
.bd-evgrp > summary { cursor: pointer; list-style: none; }
.bd-evgrp > summary::-webkit-details-marker { display: none; }
.bd-evgrp > summary::before { content: '▸ '; }
.bd-evgrp[open] > summary::before { content: '▾ '; }
.bd-evgrp.later .bd-ev { opacity: .75; }
.bd-sym b em { font-style: normal; font-weight: 500; font-size: 12px; color: var(--txt-faint); margin-left: 10px; letter-spacing: 0; }
.bd-src i { display: block; flex: 1 1 100%; }
/* Downloads manager rows: the icon sits in its own column */
.fla-row .fl-ic { grid-area: auto; }

/* ===== v2.9.7 — breakout: zones back, AM only, large view, clearer P/L ===== */
.bc-ex.hi { fill: color-mix(in srgb, var(--brk-hi) 7%, transparent); }
.bc-ex.lo { fill: color-mix(in srgb, var(--brk-lo) 7%, transparent); }
.bc-ex.hi.key { fill: color-mix(in srgb, var(--brk-hi) 20%, transparent); }
.bc-ex.lo.key { fill: color-mix(in srgb, var(--brk-lo) 20%, transparent); }
.bd-row-pl { display: inline-flex; align-items: baseline; gap: 7px; padding: 3px 10px; }
.bd-row-pl small { font-size: 10.5px; font-weight: 600; color: var(--txt-dim); }
.bd-row-pl b { font-size: 12.5px; font-weight: 700; }
.bd-row-pl.up b { color: var(--up); } .bd-row-pl.down b { color: var(--down); }
.bd-row-tools { display: none; justify-content: flex-end; }
.bd-row.open .bd-row-tools, .bd-row-tools.on { display: flex; }
.bd-big-btn { display: inline-flex; align-items: center; gap: 7px; }
.bd-big-btn svg { width: 14px; height: 14px; }
/* Large view */
.bdx-dialog { width: min(1400px, 96vw); height: min(900px, 92vh); max-width: none; max-height: none; margin: auto; padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); color: var(--txt); box-shadow: 0 24px 70px rgba(0,0,0,.4); overflow: hidden; }
.bdx-dialog[open] { display: flex; flex-direction: column; }
.bdx-dialog::backdrop { background: rgba(10, 14, 22, .6); }
.bdx-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
.bdx-title { display: flex; align-items: center; gap: 10px; }
.bdx-title b { font-size: 15px; }
.bdx-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bdx-zoom { display: inline-flex; gap: 4px; }
.bdx-zoom .dt-ib { font-size: 18px; font-weight: 600; }
.bdx-sw { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--txt-dim); cursor: pointer; }
.bdx-body { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 330px; }
.bdx-body.no-det { grid-template-columns: minmax(0, 1fr); }
.bdx-body.no-det .bdx-det { display: none; }
.bdx-chart { padding: 14px 16px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.bdx-chart .bd-chart-host { flex: 1 1 auto; min-height: 0; touch-action: none; cursor: grab; user-select: none; }
.bdx-chart .bd-chart-host:active { cursor: grabbing; }
.bd-chart.big { --bc-gut: 72px; height: 100%; display: flex; flex-direction: column; }
.bd-chart.big .bc-wrap { flex: 1 1 auto; min-height: 0; }
.bd-chart.big .bc-plot { height: 100%; min-height: 260px; }
.bd-chart.big .bc-plot { touch-action: none; }
.bdx-hint { margin: 0; font-size: 11px; color: var(--txt-faint); text-align: center; }
.bdx-det { border-left: 1px solid var(--line-soft); overflow-y: auto; padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 14px; background: var(--sunken); }
.bdx-sec { display: flex; flex-direction: column; gap: 5px; }
.bdx-sec h4 { margin: 0 0 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--txt-dim); display: flex; align-items: baseline; gap: 8px; }
.bdx-sec h4 small { font-size: 10px; letter-spacing: .04em; color: var(--txt-faint); font-weight: 500; text-transform: none; }
.bdx-kv { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.bdx-kv span { color: var(--txt-dim); }
.bdx-kv b { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 600; color: var(--txt); text-align: right; }
.bdx-kv b small { color: var(--txt-faint); font-weight: 400; margin-left: 4px; }
.bdx-kv b.up { color: var(--up); } .bdx-kv b.down { color: var(--down); } .bdx-kv b.hi { color: var(--brk-hi); } .bdx-kv b.lo { color: var(--brk-lo); }
.bdx-evs { display: flex; flex-direction: column; gap: 3px; margin-top: 2px; }
.bdx-ev { display: grid; grid-template-columns: 14px auto minmax(0, 1fr) auto; gap: 8px; align-items: baseline; font-size: 11.5px; padding: 4px 8px; border-radius: 7px; background: var(--panel); border: 1px solid var(--line-soft); }
.bdx-ev.hi b { color: var(--brk-hi); } .bdx-ev.lo b { color: var(--brk-lo); }
.bdx-ev span:first-of-type { font-family: 'JetBrains Mono', monospace; }
.bdx-ev small { color: var(--txt-faint); }
.bdx-none { margin: 2px 0 0; font-size: 12px; color: var(--up); }
.bdx-more summary { font-size: 11.5px; color: var(--txt-dim); cursor: pointer; margin-top: 4px; }
.bdx-trade { display: flex; flex-direction: column; gap: 2px; padding: 7px 9px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line-soft); font-size: 12px; }
.bdx-trade span { color: var(--txt-dim); }
.bdx-trade i { font-style: normal; font-size: 10px; margin-left: 6px; padding: 1px 6px; border-radius: 999px; border: 1px dashed var(--line); color: var(--txt-faint); }
.bdx-trade-l { display: flex; gap: 8px; align-items: baseline; font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.bdx-trade-l small { color: var(--txt-faint); }
.bdx-trade-l b { margin-left: auto; font-size: 12px; }
.bdx-trade-l b.up { color: var(--up); } .bdx-trade-l b.down { color: var(--down); }
@media (max-width: 760px) {
  .bdx-dialog { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; border: none; }
  .bdx-head { padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px; }
  .bdx-body { grid-template-columns: 1fr; grid-template-rows: minmax(300px, 55%) auto; overflow-y: auto; }
  .bdx-det { border-left: none; border-top: 1px solid var(--line-soft); overflow: visible; }
  .bdx-chart { padding: 10px 12px; }
}
.bdx-title { flex: 1 1 auto; min-width: 0; }
.bdx-x { margin-left: auto; }
.bdx-head { flex-wrap: wrap; }
.bdx-tools { order: 0; }
@media (min-width: 761px) { .bdx-head { flex-wrap: nowrap; } .bdx-title { order: 0; } .bdx-tools { order: 1; } .bdx-x { order: 2; } }
@media (max-width: 760px) {
  .bdx-dialog { width: var(--vw100); height: var(--vh100); max-height: var(--vh100); }
  .bdx-title b { font-size: 14px; }
  .bdx-tools { flex: 1 1 100%; justify-content: space-between; }
}
@media (min-width: 761px) { .bdx-title .bdx-x { display: none; } }
@media (max-width: 760px) { .bdx-x2 { display: none; } }

/* ===== v2.9.8 — demo backtest trades as a reference ===== */
.bd-row-pl.bt { background: var(--sunken); border: 1px dashed var(--line); }
.bd-row-pl.bt small { color: var(--txt-faint); }
.bd-rh-side { gap: 6px; }
.bd-lyr.lyr-demo > i::after { content: ''; position: absolute; left: 4px; right: 4px; top: 50%; border-top: 2px dashed var(--up); transform: rotate(-20deg); }

/* ===== v2.9.9 — trades that stand out, pointer price / time, price zoom ===== */
.bc-tbox { stroke-width: 1; vector-effect: non-scaling-stroke; }
.bc-tbox.up { fill: color-mix(in srgb, var(--up) 24%, transparent); stroke: color-mix(in srgb, var(--up) 75%, transparent); }
.bc-tbox.down { fill: color-mix(in srgb, var(--down) 24%, transparent); stroke: color-mix(in srgb, var(--down) 75%, transparent); }
.bc-tbox.demo { stroke-dasharray: 4 3; }
.bc-tbox.demo.up { fill: color-mix(in srgb, var(--up) 12%, transparent); }
.bc-tbox.demo.down { fill: color-mix(in srgb, var(--down) 12%, transparent); }
.bc-trade { stroke-width: 2.6; stroke-linecap: round; }
.bc-trade.demo { stroke-dasharray: 5 4; }
/* entry: ▲ buy (under the entry price) / ▼ sell (above it) */
.bc-entry, .bc-entry.buy, .bc-entry.sell { width: 0; height: 0; border-radius: 0; background: none; border: 7px solid transparent; z-index: 3;
  filter: drop-shadow(0 0 1px var(--panel)) drop-shadow(0 0 1px var(--panel)) drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.bc-entry.buy { border-top: 0; border-bottom: 11px solid var(--txt); transform: translate(-7px, 2px); }
.bc-entry.sell { border-bottom: 0; border-top: 11px solid var(--txt); transform: translate(-7px, calc(-100% - 2px)); }
.bc-entry.demo { opacity: .75; }
.bc-exit { position: absolute; width: 10px; height: 10px; border-radius: 50%; transform: translate(-50%, -50%); border: 2px solid var(--panel); box-shadow: 0 1px 3px rgba(0,0,0,.35); z-index: 3; }
.bc-exit.up { background: var(--up); } .bc-exit.down { background: var(--down); }
.bc-exit.demo { opacity: .8; }
.bc-pl { position: absolute; transform: translate(9px, -50%); z-index: 4; white-space: nowrap; font-family: 'JetBrains Mono', monospace; font-size: 10.5px; font-weight: 700; line-height: 1.35;
  color: #fff; padding: 2px 6px; border-radius: 5px; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.bc-pl.flip { transform: translate(calc(-100% - 9px), -50%); }
.bc-pl.up { background: var(--up); } .bc-pl.down { background: var(--down); }
.bc-pl.demo { background: var(--panel); border: 1.5px dashed currentColor; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.bc-pl.demo.up { color: var(--up); } .bc-pl.demo.down { color: var(--down); }
.bc-pl small { font-size: 8.5px; font-weight: 700; opacity: .8; margin-right: 4px; letter-spacing: .04em; }
@media (max-width: 760px) { .bc-pl { font-size: 9.5px; padding: 1px 5px; } }
/* crosshair: price at the pointer on the price scale, time on the time axis */
.bc-hcross { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed var(--txt-dim); opacity: .7; z-index: 3; pointer-events: none; }
.bc-hcross[hidden], .bc-tag.cur[hidden], .tl-ticks .bc-xtag[hidden] { display: none !important; }
.bc-tag.cur { background: var(--txt); color: var(--panel); z-index: 3; pointer-events: none; }
.tl-ticks .bc-xtag { display: block !important; transform: translateX(-50%) !important; top: -1px; z-index: 3; padding: 1px 5px; border-radius: 4px;
  background: var(--txt); color: var(--panel); font-weight: 700; pointer-events: none; white-space: nowrap; }
.bd-chart.big .bc-axis { cursor: ns-resize; touch-action: none; }
.bdx-fit[hidden] { display: none; }
.bc-entry.manual { border-style: solid; opacity: .85; }
.bdx-none.late { color: var(--txt-dim); margin: 2px 0 6px; }

/* ===== v3.0.0 — downloads: sorting, EA source files ===== */
.dl-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 2px; }
.dl-tools .field-hint { margin: 0; }
.fl-sort button { min-width: 64px; text-transform: none; }
.dt-top .fl-sort { margin-left: auto; }
.fla-group { display: flex; align-items: baseline; gap: 8px; margin: 16px 2px 8px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--txt-dim); }
.fla-group small { font-weight: 600; color: var(--txt-faint); letter-spacing: 0; }
.fla-fmts i.kind { background: transparent; border-style: dashed; text-transform: uppercase; }
.fla-fmts i.ver { background: color-mix(in srgb, var(--up) 10%, var(--panel)); border-color: color-mix(in srgb, var(--up) 35%, transparent); color: var(--up); }
.fl-ic.ea { color: var(--up); background: color-mix(in srgb, var(--up) 12%, transparent); }
.fl-main small.mono { font-family: 'JetBrains Mono', monospace; font-size: 11px; }

/* ===== v3.0.0 — connection uptime as one slim line in the account panel ===== */
.acct-uptime { display: flex; align-items: center; gap: 16px; padding: 12px 22px 14px; border-top: 1px solid var(--line-soft); min-width: 0; }
.acct-uptime:empty { display: none; }
.aup-lbl { flex: 0 0 auto; display: flex; flex-direction: column; gap: 1px; min-width: 92px; }
.aup-lbl span { font-size: 10px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--txt-faint); }
.aup-lbl small { font-size: 10.5px; color: var(--txt-faint); opacity: .85; white-space: nowrap; }
.aup-rows { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.acct-uptime .uptime-row { padding: 0; gap: 12px; }
.acct-uptime .uptime-row + .uptime-row { border-top: none; }
.acct-uptime .uptime-name { flex: 0 0 auto; max-width: 160px; font-size: 11px; color: var(--txt-faint); }
.acct-uptime .uptime-bars { gap: 2px; padding: 6px 0; margin: -6px 0; }
.acct-uptime .uptime-bar { height: 6px; border-radius: 1.5px; transform-origin: center; }
.acct-uptime .uptime-bar:first-child { border-radius: 99px 1.5px 1.5px 99px; }
.acct-uptime .uptime-bar:last-child { border-radius: 1.5px 99px 99px 1.5px; }
.acct-uptime .uptime-bar:hover, .acct-uptime .uptime-bar:focus-visible, .acct-uptime .uptime-bars.has-sel .uptime-bar.tip-on { transform: scaleY(2.2); }
.acct-uptime .uptime-bar.good { background: color-mix(in srgb, var(--trading) 82%, var(--panel)); }
.acct-uptime .uptime-bar.nodata { background: var(--line); opacity: .45; }
.acct-uptime .uptime-pct { min-width: 0; font-size: 11.5px; color: var(--txt); }
.ub-out.closed { background: repeating-linear-gradient(135deg, var(--line) 0 2px, transparent 2px 4px); }
.ut-range.closed em { color: var(--txt-faint); }
@media (max-width: 600px) {
  .acct-uptime { padding: 10px 15px 12px; gap: 8px; flex-direction: column; align-items: stretch; }
  .aup-lbl { flex-direction: row; align-items: baseline; gap: 8px; }
  .acct-uptime .uptime-name { max-width: 90px; }
}
.acct-uptime .uptime-bars.has-sel .uptime-bar.tip-on { box-shadow: none; outline: none; opacity: 1; }
.dt-wk-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; margin-top: 8px; padding: 12px; border-radius: 12px; border: 1px dashed var(--line); }
.dt-wk-form[hidden] { display: none; }
.dt-wk-form label { display: flex; align-items: center; gap: 6px; }
.dt-wk-form label > span { font-size: 11px; font-weight: 600; color: var(--txt-dim); min-width: 34px; }
.dt-wk-form .param-select { width: auto; }
.dt-wk-form input[type=time] { width: 110px; }
.dt-wk-act { display: flex; gap: 6px; margin-left: auto; }
.dt-wk-form .field-hint { flex: 1 1 100%; margin: 0; }

/* ===== v3.0.1 — uptime as an endless light bar (one seamless glowing line) ===== */
.acct-uptime .uptime-bars {
  gap: 0; padding: 9px 0; margin: -9px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 4%, #000 96%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 4%, #000 96%, transparent 100%);
}
.acct-uptime .uptime-bar, .acct-uptime .uptime-bar:first-child, .acct-uptime .uptime-bar:last-child {
  height: 3px; border-radius: 0; color: var(--line); background: currentColor; opacity: 1;
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}
.acct-uptime .uptime-bar.good { color: var(--trading); box-shadow: 0 0 6px 0 color-mix(in srgb, currentColor 65%, transparent), 0 0 14px 0 color-mix(in srgb, currentColor 25%, transparent); }
.acct-uptime .uptime-bar.warn { color: #f0a818; box-shadow: 0 0 6px 0 color-mix(in srgb, currentColor 70%, transparent), 0 0 14px 0 color-mix(in srgb, currentColor 30%, transparent); }
.acct-uptime .uptime-bar.bad  { color: var(--blocked); box-shadow: 0 0 7px 0 color-mix(in srgb, currentColor 75%, transparent), 0 0 16px 0 color-mix(in srgb, currentColor 35%, transparent); }
.acct-uptime .uptime-bar.nodata { color: var(--line); opacity: .5; box-shadow: none; }
.acct-uptime .uptime-bar .ub-out { background: color-mix(in srgb, var(--panel) 70%, #000 30%); box-shadow: none; }
.acct-uptime .uptime-bar .ub-out.maint { background: var(--maint); }
.acct-uptime .uptime-bar .ub-out.closed { background: color-mix(in srgb, var(--panel) 55%, var(--line)); }
.acct-uptime .uptime-bar:hover, .acct-uptime .uptime-bar:focus-visible, .acct-uptime .uptime-bars.has-sel .uptime-bar.tip-on {
  transform: scaleY(2.4); filter: brightness(1.25) saturate(1.1); z-index: 1;
}
.acct-uptime .uptime-bars.has-sel .uptime-bar { opacity: .55; }
.acct-uptime .uptime-bars.has-sel .uptime-bar.tip-on { opacity: 1; }
/* Switch-on: the line lights up from the middle outwards, like a light bar. */
.acct-uptime.aup-intro .uptime-bars { animation: aup-on 1.1s cubic-bezier(.2, .8, .2, 1) both; }
.acct-uptime.aup-intro .aup-rows .uptime-row:nth-child(2) .uptime-bars { animation-delay: .08s; }
.acct-uptime.aup-intro .aup-rows .uptime-row:nth-child(3) .uptime-bars { animation-delay: .16s; }
@keyframes aup-on {
  0%   { clip-path: inset(0 50% 0 50%); filter: brightness(1.8); }
  60%  { filter: brightness(1.35); }
  100% { clip-path: inset(0 0 0 0); filter: none; }
}
@media (prefers-reduced-motion: reduce) { .acct-uptime.aup-intro .uptime-bars { animation: none; } }

/* ===== v3.0.2 — Advanced page header: back on the left, the page on the right ===== */
.adv-page-head { flex-direction: row; align-items: center; justify-content: space-between; gap: 14px; padding: 2px 0 14px; border-bottom: 1px solid var(--line-soft); }
.adv-back { align-self: center; flex: 0 0 auto; padding: 7px 14px 7px 8px; }
.adv-page-title { min-width: 0; gap: 12px; text-align: right; }
.adv-page-title > span:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.adv-page-title > span:last-child { display: inline-flex; flex-direction: row; }
.adv-page-title b { font-size: 16px; }
.adv-page-title small { font-size: 11.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.adv-page-title .adv-ic { width: 34px; height: 34px; }
@media (max-width: 600px) {
  .adv-back span { display: none; }
  .adv-back { padding: 8px; }
  .adv-page-title .adv-ic { display: none; }
}
.adv-tab { min-width: 0; }

/* ===== v3.0.2 — wider windows on a computer, with room to breathe ===== */
@media (min-width: 761px) {
  .modal.settings-tabbed { width: min(940px, 94vw); }
  .modal.settings-tabbed .modal-body { padding: 22px 30px 28px; }
  .modal.modal-dl { width: min(900px, 94vw); }
  .modal.modal-dl .modal-body { padding: 22px 30px 28px; }
  .breakout-modal { width: min(1200px, 95vw); }
  .import-modal { width: min(1240px, 95vw); }
  .modal.breakout-modal .modal-body, .modal.import-modal .modal-body { padding: 22px 32px 32px; gap: 18px; }
}

/* ===== v3.0.2 — download everything as one .zip ===== */
.dl-tools { flex-wrap: wrap; }
.dl-tools .fl-sort { margin-left: auto; }
.dl-all { display: inline-flex; align-items: center; gap: 6px; }
.dl-all svg { width: 15px; height: 15px; }
.dl-all-code { margin-top: -6px; }

/* ===== v3.0.2 — Server (VPS + application) ===== */
.srv { display: flex; flex-direction: column; gap: 16px; padding: 4px 2px 6px; }
.srv-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.srv-kpi { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-soft); background: var(--sunken); min-width: 0; }
.srv-kpi small { font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--txt-faint); }
.srv-kpi b { font-family: 'JetBrains Mono', monospace; font-size: 14px; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srv-kpi em { font-style: normal; font-size: 11px; color: var(--txt-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srv-meter { height: 4px; border-radius: 99px; background: color-mix(in srgb, var(--line) 70%, transparent); overflow: hidden; margin: 2px 0; }
.srv-meter i { display: block; height: 100%; border-radius: inherit; background: var(--trading); box-shadow: 0 0 6px color-mix(in srgb, var(--trading) 55%, transparent); transition: width .4s ease; }
.srv-kpi.warn .srv-meter i { background: #f0a818; box-shadow: 0 0 6px color-mix(in srgb, #f0a818 55%, transparent); }
.srv-kpi.bad .srv-meter i { background: var(--blocked); box-shadow: 0 0 6px color-mix(in srgb, var(--blocked) 55%, transparent); }
.srv-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.srv-bar .field-hint { margin: 0; }
.srv-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.srv-chart { padding: 12px 14px 10px; border-radius: 12px; border: 1px solid var(--line-soft); background: var(--panel); min-width: 0; }
.srv-chart-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.srv-chart-head > b { font-size: 12.5px; color: var(--txt); }
.srv-chart-head small { margin-left: auto; font-size: 10.5px; color: var(--txt-faint); }
.sc-legend { display: flex; gap: 10px; flex-wrap: wrap; }
.sc-key { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--txt-dim); }
.sc-key b { font-family: 'JetBrains Mono', monospace; font-weight: 600; color: var(--txt); }
.sc-key i, .sc-tip span i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; background: var(--sc0); }
.srv { --sc0: var(--trading); --sc1: #7c8cff; }
.sc-key.s1 i, .sc-tip span.s1 i { background: var(--sc1); }
.sc-plot { position: relative; height: 92px; }
.sc-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sc-grid { stroke: var(--line-soft); stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.sc-line { fill: none; stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.sc-line.s0 { stroke: var(--sc0); } .sc-line.s1 { stroke: var(--sc1); }
.sc-area.s0 { fill: color-mix(in srgb, var(--sc0) 16%, transparent); } .sc-area.s1 { fill: color-mix(in srgb, var(--sc1) 12%, transparent); }
.sc-cross { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--txt-dim); opacity: .5; pointer-events: none; }
.sc-cross[hidden], .sc-tip[hidden] { display: none; }
.sc-tip { position: absolute; top: 2px; transform: translateX(8px); z-index: 2; pointer-events: none; padding: 5px 8px; border-radius: 7px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(0,0,0,.18); font-size: 11px; white-space: nowrap; display: flex; flex-direction: column; gap: 2px; }
.sc-tip.flip { transform: translateX(calc(-100% - 8px)); }
.sc-tip b { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; }
.sc-tip span { display: inline-flex; align-items: center; gap: 5px; color: var(--txt-dim); font-family: 'JetBrains Mono', monospace; }
.sc-axis { display: flex; justify-content: space-between; margin-top: 4px; font-family: 'JetBrains Mono', monospace; font-size: 9.5px; color: var(--txt-faint); }
.srv-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.srv-card { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line-soft); background: var(--sunken); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.srv-card h4 { margin: 0 0 8px; font-size: 12.5px; font-weight: 700; color: var(--txt); }
.srv-card h4 small { color: var(--txt-faint); font-weight: 600; }
.srv-card .srv-h2 { margin-top: 14px; }
.srv-kv { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 5px 0; border-bottom: 1px dashed color-mix(in srgb, var(--line-soft) 80%, transparent); font-size: 12px; }
.srv-kv:last-of-type { border-bottom: none; }
.srv-kv > span { color: var(--txt-dim); flex: 0 0 auto; }
.srv-kv > b { text-align: right; font-weight: 600; color: var(--txt); min-width: 0; overflow-wrap: anywhere; }
.srv-kv > b small { display: block; font-weight: 500; font-size: 10.5px; color: var(--txt-faint); }
.srv-kv.sub { padding-left: 12px; font-size: 11.5px; }
.srv-kv.sub > span { color: var(--txt-faint); }
.srv-eas { display: flex; flex-direction: column; gap: 4px; }
.srv-ea { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.srv-ea i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); flex: 0 0 auto; }
.srv-ea.on i { background: var(--trading); box-shadow: 0 0 5px var(--trading); }
.srv-ea span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--txt-dim); }
.srv-ea b { font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 600; }
.srv-ea b.ok { color: var(--trading); } .srv-ea b.old { color: #d4900c; } .srv-ea b.bad { color: var(--blocked); }
.srv-note { margin: 8px 0 0; font-size: 11.5px; color: var(--txt-faint); }
.srv-note.bad { color: var(--blocked); }
@media (max-width: 760px) {
  .srv-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .srv-charts, .srv-cols { grid-template-columns: 1fr; }
}
#srv-range button { text-transform: none; min-width: 44px; }
@media (max-width: 600px) { .srv-bar { flex-wrap: wrap; } .srv-bar .field-hint { flex: 1 1 100%; } .srv-bar .seg { margin-left: auto; } }

/* ===== v3.0.3 ===== */
/* Red events briefing: label on the left (with its one-line note under it), time + Save on the right */
.brief-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 14px; }
.brief-lbl { display: flex; flex-direction: column; gap: 3px; }
.brief-lbl b { font-size: 13px; font-weight: 650; color: var(--txt); }
.brief-lbl small { font-size: 11.5px; color: var(--txt-faint); }
.adv-brief .na-time-end { display: inline-flex; align-items: center; gap: 10px; }
/* Back on a phone: just a bigger arrow, no pill */
@media (max-width: 600px) {
  .adv-back { border: none; background: none; padding: 4px 6px 4px 0; margin-left: -6px; border-radius: 8px; }
  .adv-back svg { width: 28px; height: 28px; stroke-width: 2.2; }
  .adv-back:active { background: color-mix(in srgb, var(--txt) 6%, transparent); }
}
/* Calendar: "Today" at the right of the month row, while another month is shown */
.cal-nav .cal-today { margin-left: auto; width: auto; padding: 0 12px; font: inherit; font-size: 12px; font-weight: 600; color: var(--standby); border-color: color-mix(in srgb, var(--standby) 35%, transparent); background: var(--standby-bg); }
.cal-nav .cal-today[hidden] { display: none; }
/* Downloads: the buttons on the same line as the file, on the right */
@media (min-width: 601px) {
  .fl-card[data-file] { grid-template-columns: 38px minmax(0, 1fr) auto auto; grid-template-areas: "ic main lock fmts"; }
  .fl-card[data-file] .fl-fmts { justify-content: flex-end; flex-wrap: nowrap; }
  .fl-card[data-file] .fl-lock { align-self: center; }
}

/* ===== v3.0.4 — uptime: one line of text, the light bar alone below, softer ===== */
.acct-uptime { flex-direction: column; align-items: stretch; gap: 9px; padding: 12px 22px 15px; }
.aup-lbl { flex-direction: row; align-items: baseline; gap: 8px; min-width: 0; }
.aup-lbl .aup-pct { margin-left: auto; font-family: 'JetBrains Mono', monospace; font-size: 11.5px; font-weight: 600; color: var(--txt-dim); }
.aup-rows { gap: 10px; }
.acct-uptime .uptime-row { display: flex; flex-direction: column; align-items: stretch; gap: 5px; }
.uptime-rowhead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.acct-uptime .uptime-rowhead .uptime-name { max-width: none; font-size: 11px; color: var(--txt-faint); }
.acct-uptime .uptime-rowhead .uptime-pct { font-size: 11px; color: var(--txt-dim); font-weight: 600; min-width: 0; }
/* softer light: lower contrast, a gentle haze instead of a hard glow */
.acct-uptime .uptime-bars { padding: 7px 0; margin: -7px 0; }
.acct-uptime .uptime-bar, .acct-uptime .uptime-bar:first-child, .acct-uptime .uptime-bar:last-child { height: 4px; }
.acct-uptime .uptime-bar.good { color: color-mix(in srgb, var(--trading) 72%, var(--panel)); box-shadow: 0 0 8px 0 color-mix(in srgb, var(--trading) 22%, transparent); }
.acct-uptime .uptime-bar.warn { color: color-mix(in srgb, #f0a818 75%, var(--panel)); box-shadow: 0 0 8px 0 color-mix(in srgb, #f0a818 24%, transparent); }
.acct-uptime .uptime-bar.bad  { color: color-mix(in srgb, var(--blocked) 75%, var(--panel)); box-shadow: 0 0 8px 0 color-mix(in srgb, var(--blocked) 26%, transparent); }
.acct-uptime .uptime-bar:hover, .acct-uptime .uptime-bar:focus-visible, .acct-uptime .uptime-bars.has-sel .uptime-bar.tip-on { transform: scaleY(2); filter: brightness(1.12); }
@keyframes aup-on {
  0%   { clip-path: inset(0 50% 0 50%); filter: brightness(1.3); }
  100% { clip-path: inset(0 0 0 0); filter: none; }
}
@media (max-width: 600px) { .acct-uptime { padding: 10px 15px 13px; } }

/* ===== v3.0.4 — Advanced page header as a softly tinted bar ===== */
.adv-page-head { padding: 10px 14px 10px 10px; border: 1px solid color-mix(in srgb, var(--standby) 18%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--standby) 18%, transparent); border-radius: 12px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--standby) 9%, var(--panel)), color-mix(in srgb, var(--standby) 4%, var(--panel))); }
.adv-page-head .adv-back { background: var(--panel); }
.adv-page-title .adv-ic { background: var(--panel); }
@media (max-width: 600px) {
  .adv-page-head { padding: 8px 12px 8px 6px; }
  .adv-page-head .adv-back { background: none; margin-left: 0; }
}

/* ===== v3.0.4 — Downloads: 2FA always at the far right (or once per section) ===== */
.fl-card[data-file] .fl-lock-none { grid-area: lock; }
.dl-sec-head.plain .fl-lock { margin-left: auto; align-self: center; }
@media (min-width: 601px) {
  .fl-card[data-file] { grid-template-columns: 38px minmax(0, 1fr) auto 52px; grid-template-areas: "ic main fmts lock"; }
  .fl-card[data-file] .fl-lock { justify-self: end; }
}
@media (max-width: 600px) {
  .fl-card[data-file] { grid-template-columns: 38px minmax(0, 1fr) auto; grid-template-areas: "ic main lock" "ic fmts fmts"; }
  .fl-card[data-file] .fl-lock { align-self: start; }
}
.fl-lock.off { color: var(--txt-faint); background: transparent; border-color: var(--line-soft); }
.fl-lock.part { color: #c98500; background: transparent; border-style: dashed; }
.fla-row { grid-template-columns: 38px minmax(0, 1fr) auto auto; }
.fla-group .fl-lock { margin-left: auto; text-transform: none; letter-spacing: .03em; }
/* save a file on a phone */
.fl-save-dialog { width: min(420px, 92vw); }
.fl-save-body { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.fl-save-prev { max-width: 100%; max-height: 46vh; object-fit: contain; border-radius: 10px; border: 1px solid var(--line-soft); background: var(--sunken); }
.fl-save-meta { font-size: 12px; color: var(--txt-faint); }
.fl-save-act { display: flex; gap: 8px; }
.fl-save-act .btn { flex: 1 1 0; justify-content: center; text-align: center; min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; }

/* ===== v3.0.4 — Breakout detector: the period as one row of choices ===== */
.bd-period { flex-wrap: wrap; }
.bd-period-seg { flex: 0 0 auto; }
.bd-period-seg button { text-transform: none; min-width: 44px; padding: 6px 12px; font-size: 12px; white-space: nowrap; }
@media (max-width: 600px) {
  .bd-period-seg { flex: 1 1 100%; display: flex; width: 100%; }
  .bd-period-seg button { flex: 1 1 auto; padding: 8px 6px; min-width: 0; }
}
.dl-sec-head .fl-lock, .dl-sec-head > span.fl-lock { display: inline-flex; flex-direction: row; gap: 5px; }
.fla-row .fl-lock, .fla-group .fl-lock { grid-area: auto; }
.fla-row .fl-lock { justify-self: end; }
.fl-save-dialog .na-test-dialog-head b { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fl-save-dialog .na-test-dialog-head svg { width: 18px; height: 18px; flex: 0 0 auto; }
.fl-save-prev { display: block; width: 100%; height: auto; min-height: 60px; }

/* ===== v3.0.5 — Advanced: slide between the menu and its pages ===== */
.adv-in-fwd  { animation: adv-in-fwd .28s cubic-bezier(.2, .8, .2, 1) both; }
.adv-in-back { animation: adv-in-back .28s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes adv-in-fwd  { from { opacity: 0; transform: translateX(36px); } to { opacity: 1; transform: none; } }
@keyframes adv-in-back { from { opacity: 0; transform: translateX(-36px); } to { opacity: 1; transform: none; } }

/* ===== v3.0.5 — viewing MD / PNG inside the app (phones) ===== */
.fl-view-dialog { width: min(760px, 96vw); max-height: 92vh; padding: 0; display: flex; flex-direction: column; }
.fl-view-dialog[open] { display: flex; }
.fl-view-dialog .na-test-dialog-head b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fl-view-body { overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; flex: 1 1 auto; min-height: 0; }
.img-view { overflow: auto; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; background: var(--sunken); }
.img-view img { display: block; max-width: none; -webkit-touch-callout: none; pointer-events: auto; cursor: zoom-out; }
.img-view.fit img { width: 100%; height: auto; cursor: zoom-in; }
.md-view { padding: 16px 18px 24px; font-size: 14px; line-height: 1.55; color: var(--txt); overflow-wrap: anywhere; }
.md-view h1 { font-size: 20px; margin: 4px 0 12px; } .md-view h2 { font-size: 17px; margin: 20px 0 8px; } .md-view h3, .md-view h4 { font-size: 15px; margin: 16px 0 6px; }
.md-view p { margin: 0 0 10px; } .md-view ul, .md-view ol { margin: 0 0 10px; padding-left: 20px; } .md-view li { margin: 2px 0; }
.md-view code { font-family: 'JetBrains Mono', monospace; font-size: 12px; background: var(--sunken); padding: 1px 5px; border-radius: 4px; }
.md-view pre { background: var(--sunken); border: 1px solid var(--line-soft); border-radius: 8px; padding: 10px 12px; overflow-x: auto; margin: 0 0 12px; }
.md-view pre code { background: none; padding: 0; font-size: 11.5px; }
.md-view blockquote { margin: 0 0 10px; padding: 4px 12px; border-left: 3px solid var(--line); color: var(--txt-dim); }
.md-view hr { border: none; border-top: 1px solid var(--line-soft); margin: 16px 0; }
.md-view .md-table { overflow-x: auto; margin: 0 0 12px; }
.md-view table { border-collapse: collapse; font-size: 12.5px; }
.md-view th, .md-view td { border: 1px solid var(--line-soft); padding: 5px 8px; text-align: left; vertical-align: top; }
.md-view th { background: var(--sunken); }
@media (max-width: 760px) { .fl-view-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; } }
@media (max-width: 760px) {
  dialog.na-test-dialog.fl-view-dialog { width: var(--vw100); max-width: var(--vw100); height: var(--vh100); max-height: var(--vh100); margin: 0; border-radius: 0; border: none; }
  .fl-view-dialog .na-test-dialog-head { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
  .fl-view-body { padding-bottom: env(safe-area-inset-bottom, 0px); }
}

/* ===== v3.0.6 — Downloads: buttons on the file's line, flush right (phones too) ===== */
.fl-card[data-file] .fl-fmts { justify-self: end; justify-content: flex-end; }
@media (min-width: 601px) {
  .fl-card[data-file] { grid-template-columns: 38px minmax(0, 1fr) auto auto; grid-template-areas: "ic main fmts lock"; }
  .fl-card[data-file] .fl-lock-none { display: none; }
}
@media (max-width: 600px) {
  .fl-card[data-file] { grid-template-columns: 38px minmax(0, 1fr) auto; grid-template-areas: "ic main fmts" "ic main lock"; gap: 4px 10px; padding: 10px 12px; }
  .fl-card[data-file] .fl-fmts { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 6px; align-self: center; }
  .fl-card[data-file] .fl-fmt { padding: 7px 10px; text-align: center; white-space: nowrap; }
  .fl-card[data-file] .fl-lock { justify-self: end; align-self: start; }
  .fl-card[data-file] .fl-lock-none { display: none; }
}
.fl-lock.open { color: var(--up); background: color-mix(in srgb, var(--up) 10%, transparent); border-color: color-mix(in srgb, var(--up) 35%, transparent); }
.fl-lock.open b { font-family: 'JetBrains Mono', monospace; font-weight: 700; }
.dl-sec-head .ea-unlock { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.dl-sec-head .ea-unlock svg { width: 13px; height: 13px; }
.dl-sec-head .fl-lock.open { margin-left: auto; }
.ea-unlock-row { padding: 0 2px; }
.fl-fmt.view { border-color: color-mix(in srgb, var(--up) 45%, transparent); color: var(--up); }
.code-view { margin: 0; padding: 14px 16px 24px; font-family: 'JetBrains Mono', monospace; font-size: 11.5px; line-height: 1.5; white-space: pre; overflow: auto; color: var(--txt); background: var(--sunken); min-height: 100%; }
.code-view.noselect { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* ===== v3.0.6 — Advanced: a clearer slide between menu and page ===== */
.adv-in-fwd  { animation: adv-in-fwd .38s cubic-bezier(.16, .84, .24, 1) both; }
.adv-in-back { animation: adv-in-back .38s cubic-bezier(.16, .84, .24, 1) both; }
@keyframes adv-in-fwd  { from { opacity: 0; transform: translateX(28%); } 60% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes adv-in-back { from { opacity: 0; transform: translateX(-28%); } 60% { opacity: 1; } to { opacity: 1; transform: none; } }
#settings-tab-content { overflow-x: hidden; }

/* ===== v3.0.6 — Tick import ===== */
.tk { display: flex; flex-direction: column; gap: 12px; }
.tk-card { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line-soft); background: var(--sunken); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tk-card h4 { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--txt); }
.tk-row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.tk-row .mw-f { flex: 1 1 260px; min-width: 0; margin: 0; }
.tk-row .param-select { width: 100%; }
.tk-pick { display: inline-flex; align-items: center; gap: 8px; max-width: 280px; cursor: pointer; }
.tk-pick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-pick svg { width: 15px; height: 15px; flex: 0 0 auto; }
.tk-pick.disabled { opacity: .5; pointer-events: none; }
.tk-note { font-size: 11.5px; color: var(--txt-faint); }
.tk-prog { height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--line) 70%, transparent); overflow: hidden; }
.tk-prog i { display: block; height: 100%; border-radius: inherit; background: var(--trading); box-shadow: 0 0 8px color-mix(in srgb, var(--trading) 45%, transparent); transition: width .5s ease; }
.tk-stats { display: flex; align-items: center; gap: 6px 16px; flex-wrap: wrap; font-size: 12px; color: var(--txt-dim); }
.tk-stats b { font-family: 'JetBrains Mono', monospace; color: var(--txt); }
.tk-stats .btn { margin-left: auto; }
.tk-done { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--txt); padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--up) 8%, var(--panel)); border: 1px solid color-mix(in srgb, var(--up) 25%, transparent); }
.tk-done small { color: var(--txt-faint); font-size: 11.5px; }
.tk-done details { font-size: 11.5px; color: var(--txt-dim); }
.tk-done details div { padding: 2px 0 0 12px; }
.tk-cov { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px dashed var(--line-soft); }
.tk-cov:first-of-type { border-top: none; }
.tk-cov span { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tk-cov b { font-size: 12.5px; }
.tk-cov small { font-size: 11px; color: var(--txt-faint); }
@media (max-width: 600px) { .tk-pick { max-width: none; flex: 1 1 auto; } }
@media (min-width: 601px) {
  .fl-card[data-file]:not(:has(> .fl-lock)) { grid-template-columns: 38px minmax(0, 1fr) auto; grid-template-areas: "ic main fmts"; }
}
@media (max-width: 600px) {
  .fl-card[data-file]:not(:has(> .fl-lock)) { grid-template-areas: "ic main fmts"; }
}

/* ===== v3.0.7 — breakout history row: everything visible, nothing cut off ===== */
.bd-row-head { grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: "main sub pls chev"; gap: 8px 14px; }
.bd-rh-main { flex-wrap: nowrap; white-space: nowrap; }
.bd-rh-sub { flex-wrap: wrap; row-gap: 4px; }
.bd-rh-sub .bd-row-sub { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.4; }
.bd-rh-pls { grid-area: pls; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; }
.bd-rh-pls:empty { display: none; }
.bd-row-head > .bd-row-chev { grid-area: chev; justify-self: end; }
.bd-row:not(:has(.bd-row-pl)) .bd-row-chev { margin-left: 0; }
@media (max-width: 900px) {
  /* date + verdict, then the results, then the explanation — each on its own line */
  .bd-row-head { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main chev" "pls pls" "sub sub"; gap: 8px 10px; }
  .bd-rh-pls { justify-content: flex-start; }
  .bd-rh-pls .bd-row-pl { padding: 4px 10px; }
}
@media (max-width: 600px) {
  .bd-row { padding-top: 12px; padding-bottom: 12px; }
  .bd-row-head { gap: 7px 8px; }
  .bd-rh-sub .bd-row-sub { font-size: 12px; }
}

/* ===== v3.0.8 — breakout history: each day a clear card; quieter backtest tag ===== */
/* the backtest result: a small, muted reference next to the real trades */
.bd-row-pl.bt { background: transparent; border: none; padding: 2px 4px; gap: 5px; }
.bd-row-pl.bt small { font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--txt-faint); }
.bd-row-pl.bt b { font-size: 11.5px; font-weight: 600; opacity: .8; }
/* a coloured edge per verdict, so days read apart at a glance */
.bd-histcard .bd-row { position: relative; border-left: 3px solid var(--line); }
.bd-histcard .bd-row.clear { border-left-color: color-mix(in srgb, var(--up) 70%, transparent); }
.bd-histcard .bd-row.break { border-left-color: color-mix(in srgb, var(--down) 70%, transparent); }
.bd-histcard .bd-row.restricted { border-left-color: color-mix(in srgb, #e0a010 75%, transparent); }
.bd-histcard .bd-row.none, .bd-histcard .bd-row.weekend { border-left-color: var(--line); }
@media (max-width: 760px) {
  /* the list on a tinted ground, the days as white cards with a soft shadow */
  .breakout-modal .bd-histcard { background: var(--sunken); border-radius: 14px; padding: 10px; margin: 0 -4px; }
  .breakout-modal .bd-histcard > .imp-card-head { padding: 2px 4px 4px; }
  .bd-histcard .bd-row { background: var(--panel); border-color: var(--line-soft); box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 2px 8px rgba(0,0,0,.04); }
  .bd-histcard .bd-list { gap: 8px; }
  .bd-rh-pls { gap: 4px 8px; }
  .bd-rh-pls .bd-row-pl:not(.bt) { padding: 2px 8px; font-size: 11.5px; }
  .bd-rh-pls .bd-row-pl:not(.bt) b { font-size: 12px; }
  .bd-rh-pls .bd-row-pl.bt { order: 2; }
  .bd-date { font-size: 13.5px; }
}

/* ===== v3.0.9 — history filter (which kinds of day are listed) ===== */
.bd-histcard > .imp-card-head { align-items: center; }
.bd-fbtn { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.bd-fbtn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.bd-fbtn.on { border-color: var(--standby); color: var(--standby); background: var(--standby-bg); }
.bd-fbtn b { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--standby); color: #fff; font-size: 10.5px; display: inline-flex; align-items: center; justify-content: center; }
.bd-filter { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 22px; padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line-soft); }
.bd-filter[hidden] { display: none; }
.bd-fgrp { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.bd-fgrp > small { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--txt-faint); }
.bd-fgrp > span { display: flex; flex-wrap: wrap; gap: 6px; }
.bd-fchip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px 5px 8px; border-radius: 99px; border: 1px solid var(--line-soft); background: var(--sunken); color: var(--txt-faint); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: background .15s ease, border-color .15s ease, color .15s ease, opacity .15s ease; opacity: .7; }
.bd-fchip i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.bd-fchip em { font-style: normal; font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--txt-faint); }
.bd-fchip.on { opacity: 1; color: var(--txt); background: var(--panel); border-color: var(--line); box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.bd-fchip.on.f-clear i, .bd-fchip.on.f-profit i { background: var(--up); }
.bd-fchip.on.f-break i, .bd-fchip.on.f-loss i { background: var(--down); }
.bd-fchip.on.f-restricted i { background: #e0a010; }
.bd-fchip.on.f-none i, .bd-fchip.on.f-notrade i { background: var(--txt-faint); }
.bd-fchip:not(.on) { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--txt-faint) 60%, transparent); }
.bd-freset { align-self: flex-end; margin-left: auto; border: none; background: none; color: var(--standby); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; padding: 6px 2px; }
@media (max-width: 600px) { .bd-filter { padding: 10px 12px; gap: 10px; } .bd-fgrp { flex: 1 1 100%; } }
/* a position still open from an earlier day */
.bd-row-pl.carry { background: transparent; border: 1px dashed var(--line); padding: 2px 8px; }
.bd-row-pl.carry small { font-size: 10.5px; color: var(--txt-dim); }
.bc-pl.cont { background: var(--panel); color: var(--txt-dim); border: 1px dashed var(--line); box-shadow: none; }
.bdx-trade.carried { opacity: .85; border-style: dashed; }
/* Server → EAs legend */
.srv-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 0; font-size: 11px; color: var(--txt-faint); }
.srv-legend span::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.srv-legend .ok::before { background: var(--trading); } .srv-legend .old::before { background: #d4900c; } .srv-legend .bad::before { background: var(--blocked); }

/* ===== v3.0.9 — calendar "Today": a small label, not a big button ===== */
.cal-nav .cal-today { height: 24px; padding: 0 9px 0 7px; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; letter-spacing: .02em;
  color: var(--standby); background: transparent; border: 1px solid color-mix(in srgb, var(--standby) 30%, transparent); border-radius: 99px; }
.cal-nav .cal-today svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cal-nav .cal-today:hover { background: var(--standby-bg); }

/* ===== v3.0.9 — accounts in the database and users: clear cards on a tinted ground ===== */
#adv-dbacc { background: var(--sunken); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 8px; border: none; }
#adv-dbacc .dba-sum { background: none; border: none; padding: 2px 4px 4px; }
#adv-dbacc .dba-row { background: var(--panel); border: 1px solid var(--line-soft); border-left: 3px solid color-mix(in srgb, var(--up) 65%, transparent); border-radius: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 2px 8px rgba(0,0,0,.04); padding: 11px 14px; }
#adv-dbacc .dba-row + .dba-row { border-top: 1px solid var(--line-soft); }
#adv-dbacc .dba-row.removed { border-left-color: var(--line); }
#adv-users .um, #settings-tab-content .um { gap: 10px; }
#adv-users { background: var(--sunken); border-radius: 14px; padding: 10px; }
#adv-users .um-card { background: var(--panel); border-color: var(--line-soft); box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 2px 8px rgba(0,0,0,.04); border-left: 3px solid var(--line); }
#adv-users .um-card.um-fold:has(.um-avatar.admin) { border-left-color: color-mix(in srgb, var(--standby) 70%, transparent); }
#adv-users .um-card.um-add { border-left-style: dashed; box-shadow: none; }
#adv-users .um-section { padding-left: 4px; }

/* ===== v3.0.9 — history row: the backtest result on the date line, at the right ===== */
.bd-row-head { grid-template-columns: auto minmax(0, 1fr) auto auto auto; grid-template-areas: "main sub pls bt chev"; }
.bd-rh-bt { grid-area: bt; display: flex; align-items: center; justify-self: end; }
.bd-rh-bt:empty { display: none; }
@media (max-width: 900px) {
  .bd-row-head { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "main bt chev" "pls pls pls" "sub sub sub"; }
  .bd-rh-bt .bd-row-pl.bt { padding: 2px 2px; }
}

/* v3.1.0 — exchange holidays in the breakout detector */
.bd-chip.holiday { color: #6d5fd6; background: color-mix(in srgb, #7c6cf0 12%, transparent); border-color: color-mix(in srgb, #7c6cf0 35%, transparent); }
.bd-dot.holiday { background: #7c6cf0; box-shadow: 0 0 0 4px color-mix(in srgb, #7c6cf0 18%, transparent); }
.bd-histcard .bd-row.holiday { border-left-color: color-mix(in srgb, #7c6cf0 65%, transparent); }
.bd-row.holiday .bd-row-sub { color: var(--txt-faint); }
.bd-fchip.on.f-holiday i { background: #7c6cf0; }
/* a choice that shows no day with the other filters as they are */
.bd-fchip.zero em { opacity: .55; }
.bd-fchip.on.zero { opacity: .62; }

/* v3.1.0 — Data import: the market archive note */
.tk-arch { margin: -2px 0 6px; line-height: 1.45; }

/* v3.1.0 — Server → Storage */
.srv-storage { gap: 8px; }
.st-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.st-head h4 { margin: 0; }
.st-head .btn { gap: 6px; }
.st-head .btn svg { width: 14px; height: 14px; }
.st-bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--line-soft); gap: 2px; }
.st-bar i { display: block; height: 100%; min-width: 3px; }
.st-k-db { --st: #4f7cff; } .st-k-app { --st: #22a06b; } .st-k-modules { --st: #8a94a6; } .st-k-ea { --st: #e0a010; }
.st-k-releases { --st: #c46cf0; } .st-k-docs { --st: #2bb3c0; } .st-k-cache { --st: #f0806c; } .st-k-out { --st: var(--txt-faint); }
.st-bar i { background: var(--st); }
.st-list { display: flex; flex-direction: column; }
.st-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.st-list .st-row:first-child { border-top: none; }
.st-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--st); }
.st-name { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.st-name b { font-size: 12.5px; }
.st-name small { font-size: 11px; color: var(--txt-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-size { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.st-size b { font-family: 'JetBrains Mono', monospace; font-size: 12.5px; font-weight: 600; }
.st-size small { font-size: 10.5px; color: var(--txt-faint); }
.st-db { display: flex; flex-direction: column; gap: 6px; margin: -2px 0 8px 20px; padding: 8px 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line-soft); }
.st-g { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(60px, 1fr) auto; align-items: center; gap: 10px; }
.st-gname { display: flex; flex-direction: column; font-size: 12px; font-weight: 600; min-width: 0; }
.st-gname small { font-size: 10.5px; font-weight: 500; color: var(--txt-faint); }
.st-gbar { height: 6px; border-radius: 99px; background: var(--line-soft); overflow: hidden; }
.st-gbar i { display: block; height: 100%; border-radius: 99px; background: color-mix(in srgb, #4f7cff 75%, transparent); }
.st-g b { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; font-weight: 600; min-width: 58px; text-align: right; }
.st-g.free .st-gname, .st-g.free b { color: var(--txt-faint); font-weight: 500; }
.st-g.free .st-gbar i { background: var(--line); }
.st-list.out .st-row { padding: 6px 0; }
@media (max-width: 760px) {
  .st-db { margin-left: 0; }
  .st-g { grid-template-columns: minmax(0, 1fr) 54px auto; gap: 8px; }
}

/* v3.1.1 — Release notes */
.rn { display: flex; flex-direction: column; gap: 8px; }
.rn-v { border: 1px solid var(--line-soft); border-radius: 12px; background: var(--sunken); overflow: hidden; }
.rn-v.current { border-color: color-mix(in srgb, var(--accent, #4f7cff) 40%, var(--line-soft)); }
.rn-v summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; }
.rn-v summary::-webkit-details-marker { display: none; }
.rn-v summary b { font-family: 'JetBrains Mono', monospace; font-size: 13px; }
.rn-v summary small { color: var(--txt-faint); font-size: 12px; }
.rn-tag { font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--up); background: var(--up-bg); border-radius: 99px; padding: 2px 8px; }
.rn-chev { width: 16px; height: 16px; margin-left: auto; fill: none; stroke: var(--txt-faint); stroke-width: 2; transition: transform .2s ease; }
.rn-v[open] .rn-chev { transform: rotate(180deg); }
.rn-body.md-view { padding: 2px 16px 10px; font-size: 13px; background: var(--panel); border-top: 1px solid var(--line-soft); }
.rn-body.md-view ul { padding-left: 18px; margin: 10px 0; }
.rn-body.md-view li { margin: 5px 0; }

/* v3.1.1 — Storage: when measured (automatic) */
.st-when { font-size: 11px; color: var(--txt-faint); }

/* v3.1.1 — "When breakouts happen" folds */
.bd-ana-head { width: 100%; background: none; border: none; font: inherit; color: inherit; text-align: left; cursor: pointer; padding: 0; }
.bd-ana-chev { width: 18px; height: 18px; margin-left: auto; flex: none; fill: none; stroke: var(--txt-faint); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s ease; }
.bd-ana.open .bd-ana-chev { transform: rotate(180deg); }
.bd-ana:not(.open) > .bd-ana-head { margin-bottom: 0; }

/* v3.1.2 — Connection downtime: the period on top, "+ Maintenance window" with the windows */
.dt-top-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dt-top-txt b { font-size: 13.5px; color: var(--txt); } .dt-top-txt small { font-size: 11.5px; color: var(--txt-faint); }
.dt-top #dt-days-seg { margin-left: auto; }
.dt-sec.dt-sec-row { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.dt-sec-row > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dt-sec-row .btn { margin-left: auto; }

/* v3.1.2 — password dialog (set / change / remove in one) */
.pw-dialog { width: min(440px, calc(100vw - 32px)); }
.pw-form { display: flex; flex-direction: column; gap: 8px; }
.pw-sub { margin: 0 0 4px; font-size: 13px; line-height: 1.45; color: var(--txt-dim); }
.pw-field { position: relative; display: block; }
.pw-field .text-input { width: 100%; padding-right: 42px; box-sizing: border-box; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border: none; background: none; color: var(--txt-faint); cursor: pointer; border-radius: 8px; display: grid; place-items: center; }
.pw-eye:hover { color: var(--txt); background: var(--sunken); }
.pw-eye svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.pw-meter { height: 4px; border-radius: 99px; background: var(--line-soft); overflow: hidden; }
.pw-meter i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--down); transition: width .2s ease, background .2s ease; }
.pw-meter i[data-s="2"] { background: #e0a010; } .pw-meter i[data-s="3"], .pw-meter i[data-s="4"] { background: var(--up); }
.pw-hint { font-size: 11.5px; color: var(--txt-faint); min-height: 15px; }
.pw-hint.ok { color: var(--up); } .pw-hint.warn { color: var(--down); }
.pw-note { font-size: 11.5px; color: var(--txt-faint); }

/* v3.1.2 — countdown of the authenticator code's 30-second window */
.otp-ring { position: relative; display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none; vertical-align: middle; color: var(--up); }
.otp-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.otp-ring circle { fill: none; stroke-width: 2.6; }
.otp-ring .otp-bg { stroke: var(--line-soft); }
.otp-ring .otp-fg { stroke: currentColor; stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.otp-ring b { position: relative; font: 600 9.5px/1 'JetBrains Mono', monospace; color: var(--txt-dim); }
.otp-ring.low { color: #e0a010; }
.otp-ring.low b { color: #c98500; }
label > .otp-ring { position: absolute; right: 8px; bottom: 7px; }
label:has(> .otp-ring) { position: relative; }

/* v3.1.2 — "needs attention" markers in the account list (same issues as the
   red banner on the account page) */
.acct-warn, .ea-sub-warn {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  min-width: 15px; height: 15px; padding: 0 4px; box-sizing: border-box; border-radius: 99px;
  font: 800 9.5px/1 'JetBrains Mono', monospace; color: #fff; cursor: help;
}
.acct-warn.bad, .ea-sub-warn.bad { background: var(--down); box-shadow: 0 0 0 3px color-mix(in srgb, var(--down) 18%, transparent); }
.acct-warn.warn, .ea-sub-warn.warn { background: #e0a010; box-shadow: 0 0 0 3px color-mix(in srgb, #e0a010 18%, transparent); }
.acct-warn { margin-left: -2px; }
.ea-sub-warn { margin-left: 2px; }
.rn-body h3.rn-k { display: inline-flex; align-items: center; gap: 6px; margin: 14px 0 2px; font-size: 10.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.rn-body h3.rn-k::before { content: ''; width: 8px; height: 8px; border-radius: 3px; background: currentColor; }
.rn-body h3.rn-new { color: #4f7cff; } .rn-body h3.rn-improved { color: var(--up); } .rn-body h3.rn-fixed { color: #e07a10; }
.rn-body > p { margin: 10px 0 0; color: var(--txt-faint); font-size: 12.5px; }

/* v3.1.3 — charts: a long press reads the price (no selection, no iOS magnifier) */
.bd-chart, .bd-chart-host, .bdx-chart { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#bdx-det { display: flex; flex-direction: column; gap: 14px; }
.bdx-cur { padding: 10px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line-soft); }
.bdx-cur .bdx-kv b { text-align: right; }
.bdx-cur .bdx-kv b.warn { color: #c98500; }
.bdx-cur-empty { margin: 0; font-size: 12px; color: var(--txt-faint); line-height: 1.45; }

/* v3.1.3 — one look for every Advanced page: each section on the darker
   ground (rounded, soft border), the items in it on white. A page that is a
   single section (uptime, briefing, copy trade, downtime, accounts in the
   database) is that section; a page of several sections has no box around
   them. */
.set-sec { background: var(--sunken); border: 1px solid var(--line-soft); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.set-sec-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.set-sec-head b { font-size: 13px; font-weight: 700; color: var(--txt); }
.set-sec-head small { font-size: 11.5px; color: var(--txt-faint); }
.adv-page > #adv-ticks, .adv-page > #adv-server, .adv-page > #adv-events, .adv-page > #adv-datafiles,
.adv-page > #adv-strategy, .adv-page > #adv-releases, .adv-page > #adv-files, .adv-page > #adv-notifications {
  background: transparent; border: none; padding: 0; box-shadow: none; }
.adv-page > #adv-uptime, .adv-page > #adv-briefing, .adv-page > #adv-copy, .adv-page > #adv-downtime, .adv-page > #adv-dbacc {
  background: var(--sunken); border: 1px solid var(--line-soft); border-radius: 14px; }
#adv-uptime > .field-row, #adv-briefing .brief-row { background: transparent; }
#adv-downtime .dt-ea, #adv-copy .mirror-row, #adv-copy .copy-row, #adv-dbacc .dba-row { background: var(--panel); }
#adv-dbacc .dba-row { border-radius: 10px; margin: 0 8px; border: 1px solid var(--line-soft); }
#adv-dbacc .dba-row + .dba-row { border-top: 1px solid var(--line-soft); margin-top: 6px; }
#adv-dbacc .dba-sum { padding: 12px 16px 8px; }
#adv-dbacc { padding-bottom: 8px; }
.tk-card, .srv-card, .rn-v { border-radius: 14px; }
.rn-v summary { background: var(--sunken); }

/* Event tracker & activity */
.ev { display: flex; flex-direction: column; gap: 12px; }
.ev-top { display: flex; justify-content: flex-end; }
.ev-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.ev-kpi { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 10px; padding: 9px 12px; display: flex; flex-direction: column; gap: 2px; }
.ev-kpi small { font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--txt-faint); font-weight: 650; }
.ev-kpi b { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ev-kpi.bad b { color: var(--down); }
.ev-now, .ev-ips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ev-ips small { font-size: 11px; color: var(--txt-faint); margin-right: 4px; }
.ev-pill { font: inherit; font-size: 11.5px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line-soft); background: var(--panel); color: var(--txt-dim); cursor: default; }
button.ev-pill { cursor: pointer; } button.ev-pill b { color: var(--down); margin-left: 4px; }
.ev-pill.bad { color: var(--down); border-color: color-mix(in srgb, var(--down) 35%, transparent); background: var(--blocked-bg); }
.ev-pill.warn { color: #c98500; border-color: color-mix(in srgb, #e0a010 35%, transparent); background: color-mix(in srgb, #e0a010 10%, transparent); }
.ev-filters { display: flex; flex-direction: column; gap: 8px; }
.ev-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.ev-cat { font: inherit; font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 99px; border: 1px solid var(--line-soft); background: var(--panel); color: var(--txt-dim); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.ev-cat em { font-style: normal; font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--txt-faint); }
.ev-cat.on { background: var(--txt); color: var(--panel); border-color: var(--txt); }
.ev-cat.on em { color: inherit; opacity: .7; }
.ev-cat.bad:not(.on) em { color: var(--down); }
.ev-row2 { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 8px; }
.ev-row2 .text-input { width: 100%; }
.ev-count { font-size: 11.5px; color: var(--txt-faint); }
.ev-list { display: flex; flex-direction: column; gap: 4px; }
.ev-row { display: grid; grid-template-columns: 8px 92px minmax(0, 1fr) minmax(0, 260px); gap: 10px; align-items: center; padding: 8px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line-soft); }
.ev-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--up); }
.ev-row.fail .ev-dot { background: var(--down); } .ev-row.blocked .ev-dot { background: #e0a010; }
.ev-row.fail { border-color: color-mix(in srgb, var(--down) 30%, var(--line-soft)); }
.ev-when, .ev-main, .ev-src { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ev-when b { font-size: 12px; } .ev-when small { font-size: 11px; color: var(--txt-faint); font-variant-numeric: tabular-nums; }
.ev-main b { font-size: 12.5px; } .ev-main em { font-style: normal; font-size: 11.5px; color: var(--txt-dim); font-weight: 600; }
.ev-main small, .ev-src small { font-size: 11px; color: var(--txt-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-src span { font-size: 11.5px; color: var(--txt-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-src { text-align: right; }
@media (max-width: 760px) {
  .ev-row { grid-template-columns: 8px minmax(0, 1fr); grid-template-areas: "dot when" "dot main" "dot src"; row-gap: 3px; }
  .ev-dot { grid-area: dot; align-self: start; margin-top: 5px; } .ev-when { grid-area: when; flex-direction: row; gap: 8px; } .ev-main { grid-area: main; } .ev-src { grid-area: src; text-align: left; }
  .ev-row2 { grid-template-columns: 1fr; }
}
.ua-dialog { width: min(760px, calc(var(--vw100, 100vw) - 24px)); }
.ua-dialog .na-test-dialog-body { display: flex; flex-direction: column; gap: 12px; max-height: calc(var(--vh100, 100vh) - 120px); overflow-y: auto; }
.ua-head { display: flex; align-items: center; gap: 12px; }
.ua-head span { display: flex; flex-direction: column; } .ua-head small { color: var(--txt-faint); font-size: 12px; }
.ua-sec { display: flex; flex-direction: column; gap: 4px; background: var(--sunken); border: 1px solid var(--line-soft); border-radius: 12px; padding: 10px 12px; }
.ua-sec > small { font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--txt-faint); font-weight: 650; }
.ua-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; font-size: 12px; align-items: baseline; }
.ua-line em { font-style: normal; font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--txt-dim); }
.ua-line small { color: var(--txt-faint); font-size: 11px; }
.ua-tabs { align-self: flex-start; }

/* Profile pictures */
.um-avatar.has-img { padding: 0; overflow: hidden; background: var(--sunken); }
.um-avatar.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.um-avatar.lg { width: 44px; height: 44px; font-size: 18px; }
.tb-avatar { width: 24px; height: 24px; border-radius: 50%; overflow: hidden; display: inline-flex; flex: none; box-shadow: 0 0 0 1px var(--line-soft); }
.tb-avatar[hidden] { display: none; }
.tb-avatar img { width: 100%; height: 100%; object-fit: cover; }
body.has-avatar .tb-user-ic { display: none; }

/* Data files */
.df { display: flex; flex-direction: column; gap: 12px; }
.df-rep { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line-soft); }
.df-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--sunken); display: inline-flex; align-items: center; justify-content: center; color: var(--txt-dim); }
.df-ic svg { width: 18px; height: 18px; }
.df-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.df-main b { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.df-main small { font-size: 11px; color: var(--txt-faint); }
.df-act { display: inline-flex; gap: 6px; align-items: center; justify-content: flex-end; }
.df-inst { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line-soft); }
.df-inst-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; } .df-inst-head small { font-size: 11.5px; color: var(--txt-faint); }
.df-months { display: flex; flex-wrap: wrap; gap: 4px; }
.df-m { display: inline-flex; flex-direction: column; align-items: center; padding: 4px 7px; border-radius: 8px; background: var(--sunken); min-width: 58px; }
.df-m b { font-size: 11px; font-weight: 650; } .df-m small { font-size: 10px; color: var(--txt-faint); }
.df-del { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; font-size: 12px; color: var(--txt-dim); }
.df-del .param-select { width: auto; min-width: 110px; }
.df-job { display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
@media (max-width: 760px) { .df-rep { grid-template-columns: 34px minmax(0, 1fr); } .df-act { grid-column: 1 / -1; } }
.imp-saved { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.imp-saved-head { display: flex; gap: 8px; align-items: baseline; } .imp-saved-head b { font-size: 12.5px; } .imp-saved-head small { font-size: 11.5px; color: var(--txt-faint); }
.imp-saved-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line-soft); background: var(--sunken); font: inherit; text-align: left; cursor: pointer; color: inherit; }
.imp-saved-row:hover { border-color: var(--line); }
.imp-saved-row svg { width: 18px; height: 18px; color: var(--txt-dim); }
.imp-saved-row span { display: flex; flex-direction: column; min-width: 0; } .imp-saved-row b { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .imp-saved-row small { font-size: 11px; color: var(--txt-faint); }
.imp-saved-row em { font-style: normal; font-size: 12px; font-weight: 650; color: var(--accent, #2a8f6e); }

/* Strategy analysis */
.sa { display: flex; flex-direction: column; gap: 12px; }
.sa-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.sa-src { font-size: 12px; color: var(--txt-faint); }
.sa-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.sa-tile { background: var(--sunken); border: 1px solid var(--line-soft); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sa-tile small { font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--txt-faint); font-weight: 650; }
.sa-tile b { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-tile em { font-style: normal; font-size: 11px; color: var(--txt-faint); }
.sa .up { color: var(--up); } .sa .down { color: var(--down); }
.sa-chart { background: var(--sunken); border: 1px solid var(--line-soft); border-radius: 14px; padding: 12px 12px 8px; }
.sa-chart svg { width: 100%; height: 230px; display: block; }
.sa-line { fill: none; stroke: var(--up); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.sa-area { fill: color-mix(in srgb, var(--up) 12%, transparent); }
.sa-base { stroke: var(--line); stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.sa-dd { fill: color-mix(in srgb, var(--down) 30%, transparent); stroke: color-mix(in srgb, var(--down) 60%, transparent); stroke-width: 1; vector-effect: non-scaling-stroke; }
.sa-axis { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--txt-faint); margin-top: 4px; }
.sa-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sa-kv { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; padding: 3px 0; border-bottom: 1px dashed var(--line-soft); }
.sa-kv:last-child { border-bottom: none; }
.sa-kv span { color: var(--txt-dim); } .sa-kv b { font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.sa-kv[title] span { text-decoration: underline dotted var(--line); text-underline-offset: 3px; cursor: help; }
.sa-ls { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 5px 18px; font-size: 12.5px; }
.sa-ls > b { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--txt-faint); text-align: right; }
.sa-ls > span { color: var(--txt-dim); } .sa-ls > em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.sa-months { display: flex; flex-direction: column; gap: 3px; overflow-x: auto; }
.sa-mrow { display: grid; grid-template-columns: 44px repeat(12, minmax(38px, 1fr)) minmax(84px, auto); gap: 3px; font-size: 11px; }
.sa-mrow.head span { text-align: center; color: var(--txt-faint); font-weight: 650; }
.sa-mrow > span:first-child { font-weight: 650; color: var(--txt-dim); align-self: center; }
.sa-m { border-radius: 6px; padding: 5px 2px; text-align: center; font-variant-numeric: tabular-nums; background: var(--panel); }
.sa-m.up { background: color-mix(in srgb, var(--up) calc(12% + var(--a, 0) * 40%), var(--panel)); color: var(--txt); }
.sa-m.down { background: color-mix(in srgb, var(--down) calc(12% + var(--a, 0) * 40%), var(--panel)); color: var(--txt); }
.sa-m.none { background: transparent; }
.sa-m.year { font-weight: 650; padding: 5px 6px; background: var(--panel); }
.sa-m.year.up { color: var(--up); } .sa-m.year.down { color: var(--down); }
.sa-bars { display: flex; gap: 3px; align-items: flex-end; height: 120px; }
.sa-bar { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 3px; height: 100%; min-width: 0; }
.sa-bar-v { flex: 1 1 auto; width: 100%; display: flex; align-items: flex-end; background: var(--panel); border-radius: 5px; overflow: hidden; }
.sa-bar-v i { display: block; width: 100%; background: var(--up); border-radius: 5px 5px 0 0; }
.sa-bar-v i.down { background: var(--down); }
.sa-bar small { font-size: 9.5px; color: var(--txt-faint); }
@media (max-width: 760px) {
  .sa-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sa-cols { grid-template-columns: 1fr; }
  .sa-chart svg { height: 180px; }
}
.ev-row2 input[type=search] { font: inherit; font-size: 13px; padding: 7px 11px; border-radius: 9px; border: 1px solid var(--line-soft); background: var(--panel); color: var(--txt); min-width: 0; }
.ev-row2 input[type=search]:focus { outline: none; border-color: var(--line); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #2a8f6e) 15%, transparent); }

/* v3.1.4 — strategy analysis: copied trades switch, months in %, profit and loss per weekday / hour */
.sa-live { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; background: var(--sunken); border: 1px solid var(--line-soft); font-size: 12.5px; cursor: pointer; }
.sa-live span { display: flex; flex-direction: column; gap: 1px; } .sa-live small { font-size: 11px; color: var(--txt-faint); }
.sa-mrow { grid-template-columns: 44px repeat(12, minmax(52px, 1fr)) minmax(92px, auto); }
.sa-m { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 4px 2px; line-height: 1.2; }
.sa-m b { font-size: 11.5px; font-weight: 700; }
.sa-m small { font-size: 9.5px; color: var(--txt-dim); opacity: .85; }
.sa-m.year b { font-size: 12px; }
.sa-bars2 { display: flex; gap: 3px; height: 150px; }
.sa-bar2 { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.sa-pl { position: relative; flex: 1 1 auto; display: grid; grid-template-rows: 1fr 1fr; }
.sa-up, .sa-dn { display: flex; width: 100%; background: var(--panel); overflow: hidden; }
.sa-up { align-items: flex-end; border-radius: 5px 5px 0 0; border-bottom: 1px solid var(--line); }
.sa-dn { align-items: flex-start; border-radius: 0 0 5px 5px; }
.sa-up i { display: block; width: 100%; background: color-mix(in srgb, var(--up) 75%, transparent); border-radius: 4px 4px 0 0; }
.sa-dn i { display: block; width: 100%; background: color-mix(in srgb, var(--down) 70%, transparent); border-radius: 0 0 4px 4px; }
.sa-net { position: absolute; left: 50%; width: 7px; height: 7px; margin: 0 0 -3.5px -3.5px; border-radius: 50%; background: var(--txt); box-shadow: 0 0 0 2px var(--panel); pointer-events: none; }
.sa-bar2 > small { font-size: 9.5px; color: var(--txt-faint); text-align: center; padding-top: 3px; }
.sa-bar2.empty .sa-net { display: none; }
.sa-bt { display: grid; grid-template-columns: minmax(36px, auto) repeat(5, minmax(0, 1fr)); gap: 3px 10px; font-size: 11.5px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.sa-bt span { text-align: right; white-space: nowrap; } .sa-bt span:nth-child(6n+1) { text-align: left; }
.sa-bt .h { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--txt-faint); font-weight: 650; }
.sa-bt small { color: var(--txt-faint); font-size: 10.5px; }
/* v3.1.4 — uptime thresholds explained */
#adv-uptime .up-legend { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 16px 0; }
#adv-uptime .up-legend span { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; padding: 5px 10px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line-soft); color: var(--txt-dim); }
#adv-uptime .up-legend i { width: 9px; height: 9px; border-radius: 50%; }
#adv-uptime .up-legend .good i { background: var(--up); } #adv-uptime .up-legend .warn i { background: #e0a010; } #adv-uptime .up-legend .bad i { background: var(--down); }
#adv-uptime .up-note { margin: 0; padding: 8px 16px 0; font-size: 11.5px; line-height: 1.5; color: var(--txt-faint); }
/* v3.1.4 — the red-events briefing as the first row of Notifications */
#na-brief { border: 1px solid var(--line-soft); border-radius: 14px; background: var(--sunken); margin-bottom: 12px; }
#na-brief .brief-row { padding: 14px 18px; }
/* v3.1.4 — breakout statistics on a phone: two per row; an odd last tile takes the whole row */
@media (max-width: 760px) {
  .bd-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bd-stats > div:last-child:nth-child(odd) { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; }
}
/* v3.1.4 — Advanced: no clipped menu on phones; pages slide in once loaded */
#settings-tab-content > * { flex-shrink: 0; }
.adv-host { position: relative; }
.adv-staging { position: absolute; left: 0; right: 0; top: 0; visibility: hidden; pointer-events: none; }
.adv-in-fwd  { animation: adv-in-fwd .42s cubic-bezier(.22, .8, .25, 1) both; }
.adv-in-back { animation: adv-in-back .42s cubic-bezier(.22, .8, .25, 1) both; }
@keyframes adv-in-fwd  { from { opacity: .25; transform: translateX(22%); } to { opacity: 1; transform: none; } }
@keyframes adv-in-back { from { opacity: .25; transform: translateX(-22%); } to { opacity: 1; transform: none; } }

/* v3.1.5 — Connection downtime: the page is one section — its headings and
   cards sit inside it with the same inset as every other section (phones
   too), the cards on white. */
.adv-page > #adv-downtime { padding: 14px 16px; }
#adv-downtime .dt-win, #adv-downtime .dt-wins-empty { background: var(--panel); }
#adv-downtime .dt-sec { padding: 8px 0 0; }
#adv-downtime .dt-top { padding: 0; }
@media (max-width: 640px) {
  .adv-page > #adv-downtime { padding: 12px; }
  .adv-page > #adv-downtime.dt-pane.adv-pane { background: var(--sunken); border: 1px solid var(--line-soft); }
}
/* v3.1.6 — a day off (Wednesdays and weekends switched off) with a result: still a day off, the figure muted */
.cal-day.dead.dead-trades { opacity: .55; }
.cal-day.dead.dead-trades .dpl, .cal-day.dead.dead-trades .dn { color: var(--txt-faint); }

/* ===================== v3.1.7 ===================== */
/* Settings tabs: the selected tab is three times as wide as the other, its
   label centred; on a phone the bar spans the width and the selected tab
   takes the larger share. */
#settings-tab-seg { --tab-u: 96px; display: inline-flex; }
#settings-tab-seg button {
  flex: 0 0 var(--tab-u); width: var(--tab-u); text-align: center; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  transition: flex-basis .28s cubic-bezier(.2,.8,.2,1), width .28s cubic-bezier(.2,.8,.2,1), background-color .2s, color .2s;
}
#settings-tab-seg button.on { flex-basis: calc(var(--tab-u) * 3); width: calc(var(--tab-u) * 3); }
@media (max-width: 600px) {
  #settings-tab-seg { display: flex; width: 100%; flex-wrap: nowrap; }
  #settings-tab-seg button { flex: 1 1 0; width: auto; min-width: 0; padding: 6px 8px; transition: flex-grow .28s cubic-bezier(.2,.8,.2,1), background-color .2s, color .2s; }
  #settings-tab-seg button.on { flex: 2 1 0; width: auto; }
}
@media (prefers-reduced-motion: reduce) { #settings-tab-seg button { transition: none; } }

/* This account on a phone: every compact control — switches, segmented
   choices, the display-size stepper, the time zone lists — stays on the
   right, centred on its row, as on a computer. Only text fields (names)
   take the full width below. */
@media (max-width: 600px) {
  .settings-tabbed .set-card-list > .field-row:has(.tz-select, .zoom-control, .seg, #twofa-enable-btn) {
    grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label control" "hint control"; row-gap: 2px;
  }
  .settings-tabbed .set-card-list > .field-row:has(.tz-select, .zoom-control, .seg, #twofa-enable-btn):not(:has(> .field-hint)) { grid-template-areas: "label control"; }
  .set-card-list > .field-row:has(.tz-select, .zoom-control, .seg, #twofa-enable-btn) > :not(.field-label):not(.field-hint) {
    justify-self: end; align-self: center; margin-top: 0;
  }
  .set-card-list .tz-select { width: auto; max-width: 46vw; }
  .set-card-list .seg-sm button { font-size: 10.5px; padding: 4px 8px; }
  .set-card-list .zoom-control { gap: 4px; }
}
/* One look for the controls on the page: the same height for selects, the
   zoom stepper and segmented choices. */
.set-card-list .tz-select { min-height: 30px; }
.set-card-list .zoom-control { min-height: 30px; align-items: center; }

/* Notifications card: the test button on the right of its note. */
.push-card-foot { justify-content: space-between; flex-wrap: nowrap; }
.push-card-foot .push-test-msg { min-width: 0; }
.push-card-foot #push-test { flex: none; }
#push-toggle[hidden] { display: none; }
.pt-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--panel); cursor: pointer; }
.pt-row span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pt-row b { font-size: 13px; font-weight: 600; color: var(--txt); }
.pt-row small { font-size: 10.5px; color: var(--txt-faint); }
.pt-row.pt-all { background: var(--sunken); }
.pt-dialog { width: min(420px, calc(100vw - 32px)); }

/* Manage users: security on each profile, and where pictures appear. */
.um-row.um-row-sec { grid-template-columns: 1fr; }
.um-row-ctl.um-sec { flex-direction: column; flex-wrap: nowrap; align-items: stretch; justify-content: flex-start; gap: 0; border: 1px solid var(--line-soft); border-radius: 9px; background: var(--sunken); }
.um-sec-line { display: flex; align-items: center; gap: 10px; padding: 8px 12px; flex-wrap: wrap; }
.um-sec-line + .um-sec-line { border-top: 1px solid var(--line-soft); }
.um-sec-name { flex: 1 1 160px; display: flex; flex-direction: column; gap: 1px; font-size: 12.5px; font-weight: 600; color: var(--txt); min-width: 0; }
.um-sec-name small { font-size: 10.5px; font-weight: 400; color: var(--txt-faint); }
.um-sec-line .twofa-status { flex: none; }
.um-sec-line .btn { flex: none; }
.um-pics .um-avatar svg { width: 18px; height: 18px; }

/* Sign-in screen with the last profile's picture (owner's choice). */
.login-face { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 4px 0 2px; animation: cc-fade-up .35s cubic-bezier(.2,.8,.2,1) both; }
.login-face.hidden { display: none; }
.login-face-img {
  width: 96px; height: 96px; border-radius: 50%; overflow: hidden; display: inline-flex; align-items: center; justify-content: center;
  background: var(--sunken); box-shadow: 0 0 0 1px var(--line-soft), 0 10px 28px rgba(0,0,0,0.16);
  font-size: 38px; font-weight: 700; color: var(--txt-dim);
}
.login-face-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.login-face b { font-size: 17px; font-weight: 700; color: var(--txt); letter-spacing: -0.01em; }
.login-face .btn-link-plain { font-size: 12px; }
.login-card.has-face .login-sub { display: none; }


/* ===================== v3.1.8 ===================== */
/* Breakout charts as candlesticks. */
.bc-wick { fill: none; stroke-width: 1; vector-effect: non-scaling-stroke; }
.bc-wick.up { stroke: var(--trading); }
.bc-wick.down { stroke: var(--blocked); }
.bc-cbody { stroke: none; }
.bc-cbody.up { fill: var(--trading); }
.bc-cbody.down { fill: var(--blocked); }
.bd-histcard .imp-card-head .bd-style-seg { margin-left: auto; align-self: center; }
.bd-histcard .imp-card-head .bd-style-seg + .bd-fbtn { margin-left: 8px; }
.bdx-tools .bd-style-seg { align-self: center; }
/* Connection downtime: the uptime thresholds at the top of the page. */
#adv-downtime > .dt-th { display: flex; flex-direction: column; gap: 8px; padding-bottom: 14px; margin-bottom: 4px; border-bottom: 1px solid var(--line-soft); }
#adv-downtime > .dt-main { display: flex; flex-direction: column; gap: 14px; }
.dt-th-row { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px 18px; padding: 0 2px; }
.dt-th-f { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--txt-dim); }
.dt-th-f > span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.dt-th-f i { width: 9px; height: 9px; border-radius: 50%; }
.dt-th-f i.good { background: var(--up); } .dt-th-f i.warn { background: #e0a010; }
.dt-th-act { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; }
.dt-th-act .field-hint { margin: 0; }
.dt-th .up-legend { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 2px; }
.dt-th .up-legend span { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; padding: 5px 10px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line-soft); color: var(--txt-dim); }
.dt-th .up-legend i { width: 9px; height: 9px; border-radius: 50%; }
.dt-th .up-legend .good i { background: var(--up); } .dt-th .up-legend .warn i { background: #e0a010; } .dt-th .up-legend .bad i { background: var(--down); }
.dt-th .up-note { margin: 0; padding: 0 2px; font-size: 11.5px; color: var(--txt-faint); line-height: 1.45; }
/* Data import & files: one page. */
.adv-page > #adv-data { background: transparent; border: none; padding: 0; box-shadow: none; }
.dh { display: flex; flex-direction: column; gap: 14px; }
.dh-files > .df { display: flex; flex-direction: column; gap: 14px; }
.dh-sec #adv-ticks .tk { gap: 0; }
.dh-sec #adv-ticks .tk-card { background: var(--panel); }
.df-inst-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.df-inst-head > small { flex: 1 1 260px; min-width: 0; }
.df-inst-head > .btn { margin-left: auto; }
.dt-th-f input { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 7px 24px 7px 10px; color: var(--txt); font-family: 'Space Grotesk', system-ui, sans-serif; font-size: 13px; width: 92px; }
.dt-th-f input:focus { outline: none; border-color: var(--standby); box-shadow: 0 0 0 3px var(--standby-bg); }
@media (max-width: 600px) { .dt-th-f input { font-size: 16px; } .dt-th-act { margin-left: 0; width: 100%; justify-content: flex-end; } }
.df-nodata .df-inst-head b { font-size: 13px; font-weight: 600; }

/* ===================== v3.1.9 ===================== */
/* Strategy analysis → Monte Carlo simulation. */
.mc { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.mc-head { display: flex; align-items: center; gap: 12px; }
.mc-head > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mc-head b { font-size: 16px; font-weight: 700; color: var(--txt); }
.mc-head small { font-size: 12px; color: var(--txt-faint); line-height: 1.4; }
.mc-ic { width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; flex: none; background: var(--standby-bg); color: var(--standby); }
.mc-ic svg { width: 20px; height: 20px; }
.mc-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.mc-sel { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--panel); }
.mc-sel-txt { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; font-size: 13px; color: var(--txt-dim); }
.mc-sel-txt b { color: var(--txt); }
.mc-sel-txt small { font-size: 11.5px; color: var(--txt-faint); }
.mc-sel .btn svg, .mc .btn svg { width: 14px; height: 14px; margin-right: 5px; vertical-align: -2px; }
.mc-pick { border: 1px solid var(--line-soft); border-radius: 10px; background: var(--panel); padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; }
.mc-flt { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.mc-f { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--txt-faint); }
.mc-f > span:first-child { text-transform: uppercase; letter-spacing: .05em; font-weight: 650; }
.mc-f .param-select { min-width: 110px; }
.mc-wd { display: inline-flex; gap: 4px; }
.mc-chip { border: 1px solid var(--line-soft); background: var(--sunken); color: var(--txt-faint); border-radius: 7px; padding: 4px 8px; font-size: 11px; cursor: pointer; font-family: inherit; }
.mc-chip.on { background: var(--standby-bg); color: var(--standby); border-color: color-mix(in srgb, var(--standby) 40%, transparent); }
.mc-pick-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--txt-dim); }
.mc-pick-act { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.mc-tlist { max-height: 260px; overflow: auto; border: 1px solid var(--line-soft); border-radius: 8px; }
.mc-trow { display: grid; grid-template-columns: 18px minmax(0, 1.4fr) 48px minmax(0, 1fr) 56px; align-items: center; gap: 8px; padding: 5px 10px; font-size: 12px; border-bottom: 1px solid var(--line-soft); cursor: pointer; color: var(--txt-dim); }
.mc-trow:last-child { border-bottom: none; }
.mc-trow:not(.on) { opacity: .55; }
.mc-trow input { margin: 0; accent-color: var(--standby); }
.mc-t-side.buy { color: var(--up); } .mc-t-side.sell { color: var(--down); }
.mc-t-pl { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.mc-t-pl.up { color: var(--up); } .mc-t-pl.down { color: var(--down); }
.mc-t-tag { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--standby); text-align: right; }
.mc-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.mc-o { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.mc-o-wide { grid-column: 1 / -1; }
.mc-o-l { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 650; color: var(--txt-faint); }
.mc-o-h { font-size: 11px; color: var(--txt-faint); line-height: 1.4; }
.mc-o .seg { flex-wrap: wrap; }
.mc-in { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; color: var(--txt); font-family: 'Space Grotesk', system-ui, sans-serif; font-size: 13px; width: 110px; }
.mc-in.wide { width: 150px; }
.suffix-input .mc-in { padding-right: 46px; width: 120px; }
.mc-in:focus { outline: none; border-color: var(--standby); box-shadow: 0 0 0 3px var(--standby-bg); }
.mc-o .param-select { max-width: 100%; }
.mc-stress { border: 1px solid var(--line-soft); border-radius: 10px; background: var(--panel); padding: 8px 12px; }
.mc-stress summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--txt); }
.mc-stress summary small { font-weight: 400; color: var(--txt-faint); font-size: 11.5px; margin-left: 6px; }
.mc-stress[open] summary { margin-bottom: 10px; }
.mc-run-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 4px; }
.mc-seed { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 650; color: var(--txt-faint); }
.mc-seed .mc-in { width: 120px; }
.mc-run-info { font-size: 11.5px; color: var(--txt-faint); flex: 1; min-width: 140px; }
.mc-run-msg { font-size: 12px; color: var(--down); }
.mc-hlist { display: flex; flex-direction: column; gap: 6px; max-height: 560px; overflow: auto; }
.mc-hrow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 10px; text-align: left; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line-soft); background: var(--panel); color: var(--txt); cursor: pointer; font-family: inherit; }
.mc-hrow:hover { border-color: var(--line); }
.mc-hrow.on { border-color: var(--standby); box-shadow: 0 0 0 3px var(--standby-bg); }
.mc-h-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.mc-h-main b { font-size: 12.5px; }
.mc-h-main small { font-size: 10.5px; color: var(--txt-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-h-fig { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.mc-h-fig small { font-size: 9.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--txt-faint); }
.mc-h-fig b { font-size: 12px; font-variant-numeric: tabular-nums; }
.mc-h-fig b.up, .mc .up { color: var(--up); } .mc-h-fig b.down, .mc .down { color: var(--down); }
.mc-st { grid-column: 2 / -1; justify-self: end; font-size: 10.5px; font-weight: 650; padding: 3px 8px; border-radius: 99px; background: var(--sunken); color: var(--txt-faint); }
.mc-st.running, .mc-st.queued { background: var(--standby-bg); color: var(--standby); }
.mc-st.failed { color: var(--down); }
.mc-result { display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 70px; }
.mc-result:empty { display: none; }
.mc-wait { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--sunken); }
.mc-wait small { font-size: 11.5px; color: var(--txt-faint); }
.mc-wait .btn { align-self: flex-start; }
.mc-res-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.mc-res-title { display: flex; flex-direction: column; gap: 2px; }
.mc-res-title b { font-size: 15px; }
.mc-res-title small { font-size: 11.5px; color: var(--txt-faint); }
.mc-res-act { display: inline-flex; gap: 6px; }
.mc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mc-chips span { font-size: 11px; padding: 4px 9px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line-soft); color: var(--txt-dim); }
.mc-seltxt { margin: -4px 0 0; font-size: 11.5px; color: var(--txt-faint); }
.mc-fan-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 64px; }
.mc-plot { position: relative; height: 280px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line-soft); overflow: hidden; touch-action: pan-y; }
.mc-plot svg { width: 100%; height: 100%; display: block; }
.mc-b90 { fill: color-mix(in srgb, var(--standby) 13%, transparent); }
.mc-b50 { fill: color-mix(in srgb, var(--standby) 24%, transparent); }
.mc-med { fill: none; stroke: var(--standby); stroke-width: 2; vector-effect: non-scaling-stroke; }
.mc-sample { fill: none; stroke: var(--txt-faint); stroke-width: 0.8; opacity: .35; vector-effect: non-scaling-stroke; }
.mc-start { stroke: var(--txt-dim); stroke-width: 1; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.mc-limit { stroke: var(--down); stroke-width: 1.2; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; }
.mc-target { stroke: var(--up); stroke-width: 1.2; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; }
.mc-tag { position: absolute; left: 6px; transform: translateY(-120%); font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; pointer-events: none; }
.mc-tag.limit { color: var(--down); } .mc-tag.target { color: var(--up); }
.mc-cross { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--txt-faint); pointer-events: none; }
.mc-tip { position: absolute; top: 8px; transform: translateX(10px); background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; font-size: 11.5px; display: flex; flex-direction: column; gap: 2px; box-shadow: 0 8px 22px rgba(0,0,0,.14); pointer-events: none; z-index: 2; white-space: nowrap; }
.mc-tip.flip { transform: translateX(calc(-100% - 10px)); }
.mc-tip b { font-size: 11.5px; margin-bottom: 2px; }
.mc-tip em { font-style: normal; display: inline-block; width: 52px; color: var(--txt-faint); }
.mc-tip small { color: var(--txt-faint); margin-left: 4px; }
.mc-yax { position: relative; }
.mc-yax span { position: absolute; left: 8px; transform: translateY(-50%); font-size: 10.5px; color: var(--txt-faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mc-xax { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--txt-faint); margin: 4px 64px 0 0; }
.mc-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 11px; color: var(--txt-dim); }
.mc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.mc-legend i { width: 16px; height: 8px; border-radius: 2px; display: inline-block; }
.mc-legend i.b90 { background: color-mix(in srgb, var(--standby) 13%, transparent); }
.mc-legend i.b50 { background: color-mix(in srgb, var(--standby) 30%, transparent); }
.mc-legend i.med { height: 2px; background: var(--standby); }
.mc-legend i.smp { height: 1px; background: var(--txt-faint); }
.mc-legend i.lim { height: 0; border-top: 2px dashed var(--down); border-radius: 0; }
.mc-legend i.tgt { height: 0; border-top: 2px dashed var(--up); border-radius: 0; }
.mc-hist-chart { display: flex; flex-direction: column; gap: 6px; }
.mc-hc-head b { font-size: 13px; }
.mc-hc-plot { position: relative; height: 150px; border-bottom: 1px solid var(--line); margin-top: 16px; }
.mc-hc-plot > i { position: absolute; bottom: 0; background: color-mix(in srgb, var(--standby) 55%, transparent); border-radius: 2px 2px 0 0; }
.mc-hc-plot > i.up { background: color-mix(in srgb, var(--up) 60%, transparent); }
.mc-hc-plot > i.down { background: color-mix(in srgb, var(--down) 60%, transparent); }
.mc-mark { position: absolute; top: -14px; bottom: 0; width: 0; border-left: 2px solid var(--txt); }
.mc-mark em { position: absolute; top: -2px; left: 4px; font-style: normal; font-size: 10px; font-weight: 650; white-space: nowrap; color: var(--txt); }
.mc-mark.med { border-color: var(--standby); } .mc-mark.med em { color: var(--standby); }
.mc-mark.p95 { border-color: var(--down); border-left-style: dashed; } .mc-mark.p95 em { color: var(--down); }
.mc-mark.act { border-color: #e0a010; } .mc-mark.act em { color: #e0a010; top: 12px; }
.mc-hc-ax { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--txt-faint); font-variant-numeric: tabular-nums; }
.mc-ddp { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.mc-ddp span { display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line-soft); }
.mc-ddp small { font-size: 10px; color: var(--txt-faint); }
.mc-ddp b { font-size: 13px; font-variant-numeric: tabular-nums; }
.mc-ptable { display: grid; grid-template-columns: minmax(70px, .8fr) repeat(6, minmax(0, 1fr)); font-size: 12px; border: 1px solid var(--line-soft); border-radius: 10px; overflow: hidden; background: var(--panel); }
.mc-ptable > span { padding: 6px 10px; border-bottom: 1px solid var(--line-soft); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-ptable > span:nth-child(7n+1) { text-align: left; }
.mc-ptable > span.h { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--txt-faint); font-weight: 650; background: var(--sunken); }
.mc-ptable > span.med { background: color-mix(in srgb, var(--standby) 8%, transparent); font-weight: 650; }
.mc-note { margin: 8px 0 0; font-size: 11.5px; color: var(--txt-faint); line-height: 1.45; }
.mc-real p { margin: 0; font-size: 12.5px; color: var(--txt-dim); line-height: 1.55; }
.mc-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .mc-grid { grid-template-columns: 1fr; }
  .mc-hlist { max-height: 340px; }
}
@media (max-width: 600px) {
  .mc-opts { grid-template-columns: 1fr; }
  .mc-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mc-plot { height: 220px; }
  .mc-fan-wrap { grid-template-columns: minmax(0, 1fr) 54px; }
  .mc-xax { margin-right: 54px; }
  .mc-ptable { overflow-x: auto; grid-template-columns: 64px repeat(6, minmax(86px, 1fr)); }
  .mc-ddp { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mc-in, .mc-f .param-select, .mc-o .param-select { font-size: 16px; }
  .mc-trow { grid-template-columns: 18px minmax(0, 1fr) 40px minmax(0, 1fr); }
  .mc-trow .mc-t-tag { display: none; }
  .mc-hrow { grid-template-columns: minmax(0, 1fr) auto auto; }
}
.mc-pwrap { overflow-x: auto; border-radius: 10px; }
.mc-ddp small { white-space: nowrap; }
@media (max-width: 600px) {
  .mc-ptable { overflow: visible; min-width: 640px; grid-template-columns: 70px repeat(6, minmax(86px, 1fr)); }
  .mc-tiles > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* ===================== v3.1.10 ===================== */
/* Monte Carlo: form in numbered blocks, presets, switches, comparison. */
.mc .seg button, .mc-seg button { text-transform: none; }
.mc-seg-wide { display: flex; width: 100%; }
.mc-seg-wide button { flex: 1 1 0; padding: 6px 8px; font-size: 11.5px; }
.mc-form { gap: 14px; }
.mc-presets { display: flex; flex-direction: column; gap: 6px; }
.mc-preset-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.mc-preset { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-soft); background: var(--panel); color: var(--txt); cursor: pointer; font-family: inherit; transition: border-color .15s, box-shadow .15s; }
.mc-preset:hover { border-color: var(--line); }
.mc-preset.on { border-color: var(--standby); box-shadow: 0 0 0 3px var(--standby-bg); }
.mc-preset b { font-size: 12px; font-weight: 650; }
.mc-preset small { font-size: 10.5px; color: var(--txt-faint); line-height: 1.35; }
.mc-block { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--panel); }
.mc-bh { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.mc-bh b, .mc-stress summary b { font-size: 12.5px; font-weight: 700; color: var(--txt); }
.mc-bh small, .mc-stress summary small { font-size: 11px; color: var(--txt-faint); font-weight: 400; }
.mc-block .mc-sel, .mc-block .mc-pick { background: var(--sunken); }
.mc-block .mc-tlist { background: var(--panel); }
.mc-method-h { margin: -2px 0 0; }
.mc-o { gap: 4px; }
.mc-o-l { font-size: 10.5px; }
.mc-o-h { font-size: 10.5px; line-height: 1.4; }
.mc-o.mc-dis { opacity: .5; }
.mc-o.mc-dis input { pointer-events: none; }
.mc-num { position: relative; display: inline-flex; align-items: center; width: 130px; max-width: 100%; }
.mc-num.wide { width: 160px; }
.mc-num .mc-in { width: 100%; padding-right: 34px; background: var(--sunken); }
.mc-num:not(:has(em)) .mc-in { padding-right: 10px; }
.mc-num em { position: absolute; right: 10px; font-style: normal; font-size: 11.5px; color: var(--txt-faint); pointer-events: none; }
.mc-in { background: var(--sunken); min-height: 32px; box-sizing: border-box; }
.mc-name { width: 100%; max-width: 320px; }
.mc-sel-in { width: 100%; min-height: 32px; }
.mc-sws { display: flex; flex-direction: column; gap: 6px; }
.mc-sw { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--sunken); cursor: pointer; }
.mc-sw input { margin-top: 2px; flex: none; }
.mc-sw span { display: flex; flex-direction: column; gap: 1px; }
.mc-sw b { font-size: 12.5px; font-weight: 600; color: var(--txt); }
.mc-sw small { font-size: 10.5px; color: var(--txt-faint); line-height: 1.4; }
.mc-sw.off { opacity: .5; cursor: default; }
.mc-stress { padding: 10px 12px; }
.mc-stress summary { display: flex; align-items: baseline; gap: 8px; list-style: none; }
.mc-stress summary::-webkit-details-marker { display: none; }
.mc-stress summary::before { content: '▸'; font-size: 11px; color: var(--txt-faint); transition: transform .15s; }
.mc-stress[open] summary::before { transform: rotate(90deg); }
.mc-stress[open] summary { margin-bottom: 4px; }
.mc-run { display: flex; flex-direction: column; gap: 10px; padding-top: 2px; }
.mc-run-row { justify-content: flex-end; padding-top: 4px; border-top: 1px dashed var(--line-soft); padding-top: 12px; }
.mc-run-info { flex: 1 1 200px; }
.mc-warn { margin: 0; font-size: 11.5px; color: var(--down); text-align: right; }
.mc-empty { margin: 4px 0; font-size: 12px; color: var(--txt-faint); line-height: 1.45; }
/* History rows: a compare box, the run, two figures. */
.mc-hrow { grid-template-columns: 18px minmax(0, 1fr) auto auto; outline: none; }
.mc-hrow:focus-visible { box-shadow: 0 0 0 3px var(--standby-bg); }
.mc-cmp { margin: 0; accent-color: var(--standby); cursor: pointer; }
.mc-cmp-none { width: 13px; }
.mc-st { grid-column: auto / span 2; }
.mc-compare:empty { display: none; }
.mc-cmpbox .set-sec-head { align-items: center; }
.mc-cmp-x { margin-left: auto; }
.mc-ctable { display: grid; grid-template-columns: minmax(130px, 1fr) repeat(var(--n), minmax(110px, 1fr)); border: 1px solid var(--line-soft); border-radius: 10px; overflow: hidden; background: var(--panel); font-size: 12px; }
.mc-ctable > span { padding: 6px 10px; border-bottom: 1px solid var(--line-soft); text-align: right; font-variant-numeric: tabular-nums; }
.mc-ctable > span.l { text-align: left; color: var(--txt-dim); }
.mc-ctable > span.h { background: var(--sunken); display: flex; flex-direction: column; align-items: flex-end; gap: 1px; font-size: 12px; }
.mc-ctable > span.h small { font-size: 10.5px; color: var(--txt-faint); }
.mc-ctable > span.best { color: var(--up); font-weight: 700; }
/* The reading of a result. */
.mc-verdict { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--standby) 7%, var(--sunken)); border: 1px solid color-mix(in srgb, var(--standby) 22%, transparent); }
.mc-verdict p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--txt-dim); }
.mc-verdict b { color: var(--txt); font-variant-numeric: tabular-nums; }
.mc-verdict b.up { color: var(--up); } .mc-verdict b.down { color: var(--down); }
.mc-verdict .mc-prec { font-size: 11px; color: var(--txt-faint); }
.mc-time { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.mc-time span { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line-soft); }
.mc-time small { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--txt-faint); font-weight: 650; }
.mc-time b { font-size: 14px; font-variant-numeric: tabular-nums; }
.mc-time em { font-style: normal; font-size: 11px; color: var(--txt-faint); }
/* Fan chart: a light grid and tags on the right of the lines. */
.mc-grid-l { stroke: var(--line-soft); stroke-width: 1; vector-effect: non-scaling-stroke; }
.mc-tag { left: auto; right: 8px; padding: 1px 6px; border-radius: 5px; background: color-mix(in srgb, var(--panel) 85%, transparent); }
.mc-tag.start { color: var(--txt-faint); }
.mc-tip .med { font-weight: 700; color: var(--standby); }
.mc-hc-plot { margin-top: 30px; }
.mc-mark em { top: calc(-14px + var(--k, 0) * 13px); background: color-mix(in srgb, var(--sunken) 85%, transparent); padding: 0 3px; border-radius: 3px; }
.mc-mark.flip em { left: auto; right: 4px; }
.mc-mark { top: -16px; }
.mc-mark.act em { top: calc(-14px + var(--k, 0) * 13px); }
.mc-hist-chart .set-sec-head { padding: 0; }
.mc-ptable.uw { grid-template-columns: minmax(70px, .8fr) repeat(7, minmax(0, 1fr)); }
.mc-ptable.uw > span:nth-child(7n+1) { text-align: right; }
.mc-ptable.uw > span:nth-child(8n+1) { text-align: left; }
.mc-ptable > span.avg { background: var(--sunken); border-bottom: none; }
@media (max-width: 600px) {
  .mc-seg-wide { flex-wrap: wrap; }
  .mc-seg-wide button { flex: 1 1 40%; }
  .mc-preset-row { grid-template-columns: 1fr 1fr; }
  .mc-num, .mc-num.wide { width: 100%; }
  .mc-name { max-width: none; }
  .mc-ptable.uw { min-width: 720px; grid-template-columns: 70px repeat(7, minmax(86px, 1fr)); }
  .mc-ctable { font-size: 11.5px; grid-template-columns: minmax(96px, 1fr) repeat(var(--n), minmax(80px, 1fr)); }
  .mc-hrow { grid-template-columns: 18px minmax(0, 1fr) auto; }
  .mc-hrow .mc-h-fig:last-child { display: none; }
  .mc-run-row { justify-content: stretch; }
  .mc-run-row .btn.primary { flex: 1 1 100%; }
}
.mc-ptable > span.h { white-space: normal; line-height: 1.25; align-self: stretch; display: flex; align-items: flex-end; justify-content: flex-end; }
.mc-ptable > span.h:first-child { justify-content: flex-start; }
@media (min-width: 901px) { .mc-hist { position: sticky; top: 64px; } }
/* Profile picture: the built-in figures. */
.av-dialog { width: min(640px, calc(100vw - 24px)); }
.av-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; max-height: min(60vh, 520px); overflow: auto; padding: 2px; }
.av-opt { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px 8px; border-radius: 12px; border: 1px solid var(--line-soft); background: var(--sunken); cursor: pointer; font-family: inherit; color: var(--txt-dim); transition: border-color .15s, box-shadow .15s, transform .15s; }
.av-opt:hover { border-color: var(--standby); box-shadow: 0 0 0 3px var(--standby-bg); transform: translateY(-1px); }
.av-opt img { width: 68px; height: 68px; border-radius: 50%; display: block; }
.av-opt span { font-size: 11px; font-weight: 600; text-align: center; line-height: 1.25; }
.av-opt.busy { opacity: .6; }
.av-dialog .mw-actions .btn svg { width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; }
@media (max-width: 600px) { .av-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .av-opt img { width: 60px; height: 60px; } }
/* Monte Carlo: the guide. */
.mc-guide { border: 1px solid color-mix(in srgb, var(--standby) 25%, var(--line-soft)); border-radius: 12px; background: color-mix(in srgb, var(--standby) 5%, var(--sunken)); padding: 10px 14px; }
.mc-guide summary { display: flex; align-items: baseline; gap: 8px; cursor: pointer; list-style: none; }
.mc-guide summary::-webkit-details-marker { display: none; }
.mc-guide summary::before { content: '▸'; font-size: 11px; color: var(--standby); transition: transform .15s; }
.mc-guide[open] summary::before { transform: rotate(90deg); }
.mc-guide summary b { font-size: 13px; color: var(--txt); }
.mc-guide summary small { font-size: 11px; color: var(--txt-faint); }
.mc-guide-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px 18px; margin-top: 10px; }
.mc-guide-body b { font-size: 12px; color: var(--txt); }
.mc-guide-body p { margin: 3px 0 0; font-size: 12px; line-height: 1.5; color: var(--txt-dim); }
.mc-guide-body em { font-style: normal; font-weight: 650; color: var(--txt); }

/* ===================== v3.2.1 ===================== */
/* Trade analyzer: today's trades, one line each. */
.bd-today-trades { display: flex; flex-direction: column; gap: 4px; }
.bd-tt-head { font-size: 12.5px; color: var(--txt-dim); margin-bottom: 2px; }
.bd-tt { display: grid; grid-template-columns: minmax(0, 1.6fr) auto auto auto; align-items: center; gap: 4px 12px; padding: 6px 10px; border-radius: 9px; background: var(--panel); border: 1px solid var(--line-soft); font-size: 12px; }
.bd-tt-acc { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--txt); font-weight: 600; }
.bd-tt-side { color: var(--txt-dim); white-space: nowrap; }
.bd-tt-side.buy { color: var(--up); } .bd-tt-side.sell { color: var(--down); }
.bd-tt-time { color: var(--txt-faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bd-tt b { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bd-tt b.up { color: var(--up); } .bd-tt b.down { color: var(--down); }
@media (max-width: 600px) { .bd-tt { grid-template-columns: minmax(0, 1fr) auto; } .bd-tt-time { grid-column: 1; } }

/* ===== v3.2.3 — a closed <dialog> is never part of the page ===== */
/* A rule like ".x-dialog { display: flex }" beats the browser's own
   "dialog:not([open]) { display: none }" — a closed window then showed at the
   end of the page, with what it last held. */
dialog:not([open]) { display: none !important; }

/* EA source viewer: a code box of moderate height, Copy as the main action */
.fl-view-dialog.code { height: fit-content; max-height: min(720px, 92vh); }
.fl-view-dialog.code[open] { display: block; overflow: auto; }   /* sized by its content */
.fl-view-dialog.code .fl-view-body { flex: 0 1 auto; margin: 14px 16px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--sunken); height: min(360px, 46vh); }
.fl-view-dialog.code .code-view { min-height: 0; padding: 12px 14px 16px; }
.fl-view-ver { font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 600; color: var(--txt-faint); margin-left: 6px; }
.fl-code-acts { display: flex; align-items: center; gap: 10px; padding: 14px 16px 16px; flex-wrap: wrap; }
.fl-code-acts .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; font-weight: 600; padding: 10px 18px; }
.fl-code-acts .btn svg { width: 15px; height: 15px; }
.fl-code-acts .fl-copy { min-width: 200px; }
.fl-code-acts .fl-lock { margin-left: auto; }
.fl-code-acts .fl-lock b { font-family: 'JetBrains Mono', monospace; font-weight: 700; min-width: 2.4em; text-align: right; }
@media (max-width: 760px) {
  dialog.na-test-dialog.fl-view-dialog.code { width: calc(var(--vw100, 100vw) - 24px); max-width: calc(var(--vw100, 100vw) - 24px); height: fit-content; max-height: calc(var(--vh100, 100vh) - 48px); margin: auto; border-radius: 14px; border: 1px solid var(--line); }
  .fl-view-dialog.code .na-test-dialog-head { padding-top: 12px; }
  .fl-view-dialog.code .fl-view-body { height: 42vh; margin: 12px 12px 0; }
  .fl-code-acts { padding: 12px; }
  .fl-code-acts .fl-copy { flex: 1 1 100%; min-width: 0; order: 2; }
  .fl-code-acts .fl-lock { order: 1; margin-left: 0; }
}

/* Trades table: the result marks that the row opens the trade (admins) */
.pl-open { border-bottom: 1px dashed color-mix(in srgb, currentColor 45%, transparent); }

/* Large chart: positions first */
.bdx-pos { display: flex; flex-direction: column; gap: 3px; padding: 9px 11px 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line-soft); border-left: 3px solid var(--line); }
.bdx-pos.up { border-left-color: var(--up); } .bdx-pos.down { border-left-color: var(--down); }
.bdx-pos.focus { box-shadow: 0 0 0 1px var(--txt-faint); }
.bdx-pos.carried { border-style: dashed; border-left-style: solid; }
.bdx-pos + .bdx-pos { margin-top: 6px; }
.bdx-pos-h { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; font-size: 12.5px; min-width: 0; }
.bdx-pos-h > span { color: var(--txt-dim); font-size: 11.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bdx-pos-pl { margin-left: auto; font-family: 'JetBrains Mono', monospace; font-size: 13px; }
.bdx-pos-pl.up { color: var(--up); } .bdx-pos-pl.down { color: var(--down); }
.bdx-pos-note { margin: 4px 0 0; font-size: 11px; line-height: 1.4; color: var(--txt-faint); }
.bdx-positions h4 small { margin-left: 0; }

/* Monte Carlo: one framed section that folds away */
.mc { margin-top: 18px; padding: 0; border: 1px solid var(--line-soft); border-radius: 14px; background: color-mix(in srgb, var(--sunken) 45%, transparent); gap: 0; overflow: clip; }
.mc .mc-head { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; cursor: pointer; border-radius: 14px 14px 0 0; transition: background .15s; }
.mc .mc-head:hover { background: color-mix(in srgb, var(--sunken) 70%, transparent); }
.mc .mc-head:focus-visible { outline: 2px solid var(--standby); outline-offset: -2px; }
.mc-head-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.mc-head-txt b { font-size: 16px; font-weight: 700; color: var(--txt); }
.mc-head-txt small { font-size: 12px; color: var(--txt-faint); line-height: 1.45; max-width: 820px; }
.mc-fold { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 12px; border-radius: 999px; border: 1px solid var(--line-soft); background: var(--panel); font-size: 12px; font-weight: 600; color: var(--txt-dim); }
.mc-fold svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; transform: rotate(180deg); }
.mc.folded .mc-fold svg { transform: none; }
.mc.folded .mc-head { border-radius: 14px; }
.mc-body { display: flex; flex-direction: column; gap: 14px; padding: 14px 16px 18px; border-top: 1px solid var(--line-soft); animation: adv-in-fwd .22s cubic-bezier(.2, .8, .2, 1) both; animation-name: mc-open; }
@keyframes mc-open { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.mc-body .mc-grid { gap: 14px; }
.mc-body .mc-hist { position: sticky; top: 8px; }
/* presets: the last row fills the width (no empty slot) */
.mc-preset-row { display: flex; flex-wrap: wrap; }
.mc-preset { flex: 1 1 150px; }
/* the result as a card of its own */
.mc-body .mc-result { padding: 16px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--panel); }
.mc-body .mc-compare:not(:empty) { padding: 14px 16px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--panel); }
@media (max-width: 600px) {
  .mc .mc-head { padding: 12px; gap: 10px; align-items: flex-start; }
  .mc-head-txt small { font-size: 11.5px; }
  .mc-fold span { display: none; }
  .mc-fold { padding: 6px; }
  .mc-body { padding: 12px 10px 14px; }
  .mc-body .mc-hist { position: static; }
  .mc-body .mc-result { padding: 12px 10px; }
  .mc-preset { flex-basis: 40%; }
}
.mc .mc-head > .mc-fold { flex-direction: row; gap: 6px; }

/* ===== v3.2.4 — large chart by touch: the page scrolls over the chart; the
   time axis is the handle that moves the time ===== */
@media (pointer: coarse) {
  .bdx-chart .bd-chart-host, .bdx-chart .bd-chart.big .bc-plot { touch-action: pan-y; cursor: default; }
  .bdx-chart .bd-chart.big .bc-plot { min-height: 220px; }
  .bdx-chart .bc-axis { touch-action: none; }
  .bdx-chart .bd-chart > .tl-ticks { touch-action: none; height: 30px; margin-top: 6px; border-radius: 8px; background: var(--sunken); border: 1px solid var(--line-soft); }
  .bdx-chart .bd-chart > .tl-ticks > span { top: 50%; transform: translate(-50%, -50%); }
  .bdx-chart .bd-chart > .tl-ticks > span.first { transform: translate(0, -50%); }
  .bdx-chart .bd-chart > .tl-ticks > span.last { transform: translate(-100%, -50%); }
  .bdx-chart .bd-chart > .tl-ticks::after { content: ''; position: absolute; left: 50%; bottom: 3px; width: 28px; height: 3px; margin-left: -14px; border-radius: 2px; background: var(--line); }
}
/* Trades table (admins): the row opens the trade on the chart */
tr.tr-open { cursor: pointer; }
tr.tr-open:hover td { background: color-mix(in srgb, var(--sunken) 70%, transparent); }
tr.tr-open:focus-visible { outline: 2px solid var(--standby); outline-offset: -2px; }

/* ===== v3.2.5 — a trade over candlesticks: the box lies under the candles
   (they stay readable), the entry → exit line on top ===== */
.bc-tbox.under.up { fill: color-mix(in srgb, var(--up) 13%, transparent); stroke: color-mix(in srgb, var(--up) 70%, transparent); stroke-dasharray: 5 3; }
.bc-tbox.under.down { fill: color-mix(in srgb, var(--down) 13%, transparent); stroke: color-mix(in srgb, var(--down) 70%, transparent); stroke-dasharray: 5 3; }
/* Timeframe beside the chart style */
.bd-histcard .imp-card-head .bd-chart-opts { margin-left: auto; align-self: center; display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.bd-histcard .imp-card-head .bd-chart-opts .bd-style-seg { margin-left: 0; }
.bd-histcard .imp-card-head .bd-chart-opts + .bd-fbtn { margin-left: 8px; }
.bdx-tools .bd-tf-seg { align-self: center; }
.bd-tf-seg button { min-width: 34px; }
.bc-tfnote { position: absolute; left: 8px; top: 6px; z-index: 3; font-size: 10.5px; padding: 2px 8px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line-soft); color: var(--txt-faint); pointer-events: none; }
@media (max-width: 600px) {
  .bd-histcard .imp-card-head { flex-wrap: wrap; }
  .bd-histcard .imp-card-head .bd-chart-opts { order: 3; width: 100%; justify-content: flex-start; margin-left: 0; margin-top: 6px; }
}

/* Map: the credit fades out (see mapCleanAttribution), a small "i" stays */
.leaflet-control-attribution { transition: opacity .4s ease; }
.leaflet-control-attribution.folded { opacity: 0; pointer-events: none; }
.map-attr-i { display: none; position: absolute; right: 6px; bottom: 6px; width: 16px; height: 16px; padding: 0; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--txt-faint) 45%, transparent); background: color-mix(in srgb, var(--panel) 70%, transparent); color: var(--txt-faint); font: italic 600 10px/14px Georgia, serif; text-align: center; cursor: pointer; opacity: .55; pointer-events: auto; }
.map-attr-i.on { display: block; }
.map-attr-i:hover { opacity: 1; }

/* ===== v3.2.7 ===== */
.bdx-kicker { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--standby); padding: 3px 8px; border-radius: 999px; background: var(--standby-bg); white-space: nowrap; }
/* Accounts in database: copies of the account's trades on other accounts */
.dba-cpy-hint { margin: 0 0 8px; }
.dba-cpy { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "m pl" "sw sw"; gap: 6px 12px; padding: 9px 12px; font-size: 12.5px; }
.dba-cpy + .dba-cpy { border-top: 1px solid var(--line-soft); }
.dba-cpy-main { grid-area: m; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dba-cpy-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dba-cpy-main small { font-size: 11px; color: var(--txt-faint); }
.dba-cpy-pl { grid-area: pl; font-family: 'JetBrains Mono', monospace; align-self: center; }
.dba-cpy-pl.up { color: var(--up); } .dba-cpy-pl.down { color: var(--down); }
.dba-cpy.off .dba-cpy-pl { color: var(--txt-faint); text-decoration: line-through; }
.dba-cpy-sw { grid-area: sw; display: flex; gap: 16px; flex-wrap: wrap; }
.dba-cpy-sw label { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--txt-dim); cursor: pointer; }
/* Settings → Server: requests */
.srv-req { gap: 10px; }
.srq-kpis { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.srq-kpis span { display: flex; flex-direction: column; gap: 1px; }
.srq-kpis b { font-family: 'JetBrains Mono', monospace; font-size: 15px; color: var(--txt); }
.srq-kpis small { font-size: 11px; color: var(--txt-faint); }
.srq-kpis .warn b { color: #c98500; }
.srq-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.srq-cols h5 { margin: 0 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--txt-dim); }
.srq-cols h5 small { text-transform: none; letter-spacing: 0; color: var(--txt-faint); font-weight: 500; }
.srq-row { display: grid; grid-template-columns: minmax(0, 1fr) 54px auto; grid-template-areas: "n bar v" "s s s"; gap: 0 8px; align-items: center; padding: 4px 0; font-size: 12px; }
.srq-row + .srq-row { border-top: 1px solid var(--line-soft); }
.srq-name { grid-area: n; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--txt); }
.srq-bar { grid-area: bar; height: 5px; border-radius: 3px; background: var(--line-soft); overflow: hidden; }
.srq-bar i { display: block; height: 100%; background: var(--standby); border-radius: 3px; }
.srq-row b { grid-area: v; font-family: 'JetBrains Mono', monospace; font-size: 11.5px; text-align: right; }
.srq-row small { grid-area: s; font-size: 10.5px; color: var(--txt-faint); }
@media (max-width: 760px) { .srq-cols { grid-template-columns: 1fr; } }
/* Event tracker: the details of a change wrap instead of being cut off */
.ev-main small { white-space: normal; overflow-wrap: anywhere; }
.ev-modal { max-width: none; }

/* ===== v3.2.8 — main page: the instrument's price above the map ===== */
.live-chart { --bc-gut: 64px; padding: 12px 14px 10px; border-bottom: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 8px; }
.live-chart[hidden] { display: none; }
.layout:not(.no-selection) .live-chart { display: none; }
.lc-head { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; }
.lc-sym { display: flex; flex-direction: column; gap: 1px; }
.lc-sym b { font-size: 14px; } .lc-sym small { font-size: 10.5px; color: var(--txt-faint); }
.lc-px { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.lc-px b { font-family: 'JetBrains Mono', monospace; font-size: 17px; }
.lc-px em { font-style: normal; font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.lc-px em.up { color: var(--up); } .lc-px em.down { color: var(--down); }
.lc-px small { font-size: 10.5px; color: var(--txt-faint); }
.lc-chart { touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.lc-chart .bc-plot { height: 314px; cursor: crosshair; }
.lc-chart:active .bc-plot { cursor: grabbing; }
.lc-chart .lc-ticks { position: relative; height: 18px; margin: 4px var(--bc-gut) 0 0; cursor: grab; }
.live-chart .lc-ticks > span.day { color: var(--txt-dim); font-weight: 700; }
.bl-card .srv-kv a.bl-pdf { margin-left: 8px; font-size: 10.5px; font-weight: 700; color: var(--standby); text-decoration: none; padding: 1px 7px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--standby) 40%, transparent); }
.bl-card .srv-kv a.bl-pdf:hover { background: color-mix(in srgb, var(--standby) 12%, transparent); }
.lc-line { fill: none; stroke: var(--standby); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.lc-empty { padding: 30px 10px; text-align: center; font-size: 12px; color: var(--txt-faint); }
@media (max-width: 600px) { .lc-chart .bc-plot { height: 290px; } }
/* Settings → Advanced → Billing */
.bl { display: flex; flex-direction: column; gap: 10px; }
.bl-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bl-h { margin: 10px 0 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--txt-dim); }
.bl-card .srv-kv a { margin-left: 6px; font-size: 11px; }
.bl-keys { gap: 10px; }
.bl-form { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 6px 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.bl-form > b { grid-column: 1; font-size: 12.5px; }
.bl-form > small { grid-column: 1; font-size: 10.5px; color: var(--txt-faint); }
.bl-form > input, .bl-form > select { grid-column: 2; }
.bl-acts { grid-column: 2; display: inline-flex; gap: 6px; }
@media (max-width: 600px) { .bl-form { grid-template-columns: 1fr; } .bl-form > * { grid-column: 1 !important; } }

/* ===== v3.2.9 — Accounts in database: imports as cards, one switch each ===== */
.dba-sec .dba-imps { display: flex; flex-direction: column; gap: 8px; border: none; background: none; overflow: visible; }
.dba-cpy { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "m pl sw"; align-items: center; gap: 4px 16px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-soft); background: var(--panel); transition: opacity .2s, background .2s; }
.dba-cpy + .dba-cpy { border-top: 1px solid var(--line-soft); }
.dba-cpy-main { gap: 3px; }
.dba-cpy-main small { font-size: 11px; }
.dba-cpy-pl { font-size: 13px; }
.dba-cpy-sw { grid-area: sw; display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--txt-dim); cursor: pointer; white-space: nowrap; min-width: 92px; justify-content: flex-end; }
.dba-cpy.off { background: var(--sunken); }
.dba-cpy.off .dba-cpy-main, .dba-cpy.off .dba-cpy-pl { opacity: .55; }
@media (max-width: 520px) { .dba-cpy { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "m sw" "pl pl"; } .dba-cpy-pl { justify-self: start; } }
/* Live chart: whose trades, looking back */
.lc-trbtn b { margin-left: 4px; font-family: 'JetBrains Mono', monospace; }
.lc-trbtn.on { border-color: var(--standby); color: var(--standby); }
.lc-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-soft); background: var(--sunken); }
.lc-pick .field-hint { margin: 0; min-height: 0; }
.lc-acc { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-soft); background: var(--panel); font-size: 12px; cursor: pointer; }
.lc-acc input { margin: 0; accent-color: var(--standby); }
.lc-more { position: absolute; left: 8px; top: 6px; z-index: 3; font-size: 10.5px; color: var(--txt-faint); background: var(--panel); padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-soft); }
.lc-plot .bc-pl { font-size: 10px; }
/* Time axis labels: every one centred on its moment, first and last too
   (the generic first / last rules pushed them off the line). */
.live-chart .lc-ticks > span, .live-chart .lc-ticks > span:first-child, .live-chart .lc-ticks > span:last-child { transform: translateX(-50%); white-space: nowrap; }
@media (pointer: coarse) {
  .bdx-chart .bd-chart > .tl-ticks > span:first-child:not(.first), .bdx-chart .bd-chart > .tl-ticks > span:last-child:not(.last) { transform: translate(-50%, -50%); }
}

/* ===== v3.3.0 — card titles keep their words apart; billing ===== */
.srv-card h4 { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.bl-st { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--txt-faint); }
.bl-st i { width: 7px; height: 7px; border-radius: 50%; background: var(--txt-faint); }
.bl-st.on { color: var(--up); } .bl-st.on i { background: var(--up); box-shadow: 0 0 0 3px color-mix(in srgb, var(--up) 18%, transparent); }
.bl-st.bad { color: var(--down); } .bl-st.bad i { background: var(--down); }
.bl-exp { margin-left: auto; font-size: 10.5px; font-weight: 600; color: var(--txt-faint); padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line-soft); }
.bl-exp.warn { color: #c98500; border-color: color-mix(in srgb, #c98500 40%, transparent); }
.bl-bar.ro { justify-content: flex-end; }
.bl-keys { padding: 0; display: block; }
.bl-keys > summary { list-style: none; cursor: pointer; padding: 14px 16px; display: flex; align-items: center; }
.bl-keys > summary::-webkit-details-marker { display: none; }
.bl-keys > summary h4 { margin: 0; flex: 1; }
.bl-keys > summary::after { content: ''; width: 8px; height: 8px; border-right: 2px solid var(--txt-faint); border-bottom: 2px solid var(--txt-faint); transform: rotate(45deg); transition: transform .2s; margin-left: 10px; }
.bl-keys[open] > summary::after { transform: rotate(-135deg); }
.bl-keys > .bl-form, .bl-keys > .mw-err { margin: 0 16px; }
.bl-keys > .bl-form:last-of-type { margin-bottom: 14px; }
.bl-date { grid-column: 2; display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--txt-faint); }
.bl-date input { max-width: 170px; }
/* Form controls use the page's font everywhere (some selects fell back to
   the browser's serif default on phones). */
:where(select, textarea, input) { font-family: inherit; }

/* ===== v3.3.1 — price chart: one clean frame, the scale inside it ===== */
.live-chart { --bc-gut: 58px; gap: 10px; padding: 14px 16px 12px; }
.lc-head { align-items: flex-end; justify-content: space-between; gap: 6px 16px; }
.lc-px { justify-content: flex-end; }
.lc-st { display: inline-flex; align-items: center; gap: 5px; }
.lc-st i { width: 6px; height: 6px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 3px color-mix(in srgb, var(--up) 16%, transparent); }
.lc-st.closed { color: var(--txt-dim); }
.lc-st.closed i { background: var(--txt-faint); box-shadow: none; }
.lc-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lc-bar-r { margin-left: auto; display: inline-flex; gap: 6px; }
.lc-chip { height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-soft); background: transparent; color: var(--txt-dim); font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.lc-chip:hover { color: var(--txt); border-color: var(--line); }
.lc-chip.on { color: var(--standby); border-color: color-mix(in srgb, var(--standby) 45%, transparent); background: color-mix(in srgb, var(--standby) 8%, transparent); }
.lc-chip b { margin-left: 3px; font-family: 'JetBrains Mono', monospace; }
.live-chart .lc-chart { border: 1px solid var(--line-soft); border-radius: 12px; background: var(--panel); overflow: hidden; }
.live-chart .lc-chart .bc-plot { border: 0; border-radius: 0; background: none; }
.live-chart .lc-chart .bc-axis { border: 0; border-left: 1px solid var(--line-soft); border-radius: 0; background: none; cursor: ns-resize; touch-action: none; }
.live-chart .lc-chart .bc-axis .bc-y { left: auto; right: 8px; }
.live-chart .lc-chart .bc-tag { left: 0; right: 0; border-radius: 0; padding: 2px 8px 2px 0; text-align: right; }
.live-chart .lc-chart .bc-tag.off { opacity: .55; }
.live-chart .lc-chart .lc-ticks { margin: 0; padding-right: var(--bc-gut); height: 24px; border-top: 1px solid var(--line-soft); }
.live-chart .lc-chart .lc-ticks > span { top: 50%; transform: translate(-50%, -50%); }
/* Market closed: a break between candles, and after the last one */
.lc-gap { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed color-mix(in srgb, var(--txt-dim) 60%, transparent); z-index: 1; }
.lc-gap::before { content: ''; position: absolute; top: 0; bottom: 0; left: -6px; width: 12px; }
.lc-closed { position: absolute; top: 0; bottom: 0; right: 0; z-index: 1; border-left: 1px dashed color-mix(in srgb, var(--txt-faint) 55%, transparent);
  background: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--txt-faint) 9%, transparent) 6px 7px); display: flex; align-items: flex-start; justify-content: center; overflow: hidden; }
.lc-closed { container-type: inline-size; }
@container (max-width: 96px) { .lc-closed small { display: none; } }
.lc-closed small { margin-top: 8px; font-size: 9.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--txt-faint); background: var(--panel); padding: 1px 6px; border-radius: 999px; white-space: nowrap; }
/* Yesterday's high / low */
.lc-pd { stroke-width: 1; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; }
.lc-pd.yh { stroke: var(--brk-hi); } .lc-pd.yl { stroke: var(--brk-lo); }
.lc-pd-lbl { position: absolute; left: 8px; transform: translateY(-115%); font-size: 9.5px; font-weight: 700; pointer-events: none; z-index: 1; }
.lc-pd-lbl.yh { color: var(--brk-hi); } .lc-pd-lbl.yl { color: var(--brk-lo); transform: translateY(15%); }
.bc-tag.yh { background: var(--brk-hi); } .bc-tag.yl { background: var(--brk-lo); }
/* Back to the latest candles: the corner under the price scale */
.live-chart .lc-chart { position: relative; }
.lc-now { position: absolute; right: 0; bottom: 0; z-index: 4; width: var(--bc-gut); height: 24px; display: grid; place-items: center; padding: 0; margin: 0;
  border: 0; border-left: 1px solid var(--line-soft); border-top: 1px solid var(--line-soft); border-radius: 0; background: var(--panel); color: var(--standby); cursor: pointer; }
.lc-now:hover { background: color-mix(in srgb, var(--standby) 10%, var(--panel)); }
.lc-now svg { width: 14px; height: 14px; }
/* Chart settings */
.lc-cfg-btn { margin-left: auto; width: 30px; height: 26px; display: grid; place-items: center; padding: 0; border-radius: 8px; border: 1px solid var(--line-soft); background: transparent; color: var(--txt-dim); cursor: pointer; position: relative; }
.lc-cfg-btn svg { width: 16px; height: 16px; }
.lc-cfg-btn:hover, .lc-cfg-btn.open { color: var(--txt); border-color: var(--line); background: var(--sunken); }
.lc-cfg-btn.set::after { content: ''; position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--standby); }
.live-chart .lc-pick { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 4px 14px; }
.lc-pick-h { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; }
.lc-pick-h b { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--txt-dim); }
.lc-pick-h .na-dialog-x { position: static; }
.lc-opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); cursor: pointer; }
.lc-opt.col { flex-direction: column; align-items: stretch; cursor: default; gap: 8px; }
.lc-opt > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lc-opt b { font-size: 12.5px; } .lc-opt small { font-size: 11px; color: var(--txt-faint); }
.lc-accs { display: flex; flex-wrap: wrap; gap: 6px 8px; }
@media (max-width: 600px) {
  .live-chart { --bc-gut: 50px; padding: 12px 12px 10px; }
  .lc-head { align-items: flex-start; flex-direction: column; }
  .lc-px { justify-content: flex-start; }
  .lc-bar .seg-sm button { padding-left: 8px; padding-right: 8px; }
}
/* Billing: what the page is about, this month's totals */
.bl-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-soft); background: var(--panel); }
.bl-intro-txt { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bl-intro-txt > b { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--txt-dim); }
.bl-intro-txt > small { font-size: 11.5px; color: var(--txt-faint); line-height: 1.45; }
.bl-tot { display: flex; flex-wrap: wrap; gap: 6px 18px; font-family: 'JetBrains Mono', monospace; font-size: 18px; font-weight: 700; color: var(--txt); }
.bl-tot > span { display: inline-flex; align-items: baseline; gap: 6px; }
.bl-tot small { font-family: 'Space Grotesk', system-ui, sans-serif; font-size: 11px; font-weight: 600; color: var(--txt-faint); }
.bl-tot .dim { font-size: 12px; font-weight: 500; font-family: inherit; }
/* Accounts list: no empty strip between the last account and the status line */
.fleet > .bot-list { padding-bottom: 0; }
.fleet > .fleet-footer { padding-top: 10px; padding-bottom: 12px; }
.bd-note { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0 0; padding: 8px 12px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--standby) 30%, transparent); background: color-mix(in srgb, var(--standby) 7%, transparent); font-size: 12px; color: var(--txt-dim); line-height: 1.45; }
.bd-note svg { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--standby); }
.bd-note b { color: var(--txt); }
/* v3.3.3 — day separators; no text selection / magnifier on charts (iOS) */
.lc-day { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed color-mix(in srgb, var(--txt-faint) 38%, transparent); pointer-events: auto; }
.lc-gap { border-left-width: 1.5px; }
.live-chart, .live-chart *, .bc-wrap, .bc-wrap *, .tl-ticks, .srv-chart, .srv-chart *, .bd-chart, .bd-chart *, .tl, .tl * {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.live-chart input, .live-chart label { -webkit-user-select: none; }
.live-chart .lc-head { flex-direction: row; flex-wrap: nowrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.lc-l { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 18px; min-width: 0; }
.live-chart .lc-px { justify-content: flex-start; }
.live-chart .lc-st { margin-left: auto; font-size: 10.5px; color: var(--txt-faint); white-space: nowrap; text-align: right; }
@media (max-width: 600px) { .lc-l { flex-direction: column; align-items: flex-start; gap: 4px; } .live-chart .lc-head { flex-direction: row; align-items: flex-end; } }
/* Settings → Server: requests per hour, a line per user / EA */
.srq-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 10px 0; }
.srq-chart { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-soft); background: var(--panel); min-width: 0; }
.srq-ch { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.srq-ch > b { font-size: 12.5px; }
.srq-keys { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; color: var(--txt-dim); }
.srq-keys > span { display: inline-flex; align-items: center; gap: 5px; }
.srq-keys i, .srq-chart .sc-tip i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.srq-keys b { color: var(--txt); font-family: 'JetBrains Mono', monospace; font-weight: 600; }
.srq-plot { position: relative; height: 120px; }
.srq-plot svg { width: 100%; height: 100%; display: block; overflow: visible; }
.srq-plot path { fill: none; stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.srq-max { position: absolute; left: 0; top: -2px; font-size: 9.5px; color: var(--txt-faint); font-family: 'JetBrains Mono', monospace; }
.srq-chart .sc-axis { display: flex; justify-content: space-between; }
.srq-chart .sc-tip span { display: flex; align-items: center; gap: 5px; }
.srq-cols.one { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 760px) { .srq-charts { grid-template-columns: minmax(0, 1fr); } }
.sa-pers { display: inline-flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.zoom-reset[hidden] { display: none; }
/* Storage: two rings (app folder, database) with their legends */
.st-viz { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 8px; }
.st-panel { display: flex; align-items: center; gap: 16px; padding: 12px; border-radius: 10px; border: 1px solid var(--line-soft); background: var(--panel); min-width: 0; }
.st-ring { width: 120px; height: 120px; flex: none; }
.st-ring-bg { stroke: var(--sunken); }
.st-ring-v { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; fill: var(--txt); }
.st-ring-l { font-size: 7px; fill: var(--txt-faint); text-transform: uppercase; letter-spacing: .06em; }
.st-leg { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; }
.st-li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 44px; align-items: baseline; gap: 8px; font-size: 12px; }
.st-li i { width: 10px; height: 10px; border-radius: 3px; align-self: center; }
.st-li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-li small { margin-left: 6px; font-size: 10.5px; color: var(--txt-faint); }
.st-li b { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; }
.st-li em { font-style: normal; font-size: 10.5px; color: var(--txt-faint); text-align: right; }
.st-out { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-top: 10px; font-size: 11.5px; color: var(--txt-dim); }
.st-out > small { color: var(--txt-faint); text-transform: uppercase; letter-spacing: .05em; font-size: 10.5px; }
.st-out b { font-family: 'JetBrains Mono', monospace; color: var(--txt); font-weight: 600; }
.st-out em { font-style: normal; color: var(--txt-faint); font-size: 10.5px; }
@media (max-width: 900px) { .st-viz { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 420px) { .st-panel { flex-direction: column; align-items: stretch; } .st-ring { align-self: center; } }
.srq-chart.wide { grid-column: 1 / -1; }
.srq-keys small { margin-left: 4px; font-size: 10px; color: var(--txt-faint); }
.srv-pick { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 8px; }
.lc-day.brk { border-left-color: color-mix(in srgb, var(--txt-dim) 45%, transparent); }
/* Connection downtime: the period and the "+ maintenance window" buttons stand out from the card, quietly */
#dt-days-seg { background: var(--panel); border: 1px solid var(--line); }
#dt-days-seg button:not(.on) { color: var(--txt-dim); }
.btn.small[data-dt-add], .dt-wchip.add { background: transparent; border: 1px dashed color-mix(in srgb, var(--standby) 55%, transparent); color: var(--standby); font-weight: 600; }
.btn.small[data-dt-add]:hover, .dt-wchip.add:hover { background: color-mix(in srgb, var(--standby) 8%, transparent); border-style: solid; }
.srv-bar-r { display: inline-flex; align-items: center; gap: 8px; }
.srv-bar-r .lc-cfg-btn { margin-left: 0; }
.srv-cfg-pick { display: flex; flex-direction: column; padding: 4px 14px; margin-bottom: 8px; border-radius: 10px; border: 1px solid var(--line-soft); background: var(--panel); }
.srv-cfg-pick .lc-pick-h small { font-size: 10.5px; color: var(--txt-faint); }
.srv-cfg-pick .lc-opt { padding: 8px 0; }
/* Cards with the main figures first; the rest folds out */
.xcard:not(.expanded) .xtra { display: none; }
.xmore { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 3px 2px; border: 0; background: none; color: var(--standby); font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; }
.xmore small { font-size: 10px; color: var(--txt-faint); font-weight: 600; }
.xmore i { width: 6px; height: 6px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg) translate(-1px, -1px); transition: transform .2s; }
.xcard.expanded .xmore i { transform: rotate(-135deg) translate(-1px, -1px); }
.set-sec.xcard { display: flex; flex-direction: column; }
/* Candles | Line on the right, beside the settings button */
.live-chart .lc-bar .lc-type { margin-left: auto; }
.live-chart .lc-bar .lc-cfg-btn { margin-left: 0; }
/* Header as on trading platforms: the symbol and what it is on one line,
   the price large below it with the day's change; live / closed on the right. */
.live-chart .lc-head { align-items: flex-end; }
.live-chart .lc-l { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.live-chart .lc-sym { flex-direction: row; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.live-chart .lc-sym b { font-size: 14px; letter-spacing: .01em; }
.live-chart .lc-sym small { font-size: 11px; }
.live-chart .lc-px { align-items: baseline; gap: 10px; }
.live-chart .lc-px b { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.live-chart .lc-px em { font-size: 12.5px; font-weight: 600; }
@media (max-width: 600px) { .live-chart .lc-px b { font-size: 20px; } }
/* Phones: the instrument and its price stacked, left-aligned (as before) */
@media (max-width: 600px) { .lc-l { align-items: flex-start; } .live-chart .lc-head { align-items: flex-end; } }
/* Price header (final), the same on a computer and a phone: the instrument
   and what it is on one line, the price large below it with the day's change,
   live / closed on the right. */
.live-chart .lc-head { align-items: flex-end; }
.live-chart .lc-l { flex-direction: column; align-items: flex-start; gap: 2px; }
.live-chart .lc-sym { flex-direction: row; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.live-chart .lc-sym b { font-size: 15px; }
.live-chart .lc-sym small { font-size: 12px; }
.live-chart .lc-px b { font-size: 24px; }
@media (max-width: 600px) { .live-chart .lc-px b { font-size: 21px; } }
/* Uptime thresholds: Save on the line of the two fields (phones too); the colour key under the text */
.dt-th-row { flex-wrap: nowrap; }
@media (max-width: 600px) { .dt-th-row { gap: 10px 12px; } .dt-th-f input { width: 84px; } .dt-th-act { margin-left: auto; width: auto; } #th-msg:empty { display: none; } }
/* Period choices on the right (Server, Strategy analysis, …) */
.srv-bar .srv-bar-r { margin-left: auto; }
.sa-top { justify-content: flex-end; }
.sa-top .sa-src { margin-right: auto; }
.sa-pers { margin-left: auto; }
@media (max-width: 600px) { .srv-bar .srv-bar-r { margin-left: auto; } .srv-bar .seg { margin-left: 0; } .sa-pers { width: 100%; justify-content: flex-end; } }
/* Price chart: every day's high / low */
.lc-dhl { fill: none; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.lc-dhl.h { stroke: var(--up); } .lc-dhl.l { stroke: var(--down); }
.lc-dhl.fin { stroke-width: 1; opacity: .75; }
.lc-9 { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: #2f6fed; transform: translate(-50%, 9px); pointer-events: auto; z-index: 2; }
#lc-yhl { flex: none; }
.lc-dhl.old { opacity: .32; stroke-width: 1; }
.lc-dhl.fin { opacity: .45; }
.lc-dhl.now { stroke-width: 1.6; opacity: 1; }
/* Choices inside the chart settings stand out from the panel */
.lc-pick .seg { background: var(--panel); border: 1px solid var(--line); }
.lc-pick .seg button:not(.on) { color: var(--txt-dim); }
/* Server: features in one line; what an EA goes without */
.srv-card .srv-kv.sub span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srv-card .srv-kv.sub b { white-space: nowrap; flex: none; }
.srv-miss { display: block; margin-top: 2px; font-size: 10.5px; color: #c98500; line-height: 1.35; }
.srv-miss em { font-style: normal; color: var(--txt-faint); }
.srv-ea > span { min-width: 0; }
/* Charts shown: a heading with its note, the switches in two columns */
.srv-cfg-pick .lc-pick-h { justify-content: flex-start; }
.srv-cfg-pick .lc-pick-h > span { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.srv-cfg-pick .lc-pick-h small { text-transform: none; letter-spacing: 0; }
.srv-cfg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
.srv-cfg-grid .lc-opt { justify-content: space-between; text-align: left; }
.srv-cfg-grid .lc-opt b { font-size: 12.5px; }
@media (max-width: 420px) { .srv-cfg-grid { column-gap: 12px; } .srv-cfg-grid .lc-opt b { font-size: 12px; } }
.srv-ea .srv-miss { white-space: normal; }
.srv-cfg-pick, .srv-cfg-pick * { text-align: left; }
.srv-cfg-pick .lc-opt { display: flex; align-items: center; }
/* Large chart: previous / next beside the verdict */
.bdx-nav { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; }
.bdx-nav small { font-size: 11px; color: var(--txt-faint); font-family: 'JetBrains Mono', monospace; min-width: 44px; text-align: center; }
.bdx-nav .dt-ib { width: 28px; height: 28px; font-size: 17px; line-height: 1; }
.bdx-nav .dt-ib:disabled { opacity: .35; cursor: default; }
/* Trade analyzer: advanced trade stats */
.bdx-adv .bdx-kv b small { font-weight: 500; color: var(--txt-faint); }
.bdx-adv-nums { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--down); padding: 2px 0 6px; word-break: break-word; }
.bdx-adv-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 10px 0 4px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--txt-dim); }
.bdx-adv-h small { text-transform: none; letter-spacing: 0; color: var(--txt-faint); }
.bdx-adv-h label { display: inline-flex; align-items: center; gap: 6px; text-transform: none; letter-spacing: 0; font-size: 11.5px; }
.bdx-adv-h input { width: 52px; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--txt); font-size: 12px; }
.srv-cfg-pick { align-items: stretch; }
.srv-ea .srv-miss { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.bdx-lock { position: fixed; left: 0; right: 0; width: 100%; overflow: hidden; }
.bdx-dialog { overscroll-behavior: contain; }
/* A tall (portrait) screen: the large chart grows with the window */
@media (min-width: 761px) and (max-aspect-ratio: 4/5) {
  .bdx-dialog { height: calc(var(--vh100, 100vh) - 48px); }
}
.bdx-cdl { display: inline-block; width: 6px; height: 11px; border-radius: 1.5px; margin: 0 4px 0 6px; vertical-align: -1px; background: var(--txt-faint); }
.bdx-cdl.up { background: var(--up); } .bdx-cdl.down { background: var(--down); }
.bdx-cl { font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.bdx-cl.up { color: var(--up); } .bdx-cl.down { color: var(--down); }
.bdx-avg { color: var(--txt); }
.bdx-adv .bdx-kv:has(.bdx-avg) { border-top: 1px dashed var(--line-soft); padding-top: 4px; }
.bdx-wk { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 3px 10px; align-items: baseline; font-size: 11.5px; }
.bdx-wk .h { font-size: 10px; color: var(--txt-faint); }
.bdx-wk .h:not(:first-child) { text-align: right; }
.bdx-wk > b { font-family: 'JetBrains Mono', monospace; font-size: 11px; text-align: right; font-weight: 600; }
.bdx-wk > span:not(.h) { white-space: nowrap; color: var(--txt-dim); }
.bdx-wk .avg { border-top: 1px dashed var(--line-soft); padding-top: 3px; color: var(--txt); }
/* Strategy analysis: breakout or retest */
.sa-appr { display: grid; grid-template-columns: minmax(0, 1fr) repeat(5, auto); gap: 6px 14px; align-items: baseline; font-size: 12px; }
.sa-appr .h { font-size: 10px; color: var(--txt-faint); text-transform: uppercase; letter-spacing: .05em; }
.sa-appr > span:not(:nth-child(6n+1)) { text-align: right; font-family: 'JetBrains Mono', monospace; font-size: 11.5px; }
.sa-appr > span:nth-child(6n+1) small { display: block; font-size: 10.5px; color: var(--txt-faint); }
.sa-appr .up { color: var(--up); } .sa-appr .down { color: var(--down); }
.sa-side { font-style: normal; font-weight: 700; margin-right: 4px; }
.sa-side.buy { color: var(--up); } .sa-side.sell { color: var(--down); }
#sa-lb { margin-left: auto; }
.bdx-adv .bdx-kv b .up { color: var(--up); } .bdx-adv .bdx-kv b .down { color: var(--down); }
@media (max-width: 600px) { .sa-appr { gap: 6px 8px; font-size: 11px; } .sa-appr > span:not(:nth-child(6n+1)) { font-size: 10.5px; } }
/* Run-up to the entry */
.bdx-ru { display: grid; grid-template-columns: minmax(0, auto) auto 1fr 1fr 1fr; gap: 3px 10px; align-items: baseline; font-size: 11.5px; }
.bdx-ru .h { font-size: 10px; color: var(--txt-faint); }
.bdx-ru .h:nth-child(n+3) { text-align: right; }
.bdx-ru > b { font-family: 'JetBrains Mono', monospace; font-size: 11px; text-align: right; font-weight: 600; }
.bdx-ru > b.up { color: var(--up); } .bdx-ru > b.down { color: var(--down); }
.bdx-ru > span:not(.h) { color: var(--txt-dim); white-space: nowrap; }
.bdx-ru .ru-k { text-align: left; font-family: inherit; font-size: 10.5px; padding: 0 6px; border-radius: 999px; }
.bdx-ru .ru-k.b { color: var(--up); background: color-mix(in srgb, var(--up) 12%, transparent); }
.bdx-ru .ru-k.r { color: #c98500; background: color-mix(in srgb, #c98500 14%, transparent); }
.bdx-ru .ru-k.a, .bdx-ru .ru-k.u { color: var(--txt-dim); background: var(--sunken); }
.bdx-sim-m { margin: 2px 0 6px; background: var(--panel); border: 1px solid var(--line); }
.bdx-sim-m button:not(.on) { color: var(--txt-dim); }
#bdx-sim-x { width: 52px; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--txt); font-size: 12px; }
.bdx-sim-f { display: flex; flex-direction: column; gap: 6px; margin: 2px 0 6px; font-size: 11.5px; color: var(--txt-dim); }
.bdx-sim-f label { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bdx-sim-f input { width: 52px; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--txt); font-size: 12px; }
/* Large chart header: every control the same height and on one line; the
   view choice (Whole day · Night · AM window) as far from › as from −. The
   title doesn't stretch, so the space left over goes before the ×. */
.bdx-tools > .seg, .bdx-tools #bdx-presets { align-self: center; }
@media (min-width: 761px) {
  .bdx-head { gap: 10px; }
  .bdx-head { justify-content: flex-start; }
  .bdx-title { flex: 0 1 auto; }
  .bdx-tools { gap: 10px; flex: 1 1 auto; }
  .bdx-tools .bdx-x2 { margin-left: auto; }
  .bdx-tools > .seg, .bdx-tools .seg-sm { height: 32px; align-items: stretch; box-sizing: border-box; }
  .bdx-tools > .seg button, .bdx-tools .seg-sm button { display: inline-flex; align-items: center; }
  .bdx-tools .bdx-fit { height: 32px; box-sizing: border-box; display: inline-flex; align-items: center; }
  .bdx-nav { margin-left: 0; }
  .bdx-nav .dt-ib { width: 32px; height: 32px; }
}

/* Simulated close: the best settings (strategy and trade details) */
/* Strategy analysis → Simulations */
#sa-sims { display: flex; flex-direction: column; gap: 16px; }
#sa-sims > .field-hint { margin: 0; }
#sa-sims .set-sec { padding: 16px 18px; gap: 12px; }
#sa-sims .set-sec-head { row-gap: 6px; }
#sa-sims .set-sec-head small { flex-basis: 100%; line-height: 1.45; }
#sa-sims .set-sec-head .seg { margin-left: auto; }
.sa-fhead { margin-top: 8px; }
.sa-sim { display: grid; grid-template-columns: minmax(220px, 1fr) repeat(5, auto); gap: 0; align-items: baseline; font-size: 12px; }
.sa-sim > span, .sa-simrow > span { padding: 7px 8px; }
.sa-sim .h { font-size: 10px; color: var(--txt-faint); text-transform: uppercase; letter-spacing: .05em; padding-top: 0; }
.sa-sim .v { text-align: right; font-family: 'JetBrains Mono', monospace; font-size: 11.5px; white-space: nowrap; }
.sa-sim .s small { display: block; font-size: 10.5px; color: var(--txt-faint); margin-top: 2px; }
.sa-sim .v small.up, .sa-sim .v small.down { font-size: 10px; margin-left: 3px; }
.sa-sim .up { color: var(--up); } .sa-sim .down { color: var(--down); }
.sa-sim > .sa-sim-none { grid-column: 1 / -1; color: var(--txt-faint); padding: 10px 8px; }
.sa-simrow { display: contents; cursor: pointer; }
.sa-simrow > span { align-self: stretch; border-top: 1px solid var(--line-soft); transition: background .12s; }
.sa-simrow:hover > span { background: var(--hover); }
.sa-simrow.on > span { background: rgba(127, 127, 127, .12); }
.sa-simrow.on .sl { font-weight: 600; }
.sa-simrow:focus-visible { outline: none; }
.sa-simrow:focus-visible > span { background: rgba(127, 127, 127, .14); }
.sa-simrow .s { display: flex; gap: 9px; align-items: flex-start; }
.sa-inc { display: inline-flex; padding: 1px 0 0; cursor: pointer; }
.sa-inc input { width: 15px; height: 15px; margin: 0; accent-color: var(--backtest); cursor: pointer; }
.sa-curve { grid-column: 1 / -1; padding: 8px 8px 16px; }
.sa-curve-c svg { height: 190px; }
.sa-curve-c .sa-c-real { fill: none; stroke: var(--txt-faint); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.sa-curve-c .sa-c-sim { fill: none; stroke: var(--backtest); stroke-width: 2; vector-effect: non-scaling-stroke; }
.sa-curve-k { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 11.5px; margin-top: 8px; }
.sa-curve-k i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; background: var(--txt-faint); }
.sa-curve-k i.sim { background: var(--backtest); }
.sa-curve-k small { color: var(--txt-faint); margin-left: 4px; }
#sa-tab { margin-right: 6px; }
/* the combination */
.sa-cmb { border-color: color-mix(in srgb, var(--backtest) 35%, var(--line-soft)); }
.sa-cmb-clear { margin-left: auto; font: inherit; font-size: 11.5px; color: var(--txt-dim); background: none; border: 1px solid var(--line-soft); border-radius: 999px; padding: 2px 10px; cursor: pointer; }
.sa-cmb-clear:hover { color: var(--txt); border-color: var(--txt-faint); }
.sa-cmb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sa-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; padding: 4px 4px 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--backtest) 12%, transparent); border: 1px solid color-mix(in srgb, var(--backtest) 40%, transparent); max-width: 100%; }
.sa-chip button { font: inherit; line-height: 1; width: 20px; height: 20px; border-radius: 50%; border: 0; background: none; color: var(--txt-dim); cursor: pointer; flex: none; }
.sa-chip button:hover { background: var(--hover); color: var(--txt); }
.sa-cmb-k { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.sa-cmb-t { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sa-cmb-t small { font-size: 10px; color: var(--txt-faint); text-transform: uppercase; letter-spacing: .05em; }
.sa-cmb-t b { font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 600; }
.sa-cmb-t b i { font-style: normal; color: var(--txt-faint); margin: 0 2px; }
.sa-cmb-t b.up { color: var(--up); } .sa-cmb-t b.down { color: var(--down); }
.sa-cmb-t em { font-style: normal; font-size: 11px; color: var(--txt-dim); }
.sa-cmb-t em .up { color: var(--up); } .sa-cmb-t em .down { color: var(--down); }
.sa-cmb-alone { display: flex; flex-direction: column; font-size: 12px; }
.sa-cmb-alone > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 2px; border-top: 1px solid var(--line-soft); }
.sa-cmb-alone .sa-cmb-ah { border-top: 0; font-size: 10px; color: var(--txt-faint); text-transform: uppercase; letter-spacing: .05em; }
.sa-cmb-alone b { font-family: 'JetBrains Mono', monospace; font-weight: 600; white-space: nowrap; }
.sa-cmb-alone .up { color: var(--up); } .sa-cmb-alone .down { color: var(--down); }
.sa-cmb-alone .sum span { font-weight: 600; } .sa-cmb-alone .sum small { font-weight: 400; color: var(--txt-faint); }
.sa-cmb-sh { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 4px; }
.sa-cmb-sh b { font-size: 12.5px; } .sa-cmb-sh small { font-size: 11px; color: var(--txt-faint); }
.sa-cmb-al { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.sa-cmb-a { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 5px; }
.sa-cmb-a small { font-size: 10.5px; color: var(--txt-faint); }
.sa-cmb-a b { font-family: 'JetBrains Mono', monospace; font-size: 15px; }
.sa-cmb-a .bar { height: 4px; border-radius: 2px; background: var(--line-soft); overflow: hidden; }
.sa-cmb-a .bar i { display: block; height: 100%; background: var(--backtest); }
@media (max-width: 600px) {
  #sa-sims { gap: 12px; }
  #sa-sims .set-sec { padding: 14px 12px; }
  /* a row: the setting across, its five figures under it */
  .sa-sim { grid-template-columns: repeat(5, minmax(0, 1fr)); font-size: 11.5px; }
  .sa-sim .s, .sa-sim .h.s { grid-column: 1 / -1; }
  .sa-sim .h.s { display: none; }
  .sa-sim > span, .sa-simrow > span { padding: 6px 4px; }
  .sa-sim .h { white-space: normal; line-height: 1.25; font-size: 9px; padding-bottom: 4px; }
  .sa-sim .v { font-size: 10.5px; border-top: 0 !important; padding-top: 0; }
  .sa-sim .v small, .sa-sim .v small.up, .sa-sim .v small.down { display: block; margin-left: 0; }
  .sa-simrow > span.s { padding-top: 10px; }
  .sa-sim > span.s.real { padding-top: 8px; border-top: 1px solid var(--line-soft); }
  .sa-cmb-k, .sa-cmb-al { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .sa-cmb-t b { font-size: 12px; }
}
.bdx-simtop { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 2px 10px; font-size: 11.5px; margin-top: 2px; }
.bdx-simtop .h { font-size: 10px; color: var(--txt-faint); text-transform: uppercase; letter-spacing: .05em; }
.bdx-simtop .h:not(:first-child) { text-align: right; }
.bdx-simrow { display: contents; font: inherit; color: inherit; cursor: pointer; }
.bdx-simrow > * { padding: 3px 0; white-space: nowrap; }
.bdx-simrow > b { text-align: right; font-weight: 500; font-family: 'JetBrains Mono', monospace; font-size: 11px; white-space: nowrap; }
.bdx-simrow:hover > *, .bdx-simrow.on > * { color: var(--txt); }
.bdx-simrow.on > span { font-weight: 600; }
.bdx-simrow .up { color: var(--up); } .bdx-simrow .down { color: var(--down); }

/* Live chart: positions open now */
.lc-pos { stroke-width: 1.2; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; opacity: .9; }
.lc-pos.up { stroke: var(--up); } .lc-pos.down { stroke: var(--down); }
.bc-entry.live { z-index: 4; }
.lc-posl { position: absolute; right: 6px; transform: translateY(-115%); z-index: 4; font-family: 'JetBrains Mono', monospace; font-size: 10.5px; white-space: nowrap; padding: 1px 6px; border-radius: 5px; background: var(--panel); border: 1px solid currentColor; pointer-events: auto; }
.lc-posl.up { color: var(--up); } .lc-posl.down { color: var(--down); }
.lc-posl b { font-weight: 700; }
.lc-posl.off { transform: translateY(-50%); opacity: .85; border-style: dashed; }
.lc-posl small { color: var(--txt-faint); font-size: 9.5px; }
.bc-tag.pos.up { background: var(--up); } .bc-tag.pos.down { background: var(--down); }
.lc-open { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; width: fit-content; margin-top: 3px; }
.lc-open.up { color: var(--up); } .lc-open.down { color: var(--down); }
.lc-open i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: lcOpenPulse 1.6s ease-in-out infinite; }
.lc-open b { font-family: 'JetBrains Mono', monospace; font-weight: 700; }
@keyframes lcOpenPulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .lc-open i { animation: none; } }
@media (max-width: 600px) { .lc-posl { font-size: 9.5px; padding: 1px 4px; right: 3px; } }
/* a sell's ▼ sits above its line: its label goes under it */
.lc-posl.sell:not(.off) { transform: translateY(15%); }
/* Connection strips: a bar with nothing to count (the market closed or
   maintenance all the time) is neutral; today's part still to come is empty. */
.uptime-bar.idle { background: var(--line); opacity: .55; }
.acct-uptime .uptime-bar.idle { background: var(--line); color: var(--line); opacity: .5; box-shadow: none; }
.uptime-bar.idle .ub-out.closed, .uptime-bar.idle .ub-out.maint { background: transparent; }
.ub-future { position: absolute; top: 0; bottom: 0; background: var(--line); pointer-events: none; }
.acct-uptime .uptime-bar .ub-future { background: var(--line); box-shadow: none; }
.uptime-bar.has-segs, .uptime-bar { position: relative; overflow: hidden; }
/* Strategy analysis: figures stay whole; a second part goes under the first */
.sa-kv b .nw, .sa-cmb-t .nw { white-space: nowrap; }
.sa-kv b .nw { color: inherit; }
.sa-kv b { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; column-gap: 4px; }
.sa-kv span:first-child { min-width: 0; }
.sa-cmb-t b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.sa-cmb-t .real { font-size: 11px; color: var(--txt-faint); font-family: 'JetBrains Mono', monospace; }
.sa-cmb-t .real .nw { color: var(--txt-dim); }
.sa-cmb-t small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) { .sa-cmb-t b { font-size: 13.5px; } }
/* Files: a format's file name, renamed in place */
.fl-var .fl-fn { flex: 1 1 auto; min-width: 60px; font: inherit; font-size: 12px; color: var(--txt); background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 3px 6px; margin: -3px 0; text-overflow: ellipsis; }
.fl-var .fl-fn:hover { border-color: var(--line-soft); background: var(--panel); }
.fl-var .fl-fn:focus { outline: none; border-color: var(--txt-faint); background: var(--panel); }
.fl-var.ren { border-color: color-mix(in srgb, var(--trading) 45%, var(--line-soft)); }
.fl-var button { flex: none; }
/* Trade analyzer: Advanced trade stats shown on request */
.bdx-adv h4 { display: flex; align-items: baseline; gap: 6px; }
.bdx-adv-tg { margin-left: auto; font: inherit; font-size: 11px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--txt-dim); background: var(--sunken); border: 1px solid var(--line-soft); border-radius: 999px; padding: 2px 10px; cursor: pointer; }
.bdx-adv-tg:hover { color: var(--txt); border-color: var(--txt-faint); }
.bdx-adv.shut h4 { margin-bottom: 0; }
/* The spread of a position */
.bdx-spr { margin: 2px 0; padding: 4px 0; border-top: 1px dashed var(--line-soft); border-bottom: 1px dashed var(--line-soft); }
.bdx-spr .bdx-kv span small, .bdx-kv span small { color: var(--txt-faint); font-size: 10px; margin-left: 3px; }
.bdx-spr .bdx-kv b small { color: var(--txt-faint); font-weight: 500; margin-left: 3px; }
/* Saved MT5 reports: the name, renamed in place */
.df-main .df-fn { font: inherit; font-weight: 650; font-size: 13px; color: var(--txt); background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 2px 6px; margin: -2px 0 1px -6px; width: 100%; max-width: 460px; text-overflow: ellipsis; }
.df-main .df-fn:hover { border-color: var(--line-soft); background: var(--panel); }
.df-main .df-fn:focus { outline: none; border-color: var(--txt-faint); background: var(--panel); }
.df-main .df-fn.saved { border-color: var(--trading); }
.bdx-spr .bdx-kv b { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; column-gap: 6px; }
.bdx-spr .nw { white-space: nowrap; }
.bdx-spr .bdx-tip { cursor: help; text-decoration: underline dotted var(--line); text-underline-offset: 3px; }
.bdx-spr-sub { text-align: right; font-size: 10.5px; color: var(--txt-faint); margin: -3px 0 2px; font-family: 'JetBrains Mono', monospace; }
/* Duo Push: waiting for the phone */
.login-duo { display: flex; flex-direction: column; gap: 14px; margin: 6px 0 4px; }
.duo-wait { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; row-gap: 3px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--sunken); border: 1px solid var(--line-soft); }
.duo-wait b { font-size: 13.5px; } .duo-wait small { grid-column: 2; font-size: 11.5px; color: var(--txt-faint); }
.duo-wait.big { padding: 16px 18px; } .duo-wait.ok { grid-template-columns: 1fr; border-color: var(--trading); } .duo-wait.ok small { grid-column: 1; }
.duo-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--trading); box-shadow: 0 0 0 0 color-mix(in srgb, var(--trading) 60%, transparent); animation: duoPulse 1.4s ease-out infinite; display: inline-block; }
.login-duo.done .duo-dot, .login-duo .done .duo-dot { animation: none; background: var(--txt-faint); }
@keyframes duoPulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--trading) 55%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }
@media (prefers-reduced-motion: reduce) { .duo-dot { animation: none; } }
.duo-acts { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.duo-setup { display: flex; flex-direction: column; gap: 14px; }
.duo-enroll { display: flex; flex-direction: column; gap: 8px; }
.duo-enroll p { margin: 0; font-size: 13px; }
.duo-qr { width: 200px; height: 200px; image-rendering: pixelated; background: #fff; padding: 8px; border-radius: 10px; border: 1px solid var(--line-soft); align-self: flex-start; }
.fl-code.duo input, .fl-code.duo button[type=submit] { display: none; }
.fl-code .fl-usecode { display: none; }
.fl-code.duo .fl-usecode { display: inline-flex; }
.fl-code.duo span { display: inline-flex; align-items: center; gap: 8px; }
/* Trade analyzer: the position card — entry / exit, the result taken apart, while open */
.bdx-pg { display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line-soft); }
.bdx-ee { display: grid; grid-template-columns: 64px 1fr auto; align-items: baseline; gap: 8px; font-size: 12.5px; }
.bdx-ee span { color: var(--txt-dim); }
.bdx-ee b { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 600; color: var(--txt); white-space: nowrap; }
.bdx-ee b + b { text-align: right; }
.bdx-ee.dur { grid-template-columns: 64px 1fr; border-top: 1px dashed var(--line-soft); padding-top: 3px; margin-top: 2px; }
.bdx-q { display: flex; flex-wrap: wrap; justify-content: flex-end; column-gap: 10px; margin: -1px 0 3px; font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--txt-faint); cursor: help; }
.bdx-pg-h { margin: 8px 0 1px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--txt-dim); }
.bdx-res { display: flex; flex-direction: column; gap: 2px; }
.bdx-res .bdx-kv b { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; column-gap: 8px; }
.bdx-res .bdx-kv b .nw, .bdx-kv b .nw { white-space: nowrap; }
.bdx-res .bdx-tip { cursor: help; text-decoration: underline dotted var(--line); text-underline-offset: 3px; }
.bdx-res-sum { border-top: 1px solid var(--line); padding-top: 3px; margin-top: 1px; }
.bdx-res-sum .bdx-kv span { color: var(--txt); font-weight: 600; }
/* Advanced trade stats, in groups */
.bdx-grp { padding: 4px 0 8px; border-top: 1px solid var(--line-soft); }
.bdx-grp:first-child { border-top: 0; }
.bdx-grp-h { display: flex; flex-direction: column; gap: 1px; margin: 6px 0 4px; }
.bdx-grp-h b { font-size: 12.5px; color: var(--txt); }
.bdx-grp-h small { font-size: 11px; color: var(--txt-faint); }
.bdx-grp .bdx-grp-h + .bdx-adv-h { margin-top: 4px; }
/* Sign-in, the second step: every case laid out the same way */
.login-codebox { display: flex; flex-direction: column; gap: 14px; }
.login-codebox .login-sub { margin-top: -4px; line-height: 1.45; }
.login-codebox label span { color: var(--txt-dim); }
.login-alt { display: flex; flex-direction: column; gap: 10px; }
.login-alt .btn-secondary, .login-duo .btn-secondary { margin-top: 0; }
#login-2fa-form .login-duo { gap: 10px; margin: 2px 0 0; }
#login-2fa-form .duo-wait { min-height: 56px; }
#login-2fa-form .duo-wait small { line-height: 1.4; }
.login-duo.bad .duo-wait { border-color: color-mix(in srgb, var(--blocked) 55%, var(--line-soft)); }
.login-duo.bad .duo-dot { background: var(--blocked); }
#login-2fa-form .login-error { margin-top: -6px; text-align: center; }
#login-2fa-form > .btn-link-plain, #login-2fa-form .login-duo .btn-link-plain, #login-2fa-form .login-codebox .btn-link-plain { align-self: center; }
#login-2fa-form .login-2fa-hint { margin-top: -6px; }
#login-2fa-form #login-2fa-code::placeholder { letter-spacing: 0.5em; color: var(--txt-faint); opacity: .45; }
@media (max-width: 420px) { .login-card { padding: 24px 18px 20px; } #login-2fa-form #login-2fa-code { font-size: 20px; letter-spacing: 0.35em; } }
#login-2fa-form.is-duo .otp-ring { display: none; }
/* Phones and small tablets: portrait only. app.js decides from the device's
   own screen (not the window), so a foldable's near-square inner screen and
   split-screen windows are left alone; html.rotate-on shows the cover. */
.rotate-lock { display: none; }
html.rotate-on .rotate-lock { display: flex; position: fixed; inset: 0; z-index: 2147483000; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; text-align: center; background: var(--bg, #0b0f14); color: var(--txt); }
html.rotate-on .rotate-lock svg { width: 54px; height: 54px; color: var(--trading); animation: rl-turn 2.4s ease-in-out infinite; }
html.rotate-on .rotate-lock b { font-size: 17px; }
html.rotate-on .rotate-lock small { font-size: 13px; color: var(--txt-faint); max-width: 320px; }
html.rotate-on body { overflow: hidden !important; }
@keyframes rl-turn { 0%, 30% { transform: rotate(-90deg); } 60%, 100% { transform: rotate(0deg); } }
@media (prefers-reduced-motion: reduce) { .rotate-lock svg { animation: none; } }
/* Downloads: "View code" on an EA file (locked), and the seconds left (open) */
.fl-fmt.view.locked { display: inline-flex; align-items: center; gap: 5px; color: var(--txt-dim); border-color: var(--line); }
.fl-fmt.view.locked svg { width: 13px; height: 13px; }
.fl-fmt.view .ea-left-s { margin-left: 4px; font-weight: 600; font-variant-numeric: tabular-nums; }
/* Users: disabled profiles and the unused-profiles rule */
.um-tag.bad { color: var(--blocked); border-color: color-mix(in srgb, var(--blocked) 45%, transparent); background: color-mix(in srgb, var(--blocked) 8%, transparent); }
.um-card.um-off > .um-head .um-avatar, .um-card.um-off > .um-head .um-ident { opacity: .55; }
.um-state.off .um-row-lbl small { color: var(--blocked); }
.um-pol { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.um-pol input { width: 76px; text-align: right; }
.um-pol span { color: var(--txt-dim); font-size: 12.5px; }
/* Advanced → Blocked addresses */
.ipb { display: flex; flex-direction: column; gap: 14px; }
.ipb-card { border: 1px solid var(--line-soft); border-radius: 12px; padding: 12px 14px; background: var(--panel); }
.ipb-card h4 { margin: 0 0 6px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.ipb-n { font-size: 11px; font-weight: 600; color: var(--txt-dim); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; }
.ipb-rule { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 6px; }
.ipb-rule label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--txt-dim); white-space: nowrap; }
.ipb-rule input { width: 64px; text-align: right; }
.ipb-ok { color: var(--up); font-size: 12.5px; }
.ipb-add { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 2px; }
.ipb-add input { flex: 1 1 180px; min-width: 0; }
.ipb-me { margin: 4px 0 8px; }
.ipb-list { display: flex; flex-direction: column; gap: 6px; }
.ipb-row { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(0, 2fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line-soft); }
.ipb-row.black { border-color: color-mix(in srgb, var(--blocked) 35%, var(--line-soft)); }
.ipb-ip { display: flex; flex-direction: column; min-width: 0; }
.ipb-ip b { font-size: 12.5px; overflow-wrap: anywhere; }
.ipb-ip small, .ipb-why small { color: var(--txt-faint); font-size: 11.5px; }
.ipb-why { display: flex; flex-direction: column; font-size: 12.5px; min-width: 0; }
.ipb-ea { font-style: normal; font-size: 11.5px; color: #e0a010; }
.ipb-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ipb-tabs { align-self: flex-start; max-width: 100%; overflow-x: auto; }
.ipb-tabs .ipb-n { margin-left: 4px; }
.ipb-devf { margin: 2px 0 10px; max-width: 100%; overflow-x: auto; }
.ipb-me-tag { font-family: var(--font, inherit); font-size: 10.5px; color: var(--accent, #3b82f6); border: 1px solid currentColor; border-radius: 999px; padding: 0 6px; margin-left: 4px; }
.ipb-okn { color: var(--up); } .ipb-failn { color: var(--down, #e5484d); }
.ipb-blk { color: var(--down, #e5484d) !important; }
.ipb-more { margin-top: 8px; }
.ipb-chk { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; margin: 4px 0 10px; cursor: pointer; }
.ipb-chk input { margin-top: 3px; flex: none; }
.ipb-chk small { color: var(--txt-faint); }
@media (max-width: 640px) { .ipb-row { grid-template-columns: 1fr; } .ipb-acts { justify-content: flex-start; } }
/* Advanced → Economic events */
.nr { display: flex; flex-direction: column; gap: 14px; }
.nr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.nr-imp { border: 1px solid var(--line-soft); border-radius: 12px; padding: 12px 14px; background: var(--panel); display: flex; flex-direction: column; gap: 10px; }
.nr-head { display: flex; align-items: center; gap: 8px; }
.nr-head .imp-dot { margin: 0; width: 10px; height: 10px; }
.nr-head b { font-size: 14px; }
.nr-head small { color: var(--txt-faint); font-size: 12px; }
.nr-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.nr-line[hidden] { display: none; }
.nr-lbl { font-size: 12.5px; color: var(--txt-dim); display: flex; flex-direction: column; }
.nr-lbl small { color: var(--txt-faint); font-size: 11px; }
.nr-seg { align-self: auto; }
.nr-mins { font-size: 12.5px; color: var(--txt-dim); white-space: nowrap; }
.nr-mins input { width: 54px; text-align: right; }
.nr-all { cursor: pointer; }
.nr-save { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nr-dirty { color: #e0a010; font-size: 12.5px; }
.nr-prev { border: 1px solid var(--line-soft); border-radius: 12px; padding: 12px 14px; }
.nr-prev h4 { margin: 0 0 8px; font-size: 14px; }
.nr-ev { display: flex; flex-direction: column; gap: 4px; }
.nr-day { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--txt-dim); margin: 8px 0 2px; }
.nr-day:first-child { margin-top: 0; }
.nr-e { display: grid; grid-template-columns: 56px 10px auto minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 12.5px; padding: 3px 0; border-bottom: 1px dashed var(--line-soft); }
.nr-e .imp-dot { margin: 0; }
.nr-t { color: var(--txt-dim); font-size: 11.5px; }
.nr-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nr-eff { text-align: right; color: #e0a010; font-size: 12px; white-space: nowrap; display: flex; flex-direction: column; }
.nr-eff.day { color: var(--blocked); }
.nr-eff small { color: var(--txt-faint); font-size: 10.5px; }
@media (max-width: 560px) { .nr-e { grid-template-columns: 48px 10px auto minmax(0, 1fr); } .nr-eff { grid-column: 1 / -1; text-align: left; } }
/* Settings → This Account as a menu (like Advanced) */
.acct-menu { margin-bottom: 4px; }
.acct-head[hidden], .acct-menu[hidden], #settings-tab-content > .set-card[hidden], #settings-tab-content > .trade-hero[hidden] { display: none !important; }
.set-card.set-card-push { padding: 0; border: 0; background: none; box-shadow: none; }
.set-card.acct-open > .set-card-head { display: none; }
.acct-head { margin-bottom: 12px; }
.bl-more { margin-top: 4px; }
.bl-more > summary { cursor: pointer; font-size: 13px; color: var(--standby); padding: 6px 0; }
/* Advanced → Server access */
.ax { display: flex; flex-direction: column; gap: 12px; }
.ax-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ax-note { flex: 1 1 220px; color: var(--txt-faint); font-size: 11.5px; }
.ax-bar #ax-reload { margin-left: auto; }
.ax-sum { display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--panel); }
.ax-chip { border: 1px solid var(--line); background: var(--bg); color: var(--txt-dim); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.ax-chip small { font-weight: 500; color: var(--txt-faint); margin-left: 4px; }
.ax-chip.on { border-color: var(--standby); color: var(--standby); background: color-mix(in srgb, var(--standby) 8%, transparent); }
.ax-tot { display: inline-flex; align-items: baseline; gap: 6px; }
.ax-tot b { font-size: 18px; font-variant-numeric: tabular-nums; }
.ax-tot small { font-size: 12px; color: var(--txt-faint); }
.ax-tot.bad b { color: var(--blocked); } .ax-tot.ok b { color: var(--up); }
.ax-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; align-items: stretch; }
.ax-card { border: 1px solid var(--line-soft); border-radius: 12px; padding: 10px 12px; background: var(--panel); cursor: pointer; display: flex; flex-direction: column; gap: 8px; transition: border-color .15s, box-shadow .15s; min-width: 0; }
.ax-card:hover { border-color: var(--line); }
.ax-card.on { border-color: var(--standby); box-shadow: 0 0 0 1px var(--standby) inset; }
.ax-card h4 { margin: 0; display: flex; flex-direction: column; font-size: 13.5px; min-width: 0; }
.ax-card h4 span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ax-card h4 small { font-weight: 400; font-size: 11.5px; color: var(--txt-faint); }
.ax-card h4 small.warn { color: #e0a010; }
.ax-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 10px; }
.ax-fig { display: flex; flex-direction: column; min-width: 0; }
.ax-fig b { font-size: 17px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.ax-fig small { font-size: 11px; color: var(--txt-dim); line-height: 1.3; }
.ax-fig em { font-style: normal; font-size: 10.5px; color: var(--txt-faint); }
.ax-fig.bad b { color: var(--blocked); } .ax-fig.ok b { color: var(--up); }
.ax-days { display: flex; align-items: flex-end; gap: 2px; height: 28px; margin-top: auto; }
.ax-days span { flex: 1; height: 100%; display: flex; align-items: flex-end; background: color-mix(in srgb, var(--line-soft) 45%, transparent); border-radius: 2px; }
.ax-days i { display: block; width: 100%; background: color-mix(in srgb, var(--blocked) 70%, transparent); border-radius: 2px; }
.ax-ports { display: flex; flex-wrap: wrap; gap: 3px 10px; font-size: 11px; color: var(--txt-dim); }
.ax-ports b { font-family: 'JetBrains Mono', monospace; font-weight: 600; color: var(--txt); }
.ax-mapcard { border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; background: var(--panel); }
.ax-map { height: 320px; width: 100%; background: var(--sunken); }
.ax-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 7px 12px; font-size: 11.5px; color: var(--txt-dim); }
.ax-legend .d { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.ax-legend .d.bad { background: #e5484d; } .ax-legend .d.ok { background: #22a06b; }
.ax-legend label { display: inline-flex; align-items: center; gap: 0; cursor: pointer; }
.ax-legend label input { margin: 0 6px 0 0; width: 13px; height: 13px; accent-color: var(--accent, #3b82f6); }
.ax-legend .d.ok { box-shadow: 0 0 0 1.5px #fff inset; }
.ax-only { margin-left: auto; color: var(--standby); }
.ax-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 12px; align-items: start; }
.ax-list { border: 1px solid var(--line-soft); border-radius: 12px; padding: 10px 12px; background: var(--panel); min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.ax-list h4 { margin: 0; font-size: 13.5px; display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; }
.ax-list h4 small { font-weight: 400; color: var(--txt-faint); font-size: 11.5px; }
.ax-rows { display: flex; flex-direction: column; }
.ax-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.3fr) auto; grid-template-areas: 'ip what when' 'ip what act'; gap: 0 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line-soft); font-size: 12.5px; }
.ax-row:first-child { border-top: 0; }
.ax-row .ip { grid-area: ip; display: flex; flex-direction: column; min-width: 0; }
.ax-row .what { grid-area: what; display: flex; flex-direction: column; min-width: 0; }
.ax-row .when { grid-area: when; font-size: 11px; color: var(--txt-faint); text-align: right; white-space: nowrap; }
.ax-row .act { grid-area: act; justify-self: end; }
.ax-row .act:empty { display: none; }
.ax-row small { color: var(--txt-faint); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ax-row .ip b { overflow-wrap: anywhere; }
.ax-row.ok .ip b { color: var(--up); }
.ax-row .act .btn { padding: 2px 8px; font-size: 11px; }
.ax-blk { font-style: normal; font-size: 11px; color: var(--blocked); }
.ax-more { align-self: center; }
.ax-more small { color: var(--txt-faint); margin-left: 4px; font-weight: 400; }
.ax-manage { border: 1px solid var(--line-soft); border-radius: 12px; padding: 0 12px; background: var(--panel); }
.ax-manage > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; padding: 11px 0; }
.ax-manage > summary::-webkit-details-marker { display: none; }
.ax-manage > summary > span { display: flex; flex-direction: column; flex: 1; }
.ax-manage > summary b { font-size: 13.5px; }
.ax-manage > summary small { font-size: 11.5px; color: var(--txt-faint); }
.ax-chev { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; color: var(--txt-dim); transition: transform .2s; }
.ax-manage[open] .ax-chev { transform: rotate(180deg); }
.ax-manage[open] { padding-bottom: 12px; }
.ax-manage > .field-hint { margin: 0 0 10px; }
.ax-hosts { display: flex; flex-direction: column; border: 1px solid var(--line-soft); border-radius: 10px; margin-bottom: 10px; }
.ax-host { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-top: 1px solid var(--line-soft); }
.ax-host:first-child { border-top: 0; }
.ax-host-n { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ax-host-n b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ax-host-n small { font-size: 11.5px; color: var(--txt-faint); }
.ax-host-acts { display: flex; gap: 6px; flex-shrink: 0; }
.ax-add { display: flex; gap: 8px; align-items: center; }
.ax-add input { flex: 1 1 auto; min-width: 0; max-width: 360px; }
.ax-add .btn { flex-shrink: 0; }
#ax-cmd { margin-top: 10px; }
.ax-code { display: flex; gap: 8px; align-items: flex-start; background: var(--sunken); border-radius: 8px; padding: 8px 10px; }
.ax-code code { flex: 1; font-size: 11.5px; word-break: break-all; white-space: pre-wrap; min-width: 0; }
@media (max-width: 640px) {
  .ax-two { grid-template-columns: 1fr; }
  .ax-cards { grid-template-columns: 1fr; }
  .ax-map { height: 240px; }
  .ax-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'ip when' 'what act'; row-gap: 3px; }
  .ax-row .what { flex-direction: row; gap: 6px; align-items: baseline; }
  .ax-host { flex-wrap: wrap; }
  .ax-host-acts { width: 100%; justify-content: flex-end; }
  .ax-add input { max-width: none; }
  .ax-sum { gap: 6px 14px; }
  .ax-bar .ax-note { order: 3; flex-basis: 100%; }
}

/* Rental (Users → a user) and its reminder at the top of every page. */
.um-row-rent { grid-template-columns: minmax(0, 1fr) auto; }
.um-rent { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 12px; padding: 12px; border: 1px solid var(--line-soft); border-radius: 10px; background: color-mix(in srgb, var(--panel) 70%, transparent); min-width: 0; }
.um-pnote { color: var(--accent, #3b82f6); }
.rent-head { display: flex; flex-direction: column; gap: 2px; }
.rent-head small { color: var(--txt-faint); font-size: 12px; }
.rent-st { font-weight: 600; font-size: 13.5px; }
.rent-st.ok { color: var(--trading); } .rent-st.warn { color: #e0a010; } .rent-st.bad { color: var(--blocked); }
.rent-pn { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rent-pn > span { font-size: 12.5px; color: var(--txt-dim); }
.rent-pn input { flex: 1 1 180px; min-width: 0; }
.rent-sub { display: flex; align-items: center; gap: 6px; font-size: 12.5px; grid-column: 1 / -1; }
.rent-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 10px; align-items: end; }
.rent-form label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--txt-dim); min-width: 0; }
.rent-form label small { color: var(--txt-faint); }
.rent-form input { width: 100%; min-width: 0; box-sizing: border-box; }
.rent-form .rent-wide { grid-column: 1 / span 3; }
.rent-go { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rent-list { display: flex; flex-direction: column; gap: 6px; }
.rent-pay { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 7px 10px; border: 1px solid var(--line-soft); border-radius: 9px; }
.rent-per { display: flex; flex-direction: column; min-width: 0; }
.rent-per b { font-size: 12.5px; } .rent-per small { color: var(--txt-faint); font-size: 11.5px; overflow-wrap: anywhere; }
.rent-amt { font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 640px) {
  .rent-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .rent-form .rent-wide { grid-column: 1 / -1; }
  .rent-go { grid-column: 1 / -1; }
}
#rent-note, #bill-note { display: flex; align-items: center; gap: 12px; margin: 12px 0 0; padding: 10px 14px; border-radius: 12px; border: 1px solid; font-size: 13.5px; }
#rent-note[hidden], #bill-note[hidden] { display: none; }
#rent-note.warn { border-color: color-mix(in srgb, #e0a010 45%, transparent); background: color-mix(in srgb, #e0a010 10%, var(--panel)); }
#rent-note.bad { border-color: color-mix(in srgb, var(--blocked) 45%, transparent); background: color-mix(in srgb, var(--blocked) 10%, var(--panel)); }
/* Rental reminder: the colour says how urgent — amber 4-7 days, orange 1-3,
   red when it ends today or has ended — with a ring of the paid days left. */
#rent-note[class*="rn-"] { --rn: #d99a0b; border-width: 1px 1px 1px 5px; padding: 12px 14px 12px 12px; border-radius: 14px;
  border-color: color-mix(in srgb, var(--rn) 55%, transparent); background: color-mix(in srgb, var(--rn) 9%, var(--panel));
  box-shadow: 0 6px 22px -14px color-mix(in srgb, var(--rn) 70%, transparent); }
#rent-note.rn-urgent { --rn: #e8661c; }
#rent-note.rn-end { --rn: var(--blocked); }
#rent-note.rn-end .rn-ring b { animation: rnPulse 1.8s ease-in-out infinite; }
@keyframes rnPulse { 50% { opacity: .45; } }
#rent-note .rn-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
#rent-note .rn-ring { position: relative; flex: none; width: 44px; height: 44px; }
#rent-note .rn-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
#rent-note .rn-ring circle { fill: none; stroke-width: 4; }
#rent-note .rn-ring .rn-track { stroke: color-mix(in srgb, var(--rn) 18%, transparent); }
#rent-note .rn-ring .rn-fill { stroke: var(--rn); stroke-linecap: round; }
#rent-note .rn-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 750; font-size: 15px; color: var(--rn); font-variant-numeric: tabular-nums; }
#rent-note .rn-text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
#rent-note .rn-title { font-size: 14.5px; font-weight: 700; color: var(--txt); }
#rent-note .rn-sub { color: var(--txt-dim); font-size: 13px; }
#rent-note .rn-sub b { color: var(--txt); font-weight: 650; }
#rent-note .rn-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
#rent-note .rn-chip { --c: #d99a0b; display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 7px; padding: 5px 10px; border-radius: 10px; cursor: pointer; font: inherit; font-size: 12.5px;
  border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); background: color-mix(in srgb, var(--c) 8%, var(--panel)); color: var(--txt); text-align: left; }
#rent-note .rn-chip.urgent { --c: #e8661c; }
#rent-note .rn-chip.end { --c: var(--blocked); }
#rent-note .rn-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); align-self: center; }
#rent-note .rn-chip span { color: var(--c); font-weight: 650; }
#rent-note .rn-chip small { color: var(--txt-faint); }
#rent-note .rn-chip .rn-paid { flex-basis: 100%; padding-left: 15px; }
#rent-note .rn-chip:hover { background: color-mix(in srgb, var(--c) 15%, var(--panel)); }
#bill-note { --rn: #d99a0b; border-width: 1px 1px 1px 5px; border-style: solid; padding: 12px 14px 12px 12px; border-radius: 14px;
  border-color: color-mix(in srgb, var(--rn) 55%, transparent); background: color-mix(in srgb, var(--rn) 9%, var(--panel)); }
#bill-note.rn-end { --rn: var(--blocked); }
#bill-note .rn-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
#bill-note .bill-ic { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--rn); background: color-mix(in srgb, var(--rn) 14%, transparent); }
#bill-note .bill-ic svg { width: 22px; height: 22px; }
#bill-note .rn-text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
#bill-note .rn-title { font-size: 14.5px; font-weight: 700; }
#bill-note .rn-sub { color: var(--txt-dim); font-size: 13px; }
#bill-note .rent-acts { display: flex; align-items: center; gap: 6px; flex: none; }
#bill-note .rent-x { border: 0; background: none; color: var(--txt-dim); font-size: 20px; line-height: 1; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; }
.bl-alerts .bl-al-list { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.bl-alerts .bl-al { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; }
@media (max-width: 640px) { #rent-note[class*="rn-"] { flex-wrap: wrap; } #rent-note .rn-ring { width: 38px; height: 38px; } }
#rent-note .rent-msg { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
#rent-note .rent-msg b { font-weight: 650; }
#rent-note .rent-msg span { color: var(--txt-dim); }
#rent-note .rent-msg small { color: var(--txt-faint); }
#rent-note .rent-acts { display: flex; align-items: center; gap: 6px; flex: none; }
#rent-note .rent-x { border: 0; background: none; color: var(--txt-dim); font-size: 20px; line-height: 1; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; }
#rent-note .rent-x:hover { background: color-mix(in srgb, var(--txt) 8%, transparent); }
@media (max-width: 640px) { #rent-note { margin: 10px 0 0; padding: 9px 10px; font-size: 13px; align-items: flex-start; } #rent-note .rent-msg { flex-direction: column; } }

/* Inputs of the access, device and rental forms. */
.ipb input:not([type=checkbox]), .rent-form input, .rent-pn input {
  padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--txt);
  font-family: inherit; font-size: 13px; box-sizing: border-box; min-height: 34px;
}
.ipb input:not([type=checkbox]):focus, .rent-form input:focus, .rent-pn input:focus { outline: none; border-color: var(--accent, #3b82f6); }
.ipb-rule input { padding: 5px 8px; min-height: 30px; }
#rent-note .rent-one { color: var(--txt-dim); }
#rent-note .rent-one .rent-who { color: var(--txt); font-weight: 600; }

/* Settings pages and the phone menu: one smooth, clearly visible motion
   (the earlier rules above are kept for reference, these win). */
.adv-in-fwd  { animation: adv-in-fwd2 .34s cubic-bezier(.22, .8, .26, 1) both; will-change: transform, opacity; }
.adv-in-back { animation: adv-in-back2 .34s cubic-bezier(.22, .8, .26, 1) both; will-change: transform, opacity; }
@keyframes adv-in-fwd2  { from { opacity: 0; transform: translate3d(14%, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes adv-in-back2 { from { opacity: 0; transform: translate3d(-14%, 0, 0); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) {
  #user-menu.opening { animation: menu-in .26s cubic-bezier(.22, .8, .26, 1) both; will-change: transform, opacity; }
  #user-menu.opening .user-menu-item { animation: menu-item-in .3s cubic-bezier(.22, .8, .26, 1) both; }
}
@media (prefers-reduced-motion: reduce) { .adv-in-fwd, .adv-in-back { animation: none !important; } }
/* Password dialogs */
.pwc { width: min(460px, calc(100vw - 24px)); }
.pwc-form { display: flex; flex-direction: column; gap: 10px; }
.pwc-f { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--txt-dim); }
.pwc-f .text-input { width: 100%; box-sizing: border-box; padding: 10px 42px 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--txt); font-size: 14px; font-family: inherit; }
.pwc-f .text-input:focus { outline: none; border-color: var(--accent, #3b82f6); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #3b82f6) 18%, transparent); }
.pwc-f .text-input.bad { border-color: var(--blocked); }
.pw-eye.on { color: var(--accent, #3b82f6); }
.pwc .pw-meter { height: 5px; border-radius: 99px; background: var(--sunken, var(--line-soft)); overflow: hidden; margin-top: -2px; }
.pwc .pw-meter i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--blocked); transition: width .25s ease, background .25s ease; }
.pwc .pw-meter i[data-s="2"] { background: #e0a010; } .pwc .pw-meter i[data-s="3"] { background: var(--trading); } .pwc .pw-meter i[data-s="4"] { background: var(--trading); }
.pwc-rules { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 12px; color: var(--txt-faint); }
.pwc-rules li { display: flex; gap: 6px; align-items: flex-start; }
.pwc-rules li i { flex: none; width: 14px; height: 14px; margin-top: 1px; border-radius: 50%; border: 1.5px solid currentColor; box-sizing: border-box; position: relative; }
.pwc-rules li.ok { color: var(--trading); } .pwc-rules li.no { color: var(--txt-dim); }
.pwc-rules li.ok i { background: currentColor; }
.pwc-rules li.ok i::after { content: ''; position: absolute; left: 3.5px; top: 1px; width: 3px; height: 6px; border: solid var(--panel); border-width: 0 1.6px 1.6px 0; transform: rotate(45deg); }
.pwc-match { font-size: 12px; min-height: 1em; margin-top: -4px; color: var(--txt-faint); }
.pwc-match.ok { color: var(--trading); } .pwc-match.no { color: #e0a010; }
.pwc-err { margin: 0; font-size: 12.5px; color: var(--blocked); }
.pwc .pw-sub { margin: 0 0 2px; font-size: 13px; color: var(--txt-dim); }
@media (max-width: 480px) { .pwc-rules { grid-template-columns: 1fr; } }
.um-add-chk { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--txt-dim); margin-top: 10px; cursor: pointer; }
.um-add-chk input { margin: 0; }
.um-add-hint { margin: 6px 0 0; }
.um-starts { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.um-start { display: flex; gap: 8px; align-items: center; font-size: 12.5px; }
.um-date { padding: 5px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--txt); font: inherit; font-size: 12.5px; }
@media (max-width: 600px) { .um-starts { align-items: flex-start; } }
/* This Account → Rental */
.my-rent-v { font-size: 13px; }
.my-rent-v.bad { color: var(--blocked); }
.my-rent-pays { padding: 12px 14px; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 8px; }
.my-rent-h { font-size: 12.5px; font-weight: 600; }
.my-rent-pays .field-hint { margin: 0; }
.twofa-status.warn { color: #e0a010; border-color: color-mix(in srgb, #e0a010 40%, transparent); }
/* A short confirmation */
.cc-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); opacity: 0; z-index: 100000; padding: 10px 16px; border-radius: 12px;
  background: var(--txt); color: var(--panel); font-size: 13.5px; box-shadow: 0 8px 30px rgba(0,0,0,.25); transition: opacity .25s ease, transform .25s ease; pointer-events: none; }
.cc-toast.in { opacity: 1; transform: translate(-50%, 0); }

/* This Account → Rental: the state at a glance */
.my-rent-hero { padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 4px; background: linear-gradient(180deg, color-mix(in srgb, var(--trading) 7%, var(--panel)), var(--panel)); }
.my-rent-hero.warn { background: linear-gradient(180deg, color-mix(in srgb, #e0a010 9%, var(--panel)), var(--panel)); }
.my-rent-hero.bad { background: linear-gradient(180deg, color-mix(in srgb, var(--blocked) 8%, var(--panel)), var(--panel)); }
.my-rent-hero + .field-row { border-top: 1px solid var(--line-soft); }
.mrh-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mrh-k { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--txt-dim); font-weight: 600; }
.mrh-date { font-size: 22px; font-weight: 700; letter-spacing: -.01em; color: var(--txt); }
.mrh-sub { font-size: 12.5px; color: var(--txt-dim); }
.mrh-bar { height: 6px; border-radius: 99px; background: var(--sunken, var(--line-soft)); overflow: hidden; margin-top: 8px; }
.mrh-bar i { display: block; height: 100%; border-radius: inherit; background: var(--trading); }
.my-rent-hero.warn .mrh-bar i { background: #e0a010; }
.mrh-ends { display: flex; justify-content: space-between; font-size: 11px; color: var(--txt-faint); }
.rent-pay.now { border-color: color-mix(in srgb, var(--trading) 45%, var(--line-soft)); }
.rent-pay.editing { border-color: var(--accent, #3b82f6); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent, #3b82f6) 18%, transparent); }
.rent-pay-acts { display: flex; align-items: center; gap: 2px; }
.rent-ed { width: 28px; height: 28px; border: 0; background: none; border-radius: 8px; color: var(--txt-dim); cursor: pointer; display: grid; place-items: center; }
.rent-ed:hover { background: color-mix(in srgb, var(--txt) 8%, transparent); color: var(--txt); }
.rent-ed svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.pwc-note { font-size: 11.5px; color: var(--txt-faint); line-height: 1.4; }
/* Manage users: one card, a few tabs */
.um-tabs { margin: 10px 12px 2px; align-self: flex-start; max-width: calc(100% - 24px); overflow-x: auto; }
.um-pane[hidden] { display: none; }
.um-perm-head .um-row-lbl { font-weight: 600; }

/* Manage users: the buttons under a tab keep their distance from the rows */
.um-pane > .um-actions { margin-top: 12px; }

/* Settings → Advanced → Rentals */
.rnt { display: flex; flex-direction: column; gap: 12px; }
.rnt-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.rnt-k { display: flex; flex-direction: column; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--panel); }
.rnt-k b { font-size: 20px; font-variant-numeric: tabular-nums; } .rnt-k small { font-size: 11.5px; color: var(--txt-dim); }
.rnt-k.ok b { color: var(--trading); } .rnt-k.warn b { color: #e0a010; } .rnt-k.bad b { color: var(--blocked); }
.rnt-list { display: flex; flex-direction: column; gap: 8px; }
.rnt-row { border: 1px solid var(--line-soft); border-radius: 12px; background: var(--panel); overflow: hidden; }
.rnt-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.rnt-head .um-av, .rnt-head .avatar { flex: none; }
.rnt-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rnt-who b { font-size: 14px; } .rnt-who small { font-size: 12px; color: var(--txt-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rnt-st { flex: none; }
.rnt-row.open .um-chev { transform: rotate(180deg); }
.rnt-row > .um-rent { margin: 0 12px 12px; }
.rnt-add { display: flex; }
@media (max-width: 520px) { .rnt-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* EA settings → MetaTrader */
.mt5-since { color: var(--txt-faint); font-weight: 400; font-size: 11.5px; margin-left: 4px; }
.mt5-restart { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.mt5-restart b { font-size: 13px; } .mt5-restart .field-hint { margin: 2px 0 0; }
.mt5-restart .btn { flex: none; }
@media (max-width: 520px) { .mt5-restart { flex-direction: column; align-items: stretch; } }

/* Rentals (3.6.4): payments first, the user's settings below */
.rent-lh { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rent-lh .rent-sub { grid-column: auto; }
.rent-form { padding: 10px; border: 1px solid var(--line-soft); border-radius: 10px; background: color-mix(in srgb, var(--txt) 3%, transparent); }
.rent-form[hidden] { display: none; }
.rent-set { display: flex; flex-direction: column; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.rent-test { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; cursor: pointer; }
.rent-test > span { display: flex; flex-direction: column; gap: 2px; }
.rent-test small { color: var(--txt-faint); font-size: 12px; }
.rent-test-note { color: var(--txt-dim) !important; }
.rent-foot { display: flex; justify-content: flex-end; }
.rnt-sec { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.rnt-sec b { font-size: 13px; } .rnt-sec small { font-size: 12px; color: var(--txt-dim); }
.rnt-row.test { border-style: dashed; }
.rnt-st { display: flex; gap: 6px; align-items: center; }
.um-rent-tag { margin-right: 8px; }
.um-row-ctl:has(.um-rent-tag) { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }

/* Blocked access → Devices: one card per device */
.ipb-dev { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 10px; }
.ipb-dev.black { border-color: color-mix(in srgb, var(--blocked) 35%, var(--line-soft)); }
.dv-top { display: flex; align-items: center; gap: 10px; }
.dv-ic { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--txt) 6%, transparent); color: var(--txt-dim); }
.dv-ic svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dv-name { flex: 1; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.dv-name b { font-size: 13.5px; }
.dv-top .ipb-acts { flex: none; }
.dv-kv { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 4px 12px; font-size: 12.5px; padding-left: 40px; }
.dv-k { color: var(--txt-faint); }
.dv-v { min-width: 0; overflow-wrap: anywhere; color: var(--txt-dim); }
.dv-v b { color: var(--txt); font-weight: 600; }
.dv-blk { color: var(--blocked); }
.dv-spec { padding-left: 40px; color: var(--txt-faint); font-size: 11.5px; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .dv-kv, .dv-spec { padding-left: 0; }
  .dv-kv { grid-template-columns: 78px minmax(0, 1fr); }
}

/* Advanced menu in groups (3.6.5) */
.adv-menu.adv-grouped { border: none; background: none; overflow: visible; gap: 18px; }
.adv-group { display: flex; flex-direction: column; gap: 8px; }
.adv-gh { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 0 4px; }
.adv-gh b { font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--txt-dim); }
.adv-gh small { font-size: 12px; color: var(--txt-faint); }
.adv-glist { display: flex; flex-direction: column; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--panel); overflow: hidden; }
@media (min-width: 900px) {
  .adv-glist { display: grid; grid-template-columns: 1fr 1fr; }
  .adv-glist .adv-item + .adv-item { border-top: none; }
  .adv-glist .adv-item:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
  .adv-glist .adv-item:nth-child(2n) { border-left: 1px solid var(--line-soft); }
  .adv-glist .adv-item:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
/* Security & access: one page, two parts */
.sec { display: flex; flex-direction: column; gap: 12px; }
.sec-top { display: flex; flex-direction: column; gap: 6px; }
.sec-tabs { align-self: stretch; }
.sec-sub { margin: 0; }

/* Rentals (3.6.5): a calm strip of figures, one row per client with where
   the paid month stands, test users tucked away at the end */
.rnt-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line-soft); border-radius: 14px; background: var(--panel); overflow: hidden; }
.rnt-strip .rnt-k { border: 0; border-radius: 0; background: none; padding: 12px 16px; gap: 2px; }
.rnt-strip .rnt-k + .rnt-k { border-left: 1px solid var(--line-soft); }
.rnt-strip .rnt-k b { font-size: 22px; font-weight: 650; line-height: 1.1; }
.rnt-strip .rnt-k:not(.ok):not(.warn):not(.bad) b { color: var(--txt); }
.rnt-row { border-radius: 14px; transition: box-shadow .15s ease, border-color .15s ease; }
.rnt-row.open { border-color: color-mix(in srgb, var(--standby) 35%, var(--line-soft)); box-shadow: 0 6px 20px -14px rgba(0, 0, 0, .35); }
.rnt-head { padding: 12px 14px; gap: 12px; }
@media (hover: hover) { .rnt-head:hover { background: color-mix(in srgb, var(--txt) 3%, transparent); } }
.rnt-prog { flex: 0 1 230px; min-width: 120px; display: flex; flex-direction: column; gap: 5px; }
.rnt-bar { display: block; height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--txt) 8%, transparent); overflow: hidden; }
.rnt-bar i { display: block; height: 100%; border-radius: inherit; background: var(--txt-faint); }
.rnt-bar.ok i { background: var(--trading); } .rnt-bar.warn i { background: #e0a010; } .rnt-bar.bad i { background: var(--blocked); }
.rnt-when { font-size: 12px; color: var(--txt-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rnt-when.warn { color: #c98d00; } .rnt-when.bad { color: var(--blocked); }
.rnt-empty { margin: 0; padding: 18px; text-align: center; font-size: 13px; color: var(--txt-dim); border: 1px dashed var(--line-soft); border-radius: 14px; }
.rnt-add { align-self: flex-start; position: relative; display: inline-flex; align-items: center; gap: 0; padding: 7px 14px; border: 1px dashed var(--line-soft); border-radius: 10px; font-size: 13px; color: var(--standby); cursor: pointer; }
.rnt-add select { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
@media (hover: hover) { .rnt-add:hover { border-color: var(--standby); } }
.rnt-tests { border-top: 1px solid var(--line-soft); padding-top: 10px; }
.rnt-tests > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; font-size: 12.5px; color: var(--txt-dim); padding: 2px 4px; }
.rnt-tests > summary::-webkit-details-marker { display: none; }
.rnt-tests > summary::before { content: '›'; display: inline-block; transition: transform .15s ease; font-size: 15px; line-height: 1; }
.rnt-tests[open] > summary::before { transform: rotate(90deg); }
.rnt-tests > summary small { color: var(--txt-faint); font-size: 11.5px; }
.rnt-tests .rnt-list { margin-top: 8px; }
.rnt-row.test { border-style: solid; background: none; }
.rnt-row.test .rnt-head { padding: 8px 12px; gap: 10px; }
.rnt-row.test .rnt-who b { font-size: 13px; font-weight: 550; color: var(--txt-dim); }
.rnt-row.test .avatar, .rnt-row.test .um-av { transform: scale(.8); }
/* the open panel: payments | note */
.rent-cols { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 18px; align-items: start; }
.rent-cols .rent-set { border-top: 0; padding-top: 0; gap: 14px; }
.rent-pn { flex-direction: column; align-items: stretch; gap: 4px; }
.rent-pn > small { font-size: 11.5px; color: var(--txt-faint); margin-top: -2px; }
.rent-pn-row { display: flex; gap: 6px; }
.rent-pn-row input { flex: 1; min-width: 0; }
.rent-off { align-self: flex-start; border: 0; background: none; padding: 0; font: inherit; font-size: 12.5px; color: var(--blocked); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--blocked) 35%, transparent); }
@media (max-width: 700px) {
  .rent-cols { grid-template-columns: 1fr; }
  .rnt-strip { grid-template-columns: 1fr 1fr; }
  .rnt-strip .rnt-k:nth-child(3) { border-left: 0; }
  .rnt-strip .rnt-k:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
  .rnt-head { flex-wrap: wrap; }
  .rnt-prog { order: 5; flex: 1 1 100%; padding-left: 46px; }
}

/* Biometrics reminder (clients): a small card at the bottom, never blocking */
.bio-nudge { position: fixed; right: 20px; bottom: 20px; z-index: 900; width: min(380px, calc(100vw - 32px)); display: flex; gap: 12px; padding: 14px 16px; border: 1px solid var(--line-soft); border-radius: 16px; background: var(--panel); box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .45); opacity: 0; transform: translateY(12px); transition: opacity .25s ease, transform .25s ease; }
.bio-nudge.in { opacity: 1; transform: none; }
.bn-ic { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--standby-bg); color: var(--standby); }
.bn-ic svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bn-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bn-txt b { font-size: 14px; }
.bn-txt small { font-size: 12.5px; color: var(--txt-dim); line-height: 1.45; }
.bn-acts { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.bn-never { border: 0; background: none; padding: 0; font: inherit; font-size: 12px; color: var(--txt-faint); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 640px) { .bio-nudge { left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); width: auto; } }
.pwc-weak { display: block; padding: 8px 10px; border-radius: 9px; font-size: 12px; line-height: 1.45; color: #9a6a00; background: color-mix(in srgb, #e0a010 12%, transparent); border: 1px solid color-mix(in srgb, #e0a010 30%, transparent); }
.pwc-weak[hidden] { display: none; }

/* This Account (3.6.5): who is signed in, then — for a client — the trading card */
.acct-prof { display: flex; align-items: center; gap: 14px; padding: 4px 4px 2px; }
.acct-prof .um-avatar { width: 48px; height: 48px; padding: 0; font-size: 19px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; }
.acct-prof .um-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ap-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ap-txt b { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.ap-txt small { font-size: 12.5px; color: var(--txt-dim); }
.ap-sec { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 99px; border: 1px solid var(--line-soft); background: var(--panel); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.ap-sec svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ap-sec.ok { color: var(--trading); border-color: color-mix(in srgb, var(--trading) 30%, var(--line-soft)); }
.ap-sec.warn { color: #c98d00; border-color: color-mix(in srgb, #e0a010 40%, var(--line-soft)); }
.th { --c: var(--offline); position: relative; display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; border-radius: 18px; border: 1px solid color-mix(in srgb, var(--c) 28%, var(--line-soft)); background: linear-gradient(135deg, color-mix(in srgb, var(--c) 13%, var(--panel)) 0%, var(--panel) 70%); overflow: hidden; }
.th.on { --c: var(--trading); } .th.partial { --c: #e0a010; } .th.off { --c: var(--blocked); } .th.none { --c: var(--txt-faint); }
.th + .th { margin-top: -6px; }
.th-top { display: flex; align-items: center; gap: 16px; }
.th-ic { position: relative; flex: none; width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); }
.th-ic svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.th.on .th-ic::after { content: ''; position: absolute; inset: -4px; border-radius: 18px; border: 2px solid color-mix(in srgb, var(--c) 45%, transparent); animation: thPulse 2.4s ease-out infinite; }
@keyframes thPulse { 0% { opacity: .9; transform: scale(.92); } 100% { opacity: 0; transform: scale(1.18); } }
@media (prefers-reduced-motion: reduce) { .th.on .th-ic::after { animation: none; opacity: .5; } }
.th-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.th-acct { font-size: 11.5px; color: var(--txt-faint); }
.th-acct b { color: var(--txt-dim); font-weight: 600; }
.th-title { font-size: 20px; font-weight: 700; letter-spacing: -.015em; color: var(--txt); }
.th-sub { font-size: 12.5px; color: var(--txt-dim); line-height: 1.45; }
.th-pill { flex: none; padding: 6px 12px; border-radius: 99px; font-size: 12px; font-weight: 800; letter-spacing: .08em; color: #fff; background: var(--c); }
.th.none .th-pill { display: none; }
.th-eas { list-style: none; margin: 0; padding: 10px 0 0; border-top: 1px solid color-mix(in srgb, var(--c) 18%, var(--line-soft)); display: flex; flex-direction: column; gap: 6px; }
.th-eas li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.th-eas li i { width: 8px; height: 8px; border-radius: 50%; background: var(--blocked); }
.th-eas li.on i { background: var(--trading); }
.th-eas li span { flex: 1; min-width: 0; color: var(--txt-dim); }
.th-eas li b { font-size: 12px; }
@media (max-width: 640px) {
  .th { padding: 16px; }
  .th-top { align-items: flex-start; gap: 12px; }
  .th-ic { width: 42px; height: 42px; }
  .th-title { font-size: 18px; }
  .th-pill { padding: 5px 9px; font-size: 11px; }
}

/* Strategy analysis (3.6.5): the tab bar and the context line in the same place on every tab */
.sa-head { display: flex; flex-direction: column; gap: 10px; }
.sa-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-soft); overflow-x: auto; scrollbar-width: none; }
.sa-tabs::-webkit-scrollbar { display: none; }
.sa-tabs button { position: relative; padding: 9px 14px 11px; border: 0; background: none; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--txt-dim); cursor: pointer; white-space: nowrap; }
.sa-tabs button::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: transparent; }
.sa-tabs button.on { color: var(--standby); }
.sa-tabs button.on::after { background: var(--standby); }
@media (hover: hover) { .sa-tabs button:not(.on):hover { color: var(--txt); } }
.sa-ctx { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; min-height: 30px; }
.sa-ctx .sa-src { flex: 1 1 260px; margin: 0; font-size: 12.5px; color: var(--txt-dim); }
.sa-ctx .sa-pers { margin-left: 0; }
.rent-cols > * { min-width: 0; }
.rent-pn-row input { flex: 1 1 0; width: auto; min-width: 0; }
.rent-pn-row .btn { flex: none; }
/* open: the panel says where it stands, so the row's bar steps aside */
.rnt-row.open .rnt-prog { visibility: hidden; }
@media (max-width: 700px) { .rnt-row.open .rnt-prog { display: none; } }
.rent-cols .rent-pn { flex-wrap: nowrap; min-width: 0; }
.rent-form .rent-go { grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.rent-form .rent-wide { grid-column: 1 / -1; }

/* 3.6.6 — one account, no sidebar (clients): a readable page width on laptops,
   balance on the left and its facts on the right instead of one stretched card. */
#app.app-solo { max-width: 1180px; }
@media (min-width: 901px) {
  .acct-panel.user-view .acct-summary-card.bare {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px 40px;
  }
  .acct-panel.user-view .acct-panel-top .acct-sum-facts {
    display: flex; justify-content: flex-end; gap: 0; border-top: none; padding-top: 0; padding-bottom: 6px;
  }
  .acct-panel.user-view .acct-panel-top .acct-sum-facts .acct-fact { min-width: 128px; padding-left: 22px; margin-left: 22px; border-left: 1px solid var(--line-soft); }
  .acct-panel.user-view .acct-panel-top .acct-sum-facts .acct-fact:first-child { border-left: none; margin-left: 0; padding-left: 0; }
  .acct-panel.user-view .acct-panel-top .acct-sum-facts .fact-narrow { min-width: 110px; margin-right: 0; }
  /* calendar days: wide, not square — three short lines fit a shorter cell */
  .cal-day { aspect-ratio: 1.55; }
}
#app.app-solo .acct-panel-head ~ .analytics-head { margin-top: 22px; }
/* Manage users (3.6.6): the list first, adding behind a button, shared settings at the foot */
.um-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.um-bar .users-legend { margin: 0 2px; }
.um-common { padding-top: 4px; padding-bottom: 4px; }
.um-pol-st { display: block; margin-top: 4px; color: var(--txt-dim) !important; font-weight: 600; }
/* Server access (3.6.6): calm source cards — name, state, two figures */
.ax-cards { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.ax-card { gap: 6px; padding: 12px 14px; }
.ax-ch { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ax-ch b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ax-st { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 3px color-mix(in srgb, var(--up) 18%, transparent); }
.ax-st.warn { background: #e0a010; box-shadow: 0 0 0 3px color-mix(in srgb, #e0a010 18%, transparent); }
.ax-st.dash { background: var(--standby); box-shadow: 0 0 0 3px color-mix(in srgb, var(--standby) 18%, transparent); }
.ax-cs { font-size: 11.5px; color: var(--txt-faint); margin-top: -2px; }
.ax-cs.warn { color: #e0a010; }
.ax-cn { display: flex; gap: 18px; margin-top: 4px; }
.ax-cn span { display: flex; flex-direction: column; min-width: 0; }
.ax-cn b { font-size: 20px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.ax-cn small { font-size: 11px; color: var(--txt-dim); }
.ax-cn .bad b { color: var(--blocked); }
.ax-cn .ok b { color: var(--up); }
.ax-card .ax-days { height: 22px; margin-top: 6px; }
/* Connection downtime (3.6.6): thresholds folded under the outages */
.dt-th-d { margin-top: 16px; }
.dt-th-d .dt-th { display: flex; flex-direction: column; gap: 8px; padding: 2px 0 14px; }
/* Server → VPS → EAs on the dashboard (3.6.6): one aligned row per EA */
.srv-eat { display: flex; flex-direction: column; border: 1px solid var(--line-soft); border-radius: 10px; overflow: hidden; }
.srv-eat-r { display: grid; grid-template-columns: minmax(0, 1fr) 54px 54px auto; align-items: center; gap: 4px 10px; padding: 7px 10px; font-size: 12px; }
.srv-eat-r + .srv-eat-r { border-top: 1px solid var(--line-soft); }
.srv-eat-r.h { background: var(--sunken); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--txt-faint); padding-top: 6px; padding-bottom: 6px; }
.srv-eat-r .n { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--txt); }
.srv-eat-r .n > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srv-eat-r .n i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); flex: none; }
.srv-eat-r.on .n i { background: var(--trading); box-shadow: 0 0 5px var(--trading); }
.srv-eat-r .v { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: var(--txt-dim); }
.srv-eat-r .s em { font-style: normal; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.srv-eat-r .s em.ok { color: var(--trading); background: color-mix(in srgb, var(--trading) 12%, transparent); }
.srv-eat-r .s em.old { color: #c98500; background: color-mix(in srgb, #e0a010 14%, transparent); }
.srv-eat-r .s em.bad { color: var(--blocked); background: color-mix(in srgb, var(--blocked) 12%, transparent); }
.srv-eat-r .m { grid-column: 1 / -1; padding-left: 15px; }
.srv-eat-r .m .srv-miss { margin: 0; white-space: normal; }
@media (max-width: 600px) {
  .srv-eat-r { grid-template-columns: auto auto minmax(0, 1fr); }
  .srv-eat-r.h { display: none; }
  .srv-eat-r .n { grid-column: 1 / -1; }
  .srv-eat-r .v::before { content: attr(data-l) ' '; color: var(--txt-faint); font-size: 10px; }
  .srv-eat-r .s { justify-self: end; }
}
/* Server → Requests: the slowest answers (3.6.6) */
.srq-slow { margin-top: 12px; border-top: 1px solid var(--line-soft); padding-top: 10px; }
.srq-slow h5 { margin: 0 0 6px; font-size: 12.5px; }
.srq-slow h5 small { font-weight: 400; color: var(--txt-faint); margin-left: 6px; }
.srq-sr { display: grid; grid-template-columns: minmax(0, 1fr) 70px 110px; gap: 10px; align-items: baseline; font-size: 12px; padding: 3px 0; }
.srq-sr span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--txt-dim); font-size: 11.5px; }
.srq-sr b { text-align: right; font-variant-numeric: tabular-nums; }
.srq-sr b.warn { color: #c98500; } .srq-sr b.bad { color: var(--blocked); }
.srq-sr small { color: var(--txt-faint); text-align: right; }
.um-bar-t { font-size: 13px; color: var(--txt); display: inline-flex; align-items: baseline; gap: 6px; margin-left: 2px; }
.um-bar-t span { color: var(--txt-faint); font-size: 12px; }
/* Security & access (3.6.7): the period beside the tabs; all sources in one row */
.sec-tabrow { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line-soft); }
.sec-tabrow .sec-tabs { flex: 1 1 auto; border-bottom: 0; min-width: 0; }
.sec-tools { flex: none; }
.sec-tools:empty { display: none; }
.ax-cards { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.ax > .ax-note { display: block; flex: none; margin: -2px 2px 0; }
@media (max-width: 600px) {
  .sec-tools .seg button { padding-left: 8px; padding-right: 8px; }
  .ax-card { padding: 10px 12px; }
  .ax-cn { gap: 12px; }
  .ax-cn b { font-size: 18px; }
}
/* Server → EAs on the dashboard: a card of its own, full width */
.srv-eas-card .srv-eat-r { grid-template-columns: minmax(0, 1fr) 90px 120px 130px; padding: 9px 14px; }
.srv-eas-card .srv-eat-r .m { padding-left: 15px; }
@media (max-width: 600px) {
  .srv-eas-card .srv-eat-r { grid-template-columns: auto auto minmax(0, 1fr); padding: 8px 10px; }
}
/* Snow (beta) */
#snow { position: fixed; left: 0; top: 0; pointer-events: none; z-index: 2147483000; }
.beta-chip { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 99px; font-size: 9.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--standby); background: var(--standby-bg); vertical-align: 1px; }
/* Jarvis (beta) */
.jv { display: flex; flex-direction: column; gap: 14px; }
.jv-hero { border: 1px solid var(--line-soft); border-radius: 14px; padding: 14px 16px; background: linear-gradient(135deg, color-mix(in srgb, var(--standby) 10%, var(--panel)), var(--panel)); display: flex; flex-direction: column; gap: 10px; }
.jv-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.jv-hero-top > span:first-child b { font-size: 17px; }
.jv-pct { display: flex; align-items: baseline; gap: 8px; }
.jv-pct b { font-size: 18px; color: var(--standby); font-variant-numeric: tabular-nums; }
.jv-pct small { font-size: 11.5px; color: var(--txt-faint); }
.jv-bar { display: block; height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--line-soft) 70%, transparent); overflow: hidden; }
.jv-bar i { display: block; height: 100%; border-radius: 99px; background: var(--standby); transition: width .4s; }
.jv-hero .field-hint { margin: 0; }
.jv-sec { border: 1px solid var(--line-soft); border-radius: 12px; padding: 12px 14px; background: var(--panel); display: flex; flex-direction: column; gap: 8px; }
.jv-sec h4 { margin: 0; font-size: 13.5px; }
.jv-sec h4 small { font-weight: 400; color: var(--txt-faint); margin-left: 6px; font-size: 11.5px; }
.jv-list { display: flex; flex-direction: column; }
.jv-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line-soft); }
.jv-item:first-child { border-top: 0; }
.jv-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line); }
.jv-item.building .jv-dot { border-color: #e0a010; background: color-mix(in srgb, #e0a010 30%, transparent); }
.jv-item.done .jv-dot { border-color: var(--up); background: var(--up); }
.jv-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.jv-txt b { font-size: 13px; }
.jv-txt small { font-size: 11.5px; color: var(--txt-dim); line-height: 1.4; }
.jv-item.done .jv-txt b { color: var(--txt-dim); }
.jv-act { flex: none; display: flex; align-items: center; gap: 6px; }
.jv-chip { flex: none; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; color: var(--txt-dim); background: var(--sunken); }
.jv-chip.building { color: #c98500; background: color-mix(in srgb, #e0a010 14%, transparent); }
.jv-chip.done { color: var(--up); background: color-mix(in srgb, var(--up) 12%, transparent); }
.jv-add { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 8px; margin-top: 4px; }
.jv-kv { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.jv-kv span { color: var(--txt-dim); }
.jv-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.jv-dt { display: flex; flex-direction: column; border: 1px solid var(--line-soft); border-radius: 10px; overflow: hidden; }
.jv-dr { display: grid; grid-template-columns: minmax(0, 1.3fr) 60px minmax(0, 1fr) 70px minmax(0, 1fr) minmax(0, 1fr); gap: 8px; padding: 7px 10px; font-size: 12px; font-variant-numeric: tabular-nums; }
.jv-dr + .jv-dr { border-top: 1px solid var(--line-soft); }
.jv-dr.h { background: var(--sunken); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--txt-faint); }
.jv-dr .up { color: var(--up); } .jv-dr .down { color: var(--down); }
.jv-raw pre { max-height: 260px; overflow: auto; font-size: 11px; background: var(--sunken); padding: 8px; border-radius: 8px; white-space: pre-wrap; word-break: break-word; }
.jv-rep { border-top: 1px solid var(--line-soft); padding: 8px 0; }
.jv-rep summary { cursor: pointer; display: flex; gap: 10px; align-items: baseline; font-size: 12.5px; }
.jv-rep summary small { color: var(--txt-faint); }
.jv-rep p { margin: 8px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--txt); }
@media (max-width: 600px) {
  .jv-item { flex-wrap: wrap; }
  .jv-act { width: 100%; padding-left: 20px; }
  .jv-add { grid-template-columns: 1fr; }
  .jv-dr { grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr); }
  .jv-dr > span:nth-child(n+4) { display: none; }
}
/* Blocked access → Devices: the action in the middle of the card's height */
.ipb-dev { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 14px; }
.dv-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.dv-acts { align-self: center; }
.dv-acts:empty { display: none; }
@media (max-width: 640px) {
  .ipb-dev { grid-template-columns: 1fr; }
  .dv-acts { justify-self: end; }
}
/* Manage users: the count and the button on one line, centred on each other */
.um-bar { align-items: center; min-height: 30px; }
.um-bar-t { align-items: center; line-height: 1; height: 28px; }
.um-bar .btn { align-self: center; margin: 0; }
.ax-st.all { background: var(--txt-dim); box-shadow: 0 0 0 3px color-mix(in srgb, var(--txt-dim) 16%, transparent); }
.ax-card.ax-all { background: var(--sunken); }
.ax-cards { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
@media (max-width: 600px) { .ax-card.ax-all { grid-column: 1 / -1; } }
/* Uptime thresholds (3.6.8): one row per colour */
.th3 { display: flex; flex-direction: column; border: 1px solid var(--line-soft); border-radius: 10px; overflow: hidden; }
.th3-r { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 10px; padding: 8px 12px; min-height: 44px; }
.th3-r + .th3-r { border-top: 1px solid var(--line-soft); }
.th3-r > i { width: 10px; height: 10px; border-radius: 50%; }
.th3-r.good > i { background: var(--up); } .th3-r.warn > i { background: #e0a010; } .th3-r.bad > i { background: var(--down); }
.th3-n { font-size: 13px; font-weight: 600; }
.th3-v { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--txt-dim); }
.th3-v input { width: 84px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 24px 6px 10px; color: var(--txt); font-size: 13px; }
.th3-v input:focus { outline: none; border-color: var(--standby); box-shadow: 0 0 0 3px var(--standby-bg); }
#th-red { font-weight: 600; color: var(--txt); padding-right: 4px; }
.th3-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.th3-foot small { flex: 1 1 240px; color: var(--txt-faint); font-size: 11.5px; line-height: 1.4; }
.th3-foot .field-hint { margin: 0; }
/* Top bar kept in view (Appearance, wide screens) */
@media (min-width: 601px) {
  body.pin-top .topbar { position: sticky; top: 0; z-index: 8000; background: var(--bg); padding-top: 14px; margin-top: -14px; }
  body.pin-top .fleet { top: calc(var(--tbh, 80px) + 4px); max-height: calc(var(--vh100) - var(--tbh, 80px) - 16px); }
}
@media (max-width: 600px) { .pin-row { display: none; } }
/* Snow 2 (3.6.8): the gnome, his bubble, the Christmas logo */
#snow-gnome { position: fixed; left: 0; bottom: 0; width: 72px; height: 90px; z-index: 2147483001; cursor: pointer; pointer-events: auto; outline: none; will-change: transform; }
#snow-gnome[hidden] { display: none; }
#snow-gnome .gn-body { width: 72px; height: 90px; transform-origin: 50% 100%; }
#snow-gnome svg { width: 100%; height: 100%; display: block; overflow: visible; filter: drop-shadow(0 2px 3px rgba(0,0,0,.18)); }
#snow-gnome.walking .gn-body { animation: gn-bob .42s ease-in-out infinite; }
#snow-gnome.work .gn-shovel { transform-origin: 45px 40px; animation: gn-dig .5s ease-in-out infinite; }
#snow-gnome:not(.walking) .gn-pom { animation: gn-pom 2.4s ease-in-out infinite; transform-origin: 44px 11px; }
#snow-gnome:hover .gn-body, #snow-gnome:focus-visible .gn-body { transform: scale(1.06); }
@keyframes gn-bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-3px) rotate(2deg); } }
@keyframes gn-dig { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-28deg); } }
@keyframes gn-pom { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(1px, -1.5px); } }
.gn-bubble { position: absolute; left: 52px; bottom: 84px; width: max-content; max-width: min(300px, 70vw); padding: 9px 12px; border-radius: 14px 14px 14px 4px;
  background: var(--panel); color: var(--txt); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0,0,0,.18); font-size: 13px; line-height: 1.4; font-weight: 500;
  animation: gn-pop .3s cubic-bezier(.2,1.4,.4,1) both; }
.gn-bubble[hidden] { display: none; }
@keyframes gn-pop { from { transform: scale(.6) translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
.brand-icon.xmas { width: 38px; height: 38px; margin-top: -4px; }
.brand-icon.xmas .xl { animation: xl-blink 1.6s ease-in-out infinite; }
.brand-icon.xmas .x2 { animation-delay: .4s; } .brand-icon.xmas .x3 { animation-delay: .8s; } .brand-icon.xmas .x4 { animation-delay: 1.2s; }
.brand-icon.xmas .xstar { transform-origin: 20px 4.5px; animation: xl-star 2.8s ease-in-out infinite; }
@keyframes xl-blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes xl-star { 0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 #f5c542); } 50% { transform: scale(1.15); filter: drop-shadow(0 0 2px #f5c542); } }
@media (prefers-reduced-motion: reduce) { .brand-icon.xmas .xl, .brand-icon.xmas .xstar { animation: none; } }
.ax-ch { align-items: flex-start; }
.ax-ch .ax-st { margin-top: 5px; }
.ax-ch b { white-space: normal; overflow: visible; line-height: 1.25; }
.snow-lvl { display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; margin-top: 8px; }
.snow-lvl[hidden] { display: none; }
.snow-lvl .field-label { margin: 0; }
.snow-lvl .field-hint { margin: 0; flex-basis: 100%; }
.jv-rep summary { flex-wrap: wrap; }
.jv-hl { flex: 1 1 260px; font-size: 12.5px; color: var(--txt); }
/* Snow row: label + switch, the hint below, the amount on a line of its own (phones too).
   :has(#snow-switch) lifts it above the phone rules for rows with a segmented choice. */
.settings-tabbed .set-card-list > .field-row.snow-row:has(#snow-switch) {
  grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label control" "hint control" "lvl lvl"; row-gap: 2px;
}
.set-card-list > .field-row.snow-row:has(#snow-switch) > .snow-lvl { grid-area: lvl; justify-self: stretch; align-self: start; margin-top: 10px; }
.set-card-list > .field-row.snow-row:has(#snow-switch) > .switch { grid-area: control; justify-self: end; align-self: center; margin: 0; }


/* ---- The assistant (beta): a large window in the middle, in the dashboard's own colours ---- */
.mia-btn { position: relative; display: inline-grid; place-items: center; padding: 0; color: var(--txt-dim); }
.mia-btn[hidden] { display: none !important; }
.mia-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.mia-btn:hover { color: var(--txt); border-color: var(--standby); }
.mia-btn .mia-dot { position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--offline); }
.mia-btn.on .mia-dot { background: var(--trading); }
.mia-btn-wide { margin-left: 14px; }
.mia-btn-narrow { display: none; margin-right: 6px; }
@media (max-width: 700px) { .mia-btn-wide { display: none !important; } .mia-btn-narrow:not([hidden]) { display: inline-grid; } }

.mia { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; }
.mia[hidden] { display: none; }
.mia-scrim { position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(6px); opacity: 0; transition: opacity .2s ease; }
.mia.show .mia-scrim { opacity: 1; }
.mia-win { position: relative; width: min(760px, calc(100% - 32px)); height: min(760px, calc(100% - 48px)); display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 30px 80px #0006; overflow: hidden;
  transform: scale(.97) translateY(8px); opacity: 0; transition: transform .22s cubic-bezier(.2,.8,.2,1), opacity .18s ease; }
.mia.show .mia-win { transform: none; opacity: 1; }
.mia-top { display: flex; align-items: center; gap: 6px; padding: 14px 14px 0 22px; }
.mia-who { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.mia-who b { font-size: 16px; }
.mia-who small { color: var(--txt-dim); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mia-ic { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 10px; background: transparent; color: var(--txt-dim); cursor: pointer; }
.mia-ic:hover { background: var(--hover); color: var(--txt); }
.mia-ic[hidden] { display: none; }
.mia-ic.mia-new { width: auto; display: inline-flex; gap: 6px; padding: 0 11px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--txt); background: var(--hover); }
@media (max-width: 520px) { .mia-ic.mia-new span { display: none; } .mia-ic.mia-new { padding: 0; width: 34px; justify-content: center; } }
.mia-ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#mia-voice .mia-wave { display: none; } #mia-voice[aria-pressed="true"] { color: var(--standby); }
#mia-voice[aria-pressed="true"] .mia-mute { display: none; } #mia-voice[aria-pressed="true"] .mia-wave { display: block; }

.mia-stage { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 18px 24px 16px; }
.mia-core { --lvl: 0; position: relative; width: 132px; height: 132px; display: grid; place-items: center; }
.mia-core i { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid var(--standby); opacity: .25; }
.mia-core i:nth-child(2) { inset: 14px; opacity: .45; } .mia-core i:nth-child(3) { inset: 28px; opacity: .7; }
.mia-core span { width: 52px; height: 52px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, color-mix(in srgb, var(--standby) 40%, #fff), var(--standby) 70%);
  box-shadow: 0 0 calc(18px + var(--lvl) * 40px) color-mix(in srgb, var(--standby) 55%, transparent); transition: transform .12s ease, box-shadow .12s ease; transform: scale(calc(1 + var(--lvl) * .35)); }
.mia-core[data-s="idle"] i { animation: miaBreathe 4s ease-in-out infinite; }
.mia-core[data-s="idle"] i:nth-child(2) { animation-delay: .4s; } .mia-core[data-s="idle"] i:nth-child(3) { animation-delay: .8s; }
.mia-core[data-s="listen"] i, .mia-core[data-s="hear"] i { transform: scale(calc(1 + var(--lvl) * .12)); transition: transform .1s ease; }
.mia-core[data-s="hear"] span { background: radial-gradient(circle at 35% 35%, #fff, var(--trading) 70%); }
.mia-core[data-s="think"] i:nth-child(1) { border-color: transparent; border-top-color: var(--standby); opacity: .9; animation: miaSpin 1s linear infinite; }
.mia-core[data-s="think"] i:nth-child(2) { border-color: transparent; border-right-color: var(--standby); opacity: .6; animation: miaSpin 1.6s linear infinite reverse; }
.mia-core[data-s="speak"] i { animation: miaRing 1.4s ease-out infinite; } .mia-core[data-s="speak"] i:nth-child(2) { animation-delay: .45s; } .mia-core[data-s="speak"] i:nth-child(3) { animation-delay: .9s; }
.mia-core[data-s="off"] i { border-color: var(--offline); } .mia-core[data-s="off"] span { background: var(--offline); box-shadow: none; }
@keyframes miaBreathe { 50% { transform: scale(1.04); opacity: .55; } }
@keyframes miaSpin { to { transform: rotate(360deg); } }
@keyframes miaRing { from { transform: scale(.75); opacity: .8; } to { transform: scale(1.12); opacity: 0; } }
.mia-say { margin: 0; max-width: 560px; text-align: center; color: var(--txt); font-size: 16px; line-height: 1.5; min-height: 24px;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.mia-call { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 22px; border-radius: 999px; border: 1px solid var(--standby);
  background: color-mix(in srgb, var(--standby) 14%, transparent); color: var(--txt); font: inherit; font-weight: 600; cursor: pointer; }
.mia-call svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.mia-call.on { background: var(--blocked); border-color: var(--blocked); color: #fff; }
.mia-call:disabled { opacity: .45; cursor: default; }

.mia-log { flex: 1; overflow-y: auto; padding: 6px 24px 10px; display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--line-soft); }
.mia-log[hidden] { display: flex; visibility: hidden; }
.mia-msg { max-width: 82%; display: flex; flex-direction: column; }
.mia-msg.fresh { animation: miaIn .2s ease both; }
.mia-msg p { margin: 0; padding: 9px 14px; border-radius: 16px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.mia-msg small { color: var(--txt-faint); font-size: 11px; margin: 3px 4px 0; }
.mia-msg.me { align-self: flex-end; align-items: flex-end; }
.mia-msg.me p { background: color-mix(in srgb, var(--standby) 16%, var(--panel-2)); border: 1px solid color-mix(in srgb, var(--standby) 35%, transparent); }
.mia-msg.her { align-self: flex-start; } .mia-msg.her p { background: var(--panel-2); border: 1px solid var(--line-soft); }
.mia-msg.err p { color: var(--blocked); }
.mia-msg.wait p { display: inline-flex; gap: 4px; padding: 13px 14px; }
.mia-msg.wait i { width: 6px; height: 6px; border-radius: 50%; background: var(--txt-dim); animation: miaDot 1s infinite ease-in-out; }
.mia-msg.wait i:nth-child(2) { animation-delay: .15s; } .mia-msg.wait i:nth-child(3) { animation-delay: .3s; }
.mia-play { border: 0; background: none; color: var(--standby); font: inherit; font-size: 11px; cursor: pointer; padding: 0; }
@keyframes miaDot { 0%, 80%, 100% { opacity: .35; } 40% { opacity: 1; } }
@keyframes miaIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.mia-compose { display: flex; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--line-soft); }
.mia-compose input { flex: 1; height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--sunken); color: var(--txt); font: inherit; font-size: 14.5px; }
.mia-compose input:focus { outline: none; border-color: var(--standby); }
.mia-send { width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--standby); color: var(--bg); cursor: pointer; display: grid; place-items: center; }
.mia-send svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.mia-send:disabled { opacity: .35; cursor: default; }
/* A phone: nearly the whole screen, clear of its rounded corners. */
@media (max-width: 700px) {
  .mia-win { width: calc(100% - 16px); height: calc(100% - 28px); border-radius: 28px; }
  .mia-top { padding: 16px 12px 0 22px; }
  .mia-core { width: 112px; height: 112px; }
  .mia-log { padding: 6px 18px 10px; }
  .mia-compose { padding: 12px 18px 22px; }
  .mia-compose input { font-size: 16px; }   /* iOS zooms into smaller fields */
}

/* Advanced → Features in testing */
.ft { display: flex; flex-direction: column; gap: 14px; }
.ft-intro { margin: 0; color: var(--txt-dim); font-size: 13.5px; line-height: 1.5; }
.ft-intro b { color: var(--txt); }
.ft-card { display: flex; flex-direction: column; gap: 10px; }
.ft-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ft-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--standby); background: color-mix(in srgb, var(--standby) 13%, transparent); flex: none; }
.ft-ic svg { width: 21px; height: 21px; }
.ft-t { flex: 1; min-width: 160px; display: flex; flex-direction: column; }
.ft-t b { font-size: 15px; }
.ft-t small { color: var(--txt-dim); }
.ft-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: 13px; }
.ft-dl dt { color: var(--txt-faint); }
.ft-dl dd { margin: 0; color: var(--txt-dim); }
@media (max-width: 560px) { .ft-dl { grid-template-columns: 1fr; } .ft-dl dt { margin-top: 4px; } }

/* See as: the bar while looking in as someone, and the picker */
#see-as-bar { position: sticky; top: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 14px; background: #6d4bd8; color: #fff; font-size: 13.5px; box-shadow: 0 4px 18px -8px rgba(60, 30, 150, .6); }
#see-as-bar svg { width: 18px; height: 18px; flex: none; }
#see-as-bar b { font-weight: 700; }
#see-as-bar .btn { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.35); }
#see-as-bar .btn:hover { background: rgba(255,255,255,.26); }
body.see-as { box-shadow: inset 0 0 0 3px #6d4bd8; }
.sa2 { display: flex; flex-direction: column; gap: 12px; }
.sa2-list { display: flex; flex-direction: column; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--panel); overflow: hidden; }
.sa2-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.sa2-row + .sa2-row { border-top: 1px solid var(--line-soft); }
.sa2-row[hidden] { display: none; }
.sa2-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sa2-who small { color: var(--txt-faint); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* New trades for the demo: a window over the dimmed, blurred page */
body.nt-open { overflow: hidden; }
.nt-back { position: fixed; inset: 0; z-index: 8500; display: grid; place-items: center; padding: 16px;
  background: rgba(8, 12, 20, .5); backdrop-filter: blur(7px) saturate(.8); -webkit-backdrop-filter: blur(7px) saturate(.8); animation: ntIn .22s ease-out; }
@keyframes ntIn { from { opacity: 0; } }
.nt-card { width: min(640px, 100%); max-height: min(88vh, 860px); display: flex; flex-direction: column; background: var(--panel); color: var(--txt);
  border-radius: 22px; border: 1px solid var(--line-soft); box-shadow: 0 30px 80px -20px rgba(0,0,0,.55), 0 0 0 1px color-mix(in srgb, var(--standby) 30%, transparent);
  animation: ntPop .28s cubic-bezier(.2,.9,.3,1.2); overflow: hidden; }
@keyframes ntPop { from { transform: translateY(14px) scale(.97); opacity: 0; } }
.nt-head { display: flex; align-items: flex-start; gap: 14px; padding: 20px 20px 8px; }
.nt-head h3 { margin: 0; font-size: 18px; }
.nt-head p { margin: 3px 0 0; color: var(--txt-dim); font-size: 13.5px; }
.nt-badge { flex: none; min-width: 42px; height: 42px; padding: 0 8px; border-radius: 13px; display: grid; place-items: center; font-weight: 800; font-size: 18px;
  color: #fff; background: linear-gradient(135deg, var(--standby), color-mix(in srgb, var(--standby) 55%, #3b82f6)); box-shadow: 0 8px 20px -10px var(--standby); }
.nt-head > div { flex: 1; min-width: 0; }
.nt-x { border: 0; background: none; color: var(--txt-dim); font-size: 24px; width: 34px; height: 34px; border-radius: 10px; cursor: pointer; }
.nt-x:hover { background: var(--hover); }
.nt-body { padding: 4px 20px 12px; overflow: auto; }
.nt-hint { margin: 0 0 10px; color: var(--txt-dim); font-size: 13px; }
.nt-list { display: flex; flex-direction: column; gap: 6px; }
.nt-row, .nt-opt { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 13px; cursor: pointer; }
.nt-row:hover, .nt-opt:hover { background: var(--hover); }
.nt-chk, .nt-tot { cursor: default; }
.nt-tot { border-style: dashed; }
.nt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nt-main small { color: var(--txt-faint); font-size: 12.5px; }
.nt-main em { font-style: normal; color: #d99a0b; }
.nt-side { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; }
.nt-side.buy { color: #1f9d6b; background: color-mix(in srgb, #1f9d6b 14%, transparent); }
.nt-side.sell { color: #d9534f; background: color-mix(in srgb, #d9534f 14%, transparent); }
.nt-pl { font-variant-numeric: tabular-nums; padding: 4px 9px; border-radius: 999px; font-size: 13px; }
.nt-pl.up { color: #1f9d6b; background: color-mix(in srgb, #1f9d6b 12%, transparent); }
.nt-pl.down { color: #d9534f; background: color-mix(in srgb, #d9534f 12%, transparent); }
.nt-src { border: 1px solid var(--line-soft); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.nt-src-h { display: flex; align-items: center; gap: 10px; }
.nt-src .nt-opt { border-radius: 10px; }
.nt-foot { display: flex; align-items: center; gap: 8px; padding: 12px 20px 18px; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.nt-sp { flex: 1; }
.nt-done { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 24px 0 10px; }
.nt-ok { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; color: #fff; background: #1f9d6b; }
@media (max-width: 560px) { .nt-card { border-radius: 18px; } }

/* Data check */
.dc { display: flex; flex-direction: column; gap: 12px; }
.dc code { font-size: 12px; background: var(--hover); padding: 1px 5px; border-radius: 5px; }
.dc-sum { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.dc-pill { font-size: 12.5px; padding: 3px 9px; border-radius: 999px; font-weight: 600; }
.dc-pill.same { color: #1f9d6b; background: color-mix(in srgb, #1f9d6b 12%, transparent); }
.dc-pill.differs { color: #e8661c; background: color-mix(in srgb, #e8661c 12%, transparent); }
.dc-pill.none { color: var(--blocked); background: color-mix(in srgb, var(--blocked) 12%, transparent); }
.dc-tw { max-height: 340px; overflow: auto; border: 1px solid var(--line-soft); border-radius: 12px; }
.dc-t { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.dc-t th, .dc-t td { padding: 6px 9px; text-align: left; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.dc-t th { position: sticky; top: 0; background: var(--panel); color: var(--txt-faint); font-weight: 600; }
.dc-t .num { text-align: right; font-variant-numeric: tabular-nums; }
.dc-t tr.dc-differs td:nth-child(3) { color: #e8661c; font-weight: 600; }
.dc-t tr.dc-none td:nth-child(3) { color: var(--blocked); font-weight: 600; }
.dc-acts { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

.nt-row.off { opacity: .55; }
.nt-row { cursor: default; flex-wrap: wrap; }
.nt-src-sel { margin-top: 3px; max-width: 100%; font: inherit; font-size: 12.5px; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line-soft); background: var(--panel); color: var(--txt); }
.nt-rep { color: #d99a0b !important; }
.nt-ign { border: 0; background: none; color: var(--txt-faint); font: inherit; font-size: 12px; cursor: pointer; padding: 4px 6px; border-radius: 7px; }
.nt-ign:hover { color: var(--blocked); background: color-mix(in srgb, var(--blocked) 10%, transparent); }
.nt-sum { font-size: 13px; color: var(--txt-dim); display: inline-flex; gap: 6px; align-items: center; }
.nt-head p { max-width: 56ch; }
@media (max-width: 560px) { .nt-pl-wrap { margin-left: auto; } .nt-foot .btn { flex: 1; } .nt-sum { flex-basis: 100%; } }

#see-as-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 9100; padding: 10px 16px; border-radius: 12px;
  background: #6d4bd8; color: #fff; font-size: 13.5px; box-shadow: 0 10px 30px -10px rgba(60,30,150,.6); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
#see-as-toast.on { opacity: 1; transform: translate(-50%, 0); }
