:root {
  --bg: #0b0f15;
  --bg-elev: #101722;
  --panel: #131c28;
  --panel-soft: #182233;
  --panel-muted: #0f1620;
  --line: #293447;
  --line-strong: #3a4760;
  --text: #ecf2fa;
  --text-soft: #a8b5c7;
  --text-dim: #7f8da3;
  --primary: #8cb4ff;
  --primary-soft: rgba(140,180,255,.14);
  --kr-rise: #ff6b6b;
  --kr-rise-soft: rgba(255,107,107,.14);
  --kr-fall: #6da8ff;
  --kr-fall-soft: rgba(109,168,255,.14);
  --good: #35c47c;
  --good-soft: rgba(53,196,124,.14);
  --warn: #f0b64c;
  --warn-soft: rgba(240,182,76,.15);
  --danger: #ef6158;
  --danger-soft: rgba(239,97,88,.15);
  --shadow: 0 10px 30px rgba(0,0,0,.30);
  --radius: 18px;
  --radius-sm: 12px;
  --font-main: Arial, "Noto Sans KR", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(circle at top left, rgba(140,180,255,.08), transparent 28%),
    radial-gradient(circle at top right, rgba(53,196,124,.05), transparent 24%),
    linear-gradient(180deg, #0a0f15 0%, #0b1119 100%);
  color: var(--text);
  font-family: var(--font-main);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--primary); text-decoration: none; }

body *,
body *::before,
body *::after {
  text-shadow: none !important;
}

.shell {
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  background: rgba(11,15,21,.88);
  backdrop-filter: blur(12px);
}

.brand-block h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -.3px;
}

.brand-block p {
  margin: 6px 0 0;
  color: var(--text-soft);
  font-size: 14px;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.topnav a {
  padding: 10px 14px;
  border: 1px solid rgba(140,180,255,.18);
  background: rgba(140,180,255,.08);
  border-radius: 999px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.page-title-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.page-title-row h2 {
  margin: 0;
  font-size: 22px;
}

.page-title-row .hint {
  color: var(--text-soft);
  font-size: 14px;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.metric-card {
  position: relative;
  overflow: hidden;
  padding: 18px 18px 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01)), var(--panel);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.metric-card::after {
  content: "";
  position: absolute;
  inset: auto -10% 0 auto;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(140,180,255,.12), transparent 60%);
  pointer-events: none;
}
.metric-card span {
  display: block;
  color: var(--text-soft);
  font-size: 12px;
  margin-bottom: 10px;
}
.metric-card strong {
  display: block;
  font-size: 30px;
  letter-spacing: -.5px;
}
.metric-card small {
  display: block;
  margin-top: 10px;
  color: var(--text-dim);
  font-size: 12px;
}

.content-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 16px;
}
.content-grid.single {
  grid-template-columns: 1fr;
}

.panel {
  background: linear-gradient(180deg, rgba(255,255,255,.018), rgba(255,255,255,.01)), var(--panel);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-header h3, .panel-header h2 {
  margin: 0;
  font-size: 18px;
}

.panel-sub {
  color: var(--text-soft);
  font-size: 12px;
}

.table-list {
  display: grid;
  gap: 14px;
}

.row {
  display: grid;
  grid-template-columns: repeat(4, minmax(70px, 1fr));
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01)), var(--panel-soft);
  border: 1px solid rgba(255,255,255,.06);
}

.row strong {
  font-size: 14px;
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}

.timeline li {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01)), var(--panel-soft);
  border: 1px solid rgba(255,255,255,.06);
  color: var(--text);
}

.detail-box {
  display: grid;
  gap: 14px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01)), var(--panel-soft);
  border: 1px solid rgba(255,255,255,.06);
  color: var(--text);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

