/* ===== 1. CSS Variables ===== */
:root {
  /* Light theme (ページ全体) */
  --bg-page: #f5f6f8;
  --bg-white: #ffffff;
  --text-primary: #1a202c;
  --text-secondary: #4a5568;
  --text-muted: #a0aec0;
  --border: #e2e8f0;
  --accent-blue: #2563eb;

  /* 売買色 */
  --color-buy: #16a34a;
  --color-buy-hover: #15803d;
  --color-buy-bg: #dcfce7;
  --color-sell: #dc2626;
  --color-sell-hover: #b91c1c;
  --color-sell-bg: #fef2f2;
  --color-win: #16a34a;
  --color-lose: #dc2626;

  /* Dark theme (チャートエリアのみ) */
  --chart-bg: #131722;
  --chart-text: #d1d4dc;
  --chart-grid: #1e222d;
  --chart-border: #2a2e39;

  /* Spacing & Shape */
  --gutter: 16px;
  --max-width: 960px;
  --radius: 8px;
  --radius-lg: 12px;

  /* Header */
  --header-bg: #1e293b;
  --header-text: #f1f5f9;
}

/* ===== 2. Reset & Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Hiragino Sans", "Noto Sans JP", sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== 3. Header ===== */
.Header {
  background: var(--header-bg);
  color: var(--header-text);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.Header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.Header__logo {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  margin: 0;
}

.Header__logo span {
  color: #60a5fa;
  font-weight: 400;
  font-size: 0.75rem;
  margin-left: 6px;
}

.Header__right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.Header__balance {
  font-size: 0.82rem;
  font-weight: 600;
  color: #94a3b8;
}

.Header__balance span {
  color: #f1f5f9;
  font-variant-numeric: tabular-nums;
}

.Header__reset {
  background: transparent;
  border: 1px solid #475569;
  color: #94a3b8;
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.Header__reset:hover {
  background: #334155;
  color: #e2e8f0;
}

/* ===== 4. Disclaimer ===== */
.Disclaimer {
  background: #fef9c3;
  color: #854d0e;
  text-align: center;
  font-size: 0.72rem;
  padding: 5px var(--gutter);
  line-height: 1.5;
}

/* ===== 5. Main Content ===== */
.Main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--gutter);
  width: 100%;
}

/* ===== 6. Scenario Selector ===== */
.ScenarioSelector {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.ScenarioSelector::-webkit-scrollbar {
  display: none;
}

.ScenarioSelector__pill {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-white);
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.ScenarioSelector__pill:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.ScenarioSelector__pill--active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #fff;
}

.ScenarioSelector__pill--active:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

.ScenarioSelector__icon {
  font-size: 1rem;
}

.ScenarioSelector__difficulty {
  font-size: 0.65rem;
  opacity: 0.7;
}

/* ===== 7. Chart Area (Dark) ===== */
.ChartArea {
  background: var(--chart-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 12px;
}

.ChartArea__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 6px;
  flex-wrap: wrap;
  gap: 8px;
}

.ChartArea__pair {
  color: var(--chart-text);
  font-size: 0.78rem;
  font-weight: 600;
}

.ChartArea__price {
  color: var(--chart-text);
  font-size: 1.4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: color 0.2s;
}

.ChartArea__price--up {
  color: #26a69a;
}

.ChartArea__price--down {
  color: #ef5350;
}

.ChartArea__spread {
  color: #6b7280;
  font-size: 0.7rem;
}

.ChartArea__speed {
  display: flex;
  gap: 4px;
}

.SpeedBtn {
  background: var(--chart-border);
  border: none;
  color: var(--chart-text);
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}

.SpeedBtn:hover {
  background: #363a45;
}

.SpeedBtn--active {
  background: var(--accent-blue);
  color: #fff;
}

.ChartArea__canvas {
  width: 100%;
  height: 350px;
}

.ChartArea__status {
  text-align: center;
  padding: 4px;
  font-size: 0.7rem;
}

.ChartArea__status--complete {
  color: #fbbf24;
}

.ChartArea__status--playing {
  color: #34d399;
}

.ChartArea__status--paused {
  color: #fbbf24;
}

