* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --success: #22c55e;
  --success-light: #f0fdf4;
  --orange: #f97316;
  --bg: #f5f5f5;
  --card: #ffffff;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #1a1a2e;
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

.app-container {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
  margin: 0 auto;
}

@media (min-width: 500px) {
  .app-container {
    box-shadow: 0 0 40px rgba(0,0,0,0.3);
  }
}

.header {
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  padding: calc(var(--safe-top) + 20px) 20px 24px;
  color: white;
}

.header-date {
  font-size: 14px;
  opacity: 0.8;
  margin-bottom: 4px;
}

.header-title {
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-nav {
  display: flex;
  gap: 8px;
}

.header-nav button {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  padding-bottom: 2px;
}

.header-nav button:hover {
  background: rgba(255,255,255,0.3);
}

.header-nav button:active {
  background: rgba(255,255,255,0.4);
}

.header-nav button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.header-nav .return-today-btn {
  background: rgba(255,255,255,0.2);
  color: white;
  border: none;
  padding: 0 14px;
  border-radius: 18px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  width: auto;
  height: 36px;
}

.header-nav .return-today-btn:hover {
  background: rgba(255,255,255,0.3);
}

.header-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

.header-stat {
  background: rgba(255,255,255,0.2);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
}

.content {
  padding: 20px;
  padding-bottom: calc(80px + var(--safe-bottom));
}

.section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-title button {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
}

.section-title-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hide-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  text-transform: none;
}

.hide-toggle input {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: var(--primary);
}

.habit-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.habit-item {
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: transform 0.1s, box-shadow 0.1s;
  cursor: pointer;
}

.habit-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.habit-item:active {
  transform: scale(0.98);
}

.habit-item.done {
  background: var(--success-light);
}

.habit-check {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  font-size: 14px;
}

.habit-item.done .habit-check {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.habit-timer-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
  transition: transform 0.2s;
}

.habit-timer-circle:hover {
  transform: scale(1.1);
}

.habit-timer-circle:active {
  transform: scale(0.95);
}

.timer-progress-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(
    var(--success) calc(var(--progress, 0) * 360deg),
    var(--border) calc(var(--progress, 0) * 360deg) 360deg
  );
}

.timer-progress-inner {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

/* Play triangle using CSS */
.timer-progress-inner.idle::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 8px solid var(--primary);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  margin-left: 2px;
}

/* Pause bars using CSS */
.timer-progress-inner.running::before,
.timer-progress-inner.running::after {
  content: '';
  width: 3px;
  height: 10px;
  background: var(--primary);
  border-radius: 1px;
}

.timer-progress-inner.running::before {
  margin-right: 3px;
}

/* Resume play triangle (paused state) */
.timer-progress-inner.paused::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 8px solid var(--orange);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  margin-left: 2px;
}

/* Checkmark for done state */
.timer-progress-inner.done {
  font-size: 14px;
  color: white;
  font-weight: bold;
}

.habit-item.done .timer-progress-ring {
  background: var(--success);
}

.habit-item.done .timer-progress-inner {
  background: var(--success);
  color: white;
}

