@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --primary: #FF6B6B;
  --primary-dim: #FFA07A;
  --primary-glow: rgba(142, 68, 173, 0.3);
  --bg-deep: #FFD93D;
  --bg-mid: #6BCB77;
  --bg-card: #4D96FF;
  --bg-card-hover: #2E2E50;
  --text-primary: #F5F5F5;
  --text-secondary: #B8B5C8;
  --text-muted: #7A7694;
  --border: rgba(142, 68, 173, 0.15);
  --border-strong: rgba(142, 68, 173, 0.3);
  --success: #2ECC71;
  --success-dim: rgba(46, 204, 113, 0.15);
  --heat-0: #1a1a30;
  --heat-1: #4A2363;
  --heat-2: #6B2F8A;
  --heat-3: #8E44AD;
  --heat-4: #BB6BD9;
  --danger: #E74C3C;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

::selection {
  background: var(--primary);
  color: var(--text-primary);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(142, 68, 173, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(48, 43, 99, 0.4) 0%, transparent 50%);
}

.app-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 100px;
  min-height: 100vh;
}

/* Header */
.app-header {
  padding: 32px 0 8px;
  text-align: center;
}

.app-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--heat-4));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.app-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 300;
}

/* Tab Navigation */
.tab-nav {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 4px;
  margin: 20px 0;
  border: 1px solid var(--border);
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.25s ease;
}

.tab-btn:hover {
  color: var(--text-secondary);
  background: rgba(142, 68, 173, 0.08);
}

.tab-btn.active {
  background: var(--primary);
  color: var(--text-primary);
  box-shadow: 0 2px 12px var(--primary-glow);
}

.tab-icon {
  font-size: 1rem;
}

/* Loading Skeletons */
.loading-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 0;
}

.skeleton-card {
  height: 72px;
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  border-radius: var(--radius-md);
  animation: shimmer 1.5s ease infinite;
}

.skeleton-heatmap {
  height: 200px;
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  border-radius: var(--radius-md);
  animation: shimmer 1.5s ease infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Section Titles */
.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Today Header */
.today-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 20px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.today-progress-text {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 4px;
}

.progress-ring-container {
  position: relative;
  width: 64px;
  height: 64px;
}

.progress-ring {
  width: 64px;
  height: 64px;
  transform: rotate(-90deg);
}

.progress-ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 6;
}

.progress-ring-fill {
  fill: none;
  stroke: var(--primary);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dasharray 0.6s ease;
}

.progress-ring-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  animation: fadeInUp 0.5s ease both;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.empty-state h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

/* Habit Cards */
.habit-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.habit-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: all 0.25s ease;
  animation: fadeInUp 0.4s ease both;
}

.habit-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

.habit-card.completed {
  border-color: rgba(46, 204, 113, 0.2);
  background: rgba(46, 204, 113, 0.04);
}

.check-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  background: transparent;
  color: transparent;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.check-btn:hover {
  border-color: var(--primary);
}

.check-btn.checked {
  background: var(--success);
  border-color: var(--success);
  color: white;
  box-shadow: 0 2px 8px rgba(46, 204, 113, 0.3);
}

.habit-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  min-width: 0;
}

.habit-emoji {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.habit-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.habit-name {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-primary);
  transition: all 0.25s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.habit-name.strikethrough {
  text-decoration: line-through;
  color: var(--text-muted);
}

.habit-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.habit-actions {
  flex-shrink: 0;
}

.icon-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background: rgba(231, 76, 60, 0.15);
  color: var(--danger);
}