.ChartArea__hint {
  text-align: center;
  padding: 2px 8px 6px;
  font-size: 0.62rem;
  color: #6b7280;
  letter-spacing: 0.02em;
}

.ChartArea__toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ChartArea__zoom {
  display: flex;
  gap: 2px;
}

.ToolbarBtn {
  background: var(--chart-border);
  border: none;
  color: var(--chart-text);
  font-size: 0.82rem;
  width: 30px;
  height: 26px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.ToolbarBtn:hover {
  background: #363a45;
}

/* ===== 7b. Scenario Description ===== */
.ScenarioDesc {
  margin-bottom: 8px;
}

.ScenarioDesc__inner {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.ScenarioDesc__point {
  color: var(--accent-blue);
  font-size: 0.72rem;
}

/* ===== 7c. Trade Info Grid ===== */
.TradeInfo {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
  text-align: center;
}

.TradeInfo__card {
  background: var(--bg-page);
  border-radius: var(--radius);
  padding: 6px 8px;
  font-size: 0.7rem;
}

.TradeInfo__label {
  color: var(--text-muted);
  margin-bottom: 2px;
  font-size: 0.65rem;
}

.TradeInfo__value {
  display: flex;
  gap: 3px;
  justify-content: center;
  align-items: center;
}

/* ===== 7d. Leverage Buttons ===== */
.LevBtn {
  background: var(--bg-page);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.LevBtn:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.LevBtn--active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #fff;
}

/* ===== 7e. Scenario Completion CTA ===== */
.ScenarioCta {
  background: linear-gradient(135deg, #eff6ff, #f0fdf4);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 12px;
  text-align: center;
  animation: guideIn 0.3s ease;
}

.ScenarioCta__text {
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.7;
  margin-bottom: 12px;
}

.ScenarioCta__link {
  display: inline-block;
  padding: 12px 28px;
  background: var(--accent-blue);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 700;
  transition: background 0.15s, transform 0.1s;
}

.ScenarioCta__link:hover {
  background: #1d4ed8;
}

.ScenarioCta__link:active {
  transform: scale(0.97);
}

.ScenarioCta__note {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 10px;
  line-height: 1.5;
}

/* ===== 8. Trade Panel ===== */
.TradePanel {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  margin-bottom: 8px;
}

.TradePanel__buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.TradeBtn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.TradeBtn:active {
  transform: scale(0.97);
}

.TradeBtn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.TradeBtn--buy {
  background: var(--color-buy);
}

.TradeBtn--buy:hover:not(:disabled) {
  background: var(--color-buy-hover);
}

.TradeBtn--sell {
  background: var(--color-sell);
}

.TradeBtn--sell:hover:not(:disabled) {
  background: var(--color-sell-hover);
}

.TradeBtn__label {
  font-size: 0.65rem;
  font-weight: 400;
  opacity: 0.8;
}

.TradePanel__shortcuts {
  text-align: center;
  font-size: 0.62rem;
  color: var(--text-muted);
  padding: 0 0 6px;
}

.TradePanel__shortcuts kbd {
  display: inline-block;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 0.62rem;
  font-family: inherit;
  font-weight: 600;
  margin: 0 1px;
}

/* ===== 9. Position Panel ===== */
#positionPanel {
  min-height: 80px;
}

.PositionPanel {
  background: var(--bg-page);
  border-radius: var(--radius);
  padding: 8px 12px;
}

.PositionPanel--empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
}

.PositionPanel__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  margin-bottom: 2px;
}

