/* Quantum Flight · approved visual system, 2026-09-06.
   Presentation only: keep the renderer, native hidden states, trading controls,
   adaptive navigation and live-viewer geometry in their owning modules. */

/* 01 · Shared palette and cinematic surface */
:root {
  color-scheme: dark;
  --qf-surface: #131a24;
  --qf-surface-raised: #18212d;
  --qf-surface-inset: #0b131d;
  --qf-line: #2b3849;
  --qf-line-bright: #3a495b;
  --qf-shadow: 0 4px 18px rgba(0, 0, 0, .08);
  --qf-ease: cubic-bezier(.2, .8, .2, 1);
  --bg: #0b0f14;
  --panel: var(--qf-surface);
  --panel-2: var(--qf-surface-raised);
  --border: var(--qf-line);
  --text: #eef3f9;
  --muted: #9aaabd;
  --cyan: #86d8fc;
  --accent: #86d8fc;
  --info: #86d8fc;
  --violet: #bac5e5;
  --ok: #88dcb4;
  --green: #88dcb4;
  --warn: #f1c678;
  --amber: #f1c678;
  --danger: #ff99aa;
  --red: #ff99aa;
  --n0: #091422;
  --n1: #112033;
  --n2: #1a2b40;
  --n3: #3a5069;
  --n4: #a7b8cc;
  --n5: #d7e5f3;
  --n6: #edf5fc;
  --radius-md: 10px;
  --radius-lg: 18px;
  --fs-label: 15px;
  --fs-body: 17px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI Variable Text", "Segoe UI", "Microsoft JhengHei", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.ambient-grid {
  background:
    linear-gradient(180deg, rgba(4, 12, 25, .12), rgba(5, 13, 27, .42) 54%, rgba(5, 12, 24, .82)),
    url('/assets/cinematic-orbit-v1.png') center top / cover no-repeat;
  opacity: 1;
  animation: none;
}
.ambient-grid::before {
  background: linear-gradient(90deg, rgba(5, 13, 26, .25), transparent 62%);
}
.ambient-grid::after { display: none; }
::selection { color: #f8fcff; background: #28556f; }
.muted { color: var(--muted); }

/* Do not change the one-screen workbench's main padding/height chain. */
body:not(:has(#internal-browse.panel.active)) main {
  max-width: 1600px;
  padding-top: 35px;
  padding-inline: 38px;
}
main > .panel:not(#internal-browse) { min-width: 0; }
.panel > .section-title {
  min-height: 0;
  margin: 0 0 28px;
  padding: 0;
  gap: 24px;
  border: 0;
  background: none;
  box-shadow: none;
}
.section-title::before, .section-title::after,
.panel:not(#internal-browse) .module-card::before,
.panel:not(#internal-browse) .module-card::after { display: none; }
.section-title h1 {
  margin: 0;
  color: var(--text);
  font-size: 36px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -.025em;
}
.page-heading { display: flex; align-items: center; gap: 13px; min-width: 0; }
.page-heading > span { min-width: 0; overflow-wrap: anywhere; }
.page-heading-icon { display: block; flex: 0 0 30px; width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; color: var(--accent); }
/* This single title lives in the header's stacking context. Desktop uses the
   reserved caption space; mobile joins the existing logo row in normal flow. */
.workbench-route-title { display: none; }
body:not(.auth-locked):has(#internal-browse.panel.active) .workbench-route-title {
  display: flex;
  position: static;
  flex: 0 0 auto;
  height: auto;
  padding: 4px 0 8px;
  min-width: 0;
  margin: 0;
  gap: 9px;
  color: var(--text);
  font-size: 17px;
  font-weight: 550;
  line-height: 1.25;
  letter-spacing: 0;
  pointer-events: none;
  user-select: none;
}
.workbench-route-title .page-heading-icon { flex-basis: 20px; width: 20px; height: 20px; }
.section-title p {
  max-width: 72ch;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
  letter-spacing: 0;
}
.section-title.compact { margin: 34px 0 20px; }
.section-title h2, .panel h2 {
  color: var(--text);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -.02em;
}
.panel h3 { color: var(--text); font-size: 20px; line-height: 1.4; }
.section-kicker, .eyebrow {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .07em;
}
.section-title > .actions { flex-shrink: 0; }
#dashboard .section-title #startAllBotsBtn { border-color: var(--qf-line); background: transparent; color: var(--text); }
#dashboard .section-title #startAllBotsBtn:hover:not(:disabled) { border-color: #5a7085; background: var(--qf-surface-raised); box-shadow: none; }
.actions { gap: 10px; }

/* 02 · Controls, cards and readable forms (not the live trading rail) */
:is(.panel:not(#internal-browse), dialog) :is(.card, .form-card, .module-card) {
  border: 1px solid var(--qf-line);
  border-radius: 18px;
  background: var(--qf-surface);
  box-shadow: var(--qf-shadow);
  backdrop-filter: none;
}
.panel:not(#internal-browse) .form-card { padding: 28px; }
:is(.panel:not(#internal-browse), dialog) :is(button, .button) {
  border-radius: 10px;
  font-family: inherit;
  font-weight: 550;
  letter-spacing: 0;
  text-transform: none;
  transition: background-color 160ms var(--qf-ease), border-color 160ms var(--qf-ease), color 160ms var(--qf-ease), box-shadow 160ms var(--qf-ease);
}
:is(.panel:not(#internal-browse), dialog) :is(.primary, .secondary, .danger, .start-all) {
  min-height: 48px;
  padding: 11px 18px;
  font-size: 16px;
  line-height: 1.4;
  box-shadow: none;
}
:is(.panel:not(#internal-browse), dialog) :is(.primary, .start-all) {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #102331;
  text-shadow: none;
}
:is(.panel:not(#internal-browse), dialog) :is(.primary, .start-all):hover:not(:disabled) {
  border-color: #d5f2ff;
  background: #b1e7fd;
  box-shadow: 0 0 0 3px rgba(145, 217, 246, .1);
}
:is(.panel:not(#internal-browse), dialog) .secondary {
  border: 1px solid var(--qf-line-bright);
  background: var(--qf-surface-raised);
  color: var(--text);
}
:is(.panel:not(#internal-browse), dialog) .secondary:hover:not(:disabled) {
  border-color: #8eb9d7;
  background: #28445d;
}
:is(.panel:not(#internal-browse), dialog) .danger {
  border: 1px solid rgba(255, 155, 170, .4);
  background: rgba(94, 37, 53, .4);
  color: #ffb0bc;
}
:is(.panel:not(#internal-browse), dialog) .danger:hover:not(:disabled) {
  border-color: #ffa2b1;
  background: rgba(126, 46, 65, .55);
}
:is(.panel:not(#internal-browse), dialog) :is(.primary, .secondary, .danger, .start-all):active:not(:disabled) {
  filter: brightness(.9);
  box-shadow: inset 0 2px 4px rgba(0, 6, 16, .2);
}
:is(.panel:not(#internal-browse), dialog) button:disabled { opacity: .45; cursor: not-allowed; }
:is(.panel:not(#internal-browse), dialog) :is(button, input, select, textarea, summary):focus-visible {
  outline: 2px solid #a5e3ff;
  outline-offset: 3px;
}
:is(.panel:not(#internal-browse), dialog) label {
  color: #d8e6f3;
  font-size: 16px;
  font-weight: 550;
  line-height: 1.5;
  letter-spacing: 0;
}
:is(.panel:not(#internal-browse), dialog) :is(input, select, textarea):not([type="checkbox"]):not([type="radio"]):not([type="range"]) {
  min-width: 0;
  min-height: 50px;
  border: 1px solid #3b526b;
  border-radius: 10px;
  background-color: var(--qf-surface-inset);
  color: var(--text);
  font-family: inherit;
  font-size: 17px;
  line-height: 1.5;
  letter-spacing: 0;
  box-shadow: none;
}
:is(.panel:not(#internal-browse), dialog) :is(input, textarea)::placeholder { color: #8298ae; }
:is(.panel:not(#internal-browse), dialog) :is(input, select, textarea):focus { border-color: #8bd8fa; }
:is(.panel:not(#internal-browse), dialog) :is(input, select, textarea):disabled {
  border-color: #34445a;
  background-color: rgba(22, 34, 49, .7);
  color: #94a6ba;
}
:is(.panel:not(#internal-browse), dialog) :is(input[type="checkbox"], input[type="radio"]) {
  accent-color: #91d9f6;
}
:is(.panel:not(#internal-browse), dialog) :is(.field-help, .field-note, .account-form-hint, .language-note, .about-note, label small) {
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: 0;
}
:is(.panel:not(#internal-browse), dialog) .notice {
  margin-block: 18px;
  padding: 15px 18px;
  border: 1px solid var(--qf-line);
  border-radius: 12px;
  background: rgba(10, 28, 45, .75);
  color: #bbcedf;
  font-size: 15px;
  line-height: 1.65;
  box-shadow: none;
}

/* 03 · Prototype fleet cards: identity, two facts and a quiet status footer.
   Real controls remain in a native details disclosure; no fake readings. */
#dashboard .metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 27px;
  overflow: hidden;
  border: 1px solid var(--qf-line);
  border-radius: 16px;
  background: var(--qf-surface);
}
#dashboard .metric {
  container-type: inline-size;
  min-width: 0;
  min-height: 168px;
  padding: 24px 26px;
  border: 0;
  border-right: 1px solid var(--qf-line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
#dashboard .metric:last-child { border-right: 0; }
#dashboard .metric::before, #dashboard .metric::after,
#dashboard .metric-signal, #dashboard .metric-beacon { display: none; }
#dashboard .metric-head { gap: 9px; margin-bottom: 10px; }
#dashboard .metric-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--muted);
  box-shadow: none;
}
#dashboard .metric-icon svg { width: 20px; height: 20px; }
#dashboard .metric-label > span { color: var(--muted); font-size: 15px; font-weight: 400; letter-spacing: 0; }
#dashboard .metric-label > small { display: none; }
#dashboard .metric-reading { min-width: 0; flex-wrap: wrap; gap: 7px; align-items: baseline; }
#dashboard .metric .metric-reading > strong {
  min-width: 0;
  max-width: 100%;
  color: var(--text);
  font-size: 42px;
  font-weight: 560;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.03em;
  white-space: normal;
  overflow-wrap: anywhere;
  text-overflow: clip;
  text-shadow: none;
}
#dashboard .metric .metric-reading > small { color: var(--muted); font-size: 15px; line-height: 1.5; }
#dashboard .metric .metric-reading > :is(#metricUnrealized, #metricRealized) { font-size: clamp(16px, 7.4cqi, 30px); white-space: nowrap; overflow-wrap: normal; letter-spacing: -.025em; overflow-x: auto; scrollbar-width: thin; }
#dashboard .metric .metric-reading .qf-metric-total { color: var(--muted); font-size: 19px; font-weight: 400; letter-spacing: 0; white-space: nowrap; }
#dashboard .metric .metric-source { margin-top: 7px; color: var(--muted); font-size: 13px; }
#dashboard .bot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
#dashboard .bot-card.qf-fleet-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--qf-line);
  border-radius: 18px;
  background: var(--qf-surface);
  box-shadow: none;
  backdrop-filter: none;
  transition: border-color 160ms var(--qf-ease), box-shadow 160ms var(--qf-ease);
}
#dashboard .qf-fleet-card:hover { border-color: #476071; box-shadow: 0 5px 25px #0002; }
.bot-identity-ssot {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px;
  min-width: 0;
  vertical-align: middle;
}
.bot-identity-ssot > .bot-avatar-frame { flex-shrink: 0; }
#dashboard .qf-fleet-card .bot-head {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}
#dashboard .qf-fleet-card .bot-head-main { min-width: 0; width: 100%; }
#dashboard .qf-fleet-card .bot-card-identity { width: 100%; gap: 14px; }
#dashboard .qf-fleet-card .bot-card-avatar {
  flex: 0 0 60px;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  height: 60px;
  min-height: 60px;
  max-height: 60px;
  padding: 0;
  border: 1px solid #577084;
  border-radius: 50%;
  background: var(--qf-surface-raised);
  box-shadow: inset 0 0 0 4px #17212d, 0 3px 12px #0003;
}
#dashboard .qf-fleet-card .bot-card-identity > .bot-identity {
  flex: 1 1 auto;
  min-width: 0;
  overflow: visible;
  white-space: normal;
}
#dashboard .qf-fleet-card .bot-name,
#dashboard .qf-fleet-card .bot-head h3 {
  min-height: 0;
  margin: 0;
  color: var(--text);
  font-size: 24px;
  font-weight: 620;
  line-height: 1.28;
  letter-spacing: -.02em;
}
:is(#appShell, dialog) .bot-name-trigger,
#dashboard .qf-fleet-card .bot-name-trigger {
  display: inline;
  width: auto;
  max-width: 100%;
  min-height: 40px;
  padding: 5px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  overflow: visible;
  text-overflow: clip;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  max-height: none;
  max-block-size: none;
}
#dashboard .qf-fleet-card .bot-name-trigger:hover { color: var(--accent); }
/* The legacy heading, not only its rename button, caps names at two lines. */
#dashboard #botGrid .qf-fleet-card .bot-name {
  display: block;
  height: auto;
  max-height: none;
  max-block-size: none;
  overflow: visible;
  -webkit-line-clamp: unset;
  line-clamp: unset;
}
:is(#dashboard .qf-fleet-card, #cloud .qf-webhook-card, #botDetailsDialog .qf-detail-identity) .bot-avatar-frame::before { inset: -4px; border: 1px solid #3b5264; background: none; pointer-events: none; }
:is(#dashboard .qf-fleet-card, #cloud .qf-webhook-card, #botDetailsDialog .qf-detail-identity) .bot-avatar-frame img { background: var(--qf-surface-raised); }
:is(#dashboard .qf-fleet-card, #cloud .qf-webhook-card) :is(.bot-meta, .identity-meta) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 0;
  margin: 6px 0 0;
  padding: 0;
  color: var(--muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
:is(#dashboard .qf-fleet-card, #cloud .qf-webhook-card) :is(.bot-meta, .identity-meta) > span {
  display: inline;
  margin: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
}
:is(#dashboard .qf-fleet-card, #cloud .qf-webhook-card) :is(.bot-meta, .identity-meta) > :is(.qf-asset-badge, .asset-badge) {
  display: inline-block;
  padding: 0 6px;
  border: 1px solid #435467;
  border-radius: 4px;
  color: #b6d2e5;
  font: 400 12px/1.5 "Cascadia Code", Consolas, monospace;
  letter-spacing: 0;
}
#dashboard .qf-fleet-details {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin: 14px 0;
}
#dashboard .qf-fleet-details > div { min-width: 0; }
#dashboard .qf-fleet-details small { display: block; margin-bottom: 5px; color: var(--muted); font-size: 14px; }
#dashboard .qf-fleet-details strong { display: block; color: var(--text); font-size: 20px; font-weight: 550; line-height: 1.4; overflow-wrap: anywhere; }
#dashboard .qf-fleet-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--qf-line);
}
#dashboard .qf-fleet-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  position: relative;
  flex: 0 0 32px;
  align-self: flex-start;
  justify-content: center;
  width: 32px;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--green);
  font-size: 14px;
  line-height: 1.5;
}
#dashboard .qf-fleet-status > [aria-hidden="true"] { flex: 0 0 auto; color: inherit; font-size: 15px; line-height: 1; }
#dashboard .qf-fleet-status:is(:hover, :focus-visible)::after { content: attr(data-explanation); position: absolute; z-index: 25; top: calc(100% + 6px); right: 0; width: max-content; max-width: min(290px, 70vw); padding: 12px; border: 1px solid var(--qf-line); border-radius: 10px; background: #101923; color: var(--text); box-shadow: 0 8px 24px #0006; font-size: 14px; line-height: 1.55; text-align: left; white-space: normal; pointer-events: none; }
#dashboard .qf-symbol-action { display: block; min-height: 32px; padding: 0; border: 0; border-radius: 4px; background: none; text-align: left; }
#dashboard .qf-symbol-action:hover strong { color: var(--accent); }
#dashboard .qf-fleet-status[data-tone="warning"] { color: var(--amber); }
#dashboard .qf-fleet-status[data-tone="error"] { color: var(--red); }
#dashboard .qf-fleet-status[data-tone="neutral"] { color: var(--muted); }
#dashboard .qf-fleet-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 8px; min-width: 0; width: 100%; }
#dashboard .qf-fleet-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  min-width: 0;
  padding: 7px 12px;
  border: 1px solid var(--qf-line);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
}
#dashboard .qf-fleet-actions button:hover { border-color: #5a7085; background: var(--qf-surface-raised); }
#dashboard .qf-fleet-actions svg { width: 20px; height: 20px; }
#dashboard .qf-fleet-controls { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; margin-top: 12px; border: 0; background: none; }
#dashboard .qf-fleet-controls-body { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
#dashboard .qf-fleet-controls .bot-head-flags { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
#dashboard .qf-fleet-controls .bot-include-start-all { min-height: 32px; padding: 4px 10px; font-size: 14px; }
#dashboard .qf-fleet-controls .bot-include-start-all.is-on { color: #b6dced; border-color: #3a5264; background: var(--qf-surface-raised); }
#dashboard .bot-stats { container-type: inline-size; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; margin-block: 8px 12px; }
#dashboard .bot-stats > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; min-height: 38px; padding: 6px 0; border: 0; border-radius: 0; background: none; }
#dashboard .bot-stats :is(small, span) { color: var(--muted); font-size: 13px; font-weight: 400; }
#dashboard .bot-stats strong { margin-top: 0; max-height: none; color: var(--text); font-family: inherit; font-size: 16px; font-weight: 550; line-height: 1.35; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: visible; text-overflow: clip; }
#dashboard .bot-stats > .qf-pnl-row { grid-column: 1 / -1; display: flex; border-bottom: 1px solid var(--qf-line); }
#dashboard .bot-stats > .qf-market-row { flex-wrap: wrap; padding-top: 10px; }
/* Preserve numeric tokens. Oversized edge cases remain readable in their own
   value field, never through a clipped digit or page-wide horizontal scroll. */
#dashboard .bot-stats :is([data-stat="pnl"], [data-stat="realized"]) { min-width: 0; max-width: 100%; margin-top: 0; font-size: clamp(14px, 5.3cqi, 19px); text-align: right; white-space: nowrap; word-break: normal; overflow-wrap: normal; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
#dashboard .connection-line { margin-block: 12px; color: var(--muted); font-size: 14px; line-height: 1.55; }
#dashboard .bot-account-window { grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; justify-content: stretch; margin-top: 0; padding: 9px 12px; border-color: var(--qf-line); border-radius: 10px; background: var(--qf-surface-inset); text-align: left; white-space: normal; }
#dashboard .bot-account-window :is(.bot-account-window-kicker, .bot-account-window-cta) { color: var(--muted); font-size: 13px; font-weight: 550; }
#dashboard .bot-account-window :is(strong, button) { color: var(--text); }
#dashboard .bot-account-window :is(.bot-account-window-name, .bot-account-window-spec) { min-width: 0; max-width: none; overflow: visible; white-space: normal; overflow-wrap: anywhere; text-overflow: clip; }
#dashboard .bot-account-window .bot-account-window-name { font-size: 16px; line-height: 1.4; }
#dashboard .bot-account-window-head { flex-wrap: wrap; gap: 5px 12px; }
#dashboard .qf-fleet-card .reconcile-warning { margin-block: 12px; color: var(--amber); font-size: 14px; line-height: 1.6; white-space: normal; overflow-wrap: anywhere; }
#dashboard .bot-quick-trade { margin-top: auto; padding-top: 2px; }
#dashboard .bot-quick-trade .qt-qty input { min-height: 44px; padding: 0; border: 0; border-radius: 0; background: none; font-size: 16px; }
#dashboard .bot-quick-trade .qt-side:disabled { opacity: 1; background: #29323e; color: #9aaabd; }
#dashboard .bot-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; gap: 8px; margin-top: 12px; }
#dashboard .bot-actions > button { min-width: 0; min-height: 44px; padding: 8px 6px; font-size: 14px; }
#dashboard .bot-actions > .bot-more { width: 44px; margin: 0; }
#dashboard .bot-group-bar { margin: 0 0 18px; padding: 0; border: 0; background: none; box-shadow: none; gap: 10px; }
#dashboard .bot-group-bar :is(button, select) { min-height: 40px; }
#dashboard .bot-group-count { margin-left: auto; color: var(--muted); font-size: 14px; }

/* 04 · Prototype Webhook cards: identity header, complete URL and visible actions. */
#cloud .webhook-route-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  margin-bottom: 26px;
  padding: 28px 25px;
  border: 1px solid #2c4252;
  border-radius: 14px;
  background: linear-gradient(110deg, #13232e, #121a23 70%);
}
#cloud .webhook-route-step { display: grid; justify-items: center; align-content: start; gap: 16px; min-width: 0; color: var(--text); font-size: clamp(16px, 1.7vw, 22px); text-align: center; }
#cloud .webhook-route-step > svg { width: 84px; height: 84px; color: var(--text); }
#cloud .webhook-route-name { color: var(--muted); font-size: 14px; line-height: 1.5; min-height: 3em; display: grid; align-items: center; }
#cloud .webhook-route-description { color: var(--muted); font-size: 16px; line-height: 1.7; margin: -8px 0 24px; }
#cloud .webhook-route-brand { display: block; flex-shrink: 0; object-fit: contain; }
#cloud .webhook-route-brand-tradingview { width: 84px; height: 84px; }
#cloud .webhook-route-brand-quantwing { width: 84px; height: 84px; }
#cloud .webhook-route-arrow { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; color: #627b91; font-size: 22px; line-height: 1; }
#cloud .webhook-route-note { margin-left: auto; color: var(--muted); font-size: 14px; text-align: right; }
#cloud .cloud-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
#cloud .cloud-feedback { margin: 0 0 22px; }
#cloud .cloud-feedback:has(> .notice.hidden):has(> button.hidden) { display: none; }
#cloud .cloud-feedback .notice { margin: 0 0 10px; color: var(--muted); font-size: 15px; line-height: 1.6; }
#cloud .cloud-feedback > button { min-height: 44px; }
#cloud .cloud-grid > .cloud-device-card { padding: 0; border: 0; background: none; box-shadow: none; backdrop-filter: none; }
#cloud .cloud-device-card > .subsection-heading { margin-bottom: 8px; }
#cloud .cloud-device-card > .subsection-heading .eyebrow { display: none; }
#cloud .cloud-device-card h2 { margin: 0; font-size: 24px; }
#cloud .cloud-device-card > p.muted { margin: 0 0 22px; font-size: 15px; line-height: 1.65; }
#cloud .cloud-list { display: grid; gap: 15px; }
#cloud .cloud-webhook-item.qf-webhook-card {
  display: block;
  min-width: 0;
  padding: 22px 24px;
  border: 1px solid var(--qf-line);
  border-radius: 16px;
  background: linear-gradient(115deg, #161f2b, #121a23);
  box-shadow: none;
  backdrop-filter: none;
  transition: border-color 200ms var(--qf-ease), box-shadow 200ms var(--qf-ease);
}
#cloud .qf-webhook-card:hover { border-color: #476071; box-shadow: 0 5px 25px #0002; }
#cloud .qf-webhook-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 19px; }
#cloud .cloud-webhook-main { min-width: 0; }
#cloud .cloud-webhook-identity {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 18px;
  min-width: 0;
  max-width: 100%;
}
#cloud .cloud-webhook-identity > :not(.bot-avatar-frame) { min-width: 0; }
#cloud .qf-webhook-card .cloud-webhook-avatar {
  display: inline-flex;
  flex: 0 0 68px;
  width: 68px;
  min-width: 68px;
  max-width: 68px;
  height: 68px;
  min-height: 68px;
  max-height: 68px;
  padding: 0;
  border: 1px solid #577084;
  border-radius: 50%;
  background: var(--qf-surface-raised);
  box-shadow: inset 0 0 0 4px #17212d, 0 3px 12px #0003;
}
#cloud .qf-webhook-card .cloud-webhook-name {
  display: block;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font-size: 26px;
  font-weight: 620;
  line-height: 1.28;
  letter-spacing: -.02em;
  text-align: left;
  text-transform: none;
  white-space: normal;
  overflow-wrap: anywhere;
  overflow: visible;
  text-overflow: clip;
}
#cloud .qf-webhook-head > :is(button, .qf-webhook-more) {
  display: inline-grid;
  place-items: center;
  flex: 0 0 40px;
  min-height: 40px;
  min-width: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
}
#cloud .qf-webhook-head > button:hover { background: var(--qf-surface-raised); color: var(--text); }
#cloud .qf-webhook-url-row { display: flex; align-items: stretch; gap: 12px; min-width: 0; }
#cloud .qf-webhook-url-row > :is(code, .url-field, .qf-webhook-url) {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  min-height: 50px;
  margin: 0;
  padding: 13px 16px;
  border: 1px solid #2c3d50;
  border-radius: 10px;
  background: #0b131d;
  color: #b6dced;
  font: 400 14px/1.6 "Cascadia Code", Consolas, monospace;
  letter-spacing: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  user-select: all;
}
#cloud .qf-webhook-url-row :is(.url-field, .qf-webhook-url) code { min-width: 0; margin: 0; padding: 0; border: 0; background: none; font: inherit; color: inherit; white-space: inherit; overflow-wrap: anywhere; }
#cloud .qf-webhook-url-row .actions { display: flex; flex: 0 0 auto; flex-wrap: nowrap; align-items: stretch; gap: 10px; margin: 0; padding: 0; }
#cloud .qf-webhook-url-row .actions button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-width: 0; min-height: 48px; padding: 10px 18px; border-radius: 10px; font-size: 16px; font-weight: 550; line-height: 1.4; white-space: nowrap; }
#cloud .qf-webhook-url-row .actions [data-copy-target] { border: 1px solid var(--accent); background: var(--accent); color: #102331; }
#cloud .qf-webhook-url-row .actions [data-copy-target]:hover:not(:disabled) { background: #b0e6ff; border-color: #b0e6ff; }
#cloud .qf-webhook-url-row .actions [data-webhook-replace] { border: 1px solid var(--qf-line); background: transparent; color: var(--text); }
#cloud .qf-webhook-url-row .actions [data-webhook-replace]:hover:not(:disabled) { background: var(--qf-surface-raised); border-color: #5a7085; }
#cloud .qf-webhook-url-row .actions svg { width: 22px; height: 22px; }
#cloud .account-count { color: var(--muted); padding: 0; border: 0; background: none; font-size: 15px; font-weight: 400; }
#cloud .webhook-payload-grid { margin-top: 32px; grid-template-columns: minmax(0, 1fr); }
#cloud .alert-payload-card { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
#cloud .alert-payload-card > .template-head { grid-column: 1 / -1; margin: 0; padding: 0; border: 0; }
#cloud .alert-block { margin: 0; padding: 22px; border: 1px solid var(--qf-line); border-radius: 14px; background: var(--qf-surface-inset); }
#cloud .alert-block-head h3 { font-size: 19px; }
#cloud .alert-tag { color: #b7d7e9; border-color: var(--qf-line); background: rgba(43, 75, 95, .38); font-size: 12px; }
#cloud :is(.alert-fields, .alert-rules, .receiver-help) { color: var(--muted); font-size: 15px; line-height: 1.7; }
#cloud .alert-fields { min-width: 0; grid-template-columns: minmax(0, 1fr); }
#cloud .alert-fields > div { grid-template-columns: 70px minmax(0, 1fr); gap: 12px; }
#cloud .alert-shape { color: #d5ebfa; font-size: 15px; line-height: 1.8; overflow-x: auto; }
#cloud .alert-shape-tag { color: var(--muted); }
#cloud .json-template { margin-top: 16px; padding: 50px 18px 18px; border-color: var(--qf-line); border-radius: 12px; background: #0a1119; color: #b7d4ea; font-size: 15px; line-height: 1.8; }

/* 05 · Accounts, settings and API keep their full feature inventory */
#settings .settings-toolbar { margin-bottom: 24px; padding: 0; border: 0; background: none; box-shadow: none; gap: 16px; }
#settings .settings-search > span { color: var(--muted); font-size: 14px; }
#settings .settings-search-count { color: var(--muted); font-size: 14px; }
#settings .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 24px; }
#settings .settings-preferences-stack { display: grid; min-width: 0; gap: 24px; }
#settings .settings-preferences-stack[hidden] { display: none; }
#settings :is(.account-manager, .advanced-settings) { grid-column: 1 / -1; }
#settings :is(.member-head, .account-manager-head, .account-manager-title) { gap: 16px; }
#settings .member-avatar { width: 60px; min-width: 60px; height: 60px; border: 1px solid var(--qf-line-bright); box-shadow: none; background: #233b52; }
#settings .member-identity { min-width: 0; }
#settings .member-identity h2 { font-size: 24px; }
#settings :is(.member-identity p, .account-manager-title p) { color: var(--muted); font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
#settings .member-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#settings .settings-cloud-status { display: flex; align-items: center; gap: 12px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--qf-line); }
#settings .settings-cloud-status > span:first-child { flex: 0 0 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
#settings .settings-cloud-status > span.online { background: var(--green); box-shadow: 0 0 0 4px rgb(136 220 180 / 9%); }
#settings .settings-cloud-status > div { min-width: 0; }
#settings .settings-cloud-status small { display: block; color: var(--muted); font-size: 13px; }
#settings .settings-cloud-status strong { display: block; margin-top: 3px; color: var(--text); font-size: 16px; font-weight: 550; overflow-wrap: anywhere; }
#settings #settingsCloudNotice { margin: 14px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
#settings .account-manager-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
#settings .credential-panel { min-width: 0; padding: 0 28px 0 0; border-color: var(--qf-line); background: none; }
#settings .account-list-panel { min-width: 0; padding: 0; }
#settings .account-title-icon { width: 46px; min-width: 46px; height: 46px; border: 0; border-radius: 12px; background: rgba(138, 204, 238, .1); box-shadow: none; color: #bbdeef; }
#settings .secure-chip { color: #afc9da; border-color: var(--qf-line); background: rgba(34, 61, 80, .5); font-size: 12px; letter-spacing: 0; }
#settings .account-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
#accountDialog { width: min(600px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: 24px; border: 1px solid var(--qf-line); border-radius: 20px; color: var(--text); background: var(--qf-surface); box-shadow: 0 24px 80px #0008; overflow: auto; }
#accountDialog:not([open]) { display: none; }
#accountDialog::backdrop { background: #03080bb3; backdrop-filter: blur(8px); }
#accountDialog #accountEditor { padding: 0; border: 0; background: none; }
#accountDialog .qf-detail-header { margin-bottom: 18px; }
#accountDialog .qf-detail-header { display: flex; align-items: center; gap: 18px; }
#accountDialog .qf-detail-header h2 { margin: 0; font-size: 24px; }
#accountDialog .credential-form { gap: 18px; padding: 0; }
#accountDialog .credential-form::before { display: none; }
#accountDialog .credential-form > label { margin: 0; }
#accountDialog .account-env-note { margin: 0; min-height: 0; }
#accountDialog .account-env-note:empty { display: none; }
#accountDialog :is(input, select, button) { font-size: 16px; }
#accountDialog .account-form-actions { grid-column: 1 / -1; }
@media (max-width: 680px) { #settings .account-list { grid-template-columns: minmax(0, 1fr); } #accountDialog { padding: 18px; } #accountDialog .credential-form { grid-template-columns: minmax(0, 1fr); } }
#settings .account-card { padding: 0; border: 1px solid var(--qf-line); border-radius: 14px; background: var(--qf-surface-inset); box-shadow: none; }
#settings .account-card-head { padding: 18px; border-color: var(--qf-line); }
#settings .account-details { padding: 4px 18px; }
#settings .account-detail-row { grid-template-columns: 100px minmax(0, 1fr); min-height: 52px; border-color: var(--qf-line); }
#settings .account-card-actions { padding: 16px 18px; border-color: var(--qf-line); background: rgba(20, 37, 54, .56); flex-wrap: wrap; }
#settings .account-card-title h4 { color: #e1edf7; font-size: 20px; }
#settings .account-card h3 { font-size: 20px; }
#settings .account-card :is(small, p) { color: var(--muted); font-size: 14px; line-height: 1.55; }
#settings .switch-row, #botForm .switch-row { min-height: 76px; margin: 0; padding: 17px 0; border: 0; border-bottom: 1px solid var(--qf-line); border-radius: 0; background: none; gap: 20px; }
#settings #settingsForm > .section-kicker, #settings .safety-card > .section-kicker { position: static; display: block; margin-bottom: 6px; }
#settings #settingsForm h2, #settings .safety-card h2 { margin: 0 0 18px; padding: 0 0 18px; border-color: var(--qf-line); }
#settings .switch-row strong, #botForm .switch-row strong { color: #dfebf7; font-size: 17px; font-weight: 600; }
#settings .switch-row small, #botForm .switch-row small { margin-top: 5px; font-size: 14px; line-height: 1.55; }
#settings .switch-row:last-of-type { border-bottom: 0; }
#settings .entitlement-grid, #cloud .entitlement-grid, #settings .product-facts { gap: 12px; }
#settings .entitlement-grid > span, #cloud .entitlement-grid > span, #settings .product-facts > span {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--qf-line);
  border-radius: 11px;
  background: var(--qf-surface-inset);
  color: #a9bfd2;
  font-size: 14px;
  letter-spacing: 0;
}
#settings .entitlement-grid strong, #cloud .entitlement-grid strong, #settings .product-facts strong { margin-top: 7px; color: #e2edf6; font-size: 17px; font-weight: 550; overflow-wrap: anywhere; }
#settings .advanced-settings > summary strong { color: var(--text); font-size: 23px; }
#settings .advanced-settings > summary small { color: var(--muted); font-size: 15px; line-height: 1.6; }
#settings .advanced-settings-body { padding-top: 24px; gap: 24px; }
#settings .advanced-settings-body section { padding: 0; border: 0; background: none; }
#settings .advanced-safety { color: #b6c9d9; font-size: 15px; line-height: 1.8; }
#settings .about-brand { gap: 20px; }
#settings .about-brand img { width: 68px; height: 68px; border: 0; border-radius: 0; background: none; filter: none; box-shadow: none; }
#settings .about-brand p { color: var(--muted); font-size: 15px; }
#api .api-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
#api .api-command-head { gap: 20px; }
#api .api-command-head h2 { font-size: 24px; }
#api .api-command-head p { color: var(--muted); font-size: 15px; line-height: 1.6; }
#api .api-command-head > label { flex: 0 0 160px; min-width: 0; }
#api .api-key-status { margin-block: 22px; padding: 18px; border: 1px solid var(--qf-line); border-radius: 12px; background: var(--qf-surface-inset); }
#api .api-key-status strong { color: #e2f1fa; font-size: 24px; }
#api .api-key-status small { color: var(--muted); font-size: 14px; }
#api .module-heading { margin-bottom: 18px; }
#api .module-heading span { color: var(--text); font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
#api .module-heading small { color: var(--muted); font-size: 14px; line-height: 1.6; }
#api .module-heading i { display: none; }
:is(#api, dialog) .copy-field code { padding: 14px; border: 1px solid var(--qf-line); border-radius: 10px; background: var(--qf-surface-inset); color: #b1e1f7; font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
#api .api-command-list { gap: 0; }
#api .api-command-item { padding: 19px 0; border: 0; border-bottom: 1px solid var(--qf-line); border-radius: 0; background: none; }
#api .api-command-item:last-child { border-bottom: 0; }
#api .api-command-item.critical { padding-inline: 12px; border-left: 3px solid #806940; background: rgba(241, 198, 120, .045); }
#api .api-command-item :is(h3, strong) { color: #dfedf7; font-size: 18px; }
#api .api-command-item :is(p, small) { color: var(--muted); font-size: 14px; line-height: 1.6; }
#api .api-command-item pre { padding: 13px; border-color: var(--qf-line); border-radius: 9px; background: #071521; color: #bbdfee; font-size: 13px; line-height: 1.7; }
:is(.panel:not(#internal-browse), dialog) .copy-icon-btn { width: 44px; min-width: 44px; height: 44px; min-height: 44px; border-radius: 10px; border-color: var(--qf-line-bright); background: rgba(28, 49, 69, .7); color: #b4d8ed; }
:is(.panel:not(#internal-browse), dialog) .key-field-clear { color: #b7cadb; background: transparent; }

/* 06 · Native dialogs, guided creation and the existing crop controller */
dialog {
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 48px);
  border: 1px solid #46586c;
  border-radius: 22px;
  background: #151e29;
  color: var(--text);
  box-shadow: 0 28px 96px rgba(0, 5, 14, .66);
}
dialog::backdrop { background: rgba(2, 9, 18, .7); backdrop-filter: blur(7px); }
dialog > form { padding: 28px; }
dialog > form::before { display: none; }
dialog .dialog-title, .brand-dialog .dialog-title { margin: 0 0 24px; padding: 0 0 20px; gap: 20px; border-bottom: 1px solid var(--qf-line); }
dialog .dialog-title h2 { margin: 0 0 6px; color: var(--text); font-size: 27px; font-weight: 600; line-height: 1.4; letter-spacing: -.02em; }
dialog .dialog-title p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
dialog .icon-button { flex-shrink: 0; width: 40px; min-width: 40px; height: 40px; min-height: 40px; padding: 0; border: 1px solid var(--qf-line); background: rgba(31, 48, 66, .7); color: #c7dbea; font-size: 25px; }
dialog .dialog-actions, .brand-dialog .dialog-actions { margin: 24px 0 0; padding: 20px 0 0; gap: 10px; border-top: 1px solid var(--qf-line); justify-content: flex-end; flex-wrap: wrap; background: none; }
dialog .form-grid { gap: 20px; }
#botDetailsDialog { width: 620px; max-height: min(800px, calc(100dvh - 48px)); padding: 0; }
#botDetailsDialog .qf-detail-header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 16px; padding: 14px 22px; border-bottom: 1px solid var(--qf-line); background: #151e29; }
#botDetailsDialog .qf-detail-back { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; min-height: 44px; padding: 8px 10px; border: 1px solid transparent; background: transparent; color: var(--muted); font-size: 16px; }
#botDetailsDialog .qf-detail-back:hover { color: var(--text); border-color: var(--qf-line); background: var(--qf-surface-raised); }
#botDetailsDialog .qf-detail-back > svg { flex: 0 0 20px; width: 20px; height: 20px; }
#botDetailsDialog .qf-detail-header h2 { margin: 0; color: var(--text); font-size: 22px; font-weight: 600; line-height: 1.4; }
#botDetailsDialog .qf-detail-body { min-width: 0; padding: 24px; overflow-wrap: anywhere; }
#botDetailsDialog .qf-detail-identity { width: 100%; gap: 14px; margin-bottom: 24px; }
#botDetailsDialog .qf-detail-identity > .bot-avatar-frame {
  --qf-detail-avatar-size: 68px;
  flex: 0 0 var(--qf-detail-avatar-size);
  width: var(--qf-detail-avatar-size);
  min-width: var(--qf-detail-avatar-size);
  max-width: var(--qf-detail-avatar-size);
  height: var(--qf-detail-avatar-size);
  min-height: var(--qf-detail-avatar-size);
  max-height: var(--qf-detail-avatar-size);
  padding: 0;
  border: 1px solid #577084;
  border-radius: 50%;
  background: var(--qf-surface-raised);
  box-shadow: inset 0 0 0 4px #17212d, 0 3px 12px #0003;
}
#botDetailsDialog .qf-detail-identity > .bot-identity { min-width: 0; }
#botDetailsDialog .qf-detail-identity strong { display: block; font-size: 24px; font-weight: 600; line-height: 1.35; white-space: normal; overflow-wrap: anywhere; }
#botDetailsDialog .bot-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 6px; color: var(--muted); font-size: 14px; white-space: normal; }
#botDetailsDialog .qf-asset-badge { padding: 0 6px; border: 1px solid #435467; border-radius: 4px; font: 12px/1.6 "Cascadia Code", Consolas, monospace; }
#botDetailsDialog .qf-detail-status { margin-bottom: 22px; padding: 17px 18px; border: 1px solid var(--qf-line); border-radius: 12px; background: var(--qf-surface-inset); }
#botDetailsDialog .qf-detail-status h3 { margin: 0 0 7px; color: var(--green); font-size: 18px; font-weight: 600; }
#botDetailsDialog .qf-detail-status[data-tone="warning"] h3 { color: var(--amber); }
#botDetailsDialog .qf-detail-status[data-tone="error"] h3 { color: var(--red); }
#botDetailsDialog .qf-detail-status[data-tone="neutral"] h3 { color: var(--muted); }
#botDetailsDialog .qf-detail-status p { margin: 0; color: var(--text); font-size: 15px; line-height: 1.7; }
#botDetailsDialog .bot-diagnostics { margin: 0 0 22px; }
#botDetailsDialog .bot-diagnostic-item p { white-space: normal; overflow-wrap: anywhere; font-size: 15px; line-height: 1.65; }
#botDetailsDialog .qf-detail-facts { margin: 0; }
#botDetailsDialog .qf-detail-facts > div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; padding: 16px 0; border-top: 1px solid var(--qf-line); }
#botDetailsDialog .qf-detail-facts dt { color: var(--muted); font-size: 14px; }
#botDetailsDialog .qf-detail-facts dd { margin: 0; color: var(--text); font-size: 15px; line-height: 1.6; white-space: normal; overflow-wrap: anywhere; }
#botDialog { width: 680px; }
#botWizardProgress { grid-template-columns: max-content minmax(28px, 1fr) max-content; gap: 16px; margin: 0 0 26px; padding: 0; }
#botWizardProgress > li { flex-direction: row; flex-wrap: nowrap; gap: 10px; }
#botWizardProgress > li > span { width: 34px; height: 34px; border-color: #4c6580; background: #182a3d; color: #acc2d6; font-size: 15px; }
#botWizardProgress > li > strong { color: #a6bbcf; font-size: 16px; font-weight: 550; }
#botWizardProgress > li.active > span, #botWizardProgress > li.done > span { border-color: #a4e1fb; background: #91d9f6; color: #092335; }
#botWizardProgress > li.active > strong, #botWizardProgress > li.done > strong { color: #e7f4fd; }
#botWizardProgress > i { background: #354f67; }
#botForm .display-mode-options { gap: 12px; }
#botForm .display-mode-options > label { border-color: var(--qf-line); border-radius: 12px; background: var(--qf-surface-inset); }
#botForm .display-mode-options > label:has(input:checked) { border-color: #8bcde9; background: rgba(77, 140, 170, .18); }
#botForm .bot-webhook-note { color: var(--muted); font-size: 14px; line-height: 1.6; }
#botForm #botWebhookCopy { display: inline-flex; align-items: center; justify-content: center; gap: 10px; flex: 0 0 auto; width: auto; min-width: 120px; height: auto; min-height: 48px; padding: 10px 16px; border: 1px solid var(--accent); background: var(--accent); color: #102331; font-size: 16px; white-space: nowrap; }
#botForm #botWebhookCopy svg { width: 20px; height: 20px; flex-shrink: 0; }
#botAvatarDialog { width: 600px; }
#botAvatarDialog .bot-avatar-crop { margin-block: 28px; border-color: #a5ddf5; background: #081524; box-shadow: 0 0 0 8px rgba(140, 207, 239, .06), 0 20px 56px rgba(0, 0, 0, .3); }
#botAvatarDialog .bot-avatar-controls { grid-template-columns: 44px minmax(0, 1fr) 44px auto; gap: 12px; }
#botAvatarDialog .bot-avatar-zoom-button { min-width: 44px; min-height: 44px; padding: 0; font-size: 22px; }
#botAvatarDialog input[type="range"] { accent-color: #91d9f6; }
#botAvatarDialog .bot-avatar-zoom > span { color: var(--muted); font-size: 14px; }
.auth-gate-card { border: 1px solid rgba(161, 196, 224, .28); border-radius: 26px; background: rgba(12, 25, 43, .84); box-shadow: 0 30px 96px rgba(0, 4, 14, .4); backdrop-filter: blur(26px); }
.auth-gate-brand img { width: 64px; height: 64px; filter: none; }
.auth-gate-brand b { color: #f0f6fc; font-size: 30px; font-weight: 600; letter-spacing: -.03em; }
.auth-gate-card h1 { font-size: 30px; color: #edf5fc; }
.auth-gate-card :is(p, small) { color: #b2c6d9; line-height: 1.7; }
.brand-loader-logo { filter: none; }

/* 07 · Supporting screens, overlays and workbench colors only.
   Never resize .wb-stage-img or override the stage/rail grid, overflow or z-index. */
.operation-log-columns > col:nth-child(1) { width: 172px; }
.operation-log-columns > col:nth-child(2) { width: 150px; }
.operation-log-columns > col:nth-child(3) { width: 220px; }
.operation-log-columns > col:nth-child(4) { width: 158px; }
.operation-log-columns > col:nth-child(5) { width: 88px; }
.panel:not(#internal-browse) :is(.table-wrap, .log-panel) { border: 1px solid var(--qf-line); border-radius: 14px; background: rgba(11, 24, 39, .85); }
.panel:not(#internal-browse) :is(th, td) { border-color: var(--qf-line); font-size: 15px; }
.panel:not(#internal-browse) th { color: #a9c0d4; background: rgba(24, 42, 60, .85); font-weight: 600; letter-spacing: 0; }
.panel:not(#internal-browse) td { color: #d5e4f0; }
.panel:not(#internal-browse) pre { border-color: var(--qf-line); border-radius: 12px; background: #081622; color: #c2ddef; }
.wb-menu, .bot-group-menu, .symbol-menu { border-color: #3f5c75; border-radius: 12px; background: #13263a; box-shadow: 0 14px 44px rgba(0, 5, 14, .5); }
.wb-menu button { color: #d8e9f5; }
.wb-menu button:hover { background: #284960; }
.wb-stage-rail { background-color: #102237; border-color: #365269; }
.wb-stage-head { background-color: rgba(17, 33, 52, .95); }
.wb-stage-head .wb-pane-bot-name { color: #ecf5fc; }
#internal-browse .wb-stage-state button.primary { border-color: #a4e1fb; background: #91d9f6; color: #082135; box-shadow: none; }
.wb-stage-head :is(.wb-pane-combined-picker, .wb-pane-bot-picker) > summary { border-color: #52728f; background-color: #172f45; }
.wb-trade-summary { border-color: #38536a; background-color: rgba(14, 29, 46, .95); }
.wb-trade-summary small { color: #b0c2d4; }
.wb-trade-summary strong { color: #edf5fc; }
.wb-stage-problem-layer .wb-stage-problem-strip { color: #f9deb0; border-color: #d4ae67; background: rgba(40, 31, 16, .94); }
.wb-empty { color: #bdcfdf; background-color: rgba(13, 29, 47, .64); }
.wb-empty strong { color: #e4f0f9; }

/* 08 · Prototype responsive content. Existing mobile glass and native caption
   geometry remain owned by adaptive-navigation.css. */
@media (min-width: 1600px) {
  body:not(:has(#internal-browse.panel.active)) main { padding-top: 42px; }
  #cloud .cloud-webhook-item.qf-webhook-card { padding: 25px 28px; }
  #cloud .cloud-list { gap: 20px; }
  #cloud .qf-webhook-card .cloud-webhook-avatar { width: 76px; min-width: 76px; max-width: 76px; height: 76px; min-height: 76px; max-height: 76px; flex-basis: 76px; }
  #cloud .qf-webhook-card .cloud-webhook-name { font-size: 28px; }
  #cloud .qf-webhook-url-row > :is(code, .url-field, .qf-webhook-url) { font-size: 16px; }
  #cloud .qf-webhook-head { margin-bottom: 23px; }
}
@media (min-width: 761px) {
  #internal-browse .wb-stage-head .wb-pane-bot-name { font-size: 16px; }
}
@media (min-width: 1101px) {
  #appShell .brand-logo { width: 56px; height: 56px; flex-basis: 56px; }
  #appShell .brand { gap: 8px; }
}
@media (max-width: 1200px) {
  body:not(:has(#internal-browse.panel.active)) main { padding-top: 28px; padding-inline: 26px; }
  #dashboard .metric { min-height: 152px; padding: 22px 19px; }
  #dashboard .metric .metric-reading > strong { font-size: 36px; }
  #settings .settings-grid, #settings .account-manager-grid { grid-template-columns: minmax(0, 1fr); }
  #settings .credential-panel { padding: 0 0 24px; border-right: 0; border-bottom: 1px solid var(--qf-line); }
  #cloud .alert-payload-card { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 761px) and (max-width: 1440px) {
  #dashboard .bot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #dashboard .bot-card.qf-fleet-card { padding: 20px; }
  #dashboard .qf-fleet-details { gap: 14px; }
  #dashboard .bot-quick-trade { grid-template-columns: minmax(0, 1fr) minmax(100px, 1.4fr) minmax(0, 1fr) 38px; gap: 5px; }
  #dashboard .bot-quick-trade .qt-qty { grid-template-columns: 26px minmax(40px, 1fr) 26px; }
  #dashboard .bot-quick-trade .qt-side { padding-inline: 4px; font-size: 14px; }
}
@media (max-width: 980px) {
  .panel > .section-title { align-items: flex-start; flex-wrap: wrap; }
  #dashboard .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #dashboard .metric:nth-child(2) { border-right: 0; }
  #dashboard .metric:nth-child(-n+2) { border-bottom: 1px solid var(--qf-line); }
  #cloud .qf-webhook-url-row { flex-wrap: wrap; }
  #cloud .qf-webhook-url-row > :is(code, .url-field, .qf-webhook-url) { flex-basis: 100%; }
  #cloud .qf-webhook-url-row .actions { flex: 1 1 100%; }
  #cloud .qf-webhook-url-row .actions [data-copy-target] { flex: 1 1 auto; }
  #cloud .webhook-route-strip { gap: 12px; }
  #cloud .webhook-route-note { display: none; }
  #api .api-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  body:not(:has(#internal-browse.panel.active)) main { padding-top: 25px; padding-inline: 18px; }
  .panel > .section-title { align-items: flex-start; gap: 18px; margin-bottom: 22px; }
  .section-title h1 { font-size: 31px; }
  .page-heading { gap: 10px; }
  .page-heading-icon { flex-basis: 27px; width: 27px; height: 27px; }
  body:not(.auth-locked):has(#internal-browse.panel.active) .workbench-route-title { position: static; inset: auto; z-index: auto; flex: 0 1 auto; height: auto; min-height: 0; font-size: 16px; white-space: nowrap; }
  .section-title p { font-size: 15px; line-height: 1.6; }
  .section-title > .actions { width: 100%; flex-shrink: 1; flex-wrap: wrap; }
  .section-title > .actions > button { flex: 1 1 auto; }
  .section-title.compact { margin-top: 28px; }
  .panel:not(#internal-browse) .form-card { padding: 23px; }
  #dashboard .metric { min-height: 144px; padding: 20px 17px; }
  #dashboard .metric-head { gap: 8px; margin-bottom: 10px; }
  #dashboard .metric-icon { width: 18px; height: 18px; min-width: 18px; }
  #dashboard .metric-icon svg { width: 18px; height: 18px; }
  #dashboard .metric-label > span { font-size: 13px; }
  #dashboard .metric .metric-reading > strong { font-size: 34px; }
  #dashboard .metric .metric-reading > small { font-size: 12px; }
  #dashboard .metric .metric-source { font-size: 11px; }
  #dashboard .bot-card.qf-fleet-card { padding: 20px; }
  #dashboard .bot-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  #dashboard .qf-fleet-details { margin: 14px 0; }
  #dashboard .qf-fleet-bottom { padding-top: 12px; }
  #dashboard .bot-group-count { margin-left: 0; }
  #cloud .cloud-grid > .cloud-device-card { padding: 0; }
  #cloud .webhook-route-strip { gap: 6px; margin-bottom: 22px; padding: 20px 10px; }
  #cloud .webhook-route-step { gap: 12px; font-size: 14px; }
  #cloud .webhook-route-step > svg { display: block; width: 60px; height: 60px; }
  #cloud .webhook-route-brand-tradingview { width: 60px; height: 60px; }
  #cloud .webhook-route-brand-quantwing { width: 60px; height: 60px; }
  #cloud .webhook-route-arrow { font-size: 16px; }
  #cloud .cloud-webhook-item.qf-webhook-card { padding: 20px 18px; }
  #cloud .qf-webhook-card .cloud-webhook-name { font-size: 23px; }
  #cloud .qf-webhook-card .cloud-webhook-avatar { width: 59px; min-width: 59px; max-width: 59px; height: 59px; min-height: 59px; max-height: 59px; flex-basis: 59px; }
  #cloud .cloud-webhook-identity { gap: 14px; }
  #cloud .qf-webhook-head { gap: 9px; }
  #cloud .qf-webhook-card :is(.bot-meta, .identity-meta) { font-size: 12px; gap: 6px; }
  #cloud .qf-webhook-url-row { gap: 8px; }
  #cloud .qf-webhook-url-row > :is(code, .url-field, .qf-webhook-url) { padding: 12px; font-size: 12px; }
  #cloud .qf-webhook-url-row .actions { gap: 8px; }
  #cloud .qf-webhook-url-row .actions button { min-height: 43px; padding: 10px 14px; font-size: 14px; }
  #cloud .alert-block { padding: 17px; }
  #cloud .alert-fields > div { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  #settings .member-head { flex-wrap: wrap; }
  #settings .member-identity { flex: 1 1 160px; }
  #settings .member-facts { grid-template-columns: minmax(0, 1fr); }
  #api .api-command-head { flex-wrap: wrap; }
  #api .api-command-head > label { flex: 1 1 100%; }
  dialog { max-width: calc(100vw - 30px); max-height: calc(100dvh - 38px); border-radius: 22px; }
  dialog > form { padding: 23px 21px; }
  dialog .dialog-title h2 { font-size: 25px; }
  dialog .form-grid { gap: 17px; }
  #botDetailsDialog { max-height: calc(100dvh - 38px); }
  #botDetailsDialog .qf-detail-header { gap: 10px; padding: 10px 14px; }
  #botDetailsDialog .qf-detail-header h2 { font-size: 20px; }
  #botDetailsDialog .qf-detail-body { padding: 20px; }
  #botDetailsDialog .qf-detail-identity > .bot-avatar-frame { --qf-detail-avatar-size: 56px; }
  #botDetailsDialog .qf-detail-facts > div { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  #botForm .form-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  #botForm .form-grid > label { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
  #botForm .form-grid > label > :is(input, select),
  #botForm .form-grid > .switch-row > span { min-width: 0; max-width: 100%; }
  /* Invisible absolute bubbles still enlarge scrollWidth before the first
     pointer/focus event positions them. Generate only the requested bubble;
     keep its aria-label and existing nudgeHintBubble boundary calculation. */
  #botForm .field-hint::after { display: none; max-width: min(280px, calc(100vw - 96px)); }
  #botForm .field-hint:is(:hover, :focus)::after { display: block; visibility: visible; opacity: 1; }
  #botWizardProgress { gap: 10px; }
  #botWizardProgress > li { gap: 7px; }
  #botWizardProgress > li > strong { font-size: 14px; }
  #botWizardProgress > li > span { width: 30px; height: 30px; }
  #botAvatarDialog .bot-avatar-controls { grid-template-columns: 44px minmax(0, 1fr) 44px; }
  #botAvatarDialog .bot-avatar-crop { width: min(360px, calc(100vw - 76px)); }
  #botAvatarDialog .bot-avatar-controls > #botAvatarReset { grid-column: 1 / -1; }
}

/* Mobile pane flow: desktop's fixed 2×2 height cannot be reused after its
   columns collapse. Keep the same live panes and scroll them vertically;
   reserve a real canvas even when notices and record views are present. */
@media (max-width: 760px) {
  body:not(.auth-locked):has(#internal-browse.panel.active):not(.workbench-fullscreen-active) { overflow: auto; }
  body:not(.auth-locked):has(#internal-browse.panel.active) #appShell {
    display: block;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }
  body:not(.auth-locked):has(#internal-browse.panel.active) main {
    display: block;
    height: auto;
    min-height: 0;
    overflow: visible;
    padding: 8px 10px calc(var(--qw-mobile-dock-h, 70px) + 26px + env(safe-area-inset-bottom));
  }
  #internal-browse.panel.active:is([data-layout="grid"], [data-layout="split"]) {
    height: auto;
    min-height: 0;
    overflow: visible;
  }
  #internal-browse.panel.active > .workbench-stage:is([data-layout="grid"], [data-layout="split"]) {
    display: grid;
    flex: none;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-auto-rows: auto;
    width: 100%;
    height: auto;
    min-height: 0;
    margin: 0;
    gap: 14px;
    overflow: visible;
    aspect-ratio: auto;
  }
  #internal-browse .workbench-stage:is([data-layout="grid"], [data-layout="split"]) > :is(.wb-grid-tile, .wb-grid-empty, .wb-focus-pane):not(.is-fullscreen) {
    grid-column: 1;
    grid-row: auto;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(240px, 1fr) auto;
    grid-template-areas: "rail" "notices" "canvas" "problem";
    width: 100%;
    height: auto;
    min-height: 480px;
  }
  #internal-browse .workbench-stage:is([data-layout="grid"], [data-layout="split"]) > :is(.is-horizontal-composite, .is-viewer-record-composite):not(.is-fullscreen) {
    grid-template-rows: auto auto minmax(240px, 1fr) auto minmax(160px, 1fr);
    grid-template-areas: "rail" "notices" "canvas" "problem" "record";
    height: auto;
    min-height: 660px;
  }
  #internal-browse .workbench-stage:is([data-layout="grid"], [data-layout="split"]) > :is(.wb-split-resizer, .wb-grid-resizer-x, .wb-grid-resizer-y) {
    display: none;
  }
  #internal-browse .wb-stage-head .wb-pane-bot-name { font-size: 14px; }
}
/* Membership is projected from central entitlement; gold is reserved for VIP. */
#settingsMemberBadge.vip {
  color: #ffe2a0;
  background: rgba(195, 151, 53, .16);
  border: 1px solid rgba(236, 190, 95, .55);
  font-weight: 800;
  letter-spacing: .06em;
}
.membership-subscription-dialog { width: min(560px, calc(100vw - 32px)); padding: 28px; }
.membership-subscription-dialog p { line-height: 1.65; overflow-wrap: anywhere; }
.membership-subscription-dialog .membership-price { display: flex; align-items: baseline; gap: 8px; margin: 24px 0 12px; }
.membership-price strong { color: var(--text); font-size: clamp(30px, 7vw, 42px); font-weight: 760; letter-spacing: -.04em; }
.membership-price span { color: var(--muted); font-size: 18px; }
#membershipSubscriptionNotice:empty { display: none; }
@media (max-width: 760px) {
  .membership-subscription-dialog { padding: 20px; }
  .membership-subscription-dialog .dialog-actions { flex-wrap: wrap; }
}
#settingsDesktopNodes .login-device-item small {
  white-space: normal;
  overflow-wrap: anywhere;
}
@media (prefers-reduced-motion: reduce) {
  :is(.panel:not(#internal-browse), dialog) *,
  :is(.panel:not(#internal-browse), dialog) *::before,
  :is(.panel:not(#internal-browse), dialog) *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
/* Host selection is connection chrome; product pages remain the canonical DOM. */
.workspace-connection-dialog { width: min(560px, calc(100vw - 32px)); max-height: 85dvh; overflow: auto; padding: 28px; color: var(--text, #e6f0f8); background: #101c2bed; border: 1px solid #83bddc55; border-radius: 24px; box-shadow: 0 24px 100px #0008; }
.workspace-connection-dialog::backdrop { background: #030913ba; backdrop-filter: blur(16px); }
.workspace-connection-dialog h2 { font-size: 26px; }
.workspace-connection-dialog p { line-height: 1.7; }
.workspace-connection-list { display: grid; gap: 12px; margin: 24px 0; }
.workspace-connection-dialog button { min-height: 48px; white-space: normal; }
html[data-quantwing-host="web"] .window-controls,
html[data-quantwing-host="web"] .auth-window-controls { display: none; }
.workspace-connection-notice { position: fixed; z-index: 90; inset: 20vh 24px auto; margin: auto; width: min(600px, calc(100vw - 48px)); box-sizing: border-box; padding: 28px; border: 1px solid #83bddc55; border-radius: 24px; background: #101c2bf2; color: #e6f0f8; box-shadow: 0 24px 100px #0008; }
.workspace-connection-notice p { line-height: 1.7; }
/* Authentication controls shell visibility; an offline execution host does not. */
