/* 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);
  /* Existing blue primary variant shared by create/start actions. Trading buy/sell stay separate. */
  --qf-primary-background: linear-gradient(135deg, #2579ef, #25a5e8);
  --qf-primary-border: #2579ef;
  --qf-primary-text: #fff;
  --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;
  --fs-page: clamp(28px, 2.5vw, 32px);
  --fs-section: 24px;
  --fs-card-title: 22px;
  --fs-dialog: 24px;
}

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;
}
/* ⭐ 這一行不是裝飾，它就是「螢幕最上面那條黑帶」的根因（2026-09-16）。
   iOS 26 / Safari 26 起 theme-color 不再被讀，改成**取樣**一個貼著視窗邊緣的
   fixed/sticky 元素的 background-COLOR（WebKit bug 301756，WebKit 工程師本人證實）。
   .ambient-grid（styles.css:502 position:fixed; inset:0）四個幾何條件全中、全站唯一，
   但它的 background 全是 gradient + url ⇒ background-color 計算值恆為透明
   ⇒ Safari 取樣到「沒有顏色」，退回它自己的預設 = 那條黑帶。
   ⚠ **它畫得出星空圖 ≠ 它有 background-color** —— 這兩件事在這裡是分開的。
   ⚠ alpha 用 .999 不用 1：Safari 26 另有一個 bug，inset:0 的 fixed 元素帶「完全不透明」
      背景時反而蓋不滿（benfrain 與 edoardolunardi 兩家獨立一致）。
   ⛔ 改 html/body 沒用：只要有合格的 fixed 元素，body 只是它找不到時的退路。
   ⭐ 同一個病 TranslationAI 2026-08-26 解過（commit 9205c1e1afb6，web/src/styles/layout.css:14）
      —— 那邊也是一行 background 就解決。⛔ 這不是新發明，是抄已驗證的解法。 */
.ambient-grid {
  background:
    linear-gradient(180deg, rgba(4, 12, 25, .12), rgba(5, 13, 27, .42) 54%, rgba(5, 12, 24, .82)),
    url('/renderer-assets/2820eb82c9728f599d004a95967f5380a89b9505430984c31ee8ad630696faa0/assets/cinematic-orbit-v1.png') center top / cover no-repeat;
  /* ⛔ 這一行必須在上面那個 background 簡寫**之後** —— 簡寫會把 background-color
     重設成 transparent，擺前面等於沒寫（最後一次賦值贏，不是宣告得比較明確的贏）。 */
  background-color: rgba(5, 12, 24, .999);
  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([data-active-panel="internal-browse"]) 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: var(--fs-page);
  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)[data-active-panel="internal-browse"] .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: var(--fs-section);
  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.primary { border-color: var(--qf-primary-border); background: var(--qf-primary-background); color: var(--qf-primary-text); }
