  :root {
    --bg: #06070b;
    --bg-2: #0b0d14;
    --card: rgba(255,255,255,0.025);
    --card-hover: rgba(255,255,255,0.04);
    --border: rgba(255,255,255,0.07);
    --border-strong: rgba(255,255,255,0.12);
    --text: #ecedf1;
    --muted: #8b919c;
    --dim: #5d6371;
    --accent: #b39dff;
    --accent-2: #8b5cf6;
    --accent-glow: rgba(179,157,255,0.35);
    --green: #4ade80;
    --orange: #fb923c;
    --red: #f87171;
    --blue: #60a5fa;
    --teal: #5eead4;
    --font-sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

  /* 모바일 가로 스크롤 방지 (세로는 자유롭게) */
  html {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-text-size-adjust: 100%;
  }
  body {
    overflow-x: hidden;
    overflow-y: visible;
    min-height: 100vh;
    position: relative;
  }
  img, svg, video, canvas, iframe {
    max-width: 100%;
    height: auto;
  }

  /* 키보드 포커스 (접근성) */
  *:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 6px;
  }
  /* 마우스 클릭 시에는 outline 안보이게 */
  *:focus:not(:focus-visible) { outline: none; }
  html, body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.01em;
  }
  body {
    background:
      radial-gradient(1200px 600px at 50% -100px, rgba(139,92,246,0.10), transparent 60%),
      radial-gradient(800px 500px at 100% 30%, rgba(94,234,212,0.04), transparent 60%),
      radial-gradient(900px 600px at 0% 80%, rgba(96,165,250,0.04), transparent 60%),
      var(--bg);
  }
  /* 데스크톱에서만 background-attachment fixed (모바일은 스크롤 끊김 발생) */
  @media (hover: hover) and (pointer: fine) {
    body { background-attachment: fixed; }
  }
  /* container 에만 safe-area-inset 적용 (body 적용 시 가로 스크롤 발생 가능) */
  .container {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    padding-bottom: max(50px, env(safe-area-inset-bottom));
  }
  .num, .num * { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }

  .container { max-width: 540px; margin: 0 auto; padding: 10px 12px 50px; }

  .topbar {
    position: relative;
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px; padding: 9px 12px;
    background:
      linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015)),
      rgba(11,13,20,0.5);
    border: 1px solid var(--border);
    border-radius: 13px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 6px 20px rgba(0,0,0,0.25);
  }
  .topbar::before {
    content: ""; position: absolute; inset: 0;
    border-radius: 13px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(179,157,255,0.25), transparent 40%, transparent 60%, rgba(94,234,212,0.15));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    pointer-events: none;
  }
  .topbar-brand {
    display: flex; align-items: center; gap: 10px;
  }
  .brand-mark {
    width: 26px; height: 26px;
    border-radius: 7px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff; font-size: 13px; font-weight: 800;
    box-shadow: 0 6px 18px -4px var(--accent-glow), 0 0 0 1px rgba(255,255,255,0.08) inset;
    letter-spacing: -0.04em;
  }
  .topbar-title {
    font-size: 13.5px; font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--text);
  }
  .topbar-title .sub {
    color: var(--muted); font-weight: 500; margin-left: 6px;
    font-size: 11.5px;
  }
  .topbar-actions {
    display: flex; align-items: center; gap: 6px;
  }
  .icon-btn {
    background: rgba(179,157,250,0.10);
    border: 1px solid rgba(179,157,250,0.28);
    color: var(--accent);
    width: 27px; height: 27px;
    border-radius: 50%;
    font-size: 13px; font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
    display: grid; place-items: center;
    padding: 0;
  }
  .icon-btn:hover {
    background: rgba(179,157,250,0.18);
    border-color: rgba(179,157,250,0.45);
    transform: translateY(-1px);
  }
  .icon-btn:active { transform: translateY(0); }
  .icon-btn svg { display: block; }

  .hint-panel {
    position: relative;
    background:
      linear-gradient(135deg, rgba(179,157,255,0.10), rgba(96,165,250,0.04));
    border: 1px solid rgba(179,157,255,0.22);
    border-radius: 11px;
    padding: 10px 13px;
    margin-bottom: 10px;
    font-size: 12.5px;
    line-height: 1.5;
    transition: all 0.3s;
    color: #d8dae0;
  }
  .hint-panel b { color: var(--accent); font-weight: 700; }

  .card {
    position: relative;
    background:
      linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.01)),
      rgba(11,13,20,0.4);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 13px;
    margin-bottom: 10px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 1px 0 rgba(255,255,255,0.03) inset, 0 4px 14px rgba(0,0,0,0.18);
  }
  .card-title {
    font-size: 10.5px; font-weight: 700;
    color: var(--muted);
    letter-spacing: 0.13em; text-transform: uppercase;
    margin-bottom: 10px;
    display: flex; align-items: center; gap: 7px;
  }
  .card-title::after {
    content: ""; flex: 1; height: 1px;
    background: linear-gradient(90deg, var(--border), transparent);
    margin-left: 4px;
  }

  /* === 풀 시각화 === */
  .pool-bars {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 8px; margin-bottom: 10px;
  }
  .bar-group {
    position: relative;
    background:
      linear-gradient(180deg, rgba(0,0,0,0.35), rgba(0,0,0,0.2));
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 10px;
    padding: 9px 11px;
    overflow: hidden;
  }
  .bar-group::before {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(circle at 100% 0%, rgba(179,157,255,0.06), transparent 50%);
    pointer-events: none;
  }
  .bar-group.usdt::before {
    background: radial-gradient(circle at 100% 0%, rgba(94,234,212,0.06), transparent 50%);
  }
  .bar-label {
    font-size: 9.5px; font-weight: 700;
    color: var(--dim); letter-spacing: 0.14em;
    position: relative;
  }
  .bar-amount {
    font-family: var(--font-mono);
    font-size: 16px; font-weight: 600;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
    margin: 4px 0 7px;
    word-break: break-all;
    position: relative;
  }
  .bar-bg {
    height: 4px; border-radius: 999px;
    background: rgba(255,255,255,0.04);
    overflow: hidden;
    position: relative;
  }
  .bar-fill {
    height: 100%; border-radius: 999px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 12px currentColor;
  }
  .bar-a {
    background: linear-gradient(90deg, var(--accent), #c4b5fd);
    color: var(--accent-glow);
  }
  .bar-b {
    background: linear-gradient(90deg, var(--teal), #86efac);
    color: rgba(94,234,212,0.4);
  }

  .pool-stats {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 4px 10px; padding-top: 10px;
    border-top: 1px dashed var(--border);
    font-size: 11px;
  }
  .pool-stats > div {
    display: flex; flex-direction: column; gap: 2px;
    color: var(--dim);
    min-width: 0;
  }
  .pool-stats > div span {
    font-size: 10px; letter-spacing: 0.04em;
  }
  .pool-stats b {
    color: var(--text); font-weight: 600;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
    font-size: 12px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }

  /* === 미니 차트 === */
  .price-chart {
    height: 48px;
    background:
      linear-gradient(180deg, rgba(0,0,0,0.35), rgba(0,0,0,0.15));
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 8px;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
  }
  .price-chart svg { width: 100%; height: 100%; display: block; }
  .price-chart .empty-msg {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--dim); font-size: 10.5px;
  }

  /* === 보유 카드 === */
  /* === 자산 카드 면책 안내 === */
  .asset-disclaimer {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    margin-bottom: 10px;
    background: rgba(251,191,36,0.06);
    border: 1px solid rgba(251,191,36,0.2);
    border-radius: 7px;
    font-size: 10.5px;
    line-height: 1.4;
    color: #c9a55a;
    font-weight: 500;
  }

  .balances {
    display: grid; gap: 0;
    font-size: 12.5px;
  }
  .balances > div {
    display: flex; justify-content: space-between; align-items: baseline;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(255,255,255,0.04);
    gap: 10px;
  }
  .balances > div:last-child { border-bottom: none; }
  .balances .val-col {
    display: flex; flex-direction: column; align-items: flex-end;
    line-height: 1.25;
    min-width: 0;
  }
  .balances b {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    letter-spacing: -0.01em;
  }
  .balances .label { color: var(--muted); font-weight: 500; }
  .fiat-sub {
    color: var(--dim);
    font-weight: 500;
    font-size: 10.5px;
    margin-top: 1px;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
  }
  .il-positive b { color: var(--green); }
  .il-negative b { color: var(--red); }
  #total-value {
    color: var(--accent);
    font-size: 13.5px;
    font-weight: 700;
  }
  #total-value .fiat-sub {
    color: var(--muted);
  }

  /* === 액션 카드 (스왑/LP) === */
  .toggle-row {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 3px; margin-bottom: 11px;
    background: rgba(0,0,0,0.35);
    padding: 3px;
    border-radius: 9px;
    border: 1px solid rgba(255,255,255,0.04);
  }
  .toggle-row.three { grid-template-columns: 1fr 1fr 1fr; }
  .toggle-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    padding: 8px 6px;
    border-radius: 6px;
    font-size: 11.5px; font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    letter-spacing: 0.01em;
    white-space: nowrap;
  }
  .toggle-btn:hover { color: var(--text); }
  .toggle-btn.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 14px -4px var(--accent-glow), 0 0 0 1px rgba(255,255,255,0.1) inset;
  }

  .input-row {
    display: flex; align-items: center; gap: 7px;
    margin-bottom: 7px;
  }
  .input-row label {
    font-size: 10.5px; font-weight: 700;
    color: var(--muted);
    min-width: 44px;
    letter-spacing: 0.04em;
  }
  .input-row input[type="number"] {
    flex: 1;
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 7px;
    padding: 9px 11px;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 13.5px; font-weight: 500;
    font-variant-numeric: tabular-nums;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    min-width: 0;
  }
  .input-row input[type="number"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(179,157,255,0.12);
  }
  .input-row input[type="number"]:disabled {
    opacity: 0.6; cursor: not-allowed;
  }
  .input-row input[type="range"] { flex: 1; accent-color: var(--accent); }
  .input-row .max-btn {
    background: rgba(179,157,250,0.12);
    border: 1px solid rgba(179,157,250,0.28);
    color: var(--accent);
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 10.5px; font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    letter-spacing: 0.02em;
  }
  .input-row .max-btn:hover {
    background: rgba(179,157,250,0.2);
    border-color: rgba(179,157,250,0.45);
  }
  .pct-display {
    min-width: 42px; text-align: right;
    color: var(--accent); font-weight: 700;
    font-size: 12.5px;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
  }

  .preview-box {
    background:
      linear-gradient(180deg, rgba(0,0,0,0.3), rgba(0,0,0,0.18));
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 8px;
    padding: 8px 11px;
    margin: 9px 0;
    font-size: 11.5px;
  }
  .preview-row {
    display: flex; justify-content: space-between; align-items: baseline;
    padding: 3px 0;
    color: var(--muted);
  }
  .preview-row b {
    color: var(--text); font-weight: 600;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
  }
  .preview-row.warn b { color: var(--orange); }
  .preview-row.danger b { color: var(--red); }

  .action-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff; border: none;
    border-radius: 9px;
    padding: 11px;
    font-size: 13.5px; font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: transform 0.1s ease, opacity 0.2s, box-shadow 0.2s ease;
    box-shadow: 0 6px 20px -6px var(--accent-glow), 0 0 0 1px rgba(255,255,255,0.08) inset;
  }
  .action-btn:hover:not(:disabled) {
    box-shadow: 0 8px 28px -6px var(--accent-glow), 0 0 0 1px rgba(255,255,255,0.12) inset;
  }
  .action-btn:active:not(:disabled) { transform: scale(0.985); }
  .action-btn:disabled {
    background: rgba(255,255,255,0.04);
    color: var(--dim); cursor: not-allowed;
    box-shadow: none;
  }
  .action-btn.green {
    background: linear-gradient(135deg, var(--green), #16a34a);
    box-shadow: 0 6px 20px -6px rgba(74,222,128,0.4), 0 0 0 1px rgba(255,255,255,0.08) inset;
  }
  .action-btn.green:hover:not(:disabled) {
    box-shadow: 0 8px 28px -6px rgba(74,222,128,0.5), 0 0 0 1px rgba(255,255,255,0.12) inset;
  }
  .action-btn.red {
    background: linear-gradient(135deg, var(--red), #dc2626);
    box-shadow: 0 6px 20px -6px rgba(248,113,113,0.4), 0 0 0 1px rgba(255,255,255,0.08) inset;
  }
  .action-btn.red:hover:not(:disabled) {
    box-shadow: 0 8px 28px -6px rgba(248,113,113,0.5), 0 0 0 1px rgba(255,255,255,0.12) inset;
  }

  .swap-arrow {
    text-align: center;
    margin: 4px 0;
    color: var(--accent);
    font-size: 16px;
  }

  /* === 설정 === */
  .check-row {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 0;
    font-size: 12.5px;
    cursor: pointer;
    transition: color 0.15s ease;
  }
  .check-row:hover { color: var(--accent); }
  .check-row input[type="checkbox"] {
    width: 17px; height: 17px;
    accent-color: var(--accent);
    cursor: pointer;
  }
  .reset-btn {
    width: 100%;
    background: rgba(248,113,113,0.08);
    border: 1px solid rgba(248,113,113,0.25);
    color: var(--red);
    padding: 9px;
    border-radius: 9px;
    font-size: 12.5px; font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.18s ease;
    letter-spacing: 0.01em;
  }
  .reset-btn:hover {
    background: rgba(248,113,113,0.14);
    border-color: rgba(248,113,113,0.4);
  }

  /* === 시장 가격 표시 === */
  .market-price {
    background:
      linear-gradient(135deg, rgba(96,165,250,0.08), rgba(94,234,212,0.04));
    border: 1px solid rgba(96,165,250,0.22);
    border-radius: 11px;
    padding: 9px 12px;
    margin-bottom: 10px;
    font-size: 11.5px;
    display: flex; justify-content: space-between; align-items: center;
    gap: 10px;
    color: var(--muted);
  }
  .market-price-left {
    display: inline-flex; align-items: center; gap: 8px;
    min-width: 0;
  }
  .market-label {
    color: var(--muted); font-weight: 600;
    letter-spacing: 0.01em;
  }
  .market-meta {
    color: var(--dim);
    font-size: 10px;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.05);
    white-space: nowrap;
    margin-left: 2px;
  }
  .market-price b {
    color: var(--blue);
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-left: 2px;
  }
  .market-price .deviation {
    font-size: 11px; font-weight: 700;
    padding: 4px 9px;
    border-radius: 999px;
    letter-spacing: 0.01em;
    white-space: nowrap;
  }
  .market-price .deviation.up { background: rgba(74,222,128,0.13); color: var(--green); }
  .market-price .deviation.down { background: rgba(248,113,113,0.13); color: var(--red); }
  .market-price .deviation.flat { background: rgba(255,255,255,0.05); color: var(--muted); }

  /* 라이브 상태 점 */
  .market-status {
    display: inline-block;
    width: 7px; height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
  }
  .market-status.idle { background: var(--dim); }
  .market-status.loading {
    background: var(--orange);
    box-shadow: 0 0 0 2px rgba(251,146,60,0.18);
    animation: pulse-status 1s ease-in-out infinite;
  }
  .market-status.live {
    background: var(--green);
    box-shadow: 0 0 0 2px rgba(74,222,128,0.22);
    animation: pulse-status 2s ease-in-out infinite;
  }
  .market-status.error {
    background: var(--red);
    box-shadow: 0 0 0 2px rgba(248,113,113,0.18);
  }
  @keyframes pulse-status {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
  }

  /* === 도움말 모달 === */
  .modal {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.85);
    display: none;
    align-items: center; justify-content: center;
    padding: 20px;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    /* 노치 안전영역 */
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
  .modal.active { display: flex; }
  .modal-content {
    background:
      linear-gradient(180deg, rgba(255,255,255,0.03), transparent),
      var(--bg-2);
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    padding: 22px;
    max-width: 500px; width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    -webkit-overflow-scrolling: touch;
  }
  /* 작은 화면 — 모달이 더 큰 비율 차지 */
  @media (max-width: 480px) {
    .modal { padding: 12px; }
    .modal-content {
      padding: 18px 16px;
      max-height: 92vh;
      border-radius: 14px;
    }
    .modal-content h2 { font-size: 17px !important; margin-bottom: 12px; }
  }
  .modal-content h2 {
    font-size: 19px; font-weight: 800;
    margin-bottom: 14px;
    color: var(--accent);
    letter-spacing: -0.01em;
  }
  .modal-content h3 {
    font-size: 14px; font-weight: 700;
    margin: 16px 0 6px;
    color: var(--text);
  }
  .modal-content p {
    font-size: 13px; line-height: 1.65;
    margin-bottom: 8px;
    color: #c8cad1;
  }
  .modal-content code {
    background: rgba(179,157,250,0.12);
    color: #d4c5ff;
    padding: 2px 7px;
    border-radius: 5px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
  }
  .modal-close {
    width: 100%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    border: none; border-radius: 10px;
    padding: 12px; font-weight: 700;
    margin-top: 16px; cursor: pointer;
    box-shadow: 0 6px 20px -6px var(--accent-glow);
    transition: transform 0.1s ease;
  }
  .modal-close:active { transform: scale(0.985); }

  /* === 매뉴얼 링크 배너 (도움말 모달 상단) === */
  .manual-link-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    margin: -4px 0 18px;
    background: linear-gradient(135deg, rgba(179,157,250,0.1), rgba(94,234,212,0.06));
    border: 1px solid rgba(179,157,250,0.25);
    border-radius: 11px;
    color: var(--text);
    text-decoration: none;
    transition: all 0.2s ease;
  }
  .manual-link-banner:hover {
    background: linear-gradient(135deg, rgba(179,157,250,0.16), rgba(94,234,212,0.1));
    border-color: rgba(179,157,250,0.4);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px -8px rgba(179,157,250,0.4);
  }
  .manual-link-banner:active { transform: translateY(0); }
  .manual-link-banner .banner-icon {
    font-size: 22px;
    flex-shrink: 0;
    line-height: 1;
  }
  .manual-link-banner .banner-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
  }
  .manual-link-banner .banner-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.005em;
  }
  .manual-link-banner .banner-desc {
    font-size: 11.5px;
    color: var(--muted);
    line-height: 1.4;
  }
  .manual-link-banner .banner-arrow {
    color: var(--accent);
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
    transition: transform 0.2s ease;
  }
  .manual-link-banner:hover .banner-arrow {
    transform: translateX(3px);
  }

  /* === 학습 여정 순서도 === */
  .journey {
    margin: 8px 0 6px;
    padding: 4px 2px;
  }
  .journey-step {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
  }
  /* 단계 사이 연결선 */
  .journey-step:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 38px;
    bottom: -10px;
    width: 2px;
    background: linear-gradient(180deg, var(--accent) 0%, rgba(179,157,250,0.15) 100%);
    border-radius: 999px;
  }
  .journey-num {
    flex-shrink: 0;
    width: 30px; height: 30px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    box-shadow: 0 4px 14px -4px var(--accent-glow), 0 0 0 1px rgba(255,255,255,0.1) inset;
    position: relative;
    z-index: 1;
    letter-spacing: -0.02em;
  }
  .journey-body {
    flex: 1;
    padding-top: 2px;
    min-width: 0;
  }
  .journey-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text);
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 3px;
    line-height: 1.3;
  }
  .journey-desc {
    font-size: 12px;
    line-height: 1.55;
    color: var(--muted);
  }
  .journey-desc code {
    background: rgba(179,157,250,0.12);
    color: #d4c5ff;
    padding: 1px 5px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 11px;
  }
  .journey-arrow {
    text-align: center;
    color: var(--accent);
    font-size: 14px;
    margin: -4px 0 -2px 14px;
    opacity: 0.6;
  }

  /* === FAQ 접이식 항목 === */
  .faq-list { margin-top: 6px; }
  .faq {
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--border);
    border-radius: 9px;
    margin: 5px 0;
    overflow: hidden;
    transition: background-color 0.18s ease, border-color 0.18s ease;
  }
  .faq:hover { background: rgba(255,255,255,0.04); }
  .faq[open] {
    background: rgba(179,157,250,0.06);
    border-color: rgba(179,157,250,0.22);
  }
  .faq summary {
    cursor: pointer;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 9px;
    user-select: none;
    -webkit-user-select: none;
  }
  .faq summary::-webkit-details-marker { display: none; }
  .faq summary::before {
    content: "+";
    color: var(--accent);
    font-weight: 700;
    font-size: 16px;
    line-height: 1;
    width: 12px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
  }
  .faq[open] summary::before { content: "−"; }
  .faq-body {
    padding: 4px 14px 12px 33px;
    font-size: 12.5px;
    line-height: 1.65;
    color: #c8cad1;
  }
  .faq-body code {
    background: rgba(179,157,250,0.12);
    color: #d4c5ff;
    padding: 1px 5px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 11.5px;
  }
  .faq-body b { color: var(--accent); font-weight: 700; }

  .settings-modal-content { max-width: 440px; }
  .settings-modal-content h2 {
    font-size: 16px;
    margin-bottom: 14px;
    letter-spacing: -0.005em;
  }
  .settings-modal-content .check-row {
    padding: 10px 12px;
    margin-bottom: 4px;
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--border);
    border-radius: 9px;
  }
  .settings-modal-content .reset-btn {
    margin-top: 12px;
  }
  .settings-modal-content .modal-close {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    color: var(--muted);
    box-shadow: none;
    margin-top: 8px;
  }
  .settings-modal-content .modal-close:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text);
  }

  /* === 토스트 알림 === */
  .toast {
    position: fixed;
    bottom: max(22px, env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(11,13,20,0.95);
    border: 1px solid var(--border-strong);
    border-radius: 11px;
    padding: 11px 18px;
    font-size: 13px; font-weight: 600;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 200;
    max-width: 90vw;
    backdrop-filter: blur(10px);
    box-shadow: 0 12px 36px rgba(0,0,0,0.4);
  }
  .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
  .toast.success { border-color: rgba(74,222,128,0.4); color: var(--green); }
  .toast.error { border-color: rgba(248,113,113,0.4); color: var(--red); }
  .toast.info { border-color: rgba(179,157,250,0.4); color: var(--accent); }

  .footer-note {
    text-align: center;
    color: var(--dim);
    font-size: 10.5px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    letter-spacing: 0.02em;
    line-height: 1.7;
  }
  .footer-status {
    margin-bottom: 6px;
  }
  .footer-links {
    margin-bottom: 4px;
  }
  .footer-links-legal {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(255,255,255,0.06);
  }
  .footer-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: 11.5px;
    font-weight: 500;
    padding: 2px 1px;
    border-bottom: 1px dashed transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
  }
  .footer-links a:hover {
    color: var(--accent);
    border-bottom-color: rgba(179,157,250,0.4);
  }
  .footer-copy {
    color: var(--dim);
    font-size: 10px;
    opacity: 0.7;
    letter-spacing: 0.05em;
  }
  .footer-note .dot {
    display: inline-block;
    width: 3px; height: 3px;
    background: var(--dim);
    border-radius: 50%;
    margin: 0 6px;
    vertical-align: middle;
    opacity: 0.6;
  }

  /* === TIER 1 신기능: 설정 섹션 그룹화 === */
  .settings-section {
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px dashed rgba(255,255,255,0.06);
  }
  .settings-section:last-of-type { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
  .settings-section-title {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 10px;
  }

  /* === TIER 1.1: 봇 속도 조절 === */
  .speed-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    min-width: 0;  /* 부모 폭 초과 방지 */
  }
  .speed-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    flex-shrink: 0;
  }
  .speed-buttons {
    display: flex;
    gap: 4px;
    flex: 1;
    justify-content: flex-end;
    min-width: 0;
    flex-wrap: wrap;  /* 모바일에서 부족하면 줄바꿈 */
  }
  .speed-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    min-width: 36px;
    flex: 0 0 auto;
  }
  .speed-btn:hover {
    color: var(--text);
    border-color: rgba(179,157,250,0.3);
  }
  .speed-btn.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #06070b;
    border-color: transparent;
    box-shadow: 0 2px 8px -2px rgba(179,157,250,0.4);
  }

  /* === TIER 1.2: 저장 슬롯 === */
  .save-slots {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .slot {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    transition: border-color 0.15s ease;
  }
  .slot:hover { border-color: rgba(179,157,250,0.18); }
  .slot[data-occupied="true"] { border-color: rgba(179,157,250,0.18); }
  .slot-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
    gap: 10px;
    min-width: 0;
  }
  .slot-name {
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
  }
  .slot-info {
    color: var(--dim);
    font-size: 11px;
    font-family: var(--font-mono);
    text-align: right;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
  }
  .slot-info b {
    color: var(--text);
    font-weight: 600;
    font-size: 11px;
  }
  .slot-actions {
    display: flex;
    gap: 5px;
  }
  .slot-btn {
    flex: 1;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 13px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
  }
  .slot-btn:hover:not(:disabled) {
    background: rgba(179,157,250,0.1);
    border-color: rgba(179,157,250,0.3);
    color: var(--text);
  }
  .slot-btn:active:not(:disabled) { transform: scale(0.96); }
  .slot-btn:disabled { opacity: 0.3; cursor: not-allowed; }
  .slot-btn.save:hover:not(:disabled) {
    border-color: var(--accent);
    background: rgba(179,157,250,0.15);
  }
  .slot-btn.delete:hover:not(:disabled) {
    border-color: rgba(248,113,113,0.4);
    background: rgba(248,113,113,0.1);
    color: var(--red);
  }

  /* === TIER 1.3: 위험 버튼 === */
  .reset-btn.danger {
    width: 100%;
    background: rgba(248,113,113,0.08);
    border: 1px solid rgba(248,113,113,0.3);
    color: #fca5a5;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
  }
  .reset-btn.danger:hover {
    background: rgba(248,113,113,0.15);
    border-color: var(--red);
    color: var(--red);
  }
  .reset-btn.danger:active { transform: scale(0.98); }

  /* === TIER 1.4: 슬리피지 곡선 차트 === */
  .slippage-chart {
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 10px 12px;
    margin: 10px 0;
  }
  .slippage-chart-title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 11px;
    color: var(--muted);
    font-weight: 600;
  }
  .slippage-chart-hint {
    color: var(--dim);
    font-size: 9.5px;
    font-weight: 400;
    line-height: 1.3;
    text-align: right;
  }
  .slippage-chart-canvas {
    width: 100%;
    height: 70px;
    position: relative;
  }
  .slippage-chart-canvas svg {
    width: 100%;
    height: 100%;
    display: block;
  }

  /* ========================================
   * TIER 2: 새 기능 스타일
   * ======================================== */

  /* === TIER 2.2: 전략 비교 === */
  .strategy-compare {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed rgba(255,255,255,0.06);
  }
  .sc-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
  }
  .sc-title {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .sc-hint { font-size: 10.5px; color: var(--dim); }
  .sc-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
    align-items: stretch;
    background: rgba(0,0,0,0.2);
    border-radius: 9px;
    padding: 10px;
    margin-bottom: 8px;
  }
  .sc-col {
    display: flex; flex-direction: column; gap: 3px;
    text-align: center; min-width: 0;
  }
  .sc-col-label { font-size: 11px; color: var(--muted); font-weight: 600; }
  .sc-col-value {
    font-family: var(--font-mono);
    font-size: 15px; font-weight: 700;
    letter-spacing: -0.01em;
  }
  .sc-col.hodl .sc-col-value { color: #c8cad1; }
  .sc-col.lp .sc-col-value { color: var(--accent); }
  .sc-col-sub { font-family: var(--font-mono); font-size: 10.5px; color: var(--dim); }
  .sc-divider { width: 1px; background: var(--border); margin: 4px 0; }
  .sc-breakdown {
    display: grid; gap: 4px;
    font-size: 11.5px;
    padding: 8px 10px;
    background: rgba(0,0,0,0.15);
    border-radius: 7px;
  }
  .sc-row { display: flex; justify-content: space-between; align-items: baseline; }
  .sc-row span { color: var(--muted); }
  .sc-row b { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 700; }
  .sc-row.sc-total {
    margin-top: 4px; padding-top: 6px;
    border-top: 1px dashed rgba(255,255,255,0.08);
    font-size: 12.5px;
  }
  .sc-row.sc-total span { color: var(--text); font-weight: 600; }
  .sc-pos { color: var(--green) !important; }
  .sc-neg { color: var(--red) !important; }

  /* === TIER 2.4: 거래 내역 === */
  .tx-log-card { padding: 0; overflow: hidden; }
  .tx-log-summary {
    list-style: none;
    cursor: pointer;
    padding: 12px 14px;
    display: flex; justify-content: space-between; align-items: center;
    user-select: none;
    transition: background-color 0.15s ease;
  }
  .tx-log-summary::-webkit-details-marker { display: none; }
  .tx-log-summary::before {
    content: "▸";
    color: var(--accent);
    font-size: 12px;
    margin-right: 8px;
    transition: transform 0.2s ease;
  }
  .tx-log-card[open] .tx-log-summary::before { transform: rotate(90deg); }
  .tx-log-summary:hover { background: rgba(179,157,250,0.04); }
  .tx-log-title { flex: 1; font-size: 13px; font-weight: 700; color: var(--text); }
  .tx-log-meta { color: var(--muted); font-size: 11.5px; font-family: var(--font-mono); }
  .tx-log-count-wrap b { color: var(--accent); font-weight: 700; }
  .tx-log-actions {
    display: flex; gap: 6px;
    padding: 10px 12px 8px;
    border-top: 1px solid var(--border);
  }
  .tx-log-btn {
    flex: 1;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 6px 10px;
    border-radius: 7px;
    font-size: 11.5px; font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
  }
  .tx-log-btn:hover {
    background: rgba(179,157,250,0.1);
    color: var(--text);
    border-color: rgba(179,157,250,0.3);
  }
  .tx-log-btn.danger:hover {
    background: rgba(248,113,113,0.1);
    color: var(--red);
    border-color: rgba(248,113,113,0.3);
  }
  .tx-log-list {
    max-height: 280px;
    overflow-y: auto;
    padding: 4px 0;
    border-top: 1px solid var(--border);
  }
  .tx-log-list::-webkit-scrollbar { width: 6px; }
  .tx-log-list::-webkit-scrollbar-thumb {
    background: rgba(179,157,250,0.2);
    border-radius: 3px;
  }
  .tx-item {
    display: grid;
    grid-template-columns: 60px 22px 1fr;
    gap: 8px;
    padding: 7px 14px;
    font-size: 11.5px;
    align-items: baseline;
    border-bottom: 1px solid rgba(255,255,255,0.03);
  }
  .tx-item:last-child { border-bottom: none; }
  .tx-item:hover { background: rgba(179,157,250,0.04); }
  .tx-time { color: var(--dim); font-family: var(--font-mono); font-size: 10.5px; }
  .tx-icon { font-size: 13px; text-align: center; }
  .tx-summary {
    color: #c8cad1;
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .tx-item.bot .tx-summary { color: var(--muted); }
  .tx-item.lp-add .tx-summary { color: var(--accent-2); }
  .tx-item.lp-remove .tx-summary { color: #fbbf24; }
  .tx-log-empty {
    padding: 24px 14px;
    text-align: center;
    color: var(--dim);
    font-size: 12px;
    border-top: 1px solid var(--border);
  }

  /* === TIER 2.1 / 2.5: 시나리오·커스텀풀 모달 공통 === */
  .modal-intro {
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.55;
    margin-bottom: 14px;
  }
  .scenario-list {
    display: flex; flex-direction: column; gap: 8px;
    margin-bottom: 12px;
  }
  /* === TIER 2.1: 활성 시나리오 배너 === */
  .active-scenario {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 13px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, rgba(179,157,250,0.12), rgba(94,234,212,0.06));
    border: 1px solid rgba(179,157,250,0.3);
    border-radius: 10px;
    animation: as-glow 2.5s ease-in-out infinite;
  }
  @keyframes as-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(179,157,250,0.15); }
    50% { box-shadow: 0 0 14px -2px rgba(179,157,250,0.4); }
  }
  .active-scenario .as-icon {
    font-size: 18px;
    flex-shrink: 0;
    line-height: 1;
  }
  .active-scenario .as-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
  }
  .active-scenario .as-label {
    color: var(--accent);
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }
  .active-scenario .as-name {
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .active-scenario .as-end-btn {
    background: rgba(248,113,113,0.1);
    border: 1px solid rgba(248,113,113,0.3);
    color: #fca5a5;
    font-size: 11.5px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 7px;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
    transition: all 0.15s ease;
  }
  .active-scenario .as-end-btn:hover {
    background: rgba(248,113,113,0.2);
    border-color: var(--red);
    color: var(--red);
  }
  .active-scenario .as-end-btn:active {
    transform: scale(0.96);
  }

  /* === 시나리오 모달 안의 종료 영역 === */
  .active-scenario-modal {
    background: rgba(179,157,250,0.06);
    border: 1px solid rgba(179,157,250,0.25);
    border-radius: 9px;
    padding: 10px 12px;
    margin-bottom: 12px;
  }
  .as-modal-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
  }
  .as-modal-label {
    color: var(--accent);
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .as-modal-name {
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
  }
  .as-modal-end {
    width: 100%;
    background: rgba(248,113,113,0.08);
    border: 1px solid rgba(248,113,113,0.25);
    color: #fca5a5;
    padding: 8px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
  }
  .as-modal-end:hover {
    background: rgba(248,113,113,0.15);
    color: var(--red);
    border-color: var(--red);
  }

  .scenario-item {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    color: var(--text);
    font-family: inherit;
    width: 100%;
  }
  .scenario-item:hover {
    background: rgba(179,157,250,0.06);
    border-color: rgba(179,157,250,0.3);
    transform: translateY(-1px);
  }
  .scenario-item:active { transform: translateY(0); }
  .sc-item-title {
    font-size: 13.5px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text);
  }
  .sc-item-desc {
    font-size: 11.5px;
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 6px;
  }
  .sc-item-objective {
    font-size: 11px;
    color: var(--accent-2);
    font-weight: 600;
  }
  .custom-form { margin-bottom: 14px; }
  .cp-section {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin: 14px 0 8px;
  }
  .cp-section:first-child { margin-top: 4px; }
  .cp-hint {
    font-size: 11.5px;
    color: var(--dim);
    margin: 6px 0 4px;
    text-align: right;
    font-family: var(--font-mono);
  }
  .cp-hint b { color: var(--accent-2); font-weight: 700; }

  /* === TIER 3.2: 백테스트 === */
  .bt-form { margin-bottom: 14px; }
  .bt-status {
    margin-top: 10px;
    font-size: 11.5px;
    color: var(--muted);
    text-align: center;
    min-height: 16px;
  }
  .bt-status.error { color: var(--red); }
  .bt-status.success { color: var(--green); }
  .bt-result-box {
    margin-top: 12px;
    padding: 14px;
    background: linear-gradient(135deg, rgba(94,234,212,0.06), rgba(179,157,250,0.04));
    border: 1px solid rgba(94,234,212,0.2);
    border-radius: 10px;
    font-size: 12.5px;
    line-height: 1.6;
  }
  .bt-result-box .bt-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
  }
  .bt-result-box .bt-row span { color: var(--muted); }
  .bt-result-box .bt-row b {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
  }
  .bt-result-box .bt-row.highlight {
    border-top: 1px dashed rgba(94,234,212,0.25);
    margin-top: 6px;
    padding-top: 8px;
    font-size: 13.5px;
  }
  .bt-result-box .bt-row.highlight b { color: var(--accent-2); }

  /* ========================================
   * TIER 4: 가벼운 개선
   * ======================================== */

  /* === TIER 4.1: 성취 시스템 === */
  .icon-btn-trophy { position: relative; }
  .ach-badge {
    position: absolute;
    top: -3px; right: -3px;
    background: var(--accent);
    color: #06070b;
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 800;
    min-width: 14px;
    height: 14px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    box-shadow: 0 0 0 1.5px var(--bg);
    line-height: 1;
  }

  .ach-progress-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 8px 12px;
    background: rgba(179,157,250,0.06);
    border: 1px solid rgba(179,157,250,0.18);
    border-radius: 9px;
    margin-bottom: 12px;
    font-size: 12.5px;
    color: var(--muted);
  }
  .ach-progress-num { font-family: var(--font-mono); }
  .ach-progress-num b { color: var(--accent); font-weight: 700; }

  .achievements-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 50vh;
    overflow-y: auto;
    margin-bottom: 12px;
    padding-right: 4px;
  }
  .achievements-list::-webkit-scrollbar { width: 6px; }
  .achievements-list::-webkit-scrollbar-thumb {
    background: rgba(179,157,250,0.2);
    border-radius: 3px;
  }
  .ach-item {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    background: rgba(0,0,0,0.18);
    border: 1px solid var(--border);
    border-radius: 9px;
    transition: all 0.15s ease;
  }
  .ach-item.unlocked {
    background: rgba(179,157,250,0.06);
    border-color: rgba(179,157,250,0.25);
  }
  .ach-item.locked { opacity: 0.45; filter: grayscale(0.8); }
  .ach-item-icon {
    font-size: 22px;
    text-align: center;
    line-height: 1;
  }
  .ach-item-body { min-width: 0; }
  .ach-item-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
  }
  .ach-item-desc {
    font-size: 11.5px;
    color: var(--muted);
    line-height: 1.4;
    margin-top: 2px;
  }
  .ach-item-date {
    font-size: 10px;
    color: var(--dim);
    font-family: var(--font-mono);
    text-align: right;
    flex-shrink: 0;
  }
  .ach-item.unlocked .ach-item-date { color: var(--accent); }

  /* 성취 잠금해제 토스트 */
  .ach-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-30px);
    background: linear-gradient(135deg, rgba(11,13,20,0.95), rgba(20,24,38,0.95));
    border: 1px solid rgba(179,157,250,0.4);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    gap: 12px;
    align-items: center;
    z-index: 200;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    max-width: 90%;
    backdrop-filter: blur(16px);
    box-shadow: 0 12px 40px -10px rgba(179,157,250,0.4);
  }
  .ach-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  .ach-toast-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
  }
  .ach-toast-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
  .ach-toast-label {
    color: var(--accent);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }
  .ach-toast-title {
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
  }
  .ach-toast-desc {
    color: var(--muted);
    font-size: 11.5px;
  }

  /* === TIER 4.3: 툴팁 === */
  .tip {
    cursor: help;
    position: relative;
    border-bottom: 1px dotted rgba(179,157,250,0.3);
  }
  .tip i {
    color: var(--accent);
    font-style: normal;
    font-size: 9.5px;
    margin-left: 2px;
    opacity: 0.7;
  }
  .tip:hover i { opacity: 1; }
  .tip::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20,24,38,0.97);
    border: 1px solid rgba(179,157,250,0.3);
    color: var(--text);
    padding: 8px 11px;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.5;
    width: max-content;
    max-width: 240px;
    white-space: normal;
    text-align: left;
    font-weight: 400;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 50;
    box-shadow: 0 6px 20px -4px rgba(0,0,0,0.5);
    backdrop-filter: blur(12px);
  }
  .tip:hover::after, .tip:focus::after, .tip:active::after { opacity: 1; }

  /* === TIER 4.4: 라이트 모드 (전면 개선) === */
  body[data-theme="light"] {
    --bg: #f5f6fa;
    --bg-2: #ffffff;
    --card: rgba(255,255,255,0.7);
    --card-hover: rgba(255,255,255,0.95);
    --border: rgba(15,17,21,0.08);
    --border-strong: rgba(15,17,21,0.14);
    --text: #1a1d24;
    --muted: #5b6068;
    --dim: #8a8f97;
    --accent: #6d4be8;
    --accent-2: #5b3ed1;
    --accent-glow: rgba(109,75,232,0.18);
    --green: #059669;
    --orange: #d97706;
    --red: #dc2626;
    --blue: #2563eb;
    --teal: #0d9488;
    --warn: #d97706;
    background:
      radial-gradient(1200px 600px at 50% -100px, rgba(109,75,232,0.08) 0%, transparent 60%),
      radial-gradient(800px 500px at 100% 30%, rgba(13,148,136,0.04) 0%, transparent 60%),
      radial-gradient(900px 600px at 0% 80%, rgba(37,99,235,0.04) 0%, transparent 60%),
      var(--bg);
  }

  /* === 카드 / 컨테이너 === */
  body[data-theme="light"] .card {
    background: #ffffff;
    border-color: rgba(15,17,21,0.08);
    box-shadow: 0 1px 3px rgba(15,17,21,0.04), 0 1px 2px rgba(15,17,21,0.02);
  }
  body[data-theme="light"] .card:hover {
    border-color: rgba(109,75,232,0.18);
    box-shadow: 0 4px 12px rgba(15,17,21,0.06);
  }

  /* === 토픽바 === */
  body[data-theme="light"] .topbar {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-color: rgba(15,17,21,0.08);
  }
  body[data-theme="light"] .topbar-title {
    color: var(--text);
  }
  body[data-theme="light"] .topbar-title .sub {
    color: var(--muted);
  }
  body[data-theme="light"] .icon-btn {
    background: rgba(109,75,232,0.06);
    border-color: rgba(109,75,232,0.18);
  }
  body[data-theme="light"] .icon-btn:hover {
    background: rgba(109,75,232,0.12);
    border-color: rgba(109,75,232,0.3);
  }

  /* === 힌트 패널 === */
  body[data-theme="light"] .hint-panel {
    background: linear-gradient(135deg, rgba(109,75,232,0.05), rgba(13,148,136,0.03));
    border-color: rgba(109,75,232,0.18);
    color: #2a2d34;
  }
  body[data-theme="light"] .hint-panel b {
    color: var(--accent);
  }

  /* === 코드·인라인 코드 === */
  body[data-theme="light"] pre,
  body[data-theme="light"] code {
    background: rgba(109,75,232,0.07);
    color: #4f33b5;
  }

  /* === 입력 필드 === */
  body[data-theme="light"] input[type="number"],
  body[data-theme="light"] input[type="text"],
  body[data-theme="light"] .input-row input {
    background: #ffffff;
    border: 1px solid rgba(15,17,21,0.12);
    color: var(--text);
  }
  body[data-theme="light"] input[type="number"]:focus,
  body[data-theme="light"] input[type="text"]:focus,
  body[data-theme="light"] .input-row input:focus {
    border-color: var(--accent);
    background: #fbfaff;
  }
  body[data-theme="light"] .input-row .input-wrap {
    background: #ffffff;
    border-color: rgba(15,17,21,0.12);
  }
  body[data-theme="light"] .input-row .input-wrap:focus-within {
    border-color: var(--accent);
  }

  /* === 미리보기 박스 / 풀 통계 (라이트 모드) === */
  body[data-theme="light"] .pool-stats,
  body[data-theme="light"] .pool-bars {
    background: transparent;
    border-color: transparent;
  }
  body[data-theme="light"] .preview-box {
    background: #fafbfd;
    border: 1px solid rgba(15,17,21,0.08);
  }
  /* 풀 시각화 카드 안 박스들 — 다크 그라데이션 무력화 */
  body[data-theme="light"] .bar-group {
    background: #fafbfd;
    border: 1px solid rgba(15,17,21,0.08);
  }
  body[data-theme="light"] .bar-group::before {
    background: radial-gradient(circle at 100% 0%, rgba(109,75,232,0.05), transparent 50%);
  }
  body[data-theme="light"] .bar-group.usdt::before {
    background: radial-gradient(circle at 100% 0%, rgba(13,148,136,0.05), transparent 50%);
  }
  body[data-theme="light"] .bar-bg {
    background: rgba(15,17,21,0.06);
  }
  /* pool-stats 안 각 통계 박스 */
  body[data-theme="light"] .pool-stats > div {
    background: #fafbfd;
    border: 1px solid rgba(15,17,21,0.06);
  }
  /* 가격 기록 차트 영역 — 다크 그라데이션 → 흰 배경 + 노란 보더 */
  body[data-theme="light"] .price-chart {
    background: #ffffff;
    border: 1px solid rgba(251,191,36,0.35);
  }
  body[data-theme="light"] .price-chart .empty-msg {
    color: var(--muted);
  }

  /* === 액션 버튼 (스왑 / LP) === */
  body[data-theme="light"] .action-btn {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(109,75,232,0.25);
  }
  body[data-theme="light"] .action-btn:hover {
    box-shadow: 0 6px 16px rgba(109,75,232,0.35);
  }
  body[data-theme="light"] .action-btn:disabled {
    background: rgba(15,17,21,0.08);
    color: var(--dim);
    box-shadow: none;
  }

  /* === 탭 / 토글 / 방향 === */
  body[data-theme="light"] .tab,
  body[data-theme="light"] .dir-btn {
    color: var(--muted);
  }
  body[data-theme="light"] .tab.active,
  body[data-theme="light"] .dir-btn.active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
  }
  body[data-theme="light"] .tabs {
    background: rgba(15,17,21,0.04);
  }

  /* === 시장 가격 박스 === */
  body[data-theme="light"] .market-price {
    background: linear-gradient(135deg, rgba(37,99,235,0.04), rgba(109,75,232,0.04));
    border-color: rgba(37,99,235,0.18);
  }
  body[data-theme="light"] #market-price-val {
    color: var(--blue);
  }

  /* === 자산 카드 === */
  /* === 자산 카드 (라이트 모드) === */
  body[data-theme="light"] .asset-disclaimer {
    background: rgba(217,119,6,0.06);
    border-color: rgba(217,119,6,0.25);
    color: #92560a;
  }
  body[data-theme="light"] .asset-row {
    border-bottom-color: rgba(15,17,21,0.06);
  }
  body[data-theme="light"] .asset-row .asset-name {
    color: var(--text);
  }
  body[data-theme="light"] .asset-row .asset-meta {
    color: var(--muted);
  }
  body[data-theme="light"] .total-asset {
    color: var(--accent);
  }

  /* === 거래 내역 === */
  body[data-theme="light"] .tx-log-card {
    background: #ffffff;
  }
  body[data-theme="light"] .tx-item {
    background: #fafbfd;
    border-color: rgba(15,17,21,0.04);
  }
  body[data-theme="light"] .tx-item.swap { border-left-color: var(--accent); }
  body[data-theme="light"] .tx-item.lp-add { border-left-color: var(--green); }
  body[data-theme="light"] .tx-item.lp-remove { border-left-color: var(--orange); }
  body[data-theme="light"] .tx-item.bot { border-left-color: var(--blue); }

  /* === 모달 === */
  body[data-theme="light"] .modal {
    background: rgba(15,17,21,0.4);
    backdrop-filter: blur(8px);
  }
  body[data-theme="light"] .modal-content {
    background: #ffffff;
    border-color: rgba(15,17,21,0.1);
    box-shadow: 0 25px 70px rgba(15,17,21,0.18);
  }
  body[data-theme="light"] .modal-content h2 {
    color: var(--accent);
  }
  body[data-theme="light"] .modal-content h3 {
    color: var(--text);
  }
  body[data-theme="light"] .modal-close {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #ffffff;
  }

  /* === 슬롯 / 시나리오 / 옵션 === */
  body[data-theme="light"] .speed-control,
  body[data-theme="light"] .save-slots .slot,
  body[data-theme="light"] .scenario-item,
  body[data-theme="light"] .option {
    background: #fafbfd;
    border-color: rgba(15,17,21,0.08);
  }
  body[data-theme="light"] .save-slots .slot:hover,
  body[data-theme="light"] .scenario-item:hover {
    background: #f0eeff;
    border-color: rgba(109,75,232,0.25);
  }
  body[data-theme="light"] .speed-btn {
    color: var(--muted);
    border-color: rgba(15,17,21,0.12);
  }
  body[data-theme="light"] .speed-btn.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #ffffff;
  }

  /* === 토글 스위치 === */
  body[data-theme="light"] .toggle-row {
    background: #fafbfd;
    border-color: rgba(15,17,21,0.06);
  }
  body[data-theme="light"] .switch {
    background: rgba(15,17,21,0.18);
  }
  body[data-theme="light"] input:checked + .switch {
    background: var(--accent);
  }

  /* === 토스트 === */
  body[data-theme="light"] .toast,
  body[data-theme="light"] .ach-toast {
    background: rgba(255,255,255,0.97);
    color: var(--text);
    border-color: rgba(15,17,21,0.12);
    box-shadow: 0 12px 36px rgba(15,17,21,0.12);
  }
  body[data-theme="light"] .toast.success { border-color: rgba(5,150,105,0.4); color: var(--green); }
  body[data-theme="light"] .toast.error { border-color: rgba(220,38,38,0.4); color: var(--red); }
  body[data-theme="light"] .toast.info { border-color: rgba(109,75,232,0.4); color: var(--accent); }

  /* === 툴팁 === */
  body[data-theme="light"] .tip::after {
    background: #1a1d24;
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(15,17,21,0.2);
  }
  body[data-theme="light"] .tip i {
    color: var(--muted);
  }

  /* === 활성 시나리오 배너 === */
  body[data-theme="light"] .active-scenario {
    background: linear-gradient(135deg, rgba(109,75,232,0.08), rgba(13,148,136,0.04));
    border-color: rgba(109,75,232,0.25);
  }
  body[data-theme="light"] .active-scenario .as-name {
    color: var(--text);
  }
  body[data-theme="light"] .active-scenario .as-end-btn {
    background: rgba(220,38,38,0.06);
    border-color: rgba(220,38,38,0.25);
    color: #b91c1c;
  }
  body[data-theme="light"] .active-scenario .as-end-btn:hover {
    background: rgba(220,38,38,0.12);
    color: var(--red);
  }

  /* === 차트 / 그래프 영역 === */
  body[data-theme="light"] .chart-svg {
    background: #fafbfd;
    border-radius: 8px;
  }
  body[data-theme="light"] .chart-svg .grid line {
    stroke: rgba(15,17,21,0.06);
  }
  body[data-theme="light"] .chart-svg text {
    fill: var(--muted);
  }

  /* === 푸터 === */
  body[data-theme="light"] .footer-status,
  body[data-theme="light"] .footer-links a {
    color: var(--muted);
  }
  body[data-theme="light"] .footer-links a:hover {
    color: var(--accent);
    border-bottom-color: rgba(109,75,232,0.4);
  }
  body[data-theme="light"] .footer-copy {
    color: var(--dim);
  }

  /* === 성취 모달 === */
  body[data-theme="light"] .ach-progress-row {
    background: #f0eeff;
    border-color: rgba(109,75,232,0.18);
  }
  body[data-theme="light"] .ach-progress-num b {
    color: var(--accent);
  }
  body[data-theme="light"] .ach-item {
    background: #fafbfd;
    border-color: rgba(15,17,21,0.06);
  }
  body[data-theme="light"] .ach-item.unlocked {
    background: linear-gradient(135deg, rgba(109,75,232,0.06), rgba(13,148,136,0.03));
    border-color: rgba(109,75,232,0.25);
  }
  body[data-theme="light"] .ach-item.locked {
    opacity: 0.55;
  }
  body[data-theme="light"] .ach-item .ach-name {
    color: var(--text);
  }
  body[data-theme="light"] .ach-item .ach-desc {
    color: var(--muted);
  }
  body[data-theme="light"] .reset-btn,
  body[data-theme="light"] .reset-btn.danger {
    background: #ffffff;
    border-color: rgba(220,38,38,0.3);
    color: var(--red);
  }
  body[data-theme="light"] .reset-btn:hover {
    background: rgba(220,38,38,0.06);
  }

  /* === 슬리피지 곡선 / 차트 영역 === */
  body[data-theme="light"] .slippage-chart {
    background: #fafbfd;
  }

  /* === 전략 비교 (HODL vs LP) === */
  body[data-theme="light"] .strategy-compare {
    background: linear-gradient(135deg, rgba(13,148,136,0.04), rgba(109,75,232,0.04));
    border-color: rgba(13,148,136,0.2);
  }
  body[data-theme="light"] .strategy-row .strategy-label {
    color: var(--muted);
  }
  body[data-theme="light"] .strategy-row b {
    color: var(--text);
  }

  /* === 매뉴얼 / 약관 / 개인정보 (텍스트 페이지) === */
  body[data-theme="light"] .toc {
    background: #fafbfd;
    border-color: rgba(15,17,21,0.08);
  }
  body[data-theme="light"] .toc a {
    color: var(--text);
  }
  body[data-theme="light"] .toc a:hover {
    color: var(--accent);
    background: rgba(109,75,232,0.06);
  }
  body[data-theme="light"] .meta-line {
    color: var(--muted);
    border-color: rgba(15,17,21,0.08);
  }
  body[data-theme="light"] section h2 {
    color: var(--text);
  }
  body[data-theme="light"] section h3 {
    color: var(--accent);
  }
  body[data-theme="light"] .tip,
  body[data-theme="light"] .key-box {
    background: linear-gradient(135deg, rgba(13,148,136,0.05), rgba(109,75,232,0.03));
    border-left-color: var(--teal);
    color: #2a2d34;
  }
  body[data-theme="light"] .tip b,
  body[data-theme="light"] .key-box b {
    color: var(--teal);
  }
  body[data-theme="light"] table {
    background: #ffffff;
  }
  body[data-theme="light"] table th {
    background: #f0eeff;
    color: var(--text);
    border-color: rgba(15,17,21,0.08);
  }
  body[data-theme="light"] table td {
    border-color: rgba(15,17,21,0.06);
  }
  body[data-theme="light"] table tr:nth-child(even) td {
    background: #fafbfd;
  }

  /* === 약관 정의 목록 === */
  body[data-theme="light"] .def-list dt {
    color: var(--accent);
  }
  body[data-theme="light"] .def-list dd {
    color: #2a2d34;
  }

  /* === 강의 페이지 === */
  body[data-theme="light"] .progress-dot {
    background: #ffffff;
    border-color: rgba(15,17,21,0.15);
    color: var(--muted);
  }
  body[data-theme="light"] .progress-dot.complete {
    background: var(--green);
    color: #ffffff;
  }
  body[data-theme="light"] .progress-dot.current {
    color: #ffffff;
  }
  body[data-theme="light"] .chapter-card {
    background: #ffffff;
    border-color: rgba(15,17,21,0.08);
    color: var(--text);
    box-shadow: 0 1px 3px rgba(15,17,21,0.04);
  }
  body[data-theme="light"] .chapter-card:hover {
    background: #fafaff;
    border-color: rgba(109,75,232,0.25);
  }

  /* === 퀴즈 페이지 === */
  body[data-theme="light"] .option {
    background: #ffffff;
    color: var(--text);
  }
  body[data-theme="light"] .option:hover:not(:disabled) {
    background: #fafaff;
    border-color: rgba(109,75,232,0.3);
  }
  body[data-theme="light"] .option.correct {
    background: rgba(5,150,105,0.08);
    border-color: var(--green);
    color: var(--green);
  }
  body[data-theme="light"] .option.wrong {
    background: rgba(220,38,38,0.08);
    border-color: var(--red);
    color: var(--red);
  }

  /* === 비교기 / APY 결과 박스 === */
  body[data-theme="light"] .result-box {
    background: #fafbfd;
  }
  body[data-theme="light"] .result-box.highlight {
    background: linear-gradient(135deg, rgba(109,75,232,0.06), rgba(13,148,136,0.04));
    border-color: rgba(109,75,232,0.3);
  }
  body[data-theme="light"] .pool-card {
    background: #fafbfd;
  }
  body[data-theme="light"] .pool-card.best {
    border-color: rgba(5,150,105,0.4);
  }
  body[data-theme="light"] .pool-card.worst {
    border-color: rgba(220,38,38,0.4);
  }

  /* === 섹션 구분선 === */
  body[data-theme="light"] hr {
    border-color: rgba(15,17,21,0.08);
  }

  /* === 셀렉션 색상 === */
  body[data-theme="light"] ::selection {
    background: rgba(109,75,232,0.2);
    color: var(--text);
  }

  /* === 스크롤바 (Webkit) === */
  body[data-theme="light"] ::-webkit-scrollbar { width: 10px; height: 10px; }
  body[data-theme="light"] ::-webkit-scrollbar-track { background: #f0f1f5; }
  body[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(15,17,21,0.18);
    border-radius: 5px;
  }
  body[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(15,17,21,0.28);
  }

  @keyframes flash {
    0% { background-color: rgba(179,157,250,0.18); }
    100% { background-color: transparent; }
  }
  .flash { animation: flash 0.6s ease-out; }

  /* ============================================
   * 반응형 — 태블릿 / 데스크톱 대응
   * ============================================ */

  /* 태블릿 (640px ~) — 컨테이너 약간 넓게 + 패딩 증가 */
  @media (min-width: 640px) {
    .container { max-width: 600px; padding: 14px 16px 60px; }
    html, body { font-size: 15px; }
    .topbar { padding: 11px 14px; }
    .card { padding: 14px 16px; }
  }

  /* 작은 데스크톱 (900px ~) — 컨테이너만 넓히고 그리드는 사용 안 함 (모바일 레이아웃 유지가 안전) */
  @media (min-width: 900px) {
    .container {
      max-width: 640px;
      padding: 20px 20px 60px;
    }
  }

  /* 큰 데스크톱 (1280px ~) — 살짝 더 넓게 + 약간 큰 폰트 */
  @media (min-width: 1280px) {
    .container {
      max-width: 680px;
      padding: 24px 24px 80px;
    }
    html, body { font-size: 15px; }
  }

  /* 매우 작은 모바일 (~360px) — 패딩 더 좁게 */
  @media (max-width: 360px) {
    .container { padding: 8px 10px 40px; }
    .card { padding: 11px 12px; }
    .topbar-title .sub { display: none; }
    .speed-buttons { gap: 3px; }
    .speed-btn { padding: 4px 6px; min-width: 30px; font-size: 10.5px; }
  }

  /* 가로 모드 모바일 — 헤더 컴팩트 */
  @media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
    .topbar { padding: 6px 10px; margin-bottom: 6px; }
    .hint-panel { padding: 8px 10px; font-size: 11.5px; }
    .market-price { padding: 6px 10px; }
  }

  /* 호버 가능한 기기 — 카드 hover 강조 */
  @media (hover: hover) and (pointer: fine) {
    .card { transition: border-color 0.2s ease; }
    .card:hover { border-color: rgba(179,157,250,0.18); }
    .scenario-item:hover, .save-slots .slot:hover {
      transform: translateY(-2px);
    }
  }

  /* 터치 기기 — 버튼 최소 크기 보장 (Apple HIG: 44pt, Google: 48dp) */
  @media (hover: none) and (pointer: coarse) {
    .action-btn, .modal-close, .reset-btn {
      min-height: 44px;
    }
    .icon-btn {
      min-width: 38px;
      min-height: 38px;
    }
  }

  /* 다크/라이트 시스템 선호도 자동 감지 (저장된 명시적 선택 없을 때) */
  @media (prefers-color-scheme: light) {
    body:not([data-theme]) {
      /* 사용자가 명시적으로 선택 안 했고 시스템이 라이트면 라이트로 자동 전환 */
      /* 단, JS 의 명시적 선택이 있으면 data-theme 속성이 우선 */
    }
  }

  /* 인쇄 — 색상 제거, 콘텐츠 우선 */
  @media print {
    body {
      background: white !important;
      color: black !important;
    }
    .topbar, .modal, .toast, .ach-toast,
    .hint-panel, .footer-note,
    .icon-btn, .action-btn, .reset-btn,
    .tx-log-actions, .save-slots {
      display: none !important;
    }
    .card { border: 1px solid #ccc; box-shadow: none; }
  }

  /* 접근성: 모션 줄이기 선호 */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.001ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.001ms !important;
    }
  }