button {
  appearance: none;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
}
button.primary {
  background: linear-gradient(180deg, rgba(140,180,255,.22), rgba(140,180,255,.12));
  border-color: rgba(140,180,255,.4);
}
button.warn {
  background: linear-gradient(180deg, rgba(240,182,76,.18), rgba(240,182,76,.08));
  border-color: rgba(240,182,76,.4);
}
button.danger {
  background: linear-gradient(180deg, rgba(239,97,88,.22), rgba(239,97,88,.10));
  border-color: rgba(239,97,88,.45);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.badge.running { background: var(--good-soft); color: #a8f3ca; border: 1px solid rgba(53,196,124,.25); }
.badge.stopped { background: rgba(124,138,160,.15); color: #d4deea; border: 1px solid rgba(124,138,160,.22); }
.badge.warn { background: var(--warn-soft); color: #ffe19f; border: 1px solid rgba(240,182,76,.28); }
.badge.danger { background: var(--danger-soft); color: #ffc2be; border: 1px solid rgba(239,97,88,.28); }
.badge.live { background: var(--primary-soft); color: #d7e5ff; border: 1px solid rgba(140,180,255,.3); }
.badge.paper { background: rgba(168,181,199,.14); color: #dde6f1; border: 1px solid rgba(168,181,199,.25); }
.badge.dev { background: rgba(140,180,255,.10); color: #dce8ff; border: 1px solid rgba(140,180,255,.18); }

.kill-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(239,97,88,.18), rgba(239,97,88,.08));
  border: 1px solid rgba(239,97,88,.35);
  box-shadow: var(--shadow);
}
.kill-banner.hidden { display: none; }
.kill-banner strong { font-size: 18px; }
.kill-banner p { margin: 6px 0 0; color: #ffd2cf; }

.section-note {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.5;
}

.tb-align-number,
.tb-auto-num,
.num-col,
td.tb-align-number,
td.tb-auto-num,
td.num-col,
th.tb-align-number,
th.tb-auto-num,
th.num-col,
[data-align="number"],
[data-align="right"],
[data-tb-align="number"],
[data-tb-align="right"] {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
}

.tb-align-center,
.tb-auto-num-center,
td.tb-align-center,
td.tb-auto-num-center,
th.tb-align-center,
th.tb-auto-num-center,
[data-align="center"],
[data-tb-align="center"] {
  text-align: center !important;
  font-variant-numeric: tabular-nums;
}

.tb-align-left,
.tb-num-skip,
td.tb-align-left,
td.tb-num-skip,
th.tb-align-left,
th.tb-num-skip,
[data-align="left"],
[data-align="text"],
[data-tb-align="left"],
[data-tb-align="text"] {
  text-align: left !important;
}

.tb-num-positive {
  color: var(--kr-rise) !important;
}

.tb-num-negative {
  color: var(--kr-fall) !important;
}

.tb-num-zero {
  color: var(--text-soft) !important;
}

.text-profit {
  color: var(--kr-rise) !important;
}

.text-loss {
  color: var(--kr-fall) !important;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
}
.form-grid label {
  display: block;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01)), var(--panel-soft);
  border: 1px solid rgba(255,255,255,.06);
  color: var(--text-soft);
  font-size: 12px;
}
.form-grid input {
  width: 100%;
  margin-top: 8px;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.08);
  background: #0c131d;
  color: var(--text);
}

.soft-page .panel, .soft-page .metric-card {
  background: linear-gradient(180deg, rgba(255,255,255,.018), rgba(255,255,255,.01)), #15202e;
}

@media (max-width: 1200px) {
  .hero-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
  .content-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .topbar { display: block; }
  .topnav { margin-top: 12px; }
  .hero-grid, .form-grid { grid-template-columns: 1fr; }
}

/* ===== header_v2 ===== */
.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
}

.app-topbar .brand-block h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.topnav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  text-decoration: none;
}

.topnav a.active {
  font-weight: 700;
  text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.10);
}

.context-bar {
  display: block;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 24px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.context-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}

.context-purpose {
  font-size: 14px;
  opacity: 0.82;
  line-height: 1.4;
  text-align: right;
}

.strategy-submenu {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 24px 18px;
  overflow-x: auto;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.strategy-submenu a,
.strategy-submenu span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1;
}

.strategy-submenu a {
  text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.strategy-submenu a.active {
  font-weight: 700;
  text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
}

.strategy-submenu .disabled {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}

body .shell {
  padding-top: 36px;
}

@media (max-width: 900px) {
  .app-topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .context-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .context-purpose {
    text-align: left;
  }

  .topnav {
    gap: 8px;
  }

  .topnav a,
  .strategy-submenu a,
  .strategy-submenu span {
    min-height: 34px;
    padding: 0 12px;
  }
}
/* ===== /header_v2 ===== */

/* Strategy compact layout */
.strategy-compact .strategy-hero-grid {
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 8px;
}

.strategy-compact .compact-card {
  padding: 10px 12px;
  min-height: auto;
}

.strategy-compact .compact-card span,
.strategy-compact .compact-card .metric-label {
  font-size: 11px;
  line-height: 1.2;
}

.strategy-compact .compact-card strong,
.strategy-compact .compact-card .metric-value {
  font-size: 15px;
  line-height: 1.2;
  margin-top: 4px;
  word-break: break-word;
}

@media (max-width: 1200px) {
  .strategy-compact .strategy-hero-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .strategy-compact .strategy-hero-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .compare-grid-4 {
    grid-template-columns: 100px 1fr;
  }

  .compare-grid-4 .cell:nth-child(2n) {
    border-right: 0;
  }

  .compare-grid-4 .cell:nth-child(4n) {
    border-right: 0;
  }

  .compare-grid-4 .cell:nth-last-child(-n+2) {
    border-bottom: 0;
  }
}

/* Strategy compare table: 6 columns, gap 0 */
.compare-grid-6 {
  display: grid;
  grid-template-columns: 96px 0.8fr 96px 0.8fr 96px 0.8fr;
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.compare-grid-6 .cell {
  padding: 6px 8px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  line-height: 1.3;
}

.compare-grid-6 .cell.head {
  font-weight: 700;
  background: rgba(255, 255, 255, 0.03);
}

.compare-grid-6 .cell.value {
  word-break: break-word;
}

.compare-grid-6 .cell:nth-child(6n) {
  border-right: 0;
}

.compare-grid-6 .cell:nth-last-child(-n+6) {
  border-bottom: 0;
}

@media (max-width: 1100px) {
  .compare-grid-6 {
    grid-template-columns: 96px 0.8fr 96px 0.8fr;
  }

  .compare-grid-6 .cell:nth-child(4n) {
    border-right: 0;
  }
}

@media (max-width: 768px) {
  .compare-grid-6 {
    grid-template-columns: 96px 0.8fr;
  }

  .compare-grid-6 .cell:nth-child(2n) {
    border-right: 0;
  }
}

/* Strategy compare table mobile fix */
.compare-grid-6 .cell {
  min-width: 0;
  box-sizing: border-box;
}

.compare-grid-6 .cell.value {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 600px) {
  .compare-grid-6 {
    grid-template-columns: 84px minmax(0, 1fr) !important;
  }

  .compare-grid-6 .cell {
    padding: 5px 6px;
    font-size: 11px;
    line-height: 1.25;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .compare-grid-6 .cell:nth-child(2n) {
    border-right: 0 !important;
  }

  .compare-grid-6 .cell:nth-child(6n) {
    border-right: 1px solid rgba(255, 255, 255, 0.08);
  }

  .compare-grid-6 .cell:nth-last-child(-n+6) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .compare-grid-6 .cell:nth-last-child(-n+2) {
    border-bottom: 0 !important;
  }
}

/* Strategy compare table: 8 columns, equal width */
.compare-grid-8 {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.compare-grid-8 .cell {
  min-width: 0;
  box-sizing: border-box;
  padding: 6px 8px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  line-height: 1.3;
}

.compare-grid-8 .cell.head {
  font-weight: 700;
  background: rgba(255, 255, 255, 0.03);
}

.compare-grid-8 .cell.value {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.compare-grid-8 .cell:nth-child(8n) {
  border-right: 0;
}

.compare-grid-8 .cell:nth-last-child(-n+8) {
  border-bottom: 0;
}

@media (max-width: 1100px) {
  .compare-grid-8 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .compare-grid-8 .cell:nth-child(4n) {
    border-right: 0;
  }

  .compare-grid-8 .cell:nth-last-child(-n+4) {
    border-bottom: 0;
  }
}

@media (max-width: 600px) {
  .compare-grid-8 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compare-grid-8 .cell:nth-child(2n) {
    border-right: 0;
  }

  .compare-grid-8 .cell:nth-last-child(-n+2) {
    border-bottom: 0;
  }
}

/* Strategy plain blocks */
.strategy-plain-block {
  margin-bottom: 0;
}

.strategy-plain-title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 6px 0;
}

/* Strategy card blocks */
.strategy-card-block {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.strategy-ai-card-row {
  display: grid;
  grid-template-columns: 1.2fr 0.7fr 0.9fr 1.6fr 0.9fr 1.6fr;
  gap: 8px;
  align-items: start;
}

.strategy-ai-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
}

.strategy-ai-panel {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  box-shadow: none;
  padding: 18px;
}

.strategy-ai-panel .panel-header {
  margin-bottom: 10px;
}

.strategy-ai-card {
  min-width: 0;
  min-height: 84px;
  padding: 10px 12px 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.02)),
    #1a2230;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.strategy-ai-card-compact {
  min-height: 0;
  padding: 10px 12px;
}

.strategy-ai-card-compact .strategy-ai-card-label,
.strategy-ai-card-compact .strategy-ai-card-value {
  white-space: nowrap;
}

.strategy-ai-card-compact .strategy-ai-card-value {
  text-align: center;
}

.strategy-ai-card-primary {
  background:
    linear-gradient(180deg, rgba(70, 145, 220, 0.28), rgba(48, 95, 148, 0.18)),
    #203044;
  border-color: rgba(105, 180, 255, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 10px 22px rgba(9, 18, 33, 0.26);
}

.strategy-ai-card-wide {
  min-height: 0;
  padding-bottom: 6px;
}

.strategy-ai-card-label {
  color: #9fb1c6;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.strategy-ai-card-value {
  color: #ecf3ff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.strategy-ai-card-rich {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  color: #d8e7fb;
}

.strategy-ai-detail-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 8px;
  align-items: start;
}

.strategy-ai-section-title {
  color: #9fb1c6;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.strategy-ai-reason-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.strategy-ai-reason-line {
  padding: 9px 11px;
  border: 1px solid rgba(120, 150, 186, 0.14);
  border-radius: 12px;
  background: rgba(20, 29, 42, 0.62);
  color: #dce8f6;
  font-size: 13px;
  line-height: 1.45;
}

.strategy-ai-context-shell,
.strategy-ai-controls-shell {
  min-width: 0;
}

.strategy-ai-context-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
}

.strategy-ai-context-card {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.015)),
    #171f2b;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.strategy-ai-context-label {
  color: #91a6be;
  font-size: 11px;
  line-height: 1.2;
}

