@import url("/releases/eee019d4f4271b6285e6/assets/app.css?v=160");

/* A quiet, readable identifier within the existing strategy control. */
.strategy-new { display: inline-block; color: var(--blue); background: var(--blue-soft); font-size: 10px; line-height: 1.4; font-weight: 650; letter-spacing: .04em; border-radius: 6px; padding: 1px 4px; margin-inline-start: 5px; vertical-align: middle; }
.fg-evidence-switch { width: fit-content; max-width: 100%; flex-wrap: wrap; margin-block: 8px 16px; }
.fg-evidence-switch button { min-height: 36px; white-space: normal; }
.fg50-dashboard #positions { grid-template-columns: minmax(0, 1fr); }
.fg50-dashboard #positions > * { min-width: 0; max-width: 100%; }
.fg50-dashboard #positions .risk-card { grid-row: 2; }
.fg50-dashboard #positions .risk-card .health-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fg50-dashboard .sil-quant-shell ~ main #positions-support { grid-template-columns: minmax(0, 1fr); }
.fg50-dashboard #decision-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
.fg50-dashboard #decision-cards > div { min-width: 0; }
.fg50-dashboard #decision-cards strong { font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
.fg50-dashboard #holding-history-body details ul { padding-inline-start: 16px; font-size: 14px; line-height: 1.65; }
.fg50-dashboard #holding-history-body summary { min-height: 44px; align-content: center; cursor: pointer; }
.fg50-dashboard #fg-history-pager { display: flex; flex-wrap: wrap; gap: 6px; }
.fg50-dashboard .holding-history-actions { flex-wrap: wrap; }
.fg50-dashboard #fg-history-pager[hidden] { display: none; }
.fg50-dashboard #fg-history-pager button { min-height: 44px; min-width: 44px; }
.fg50-dashboard #fg-history-pager button:disabled { opacity: .45; cursor: default; }
@media (max-width: 820px) {
  /* The inherited 280px flex-basis is a width on desktop, but becomes an
     unwanted height when the heading changes to a column on phones. */
  .fg50-dashboard #positions .position-workspace-copy,
  .fg50-dashboard #positions .position-ledger-meta { flex: 0 0 auto; }
}
@media (max-width: 600px) {
  .fg50-dashboard #fg-history-pager { flex: 1 1 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .fg50-dashboard #fg-history-pager button { padding-inline: 7px; }
  .fg50-dashboard #positions .risk-card .health-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fg50-dashboard #decision-cards { grid-template-columns: minmax(0, 1fr); }
}
.strategy-sidebar .strategy-new { display: block; width: fit-content; margin: 2px auto 0; }

/* Secondary account facts stay closed by default; updates preserve disclosure state. */
.account-details { margin-top: 8px; color: var(--text-secondary); font-size: 14px; }
.account-details summary { width: fit-content; max-width: 100%; min-height: 44px; align-content: center; cursor: pointer; font-weight: 500; }
.account-details summary:hover { color: var(--text); }
.account-details summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
.account-details dl { display: flex; flex-wrap: wrap; gap: 16px 40px; margin: 6px 0 12px; }
.account-details dl > div { min-width: 0; max-width: 100%; }
.account-details dt { font-size: 14px; }
.account-details dd { margin: 6px 0 0; color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.account-details p, .trade-activity-note { margin: 0 0 12px; color: var(--text-secondary); font-size: 14px; line-height: 1.6; max-width: 75ch; }
.trade-activity-note:empty { display: none; }
.attribution-metric[data-cost-embedded] { cursor: default; }
.attribution-metric[data-cost-embedded] strong { color: var(--text-secondary); font-size: 1rem; line-height: 1.45; white-space: normal; overflow-wrap: anywhere; }
.attribution-metric[data-cost-embedded]:hover { background: transparent; box-shadow: none; }

/*
  Precision Ledger — the single supported interface.
  Calm editorial hierarchy, exact operational state, and hairline structure.
  Historical presentations are retained only in release backups.
*/

:root {
  --bg: #f9fafb;
  --bg-elevated: #ffffff;
  --surface: rgba(255, 255, 255, .82);
  --surface-solid: #ffffff;
  --surface-muted: rgba(28, 35, 46, .045);
  --text: #171a1f;
  --text-secondary: #59636f;
  --text-tertiary: #606b77;
  --border: rgba(28, 35, 46, .105);
  --border-strong: rgba(28, 35, 46, .18);
  --shadow: none;
  --shadow-control: 0 1px 2px rgba(16, 22, 31, .06), 0 8px 24px rgba(16, 22, 31, .06);
  --blue: #176b49;
  --blue-soft: rgba(23, 107, 73, .1);
  --green: #17733c;
  --green-soft: rgba(23, 115, 60, .1);
  --red: #c92424;
  --red-soft: rgba(201, 36, 36, .08);
  --orange: #995811;
  --orange-soft: rgba(153, 88, 17, .1);
  --chart-strategy: #176b49;
  --chart-market: #485463;
  --grid: rgba(28, 35, 46, .075);
  --material-chrome: #f4f6f8;
  --material-panel: rgba(255, 255, 255, .62);
  --material-panel-strong: rgba(255, 255, 255, .84);
  --material-control: rgba(28, 35, 46, .045);
  --material-selected: #ffffff;
  --inner-highlight: inset 0 1px 0 rgba(255, 255, 255, .7);
  --radius-xl: 12px;
  --radius-lg: 10px;
  --radius-md: 8px;
  --blur: none;
  --blur-chrome: none;
  --app-brand-height: 88px;
  --app-connection-height: 44px;
  --app-connection-top: var(--app-brand-height);
  --app-topbar-height: var(--app-brand-height);
  --strategy-sidebar-expanded: clamp(244px, 19vw, 272px);
  --strategy-sidebar-collapsed: 76px;
  --strategy-sidebar-width: var(--strategy-sidebar-expanded);
  --strategy-sidebar-motion: 260ms;
  --strategy-sidebar-ease: cubic-bezier(.22, 1, .36, 1);
  --strategy-drawer-motion: 220ms;
}

html[data-strategy-sidebar="collapsed"] {
  --strategy-sidebar-width: var(--strategy-sidebar-collapsed);
}

html[data-theme="dark"] {
  --bg: #111316;
  --bg-elevated: #16191e;
  --surface: rgba(26, 29, 34, .86);
  --surface-solid: #1a1d22;
  --surface-muted: rgba(240, 244, 250, .052);
  --text: #f1f3f5;
  --text-secondary: #b4bcc6;
  --text-tertiary: #959faa;
  --border: rgba(237, 243, 250, .095);
  --border-strong: rgba(237, 243, 250, .17);
  --blue: #58b286;
  --blue-soft: rgba(88, 178, 134, .13);
  --green: #67c58f;
  --green-soft: rgba(103, 197, 143, .13);
  --red: #ff7777;
  --red-soft: rgba(255, 119, 119, .12);
  --orange: #d9a25f;
  --orange-soft: rgba(217, 162, 95, .12);
  --chart-strategy: #67c58f;
  --chart-market: #d3dbe4;
  --grid: rgba(237, 243, 250, .075);
  --material-chrome: #0d0f12;
  --material-panel: rgba(26, 29, 34, .72);
  --material-panel-strong: rgba(26, 29, 34, .88);
  --material-control: rgba(240, 244, 250, .055);
  --material-selected: #262b33;
  --inner-highlight: inset 0 1px 0 rgba(255, 255, 255, .055);
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --bg: #111316;
    --bg-elevated: #16191e;
    --surface: rgba(26, 29, 34, .86);
    --surface-solid: #1a1d22;
    --surface-muted: rgba(240, 244, 250, .052);
    --text: #f1f3f5;
    --text-secondary: #b4bcc6;
    --text-tertiary: #959faa;
    --border: rgba(237, 243, 250, .095);
    --border-strong: rgba(237, 243, 250, .17);
    --blue: #58b286;
    --blue-soft: rgba(88, 178, 134, .13);
    --green: #67c58f;
    --green-soft: rgba(103, 197, 143, .13);
    --red: #ff7777;
    --red-soft: rgba(255, 119, 119, .12);
    --orange: #d9a25f;
    --orange-soft: rgba(217, 162, 95, .12);
    --chart-strategy: #67c58f;
    --chart-market: #d3dbe4;
    --grid: rgba(237, 243, 250, .075);
    --material-chrome: #0d0f12;
    --material-panel: rgba(26, 29, 34, .72);
    --material-panel-strong: rgba(26, 29, 34, .88);
    --material-control: rgba(240, 244, 250, .055);
    --material-selected: #262b33;
    --inner-highlight: inset 0 1px 0 rgba(255, 255, 255, .055);
  }
}

