:root {
  --bg: #111417;
  --panel: rgba(26, 32, 40, 0.82);
  --panel-border: rgba(255, 244, 224, 0.12);
  --text: #f4efe4;
  --muted: #cdbfa6;
  --primary: #f6b86c;
  --primary-strong: #ff9f43;
  --accent: #8cd0d5;
  --danger: #ea6f5a;
  --success: #73c8a9;
  --warning: #dcb35c;
  --shadow: 0 22px 50px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 28px;
  font-family: "Aptos", "Segoe UI Variable Text", "Trebuchet MS", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(140, 208, 213, 0.22), transparent 28%),
    radial-gradient(circle at top right, rgba(246, 184, 108, 0.2), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 35%),
    var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 244, 224, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 244, 224, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 80%);
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1220px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero,
.panel {
  border: 1px solid var(--panel-border);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: 26px;
  border-radius: 24px;
}

.hero__copy {
  max-width: 760px;
}

.hero h1,
.calendar-header h2,
#selectedDateLabel {
  font-family: "Georgia", "Times New Roman", serif;
  letter-spacing: 0.01em;
}

.hero h1 {
  margin: 6px 0 10px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 0.95;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.lede {
  margin: 0;
  max-width: 58ch;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--muted);
}

.hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.hero-chip {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 244, 224, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.9rem;
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.insight-card {
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 18px;
  background: rgba(26, 32, 40, 0.76);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.insight-card p {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.74rem;
}

.insight-card strong {
  display: block;
  margin-top: 10px;
  font-size: 1.45rem;
  color: var(--text);
}

.insight-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.92rem;
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 20px;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px;
  border-radius: 22px;
}

.panel__head,
.calendar-header,
.panel__footer,
.day-actions,
.preset-row__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel__head {
  flex-wrap: wrap;
}

.panel__head-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.calendar-header h2,
#selectedDateLabel {
  margin: 0;
  font-size: 1.75rem;
}

.form-inline {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-inline label {
  font-size: 0.78rem;
  color: var(--muted);
}

.form-inline input,
.add-task input {
  min-height: 46px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 244, 224, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
}

.form-inline input:focus-visible,
.add-task input:focus-visible,
.notes-input:focus-visible,
.btn:focus-visible,
.calendar-day:focus-visible,
.pill__remove:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.nav-buttons {
  display: flex;
  gap: 8px;
}

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

.calendar-days {
  gap: 8px;
  text-align: center;
  color: var(--muted);
  font-size: 0.84rem;
}

.calendar-grid {
  gap: 10px;
}

.calendar-day {
  position: relative;
  min-height: 68px;
  border-radius: 18px;
  border: 1px solid hsla(var(--day-hue, 10), 54%, var(--day-border-lightness, 56%), 0.8);
  background:
    linear-gradient(160deg, hsla(var(--day-hue, 10), 74%, var(--day-lightness, 88%), 0.28), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.12s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.calendar-day:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.25);
}

.calendar-day--today {
  border-color: rgba(140, 208, 213, 0.95);
  box-shadow: 0 0 0 1px rgba(140, 208, 213, 0.36);
}

.calendar-day--selected {
  border-color: rgba(246, 184, 108, 0.95);
  box-shadow: 0 0 0 1px rgba(246, 184, 108, 0.38);
}

.calendar-day--other-month {
  opacity: 0.36;
}

.calendar-day--empty {
  background:
    linear-gradient(160deg, rgba(234, 111, 90, 0.2), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.03);
  border-color: rgba(234, 111, 90, 0.45);
}

.calendar-day--partial {
  background:
    linear-gradient(160deg, rgba(220, 179, 92, 0.24), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.04);
}

.calendar-day--complete {
  background:
    linear-gradient(160deg, rgba(115, 200, 169, 0.28), rgba(140, 208, 213, 0.12)),
    rgba(255, 255, 255, 0.04);
  border-color: rgba(115, 200, 169, 0.8);
}

.calendar-day--flash {
  animation: pulse 0.8s ease;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(246, 184, 108, 0.45);
  }
  60% {
    transform: scale(1.03);
    box-shadow: 0 0 0 14px rgba(246, 184, 108, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(246, 184, 108, 0);
  }
}

.status {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 244, 224, 0.1);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.94rem;
}

.status--info {
  color: #f0d6af;
  border-color: rgba(246, 184, 108, 0.28);
}

.status--warning {
  color: #f5df9d;
  border-color: rgba(220, 179, 92, 0.42);
}

.status--success {
  color: #c9f6e5;
  border-color: rgba(115, 200, 169, 0.48);
}

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

.notes-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notes-input {
  min-height: 110px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 244, 224, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  line-height: 1.5;
  resize: vertical;
}

.task-row,
.empty-state {
  border-radius: 16px;
  border: 1px solid rgba(255, 244, 224, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

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

.task-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-strong);
}

.task-row__label {
  flex: 1;
}

.empty-state {
  padding: 24px 18px;
  text-align: center;
}

.empty-state p {
  margin: 0 0 6px;
  font-size: 1rem;
}

.empty-state span,
.subtle {
  color: var(--muted);
}

.subtle {
  margin: 0;
  font-size: 0.9rem;
}

.add-task {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.preset-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.preset-row__head {
  align-items: flex-start;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 244, 224, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.pill__remove {
  padding: 4px 8px;
  border: none;
  border-radius: 999px;
  background: rgba(234, 111, 90, 0.16);
  color: #ffd5ce;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}

.btn {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn--primary {
  color: #24170d;
  background: linear-gradient(135deg, var(--primary) 0%, #ffd59d 100%);
  box-shadow: 0 14px 30px rgba(246, 184, 108, 0.28);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 244, 224, 0.12);
}

.btn--outline {
  background: transparent;
  border-color: rgba(255, 244, 224, 0.18);
  color: var(--muted);
}

.hidden {
  display: none;
}

.day-actions {
  flex-direction: column;
  align-items: flex-end;
}

.task-meter {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  width: 120px;
}

.task-meter span {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.site-footer {
  margin-top: 22px;
  text-align: center;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 242, 220, 0.62);
}

@media (max-width: 1024px) {
  body {
    padding: 18px;
  }

  .insight-grid,
  .panel-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    flex-direction: column;
  }

  .hero__actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .panel,
  .hero {
    padding: 18px;
    border-radius: 18px;
  }

  .panel__head-group,
  .calendar-header,
  .preset-row__head {
    width: 100%;
  }

  .calendar-grid {
    gap: 8px;
  }

  .calendar-day {
    min-height: 56px;
    border-radius: 14px;
  }

  .add-task {
    grid-template-columns: 1fr;
  }

  .day-actions {
    width: 100%;
    align-items: flex-start;
  }
}