.strategy-ai-context-value {
  color: #edf4ff;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.strategy-ai-controls-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.strategy-ai-control-card {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.018)),
    #19222f;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.strategy-ai-control-card.is-applied {
  border-color: rgba(85, 190, 255, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.strategy-ai-control-card.is-shadow {
  border-color: rgba(242, 181, 89, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.strategy-ai-control-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.strategy-ai-control-card-label {
  color: #eef4ff;
  font-size: 13px;
  line-height: 1.35;
}

.strategy-ai-control-card-badge {
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #a8b9cf;
  font-size: 11px;
  line-height: 1.2;
  background: rgba(255, 255, 255, 0.03);
}

.strategy-ai-control-card-badge.is-applied {
  color: #7fdbff;
  border-color: rgba(85, 190, 255, 0.3);
  background: rgba(34, 91, 129, 0.24);
}

.strategy-ai-control-card-badge.is-shadow {
  color: #f0c37a;
  border-color: rgba(242, 181, 89, 0.25);
  background: rgba(104, 70, 21, 0.22);
}

.strategy-ai-control-sources {
  min-width: 0;
}

.strategy-ai-source-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.strategy-ai-source-badges.is-compact {
  justify-content: center;
  gap: 4px;
}

.strategy-ai-source-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: #aebbd0;
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
}

.strategy-ai-source-badge.is-baseline {
  color: #afbdd1;
  border-color: rgba(173, 192, 214, 0.18);
  background: rgba(148, 163, 184, 0.14);
}

.strategy-ai-source-badge.is-light {
  color: #7fd8ff;
  border-color: rgba(85, 190, 255, 0.28);
  background: rgba(28, 81, 115, 0.24);
}

.strategy-ai-source-badge.is-heavy {
  color: #f1c77f;
  border-color: rgba(242, 181, 89, 0.28);
  background: rgba(104, 70, 21, 0.22);
}

.strategy-ai-source-badge.is-training {
  color: #9ae7bf;
  border-color: rgba(92, 201, 138, 0.26);
  background: rgba(25, 89, 54, 0.24);
}

.strategy-ai-control-rows {
  display: grid;
  gap: 6px;
}

.strategy-ai-control-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.strategy-ai-control-row.is-final {
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.strategy-ai-control-row-label {
  color: #8fa4bc;
  font-size: 11px;
  line-height: 1.2;
}

.strategy-ai-control-row-value {
  color: #ecf4ff;
  font-size: 13px;
  line-height: 1.35;
  text-align: right;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.strategy-ai-empty-note {
  padding: 10px 12px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: #98abc1;
  font-size: 12px;
  line-height: 1.45;
}

.strategy-ai-operating-shell {
  display: grid;
  gap: 10px;
}

.strategy-ai-operating-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(105, 180, 255, 0.16);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(68, 122, 184, 0.14), rgba(25, 35, 49, 0.36)),
    #171f2b;
}

.strategy-ai-summary-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.strategy-ai-summary-title {
  color: #edf5ff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}

.strategy-ai-summary-sub {
  color: #9fb1c6;
  font-size: 12px;
  line-height: 1.45;
}

.strategy-ai-summary-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.strategy-ai-status-chip {
  display: inline-grid;
  grid-template-columns: auto;
  gap: 2px;
  min-width: 86px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.strategy-ai-status-chip span {
  color: #95a9c0;
  font-size: 10px;
  line-height: 1.2;
}

.strategy-ai-status-chip strong {
  color: #eef6ff;
  font-size: 12px;
  line-height: 1.25;
}

.strategy-ai-status-chip.is-good {
  border-color: rgba(99, 209, 151, 0.3);
  background: rgba(28, 94, 61, 0.2);
}

.strategy-ai-status-chip.is-warn {
  border-color: rgba(245, 185, 90, 0.3);
  background: rgba(104, 70, 21, 0.2);
}

.strategy-ai-main-change {
  display: grid;
  gap: 8px;
}

.strategy-ai-change-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(11, 17, 25, 0.28);
}

.strategy-ai-change-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  color: #edf4ff;
  font-size: 12px;
  line-height: 1.35;
}

.strategy-ai-change-table th,
.strategy-ai-change-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  text-align: left;
  vertical-align: middle;
}

.strategy-ai-change-table th {
  color: #b7c7da;
  font-size: 11px;
  font-weight: 700;
  background: rgba(77, 101, 134, 0.45);
}

.strategy-ai-change-table td:nth-child(3),
.strategy-ai-change-table td:nth-child(4) {
  text-align: right;
}

.strategy-ai-change-table tr:last-child td {
  border-bottom: 0;
}

.strategy-ai-change-table.is-detail {
  min-width: 860px;
}

.strategy-ai-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.strategy-ai-tab-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: #c9d7e8;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.strategy-ai-tab-button strong {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #eef5ff;
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}

.strategy-ai-tab-button.is-active {
  border-color: rgba(105, 180, 255, 0.42);
  background: rgba(50, 103, 160, 0.3);
  color: #f3f8ff;
}

.strategy-ai-tab-panel {
  display: none;
}

.strategy-ai-tab-panel.is-active {
  display: grid;
  gap: 8px;
}

.strategy-ai-signal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.strategy-ai-signal-card,
.strategy-ai-detail-card {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.015)),
    #171f2b;
}