/* Floating Add Button */
.btn-add-floating {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 14px;
  border: 2px dashed var(--border-strong);
  background: transparent;
  color: var(--primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all 0.25s ease;
}

.btn-add-floating:hover {
  background: rgba(142, 68, 173, 0.08);
  border-color: var(--primary);
}

/* Buttons */
.btn-primary {
  padding: 12px 24px;
  background: var(--primary);
  color: var(--text-primary);
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-primary:hover {
  background: var(--primary-dim);
  box-shadow: 0 4px 16px var(--primary-glow);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  padding: 12px 24px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

/* Heatmap */
.heatmap-container {
  animation: fadeInUp 0.4s ease both;
}

.heatmap-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-select {
  padding: 8px 12px;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
  outline: none;
}

.filter-select:focus {
  border-color: var(--primary);
}

.heatmap-scroll {
  overflow-x: auto;
  padding-bottom: 8px;
}

.heatmap-grid-wrapper {
  min-width: 680px;
}

.heatmap-month-labels {
  display: grid;
  grid-template-columns: 32px repeat(53, 1fr);
  margin-bottom: 4px;
  padding-left: 0;
}

.month-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

.heatmap-body {
  display: flex;
  gap: 4px;
}

.heatmap-day-labels {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 28px;
  flex-shrink: 0;
}

.day-label {
  height: 13px;
  font-size: 0.65rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.heatmap-grid {
  display: flex;
  gap: 3px;
}

.heatmap-week {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.heatmap-cell {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  transition: all 0.15s ease;
}

.heatmap-cell.level--1 {
  background: transparent;
}

.heatmap-cell.level-0 {
  background: var(--heat-0);
  border: 1px solid rgba(142, 68, 173, 0.08);
}

.heatmap-cell.level-1 {
  background: var(--heat-1);
}

.heatmap-cell.level-2 {
  background: var(--heat-2);
}

.heatmap-cell.level-3 {
  background: var(--heat-3);
}

.heatmap-cell.level-4 {
  background: var(--heat-4);
  box-shadow: 0 0 6px rgba(187, 107, 217, 0.4);
}

.heatmap-cell.today {
  outline: 2px solid var(--text-primary);
  outline-offset: 1px;
}

.heatmap-cell:hover {
  transform: scale(1.5);
  z-index: 10;
  position: relative;
}

.legend-cell {
  cursor: default;
}

.legend-cell:hover {
  transform: none;
}

.heatmap-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 12px;
}

.legend-text {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin: 0 4px;
}

.heatmap-stats-row {
  display: flex;
  gap: 16px;
  margin-top: 20px;
}

.heatmap-stat {
  flex: 1;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 16px;
  text-align: center;
}

.heatmap-stat-value {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
}

.heatmap-stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Streaks */
.streaks-container {
  animation: fadeInUp 0.4s ease both;
}

.overall-streaks {
  margin-bottom: 28px;
}

.streak-hero-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.streak-hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
  overflow: hidden;
}

.streak-hero-card.current {
  border-top: 3px solid var(--primary);
}

.streak-hero-card.longest {
  border-top: 3px solid var(--heat-4);
}

.streak-flame {
  font-size: 2rem;
  margin-bottom: 4px;
}

.streak-hero-number {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.streak-hero-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.per-habit-streaks {
  margin-top: 8px;
}

.streak-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.streak-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  animation: fadeInUp 0.4s ease both;
  transition: border-color 0.2s ease;
}

.streak-card:hover {
  border-color: var(--border-strong);
}

.streak-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.streak-card-emoji {
  font-size: 1.3rem;
}

.streak-card-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
}

.streak-card-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 10px;
}

.streak-stat {
  display: flex;
  align-items: center;
  gap: 8px;
}

.streak-stat-icon {
  font-size: 1rem;
}

.streak-stat-info {
  display: flex;
  flex-direction: column;
}

.streak-stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  line-height: 1.2;
}

.streak-stat-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.streak-bar-container {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.streak-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--heat-4));
  border-radius: 2px;
  transition: width 0.6s ease;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 12, 41, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 0;
}

.modal-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(231, 76, 60, 0.15);
  color: var(--danger);
}

