:root {
  color-scheme: dark;
  --bg: #070a11;
  --bg-soft: #0a0f19;
  --panel: #0e1420;
  --panel-raised: #121a28;
  --panel-hover: #162032;
  --text: #f4f7fb;
  --text-soft: #c7d0dc;
  --muted: #8491a3;
  --muted-strong: #9eabba;
  --line: #202b3b;
  --line-soft: rgba(142, 162, 190, 0.13);
  --accent: #6c8cff;
  --accent-bright: #89a2ff;
  --accent-soft: rgba(108, 140, 255, 0.14);
  --positive: #2dd4bf;
  --positive-soft: rgba(45, 212, 191, 0.12);
  --negative: #fb7185;
  --warning: #f4c15d;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.25);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 78% -12%, rgba(65, 92, 178, 0.16), transparent 35rem),
    linear-gradient(180deg, #080c14 0%, var(--bg) 50%);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
h1, h2, h3, h4, p { text-wrap: pretty; }
code { color: var(--text-soft); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  color: #071018;
  background: var(--positive);
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  font-size: 1rem;
  font-weight: 750;
  text-decoration: none;
}

.brand > span:last-child { display: grid; gap: 0.1rem; }
.brand small {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 650;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.brand-mark {
  position: relative;
  display: flex;
  width: 38px;
  height: 38px;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  padding: 9px;
  overflow: hidden;
  border: 1px solid rgba(108, 140, 255, 0.42);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(108, 140, 255, 0.14), rgba(45, 212, 191, 0.05));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.brand-mark i { width: 3px; border-radius: 2px; background: var(--accent-bright); }
.brand-mark i:nth-child(1) { height: 38%; }
.brand-mark i:nth-child(2) { height: 78%; background: var(--positive); }
.brand-mark i:nth-child(3) { height: 58%; }

.eyebrow {
  margin: 0 0 0.55rem;
  color: var(--accent-bright);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  line-height: 1.4;
  text-transform: uppercase;
}

.lede {
  max-width: 720px;
  margin: 0.8rem 0 0;
  color: var(--muted-strong);
  font-size: 0.98rem;
  line-height: 1.65;
}

.quiet-button,
.secondary-button,
.secondary-link,
.primary-link,
.primary-button,
.danger-button,
.table-action,
.stack button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--panel-raised);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.quiet-button:hover,
.secondary-button:hover,
.secondary-link:hover,
.table-action:hover { border-color: #3c4e68; background: var(--panel-hover); }
.quiet-button { padding: 0.55rem 0.8rem; }
.button-link,
.primary-link,
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.68rem 1rem;
  text-decoration: none;
}
.primary-link,
.primary-button,
.stack button {
  border-color: #718dff;
  color: #fff;
  background: linear-gradient(135deg, #627ff0, #506fe9);
  font-weight: 750;
  box-shadow: 0 8px 24px rgba(73, 103, 219, 0.2);
}
.primary-link:hover,
.primary-button:hover,
.stack button:hover { background: linear-gradient(135deg, #7893ff, #5e7cf0); transform: translateY(-1px); }
.danger-button { padding: 0.65rem 0.9rem; }
.danger-button.is-armed { border-color: rgba(251, 113, 133, 0.45); color: #ffb3bf; background: rgba(251, 113, 133, 0.1); }
.danger-button:disabled,
.primary-button:disabled,
.stack button:disabled { cursor: wait; opacity: 0.55; transform: none; }

/* Logowanie i aktywacja */
.auth-page { min-height: 100vh; background: #070a11; }
.auth-layout { display: grid; min-height: 100vh; grid-template-columns: minmax(420px, 1.04fr) minmax(480px, 0.96fr); }
.auth-brand-panel {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  padding: clamp(2rem, 4.5vw, 4.5rem);
  overflow: hidden;
  border-right: 1px solid var(--line-soft);
  background:
    radial-gradient(circle at 24% 80%, rgba(45, 212, 191, 0.12), transparent 24rem),
    radial-gradient(circle at 82% 18%, rgba(108, 140, 255, 0.24), transparent 28rem),
    linear-gradient(145deg, #0c1320, #080d16 68%);
}
.auth-brand-panel::before {
  position: absolute;
  inset: 0;
  content: "";
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(133, 151, 180, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(133, 151, 180, 0.1) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, transparent 4%, #000 30%, #000 78%, transparent 100%);
}
.auth-brand-panel > * { position: relative; z-index: 1; }
.auth-brand-copy { width: min(680px, 100%); margin: auto 0; padding: 4rem 0; }
.auth-brand-title {
  margin: 0;
  color: #f7f9ff;
  font-size: clamp(2.8rem, 4.5vw, 5.4rem);
  font-weight: 720;
  letter-spacing: -0.055em;
  line-height: 0.99;
}
.auth-brand-lede { max-width: 550px; margin: 1.5rem 0 0; color: #a7b4c6; font-size: 1.04rem; line-height: 1.7; }
.auth-market-visual {
  position: relative;
  width: min(590px, 92%);
  height: 150px;
  margin-top: 3.2rem;
  overflow: hidden;
  border: 1px solid rgba(128, 153, 191, 0.16);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(rgba(128, 153, 191, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(128, 153, 191, 0.08) 1px, transparent 1px),
    rgba(4, 9, 16, 0.45);
  background-size: 100% 37px, 72px 100%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}
.auth-market-visual .market-line {
  position: absolute;
  right: 5%;
  bottom: 25%;
  left: 5%;
  height: 42%;
  border-top: 2px solid rgba(108, 140, 255, 0.7);
  border-radius: 50%;
  transform: rotate(-8deg) skewX(-18deg);
  filter: drop-shadow(0 0 8px rgba(108, 140, 255, 0.3));
}
.auth-market-visual > i { position: absolute; width: 7px; border-radius: 2px; background: var(--positive); }
.auth-market-visual > i::before { position: absolute; top: -10px; bottom: -10px; left: 3px; width: 1px; content: ""; background: inherit; }
.auth-market-visual > i:nth-of-type(1) { left: 8%; top: 42%; height: 34%; }
.auth-market-visual > i:nth-of-type(2) { left: 21%; top: 30%; height: 48%; background: var(--negative); }
.auth-market-visual > i:nth-of-type(3) { left: 34%; top: 44%; height: 29%; }
.auth-market-visual > i:nth-of-type(4) { left: 47%; top: 21%; height: 55%; }
.auth-market-visual > i:nth-of-type(5) { left: 60%; top: 32%; height: 39%; background: var(--negative); }
.auth-market-visual > i:nth-of-type(6) { left: 73%; top: 13%; height: 61%; }
.auth-market-visual > i:nth-of-type(7) { left: 86%; top: 22%; height: 46%; }
.auth-trust { display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: #7f8da1; font-size: 0.72rem; }
.auth-trust span { display: inline-flex; align-items: center; gap: 0.5rem; }
.auth-trust i { width: 7px; height: 7px; border-radius: 50%; background: var(--positive); box-shadow: 0 0 12px rgba(45, 212, 191, 0.65); }

.auth-shell { display: grid; min-height: 100vh; place-items: center; padding: clamp(2rem, 6vw, 6rem); background: rgba(7, 10, 17, 0.9); }
.auth-form-copy { width: min(440px, 100%); }
.auth-mobile-brand { display: none; }
.auth-shell h1 { max-width: 12ch; margin: 0; font-size: clamp(2.35rem, 4.5vw, 3.7rem); font-weight: 720; letter-spacing: -0.05em; line-height: 1.02; }
.auth-shell .lede { margin-top: 1rem; font-size: 0.96rem; }
.stack { display: grid; gap: 1rem; margin-top: 2rem; }
.stack label,
.field-grid label,
.ai-form label,
.filter-bar label,
.approval-form label { display: grid; gap: 0.45rem; color: var(--muted-strong); font-size: 0.76rem; font-weight: 600; }
.stack input,
.field-grid input,
.field-grid select,
.ai-form select,
.ai-form textarea,
.filter-bar input,
.filter-bar select,
.approval-form select {
  width: 100%;
  min-height: 44px;
  padding: 0.7rem 0.8rem;
  border: 1px solid #263246;
  border-radius: var(--radius-sm);
  outline: none;
  color: var(--text);
  background: #090e17;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.stack input:hover,
.field-grid input:hover,
.field-grid select:hover,
.ai-form select:hover,
.ai-form textarea:hover,
.filter-bar input:hover,
.filter-bar select:hover { border-color: #374760; }
.stack input:focus,
.field-grid input:focus,
.field-grid select:focus,
.ai-form select:focus,
.ai-form textarea:focus,
.filter-bar input:focus,
.filter-bar select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108, 140, 255, 0.13); }
.stack button { width: 100%; margin-top: 0.45rem; padding: 0.8rem 1rem; }
.password-rule { margin: 0; color: var(--muted); font-size: 0.75rem; line-height: 1.5; }
.stack .password-visibility { display: flex; align-items: center; gap: 0.6rem; }
.stack .password-visibility input { width: auto; min-height: auto; margin: 0; accent-color: var(--accent); }
.auth-link { margin: 1.5rem 0 0; color: var(--muted); font-size: 0.82rem; }
.auth-link a { color: var(--accent-bright); text-underline-offset: 3px; }
.notice { margin: 1.2rem 0; padding: 0.8rem 1rem; border: 1px solid rgba(244, 193, 93, 0.25); border-radius: var(--radius-sm); color: #f7d99d; background: rgba(244, 193, 93, 0.08); font-size: 0.82rem; line-height: 1.5; }
.notice-success { border-color: rgba(45, 212, 191, 0.25); color: #a7f3e7; background: rgba(45, 212, 191, 0.08); }

/* Główny shell aplikacji */
.app-body { min-height: 100vh; overflow-x: hidden; }
.app-shell { display: grid; min-height: 100vh; grid-template-columns: 248px minmax(0, 1fr); }
.app-sidebar {
  position: fixed;
  z-index: 40;
  inset: 0 auto 0 0;
  display: flex;
  width: 248px;
  flex-direction: column;
  border-right: 1px solid var(--line-soft);
  background: rgba(7, 11, 18, 0.97);
  box-shadow: 12px 0 45px rgba(0, 0, 0, 0.08);
}
.app-brand { min-height: 76px; padding: 0 1.15rem; border-bottom: 1px solid var(--line-soft); }
.app-nav { display: grid; gap: 0.28rem; padding: 1.05rem 0.75rem; overflow-y: auto; }
.app-nav-link {
  position: relative;
  display: grid;
  min-height: 46px;
  grid-template-columns: 34px 1fr;
  align-items: center;
  padding: 0.45rem 0.65rem;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #8f9bad;
  text-decoration: none;
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease;
}
.app-nav-link:hover { color: var(--text-soft); background: rgba(255, 255, 255, 0.025); }
.app-nav-link.is-active { border-color: rgba(108, 140, 255, 0.17); color: #f4f7ff; background: linear-gradient(90deg, rgba(108, 140, 255, 0.15), rgba(108, 140, 255, 0.04)); }
.app-nav-link.is-active::before { position: absolute; top: 10px; bottom: 10px; left: -0.76rem; width: 3px; border-radius: 0 3px 3px 0; content: ""; background: var(--accent-bright); box-shadow: 0 0 12px rgba(108, 140, 255, 0.45); }
.app-nav-link strong { font-size: 0.79rem; font-weight: 650; }
.nav-icon { display: grid; width: 20px; height: 20px; place-items: center; color: #65738a; }
.nav-icon svg { width: 19px; height: 19px; overflow: visible; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.app-nav-link.is-active .nav-icon { color: var(--accent-bright); }
.app-nav-section { display: grid; gap: 0.25rem; margin-top: 0.8rem; padding-top: 1rem; border-top: 1px solid var(--line-soft); }
.app-nav-section > p { margin: 0 0 0.3rem 0.7rem; color: #657187; font-size: 0.58rem; font-weight: 800; letter-spacing: 0.15em; text-transform: uppercase; }
.sidebar-foot { margin-top: auto; padding: 1.1rem; border-top: 1px solid var(--line-soft); }
.sidebar-foot p { margin: 0.55rem 0 0; color: var(--muted); font-size: 0.66rem; }
.mode-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.35rem 0.55rem;
  border: 1px solid rgba(244, 193, 93, 0.3);
  border-radius: 6px;
  color: #f6cf7d;
  background: rgba(244, 193, 93, 0.08);
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  white-space: nowrap;
}

.app-workspace { min-width: 0; grid-column: 2; }
.app-topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: grid;
  min-height: 76px;
  grid-template-columns: minmax(160px, 1fr) auto auto;
  align-items: center;
  padding: 0 2rem;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(8, 12, 20, 0.84);
  backdrop-filter: blur(20px) saturate(1.25);
}
.page-context { display: grid; gap: 0.15rem; }
.page-context p { margin: 0; color: var(--accent-bright); font-size: 0.56rem; font-weight: 800; letter-spacing: 0.16em; }
.page-context strong { font-size: 0.82rem; }
.system-pulse { display: grid; grid-template-columns: auto auto; align-items: center; column-gap: 0.5rem; padding: 0 1.5rem; border-right: 1px solid var(--line-soft); }
.system-pulse > span { width: 7px; height: 7px; grid-row: span 2; border-radius: 50%; background: var(--warning); box-shadow: 0 0 13px rgba(244, 193, 93, 0.55); }
.system-pulse strong { color: #f6cf7d; font-size: 0.62rem; letter-spacing: 0.08em; }
.system-pulse small { color: var(--muted); font-size: 0.6rem; }
.account-menu { display: flex; align-items: center; gap: 0.65rem; padding-left: 1.5rem; }
.account-menu > span:nth-child(2) { display: grid; gap: 0.1rem; max-width: 180px; }
.account-menu > span:nth-child(2) strong { overflow: hidden; font-size: 0.72rem; text-overflow: ellipsis; }
.account-menu > span:nth-child(2) small { color: var(--muted); font-size: 0.6rem; }
.account-avatar { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid rgba(108, 140, 255, 0.35); border-radius: 9px; color: var(--accent-bright); background: var(--accent-soft); font-size: 0.61rem; font-weight: 800; }
.account-menu form { margin: 0; }
.account-menu .quiet-button { min-height: 34px; color: var(--muted-strong); font-size: 0.7rem; }
.menu-toggle { display: none; width: 40px; height: 40px; place-items: center; border: 0; border-radius: var(--radius-sm); color: var(--text); background: transparent; font-size: 1.15rem; cursor: pointer; }

.app-main { width: 100%; max-width: 1660px; min-height: calc(100vh - 76px); margin: 0 auto; padding: clamp(1.5rem, 2.8vw, 2.8rem); }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 1.45rem; }
.page-header > div:first-child { min-width: 0; }
.page-header h1 { max-width: 18ch; margin: 0; font-size: clamp(2.4rem, 4.4vw, 4.5rem); font-weight: 710; letter-spacing: -0.055em; line-height: 0.98; }
.compact-page-header { align-items: center; }
.compact-page-header h1 { max-width: none; font-size: clamp(2.15rem, 3.6vw, 3.75rem); }
.page-header-actions,
.trading-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.65rem; }

.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.section-heading .eyebrow { margin-bottom: 0.3rem; }
.section-heading h2 { margin: 0; font-size: 1.12rem; font-weight: 690; letter-spacing: -0.02em; }
.compact-heading { align-items: center; }
.compact-heading h2,
.compact-heading h3 { margin: 0; }
.source-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0.35rem 0.62rem;
  border: 1px solid rgba(45, 212, 191, 0.22);
  border-radius: 999px;
  color: #8ee9dc;
  background: rgba(45, 212, 191, 0.07);
  font-size: 0.65rem;
  font-weight: 650;
  white-space: nowrap;
}
.text-link { color: var(--accent-bright); font-size: 0.72rem; text-decoration: none; }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Kokpit */
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }
.metric-card {
  position: relative;
  display: grid;
  min-height: 130px;
  padding: 1.05rem 1.15rem;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(18, 26, 40, 0.93), rgba(12, 18, 28, 0.93));
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.025);
}
.metric-card::before { position: absolute; top: 0; right: 1rem; left: 1rem; height: 2px; border-radius: 0 0 2px 2px; content: ""; background: linear-gradient(90deg, var(--accent), transparent); opacity: 0.7; }
.metric-card:nth-child(2)::before { background: linear-gradient(90deg, var(--positive), transparent); }
.metric-card:nth-child(3)::before { background: linear-gradient(90deg, #a78bfa, transparent); }
.metric-card:nth-child(4)::before { background: linear-gradient(90deg, var(--warning), transparent); }
.metric-card span { color: var(--muted-strong); font-size: 0.68rem; font-weight: 650; }
.metric-card strong { align-self: end; font-size: clamp(1.85rem, 3vw, 2.65rem); font-variant-numeric: tabular-nums; font-weight: 680; letter-spacing: -0.045em; }
.metric-card small { color: #748297; font-size: 0.65rem; }
.dashboard-columns { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr); gap: 0.8rem; margin-top: 0.8rem; }
.workspace-panel,
.market-card,
.signal-panel,
.ai-panel,
.trading-desk,
.order-ticket,
.positions-panel,
.orders-panel {
  min-width: 0;
  padding: 1.15rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(14, 20, 32, 0.87);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}
.workspace-panel { margin-top: 0.8rem; }
.dashboard-columns .workspace-panel { margin-top: 0; }
.quick-module-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin-top: 0.8rem; }
.quick-module-grid a {
  position: relative;
  display: grid;
  min-height: 145px;
  padding: 1.1rem;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(12, 18, 28, 0.72);
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}
.quick-module-grid a::after { position: absolute; right: 1rem; bottom: 0.8rem; content: "→"; color: #566680; font-size: 1rem; transition: transform 160ms ease, color 160ms ease; }
.quick-module-grid a:hover { border-color: rgba(108, 140, 255, 0.3); background: var(--panel); transform: translateY(-2px); }
.quick-module-grid a:hover::after { color: var(--accent-bright); transform: translateX(3px); }
.quick-module-grid span { color: var(--accent-bright); font-size: 0.6rem; font-weight: 750; }
.quick-module-grid strong { align-self: end; font-size: 0.93rem; }
.quick-module-grid p { margin: 0.4rem 1.4rem 0 0; color: var(--muted); font-size: 0.72rem; line-height: 1.5; }

/* Dane rynkowe */
.market-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(330px, 0.4fr); gap: 0.8rem; }
.market-card-wide { grid-row: span 2; }
.data-quality-badge { display: flex; min-width: 220px; align-items: center; gap: 0.7rem; padding: 0.75rem 0.9rem; border: 1px solid var(--line-soft); border-radius: var(--radius); background: rgba(14, 20, 32, 0.8); }
.data-quality-badge > span { width: 8px; height: 8px; border-radius: 50%; background: var(--positive); box-shadow: 0 0 12px rgba(45, 212, 191, 0.55); }
.data-quality-badge div { display: grid; gap: 0.16rem; }
.data-quality-badge strong { font-size: 0.72rem; }
.data-quality-badge small { color: var(--muted); font-size: 0.62rem; }
.widget-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid #1c2737;
  border-radius: 10px;
  background:
    linear-gradient(rgba(128, 153, 191, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(128, 153, 191, 0.055) 1px, transparent 1px),
    #080d16;
  background-size: 100% 52px, 72px 100%;
}
.widget-chart { height: min(690px, calc(100vh - 250px)); min-height: 520px; }
.widget-analysis { height: 360px; }
.widget-calendar { height: 470px; }
.tradingview-widget-container,
.tradingview-widget-container__widget { position: relative; z-index: 1; width: 100%; height: 100%; }
.widget-loading-state {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.55rem;
  color: var(--muted);
  text-align: center;
  background: rgba(8, 13, 22, 0.94);
}
.widget-loading-state > span { width: 24px; height: 24px; border: 2px solid #26344a; border-top-color: var(--accent-bright); border-radius: 50%; animation: widget-spin 900ms linear infinite; }
.widget-loading-state strong { color: var(--text-soft); font-size: 0.78rem; }
.widget-loading-state small { font-size: 0.67rem; }
.widget-loading-state button { margin-top: 0.3rem; padding: 0.5rem 0.75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text); background: var(--panel-raised); cursor: pointer; }
.widget-ready .widget-loading-state { display: none; }
.widget-error .widget-loading-state > span { border: 0; animation: none; }
.widget-error .widget-loading-state > span::before { content: "!"; color: var(--warning); font-size: 1rem; font-weight: 800; }
.widget-error .tradingview-widget-container { opacity: 0.08; }
@keyframes widget-spin { to { transform: rotate(360deg); } }
.data-boundary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin-top: 0.8rem; }
.data-boundary > div { min-height: 155px; padding: 1.1rem; border: 1px solid var(--line-soft); border-radius: var(--radius); background: rgba(12, 18, 28, 0.62); }
.data-boundary h2 { margin: 0 0 0.65rem; font-size: 1rem; }
.data-boundary p:last-child { margin: 0; color: var(--muted); font-size: 0.76rem; line-height: 1.55; }

/* Terminal, portfel i ryzyko */
.risk-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.7rem; margin: 0 0 0.8rem; }
.risk-strip > div { display: grid; min-height: 82px; gap: 0.4rem; padding: 0.85rem 0.95rem; border: 1px solid var(--line-soft); border-radius: 10px; background: rgba(12, 18, 28, 0.74); }
.risk-strip span { color: var(--muted); font-size: 0.65rem; }
.risk-strip strong { align-self: end; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.positive { color: var(--positive); }
.negative { color: var(--negative); }
.trading-grid { display: grid; grid-template-columns: minmax(360px, 0.55fr) minmax(0, 1fr); gap: 0.8rem; }
.orders-panel { margin-top: 0.8rem; }
.field-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.primary-button { width: 100%; margin-top: 0.9rem; padding: 0.8rem; }
.form-message { min-height: 2.2em; margin: 0.7rem 0 0; color: var(--muted); font-size: 0.74rem; line-height: 1.5; }
.table-scroll { overflow-x: auto; scrollbar-color: #314059 #0b1019; }
table { width: 100%; border-collapse: collapse; font-size: 0.74rem; }
th, td { padding: 0.72rem 0.65rem; border-bottom: 1px solid var(--line-soft); text-align: left; white-space: nowrap; }
th { color: #7f8ca0; font-size: 0.61rem; font-weight: 750; letter-spacing: 0.07em; text-transform: uppercase; }
tbody tr { transition: background 130ms ease; }
tbody tr:not(:has(.empty-cell)):hover { background: rgba(108, 140, 255, 0.035); }
.empty-cell { height: 70px; color: var(--muted); text-align: center; }
.order-status { font-size: 0.64rem; font-weight: 800; letter-spacing: 0.05em; }
.status-filled { color: var(--positive); }
.status-open { color: var(--warning); }
.status-cancelled { color: var(--muted); }
.table-action { min-height: 30px; padding: 0.3rem 0.5rem; font-size: 0.68rem; }
.policy-list { display: grid; gap: 0.55rem; margin: 0; padding: 0; list-style: none; }
.policy-list li { padding: 0.72rem 0.8rem; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); color: var(--muted-strong); background: #0a0f18; font-size: 0.73rem; line-height: 1.5; }

/* Sygnały i analiza AI */
.filter-bar { display: grid; grid-template-columns: minmax(180px, 0.7fr) minmax(150px, 0.25fr) auto; gap: 0.75rem; align-items: end; padding: 1rem; border: 1px solid var(--line-soft); border-radius: var(--radius); background: rgba(14, 20, 32, 0.87); }
.result-count { color: var(--muted); font-size: 0.68rem; }
.event-list { display: grid; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.event-item,
.event-empty { display: flex; min-height: 52px; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem 0.85rem; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); background: #090e17; }
.event-item strong { overflow: hidden; font-size: 0.75rem; text-overflow: ellipsis; white-space: nowrap; }
.event-item time,
.event-empty { color: var(--muted); font-size: 0.7rem; }
.detailed-event-list .event-item div { min-width: 0; }
.detailed-event-list .event-item p { max-width: 900px; margin: 0.3rem 0 0; overflow: hidden; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.64rem; text-overflow: ellipsis; white-space: nowrap; }
.ai-form { display: grid; grid-template-columns: minmax(160px, 0.35fr) minmax(140px, 0.25fr) minmax(280px, 1fr); gap: 0.8rem; align-items: end; }
.ai-form textarea { min-height: 44px; resize: vertical; }
.ai-focus { grid-row: span 2; }
.ai-submit { grid-column: 1 / 3; margin-top: 0; }
.ai-result { margin-top: 1rem; padding: 1.1rem; border: 1px solid var(--line-soft); border-radius: var(--radius); background: #090e17; }
.ai-result-header { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.ai-result-header > div { display: grid; gap: 0.35rem; padding: 0.8rem; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); background: var(--panel); }
.ai-result-header span { color: var(--muted); font-size: 0.66rem; }
.ai-result-header strong { font-size: 0.82rem; }
.bias-bullish { color: var(--positive); }
.bias-bearish { color: var(--negative); }
.bias-neutral { color: #77b8ff; }
.bias-uncertain { color: var(--warning); }
.ai-summary { margin: 1.1rem 0; color: var(--text-soft); font-size: 0.94rem; line-height: 1.65; }
.ai-result-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.7rem; }
.ai-result-grid section { padding: 0.9rem; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); }
.ai-result h3 { margin: 0 0 0.65rem; font-size: 0.82rem; }
.ai-result ul { margin: 0; padding-left: 1.1rem; color: var(--muted); font-size: 0.76rem; line-height: 1.6; }
.ai-scenarios { margin-top: 0.75rem; }
#ai-scenario-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
#ai-scenario-list article { padding: 0.8rem; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); background: var(--bg-soft); }
#ai-scenario-list h4 { margin: 0 0 0.55rem; }
#ai-scenario-list p { margin: 0.3rem 0; color: var(--muted); font-size: 0.7rem; line-height: 1.5; }
.ai-disclaimer { margin: 0.9rem 0 0; color: #6e7b8f; font-size: 0.68rem; }
.security-note { display: grid; grid-template-columns: minmax(140px, 0.25fr) 1fr; gap: 1rem; margin-top: 0.8rem; padding: 0.9rem 1rem; border: 1px solid rgba(108, 140, 255, 0.15); border-radius: var(--radius); color: var(--muted); background: rgba(108, 140, 255, 0.06); }
.security-note strong { color: var(--text-soft); font-size: 0.76rem; }
.security-note p { margin: 0; font-size: 0.73rem; line-height: 1.55; }

/* Integracje i administracja */
.integration-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.integration-card { display: grid; min-height: 190px; padding: 1.05rem; border: 1px solid var(--line-soft); border-radius: var(--radius); background: linear-gradient(145deg, rgba(18, 26, 40, 0.9), rgba(11, 17, 27, 0.86)); }
.integration-card > div { display: flex; align-items: center; justify-content: space-between; }
.integration-icon { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid rgba(108, 140, 255, 0.25); border-radius: 10px; color: var(--accent-bright); background: var(--accent-soft); font-size: 0.65rem; font-weight: 800; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #596476; }
.status-dot.status-ready { background: var(--positive); box-shadow: 0 0 12px rgba(45, 212, 191, 0.55); }
.status-dot.status-waiting { background: var(--warning); }
.integration-card h2 { align-self: end; margin: 1.2rem 0 0.35rem; font-size: 1rem; }
.integration-card p { margin: 0; color: var(--muted); font-size: 0.72rem; line-height: 1.5; }
.integration-card > strong { margin-top: 0.7rem; color: #91e9dc; font-size: 0.67rem; }
.broker-control-panel { margin-top: 0.9rem; overflow: hidden; }
.broker-control-panel > .section-heading { padding: 1rem; }
.broker-control-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.broker-candidate-alert,
.mt5-readiness-card { min-height: 190px; padding: 1rem; background: #0a1019; }
.broker-candidate-alert { border-right: 1px solid var(--line-soft); }
.broker-candidate-alert > span,
.mt5-readiness-card > div > span { color: var(--muted); font-size: 0.58rem; font-weight: 800; letter-spacing: 0.12em; }
.broker-candidate-alert h3 { margin: 0.55rem 0 0.35rem; font-size: 1.25rem; }
.broker-candidate-alert > strong { color: var(--warning); font-size: 0.72rem; }
.broker-candidate-alert.is-blocked { background: linear-gradient(135deg, rgba(251, 113, 133, 0.09), #0a1019 58%); }
.broker-candidate-alert.is-blocked > strong { color: #ff9aaa; }
.broker-candidate-alert.is-restricted { background: linear-gradient(135deg, rgba(244, 193, 93, 0.09), #0a1019 58%); }
.broker-candidate-alert.is-restricted > strong { color: #f1cf83; }
.broker-candidate-alert p,
.mt5-readiness-card p { max-width: 680px; margin: 0.75rem 0 0; color: var(--muted-strong); font-size: 0.72rem; line-height: 1.55; }
.broker-source-links { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 0.9rem; }
.broker-source-links a { color: var(--accent-bright); font-size: 0.66rem; text-underline-offset: 3px; }
.mt5-readiness-card > div { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.mt5-readiness-card > div > strong { color: var(--warning); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.68rem; }
.mt5-readiness-card dl,
.decision-execution-panel dl { display: grid; grid-template-columns: repeat(2, 1fr); margin: 1rem 0 0; border: 1px solid var(--line-soft); }
.mt5-readiness-card dl div,
.decision-execution-panel dl div { display: grid; gap: 0.2rem; padding: 0.6rem; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.mt5-readiness-card dl div:nth-child(2n),
.decision-execution-panel dl div:nth-child(2n) { border-right: 0; }
.mt5-readiness-card dt,
.decision-execution-panel dt { color: var(--muted); font-size: 0.55rem; }
.mt5-readiness-card dd,
.decision-execution-panel dd { margin: 0; color: var(--text-soft); font-size: 0.65rem; }
.external-terminal-card { display: grid; grid-column: 1 / -1; grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr); gap: 1.25rem; padding: 1rem; border-top: 1px solid var(--line-soft); background: linear-gradient(120deg, rgba(108, 140, 255, 0.08), #0a1019 52%); }
.external-terminal-card h3 { margin: 0; font-size: 1.1rem; }
.external-terminal-copy > p:not(.eyebrow) { max-width: 760px; margin: 0.55rem 0 0; color: var(--muted-strong); font-size: 0.72rem; line-height: 1.55; }
.external-terminal-status { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.85rem; }
.external-terminal-status span { padding: 0.42rem 0.55rem; border: 1px solid var(--line-soft); border-radius: 3px; color: var(--muted); background: rgba(6, 10, 17, 0.72); font-size: 0.55rem; letter-spacing: 0.06em; }
.external-terminal-status strong { margin-left: 0.25rem; color: #f1cf83; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.external-terminal-actions { display: grid; align-content: center; gap: 0.5rem; }
.external-terminal-actions .primary-link,
.external-terminal-actions .secondary-link { width: 100%; }
.external-terminal-actions p { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.61rem; line-height: 1.5; }
.external-terminal-actions p strong { color: var(--muted-strong); }
.broker-tv-gateway-card { border-top-color: rgba(108, 140, 255, 0.2); background: linear-gradient(120deg, rgba(41, 190, 176, 0.07), #0a1019 52%); }
.broker-tv-gateway-card .external-terminal-status strong { color: #91e9dc; }
.broker-review-form { padding: 1rem; }
.broker-review-form > .section-heading { margin-bottom: 0.35rem; }
.form-help { margin: 0 0 1rem; color: var(--muted); font-size: 0.72rem; line-height: 1.5; }
.broker-review-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.broker-review-fields label { display: grid; gap: 0.4rem; color: var(--muted-strong); font-size: 0.68rem; }
.broker-review-fields input,
.broker-review-fields select { width: 100%; min-height: 40px; padding: 0.55rem 0.65rem; border: 1px solid #263246; border-radius: var(--radius-sm); color: var(--text); background: #090e17; }
.broker-checks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.55rem 1rem; margin: 1rem 0; padding: 0.85rem; border: 1px solid var(--line-soft); }
.broker-checks legend { padding: 0 0.35rem; color: var(--muted-strong); font-size: 0.68rem; }
.broker-checks label { display: flex; align-items: flex-start; gap: 0.5rem; color: var(--muted-strong); font-size: 0.67rem; line-height: 1.4; }
.broker-checks input { margin-top: 0.08rem; accent-color: var(--accent); }
.broker-review-result { margin-top: 0.8rem; padding: 0.75rem; border: 1px solid var(--line-soft); background: #0a1019; }
.broker-review-result strong { color: var(--text-soft); font-size: 0.72rem; }
.broker-review-result p { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.68rem; line-height: 1.5; }
.broker-review-result.is-blocked { border-color: rgba(251, 113, 133, 0.28); }
.broker-review-result.is-blocked strong { color: #ff9aaa; }
.broker-review-result.is-ready { border-color: rgba(45, 212, 191, 0.28); }
.broker-review-result.is-ready strong { color: #91e9dc; }
.contract-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem; }
.contract-grid p { display: grid; gap: 0.4rem; margin: 0; padding: 0.8rem; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); background: #090e17; }
.contract-grid strong { font-size: 0.72rem; }
.contract-grid span { color: var(--muted); font-size: 0.67rem; line-height: 1.5; }
.runtime-error { padding: 0.8rem 1rem; border: 1px solid rgba(251, 113, 133, 0.25); border-radius: var(--radius-sm); color: #ffb3bf; background: rgba(251, 113, 133, 0.08); }

/* Creator Hub */
.creator-titlebar { margin-bottom: 0.45rem; }
.creator-command-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 0.45rem; border: 1px solid #1d2838; background: #0a1019; }
.creator-command-strip > div { display: grid; min-height: 58px; align-content: center; gap: 0.12rem; padding: 0.5rem 0.7rem; border-right: 1px solid #1d2838; }
.creator-command-strip > div:last-child { border-right: 0; }
.creator-command-strip span { color: #7d8ca1; font-size: 0.49rem; }
.creator-command-strip strong { color: #bec9d8; font-size: 0.62rem; }
.creator-command-strip strong.is-ready { color: #83dccf; }
.creator-command-strip small { color: #7a899e; font-size: 0.47rem; }
.creator-workstation { display: grid; grid-template-columns: minmax(680px, 1fr) 300px; gap: 0.45rem; align-items: stretch; }
.creator-platform-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.45rem; padding: 0.5rem; }
.creator-platform-card { display: grid; min-width: 0; min-height: 390px; grid-template-rows: auto auto auto 1fr auto; gap: 0.65rem; padding: 0.7rem; border: 1px solid #202d40; background: #0a1019; }
.creator-platform-card > header { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.5rem; }
.creator-platform-mark { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid #33435d; color: #aebeff; background: #111a2b; font-size: 0.58rem; font-weight: 800; }
.youtube-mark { border-color: rgba(251, 113, 133, 0.35); color: #ff9cac; }
.tiktok-mark { border-color: rgba(45, 212, 191, 0.3); color: #85ddd0; }
.x-mark { border-color: rgba(200, 211, 226, 0.3); color: #d4dce7; }
.creator-platform-card h3 { margin: 0; font-size: 0.7rem; }
.creator-platform-card header p { margin: 0.12rem 0 0; color: #7f8da1; font-size: 0.48rem; }
.creator-connection-state { color: #d9ba73; font-size: 0.43rem; font-weight: 800; text-align: right; }
.creator-connection-state.is-connected { color: #84ddcf; }
.creator-capabilities { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.creator-capabilities span { padding: 0.22rem 0.32rem; border: 1px solid #2b3a50; color: #91a5e8; background: #0e1623; font-size: 0.4rem; font-weight: 760; }
.creator-capabilities .is-limited { border-color: rgba(244, 193, 93, 0.25); color: #d7bc7e; }
.creator-platform-card dl { margin: 0; }
.creator-platform-card dl > div { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.38rem 0; border-top: 1px solid #1c2838; }
.creator-platform-card dt { color: #75849a; font-size: 0.48rem; }
.creator-platform-card dd { overflow: hidden; margin: 0; color: #abb7c8; font-size: 0.48rem; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.creator-platform-note { margin: 0; color: #8c9aae; font-size: 0.53rem; line-height: 1.55; }
.creator-platform-actions { display: flex; gap: 0.35rem; }
.creator-platform-actions button { min-height: 34px; margin: 0; font-size: 0.53rem; }
.creator-platform-actions .primary-button { flex: 1; }
.creator-platform-actions .quiet-button { border: 1px solid #334157; }
.creator-readiness { min-width: 0; }
.creator-preflight-list { margin: 0; padding: 0; list-style: none; }
.creator-preflight-list li { display: grid; min-height: 64px; grid-template-columns: 30px 1fr; align-items: center; gap: 0.45rem; padding: 0.5rem 0.7rem; border-bottom: 1px solid #1b2635; }
.creator-preflight-list li > span { display: grid; width: 26px; height: 26px; place-items: center; border: 1px solid #334157; color: #8391a6; font-size: 0.45rem; }
.creator-preflight-list li.is-ready > span { border-color: rgba(45, 212, 191, 0.35); color: #80dacc; }
.creator-preflight-list p { display: grid; gap: 0.15rem; margin: 0; }
.creator-preflight-list strong { color: #aeb9c9; font-size: 0.56rem; }
.creator-preflight-list small { color: #7d8ca1; font-size: 0.48rem; line-height: 1.4; }
.creator-safety-card { display: grid; gap: 0.35rem; margin: 0.7rem; padding: 0.7rem; border: 1px solid rgba(244, 193, 93, 0.22); background: rgba(244, 193, 93, 0.04); }
.creator-safety-card span { color: #b49659; font-size: 0.43rem; font-weight: 800; letter-spacing: 0.08em; }
.creator-safety-card strong { color: #d2bb86; font-size: 0.57rem; }
.creator-safety-card p { margin: 0; color: #9d937e; font-size: 0.5rem; line-height: 1.5; }
.creator-message { min-height: 2rem; margin: 0.7rem; color: #8392a7; font-size: 0.51rem; line-height: 1.5; }
.creator-message.is-error { color: #f3a1ae; }
.creator-runbook { margin-top: 0.45rem; }
.creator-runbook-flow { display: grid; grid-template-columns: auto 1fr auto 1fr auto 1fr auto 1fr auto; align-items: center; gap: 0.55rem; padding: 0.7rem; }
.creator-runbook-flow > div { display: flex; align-items: center; gap: 0.4rem; }
.creator-runbook-flow b { display: grid; width: 24px; height: 24px; place-items: center; border: 1px solid #34435b; color: #91a4e7; font-size: 0.43rem; }
.creator-runbook-flow span { display: grid; gap: 0.1rem; }
.creator-runbook-flow strong { color: #acb7c8; font-size: 0.56rem; }
.creator-runbook-flow small { color: #78879c; font-size: 0.45rem; }
.creator-runbook-flow i { height: 1px; background: #2a374a; }

@media (max-width: 1120px) {
  .creator-workstation { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .creator-platform-grid { grid-template-columns: 1fr; }
  .creator-platform-card { min-height: 0; }
  .creator-command-strip { grid-template-columns: repeat(2, 1fr); }
  .creator-command-strip > div:nth-child(2) { border-right: 0; }
  .creator-command-strip > div:nth-child(-n+2) { border-bottom: 1px solid #1d2838; }
  .creator-runbook-flow { grid-template-columns: 1fr; }
  .creator-runbook-flow i { width: 1px; height: 14px; margin-left: 12px; }
}

@media (max-width: 520px) {
  .creator-command-strip { grid-template-columns: 1fr; }
  .creator-command-strip > div { border-right: 0; border-bottom: 1px solid #1d2838; }
  .creator-command-strip > div:last-child { border-bottom: 0; }
}
.admin-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.admin-heading h1 { max-width: none; margin: 0; font-size: clamp(2.2rem, 4vw, 3.8rem); letter-spacing: -0.05em; }
.admin-table { width: 100%; }
.account-actions { display: flex; align-items: flex-end; gap: 0.5rem; }
.account-status { font-size: 0.66rem; font-weight: 800; }
.status-pending { color: var(--warning); }
.status-approved { color: #77b8ff; }
.status-active { color: var(--positive); }
.status-rejected { color: var(--negative); }
.approve-action { color: #a7f3e7; border-color: rgba(45, 212, 191, 0.25); }
.reject-action { color: #ffb3bf; border-color: rgba(251, 113, 133, 0.25); }
.approval-form { display: flex; align-items: flex-end; gap: 0.5rem; }
.approval-form select { min-height: 32px; padding: 0.3rem 0.45rem; }
.panel-copy { max-width: 720px; margin: 0 0 1.2rem; color: var(--muted); line-height: 1.6; }
.mobile-nav,
.sidebar-backdrop { display: none; }

@media (max-width: 1180px) {
  .account-menu > span:nth-child(2) { display: none; }
  .metric-grid,
  .quick-module-grid { grid-template-columns: repeat(2, 1fr); }
  .integration-grid { grid-template-columns: repeat(2, 1fr); }
  .contract-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-workspace { grid-column: 1; }
  .app-sidebar { transform: translateX(-105%); transition: transform 180ms ease; box-shadow: 28px 0 70px rgba(0, 0, 0, 0.48); }
  .app-sidebar.is-open { transform: translateX(0); }
  .app-topbar { min-height: 68px; grid-template-columns: auto 1fr auto; padding: 0 0.9rem; }
  .menu-toggle { display: inline-grid; }
  .system-pulse { display: none; }
  .app-main { min-height: calc(100vh - 68px); padding: 1.35rem 1.1rem calc(6.6rem + env(safe-area-inset-bottom)); }
  .sidebar-backdrop { position: fixed; z-index: 35; inset: 0; display: block; background: rgba(0, 0, 0, 0.64); backdrop-filter: blur(3px); }
  .sidebar-backdrop[hidden] { display: none; }
  .mobile-nav {
    position: fixed;
    z-index: 32;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 0.35rem 0 max(0.35rem, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(8, 12, 20, 0.95);
    box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(20px) saturate(1.25);
  }
  .mobile-nav-link,
  .mobile-more { display: grid; min-height: 56px; place-content: center; justify-items: center; gap: 0.3rem; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 0.6rem; text-decoration: none; cursor: pointer; }
  .mobile-nav-link .nav-icon,
  .mobile-more .nav-icon { width: 19px; height: 19px; }
  .mobile-nav-link strong,
  .mobile-more strong { font-size: 0.59rem; font-weight: 650; }
  .mobile-nav-link.is-active { color: var(--accent-bright); background: rgba(108, 140, 255, 0.08); }
  .mobile-nav-link.is-active .nav-icon { color: var(--accent-bright); }
  body.nav-open { overflow: hidden; }
  .auth-layout { grid-template-columns: minmax(0, 1fr); }
  .auth-brand-panel { display: none; }
  .auth-shell { position: relative; min-height: 100vh; place-items: center; padding: 6.5rem 1.5rem 3rem; }
  .auth-shell::before { position: absolute; inset: 0; content: ""; opacity: 0.16; background-image: linear-gradient(rgba(133, 151, 180, 0.12) 1px, transparent 1px), linear-gradient(90deg, rgba(133, 151, 180, 0.12) 1px, transparent 1px); background-size: 52px 52px; mask-image: linear-gradient(to bottom, #000, transparent 45%); }
  .auth-shell > * { position: relative; z-index: 1; }
  .auth-mobile-brand { position: absolute; top: 1.5rem; left: 1.5rem; display: inline-flex; }
}

@media (max-width: 760px) {
  body { font-size: 14px; }
  .page-header { align-items: flex-start; flex-direction: column; gap: 1rem; margin-bottom: 1.15rem; }
  .page-header h1,
  .compact-page-header h1 { font-size: clamp(2.05rem, 10.5vw, 3.1rem); line-height: 1.02; }
  .page-header .lede { font-size: 0.88rem; }
  .page-header-actions { width: 100%; }
  .page-header-actions a { flex: 1; }
  .metric-grid,
  .quick-module-grid,
  .integration-grid,
  .contract-grid,
  .data-boundary { grid-template-columns: 1fr; }
  .metric-card { min-height: 112px; }
  .dashboard-columns,
  .market-grid,
  .trading-grid { grid-template-columns: 1fr; }
  .market-card-wide { grid-row: auto; }
  .risk-strip { grid-template-columns: repeat(2, 1fr); }
  .field-grid,
  .ai-form,
  .filter-bar { grid-template-columns: 1fr; }
  .ai-focus { grid-row: auto; }
  .ai-submit { grid-column: auto; }
  .ai-result-header,
  .ai-result-grid,
  #ai-scenario-list { grid-template-columns: 1fr; }
  .security-note { grid-template-columns: 1fr; }
  .data-quality-badge { width: 100%; }
  .account-menu { padding-left: 0.35rem; }
  .account-menu .quiet-button { min-height: 32px; padding: 0.45rem 0.55rem; font-size: 0.64rem; }
  .account-avatar { display: none; }
  .page-context p { display: none; }
  .widget-chart { height: 520px; min-height: 440px; }
  .widget-analysis { height: 390px; }
  .event-item { align-items: flex-start; flex-direction: column; }
  .orders-panel table,
  .admin-table table { min-width: 720px; }
  .trading-controls { width: 100%; justify-content: space-between; }
  .admin-heading { align-items: flex-start; flex-direction: column; }
  .approval-form { align-items: stretch; flex-direction: column; }
}

@media (max-width: 480px) {
  .app-main { padding-right: 0.85rem; padding-left: 0.85rem; }
  .risk-strip { gap: 0.5rem; }
  .risk-strip > div { min-height: 76px; padding: 0.75rem; }
  .workspace-panel,
  .market-card,
  .signal-panel,
  .ai-panel,
  .order-ticket,
  .positions-panel,
  .orders-panel { padding: 0.9rem; }
  .auth-shell { padding-right: 1.15rem; padding-left: 1.15rem; }
  .auth-shell h1 { font-size: 2.45rem; }
  .auth-form-copy { padding: 1.25rem; border: 1px solid var(--line-soft); border-radius: var(--radius-lg); background: rgba(14, 20, 32, 0.82); box-shadow: var(--shadow); }
}

/* AI Expert Architect */
.experts-workstation.ai-experts-workstation { grid-template-columns: 230px minmax(620px, 1fr) 330px; align-items: stretch; }
.ai-architect-console,
.ai-proposal-inspector { min-height: 760px; }
.ai-console-head { display: flex; min-height: 54px; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0 0.75rem; border-bottom: 1px solid #1b2635; background: #0d131e; }
.ai-console-head > div:first-child { display: grid; gap: 0.12rem; }
.ai-console-head > div:first-child > span { color: #7b899d; font-size: 0.48rem; font-weight: 780; letter-spacing: 0.1em; }
.ai-console-head h2 { margin: 0; font-size: 0.78rem; }
.ai-context-badges { display: flex; gap: 0.3rem; }
.ai-context-badges span { padding: 0.3rem 0.42rem; border: 1px solid #2a374b; color: #9aa8bd; background: #0a1019; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.5rem; }
.ai-context-badges .is-blocked { border-color: rgba(244, 193, 93, 0.28); color: #d7ba78; background: rgba(244, 193, 93, 0.05); }

.agent-pipeline { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; padding: 0; border-bottom: 1px solid #1b2635; list-style: none; background: #0a1019; }
.agent-pipeline li { position: relative; display: grid; min-height: 62px; grid-template-columns: 24px 1fr; align-items: center; gap: 0.45rem; padding: 0.5rem 0.65rem; border-right: 1px solid #1b2635; }
.agent-pipeline li:last-child { border-right: 0; }
.agent-pipeline b { display: grid; width: 22px; height: 22px; place-items: center; border: 1px solid #2b394d; color: #7b899d; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.46rem; }
.agent-pipeline span { display: grid; gap: 0.12rem; }
.agent-pipeline strong { color: #9da9ba; font-size: 0.56rem; }
.agent-pipeline small { color: #77869a; font-size: 0.47rem; }
.agent-pipeline i { position: absolute; right: -5px; z-index: 1; width: 9px; height: 9px; border-top: 1px solid #2a374b; border-right: 1px solid #2a374b; background: #0a1019; transform: rotate(45deg); }
.agent-pipeline li.is-running { background: rgba(108, 140, 255, 0.08); box-shadow: inset 0 -2px var(--accent); }
.agent-pipeline li.is-running b { border-color: #637fe6; color: #b1c1ff; animation: expert-pulse 1.4s ease-in-out infinite; }
.agent-pipeline li.is-complete b { border-color: rgba(45, 212, 191, 0.35); color: #80dacc; background: rgba(45, 212, 191, 0.06); }
.agent-pipeline li.is-complete b::before { content: "✓"; }
.agent-pipeline li.is-complete b { font-size: 0; }
.agent-pipeline li.is-complete b::before { font-size: 0.55rem; }
.agent-pipeline li.is-blocked b { border-color: rgba(244, 193, 93, 0.35); color: #dfbf78; }
@keyframes expert-pulse { 50% { box-shadow: 0 0 0 4px rgba(108, 140, 255, 0.08); } }

.architect-composer { padding: 0.7rem; border-bottom: 1px solid #1b2635; background: linear-gradient(180deg, #0d141f, #0a1019); }
.architect-scope-row { display: grid; grid-template-columns: 1fr 0.8fr 1.25fr 1fr; gap: 0.45rem; margin-bottom: 0.5rem; }
.architect-composer label { display: grid; gap: 0.28rem; color: #7b899d; font-size: 0.52rem; font-weight: 640; }
.architect-composer select,
.architect-composer textarea { width: 100%; min-height: 33px; padding: 0.45rem 0.52rem; border: 1px solid #29364b; border-radius: 2px; outline: 0; color: #d5dce8; background: #070c14; font-size: 0.61rem; }
.architect-composer select:focus,
.architect-composer textarea:focus { border-color: #607deb; box-shadow: 0 0 0 2px rgba(96, 125, 235, 0.11); }
.architect-composer textarea { min-height: 94px; resize: vertical; line-height: 1.5; }
.brief-presets { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.45rem; }
.brief-presets button { min-height: 25px; padding: 0.3rem 0.48rem; border: 1px solid #2a374b; border-radius: 2px; color: #93a2b8; background: #111927; font-size: 0.5rem; cursor: pointer; }
.brief-presets button:hover { border-color: #4d64b6; color: #bdc9ed; }
.architect-submit-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: 0.55rem; }
.architect-submit-row p { margin: 0; color: #7b899d; font-size: 0.53rem; line-height: 1.45; }
.architect-submit-row p.is-error { color: #f09cac; }
.architect-submit-row button { min-width: 170px; min-height: 34px; border-radius: 2px; font-size: 0.58rem; }

.agent-run-output { min-height: 260px; padding: 0.65rem; background: #080d15; }
.agent-run-empty { display: grid; min-height: 225px; grid-template-columns: 38px minmax(0, 1fr); align-content: center; align-items: center; gap: 0.75rem; max-width: 520px; margin: 0 auto; }
.agent-run-empty > span { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid #354a79; color: #a6b8f7; background: #111a2b; font-size: 0.58rem; font-weight: 800; }
.agent-run-empty strong { font-size: 0.65rem; }
.agent-run-empty p { margin: 0.25rem 0 0; color: #7b899d; font-size: 0.55rem; line-height: 1.5; }
.agent-run-report { display: grid; gap: 0.5rem; }
.agent-report-card { padding: 0.65rem; border: 1px solid #202d40; background: #0c131e; }
.agent-report-card > span { color: #7891e6; font-size: 0.45rem; font-weight: 780; letter-spacing: 0.09em; }
.agent-report-card h3 { margin: 0.3rem 0 0; font-size: 0.72rem; }
.agent-report-card > p { margin: 0.35rem 0 0; color: #a0adbf; font-size: 0.57rem; line-height: 1.5; }
.agent-logic-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; margin-top: 0.55rem; }
.agent-logic-grid section { padding: 0.5rem; border: 1px solid #1d2939; background: #090f18; }
.agent-logic-grid h4 { margin: 0 0 0.35rem; color: #93a3ba; font-size: 0.54rem; }
.agent-logic-grid ul { display: grid; gap: 0.28rem; margin: 0; padding-left: 1rem; color: #8493a8; font-size: 0.52rem; line-height: 1.45; }

.manual-dsl-editor { margin: 0.65rem; border: 1px solid #202d40; background: #090f18; }
.manual-dsl-editor > summary { display: grid; min-height: 44px; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.55rem; padding: 0 0.65rem; color: #aab5c5; cursor: pointer; list-style: none; }
.manual-dsl-editor > summary::-webkit-details-marker { display: none; }
.manual-dsl-editor > summary > span { color: #778fe2; font-size: 0.45rem; font-weight: 780; letter-spacing: 0.09em; }
.manual-dsl-editor > summary strong { font-size: 0.58rem; }
.manual-dsl-editor > summary small { color: #7b899d; font-size: 0.48rem; }
.manual-dsl-editor[open] > summary { border-bottom: 1px solid #1b2635; }
.manual-dsl-editor .expert-builder-head { border-top: 0; }

.ai-proposal-inspector { min-width: 0; }
.proposal-section { padding: 0.65rem; border-bottom: 1px solid #1b2635; }
.proposal-section > span { display: block; margin-bottom: 0.45rem; color: #7289d8; font-size: 0.45rem; font-weight: 780; letter-spacing: 0.09em; }
.proposal-plan { margin: 0; }
.proposal-plan > div { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.35rem 0; border-top: 1px solid #192333; }
.proposal-plan > div:first-child { border-top: 0; }
.proposal-plan dt { color: #7b899d; font-size: 0.49rem; }
.proposal-plan dd { overflow: hidden; max-width: 190px; margin: 0; color: #aab5c5; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.48rem; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.audit-verdict { display: grid; gap: 0.14rem; padding: 0.5rem; border: 1px solid #2b394d; background: #0c131e; }
.audit-verdict strong { color: #aab5c5; font-size: 0.58rem; }
.audit-verdict small { color: #7b899d; font-size: 0.49rem; line-height: 1.4; }
.audit-verdict.verdict-approve { border-color: rgba(45, 212, 191, 0.3); background: rgba(45, 212, 191, 0.04); }
.audit-verdict.verdict-approve strong { color: #8bdfd2; }
.audit-verdict.verdict-revise,
.audit-verdict.verdict-reject { border-color: rgba(244, 193, 93, 0.3); background: rgba(244, 193, 93, 0.04); }
.proposal-list { display: grid; max-height: 135px; gap: 0.28rem; margin: 0.45rem 0 0; padding-left: 1rem; overflow-y: auto; color: #8c9aae; font-size: 0.49rem; line-height: 1.45; }
.proposal-diff { display: grid; max-height: 160px; gap: 0.3rem; overflow-y: auto; }
.proposal-diff > p { margin: 0; color: #7b899d; font-size: 0.5rem; line-height: 1.45; }
.proposal-diff > div { display: grid; grid-template-columns: auto 1fr; gap: 0.12rem 0.4rem; padding: 0.38rem; border: 1px solid #1e2a3a; background: #090f18; }
.proposal-diff span { align-self: start; padding: 0.15rem 0.25rem; border: 1px solid #33425a; color: #9aabc2; font-size: 0.4rem; }
.proposal-diff .diff-added { border-color: rgba(45, 212, 191, 0.3); color: #83d7ca; }
.proposal-diff .diff-changed { border-color: rgba(244, 193, 93, 0.3); color: #d6b975; }
.proposal-diff strong { min-width: 0; overflow: hidden; color: #aeb9c9; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.47rem; text-overflow: ellipsis; white-space: nowrap; }
.proposal-diff small { grid-column: 2; overflow-wrap: anywhere; color: #77869a; font-size: 0.43rem; line-height: 1.4; }
.proposal-approval { position: sticky; bottom: 0; z-index: 2; padding: 0.7rem; border-top: 1px solid #2a374b; background: rgba(9, 15, 24, 0.97); box-shadow: 0 -12px 24px rgba(0, 0, 0, 0.18); }
.proposal-approval > div { display: grid; gap: 0.12rem; margin-bottom: 0.5rem; }
.proposal-approval > div span { color: #7289d8; font-size: 0.44rem; font-weight: 780; letter-spacing: 0.09em; }
.proposal-approval > div strong { color: #bdc7d7; font-size: 0.58rem; }
.proposal-approval > div small { color: #7b899d; font-size: 0.48rem; }
.approval-confirm { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 0.4rem; margin-bottom: 0.5rem; color: #92a0b4; font-size: 0.49rem; line-height: 1.4; cursor: pointer; }
.approval-confirm input { margin: 0.1rem 0 0; accent-color: var(--accent); }
.proposal-approval button { width: 100%; min-height: 34px; border-radius: 2px; font-size: 0.57rem; }
.proposal-approval button:disabled { opacity: 0.42; cursor: not-allowed; }
.proposal-approval > p { min-height: 1rem; margin: 0.4rem 0 0; color: #7b899d; font-size: 0.48rem; line-height: 1.4; }
.compact-readiness { border-top: 1px solid #1b2635; }
.compact-readiness li { min-height: 44px; }
.expert-channel-control { display: grid; gap: 0.42rem; }
.expert-channel-control label { color: #8795a9; font-size: 0.5rem; }
.expert-channel-control select { width: 100%; min-height: 33px; padding: 0.35rem 0.45rem; border: 1px solid #29364a; border-radius: 2px; color: #d0d7e2; background: #080d15; font-size: 0.55rem; }
.expert-channel-control button { width: 100%; min-height: 33px; font-size: 0.55rem; }
.expert-channel-control p { margin: 0; color: #7b899d; font-size: 0.49rem; line-height: 1.45; }

@media (max-width: 1240px) and (min-width: 981px) {
  .experts-workstation.ai-experts-workstation { grid-template-columns: 205px minmax(560px, 1fr) 285px; }
  .architect-scope-row { grid-template-columns: repeat(2, 1fr); }
  .proposal-plan dd { max-width: 145px; }
}

@media (max-width: 980px) {
  .experts-workstation.ai-experts-workstation { grid-template-columns: 205px minmax(540px, 1fr); }
  .ai-proposal-inspector { grid-column: 1 / 3; min-height: 0; }
  .proposal-approval { position: static; }
}

@media (max-width: 760px) {
  .experts-workstation.ai-experts-workstation { grid-template-columns: 1fr; }
  .ai-architect-console { min-height: 0; order: 1; }
  .ai-experts-workstation .expert-library { order: 2; }
  .ai-proposal-inspector { grid-column: auto; min-height: 0; order: 3; }
  .agent-pipeline { grid-template-columns: repeat(2, 1fr); }
  .agent-pipeline li:nth-child(2) { border-right: 0; }
  .agent-pipeline li:nth-child(-n+2) { border-bottom: 1px solid #1b2635; }
  .agent-pipeline i { display: none; }
  .architect-scope-row { grid-template-columns: repeat(2, 1fr); }
  .architect-submit-row { align-items: stretch; flex-direction: column; }
  .architect-submit-row button { width: 100%; }
  .agent-logic-grid { grid-template-columns: 1fr; }
  .manual-dsl-editor > summary { grid-template-columns: auto 1fr; }
  .manual-dsl-editor > summary small { display: none; }
}

@media (max-width: 480px) {
  .ai-console-head { align-items: flex-start; flex-direction: column; padding: 0.55rem; }
  .ai-context-badges { width: 100%; }
  .ai-context-badges span { flex: 1; text-align: center; }
  .architect-scope-row { grid-template-columns: 1fr; }
  .agent-pipeline strong { font-size: 0.52rem; }
  .agent-pipeline small { font-size: 0.44rem; }
  .architect-composer,
  .agent-run-output { padding: 0.5rem; }
  .manual-dsl-editor { margin: 0.5rem; }
}

/* Expert Studio */
.expert-titlebar { margin-bottom: 0.45rem; }
.expert-statusbar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 0.45rem;
  border: 1px solid #1d2838;
  border-radius: 4px;
  overflow: hidden;
  background: #0a1019;
}
.expert-statusbar > div { display: grid; min-height: 54px; align-content: center; gap: 0.12rem; padding: 0.45rem 0.7rem; border-right: 1px solid #1d2838; }
.expert-statusbar > div:last-child { border-right: 0; }
.expert-statusbar span { color: #657389; font-size: 0.51rem; }
.expert-statusbar strong { font-size: 0.67rem; letter-spacing: 0.025em; }
.expert-statusbar small { color: #67758a; font-size: 0.5rem; }
.expert-statusbar .status-warning { color: #d7ba78; }

.experts-workstation { display: grid; grid-template-columns: 238px minmax(520px, 1fr) 270px; gap: 0.45rem; align-items: start; }
.expert-library,
.expert-inspector { min-height: 706px; }
.expert-filters { display: flex; gap: 0.15rem; padding: 0.5rem; border-bottom: 1px solid #1b2635; }
.expert-filters button { min-height: 25px; padding: 0.3rem 0.48rem; border: 1px solid transparent; border-radius: 2px; color: #6f7d92; background: transparent; font-size: 0.54rem; cursor: pointer; }
.expert-filters button.is-active { border-color: #28364d; color: #d1d8e6; background: #151e2d; }
.expert-list { display: grid; max-height: 572px; overflow-y: auto; }
.expert-list-empty { display: grid; min-height: 160px; align-content: center; gap: 0.35rem; padding: 1rem; text-align: center; }
.expert-list-empty strong { color: #aab4c4; font-size: 0.66rem; }
.expert-list-empty p { margin: 0; color: #6e7c90; font-size: 0.57rem; line-height: 1.5; }
.expert-list-item { display: grid; min-height: 78px; gap: 0.3rem; padding: 0.65rem; border: 0; border-bottom: 1px solid #182231; color: var(--text-soft); background: transparent; text-align: left; cursor: pointer; }
.expert-list-item:hover { background: #0f1723; }
.expert-list-item.is-active { box-shadow: inset 2px 0 var(--accent); background: rgba(108, 140, 255, 0.08); }
.expert-list-item > span { display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
.expert-list-item strong { overflow: hidden; font-size: 0.65rem; text-overflow: ellipsis; white-space: nowrap; }
.expert-list-item b { color: #9aa7b9; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.56rem; font-weight: 650; }
.expert-list-item small { color: #8996aa; font-size: 0.51rem; }
.expert-state-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #66758a; }
.expert-state-validated { background: var(--positive); box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.08); }
.expert-state-draft { background: var(--warning); }
.expert-state-paused,
.expert-state-archived { background: #6c7889; }
.expert-library-cta { width: calc(100% - 1rem); min-height: 32px; margin: 0.5rem; border: 1px dashed #33425a; color: #90a5ed; background: #0d141f; font-size: 0.58rem; cursor: pointer; }

.expert-builder { min-height: 706px; }
.expert-builder-head { display: flex; min-height: 54px; align-items: center; justify-content: space-between; padding: 0 0.75rem; border-bottom: 1px solid #1b2635; background: #0d131e; }
.expert-builder-head > div:first-child { display: grid; gap: 0.12rem; }
.expert-builder-head span { color: #65748a; font-size: 0.49rem; font-weight: 760; letter-spacing: 0.1em; }
.expert-builder-head h2 { margin: 0; font-size: 0.78rem; }
.expert-version { display: grid; justify-items: end; gap: 0.08rem; }
.expert-version strong { color: #d5bd88; font-size: 0.57rem; }
.expert-version small { color: #68768a; font-size: 0.49rem; }
.strategy-flow { display: grid; grid-template-columns: auto 1fr auto 1fr auto 1fr auto; align-items: center; gap: 0.4rem; padding: 0.55rem 0.75rem; border-bottom: 1px solid #192433; background: #0a1019; }
.strategy-flow span { display: flex; align-items: center; gap: 0.3rem; color: #718096; font-size: 0.52rem; white-space: nowrap; }
.strategy-flow b { display: grid; width: 20px; height: 20px; place-items: center; border: 1px solid #2b394e; color: #8795a9; font-size: 0.45rem; }
.strategy-flow .is-current { color: #c8d1df; }
.strategy-flow .is-current b { border-color: #5573dd; color: #aec0ff; background: rgba(85, 115, 221, 0.13); }
.strategy-flow i { height: 1px; background: #233044; }
.expert-form { padding: 0.65rem; }
.expert-fieldset { margin: 0 0 0.55rem; padding: 0.65rem; border: 1px solid #1e2a3a; background: #0b111a; }
.expert-fieldset legend { padding: 0 0.35rem; color: #aeb8c7; font-size: 0.59rem; font-weight: 680; }
.expert-fieldset legend span { color: #7188db; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.5rem; }
.expert-form-grid { display: grid; grid-template-columns: minmax(180px, 1.5fr) repeat(3, minmax(105px, 0.7fr)); gap: 0.55rem; }
.expert-form label { display: grid; min-width: 0; gap: 0.28rem; color: #718096; font-size: 0.53rem; font-weight: 630; }
.expert-form input,
.expert-form select,
.expert-form textarea { width: 100%; min-height: 32px; padding: 0.4rem 0.5rem; border: 1px solid #263247; border-radius: 2px; outline: 0; color: #d4dbe6; background: #080d15; font-size: 0.61rem; }
.expert-form textarea { resize: vertical; line-height: 1.45; }
.expert-form input:focus,
.expert-form select:focus,
.expert-form textarea:focus { border-color: #5e7ce9; box-shadow: 0 0 0 2px rgba(94, 124, 233, 0.1); }
.expert-form input:disabled { color: #68768a; background: #0b1119; }
.expert-form .expert-wide { grid-column: 1 / -1; }
.rule-group-head { display: flex; min-height: 25px; align-items: center; justify-content: space-between; margin-bottom: 0.45rem; padding: 0 0.5rem; border-left: 2px solid #5c79e4; background: #111927; }
.rule-group-head span { color: #a5b3ca; font-size: 0.49rem; font-weight: 760; letter-spacing: 0.06em; }
.rule-group-head small { color: #617087; font-size: 0.48rem; }
.visual-rule-row { display: grid; grid-template-columns: minmax(120px, 1.4fr) 66px minmax(120px, 1.15fr) minmax(90px, 0.8fr) minmax(120px, 1.4fr) 66px; gap: 0.4rem; align-items: end; padding: 0.5rem; border: 1px solid #233047; background: #0d141f; }
.visual-rule-row label > span { color: #627188; font-size: 0.48rem; }
.rule-readable { margin: 0.45rem 0 0; padding: 0.45rem 0.55rem; border: 1px dashed #29374c; color: #98a6b9; background: rgba(16, 23, 34, 0.7); font-size: 0.55rem; line-height: 1.45; }
.expert-risk-grid { display: grid; grid-template-columns: repeat(5, minmax(90px, 1fr)) minmax(150px, 1.3fr); gap: 0.45rem; align-items: end; }
.risk-boundary { display: grid; min-height: 52px; align-content: center; gap: 0.12rem; padding: 0.4rem 0.5rem; border: 1px solid rgba(45, 212, 191, 0.2); background: rgba(45, 212, 191, 0.04); }
.risk-boundary span { color: #69a89f; font-size: 0.43rem; font-weight: 780; letter-spacing: 0.08em; }
.risk-boundary strong { color: #9bc8c2; font-size: 0.54rem; }
.risk-boundary small { color: #64827f; font-size: 0.47rem; }
.expert-form-actions { display: flex; gap: 0.4rem; align-items: center; }
.expert-form-actions button { min-height: 33px; border-radius: 2px; font-size: 0.57rem; }
.expert-form-actions button:disabled { opacity: 0.42; cursor: not-allowed; }
.expert-message { min-height: 1.25rem; margin: 0.45rem 0 0; color: #748398; font-size: 0.53rem; }
.expert-message.is-error { color: #f19aaa; }

.expert-readiness-score { display: grid; grid-template-columns: 1fr auto; gap: 0.3rem; padding: 0.75rem; border-bottom: 1px solid #1b2635; }
.expert-readiness-score span { color: #65748a; font-size: 0.48rem; font-weight: 760; letter-spacing: 0.09em; }
.expert-readiness-score strong { color: #bdc8d8; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.63rem; }
.expert-readiness-score progress { width: 100%; height: 4px; grid-column: 1 / 3; border: 0; appearance: none; }
.expert-readiness-score progress::-webkit-progress-bar { background: #1a2433; }
.expert-readiness-score progress::-webkit-progress-value { background: linear-gradient(90deg, #5474ef, #7f98ff); }
.expert-readiness-score progress::-moz-progress-bar { background: linear-gradient(90deg, #5474ef, #7f98ff); }
.readiness-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.readiness-list li { display: grid; min-height: 54px; grid-template-columns: 24px 1fr; align-items: center; gap: 0.45rem; padding: 0.5rem 0.7rem; border-bottom: 1px solid #192333; }
.readiness-list li > span { display: grid; width: 22px; height: 22px; place-items: center; border: 1px solid #2b394d; color: #77869b; font-size: 0.5rem; }
.readiness-list p { display: grid; gap: 0.12rem; margin: 0; }
.readiness-list strong { color: #9da9ba; font-size: 0.57rem; }
.readiness-list small { color: #647389; font-size: 0.49rem; }
.readiness-list .is-ready > span { border-color: rgba(45, 212, 191, 0.35); color: #80dacc; background: rgba(45, 212, 191, 0.06); }
.readiness-list .is-blocked > span { border-color: rgba(244, 193, 93, 0.3); color: #dfbf78; background: rgba(244, 193, 93, 0.05); }
.expert-boundary-card { display: grid; gap: 0.35rem; margin: 0.65rem; padding: 0.65rem; border: 1px solid rgba(244, 193, 93, 0.19); background: rgba(244, 193, 93, 0.04); }
.expert-boundary-card span { color: #9b8354; font-size: 0.45rem; font-weight: 780; letter-spacing: 0.09em; }
.expert-boundary-card strong { color: #cfb77f; font-size: 0.59rem; }
.expert-boundary-card p { margin: 0; color: #807965; font-size: 0.51rem; line-height: 1.5; }
.expert-meta { margin: 0 0.65rem; }
.expert-meta > div { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.42rem 0; border-top: 1px solid #192333; }
.expert-meta dt { color: #68778c; font-size: 0.5rem; }
.expert-meta dd { overflow: hidden; margin: 0; color: #9aa7b9; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.49rem; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.expert-bottom-dock { margin-top: 0.45rem; }
.expert-runtime-grid { display: grid; grid-template-columns: repeat(5, 1fr); border-bottom: 1px solid #1b2635; background: #090f18; }
.expert-runtime-grid article { display: grid; min-width: 0; min-height: 86px; align-content: center; gap: 0.22rem; padding: 0.65rem; border-right: 1px solid #1b2635; }
.expert-runtime-grid article:last-child { border-right: 0; }
.expert-runtime-grid span { color: #7289d8; font-size: 0.44rem; font-weight: 780; letter-spacing: 0.09em; }
.expert-runtime-grid strong { overflow: hidden; color: #b9c5d5; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.61rem; text-overflow: ellipsis; white-space: nowrap; }
.expert-runtime-grid small { color: #7b899d; font-size: 0.47rem; line-height: 1.4; }
.indicator-catalog-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 34px; padding: 0.45rem 0.65rem; border-bottom: 1px solid #1b2635; }
.indicator-catalog-heading span { color: #7289d8; font-size: 0.45rem; font-weight: 780; letter-spacing: 0.09em; }
.indicator-catalog-heading small { color: #7b899d; font-size: 0.48rem; }
.indicator-catalog { display: grid; grid-template-columns: repeat(6, 1fr); }
.indicator-catalog article { display: grid; min-height: 78px; align-content: center; gap: 0.18rem; padding: 0.55rem 0.65rem; border-right: 1px solid #1b2635; }
.indicator-catalog article:last-child { border-right: 0; }
.indicator-catalog span { color: #687eac; font-size: 0.43rem; font-weight: 780; letter-spacing: 0.08em; }
.indicator-catalog h3 { margin: 0; font-size: 0.67rem; }
.indicator-catalog p { margin: 0; color: #8491a3; font-size: 0.51rem; }
.indicator-catalog small { color: #5f6e82; font-size: 0.46rem; }

/* Kontrast WCAG AA dla gęstych etykiet terminala */
.expert-statusbar span,
.expert-statusbar small,
.expert-builder-head span,
.expert-version small,
.expert-readiness-score span,
.readiness-list small,
.expert-meta dt { color: #7b899d; }
.expert-list-empty p { color: #758398; }
.rule-group-head small,
.visual-rule-row label > span { color: #7b899d; }
.risk-boundary small { color: #83a09c; }
.expert-boundary-card p { color: #a09884; }
.indicator-catalog small { color: #7a899e; }

@media (max-width: 1220px) and (min-width: 981px) {
  .experts-workstation { grid-template-columns: 205px minmax(470px, 1fr) 235px; }
  .expert-form-grid { grid-template-columns: minmax(160px, 1.5fr) repeat(2, minmax(100px, 0.7fr)); }
  .expert-form-grid > label:nth-child(4) { display: none; }
  .visual-rule-row { grid-template-columns: minmax(110px, 1.2fr) 62px minmax(110px, 1fr) minmax(85px, 0.7fr) minmax(110px, 1.2fr) 62px; }
  .expert-risk-grid { grid-template-columns: repeat(5, 1fr); }
  .risk-boundary { grid-column: 1 / -1; }
}

@media (max-width: 980px) {
  .experts-workstation { grid-template-columns: 210px minmax(500px, 1fr); }
  .expert-inspector { grid-column: 1 / 3; min-height: 0; }
  .indicator-catalog { grid-template-columns: repeat(3, 1fr); }
  .expert-runtime-grid { grid-template-columns: repeat(2, 1fr); }
  .expert-runtime-grid article:nth-child(2n) { border-right: 0; }
  .expert-runtime-grid article:last-child { grid-column: 1 / -1; border-top: 1px solid #1b2635; }
  .indicator-catalog article:nth-child(3n) { border-right: 0; }
  .indicator-catalog article:nth-child(-n+3) { border-bottom: 1px solid #1b2635; }
}

@media (max-width: 760px) {
  .expert-titlebar { align-items: center; }
  .expert-titlebar .mode-badge { display: none; }
  .expert-statusbar { grid-template-columns: repeat(2, 1fr); }
  .expert-statusbar > div:nth-child(2) { border-right: 0; }
  .expert-statusbar > div:nth-child(-n+2) { border-bottom: 1px solid #1d2838; }
  .experts-workstation { grid-template-columns: 1fr; }
  .expert-library,
  .expert-inspector { min-height: 0; }
  .expert-list { max-height: 260px; }
  .expert-builder { order: 1; }
  .expert-library { order: 2; }
  .expert-inspector { grid-column: auto; order: 3; }
  .expert-form-grid { grid-template-columns: repeat(2, 1fr); }
  .expert-form-grid .expert-wide { grid-column: 1 / -1; }
  .visual-rule-row { grid-template-columns: minmax(120px, 1fr) 70px; }
  .operator-field { grid-column: 1 / 3; }
  .expert-risk-grid { grid-template-columns: repeat(2, 1fr); }
  .risk-boundary { grid-column: 1 / 3; }
  .expert-form-actions { display: grid; grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .expert-titlebar .workspace-title-actions { margin-left: auto; }
  .expert-titlebar .primary-button { padding: 0.4rem 0.55rem; }
  .strategy-flow { grid-template-columns: repeat(4, 1fr); gap: 0.25rem; }
  .strategy-flow i { display: none; }
  .strategy-flow span { display: grid; justify-items: center; gap: 0.2rem; font-size: 0.47rem; }
  .expert-form-grid { grid-template-columns: 1fr; }
  .expert-runtime-grid { grid-template-columns: 1fr; }
  .expert-runtime-grid article,
  .expert-runtime-grid article:last-child { grid-column: auto; border-right: 0; border-bottom: 1px solid #1b2635; }
  .indicator-catalog-heading { align-items: flex-start; flex-direction: column; gap: 0.2rem; }
  .expert-form-grid .expert-wide { grid-column: auto; }
  .visual-rule-row { grid-template-columns: minmax(0, 1fr) 64px; }
  .expert-risk-grid { grid-template-columns: repeat(2, 1fr); }
  .risk-boundary { grid-column: 1 / 3; }
  .indicator-catalog { grid-template-columns: repeat(2, 1fr); }
  .indicator-catalog article:nth-child(3n) { border-right: 1px solid #1b2635; }
  .indicator-catalog article:nth-child(2n) { border-right: 0; }
  .indicator-catalog article:nth-child(-n+4) { border-bottom: 1px solid #1b2635; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* ForexTM Workstation v2 — operacyjny układ data-first */
.sidebar-logout {
  width: 100%;
  min-height: 32px;
  margin-top: 0.75rem;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
  font-size: 0.68rem;
  cursor: pointer;
}

.workspace-command { display: flex; min-width: 0; align-items: center; gap: 0.65rem; }
.symbol-command { position: relative; display: grid; min-width: 170px; gap: 0.1rem; }
.symbol-command > span { color: #69788e; font-size: 0.52rem; font-weight: 750; letter-spacing: 0.12em; text-transform: uppercase; }
.symbol-command select {
  width: 100%;
  min-height: 30px;
  padding: 0 1.7rem 0 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 0.82rem;
  font-weight: 720;
  cursor: pointer;
}
.timeframe-command,
.chart-timeframes { display: flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid #1e2939; border-radius: 4px; background: #090e17; }
.timeframe-command button,
.chart-timeframes button {
  min-width: 34px;
  min-height: 26px;
  padding: 0.25rem 0.4rem;
  border: 0;
  border-radius: 3px;
  color: #738197;
  background: transparent;
  font-size: 0.62rem;
  font-weight: 700;
  cursor: pointer;
}
.timeframe-command button:hover,
.chart-timeframes button:hover { color: var(--text-soft); background: #121a28; }
.timeframe-command button.is-active,
.chart-timeframes button.is-active { color: #e9edff; background: #29385c; box-shadow: inset 0 0 0 1px rgba(122, 151, 255, 0.18); }

.data-status-strip {
  position: sticky;
  z-index: 24;
  top: 56px;
  display: flex;
  min-height: 28px;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  border-bottom: 1px solid #1b2432;
  color: #738197;
  background: rgba(8, 12, 19, 0.96);
  scrollbar-width: none;
}
.data-status-strip::-webkit-scrollbar { display: none; }
.data-status-strip > span { display: inline-flex; min-height: 28px; align-items: center; gap: 0.38rem; padding: 0 0.75rem; border-right: 1px solid #1b2432; font-size: 0.57rem; white-space: nowrap; }
.data-status-strip b { color: #9ba8ba; font-size: 0.54rem; letter-spacing: 0.04em; }
.data-status-strip time { margin-left: auto; padding: 0 0.8rem; color: #718097; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.58rem; white-space: nowrap; }
.status-indicator { width: 6px; height: 6px; border-radius: 50%; background: #667085; }
.status-indicator.status-ready { background: var(--positive); box-shadow: 0 0 8px rgba(45, 212, 191, 0.45); }
.status-indicator.status-offline { background: #596476; }

.workspace-titlebar {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid #1c2635;
}
.workspace-titlebar .eyebrow { margin-bottom: 0.18rem; font-size: 0.52rem; letter-spacing: 0.14em; }
.workspace-titlebar h1 { margin: 0; font-size: 1.18rem; font-weight: 690; letter-spacing: -0.018em; line-height: 1.2; }
.workspace-title-actions,
.execution-title-actions { display: flex; align-items: center; gap: 0.45rem; }
.workspace-titlebar .primary-link,
.workspace-titlebar .secondary-link { min-height: 32px; padding: 0.42rem 0.68rem; border-radius: 4px; font-size: 0.65rem; }
.provider-state { display: flex; align-items: center; gap: 0.55rem; }
.provider-state > span { width: 7px; height: 7px; border-radius: 50%; background: var(--positive); box-shadow: 0 0 9px rgba(45, 212, 191, 0.48); }
.provider-state div { display: grid; gap: 0.06rem; }
.provider-state strong { font-size: 0.66rem; }
.provider-state small { color: #6e7c90; font-size: 0.56rem; }

.workstation-pane {
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #1d2838;
  border-radius: 4px;
  background: #0a1019;
  box-shadow: none;
}
.pane-heading {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0 0.75rem;
  border-bottom: 1px solid #1b2635;
  background: #0d131e;
}
.pane-heading > div { display: grid; gap: 0.12rem; min-width: 0; }
.pane-heading > div > span,
.ticket-heading > div > span,
.chart-command-bar > div:first-child > span { color: #8290a4; font-size: 0.5rem; font-weight: 780; letter-spacing: 0.12em; }
.pane-heading h2,
.ticket-heading h2,
.chart-command-bar h2 { margin: 0; overflow: hidden; font-size: 0.78rem; font-weight: 690; text-overflow: ellipsis; white-space: nowrap; }
.pane-count { display: grid; min-width: 22px; height: 20px; place-items: center; border: 1px solid #273448; border-radius: 3px; color: #8492a7; font-size: 0.56rem; }
.pane-action { border: 0; color: #87a0ff; background: transparent; font-size: 0.6rem; text-decoration: none; cursor: pointer; white-space: nowrap; }
.pane-footer-link { display: block; padding: 0.65rem 0.75rem; border-top: 1px solid #1b2635; color: #8299e9; font-size: 0.6rem; text-decoration: none; }
.icon-action { display: grid; width: 26px; height: 26px; place-items: center; border: 1px solid #243147; border-radius: 3px; color: #8390a4; background: #101722; cursor: pointer; }

.watchlist-columns { display: grid; grid-template-columns: 1fr auto; padding: 0.45rem 0.65rem; border-bottom: 1px solid #182231; color: #8290a4; font-size: 0.5rem; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; }
.watchlist-list { display: grid; }
.watchlist-list button {
  display: grid;
  min-height: 54px;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border: 0;
  border-bottom: 1px solid #172130;
  color: var(--text-soft);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.watchlist-list button:hover { background: #0f1723; }
.watchlist-list button.is-active { box-shadow: inset 2px 0 var(--accent); background: rgba(108, 140, 255, 0.08); }
.watchlist-list button > span { display: grid; gap: 0.15rem; }
.watchlist-list button > span:last-child { justify-items: end; }
.watchlist-list strong { font-size: 0.68rem; font-weight: 680; }
.watchlist-list b { color: #aab4c3; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.65rem; font-weight: 600; }
.watchlist-list small { color: #8290a4; font-size: 0.52rem; }
.watchlist-groups { display: flex; gap: 0.2rem; padding: 0.5rem 0.6rem; border-bottom: 1px solid #182231; }
.watchlist-groups button { min-height: 24px; padding: 0.2rem 0.45rem; border: 1px solid transparent; border-radius: 3px; color: #69778b; background: transparent; font-size: 0.56rem; cursor: pointer; }
.watchlist-groups button.is-active { border-color: #26344a; color: #c1cada; background: #111925; }
.provider-empty { margin: 0.6rem; padding: 0.65rem; border: 1px dashed #253247; color: #748297; background: rgba(16, 23, 34, 0.55); }
.provider-empty strong { color: #a8b2c1; font-size: 0.63rem; }
.provider-empty p { margin: 0.35rem 0; font-size: 0.57rem; line-height: 1.45; }
.provider-empty a { color: #87a0ff; font-size: 0.58rem; text-decoration: none; }

/* Overview */
.workstation-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-bottom: 0.55rem; border: 1px solid #1d2838; border-radius: 4px; overflow: hidden; }
.workstation-metrics .metric-card { min-height: 88px; padding: 0.7rem 0.85rem; border: 0; border-right: 1px solid #1d2838; border-radius: 0; background: #0b111b; box-shadow: none; }
.workstation-metrics .metric-card:last-child { border-right: 0; }
.workstation-metrics .metric-card::before { right: auto; left: 0; width: 2px; height: 100%; background: #506ede; opacity: 0.75; }
.workstation-metrics .metric-card:nth-child(2)::before { background: var(--positive); }
.workstation-metrics .metric-card:nth-child(3)::before { background: #9d7bea; }
.workstation-metrics .metric-card:nth-child(4)::before { background: var(--warning); }
.workstation-metrics .metric-card span { font-size: 0.57rem; }
.workstation-metrics .metric-card strong { font-size: clamp(1.25rem, 2vw, 1.75rem); font-weight: 650; }
.workstation-metrics .metric-card small { font-size: 0.55rem; }
.overview-workstation { display: grid; grid-template-columns: 230px minmax(420px, 1fr) 280px; gap: 0.55rem; }
.overview-chart-frame { height: 430px; min-height: 0; border: 0; border-radius: 0; }
.overview-side-stack { display: grid; min-width: 0; grid-template-rows: auto minmax(0, 1fr); gap: 0.55rem; }
.risk-gauge { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0.35rem 0.6rem; padding: 0.8rem 0.75rem 0.6rem; }
.risk-gauge progress { width: 100%; height: 5px; grid-column: 1; overflow: hidden; border: 0; border-radius: 0; appearance: none; }
.risk-gauge progress::-webkit-progress-bar { background: #1a2433; }
.risk-gauge progress::-webkit-progress-value { background: linear-gradient(90deg, #5474ef, #7f98ff); }
.risk-gauge progress::-moz-progress-bar { background: linear-gradient(90deg, #5474ef, #7f98ff); }
.risk-gauge strong { grid-column: 2; grid-row: 1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.7rem; }
.risk-gauge small { grid-column: 1 / 3; color: #8290a4; font-size: 0.52rem; }
.compact-data-list { margin: 0; padding: 0 0.75rem 0.7rem; }
.compact-data-list > div { display: flex; align-items: center; justify-content: space-between; padding: 0.45rem 0; border-top: 1px solid #192333; }
.compact-data-list dt { color: #718096; font-size: 0.57rem; }
.compact-data-list dd { margin: 0; color: #a7b2c2; font-size: 0.58rem; font-weight: 650; }
.alert-monitor { min-height: 0; }
.compact-events { max-height: 246px; overflow-y: auto; padding: 0.55rem; }
.compact-events .event-empty,
.compact-events .event-item { min-height: 44px; padding: 0.55rem; border-radius: 2px; font-size: 0.58rem; }
.overview-bottom-dock { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.65fr); gap: 0.55rem; margin-top: 0.55rem; }
.dock-tabs { display: flex; min-height: 34px; align-items: center; gap: 0.15rem; padding: 0 0.55rem; border-bottom: 1px solid #1b2635; background: #0d131e; }
.dock-tabs button,
.dock-tabs a { min-height: 25px; padding: 0.35rem 0.55rem; border: 0; border-radius: 2px; color: #8290a4; background: transparent; font-size: 0.58rem; text-decoration: none; cursor: pointer; }
.dock-tabs .is-active { color: #d3daea; background: #182235; }
.dock-spacer { flex: 1; }
.dock-panel .empty-cell { height: 62px; }
.ai-brief-empty { display: grid; min-height: 94px; grid-template-columns: 34px 1fr; gap: 0.6rem; align-content: center; padding: 0.75rem; }
.ai-brief-empty > span { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid #33466c; color: #93a8f5; background: #111a2b; font-size: 0.56rem; font-weight: 800; }
.ai-brief-empty p { margin: 0; color: #79879b; font-size: 0.6rem; line-height: 1.45; }
.ai-brief-empty a { grid-column: 2; color: #8ca3f5; font-size: 0.59rem; text-decoration: none; }

/* Chart workspace */
.market-workstation { display: grid; grid-template-columns: 220px minmax(500px, 1fr) 290px; gap: 0.45rem; }
.market-watch { min-height: 650px; }
.primary-chart-pane { min-height: 650px; }
.chart-command-bar { display: grid; min-height: 48px; grid-template-columns: minmax(130px, 1fr) auto auto; align-items: center; gap: 0.7rem; padding: 0 0.7rem; border-bottom: 1px solid #1c2736; background: #0d131e; }
.chart-command-bar > div:first-child { display: grid; gap: 0.1rem; }
.chart-tools { display: flex; gap: 0.35rem; }
.chart-tools span { padding: 0.35rem 0.45rem; border-left: 1px solid #243044; color: #93a0b2; font-size: 0.54rem; white-space: nowrap; }
.primary-chart-frame { height: 602px; min-height: 0; border: 0; border-radius: 0; }
.market-inspector { min-height: 650px; }
.inspector-tabs { display: grid; grid-template-columns: repeat(3, 1fr); min-height: 32px; border-bottom: 1px solid #1b2635; }
.inspector-tabs button { border: 0; border-right: 1px solid #1b2635; color: #6d7b90; background: #0b111a; font-size: 0.55rem; cursor: pointer; }
.inspector-tabs button:last-child { border-right: 0; }
.inspector-tabs button.is-active { color: #d2d9e8; box-shadow: inset 0 -2px var(--accent); background: #101722; }
.inspector-panel { padding: 0.65rem; }
.inspector-widget-panel { height: 552px; padding: 0; }
.quote-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin: 0; overflow: hidden; border: 1px solid #1c2737; background: #1c2737; }
.quote-grid > div { display: grid; min-height: 62px; gap: 0.25rem; align-content: center; padding: 0.55rem; background: #0b111a; }
.quote-grid dt { color: #66758a; font-size: 0.53rem; }
.quote-grid dd { margin: 0; color: #c1cad8; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem; }
.data-unavailable { display: grid; gap: 0.3rem; margin-top: 0.65rem; padding: 0.65rem; border: 1px dashed #2a374b; background: #0d141f; }
.data-unavailable span { color: #7283a0; font-size: 0.5rem; font-weight: 780; letter-spacing: 0.1em; }
.data-unavailable strong { font-size: 0.63rem; }
.data-unavailable p { margin: 0; color: #6e7c90; font-size: 0.57rem; line-height: 1.45; }
.context-actions { display: grid; gap: 0.35rem; margin-top: 0.65rem; }
.context-actions a { padding: 0.55rem; border: 1px solid #243147; color: #94a8ef; background: #101722; font-size: 0.6rem; text-align: center; text-decoration: none; }
.inspector-widget,
.inspector-calendar { height: 100%; border: 0; border-radius: 0; }
.market-bottom-dock { margin-top: 0.45rem; }
.source-contract-row { display: grid; grid-template-columns: repeat(4, 1fr); }
.source-contract-row > div { display: grid; min-height: 57px; align-content: center; gap: 0.12rem; padding: 0.5rem 0.7rem; border-right: 1px solid #1b2635; }
.source-contract-row > div:last-child { border-right: 0; }
.source-contract-row span { color: #617087; font-size: 0.48rem; font-weight: 760; letter-spacing: 0.09em; }
.source-contract-row strong { font-size: 0.63rem; }
.source-contract-row small { color: #6b798d; font-size: 0.53rem; }

/* Unified decision workspace */
.decision-titlebar { align-items: center; }
.decision-title-actions { display: flex; align-items: center; gap: 0.55rem; }
.decision-title-actions .primary-button { min-height: 34px; padding: 0.45rem 0.75rem; border-radius: 3px; font-size: 0.6rem; }
.decision-workstation { display: grid; grid-template-columns: minmax(560px, 1fr) 350px; gap: 0.45rem; }
.decision-chart-pane { min-width: 0; min-height: 650px; }
.decision-chart-frame { height: 548px; }
.decision-quote-strip { display: grid; grid-template-columns: repeat(6, 1fr); min-height: 53px; border-top: 1px solid #1c2736; background: #0b111a; }
.decision-quote-strip > div { display: grid; min-width: 0; align-content: center; gap: 0.15rem; padding: 0.45rem 0.65rem; border-right: 1px solid #1c2736; }
.decision-quote-strip > div:last-child { border-right: 0; }
.decision-quote-strip span { color: #8d9bad; font-size: 0.48rem; font-weight: 760; letter-spacing: 0.08em; }
.decision-quote-strip strong { overflow: hidden; color: #bcc7d7; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.65rem; text-overflow: ellipsis; white-space: nowrap; }
.decision-engine-panel { min-height: 650px; }
.decision-engine-led { width: 8px; height: 8px; border-radius: 50%; background: #50627b; box-shadow: 0 0 0 4px rgba(80, 98, 123, 0.1); }
.decision-engine-panel.is-ready .decision-engine-led { background: var(--positive); box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.1), 0 0 16px rgba(45, 212, 191, 0.25); }
.decision-engine-panel.is-blocked .decision-engine-led { background: var(--warning); box-shadow: 0 0 0 4px rgba(244, 193, 93, 0.1); }
.decision-state-block { display: grid; gap: 0.4rem; min-height: 138px; align-content: center; padding: 0.9rem 0.8rem; border-bottom: 1px solid #1b2635; background: radial-gradient(circle at 100% 0%, rgba(85, 112, 220, 0.12), transparent 48%), #0a1019; }
.decision-state-block > span { color: #7f90aa; font-size: 0.51rem; font-weight: 800; letter-spacing: 0.1em; }
.decision-state-block > strong { color: #d3dae6; font-size: 1.32rem; font-weight: 660; letter-spacing: -0.025em; }
.decision-engine-panel.is-ready .decision-state-block > strong { color: #91e3d7; }
.decision-engine-panel.is-blocked .decision-state-block > strong { color: #d9c183; }
.decision-state-block p { margin: 0; color: #76859a; font-size: 0.59rem; line-height: 1.5; }
.decision-quality-grid { display: grid; grid-template-columns: repeat(2, 1fr); border-bottom: 1px solid #1b2635; }
.decision-quality-grid > div { display: grid; min-height: 58px; align-content: center; gap: 0.15rem; padding: 0.55rem 0.75rem; border-right: 1px solid #1b2635; }
.decision-quality-grid > div:last-child { border-right: 0; }
.decision-quality-grid > div:nth-child(3) { grid-column: 1 / -1; border-top: 1px solid #1b2635; }
.decision-quality-grid span { color: #8d9bad; font-size: 0.5rem; }
.decision-quality-grid strong { color: #b9c4d4; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.68rem; }
.decision-readiness-links { display: grid; grid-template-columns: repeat(2, 1fr); border-bottom: 1px solid #1b2635; }
.decision-readiness-links button { display: grid; min-height: 47px; align-content: center; gap: 0.12rem; padding: 0.45rem 0.7rem; border: 0; border-right: 1px solid #1b2635; color: inherit; background: #0a1019; text-align: left; cursor: pointer; }
.decision-readiness-links button:last-child { border-right: 0; }
.decision-readiness-links button:hover { background: #101827; }
.decision-readiness-links span { color: #92a1b7; font-size: 0.48rem; }
.decision-readiness-links strong { color: #9cabc0; font-size: 0.53rem; font-weight: 620; line-height: 1.35; }
.decision-section { padding: 0.65rem 0.75rem; border-bottom: 1px solid #192333; }
.decision-section h3 { margin: 0 0 0.4rem; color: #8796ab; font-size: 0.54rem; font-weight: 760; letter-spacing: 0.04em; text-transform: uppercase; }
.decision-section ul { display: grid; gap: 0.3rem; margin: 0; padding: 0; list-style: none; }
.decision-section li { position: relative; padding-left: 0.75rem; color: #748296; font-size: 0.56rem; line-height: 1.42; }
.decision-section li::before { position: absolute; top: 0.47em; left: 0; width: 4px; height: 4px; border-radius: 50%; background: #6278c8; content: ""; }
.decision-safety { display: grid; grid-template-columns: auto 1fr; gap: 0.55rem; margin: 0.65rem 0.75rem; padding: 0.55rem; border: 1px solid rgba(244, 193, 93, 0.2); background: rgba(244, 193, 93, 0.05); }
.decision-safety span { color: #d4b96f; font-size: 0.48rem; font-weight: 820; letter-spacing: 0.08em; }
.decision-safety p { margin: 0; color: #b2a581; font-size: 0.52rem; line-height: 1.4; }
.decision-bottom-dock { margin-top: 0.45rem; }
.decision-bottom-dock .dock-tabs small { align-self: center; color: #8d9bad; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.51rem; }
.decision-dock-grid { display: grid; grid-template-columns: 1.25fr repeat(3, 1fr); }
.decision-dock-grid .data-unavailable { min-height: 84px; margin: 0; border: 0; border-right: 1px solid #1b2635; }
.decision-policy-card { display: grid; min-height: 84px; align-content: center; gap: 0.2rem; padding: 0.65rem 0.75rem; border-right: 1px solid #1b2635; background: #0b111a; }
.decision-policy-card:last-child { border-right: 0; }
.decision-policy-card[hidden] { display: none; }
.decision-no-policy { grid-column: 2 / -1; }
.decision-policy-card span { color: #91a2be; font-size: 0.48rem; font-weight: 800; letter-spacing: 0.09em; }
.decision-policy-card strong { color: #b5c0cf; font-size: 0.6rem; }
.decision-policy-card p { margin: 0; color: #8998ac; font-size: 0.52rem; line-height: 1.42; }
.decision-bottom-dock .data-unavailable p { color: #8998ac; }
.decision-source-panel { min-height: 125px; background: #0b111a; }
.decision-panel-heading { display: flex; min-height: 54px; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.55rem 0.75rem; border-bottom: 1px solid #1b2635; }
.decision-panel-heading > div { display: grid; gap: 0.16rem; }
.decision-panel-heading span { color: #91a2be; font-size: 0.49rem; font-weight: 800; letter-spacing: 0.08em; }
.decision-panel-heading strong { color: #b5c0cf; font-size: 0.62rem; }
.decision-panel-heading p { max-width: 560px; margin: 0; color: #7f8da0; font-size: 0.54rem; line-height: 1.45; text-align: right; }
.decision-source-panel table { font-size: 0.57rem; }
.decision-source-panel th,
.decision-source-panel td { padding: 0.48rem 0.65rem; }
.decision-method-note { margin: 0; padding: 0.5rem 0.75rem; border-top: 1px solid #1b2635; color: #7f8da0; font-size: 0.54rem; }
.decision-execution-panel { display: grid; grid-template-columns: repeat(2, 1fr); min-height: 154px; background: #0b111a; }
.decision-execution-panel[hidden] { display: none; }
.decision-execution-panel > article { padding: 0.75rem; border-right: 1px solid #1b2635; }
.decision-execution-panel > article:last-child { border-right: 0; }
.decision-execution-panel > article > span { color: #91a2be; font-size: 0.49rem; font-weight: 800; letter-spacing: 0.08em; }
.decision-execution-panel > article > strong { display: block; margin-top: 0.25rem; color: #d2ba7d; font-size: 0.68rem; }
.decision-execution-panel dl { margin-top: 0.55rem; }
.decision-execution-panel > article > p { margin: 0.55rem 0 0; color: #7f8da0; font-size: 0.54rem; line-height: 1.45; }
.decision-execution-panel > article > a { display: inline-block; margin-top: 0.45rem; color: var(--accent-bright); font-size: 0.54rem; text-underline-offset: 3px; }

/* Execution workspace */
.execution-statusbar { display: grid; grid-template-columns: repeat(5, 1fr); margin-bottom: 0.45rem; border: 1px solid #1d2838; border-radius: 4px; background: #0b111a; }
.execution-statusbar > div { display: grid; min-height: 47px; align-content: center; gap: 0.14rem; padding: 0.45rem 0.65rem; border-right: 1px solid #1d2838; }
.execution-statusbar > div:last-child { border-right: 0; }
.execution-statusbar span { color: #637186; font-size: 0.51rem; }
.execution-statusbar strong { overflow: hidden; font-size: 0.63rem; text-overflow: ellipsis; white-space: nowrap; }
.execution-workstation { display: grid; grid-template-columns: minmax(500px, 1fr) 340px; gap: 0.45rem; }
.execution-center { display: grid; min-width: 0; gap: 0.45rem; }
.execution-chart-frame { height: 430px; min-height: 0; border: 0; border-radius: 0; }
.compact-chart-command { grid-template-columns: 1fr auto; }
.execution-positions { min-height: 140px; }
.execution-ticket { padding-bottom: 0.65rem; }
.ticket-heading { display: flex; min-height: 48px; align-items: center; justify-content: space-between; padding: 0 0.7rem; border-bottom: 1px solid #1b2635; background: #0d131e; }
.ticket-heading > div { display: grid; gap: 0.1rem; }
.paper-safety-banner { display: flex; align-items: center; gap: 0.55rem; margin: 0.65rem; padding: 0.5rem 0.6rem; border: 1px solid rgba(244, 193, 93, 0.22); background: rgba(244, 193, 93, 0.06); }
.paper-safety-banner > span { display: grid; width: 20px; height: 20px; place-items: center; border: 1px solid rgba(244, 193, 93, 0.32); color: var(--warning); font-size: 0.65rem; }
.paper-safety-banner p { display: grid; gap: 0.08rem; margin: 0; color: #7d899a; font-size: 0.53rem; }
.paper-safety-banner strong { color: #d5bd88; font-size: 0.59rem; }
.ticket-field { display: grid; gap: 0.3rem; margin: 0 0.65rem 0.55rem; color: #738197; font-size: 0.57rem; font-weight: 620; }
.ticket-field input,
.ticket-field select { width: 100%; min-height: 34px; padding: 0.45rem 0.55rem; border: 1px solid #263247; border-radius: 3px; outline: 0; color: #d6dce7; background: #080d15; font-size: 0.65rem; }
.ticket-field input:focus,
.ticket-field select:focus { border-color: #5e7ce9; box-shadow: 0 0 0 2px rgba(94, 124, 233, 0.12); }
.side-selector { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.35rem; margin: 0 0.65rem 0.6rem; padding: 0; border: 0; }
.side-selector legend { margin-bottom: 0.3rem; color: #738197; font-size: 0.57rem; }
.side-selector label { cursor: pointer; }
.side-selector input { position: absolute; opacity: 0; pointer-events: none; }
.side-selector span { display: grid; min-height: 32px; place-items: center; border: 1px solid #263247; color: #7d899d; background: #0b111a; font-size: 0.62rem; font-weight: 760; }
.side-selector label:first-of-type input:checked + span { border-color: rgba(45, 212, 191, 0.4); color: #8fe9dc; background: rgba(45, 212, 191, 0.09); }
.side-selector label:last-of-type input:checked + span { border-color: rgba(251, 113, 133, 0.4); color: #ff9aaa; background: rgba(251, 113, 133, 0.09); }
.ticket-grid { display: grid; grid-template-columns: repeat(2, 1fr); }
.ticket-grid .ticket-field { margin-right: 0.3rem; }
.ticket-grid .ticket-field:nth-child(even) { margin-right: 0.65rem; margin-left: 0.3rem; }
.ticket-grid .ticket-wide { grid-column: 1 / 3; margin-right: 0.65rem; margin-left: 0.65rem; }
.order-risk-preview { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0.15rem 0.65rem 0.6rem; border: 1px solid #1e2a3b; }
.order-risk-preview > div { display: grid; min-height: 49px; align-content: center; gap: 0.15rem; padding: 0.4rem; border-right: 1px solid #1e2a3b; }
.order-risk-preview > div:last-child { border-right: 0; }
.order-risk-preview span { color: #617087; font-size: 0.48rem; }
.order-risk-preview strong { overflow: hidden; color: #aab4c3; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.57rem; text-overflow: ellipsis; white-space: nowrap; }
.ticket-submit { width: calc(100% - 1.3rem); min-height: 36px; margin: 0 0.65rem; border-radius: 3px; font-size: 0.64rem; }
.execution-ticket .form-message { min-height: 2.5rem; margin: 0.55rem 0.65rem 0; font-size: 0.56rem; }
.terminal-orders-dock { margin-top: 0.45rem; }
.terminal-orders-dock table { min-width: 760px; }

/* Wspólne zagęszczenie pozostałych modułów */
.app-main > .page-header { min-height: 48px; align-items: center; margin-bottom: 0.65rem; padding-bottom: 0.65rem; border-bottom: 1px solid #1c2635; }
.app-main > .page-header h1,
.app-main > .compact-page-header h1,
.app-main .admin-heading h1 { max-width: none; font-size: 1.18rem; letter-spacing: -0.02em; line-height: 1.2; }
.app-main > .page-header .lede,
.app-main .admin-heading + .lede { max-width: 760px; margin-top: 0.3rem; font-size: 0.68rem; line-height: 1.45; }
.app-main .workspace-panel,
.app-main .ai-panel,
.app-main .integration-card,
.app-main .filter-bar,
.app-main .security-note { border-radius: 4px; }

@media (min-width: 981px) {
  .app-shell { grid-template-columns: 68px minmax(0, 1fr); }
  .app-sidebar { width: 68px; overflow: hidden; transition: width 180ms ease, box-shadow 180ms ease; }
  .app-sidebar:hover,
  .app-sidebar:focus-within { width: 224px; box-shadow: 20px 0 55px rgba(0, 0, 0, 0.42); }
  .app-brand { min-width: 224px; padding: 0 0.9rem; }
  .app-brand > span:last-child,
  .app-nav-link strong,
  .app-nav-section > p,
  .sidebar-foot p,
  .sidebar-logout { opacity: 0; transition: opacity 120ms ease; }
  .app-sidebar:hover .app-brand > span:last-child,
  .app-sidebar:focus-within .app-brand > span:last-child,
  .app-sidebar:hover .app-nav-link strong,
  .app-sidebar:focus-within .app-nav-link strong,
  .app-sidebar:hover .app-nav-section > p,
  .app-sidebar:focus-within .app-nav-section > p,
  .app-sidebar:hover .sidebar-foot p,
  .app-sidebar:focus-within .sidebar-foot p,
  .app-sidebar:hover .sidebar-logout,
  .app-sidebar:focus-within .sidebar-logout { opacity: 1; }
  .app-nav { width: 224px; padding-right: 0.6rem; padding-left: 0.6rem; }
  .app-nav-link { grid-template-columns: 34px 1fr; padding-left: 0.62rem; }
  .app-nav-link.is-active::before { left: -0.62rem; }
  .sidebar-foot { width: 224px; }
  .app-workspace { grid-column: 2; }
  .app-topbar { min-height: 56px; grid-template-columns: minmax(390px, 1fr) auto auto; padding: 0 0.8rem 0 1rem; }
  .app-main { max-width: none; min-height: calc(100vh - 84px); padding: 0.85rem; }
}

@media (max-width: 1180px) and (min-width: 981px) {
  .overview-workstation { grid-template-columns: 200px minmax(360px, 1fr) 245px; }
  .market-workstation { grid-template-columns: 185px minmax(390px, 1fr) 255px; }
  .chart-tools { display: none; }
  .execution-workstation { grid-template-columns: minmax(420px, 1fr) 320px; }
  .decision-workstation { grid-template-columns: minmax(470px, 1fr) 320px; }
  .decision-dock-grid { grid-template-columns: repeat(2, 1fr); }
  .decision-dock-grid > *:nth-child(2) { border-right: 0; }
  .decision-dock-grid > *:nth-child(-n+2) { border-bottom: 1px solid #1b2635; }
}

@media (max-width: 980px) {
  .app-topbar { position: sticky; top: 0; min-height: 56px; grid-template-columns: auto minmax(130px, 1fr) auto; padding: 0 0.65rem; }
  .workspace-command { justify-content: center; }
  .symbol-command { min-width: 130px; }
  .symbol-command > span,
  .timeframe-command { display: none; }
  .system-pulse { display: grid; padding: 0 0.2rem; border: 0; }
  .system-pulse small { display: none; }
  .account-menu { display: none; }
  .data-status-strip { top: 56px; }
  .data-status-strip time { display: none; }
  .app-main { min-height: calc(100vh - 84px); padding: 0.75rem 0.75rem calc(6.6rem + env(safe-area-inset-bottom)); }
  .overview-workstation { grid-template-columns: 210px minmax(400px, 1fr); }
  .overview-side-stack { grid-column: 1 / 3; grid-template-columns: repeat(2, 1fr); grid-template-rows: auto; }
  .overview-bottom-dock { grid-template-columns: 1fr; }
  .market-workstation { grid-template-columns: 190px minmax(430px, 1fr); }
  .market-inspector { grid-column: 1 / 3; min-height: 0; }
  .inspector-widget-panel { height: 430px; }
  .execution-workstation { grid-template-columns: minmax(0, 1fr) 320px; }
  .decision-workstation { grid-template-columns: minmax(0, 1fr) 320px; }
  .decision-dock-grid { grid-template-columns: repeat(2, 1fr); }
  .broker-review-fields { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .workspace-titlebar { min-height: 42px; }
  .workspace-titlebar h1 { font-size: 1rem; }
  .workspace-title-actions .secondary-link { display: none; }
  .workstation-metrics { grid-template-columns: repeat(2, 1fr); }
  .workstation-metrics .metric-card { border-right: 1px solid #1d2838; border-bottom: 1px solid #1d2838; }
  .workstation-metrics .metric-card:nth-child(2n) { border-right: 0; }
  .workstation-metrics .metric-card:nth-child(n+3) { border-bottom: 0; }
  .overview-workstation,
  .market-workstation,
  .execution-workstation,
  .decision-workstation { grid-template-columns: 1fr; }
  .overview-workstation .watchlist-pane { order: 2; }
  .overview-chart-pane { order: 1; }
  .overview-side-stack { grid-column: auto; order: 3; grid-template-columns: 1fr; }
  .overview-chart-frame { height: 420px; }
  .overview-bottom-dock { grid-template-columns: 1fr; }
  .market-watch { min-height: 0; order: 2; }
  .market-watchlist { display: grid; grid-template-columns: repeat(5, minmax(125px, 1fr)); overflow-x: auto; }
  .market-watchlist button { border-right: 1px solid #172130; }
  .market-inspector { grid-column: auto; min-height: 0; order: 3; }
  .primary-chart-pane { min-height: 0; order: 1; }
  .primary-chart-frame { height: 520px; }
  .chart-command-bar { grid-template-columns: 1fr auto; }
  .chart-tools { display: none; }
  .source-contract-row { grid-template-columns: repeat(2, 1fr); }
  .source-contract-row > div:nth-child(2) { border-right: 0; }
  .source-contract-row > div:nth-child(-n+2) { border-bottom: 1px solid #1b2635; }
  .execution-center { order: 1; }
  .execution-ticket { order: 2; }
  .execution-statusbar { grid-template-columns: repeat(2, 1fr); }
  .execution-statusbar > div { border-bottom: 1px solid #1d2838; }
  .execution-statusbar > div:nth-child(2n) { border-right: 0; }
  .execution-statusbar > div:last-child { grid-column: 1 / 3; border-bottom: 0; }
  .execution-chart-frame { height: 420px; }
  .terminal-orders-dock { margin-top: 0.55rem; }
  .decision-chart-pane { min-height: 0; }
  .decision-engine-panel { min-height: 0; }
  .decision-chart-frame { height: 460px; }
  .decision-quote-strip { grid-template-columns: repeat(3, 1fr); }
  .decision-quote-strip > div:nth-child(3) { border-right: 0; }
  .decision-quote-strip > div:nth-child(-n+3) { border-bottom: 1px solid #1c2736; }
  .decision-dock-grid { grid-template-columns: 1fr; }
  .decision-dock-grid > * { border-right: 0; border-bottom: 1px solid #1b2635; }
  .decision-dock-grid > *:last-child { border-bottom: 0; }
  .decision-no-policy { grid-column: 1 / -1; }
  .broker-control-grid,
  .decision-execution-panel { grid-template-columns: 1fr; }
  .external-terminal-card { grid-template-columns: 1fr; }
  .broker-candidate-alert,
  .decision-execution-panel > article { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .broker-review-fields,
  .broker-checks { grid-template-columns: 1fr; }
  .decision-panel-heading { display: grid; }
  .decision-panel-heading p { text-align: left; }
}

@media (max-width: 480px) {
  .app-main { padding-right: 0.45rem; padding-left: 0.45rem; }
  .data-status-strip > span { padding: 0 0.55rem; }
  .workspace-titlebar .primary-link { padding: 0.4rem 0.55rem; }
  .overview-chart-frame,
  .primary-chart-frame,
  .execution-chart-frame { height: 390px; }
  .decision-chart-frame { height: 390px; }
  .decision-title-actions .source-badge { display: none; }
  .chart-command-bar { padding: 0 0.45rem; }
  .chart-timeframes button { min-width: 30px; }
  .ticket-grid { grid-template-columns: 1fr; }
  .ticket-grid .ticket-field,
  .ticket-grid .ticket-field:nth-child(even),
  .ticket-grid .ticket-wide { grid-column: auto; margin-right: 0.65rem; margin-left: 0.65rem; }
  .order-risk-preview { grid-template-columns: 1fr; }
  .order-risk-preview > div { min-height: 38px; border-right: 0; border-bottom: 1px solid #1e2a3b; }
  .order-risk-preview > div:last-child { border-bottom: 0; }
}