.strategy-ai-signal-title,
.strategy-ai-detail-title {
  color: #9fb1c6;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.strategy-ai-signal-value {
  margin-top: 6px;
  color: #eef6ff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

.strategy-ai-signal-meta {
  margin-top: 4px;
  color: #91a6be;
  font-size: 11px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.strategy-ai-detail-card {
  display: grid;
  gap: 8px;
}

.strategy-ai-detail-line {
  color: #e3eefb;
  font-size: 13px;
  line-height: 1.45;
}

.strategy-ai-detail-list {
  display: grid;
  gap: 5px;
  color: #cbd8e8;
  font-size: 12px;
  line-height: 1.45;
}

.strategy-ai-mini-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.strategy-ai-mini-metrics div {
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.strategy-ai-mini-metrics span {
  color: #8fa4bc;
  font-size: 10px;
  line-height: 1.2;
}

.strategy-ai-mini-metrics strong {
  color: #edf5ff;
  font-size: 12px;
  line-height: 1.25;
}

.strategy-ai-factor-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 8px;
}

.strategy-ai-factor-card {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.015)),
    #171f2b;
  display: grid;
  gap: 8px;
}

.strategy-ai-factor-card.is-changed {
  border-color: rgba(85, 190, 255, 0.36);
  background:
    linear-gradient(180deg, rgba(61, 139, 198, 0.22), rgba(25, 35, 49, 0.36)),
    #172233;
}

.strategy-ai-factor-card.is-shadow {
  border-color: rgba(242, 181, 89, 0.26);
}

