/* Regal UI foundation: one owner for controls, spacing and shared surfaces.
   Important declarations in this named layer win over historical unlayered
   selectors, including mobile IDs. Feature sheets own layout/data colors only. */
body.qe-workspace {
  --regal-font:"IBM Plex Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --regal-space-1:4px; --regal-space-2:8px; --regal-space-3:12px;
  --regal-space-4:16px; --regal-space-6:24px; --regal-space-8:32px;
  --regal-card-pad:12px; --regal-dialog-pad:16px; --regal-chart-pad:8px;
  --regal-gap:12px; --regal-row-pad:4px; --regal-cell-pad-x:8px; --regal-table-row:32px; --regal-table-header-font:11px;
  --regal-control-height:34px; --regal-button-height:34px; --regal-control-radius:6px; --regal-panel-radius:8px;
  --regal-control-bg:#0a0d12; --regal-control-border:#4a4650;
  --regal-control-text:#e6e8ed; --regal-control-font:13px;
  --regal-surface:#111318; --regal-accent:#dfbb64;
  padding-bottom:0;
}
@layer regal-foundation {
  /* Text fields use identical geometry everywhere, including dynamically
     mounted settings, filter fields, chat composers and dialog searches. */
  body.qe-workspace :is(input:not([type=checkbox],[type=radio],[type=range],[type=color],[type=file],[type=hidden]),select,textarea) {
    box-sizing:border-box !important; min-width:0 !important; max-width:100% !important;
    min-height:var(--regal-control-height) !important;
    padding:6px 10px !important;
    border:1px solid var(--regal-control-border) !important;
    border-radius:var(--regal-control-radius) !important;
    background:var(--regal-control-bg) !important; color:var(--regal-control-text) !important;
    font-family:var(--regal-font) !important; font-size:var(--regal-control-font) !important;
    font-weight:400 !important; line-height:1.3 !important; letter-spacing:normal !important;
    text-transform:none !important; box-shadow:none !important; margin:0 !important;
  }
  body.qe-workspace :is(input:not([type=checkbox],[type=radio],[type=range],[type=color],[type=file],[type=hidden]),select) {
    height:var(--regal-control-height) !important;
  }
  body.qe-workspace textarea:not([hidden]) { min-height:64px !important; resize:vertical; }
  body.qe-workspace :is(input,textarea)::placeholder { color:#919aa8 !important; opacity:1 !important; }
  body.qe-workspace :is(input,select,textarea):focus-visible {
    border-color:var(--regal-accent) !important; outline:2px solid var(--regal-accent) !important;
    outline-offset:-2px !important; box-shadow:none !important;
  }
  /* Native controls stay separate from text-field geometry. */
  body.qe-workspace input:is([type=checkbox],[type=radio]) {
    box-sizing:border-box !important; width:18px !important; height:18px !important;
    min-height:18px !important; margin:0 !important; flex:none !important; accent-color:var(--regal-accent);
  }
  body.qe-workspace :is(.regal-actions,.regal-context-controls,.regal-ticker-actions,.regal-v5-controls,
    .regal-review-buttons,.actions-row,.set-actions,.qe-screen-actions,.qe-daily-email-actions) {
    display:flex; flex-wrap:wrap; align-items:center; gap:var(--regal-space-2) !important;
    margin-block:0 !important;
  }
  body.qe-workspace :is(.regal-button,.regal-actions>button,.regal-symbol-form>button,.regal-ticker-actions>button,.regal-v5-controls>button,
    .qe-screen-actions>button,.qe-research-page-controls>button,.qe-ai-usage-row>button,
    .qe-daily-email-actions>button,.regal-ask-send,.qe-research-chat-composer>button,
    .qe-chat-spendbar>button,.actions-row>button,.qe-panel-heading>button,
    .qe-original-settings-head>button,.regal-context-controls>button,.regal-mobile-table-controls>button,.rp-close,.qe-broker-add>button,.regal-panel-refresh-button,.regal-settings-form>button,.regal-settings-stack>button,
    [id=qe-settings-close-footer],.qe-ai-usage-heading>button,.regal-price-chart-controls>button,.regal-tool-btn,.qe-model-toggle) {
    box-sizing:border-box !important; min-height:var(--regal-button-height) !important;
    padding:6px 10px !important;
    border:1px solid var(--regal-control-border) !important; border-radius:var(--regal-control-radius) !important;
    background:#1b2029 !important; color:var(--regal-control-text) !important;
    font-family:var(--regal-font) !important; font-size:13px !important; line-height:1.3 !important;
    font-weight:500 !important; margin:0 !important;box-shadow:none !important;cursor:pointer;
  }
  body.qe-workspace :is(.regal-primary-action,.regal-symbol-form>button[type=submit],.regal-ask-send,.qe-research-chat-composer>button[type=submit]) {
    background:var(--regal-accent) !important; border-color:var(--regal-accent) !important; color:#211b0d !important;
  }
  body.qe-workspace .qe-watchlist-remove {
    min-height:24px !important;padding:2px 6px !important;border:1px solid var(--regal-control-border) !important;
    border-radius:var(--regal-control-radius) !important;background:#1b2029 !important;color:var(--regal-control-text) !important;
    font-family:var(--regal-font) !important;line-height:1.5 !important;
  }
  body.qe-workspace button:disabled { cursor:not-allowed; opacity:.55; }
  body.qe-workspace button:focus-visible { outline:2px solid var(--regal-accent) !important;outline-offset:-2px !important;box-shadow:none !important; }
  /* Reused field and symbol-entry composition, not per-dialog layout copies. */
  /* :not([hidden]): this outranked every [hidden] rule, so a sign-in method
     the deployment does not offer still showed (2026-10-27). */
  body.qe-workspace .regal-symbol-form:not([hidden]) {
    display:grid !important; grid-template-columns:minmax(0,24rem) auto !important;
    align-items:end; justify-content:start; gap:var(--regal-space-2) var(--regal-space-3) !important;
    padding:0 !important; margin:0 !important; min-width:0; width:100%;
  }
  body.qe-workspace .regal-symbol-form>label {
    grid-column:1/-1; position:static !important; height:auto !important; width:auto !important;
    clip:auto !important; clip-path:none !important; overflow:visible !important;
    padding:0 !important; margin:0 !important; color:#aeb7c4; font-size:13px; line-height:1.5;
  }
  body.qe-workspace .regal-symbol-form>input { width:100% !important; max-width:none !important; }
  body.qe-workspace :is(.regal-field,.qe-screen-field) { display:flex;flex-direction:column;gap:var(--regal-space-1) !important;min-width:0; }
  body.qe-workspace .regal-field :is(input,select,textarea) { width:100%; }
  /* One dialog frame and vertical rhythm. Empty/hidden regions do not add gaps. */
  body.qe-workspace :is(.qe-command-palette-card,#qe-settings-panel .modal,.qe-popover-card) {
    box-sizing:border-box !important; padding:var(--regal-dialog-pad) !important;
    border-radius:var(--regal-panel-radius) !important; min-height:0 !important;
  }
  body.qe-workspace .qe-command-palette-card { display:flex !important;flex-direction:column;gap:var(--regal-gap) !important; }
  body.qe-workspace .qe-command-palette-card> :is(p,form,section,div):not(.qe-panel-heading) { margin-block:0 !important; }
  body.qe-workspace .qe-command-palette-card> :is(section,div,p):empty { display:none; }
  body.qe-workspace :is(.qe-panel-heading,.qe-original-settings-head,.regal-deck-section-head) {
    align-items:center; gap:var(--regal-space-2) !important; margin:0 !important;
    padding:0 !important;
  }
  body.qe-workspace .qe-panel-heading :is(h2,h3,p) { margin:0 !important;line-height:1.4; }
  body.qe-workspace .qe-panel-heading>button { margin-left:auto !important;flex:none; }
  /* Explanations have one fixed header and one scrollable text body. */
  body.qe-workspace #qe-popover {
    display:grid;place-items:center;padding:16px;box-sizing:border-box;
    pointer-events:auto !important;background:rgb(0 0 0 / 35%);
  }
  body.qe-workspace #qe-popover[hidden] { display:none !important; }
  body.qe-workspace #qe-popover-card {
    position:relative !important;inset:auto !important;transform:none !important;
    width:min(480px,100%) !important;max-width:100% !important;
    max-height:calc(var(--regal-mobile-viewport,100dvh) - 32px) !important;
    display:flex;flex-direction:column;gap:var(--regal-space-2);overflow:hidden !important;
  }
  body.qe-workspace #qe-popover-card>.qe-panel-heading { display:flex;flex:none;align-items:flex-start; }
  body.qe-workspace #qe-popover-heading { flex:1;min-width:0;overflow-wrap:anywhere;text-align:left; }
  body.qe-workspace #qe-popover-close { height:32px !important;min-height:32px !important;padding:4px 8px !important; }
  body.qe-workspace .regal-radar-min { width:auto !important;min-height:32px !important;padding:4px 8px !important;font-size:12px !important; }
  body.qe-workspace .regal-radar-dismiss { width:32px !important;height:32px !important;min-width:32px !important;min-height:32px !important;padding:0 !important;font-size:18px !important; }
  body.qe-workspace .rp-close { min-width:32px !important; }
  body.qe-workspace #qe-popover-body { white-space:pre-line;min-height:0;min-width:0;overflow-y:auto;overscroll-behavior:contain;overflow-wrap:anywhere; }
  body.qe-workspace #qe-popover-card:has(.regal-market-overview) { display:block;overflow-y:auto !important;overscroll-behavior:contain; }
  body.qe-workspace #qe-popover-card:has(.regal-market-overview)>.qe-panel-heading { position:sticky;top:0;z-index:1000;background:#10151d !important;border-bottom:1px solid #57471f;padding:4px 0 8px !important; }
  body.qe-workspace #qe-popover-card:has(.regal-market-overview) #qe-popover-body { height:auto !important;max-height:none !important;overflow:visible !important; }
  body.qe-workspace .regal-market-overview>section { margin:6px 0 12px;min-width:0; }
  body.qe-workspace[data-mobile-app] #qe-popover:has(.regal-market-overview) { inset:var(--mobile-top) 0 var(--mobile-bottom) !important;padding:8px !important;z-index:1000; }
  body.qe-workspace[data-mobile-app] #qe-popover-card:has(.regal-market-overview) { max-height:100% !important; }
  body.qe-workspace #qe-popover .regal-disclosure-scope { white-space:normal;width:100% !important;min-width:0;height:auto !important;min-height:0 !important;max-height:none !important;padding:0 !important;margin:0 !important;border:0 !important;box-shadow:none !important;background:none !important;overflow:visible !important; }
  body.qe-workspace #qe-popover .regal-disclosure-content { margin:0 !important;min-width:0;max-width:100%;box-sizing:border-box; }
  body.qe-workspace #qe-popover :is(.regal-disclosure-content.qe-card,.regal-disclosure-content>.qe-card,.regal-disclosure-content>div>.qe-card) { padding:0 !important;border:0 !important;border-radius:0 !important;box-shadow:none !important;background:none !important; }
  body.qe-workspace #qe-popover .regal-disclosure-content>summary { display:none !important; }

  body.qe-workspace :where(.regal-stack,#qe-watchlist-dialog-content,.qe-screen,.qe-screen-form,.regal-context,.regal-flow,.v33-parity-tool):not([hidden]) {
    display:flex; flex-direction:column; gap:var(--regal-gap) !important; min-width:0;
  }
  body.qe-workspace :where(.regal-stack,#qe-watchlist-dialog-content,.qe-screen,.qe-screen-form,.regal-context,.regal-flow,.v33-parity-tool)>* { margin-block:0 !important; }
  body.qe-workspace :is(.regal-stack,#qe-watchlist-dialog-content,.qe-screen)>p:empty { display:none; }
  body.qe-workspace :is(.regal-ticker .qe-card,.es-eng-card,.qe-quant-performance-card,
    .qe-inline-model-grid>section,.regal-ticker .stat-group,.regal-ticker .dcf-scenario,
    .regal-hero,.regal-stat-tile,.regal-engine-tile,.regal-verdict-card,.qe-lookthrough-card,.rp-card,
    .regal-gauge-card,.regal-research-card,.regal-rot-hero,.regal-smart-detail,.regal-theme-detail,.qe-settings-section,
    .regal-ask-card,.regal-series-chart,.regal-price-chart,.regal-notice,.regal-quant-signals,.qe-broker-add,.qe-profile-guide-options>button) {
    box-sizing:border-box; min-height:0 !important; padding:var(--regal-card-pad) !important; border-radius:var(--regal-panel-radius) !important;box-shadow:none !important;
  }
  body.qe-workspace :is(.qe-inline-model-grid,.regal-ticker-grid,.regal-context-explain,
    .regal-ticker .stats-grid,.regal-ticker .dcf-scenarios,.regal-engine-tiles,.qe-quant-card-row,
    .regal-macro-grid,.regal-stat-grid,.regal-gauge-row,.regal-viz-grid,.regal-shocks-grid,
    .regal-stat-tiles,.qe-bond-groups,.qe-screen-form) { gap:var(--regal-gap) !important; }
  body.qe-workspace :is(.qe-inline-model-grid,.regal-ticker-grid,.regal-context-explain) { margin-block:var(--regal-gap); }
  body.qe-workspace :is(.regal-context,.regal-ticker,.qe-settings-section,.qe-card) :is(h4,h5) { line-height:1.4;margin:0 0 var(--regal-space-3); }
  body.qe-workspace :is(.regal-context,.regal-ticker,.qe-settings-section,.qe-card) p { line-height:1.5;margin-block:var(--regal-space-2); }
  body.qe-workspace .regal-ticker>* { margin-block:0 !important; }
  body.qe-workspace .regal-ticker { grid-template-columns:minmax(0,1fr) !important;max-width:100%; }
  body.qe-workspace .regal-ticker .qe-card { min-width:0;max-width:100%; }
  body.qe-workspace .regal-summary-card { height:auto !important;min-height:0 !important;margin:0 !important;background:var(--regal-surface) !important;border:1px solid var(--qe-border,#30363d) !important;display:flex;flex-direction:column;gap:var(--regal-space-2) !important; }
  body.qe-workspace .regal-summary-card>* { margin-block:0 !important;flex:0 0 auto !important;min-height:0; }
  body.qe-workspace .regal-summary-card .regal-card-heading { color:var(--regal-accent);font-size:14px;line-height:1.4; }
  body.qe-workspace .regal-summary-card .regal-card-heading>span:nth-child(2) { font-size:14px !important;font-family:inherit !important; }
  body.qe-workspace .qe-inline-model-summary { display:flex;flex-wrap:wrap;align-items:center;gap:var(--regal-space-2); }
  body.qe-workspace .qe-inline-model-summary>* { margin:0 !important; }
  body.qe-workspace .regal-factor-donut { display:block;width:200px;height:200px;max-width:100%;margin-inline:auto; }
  body.qe-workspace .regal-factor-legend { margin:0; }
  body.qe-workspace .regal-factor-legend>div { display:flex;justify-content:space-between;gap:8px;padding:4px 8px; }
  body.qe-workspace .regal-factor-legend dd { margin:0; }
  body.qe-workspace .regal-engine-tiles { grid-template-columns:repeat(auto-fit,minmax(min(100%,128px),1fr)) !important; }
  body.qe-workspace .regal-engine-tile strong { font-size:16px !important;line-height:1.3;overflow-wrap:normal !important; }
  body.qe-workspace .qe-ticker-hero { display:grid !important;grid-template-columns:minmax(0,1fr);gap:var(--regal-space-2) !important; }
  body.qe-workspace .qe-ticker-hero .regal-ticker-actions { order:0 !important; }
  body.qe-workspace select:not([hidden]) { min-width:min(120px,100%) !important; }
  body.qe-workspace :is(.regal-rdcf-input,.regal-mobile-table-controls) { gap:var(--regal-space-2) !important; }
  body.qe-workspace .regal-mobile-table-controls { align-items:end; }
  body.qe-workspace .regal-mobile-table-controls label { min-width:0; }
  body.qe-workspace .qe-card>select { margin-block:var(--regal-space-2) !important; }
  body.qe-workspace details { margin-block:var(--regal-space-2) !important; }
  body.qe-workspace details[open]> *+* { margin-top:var(--regal-space-2) !important;margin-bottom:0 !important; }
  body.qe-workspace .rp-backdrop { box-sizing:border-box;padding:var(--regal-dialog-pad) !important;overflow:hidden !important; }
  body.qe-workspace .rp-modal { box-sizing:border-box;margin:0 !important;border-radius:var(--regal-panel-radius) !important;padding:var(--regal-dialog-pad) !important;display:flex;flex-direction:column;gap:var(--regal-gap);max-height:calc(100dvh - var(--regal-dialog-pad) * 2);overflow-y:auto;overscroll-behavior:contain; }
  body.qe-workspace .rp-modal>* { padding:0 !important;margin:0 !important;flex-shrink:0; }
  body.qe-workspace .rp-modal>.rp-head { position:sticky;top:0;z-index:2;background:var(--regal-surface); }
  body.qe-workspace .rp-cards-grid { display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr)) !important;gap:var(--regal-gap) !important; }
  body.qe-workspace .regal-profile-estimates { display:grid;gap:4px;margin:8px 0;font-size:12px;line-height:1.35;text-align:left; }
  body.qe-workspace .regal-profile-estimates>div { display:flex;justify-content:space-between;gap:8px;min-width:0; }
  body.qe-workspace .regal-profile-estimates dd { margin:0;font-weight:700;font-variant-numeric:tabular-nums;color:var(--regal-accent);white-space:nowrap; }
  body.qe-workspace .regal-profile-estimate-note { display:grid;gap:4px;min-width:0;font-size:12px;line-height:1.4; }
  body.qe-workspace .regal-profile-estimate-note p { margin:0; }
  body.qe-workspace .regal-profile-estimate-note small { color:var(--qe-muted);font-size:11px; }
  body.qe-workspace .table-scroll { min-width:0;max-width:100%;overflow-x:auto; }
  /* Live result regions are structural; their child cards own the framing. */
  body.qe-workspace .qe-command-palette-card>[aria-live] { padding:0 !important;border:0 !important;background:transparent !important; }
  body.qe-workspace .regal-hero { gap:8px !important; }
  body.qe-workspace .regal-hero-symbol { font-size:28px;line-height:1.15; }
  body.qe-workspace .regal-hero-close { font-size:26px;line-height:1.15; }
  /* The dialog is the surface; its tool body is a flow, not a second panel. */
  body.qe-workspace .regal-context .v33-parity-tool {
    padding:0 !important;border:0 !important;border-radius:0 !important;
    background:transparent !important;box-shadow:none !important;
  }
  body.qe-workspace .v33-parity-tool> :is(button,select) { align-self:flex-start; }
  body.qe-workspace .regal-context-controls> :is(input,select) { flex:1 1 150px;width:auto;min-width:0; }
  body.qe-workspace .qe-main { padding:16px 16px 48px !important; }
  @media(max-width:768px) { body.qe-workspace .qe-main { padding:12px 10px calc(var(--mobile-bottom,46px) + 8px) !important; } }
  body.qe-workspace :is(.regal-viz-header,.regal-tool-meta) { margin:0 !important; }
  body.qe-workspace .regal-viz-header { min-width:0; padding:0; }
  body.qe-workspace .regal-viz-title { display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 8px;min-width:0;margin:0 !important;line-height:1.4; }
  /* Desktop opens a section and adds its heading; 4px keeps the caption below it off the heading (Multi-Stage DCF, Nov 7). */
  body.qe-workspace .regal-viz-title.regal-expanded-heading { margin-bottom:4px !important; }
  body.qe-workspace .regal-viz-subtitle { font-weight:400;font-size:12px;line-height:1.4;color:var(--qe-muted,#aab4c4); }
  body.qe-workspace :is(.regal-context,.regal-research-price) .regal-price-chart { padding:0 !important;border:0 !important;border-radius:0 !important;background:transparent !important; }
  /* Every title/body group uses the same rhythm, including groups nested inside a tool. */
  body.qe-workspace .regal-context :has(> .regal-viz-header) { display:flex;flex-direction:column;gap:var(--regal-space-2) !important;min-width:0; }
  body.qe-workspace .regal-context :has(> .regal-viz-header)>* { margin-block:0 !important; }
  body.qe-workspace details[data-desktop-expanded] { display:flex;flex-direction:column;gap:var(--regal-space-2);margin:0 !important;padding:0 !important;border:0 !important;background:none !important; }
  body.qe-workspace details[data-desktop-expanded]>summary { display:none !important; }
  body.qe-workspace details[data-desktop-expanded]>:is(h4,p) { margin:0 !important; }
  body.qe-workspace details[data-desktop-expanded]>p:empty { display:none; }
  body.qe-workspace :is(.qe-card,.regal-gauge-card,.regal-research-card,.regal-smart-detail,.regal-theme-detail).regal-flow { gap:8px !important; }
  body.qe-workspace .regal-price-chart-header h4 { margin:0 !important;line-height:1.3 !important;font-size:12px !important; }
  body.qe-workspace .regal-price-chart-caption { font-size:11px !important;line-height:1.35 !important; }
  body.qe-workspace .regal-price-chart-host { min-width:0;min-height:0 !important;margin:0 !important;padding:0 !important;border:0 !important;background:transparent !important;box-shadow:none !important; }
  body.qe-workspace :is(.regal-context .v33-parity-tool,.regal-ticker) :is(p,li) { font-size:13px;line-height:1.4; }
  body.qe-workspace .regal-ticker .stat-label { min-height:0 !important; }
  body.qe-workspace .regal-rot-tile { padding:0 8px !important;border:0 !important;background:transparent !important; }
  body.qe-workspace .regal-rot-tile+ .regal-rot-tile { border-left:1px solid var(--qe-border) !important; }
  body.qe-workspace .es-eng-card-body { display:flex;flex-direction:column;gap:8px;min-width:0; }
  body.qe-workspace .es-eng-card-body>* { margin-block:0 !important; }
  body.qe-workspace div:has(>.es-eng-card) { align-items:stretch !important; }

  body.qe-workspace .qe-profile-guide-options>button { min-height:56px !important; }
  @media(max-width:768px) {
    body.qe-workspace[data-mobile-app] #qe-profile-guide .qe-command-palette-card { padding:12px !important; }
    body.qe-workspace[data-mobile-app] #qe-profile-guide .qe-profile-guide-options > button { padding:10px !important; }
    body.qe-workspace[data-mobile-app] .regal-portfolio-heading { display:grid !important; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:6px !important; margin-bottom:6px !important; }
    body.qe-workspace[data-mobile-app] .regal-portfolio-heading-copy { display:grid !important; grid-template-columns:minmax(0,1fr) auto; gap:3px 6px !important; }
    body.qe-workspace[data-mobile-app] .regal-portfolio-heading-copy > div { grid-column:1; }
    body.qe-workspace[data-mobile-app] .regal-portfolio-heading-copy > span:not(.regal-panel-refresh) { grid-column:1; white-space:normal; line-height:1.25; }
    body.qe-workspace[data-mobile-app] .regal-portfolio-heading-copy > .regal-panel-refresh { grid-column:2; grid-row:1 / 3; }
    body.qe-workspace[data-mobile-app] .regal-portfolio-heading-actions { width:auto !important; margin:0 !important; gap:4px !important; }
  }
  body.qe-workspace :is(.regal-research-cards,.regal-rot-tiles) { gap:var(--regal-gap) !important; }
  body.qe-workspace :is(.regal-symbol-form,.qe-screen-form,fieldset) {
    padding:0 !important;border:0 !important;border-radius:0 !important;
    margin:0 !important;background:transparent !important;min-width:0;
  }
  body.qe-workspace :is(.qe-card,.regal-gauge-card,.regal-research-card,.qe-settings-section,.rp-card) :is(.qe-card,.stat-group,.regal-gauge-card,.regal-research-card,.qe-broker-add) {
    padding:0 !important;border:0 !important;box-shadow:none !important;background:transparent !important;
  }
  body.qe-workspace .regal-price-chart { padding:var(--regal-chart-pad) !important; }
  body.qe-workspace :is(.qe-card,.qe-command-palette-card) .regal-price-chart { padding:0 !important;border:0 !important;background:transparent !important; }
  body.qe-workspace :is(.regal-price-chart-header,.regal-price-chart-controls,.regal-price-chart-readout,.regal-price-chart-caption,.regal-price-chart-credit) {
    padding:0 !important;margin:0 !important;
  }
  body.qe-workspace .regal-data-table { border:0 !important;border-radius:0 !important;display:table !important;min-width:100%; }
  body.qe-workspace .regal-data-table tr { height:var(--regal-table-row); }
  body.qe-workspace .regal-data-table button {
    min-height:24px !important;padding:2px 6px !important;font-size:12px !important;
    line-height:1.3 !important;border-radius:4px !important;
  }
  body.qe-workspace .regal-data-table th button { min-height:24px !important; }
  body.qe-workspace .regal-data-table :is(td[colspan],[data-kind=detail],[data-wrap=true]) { white-space:normal; }
  body.qe-workspace :is(.qe-card,.qe-command-palette-card,.qe-lookthrough-card,.regal-gauge-card) .regal-table-scroll { border:0 !important;border-radius:0 !important;background:transparent !important; }
  body.qe-workspace :is(.regal-viz-toggle,.regal-ask-modes) {
    display:inline-flex;align-self:flex-start;gap:0 !important;padding:0 !important;
    border:1px solid var(--regal-control-border);border-radius:var(--regal-control-radius);overflow:hidden;
  }
  body.qe-workspace :is(.regal-viz-toggle,.regal-ask-modes)>button {
    min-height:30px !important;padding:4px 8px !important;border:0 !important;
    border-right:1px solid var(--regal-control-border) !important;border-radius:0 !important;margin:0 !important;
  }
  body.qe-workspace :is(.regal-viz-toggle,.regal-ask-modes)>button:last-child { border-right:0 !important; }
  /* All table renderers share density, scroll bounds and header alignment. */
  body.qe-workspace .regal-table-scroll {
    min-width:0;max-width:100%;max-height:min(70vh,calc(var(--regal-table-row) * 16));overflow:auto !important;
    overscroll-behavior:contain;scrollbar-gutter:stable;
  }
  body.qe-workspace .regal-data-table { width:100%;border-collapse:collapse;font-size:12px !important; }
  body.qe-workspace .regal-data-table :is(th,td) {
    padding:var(--regal-row-pad) var(--regal-cell-pad-x) !important;
    line-height:1.3 !important;vertical-align:middle;white-space:nowrap;
  }
  /* Desktop retains ordinary data text; phone renderers may use their compact values. */
  body.qe-workspace:not([data-mobile-app]) .regal-data-table td { font-size:12px !important; }
  /* Dates and ticker badges set their own intrinsic column width. Breaking
     an ISO date or a leverage badge onto another line inflated only some
     desktop rows; narrow tables already scroll inside their shared frame. */
  body.qe-workspace:not([data-mobile-app]) .regal-data-table :is(th,td):is([data-kind=ticker],[data-kind=earnings]) {
    white-space:nowrap !important;
  }
  body.qe-workspace .regal-data-table thead th {
    position:sticky;top:0;z-index:2;background:var(--card,#16171d) !important;
    font-size:var(--regal-table-header-font) !important;line-height:1.25 !important;
  }
  body.qe-workspace .regal-data-table th .qe-sort-button { box-sizing:border-box;width:100% !important;max-width:100%;margin:0 !important;border:0 !important;background:transparent !important;border-radius:0 !important;text-align:inherit !important;padding:0 !important;font-size:inherit !important;line-height:inherit !important;white-space:inherit !important; }
  body.qe-workspace .regal-data-table .tkr-hit { font-size:12px !important; }
  body.qe-workspace :is(.qe-model-details,.qe-watchlist-table,.regal-context,.regal-ticker,.qe-quant-performance-card) .regal-data-table :is(th,td) {
    padding:var(--regal-row-pad) var(--regal-cell-pad-x) !important;line-height:1.3;
  }
  body.qe-workspace .regal-notice { background:var(--regal-surface);border:1px solid var(--regal-control-border); }
  body.qe-workspace .regal-notice> :first-child { margin-top:0; }
  body.qe-workspace .regal-notice> :last-child { margin-bottom:0; }
  body.qe-workspace .regal-ask-card { display:flex;flex-direction:column;gap:var(--regal-space-3); }
  body.qe-workspace .regal-ask-card> :is(p,textarea,div) { margin:0 !important; }
  body.qe-workspace .qe-research-chat-composer { gap:var(--regal-space-2) !important;padding:var(--regal-card-pad) !important; }
  body.qe-workspace #qe-settings-content { display:grid !important;grid-template-columns:160px minmax(0,1fr);align-items:start;align-content:start;gap:var(--regal-gap);min-height:0;max-height:calc(100dvh - 130px);overflow-y:auto;overscroll-behavior:contain; }
  body.qe-workspace .qe-settings-section { margin:0 !important; }
  body.qe-workspace .qe-broker-add { display:grid;gap:var(--regal-space-2) !important; }
  body.qe-workspace .qe-broker-add-title { margin:0 !important; }
  body.qe-workspace .qe-daily-email-form { gap:var(--regal-gap) !important; }
  body.qe-workspace label:has(> :is(input:not([type=checkbox],[type=radio],[type=range]),select,textarea)) { gap:var(--regal-space-1) !important; }

  body.qe-workspace .qe-ai-usage-content { display:grid;gap:var(--regal-space-4); }
  body.qe-workspace .qe-ai-usage-content>section { margin:0 !important;padding:var(--regal-space-4) !important; }
  @media(max-width:768px), (max-width:1024px) and (max-height:500px) and (pointer:coarse) {
    body.qe-workspace #qe-tools-rail { display:none !important; }
    /* Phone pages own vertical scrolling; tables only scroll sideways. */
    body.qe-workspace .regal-table-scroll { max-height:none !important;overflow-x:auto !important;overflow-y:auto !important;overscroll-behavior:auto;scrollbar-gutter:auto; }
    body.qe-workspace .regal-mobile-ticker-tabs>button { min-width:0;font-size:11px !important;padding:3px 2px !important; }
    body.qe-workspace .qe-command-palette>section>.qe-panel-heading { position:sticky;top:0;z-index:5;background:var(--regal-surface); }
    /* break-word, not anywhere: a header word ("TICKER") split letter by letter (2026-10-27). */
    body.qe-workspace .regal-data-table thead th { position:static !important;white-space:normal !important;overflow-wrap:break-word; }
    body.qe-workspace .regal-data-table td[data-wrap=true] { white-space:normal !important;overflow-wrap:anywhere; }
    body.qe-workspace .regal-data-table td[data-wrap=true]>small { display:block;margin-left:0; }
    body.qe-workspace .regal-data-table td:has(>.tkr-hit) { padding-inline:2px !important; }
    body.qe-workspace .regal-data-table .tkr-hit { min-width:0 !important;padding:2px !important;font-size:11px !important; }
    body.qe-workspace .qe-model-details tr.qe-model-row-clickable>td { padding:0 !important; }
    body.qe-workspace { --regal-dialog-pad:10px !important;--regal-card-pad:8px !important;--regal-gap:8px !important;--regal-control-height:36px !important;--regal-button-height:32px !important;--regal-control-font:16px !important;--regal-table-row:32px !important;--regal-table-header-font:10px !important;--regal-row-pad:3px !important;--regal-cell-pad-x:6px !important; }
    body.qe-workspace .regal-symbol-form { grid-template-columns:minmax(0,1fr) auto !important;flex:none !important; }
    body.qe-workspace .regal-symbol-form:has(#qe-ticker-dialog-close) { grid-template-columns:52px minmax(0,1fr) auto !important; }
    body.qe-workspace .regal-symbol-form:has(#qe-ticker-dialog-close)>label { grid-column:2/-1;grid-row:1; }
    body.qe-workspace .regal-symbol-form #qe-ticker-dialog-close { grid-column:1;grid-row:2;padding:8px !important;min-width:32px !important; }
    body.qe-workspace .regal-symbol-form:has(#qe-ticker-dialog-close)>input { grid-column:2;grid-row:2; }
    body.qe-workspace .regal-symbol-form:has(#qe-ticker-dialog-close)>button[type=submit] { grid-column:3;grid-row:2; }
    body.qe-workspace .qe-panel-heading>button[data-mobile-back=true] { margin-left:0 !important;margin-right:0 !important; }
    body.qe-workspace button[data-mobile-back=true] { width:32px !important;min-width:32px !important;height:32px !important;padding:4px !important;font-size:0 !important;line-height:1 !important;display:grid !important;place-items:center; }
    body.qe-workspace button[data-mobile-back=true]::before { content:"‹" !important;font-size:20px !important;line-height:20px; }
    body.qe-workspace button[data-mobile-close=true] { width:52px !important;min-width:52px !important;height:32px !important;padding:4px !important;font-size:0 !important;line-height:1 !important; }
    body.qe-workspace button[data-mobile-close=true]::before { content:"Close" !important;font:600 12px/1 system-ui,sans-serif !important; }
    body.qe-workspace .qe-panel-heading>button[data-mobile-close=true] { order:2;margin-left:auto !important;margin-right:0 !important; }

    body.qe-workspace :is(#qe-context-dialog-result,#qe-ticker-dialog-result,#qe-custom-screener,#qe-watchlist-dialog-content,#qe-settings-content) {
      padding:0 !important;margin:0 !important;min-width:0;
    }
    body.qe-workspace .qe-command-palette-card { gap:var(--regal-gap) !important; }
    body.qe-workspace .qe-screen-form { grid-template-columns:repeat(2,minmax(0,1fr)); }
  }
}

@layer regal-foundation {
  html:has(body .rp-backdrop:not([hidden])) { overflow:hidden !important; }
  html:has(body[data-mobile-app] :is(.qe-command-palette,#qe-settings-panel,#qe-research-chat,#qe-popover):not([hidden])) { overflow:hidden !important; }
}
@media(max-width:768px) {

  body.qe-workspace :is(.regal-context,.regal-ticker,.qe-quant-performance-card) .regal-data-table :is(th,td) { padding:4px 6px;line-height:1.3; }
  /* Mobile frames keep their existing safe-area/keyboard padding and scroll. */
  body.qe-workspace :is(.qe-inline-model-close,.qe-inline-model-full,.qe-model-pie-toggle) { min-height:36px; }

}
/* The compact Engine/portfolio schema moved Allocation from fifth to third.
   Align headers and cells by their shared meaning, not legacy column numbers. */
.qe-model-details table[data-v5-columns=compact] :is(th,td)[data-kind] { text-align:left; }
.qe-model-details table[data-v5-columns=compact] :is(th,td):is([data-kind=weight],[data-kind=rank],[data-kind=momentum],[data-kind=trailing],[data-kind=multiple]) { text-align:right; }
.qe-model-details table[data-v5-columns=compact] :is(th,td):is([data-kind=earnings],[data-kind=favorite]) { text-align:center; }


@layer regal-foundation {
  body.qe-workspace .regal-cell-secondary { display:block; margin-top:2px; color:var(--qe-muted); font-size:10px; line-height:1.2; white-space:nowrap; }
  body.qe-workspace .qe-screen-grid { align-items:end !important; }
  body.qe-workspace .qe-screen-form { display:flex !important;flex-direction:column;gap:var(--regal-gap) !important; }
}

/* Shared delayed-read notice uses the same section spacing as the deck. */
#qe-read-wait-status{position:fixed;left:50%;bottom:16px;transform:translateX(-50%);z-index:10020;width:max-content;max-width:calc(100% - 32px);box-sizing:border-box;margin:0;padding:12px 16px;border:1px solid var(--border);border-radius:8px;background:var(--card,#101117);color:var(--text);pointer-events:none;}

body[data-mobile-app] #qe-read-wait-status{bottom:calc(var(--mobile-bottom,46px) + 12px);}
/* Background deck reads never cover an open dialog: it covered the chat composer (2026-10-27). */
body:has([role="dialog"][aria-modal="true"]:not([hidden])) #qe-read-wait-status{display:none;}

/* A table's destructive action remains reachable while its research columns pan. */
body.qe-workspace[data-mobile-app] .regal-data-table :is(td,th)[data-kind=remove]{position:sticky;inset-inline-end:0;z-index:2;background:var(--regal-surface,#10151c);border-inline-start:1px solid var(--border,#303a43);}
body.qe-workspace[data-mobile-app] .regal-data-table th[data-kind=remove]{z-index:3;}
@layer regal-foundation {body.qe-workspace[data-mobile-app] .regal-data-table [data-kind=remove] button{min-height:32px !important;padding:4px 8px !important;}}

body.qe-workspace[data-mobile-app] .regal-factor-detail { display:none; }

/* One research grid owns desktop placement. Groups containing charts or
   statistics contribute their cards to that grid, never a second tiny grid. */
@layer regal-foundation {
 body.qe-workspace .regal-ticker .regal-ticker-toolbar { display:flex !important;flex-wrap:wrap;align-items:center;gap:var(--regal-gap) !important;padding:0 !important;border:0 !important;background:transparent !important;margin:0 !important; }
 body.qe-workspace .regal-ticker-toolbar .regal-ticker-actions { display:flex;flex:1 1 360px;min-width:0;flex-wrap:wrap;align-items:center;gap:var(--regal-space-2);margin:0 !important; }
 body.qe-workspace .regal-ticker-toolbar .regal-ticker-actions>select { width:auto !important;flex:0 1 220px;min-width:160px !important;max-width:100% !important; }
 body.qe-workspace .regal-ticker-head .regal-ticker-context { grid-column:1/-1;order:2;display:flex;flex-wrap:wrap;align-items:center;gap:12px 24px; }
 body.qe-workspace .regal-ticker-head .regal-ticker-context :is(.regal-verdict-card,.regal-engine-tile) { border:0 !important;background:transparent !important;padding:0 !important;margin:0 !important;min-height:32px !important; }
 body.qe-workspace .regal-ticker-head .regal-ticker-context .regal-engine-tile { display:flex !important;flex-wrap:wrap;align-items:baseline;gap:8px; }
 body.qe-workspace .regal-ticker-head .regal-ticker-context .regal-engine-tiles { display:block !important; }
 body.qe-workspace .regal-ticker-head .regal-ticker-context .regal-engine-tile>* { margin:0 !important; }
 body.qe-workspace .regal-ticker-source { color:var(--qe-muted,#aab4c4);font-size:12px;line-height:1.4; }
 body.qe-workspace .regal-ticker .stat-row { display:grid !important;grid-template-columns:minmax(0,1fr) minmax(105px,.85fr);gap:4px 12px !important;align-items:start;padding:6px 0 !important; }
 body.qe-workspace .regal-ticker :is(.stat-label,.stat-val) { min-width:0;max-width:100%;overflow-wrap:anywhere;line-height:1.4; }
 body.qe-workspace .regal-ticker .stat-val { white-space:normal !important;text-align:right; }
 body.qe-workspace .regal-ticker .stat-number { white-space:nowrap; }
 body.qe-workspace .regal-ticker :is(.stat-session-ahead,.stat-caveat) { display:block;white-space:normal;max-width:100%;margin:3px 0 0 auto !important;line-height:1.35;font-size:11px; }
 body.qe-workspace .regal-ticker .stat-session-ahead { width:fit-content; }
 body.qe-workspace .regal-ticker :is(.regal-research-card,.stat-group,.qe-ticker-financial-series) { box-sizing:border-box;min-width:0;padding:var(--regal-card-pad) !important;border:1px solid var(--qe-border,#30363d) !important;border-radius:var(--regal-panel-radius) !important;background:var(--regal-surface) !important;margin:0 !important; }
 body.qe-workspace .regal-ticker .qe-ticker-financial-series { align-self:start !important; }
 body.qe-workspace .regal-ticker :is(.regal-research-metrics,[data-research-panel=statistics]>.qe-card) { padding:0 !important;border:0 !important;background:transparent !important; }
 body.qe-workspace .regal-ticker :is(.regal-research-card,.stat-group)>:is(h3,h4) { margin:0 0 8px !important;font-size:14px !important;line-height:1.35;letter-spacing:normal;text-transform:none; }
 body.qe-workspace .regal-research-card dl { margin:0; }
 body.qe-workspace .regal-research-card dl>div { display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:start;gap:6px 12px;min-height:32px;padding:6px 0 !important; }
 body.qe-workspace .regal-research-card :is(dt,dd) { min-width:0;margin:0;line-height:1.45;overflow-wrap:anywhere; }
 body.qe-workspace .regal-research-card dd { text-align:right; }
 body.qe-workspace .regal-financial-disclosure>.regal-expanded-heading { display:none !important; }
 @media(min-width:769px) {
  body.qe-workspace:not([data-mobile-app]) .qe-ticker-dialog-card { width:min(1680px,calc(100vw - 32px)) !important;max-width:calc(100vw - 32px) !important; }
  body.qe-workspace:not([data-mobile-app]) .regal-ticker[data-research-layout] { display:grid !important;grid-template-columns:repeat(12,minmax(0,1fr)) !important;gap:var(--regal-gap) !important;align-items:start; }
  body.qe-workspace:not([data-mobile-app]) .regal-ticker[data-research-layout]>* { grid-column:span 6;min-width:0; }
  body.qe-workspace:not([data-mobile-app]) .regal-ticker[data-research-layout=overview]>.regal-ticker-head { grid-column:1/-1;display:grid !important;grid-template-columns:minmax(0,1fr) minmax(220px,.55fr) !important;gap:var(--regal-gap) !important;padding-bottom:var(--regal-gap);border-bottom:1px solid var(--qe-border,#30363d); }
  body.qe-workspace:not([data-mobile-app]) .regal-ticker-head>.regal-hero { grid-column:1/-1;order:0;padding:0 !important;border:0 !important;background:transparent !important; }
  body.qe-workspace:not([data-mobile-app]) .regal-ticker-head>.qe-ticker-hero { grid-column:1/-1;order:1; }
  body.qe-workspace:not([data-mobile-app]) .regal-ticker[data-research-layout=overview]>.regal-research-radar { grid-column:span 5; }
  body.qe-workspace:not([data-mobile-app]) .regal-ticker[data-research-layout=overview]>.regal-peers { grid-column:span 7; }
  /* A fund page (owner, 2026-10-31: 'terrible layout'): the full-width 'Complete metrics' heading left the
     fund profile alone on its row with the right half empty and the chart below at another width. Fund
     profile and price chart side by side, then the metrics, then the earnings note and signals. */
  body.qe-workspace:not([data-mobile-app]) .regal-ticker[data-research-layout=overview]:has(>.regal-fund-profile)>.regal-fund-profile { grid-column:1/span 6;grid-row:span 3;order:1; }
  body.qe-workspace:not([data-mobile-app]) .regal-ticker[data-research-layout=overview]:has(>.regal-fund-profile)>.regal-research-price { grid-column:span 6 !important;order:1; }
  body.qe-workspace:not([data-mobile-app]) .regal-ticker[data-research-layout=overview]:has(>.regal-fund-profile)>.regal-research-metrics>h3,
  body.qe-workspace:not([data-mobile-app]) .regal-ticker[data-research-layout=overview]:has(>.regal-fund-profile)>.regal-research-metrics>.regal-ticker-grid>* { order:2;grid-column:7/-1 !important; }
  body.qe-workspace:not([data-mobile-app]) .regal-ticker[data-research-layout=overview]:has(>.regal-fund-profile)>*:not(.regal-ticker-head,.regal-fund-profile,.regal-research-price,.regal-research-metrics) { order:3; }
  body.qe-workspace:not([data-mobile-app]) .regal-ticker[data-research-layout=overview]:has(>.regal-fund-profile) [data-research-layout=financials]>.qe-card:first-child { grid-column:1/-1; }
  body.qe-workspace:not([data-mobile-app]) .regal-ticker[data-research-layout=overview]:has(>.regal-fund-profile) [data-research-layout=financials]>.qe-card:nth-child(2) { grid-column:1/-1; }
  body.qe-workspace:not([data-mobile-app]) .regal-research-radar .regal-radar svg { max-height:320px !important; }
  body.qe-workspace:not([data-mobile-app]) :is(.regal-research-metrics,.regal-research-metrics>.regal-ticker-grid) { display:contents !important; }
  body.qe-workspace:not([data-mobile-app]) .regal-research-metrics>.regal-ticker-grid>.qe-card { grid-column:span 6; }
  /* A fund with no profile card (ITA, live 2026-11-06) has a note and a metric list, not cards: each fell into one
     113 px column and its withheld-return reason ran a word to a line. They span the row. */
  body.qe-workspace:not([data-mobile-app]) .regal-research-metrics>.regal-ticker-grid>:not(.qe-card) { grid-column:1/-1; }
  body.qe-workspace:not([data-mobile-app]) .regal-research-metrics>h3 { grid-column:1/-1;margin:8px 0 0 !important; }
  body.qe-workspace:not([data-mobile-app]) .regal-ticker[data-research-layout=overview]>div:has(>.regal-ticker[data-research-layout=financials]) { grid-column:1/-1; }
  body.qe-workspace:not([data-mobile-app]) [data-research-layout=financials]>.regal-financial-pair { display:contents !important; }
  body.qe-workspace:not([data-mobile-app]) [data-research-layout=financials] [data-research-panel] { grid-column:span 6;min-width:0; }
  /* Stock page (owner, 2026-10-31: 'terrible layout'). History and statistics are grids of their own; the
     Discounted Cash Flow spans the Reverse DCF and the earnings card beside it; the signals run across the
     full width, their three charts side by side instead of one 2,700 px column. */
  body.qe-workspace:not([data-mobile-app]) [data-research-layout=financials]>:is([data-research-panel=history],[data-research-panel=statistics]):not([hidden]) { grid-column:1/-1 !important;display:grid !important;grid-template-columns:repeat(12,minmax(0,1fr));gap:var(--regal-gap);align-items:stretch; }
  body.qe-workspace:not([data-mobile-app]) [data-research-layout=financials]>[data-research-panel=reverse] { grid-column:1/span 6; }
  body.qe-workspace:not([data-mobile-app]) [data-research-layout=financials]>[data-research-panel=dcf] { grid-column:7/-1;grid-row:span 2; }
  body.qe-workspace:not([data-mobile-app]) [data-research-layout=financials]>[data-research-panel=earnings] { grid-column:1/span 6; }
  body.qe-workspace:not([data-mobile-app]) [data-research-layout=financials]>[data-research-panel=signals] { grid-column:1/-1; }
  body.qe-workspace:not([data-mobile-app]) [data-research-layout=financials]>[data-research-panel=signals] .regal-ticker-grid { display:grid !important;grid-template-columns:repeat(3,minmax(0,1fr)) !important;gap:var(--regal-gap);align-items:stretch; }
  body.qe-workspace:not([data-mobile-app]) [data-research-layout=financials]>[data-research-panel=signals] .regal-ticker-grid>.qe-ticker-financial-series { grid-column:span 1 !important;min-width:0; }
  body.qe-workspace:not([data-mobile-app]) [data-research-panel=history]>.qe-card,
  body.qe-workspace:not([data-mobile-app]) [data-research-panel=history] .regal-financial-content,
  body.qe-workspace:not([data-mobile-app]) .regal-history-body,
  body.qe-workspace:not([data-mobile-app]) .regal-history-body>.regal-ticker-grid,
  body.qe-workspace:not([data-mobile-app]) [data-research-panel=statistics]>.qe-card,
  body.qe-workspace:not([data-mobile-app]) [data-research-panel=statistics] .stats-grid { display:contents !important; }
  body.qe-workspace:not([data-mobile-app]) :is([data-research-panel=history],[data-research-panel=statistics]) :is(h3,.regal-history-body>details,.regal-history-body>select,.regal-history-body>.regal-ticker-grid>p,.qe-card>p) { grid-column:1/-1;min-width:0;margin:0; }
  body.qe-workspace:not([data-mobile-app]) [data-research-panel=history] .regal-financial-disclosure { grid-column:1/-1;display:block !important; }
  body.qe-workspace:not([data-mobile-app]) .regal-history-body>select { max-width:240px !important; }
  body.qe-workspace:not([data-mobile-app]) .regal-history-body>details { display:flex;flex-wrap:wrap;align-items:baseline;gap:8px; }
  body.qe-workspace:not([data-mobile-app]) .regal-history-body>details>:is(h4,p) { margin:0 !important; }
  body.qe-workspace:not([data-mobile-app]) [data-research-layout=financials] :is(.stat-group,.qe-ticker-financial-series,.qe-ticker-exact-values) { grid-column:span 6;min-width:0; }
  body.qe-workspace:not([data-mobile-app]) .regal-ticker figure.qe-ticker-financial-series>svg { max-height:220px; }
 }
 /* A fund page side by side needs the room: between tablet and 1200 px the profile and the metrics each got half of a
    narrow dialog (labels broke letter by letter, the metrics floated under a tall gap). There they stack (owner audit
    2026-10-31: 'At certain widths it looks weird'). */
 @media(min-width:769px) and (max-width:1199.98px) {
  body.qe-workspace:not([data-mobile-app]) .regal-ticker[data-research-layout=overview]:has(>.regal-fund-profile)>.regal-fund-profile { grid-column:1/-1 !important;grid-row:auto !important; }
  body.qe-workspace:not([data-mobile-app]) .regal-ticker[data-research-layout=overview]:has(>.regal-fund-profile)>.regal-research-price { grid-column:1/-1 !important; }
  body.qe-workspace:not([data-mobile-app]) .regal-ticker[data-research-layout=overview]:has(>.regal-fund-profile)>.regal-research-metrics>h3,
  body.qe-workspace:not([data-mobile-app]) .regal-ticker[data-research-layout=overview]:has(>.regal-fund-profile)>.regal-research-metrics>.regal-ticker-grid>* { grid-column:1/-1 !important; }
 }
 @media(min-width:1440px) {
  body.qe-workspace:not([data-mobile-app]) .regal-ticker[data-research-layout=overview]>.regal-research-price { grid-column:1/-1; }
  body.qe-workspace:not([data-mobile-app]) .regal-ticker[data-research-layout=overview]>.regal-thesis { grid-column:1/-1; }
  body.qe-workspace:not([data-mobile-app]) .regal-research-metrics>.regal-ticker-grid>.qe-card,
  body.qe-workspace:not([data-mobile-app]) [data-research-layout=financials] .stat-group { grid-column:span 4; }
  body.qe-workspace:not([data-mobile-app]) [data-research-layout=financials] .qe-ticker-financial-series { grid-column:span 3; }
  body.qe-workspace:not([data-mobile-app]) [data-research-layout=financials] :is(.qe-ticker-financial-series:has(svg[aria-label="Reported annual cash-flow uses"]),.qe-ticker-financial-series:has(svg[aria-label="Reported annual margins"]),.qe-ticker-exact-values) { grid-column:span 6; }
 }
}

/* One compact toolkit skin for the nine market tools, Ticker, Screener,
   Watchlist and Chat. Splash's graphite/gold hierarchy, without its demo
   layout, fixed heights or extra frames. Geometry stays in the foundation. */
@layer regal-foundation {
  body.qe-workspace .regal-tool-surface {
    --regal-surface:#0f1218; --qe-card:#151a22; --qe-border:#303a43;
    --qe-muted:#aab5c1; --regal-control-border:#3d4854;
    background:var(--regal-surface) !important; border-color:#35414b !important;
    box-shadow:none !important;
  }
  body.qe-workspace .regal-tool-surface> :is(.qe-panel-heading,.qe-research-chat-strip) {
    padding:6px 8px !important; border-bottom:1px solid var(--qe-border) !important;
    background:linear-gradient(90deg,#dfbb6418,#18202980 55%,var(--regal-surface)) var(--regal-surface) !important;
  }
  body.qe-workspace .regal-tool-surface :is(.qe-panel-heading,.qe-research-chat-strip) h2:not([data-mobile-title]) {
    font-size:16px !important; font-weight:650; letter-spacing:normal;
  }
  body.qe-workspace .regal-tool-surface :is(.regal-viz-title,.regal-price-chart-header h4) {
    font-family:var(--regal-font) !important; font-size:12px !important;
    font-weight:650 !important; letter-spacing:normal !important; text-transform:none !important;
  }
  body.qe-workspace .regal-tool-surface :is(.regal-tool-meta,.regal-stat-tile>small,.regal-rot-tile>span) {
    color:var(--qe-muted) !important;
  }
  body.qe-workspace .regal-tool-surface :is(.regal-rot-hero,.regal-hero,.regal-stat-tile,.regal-engine-tile) {
    background:#151a22 !important; border-color:var(--qe-border) !important;
  }
  body.qe-workspace .regal-tool-surface :is(.regal-rot-hero,.regal-hero) {
    border-inline-start:2px solid var(--regal-accent) !important;
  }
  body.qe-workspace .regal-tool-surface .regal-rot-verdict {
    text-transform:none !important; letter-spacing:normal !important;
  }
  body.qe-workspace .regal-tool-surface .regal-ask-card {
    border:0 !important; border-top:1px solid var(--qe-border) !important;
    border-radius:0 !important; padding-inline:0 !important; background:transparent !important;
  }
  body.qe-workspace .regal-tool-surface .regal-data-table thead th {
    background:#141820 !important; border-color:var(--qe-border) !important;
  }
  @media(max-width:768px) {
    body.qe-workspace .regal-tool-surface> :is(.qe-panel-heading,.qe-research-chat-strip) { padding:4px 6px !important; }
  }
}
/* One readable explanation across all three model products. */
@layer regal-foundation {
 .qe-product-tabs button .regal-tab-info{position:absolute;top:6px;right:8px;font-size:13px;font-weight:600;color:#c1a75d;line-height:1;cursor:help}
 .regal-portfolio-principles{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:0 0 14px}
 .regal-portfolio-principles article{min-width:0;padding:12px;border:1px solid var(--border,#30363d);border-top:2px solid var(--gold,#dfbb64);border-radius:8px;background:#10161e}
 .regal-portfolio-principles h3{margin:0 0 6px;font-size:16px;line-height:1.3;color:#dfbb64}
 .regal-portfolio-principles article p,.regal-principles-warning{margin:0;font-size:14px;line-height:1.45;color:#dce3ee}
 .regal-principles-warning{grid-column:1/-1}
 @media(max-width:767px){.regal-portfolio-principles{grid-template-columns:1fr;gap:8px;margin-bottom:10px}.regal-portfolio-principles article{padding:10px}.regal-portfolio-principles h3{font-size:15px}}
}

@layer regal-foundation {
  body.qe-workspace .regal-form-panel { display:flex !important;flex-direction:column;align-items:stretch !important;gap:var(--regal-gap) !important;margin:0 !important;padding:var(--regal-card-pad) !important;min-width:0;box-sizing:border-box; }
  body.qe-workspace .regal-form-panel form { align-items:stretch !important; }
  body.qe-workspace .regal-form-panel form>:not(button) { align-self:stretch !important;width:100% !important;box-sizing:border-box;min-width:0; }
  body.qe-workspace .regal-form-panel form>button { justify-self:start;align-self:start;width:auto !important; }
  body.qe-workspace :is(.regal-form-panel,.regal-settings-stack,.qe-settings-section)>button { justify-self:start;align-self:flex-start !important;width:auto !important;max-width:100%; }
  body.qe-workspace .regal-research-toolbar { grid-column:1/-1;display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;min-width:0; }
  body.qe-workspace .regal-research-toolbar>select { width:auto !important;min-width:160px;max-width:240px !important; }
  body.qe-workspace:not([data-mobile-app]) .regal-radar .regal-factor-axis-label { font-size:20px; }
  body.qe-workspace :is(.regal-form-panel,.regal-settings-stack)>* { margin:0 !important; }
  body.qe-workspace :is(.regal-settings-stack,.regal-settings-form) { display:grid;gap:var(--regal-gap);min-width:0; }
  body.qe-workspace .regal-settings-form>label:not(.qe-daily-email-consent) { display:grid;gap:4px;min-width:0; }
  body.qe-workspace .regal-settings-reading { display:grid;grid-template-columns:minmax(100px,.3fr) minmax(0,1fr);gap:4px 12px;padding:var(--regal-card-pad);background:#151a22;border-radius:var(--regal-panel-radius); }
  body.qe-workspace .regal-settings-reading strong { min-width:0;overflow-wrap:anywhere; }
  body.qe-workspace .regal-settings-reading small { grid-column:2; }
  body.qe-workspace #qe-settings-panel .modal { width:min(1080px,calc(100vw - 32px)) !important;max-height:calc(100dvh - 32px) !important;display:flex;flex-direction:column;gap:var(--regal-gap);overflow:hidden !important; }
  body.qe-workspace #qe-settings-content>.set-tabs { grid-column:1;grid-row:1;display:grid !important;gap:4px !important;align-content:start;position:sticky;top:0;margin:0 !important;border:0 !important; }
  body.qe-workspace #qe-settings-content>.set-tabpanel:not([hidden]) { grid-column:2;grid-row:1;display:grid !important;gap:var(--regal-gap);min-width:0;padding:0 !important; }
  body.qe-workspace #qe-settings-content>.set-tabpanel[hidden] { display:none !important; }
  body.qe-workspace #qe-settings-panel .set-tab { min-height:var(--regal-button-height) !important;padding:8px 10px !important;text-align:left;white-space:normal;border:0 !important;border-left:3px solid transparent !important;border-radius:4px !important;background:transparent;font-size:13px;line-height:1.4; }
  body.qe-workspace #qe-settings-panel .set-tab[aria-selected=true] { border-left-color:var(--regal-accent) !important;background:#dfbb6412;color:var(--regal-control-text); }
  body.qe-workspace #qe-settings-panel .qe-settings-section { display:grid;gap:var(--regal-gap);padding:var(--regal-card-pad) !important;border:1px solid var(--qe-border,#30363d);border-radius:var(--regal-panel-radius);background:var(--regal-surface); }
  body.qe-workspace #qe-settings-panel .qe-settings-section>* { margin:0 !important; }
  body.qe-workspace #qe-settings-panel .qe-settings-section.regal-settings-groups { padding:0 !important;border:0 !important;background:transparent !important; }
  body.qe-workspace #qe-settings-panel :is(.qe-ai-usage-wallet,.qe-ai-usage-included,.qe-ai-usage-form) { padding:var(--regal-card-pad) !important;margin:0 !important;background:var(--regal-surface);border:1px solid var(--qe-border,#30363d);border-radius:var(--regal-panel-radius); }
  body.qe-workspace #qe-settings-panel :is(.set-tabpanel,form)>button,
  body.qe-workspace .regal-research-card>button { justify-self:start;align-self:start;width:auto !important; }
  body.qe-workspace .regal-peer-picker time { white-space:nowrap; }
  body.qe-workspace #qe-settings-panel .qe-settings-section h3 { font-size:15px !important;margin:0 !important; }
  body.qe-workspace #qe-settings-panel .qe-subscription-plans { gap:var(--regal-gap); }
  body.qe-workspace #qe-settings-panel .qe-subscription-plan { padding:var(--regal-card-pad);border-color:var(--qe-border,#30363d); }
  body.qe-workspace #qe-settings-panel .qe-subscription-plan[data-current=true] { border-color:var(--regal-accent); }
  body.qe-workspace .qe-subscription-plan h4 { display:flex;flex-wrap:wrap;align-items:center;gap:8px;font-size:15px;margin:0 !important; }
  body.qe-workspace .regal-plan-badge { font-size:11px;font-weight:500;color:var(--regal-accent); }
  body.qe-workspace .regal-plan-prices { margin:0;display:grid;gap:6px; }
  body.qe-workspace .regal-plan-prices>div { display:flex;justify-content:space-between;gap:12px; }
  body.qe-workspace .regal-plan-prices :is(dt,dd) { margin:0;font-size:12px; }
  body.qe-workspace .regal-plan-selection { color:var(--regal-accent);font-weight:600; }
  body.qe-workspace .regal-portfolio-account-info { display:grid;gap:8px;min-width:0; }
  body.qe-workspace .regal-portfolio-account-info .regal-sell-disclaimer { display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:6px 12px;padding:0 !important;border:0 !important;background:transparent !important;margin:0 !important;font-size:12px; }
  body.qe-workspace .regal-portfolio-account-info .es-portfolio-legend { font-size:11px;line-height:1.4; }
  @supports(grid-template-rows:subgrid) {
    @media(min-width:769px) {
      body.qe-workspace:not([data-mobile-app]) .regal-v5-workspace #v33-me-2col { display:grid !important;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:auto minmax(0,1fr) auto;gap:8px var(--regal-gap) !important; }
      body.qe-workspace:not([data-mobile-app]) .regal-v5-workspace #v33-me-2col>.es-eng-card { display:grid !important;grid-template-rows:subgrid;grid-row:1 / span 3;gap:8px; }
      body.qe-workspace:not([data-mobile-app]) #v33-me-model-card { grid-column:1; }
      body.qe-workspace:not([data-mobile-app]) #v33-me-portfolio-card { grid-column:2; }
      body.qe-workspace:not([data-mobile-app]) #v33-me-2col .regal-portfolio-footer { align-content:start;margin-top:0; }
    }
  }
  body.qe-workspace .qe-subscription-confirm:not([hidden]) { padding:var(--regal-card-pad);border:1px solid var(--regal-accent);border-radius:var(--regal-panel-radius); }
  body.qe-workspace #qe-ticker-dialog:has(.regal-ticker) #qe-ticker-dialog-description { display:none; }
  body.qe-workspace #qe-ticker-dialog-form { display:flex !important;flex-wrap:wrap;align-items:center;gap:8px !important;margin:0 !important; }
  body.qe-workspace #qe-ticker-dialog-form>label { width:auto !important;flex:0 0 auto;align-self:center;margin:0 !important; }
  body.qe-workspace #qe-ticker-dialog-symbol { width:auto !important;flex:1 1 160px;max-width:280px !important; }
  @media(max-width:768px) {
    body.qe-workspace .regal-ticker-head .regal-ticker-context { display:grid !important;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px !important; }
    /* A sentence in the verdict line ("No broker connected. Check ...") had 54 px beside the badge and ran five lines
       (live 2026-11-06, 390 px). It takes the whole row; a short allocation keeps its place beside the badge. */
    body.qe-workspace[data-mobile-app] .regal-ticker-head .regal-ticker-context .regal-verdict-card:has(>.regal-verdict-body>.regal-verdict-line:not([data-mobile-allocation])) { grid-column:1/-1 !important; }
    body.qe-workspace[data-mobile-app] .regal-ticker-context .regal-verdict-line:not([data-mobile-allocation]) { grid-column:2/-1 !important; }
    body.qe-workspace .regal-ticker-context .regal-engine-tiles { border:0 !important;background:transparent !important; }
    body.qe-workspace .regal-ticker-head .regal-ticker-context .regal-engine-tile { gap:4px 6px !important; }
    body.qe-workspace .regal-ticker-context .regal-engine-tile span[data-mobile-label]::before { font-size:11px !important; }
    body.qe-workspace .regal-ticker-toolbar .regal-ticker-jump { display:none !important; }
    body.qe-workspace .regal-ticker-toolbar .regal-ticker-actions { flex:1 1 210px; }
    body.qe-workspace #qe-ticker-dialog-form .regal-panel-refresh { display:contents; }
    body.qe-workspace #qe-ticker-dialog-form .regal-panel-refresh-status { flex-basis:100%; }
    body.qe-workspace #qe-ticker-dialog-form>label { flex-basis:100%; }
    body.qe-workspace #qe-ticker-dialog-form #qe-ticker-dialog-symbol { flex:1 1 0; }
    body.qe-workspace .regal-peer-picker { display:grid !important;gap:6px;min-width:0; }
    body.qe-workspace .regal-peer-picker>p { margin:0;font-size:12px;line-height:1.4; }
    body.qe-workspace .regal-peer-picker>button { justify-self:start;width:auto; }
    body.qe-workspace #qe-settings-panel .modal { width:calc(100vw - 12px) !important;max-height:calc(100dvh - 12px) !important; }
    body.qe-workspace #qe-settings-content { grid-template-columns:minmax(0,1fr); }
    body.qe-workspace #qe-settings-content>.set-tabs { grid-column:1;grid-row:1;grid-template-columns:repeat(4,minmax(0,1fr));position:static; }
    body.qe-workspace #qe-settings-content>.set-tabpanel:not([hidden]) { grid-column:1;grid-row:2; }
    body.qe-workspace #qe-settings-panel .set-tab { text-align:center;padding:5px 4px !important;font-size:12px;border-left:0 !important;border-bottom:2px solid transparent !important; }
    body.qe-workspace #qe-settings-panel .set-tab[aria-selected=true] { border-bottom-color:var(--regal-accent) !important; }
  }
  body.qe-workspace .regal-form-panel :is(.regal-field,.qe-screen-field) { margin:0 !important; }
  body.qe-workspace .regal-form-panel .qe-screen-actions { justify-content:flex-start !important; }
  body.qe-workspace .regal-form-help { margin:0 !important;line-height:1.4;overflow-wrap:anywhere; }
  body.qe-workspace .regal-panel-refresh { display:flex;align-items:center;gap:6px;min-width:0; }
  body.qe-workspace .regal-panel-refresh-button { flex:0 0 auto;width:34px !important;min-width:34px !important;max-width:34px !important;padding:4px !important; }
  body.qe-workspace .regal-panel-refresh-status { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0; }
  body.qe-workspace .regal-panel-refresh-status:empty { display:none; }
  body.qe-workspace .qe-panel-heading:has(>.regal-panel-refresh)>button { margin-inline-start:0 !important; }
  body.qe-workspace .regal-panel-heading { display:flex;justify-content:space-between;align-items:start;gap:var(--regal-gap); }
  body.qe-workspace .regal-panel-heading>h3 { margin:0; }
  body.qe-workspace .regal-form-panel :is(.qe-screen-results,.regal-form-help):empty { display:none; }
  /* Exposure across the full width, the two earnings panels below it, left to right (owner, 2026-10-31). */
  body.qe-workspace .regal-v5-workspace #regal-deck-sections { display:grid !important;grid-template-columns:minmax(0,1fr) !important;gap:var(--regal-gap) !important;align-items:start;margin-top:var(--regal-gap) !important; }
  body.qe-workspace .regal-v5-workspace #regal-slot-earnings { grid-column:auto;min-width:0; }
  body.qe-workspace .regal-v5-workspace .regal-selected-exposure[hidden] { display:none !important; }
  body.qe-workspace .regal-exposure-grid { list-style:none;margin:var(--regal-gap) 0 0;padding:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(5,auto);grid-auto-flow:column;gap:4px var(--regal-gap);counter-reset:exposure; }
  body.qe-workspace .regal-exposure-item { display:flex;flex-wrap:wrap;align-items:center;gap:2px 8px;min-height:32px;padding:4px 8px;border-bottom:1px solid var(--qe-border,rgba(255,255,255,.08));counter-increment:exposure;min-width:0; }
  body.qe-workspace .regal-exposure-item::before { content:counter(exposure);min-width:18px;color:var(--qe-muted,#aab5c5);font-size:12px;text-align:right; }
  body.qe-workspace .regal-exposure-weight { margin-left:auto;font-variant-numeric:tabular-nums; }
  body.qe-workspace .regal-exposure-class { color:var(--qe-muted,#aab5c5);font-size:12px; }
  body.qe-workspace .regal-exposure-intro { margin:0 0 8px; }
  body.qe-workspace .regal-v5-card { padding:var(--regal-card-pad) !important;border-radius:var(--regal-panel-radius) !important;min-width:0;box-sizing:border-box; }
  body.qe-workspace .regal-v5-card h3 { margin:0;font-size:14px;line-height:1.35; }
  body.qe-workspace .qe-panel-heading>.regal-panel-refresh { margin-inline-start:auto;order:1; }
  body.qe-workspace .qe-panel-heading>button { order:2; }
  body.qe-workspace .regal-v5-workspace :is(.regal-earnings-scopes,.regal-earnings-scopes>[data-earnings-scope]) { display:block;min-width:0; }
  body.qe-workspace .regal-v5-workspace [data-earnings-scope][hidden] { display:none !important; }
  body.qe-workspace .regal-v5-workspace .regal-earnings { padding:0 !important;border:0 !important;background:transparent !important;margin:0 !important; }
  body.qe-workspace .regal-v5-workspace .regal-earnings-boards { display:grid;grid-template-columns:repeat(2,minmax(0,1fr)) !important;gap:var(--regal-gap);align-items:start; }
  body.qe-workspace .regal-v5-workspace .regal-earnings-boards>section { min-width:0; }
  @media(max-width:768px) {
    body.qe-workspace .regal-v5-workspace #regal-deck-sections,
    body.qe-workspace .regal-v5-workspace .regal-earnings-boards { grid-template-columns:minmax(0,1fr) !important; }
    body.qe-workspace .regal-v5-workspace #regal-slot-earnings { grid-column:auto; }
    body.qe-workspace .regal-exposure-grid { grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(10,auto); }
    /* 320px (2026-11-06): GOOGL's '+GOOG' note pushed 7.24% out of its 140px column onto the next column's '14 TXN'. Narrow phones let the row wrap: the note and weight move to a second line. */
    @media(max-width:430px) { body.qe-workspace .regal-exposure-item { flex-wrap:wrap;gap:0 5px;padding:4px; } body.qe-workspace .regal-exposure-item::before { min-width:14px; } body.qe-workspace .regal-exposure-item > .regal-exposure-class { font-size:11px; } }
  }
}

/* Admin's live site notice (2026-10-30): one compact line above the workspace. */
.regal-site-notice{padding:6px 12px;background:var(--regal-surface-raised,#2a2414);color:var(--regal-gold,#e7c76a);border-bottom:1px solid currentColor;font-size:13px;line-height:1.4;text-align:center}

/* Owner, 2026-10-31: the "+" / "−" of every expandable header sat below its text: the sign kept the
   summary's 1.4 line height (24 px) inside an 18-26 px box. The sign's line box is its own box now. */
body.qe-workspace details > summary::before { line-height: 1 !important; padding-bottom: 1px; box-sizing: border-box; }
/* The bottom disclaimer inherited the bottom bar's wide monospace label font; it is a sentence. */
body.qe-workspace .qe-bottom-bar .qe-bottom-disclaimer { font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif !important; font-size: 11px !important; letter-spacing: 0 !important; font-weight: 400 !important; text-transform: none !important; }

/* Owner, 2026-10-31 ("panel arrangement still ugly"): side-by-side cards end on the same line, and the thesis's
   three cards sit in one row across the page instead of a tall column beside a short chart. */
body.qe-workspace:not([data-mobile-app]) .regal-ticker .regal-thesis-grid { grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr)) !important; }
body.qe-workspace:not([data-mobile-app]) .regal-ticker[data-research-layout=overview] { align-items:stretch; }
.regal-model-cadence { display:block; margin:2px 0; font-size:11px; line-height:1.3; }
@layer regal-foundation {
 body.qe-workspace:not([data-mobile-app]) #v33-top :is(#qe-original-news-toggle,#qe-index-ribbon,#regal-engine-pill,#qe-profile-picker,#qe-settings-toggle,#qe-keyboard-help-toggle,.regal-header-sign-out button) {
  background:#15191e !important;color:#e7edf6 !important;border:1px solid #57471f !important;border-bottom:3px solid #dfbb64 !important;border-radius:5px !important;min-height:34px !important;box-shadow:none !important;
 }
 body.qe-workspace:not([data-mobile-app]) #v33-top #qe-original-news-toggle {font-size:12px !important;font-weight:700 !important;white-space:nowrap;}
 body.qe-workspace:not([data-mobile-app]) #v33-top #qe-original-news-toggle::before {content:'▣';margin-right:6px;color:#dfbb64;}
 body.qe-workspace #v33-top .regal-header-sign-out {margin:0;display:flex;align-items:center;}
 body.qe-workspace #v33-top .regal-header-sign-out button {padding:4px 10px;cursor:pointer;}
 body.qe-workspace[data-mobile-app] .regal-mobile-sign-out {display:contents;}
 body.qe-workspace[data-mobile-app] .regal-mobile-sign-out>button {width:100%;text-align:center;}
 body.qe-workspace[data-signed-out=true] :is(.regal-header-sign-out,.regal-mobile-sign-out) {display:none !important;}
}
@layer regal-foundation {
 body.qe-workspace .regal-quant-heading { box-sizing:border-box; padding:6px 10px !important; margin:4px 0 8px !important; gap:8px !important; }
}
@layer regal-foundation {
 @media(max-width:768px) {
  body.qe-workspace[data-mobile-app] .regal-mobile-trade-tabs > button { font-size:11px !important; line-height:1.3 !important; min-height:28px !important; align-self:center; }
  body.qe-workspace[data-mobile-app] .regal-mobile-trade-tabs > .regal-mobile-publication { padding-block:3px !important; }
  body.qe-workspace[data-mobile-app] #v33-me-model-heading { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:2px 6px; font-size:14px !important; font-weight:600; letter-spacing:0 !important; text-transform:none !important; }
  body.qe-workspace[data-mobile-app] #v33-me-model-heading > .regal-mobile-publication { position:static; flex:0 0 auto; width:auto; max-width:none; min-height:0 !important; margin:0 !important; padding:0 !important; border:0; font-size:10px !important; line-height:1.3; white-space:nowrap; }
 }
}
#regal-testing-banner { position:sticky; top:0; z-index:3000; background:#b91c1c; color:#fff; text-align:center; font:700 10px/18px system-ui,sans-serif; letter-spacing:.08em; min-height:18px; }
body[data-signed-out="true"] #regal-testing-banner,
body[data-original-saas-quant]:not([data-original-saas-quant="stock_etf_quant"]) #regal-testing-banner,
body[data-workspace-dialog] #regal-testing-banner,
body[data-chat-open] #regal-testing-banner,
body[data-mobile-app]:not([data-mobile-destination="model"]) #regal-testing-banner { display:none !important; }
.regal-mobile-legal { display:block; width:max-content; margin:8px 16px 16px; color:#dfbb64; font-size:12px; }
@media(max-width:768px) {
 body[data-mobile-app] #regal-testing-banner { position:fixed; top:calc(32px + env(safe-area-inset-top)); left:0; right:0; }
}
/* Phone reading density: compact data and section rhythm across every tool. */
@media(max-width:768px){
 body[data-mobile-app] .regal-mobile-market-panel{background:#10151d}
 body[data-mobile-app] .regal-mobile-market-panel h2{font-size:9px;line-height:1.3;margin:0 0 2px}
 body[data-mobile-app] .regal-mobile-market-panel p{font-size:8px;line-height:1.2;margin:0;color:#a5b0bd}
 body[data-mobile-app] .regal-mobile-market-row{display:grid;grid-template-columns:1fr auto;gap:1px 3px;padding:2px 0;border-top:1px solid #ffffff12;font-size:9px;line-height:1.2}
 body[data-mobile-app] .regal-mobile-market-row > span:first-of-type{display:none}
 body[data-mobile-app] .regal-mobile-market-row small{display:none}
}
/* Representative iPhone width: keep primary labels legible without spreading cards. */
@layer regal-foundation {
 @media(max-width:430px){
  body.qe-workspace[data-mobile-app] { --mobile-bottom:calc(52px + env(safe-area-inset-bottom)) !important; }
  /* Each label on one line (owner, 2026-11-01: 'Smart Money ... must fit on ONE line'; it wrapped again at 11px in
     six equal columns, live 2026-11-06). Columns follow their labels; every tap target stays at least 44px. */
  body.qe-workspace[data-mobile-app] .regal-mobile-nav { grid-template-columns:repeat(6,auto) !important;justify-content:space-around !important; }
  body.qe-workspace[data-mobile-app] .regal-mobile-nav button { font-size:11px !important;line-height:1.1 !important;min-height:48px !important;min-width:44px !important;padding:1px 3px !important; }
  body.qe-workspace[data-mobile-app] .regal-mobile-nav button span { white-space:nowrap !important; }
  /* 320px (live 2026-11-06): 11px labels overran their buttons (Smart Money 100-167px in a 110-157px button), so neighbours ran together. */
  @media(max-width:350px){ body.qe-workspace[data-mobile-app] .regal-mobile-nav button { font-size:10px !important;padding:1px !important;min-width:40px !important; } }
  body.qe-workspace[data-mobile-app] .regal-mobile-macro-grid .mv-tile .lbl { font-size:11px !important;line-height:1.2 !important;letter-spacing:0 !important; }
  body.qe-workspace[data-mobile-app] .regal-mobile-macro-grid { grid-template-columns:repeat(2,minmax(0,1fr)) !important;gap:6px !important; }
  body.qe-workspace[data-mobile-app] .regal-mobile-macro-grid .mv-tile .band,
  body.qe-workspace[data-mobile-app] .regal-mobile-macro-grid .regal-mobile-macro-date::after { font-size:11px !important; }
  body.qe-workspace[data-mobile-app] .regal-mobile-market-panel :is(h2,p),
  body.qe-workspace[data-mobile-app] .regal-mobile-market-row { font-size:11px !important;line-height:1.2 !important; }
 }
}
@layer regal-foundation {
 @media (max-width:768px) {
  body.qe-workspace[data-mobile-app] { --regal-space-2:4px; --regal-space-3:6px; --regal-space-4:8px; --regal-space-6:12px; --regal-space-8:16px; --regal-gap:6px !important; --regal-card-pad:6px !important; }
  body.qe-workspace[data-mobile-app] :is(.regal-context,.regal-ticker,.qe-settings-section) p { margin-block:4px !important; line-height:1.35; }
  body.qe-workspace[data-mobile-app] :is(.regal-context,.regal-ticker,.qe-settings-section) :is(h4,h5) { margin-bottom:4px !important; }
  body.qe-workspace[data-mobile-app] .regal-context .regal-heat-row { min-height:30px !important; height:auto !important; padding:3px 6px !important; line-height:1.25 !important; margin:0 !important; }
  body.qe-workspace[data-mobile-app] .regal-heat-column { padding:6px !important; }
  body.qe-workspace[data-mobile-app] .regal-heat-columns { gap:6px !important; }
  body.qe-workspace[data-mobile-app] .regal-ticker dl > div { padding-block:3px !important; line-height:1.3; }
  body.qe-workspace[data-mobile-app] :is(.regal-context,.regal-ticker) summary { min-height:32px !important; padding:4px 8px !important; }
 }
}
/* Compact phone model details: retain readable type without desktop-sized gaps. */
@media (max-width: 768px) {
  body.qe-workspace[data-mobile-app] .qe-inline-model-panel { padding:8px; font-size:12px; line-height:1.3; }
  body.qe-workspace[data-mobile-app] .qe-inline-model-panel h3 { font-size:14px; line-height:1.3; }
  body.qe-workspace[data-mobile-app] .qe-inline-model-panel header { gap:6px; }
  body.qe-workspace[data-mobile-app] .qe-inline-model-summary { margin-top:4px; padding:6px; gap:3px 6px; }
  body.qe-workspace[data-mobile-app] .qe-inline-model-date { margin:5px 0; }
  body.qe-workspace[data-mobile-app] .qe-inline-model-grid { gap:5px !important; margin-block:5px; }
  body.qe-workspace[data-mobile-app] .qe-inline-model-grid > section { padding:6px !important; height:auto; }
  body.qe-workspace[data-mobile-app] .qe-inline-model-grid h4 { font-size:12px; line-height:1.3; margin:0 0 3px; }
  body.qe-workspace[data-mobile-app] .qe-inline-model-grid dl > div { padding:3px 0; gap:8px; line-height:1.3; }
  body.qe-workspace[data-mobile-app] .qe-inline-model-panel > p { margin-block:5px; line-height:1.3; }
}
@media (min-width: 769px) {
  body.qe-workspace:not([data-mobile-app]) .regal-ticker[data-research-layout=overview]>.regal-research-price,
  body.qe-workspace:not([data-mobile-app]) .regal-ticker[data-research-layout=overview]>.regal-thesis { grid-column:1/-1; }
}

/* Owner, 2026-11-02: left-aligned news & market live, top-right tab info, and macro tiles nowrap */
@media (min-width: 769px) {
  body.qe-workspace:not([data-mobile-app]) #v33-top.qe-header {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 12px !important;
    justify-content: flex-start !important;
  }
  body.qe-workspace:not([data-mobile-app]) #v33-top > .qe-original-news-strip {
    display: flex !important;
    flex: 0 1 auto !important;
    margin: 0 auto 0 12px !important;
    padding: 0 !important;
    border: 0 !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 10px !important;
    order: 0 !important;
  }
  body.qe-workspace:not([data-mobile-app]) #v33-top #qe-original-news-toggle {
    order: 0 !important;
    margin: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    flex: 0 0 auto !important;
  }
  body.qe-workspace:not([data-mobile-app]) #v33-top #qe-index-ribbon {
    order: 1 !important;
    margin: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    flex: 0 0 auto !important;
    position: static !important;
    transform: none !important;
  }
  body.qe-workspace:not([data-mobile-app]) #v33-top .qe-header-status {
    margin-left: auto !important;
    flex: 0 0 auto !important;
  }
}

#v33-cabinet > .v33-cab-tab,
.v33-cab-tab,
.qe-product-tabs button {
  position: relative !important;
}
#v33-cabinet > .v33-cab-tab .regal-tab-info,
.v33-cab-tab .regal-tab-info,
.qe-product-tabs button .regal-tab-info {
  position: absolute !important;
  top: 8px !important;
  right: 12px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--qe-accent, #c1a75d) !important;
  line-height: 1 !important;
  cursor: help !important;
  z-index: 2 !important;
}

#v33-macro-tiles > .regal-strip-tile {
  box-sizing: border-box !important;
  min-width: 0 !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  padding: 7px 9px !important;
}
#v33-macro-tiles > .regal-strip-tile .regal-strip-label {
  white-space: nowrap !important;
  flex-wrap: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-size: clamp(8px, 0.65vw, 9.5px) !important;
  line-height: 1.2 !important;
}
#v33-macro-tiles > .regal-strip-tile[data-lead] .regal-strip-label {
  font-size: clamp(7.5px, 0.58vw, 8.5px) !important;
}

/* Dialog format standardization: all tool dialog cards (Single Ticker, Custom Screener, Watchlist, Context tools)
   and Market Overview share standard consistent desktop window sizing */
@media (min-width: 769px) {
  body.qe-workspace:not([data-mobile-app]) :is(.qe-ticker-dialog-card, .qe-screener-dialog-card, .qe-watchlist-dialog-card, .qe-context-dialog-card) {
    width: min(1180px, calc(100vw - 48px)) !important;
    max-width: min(1180px, calc(100vw - 48px)) !important;
    box-sizing: border-box !important;
  }
  body.qe-workspace:not([data-mobile-app]) #qe-ticker-dialog .qe-ticker-dialog-card:has(.regal-ticker) {
    width: min(1180px, calc(100vw - 48px)) !important;
    max-width: min(1180px, calc(100vw - 48px)) !important;
  }
  body.qe-workspace:not([data-mobile-app]) #qe-popover-card:has(.regal-market-overview) {
    width: min(1180px, calc(100vw - 48px)) !important;
    max-width: min(1180px, calc(100vw - 48px)) !important;
  }
  body.qe-workspace:not([data-mobile-app]) .regal-market-overview {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 16px !important;
    align-items: start !important;
  }
}

/* Two kinds of missing data (owner, Nov 11 2026): a limit reads as a quiet note with its reason, an error as a
   warning about the connection or the server. read_outcome.js marks each message by the words it opens with.
   :where() keeps these at zero specificity, so an element's own colours and markers still win. */
:where([data-outcome="limit"]){color:var(--qe-muted,#a7afbc);}
:where([data-outcome="error"]){color:var(--qe-warn,#d9832e);}
:where([data-outcome="limit"])::before{content:"\24D8\00A0";}
:where([data-outcome="error"])::before{content:"\26A0\FE0E\00A0";}
/* A whole-cell short form keeps its colour and hover, not an icon: a dense cell or tile keeps its width. */
:where([data-outcome][data-outcome-short])::before{content:none;}
