/* Фиксированная фирменная палитра (Sky) — сознательно НЕ подстраивается под
   тему Telegram-клиента пользователя, в отличие от более типичного подхода
   через var(--tg-theme-*, ...). Мини-ап должен выглядеть одинаково всегда. */

:root {
  --bg: #F5F9FF;
  --text: #0B1730;
  --hint: #6B7A99;
  --button: #3B82F6;
  --button-text: #ffffff;
  --secondary-bg: #ffffff;
  --destructive: #e53935;
  --heat-empty: #E3ECFB;
  --heat-l1: #C7DBFB;
  --heat-l2: #8FB8F7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.screen {
  padding: 16px;
  padding-bottom: 32px;
}

.app-header {
  margin-bottom: 16px;
}

.app-header h1 {
  margin: 0 0 4px;
  font-size: 22px;
}

.muted {
  color: var(--hint);
  font-size: 14px;
}

.card {
  background: var(--secondary-bg);
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 12px;
}

.notice {
  text-align: center;
}

.notice p {
  margin: 0;
}

.notice-error {
  color: var(--destructive);
}

.section {
  margin-top: 24px;
}

.section h2 {
  font-size: 17px;
  margin: 0 0 10px;
}

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

.section-header h2 {
  margin: 0;
}

.add-btn {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--button);
  color: var(--button-text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* --- Модалка добавления --- */

.modal-overlay[hidden] {
  display: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 23, 48, 0.4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
}

.modal {
  width: 100%;
  max-width: 480px;
  margin: 0;
  border-radius: 16px 16px 0 0;
}

.modal h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.modal input[type="text"],
.modal input[type="date"],
.modal textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--heat-l1);
  border-radius: 8px;
  padding: 10px;
  font-size: 15px;
  font-family: inherit;
  margin-bottom: 10px;
  color: var(--text);
  background: var(--bg);
}

.modal textarea {
  min-height: 80px;
  resize: vertical;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.btn-primary,
.btn-secondary {
  flex: 1 1 0;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-size: 15px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: var(--button);
  color: var(--button-text);
}

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

.btn-secondary {
  background: var(--bg);
  color: var(--text);
}

/* --- Задачи --- */

.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--secondary-bg);
  border-radius: 12px;
  padding: 12px;
}

.task-item.task-done .task-title {
  text-decoration: line-through;
  color: var(--hint);
}

.checkbox {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--button);
  background: transparent;
  padding: 0;
  cursor: pointer;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.checkbox.checked {
  background: var(--button);
}

.checkbox.checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border-right: 2px solid var(--button-text);
  border-bottom: 2px solid var(--button-text);
  transform: rotate(45deg);
}

.task-title {
  flex: 1 1 auto;
  font-size: 15px;
  word-break: break-word;
}

.goal-tag {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--button);
  border: 1px solid var(--button);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

/* --- Неделя --- */

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

.week-day-today {
  border: 1px solid var(--button);
}

.week-day-header {
  font-size: 14px;
  font-weight: 600;
  text-transform: capitalize;
}

.week-day-empty {
  margin: 6px 0 0;
}

.week-task-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.week-task {
  font-size: 14px;
}

.week-task-done {
  text-decoration: line-through;
  color: var(--hint);
}

/* --- Цели --- */

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

.goal-card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: var(--bg);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--button);
  border-radius: 999px;
  transition: width 0.2s ease;
}

.goal-card-caption {
  margin-top: 6px;
}

/* --- Отчёты --- */

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

.report-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.report-date {
  font-size: 15px;
  font-weight: 600;
  text-transform: capitalize;
}

.report-chevron {
  color: var(--hint);
  transition: transform 0.2s ease;
}

.report-item.expanded .report-chevron {
  transform: rotate(90deg);
}

.report-body {
  margin-top: 10px;
}

.report-feedback {
  margin: 0 0 6px;
  font-size: 14px;
}

.report-wrong {
  margin: 0;
  font-size: 13px;
}

/* --- Прогресс (стрик + активность) --- */

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

.activity-header h2 {
  margin: 0;
}

.streak-badge[hidden] {
  display: none;
}

.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--secondary-bg);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--button);
}

.heat-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  margin-top: 8px;
}

.heat-cell {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 4px;
  background: var(--heat-empty);
}

.heat-cell.l1 {
  background: var(--heat-l1);
}

.heat-cell.l2 {
  background: var(--heat-l2);
}

.heat-cell.l3 {
  background: var(--button);
}

/* --- Идеи --- */

.idea-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.idea-item {
  font-size: 14px;
}