.strategy-ai-factor-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.strategy-ai-factor-label {
  color: #a9bed5;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.strategy-ai-factor-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}

.strategy-ai-factor-flow div:not(.strategy-ai-factor-arrow) {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.strategy-ai-factor-flow span {
  color: #8fa4bc;
  font-size: 10px;
  line-height: 1.2;
}

.strategy-ai-factor-flow strong,
.strategy-ai-factor-single {
  color: #f2f8ff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.strategy-ai-factor-arrow {
  color: #79c7ff;
  font-size: 14px;
  font-weight: 700;
}

.strategy-ai-factor-single {
  text-align: center;
}

.strategy-ai-factor-sources {
  min-height: 18px;
}

.strategy-unified-diagnosis-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
}

.strategy-unified-funnel-box {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.strategy-unified-funnel-head {
  display: grid;
  gap: 3px;
}

@media (max-width: 1200px) {
  .strategy-ai-card-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .strategy-ai-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .strategy-ai-context-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .strategy-ai-controls-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .strategy-ai-operating-summary {
    grid-template-columns: 1fr;
  }

  .strategy-ai-summary-chips {
    justify-content: flex-start;
  }

  .strategy-ai-factor-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .strategy-unified-diagnosis-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .strategy-ai-card-row {
    grid-template-columns: 1fr;
  }

  .strategy-ai-card-grid {
    grid-template-columns: 1fr;
  }

  .strategy-ai-card,
  .strategy-ai-card-wide {
    min-height: 0;
  }

  .strategy-ai-card-compact .strategy-ai-card-label,
  .strategy-ai-card-compact .strategy-ai-card-value {
    white-space: normal;
  }

  .strategy-ai-card-value {
    font-size: 14px;
  }

  .strategy-ai-card-rich {
    font-size: 13px;
  }

  .strategy-ai-reason-list {
    grid-template-columns: 1fr;
  }

  .strategy-ai-context-grid,
  .strategy-ai-controls-grid {
    grid-template-columns: 1fr;
  }

  .strategy-ai-control-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .strategy-ai-control-row-value {
    text-align: left;
  }

  .strategy-ai-signal-grid,
  .strategy-ai-mini-metrics,
  .strategy-ai-detail-grid {
    grid-template-columns: 1fr;
  }

  .strategy-ai-change-table {
    min-width: 640px;
  }

  .strategy-ai-factor-grid {
    grid-template-columns: 1fr;
  }

  .strategy-ai-factor-flow {
    grid-template-columns: 1fr;
  }

  .strategy-ai-factor-arrow {
    display: none;
  }
}

.strategy-card-title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 6px 0;
}

.strategy-inside-actions {
  justify-content: flex-end;
}

.range-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.range-wrap input[type="range"] {
  flex: 1;
  min-width: 0;
}

.range-wrap strong {
  min-width: 18px;
  text-align: right;
}

@media (max-width: 768px) {
  .strategy-card-title {
    font-size: 22px;
  }

  .strategy-inside-actions {
    justify-content: stretch;
    flex-wrap: wrap;
  }
}



/* Strategy UI cleanup: title size + equal bottom panel widths */
.strategy-compact .page-title-row h2 {
  font-size: 18px;
}

.strategy-compact .strategy-card-title {
  font-size: 18px;
}

.strategy-bottom-grid {
  grid-template-columns: 1fr 1fr;
}



/* Strategy explain modal + actual variables box */
.strategy-family-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.strategy-inline-button {
  padding: 4px 10px;
  min-height: auto;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.strategy-actual-vars-box {
  gap: 10px;
}

.strategy-filter-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 1px solid rgba(255,255,255,.08);
}

.strategy-filter-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-width: 0;
  border-right: 1px solid rgba(255,255,255,.08);
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.strategy-filter-pair .cell {
  min-width: 0;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.3;
  box-sizing: border-box;
}

.strategy-filter-pair .cell.head {
  font-weight: 700;
  background: rgba(255,255,255,.03);
  border-right: 1px solid rgba(255,255,255,.08);
}

.strategy-filter-pair .cell.value {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 1200px) {
  .strategy-filter-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .strategy-filter-grid-4 {
    grid-template-columns: 1fr;
  }

  .strategy-filter-pair {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .strategy-filter-pair .cell {
    padding: 5px 6px;
    font-size: 11px;
    line-height: 1.25;
  }
}

.strategy-actual-vars-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-soft);
}

.strategy-vars-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

.strategy-var-chip {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.06);
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01)), var(--panel-soft);
}

.strategy-var-label {
  font-size: 11px;
  color: var(--text-soft);
  margin-bottom: 4px;
}

.strategy-var-value {
  font-size: 13px;
  font-weight: 700;
}

.strategy-filter-status {
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.5;
}

.strategy-modal[hidden] {
  display: none;
}

.strategy-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.62);
}

.strategy-modal-card {
  width: min(1100px, 95vw);
  max-height: 88vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(255,255,255,.018), rgba(255,255,255,.01)), var(--panel);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.strategy-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.strategy-modal-header h3 {
  margin: 0;
  font-size: 18px;
}

.strategy-modal-body {
  overflow: auto;
  padding: 18px;
  display: grid;
  gap: 16px;
}

.strategy-modal-body h4 {
  margin: 0 0 6px 0;
  font-size: 16px;
}

.strategy-modal-body p,
.strategy-modal-body li {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
}

.strategy-modal-body ul {
  margin: 0;
  padding-left: 18px;
}

@media (max-width: 768px) {
  .strategy-vars-grid {
    grid-template-columns: 1fr;
  }

  .strategy-modal {
    padding: 12px;
  }

  .strategy-modal-card {
    width: 100%;
    max-height: 92vh;
  }
}

/* Strategy edit table 8 columns / 1:2 ratio override */
#strategy_edit_table.compare-grid-8 {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr) minmax(0, 2fr)
    minmax(0, 1fr) minmax(0, 2fr)
    minmax(0, 1fr) minmax(0, 2fr)
    minmax(0, 1fr) minmax(0, 2fr);
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

#strategy_edit_table.compare-grid-8 .cell {
  min-width: 0;
  box-sizing: border-box;
  padding: 6px 8px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  line-height: 1.3;
}

#strategy_edit_table.compare-grid-8 .cell.head {
  font-weight: 700;
  background: rgba(255, 255, 255, 0.03);
}

#strategy_edit_table.compare-grid-8 .cell.value {
  overflow-wrap: anywhere;
  word-break: break-word;
}

#strategy_edit_table.compare-grid-8 .cell:nth-child(8n) {
  border-right: 0;
}

#strategy_edit_table.compare-grid-8 .cell:nth-last-child(-n+8) {
  border-bottom: 0;
}

