:root {
  --bg:        #F1EEEB;
  --paper:     #FFFFFF;
  --sand:      #E4D8CB;
  --stone:     #CDC6C3;
  --rose:      #D3B5B3;
  --rose-deep: #9E7476;
  --cinna:     #CFB3A9;
  --latte:     #A09086;
  --slate:     #849398;
  --ink:       #1B2C36;

  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Manrope", -apple-system, "Helvetica Neue", sans-serif;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  color-scheme: light;
}

body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 88px;
}

.save-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--rose-deep);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 12.5px;
  text-align: center;
  padding: 7px 12px;
  animation: fade 150ms ease-out;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 28px 20px 40px;
}

.view {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.view[hidden] { display: none; }

.week-header, .cycle-header, .add-header { margin: 0; }

.cycle-header { display: flex; flex-direction: column; gap: 16px; }

.block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fade 150ms ease-out;
}

.label {
  margin: 0;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--latte);
}

/* ——— header ——— */
.today-header {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.date-words {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 30px;
  letter-spacing: 0.02em;
  line-height: 1.1;
  text-wrap: balance;
}

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.week-day {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--latte);
}

.week-day.is-today {
  background: var(--ink);
  color: var(--paper);
}

/* ——— priorities ——— */
.priorities-block .block { gap: 0; }

.priorities {
  margin: 0;
  padding: 4px 18px;
  list-style: none;
  background: var(--rose);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
}

.priorities li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
}

.priorities li + li {
  border-top: 1px solid rgba(27, 44, 54, 0.12);
}

.priority-num {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
  color: var(--rose-deep);
  min-width: 26px;
}

.priority-checkbox {
  border-color: var(--rose-deep);
}

.priorities li.is-done .priority-checkbox {
  background: var(--rose-deep);
  border-color: var(--rose-deep);
}

.priority-title {
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
}

.priorities li.is-done .priority-title {
  color: var(--rose-deep);
  text-decoration: line-through;
}

.priority-title.is-empty {
  color: rgba(27, 44, 54, 0.35);
  border-bottom: 1px solid rgba(27, 44, 54, 0.2);
  flex: 1;
  height: 1px;
  align-self: center;
}

/* ——— task list ——— */
.task-list {
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(27, 44, 54, 0.06);
  overflow: hidden;
}

.task-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
}

.task-row + .task-row {
  border-top: 1px solid var(--stone);
}

.checkbox {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--stone);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.checkbox svg {
  opacity: 0;
  transition: opacity 150ms ease-out;
}

.task-row.is-done .checkbox {
  background: var(--rose);
  border-color: var(--rose);
}

.task-row.is-done .checkbox svg { opacity: 1; }

.task-title {
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  text-align: left;
  background: none;
  border: none;
  flex: 1;
  padding: 0;
}

.task-row.is-done .task-title {
  color: var(--latte);
  text-decoration: line-through;
}

.empty-line {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--latte);
  padding: 18px;
  text-align: center;
}

/* ——— hard dates ——— */
.hard-dates {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hard-dates li {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--slate);
}

/* ——— schedule ——— */
.schedule-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.schedule-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.schedule-time {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 13px;
  color: var(--slate);
  min-width: 40px;
}

.schedule-title {
  font-family: var(--sans);
  font-size: 14.5px;
  color: var(--ink);
  flex: 1;
}

.schedule-calendar {
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--latte);
}

/* ——— mood ——— */
.mood-dots {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  justify-items: center;
}

.mood-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--stone);
  background: var(--paper);
  padding: 0;
  cursor: pointer;
}

.mood-dot.is-selected {
  background: var(--rose-deep);
  border-color: var(--rose-deep);
}

.mood-captions {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin-top: 8px;
}

.mood-captions span {
  font-size: 10px;
  color: var(--latte);
  text-align: center;
}

/* ——— mind dump ——— */
.dump-field {
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--stone);
  border-radius: var(--radius);
  padding: 14px 16px;
  min-height: 96px;
  resize: vertical;
}

.dump-field::placeholder { color: var(--latte); }

.reset-btn {
  align-self: flex-start;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--latte);
  background: none;
  border: none;
  padding: 2px 0;
  cursor: pointer;
}

/* ——— bottom nav ——— */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  background: var(--paper);
  border-top: 1px solid var(--stone);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--latte);
  font-family: var(--sans);
  font-size: 11px;
  padding: 6px 0;
  cursor: pointer;
}

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

/* ——— sphere dot (цвет сферы задачи) ——— */
.sphere-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}

.task-row.is-past .task-title { color: var(--rose-deep); }

