:root {
  --bg: #f4efe8;
  --surface: rgba(255, 252, 247, 0.78);
  --line: rgba(53, 38, 29, 0.12);
  --text: #1f1712;
  --muted: #7a6658;
  --accent: #b55d3d;
  --shadow: 0 18px 40px rgba(63, 39, 22, 0.08);
}

body[data-theme="soft"] {
  --bg: #f4f1ed;
  --surface: rgba(255, 253, 250, 0.98);
  --line: rgba(124, 105, 91, 0.14);
  --text: #2a2420;
  --muted: #85756b;
  --accent: #8f7d72;
  --shadow: 0 14px 28px rgba(61, 47, 38, 0.08);
}

body[data-theme="journal"] {
  --bg: #ebe1d1;
  --surface: rgba(251, 246, 238, 0.9);
  --line: rgba(95, 70, 48, 0.16);
  --text: #2e2319;
  --muted: #7e6857;
  --accent: #9e5c35;
  --shadow: 0 14px 28px rgba(72, 49, 29, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Inter, Roboto, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.7), transparent 28%),
    linear-gradient(180deg, #f8f3ed 0%, var(--bg) 100%);
}

.page-shell {
  width: min(100%, calc(100% - 28px));
  margin: 0 auto;
  padding: 36px 0 56px;
}

.page-header {
  margin-bottom: 28px;
}

.page-header h1 {
  margin: 0;
  font-size: clamp(1.45rem, 2.6vw, 1.9rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-align: center;
}

.page-kicker {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
}

.calendar-grid {
  display: grid;
  gap: 0;
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

body[data-theme="soft"] .calendar-grid {
  width: min(100%, 390px);
  gap: 12px;
  padding: 0;
  border: 0;
}

body[data-theme="soft"] .day-card {
  padding: 19px 22px 18px;
  border: 1px solid rgba(124, 105, 91, 0.12);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.48), transparent 42%),
    rgba(255, 253, 250, 0.98);
  box-shadow: 0 10px 22px rgba(61, 47, 38, 0.07);
}

body[data-theme="soft"] .day-card:last-child {
  border-bottom: 1px solid rgba(124, 105, 91, 0.12);
}

body[data-theme="soft"] .day-card:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 14px 24px rgba(61, 47, 38, 0.1);
}

body[data-theme="soft"] .day-title {
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

body[data-theme="soft"] .day-date {
  color: #5d4b40;
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.25;
}

body[data-theme="soft"] .day-card-text {
  gap: 7px;
}

body[data-theme="soft"] .day-date::after {
  content: "";
  display: block;
  width: 34px;
  height: 1px;
  margin-top: 8px;
  background: rgba(143, 125, 114, 0.35);
}

body[data-theme="soft"] .day-card.is-complete {
  background:
    linear-gradient(180deg, rgba(230, 236, 232, 0.72), transparent 45%),
    #eef2ef;
  border-color: rgba(109, 135, 118, 0.22);
  opacity: 1;
  box-shadow: 0 8px 18px rgba(66, 87, 74, 0.08);
}

body[data-theme="soft"] .day-card.is-complete .day-title {
  color: #5f7668;
}

body[data-theme="soft"] .day-card.is-complete .day-date {
  color: #7a9084;
}

body[data-theme="soft"] .day-card.is-complete .day-date::after {
  background: rgba(95, 118, 104, 0.35);
}

.day-complete-mark {
  display: none;
  align-self: center;
  justify-self: end;
  min-width: 30px;
  height: 30px;
  border-radius: 9999px;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
}

body[data-theme="soft"] .day-card.is-complete .day-complete-mark {
  display: inline-flex;
  background: rgba(95, 118, 104, 0.14);
  color: #5f7668;
}

body[data-theme="journal"] .calendar-grid {
  width: min(100%, 500px);
  padding: 0;
  border-top: 0;
  border-bottom: 0;
}

body[data-theme="journal"] .day-card {
  padding: 20px 0;
  border-bottom: 1px dashed var(--line);
}

body[data-theme="journal"] .day-card:hover {
  transform: translateX(6px);
}

body[data-theme="journal"] .day-title {
  font-size: 1.35rem;
}

body[data-theme="journal"] .day-date {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.day-card {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  padding: 18px 6px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  transition: transform 0.18s ease, color 0.18s ease, opacity 0.18s ease;
  cursor: pointer;
}

.day-card:last-child {
  border-bottom: 0;
}

.day-card-text {
  display: grid;
  gap: 4px;
}

.day-card:hover {
  transform: translateX(4px);
}

.day-card.is-complete {
  opacity: 0.46;
}

.day-remaining {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
}

.day-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text);
}

.day-date {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.25;
}

@media (max-width: 780px) {
  .page-shell {
    width: min(100% - 18px, 100%);
    padding-top: 24px;
  }

  .calendar-grid {
    width: 100%;
    padding: 6px 0;
  }

  .day-title {
    font-size: 1.3rem;
  }

  .day-date {
    font-size: 0.9rem;
  }

  .page-header {
    margin-bottom: 22px;
  }

  .page-header h1 {
    font-size: clamp(1.35rem, 6vw, 1.7rem);
  }

  body[data-theme="soft"] .calendar-grid,
  body[data-theme="journal"] .calendar-grid {
    width: 100%;
  }

  body[data-theme="soft"] .day-card {
    padding: 18px 18px 17px;
  }

  body[data-theme="soft"] .day-title {
    font-size: 1.18rem;
  }

  body[data-theme="soft"] .day-date {
    font-size: 0.9rem;
  }

  .day-card {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .day-remaining {
    font-size: 0.76rem;
  }
}
