:root {
  --ink: #263238;
  --muted: #697684;
  --paper: #fffdf7;
  --line: #e5ddcf;
  --sky: #bfe8ff;
  --sky-dark: #2379aa;
  --mint: #c8f7dc;
  --sun: #ffe28a;
  --rose: #ffc9dd;
  --lav: #dccbff;
  --shadow: 0 18px 45px rgba(38, 50, 56, 0.16);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Trebuchet MS", "Comic Sans MS", system-ui, sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 15%, rgba(255, 226, 138, .55), transparent 28%),
    radial-gradient(circle at 85% 8%, rgba(191, 232, 255, .8), transparent 30%),
    linear-gradient(135deg, #fff7dc, #eaf7ff 55%, #fff0f6);
}

button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 4px solid rgba(35, 121, 170, .3);
  outline-offset: 3px;
}

.app-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 26px;
  border: 4px solid var(--ink);
  border-radius: 34px;
  background: rgba(255, 253, 247, .86);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--sky-dark);
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 6vw, 4.5rem); line-height: .92; margin-bottom: 12px; }
h2 { font-size: 1.25rem; margin-bottom: 12px; }
.hero-copy { max-width: 54ch; margin-bottom: 0; color: #49545f; font-size: 1.1rem; }
.mascot { font-size: clamp(3rem, 9vw, 7rem); filter: drop-shadow(0 8px 0 rgba(0,0,0,.08)); }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 22px 0;
}

.pill-btn, .ghost-btn, .primary-btn {
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 900;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 5px 0 rgba(38, 50, 56, .22);
}
.pill-btn:hover, .ghost-btn:hover, .primary-btn:hover { transform: translateY(-1px); }
.pill-btn:active, .ghost-btn:active, .primary-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(38, 50, 56, .22); }
.primary-btn { width: 100%; background: var(--sun); }
.danger { background: #ffe4e4; }

.month-card {
  min-width: 250px;
  text-align: center;
  padding: 10px 18px;
  border-radius: 22px;
  background: var(--paper);
  border: 3px dashed var(--sky-dark);
}
.month-card strong { display: block; font-size: 1.35rem; }
.month-card span { color: var(--muted); font-size: .92rem; }

.planner-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 22px;
  align-items: start;
}

.calendar-card, .side-panel > * {
  background: rgba(255, 253, 247, .92);
  border: 4px solid var(--ink);
  border-radius: 28px;
  box-shadow: var(--shadow);
}
.calendar-card { padding: 16px; }

.weekday-row, .calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}
.weekday-row span {
  text-align: center;
  padding: 8px;
  font-weight: 900;
  color: var(--sky-dark);
}

.day-cell {
  min-height: 118px;
  padding: 8px;
  border: 3px solid var(--line);
  border-radius: 20px;
  background: #fff;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.day-cell:hover { transform: translateY(-2px); border-color: var(--sky-dark); }
.day-cell.selected { background: #effaff; border-color: var(--sky-dark); box-shadow: inset 0 0 0 3px var(--sky); }
.day-cell.today .day-number { background: var(--sun); }
.day-cell.outside { opacity: .36; }
.day-number {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-weight: 900;
  background: var(--paper);
}
.day-summary { display: flex; flex-wrap: wrap; gap: 4px; }
.mini-activity {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 4px 7px;
  border: 2px solid rgba(38,50,56,.2);
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-activity.blue, .activity-item.blue { background: var(--sky); }
.mini-activity.green, .activity-item.green { background: var(--mint); }
.mini-activity.yellow, .activity-item.yellow { background: var(--sun); }
.mini-activity.pink, .activity-item.pink { background: var(--rose); }
.mini-activity.purple, .activity-item.purple { background: var(--lav); }
.more-count { font-weight: 900; color: var(--muted); font-size: .8rem; }

.side-panel { display: grid; gap: 18px; }
.side-panel > * { padding: 18px; }
.selected-day-card { background: var(--sky) !important; }
.tiny-label { display: block; font-size: .78rem; color: #41515c; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
#selectedDayLabel { font-size: 1.35rem; }

.activity-form label { display: grid; gap: 6px; margin-bottom: 12px; font-weight: 900; }
.activity-form input, .activity-form select {
  width: 100%;
  border: 3px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: #fff;
  color: var(--ink);
}

.idea-box { background: #fff5c7 !important; }
.idea-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.idea-buttons button {
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  padding: 8px 10px;
  font-weight: 900;
}

.day-list ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.activity-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  border: 3px solid rgba(38,50,56,.22);
  border-radius: 18px;
  padding: 8px;
  font-weight: 900;
}
.activity-item.done .activity-text { text-decoration: line-through; opacity: .65; }
.check-btn, .delete-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: #fff;
  font-weight: 900;
}
.delete-btn { background: #ffe4e4; }
.empty-state { color: var(--muted); margin-bottom: 0; }

@media (max-width: 900px) {
  .planner-layout { grid-template-columns: 1fr; }
  .side-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .day-list { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .app-shell { width: min(100% - 16px, 1180px); padding-top: 10px; }
  .hero { border-radius: 24px; padding: 18px; }
  .mascot { display: none; }
  .calendar-card { padding: 10px; }
  .weekday-row, .calendar-grid { gap: 5px; }
  .weekday-row span { font-size: .75rem; padding: 4px 0; }
  .day-cell { min-height: 84px; border-radius: 14px; padding: 5px; border-width: 2px; }
  .day-number { width: 26px; height: 26px; font-size: .82rem; }
  .mini-activity { font-size: .68rem; padding: 2px 5px; }
  .side-panel { grid-template-columns: 1fr; }
  .toolbar { gap: 8px; }
  .pill-btn, .ghost-btn { padding: 10px 12px; }
}

@media print {
  body { background: #fff; }
  .toolbar, .activity-form, .idea-box { display: none !important; }
  .app-shell { width: 100%; padding: 0; }
  .hero, .calendar-card, .side-panel > * { box-shadow: none; }
  .planner-layout { grid-template-columns: 1fr; }
  .side-panel { display: none; }
  .day-cell { break-inside: avoid; min-height: 110px; }
}
