:root {
  --paper: #f6f2e8;
  --surface: #fffdf7;
  --surface-strong: #ffffff;
  --ink: #1e2428;
  --muted: #68747c;
  --line: #ddd6c9;
  --teal: #196b6f;
  --teal-soft: #dff0eb;
  --coral: #c65d3e;
  --coral-soft: #f7e4dc;
  --gold: #af7c20;
  --gold-soft: #f5ead2;
  --green: #467348;
  --green-soft: #e3efdf;
  --violet: #695a93;
  --violet-soft: #ebe6f3;
  --blue: #3c667c;
  --blue-soft: #e2eef2;
  --shadow: 0 18px 40px rgba(31, 34, 36, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.hero {
  min-height: 330px;
  display: flex;
  align-items: flex-end;
  padding: 44px clamp(18px, 5vw, 72px);
  color: #fff;
  background:
    linear-gradient(90deg, rgba(18, 30, 34, 0.78), rgba(18, 30, 34, 0.32) 58%, rgba(18, 30, 34, 0.08)),
    url("assets/study-desk.png") center/cover no-repeat;
}

.hero__content {
  width: min(760px, 100%);
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.28);
}

.eyebrow {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow.dark {
  color: var(--teal);
}

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

h1 {
  max-width: 660px;
  margin-bottom: 12px;
  font-size: clamp(2.4rem, 6vw, 5rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 630px;
  margin-bottom: 22px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.05rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: min(720px, 100%);
}

.hero-stats div {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.hero-stats span {
  display: block;
  overflow-wrap: anywhere;
  font-size: 1.2rem;
  font-weight: 800;
}

.hero-stats small {
  display: block;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.76rem;
}

.workspace {
  width: min(1220px, calc(100% - 32px));
  margin: -24px auto 48px;
}

.toolbar,
.schedule-panel,
.side-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.96);
  box-shadow: var(--shadow);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  margin-bottom: 18px;
}

.day-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.day-tab {
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
}

.day-tab[aria-selected="true"] {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.day-tab.is-today {
  box-shadow: inset 0 -3px 0 var(--gold);
}

.alarm-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.primary-button,
.ghost-button {
  min-height: 42px;
  padding: 9px 13px;
  border-radius: 8px;
  font-weight: 800;
}

.primary-button {
  border: 1px solid var(--teal);
  background: var(--teal);
  color: #fff;
}

.primary-button.is-on {
  border-color: var(--green);
  background: var(--green);
}

.ghost-button {
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--ink);
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 18px;
  align-items: start;
}

.schedule-panel {
  padding: 18px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.section-heading h2,
.next-alarm h2 {
  margin-bottom: 4px;
  font-size: 2rem;
  line-height: 1.1;
}

.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
}

.progress-box {
  width: 170px;
  flex: 0 0 auto;
  text-align: right;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.85rem;
}

.progress-track {
  height: 8px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7e0d4;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
  transition: width 0.2s ease;
}

.schedule-list {
  display: grid;
  gap: 10px;
  padding-top: 16px;
}

.daily-notes {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.notes-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.notes-heading h3 {
  margin-bottom: 0;
  font-size: 1.12rem;
}

.notes-status {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 900;
}

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

.note-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
}

.note-field textarea {
  width: 100%;
  min-height: 136px;
  resize: vertical;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: var(--surface-strong);
  color: var(--ink);
  line-height: 1.45;
}

.note-field textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(25, 107, 111, 0.15);
}

.note-clear {
  margin-top: 12px;
}

.schedule-item {
  --accent: var(--teal);
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 44px;
  gap: 14px;
  align-items: center;
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: var(--surface-strong);
}

.schedule-item.is-active {
  outline: 3px solid rgba(25, 107, 111, 0.18);
  background: #fffaf0;
}

.schedule-item[data-kind="break"] {
  --accent: var(--gold);
}

.schedule-item[data-kind="twk"] {
  --accent: var(--coral);
}

.schedule-item[data-kind="tkp"] {
  --accent: var(--green);
}

.schedule-item[data-kind="verbal"] {
  --accent: var(--violet);
}

.schedule-item[data-kind="figural"] {
  --accent: var(--blue);
}

.schedule-item[data-kind="review"] {
  --accent: #7a6044;
}

.schedule-item[data-kind="recovery"] {
  --accent: #4f6f56;
  background: #fbfff8;
}

.time-block {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 900;
}

.time-block span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.slot-title {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.subject {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.slot-events {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.event-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 7px;
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.event-chip.pickup {
  background: var(--coral-soft);
  color: var(--coral);
}

.event-chip.bath {
  background: var(--blue-soft);
  color: var(--blue);
}

.done-check {
  width: 32px;
  height: 32px;
  border: 2px solid var(--line);
  border-radius: 8px;
  appearance: none;
  background: var(--surface);
  position: relative;
}

.done-check:checked {
  border-color: var(--green);
  background: var(--green);
}

.done-check:checked::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 10px;
  width: 8px;
  height: 14px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.side-panel {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.side-panel section + section {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.next-alarm p {
  margin-bottom: 10px;
  color: var(--muted);
}

.countdown {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--gold-soft);
  color: #7a520f;
  font-weight: 900;
}

.side-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.side-heading h3,
.side-panel h3 {
  margin-bottom: 10px;
  font-size: 1rem;
}

.side-heading span {
  min-width: 30px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 900;
}

.reminder-list {
  display: grid;
  gap: 8px;
}

.reminder {
  display: grid;
  grid-template-columns: 55px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.reminder strong {
  color: var(--teal);
  font-size: 0.88rem;
}

.reminder span {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

.priority-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.priority-list span,
.coverage-grid span {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--green-soft);
  color: #365e38;
  font-size: 0.82rem;
  font-weight: 900;
}

.coverage-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.coverage-grid span:nth-child(2n) {
  background: var(--violet-soft);
  color: var(--violet);
}

.coverage-grid span:nth-child(3n) {
  background: var(--coral-soft);
  color: var(--coral);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(360px, calc(100% - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #162225;
  color: #fff;
  box-shadow: var(--shadow);
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .dashboard {
    grid-template-columns: 1fr;
  }

  .side-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .side-panel section + section {
    padding-top: 0;
    border-top: 0;
  }
}

@media (max-width: 760px) {
  .hero {
    min-height: 360px;
    padding: 32px 18px;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .workspace {
    width: min(100% - 20px, 1220px);
    margin-top: -16px;
  }

  .toolbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .alarm-actions {
    justify-content: stretch;
  }

  .alarm-actions button,
  .day-tab {
    flex: 1 1 auto;
  }

  .progress-box {
    width: 100%;
    text-align: left;
  }

  .schedule-item {
    grid-template-columns: 1fr 42px;
    gap: 10px;
  }

  .time-block {
    grid-column: 1 / -1;
  }

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

  .notes-heading,
  .notes-grid {
    grid-template-columns: 1fr;
  }

  .notes-heading {
    flex-direction: column;
    align-items: stretch;
  }

  .note-clear {
    width: 100%;
  }
}