.modal-body {
  padding: 20px 24px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 24px;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.emoji-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.emoji-btn {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border);
  background: var(--bg-deep);
  border-radius: var(--radius-sm);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.emoji-btn:hover {
  border-color: var(--text-muted);
}

.emoji-btn.selected {
  border-color: var(--primary);
  background: rgba(142, 68, 173, 0.15);
  box-shadow: 0 0 8px var(--primary-glow);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Mobile responsiveness */
@media (max-width: 640px) {
  .app-container {
    padding: 0 12px 80px;
  }

  .app-title {
    font-size: 1.6rem;
  }

  .today-header {
    padding: 16px;
  }

  .section-title {
    font-size: 1rem;
  }

  .streak-hero-number {
    font-size: 2rem;
  }

  .streak-card-stats {
    gap: 12px;
    flex-wrap: wrap;
  }

  .heatmap-cell {
    width: 11px;
    height: 11px;
  }

  .heatmap-grid {
    gap: 2px;
  }

  .heatmap-week {
    gap: 2px;
  }

  .modal-content {
    max-height: 90vh;
  }

  .emoji-btn {
    width: 36px;
    height: 36px;
  }

  .tab-label {
    font-size: 0.78rem;
  }
}
```

<!-- WALKTHROUGH_SCRIPT:
[
  {"step": 1, "narration": "Welcome to Habit Forge — your personal habit tracker with streaks and a heatmap calendar. Let's start by adding your first habit.", "view": "user", "highlight_selector": ".empty-state .btn-primary", "wait_for": "tap_to_continue"},
  {"step": 2, "narration": "Choose an emoji icon that represents your habit, give it a name, and optionally add a description. Then tap 'Add Habit'.", "view": "user", "highlight_selector": ".modal-content", "wait_for": "user_interaction"},
  {"step": 3, "narration": "Your habit appears on the Today tab. Tap the circle next to any habit to check it off for today. The progress ring updates instantly.", "view": "user", "highlight_selector": ".check-btn", "wait_for": "user_interaction"},
  {"step": 4, "narration": "Switch to the Heatmap tab to see your activity over the past year — just like GitHub's contribution graph. Darker purple means more completions.", "view": "user", "highlight_selector": ".tab-btn:nth-child(2)", "wait_for": "user_interaction"},
  {"step": 5, "narration": "Use the dropdown to filter the heatmap by a specific habit, or view all habits combined.", "view": "user", "highlight_selector": ".filter-select", "wait_for": "tap_to_continue"},
  {"step": 6, "narration": "The Streaks tab shows your current and longest streaks — both overall and per habit. Keep your streak alive by checking in daily!", "view": "user", "highlight_selector": ".tab-btn:nth-child(3)", "wait_for": "user_interaction"},
  {"step": 7, "narration": "Your data syncs across all your devices automatically. Open this app on your phone and desktop — everything stays in sync.", "view": "user", "highlight_selector": ".app-header", "wait_for": "tap_to_continue"}
]
-->

.auth-gate-container {
  min-height: 40vh;
  display: flex;
  align-items: center;
}

.auth-gate {
  width: 100%;
}

.user-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.user-bar-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.user-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-logout-btn {
  padding: 10px 14px;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .user-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .user-logout-btn {
    width: 100%;
  }
}

.completion-charts-section {
  margin-bottom: 28px;
}

.completion-charts-header {
  margin-bottom: 12px;
}

.completion-charts-note {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.completion-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.series-chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}

.series-chart-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.series-chart-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-primary);
}

.series-chart-subtitle {
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.series-chart-summary {
  text-align: right;
}

.series-chart-summary-value {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.series-chart-summary-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.series-chart-bars {
  height: 150px;
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.series-chart-bar-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  height: 100%;
}

.series-chart-bar {
  width: 100%;
  min-height: 2px;
  border-radius: 8px 8px 3px 3px;
  box-shadow: 0 0 8px rgba(142, 68, 173, 0.18);
}

.series-chart-bar-label {
  font-size: 0.62rem;
  color: var(--text-muted);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  height: 42px;
}

.habit-series-preview {
  margin-top: 14px;
}

.habit-series-preview .series-chart-bars {
  height: 96px;
}

.habit-series-preview .series-chart-card {
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.habit-series-preview .series-chart-title {
  font-size: 0.86rem;
}

@media (max-width: 640px) {
  .completion-charts-grid {
    grid-template-columns: 1fr;
  }

  .series-chart-bars {
    height: 130px;
  }

  .series-chart-bar-label {
    font-size: 0.56rem;
  }
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.share-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.share-btn {
  padding: 10px 14px;
}

.public-share-view {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.public-share-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: rgba(142, 68, 173, 0.12);
  color: var(--heat-4);
  font-size: 0.78rem;
  font-weight: 600;
}

.public-share-note {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.45;
}

.public-share-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.public-share-copy-btn {
  padding: 10px 14px;
}

.public-share-chart-wrap {
  margin-top: 14px;
}

@media (max-width: 640px) {
  .section-title-row {
    align-items: flex-start;
  }

  .share-controls {
    width: 100%;
  }

  .share-btn {
    flex: 1;
  }

  .public-share-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .public-share-copy-btn {
    width: 100%;
  }
}
