  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html, body { height: 100%; }
  /* 모바일 동적 viewport 대응 (iOS Safari 주소창 표시/숨김에 따라 vh 변동) */
  /* min-height: 100vh 사용 시 100vh > 100dvh일 때 body가 화면보다 커져 잘림 */
  body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #0f1117; color: #e2e8f0; display: flex; overflow: hidden; height: 100dvh; min-height: 100dvh; max-height: 100dvh; }
  @supports not (height: 100dvh) {
    body { height: 100vh; min-height: 100vh; max-height: 100vh; }
  }

  /* ── 좌측 사이드바 ── */
  #sidebar { width: 220px; background: #161b22; border-right: 1px solid #21262d; display: flex; flex-direction: column; flex-shrink: 0; height: 100%; min-height: 0; }
  #sidebar-title { padding: 14px 14px 11px; font-size: 15px; font-weight: 700; color: #e2e8f0; border-bottom: 1px solid #21262d; flex-shrink: 0; }
  .sidebar-label { padding: 6px 14px 3px; font-size: 10px; font-weight: 600; letter-spacing: 1px; color: #6e7681; text-transform: uppercase; }

  /* 스크롤 영역 (섹터 + Members) */
  #sidebar-scroll { flex: 1; overflow-y: auto; min-height: 0; }
  #sidebar-scroll::-webkit-scrollbar { width: 6px; }
  #sidebar-scroll::-webkit-scrollbar-thumb { background: #30363d; border-radius: 3px; }

  /* 섹터 진행 박스 — 컴팩트 */
  #sector-box { margin: 8px 10px 0; background: #1c2128; border: 1px solid #30363d; border-radius: 8px; padding: 8px 11px; }
  #sector-name { font-size: 13.5px; font-weight: 700; color: #e2e8f0; display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
  #sector-count { font-size: 10.5px; font-weight: 600; color: #6e7681; font-variant-numeric: tabular-nums; }
  #sector-phase { font-size: 10.5px; color: #8b949e; margin-top: 2px; }
  .progress-track { background: #21262d; border-radius: 3px; height: 3px; margin-top: 6px; }
  .progress-fill { height: 3px; border-radius: 3px; background: #388bfd; transition: width .4s; }
  #sector-stocks { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 3px; }
  .stock-badge { font-size: 9.5px; padding: 1.5px 6px; border-radius: 10px; background: #21262d; color: #8b949e; }
  .stock-badge.current { background: #1f6feb; color: #fff; }
  .stock-badge.done { background: #1a7f37; color: #fff; }

  /* 멤버 */
  .member { padding: 4px 12px; font-size: 13px; display: flex; align-items: center; gap: 8px; border-radius: 4px; margin: 1px 8px; cursor: pointer; }
  .member:hover { background: #21262d; }
  .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
  .member-name { font-weight: 600; }
  .member-sub { font-size: 10px; color: #6e7681; padding: 0 20px 3px; line-height: 1.5; }

  /* 고정 하단 영역 (토큰 + Live) */
  #sidebar-bottom { flex-shrink: 0; border-top: 1px solid #21262d; background: #161b22; }

  /* ── 토큰 패널 — 미니멀 무채색 ──────────────────── */
  #token-box { padding: 11px 13px 12px; border-bottom: 1px solid #21262d; }
  #token-box .tb-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; cursor: pointer; user-select: none; }
  #token-box .tb-title { font-size: 11px; font-weight: 600; color: #c9d1d9; display: flex; align-items: center; gap: 6px; letter-spacing: .01em; }
  #token-box .tb-chev { font-size: 8px; color: #6e7681; transition: transform .15s; transform: rotate(90deg); display: inline-block; }
  #token-box.collapsed .tb-chev { transform: rotate(0deg); }
  #token-box .tb-status { font-size: 9.5px; padding: 2px 7px 2px 6px; border-radius: 4px; font-weight: 600; color: #adb6c0; background: transparent; border: 1px solid #30363d; display: inline-flex; align-items: center; gap: 4px; }
  #token-box .tb-status-dot { width: 6px; height: 6px; border-radius: 50%; background: #3fb950; display: inline-block; }
  #token-box .tb-status.exhausted { color: #f85149; border-color: rgba(248,81,73,.4); }
  #token-box .tb-status.exhausted .tb-status-dot { background: #f85149; }

  /* 게이지 — 남은 %에 따라 초록→노랑→주황→빨강 단계 */
  #token-box .tb-gauge-track { background: #0d1117; border: 1px solid #21262d; border-radius: 3px; height: 8px; overflow: hidden; cursor: help; }
  #token-box .tb-gauge-fill { height: 100%; transition: width .5s ease, background .3s; background: linear-gradient(90deg, #2ea043, #3fb950, #56d364); }
  /* 60~100% 남음 — 초록 그라데이션 */
  #token-box .tb-gauge-fill.ok      { background: linear-gradient(90deg, #2ea043, #3fb950, #56d364); }
  /* 35~60% — 황록 */
  #token-box .tb-gauge-fill.caution { background: linear-gradient(90deg, #bf8700, #d4a017, #f0b429); }
  /* 15~35% — 주황 */
  #token-box .tb-gauge-fill.warn    { background: linear-gradient(90deg, #d2691e, #f0883e, #f7a04a); }
  /* 0~15% — 빨강 깜빡 */
  #token-box .tb-gauge-fill.danger  { background: linear-gradient(90deg, #c93c37, #f85149, #ff7b72); animation: gauge-blink 1.2s ease-in-out infinite; }
  /* 회복 완료 — 빛나는 초록 펄스 */
  #token-box .tb-gauge-fill.recovered { background: linear-gradient(90deg, #2ea043, #3fb950, #7ee787, #3fb950, #2ea043); background-size: 200% 100%; animation: gauge-flow 2s linear infinite, gauge-glow 1.6s ease-in-out infinite; }
  /* 회복 대기 polling — 회색 천천히 흐름 */
  #token-box .tb-gauge-fill.polling { background: linear-gradient(90deg, #6e7681, #8b949e, #6e7681); background-size: 200% 100%; animation: gauge-flow 4s linear infinite; }
  /* 한도 미설정 (calibrate 전) — 옅은 파랑 */
  #token-box .tb-gauge-fill.unset   { background: linear-gradient(90deg, #30363d, #4a5563); }

  @keyframes gauge-flow { 0% { background-position: 0% 0; } 100% { background-position: 200% 0; } }
  @keyframes gauge-blink { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }
  @keyframes gauge-glow { 0%,100% { box-shadow: 0 0 0 0 rgba(126,231,135,0); } 50% { box-shadow: 0 0 6px 1px rgba(126,231,135,.7); } }

  /* 잔여/누적 한 줄 — wrap 방지 */
  #token-box .tb-gauge-labels { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; margin-top: 7px; font-variant-numeric: tabular-nums; white-space: nowrap; }
  #token-box .tb-remain { font-size: 12px; font-weight: 700; color: #e2e8f0; white-space: nowrap; }
  #token-box .tb-remain-sub { font-size: 9.5px; color: #6e7681; margin-left: 3px; font-weight: 400; }
  #token-box .tb-total { font-size: 10px; color: #6e7681; flex-shrink: 0; white-space: nowrap; }
  #token-box .tb-sub { font-size: 9.5px; color: #6e7681; margin-top: 2px; font-variant-numeric: tabular-nums; }

  /* 펼침 영역 */
  #token-box .tb-detail { display: block; margin-top: 11px; padding-top: 10px; border-top: 1px solid #21262d; font-size: 10px; color: #8b949e; line-height: 1.55; }
  #token-box.collapsed .tb-detail { display: none; }

  /* 최근 충전 — 한 줄 컴팩트 */
  #token-box #tb-last-donation { display: none; padding: 3px 0 7px; font-size: 10px; color: #8b949e; line-height: 1.4; border-bottom: 1px solid #21262d; margin-bottom: 7px; }
  #token-box #tb-last-donation .ld-row { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
  #token-box #tb-last-donation .ld-label { color: #6e7681; font-size: 9.5px; }
  #token-box #tb-last-donation .ld-tokens { color: #3fb950; font-weight: 700; }
  #token-box #tb-last-donation .ld-meta { color: #6e7681; font-size: 9.5px; margin-left: auto; }

  /* 충전 안내 — 차분히 */
  #token-box .tb-tagline { font-size: 10px; color: #8b949e; margin-bottom: 7px; line-height: 1.55; }
  #token-box .tb-account { font-family: ui-monospace, SFMono-Regular, monospace; color: #c9d1d9; font-size: 10.5px; display: block; user-select: all; cursor: copy; word-break: break-all;
    background: transparent; border: 1px solid #30363d; border-radius: 4px; padding: 6px 8px; text-align: center; transition: border-color .15s, color .15s; }
  #token-box .tb-account:hover { border-color: #58a6ff; color: #58a6ff; }
  #token-box .tb-footnote { margin-top: 7px; color: #6e7681; font-size: 9.5px; line-height: 1.55; text-align: center; }

  #token-box .tb-owner-actions { margin-top: 8px; display: flex; justify-content: center; }
  #token-box .tb-add-btn { background: transparent; border: 1px solid #30363d; color: #8b949e; padding: 4px 14px; border-radius: 4px; font-size: 10.5px; font-weight: 600; cursor: pointer; transition: all .15s; }
  #token-box .tb-add-btn:hover { background: #21262d; color: #c9d1d9; border-color: #58a6ff; }

  /* 위급 — 펄스 제거, 보더 색만 변경 */
  #token-box.exhausted-warn { border-bottom-color: rgba(248,81,73,.4); }

  /* Live 시황 — 원래 인라인 한 줄 구조, 하단에 여유 공간 */
  #market-ticker { padding: 8px 12px 20px; font-size: 11px; color: #6e7681; line-height: 1.8; }
  #market-ticker .live { color: #3fb950; font-weight: 600; }

  /* 읽기 전용 모드 — 익명 접속자 */
  body.readonly #btn-pause, body.readonly #btn-play,
  body.readonly #btn-summary, body.readonly #btn-main-run, body.readonly #btn-sub-run { display: none !important; }
  /* owner 전용 — visitor 모드면 숨김 (재사용 클래스) */
  body.readonly .owner-only { display: none !important; }
  /* visitor 전용 — admin 모드면 숨김 */
  body.admin-mode .visitor-only { display: none !important; }
  /* 방문자 모드 — 토큰/계좌/후원 관련 UI 전부 숨김 (운영 안정화 전까지 외부 노출 X) */
  body.readonly #token-box { display: none !important; }
  body.readonly .msg-donation,
  body.readonly .msg-donation-system { display: none !important; }
  /* Members 행도 visitor엔 클릭 안 되는 느낌 */
  body.readonly .member { cursor: default; }
  body.readonly .member:hover { background: transparent; }
  body.readonly #visitor-timers { display: none !important; }
  /* visitor 모드 카운트다운 (메인·서브 다음 실행 시간) */
  #visitor-timers { display: none; gap: 12px; align-items: center; font-size: 11px;
    color: #8b949e; font-variant-numeric: tabular-nums; }
  #visitor-timers .vt-item { display: inline-flex; align-items: baseline; gap: 4px; }
  #visitor-timers .vt-label { font-size: 9.5px; color: #6e7681; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
  #visitor-timers .vt-val { color: #c9d1d9; font-weight: 600; font-size: 11.5px; }
  #visitor-timers .vt-val.running { color: #3fb950; }
  @media (max-width: 480px) {
    #visitor-timers { font-size: 10px; gap: 8px; }
    #visitor-timers .vt-label { font-size: 9px; }
    #visitor-timers .vt-val { font-size: 10.5px; }
  }
  body.readonly #typing { display: none; }
  /* visitor 모드 — input·전송 버튼 숨기고 안내 banner 표시 */
  /* 채팅 공개 — 입력창·전송·대기열은 방문자에게도 표시 (owner 전용 기능은 .owner-only 등으로 별도 숨김 유지) */

  /* 안내 박스 — owner엔 숨김, visitor에서 표시 */
  #readonly-notice { display: none; align-items: center; gap: 8px; flex: 1;
    padding: 9px 12px; background: #1c2128; border: 1px dashed #30363d;
    border-radius: 6px; color: #8b949e; font-size: 12.5px; line-height: 1.4;
    min-width: 0; }
  #readonly-notice .rn-icon { font-size: 14px; flex-shrink: 0; }
  #readonly-notice .rn-text { min-width: 0; overflow: hidden; }
  #readonly-notice .rn-text b { color: #c9d1d9; font-weight: 600; }
  @media (max-width: 480px) {
    #readonly-notice { font-size: 11.5px; padding: 8px 10px; gap: 6px; }
    #readonly-notice .rn-icon { font-size: 13px; }
  }

  /* 안내 박스 — owner엔 숨김, visitor에선 표시 */
  #readonly-notice { display: none; align-items: center; gap: 8px; flex: 1;
    padding: 9px 12px; background: #1c2128; border: 1px dashed #30363d;
    border-radius: 6px; color: #8b949e; font-size: 12.5px; line-height: 1.4;
    min-width: 0; }
  #readonly-notice .rn-icon { font-size: 14px; flex-shrink: 0; }
  #readonly-notice .rn-text { min-width: 0; overflow: hidden; }
  #readonly-notice .rn-text b { color: #c9d1d9; font-weight: 600; }
  @media (max-width: 480px) {
    #readonly-notice { font-size: 11.5px; padding: 8px 10px; gap: 6px; }
    #readonly-notice .rn-icon { font-size: 13px; }
  }

  /* ── 메인 채팅 ── */
  #main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; }
  #chat-header { padding: 10px 16px; border-bottom: 1px solid #21262d; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; background: #161b22; }
  #chat-header h2 { font-size: 14px; font-weight: 600; }
  .sub { font-size: 11px; color: #6e7681; margin-left: 8px; }
  .btn { border: none; border-radius: 6px; padding: 5px 11px; font-size: 12px; cursor: pointer; font-weight: 500; }
  .btn-ghost { background: #21262d; color: #8b949e; border: 1px solid #30363d; }
  .btn-play { background: #1a7f37; color: #fff; }
  .btn-play.playing { background: #b62324; color: #fff; }
  .btn-group { display: flex; gap: 6px; }
  a.btn { display: inline-flex; align-items: center; text-decoration: none; }

  #messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; overflow-anchor: none; }
  #msg-anchor { height: 1px; flex-shrink: 0; }
  .msg-system { text-align: center; }
  .msg-system span { background: #1c2128; border: 1px solid #30363d; color: #8b949e; font-size: 11px; padding: 3px 14px; border-radius: 10px; }
  /* 후원 라운드 메시지 — 초록 톤으로 강조 */
  .msg-donation-system span { background: rgba(63,185,80,.12); border-color: rgba(63,185,80,.35); color: #3fb950; font-weight: 600; }
  .msg-donation { background: linear-gradient(90deg, rgba(63,185,80,.08), transparent 80%); border-left: 3px solid #3fb950; padding: 6px 10px 6px 8px; border-radius: 0 8px 8px 0; }
  .msg-donation .msg-bubble { background: #0d1d10; border-color: rgba(63,185,80,.3); }
  .msg { display: flex; gap: 10px; align-items: flex-start; }
  .msg.user-msg { flex-direction: row-reverse; }
  .avatar { width: 34px; height: 34px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; flex-shrink: 0; border: 2px solid; }
  .msg-body { max-width: 500px; }
  .msg.user-msg .msg-body { text-align: right; }
  .msg-meta { font-size: 11px; color: #6e7681; margin-bottom: 3px; display: flex; align-items: baseline; gap: 5px; }
  .msg.user-msg .msg-meta { flex-direction: row-reverse; }
  .msg-name { font-weight: 700; font-size: 13px; }
  .msg-bubble { font-size: 13px; line-height: 1.65; padding: 8px 12px; border-radius: 0 8px 8px 8px; background: #1c2128; border: 1px solid #30363d; display: inline-block; text-align: left; }
  .msg.user-msg .msg-bubble { border-radius: 8px 0 8px 8px; background: #1f6feb; border-color: #388bfd; color: #fff; }
  .decision-buy  { color: #3fb950; font-weight: 700; }
  .decision-sell { color: #f85149; font-weight: 700; }
  .decision-hold { color: #d29922; font-weight: 700; }

  #typing { display: none; align-items: center; gap: 8px; padding: 4px 16px; }
  .typing-dots { font-size: 11px; color: #6e7681; }
  #input-area { padding: 10px 16px; border-top: 1px solid #21262d; display: flex; gap: 8px; flex-shrink: 0; }
  #input-area input { flex: 1; min-width: 0; -webkit-appearance: none; appearance: none; background: #1c2128; border: 1px solid #30363d; border-radius: 8px; padding: 9px 12px; color: #e2e8f0; font-size: 13px; line-height: 1.4; outline: none; }
  #input-area input::placeholder { color: #6e7681; }
  #input-area input:focus { border-color: #388bfd; }
  #input-area button { -webkit-appearance: none; appearance: none; background: #1f6feb; border: none; color: #fff; padding: 9px 16px; border-radius: 8px; font-size: 13px; cursor: pointer; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
  #chat-queue { padding: 0 16px; flex-shrink: 0; font-size: 11px; color: #8b949e; }
  #chat-queue:empty { display: none; }
  #chat-queue .cq-head { display: flex; justify-content: space-between; align-items: center; padding: 7px 0 4px; }
  #chat-queue .cq-cap { color: #6e7681; font-variant-numeric: tabular-nums; }
  #chat-queue.closed .cq-cap { color: #f85149; font-weight: 600; }
  #chat-queue .cq-list { list-style: none; margin: 0 0 6px; padding: 0; max-height: 84px; overflow-y: auto; }
  #chat-queue .cq-item { display: flex; gap: 6px; padding: 2px 0; }
  #chat-queue .cq-pos { color: #58a6ff; flex-shrink: 0; font-variant-numeric: tabular-nums; }
  #chat-queue .cq-prev { color: #adb6c0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #chat-queue .cq-empty { color: #6e7681; padding: 1px 0 6px; }
  /* 면책 푸터 (상시 — 안전장치 2/3) */
  #chat-disclaimer { padding: 7px 16px; font-size: 10px; line-height: 1.5; color: #6e7681; border-top: 1px solid #21262d; flex-shrink: 0; }
  #chat-disclaimer b { color: #8b949e; font-weight: 600; }
  /* 면책 동의 모달 */
  #consent-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 400; align-items: center; justify-content: center; padding: 20px; }
  #consent-modal.open { display: flex; }
  #consent-modal .cm-box { background: #161b22; border: 1px solid #30363d; border-radius: 10px; max-width: 420px; width: 100%; padding: 22px; }
  #consent-modal h3 { margin: 0 0 12px; font-size: 15px; color: #e2e8f0; }
  #consent-modal ul { margin: 0 0 16px; padding-left: 18px; color: #adb6c0; font-size: 12.5px; line-height: 1.7; }
  #consent-modal ul b { color: #e2e8f0; }
  #consent-modal .cm-actions { display: flex; gap: 8px; justify-content: flex-end; }
  #consent-modal button { padding: 9px 16px; border-radius: 6px; font-size: 13px; cursor: pointer; border: none; }
  #consent-modal .cm-agree { background: #1f6feb; color: #fff; font-weight: 600; }
  #consent-modal .cm-cancel { background: #21262d; color: #adb6c0; }

  /* ── 우측 — 합의 메모 ── */
  #memo-panel { width: 240px; background: #161b22; border-left: 1px solid #21262d; display: flex; flex-direction: column; flex-shrink: 0; }
  .panel-header { padding: 12px 14px 10px; border-bottom: 1px solid #21262d; }
  .panel-header h3 { font-size: 12px; font-weight: 700; }
  .panel-header p { font-size: 10px; color: #6e7681; margin-top: 2px; }
  #memo-list { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
  #memo-empty { font-size: 11px; color: #6e7681; text-align: center; padding: 20px 10px; line-height: 1.7; }

  /* 합의 카드 — v2 통일 디자인 */
  .cc { background: #0d1117; border: 1px solid #21262d; border-radius: 8px; overflow: hidden; }
  .cc-header { padding: 8px 11px 7px; border-bottom: 1px solid #21262d; }
  .cc-header-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .cc-sector { font-size: 12.5px; font-weight: 700; color: #e2e8f0; flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cc-time { font-size: 9.5px; color: #6e7681; font-weight: 400; margin-left: 4px; }
  .cc-badges { display: flex; gap: 4px; flex-shrink: 0; }
  .cc-badge { font-size: 9.5px; font-weight: 700; padding: 2px 6px; border-radius: 8px; letter-spacing: .02em; }
  .cc-outlook-긍정 { background: rgba(63,185,80,.16);  color: #3fb950; }
  .cc-outlook-중립 { background: rgba(139,148,158,.16); color: #adb6c0; }
  .cc-outlook-부정 { background: rgba(248,81,73,.16);  color: #f85149; }
  .cc-decision-매수 { background: rgba(56,139,253,.18); color: #79c0ff; }
  .cc-decision-관망 { background: rgba(210,153,34,.18); color: #e3b341; }
  .cc-decision-매도 { background: rgba(248,81,73,.18);  color: #f85149; }
  .cc-headline { font-size: 11px; color: #adb6c0; margin-top: 4px; line-height: 1.5; font-style: italic; }

  .cc-body { padding: 9px 11px 10px; font-size: 11.5px; line-height: 1.65; color: #c9d1d9; }
  .cc-thesis { color: #c9d1d9; }
  .cc-section { margin-top: 9px; }
  .cc-section-label { font-size: 9.5px; font-weight: 700; letter-spacing: .05em;
    color: #6e7681; text-transform: uppercase; margin-bottom: 4px; }
  .cc-list { font-size: 11px; line-height: 1.6; color: #c9d1d9; padding-left: 0; list-style: none; }
  .cc-list li { padding-left: 11px; position: relative; margin-bottom: 3px; }
  .cc-list li::before { content: '·'; position: absolute; left: 2px; color: #6e7681; font-weight: 700; }
  .cc-list.cc-risks-list li::before { color: #f85149; }
  .cc-list.cc-drivers-list li::before { color: #3fb950; }
  .cc-picks { display: flex; flex-wrap: wrap; gap: 4px; }
  .cc-pick { font-size: 10px; padding: 2px 7px; border-radius: 8px;
    background: #21262d; color: #c9d1d9; border: 1px solid #30363d; }

  /* v1 (옛 데이터) — 동일 구조에 점선 보더만 */
  .cc.cc-legacy { border-style: dashed; border-color: #2a3038; }
  .cc.cc-legacy .cc-legacy-note { font-size: 9.5px; color: #6e7681; font-style: italic;
    padding: 6px 11px 8px; border-top: 1px dashed #30363d; cursor: pointer; text-align: center; }
  .cc.cc-legacy .cc-raw { display: none; padding: 0 11px 10px; font-size: 10.5px; color: #8b949e;
    white-space: pre-wrap; line-height: 1.55; border-top: 1px dashed #30363d; padding-top: 8px; }
  .cc.cc-legacy.open .cc-raw { display: block; }
  .cc.cc-legacy.open .cc-legacy-note::after { content: ' ▲'; }
  .cc.cc-legacy:not(.open) .cc-legacy-note::after { content: ' ▼'; }

  /* 강제 표시 — 어떤 자식 요소도 .cc-body 숨기지 못하게 (디버그용) */
  .cc .cc-body { display: block !important; visibility: visible !important; height: auto !important; }
  .cc .cc-thesis { display: block !important; visibility: visible !important; }

  /* ── 우측 — 포트폴리오 ── */
  #portfolio-panel { width: 220px; background: #161b22; border-left: 1px solid #21262d; display: flex; flex-direction: column; flex-shrink: 0; }
  .pf-summary { padding: 10px 12px; border-bottom: 1px solid #21262d; }
  .pf-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
  .pf-label { font-size: 10px; color: #6e7681; }
  .pf-value { font-size: 12px; font-weight: 600; }
  .pf-pos { color: #f85149; }  /* 상승·이익 = 빨강 (한국 증권계좌식) */
  .pf-neg { color: #58a6ff; }  /* 하락·손실 = 파랑 */
  .pf-neu { color: #8b949e; }
  #pf-benchmark { margin-top: 14px; padding: 12px 14px 20px; border-top: 1px solid #21262d; }
  .pf-bm-title { font-size: 11.5px; font-weight: 700; color: #c9d1d9; margin-bottom: 8px; }
  .pf-bm-sub { font-size: 9.5px; font-weight: 400; color: #6e7681; margin-left: 4px; }
  .pf-bm-row { display: flex; justify-content: space-between; font-size: 11px; padding: 3px 0; color: #9aa6b2; }
  .pf-bm-row.strong { font-weight: 700; color: #e6edf3; }
  .pf-bm-row .pf-pos { color: #f85149; } .pf-bm-row .pf-neg { color: #58a6ff; }
  .pf-bm-na, .pf-bm-empty { color: #6e7681; font-size: 10px; }
  #pf-positions { flex: 1; overflow-y: auto; }
  .pos-section-label { padding: 6px 10px 3px; font-size: 10px; font-weight: 600; letter-spacing: .8px; color: #6e7681; text-transform: uppercase; }
  .pos-item { padding: 6px 10px; border-bottom: 1px solid #0d1117; font-size: 11px; }
  .pos-meta { font-size: 10px; color: #6e7681; margin-top: 2px; }
  .pos-item { cursor: pointer; transition: background .15s; }
  .pos-item:hover { background: rgba(255,255,255,0.04); }

  /* 매수 이유 모달 */
  #reason-modal { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.65); z-index:200; align-items:center; justify-content:center; }
  #reason-modal.open { display:flex; }
  #reason-box { background:#161b22; border:1px solid #30363d; border-radius:12px; padding:22px 24px; max-width:560px; width:92%; position:relative;
                max-height:86vh; display:flex; flex-direction:column; }
  #reason-box .r-body { overflow-y:auto; flex:1; min-height:0; padding-right:4px; }
  #reason-box.wide { max-width:1180px; }
  .rc-chips { white-space:normal; display:flex; flex-wrap:wrap; gap:6px; margin-bottom:12px; }
  .rc-chip { font-size:10.5px; color:#8b949e; background:#21262d; border:1px solid #30363d; border-radius:20px; padding:2px 9px; }
  .rc-card { white-space:normal; background:#0d1117; border:1px solid #21262d; border-left:3px solid #58a6ff; border-radius:8px; padding:11px 13px; margin-bottom:10px; }
  .rc-role { font-size:11px; font-weight:700; color:#79c0ff; margin-bottom:6px; }
  .rc-card ul { margin:0; padding-left:16px; }
  .rc-card li { font-size:12.5px; line-height:1.65; color:#c9d1d9; margin-bottom:5px; white-space:normal; }
  .rc-card li:last-child { margin-bottom:0; }
  #reason-box details { margin-top:8px; white-space:normal; }
  #reason-box details summary { font-size:11px; color:#6e7681; cursor:pointer; }
  #reason-box details .rd-raw { font-size:11.5px; line-height:1.6; color:#8b949e; white-space:pre-wrap; margin-top:6px; }
  #reason-box h3 { font-size:15px; font-weight:700; margin-bottom:4px; }
  #reason-box .r-meta { font-size:11px; color:#6e7681; margin-bottom:16px; }
  #reason-box .r-body { font-size:13px; line-height:1.8; color:#c9d1d9; white-space:pre-wrap; }
  #reason-close { position:absolute; top:12px; right:14px; background:none; border:none; color:#6e7681; font-size:18px; cursor:pointer; }

  /* 봇 스타일 모달 */
  #bot-modal { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.7); z-index:300; align-items:center; justify-content:center; }
  #bot-modal.open { display:flex; }
  #bot-box { background:#161b22; border:1px solid #30363d; border-radius:14px; padding:24px 26px; max-width:460px; width:92%; position:relative; max-height:80vh; overflow-y:auto; }
  #bot-box .bot-header { display:flex; align-items:center; gap:10px; margin-bottom:6px; }
  #bot-box .bot-dot { width:10px; height:10px; border-radius:50%; flex-shrink:0; }
  #bot-box .bot-name { font-size:17px; font-weight:700; }
  #bot-box .bot-model { font-size:11px; color:#6e7681; margin-bottom:4px; }
  #bot-box .bot-desc { font-size:12px; color:#8b949e; margin-bottom:16px; padding-bottom:14px; border-bottom:1px solid #21262d; }
  #bot-box .bot-section { font-size:11px; font-weight:600; color:#6e7681; text-transform:uppercase; letter-spacing:.05em; margin-bottom:8px; }
  #bot-box .bot-system { font-size:12.5px; line-height:1.85; color:#c9d1d9; white-space:pre-wrap; }
  #bot-box .bot-system .highlight { color:#3fb950; font-weight:600; }
  #bot-close { position:absolute; top:14px; right:16px; background:none; border:none; color:#6e7681; font-size:20px; cursor:pointer; }
  .member { cursor:pointer; transition: background .15s; }
  .member:hover { background:rgba(255,255,255,0.05); border-radius:4px; }

  /* 일정표 모달 */
  #chat-hash { cursor: pointer; transition: color .15s, background .15s; display: inline-flex; align-items: center;
    padding: 2px 8px 2px 6px; border-radius: 5px; border: 1px solid transparent; }
  #chat-hash:hover { background: #21262d; border-color: #30363d; color: #58a6ff; }
  #chat-hash::after { content: ' 📅 일정표'; font-size: 10px; font-weight: 600; color: #6e7681;
    margin-left: 6px; padding: 2px 6px; border-radius: 3px; background: #21262d; border: 1px solid #30363d;
    letter-spacing: .02em; }
  #chat-hash:hover::after { color: #58a6ff; border-color: rgba(56,139,253,.3); }
  #schedule-modal { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.7); z-index:300; align-items:center; justify-content:center; padding: 20px; }
  #schedule-modal.open { display:flex; }
  #schedule-box { background:#161b22; border:1px solid #30363d; border-radius:14px; padding:24px 26px; max-width:480px; width:100%; position:relative; max-height:85vh; overflow-y:auto; }
  #schedule-box h3 { font-size:16px; font-weight:700; margin-bottom:4px; color:#e2e8f0; }
  #schedule-box .sched-now { font-size:11px; color:#6e7681; margin-bottom:18px; }
  #schedule-close { position:absolute; top:14px; right:16px; background:none; border:none; color:#6e7681; font-size:20px; cursor:pointer; }
  .sched-item { padding: 10px 12px; margin-bottom: 8px; background:#0d1117; border:1px solid #21262d; border-radius:8px; }
  .sched-item.active { border-color: #388bfd; background: rgba(31,111,235,.08); }
  .sched-row { display:flex; justify-content:space-between; align-items:baseline; gap:8px; }
  .sched-title { font-size:13px; font-weight:700; color:#e2e8f0; }
  .sched-time { font-size:11px; color:#79c0ff; font-variant-numeric: tabular-nums; flex-shrink:0; }
  .sched-desc { font-size:11px; color:#8b949e; margin-top:4px; line-height:1.5; }
  .sched-next { font-size:10.5px; color:#3fb950; margin-top:4px; font-weight:600; }
  .sched-note { font-size:11px; color:#6e7681; margin-top:14px; padding-top:12px; border-top:1px dashed #30363d; line-height:1.6; }

  /* 방문 통계 모달 (admin only) — schedule와 같은 톤 */
  #stats-modal { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.7); z-index:300; align-items:center; justify-content:center; padding: 20px; }
  #stats-modal.open { display:flex; }
  #stats-box { background:#161b22; border:1px solid #30363d; border-radius:14px; padding:24px 26px; max-width:520px; width:100%; position:relative; max-height:85vh; overflow-y:auto; }
  #stats-box h3 { font-size:16px; font-weight:700; margin-bottom:4px; color:#e2e8f0; }
  #stats-box .stats-sub { font-size:11px; color:#6e7681; margin-bottom:18px; }
  #stats-close { position:absolute; top:14px; right:16px; background:none; border:none; color:#6e7681; font-size:20px; cursor:pointer; }
  .stats-block { margin-bottom: 16px; }
  .stats-block-title { font-size: 10.5px; font-weight: 700; color: #8b949e; letter-spacing: .06em;
    text-transform: uppercase; margin-bottom: 6px; }
  .stats-totals { display: flex; gap: 16px; padding: 10px 12px; background:#0d1117; border:1px solid #21262d; border-radius:8px; }
  .stats-totals .stat { flex: 1; }
  .stats-totals .stat-num { font-size: 22px; font-weight: 700; color: #58a6ff; font-variant-numeric: tabular-nums; }
  .stats-totals .stat-label { font-size: 10px; color: #8b949e; margin-top: 2px; letter-spacing: .04em; }
  .stats-bar-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 12px; }
  .stats-bar-src { width: 60px; flex-shrink: 0; color: #e2e8f0; font-weight: 600; }
  .stats-bar-track { flex: 1; height: 8px; background: #0d1117; border: 1px solid #21262d; border-radius: 4px; overflow: hidden; }
  .stats-bar-fill { height: 100%; background: linear-gradient(90deg, #1f6feb, #58a6ff); border-radius: 3px; transition: width .3s; }
  .stats-bar-num { width: 70px; text-align: right; color: #79c0ff; font-variant-numeric: tabular-nums; font-size: 11.5px; }
  .stats-day-row { display: grid; grid-template-columns: 90px 70px 1fr; gap: 8px; padding: 4px 0; font-size: 11.5px;
    border-bottom: 1px dashed #21262d; }
  .stats-day-row:last-child { border-bottom: none; }
  .stats-day-date { color: #c9d1d9; font-variant-numeric: tabular-nums; }
  .stats-day-src { color: #79c0ff; font-weight: 600; }
  .stats-day-cnt { color: #8b949e; text-align: right; font-variant-numeric: tabular-nums; }
  .stats-empty { color: #6e7681; font-size: 12px; padding: 20px 0; text-align: center; }

  /* 피드백 — 강조 톤 버튼 + 모달 */
  .btn.btn-feedback { background: #1f6feb; color: #fff; border: none; }
  .btn.btn-feedback:hover { background: #388bfd; }
  #fb-badge { display: inline-flex; align-items: center; justify-content: center;
    min-width: 16px; height: 16px; padding: 0 4px; margin-left: 4px;
    background: #da3633; color: #fff; border-radius: 8px; font-size: 10px; font-weight: 700; }

  #feedback-modal, #feedback-list-modal, #chatlog-modal { display:none; position:fixed; inset:0;
    background:rgba(0,0,0,0.7); z-index:300; align-items:center; justify-content:center; padding: 20px; }
  #feedback-modal.open, #feedback-list-modal.open, #chatlog-modal.open { display:flex; }
  #feedback-box, #feedback-list-box, #chatlog-box { background:#161b22; border:1px solid #30363d; border-radius:14px;
    padding:24px 26px; max-width:520px; width:100%; position:relative; max-height:85vh; overflow-y:auto; }
  #feedback-box h3, #feedback-list-box h3, #chatlog-box h3 { font-size:16px; font-weight:700; margin-bottom:4px; color:#e2e8f0; }
  #feedback-box .fb-sub, #feedback-list-box .fb-sub, #chatlog-box .fb-sub { font-size:11px; color:#6e7681; margin-bottom:14px; }
  #feedback-close, #fb-list-close, #chatlog-close { position:absolute; top:14px; right:16px; background:none; border:none;
    color:#6e7681; font-size:20px; cursor:pointer; }
  .cl-q { background:#0d1117; border:1px solid #30363d; border-radius:8px; padding:10px 12px; margin-bottom:12px; }
  .cl-q-head { display:flex; justify-content:space-between; gap:8px; font-size:11px; color:#6e7681; margin-bottom:6px; }
  .cl-q-text { font-size:13px; color:#e2e8f0; font-weight:600; margin-bottom:8px; }
  .cl-ans { font-size:12px; color:#adb6c0; line-height:1.5; padding:4px 0 4px 8px; border-left:2px solid #21262d; margin-top:5px; }
  .cl-ans b { color:#8b949e; font-weight:600; }
  #fb-textarea { width: 100%; min-height: 140px; background: #0d1117; border: 1px solid #30363d;
    border-radius: 6px; padding: 10px 12px; color: #e2e8f0; font-size: 13px; font-family: inherit;
    outline: none; resize: vertical; line-height: 1.55; }
  #fb-textarea:focus { border-color: #58a6ff; }
  #fb-counter { font-size: 10.5px; color: #6e7681; text-align: right; margin-top: 6px; }
  #fb-send-btn { width: 100%; background: #1f6feb; border: none; color: #fff; padding: 10px;
    border-radius: 6px; font-size: 13px; cursor: pointer; font-weight: 600; margin-top: 14px;
    transition: background .15s; }
  #fb-send-btn:hover:not(:disabled) { background: #388bfd; }
  #fb-send-btn:disabled { background: #30363d; cursor: not-allowed; }
  #fb-status { font-size: 11px; margin-top: 10px; min-height: 14px; }
  #fb-status.ok { color: #3fb950; }
  #fb-status.err { color: #f85149; }

  /* admin 피드백 리스트 */
  .fb-item { padding: 10px 12px; margin-bottom: 8px; background: #0d1117;
    border: 1px solid #21262d; border-radius: 8px; }
  .fb-item.unread { border-left: 3px solid #58a6ff; }
  .fb-item .fb-meta { display: flex; justify-content: space-between; gap: 8px;
    font-size: 10.5px; color: #6e7681; margin-bottom: 6px; }
  .fb-item .fb-content { font-size: 12.5px; color: #e2e8f0; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
  .fb-item .fb-actions { margin-top: 6px; }
  .fb-item .fb-read-btn { background: none; border: 1px solid #30363d; color: #8b949e;
    padding: 3px 8px; border-radius: 4px; font-size: 10.5px; cursor: pointer; }
  .fb-item .fb-read-btn:hover { color: #58a6ff; border-color: #58a6ff; }
  .fb-toolbar { display: flex; justify-content: space-between; margin-bottom: 10px; }
  .fb-toolbar button { background: none; border: 1px solid #30363d; color: #8b949e;
    padding: 4px 10px; border-radius: 4px; font-size: 11px; cursor: pointer; }
  .fb-toolbar button:hover { color: #58a6ff; border-color: #58a6ff; }

  /* 사이드바 타이틀 옆 작은 admin 라벨 (admin URL일 때만) */
  #sidebar-title-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
  .beta-tag { display: inline-block; font-size: 8.5px; font-weight: 700; padding: 1.5px 5px;
    border-radius: 3px; background: rgba(240,136,62,.15); color: #f0883e;
    border: 1px solid rgba(240,136,62,.35); letter-spacing: .08em;
    vertical-align: middle; margin-left: 4px; position: relative; top: -1px; }
  #admin-mark { display: none; font-size: 9.5px; font-weight: 700; padding: 2px 6px; border-radius: 4px;
    background: rgba(31,111,235,.15); color: #58a6ff; border: 1px solid rgba(56,139,253,.3);
    letter-spacing: .04em; cursor: pointer; }
  #admin-mark:hover { background: rgba(31,111,235,.25); }
  body.admin-mode #admin-mark { display: inline-block; }

  /* ───────── 모바일 토글 버튼 (기본은 숨김) ───────── */
  .mobile-only { display: none; }
  #mobile-menu-btn, #mobile-right-btn {
    background: transparent; border: none; color: #c9d1d9; font-size: 20px;
    padding: 6px 10px; cursor: pointer; border-radius: 6px;
  }
  #mobile-menu-btn:active, #mobile-right-btn:active { background: #21262d; }

  /* 드로어 backdrop */
  #drawer-backdrop {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55);
    z-index: 150; -webkit-tap-highlight-color: transparent;
  }
  body.drawer-open #drawer-backdrop { display: block; }

  /* 우측 패널 컨테이너 (탭 UI for 모바일/태블릿) */
  #right-tabs { display: none; }  /* 데스크탑에선 숨김, 모바일/태블릿에서 표시 */

  /* ───────── 태블릿 (768~1023px) ───────── */
  @media (max-width: 1023px) {
    #sidebar { width: 200px; }
    #memo-panel { width: 200px; }
    #portfolio-panel { width: 200px; }
    .msg-body { max-width: none; }
    .msg-bubble { font-size: 13px; }
  }

  /* ───────── 모바일 (767px 이하) ───────── */
  @media (max-width: 767px) {
    /* 사이드바 → 좌측 슬라이드 드로어 */
    #sidebar {
      position: fixed; left: 0; top: 0; height: 100dvh; width: 280px;
      max-width: 88vw;
      transform: translateX(-100%); transition: transform .22s ease;
      z-index: 200; box-shadow: 4px 0 20px rgba(0,0,0,0.5);
    }
    body.left-open #sidebar { transform: translateX(0); }

    /* 메인 풀폭 */
    #main { width: 100vw; flex: 1 1 auto; }
    #chat-header { padding: 8px 10px; }
    #chat-header h2 { font-size: 13px; }
    .sub { font-size: 10px; margin-left: 0; display: block; margin-top: 1px; }

    /* 채팅 헤더 버튼 — 큰 화면용 버튼들은 햄버거 메뉴에 통합 */
    #chat-header .btn-group { gap: 4px; }
    #chat-header .btn-group .btn-ghost,
    #chat-header .btn-group #btn-summary,
    #chat-header .btn-group #btn-main-run,
    #chat-header .btn-group #btn-sub-run { display: none; }
    /* play/pause만 유지 + 모바일 메뉴 버튼 */

    /* 모바일 전용 버튼들 표시 */
    .mobile-only { display: inline-flex !important; }

    /* 우측 패널들 → 우측 슬라이드 드로어로 통합 */
    #memo-panel, #portfolio-panel {
      position: fixed; right: 0; top: 0; height: 100dvh;
      width: 320px; max-width: 88vw; z-index: 200;
      transform: translateX(100%); transition: transform .22s ease;
      box-shadow: -4px 0 20px rgba(0,0,0,0.5);
      border-left: 1px solid #30363d;
    }
    body.right-open.right-tab-memo #memo-panel { transform: translateX(0); }
    body.right-open.right-tab-portfolio #portfolio-panel { transform: translateX(0); }
    /* 기본 우측 탭 = portfolio */
    body.right-open:not(.right-tab-memo):not(.right-tab-portfolio) #portfolio-panel { transform: translateX(0); }

    /* 우측 드로어 내부 탭 헤더 */
    #right-tabs {
      display: flex; gap: 4px; padding: 8px; border-bottom: 1px solid #21262d;
      background: #0f1117; position: sticky; top: 0; z-index: 5;
    }
    .right-tab-btn {
      flex: 1; padding: 6px 10px; background: #21262d; border: 1px solid #30363d;
      border-radius: 6px; color: #8b949e; font-size: 12px; cursor: pointer;
      text-align: center; font-weight: 600;
    }
    .right-tab-btn.active { background: #1f6feb; color: #fff; border-color: #388bfd; }

    /* 메시지 영역 모바일 폰트/패딩 */
    #messages { padding: 10px; gap: 8px; }
    .msg-bubble { font-size: 13.5px; padding: 7px 11px; }
    .avatar { width: 28px; height: 28px; font-size: 12px; }
    .msg-name { font-size: 12.5px; }
    .msg-meta { font-size: 10.5px; }
    .msg-body { max-width: calc(100vw - 70px); }

    /* 입력창 */
    #input-area { padding: 8px 10px; gap: 6px; align-items: center; }
    #input-area input { font-size: 16px; padding: 10px 12px; } /* 16px = iOS zoom 방지 */
    #input-area button { padding: 11px 16px; font-size: 14px; }
    /* 맨 아래 요소(면책 푸터)에 safe-area 적용 — 홈 인디케이터에 안 가리게 */
    #chat-disclaimer { padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); font-size: 10.5px; }
  }

  /* ───────── 작은 폰 (480px 이하) — 더 타이트 ───────── */
  @media (max-width: 480px) {
    #chat-header h2 { font-size: 12.5px; }
    .sub { font-size: 9.5px; }
  }

  /* ───────── 업데이트 내역 (한 줄) ───────── */
  #changelog-box { margin: 6px 0 2px; padding: 5px 8px; background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.07); border-radius: 7px; }
  #cl-line { display: block; font-size: 10.5px; color: #b9c4ce; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; }
  #cl-line .cl-date { color: #8aa0b6; }

  /* ───────── 계좌 전환 토글 ───────── */
  .pf-acct-toggle { display: flex; gap: 6px; margin: 0 0 10px; }
  .pf-acct-btn { flex: 1; padding: 6px 6px; font-size: 11.5px; font-weight: 600; cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    background: rgba(255,255,255,.04); color: #9aa6b2; border: 1px solid rgba(255,255,255,.08);
    border-radius: 7px; transition: all .12s; }
  .pf-acct-btn:hover { color: #e6edf3; }
  .pf-acct-btn.active { background: rgba(88,166,255,.16); color: #e6edf3; border-color: rgba(88,166,255,.5); }
  .pf-acct-btn .pf-acct-cap { font-size: 9px; font-weight: 400; opacity: .6; margin-left: 2px; }

  /* ───────── 방문 통계: 재방문/날짜별 ───────── */
  .stats-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .stats-legend { display: flex; gap: 12px; margin: 0 0 6px; font-size: 10px; color: #8b949e; }
  .stats-legend .lg { display: flex; align-items: center; gap: 4px; }
  .stats-legend .lg i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
  .stats-day2 { display: flex; align-items: center; gap: 8px; font-size: 11px; padding: 3px 0; }
  .stats-day2-date { width: 40px; flex: none; color: #8b949e; }
  .stats-day2-bar { flex: 1; height: 9px; display: flex; border-radius: 3px; overflow: hidden; background: rgba(255,255,255,.05); }
  .stats-day2-bar .seg-new { background: #3b82f6; }
  .stats-day2-bar .seg-ret { background: #22c55e; }
  .stats-day2-cnt { flex: none; min-width: 132px; text-align: right; font-size: 10px; color: #c9d1d9; }

  /* ───────── 재방문 코호트 (D1/D7) ───────── */
  .ret-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
  .ret-card { background: rgba(34,197,94,.08); border: 1px solid rgba(34,197,94,.22); border-radius: 8px; padding: 9px; text-align: center; }
  .ret-card .ret-num { font-size: 21px; font-weight: 800; color: #22c55e; line-height: 1.1; }
  .ret-card .ret-label { font-size: 10px; color: #9aa6b2; margin-top: 3px; }
  .ret-card .ret-sub { font-size: 9px; color: #6e7681; margin-top: 1px; }
  .coh-row { display: flex; align-items: center; font-size: 10.5px; padding: 2px 0; color: #c9d1d9; }
  .coh-head { color: #6e7681; font-weight: 700; border-bottom: 1px solid rgba(255,255,255,.07); padding-bottom: 3px; margin-bottom: 2px; }
  .coh-d { width: 46px; flex: none; color: #8b949e; }
  .coh-n { width: 42px; flex: none; text-align: right; padding-right: 16px; }
  .coh-v { flex: 1; text-align: right; }

  /* ── AI펀드 fund 모드 (window.__FUND_MODE__ 일 때만 활성) ── */
  .member-ret { margin-left: auto; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
  /* fund 모드 Members = v1 촘촘한 행 그대로. 모델만은 .fm-model, 출근은 초록 좌측선 */
  .fm-role-inline { font-size: 10.5px; color: #8b949e; margin-left: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fm-ret { margin-left: auto; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; flex-shrink: 0; padding-left: 6px; }
  .fm-model { display: block; font-size: 9px; color: #444c56; margin-top: 1px; }
  /* fund Members = 멤버 박스(닉+직위+모델) 하나. 출근 시 박스 전체 초록 테두리 */
  body.fundmode #member-list .fm-box { margin: 3px 8px; border: 1px solid transparent; border-radius: 7px; padding: 3px 0; transition: border-color .2s, background .2s; }
  body.fundmode #member-list .fm-box .member { margin: 0; }
  body.fundmode #member-list .fm-box .member-sub { padding: 0 12px 0 27px; }
  body.fundmode #member-list .fm-box.working { border-color: #3fb950; background: rgba(63,185,80,0.06); }
  body.fundmode #memo-panel .right-tab-btn, body.fundmode #portfolio-panel .right-tab-btn { display: none; }
  /* 리서치 보드 리포트 카드 */
  #fund-report { display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; }
  .fr-card { background: #0d1117; border: 1px solid #21262d; border-radius: 10px; padding: 12px 13px; }
  .fr-top { display: flex; align-items: baseline; gap: 6px; margin-bottom: 6px; }
  .fr-tk { font-weight: 800; font-size: 13px; color: #e7ecf1; }
  .fr-nm { font-size: 10px; color: #8b949e; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fr-tag { margin-left: auto; font-size: 8.5px; font-weight: 700; padding: 1px 6px; border-radius: 4px; }
  .fr-tag.pw { color: #5aa9e6; background: rgba(90,169,230,.13); }
  .fr-tag.s { color: #e08a3c; background: rgba(224,138,60,.13); }
  .fr-tag.sec { color: #a78bfa; background: rgba(167,139,250,.14); }
  .fr-card.fr-sec { background: #10131b; border-color: #2b2540; }
  .fr-op { font-size: 11px; color: #c9d1d9; line-height: 1.5; margin-top: 6px; }
  .fr-op-b { display: inline-block; min-width: 15px; font-weight: 800; color: #a78bfa; margin-right: 5px; }
  .fr-sum { font-size: 11px; color: #c9d1d9; line-height: 1.55; }
  .fr-fin { font-size: 10px; color: #8b949e; white-space: pre-wrap; line-height: 1.5; margin-top: 7px;
    padding-top: 7px; border-top: 1px solid #21262d; max-height: 132px; overflow-y: auto; font-variant-numeric: tabular-nums; }
  .fr-empty { color: #444c56; font-size: 11px; font-style: italic; padding: 10px 4px; }
  body.fundmode #mem-tab-main, body.fundmode #mem-tab-trading { display: none; }
  /* committee 전용 크롬 숨김(fund 모드엔 무의미) */
  body.fundmode #visitor-timers, body.fundmode #btn-main-run,
  body.fundmode #btn-sub-run, body.fundmode #btn-summary { display: none; }
  /* 4봇 가상계좌 — 2×2 사분면, 각 칸에 종목별 티커/진입/현재/투자금 */
  #fund-quad { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; gap: 10px; padding: 10px; }
  .fm-model { margin-left: auto; font-size: 10px; color: #6e7681; font-weight: 600; }
  .fq-cell { background: #0d1117; border: 1.5px solid #21262d; border-radius: 10px; display: flex; flex-direction: column; min-height: 0; padding: 11px 12px; transition: border-color .3s; }
  .fq-cell.working { border-color: rgba(63,185,80,.5); }
  .fq-head { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
  .fq-head .dot { width: 8px; height: 8px; }
  .fq-id { font-weight: 800; font-size: 14px; }
  .fq-ret { margin-left: auto; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
  .fq-cash { font-size: 10px; color: #6e7681; font-variant-numeric: tabular-nums;
    margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid #21262d; }
  .fq-scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
  .fq-pos { display: flex; flex-direction: column; gap: 2px; }
  .fq-pos-top { display: flex; align-items: baseline; gap: 5px; font-size: 12px; }
  .fq-pos-top .sym { color: #e7ecf1; font-weight: 700; }
  .fq-pos-top .nm { color: #6e7681; font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fq-pos-top .pnl { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; }
  .fq-pos-sub { font-size: 10px; color: #8b949e; font-variant-numeric: tabular-nums; }
  .fq-empty { color: #444c56; font-size: 10.5px; font-style: italic; padding: 6px 0; }
  .up { color: #f85149; } .down { color: #58a6ff; } .flat { color: #8b949e; }
  /* v1(위원회) ↔ v2(AI펀드) 전환 토글 — 좌상단, owner 전용 */
  #view-switch { display: flex; gap: 4px; margin-top: 9px; }
  #view-switch .vs-btn { flex: 1; text-align: center; font-size: 11px; font-weight: 700;
    padding: 5px 0; border-radius: 6px; text-decoration: none; color: #8b949e;
    background: #12161c; border: 1px solid #21262d; transition: background .15s, color .15s, border-color .15s; }
  #view-switch .vs-btn:hover { color: #c9d1d9; border-color: #30363d; }
  #view-switch .vs-btn.active { color: #fff; background: #1f6feb; border-color: #1f6feb; }
