:root {
  --bg: #F7F5F1;
  --surface: #FFFFFF;
  --border: #E1DCD0;
  --text: #22201B;
  --muted: #74705F;
  --accent: #1B2A4A;
  --up: #B23A3A;
  --down: #2C5FA8;
  --down-fill: color-mix(in srgb, var(--down) 40%, transparent); /* 2026-11-26 1분봉·일봉 음봉 몸통 - 파란색 40% 채움 */
  --good: #2E7D4F;
  --warn: #B8860B; /* 2026-10-18 사용자 요청 - PER/PBR/ROE 건전성 배지(건전=good/주의=warn/불량=bad) */
  --bad: #A33636;
  --buy-line: #E3B505; /* 2026-10-28 태쏘C 차트 매수 가격 줄/구름(노랑) */
  --ia-peak-trend: #6FA8DC; /* 2026-10-17 사용자 요청 - 투자A목록 미니차트 산(고점) 추세선/구름 */
  --ia-trough-trend: #E08A8A; /* 골짜기(저점) 추세선/구름 */
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171D;
    --surface: #1A1E25;
    --border: #2B3038;
    --text: #E9E7DF;
    --muted: #98917F;
    --accent: #8FA3CE;
    --up: #D97575;
    --down: #7CA6E2;
    --good: #6FBE8F;
    --warn: #D9A441;
    --bad: #D97575;
    --buy-line: #F2C94C;
    --ia-peak-trend: #8FC1F2;
    --ia-trough-trend: #F2A6A6;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", -apple-system, "Segoe UI", sans-serif;
  line-height: 1.6;
}
.mono { font-family: "Cascadia Code", "D2Coding", Consolas, ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.section-title { margin: 4px 0 -8px; font-size: 14px; font-weight: 600; color: var(--muted); }

/* 2026-10-18 사용자 요청 - 상단 밴드에 날짜 선택기+탭 목록까지 함께 넣어 공간을
   최소화(예전엔 topbar/날짜행/탭행 3줄이었음). 화면이 좁으면 flex-wrap으로 둘째
   줄로 넘어가되, 그래도 예전 3줄보다 훨씬 압축됨. */
.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px 16px;
  padding: 8px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.brand { font-weight: 700; font-size: 16px; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--accent); }
.topbar-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; row-gap: 4px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-date { padding: 3px 6px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text); font-size: 12.5px; }
/* 2026-10-18 사용자 요청 - 날짜 양옆에 하루 전/후 이동 아이콘 */
.topbar-date-group { display: flex; align-items: center; gap: 2px; }
.date-nav-btn {
  border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text);
  font-size: 12px; line-height: 1; padding: 4px 7px; cursor: pointer;
}
.date-nav-btn:hover { border-color: var(--accent); color: var(--accent); }
.tab-nav { display: flex; gap: 2px; flex-wrap: wrap; }
.tab-nav label {
  padding: 4px 9px;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab-nav label:hover { color: var(--text); }
.tab-nav label.is-active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.env-badge { font-family: monospace; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 4px; }
.env-badge-paper { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.env-badge-real { background: color-mix(in srgb, var(--up) 18%, transparent); color: var(--up); }
.topbar-btn { border: 1px solid var(--border); border-radius: 4px; padding: 6px 14px; font-size: 12.5px; font-weight: 600; cursor: pointer; background: var(--surface); color: var(--text); }
.topbar-btn:hover { background: var(--bg); }
.topbar-btn.is-active { background: color-mix(in srgb, var(--accent) 15%, var(--surface)); color: var(--accent); border-color: var(--accent); }

.container { padding: 24px; display: flex; flex-direction: column; gap: 24px; }

.snapshot { display: flex; gap: 24px; flex-wrap: wrap; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 12px 18px; }
.stat-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.stat-value { font-family: monospace; font-size: 18px; font-variant-numeric: tabular-nums; }
.pnl-up { color: var(--up); }
.pnl-down { color: var(--down); }

.empty-note { color: var(--muted); font-size: 13px; }

table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; }
thead th { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); background: var(--bg); }
tbody tr:last-child td { border-bottom: none; }

.toggle-btn { border: 1px solid var(--border); border-radius: 4px; padding: 5px 12px; font-size: 12.5px; cursor: pointer; background: var(--surface); color: var(--muted); }
.toggle-btn.is-active { background: color-mix(in srgb, var(--good) 15%, var(--surface)); color: var(--good); border-color: var(--good); font-weight: 600; }

/* 전략 탭 - 종목 하나에 여러 전략이 걸릴 수 있어(2026-10-13) 전략 칸 안에 버튼으로
   나열한다. 각 버튼은 두 영역: 넓은 왼쪽(사용/사용안함 전환)과 좁은 오른쪽(옵션 보기).
   사용자가 색맹이라 켜짐/꺼짐을 색만으로 구분하지 않도록 글자(●/○)와 글자 굵기도
   같이 바꾼다 - 흐릿한 회색+○+보통굵기(사용안함) vs 선명한 파란색+●+굵게(사용중). */
.strategy-badges-cell { display: flex; flex-wrap: wrap; gap: 4px; }
.strategy-badge { display: inline-flex; align-items: stretch; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.strategy-badge-toggle {
  border: none; background: var(--surface); color: var(--muted); opacity: 0.65;
  font-size: 12px; font-weight: 400; padding: 4px 8px; cursor: pointer; white-space: nowrap;
}
.strategy-badge.is-active .strategy-badge-toggle { color: var(--down); opacity: 1; font-weight: 700; }
.strategy-badge-options {
  border: none; border-left: 1px solid var(--border); background: var(--bg); color: var(--muted);
  font-size: 11px; padding: 4px 6px; cursor: pointer; flex: 0 0 auto;
}
.strategy-badge-options:hover { background: var(--border); }

.panic-sell-btn { border: 1px solid var(--up); border-radius: 4px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; background: var(--surface); color: var(--up); }
.panic-sell-btn:hover { background: color-mix(in srgb, var(--up) 15%, var(--surface)); }
.panic-sell-btn:disabled { opacity: 0.6; cursor: default; }

.filter-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.filter-row label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.filter-row select, .filter-row input[type="date"] { padding: 5px 8px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text); font-size: 13px; }

/* 가격/거래량 축 라벨(candle-chart-axis)은 고정폭, 그래프 본문(candle-chart-plot)만
   가로 스크롤된다 - 그래서 축 숫자가 스크롤과 무관하게 항상 제자리에 보인다. flex 대신
   축을 position:absolute로 왼쪽에 붙이고 본문에 그만큼 margin-left를 줘서, 레이아웃
   계산과 무관하게 두 영역이 절대 겹치지 않도록 확실히 분리한다(54px는 app.js의
   buildCandleChartSvg 안 axisW와 반드시 같은 값이어야 한다 - 하나를 바꾸면 같이 바꿀 것). */
.candle-chart-scroll {
  width: 100%;
  position: relative;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  overflow: hidden;
}
.candle-chart-axis {
  position: absolute;
  left: 0;
  top: 0;
  border-right: 1px solid var(--border);
  background: var(--surface);
  z-index: 1;
}
.candle-chart-plot {
  margin-left: 54px;
  overflow-x: auto;
  position: relative;
}
.candle-chart-axis svg, .candle-chart-plot svg { display: block; }
.candle-hit { cursor: pointer; }
.shape-icon { vertical-align: middle; }
.shape-icon-cell { text-align: center; }
/* 종목 탭의 1/3/5/20/100/400일봉 6개 칸(맨 앞 6열)은 아이콘 크기만큼만 차지하도록 최소
   너비로 줄이고, 남는 공간은 종목/거래량 칸이 가져가게 한다(표 폭 100%는 그대로 유지). */