.habit-timer-info {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.habit-timer-info.running {
  color: var(--primary);
  font-weight: 500;
}

.habit-timer-info.paused {
  color: var(--orange);
}

.habit-timer-info.completed {
  color: var(--success);
}

.habit-info {
  flex: 1;
  min-width: 0;
}

.habit-name {
  font-weight: 500;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.habit-item.done .habit-name {
  color: #166534;
}

.habit-days {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.habit-streak {
  font-size: 14px;
  color: var(--orange);
  font-weight: 500;
  white-space: nowrap;
}

.complete-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--success);
  background: transparent;
  color: var(--success);
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.complete-btn:hover {
  background: var(--success);
  color: white;
}

.complete-btn:active {
  transform: scale(0.95);
}

.reorder-controls {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.reorder-controls button {
  background: var(--bg);
  border: none;
  width: 28px;
  height: 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 10px;
  transition: background 0.2s;
}

.reorder-controls button:hover {
  background: var(--border);
}

.habit-item.dragging {
  opacity: 0.5;
  background: var(--bg);
}

.habit-item.drag-over-top {
  border-top: 2px solid var(--primary);
  margin-top: -2px;
}

.habit-item.drag-over-bottom {
  border-bottom: 2px solid var(--primary);
  margin-bottom: -2px;
}

.drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
  color: var(--text-muted);
  font-size: 24px;
  cursor: grab;
  touch-action: none;
}

.add-habit-btn {
  width: 100%;
  padding: 16px;
  border: 2px dashed var(--border);
  border-radius: 16px;
  background: transparent;
  color: var(--text-muted);
  font-size: 15px;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.2s;
}

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

.add-habit-btn:active {
  background: var(--card);
}

.nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  background: var(--card);
  display: flex;
  justify-content: space-around;
  padding: 12px 20px calc(12px + var(--safe-bottom));
  border-top: 1px solid var(--border);
  z-index: 50;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  padding: 4px 16px;
  transition: color 0.2s;
}

.nav-item:hover {
  color: var(--primary);
}

.nav-item.active {
  color: var(--primary);
}

.nav-item span:first-child {
  font-size: 24px;
}

.modal-overlay {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: flex-end;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.2s;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal {
  background: var(--card);
  width: 100%;
  max-height: 90vh;
  border-radius: 24px 24px 0 0;
  padding: 24px;
  padding-bottom: calc(24px + var(--safe-bottom));
  transform: translateY(100%);
  transition: transform 0.3s;
  overflow-y: auto;
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

/* Welcome modal - centered */
.welcome-overlay {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
  box-sizing: border-box;
}

.welcome-modal {
  background: var(--card);
  border-radius: 20px;
  padding: 28px 24px;
  max-width: 320px;
  width: 100%;
  text-align: center;
  animation: welcomeFadeIn 0.3s ease;
}

@keyframes welcomeFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.welcome-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
}

.welcome-text {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
}

.welcome-tip {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  text-align: left;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: 12px;
  margin-bottom: 20px;
}

.welcome-tip p {
  margin-bottom: 8px;
}

.welcome-tip p:last-child {
  margin-bottom: 0;
}

.welcome-btn {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.welcome-btn:hover {
  background: var(--primary-dark);
}

/* Backup reminder modal */
.backup-reminder-modal {
  max-width: 340px;
}

.backup-later-btn {
  width: 100%;
  padding: 12px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.2s, color 0.2s;
}

.backup-later-btn:hover {
  background: var(--bg);
  color: var(--text);
}

.backup-dont-remind {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}

.backup-dont-remind input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Update notification banner */
.update-banner {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  color: white;
  padding: calc(var(--safe-top) + 10px) 16px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 300;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.update-banner button {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.4);
  color: white;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.update-banner button:hover {
  background: rgba(255,255,255,0.3);
}

.update-banner button:active {
  background: rgba(255,255,255,0.4);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

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

.form-label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: var(--primary);
}

.day-picker {
  display: flex;
  gap: 8px;
}

.day-btn {
  flex: 1;
  aspect-ratio: 1;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.day-btn:hover {
  background: var(--border);
}

.day-btn.active {
  background: var(--primary);
  color: white;
}

.icon-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--bg);
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.icon-btn.active {
  background: var(--primary);
  border-color: var(--primary);
}

.icon-btn.none {
  font-size: 12px;
  color: var(--text-muted);
}

.icon-btn.none.active {
  color: white;
}

.icon-btn.more {
  font-size: 16px;
  color: var(--text-muted);
  font-weight: bold;
}

.icon-picker-overlay {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.2s;
}

.icon-picker-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.icon-picker-popup {
  background: var(--card);
  border-radius: 16px;
  padding: 20px;
  max-width: 340px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.2s;
}

.icon-picker-overlay.open .icon-picker-popup {
  transform: scale(1);
}

.icon-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.icon-picker-title {
  font-size: 18px;
  font-weight: 600;
}

.icon-picker-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, 40px);
  gap: 8px;
  justify-content: center;
}

.icon-picker-grid .icon-btn {
  width: 40px;
  height: 40px;
}

.timer-section {
  background: var(--bg);
  border-radius: 12px;
  padding: 16px;
  margin-top: 8px;
}

.timer-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-weight: 600;
  color: var(--text);
}

.timer-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.timer-input {
  width: 70px;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
  text-align: center;
}

.timer-input:focus {
  outline: none;
  border-color: var(--primary);
}

.habit-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.btn-primary {
  width: 100%;
  padding: 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-primary:active {
  background: var(--primary-dark);
}

.btn-danger {
  width: 100%;
  padding: 14px;
  background: none;
  color: #ef4444;
  border: none;
  font-size: 15px;
  cursor: pointer;
  margin-top: 12px;
}

.btn-danger:hover {
  text-decoration: underline;
}

.btn-secondary {
  flex: 1;
  padding: 12px 16px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.btn-secondary:active {
  background: var(--border);
}

.data-buttons {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.support-section {
  text-align: center;
  margin-top: 20px;
  margin-bottom: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.support-text {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.coffee-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FFDD00;
  color: #000;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}

.about-section {
  text-align: center;
  padding: 0;
}

.about-text {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 12px;
}

.feedback-btn {
  display: inline-block;
  text-decoration: none;
}

.calendar {
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

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

.calendar-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.calendar-header button {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  transition: color 0.2s;
}

.calendar-header button:hover {
  color: var(--text);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}

.calendar-day-header {
  font-size: 11px;
  color: var(--text-muted);
  padding: 8px 0;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
}

.calendar-day:not(.empty):hover {
  background: var(--bg);
}

.calendar-day:not(.empty):active {
  background: var(--border);
}

.calendar-day.today {
  background: var(--primary);
  color: white;
}

.calendar-day.today:hover {
  background: var(--primary-dark);
}

.calendar-day.selected:not(.today) {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.calendar-day.has-data::after {
  content: '';
  width: 4px;
  height: 4px;
  background: var(--success);
  border-radius: 50%;
  position: absolute;
  bottom: 4px;
}

.calendar-day.today.has-data::after {
  background: white;
}

.calendar-day.all-done::after {
  width: 6px;
  height: 6px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  border-radius: 16px;
  padding: 16px;
  color: white;
  position: relative;
}

.stat-info {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  opacity: 0.8;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  z-index: 5;
}

.stat-info:hover,
.stat-info:active {
  opacity: 1;
  background: rgba(255,255,255,0.4);
}

.stat-tooltip {
  display: none;
  position: absolute;
  top: 32px;
  background: rgba(0,0,0,0.9);
  color: white;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  width: 200px;
  z-index: 10;
  text-align: left;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.stat-tooltip.show {
  display: block;
}

@media (min-width: 400px) {
  .stat-tooltip {
    width: 240px;
  }
}

.stat-card.green {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.stat-card.orange {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

.stat-card.blue {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.stat-label {
  font-size: 12px;
  opacity: 0.8;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
}

.stat-unit {
  font-size: 12px;
  opacity: 0.8;
}

.habit-stat {
  background: var(--card);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.habit-stat-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.habit-stat-name {
  font-weight: 500;
  font-size: 14px;
}

.habit-stat-pct {
  color: var(--primary);
  font-weight: 600;
}

.progress-bar {
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.3s;
}

.heatmap-container {
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

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

.heatmap-title {
  font-weight: 600;
  font-size: 14px;
}

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

.heatmap-grid {
  display: grid;
  grid-template-rows: repeat(7, 1fr);
  grid-auto-flow: column;
  gap: 3px;
  width: max-content;
}

.heatmap-cell {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: #ebedf0;
}

.heatmap-cell.level-1 { background: #9be9a8; }
.heatmap-cell.level-2 { background: #40c463; }
.heatmap-cell.level-3 { background: #30a14e; }
.heatmap-cell.level-4 { background: #216e39; }

.heatmap-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.heatmap-legend-cell {
  width: 11px;
  height: 11px;
  border-radius: 2px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.day-detail {
  background: var(--card);
  border-radius: 12px;
  padding: 14px;
  margin-top: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.day-detail-header {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.day-detail-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  cursor: pointer;
  border-radius: 8px;
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
  transition: background 0.2s;
}

.day-detail-item:hover {
  background: var(--bg);
}