#strategy_edit_table.compare-grid-8 .cell.value > select,
#strategy_edit_table.compare-grid-8 .cell.value > input[type="text"],
#strategy_edit_table.compare-grid-8 .cell.value > input[type="time"],
#strategy_edit_table.compare-grid-8 .cell.value > .range-wrap {
  width: 100%;
}

@media (max-width: 1400px) {
  #strategy_edit_table.compare-grid-8 {
    grid-template-columns:
      minmax(0, 1fr) minmax(0, 2fr)
      minmax(0, 1fr) minmax(0, 2fr);
  }

  #strategy_edit_table.compare-grid-8 .cell:nth-child(4n) {
    border-right: 0;
  }

  #strategy_edit_table.compare-grid-8 .cell:nth-last-child(-n+4) {
    border-bottom: 0;
  }
}

@media (max-width: 768px) {
  #strategy_edit_table.compare-grid-8 {
    grid-template-columns:
      minmax(0, 1fr) minmax(0, 2fr);
  }

  #strategy_edit_table.compare-grid-8 .cell:nth-child(2n) {
    border-right: 0;
  }

  #strategy_edit_table.compare-grid-8 .cell:nth-last-child(-n+2) {
    border-bottom: 0;
  }
}


/* Strategy summary cards + session id readonly */
.strategy-summary-cards {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
}

.strategy-summary-card {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
}

.strategy-summary-label {
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.2;
  margin-bottom: 6px;
}

.strategy-summary-value {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.strategy-inline-text {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  color: var(--text);
  font-weight: 400;
  line-height: 1.3;
  background: transparent;
  border: 0;
  border-radius: 0;
  min-height: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.strategy-inline-readonly {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.02);
  color: var(--text);
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 1720px) {
  .strategy-summary-cards {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 1400px) {
  .strategy-summary-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .strategy-summary-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .strategy-summary-value {
    font-size: 14px;
  }
}


/* Strategy summary cards like warroom + change flash */
.strategy-summary-cards {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
}

.strategy-summary-card {
  min-width: 0;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  background: #1a2230;
  padding: 10px 12px;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.strategy-summary-label {
  color: #92a0b2;
  font-size: 12px;
  line-height: 1.35;
  margin-bottom: 6px;
  text-align: center;
}

.strategy-summary-value {
  color: #e7edf6;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 700;
  word-break: break-word;
  text-align: center;
}

.strategy-summary-subvalue {
  margin-top: 2px;
  color: #92a0b2;
  font-size: 11px;
  line-height: 1.25;
  font-weight: 700;
  text-align: center;
  overflow-wrap: anywhere;
}

.strategy-summary-subvalue.is-ok {
  color: #a8f3ca;
}

.strategy-summary-subvalue.is-warning {
  color: #ffe19f;
}

.strategy-applied-cards-shell {
  width: 100%;
}

.strategy-applied-cards {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 8px;
}

.strategy-applied-card {
  min-width: 0;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.012)),
    #17202d;
  padding: 10px 9px;
  display: grid;
  gap: 4px;
  align-content: start;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02);
}

.strategy-applied-card-label {
  color: #8ea0b6;
  font-size: 11px;
  line-height: 1.35;
  word-break: keep-all;
}