.PositionPanel__label {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.PositionPanel__value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.PositionPanel__value--buy {
  color: var(--color-buy);
}

.PositionPanel__value--sell {
  color: var(--color-sell);
}

.PositionPanel__pnl {
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  padding: 4px 0;
  font-variant-numeric: tabular-nums;
}

.PositionPanel__pnl--positive {
  color: var(--color-win);
}

.PositionPanel__pnl--negative {
  color: var(--color-lose);
}

.PositionPanel__close {
  display: block;
  width: 100%;
  padding: 8px;
  margin-top: 4px;
  background: #475569;
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.PositionPanel__close:hover {
  background: #334155;
}

/* ===== 10. Trade Result Toast ===== */
.TradeToast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  z-index: 200;
  animation: toastIn 0.3s ease, toastOut 0.4s ease 3.4s forwards;
  pointer-events: none;
  min-width: 200px;
  max-width: 340px;
  text-align: center;
}

.TradeToast--win {
  background: var(--color-buy);
}

.TradeToast--lose {
  background: var(--color-sell);
}

.TradeToast--info {
  background: #475569;
}

.TradeToast__main {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.TradeToast__detail {
  font-size: 0.7rem;
  font-weight: 400;
  opacity: 0.85;
}

.TradeToast__tip {
  font-size: 0.72rem;
  font-weight: 400;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  line-height: 1.5;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* ===== 10b. Behavior Hint ===== */
.BehaviorHint {
  background: #fefce8;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 12px 40px 12px 14px;
  margin-bottom: 12px;
  position: relative;
  animation: hintSlideIn 0.3s ease;
}

.BehaviorHint__text {
  font-size: 0.78rem;
  color: #92400e;
  line-height: 1.7;
}

.BehaviorHint__close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  font-size: 1rem;
  color: #92400e;
  cursor: pointer;
  line-height: 1;
  opacity: 0.6;
}

.BehaviorHint__close:hover {
  opacity: 1;
}

@keyframes hintSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== 10c. Floating Balance ===== */
.FloatingBalance {
  background: var(--header-bg);
  color: var(--header-text);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.FloatingBalance__label {
  color: #94a3b8;
}

.FloatingBalance__value {
  color: #f1f5f9;
  font-variant-numeric: tabular-nums;
}

.FloatingBalance__reset {
  margin-left: 8px;
  background: transparent;
  border: 1px solid #475569;
  color: #94a3b8;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.65rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.FloatingBalance__reset:hover {
  background: #334155;
  color: #e2e8f0;
}

/* ===== 10d. Risk Meter ===== */
.RiskMeter {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-top: 8px;
}

.RiskMeter__label {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.RiskMeter__bars {
  display: flex;
  gap: 3px;
  margin-bottom: 4px;
}

.RiskMeter__seg {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  transition: background 0.2s;
}

.RiskMeter__seg--on {
  background: var(--risk-color, var(--color-lose));
}

.RiskMeter__level {
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.RiskMeter__hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===== 11. History Section ===== */
.History {
  margin-top: 16px;
}

.History__details {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.History__summary {
  padding: 14px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.History__summary::after {
  content: "\25BC";
  font-size: 0.6rem;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.History__details[open] > .History__summary::after {
  transform: rotate(180deg);
}

.History__empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 32px 16px;
}

/* Stats Cards */
.StatsGrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 0 16px 12px;
}

.StatCard {
  background: var(--bg-page);
  border-radius: var(--radius);
  padding: 10px 12px;
  text-align: center;
}

.StatCard__value {
  font-size: 1.2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.StatCard__label {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Insights */
.Insights {
  padding: 0 16px 12px;
}

.Insight {
  font-size: 0.78rem;
  color: var(--text-secondary);
  padding: 6px 10px;
  background: #f0fdf4;
  border-radius: 6px;
  margin-bottom: 6px;
  line-height: 1.6;
}

.Insight--warn {
  background: #fef9c3;
}

/* Trade List */
.TradeList {
  border-top: 1px solid var(--border);
}

.TradeItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  font-size: 0.78rem;
  border-bottom: 1px solid var(--border);
}

.TradeItem:last-child {
  border-bottom: none;
}

.TradeItem__side {
  font-weight: 700;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 4px;
  color: #fff;
}

.TradeItem__side--buy {
  background: var(--color-buy);
}

.TradeItem__side--sell {
  background: var(--color-sell);
}

.TradeItem__prices {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.TradeItem__pnl {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ===== 12. Broker Compare ===== */
.BrokerCompare {
  margin-top: 16px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  scroll-margin-top: 72px;
}

.BrokerCompare__title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.BrokerCompare__note {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.BrokerCompare__wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.BrokerCompare__table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.BrokerCompare__table th {
  background: var(--bg-page);
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
  border-bottom: 2px solid var(--border);
}

.BrokerCompare__table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.BrokerCompare__link {
  display: inline-block;
  padding: 5px 12px;
  background: var(--accent-blue);
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s;
}

.BrokerCompare__link:hover {
  background: #1d4ed8;
}

.BrokerCompare__disclaimer {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 12px;
  line-height: 1.6;
}

/* ===== 12b. Report Modal (5回完了ポップアップ) ===== */
.ReportModal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.25s ease;
}

.ReportModal--out {
  animation: modalFadeOut 0.25s ease forwards;
}

.ReportModal__card {
  background: #fff;
  border-radius: 12px;
  padding: 32px 24px;
  text-align: center;
  max-width: 340px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.ReportModal__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.ReportModal__text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 20px;
}

.ReportModal__btn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--accent-blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.ReportModal__btn:hover {
  background: #1d4ed8;
}

.ReportModal__skip {
  display: block;
  margin: 10px auto 0;
  padding: 8px 20px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  cursor: pointer;
  transition: color 0.15s;
}

.ReportModal__skip:hover {
  color: var(--text-primary);
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ===== 12c. Report (5回後の成績レポート) ===== */
.Report__header {
  text-align: center;
  padding: 20px 16px 8px;
}

.Report__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.Report__subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.Report__section {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}

.Report__sectionTitle {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

/* Result Summary */
.Report__stats {
  display: grid;
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.Report__stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-white);
  font-size: 0.8rem;
}

.Report__statLabel {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.Report__statValue {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Trend Analysis Items */
.Report__item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.Report__item:last-child {
  border-bottom: none;
}

.Report__icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  margin-top: 2px;
}

.Report__icon--ok {
  background: var(--color-win);
}

.Report__icon--ok::after {
  content: "\2713";
}

.Report__icon--warn {
  background: #eab308;
}

.Report__icon--warn::after {
  content: "!";
}

.Report__icon--danger {
  background: var(--color-lose);
}

.Report__icon--danger::after {
  content: "\2715";
}

.Report__itemBody {
  flex: 1;
  min-width: 0;
}

.Report__itemTitle {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.Report__itemText {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Improvement Tips */
.Report__tips {
  padding-left: 20px;
}

.Report__tip {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 6px;
}

/* Skill Level */
.Report__level {
  text-align: center;
  background: var(--bg-page);
  border-radius: var(--radius);
  margin: 0 16px;
  padding: 20px 16px;
}

.Report__levelBars {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 10px;
}

.Report__bar {
  width: 36px;
  height: 10px;
  border-radius: 5px;
  background: var(--border);
}

.Report__bar--filled {
  background: var(--accent-blue);
}

.Report__levelLabel {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.Report__levelDesc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.Report__levelAdvice {
  font-size: 0.75rem;
  color: var(--accent-blue);
}

/* Retry Button */
.Report__retry {
  padding: 16px;
  text-align: center;
}

.Report__retryBtn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--bg-page);
  border: 2px solid var(--accent-blue);
  border-radius: var(--radius);
  color: var(--accent-blue);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.Report__retryBtn:hover {
  background: var(--accent-blue);
  color: #fff;
}

/* Broker Recommendation */
.Report__broker {
  border-top: none;
  padding-top: 0;
}

.Report__brokerIntro {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 14px;
}

.Report__brokerBox {
  background: var(--bg-page);
  border-radius: var(--radius);
  padding: 14px;
}

.Report__brokerBoxTitle {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.Report__brokerCard {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 10px;
}

.Report__brokerCard:last-child {
  margin-bottom: 0;
}

.Report__brokerReason {
  font-size: 0.7rem;
  color: var(--accent-blue);
  font-weight: 600;
  margin-bottom: 4px;
}

.Report__brokerName {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.Report__brokerFeature {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 6px;
}

.Report__brokerMeta {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.Report__brokerLink {
  display: inline-block;
  padding: 6px 16px;
  background: var(--accent-blue);
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  transition: background 0.15s;
}

.Report__brokerLink:hover {
  background: #1d4ed8;
}

.Report__disclaimer {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 12px;
  line-height: 1.6;
}

/* Report comparison (2周目) */
.Report__comparison {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}

.Report__compItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.78rem;
  border-bottom: 1px solid var(--border);
}

.Report__compItem:last-child {
  border-bottom: none;
}

.Report__compLabel {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.Report__compValues {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.Report__compArrow {
  color: var(--text-muted);
  font-size: 0.65rem;
}

.Report__compChange {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
}

.Report__compChange--up {
  color: var(--color-win);
  background: var(--color-buy-bg);
}

.Report__compChange--down {
  color: var(--color-lose);
  background: var(--color-sell-bg);
}

.Report__compChange--same {
  color: var(--text-muted);
  background: var(--bg-page);
}

/* ===== 13. Glossary Tooltip ===== */
.Glossary {
  text-decoration: underline dotted;
  text-decoration-color: var(--text-muted);
  text-underline-offset: 3px;
  cursor: help;
}

.GlossaryTip {
  position: absolute;
  z-index: 500;
  background: #1e293b;
  color: #f1f5f9;
  border-radius: 8px;
  padding: 10px 14px;
  max-width: 280px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}

.GlossaryTip__term {
  display: block;
  font-size: 0.78rem;
  margin-bottom: 4px;
  color: #93c5fd;
}

.GlossaryTip__desc {
  font-size: 0.72rem;
  line-height: 1.6;
  color: #cbd5e1;
}

/* ===== 14. Onboarding Guide ===== */
.Guide {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
}

.Guide__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  pointer-events: auto;
}

.Guide__highlight {
  position: fixed;
  border: 2px solid rgba(37, 99, 235, 0.6);
  border-radius: var(--radius);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
  pointer-events: none;
  z-index: 10000;
}

.Guide__center {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gutter);
  pointer-events: auto;
}

.Guide__tooltip {
  position: fixed;
  z-index: 10001;
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 20px;
  max-width: 320px;
  width: calc(100% - 32px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  animation: guideIn 0.25s ease;
  pointer-events: auto;
}

.Guide__tooltip--center {
  position: relative;
  text-align: center;
}

@keyframes guideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.Guide__step {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.Guide__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.Guide__text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}

.Guide__actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.Guide__btn {
  padding: 8px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.Guide__btn--primary {
  background: var(--accent-blue);
  color: #fff;
}

.Guide__btn--primary:hover {
  background: #1d4ed8;
}

.Guide__btn--skip {
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.Guide__btn--skip:hover {
  color: var(--text-secondary);
}

/* ===== 15. Footer ===== */
.Footer {
  background: var(--header-bg);
  color: #94a3b8;
  text-align: center;
  padding: 20px var(--gutter);
  margin-top: auto;
}

.Footer__disclaimer {
  font-size: 0.7rem;
  line-height: 1.7;
  margin-bottom: 12px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.Footer__brokerLink {
  margin-bottom: 12px;
}

.Footer__brokerLink a {
  color: #94a3b8;
  font-size: 0.72rem;
  text-decoration: none;
  transition: color 0.15s;
}

.Footer__brokerLink a:hover {
  color: #e2e8f0;
}

.Footer__copy {
  font-size: 0.65rem;
  color: #64748b;
}

/* ===== 16. Utility ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ===== 17. Responsive ===== */
@media (max-width: 480px) {
  .Header__inner {
    height: 48px;
    padding: 0 12px;
  }

  .Header__logo {
    font-size: 0.92rem;
  }

  .Header__balance {
    font-size: 0.75rem;
  }

  .Main {
    padding: 10px;
  }

  .ChartArea__canvas {
    height: 250px;
  }

  .ChartArea__price {
    font-size: 1.15rem;
  }

  .TradeBtn {
    min-height: 44px;
    font-size: 0.85rem;
  }

  .ChartArea__hint {
    font-size: 0.58rem;
  }

  .StatsGrid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .Guide__tooltip {
    max-width: 290px;
  }
}

@media (max-width: 768px) {
  .TradePanel__shortcuts {
    display: none;
  }
}

@media (min-width: 769px) {
  .Main {
    padding: 20px var(--gutter);
  }

  .ChartArea__canvas {
    height: 400px;
  }

  .StatsGrid {
    grid-template-columns: repeat(4, 1fr);
  }
}