::selection { color: var(--surface-solid); background: var(--green); }
html[data-input-mode="keyboard"] :where(button, a, select, input, textarea, summary, [tabindex]):focus-visible { outline-color: var(--blue); }

body {
  letter-spacing: -.006em;
  background: var(--bg);
  --type-body: clamp(.9rem, calc(.85rem + .16vw), .96875rem);
}

.ambient { display: none; }
.app-chrome { background: var(--material-chrome); }
.chrome-material {
  background: var(--material-chrome);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.topbar,
.connection-bar { padding-inline: max(38px, calc((100vw - 1364px) / 2)); }

.topbar {
  grid-template-columns: 200px minmax(420px, 1fr) auto;
  gap: 0 clamp(28px, 3vw, 52px);
}

.brand-logo { width: 190px; }
.nav-pills { width: min(500px, 100%); gap: clamp(20px, 2.5vw, 40px); }
.nav-pills a {
  color: var(--text-secondary);
  font-size: .875rem;
  font-weight: 520;
  letter-spacing: .01em;
}
.nav-pills a::after { right: 25%; bottom: 0; left: 25%; height: 1px; border-radius: 0; }
.nav-pills a:hover { color: var(--text); }
.nav-pills a:focus-visible {
  outline: 0;
  color: var(--text);
  box-shadow: inset 0 -2px var(--green);
}
.top-actions { gap: 8px; }
.theme-control,
.language-control {
  height: 36px;
  padding: 0;
  overflow: hidden;
  border-color: var(--border);
  border-radius: 7px;
  background: transparent;
  box-shadow: none;
}
.theme-control { width: 160px; flex-basis: 160px; }
.language-control { width: 82px; flex-basis: 82px; }
.theme-control::before,
.language-control::before { top: 3px; bottom: 3px; border-radius: 5px; box-shadow: 0 1px 3px rgba(20, 26, 35, .09); }
.theme-control button,
.language-control button { min-height: 34px; height: 34px; border-radius: 5px; font-weight: 540; }

.connection-bar {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: transparent;
}
.connection-shell { width: min(1364px, 100%); gap: 24px; }
.strategy-context {
  width: auto;
  min-width: 0;
  max-width: none;
  min-height: 46px;
  display: flex;
  align-items: center;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface-solid) 44%, transparent);
}
.connection-bar .strategy-trigger {
  width: 40px;
  min-width: 40px;
  height: 36px;
  display: grid;
  place-items: center;
  margin-left: 1px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
}
.connection-bar .strategy-trigger:hover,
.connection-bar .strategy-trigger[aria-expanded="true"] { background: var(--surface-muted); box-shadow: none; }
.strategy-trigger .strategy-active-code,
.strategy-trigger .strategy-trigger-copy,
.strategy-trigger .strategy-context #strategy-count,
.strategy-trigger #strategy-count { display: none; }
.strategy-trigger-meta { padding: 0; }
.strategy-switch-action { width: 18px; min-width: 18px; height: 18px; }
.strategy-switch-action img { width: 12px; height: 12px; opacity: .72; }
.connection-separator { display: none; }
.connection-state { margin-left: auto; color: var(--text-secondary); font-size: .82rem; }
.connection-state .live-dot { width: 7px; height: 7px; background: var(--green); box-shadow: none; }
.connection-bar.degraded .connection-state .live-dot { background: var(--orange); }
.connection-bar.offline .connection-state .live-dot { background: var(--red); }
.connection-bar #connection-detail::before { margin-right: 9px; }
.strategy-menu {
  top: calc(100% + 10px);
  width: min(540px, calc(100vw - 40px));
  padding: 8px;
  border-radius: 12px;
  background: var(--surface-solid);
  box-shadow: 0 26px 70px rgba(14, 20, 29, .15), 0 2px 8px rgba(14, 20, 29, .06);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.connection-bar .strategy-option { border-radius: 8px; }

/* Native snapshots briefly suspend interaction. Keep live controls available. */
@view-transition { navigation: none; }
/* Strategy switching is a high-frequency action; never fade the evidence. */
main { animation: none; }

/* Strategy spine ------------------------------------------------------- */
.strategy-sidebar,
.strategy-sidebar-backdrop { display: none; }

@media (min-width: 901px) {
  body.has-strategy-sidebar { position: relative; }
  body.has-strategy-sidebar .connection-bar { padding-inline: 0; }
  body.has-strategy-sidebar .connection-shell {
    width: min(1364px, calc(100vw - var(--strategy-sidebar-width) - 48px));
    margin-right: auto;
    margin-left: max(
      calc(var(--strategy-sidebar-width) + 24px),
      calc((100vw + var(--strategy-sidebar-width) - 1364px) / 2)
    );
    transition:
      width var(--strategy-sidebar-motion) var(--strategy-sidebar-ease),
      margin-left var(--strategy-sidebar-motion) var(--strategy-sidebar-ease);
  }
  body.has-strategy-sidebar .strategy-context { display: none; }
  body.has-strategy-sidebar main,
  body.has-strategy-sidebar .site-footer {
    width: min(1364px, calc(100% - var(--strategy-sidebar-width) - 48px));
    margin-right: auto;
    margin-left: max(
      calc(var(--strategy-sidebar-width) + 24px),
      calc((100vw + var(--strategy-sidebar-width) - 1364px) / 2)
    );
    transition:
      width var(--strategy-sidebar-motion) var(--strategy-sidebar-ease),
      margin-left var(--strategy-sidebar-motion) var(--strategy-sidebar-ease);
  }
  body.has-strategy-sidebar .strategy-sidebar-shell {
    position: absolute;
    z-index: 31;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--strategy-sidebar-width);
    pointer-events: none;
    transition: width var(--strategy-sidebar-motion) var(--strategy-sidebar-ease);
  }
  body.has-strategy-sidebar .strategy-sidebar {
    position: sticky;
    z-index: auto;
    top: var(--app-chrome-height);
    bottom: auto;
    width: var(--strategy-sidebar-width);
    height: calc(100vh - var(--app-chrome-height));
    height: calc(100dvh - var(--app-chrome-height));
    max-height: calc(100dvh - var(--app-chrome-height));
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    border-right: 1px solid var(--border);
    background: var(--material-chrome);
    color: var(--text);
    pointer-events: auto;
    transition: width var(--strategy-sidebar-motion) var(--strategy-sidebar-ease);
  }
}