/* ——— НЕДЕЛЯ: фокус ——— */
.focus-plate {
  background: var(--rose);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  outline: none;
  min-height: 22px;
}

.focus-plate.is-placeholder { color: rgba(27, 44, 54, 0.45); font-style: italic; }

/* ——— НЕДЕЛЯ: дни ——— */
#weekDays {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.day-card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(27, 44, 54, 0.06);
  padding: 14px 16px 16px;
}

.day-card.is-past { opacity: 0.55; }

.day-card.is-today .day-card-head { color: var(--ink); }

.day-card-head {
  margin: 0 0 8px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--latte);
}

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

.day-task-list .task-row { padding: 8px 0; gap: 10px; }
.day-task-list .task-row + .task-row { border-top: 1px solid var(--stone); }
.day-task-list .checkbox { width: 18px; height: 18px; }
.day-task-list .task-title { font-size: 14px; }

.day-task-empty {
  font-family: var(--serif);
  font-style: italic;
  color: var(--latte);
  font-size: 14px;
  padding: 4px 0;
}

.day-add-btn {
  margin-top: 8px;
  background: none;
  border: none;
  color: var(--latte);
  font-family: var(--sans);
  font-size: 13px;
  padding: 2px 0;
  cursor: pointer;
}

.week-score-block { align-items: center; text-align: center; }

.score-line {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
  color: var(--ink);
}

.score-line.is-ok { color: var(--ink); }
.score-line.is-low { color: var(--rose-deep); }

/* ——— ЦИКЛ ——— */
.cycle-progress {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 4px;
}

.progress-seg {
  height: 6px;
  border-radius: 3px;
  background: var(--stone);
}

.progress-seg.is-past { background: var(--slate); }
.progress-seg.is-current { background: var(--ink); }

.goal-cards {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.sphere-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sphere-heading {
  margin: 0;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
}

.sphere-heading .sphere-dot {
  width: 8px;
  height: 8px;
  margin-right: 9px;
}

.sphere-empty {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--latte);
}

.goal-card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(27, 44, 54, 0.06);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.goal-title {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
}

.goal-progress-row { display: flex; }

.goal-num, .goal-num-input {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
  color: var(--rose-deep);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.goal-num-input {
  width: 70px;
  border-bottom: 1px solid var(--rose-deep);
  cursor: text;
}

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

.goal-bar-fill {
  height: 100%;
  background: var(--rose);
}

/* ——— подцели ——— */
.subgoals {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--stone);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.subgoals-label {
  margin: 0;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--latte);
}

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

.subgoal-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.subgoal-check {
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--stone);
  background: var(--paper);
  padding: 0;
  cursor: pointer;
}

.subgoal-row.is-done .subgoal-check {
  background: var(--rose);
  border-color: var(--rose);
}

.subgoal-title {
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--ink);
}

.subgoal-row.is-done .subgoal-title {
  color: var(--latte);
  text-decoration: line-through;
}

.subgoal-add {
  display: flex;
  gap: 8px;
}

.subgoal-input {
  flex: 1;
  min-width: 0;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--stone);
  border-radius: 10px;
  padding: 8px 10px;
}

.subgoal-input::placeholder { color: var(--latte); }

.subgoal-add-btn {
  flex: none;
  width: 32px;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--stone);
  border-radius: 10px;
  cursor: pointer;
}

.week-scores {
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(27, 44, 54, 0.06);
  overflow: hidden;
}

.week-score-row {
  display: flex;
  justify-content: space-between;
  padding: 11px 18px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
}

.week-score-row + .week-score-row { border-top: 1px solid var(--stone); }
.week-score-row.is-current { background: var(--sand); }
.week-score-row .is-ok { color: var(--ink); font-weight: 600; }
.week-score-row .is-low { color: var(--rose-deep); font-weight: 600; }

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

.hard-dates-full li { font-family: var(--sans); font-size: 14px; color: var(--slate); }
.hard-dates-full li.is-past { text-decoration: line-through; color: var(--latte); }

/* ——— ДОБАВИТЬ ——— */
.add-form { gap: 14px; }

.add-input {
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--stone);
  border-radius: var(--radius);
  padding: 14px 16px;
  width: 100%;
}

.add-input::placeholder { color: var(--latte); }

.add-field-label {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--latte);
  margin-top: 4px;
}

.add-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  margin-top: 6px;
  cursor: pointer;
}

.add-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }

.toggle-track {
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: var(--stone);
  position: relative;
  transition: background 150ms ease-out;
  flex: none;
}

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--paper);
  transition: transform 150ms ease-out;
}