#dashboard .section-title #startAllBotsBtn.primary:hover:not(:disabled) { filter: brightness(1.12); 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) .primary {
  border: 1px solid var(--qf-primary-border);
  background: var(--qf-primary-background);
  color: var(--qf-primary-text);
  text-shadow: none;
}
:is(.panel:not(#internal-browse), dialog) .primary:hover:not(:disabled) {
  border-color: var(--qf-primary-border);
  background: var(--qf-primary-background);
  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"]):not(:where(.ai-chat-card-composer textarea)) {
  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) { 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 .qf-runner {
  display: block; max-width: 100%; margin-top: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--muted); font-size: 12px; line-height: 1.35;
}
#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; }
@media (max-width: 760px) {
  #settings .settings-toolbar { gap: 8px; margin: 16px 0; }
  #settings .settings-toolbar .settings-search { margin: 0; }
}
#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(640px, 100vw); max-height: 100dvh; margin: 0; padding: 24px; border: 1px solid var(--qf-line); border-radius: 20px 0 0 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 { display: flex; align-items: center; gap: 16px; margin-bottom: 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; }
:is(#accountDialog, #botDialog) [hidden] { display: none !important; }
body:has(:is(#accountDialog, #botDialog)[open]) { overflow: hidden; }
#accountDialog #accountLoginManage { grid-column: 1 / -1; justify-self: start; }
#accountDialog .creation-section-title { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; margin: 10px 0 0; padding-block: 14px 4px; border-top: 1px solid var(--qf-line); color: var(--text); font-size: 17px; font-weight: 600; }
#accountDialog .creation-section-title:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
#accountDialog .creation-section-title > span:first-child { color: var(--accent); font: 12px/1.5 "Cascadia Code", monospace; letter-spacing: .08em; }
#accountDialog :is(#accountLoginPreferenceHint, #accountLoginObservedStatus, #accountCredentialHeading) { grid-column: 1 / -1; margin: 0; font-size: 14px; line-height: 1.6; }
#accountDialog #accountLoginObservedStatus:empty { display: none; }
#accountDialog .account-form-actions, #botDialog .dialog-actions { position: sticky; bottom: -24px; z-index: 2; margin-top: 20px; padding: 16px 0 24px; border-top: 1px solid var(--qf-line); background: var(--qf-surface, #151e29); box-shadow: 0 -12px 20px -16px #0009; }
:is(#accountDialog, #botDialog) :is(input, select, textarea, button, summary) { scroll-margin-block: 24px 112px; }
#botDialog .creation-help { margin: 0 0 20px; padding: 12px 16px; border: 1px solid var(--qf-line); border-radius: 12px; background: var(--qf-surface-inset); font-size: 14px; }
#botDialog .creation-help > summary { cursor: pointer; color: var(--muted); line-height: 1.6; }
#botDialog .creation-help[open] > summary { color: var(--text); margin-bottom: 14px; }
#botDialog .creation-help .dialog-note { margin-bottom: 0; }
@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; }
/* 開關列母版：設定、機器人表單、通知設定共用 */
:is(#settings, #botForm, #notifications) .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); }
:is(#settings, #botForm, #notifications) .switch-row strong { color: #dfebf7; font-size: 17px; font-weight: 600; }
:is(#settings, #botForm, #notifications) .switch-row small { margin-top: 5px; font-size: 14px; line-height: 1.55; }
:is(#settings, #notifications) .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; }
: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; padding-block: 14px; border-bottom: 1px solid var(--qf-line); background: #151e29; }
#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 { padding: 24px 20px; overflow-y: auto; }
.auth-gate-card { box-sizing: border-box; width: min(100%, 400px); padding: 32px 28px 24px; border: 1px solid rgba(161, 196, 224, .28); border-radius: 22px; background: rgba(12, 25, 43, .84); box-shadow: 0 30px 96px rgba(0, 4, 14, .4); backdrop-filter: blur(26px); }
.auth-gate-brand { justify-content: center; gap: 12px; margin: 0 0 28px; white-space: nowrap; }
.auth-gate-brand img { width: 44px; height: 48px; flex: 0 0 44px; filter: none; }
.auth-gate-brand b { color: #f0f6fc; font-size: clamp(24px, 7vw, 28px); font-weight: 600; letter-spacing: -.03em; }
.auth-gate .auth-google-button { min-height: 44px; height: 44px; margin: 0 0 12px; padding: 0 12px; gap: 12px; border-radius: 8px; border-color: #747775; background: #fff; color: #1f1f1f; font-size: 16px; font-weight: 500; line-height: 20px; letter-spacing: .01em; white-space: nowrap; box-shadow: none; }
.auth-gate .auth-google-button img { width: 20px; height: 20px; flex: 0 0 20px; }
.auth-gate .auth-google-button:active:not(:disabled) { background: #e8eef3; transform: translateY(1px); }
.auth-gate .auth-remember { min-height: 44px; margin: 0; gap: 10px; font-size: 15px; }
.auth-gate .auth-remember input { -webkit-appearance: none; appearance: none; display: grid; place-content: center; width: 20px; height: 20px; flex: 0 0 20px; border: 2px solid #8da5bc; border-radius: 4px; background: transparent; cursor: pointer; }
.auth-gate .auth-remember input:checked { border-color: #a5e2f5; background: #a5e2f5; }
.auth-gate .auth-remember input::before { content: ''; width: 10px; height: 6px; border-left: 2px solid #102435; border-bottom: 2px solid #102435; transform: translateY(-1px) rotate(-45deg) scale(0); }
.auth-gate .auth-remember input:checked::before { transform: translateY(-1px) rotate(-45deg) scale(1); }
.auth-gate :is(button, input):focus-visible { outline: 2px solid #a5e2f5; outline-offset: 4px; }
.auth-gate .auth-sign-out { min-height: 44px; margin: 8px auto 0; padding: 8px 20px; border: 0; background: transparent; color: #a9bfd2; font-size: 15px; }
.auth-gate .auth-sign-out:hover { background: rgba(165, 226, 245, .08); color: #fff; }
@media (max-width: 420px) {
  .auth-gate-card { padding: 28px 20px 20px; }
}
@media (forced-colors: active) {
  .auth-gate .auth-remember input { appearance: auto; }
  .auth-gate .auth-remember input::before { content: none; }
}
.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:not(:disabled) { border-color: var(--qf-primary-border); background: var(--qf-primary-background); color: var(--qf-primary-text); 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([data-active-panel="internal-browse"]) 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([data-active-panel="internal-browse"]) 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([data-active-panel="internal-browse"]) main { padding-top: 25px; padding-inline: 18px; }
  .panel > .section-title { align-items: flex-start; gap: 18px; margin-bottom: 22px; }
  .section-title h1 { font-size: var(--fs-page); }
  .page-heading { gap: 10px; }
  .page-heading-icon { flex-basis: 27px; width: 27px; height: 27px; }
  body:not(.auth-locked)[data-active-panel="internal-browse"] .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 { padding-block: 10px; }
  #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; }
  @media (max-width: 480px) {
    /* 進度文字可換行，避免英文 max-content 將 320px 對話框擠出。 */
    #botWizardProgress { grid-template-columns: minmax(0, 1fr) minmax(12px, 32px) minmax(0, 1fr); gap: 8px; }
    #botWizardProgress > li > span { flex-shrink: 0; }
    #botWizardProgress > li > strong { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
  }
  #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)[data-active-panel="internal-browse"]:not(.workbench-fullscreen-active) { overflow: auto; }
  body:not(.auth-locked)[data-active-panel="internal-browse"] #appShell {
    display: block;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }
  body:not(.auth-locked)[data-active-panel="internal-browse"] 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;
  }
  /* 網站的真實串流可能是 MT5 的超寬影格。只有即時畫面窗格由影格比例
     決定高度；交易／操作紀錄仍保留上面的可捲動最小高度。 */
  html[data-host="web"] #internal-browse .workbench-stage:is([data-layout="grid"], [data-layout="split"]) > :is(.wb-grid-tile, .wb-focus-pane):not(.is-fullscreen):has(> .wb-stage-canvas .wb-stage-live) {
    grid-template-rows: auto auto auto auto;
    min-height: 0;
  }
  #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. */
/* Administration shares the product surface; no separate theme or trading UI. */
/* 0.4.30：從 <dialog>.showModal() 改成整頁分頁（站長 2026-09-12：「我不要覆蓋視窗
   我要整個頁面切換的那種占據整個畫面」）。
   ⛔ 這裡刻意**不**宣告 display —— 可見性一律由 .panel / .panel.active 決定。
      自帶 display 就會重演 0.3.33 的 .workbench-panel 那個 bug（沒有 .active 也永遠畫出來），
      electron-packaging.test.js 有一條迴歸釘樁在看這件事。
   ⛔ 也不要再寫 width / max-height / overflow：那三個是給 dialog 置中用的，
      在 <main> 裡會變成「頁面裡再開一個會自己捲動的小視窗」，正好是站長不要的東西。 */
.membership-admin { color: #e9f2ff; }
.membership-admin header { display: flex; align-items: center; gap: 20px; }
/* 左上角「< 返回」。⚠ .qf-detail-header / .qf-detail-back 既有的樣式全部是 ID 前綴的
   （#accountDialog / #botDetailsDialog）⇒ 只貼 class 會完全沒有樣式，這裡必須自己有一份。
   ⛔ 刻意**不**做 sticky：母版 #system-status 的標題也不是 sticky，而且頂欄在桌面是
      左側固定欄、在手機是底部 dock，再疊一層 sticky 只會多一種疊法要驗。 */
#membership-admin .qf-detail-header { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid #22364a; }
.membership-admin .admin-license-form { padding: 0; }
.membership-admin .admin-license-form::before { display: none; }
.membership-admin .admin-license-form label { margin: 0; }
.membership-admin .admin-license-form label::before { display: none; }
.membership-admin .admin-license-form input, .membership-admin .admin-license-form select { margin-top: 0; }
.membership-admin h2 { font-size: 30px; margin: 6px 0; }
.membership-admin h3 { font-size: 21px; margin: 8px 0; }
.membership-admin p { color: #acc1d7; overflow-wrap: anywhere; }
.membership-admin button:not(.qf-dialog-navigation-back) { min-height: 44px; border-radius: 12px; color: #e9f2ff; background: #182e40; border: 1px solid #426077; padding: 10px 18px; }
.membership-admin button.primary { color: #092031; background: #a5e3f6; }
.membership-admin button:active { transform: translateY(1px); }
.membership-admin .admin-brand { display: flex; align-items: center; gap: 14px; }
.membership-admin .admin-brand img { width: 48px; height: 48px; object-fit: contain; }
.admin-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin: 24px 0; }
.admin-facts > div, .admin-user { padding: 20px; background: #09131fe6; border: 1px solid #2e465b; border-radius: 18px; }
.admin-facts strong, .admin-facts small { display: block; }
.admin-facts strong { margin-top: 8px; font-size: 24px; }
.admin-user { margin-bottom: 16px; }
.admin-user ul { padding-left: 20px; line-height: 1.9; }
.admin-license-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
.admin-license-form > label { display: grid; gap: 8px; }
.admin-license-form input, .admin-license-form select { color: #e9f2ff; background: #121e30; border: 1px solid #426077; border-radius: 10px; padding: 12px; min-width: 0; }
.admin-license-form fieldset { display: flex; flex-wrap: wrap; gap: 16px; border: 1px solid #426077; border-radius: 10px; padding: 16px; }
.admin-span { grid-column: 1 / -1; }
.admin-audit { font-size: 14px; }
/* 會員後台：表格式列表 → 全畫面詳情。卡片式一人一大張在幾十位會員時就滑不完了。 */
.membership-admin h4 { font-size: 17px; margin: 24px 0 10px; color: #cfe2f5; }
.admin-notice { margin: 0 0 16px; padding: 12px 16px; border-radius: 12px; background: #1b2a3b; border: 1px solid #426077; font-size: 14px; }
.admin-notice.is-over { background: #351e22; border-color: #a4555f; color: #ffd7dc; }
.admin-hint { font-size: 13px; line-height: 1.7; color: #9fb6cd; }
.admin-hint.is-over { color: #ffc3ca; }
.admin-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px; }
.admin-search { flex: 1 1 260px; min-width: 0; display: block; margin: 0; }
.admin-search::before { display: none; }
.admin-toolbar input[type="search"], .admin-toolbar select { width: 100%; min-height: 44px; margin: 0; color: #e9f2ff; background: #121e30; border: 1px solid #426077; border-radius: 12px; padding: 10px 14px; }
.admin-toolbar select { width: auto; flex: 0 0 auto; }
.admin-count { flex: 0 0 auto; font-size: 14px; color: #9fb6cd; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.admin-table th, .admin-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #22364a; vertical-align: middle; }
.admin-table th { font-size: 13px; font-weight: 600; color: #9fb6cd; text-transform: none; white-space: nowrap; }
.admin-table td small { display: block; margin-top: 3px; font-size: 12px; color: #8ba3ba; }
.admin-table td strong { font-weight: 600; overflow-wrap: anywhere; }
.admin-table tbody tr[data-member] { cursor: pointer; }
.admin-table tbody tr[data-member]:hover, .admin-table tbody tr[data-member]:focus-visible { background: #16243700; background-color: #172638; outline: none; }
.admin-table tbody tr[data-member]:focus-visible { box-shadow: inset 0 0 0 2px #83dcfa; }
.admin-table .admin-num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.admin-table .admin-num.is-over, .admin-facts strong.is-over { color: #ff9aa6; }
.admin-table .admin-empty { text-align: center; color: #8ba3ba; padding: 32px 14px; }
.admin-table td:last-child { text-align: right; white-space: nowrap; }
.admin-table button { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.admin-badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 13px; white-space: nowrap; background: #22364a; border: 1px solid #3d566d; }
.admin-badge.is-ok { background: #12332c; border-color: #2f7a63; color: #8ff0cd; }
.admin-badge.is-warn { background: #3a3018; border-color: #9a7c2c; color: #ffdf9e; }
.admin-badge.is-over { background: #351e22; border-color: #a4555f; color: #ffb3bc; }
.admin-badge.is-stopped { background: #2a2331; border-color: #6f5d86; color: #d7c4f0; }
.admin-badge.is-dev { background: #142c3a; border-color: #3f7f9c; color: #a5e3f6; }
.admin-pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 16px; font-size: 14px; }
.admin-pager button[disabled] { opacity: .45; }
.admin-detail-nav, .billing-sections { display:flex; flex-wrap:wrap; gap:6px; }
.admin-detail-nav { border-bottom:1px solid #30495e; margin:18px 0; padding-bottom:10px; }
.admin-detail-nav button, .billing-sections button { background:transparent; color:#a9bed1; border:1px solid transparent; border-radius:8px; padding:9px 13px; }
.admin-detail-nav button[aria-current="true"], .billing-sections button[aria-pressed="true"] { background:#183346; border-color:#447e97; color:#a5e3f6; }
#membership-admin [data-member-section][hidden] { display:none !important; }
.billing-toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.billing-sections { flex:1; }
.billing-actions { display:flex; flex-wrap:wrap; gap:8px; margin:14px 0; }
.billing-actions button { min-height:38px; padding:8px 12px; }
.billing-form { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; padding:18px; margin:14px 0 20px; border:1px solid #3d566d; background:#111f2e; border-radius:12px; }
.billing-form h4, .billing-span { grid-column:1/-1; }
.billing-form h4 { margin:0; }
.billing-form label { display:grid; gap:6px; font-size:13px; color:#a9bed1; min-width:0; }
.billing-form input,.billing-form select,.billing-form textarea { width:100%; min-width:0; min-height:40px; box-sizing:border-box; padding:8px 10px; border:1px solid #426077; background:#0b1724; color:#e9f2ff; border-radius:8px; }
.billing-span button + button { margin-left:8px; }
.billing-table-wrap { overflow-x:auto; max-width:100%; }
.billing-table { width:100%; border-collapse:collapse; font-size:13px; }
.billing-table th,.billing-table td { padding:10px 12px; border-bottom:1px solid #22364a; text-align:left; vertical-align:top; overflow-wrap:anywhere; }
.billing-table th { color:#9fb6cd; font-weight:500; white-space:nowrap; }
.billing-table td small { display:block; color:#9fb6cd; margin-top:4px; }
.billing-table td button { min-height:32px; padding:5px 8px; margin:0 5px 5px 0; font-size:12px; }
.billing-history { margin:22px 0; }
.billing-history summary { cursor:pointer; color:#a9bed1; padding:10px 0; }
[data-billing-error]:not([hidden]) { border:1px solid #a4555f; color:#ffb3bc; background:#351e22; padding:12px; border-radius:8px; }
#membership-admin tr[data-member] td { padding-top:8px; padding-bottom:8px; }
@media(max-width:760px) {
  .billing-form { grid-template-columns:1fr; padding:12px; }
  .billing-table { min-width:580px; }
  .admin-detail-nav { gap:4px; }
  .admin-detail-nav button { padding:8px; font-size:13px; }
  .billing-toolbar { align-items:stretch; }
  .billing-sections { flex-basis:100%; }
}
.admin-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin: 16px 0 0; }
.admin-detail-head h3 { margin: 0 0 4px; }
.admin-detail-head p { margin: 0 0 4px; }
.admin-id { font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.admin-id code { padding: 3px 8px; border-radius: 8px; background: #09131f; border: 1px solid #2e465b; overflow-wrap: anywhere; }
.admin-id button { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.admin-receipts code { display: inline-block; max-width: 42ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; padding: 2px 6px; border-radius: 6px; background: #09131f; border: 1px solid #2e465b; font-size: 12px; }
.admin-receipts td:first-child { color: #8ba3ba; }
.admin-receipts td:last-child { text-align: left; }
.admin-terms { display: block; }
.admin-terms .admin-hint { margin: 0 0 12px; }
.admin-term-row { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(150px, 1fr) minmax(150px, 1fr); gap: 10px; align-items: center; margin-bottom: 10px; }
.admin-term-row .admin-term-on { display: flex; align-items: center; gap: 8px; margin: 0; overflow-wrap: anywhere; }
.admin-term-row input[type="datetime-local"] { color: #e9f2ff; background: #121e30; border: 1px solid #426077; border-radius: 10px; padding: 10px; min-width: 0; }
@media (max-width: 760px) { .admin-term-row { grid-template-columns: 1fr; } }
/* ── 會員後台的版面密度與窄視窗（2026-09-13）────────────────────────────────
   兩個缺陷都是 0.4.30「dialog → 整頁 panel」留下的回歸，但**根因不是同一個**：

   ① 橫向溢出：styles.css:162 給**全域每一個 <table>** 一條 min-width: 900px
      —— 它跟 .table-wrap{overflow:auto} 是成對設計的（#deliveryRows 那張就是這樣用）。
      dialog 時代 .membership-admin 自己有 overflow:auto 把它吸收掉；整頁化之後那層沒了
      ⇒ 900px 的表撐爆 354px 的內容區，整頁橫移。
      ⚠ 舊寫在這裡的 `.admin-table { display:block; overflow-x:auto }` **治不了**：
        min-width:900px 仍然套在表格自己身上 ⇒ 它自己就是 900px 的 block、沒有東西可捲。
        2026-09-13 實測 390x844：tableWidth=900 / tableClientWidth=900 / 父層 354 /
        docScrollWidth=918 vs clientWidth=390 ⇒ 那條規則等於不存在，所以刪掉改寫。
   ② 密度：站長逐字「框小一點 容納更多人」。實測第一屏可見會員數
      1440x1000=6 位 / 1280x800=3 位 / 390x844=0 位；列高 70px 是合理的，
      吃掉第一屏的是標題區 —— 390 下四張統計卡垂直堆疊就佔 490px。 */

/* 地板：任何寬度下，表格的溢出都關在自己的盒子裡，⛔ 頁面本身不橫移。
   這是產品既有母版（.table-wrap）的同一招，只是後台的表不吃 .table-wrap 那組邊框背景。 */
/* container-type 是給下面那組 @container 用的：決定表格溢不溢出的是**這個盒子**的寬度，
   ⛔ 不是視窗的寬度（實測 1000px 視窗的盒子只有 729px、1280px 視窗卻有 953px）。
   ⚠ inline-size 只 contain 行內軸，捲動與 sticky 表頭都不受影響（這個盒子本來就是捲動容器）。 */
#membership-admin .admin-table-wrap { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; container-type: inline-size; container-name: qf-admin-table; }
/* 列表那張表（6 欄）不吃全域那條 min-width: 900px，改成它自己實際需要的 720px。
   ⛔ 900 與 0 都試過，兩邊都有實測到的代價：
     ·  900（全域預設）：820x1180 下容器只有 549px ⇒ 要橫捲 351px 才看得到「狀態」欄。
     ·  0：同一個寬度下表格被壓到 588px，六欄全部換行 ⇒ **列高從 70px 漲到 112px**、
       第一屏從 10 位掉到 7 位 —— 那正好牴觸站長要的「容納更多人」。
   720 的來歷：1000x800 實測容器 729px 時列高仍是 70px（六欄都不換行）⇒ 取它的下緣。
   ⚠ 詳情頁那三張刻意**不**跟進：Webhook 那張有 8 欄，壓窄會每一格都換行；
   它們在 ≤760px 改成一列一張卡（見下面的 media query），760px 以上靠上面那層捲動容器。 */
#membership-admin .admin-table:not(.admin-receipts):not(.admin-bots) { min-width: 720px; }

/* ── 詳情頁三張表的橫捲（2026-09-13）：判準是**容器裝不裝得下**，⛔ 不是「視窗多寬」──
   改前實測（真的開 Chrome、六個寬度各量一次）：
     視窗 1440 → 盒子 1113px｜1280 → 953px｜1000 → 729px｜820 → 549px｜760 → 724px
   ⇒ 盒子掉到 900px 以下的那一段，styles.css:162 給**全域每一個 <table>** 的 min-width: 900px
     就撐爆它：1000x800 要橫捲 171px（機器人表的「狀態」、Webhook 的「券商單號／收據」、
     收據表的「券商單號／結果」看不到）；820x1180 要橫捲 351px（Webhook 有四欄看不到）。
   ⛔ 為什麼不把下面 max-width:760px 那個斷點調大：同一個區塊裡還裝著列表頁
      「藏掉方案與查看兩欄」的手機妥協 —— 斷點一調大，1000px 的視窗也會掉兩欄，
      正好牴觸站長要的「框小一點 容納更多人」。⇒ 兩件事拆成各自的判準。
   ⛔ 也不能拿視窗寬度當代理量：1000 與 1280 都是「桌面寬度」，盒子卻差了 224px
      （版面在中間某處換了佈局）⇒ 視窗寬度量到的不是真正決定溢出的那個數。 */

/* ① 解除全域那條 900px —— 換成三張表**自己量出來的**自然寬。
   實測（把 min-width 歸零後用同一支探針量）：Webhook 8 欄 652px／收據 5 欄 582px／機器人 4 欄 ≤549px。
   ⇒ 盒子只要 ≥652px 三張表就全欄顯示、零橫捲（1000x800 的 729px 盒子實測 0 溢出、0 欄看不到）。
   ⛔ 這裡刻意**不**再訂一個新的 min-width 數字：訂多少都是猜，而表格自己的最小內容寬就是答案；
      列表頁那條 720px 之所以要訂，是因為它反過來需要**撐住**不換行（見上面），兩者的目的相反。 */
#membership-admin :is(.admin-receipts, .admin-bots) { min-width: 0; }

/* ② 盒子小於那個下界時改成一列一張卡：每一欄都看得到，⛔ 不用橫捲。
   700px = 實測下界 652px 加一點餘裕（券商單號長度、機器人名稱、介面翻譯都會讓自然寬浮動）。
   ⚠ 不支援 @container 的引擎會整段忽略 ⇒ 退回「表格 + 盒子自己橫捲」，
      也就是上面 .admin-table-wrap 那層地板，⛔ 頁面本身仍然不會橫移。
   ⛔ 這一組規則原本住在下面的 @media (max-width: 760px) 裡，2026-09-13 整段搬來這裡 ——
      ⛔ 不是複製：那邊留一份就會變成兩份要人工同步的真相源。 */
@container qf-admin-table (max-width: 700px) {
  #membership-admin :is(.admin-receipts, .admin-bots) { display: block; }
  /* ⛔ 不用 sr-only（absolute + clip-path）：被裁掉的那個 thead 量起來仍是 539px 寬，
     會讓「橫向零溢出」這條斷言必須開例外。欄名改由 td::before 的 data-label 提供。 */
  #membership-admin :is(.admin-receipts, .admin-bots) thead { display: none; }
  #membership-admin :is(.admin-receipts, .admin-bots) tbody { display: block; }
  #membership-admin :is(.admin-receipts, .admin-bots) tbody tr { display: block; margin-bottom: 10px; padding: 4px 0; border: 1px solid #22364a; border-radius: 12px; background: #09131fb3; }
  /* justify-items:start 不可省：徽章（.admin-badge）是 grid item，預設 stretch 會被拉成整欄寬，
     看起來像一條色塊而不是一個標籤。 */
  /* ⛔ height: auto 是承重的：styles.css:2365 有一條**裸的**全域 `td { height: 60px; }`（特異性 0,0,1），
     卡片化之後沒有任何一條規則覆寫它 ⇒ 每一格不管內容多短都被撐成 60px。
     2026-09-13 WebKit（真的 iOS Safari 排版引擎）實測改前，四個 iPhone profile 數字一模一樣：
       webhook 卡 8 欄 = 490px｜收據卡 5 欄 = 310px｜機器人卡 4 欄 = 250px，每一格 cssHeight 都是 "60px"，
       而一格真正需要的只有 ~25px（13px 字 × line-height 1.45 ＋ 上下各 3px padding）
     ⇒ 一張 webhook 卡約 280px 是空的 —— 正好牴觸站長逐字規格「框小一點 容納更多人」。
     ⚠ 它跟上面已經解掉的 min-width: 900px 是**同一族**的全域外洩：寬度那半修了、高度這半沒有。
     ⛔ 不是 WebKit 獨有 —— 同一份夾具在 chromium 量到一模一樣的 490 / 每格 60px。
     ⛔ 為什麼不直接刪 styles.css:2365：那條是**全域**的，另外八個分頁的表格都吃它，爆炸半徑完全不同
        ⇒ 這裡只用 #membership-admin 前綴、且只在這個 @container 卡片化條件下解。
     ⛔ 也刻意**不**碰列表頁那張表：它被 :not(.admin-receipts):not(.admin-bots) 排除在這組選擇器之外
        （它的列實測也是 60px，要不要一起解是另一個決定，不在本次爆炸半徑內）。 */
  #membership-admin :is(.admin-receipts, .admin-bots) tbody td { display: grid; height: auto; grid-template-columns: minmax(64px, 30%) 1fr; gap: 8px; padding: 3px 12px; border-bottom: 0; text-align: left; align-items: baseline; justify-items: start; font-size: 13px; line-height: 1.45; }
  #membership-admin :is(.admin-receipts, .admin-bots) tbody td::before { content: attr(data-label); color: #8ba3ba; font-size: 12px; }
  #membership-admin :is(.admin-receipts, .admin-bots) tbody td.admin-empty { display: block; text-align: center; }
  #membership-admin :is(.admin-receipts, .admin-bots) tbody td.admin-empty::before { content: none; }
  /* ⛔ 這條不可省：收據的「內容」欄是 120 字元的 JSON，平常靠 42ch + nowrap + 省略號收住；
     卡片化之後那一格只有一欄寬，42ch 會直接把卡片撐爆。 */
  #membership-admin .admin-receipts code { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
}

/* 密度（全寬度）：統計卡從「一張卡一個數字獨佔一行」改成 label 與數字同一行的 chip。
   ⛔ 資訊一個都沒少 —— 少的是 padding 與換行。 */
#membership-admin .admin-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
#membership-admin .admin-facts > div { display: flex; align-items: baseline; gap: 8px; padding: 6px 12px; border-radius: 12px; }
#membership-admin .admin-facts small { display: inline; font-size: 13px; }
#membership-admin .admin-facts strong { display: inline; margin-top: 0; font-size: 18px; }
/* 標題區：⛔ 只縮後台這一頁（#id 前綴），不動 .panel 共用的 --panel-title-gap ——
   那個變數是產品所有分頁的標題距離，為了一頁去改它會動到另外八頁。 */
#membership-admin { padding-top: 20px; }
#membership-admin .qf-detail-header { margin-bottom: 10px; padding-bottom: 8px; }
#membership-admin h2 { font-size: 24px; margin: 2px 0; }
/* ⛔ 這句「不會扣款」是安全資訊不是裝飾，所以是壓縮不是刪除。 */
#memberAdminStatus { margin: 0 0 8px; font-size: 12px; line-height: 1.5; }
#membership-admin .admin-toolbar { gap: 10px; margin-bottom: 8px; }

@media (max-width: 760px) {
  .admin-detail-head { flex-direction: column; gap: 10px; }
  /* ⛔ 手機上一律不靠橫捲：客訴當下要看的「狀態」與「收據」正好是最右邊那兩欄，
     要捲才看得到等於看不到。⇒ 把上面給列表訂的 720px 解掉。
     ⚠ 選擇器要**逐字對應**上面那條、不能只寫 `.admin-table`：上面那條帶了兩個 :not()，
       特異性比 `#id .class` 高 ⇒ 只寫 `.admin-table { min-width: 0 }` 蓋不掉它
       （2026-09-13 實測：390 下表格照樣是 720px，狀態欄又跑回要橫捲才看得到）。
     ⛔ 詳情頁那三張的 min-width 不在這裡解 —— 它們已經在上面 ① 全寬度解掉了，
        因為那個缺口在 760~1170px 之間，⛔ 手機斷點根本管不到。 */
  #membership-admin .admin-table:not(.admin-receipts):not(.admin-bots) { min-width: 0; }

  /* 列表頁＝「掃描一堆人」⇒ 密度優先，維持表格不卡片化（卡片一張 ~150px，
     表格一列 ~50px ⇒ 同一個第一屏差三倍人數，正好牴觸站長規格②）。
     6 欄塞不進 354px（只藏「查看」一欄實測仍是 392px > 354px），拿掉兩欄：
     ① 第 6 欄「查看」—— 整列本來就可點（tr[data-member] 有 onclick + tabindex + Enter/Space），
        那顆鈕是重複的可視元素；
     ② 第 2 欄「方案」—— 狀態徽章已經能講出開發者（is-dev）與停權，
        而 VIP／免費 的差別在「授權到期」那一欄已經隱含（免費沒有到期日，印「—」）。
     ⛔ 兩欄都只是在窄視窗**不畫出來**，資料照樣在詳情頁第一段。
     ⛔ :not(.admin-empty) 不可省 —— 空狀態那格同時是 first/last child，
        少了它「沒有符合條件的會員。」會被一起藏掉。 */
  #membership-admin .admin-table:not(.admin-receipts):not(.admin-bots) :is(th, td):last-child:not(.admin-empty),
  #membership-admin .admin-table:not(.admin-receipts):not(.admin-bots) :is(th, td):nth-child(2) { display: none; }
  #membership-admin .admin-table:not(.admin-receipts):not(.admin-bots) :is(th, td) { padding: 7px 4px; font-size: 13px; }
  #membership-admin .admin-table:not(.admin-receipts):not(.admin-bots) td small { font-size: 11px; }
  /* 到期日與倒數不換行：它們一換行，整列就從 ~52px 撐到 94px（實測）——
     列高才是「容納更多人」的分母，比多留幾個字重要。 */
  #membership-admin .admin-table:not(.admin-receipts):not(.admin-bots) :is(th, td):nth-child(4) { white-space: nowrap; }
  /* 整列可點的視覺提示（補上被藏掉的那顆鈕）。純 CSS，⛔ 不動 HTML 內容。 */
  #membership-admin .admin-table:not(.admin-receipts):not(.admin-bots) tbody tr[data-member] td:nth-last-child(2)::after {
    content: '›'; float: right; margin-left: 4px; color: #6b8299; }

  /* ⛔ 詳情頁三張表（收據／Webhook／機器人）的卡片化**不在這裡** —— 2026-09-13 整段搬到上面
     那組 @container (max-width: 700px)。理由：它要治的破口在 760~1170px 之間，
     那一段的視窗是「桌面寬度」但盒子只有 549~729px ⇒ 手機斷點永遠碰不到它。
     ⚠ 搬過去之後，760x1000（盒子 724px）從卡片變回表格 —— 那是**改善不是回歸**：
       實測 724px 的盒子裝得下 652px 的表，八欄全部看得到、零橫捲，而表格比卡片緊湊。 */

  /* 標題區再壓一次：390 下這一段本來吃掉 826px（第一屏的 98%，表頭根本進不了畫面）。 */
  #membership-admin h2 { font-size: 21px; }
  #membership-admin .qf-detail-header { margin-bottom: 10px; padding-bottom: 8px; }
  #membership-admin .admin-facts { gap: 6px; margin: 8px 0; }
  #membership-admin .admin-facts > div { padding: 6px 10px; }
  #membership-admin .admin-facts small { font-size: 12px; }
  #membership-admin .admin-facts strong { font-size: 16px; }
  /* 搜尋／篩選／計數擠回同一行（原本換行成三列吃掉 112px）。 */
  #membership-admin .admin-toolbar { gap: 8px; }
  #membership-admin .admin-search { flex: 1 1 90px; }
  #membership-admin .admin-toolbar select { font-size: 13px; padding: 10px 6px; }
  #membership-admin .admin-count { font-size: 12px; }
}
#memberVaultPanel .account-manager-head { align-items: center; gap: 20px; }
#memberVaultPanel .switch { display: flex; flex: 0 0 auto; align-items: center; }
#memberVaultPanel .switch input { appearance: none; width: 52px; height: 30px; min-height: 30px; margin: 0; padding: 3px; border: 1px solid #617081; border-radius: 20px; background: #273545; cursor: pointer; transition: background .16s ease; }
#memberVaultPanel .switch input::before { content: ''; display: block; width: 22px; height: 22px; border-radius: 50%; background: #dce7ef; transition: transform .16s ease; }
#memberVaultPanel .switch input:checked { background: #247e99; border-color: #83dcfa; }
#memberVaultPanel .switch input:checked::before { transform: translateX(22px); background: white; }
#memberVaultPanel .switch input:focus-visible { outline: 2px solid #83dcfa; outline-offset: 4px; }
#memberVaultPanel .switch input:disabled { opacity: .5; cursor: wait; }
#memberVaultPanel .actions { display: flex; flex-wrap: wrap; gap: 10px; }
#memberVaultPanel .login-device-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-top: 1px solid var(--qf-line); }
#memberVaultPanel .login-device-item strong { overflow-wrap: anywhere; }
#memberVaultPanel .login-device-item em { font-style: normal; color: #83dcfa; }
#memberVaultPanel button { min-height: 44px; }
@media (prefers-reduced-motion: reduce) { #memberVaultPanel .switch input, #memberVaultPanel .switch input::before { transition: none; } }
@media (max-width: 600px) { .admin-facts, .admin-license-form { grid-template-columns: 1fr; } .admin-user header { align-items: start; flex-direction: column; gap: 6px; } }
/* Encrypted-account settings must fit desktop cards and narrow mobile widths. */
.billing-document { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 360px; overflow: auto; font: inherit; padding: 12px; }
.billing-digest { overflow-wrap: anywhere; display: block; max-width: 100%; }
.billing-overdue { color: var(--danger, #c33); font-weight: 700; }
#settingsMembershipContent { min-width: 0; padding-top: 12px; }
#settingsMembershipContent .billing-sections { display: flex; flex-wrap: wrap; gap: 6px; }
#settingsMembershipContent button { background: #183346; color: #cceafa; border: 1px solid #426077; border-radius: 8px; padding: 8px 12px; min-height: 38px; cursor: pointer; }
#settingsMembershipContent button:hover { border-color: #8ad6f5; }
#settingsMembershipContent button:disabled { opacity: .45; cursor: default; }
#settingsMembershipContent .billing-sections button { background: transparent; border-color: transparent; }
#settingsMembershipContent .billing-sections button[aria-pressed="true"] { background: #183346; border-color: #447e97; }
#settingsMembershipContent input[type="checkbox"] { width: auto; }
.billing-form input[type="file"] { min-width: 0; max-width: 100%; }
.billing-form label:has(textarea[name="documentText"]) { grid-column: 1 / -1; }
[data-operations] .billing-form label:has(textarea), [data-operations] .billing-form > p { grid-column: 1 / -1; }
[data-operations] .member-detail-tabs { display:flex; flex-wrap:wrap; gap:6px; }
[data-operations] .member-detail-tabs button[aria-current="true"] { border-color:#7edaff; box-shadow:inset 0 -2px #7edaff; }
@media (max-width: 760px) { body { min-width: min(320px, 100%); } }
#memberVaultPanel { min-width: 0; }
#memberVaultPanel .account-manager-head { display: flex; align-items: center; gap: 16px; padding: 20px 0; }
#memberVaultPanel .account-manager-head > div { min-width: 0; flex: 1; }
#memberVaultPanel .switch { flex-shrink: 0; }
#memberVaultPanel .actions { display: flex; flex-wrap: wrap; gap: 8px; }
#memberVaultPanel button { max-width: 100%; white-space: normal; }
#memberVaultPanel .vault-verification-code { display: block; min-width: 0; max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-all; user-select: all; }

/* 同一 picker DOM 進入 top layer，避開窗格／警告列的堆疊與裁切；位置仍由 anchoredPopupBounds 決定。 */
.wb-stage-head :is(.wb-pane-bot-picker, .wb-pane-group-picker) > .workbench-tabs[popover] { margin: 0; box-sizing: border-box; }
.wb-stage-head :is(.wb-pane-bot-picker, .wb-pane-group-picker) > .workbench-tabs[popover]:not(:popover-open) { display: none; }
