  /* History Modal - 90% viewport */
  .modal.history-modal {
    max-width: 90vw;
    max-height: 90vh;
    width: 90vw;
    height: 90vh;
  }
  .history-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
  }
  .history-stat-card {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
  }
  .history-stat-label {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 6px;
  }
  .history-stat-value {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.02em;
  }
  .history-stat-sub {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
  }
  .history-section-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
  }
  .history-section-title-main {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.01em;
  }
  .history-section-title-sub {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
  }

  /* Calendar heatmap */
  .heatmap-wrapper {
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 28px;
  }
  .heatmap {
    display: grid;
    grid-template-columns: 32px repeat(12, minmax(24px, 1fr));
    grid-template-rows: 16px repeat(7, minmax(24px, 1fr));
    gap: 3px;
    min-width: 500px;
  }
  .heatmap-header-week {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-muted);
    text-align: center;
    align-self: end;
  }
  .heatmap-header-empty {
    grid-column: 1;
    grid-row: 1;
  }
  .heatmap-day-label {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-muted);
    align-self: center;
    justify-self: end;
    padding-right: 6px;
  }
  .heatmap-cell {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    cursor: default;
    min-width: 24px;
    aspect-ratio: 1;
  }
  .heatmap-cell.today { border-color: var(--accent); border-width: 1.5px; }
  .heatmap-cell.completed-1 { background: rgba(163, 217, 192, 0.2); color: var(--success); border-color: rgba(163, 217, 192, 0.3); }
  .heatmap-cell.completed-2 { background: rgba(163, 217, 192, 0.4); color: var(--success); font-weight: 500; border-color: rgba(163, 217, 192, 0.5); }
  .heatmap-cell.completed-3plus { background: rgba(163, 217, 192, 0.65); color: var(--bg); font-weight: 600; border-color: var(--success); }
  .heatmap-cell.future { opacity: 0.3; }
  .heatmap-legend {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
  }
  .heatmap-legend-cell {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    border: 1px solid var(--border);
  }

  /* Timeline */
  .timeline-day-group {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 10px;
  }
  .timeline-day-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
  }
  .timeline-day-date {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.01em;
  }
  .timeline-day-count {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    background: var(--accent-glow);
    padding: 3px 10px;
    border-radius: 3px;
  }
  .timeline-lesson-item {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 5px 0;
    font-size: 13px;
  }
  .timeline-lesson-day-num {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    flex-shrink: 0;
    min-width: 40px;
  }
  .timeline-lesson-title {
    color: var(--text-primary);
    flex: 1;
  }
  .timeline-lesson-time {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
  }
  .history-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
  }
  .streak.clickable { cursor: pointer; transition: background 0.15s; }
  .streak.clickable:hover { background: rgba(212, 183, 107, 0.2); }