.add-toggle input:checked + .toggle-track { background: var(--rose-deep); }
.add-toggle input:checked + .toggle-track .toggle-thumb { transform: translateX(16px); }

.add-hint {
  margin: -6px 0 0;
  font-size: 12.5px;
  color: var(--latte);
}

.add-submit {
  margin-top: 8px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15px;
  color: var(--paper);
  background: var(--ink);
  border: none;
  border-radius: var(--radius);
  padding: 15px;
  cursor: pointer;
}

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

@media (max-width: 380px) {
  .date-words { font-size: 26px; }
  .app { padding: 22px 16px 32px; }
}

/* ——— если — то (Сегодня) ——— */
.if-then-block { gap: 0; }
.if-then-line {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--latte);
}

/* ——— Неделя: кнопка планирования ——— */
.week-header {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.plan-week-btn {
  align-self: flex-start;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--sand);
  border: none;
  border-radius: 999px;
  padding: 9px 18px;
  cursor: pointer;
}

/* ——— Цикл: средний скор + колесо ——— */
.cycle-average-line {
  margin: 10px 2px 0;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--latte);
}

.wheel-chart {
  margin: 0;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(27, 44, 54, 0.06);
  padding: 16px 18px;
}

.wheel-chart svg { display: block; width: 100%; height: auto; }

.wheel-chart figcaption {
  margin-top: 8px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--latte);
}

/* ——— мастер планирования недели ——— */
body.is-planning .bottom-nav { display: none; }

#view-plan {
  padding-bottom: 24px;
}

.plan-step-label {
  margin: 0;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--latte);
}

#planBody {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 18px;
}

.plan-question {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 26px;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-wrap: balance;
}

.plan-question-small { font-size: 19px; }

.plan-sub {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--latte);
}

.plan-sub-line {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--latte);
}

.plan-label {
  margin: 0;
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--ink);
}

.plan-input {
  width: 100%;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--stone);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.plan-input::placeholder { color: var(--latte); }

.plan-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.plan-ring-row { display: flex; justify-content: center; }

/* колесо баланса — шаг 0 */
.wheel-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wheel-sphere-label {
  margin: 0 0 8px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 14px;
  color: var(--ink);
}

.wheel-scale {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.wheel-num {
  width: 28px;
  height: 28px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--latte);
  background: var(--paper);
  border: 1px solid var(--stone);
  border-radius: 50%;
  cursor: pointer;
}

.wheel-num.is-selected {
  background: var(--rose-deep);
  border-color: var(--rose-deep);
  color: var(--paper);
}

/* перенос задач прошлой недели — шаг 1 */
.carry-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.carry-row {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(27, 44, 54, 0.06);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.carry-title { font-family: var(--sans); font-size: 14.5px; color: var(--ink); }

.carry-btns { display: flex; gap: 8px; }

.carry-btn {
  flex: 1;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--stone);
  border-radius: 999px;
  padding: 8px 10px;
  cursor: pointer;
}

.carry-btn.is-selected {
  background: var(--rose-deep);
  border-color: var(--rose-deep);
  color: var(--paper);
}

.blocker-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.blocker-chip {
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--stone);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
}

.blocker-chip.is-selected {
  background: var(--rose-deep);
  border-color: var(--rose-deep);
  color: var(--paper);
}

/* по цели — шаг 2 (GROW) */
.plan-done-list {
  margin: 0;
  padding-left: 18px;
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--latte);
}

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

.will-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.will-tap {
  text-align: left;
  font-family: var(--sans);
  font-size: 14.5px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--stone);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
}

.will-tap:disabled { color: var(--latte); cursor: default; }

.will-tap.is-selected {
  background: var(--rose);
  border-color: var(--rose);
}

.smart-hint {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--rose-deep);
}

.will-day-picker {
  align-self: flex-start;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--stone);
  border-radius: 999px;
  padding: 6px 10px;
}

/* сферы без цели — шаг 3 */
.sphere-question-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* фокус и проверка — шаг 4 */
.plan-warning {
  margin: 0;
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--rose-deep);
}

.plan-collected-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.plan-collected-day-head {
  margin: 0 0 4px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--latte);
}

.plan-collected-list ul {
  margin: 0;
  padding-left: 18px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
}

/* навигация мастера */
.plan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.plan-back, .plan-close {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--latte);
  background: none;
  border: none;
  padding: 10px 0;
  cursor: pointer;
}

.btn-next {
  margin-left: auto;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15px;
  color: var(--paper);
  background: var(--ink);
  border: none;
  border-radius: var(--radius);
  padding: 13px 26px;
  cursor: pointer;
}