.strategy-applied-card-value-row {
  min-height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.strategy-applied-card-value {
  color: #edf3fb;
  font-size: 14px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: center;
}

.strategy-applied-card-meta {
  color: #78c8ff;
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: .01em;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.strategy-applied-card-meta-empty {
  display: none;
}

.strategy-applied-card-sources {
  display: flex;
  justify-content: center;
}

.strategy-applied-card-ai {
  border-color: rgba(94,196,255,.36);
  background:
    linear-gradient(180deg, rgba(94,196,255,.12), rgba(94,196,255,.04)),
    #17202d;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.02),
    0 0 0 1px rgba(94,196,255,.08);
}

.strategy-inline-readonly {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.02);
  color: var(--text);
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 1720px) {
  .strategy-summary-cards {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .strategy-applied-cards {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 1400px) {
  .strategy-summary-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .strategy-applied-cards {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .strategy-summary-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .strategy-summary-value {
    font-size: 14px;
  }

  .strategy-applied-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .strategy-applied-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.strategy-signed-positive {
  color: var(--kr-rise);
}

.strategy-signed-negative {
  color: var(--kr-fall);
}

.strategy-signed-neutral {
  color: var(--text-soft);
}

@keyframes strategyChangeFlashPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(94,196,255,0);
    background: rgba(94,196,255,0);
  }
  12% {
    box-shadow:
      0 0 0 2px rgba(94,196,255,.95),
      0 0 28px rgba(94,196,255,.42);
    background: rgba(94,196,255,.28);
  }
  28% {
    box-shadow:
      0 0 0 2px rgba(94,196,255,.82),
      0 0 22px rgba(94,196,255,.32);
    background: rgba(94,196,255,.20);
  }
  44% {
    box-shadow:
      0 0 0 2px rgba(94,196,255,.92),
      0 0 30px rgba(94,196,255,.45);
    background: rgba(94,196,255,.26);
  }
  100% {
    box-shadow:
      0 0 0 1px rgba(94,196,255,.18),
      0 0 10px rgba(94,196,255,.12);
    background: rgba(94,196,255,.08);
  }
}

.strategy-change-flash {
  border-color: rgba(94,196,255,.95) !important;
  background: rgba(94,196,255,.18) !important;
  animation: strategyChangeFlashPulse 6.5s ease;
  transition:
    background-color .2s ease,
    border-color .2s ease,
    box-shadow .2s ease;
}


/* Strategy summary card flash variants */
@keyframes strategyChangeFlashNeutral {
  0% {
    box-shadow: 0 0 0 0 rgba(94,196,255,0);
    background: rgba(94,196,255,0);
  }
  16% {
    box-shadow:
      0 0 0 2px rgba(94,196,255,.95),
      0 0 28px rgba(94,196,255,.42);
    background: rgba(94,196,255,.24);
  }
  100% {
    box-shadow:
      0 0 0 1px rgba(94,196,255,.16),
      0 0 8px rgba(94,196,255,.10);
    background: rgba(94,196,255,.08);
  }
}

@keyframes strategyChangeFlashUp {
  0% {
    box-shadow: 0 0 0 0 rgba(47,191,113,0);
    background: rgba(47,191,113,0);
  }
  16% {
    box-shadow:
      0 0 0 2px rgba(47,191,113,.95),
      0 0 28px rgba(47,191,113,.42);
    background: rgba(47,191,113,.24);
  }
  100% {
    box-shadow:
      0 0 0 1px rgba(47,191,113,.16),
      0 0 8px rgba(47,191,113,.10);
    background: rgba(47,191,113,.08);
  }
}

@keyframes strategyChangeFlashDown {
  0% {
    box-shadow: 0 0 0 0 rgba(229,83,75,0);
    background: rgba(229,83,75,0);
  }
  16% {
    box-shadow:
      0 0 0 2px rgba(229,83,75,.95),
      0 0 28px rgba(229,83,75,.42);
    background: rgba(229,83,75,.24);
  }
  100% {
    box-shadow:
      0 0 0 1px rgba(229,83,75,.16),
      0 0 8px rgba(229,83,75,.10);
    background: rgba(229,83,75,.08);
  }
}

@keyframes strategyChangeFlashWarn {
  0% {
    box-shadow: 0 0 0 0 rgba(240,180,41,0);
    background: rgba(240,180,41,0);
  }
  16% {
    box-shadow:
      0 0 0 2px rgba(240,180,41,.95),
      0 0 28px rgba(240,180,41,.42);
    background: rgba(240,180,41,.24);
  }
  100% {
    box-shadow:
      0 0 0 1px rgba(240,180,41,.16),
      0 0 8px rgba(240,180,41,.10);
    background: rgba(240,180,41,.08);
  }
}

@keyframes strategyChangeFlashDanger {
  0% {
    box-shadow: 0 0 0 0 rgba(229,83,75,0);
    background: rgba(229,83,75,0);
  }
  16% {
    box-shadow:
      0 0 0 2px rgba(229,83,75,.98),
      0 0 30px rgba(229,83,75,.48);
    background: rgba(229,83,75,.28);
  }
  100% {
    box-shadow:
      0 0 0 1px rgba(229,83,75,.18),
      0 0 10px rgba(229,83,75,.12);
    background: rgba(229,83,75,.10);
  }
}

.strategy-change-flash.strategy-change-neutral {
  border-color: rgba(94,196,255,.95) !important;
  animation: strategyChangeFlashNeutral 2.4s ease;
}

.strategy-change-flash.strategy-change-up {
  border-color: rgba(47,191,113,.95) !important;
  animation: strategyChangeFlashUp 2.4s ease;
}

.strategy-change-flash.strategy-change-down {
  border-color: rgba(229,83,75,.95) !important;
  animation: strategyChangeFlashDown 2.4s ease;
}

.strategy-change-flash.strategy-change-warn {
  border-color: rgba(240,180,41,.95) !important;
  animation: strategyChangeFlashWarn 2.4s ease;
}

.strategy-change-flash.strategy-change-danger {
  border-color: rgba(229,83,75,.98) !important;
  animation: strategyChangeFlashDanger 2.4s ease;
}

.strategy-applied-card.strategy-change-flash.strategy-change-neutral,
.strategy-applied-card.strategy-change-flash.strategy-change-up,
.strategy-applied-card.strategy-change-flash.strategy-change-down,
.strategy-applied-card.strategy-change-flash.strategy-change-warn,
.strategy-applied-card.strategy-change-flash.strategy-change-danger,
.strategy-ai-control-card.strategy-change-flash.strategy-change-neutral,
.strategy-ai-control-card.strategy-change-flash.strategy-change-up,
.strategy-ai-control-card.strategy-change-flash.strategy-change-down,
.strategy-ai-control-card.strategy-change-flash.strategy-change-warn,
.strategy-ai-control-card.strategy-change-flash.strategy-change-danger {
  transform: translateY(-1px);
}



/* Strategy summary / funnel card layout */
.strategy-status-card-box {
  display: grid;
  gap: 10px;
}

.strategy-status-section {
  display: grid;
  gap: 6px;
}

.strategy-status-section-title {
  font-size: 12px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--text-soft);
}

.strategy-status-headline-card {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015)), var(--panel-soft);
}

.strategy-status-headline-value {
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 700;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.strategy-status-chip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.strategy-status-chip {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  background: rgba(255,255,255,.02);
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.strategy-time-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.strategy-time-card {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  background: rgba(255,255,255,.02);
}

.strategy-time-card-label {
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.25;
  margin-bottom: 6px;
}

.strategy-time-card-value {
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
  font-weight: 700;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.strategy-funnel-card-shell {
  display: grid;
  width: 100%;
}

.strategy-funnel-card-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
}

.strategy-funnel-metric-card {
  min-width: 0;
  padding: 10px 9px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.012)),
    #17202d;
  display: grid;
  gap: 4px;
  align-content: start;
  justify-items: center;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02);
}

.strategy-funnel-metric-label {
  width: 100%;
  color: #8ea0b6;
  font-size: 11px;
  line-height: 1.35;
  word-break: keep-all;
  text-align: center;
}

