:root {
  --cream: #f6f3ec;
  --ink: #1f1c17;
  --ink-60: rgba(31, 28, 23, 0.6);
  --ink-20: rgba(31, 28, 23, 0.2);
  --accent: #1e6f5c;
  --accent-2: #c9e6dd;
  --card: #fbfaf7;
  --shadow: 0 10px 30px rgba(31, 28, 23, 0.12);
}

.bg-cream { background: var(--cream); }
.text-ink { color: var(--ink); }
.text-ink-60 { color: var(--ink-60); }

.card {
  background: var(--card);
  border: 1px solid var(--ink-20);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.btn,
.btn-primary,
.btn-icon {
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease, color 120ms ease;
}

.btn {
  border: 1px solid var(--ink-20);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  background: white;
}

.btn-primary {
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  background: var(--accent);
  color: white;
}

.btn-disabled {
  border: 1px solid var(--ink-20);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  background: #f4f2ed;
  color: var(--ink-60);
}

.btn:active,
.btn-primary:active,
.btn-icon:active {
  transform: scale(0.96);
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--ink-20);
  display: grid;
  place-items: center;
  font-size: 14px;
  background: white;
}

.sync-indicator {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.35;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.sync-indicator svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: rgba(31, 28, 23, 0.65);
  stroke-width: 1.6;
}

.sync-indicator.syncing {
  opacity: 0.9;
  transform: translateY(-1px);
}

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

.input {
  border: 1px solid var(--ink-20);
  border-radius: 12px;
  padding: 8px 10px;
  background: white;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  font-size: 11px;
  color: var(--ink-60);
}

.calendar-weekdays > div {
  text-align: center;
}

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

.calendar-cell {
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  border: 1px solid var(--ink-20);
  background: white;
  display: grid;
  place-items: center;
  font-size: 11px;
  line-height: 1;
  color: var(--ink);
  position: relative;
}

.calendar-cell .day {
  font-size: 10px;
  color: var(--ink-60);
}

.calendar-cell[data-level="0"] { background: #fff; }
.calendar-cell[data-level="1"] { background: #f0f7f4; }
.calendar-cell[data-level="2"] { background: #dbeee7; }
.calendar-cell[data-level="3"] { background: #bfe1d5; }

.calendar-cell[data-today="true"] {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.calendar-cell.empty {
  background: transparent;
  border-color: transparent;
}

.habit-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--ink-20);
  border-radius: 14px;
  padding: 10px 12px;
  background: white;
  cursor: pointer;
}

.habit-row.done {
  background: #ecf6f2;
  border-color: #cfe7de;
}

.habit-row.done .habit-icon {
  background: #a9d6c7;
}

.habit-row .btn,
.habit-row .btn-disabled {
  cursor: pointer;
}

.habit-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-2);
  font-size: 16px;
}

.habit-meta {
  font-size: 12px;
  color: var(--ink-60);
}

.habit-reminder-text {
  font-size: 12px;
  color: var(--ink-60);
  margin-top: 2px;
}

.dialog::backdrop {
  background: rgba(31, 28, 23, 0.35);
  backdrop-filter: blur(2px);
}

.dialog-card {
  width: min(92vw, 380px);
  border-radius: 20px;
  border: 1px solid rgba(31, 28, 23, 0.08);
  padding: 18px;
  background: white;
  box-shadow: 0 24px 60px rgba(31, 28, 23, 0.18);
}