.strategy-sidebar[hidden],
.strategy-sidebar-backdrop[hidden] { display: none !important; }
.strategy-sidebar-header {
  position: relative;
  z-index: 2;
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  align-items: center;
  gap: 10px;
  padding: 14px 12px 12px 18px;
  border-bottom: 1px solid var(--border);
}
.strategy-sidebar-heading {
  min-width: 0;
  display: grid;
  gap: 4px;
  white-space: nowrap;
  transform-origin: left center;
  transition:
    opacity 160ms ease,
    transform var(--strategy-sidebar-motion) var(--strategy-sidebar-ease),
    visibility 0s linear;
}
.strategy-sidebar-heading strong { font-size: .875rem; font-weight: 670; letter-spacing: -.015em; }
.strategy-sidebar-heading small { color: var(--text-tertiary); font-size: .72rem; font-weight: 540; letter-spacing: .012em; }
.strategy-sidebar-collapse,
.strategy-sidebar-close {
  min-width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-secondary);
  background: transparent;
  box-shadow: none;
  font: inherit;
  font-size: .76rem;
  font-weight: 620;
  cursor: pointer;
  transition:
    color 140ms ease,
    border-color 140ms ease,
    background-color 140ms ease,
    box-shadow 180ms ease,
    transform 140ms var(--strategy-sidebar-ease);
}
.strategy-sidebar-collapse { border: 0; }
.strategy-sidebar-collapse:hover { color: var(--text); background: var(--surface-muted); }
.strategy-sidebar-collapse:active { transform: scale(.96); }
.strategy-sidebar-collapse svg {
  width: 19px;
  height: 19px;
  opacity: .8;
  transition: transform var(--strategy-sidebar-motion) var(--strategy-sidebar-ease), opacity 140ms ease;
}
.strategy-sidebar-collapse:hover svg { opacity: 1; }
.strategy-sidebar-collapse[aria-expanded="true"] .sidebar-icon-open,
.strategy-sidebar-collapse[aria-expanded="false"] .sidebar-icon-close { display: none; }
.strategy-sidebar-close { display: none; }
.strategy-sidebar-list {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 5px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 12px 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
  transition: padding var(--strategy-sidebar-motion) var(--strategy-sidebar-ease);
}
.strategy-sidebar-list::-webkit-scrollbar { width: 8px; }
.strategy-sidebar-list::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 8px; background: var(--border-strong); background-clip: padding-box; }
.strategy-sidebar-option {
  position: relative;
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 8px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--text-secondary);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    min-height var(--strategy-sidebar-motion) var(--strategy-sidebar-ease),
    padding var(--strategy-sidebar-motion) var(--strategy-sidebar-ease),
    color 150ms ease,
    background-color 150ms ease,
    border-color 150ms ease,
    box-shadow 180ms ease,
    transform 160ms var(--strategy-sidebar-ease);
}
.strategy-sidebar-option::before {
  content: "";
  position: absolute;
  bottom: 6px;
  left: 60px;
  width: 24px;
  /* Native borders snap their stroke to device pixels at fractional zoom.
     A filled rectangle can cover different pixel rows in successive items. */
  height: 0;
  border-top: 2px solid var(--blue);
  border-radius: 0;
  background: none;
  opacity: 0;
  transform: none;
  transition: opacity 160ms ease;
}
.strategy-sidebar-option:hover { color: var(--text); background: var(--surface-muted); }
.strategy-sidebar-option:active { background: var(--material-control); }
.strategy-sidebar-option[aria-selected="true"] {
  color: var(--text);
  border-color: transparent;
  background: var(--blue-soft);
  box-shadow: none;
}
.strategy-sidebar-option[aria-selected="true"]::before { opacity: 1; }
.strategy-sidebar-option[data-strategy-pending="true"] { background: var(--surface-muted); color: var(--text); cursor: progress; }
.strategy-sidebar-option[data-strategy-pending="true"] .strategy-option-code { opacity: .55; }
.strategy-sidebar-option[data-strategy-pending="true"] .strategy-option-state::after { content: "…"; }
.strategy-sidebar-option .strategy-option-code {
  min-width: 44px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-secondary);
  background: transparent;
  font-size: .68rem;
  font-weight: 720;
  letter-spacing: .075em;
  transition:
    color 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    transform var(--strategy-sidebar-motion) var(--strategy-sidebar-ease);
}
.strategy-sidebar-option[aria-selected="true"] .strategy-option-code {
  border-color: transparent;
  color: var(--blue);
  background: transparent;
}
.strategy-sidebar-option .strategy-option-mini { display: none; }
.strategy-sidebar-option .strategy-option-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
  transform-origin: left center;
  transition:
    opacity 150ms ease 70ms,
    transform var(--strategy-sidebar-motion) var(--strategy-sidebar-ease),
    visibility 0s linear;
}
.strategy-sidebar-option .strategy-option-copy strong { font-size: .8125rem; font-weight: 520; letter-spacing: -.01em; line-height: 1.45; white-space: normal; overflow-wrap: anywhere; }
.strategy-sidebar-option[aria-selected="true"] .strategy-option-copy strong { font-weight: 620; }
.strategy-sidebar-option .strategy-option-copy small { display: none; color: var(--text-secondary); font-size: .72rem; line-height: 1.45; white-space: normal; }
.strategy-sidebar-option .strategy-option-state {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  opacity: .82;
  transition: opacity 150ms ease 80ms, transform var(--strategy-sidebar-motion) var(--strategy-sidebar-ease), visibility 0s linear;
}
.strategy-sidebar-option .strategy-option-state img { width: 13px; height: 13px; }
.strategy-sidebar-footer {
  position: relative;
  z-index: 2;
  min-width: 0;
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  color: var(--text-tertiary);
  font-size: .68rem;
  white-space: nowrap;
  transition: padding var(--strategy-sidebar-motion) var(--strategy-sidebar-ease);
}
.strategy-sidebar-footer > span:last-child {
  transition: opacity 140ms ease 80ms, transform var(--strategy-sidebar-motion) var(--strategy-sidebar-ease), visibility 0s linear;
}
.strategy-sidebar-live-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green-soft) 70%, transparent);
}

