/*
  수익 캘린더(RX) 스타일. RS Decode 화면 언어를 그대로 따른다.
  - 카드: zinc-900/60 바탕, 흰색 6% 테두리, 14px 모서리
  - 강조: blue-500, 수치: JetBrains Mono
  - 모든 선택자는 .rx-scope 아래에만 걸어서 기존 화면에 영향이 없게 한다.
*/
.rx-scope {
  --rx-t1: #ffffff;
  --rx-t2: #e4e4e7;
  --rx-t3: #a1a1aa;
  --rx-t4: #71717a;
  --rx-panel: rgba(24, 24, 27, 0.6);
  --rx-box: rgba(39, 39, 42, 0.5);
  --rx-input: #27272a;
  --rx-line: rgba(255, 255, 255, 0.06);
  --rx-line-2: rgba(255, 255, 255, 0.1);
  --rx-blue: #3b82f6;
  --rx-blue-2: #60a5fa;
  --rx-blue-bg: rgba(96, 165, 250, 0.1);
  --rx-blue-bd: rgba(96, 165, 250, 0.3);
  --rx-warn: #fb923c;
  --rx-warn-bg: rgba(251, 146, 60, 0.1);
  --rx-warn-bd: rgba(251, 146, 60, 0.4);
  --rx-danger: #f87171;
  --rx-gain: #4ade80;
  --rx-gain-bg: rgba(74, 222, 128, 0.08);
  --rx-loss: #f87171;
  --rx-loss-bg: rgba(248, 113, 113, 0.08);
  --rx-mono: 'JetBrains Mono', ui-monospace, 'Noto Sans KR', monospace;
  color: var(--rx-t2);
  font-size: 14px;
  line-height: 1.55;
  word-break: keep-all;
  overflow-wrap: break-word;
}
html[data-rx-updown="kr"] .rx-scope {
  --rx-gain: #f87171;
  --rx-gain-bg: rgba(248, 113, 113, 0.08);
  --rx-loss: #60a5fa;
  --rx-loss-bg: rgba(96, 165, 250, 0.09);
}
.rx-scope [hidden], .rx-scope[hidden] { display: none !important; }
.rx-scope *, .rx-scope *::before, .rx-scope *::after { box-sizing: border-box; }
.rx-scope :focus-visible { outline: 2px solid var(--rx-blue-2); outline-offset: 2px; border-radius: 6px; }
.rx-scope svg { display: inline-block; flex: none; }
.rx-ico { width: 16px; height: 16px; }

.rx-root { container: rxroot / inline-size; padding-bottom: 8px; }
.rx-num { font-family: var(--rx-mono); font-variant-numeric: tabular-nums; }
.rx-gain { color: var(--rx-gain); }
.rx-loss { color: var(--rx-loss); }
.rx-flat { color: var(--rx-t4); }
.rx-dim { color: var(--rx-t3); }
.rx-warn-text { color: var(--rx-warn) !important; }
.rx-strong { color: var(--rx-t1); font-weight: 600; }
.rx-nowrap { white-space: nowrap; }
.rx-r { text-align: right !important; }
.rx-c { text-align: center !important; }
.rx-mt { margin-top: 14px; }
.rx-small { font-size: 12px; }
.rx-scope b, .rx-scope strong { color: var(--rx-t1); font-weight: 600; }

.rx-h2 { font-size: 18px; font-weight: 700; color: var(--rx-t1); margin-bottom: 6px; }
.rx-h3 { font-size: 15px; font-weight: 700; color: var(--rx-t1); }
.rx-h4 { font-size: 13px; font-weight: 700; color: var(--rx-t2); margin: 20px 0 10px; }
.rx-sub { font-size: 13px; color: var(--rx-t3); margin-top: 3px; line-height: 1.6; }
.rx-hint { display: block; font-size: 12px; color: var(--rx-t3); margin-top: 5px; }
.rx-err { display: block; font-size: 12px; color: var(--rx-danger); margin-top: 5px; font-weight: 500; }
.rx-err:empty { display: none; }
.rx-note { font-size: 12px; color: var(--rx-t3); margin: -4px 0 16px; }
.rx-foot { font-size: 12px; color: var(--rx-t3); padding: 10px 16px 14px; border-top: 1px solid var(--rx-line); }
.rx-empty { display: grid; gap: 8px; justify-items: start; }
.rx-empty .rx-btn { margin-top: 8px; }
.rx-wait { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 48px 16px; color: var(--rx-t3); font-size: 13px; }

