:root {
  --bg: #fdf7fc;
  --bg-2: #f8eff8;
  --card: #ffffff;
  --card-soft: #f6edf7;
  --text: #4b3b52;
  --muted: #8f7b96;
  --accent: #b784c6;
  --accent-strong: #9f6bb1;
  --accent-soft: #ead9ef;
  --today: #d9b8e6;
  --selected: #efe3f4;
  --success: #b78fc6;
  --danger: #d8b0c8;
  --border: #eaddea;
  --shadow: 0 10px 24px rgba(183, 132, 198, 0.14);
  --radius: 22px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--text);
}

body {
  display: flex;
  justify-content: center;
}

.app {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  padding: 18px 14px 28px;
}

.topbar {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.nav-arrow {
  height: 42px;
  width: 42px;
  border: none;
  border-radius: 14px;
  background: rgba(183, 132, 198, 0.12);
  color: var(--accent-strong);
  font-size: 28px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.days-window {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  touch-action: pan-y;
}

.day-card {
  background: rgba(255,255,255,0.82);
  border-radius: 18px;
  padding: 10px 6px;
  text-align: center;
  transition: 0.2s ease;
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: 0 6px 18px rgba(183, 132, 198, 0.08);
}

.day-card.center {
  transform: scale(1.03);
}

.day-card.today {
  background: linear-gradient(180deg, #f3e3f8 0%, #edd5f4 100%);
  border-color: #d8b5e2;
}

.day-card.selected-not-today {
  background: #f8f0fa;
  border-color: #e3cde9;
}

.day-card.center.today {
  background: linear-gradient(180deg, #ebd2f3 0%, #dfbee9 100%);
  border-color: #cfa6dc;
  box-shadow: 0 10px 24px rgba(183, 132, 198, 0.18);
}

.day-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: inherit;
}

.day-date {
  font-size: 13px;
  margin-top: 6px;
  font-weight: 600;
  color: inherit;
}

.content {
  margin-top: 20px;
}

.day-title-wrap {
  margin-bottom: 18px;
  padding-left: 4px;
}

.day-title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--accent-strong);
}

.day-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.habit-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.habit-card {
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  box-shadow: var(--shadow);
}

.habit-name {
  font-size: 17px;
  font-weight: 700;
  word-break: break-word;
  color: var(--text);
}

.status-toggle {
  display: inline-flex;
  align-items: center;
  background: var(--card-soft);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
  border: 1px solid var(--border);
}

.status-btn {
  border: none;
  min-width: 40px;
  height: 40px;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 900;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: 0.15s ease;
}

.status-btn.active.minus {
  background: linear-gradient(180deg, #f9c5d5 0%, #f4a7bc 100%);
  color: #7a2e4a;
  box-shadow: 0 4px 10px rgba(244, 167, 188, 0.45);
}

/* PLUS — ZROBIONE */
.status-btn.active.plus {
  background: linear-gradient(180deg, #d6b3e6 0%, #b784c6 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(183, 132, 198, 0.5);
}

/* efekt kliknięcia */
.status-btn:active {
  transform: scale(0.92);
}

.empty-state {
  padding: 28px 18px;
  text-align: center;
  color: var(--muted);
  background: rgba(255,255,255,0.72);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.add-btn {
  width: 100%;
  margin-top: 16px;
  height: 54px;
  border: none;
  border-radius: 20px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: white;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(183, 132, 198, 0.24);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(120, 90, 130, 0.24);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 430px;
  background: #fffafd;
  border-radius: 24px;
  padding: 18px;
  box-shadow: 0 16px 40px rgba(183, 132, 198, 0.22);
  border: 1px solid var(--border);
}

.modal-card h2 {
  margin: 0 0 14px;
  font-size: 20px;
  color: var(--accent-strong);
}

.modal-card input {
  width: 100%;
  height: 52px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 16px;
  padding: 0 14px;
  font-size: 16px;
  outline: none;
}

.modal-card input:focus {
  border-color: #cfaddb;
  box-shadow: 0 0 0 4px rgba(183, 132, 198, 0.12);
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.btn-primary,
.btn-secondary {
  height: 48px;
  border: none;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: white;
}

.btn-secondary {
  background: #f6edf7;
  color: var(--accent-strong);
  border: 1px solid var(--border);
}

@media (max-width: 360px) {
  .day-name {
    font-size: 11px;
  }

  .day-date {
    font-size: 11px;
  }
}