html[data-strategy-sidebar="collapsed"] .strategy-sidebar-header {
  grid-template-columns: 1fr;
  min-height: 64px;
  padding: 12px 18px;
}
html[data-strategy-sidebar="collapsed"] .strategy-sidebar-heading {
  position: absolute;
  visibility: hidden;
  opacity: 0;
  transform: translateX(-12px) scale(.98);
}
html[data-strategy-sidebar="collapsed"] .strategy-sidebar-collapse {
  justify-self: center;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}
html[data-strategy-sidebar="collapsed"] .strategy-sidebar-collapse:hover {
  border-color: transparent;
  background: var(--surface-muted);
  box-shadow: none;
}
html[data-strategy-sidebar="collapsed"] .strategy-sidebar-list {
  gap: 4px;
  padding: 12px 9px;
}
html[data-strategy-sidebar="collapsed"] .strategy-sidebar-list::before {
  display: none;
}
html[data-strategy-sidebar="collapsed"] .strategy-sidebar-option {
  min-height: 64px;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 6px 4px;
  border-radius: 7px;
}
html[data-strategy-sidebar="collapsed"] .strategy-sidebar-option[aria-selected="true"] {
  border-color: transparent;
  background: var(--surface-muted);
  box-shadow: none;
}
html[data-strategy-sidebar="collapsed"] .strategy-sidebar-option::before {
  bottom: 6px;
  left: calc(50% - 12px);
  width: 24px;
}
html[data-strategy-sidebar="collapsed"] .strategy-sidebar-option .strategy-option-code {
  height: 34px;
  justify-self: center;
  border-color: transparent;
  background: transparent;
}
html[data-strategy-sidebar="collapsed"] .strategy-sidebar-option[aria-selected="true"] .strategy-option-code {
  border-color: transparent;
  background: transparent;
}
html[data-strategy-sidebar="collapsed"] .strategy-sidebar-option .strategy-option-copy,
html[data-strategy-sidebar="collapsed"] .strategy-sidebar-option .strategy-option-state {
  position: absolute;
  visibility: hidden;
  opacity: 0;
  transform: translateX(-10px);
}
html[data-strategy-sidebar="collapsed"] .strategy-sidebar-footer {
  min-height: 52px;
  justify-content: center;
  padding-inline: 0;
}
html[data-strategy-sidebar="collapsed"] .strategy-sidebar-live-dot {
  width: 5px;
  height: 5px;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--green-soft) 64%, transparent);
}
html[data-strategy-sidebar="collapsed"] .strategy-sidebar-footer > span:last-child {
  position: absolute;
  visibility: hidden;
  opacity: 0;
  transform: translateX(-10px);
}