.strategy-funnel-metric-value {
  width: 100%;
  color: #edf3fb;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 1100px) {
  .strategy-status-chip-grid,
  .strategy-time-card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .strategy-funnel-card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .strategy-funnel-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.strategy-time-policy-line {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  background: rgba(255,255,255,.02);
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.content-grid.strategy-bottom-grid {
  grid-template-columns: 1fr 1fr;
}

/* OAI_20260402_STRATEGY_TABLE_ALIGNMENT_V1 */
#current_candidates table th,
#current_candidates table td,
#current_positions table th,
#current_positions table td,
#recent_order_flow table th,
#recent_order_flow table td,
#trade_history table th,
#trade_history table td {
  border-color: rgba(148, 163, 184, 0.18) !important;
}

#current_candidates table thead th,
#current_positions table thead th,
#recent_order_flow table thead th,
#trade_history table thead th {
  text-align: center !important;
}

#current_candidates table tbody td:nth-child(3),
#current_positions table tbody td:nth-child(2),
#current_positions table tbody td:nth-child(3),
#current_positions table tbody td:nth-child(4),
#current_positions table tbody td:nth-child(5),
#recent_order_flow table tbody td:nth-child(6),
#recent_order_flow table tbody td:nth-child(7),
#trade_history table tbody td:nth-child(4),
#trade_history table tbody td:nth-child(5),
#trade_history table tbody td:nth-child(6),
#trade_history table tbody td:nth-child(7) {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
}

#recent_order_flow table thead th,
#trade_history table thead th {
  font-weight: 600 !important;
}

#current_candidates table,
#current_positions table,
#recent_order_flow table,
#trade_history table {
  font-size: 13px !important;
}

.strategy-position-flow {
  margin-top: 3px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

.strategy-position-flow--pending {
  color: #f59e0b;
}

.strategy-position-flow--mismatch {
  color: #f87171;
  font-weight: 700;
}

#recent_order_flow table tbody td,
#trade_history table tbody td {
  font-weight: 500;
}

/* OAI_20260402_STRATEGY_CURRENT_CANDIDATES_CODE_CENTER_V1 */
#current_candidates table thead th:nth-child(2),
#current_candidates table tbody td:nth-child(2) {
  text-align: center !important;
  font-variant-numeric: tabular-nums;
}

/* OAI_20260402_STRATEGY_RECENT_ORDER_FLOW_CENTER_V1 */
#recent_order_flow table thead th:nth-child(2),
#recent_order_flow table tbody td:nth-child(2),
#recent_order_flow table thead th:nth-child(4),
#recent_order_flow table tbody td:nth-child(4) {
  text-align: center !important;
}

#recent_order_flow table tbody td:nth-child(5),
#recent_order_flow .strategy-orderflow-status-cell {
  text-align: left !important;
}

#recent_order_flow .strategy-orderflow-time-text {
  display: inline-block;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

#recent_order_flow .strategy-orderflow-symbol-text {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: inherit;
  line-height: 1.2;
}

.stock-info-trigger {
  appearance: none;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  text-align: inherit;
  cursor: pointer;
}

.stock-info-trigger strong {
  font-weight: 600;
}

.stock-info-trigger:hover,
.stock-info-trigger.is-open {
  color: inherit;
  text-decoration: none;
}

.stock-info-trigger:focus-visible {
  outline: 2px solid rgba(96, 165, 250, 0.9);
  outline-offset: 3px;
  border-radius: 4px;
}

.stock-info-menu {
  position: fixed;
  z-index: 10000;
  min-width: 156px;
  max-width: min(260px, calc(100vw - 16px));
  padding: 8px;
  border: 1px solid rgba(96, 165, 250, 0.42);
  border-radius: 8px;
  background: #101826;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.38);
  color: #eaf2ff;
}

.stock-info-menu[hidden] {
  display: none !important;
}

.stock-info-menu-title {
  padding: 4px 6px 7px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  color: #eaf2ff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-info-menu-links {
  display: grid;
  gap: 3px;
  padding-top: 6px;
}

.stock-info-menu-link {
  display: flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 8px;
  border-radius: 6px;
  color: #f8fbff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

.stock-info-menu-link:hover,
.stock-info-menu-link:focus-visible {
  background: rgba(148, 163, 184, 0.1);
  color: #f8fbff;
  outline: none;
}

#recent_order_flow .strategy-orderflow-status-cell {
  font-size: 13px;
}

#recent_order_flow .strategy-orderflow-status-main {
  display: block;
  font-size: 13px;
  line-height: 1.15;
  font-weight: 500;
}

#recent_order_flow .strategy-orderflow-status-reason {
  display: block;
  margin-top: 4px;
  font-size: inherit;
  line-height: 1.2;
  font-weight: 500;
  color: #f59e0b;
}

#recent_order_flow .strategy-orderflow-qty-text,
#recent_order_flow .strategy-orderflow-price-text {
  display: inline-block;
  white-space: nowrap;
  font-size: inherit;
  line-height: 1.2;
}

/* OAI_20260402_STRATEGY_TODAY_TRADE_HISTORY_ALIGN_V1 */
#trade_history table thead th:nth-child(3),
#trade_history table tbody td:nth-child(3) {
  text-align: center !important;
}

#trade_history table tbody td:nth-child(1),
#trade_history table tbody td:nth-child(2) {
  color: inherit;
}

#trade_history table thead th:nth-child(1),
#trade_history table tbody td:nth-child(1) {
  white-space: nowrap;
}

/* OAI_20260508_STRATEGY_TRADE_HISTORY_PNL_ONE_LINE_V1 */
#trade_history table thead th:nth-child(7),
#trade_history table tbody td:nth-child(7),
#trade_history .strategy-trade-history-pnl-cell {
  white-space: nowrap;
}