#symbols-table th:nth-child(-n+6), #symbols-table td:nth-child(-n+6) {
  width: 1%;
  white-space: nowrap;
}
.shape-date { font-family: "Cascadia Code", "D2Coding", Consolas, ui-monospace, monospace; font-size: 10.5px; font-weight: 700; margin-top: 2px; }

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  display: none;
  background: var(--text);
  color: var(--bg);
  font-size: 12px;
  padding: 6px 9px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 5;
}

/* 탭 (라디오 버튼 해킹) - 2026-10-18 사용자 요청으로 날짜 선택기+탭 목록(.tab-nav)을
   상단 topbar 밴드로 옮겨 공간을 아낀다. radio input은 패널과 같은 부모(.tabs)에
   남아있어야 아래 :checked ~ #panel-X 가 동작하지만, .tab-nav는 이제 그 형제가
   아니므로(다른 부모) 활성 탭 표시는 CSS 형제선택자 대신 app.js가 label[for]에
   is-active 클래스를 붙여서 한다(라디오 change 이벤트마다 동기화). */
.tabs { display: flex; flex-direction: column; gap: 16px; }
.tabs input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.tab-panel { display: none; flex-direction: column; gap: 20px; }
/* "기타" 하위 탭 줄(2026-10-26) - 하위 탭이 선택돼 있을 때만 보인다. */
.stt td.stt-def, .p-univ-def { color: var(--muted, #888); white-space: nowrap; font-size: 0.92em; } /* 2026-11-19 반등 기본값 칸 */
.sub-tab-nav { display: none; border-bottom: 1px solid var(--border); padding-bottom: 2px; }
#tab-strategy-o:checked ~ .sub-tab-nav,
#tab-strategy-q:checked ~ .sub-tab-nav,
#tab-gap-up:checked ~ .sub-tab-nav,
#tab-investment-a:checked ~ .sub-tab-nav,
#tab-symbols:checked ~ .sub-tab-nav,
#tab-performance:checked ~ .sub-tab-nav,
#tab-candle-graph-bc1m:checked ~ .sub-tab-nav,
#tab-bc1m-eval:checked ~ .sub-tab-nav,
#tab-candle-graph-bc20s:checked ~ .sub-tab-nav,
#tab-bc20s-eval:checked ~ .sub-tab-nav,
#tab-strategies:checked ~ .sub-tab-nav,
#tab-positions:checked ~ .sub-tab-nav,
#tab-daily-chart:checked ~ .sub-tab-nav { display: flex; }

#tab-dashboard:checked ~ #panel-dashboard,
#tab-gap-up:checked ~ #panel-gap-up,
#tab-investment-a:checked ~ #panel-investment-a,
#tab-investment-b:checked ~ #panel-investment-b,
#tab-investment-c:checked ~ #panel-investment-c,
#tab-day-trading-a:checked ~ #panel-day-trading-a,
#tab-day-trading-b:checked ~ #panel-day-trading-b,
#tab-tasso-a:checked ~ #panel-tasso-a,
#tab-tumae-a:checked ~ #panel-tumae-a,
#tab-tasso-b:checked ~ #panel-tasso-b,
#tab-tasso-c:checked ~ #panel-tasso-c,
#tab-tasso-d:checked ~ #panel-tasso-d,
#tab-strategy-test:checked ~ #panel-strategy-test,
#tab-test:checked ~ #panel-test,
#tab-strategy-m:checked ~ #panel-test,
#tab-strategy-n:checked ~ #panel-test,
#tab-strategy-o:checked ~ #panel-test,
#tab-strategy-p:checked ~ #panel-test,
#tab-strategy-q:checked ~ #panel-test, #tab-strategy-r:checked ~ #panel-test, #tab-strategy-s:checked ~ #panel-test, #tab-strategy-t:checked ~ #panel-test, #tab-strategy-u:checked ~ #panel-test,
#tab-symbols:checked ~ #panel-symbols,
#tab-strategies:checked ~ #panel-strategies,
#tab-positions:checked ~ #panel-positions,
#tab-performance:checked ~ #panel-performance,
#tab-expected:checked ~ #panel-expected,
#tab-candle-graph-bc1m:checked ~ #panel-candle-graph-bc1m,
#tab-bc1m-eval:checked ~ #panel-bc1m-eval,
#tab-candle-graph-bc20s:checked ~ #panel-candle-graph-bc20s,
#tab-bc20s-eval:checked ~ #panel-bc20s-eval,
#tab-daily-chart:checked ~ #panel-daily-chart {
  display: flex;
}

/* 전략 변화 탭 - 구간별 최고 결과 행 강조(색이 아니라 굵은 글자+배경으로, 색맹 고려) */
.variant-best-row { font-weight: 700; background: var(--bg); }

/* 1분봉전략A 평가 탭의 개별종목 평가 내역 - 사용 중(활성)은 청색, 사용안함(비활성)은
   적색(2026-10-07 사용자 요청). --up/--down 토큰이 이미 라이트/다크 모드별 빨강/파랑으로
   정의돼 있어 그대로 재사용한다(이 프로젝트에서 "up"=빨강/"down"=파랑, 국내 증시 관례).
   색만으로 구분하지 않고(색맹 고려) "(사용안함)" 글자 표시를 app.js에서 같이 붙인다. */
.bc1m-active-row { color: var(--down); }
.bc1m-inactive-row { color: var(--up); }

/* 20초봉전략A 평가 탭 - 1분봉전략A 평가 탭과 같은 규칙(사용 중=청색/사용안함=적색). */
.bc20s-active-row { color: var(--down); }
.bc20s-inactive-row { color: var(--up); }

/* 매수/매도 버튼 + 비율 선택 모달 */
.trade-btn { border: 1px solid var(--border); border-radius: 4px; padding: 5px 10px; font-size: 12px; font-weight: 600; cursor: pointer; background: var(--surface); color: var(--text); }
.trade-btn:hover { background: var(--bg); }
.trade-btn:disabled { opacity: 0.6; cursor: default; }
.n-retry-btn.is-current { border: 2px solid var(--text); }
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.modal-box h3 { margin: 0; font-size: 16px; }
.modal-options { display: flex; flex-direction: column; gap: 8px; }
.modal-options label { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.modal-custom { display: flex; align-items: center; gap: 8px; }
.modal-custom input { flex: 1; padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text); font-size: 14px; }
.modal-custom input:disabled { background: var(--bg); color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.modal-price-row { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.price-input { flex: 1; padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text); font-size: 14px; }
/* 2026-10-19 사용자 요청 - 가격 표시 클릭 전환 대신 "시장가" 체크박스로. 체크 중엔
   가격칸이 참고용으로 현재가를 보여주며 잠긴다(흐리게 표시해 "지금은 못 바꿈"을 알림). */
.price-input:disabled { background: var(--bg); color: var(--muted); }
.price-market-toggle { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; cursor: pointer; }
/* 2026-10-19 사용자 요청 - 매수는 "수량x가격" 참고금액, 매도는 "보유 수량"을 모달
   맨 밑에 참고로 보여준다. */
.modal-ref-row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.modal-ref-row span:last-child { color: var(--text); font-weight: 600; }

/* 종목명 클릭 -> 호가창 모달 */
.symbol-link { background: none; border: none; padding: 0; margin: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
.symbol-link:hover { color: var(--text); }
.modal-header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.orderbook-modal-box { width: min(920px, 92vw); max-height: 88vh; overflow-y: auto; }
.orderbook-layout { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.orderbook-panel { flex: 0 0 240px; }
.orderbook-chart-panel { flex: 1 1 420px; min-width: 320px; display: flex; flex-direction: column; gap: 8px; }
.orderbook-table { width: 100%; }
.orderbook-table th, .orderbook-table td { text-align: right; padding: 3px 8px; font-size: 12.5px; border-bottom: none; }
.orderbook-table thead th { text-align: center; padding-bottom: 6px; }
/* 매도/매수 구분을 색으로만 하지 않는다 - 잔량 숫자가 애초에 왼쪽(매도)/오른쪽(매수) 열
   중 하나에만 찍히고 헤더 라벨도 있으므로, 색은 어디까지나 보조 강조일 뿐이다. */
.ob-ask-qty { color: var(--down); }
.ob-bid-qty { color: var(--up); }
.ob-bid-first td { border-top: 2px solid var(--text); }

/* 시장 구분 배지 - 글자 자체가 KOSPI/KOSDAQ를 구분하므로 색은 보조 수단일 뿐(색맹 대응) */
.market-badge { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 11px; font-weight: 600; border: 1px solid currentColor; }
.market-kospi { color: var(--up); }
.market-kosdaq { color: var(--down); }

/* 투자A 목록 탭(2026-10-16) */
.investment-a-pager { justify-content: flex-start; }
.pager-btn {
  padding: 4px 10px; border: 1px solid var(--border); border-radius: 4px;
  background: var(--surface); color: var(--text); font-size: 13px; cursor: pointer;
}
.pager-btn:hover { border-color: var(--accent); color: var(--accent); }
.pager-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.investment-a-grid {
  display: grid; grid-template-columns: 1fr; gap: 16px;
}
/* 2026-10-16 사용자 요청 - 카드를 3열 가로배치로: 1) 종목정보~ROE, 2) 그래프(통째로),
   3) 매칭알람+주문입력. */
.investment-a-card {
  border: 1px solid var(--border); border-radius: 8px; padding: 12px;
  background: var(--surface); display: flex; flex-direction: row; gap: 16px; align-items: stretch;
  flex-wrap: wrap;
}
.ia-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ia-col-info { flex: 1 1 220px; justify-content: flex-start; }
.ia-col-chart { flex: 1 1 280px; min-width: 240px; }
.ia-col-side { flex: 1 1 260px; }
.ia-row1 { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 600; }
.ia-no-data-title { text-decoration: line-through; opacity: 0.6; }
/* 2026-10-17 사용자 요청 - 시가총액/거래량/등락률, PER/PBR/ROE를 각각 한 줄(3칸
   표처럼)로 - 세로로 쌓지 않고 grid로 칸을 맞춘다. */
.ia-row2, .ia-row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 6px; font-size: 12.5px; color: var(--muted); }
.ia-row2 span, .ia-row3 span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ia-change-up { color: var(--up); }
.ia-change-down { color: var(--down); }
.ia-chart-box { width: 100%; }
.ia-chart-box svg { width: 100%; height: auto; display: block; }
/* 2026-10-17 사용자 요청 - 2시간 창을 화살표로 앞뒤 이동(날짜가 과거여도 하루 전체가
   아니라 오늘처럼 2시간씩만 보여주고 그 안에서 이동). 버튼 비활성화는 더 이동할 데이터가
   없다는 뜻 - 색이 아니라 투명도+커서로 구분해 색맹 사용자도 알 수 있게 한다. */
.ia-chart-nav { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 2px; }
.ia-chart-nav-btn {
  border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text);
  font-size: 11px; line-height: 1; padding: 2px 6px; cursor: pointer;
}
.ia-chart-nav-btn:disabled { opacity: 0.35; cursor: default; }
.ia-chart-range-label { font-size: 11px; color: var(--muted); }
.ia-chart-ma20-label { font-size: 11px; color: var(--accent); text-align: left; margin-top: 1px; }
.ia-alarm-box {
  font-size: 12px; color: var(--muted); padding: 4px 6px; border: 1px dashed var(--border);
  border-radius: 4px;
}
.ia-order-row { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.ia-order-inputs { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ia-order-inputs label { display: flex; align-items: center; gap: 4px; color: var(--muted); }
.ia-order-inputs input {
  width: 90px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 4px;
  background: var(--bg); color: var(--text); font-size: 12.5px;
}
.ia-order-preview { display: flex; flex-direction: column; gap: 4px; color: var(--muted); }
.ia-order-actions { display: flex; gap: 8px; }

/* 당일단타매매A 탭(2026-10-18) - 화면 하나에 6종목, 3열x2행 그리드. 카드 자체는
   투자A목록보다 훨씬 단순(순위/종목명+그래프만 - 시세/주문입력 없음). 2026-10-18
   사용자 요청 - 세로를 늘려 6칸이 화면을 꽉 채우도록(그래프 자체의 세로 비율은
   app.js의 SVG priceH를 키워서 늘리고, 카드는 flex:1로 행 높이를 꽉 채운다). */
.day-trading-a-pager { justify-content: flex-start; }
/* 2026-10-19 사용자 요청 - 네비게이션바 오른쪽에 매수/매도/API 보조수집 등 중요
   메시지를 한 줄로 보여주는 로그창 + "..." 버튼(클릭하면 최근 30개를 모달로). */
.dta-log-bar { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; margin-left: 8px; }
.dta-log-text {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12.5px; color: var(--muted); background: var(--surface); border: 1px solid var(--border);
  border-radius: 4px; padding: 5px 10px;
}
.dta-log-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow-y: auto; min-width: 360px; }
.dta-log-list li { display: flex; gap: 10px; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.dta-log-list li:last-child { border-bottom: none; }
.dta-log-time { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.day-trading-a-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; gap: 16px;
}
@media (max-width: 1100px) {
  .day-trading-a-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .day-trading-a-grid { grid-template-columns: 1fr; }
}
.dta-card {
  border: 1px solid var(--border); border-radius: 8px; padding: 12px;
  background: var(--surface); display: flex; flex-direction: column; gap: 8px;
}
.dta-card.is-new-high-200 {
  background: color-mix(in srgb, #2ecc71 22%, var(--surface)); border-color: #2ecc71;
}
.dta-card.is-b-signal {
  background: color-mix(in srgb, #ffd400 15%, var(--surface)); border-color: #e6bf00;
}
.dta-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 600; flex-wrap: wrap; }
.dta-title-left { display: flex; align-items: center; gap: 6px; }
/* 2026-10-19 사용자 요청 - 제목(종목명) 오른쪽에 주가를 약간 띄워서 표시(title-left의
   flex gap이 그 간격을 만들어준다). */
.dta-price { font-size: 12px; font-weight: 500; color: var(--muted); }
/* 2026-10-19 사용자 요청 - 직전 대비 상승/하강 표시. 이 프로젝트의 양봉/음봉 빨강/파랑
   관례와는 별개로, 여기선 사용자가 지정한 그대로 상승=파랑/하강=빨강(var(--down)/
   var(--up) 토큰을 그 뜻대로 가져다 씀 - 토큰 이름이 아니라 실제 색상 기준). */
.dta-price-up { color: var(--down); font-weight: 700; }
.dta-price-down { color: var(--up); font-weight: 700; }
.dta-title-right { display: flex; align-items: center; gap: 8px; }
.dta-watch-label { display: inline-flex; align-items: center; cursor: pointer; }
.dta-watch-checkbox { width: 15px; height: 15px; cursor: pointer; accent-color: var(--accent); }
/* 2026-10-18 사용자 요청 - 카드 우상단 20초/1분/1일 봉 전환 버튼 */
.dta-interval-group { display: flex; gap: 2px; flex-shrink: 0; white-space: nowrap; }
.dta-interval-btn {
  border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--muted);
  font-size: 11px; font-weight: 500; padding: 3px 7px; cursor: pointer;
}
.dta-interval-btn:hover { border-color: var(--accent); color: var(--accent); }
/* 투자B목록 - 대형/중소는 글자(대형N/중소N)로 구분하고, 테두리 모양(실선/점선)도 다르게 */
.ivb-tier { font-size: 12px; font-weight: 700; padding: 1px 6px; border-radius: 4px; }
.ivb-tier-large { border: 2px solid var(--accent); color: var(--accent); }
.ivb-tier-mid { border: 1px dashed var(--muted); color: var(--muted); }
.ivb-flow { font-size: 12px; color: var(--muted); margin: 2px 0 4px; }
.dta-flow { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; cursor: help; }
.dta-flow-label { color: var(--muted); }
.dta-flow-icon { color: var(--text, currentColor); flex: none; }
.dta-flow-pct { font-variant-numeric: tabular-nums; }
.tasso-n { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; margin-right: 8px; }
.tasso-n input { width: 52px; }
.tasso-signal { line-height: 1.5; }
.ivb-flow b { color: var(--text, inherit); }
.dt-search { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; }
.dt-search-input {
  width: 120px; font-size: 12px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 4px;
  background: var(--surface); color: inherit;
}
.dt-search-status { font-size: 12px; color: var(--muted); }
/* 검색으로 찾은 카드 - 색만이 아니라 두꺼운 테두리 모양으로도 구분 */
.dta-card.is-search-hit { outline: 3px solid var(--accent); outline-offset: 2px; }
.dt-default-interval { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; font-size: 12px; color: var(--muted); }
.dta-zoom-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0;
  border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--muted); cursor: pointer;
}
.dta-zoom-btn:hover { border-color: var(--accent); color: var(--accent); }
.dta-zoom-btn.is-active { background: color-mix(in srgb, var(--accent) 15%, var(--surface)); color: var(--accent); border-color: var(--accent); }
.dta-interval-btn.is-active { background: color-mix(in srgb, var(--accent) 15%, var(--surface)); color: var(--accent); border-color: var(--accent); font-weight: 700; }
/* 2026-10-18 사용자 요청 - 시가총액~ROE를 제목 줄 아래 별도 줄로 뺀다. */
.dta-info-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
/* 2026-10-18 사용자 요청 - 제목 옆 시가총액(막대+억 단위 텍스트, "시가총액" 글자는 안 씀) */
.dta-mcap { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--muted); font-weight: 500; }
.dta-mcap-bar-track { width: 36px; height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; flex-shrink: 0; }
.dta-mcap-bar-fill { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
/* 2026-10-18 사용자 요청 - PER/PBR/ROE 건전성 배지. 색맹 사용자 고려(메모리 규칙) -
   색만으로 구분하지 않고 ✓/!/✕ 기호도 같이 넣는다. */
.dta-ratios { display: inline-flex; gap: 3px; }
/* 2026-10-18 사용자 요청 - 라벨(기호+PER/PBR/ROE)과 숫자를 2줄로 줄바꿔서 배지 폭을
   줄인다(가로로 길게 늘어서 제목 줄이 줄바꿈되던 문제 완화). */
.dta-ratio-badge {
  display: inline-flex; flex-direction: column; align-items: center; border: 1px solid; border-radius: 3px;
  padding: 1px 3px; font-size: 9px; font-weight: 700; line-height: 1.25; text-align: center;
}
.dta-ratio-value { font-size: 10px; }
.dta-ratio-good { color: var(--good); border-color: var(--good); background: color-mix(in srgb, var(--good) 15%, var(--surface)); }
.dta-ratio-warn { color: var(--warn); border-color: var(--warn); background: color-mix(in srgb, var(--warn) 15%, var(--surface)); }
.dta-ratio-bad { color: var(--bad); border-color: var(--bad); background: color-mix(in srgb, var(--bad) 15%, var(--surface)); }
/* 2026-10-18 사용자 요청 - 매수/매도/투매 버튼. 차트 높이를 그만큼 줄여서(priceH 조정)
   카드 전체 높이는 기존과 비슷하게 유지한다. */
.dta-trade-actions { display: flex; align-items: center; gap: 6px; }
.dta-trade-actions .trade-btn, .dta-trade-actions .panic-sell-btn { flex: 1; padding: 4px 0; font-size: 11.5px; text-align: center; }
.dta-trade-actions .market-badge { flex-shrink: 0; }
/* 2026-10-18 버그 수정 - flex row(기본값)였던 탓에 svg 옆에 20일선 라벨이 나란히
   밀려나 보였다(의도는 세로로 쌓고 빈 공간만 가운데로 몰아주는 것). column으로
   바꿔 svg 아래에 라벨이 쌓이게 하고, justify-content로 그 묶음 전체를 키 큰 그리드
   줄 안에서 세로 중앙에 둔다. */
.dta-chart-box { width: 100%; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.dta-chart-box svg { width: 100%; height: auto; display: block; }

/* 2026-10-21 - 당일단타매매B 차트 지표 ON/OFF 토글 버튼(네비게이션바 오른쪽) */
.pager-toggle { margin-left: 4px; }
#day-trading-b-opt-midline { margin-left: 14px; }
.pager-toggle.is-on {
  background: color-mix(in srgb, var(--accent) 18%, var(--surface)); color: var(--accent);
  border-color: var(--accent); font-weight: 700;
}
.tasso-longbull { font-weight: 700; color: var(--text); }
.tasso-body { color: var(--muted); }
.estimate-line { text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; margin: 2px 0; }
.rt-status-bar { display: inline-flex; align-items: center; gap: 4px; max-width: 460px; min-width: 0; }
.rt-status-bar .dta-log-text { max-width: 420px; }
.today-orders-wrap { max-height: 65vh; overflow: auto; }
.today-orders { border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.today-orders th, .today-orders td { padding: 4px 8px; border-bottom: 1px solid var(--border); text-align: right; }
.today-orders th:nth-child(-n+3), .today-orders td:nth-child(-n+3) { text-align: left; }
.today-orders th { position: sticky; top: 0; background: var(--surface); color: var(--muted); font-weight: 600; }
.today-orders tr.is-changed td { outline: 2px solid var(--accent); outline-offset: -2px; }
.today-orders tr.is-done td { text-decoration: line-through; color: var(--muted); }
/* 투매반등A 탭(2026-10-26) - 투자A 카드 모양. 매수한 종목은 초록 테두리 + "✔ 매수함" 글자(색만으로 구분하지 않음). */
.investment-a-card.tumae-bought { border: 2px solid var(--good); background: color-mix(in srgb, var(--good) 8%, var(--surface)); }
.tumae-bought-badge { display: inline-block; font-size: 12px; font-weight: 700; color: var(--good); border: 1px solid var(--good); border-radius: 3px; padding: 1px 6px; }
.tumae-signal { font-size: 12.5px; line-height: 1.55; }
.tumae-signal b { font-variant-numeric: tabular-nums; }
.tumae-result { font-size: 12.5px; padding: 4px 6px; border: 1px dashed var(--border); border-radius: 4px; }
.tumae-result-win { border-style: solid; }
.tumae-result-loss { border-style: dotted; }
.tumae-buys { font-size: 12px; color: var(--muted); }
.tumae-new { font-size: 11px; font-weight: 700; border: 1px solid currentColor; border-radius: 3px; padding: 0 4px; margin-left: 4px; }
/* 태쏘B 탭(2026-10-26) - 삼성전자 1분봉 x 6가지 θ. 상태는 띠의 높이(위치)와 글자로 구분 - 색만으로 구분하지 않음. */
.tasso-b-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 16px; }
.tasso-b-card { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: var(--surface); display: flex; flex-direction: column; gap: 6px; }
.tasso-b-title { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; font-size: 13px; }
.tasso-b-stat { font-weight: 400; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tasso-b-card svg { width: 100%; height: auto; display: block; }
.tasso-b-now { font-size: 12px; color: var(--muted); }
.tasso-b-now b { color: var(--text); }
/* 태쏘B 목록 한 행 2종목(2026-10-27), 좁은 화면은 1개 */
#tasso-b-list-grid, #tasso-c-grid, #tasso-d-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1100px) { #tasso-b-list-grid, #tasso-c-grid, #tasso-d-grid { grid-template-columns: 1fr; } }
/* 2026-10-29 태쏘C(+전략시험) 카드 - 차트 3/4, 정보 1/4, 정보 글자 작게 */
#strategy-test-grid, #test-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1100px) { #strategy-test-grid, #test-grid { grid-template-columns: 1fr; } }
:is(#tasso-c-grid, #strategy-test-grid, #test-grid) .investment-a-card { flex-wrap: nowrap; gap: 10px; padding: 10px; }
:is(#tasso-c-grid, #strategy-test-grid, #test-grid) .ia-col-info { flex: 1 1 0; min-width: 0; font-size: 10.5px; gap: 5px; }
:is(#tasso-c-grid, #strategy-test-grid, #test-grid) .ia-col-chart { flex: 3 1 0; min-width: 0; }
:is(#tasso-c-grid, #strategy-test-grid, #test-grid) .ia-row1 { flex-wrap: wrap; gap: 4px; font-size: 11.5px; }
:is(#tasso-c-grid, #strategy-test-grid, #test-grid) .ia-col-info :is(.tumae-signal, .tumae-result, .dta-price, .dta-flow, .trade-btn, .tasso-c-trade-btn, .dta-interval-btn) { font-size: 10px; }
:is(#tasso-c-grid, #strategy-test-grid, #test-grid) .ia-col-info .trade-btn { padding: 3px 7px; }
:is(#tasso-c-grid, #strategy-test-grid, #test-grid) .ia-col-info :is(.market-badge, .dta-mcap) { font-size: 9.5px; }
@media (max-width: 700px) {
  :is(#tasso-c-grid, #strategy-test-grid, #test-grid) .investment-a-card { flex-wrap: wrap; }
  :is(#tasso-c-grid, #strategy-test-grid, #test-grid) :is(.ia-col-info, .ia-col-chart) { flex-basis: 100%; }
}
/* 2026-10-29 신호(매치) 차트 드래그로 앞뒤 보기 - 가로로 끌기, 세로 스크롤은 그대로 */
.signal-list-grid .ia-chart-box > svg { cursor: grab; touch-action: pan-y; user-select: none; }
.signal-list-grid .ia-chart-box.is-dragging > svg { cursor: grabbing; }
.strategy-test-head { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-start; margin: 4px 0 8px; }
.strategy-test-rules { flex: 1 1 420px; font-size: 13px; }
.strategy-test-rules ol { margin: 4px 0 0; padding-left: 20px; line-height: 1.6; }
.strategy-test-summary { flex: 0 1 360px; font-size: 13px; font-variant-numeric: tabular-nums; border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; }
.strategy-test-summary div { display: flex; justify-content: space-between; gap: 12px; }
.tab-subtitle { font-size: 16px; font-weight: 700; margin: 0; }
/* 태쏘C 가상 매매 통계(2026-10-27) - 0분봉 칼만 상태 x 시간대 */
.tasso-c-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .tasso-c-stats { grid-template-columns: 1fr; } }
.tasso-c-stats table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.tasso-c-stats caption { text-align: left; font-weight: 600; font-size: 12.5px; padding: 2px 0 4px; }
.tasso-c-stats th, .tasso-c-stats td { padding: 3px 6px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
.tasso-c-stats th:nth-child(-n+2), .tasso-c-stats td:nth-child(-n+2) { text-align: left; }
.tasso-c-stats th { color: var(--muted); font-weight: 600; }
.tasso-c-stats tr.is-total td { font-weight: 700; }
.tasso-b-compare summary { cursor: pointer; font-size: 13px; color: var(--muted); padding: 4px 0; }
.tasso-b-compare[open] summary { color: var(--text); font-weight: 600; }

/* 태쏘C 자동매매 스위치(2026-10-27) - 지금 모드는 ● 표시 + 굵은 테두리 + 채움(색만으로 구분하지 않음) */
.tasso-c-auto { margin: 8px 0 12px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; }
.tasso-c-auto-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tasso-c-auto-btn { padding: 4px 10px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text); cursor: pointer; }
.tasso-c-auto-btn.is-current { border: 2px solid var(--text); font-weight: 700; background: var(--bg); }
.tasso-c-auto-status { font-size: 12px; color: var(--muted); }
#tasso-c-auto-trades table { margin-top: 6px; font-size: 12px; }
.tasso-c-trade-btn { padding: 2px 6px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text); cursor: pointer; font-size: 12px; }
.tasso-c-trade-btn.is-current { border: 2px solid var(--text); font-weight: 700; }
.tasso-c-trade-btn:disabled { cursor: default; opacity: 0.6; }
/* 2026-10-28 태쏘C - 주시 종목 카드 노란 배경(버튼 글자 "👁 주시 중"으로도 구분), 안내 한 줄 접기, 거래 표 한 줄 + ▲/▼ */
.investment-a-card.is-watched, .investment-a-card:has(.tasso-c-card-actions .tasso-c-trade-btn.is-current) { background: color-mix(in srgb, var(--buy-line) 18%, var(--surface)); }
.tasso-c-desc-row { display: flex; align-items: flex-start; gap: 6px; }
.tasso-c-desc { flex: 1; margin: 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tasso-c-desc.is-open { white-space: normal; }
.tasso-c-desc-more { flex: none; padding: 0 8px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text); cursor: pointer; }
.tasso-c-trade-nav { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; }
.tasso-c-trade-nav-btn { padding: 0 8px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text); cursor: pointer; }
.tasso-c-trade-nav-btn:disabled { opacity: 0.4; cursor: default; }
.tasso-c-held { font-weight: 600; }
/* 2026-10-28 태쏘C 보유 종목 카드는 파란 배경(📦 보유 글자로도 구분). 보유 + 주시면 파란 배경 + 노란 테두리 */
.investment-a-card:has(.tasso-c-held) { background: color-mix(in srgb, var(--down) 16%, var(--surface)); }
.investment-a-card:has(.tasso-c-held):has(.tasso-c-card-actions .tasso-c-trade-btn.is-current) { box-shadow: inset 0 0 0 3px var(--buy-line); }
.tasso-c-summary-btn { margin-left: 24px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text); cursor: pointer; } /* 자동매매 ON/PAUSE/OFF와 떨어뜨림(다른 기능) */
.tasso-c-summary-btn.is-current { border: 2px solid var(--text); font-weight: 700; background: var(--bg); }

/* 전략시험 피벗 구간 특성 표(2026-10-29) */
.stl-seg { display: block; overflow-x: auto; max-width: 100%; border-collapse: collapse; font-size: 10px; margin: 4px 0; font-variant-numeric: tabular-nums; }
.stl-seg th, .stl-seg td { padding: 1px 3px; border-bottom: 1px solid var(--border, #ddd); text-align: right; white-space: nowrap; }
.stl-seg th:first-child, .stl-seg td:first-child { text-align: left; }
.stl-seg th { font-weight: 600; opacity: 0.8; }
.stl-seg .stl-seg-future td { font-style: italic; opacity: 0.6; }
.stl-muted { color: var(--muted); }

/* 테스트 탭 전략 내용 표(2026-10-30) - 구분 | 항목 | 값 */
.stt-wrap { overflow-x: auto; margin-top: 4px; }
.stt { border-collapse: collapse; font-size: 12px; }
.stt th, .stt td { padding: 3px 8px; border: 1px solid var(--border, #ddd); text-align: left; vertical-align: top; }
.stt thead th { font-weight: 600; background: var(--panel-alt, rgba(127, 127, 127, 0.08)); }
.stt tbody th { font-weight: 600; white-space: nowrap; }
.stt-key { white-space: nowrap; }
.stt-val { font-variant-numeric: tabular-nums; }
.stt-cond { white-space: nowrap; text-align: center; }
.stt-off .stt-key, .stt-off .stt-val { opacity: 0.5; text-decoration: line-through; }
/* 2026-11-04 전략J 맨 위 전략시험 차트 */
.test-explore { display: flex; flex-direction: column; gap: 8px; }
.test-explore[hidden] { display: none; }
.test-explore-chart { border: 1px solid var(--border); border-radius: 6px; background: var(--surface); cursor: ew-resize; user-select: none; }
.test-explore-body { display: flex; gap: 10px; align-items: flex-start; }
.test-explore-body > .test-explore-chart { flex: 1 1 auto; min-width: 0; }
.test-explore-table { flex: 0 0 auto; width: 380px; overflow-x: auto; }
.test-explore-table[hidden] { display: none; }
.tex-stt { font-size: 12px; width: 100%; }
.tex-stt th { text-align: left; white-space: nowrap; color: var(--muted); font-weight: 600; }
.tex-stt td { padding: 2px 6px; white-space: nowrap; }
.tex-stt td.mono { white-space: normal; font-size: 11.5px; }
.tex-stt tr.tex-grp > * { border-top: 1px solid var(--border); }
@media (max-width: 900px) { .test-explore-body { flex-direction: column; } .test-explore-table { width: 100%; } }
.test-explore-marks { overflow-x: auto; }
.tex-marks-tbl { font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tex-marks-tbl td, .tex-marks-tbl th { padding: 2px 6px; text-align: right; }
.tex-marks-tbl td:nth-child(-n+2), .tex-marks-tbl th:nth-child(-n+2) { text-align: left; }
.tex-fit-h { margin: 10px 0 4px; font-size: 13px; }
.tex-fit-tbl .tex-fit-total td { font-weight: 700; border-top: 1px solid var(--border, #ccc); }
.tex-mark-row { cursor: pointer; }
.tex-mark-row.is-sel { background: color-mix(in srgb, var(--accent) 14%, transparent); font-weight: 700; }
.test-explore-chart svg { width: 100%; height: auto; display: block; }
.test-explore-chart:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 2026-11-06 테스트 탭 결과 차트 왼쪽 20분선 기울기(n-20~n-1) */
.chart-side-wrap { display: flex; gap: 4px; align-items: stretch; }
.chart-side-main { flex: 1; min-width: 0; }
.chart-side { flex: none; width: 52px; font-size: 9px; line-height: 1.25; font-variant-numeric: tabular-nums; color: var(--text); }
.chart-side-head { font-size: 8.5px; color: var(--muted); margin-bottom: 2px; }
.chart-side-row { display: flex; justify-content: space-between; gap: 2px; white-space: nowrap; }
.chart-side-row span:first-child { color: var(--muted); }

/* 2026-11-09 전략M 탭 - 테스트 탭 화면을 결과 종목(보조선·페이지·카드) 먼저, 검색조건(전략 표·테스트 실행) 아래로 */
#tab-strategy-m:checked ~ #panel-test, #tab-strategy-n:checked ~ #panel-test, #tab-strategy-o:checked ~ #panel-test, #tab-strategy-p:checked ~ #panel-test, #tab-strategy-q:checked ~ #panel-test, #tab-strategy-r:checked ~ #panel-test, #tab-strategy-s:checked ~ #panel-test, #tab-strategy-t:checked ~ #panel-test, #tab-strategy-u:checked ~ #panel-test { display: flex; flex-direction: column; }
#tab-strategy-m:checked ~ #panel-test > *, #tab-strategy-n:checked ~ #panel-test > *, #tab-strategy-o:checked ~ #panel-test > *, #tab-strategy-p:checked ~ #panel-test > *, #tab-strategy-q:checked ~ #panel-test > *, #tab-strategy-r:checked ~ #panel-test > *, #tab-strategy-s:checked ~ #panel-test > *, #tab-strategy-t:checked ~ #panel-test > *, #tab-strategy-u:checked ~ #panel-test > * { order: 5; }
#tab-strategy-m:checked ~ #panel-test > .tasso-c-chart-row, #tab-strategy-n:checked ~ #panel-test > .tasso-c-chart-row, #tab-strategy-o:checked ~ #panel-test > .tasso-c-chart-row, #tab-strategy-p:checked ~ #panel-test > .tasso-c-chart-row, #tab-strategy-q:checked ~ #panel-test > .tasso-c-chart-row, #tab-strategy-r:checked ~ #panel-test > .tasso-c-chart-row, #tab-strategy-s:checked ~ #panel-test > .tasso-c-chart-row, #tab-strategy-t:checked ~ #panel-test > .tasso-c-chart-row, #tab-strategy-u:checked ~ #panel-test > .tasso-c-chart-row { order: 1; }
#tab-strategy-m:checked ~ #panel-test > #strategy-m-auto, #tab-strategy-n:checked ~ #panel-test > #strategy-m-auto, #tab-strategy-o:checked ~ #panel-test > #strategy-m-auto, #tab-strategy-p:checked ~ #panel-test > #strategy-m-auto, #tab-strategy-q:checked ~ #panel-test > #strategy-m-auto, #tab-strategy-r:checked ~ #panel-test > #strategy-m-auto, #tab-strategy-s:checked ~ #panel-test > #strategy-m-auto, #tab-strategy-t:checked ~ #panel-test > #strategy-m-auto, #tab-strategy-u:checked ~ #panel-test > #strategy-m-auto { order: 0; }
#tab-strategy-m:checked ~ #panel-test > .day-trading-a-pager, #tab-strategy-n:checked ~ #panel-test > .day-trading-a-pager, #tab-strategy-o:checked ~ #panel-test > .day-trading-a-pager, #tab-strategy-p:checked ~ #panel-test > .day-trading-a-pager, #tab-strategy-q:checked ~ #panel-test > .day-trading-a-pager, #tab-strategy-r:checked ~ #panel-test > .day-trading-a-pager, #tab-strategy-s:checked ~ #panel-test > .day-trading-a-pager, #tab-strategy-t:checked ~ #panel-test > .day-trading-a-pager, #tab-strategy-u:checked ~ #panel-test > .day-trading-a-pager { order: 2; }
#tab-strategy-m:checked ~ #panel-test > .m-shortcuts, #tab-strategy-n:checked ~ #panel-test > .m-shortcuts, #tab-strategy-o:checked ~ #panel-test > .m-shortcuts, #tab-strategy-p:checked ~ #panel-test > .m-shortcuts, #tab-strategy-q:checked ~ #panel-test > .m-shortcuts, #tab-strategy-r:checked ~ #panel-test > .m-shortcuts, #tab-strategy-s:checked ~ #panel-test > .m-shortcuts, #tab-strategy-t:checked ~ #panel-test > .m-shortcuts, #tab-strategy-u:checked ~ #panel-test > .m-shortcuts { order: 2; }
/* 2026-11-10 전략M 체크한 종목 바로가기 - 1분봉 차트 축소 아이콘 + 이름 */
.m-shortcuts { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.m-shortcuts[hidden] { display: none !important; }
.m-shortcut { display: flex; flex-direction: column; align-items: center; gap: 1px; width: 78px; padding: 2px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); cursor: pointer; }
.m-shortcut:hover, .m-shortcut:focus-visible { border-color: var(--text); }
.m-shortcut-chart { display: block; width: 72px; height: 40px; overflow: hidden; pointer-events: none; }
.m-shortcut-chart svg { display: block; width: 72px; height: 40px; }
.m-shortcut-chart .empty-note { font-size: 8px; margin: 0; }
.m-shortcut-name { font-size: 9px; line-height: 1.1; color: var(--text); white-space: nowrap; }
#tab-strategy-m:checked ~ #panel-test > #test-grid, #tab-strategy-n:checked ~ #panel-test > #test-grid, #tab-strategy-o:checked ~ #panel-test > #test-grid, #tab-strategy-p:checked ~ #panel-test > #test-grid, #tab-strategy-q:checked ~ #panel-test > #test-grid, #tab-strategy-r:checked ~ #panel-test > #test-grid, #tab-strategy-s:checked ~ #panel-test > #test-grid, #tab-strategy-t:checked ~ #panel-test > #test-grid, #tab-strategy-u:checked ~ #panel-test > #test-grid { order: 3; margin-bottom: 16px; }
#tab-strategy-m:checked ~ #panel-test > .strategy-test-head, #tab-strategy-n:checked ~ #panel-test > .strategy-test-head, #tab-strategy-o:checked ~ #panel-test > .strategy-test-head, #tab-strategy-p:checked ~ #panel-test > .strategy-test-head, #tab-strategy-q:checked ~ #panel-test > .strategy-test-head, #tab-strategy-r:checked ~ #panel-test > .strategy-test-head, #tab-strategy-s:checked ~ #panel-test > .strategy-test-head, #tab-strategy-t:checked ~ #panel-test > .strategy-test-head, #tab-strategy-u:checked ~ #panel-test > .strategy-test-head { order: 4; }
#tab-strategy-m:checked ~ #panel-test .filter-row:has(#test-keys), #tab-strategy-n:checked ~ #panel-test .filter-row:has(#test-keys), #tab-strategy-o:checked ~ #panel-test .filter-row:has(#test-keys), #tab-strategy-p:checked ~ #panel-test .filter-row:has(#test-keys), #tab-strategy-q:checked ~ #panel-test .filter-row:has(#test-keys), #tab-strategy-r:checked ~ #panel-test .filter-row:has(#test-keys), #tab-strategy-s:checked ~ #panel-test .filter-row:has(#test-keys), #tab-strategy-t:checked ~ #panel-test .filter-row:has(#test-keys), #tab-strategy-u:checked ~ #panel-test .filter-row:has(#test-keys) { display: none; } /* 전략M 전용 - 시험 전략 고르기 숨김 */
#tab-strategy-m:checked ~ #panel-test tr:has(#test-days), #tab-strategy-n:checked ~ #panel-test tr:has(#test-days), #tab-strategy-o:checked ~ #panel-test tr:has(#test-days), #tab-strategy-p:checked ~ #panel-test tr:has(#test-days), #tab-strategy-q:checked ~ #panel-test tr:has(#test-days), #tab-strategy-r:checked ~ #panel-test tr:has(#test-days), #tab-strategy-s:checked ~ #panel-test tr:has(#test-days), #tab-strategy-t:checked ~ #panel-test tr:has(#test-days), #tab-strategy-u:checked ~ #panel-test tr:has(#test-days) { display: none; } /* 2026-11-09 전략M 탭 - 날짜는 맨 위 날짜 */

/* 2026-11-11 전략N 차트 날짜 역할(검사일·진입일·청산일) - 색과 함께 기호(🔍 ▶ ■)·글자로 */
.n-day-role { display: inline-block; margin: 0 0 4px; padding: 2px 8px; border: 1px solid var(--border); border-radius: 4px; font-size: 12px; color: var(--text); background: var(--surface); }
.n-day-role-검사일 { border-style: dashed; }
.n-day-role-진입일 { border-width: 2px; }
.n-day-role-청산일 { border-width: 2px; border-style: double; border-width: 3px; }

/* 2026-11-11 전략N 종목 이름 아래 진입가(붉은색)·청산가(파란색) - 글자 ▶/■로도 구분 */
.n-prices { display: flex; gap: 10px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 2px 0; }
.n-price-entry { color: #dc2626; }
.n-price-exit { color: #2563eb; }

/* 2026-11-11 전략N 결과 칸 - 진입 결과(실선) / 청산 결과(이중선) 두 덩어리, 테두리 모양으로도 구분 */
.n-sum { padding: 6px 8px; margin-bottom: 8px; border-radius: 4px; }
.n-sum-entry { border: 2px solid rgba(220, 38, 38, 0.5); }
.n-sum-exit { border: 3px double rgba(37, 99, 235, 0.6); }
/* 2026-11-11 사용자 지시 - 전략N 결과 칸은 가로로: 칸 전체 폭, 진입·청산 결과가 각각 한 줄(넘치면 줄바꿈) */
#tab-strategy-n:checked ~ #panel-test .strategy-test-summary, #tab-strategy-o:checked ~ #panel-test .strategy-test-summary, #tab-strategy-p:checked ~ #panel-test .strategy-test-summary, #tab-strategy-q:checked ~ #panel-test .strategy-test-summary, #tab-strategy-r:checked ~ #panel-test .strategy-test-summary, #tab-strategy-s:checked ~ #panel-test .strategy-test-summary, #tab-strategy-t:checked ~ #panel-test .strategy-test-summary, #tab-strategy-u:checked ~ #panel-test .strategy-test-summary { flex: 1 1 100%; order: -1; }
/* 2026-11-18 사용자 지시 - 전략N~Q 탭은 결과 표(진입·청산 결과)를 탭 맨 위에(#test-summary-top), 원래 자리(#test-summary)는 숨김 */
#test-summary-top { display: none; }
#tab-strategy-n:checked ~ #panel-test > #test-summary-top, #tab-strategy-o:checked ~ #panel-test > #test-summary-top, #tab-strategy-p:checked ~ #panel-test > #test-summary-top, #tab-strategy-q:checked ~ #panel-test > #test-summary-top, #tab-strategy-r:checked ~ #panel-test > #test-summary-top, #tab-strategy-s:checked ~ #panel-test > #test-summary-top, #tab-strategy-t:checked ~ #panel-test > #test-summary-top, #tab-strategy-u:checked ~ #panel-test > #test-summary-top { display: block; order: -4; margin-bottom: 8px; }
#tab-strategy-n:checked ~ #panel-test > #test-summary-top:empty, #tab-strategy-o:checked ~ #panel-test > #test-summary-top:empty, #tab-strategy-p:checked ~ #panel-test > #test-summary-top:empty, #tab-strategy-q:checked ~ #panel-test > #test-summary-top:empty, #tab-strategy-r:checked ~ #panel-test > #test-summary-top:empty, #tab-strategy-s:checked ~ #panel-test > #test-summary-top:empty, #tab-strategy-t:checked ~ #panel-test > #test-summary-top:empty, #tab-strategy-u:checked ~ #panel-test > #test-summary-top:empty { display: none; }
#tab-strategy-n:checked ~ #panel-test #test-summary, #tab-strategy-o:checked ~ #panel-test #test-summary, #tab-strategy-p:checked ~ #panel-test #test-summary, #tab-strategy-q:checked ~ #panel-test #test-summary, #tab-strategy-r:checked ~ #panel-test #test-summary, #tab-strategy-s:checked ~ #panel-test #test-summary, #tab-strategy-t:checked ~ #panel-test #test-summary, #tab-strategy-u:checked ~ #panel-test #test-summary { display: none; }
.strategy-test-summary .n-sum { display: flex; flex-wrap: wrap; justify-content: flex-start; align-items: baseline; gap: 4px 18px; }
.strategy-test-summary .n-sum > div { display: inline-flex; gap: 6px; }
.strategy-test-summary .n-sum > div > span { color: var(--muted, #6b7280); }
.strategy-test-summary .n-sum > b:first-child { margin-right: 6px; }

/* 2026-11-12 전략N 진입용·청산용 체크 */
.n-checks { display: flex; gap: 8px; margin: 2px 0; font-size: 12px; }
.n-check { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px; border-radius: 4px; cursor: pointer; }
.n-check-entry { border: 1px solid #dc2626; color: #dc2626; }
.n-check-exit { border: 2px double #2563eb; color: #2563eb; }
.n-check:has(input:checked) { font-weight: 700; background: rgba(250, 204, 21, 0.25); }

/* 2026-11-14 전략P - 맨 위 종목 고르기, [표] 한 줄 보기 */
#tab-strategy-p:checked ~ #panel-test > #p-top, #tab-strategy-q:checked ~ #panel-test > #p-top, #tab-strategy-r:checked ~ #panel-test > #p-top, #tab-strategy-s:checked ~ #panel-test > #p-top, #tab-strategy-t:checked ~ #panel-test > #p-top, #tab-strategy-u:checked ~ #panel-test > #p-top { order: -2; }
#tab-strategy-p:checked ~ #panel-test > #strategy-n-auto, #tab-strategy-r:checked ~ #panel-test > #strategy-n-auto, #tab-strategy-s:checked ~ #panel-test > #strategy-n-auto, #tab-strategy-t:checked ~ #panel-test > #strategy-n-auto, #tab-strategy-u:checked ~ #panel-test > #strategy-n-auto { order: -3; } /* 2026-11-17 사용자 지시 - 전략P 자동매매 버튼은 맨 위 */
.p-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.p-table th, .p-table td { border-bottom: 1px solid var(--border, #ddd); padding: 4px 6px; text-align: left; vertical-align: middle; white-space: nowrap; }
.p-table td .dta-info-row { margin: 0; }
.p-table-wrap { overflow-x: auto; width: 100%; grid-column: 1 / -1; }
#tab-strategy-p:checked ~ #panel-test tr:has(#test-universe), #tab-strategy-q:checked ~ #panel-test tr:has(#test-universe), #tab-strategy-r:checked ~ #panel-test tr:has(#test-universe), #tab-strategy-s:checked ~ #panel-test tr:has(#test-universe), #tab-strategy-t:checked ~ #panel-test tr:has(#test-universe), #tab-strategy-u:checked ~ #panel-test tr:has(#test-universe) { display: none; } /* 종목은 맨 위 고르기 */
.p-table td.p-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* 2026-11-18 전략Q 청산 항목별 시간 창 */
.q-win { margin-top: 3px; font-size: 12px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.q-win input[type="time"] { width: 7em; }
.q-win-note { font-size: 11px; color: var(--muted); }
.q-win-chk { display: inline-flex; gap: 3px; align-items: center; margin-left: 6px; font-size: 11px; white-space: nowrap; }
/* 2026-11-18 입력칸 값이 아직 [테스트 실행]으로 적용 안 됨 */
.test-rn[data-pending="1"] { outline: 2px dashed #d97706; outline-offset: 1px; }

/* 2026-11-20 반등A·B·C 화면 조건 ≠ 자동매매 저장 조건 경고 */
.n-auto-diff { color: #d32f2f; font-weight: 700; font-size: 17px; margin: 0 0 6px; }
.n-auto-diff .n-auto-diff-items { display: block; font-size: 12px; font-weight: 400; margin-top: 2px; }

/* 2026-11-20 반등A·B·C 1분 차트 돋보기 */
.mz-wrap { position: relative; }
.mz-btn { position: absolute; top: 2px; left: 50%; transform: translateX(-50%); z-index: 2; line-height: 0; padding: 2px 5px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 4px; cursor: pointer; }
.mz-btn:hover { border-color: var(--text); }
.mz-wrap.mz-picking svg { cursor: zoom-in; }
.mz-wrap.mz-zoomed svg { cursor: grab; touch-action: none; }
.mz-wrap.mz-dragging svg { cursor: grabbing; }
.rebound-budget{margin:10px 0;padding:8px 10px;border:1px solid #ccc;border-radius:6px;display:flex;flex-wrap:wrap;gap:6px 12px;align-items:center}
.rebound-budget input{width:130px}
.rebound-budget .rebound-note{flex-basis:100%;font-size:12px}
.web-user-box{display:inline-flex;gap:6px;align-items:center;margin-right:8px}
.web-user-box .web-user-name{font-weight:700}
.web-users-box{min-width:520px;max-width:92vw}
.web-users-box table{border-collapse:collapse;width:100%}
.web-users-box td,.web-users-box th{border-bottom:1px solid #ddd;padding:4px 8px;text-align:left}
.web-users-form{display:flex;flex-wrap:wrap;gap:6px 12px;align-items:center}
body.is-viewer .viewer-locked{opacity:.45;cursor:not-allowed}
.viewer-banner{background:#fff3cd;color:#5c4400;border:1px solid #d9b44a;border-radius:6px;padding:6px 10px;margin:6px 0;font-weight:700}
.viewer-toast{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);background:#333;color:#fff;padding:8px 14px;border-radius:6px;z-index:9999;font-weight:700}
/* 2026-11-20 사용자 지시 - 반등A·B·C 하단 [▶ 테스트 실행] 버튼 삭제 */
#tab-strategy-r:checked ~ #panel-test #test-run-btn, #tab-strategy-s:checked ~ #panel-test #test-run-btn, #tab-strategy-t:checked ~ #panel-test #test-run-btn, #tab-strategy-u:checked ~ #panel-test #test-run-btn, #tab-strategy-p:checked ~ #panel-test #test-run-btn { display: none; }

/* 2026-11-23 예상이익 탭 */
#expected-root { display: flex; flex-direction: column; gap: 18px; }
.exp-head { display: flex; flex-direction: column; gap: 6px; }
.exp-state { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.exp-pend { margin: 0; color: var(--muted, #888); }
.exp-strat h3 { margin: 0 0 6px; font-size: 1.05em; }
.exp-sub-h { font-weight: normal; font-size: 0.85em; color: var(--muted, #888); }
.exp-strat .table-wrap { overflow-x: auto; }
.exp-table { border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 0.9em; }
.exp-table th, .exp-table td { padding: 3px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; text-align: left; }
.exp-table td.num, .exp-sub td.num, .exp-table th, .exp-sub th { text-align: right; }
.exp-table .muted, .exp-sub .muted { color: var(--muted, #888); }
.exp-click { cursor: pointer; }
.exp-click:hover { background: rgba(127, 127, 127, 0.08); }
.exp-total td { font-weight: bold; border-top: 2px solid var(--border); }
.exp-sub { border-collapse: collapse; margin: 2px 0 6px 18px; font-size: 0.95em; }
.exp-sub th, .exp-sub td { padding: 2px 8px; border-bottom: 1px dotted var(--border); white-space: nowrap; text-align: left; }
.exp-ctl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.exp-ctl-l { font-weight: bold; margin-left: 6px; }
.exp-pick { cursor: pointer; padding: 2px 8px; border: 1px solid var(--border); border-radius: 4px; }
.exp-pick input { display: none; }
.exp-pick.on, .exp-mode.on { font-weight: bold; border-width: 2px; }
.exp-mode { padding: 2px 8px; }
.exp-var input { width: 90px; text-align: right; }