@media (min-width: 901px) {
  html[data-strategy-sidebar="collapsed"] .strategy-sidebar {
    contain: layout paint;
  }
  html[data-strategy-sidebar="collapsed"] .strategy-sidebar-header,
  html[data-strategy-sidebar="collapsed"] .strategy-sidebar-list,
  html[data-strategy-sidebar="collapsed"] .strategy-sidebar-footer {
    justify-items: center;
  }
  html[data-strategy-sidebar="collapsed"] .strategy-sidebar-collapse {
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    justify-self: center;
    margin: 0;
  }
  html[data-strategy-sidebar="collapsed"] .strategy-sidebar-option {
    width: 100%;
    justify-items: center;
  }
  html[data-strategy-sidebar="collapsed"] .strategy-sidebar-option .strategy-option-code {
    width: 46px;
    min-width: 46px;
    margin: 0;
    gap: 4px;
    align-content: center;
    line-height: 1.2;
  }
  html[data-strategy-sidebar="collapsed"] .strategy-sidebar-option .strategy-option-mini {
    display: block;
    max-width: 52px;
    color: var(--text-secondary);
    font-size: .625rem;
    font-weight: 500;
    letter-spacing: 0;
    white-space: nowrap;
  }
  html[data-strategy-sidebar="collapsed"] .strategy-sidebar-heading,
  html[data-strategy-sidebar="collapsed"] .strategy-sidebar-option .strategy-option-copy,
  html[data-strategy-sidebar="collapsed"] .strategy-sidebar-option .strategy-option-state,
  html[data-strategy-sidebar="collapsed"] .strategy-sidebar-footer > span:last-child {
    pointer-events: none;
  }
}

html[data-strategy-sidebar-motion] body.has-strategy-sidebar main,
html[data-strategy-sidebar-motion] body.has-strategy-sidebar .site-footer,
html[data-strategy-sidebar-motion] body.has-strategy-sidebar .connection-shell,
html[data-strategy-sidebar-motion] body.has-strategy-sidebar .strategy-sidebar-shell,
html[data-strategy-sidebar-motion] body.has-strategy-sidebar .strategy-sidebar { will-change: width, margin-left; }

