:root {
  color-scheme: dark;
  --bg: #0b0f14;
  --bg-soft: #121820;
  --ink: #f0f4f8;
  --muted: #8a949e;
  --line: #2d3748;
  --panel: #161e2a;
  --panel-strong: #1c2636;
  --field: #0d121b;
  --orange: #f27a39;
  --yellow: #f2c35d;
  --red: #e04f3f;
  --accent: var(--orange);
  --danger: #ff6b6b;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(242, 122, 57, 0.12), transparent 40rem),
    linear-gradient(180deg, var(--bg-soft), var(--bg) 32rem);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

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

.sticky-wrapper {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  padding-top: 10px;
  margin-bottom: 16px;
}

.topbar,
.summary,
.controls,
.day {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(242, 122, 57, 0.08), transparent 36%),
    var(--panel-strong);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--orange);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.6rem, 3vw, 2.8rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  white-space: nowrap;
}

button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--orange), var(--yellow));
  color: #0b0f14;
  cursor: pointer;
  min-height: 40px;
  padding: 0 16px;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(242, 122, 57, 0.22);
  transition:
    transform 140ms ease,
    filter 140ms ease;
  text-decoration: none;
}

button:hover,
.button-link:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

button:focus-visible,
.button-link:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

button.secondary,
.button-link.secondary {
  background: var(--panel-strong);
  color: var(--ink);
  box-shadow: none;
  border: 1px solid var(--line);
}

.summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 16px 0;
  overflow: hidden;
}

.summary div {
  padding: 18px;
  border-right: 1px solid var(--line);
}

.summary div:last-child {
  border-right: 0;
}

.summary span {
  display: block;
  font-size: 1.7rem;
  font-weight: 900;
}

.summary small {
  color: var(--muted);
  font-weight: 700;
}

.controls {
  display: grid;
  grid-template-columns: 1fr 180px 150px;
  gap: 10px;
  padding: 12px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
  color: var(--ink);
  min-height: 42px;
  padding: 0 12px;
}

input::placeholder,
textarea::placeholder {
  color: #6f7f7a;
}

.progress-track {
  height: 12px;
  margin: 16px 0 24px;
  background: #1a2530;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #283542;
}

#progressBar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--orange), var(--yellow), var(--red));
  transition: width 180ms ease;
}

.weeks {
  display: grid;
  gap: 18px;
}

.week {
  display: grid;
  gap: 12px;
}

.week-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.week-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--orange);
}

.week-header p {
  margin: 5px 0 0;
  color: var(--muted);
}

.week-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.collapse-week {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  font-size: 1.15rem;
  line-height: 1;
  background: var(--panel-strong);
  color: var(--ink);
  box-shadow: none;
  border: 1px solid var(--line);
}

.week.collapsed {
  gap: 0;
}

.week.collapsed .days {
  display: none;
}

.days {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}

.day {
  padding: 14px;
  background: linear-gradient(180deg, var(--panel), #0f171f);
  transition: border-color 200ms ease;
}

.day.all-done {
  border-color: var(--orange);
}

.day-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  cursor: pointer;
}

.day h3 {
  margin-bottom: 3px;
  font-size: 1rem;
  color: var(--orange);
}

.day-content {
  display: block;
}

.day.collapsed .day-content {
  display: none;
}

.day.collapsed .day-head {
  margin-bottom: 0;
}

.day-toggle-icon {
  display: inline-block;
  transition: transform 200ms ease;
  color: var(--muted);
}

.day.collapsed .day-toggle-icon {
  transform: rotate(-90deg);
}

.day small,
.empty {
  color: var(--muted);
}

.task {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 9px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.task input[type="checkbox"] {
  width: 20px;
  min-height: 20px;
  accent-color: var(--orange);
}

.task-title {
  display: block;
  line-height: 1.35;
}

mark {
  background: rgba(242, 122, 57, 0.35);
  color: var(--ink);
  padding: 0 2px;
  border-radius: 2px;
}

.task.done .task-title {
  color: var(--muted);
  text-decoration: line-through;
}

.notes-toggle {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--yellow);
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  min-height: auto;
  box-shadow: none;
  font-weight: 500;
}

.notes-toggle:hover {
  text-decoration: underline;
  transform: none;
}

.notes {
  margin-top: 7px;
  min-height: 34px;
  padding: 8px 10px;
  resize: vertical;
  display: none;
}

.notes.visible {
  display: block;
}

.error {
  border-color: rgba(255, 138, 120, 0.5);
  color: var(--danger);
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 10px;
  }

  .topbar,
  .status,
  .week-header,
  .day-head {
    align-items: stretch;
    flex-direction: column;
  }

  .week-actions {
    align-items: stretch;
  }

  .summary,
  .controls {
    grid-template-columns: 1fr 1fr;
  }

  .summary div:nth-child(2) {
    border-right: 0;
  }

  .summary div:nth-child(1),
  .summary div:nth-child(2) {
    border-bottom: 1px solid var(--line);
  }

  .controls input {
    grid-column: 1 / -1;
  }
}