/* ---------- 머리 카드 ---------- */
.rx-hero { background: linear-gradient(to right, #27272a, #18181b); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 12px; padding: 20px; margin-bottom: 16px; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3); }
.rx-hero-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.rx-hero-title { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; color: var(--rx-t1); margin: 0; }
.rx-hero-ico { width: 24px; height: 24px; color: #2dd4bf; }
.rx-hero-sub { font-size: 13px; color: var(--rx-t3); margin-top: 6px; max-width: 72ch; }
.rx-hero-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 16px 0 0; }
.rx-hero-stats:empty { display: none; }
@container rxroot (min-width: 720px) { .rx-hero-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; } .rx-hero-title { font-size: 24px; } }
.rx-stat { background: var(--rx-box); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 8px; padding: 11px 14px; min-width: 0; }
.rx-stat dt { font-size: 12px; color: var(--rx-t3); }
.rx-stat dt small { font-size: 11px; }
.rx-stat dd { margin: 2px 0 0; font-family: var(--rx-mono); font-size: 17px; font-weight: 700; color: var(--rx-t1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rx-stat dd small { font-size: 11px; font-weight: 500; color: var(--rx-t3); margin-left: 2px; }
.rx-stat-blue dd { color: var(--rx-blue-2); }

.rx-sync { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08); color: var(--rx-t3); font-family: var(--rx-mono); font-size: 11px; cursor: default; }
.rx-sync:not(:disabled) { cursor: pointer; }
.rx-sync-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--rx-t3); }
.rx-sync.is-ok { color: #4ade80; background: rgba(74, 222, 128, 0.08); border-color: rgba(74, 222, 128, 0.25); }
.rx-sync.is-ok .rx-sync-dot { background: #4ade80; }
.rx-sync.is-warn { color: #facc15; background: rgba(250, 204, 21, 0.08); border-color: rgba(250, 204, 21, 0.3); }
.rx-sync.is-warn .rx-sync-dot { background: #facc15; }
.rx-sync.is-bad { color: #f87171; background: rgba(248, 113, 113, 0.08); border-color: rgba(248, 113, 113, 0.3); }
.rx-sync.is-bad .rx-sync-dot { background: #f87171; }

/* ---------- 하위 메뉴 ---------- */
.rx-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
@container rxroot (max-width: 559px) {
  /* 좁은 화면: 사용가이드 버튼은 제목 옆, 저장 상태는 그 아래 줄 */
  .rx-hero-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .rx-hero-actions { display: contents; }
  .rx-guide-btn { grid-column: 2; grid-row: 1; }
  .rx-sync { grid-column: 1 / -1; justify-self: start; }
  .rx-hero-title { min-width: 0; white-space: nowrap; }
}
@container rxroot (max-width: 339px) { .rx-hero-title { font-size: 18px; } }
@container rxroot (max-width: 279px) {
  .rx-hero .rx-guide-btn { padding: 0 9px; }
  .rx-guide-pre { display: none; }
}
.rx-guide-btn[aria-current="page"] { background: var(--rx-blue-bg); color: var(--rx-blue-2); border-color: var(--rx-blue-bd); }
.rx-subnav-row { display: flex; align-items: center; gap: 6px 12px; margin-bottom: 16px; }
.rx-subnav { display: flex; flex: 1 1 auto; min-width: 0; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.rx-help { display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 38px; padding: 0 10px; border-radius: 8px; color: var(--rx-t3); font-size: 13px; font-weight: 500; white-space: nowrap; }
.rx-help:hover { color: var(--rx-t1); background: rgba(255, 255, 255, 0.05); }
@container rxroot (max-width: 719px) {
  .rx-subnav-row { flex-wrap: wrap; margin-bottom: 12px; }
  .rx-subnav { flex-basis: 100%; }
  .rx-help { margin-left: auto; min-height: 34px; font-size: 12px; }
}
.rx-subnav::-webkit-scrollbar { display: none; }
.rx-subnav-btn { display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 38px; padding: 0 14px; border-radius: 8px; border: 1px solid transparent; color: var(--rx-t3); font-size: 13px; font-weight: 600; background: rgba(39, 39, 42, 0.4); transition: background 0.15s, color 0.15s; }
.rx-subnav-btn:hover { background: rgba(255, 255, 255, 0.06); color: var(--rx-t1); }
.rx-subnav-btn[aria-current="page"] { background: var(--rx-blue-bg); color: var(--rx-blue-2); border-color: var(--rx-blue-bd); }

/* ---------- 버튼 ---------- */
.rx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 8px; border: 1px solid transparent; font-size: 13px; font-weight: 600; line-height: 1.2; white-space: nowrap; transition: background 0.15s, border-color 0.15s, color 0.15s; }
.rx-btn:disabled { cursor: not-allowed; background: rgba(39, 39, 42, 0.6) !important; color: var(--rx-t4) !important; box-shadow: none !important; border-color: transparent !important; }
.rx-btn-primary { background: var(--rx-blue); color: #fff; box-shadow: 0 4px 14px rgba(59, 130, 246, 0.22); }
.rx-btn-primary:hover { background: #2563eb; }
.rx-btn-line { background: rgba(39, 39, 42, 0.6); border-color: var(--rx-line-2); color: var(--rx-t2); }
.rx-btn-line:hover { background: rgba(63, 63, 70, 0.6); color: var(--rx-t1); }
.rx-btn-ghost { color: var(--rx-t3); }
.rx-btn-ghost:hover { background: rgba(255, 255, 255, 0.05); color: var(--rx-t1); }
.rx-btn-danger { background: #ef4444; color: #fff; }
.rx-btn-danger:hover { background: #dc2626; }
.rx-btn-danger-line { border-color: rgba(248, 113, 113, 0.4); color: #f87171; }
.rx-btn-danger-line:hover { background: rgba(248, 113, 113, 0.1); }
.rx-btn-sm { min-height: 32px; padding: 0 10px; font-size: 12px; }
.rx-btn-block { width: 100%; }
.rx-icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; color: var(--rx-t3); }
.rx-icon-btn:hover { background: rgba(255, 255, 255, 0.06); color: var(--rx-t1); }
.rx-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 0 11px; border-radius: 6px; background: rgba(39, 39, 42, 0.6); border: 1px solid rgba(255, 255, 255, 0.06); color: var(--rx-t3); font-size: 12px; font-weight: 500; white-space: nowrap; transition: all 0.15s; }
.rx-chip:hover { background: rgba(63, 63, 70, 0.6); color: var(--rx-t1); }
.rx-chip[aria-pressed="true"] { background: var(--rx-blue-bg); color: var(--rx-blue-2); border-color: var(--rx-blue-bd); }
.rx-chip .rx-ico { width: 14px; height: 14px; }
.rx-link { color: var(--rx-blue-2); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(96, 165, 250, 0.4); }
.rx-link:hover { text-decoration-color: var(--rx-blue-2); }
.rx-btnrow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.rx-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (pointer: coarse) {
  .rx-btn-sm, .rx-chip { min-height: 40px; }
  .rx-icon-btn { width: 40px; height: 40px; }
}

/* ---------- 카드 ---------- */
.rx-panel { position: relative; background: var(--rx-panel); border: 1px solid var(--rx-line); border-radius: 14px; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25); margin-bottom: 16px; overflow: hidden; }
.rx-panel-head { padding: 14px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.rx-panel-head-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 10px; }
.rx-panel-danger .rx-h3 { color: #f87171; }
.rx-pad { padding: 16px; }
.rx-two { display: grid; gap: 0 16px; }
.rx-two > .rx-panel, .rx-col > .rx-panel { margin-bottom: 16px; }
@container rxroot (min-width: 900px) {
  .rx-two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .rx-two-uneven { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
}

/* ---------- 입력 ---------- */
.rx-form { display: grid; gap: 14px; }
.rx-field { display: block; min-width: 0; margin: 0; padding: 0; border: 0; }
.rx-label { display: block; font-size: 12px; font-weight: 600; color: var(--rx-t3); margin-bottom: 6px; padding: 0; }
.rx-label em { font-style: normal; font-weight: 500; color: var(--rx-t4); margin-left: 2px; }
.rx-row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.rx-scope input:not([type="checkbox"]):not([type="radio"]) {
  width: 100%; min-height: 40px; padding: 8px 12px; background: var(--rx-input); border: 1px solid var(--rx-line-2); border-radius: 8px;
  color: var(--rx-t1); font-size: 14px; outline: none; transition: border-color 0.15s, box-shadow 0.15s; color-scheme: dark;
}
.rx-scope input::placeholder { color: #71717a; }
.rx-scope input:not([type="checkbox"]):not([type="radio"]):focus { border-color: var(--rx-blue); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); }
.rx-scope input[aria-invalid="true"] { border-color: var(--rx-danger) !important; }
.rx-scope input[list]::-webkit-calendar-picker-indicator { display: none !important; }
.rx-scope input[type="checkbox"] { accent-color: var(--rx-blue); }
@media (pointer: coarse) { .rx-scope input:not([type="checkbox"]):not([type="radio"]) { font-size: 16px; min-height: 44px; } }
.rx-with-sign { display: flex; gap: 6px; }
.rx-sign-btn { flex: none; width: 48px; min-height: 40px; border: 1px solid var(--rx-line-2); border-radius: 8px; background: rgba(39, 39, 42, 0.6); color: var(--rx-t2); font-weight: 700; font-family: var(--rx-mono); font-size: 13px; }
.rx-sign-btn:hover { border-color: var(--rx-blue); color: var(--rx-blue-2); }
.rx-choice { display: flex; flex-wrap: wrap; gap: 8px; }
.rx-choice-opt { position: relative; flex: 1 1 0; min-width: 80px; }
.rx-choice-opt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.rx-choice-opt span { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 10px; border: 1px solid var(--rx-line-2); border-radius: 8px; background: var(--rx-input); color: var(--rx-t2); font-weight: 600; font-size: 13px; transition: all 0.15s; }
.rx-choice-opt span svg { width: 14px; height: 14px; }
.rx-choice-opt:hover span { border-color: rgba(255, 255, 255, 0.25); }
.rx-choice-opt input:checked + span { background: rgba(59, 130, 246, 0.15); border-color: var(--rx-blue); color: #93c5fd; }
.rx-choice-opt.rx-opt-x input:checked + span { background: var(--rx-warn-bg); border-color: var(--rx-warn); color: #fdba74; }
.rx-choice-opt input:focus-visible + span { outline: 2px solid var(--rx-blue-2); outline-offset: 2px; }
@media (pointer: coarse) { .rx-choice-opt span, .rx-sign-btn { min-height: 44px; } }
.rx-calc { font-size: 13px; color: var(--rx-t3); line-height: 1.7; }
.rx-calc:empty { display: none; }
.rx-calc b { font-family: var(--rx-mono); }
.rx-warn { display: flex; gap: 8px; align-items: flex-start; padding: 9px 12px; border-radius: 8px; background: rgba(59, 130, 246, 0.08); border: 1px solid rgba(59, 130, 246, 0.25); color: #bfdbfe; font-size: 13px; line-height: 1.5; }
.rx-warn .rx-ico { margin-top: 2px; }
.rx-warn.is-danger { background: var(--rx-warn-bg); border-color: rgba(251, 146, 60, 0.35); color: #fdba74; }
.rx-warn + .rx-warn { margin-top: 8px; }
.rx-more { border-top: 1px solid var(--rx-line); padding-top: 10px; }
.rx-more summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; min-height: 30px; font-size: 12px; font-weight: 600; color: var(--rx-t3); }
.rx-more summary::-webkit-details-marker { display: none; }
.rx-more summary::before { content: ''; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); margin-right: 4px; transition: transform 0.15s; }
.rx-more[open] summary::before { transform: rotate(45deg); }
.rx-more[open] summary { margin-bottom: 10px; }
.rx-apply { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; margin-top: 14px; }
.rx-apply .rx-field { flex: 1 1 180px; }

/* ---------- 도장 ---------- */
.rx-stamp { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.rx-stamp svg { width: 14px; height: 14px; }
.rx-stamp-o { color: var(--rx-blue-2); }
.rx-stamp-x { color: var(--rx-warn); }
.rx-stamp-none { color: var(--rx-t4); font-weight: 500; }
.rx-tag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px; background: var(--rx-blue-bg); color: var(--rx-blue-2); border: 1px solid var(--rx-blue-bd); font-size: 11px; font-weight: 600; font-family: var(--rx-mono); line-height: 1.6; white-space: nowrap; vertical-align: 1px; }

/* ---------- 첫 설정 ---------- */
.rx-setup { max-width: 560px; }

/* ---------- 캘린더 ---------- */
.rx-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.rx-monthnav { display: flex; align-items: center; gap: 2px; }
.rx-month { font-size: 18px; font-weight: 700; color: var(--rx-t1); min-width: 6.4em; text-align: center; margin: 0; }
.rx-month-sm { font-size: 15px; min-width: 6em; }
.rx-monthnav .rx-chip { margin-left: 6px; }
.rx-seg { display: inline-flex; gap: 6px; }

.rx-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 14px; background: var(--rx-panel); border: 1px solid var(--rx-line); border-radius: 12px; overflow: hidden; }
.rx-strip > div { padding: 10px 14px; min-width: 0; }
.rx-strip > div:nth-child(n + 4) { border-top: 1px solid var(--rx-line); }
.rx-strip > div:not(:nth-child(3n + 1)) { border-left: 1px solid var(--rx-line); }
.rx-strip dt { font-size: 11px; color: var(--rx-t3); }
.rx-strip dt small { font-size: 10px; }
.rx-strip dd { margin: 1px 0 0; font-family: var(--rx-mono); font-size: 15px; font-weight: 700; color: var(--rx-t1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rx-strip dd small { font-size: 11px; font-weight: 500; color: var(--rx-t3); }
@container rxroot (min-width: 760px) {
  .rx-strip { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .rx-strip > div:nth-child(n + 4) { border-top: 0; }
  .rx-strip > div:not(:first-child) { border-left: 1px solid var(--rx-line); }
  .rx-strip dd { font-size: 17px; }
}

/* 달력과 일별 패널: 수익 캘린더 영역이 600px 이상이면 좌우로 (calendar.js SIDE_MIN과 같게) */
.rx-cal-wrap { container: rxcal / inline-size; }
.rx-cal-body { display: grid; gap: 16px; }
.rx-cal-main { container: rxmain / inline-size; min-width: 0; }
.rx-day { container: rxday / inline-size; min-width: 0; background: var(--rx-panel); border: 1px solid var(--rx-line); border-radius: 14px; padding: 14px 16px 16px; }
@container rxcal (min-width: 600px) {
  .rx-cal-body { grid-template-columns: minmax(0, 1fr) clamp(290px, 38%, 380px); align-items: start; }
  .rx-day { position: sticky; top: 86px; max-height: calc(100vh - 108px); max-height: calc(100dvh - 108px); overflow-y: auto; overscroll-behavior: contain; }
}

.rx-gridbox { border: 1px solid var(--rx-line); border-radius: 12px; overflow: hidden; }
.rx-grid { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; border: 1px solid var(--rx-line); border-radius: 12px; overflow: hidden; background: rgba(24, 24, 27, 0.45); }
.rx-grid th { font-size: 11px; font-weight: 600; color: var(--rx-t3); padding: 8px 4px 8px 10px; text-align: left; background: rgba(39, 39, 42, 0.45); border-bottom: 1px solid var(--rx-line); }
.rx-grid th + th { border-left: 1px solid var(--rx-line); }
.rx-grid td { padding: 0; height: 1px; vertical-align: top; border-top: 1px solid var(--rx-line); }
.rx-grid tbody tr:first-child td { border-top: 0; }
.rx-grid td + td { border-left: 1px solid var(--rx-line); }
.rx-grid .rx-wk-head, .rx-grid .rx-wk { width: 96px; }
.rx-cell { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; height: 100%; min-height: 92px; padding: 7px 9px; text-align: left; color: var(--rx-t1); background: transparent; transition: background 0.15s; }
.rx-cell:hover { background: rgba(255, 255, 255, 0.04); }
.rx-cell.is-out { color: var(--rx-t4); }
.rx-cell.has-gain { background: var(--rx-gain-bg); }
.rx-cell.has-loss { background: var(--rx-loss-bg); }
.rx-cell.is-selected { box-shadow: inset 0 0 0 2px var(--rx-blue); }
.rx-cell:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--rx-blue-2); border-radius: 0; }
.rx-cell-date { display: inline-grid; place-items: center; min-width: 24px; height: 24px; margin: -2px 0 0 -4px; border-radius: 12px; font-family: var(--rx-mono); font-size: 12px; font-weight: 600; }
.rx-cell.is-today .rx-cell-date { background: var(--rx-blue); color: #fff; }
.rx-cell-r { font-family: var(--rx-mono); font-size: 14px; font-weight: 700; line-height: 1.3; }
.rx-cell-r.rx-flat { font-size: 11px; font-family: inherit; }
.rx-cell-count { font-size: 11px; color: var(--rx-t3); }
.rx-cell-flags { display: flex; flex-wrap: wrap; gap: 3px; margin-top: auto; }
.rx-flag { display: inline-flex; align-items: center; gap: 2px; font-style: normal; font-size: 11px; line-height: 1.55; font-weight: 600; padding: 0 5px 0 3px; border-radius: 4px; color: var(--rx-warn); background: rgba(251, 146, 60, 0.08); box-shadow: inset 0 0 0 1px rgba(251, 146, 60, 0.45); }
.rx-flag svg { width: 11px; height: 11px; }
.rx-flag-stop { background: var(--rx-warn); color: #1c1917; box-shadow: none; padding: 0 5px; }
.rx-wk { background: rgba(39, 39, 42, 0.35); padding: 7px 9px !important; font-size: 11px; color: var(--rx-t3); line-height: 1.6; }
.rx-wk-r { display: block; font-family: var(--rx-mono); font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.rx-wk-line { display: flex; justify-content: space-between; gap: 4px; font-family: var(--rx-mono); color: var(--rx-t2); }
.rx-wk-line span { color: var(--rx-t3); font-family: inherit; }

.rx-weeklist { display: none; list-style: none; margin: 12px 0 0; padding: 0; border: 1px solid var(--rx-line); border-radius: 12px; background: var(--rx-panel); }
.rx-weeklist li { display: grid; grid-template-columns: auto 1fr; gap: 0 12px; padding: 9px 14px; border-top: 1px solid var(--rx-line); font-size: 13px; }
.rx-weeklist li:first-child { border-top: 0; }
.rx-wl-range { font-family: var(--rx-mono); color: var(--rx-t2); font-size: 12px; }
.rx-wl-r { text-align: right; font-family: var(--rx-mono); font-weight: 700; }
.rx-wl-stats { grid-column: 1 / -1; color: var(--rx-t3); font-size: 12px; }
.rx-weeklist li.is-empty .rx-flat { text-align: right; font-size: 12px; }

@container rxmain (max-width: 639px) {
  .rx-grid .rx-wk-head, .rx-grid .rx-wk { display: none; }
  .rx-weeklist:not([hidden]) { display: block; }
  .rx-cell { min-height: 78px; padding: 6px 6px; }
  .rx-cell-r { font-size: 12px; }
  .rx-cell-count { display: none; }
}
@container rxmain (max-width: 479px) {
  .rx-grid th { padding: 6px 0; text-align: center; }
  .rx-cell { min-height: 58px; padding: 5px 2px 4px; align-items: center; gap: 0; }
  .rx-cell-date { margin: 0; font-size: 11px; min-width: 22px; height: 22px; }
  .rx-cell-r { font-size: 10px; letter-spacing: -0.03em; }
  .rx-cell-r.rx-flat { font-size: 10px; }
  .rx-cell-flags { justify-content: center; margin-top: 2px; gap: 2px; }
  .rx-cell-flags .rx-flag { width: 7px; height: 7px; padding: 0; font-size: 0; border-radius: 50%; background: var(--rx-warn); box-shadow: none; }
  .rx-cell-flags .rx-flag svg { display: none; }
  .rx-cell-flags .rx-flag-stop { background: transparent; box-shadow: inset 0 0 0 2px var(--rx-warn); }
}

.rx-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 12px; color: var(--rx-t3); }
.rx-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.rx-lg { display: inline-block; width: 11px; height: 11px; border-radius: 3px; }
.rx-lg-gain { background: var(--rx-gain-bg); box-shadow: inset 0 0 0 1px var(--rx-gain); }
.rx-lg-loss { background: var(--rx-loss-bg); box-shadow: inset 0 0 0 1px var(--rx-loss); }

/* 일별 패널 */
.rx-day-head { margin-bottom: 10px; }
.rx-day-head h3 { font-size: 16px; font-weight: 700; color: var(--rx-t1); margin: 0; }
.rx-day-sum { font-size: 13px; color: var(--rx-t3); margin-top: 2px; }
[data-part="day-alerts"]:not(:empty) { margin-bottom: 10px; }
.rx-trades { list-style: none; margin: 0 0 14px; padding: 0; }
.rx-trades:not(:empty) { border-top: 1px solid var(--rx-line); }
.rx-trade { padding: 11px 0; border-bottom: 1px solid var(--rx-line); }
.rx-trade-top { display: flex; align-items: center; gap: 8px; }
.rx-sym { font-size: 15px; font-weight: 700; color: var(--rx-t1); }
.rx-side { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 4px; background: rgba(63, 63, 70, 0.6); color: var(--rx-t2); }
.rx-trade-r { margin-left: auto; font-size: 16px; font-weight: 700; }
.rx-trade-r.rx-flat { font-size: 13px; font-family: inherit; }
.rx-trade-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; font-size: 12px; color: var(--rx-t3); margin-top: 3px; }
.rx-trade-note { font-size: 13px; color: var(--rx-t2); margin-top: 5px; }
.rx-trade-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 8px; margin-top: 5px; font-size: 12px; }
.rx-trade-actions { display: flex; gap: 2px; margin-right: -8px; }
.rx-trade-actions .rx-ico { width: 14px; height: 14px; }
.rx-trade-form { margin-top: 4px; padding: 14px; background: rgba(39, 39, 42, 0.35); border: 1px solid var(--rx-line); border-radius: 12px; gap: 12px; }
.rx-form-title { font-size: 14px; font-weight: 700; color: var(--rx-t1); margin: 0; }
@container rxday (max-width: 339px) {
  .rx-trade-form { padding: 12px; }
  .rx-trade-form .rx-row2 { grid-template-columns: minmax(0, 1fr); }
  .rx-trade-form .rx-row2.rx-keep2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* ---------- 표 ---------- */
/* position: relative — 표 안의 sr-only(절대 위치) 글자가 스크롤 영역을 벗어나 페이지 폭을 늘리지 않게 */
.rx-scroll { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.rx-scroll:focus-visible { outline-offset: -2px; }
[data-part="table"] > .rx-scroll { background: var(--rx-panel); border: 1px solid var(--rx-line); border-radius: 12px; }
.rx-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rx-table th, .rx-table td { padding: 9px 12px; text-align: left; vertical-align: top; }
.rx-table thead th { font-size: 11px; font-weight: 500; color: var(--rx-t3); background: rgba(39, 39, 42, 0.3); white-space: nowrap; }
.rx-table thead th small { font-size: 10px; }
.rx-table tbody tr { border-top: 1px solid rgba(255, 255, 255, 0.05); }
.rx-table tbody th { font-weight: 600; color: var(--rx-t1); white-space: nowrap; }
.rx-table tr.is-mine > * { background: rgba(96, 165, 250, 0.08); }
.rx-table .rx-num { white-space: nowrap; }
.rx-ledger { min-width: 860px; }
.rx-ledger .rx-note { margin: 0; font-size: 13px; color: var(--rx-t2); min-width: 180px; }
.rx-steps { min-width: 600px; }
.rx-steps td:first-child { width: 48px; color: var(--rx-t3); }
.rx-steps td:nth-child(2) { color: var(--rx-t3); }
.rx-steps td:last-child { color: var(--rx-t1); white-space: normal; }
.rx-audit { min-width: 820px; }
.rx-audit td { padding: 6px 8px; vertical-align: middle; }
.rx-audit th { padding: 9px 8px; }
.rx-scope .rx-cell-input { min-height: 36px !important; padding: 6px 10px !important; }
.rx-audit td:nth-child(1) { width: 160px; }
.rx-audit td:nth-child(2), .rx-audit td:nth-child(3) { width: 130px; }
.rx-audit td:nth-child(4) { width: 90px; font-weight: 600; }
.rx-audit td:nth-child(5) { width: 80px; }
.rx-audit td:nth-child(7) { width: 48px; }

/* ---------- 사이징 ---------- */
.rx-step { margin: 0; padding: 14px 0 0; border: 0; border-top: 1px solid var(--rx-line); min-width: 0; }
.rx-step legend { float: left; width: 100%; padding: 0; font-size: 14px; font-weight: 700; color: var(--rx-t1); display: flex; align-items: baseline; gap: 8px; }
.rx-step legend + * { clear: both; }
.rx-step-no { color: var(--rx-blue-2); }
.rx-step .rx-hint { margin: 2px 0 10px; }
.rx-step .rx-calc { margin-top: 10px; }
.rx-result { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 16px; margin: 0; }
.rx-result dt { font-size: 12px; color: var(--rx-t3); }
.rx-result dt small { font-size: 11px; }
.rx-result dd { margin: 2px 0 0; font-family: var(--rx-mono); font-size: 17px; font-weight: 700; color: var(--rx-t1); overflow-wrap: anywhere; }
.rx-result dd small { font-size: 11px; color: var(--rx-t3); font-weight: 500; font-family: inherit; }
.rx-result-main { grid-column: 1 / -1; padding-bottom: 12px; border-bottom: 1px solid var(--rx-line); }
.rx-result-main dd { font-size: 32px; color: var(--rx-blue-2); line-height: 1.2; }
.rx-result-wide { grid-column: 1 / -1; }
.rx-formula { margin-top: 12px; font-size: 12px; color: var(--rx-t3); font-family: var(--rx-mono); }
[data-part="result"] .rx-warn { margin-top: 12px; }

/* ---------- 분석 ---------- */
.rx-figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 16px; }
@container rxroot (min-width: 760px) { .rx-figs { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; } }
.rx-figs > div { background: var(--rx-panel); border: 1px solid var(--rx-line); border-radius: 12px; padding: 14px 16px; min-width: 0; }
.rx-figs dt { font-size: 12px; color: var(--rx-t3); }
.rx-figs dt small { font-size: 11px; }
.rx-figs dd { margin: 2px 0 0; font-family: var(--rx-mono); font-size: 24px; font-weight: 700; color: var(--rx-t1); line-height: 1.25; }
.rx-figs .rx-fig-sub { font-family: inherit; font-size: 12px; font-weight: 500; color: var(--rx-t3); margin-top: 4px; line-height: 1.45; }
.rx-chart { position: relative; }
.rx-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.rx-gridline { stroke: rgba(255, 255, 255, 0.06); stroke-width: 1; }
.rx-axis0 { stroke: rgba(255, 255, 255, 0.22); stroke-width: 1; }
.rx-tick { fill: var(--rx-t3); font-size: 11px; font-family: var(--rx-mono); }
.rx-line { fill: none; stroke: var(--rx-blue-2); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.rx-dot { fill: var(--rx-blue-2); stroke: #18181b; stroke-width: 2; }
.rx-cross { stroke: rgba(255, 255, 255, 0.25); stroke-width: 1; }
.rx-endlabel { fill: var(--rx-t1); font-size: 11px; font-weight: 700; font-family: var(--rx-mono); }
.rx-hit { cursor: crosshair; }
.rx-tip { position: absolute; z-index: 2; pointer-events: none; display: grid; gap: 1px; padding: 8px 10px; background: rgba(20, 20, 24, 0.96); border: 1px solid rgba(96, 165, 250, 0.35); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); font-size: 12px; white-space: nowrap; color: var(--rx-t2); }
.rx-tip strong { font-size: 14px; }
.rx-mini { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 12px 0 0; }
.rx-mini dt { font-size: 11px; color: var(--rx-t3); }
.rx-mini dd { margin: 0; font-family: var(--rx-mono); font-size: 15px; font-weight: 700; color: var(--rx-t1); }
.rx-mini small { font-size: 11px; color: var(--rx-t3); font-weight: 500; }
.rx-pad .rx-more { margin-top: 14px; }
.rx-verdict { font-size: 14px; color: var(--rx-t1); line-height: 1.65; }

/* ---------- 점검 ---------- */
.rx-habits { list-style: none; margin: 0; padding: 0 16px; }
.rx-habit { display: grid; grid-template-columns: 20px 1fr; gap: 2px 12px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--rx-line); cursor: pointer; }
.rx-habit input { width: 18px; height: 18px; margin: 0; }
.rx-habit-text { font-size: 14px; color: var(--rx-t1); }
.rx-habit-ev { grid-column: 2; color: var(--rx-t3); font-size: 12px; }
.rx-habit:hover .rx-habit-text { color: #fff; }
.rx-habit-count { padding: 12px 16px 16px; font-size: 14px; }

/* ---------- 설정 ---------- */
.rx-kv { display: grid; gap: 6px; margin: 0; font-size: 13px; }
.rx-kv > div { display: grid; grid-template-columns: 90px 1fr; gap: 10px; }
.rx-kv dt { color: var(--rx-t3); }
.rx-kv dd { margin: 0; color: var(--rx-t1); font-family: var(--rx-mono); font-size: 12px; }
.rx-bal { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; margin: 0 0 6px; }
.rx-bal dt { font-size: 11px; color: var(--rx-t3); }
.rx-bal dd { margin: 0; font-family: var(--rx-mono); font-size: 14px; font-weight: 700; color: var(--rx-t1); }
.rx-bal-main { grid-column: 1 / -1; }
.rx-bal-main dd { font-size: 24px; }
.rx-bal-main dd.rx-dim { font-size: 13px; font-family: inherit; font-weight: 500; }
.rx-bal small { font-size: 12px; color: var(--rx-t3); font-weight: 500; }
.rx-adj { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: end; }
.rx-adj .rx-err { grid-column: 1 / -1; margin-top: -4px; }
.rx-adj-list { list-style: none; margin: 14px 0 0; padding: 0; border-top: 1px solid var(--rx-line); }
.rx-adj-list li { display: grid; grid-template-columns: auto 1fr auto 40px; align-items: center; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--rx-line); font-size: 13px; min-height: 46px; }
.rx-adj-list li.rx-empty-line { display: block; padding: 12px 0; color: var(--rx-t3); }
.rx-adj-note { color: var(--rx-t3); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 토스트, 확인창 ---------- */
.rx-toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 9999;
  width: min(520px, calc(100vw - 32px)); transform: translate(-50%, 10px); opacity: 0;
  display: flex; align-items: center; gap: 8px; padding: 9px 6px 9px 14px; border-radius: 12px;
  background: rgba(20, 20, 24, 0.97); border: 1px solid rgba(96, 165, 250, 0.4); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  color: #fff; font-size: 13px; line-height: 1.5; transition: opacity 0.2s, transform 0.2s;
}
.rx-toast.is-in { opacity: 1; transform: translate(-50%, 0); }
.rx-toast-gain { border-color: rgba(74, 222, 128, 0.4); }
.rx-toast-danger { border-color: rgba(248, 113, 113, 0.55); }
.rx-toast-msg { flex: 1; }
.rx-toast-action { color: var(--rx-blue-2); font-weight: 700; padding: 0 10px; min-height: 36px; border-radius: 6px; white-space: nowrap; }
.rx-toast-action:hover { background: rgba(255, 255, 255, 0.08); }
.rx-toast-close { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 6px; color: var(--rx-t3); flex: none; }
.rx-toast-close:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
@media (min-width: 768px) { .rx-toast { bottom: 24px; } }

.rx-dialog { width: min(440px, calc(100vw - 32px)); padding: 24px; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 16px; background: #050505; color: var(--rx-t2); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5); }
.rx-dialog::backdrop { background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(4px); }
.rx-dialog h2 { font-size: 17px; font-weight: 700; color: #fff; margin: 0 0 12px; }
.rx-dialog-body { display: grid; gap: 8px; font-size: 13px; color: var(--rx-t3); line-height: 1.6; }
.rx-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 22px; }

/* ---------- 사용가이드 ---------- */
.rxg { container: rxg / inline-size; }
.rxg-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; padding: 18px 20px; }
.rxg-head-text { flex: 1 1 420px; min-width: 0; }
.rxg-head-text .rx-sub { max-width: 70ch; }
.rxg-head-side { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.rxg-meta { font-size: 12px; color: var(--rx-t4); }
.rxg-error { display: grid; gap: 12px; justify-items: start; color: var(--rx-t2); }
.rxg-error p { margin: 0; }

.rxg-layout { display: grid; gap: 16px 32px; }
.rxg-toc { scroll-margin-top: 92px; background: var(--rx-panel); border: 1px solid var(--rx-line); border-radius: 14px; padding: 12px 8px; }
.rxg-toc:focus { outline: none; }
.rxg-toc-t { font-size: 12px; font-weight: 600; color: var(--rx-t4); margin: 0 0 6px 10px; }
.rxg-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rxg-toc a { display: flex; align-items: baseline; gap: 10px; min-height: 40px; padding: 8px 10px; border-radius: 8px; color: var(--rx-t2); font-size: 13px; font-weight: 600; text-decoration: none; }
.rxg-toc a:hover { background: rgba(255, 255, 255, 0.05); color: var(--rx-t1); }
.rxg-toc a[aria-current="true"] { background: var(--rx-blue-bg); color: var(--rx-blue-2); }
.rxg-toc-no { flex: none; min-width: 1.1em; font-family: var(--rx-mono); font-size: 12px; color: var(--rx-t4); }
.rxg-toc a[aria-current="true"] .rxg-toc-no { color: inherit; }
.rxg-toc-name { min-width: 0; }
.rxg-toc small { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; color: var(--rx-t3); line-height: 1.5; }
@container rxg (min-width: 620px) and (max-width: 979.98px) {
  .rxg-toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 8px; }
}
@container rxg (min-width: 980px) {
  .rxg-layout { grid-template-columns: 212px minmax(0, 1fr); align-items: start; }
  .rxg-toc { position: sticky; top: 92px; max-height: calc(100vh - 116px); overflow-y: auto; }
  .rxg-toc small { display: none; }
  .rxg-ch-foot { display: none; }
}

.rxg-body { container: rxgb / inline-size; min-width: 0; font-size: 14px; line-height: 1.75; color: var(--rx-t2); word-break: keep-all; overflow-wrap: anywhere; }
.rxg-body p { margin: 0 0 10px; }
.rxg-ch { scroll-margin-top: 92px; padding: 28px 0 12px; border-top: 1px solid var(--rx-line-2); }
.rxg-ch:first-child { border-top: 0; padding-top: 4px; }
.rxg-ch-title { display: flex; align-items: baseline; gap: 10px; margin: 0 0 8px; font-size: 22px; font-weight: 700; line-height: 1.35; color: var(--rx-t1); scroll-margin-top: 92px; }
.rxg-ch-title:focus:not(:focus-visible) { outline: none; }
.rxg-no { font-family: var(--rx-mono); font-size: 19px; color: var(--rx-blue-2); }
.rxg-body .rxg-lead { max-width: 68ch; margin: 0 0 24px; font-size: 15px; line-height: 1.7; color: var(--rx-t3); }
.rxg-h { margin: 32px 0 10px; font-size: 17px; font-weight: 700; line-height: 1.4; color: var(--rx-t1); }
.rxg-lead + .rxg-h { margin-top: 0; }
.rxg-hh { margin: 22px 0 6px; font-size: 14px; font-weight: 700; color: var(--rx-t1); }
.rxg-measure { max-width: 70ch; }
.rxg-formula, .rxg-num { font-variant-numeric: tabular-nums; }
.rxg-body .rxg-ch-foot { margin: 14px 0 0; }
.rxg-body .rxg-fine { margin-top: 26px; font-size: 12px; color: var(--rx-t4); }

/* 예시 화면 */
.rxg-fig { max-width: var(--w, 100%); margin: 12px 0 22px; }
.rxg-shot { display: block; width: 100%; padding: 0; text-align: left; cursor: zoom-in; background: #0a0a0c; border: 1px solid var(--rx-line-2); border-radius: 12px; transition: border-color 0.15s; }
.rxg-shot:hover { border-color: var(--rx-blue-bd); }
.rxg-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 11px 11px 0 0; font-size: 11px; line-height: 1.4; color: var(--rx-t3); background: rgba(255, 255, 255, 0.03); border-bottom: 1px solid var(--rx-line-2); }
.rxg-tag { font-weight: 600; color: var(--rx-t2); }
.rxg-zoom { display: inline-flex; align-items: center; gap: 4px; }
.rxg-zoom .rx-ico { width: 13px; height: 13px; }
.rxg-shot:hover .rxg-zoom { color: var(--rx-blue-2); }
.rxg-frame { position: relative; display: block; container-type: inline-size; }
.rxg-img { display: block; width: 100%; height: auto; border-radius: 0 0 11px 11px; }
.rxg-shot:not(.is-ready) .rxg-img, .rxg-shot:not(.is-ready) .rxg-mk { visibility: hidden; }
.rxg-fail { position: absolute; inset: 0; display: none; place-items: center; padding: 12px; font-size: 13px; text-align: center; color: var(--rx-t3); }
.rxg-shot.is-failed .rxg-fail { display: grid; }
.rxg-mk { position: absolute; display: grid; place-items: center; width: clamp(16px, 2.6cqi, 22px); height: clamp(16px, 2.6cqi, 22px); transform: translate(-50%, -50%); border-radius: 50%; background: var(--rx-blue); box-shadow: 0 0 0 2px #fff; color: #fff; font-family: var(--rx-mono); font-size: clamp(9px, 1.5cqi, 12px); font-weight: 700; line-height: 1; pointer-events: none; }
.rxg-fig figcaption { margin-top: 8px; font-size: 12.5px; line-height: 1.6; color: var(--rx-t3); }

.rxg-side { display: grid; gap: 4px 28px; align-items: start; margin: 12px 0 22px; }
.rxg-side > .rxg-fig { margin: 0 0 12px; }
.rxg-side-default > .rxg-fig, .rxg-side-narrow-img > .rxg-fig { max-width: min(var(--w, 100%), 300px); }
@container rxgb (min-width: 700px) {
  .rxg-side > .rxg-fig { margin: 0; }
  .rxg-side-default { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); }
  .rxg-side-wide-img { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
  .rxg-side-table-img { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .rxg-side-mid-img { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rxg-side-narrow-img { grid-template-columns: minmax(0, 240px) minmax(0, 1fr); }
  .rxg-side-sizing-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
}

/* 번호 설명, 단계, 알아두기 */
.rxg-legend { list-style: none; max-width: 72ch; margin: 4px 0 20px; padding: 0; }
.rxg-legend li { position: relative; margin-bottom: 9px; padding-left: 32px; }
.rxg-legend li::before { content: attr(data-n); position: absolute; left: 0; top: 2px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--rx-blue); color: #fff; font-family: var(--rx-mono); font-size: 12px; font-weight: 700; line-height: 1; }
@container rxgb (min-width: 760px) {
  .rxg-cols2 { max-width: none; columns: 2; column-gap: 32px; }
  .rxg-cols2 li { break-inside: avoid; }
}
.rxg-steps { list-style: none; max-width: 70ch; margin: 6px 0 20px; padding: 0; counter-reset: rxg; }
.rxg-steps li { position: relative; padding: 0 0 10px 34px; counter-increment: rxg; }
.rxg-steps li::before { content: counter(rxg); position: absolute; left: 0; top: 2px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--rx-t3); color: var(--rx-t1); font-family: var(--rx-mono); font-size: 12px; font-weight: 700; line-height: 1; }
.rxg-note { max-width: 76ch; margin: 12px 0 22px; padding: 12px 16px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); }
.rxg-body .rxg-note p:last-child { margin-bottom: 0; }
.rxg-note-t { margin-right: 8px; font-weight: 700; color: var(--rx-t1); }
.rxg-tip { background: var(--rx-blue-bg); }
.rxg-tip .rxg-note-t { color: var(--rx-blue-2); }
.rxg-caution { background: var(--rx-warn-bg); }
.rxg-caution .rxg-note-t { color: var(--rx-warn); }

/* 표 */
.rxg-tw { margin: 10px 0 22px; border: 1px solid var(--rx-line-2); border-radius: 10px; }
.rxg-tw.rxg-measure { max-width: 76ch; }
.rxg-side .rxg-tw { margin: 0; }
.rxg-table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.6; }
.rxg-table th, .rxg-table td { padding: 9px 12px; text-align: left; vertical-align: top; }
.rxg-table thead th { font-size: 12px; font-weight: 500; color: var(--rx-t3); background: rgba(39, 39, 42, 0.45); white-space: nowrap; }
.rxg-table tbody tr { border-top: 1px solid rgba(255, 255, 255, 0.06); }
.rxg-table tbody:first-child tr:first-child, .rxg-table thead + tbody tr:first-child { border-top: 0; }
.rxg-table tbody th { font-weight: 600; color: var(--rx-t1); white-space: nowrap; }
.rxg-routine tbody th { width: 8em; }
.rxg-calc caption { caption-side: top; padding: 9px 12px 2px; text-align: left; font-size: 12px; color: var(--rx-t3); }
.rxg-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; vertical-align: 1px; }
.rxg-dot-ok { background: #4ade80; }
.rxg-dot-wait { background: #a1a1aa; }
.rxg-dot-warn { background: #facc15; }
.rxg-dot-bad { background: #f87171; }
@container rxgb (max-width: 559px) {
  .rxg-table tbody th { white-space: normal; min-width: 6.5em; }
  .rxg-table td { min-width: 11em; }
}

/* 흐름 */
.rxg-flow { display: grid; gap: 4px; margin: 10px 0 8px; }
.rxg-flow-step { padding: 10px 14px; border: 1px solid var(--rx-line-2); border-radius: 10px; background: var(--rx-panel); }
.rxg-fs-when { font-size: 12px; font-weight: 600; color: var(--rx-blue-2); }
.rxg-fs-what { margin: 2px 0; font-size: 14px; font-weight: 700; color: var(--rx-t1); }
.rxg-fs-desc { font-size: 12.5px; line-height: 1.55; color: var(--rx-t3); }
.rxg-flow-arrow { display: grid; place-items: center; color: var(--rx-t4); }
.rxg-flow-arrow svg { transform: rotate(90deg); }
.rxg-body .rxg-flow-back { margin: 0 0 24px; font-size: 12.5px; color: var(--rx-t3); }
@container rxgb (min-width: 700px) {
  .rxg-flow { grid-template-columns: 1fr 14px 1fr 14px 1fr 14px 1fr; gap: 6px; align-items: stretch; }
  .rxg-flow-arrow svg { transform: none; }
  .rxg-body .rxg-flow-back { text-align: right; }
}

/* 자주 묻는 질문 */
.rxg-qa { max-width: 76ch; padding: 12px 0; border-bottom: 1px solid var(--rx-line-2); }
.rxg-h + .rxg-qa { border-top: 1px solid var(--rx-line-2); }
.rxg-body .rxg-q { margin-bottom: 4px; font-weight: 700; color: var(--rx-t1); }
.rxg-body .rxg-qa p:last-child { margin-bottom: 0; }

/* 크게 보기 */
.rxg-box { width: fit-content; min-width: min(420px, calc(100vw - 24px)); max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); padding: 0; overflow: hidden; color: var(--rx-t2); background: #050505; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 14px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5); }
.rxg-box[open] { display: flex; flex-direction: column; }
.rxg-box::backdrop { background: rgba(0, 0, 0, 0.85); }
.rxg-box-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 6px 6px 16px; border-bottom: 1px solid var(--rx-line-2); }
.rxg-box-bar p { min-width: 0; margin: 0; overflow: hidden; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.rxg-box-hint { margin: 0; padding: 6px 16px; font-size: 12px; color: var(--rx-t3); border-bottom: 1px solid var(--rx-line); }
.rxg-box-scroll { flex: 1 1 auto; min-height: 0; padding: 12px; overflow: auto; overscroll-behavior: contain; }
.rxg-box-frame { position: relative; max-width: none; margin: 0 auto; container-type: inline-size; }
.rxg-box-frame img { display: block; width: 100%; height: auto; border-radius: 6px; }

@media (prefers-reduced-motion: reduce) {
  .rx-toast { transition: opacity 0.15s linear; transform: translate(-50%, 0); }
  .rx-scope * { transition: none !important; }
}