main { width: min(1364px, calc(100% - 64px)); padding: 24px 0 56px; }
.hero-grid,
.content-grid { gap: 18px; margin-bottom: 18px; }
.hero-grid {
  grid-template-columns: minmax(0, 72%) minmax(0, 28%);
  gap: 0;
  border-bottom: 1px solid var(--border);
}
.glass-card {
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.glass-card::after { display: none; }
.hero-grid > .glass-card { border-top: 0; }
.nav-hero {
  min-height: 570px;
  padding: 28px 36px 20px 16px;
  background: transparent;
}
.system-card {
  min-height: 570px;
  gap: 22px;
  padding: 28px 16px 20px 32px;
  border-left: 1px solid var(--border);
}
.eyebrow { color: var(--text-secondary); font-size: .8125rem; font-weight: 560; letter-spacing: .012em; }
.nav-line { margin-top: 30px; gap: 18px; }
.return-badge,
.status-pill { border-radius: 7px; box-shadow: none; }
.nav-hero > .muted { margin-top: 20px; font-size: .9rem; }
.strategy-brief {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px 22px;
  margin-top: 32px;
  padding: 24px 0 20px;
  border: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.brief-primary { min-width: 0; }
.brief-primary > span { font-weight: 540; }
.brief-primary > strong { margin-top: 12px; font-size: 1.4rem; font-weight: 590; letter-spacing: -.022em; }
.brief-primary > small { margin-top: 8px; }
.brief-actions { grid-column: 2; grid-row: 1; align-self: start; }
.brief-actions button { min-height: 36px; border-radius: 6px; background: transparent; box-shadow: none; }
.brief-facts {
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.brief-fact { padding: 16px 24px 0 0; }
.brief-fact + .brief-fact { padding-left: 24px; border-left: 1px solid var(--border); }
.brief-fact strong { margin-top: 8px; font-size: 1rem; font-weight: 620; }
.brief-fact strong,
.brief-fact small {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: break-word;
}
.period-grid {
  gap: 0;
  margin-top: 18px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.period-item { padding: 16px 22px 10px 0; }
.period-item + .period-item { padding-left: 22px; }
.period-item strong { margin: 10px 0 6px; font-size: 1.35rem; font-weight: 600; }
.system-card .card-heading h2 { margin-top: 28px; font-size: 1.5rem; font-weight: 600; }
.soft-button,
.range-sync,
.icon-button,
.position-trend-toggle,
.history-asset-button { border-radius: 6px; background: transparent; box-shadow: none; }
.health-orbit { width: 142px; height: 142px; margin: 0 auto 2px; }
.health-orbit svg {
  transform: translateY(13px) scale(1.22);
  transform-origin: center;
}
.system-card .health-list {
  display: block;
  margin-top: 2px;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}
.system-card .health-list > div {
  min-height: 0;
  display: flex;
  grid-column: auto;
  grid-row: auto;
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border: 0;
  background: transparent;
}
.system-card .health-list > div:nth-child(1),
.system-card .health-list > div:nth-child(2),
.system-card .health-list > div:nth-child(3),
.system-card .health-list > div:nth-child(4) { grid-column: auto; grid-row: auto; border: 0; }
.health-list > div + div { border-top: 1px solid var(--border); }
.system-card .health-message { padding: 16px 0 0; border-top: 1px solid var(--border); }

#refresh-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
#refresh-button .refresh-icon {
  display: block;
  width: 14px;
  height: 14px;
  opacity: .76;
}
html[data-theme="dark"] #refresh-button .refresh-icon { filter: invert(1); }
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] #refresh-button .refresh-icon { filter: invert(1); }
}

.metric-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 24px 0 18px;
  gap: 0;
  overflow: visible;
  border: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.metric-item { padding: 18px; background: transparent; }
/* Dividers follow grid cells, not sibling order: row starts have no outer edge. */
.metric-item:not(:nth-child(4n + 1)) { border-left: 1px solid var(--border); }
.metric-item:nth-child(n + 5) { border-top: 1px solid var(--border); }
.metric-item:hover { background: var(--surface-muted); box-shadow: none; }
.metric-strip strong { font-size: 1.2rem; font-weight: 600; }

@media (max-width: 820px) {
  .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-item:nth-child(odd) { border-left: 0; }
  .metric-item:nth-child(n + 3) { border-top: 1px solid var(--border); }
}

.performance-toolbar,
.position-workspace-heading { padding: 14px 4px 20px; }
.chart-card,
.period-card,
.comparison-card,
.position-card,
.risk-card,
.strategy-card,
.cost-card,
.calendar-card,
.trade-card,
.operations-card,
.actions-card,
.attribution-card { padding: 24px 4px 28px; }
.content-grid .glass-card + .glass-card { border-top-color: var(--border); }
.segmented-control,
.mini-tabs,
.trade-filters,
.index-selector {
  border-radius: 7px;
  background: transparent;
  box-shadow: none;
}
.segmented-control button,
.mini-tabs button,
.trade-filters button,
.index-selector button { border-radius: 5px; }
.range-picker {
  border-radius: 7px;
  background: transparent;
  box-shadow: none;
}
.range-picker.is-open { background: var(--surface-solid); box-shadow: var(--shadow-control); }
.range-picker-trigger .range-picker-context { letter-spacing: .02em; }
.range-picker-popover { border-radius: 10px; box-shadow: 0 2px 8px rgba(14, 20, 29, .06), 0 26px 70px rgba(14, 20, 29, .15); }
.range-picker-popover .segmented-control.range-rail button { border-radius: 5px; }
.table-wrap { border-radius: 7px; }
.benchmark-kpi,
.asset-trend-card,
.strategy-principles details,
.strategy-limitations,
.strategy-limitations li details,
.strategy-algorithm,
.method-card { border-radius: 8px; box-shadow: none; }
.strategy-limitations { border-left-width: 1px; }
.site-footer { width: min(1364px, calc(100% - 64px)); border-top-color: var(--border); }

@media (min-width: 901px) {
  .hero-grid > .nav-hero,
  .hero-grid > .system-card { min-height: clamp(540px, calc(100dvh - var(--app-chrome-height) - 48px), 720px); }
  .hero-grid > .nav-hero { justify-content: space-between; }
  .period-grid { margin-top: 18px; }
}


:where(button, a, select, input, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid color-mix(in srgb, var(--green) 72%, transparent);
  outline-offset: 3px;
}

@media (max-width: 1100px) {
  .topbar,
  .connection-bar { padding-inline: 22px; }
  .topbar { grid-template-columns: 150px minmax(360px, 1fr) auto; gap: 0 26px; }
  .brand-logo { width: 132px; }
  main,
  .site-footer { width: min(100% - 44px, 1040px); }
}

@media (min-width: 901px) and (max-width: 1100px) {
  body.has-strategy-sidebar .hero-grid { grid-template-columns: minmax(0, 1fr); }
  body.has-strategy-sidebar .nav-hero { min-height: 0; padding-right: 8px; }
  body.has-strategy-sidebar .nav-line { flex-wrap: wrap; }
  body.has-strategy-sidebar .system-card {
    min-height: 0;
    padding: 26px 8px;
    border-top: 1px solid var(--border);
    border-left: 0;
  }
}

/* The English workspace labels need their intrinsic width in the narrow
   desktop handoff. Tighten only the inter-item rhythm here; never crop a
   navigation destination to preserve a decorative gap. */
@media (min-width: 901px) and (max-width: 1000px) {
  .nav-pills { gap: clamp(8px, calc(17vw - 145px), 25px); }
  .nav-pills a { flex: 1 0 auto; }
}

/* Workspace-aware proportions -----------------------------------------
   The persistent strategy rail reduces the usable canvas substantially.
   Keep the system instrument comfortably readable until the workspace,
   rather than only the viewport, is genuinely wide enough. */
@media (min-width: 1101px) and (max-width: 1360px) {
  .hero-grid { grid-template-columns: minmax(0, 68%) minmax(0, 32%); }
}

@media (min-width: 1101px) and (max-width: 1180px) {
  html:not([data-strategy-sidebar="collapsed"]) body.has-strategy-sidebar .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  html:not([data-strategy-sidebar="collapsed"]) body.has-strategy-sidebar .nav-hero {
    min-height: 0;
    padding-right: 8px;
  }
  html:not([data-strategy-sidebar="collapsed"]) body.has-strategy-sidebar .system-card {
    min-height: 0;
    padding: 26px 8px;
    border-top: 1px solid var(--border);
    border-left: 0;
  }
}

@media (max-width: 900px) {
  :root { --app-brand-height: 62px; --app-connection-height: 54px; }
  .topbar { grid-template-columns: 112px minmax(270px, 1fr) auto; gap: 0 15px; padding-inline: 16px; }
  .brand-logo { width: 108px; }
  .connection-bar { padding-inline: 14px; }
  .strategy-context {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    max-width: none;
    min-height: 42px;
    padding: 0;
    border: 0;
    background: transparent;
  }
  body.has-strategy-sidebar main,
  body.has-strategy-sidebar .site-footer {
    margin-right: auto;
    margin-left: auto;
    transition: none;
  }
  .connection-bar .strategy-trigger {
    width: 100%;
    height: 42px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    margin: 0;
    padding: 4px 9px 4px 5px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: transparent;
  }
  .strategy-trigger .strategy-active-code { min-width: 44px; height: 30px; display: inline-flex; margin-right: 7px; border: 0; border-radius: 0; background: transparent; color: var(--text-secondary); box-shadow: none; }
  .strategy-trigger .strategy-trigger-copy { display: grid; }
  .strategy-trigger .strategy-trigger-copy strong { font-size: .8125rem; font-weight: 550; }
  .strategy-trigger .strategy-trigger-meta { display: flex; }
  .strategy-trigger #strategy-count { display: none; }
  .strategy-switch-action img { transition: transform var(--strategy-drawer-motion) ease; }
  .strategy-trigger[aria-expanded="true"] .strategy-switch-action img { transform: rotate(180deg); }
  .connection-state { max-width: 36%; }
  .connection-state #connection-detail { display: none; }
  main,
  .site-footer { width: min(100% - 28px, 720px); }
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .nav-hero { min-height: 0; padding: 24px 8px 26px; }
  .system-card { min-height: 0; padding: 26px 8px; border-top: 1px solid var(--border); border-left: 0; }

  body.has-strategy-sidebar .strategy-sidebar {
    position: fixed;
    z-index: 42;
    top: calc(var(--app-chrome-height) + 8px);
    bottom: auto;
    left: max(12px, env(safe-area-inset-left, 0px));
    width: min(420px, calc(100vw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    height: auto;
    max-height: calc(100vh - var(--app-chrome-height) - 24px);
    max-height: calc(100dvh - var(--app-chrome-height) - 24px);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--material-chrome);
    color: var(--text);
    box-shadow: 0 3px 8px rgba(14, 20, 29, .06), 0 18px 48px rgba(14, 20, 29, .14);
    transform: translateY(-8px);
    opacity: 0;
    transition:
      transform var(--strategy-drawer-motion) var(--strategy-sidebar-ease),
      opacity var(--strategy-drawer-motion) ease;
  }
  body.strategy-sidebar-open { overflow: hidden; }
  body.strategy-sidebar-open .strategy-sidebar {
    transform: translateY(0);
    opacity: 1;
  }
  body.has-strategy-sidebar .strategy-sidebar-backdrop {
    position: fixed;
    z-index: 41;
    inset: var(--app-chrome-height) 0 0;
    display: block;
    width: 100%;
    height: calc(100vh - var(--app-chrome-height));
    height: calc(100dvh - var(--app-chrome-height));
    min-height: 0;
    padding: 0;
    border: 0;
    background: rgba(12, 16, 22, .16);
    cursor: default;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--strategy-drawer-motion) ease;
  }
  body.strategy-sidebar-open .strategy-sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .strategy-sidebar-header {
    min-height: 60px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 8px 12px 8px 18px;
  }
  .strategy-sidebar-collapse { display: none; }
  .strategy-sidebar-close {
    min-width: 52px;
    min-height: 44px;
    display: grid;
    border-color: transparent;
    background: transparent;
  }
  .strategy-sidebar-close:hover { color: var(--text); background: var(--surface-solid); }
  .strategy-sidebar-list { gap: 4px; padding: 8px; }
  .strategy-sidebar-option { min-height: 76px; }
  .strategy-sidebar-option .strategy-option-copy small { display: block; }
  .strategy-sidebar-footer { min-height: 40px; padding: 10px 18px; white-space: normal; }
  html[data-strategy-sidebar="collapsed"] .strategy-sidebar-header {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 60px;
    padding: 8px 12px 8px 18px;
  }
  html[data-strategy-sidebar="collapsed"] .strategy-sidebar-heading,
  html[data-strategy-sidebar="collapsed"] .strategy-sidebar-footer { position: static; visibility: visible; opacity: 1; pointer-events: auto; transform: none; }
  html[data-strategy-sidebar="collapsed"] .strategy-sidebar-list { gap: 4px; padding: 8px; }
  html[data-strategy-sidebar="collapsed"] .strategy-sidebar-list::before { display: none; }
  html[data-strategy-sidebar="collapsed"] .strategy-sidebar-option {
    min-height: 76px;
    grid-template-columns: 46px minmax(0, 1fr) 18px;
    gap: 12px;
    padding: 10px 11px 10px 9px;
  }
  html[data-strategy-sidebar="collapsed"] .strategy-sidebar-option .strategy-option-code { justify-self: stretch; }
  html[data-strategy-sidebar="collapsed"] .strategy-sidebar-option .strategy-option-copy { display: grid; }
  html[data-strategy-sidebar="collapsed"] .strategy-sidebar-option .strategy-option-state { display: grid; }
  html[data-strategy-sidebar="collapsed"] .strategy-sidebar-footer { min-height: 40px; justify-content: flex-start; padding: 10px 18px; }
  html[data-strategy-sidebar="collapsed"] .strategy-sidebar-option::before { left: 60px; }
  html[data-strategy-sidebar="collapsed"] .strategy-sidebar-footer > span:last-child,
  html[data-strategy-sidebar="collapsed"] .strategy-sidebar-option .strategy-option-copy,
  html[data-strategy-sidebar="collapsed"] .strategy-sidebar-option .strategy-option-state {
    position: static;
    visibility: visible;
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 700px) {
  :root { --app-brand-height: 58px; --app-connection-height: 52px; }
  .topbar { grid-template-columns: minmax(0, 1fr) auto; padding-inline: 13px; }
  .brand-logo { width: 96px; }
  .connection-bar { padding-inline: 10px; }
  .connection-shell { gap: 12px; }
  .connection-state { max-width: 35%; font-size: .7rem; }
  .connection-state #connection-text,
  .connection-state #connection-detail { display: none; }
  .connection-state::after {
    content: "CHECKING";
    overflow: hidden;
    font-weight: 680;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .connection-state[data-paper-status]::after { content: attr(data-paper-status); }
  /* The visible recovery action owns this compact slot during an outage.
     Do not squeeze a second status label beside it on narrow screens. */
  .connection-bar:is(.degraded, .offline) .connection-state:has(#retry-button:not([hidden]))::after { display: none; }
  main,
  .site-footer { width: min(100% - 22px, 640px); }
  main { padding-top: 20px; padding-bottom: 48px; }
  .strategy-brief { grid-template-columns: minmax(0, 1fr); gap: 18px; margin-top: 30px; padding: 24px 0 20px; }
  .brief-actions { grid-column: 1; grid-row: auto; }
  .brief-facts { grid-template-columns: minmax(0, 1fr); }
  .brief-fact { padding-top: 14px; }
  .brief-fact + .brief-fact { margin-top: 14px; padding-left: 0; border-left: 0; border-top: 1px solid var(--border); }
  .period-grid { grid-template-columns: minmax(0, 1fr); }
  .period-item { padding: 14px 0; }
  .period-item + .period-item { padding-left: 0; }
  .period-item strong { margin: 0; font-size: 1.25rem; }
  .metric-item { padding: 15px 12px; }
  .metric-strip strong { font-size: 1.15rem; }
}

@media (max-width: 390px) {
  .brand-logo { width: 88px; }
  .strategy-active-code { min-width: 42px; }
  .strategy-context #strategy-count { display: none; }
}

/* Short desktop windows need a denser vertical rhythm. This keeps the
   orientation, NAV, brief and system state together in the first view
   without shrinking ordinary reading text. */
@media (min-width: 901px) and (max-height: 820px) {
  :root {
    --app-brand-height: 80px;
    --app-connection-height: 42px;
  }
  .brand-logo { width: 176px; }
  main { padding-top: 18px; }
  .nav-hero { padding-top: 24px; padding-bottom: 16px; }
  .nav-line { margin-top: 22px; }
  .nav-hero > .muted { margin-top: 16px; }
  .strategy-brief { gap: 14px 20px; margin-top: 24px; padding: 18px 0 16px; }
  .brief-primary > strong { margin-top: 8px; font-size: 1.3rem; }
  .brief-primary > small { margin-top: 6px; }
  .brief-fact { padding-top: 12px; }
  .brief-fact strong { margin-top: 5px; }
  .period-grid { margin-top: 12px; }
  .period-item { padding-top: 12px; padding-bottom: 7px; }
  .period-item strong { margin-top: 6px; margin-bottom: 4px; font-size: 1.25rem; }
  .system-card { gap: 14px; padding-top: 22px; padding-bottom: 16px; }
  .system-card .card-heading h2 { margin-top: 16px; font-size: 1.35rem; }
  .health-orbit { width: 112px; height: 112px; margin-bottom: 0; }
  .health-orbit svg { transform: translateY(5px) scale(1.05); }
  .system-card .health-list > div { padding: 9px 0; }
  .system-card .health-message { padding-top: 12px; }
}

/* Device and input hardening -------------------------------------------- */
main,
.site-footer {
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

@media (min-width: 1101px) {
  .topbar,
  .connection-bar {
    padding-left: max(38px, calc((100vw - 1364px) / 2), env(safe-area-inset-left, 0px));
    padding-right: max(38px, calc((100vw - 1364px) / 2), env(safe-area-inset-right, 0px));
  }
}

@media (min-width: 901px) and (max-width: 1100px) {
  .topbar,
  .connection-bar {
    padding-left: max(22px, env(safe-area-inset-left, 0px));
    padding-right: max(22px, env(safe-area-inset-right, 0px));
  }
}

@media (min-width: 701px) and (max-width: 900px) {
  .topbar {
    grid-template-columns: minmax(112px, 1fr) auto;
    gap: 12px;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
  .connection-bar {
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
  .nav-pills { display: none; }
  .top-actions { grid-column: 2; grid-row: 1; }
  .mobile-menu-button {
    min-width: 58px;
    min-height: 44px;
    display: inline-grid;
    place-items: center;
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    background: var(--material-control);
    box-shadow: var(--inner-highlight);
    font-size: var(--type-label);
    font-weight: 680;
    cursor: pointer;
  }
  .mobile-menu-button:hover,
  .mobile-menu-button[aria-expanded="true"] { background: var(--material-selected); box-shadow: var(--shadow-control); }
}

@media (max-width: 700px) {
  .topbar {
    padding-left: max(13px, env(safe-area-inset-left, 0px));
    padding-right: max(13px, env(safe-area-inset-right, 0px));
  }
  .connection-bar {
    padding-left: max(10px, env(safe-area-inset-left, 0px));
    padding-right: max(10px, env(safe-area-inset-right, 0px));
  }
}

@media (pointer: coarse) {
  .theme-control,
  .language-control { height: 50px; }
  .language-control { width: 92px; flex-basis: 92px; }
  .theme-control button,
  .language-control button,
  .brief-actions button,
  .soft-button,
  .footer-tool-button,
  .mobile-sheet-header button { min-width: 44px; min-height: 44px; height: 44px; }
  .connection-bar .strategy-trigger { min-width: 44px; min-height: 44px; }
  .strategy-sidebar-collapse,
  .strategy-sidebar-close { min-width: 44px; min-height: 44px; }
  .strategy-sidebar-option { min-height: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  main { animation: none !important; }
  :root {
    --strategy-sidebar-motion: 0.01ms;
    --strategy-drawer-motion: 0.01ms;
  }
  .strategy-sidebar,
  .strategy-sidebar-shell,
  .strategy-sidebar-backdrop,
  .strategy-sidebar-heading,
  .strategy-sidebar-option,
  .strategy-sidebar-option::before,
  .strategy-sidebar-option .strategy-option-copy,
  .strategy-sidebar-option .strategy-option-state,
  .strategy-sidebar-footer,
  .strategy-sidebar-footer > span:last-child,
  .strategy-sidebar-collapse img,
  body.has-strategy-sidebar .connection-shell,
  body.has-strategy-sidebar main,
  body.has-strategy-sidebar .site-footer,
  body.strategy-sidebar-open .strategy-sidebar-option { animation: none; }
}

@media print {
  .strategy-sidebar,
  .strategy-sidebar-backdrop { display: none !important; }
  body.has-strategy-sidebar main,
  body.has-strategy-sidebar .site-footer { width: 100%; margin-inline: 0; }
}
