:root {
  color-scheme: light;
  --bg: #eaf1f6;
  --panel: #fbfdff;
  --panel-soft: #d7e5ef;
  --ink: #0b1726;
  --muted: #557086;
  --line: #cfdde8;
  --purple: #155a8a;
  --purple-dark: #0d2538;
  --lavender: #d8aa35;
  --mint: #6fb7a8;
  --rose: #d96c4a;
  --gold: #d8aa35;
  --shadow: 0 22px 60px rgba(13, 37, 56, 0.14);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(216, 170, 53, 0.2), transparent 30rem),
    radial-gradient(circle at 80% 40%, rgba(21, 90, 138, 0.12), transparent 36rem),
    var(--bg);
  color: var(--ink);
  overflow-x: hidden;
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 16rem minmax(0, 1fr);
  width: 100%;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  border-right: 1px solid rgba(13, 37, 56, 0.08);
  background: rgba(251, 253, 255, 0.62);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  display: grid;
  width: 2.8rem;
  height: 2.8rem;
  place-items: center;
  border-radius: 1rem;
  background: var(--purple);
  color: white;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  font-weight: 700;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  margin-top: 0.15rem;
}

.nav-list {
  display: grid;
  gap: 0.35rem;
}

.nav-item,
.ghost-button,
.filter-pill {
  border: 0;
  border-radius: 999px;
  padding: 0.72rem 1rem;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.nav-item {
  text-align: left;
}

.nav-item.active,
.filter-pill.active {
  background: var(--purple);
  color: white;
  box-shadow: 0 12px 24px rgba(21, 90, 138, 0.22);
}

.ghost-button {
  margin-top: auto;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
}

.workspace {
  width: min(100%, 76rem);
  padding: 2.5rem clamp(1rem, 4vw, 3.2rem) 4rem;
  overflow-x: hidden;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: rise 260ms ease;
}

.hero-grid,
.section-heading,
.calendar-toolbar,
.dialog-heading,
.focus-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.greeting,
.fresh-line,
.focus-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 1.25rem;
}

h1,
h2,
.word-card h2,
.timer-ring strong {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0;
}

h1 {
  margin: 0.35rem 0 0.7rem;
  font-size: clamp(2.35rem, 5vw, 4.7rem);
  line-height: 0.95;
}

.section-heading h1,
.focus-heading h1 {
  font-size: clamp(2.15rem, 4vw, 3.6rem);
}

.sparkle {
  color: var(--gold);
  font-size: 4rem;
}

.word-card,
.mood-panel,
.quote-card,
.day-agenda,
.compose-dialog form,
.timer-card,
.mini-calendar,
.ambient-grid button {
  background: rgba(251, 253, 255, 0.92);
  border: 1px solid rgba(13, 37, 56, 0.06);
  border-radius: 1.65rem;
  box-shadow: var(--shadow);
}

.word-card {
  margin-top: 1.8rem;
  padding: 1.5rem 1.8rem;
  background: var(--purple-dark);
  color: white;
}

.word-card p,
.mood-panel h2,
.ambient-panel h2 {
  margin: 0 0 0.8rem;
  color: var(--lavender);
  font-size: 0.86rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.word-card h2 {
  margin: 0;
  font-size: 2rem;
}

.word-card blockquote {
  margin: 0.4rem 0 0;
  color: #d8cce8;
  font-size: 1.08rem;
  font-style: italic;
}

.quote-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1rem 1.2rem;
}

.quote-card p {
  margin: 0;
  color: var(--purple-dark);
  font-weight: 700;
}

.mood-panel {
  margin-top: 1.5rem;
  padding: 1.35rem 1.5rem;
}

.mood-row,
.stats-grid,
.ambient-grid {
  display: grid;
  gap: 0.9rem;
}

.mood-row {
  grid-template-columns: repeat(5, minmax(5.8rem, 1fr));
}

.mood-button {
  border: 0;
  border-radius: 1rem;
  padding: 0.85rem 0.5rem;
  background: transparent;
  color: var(--muted);
}

.mood-button strong,
.mood-button span {
  display: block;
}

.mood-button strong {
  font-size: 1.8rem;
  line-height: 1;
}

.mood-button.active {
  background: #dbeaf4;
  color: var(--purple);
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 1.5rem;
}

.stat-card {
  min-height: 8.2rem;
  padding: 1.25rem;
  display: grid;
  place-items: center;
  border-radius: 1.1rem;
  background: var(--panel-soft);
  color: var(--purple);
}

.stat-card strong {
  color: var(--ink);
  font-size: 2rem;
}

.stat-card small {
  color: var(--muted);
}

.add-button,
.play-button {
  display: grid;
  width: 3.3rem;
  height: 3.3rem;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--purple);
  color: white;
  font-size: 2rem;
  line-height: 1;
  box-shadow: 0 16px 28px rgba(21, 90, 138, 0.24);
}

.filter-row,
.duration-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 1.3rem 0 1.7rem;
}

.task-list {
  display: grid;
  gap: 0.75rem;
}

.empty-state {
  min-height: 14rem;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.85rem;
  padding: 2rem;
  border: 1px dashed #cdbedc;
  border-radius: 1.4rem;
  background: rgba(251, 253, 255, 0.62);
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.8rem;
}

.empty-state p {
  max-width: 25rem;
  margin: 0;
  line-height: 1.5;
}

.task-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  min-height: 5rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-left: 0.3rem solid var(--rose);
  border-radius: 1.1rem;
  background: rgba(245, 249, 252, 0.86);
}

.task-check {
  width: 1.35rem;
  height: 1.35rem;
  border: 2px solid #83758f;
  border-radius: 50%;
  background: transparent;
}

.task-item.completed {
  opacity: 0.58;
}

.task-item.completed .task-check {
  background: var(--purple);
  box-shadow: inset 0 0 0 0.25rem white;
}

.task-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.task-meta {
  margin-top: 0.28rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.task-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
}

.icon-button {
  display: grid;
  width: 2.45rem;
  height: 2.45rem;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #dfeaf2;
  color: var(--purple);
  font-size: 1.35rem;
}

.calendar-toolbar {
  max-width: 45rem;
  margin: 1.2rem 0;
}

.weekday-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  max-width: 45rem;
  gap: 0.35rem;
}

.weekday-row {
  margin-bottom: 0.6rem;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.calendar-day {
  min-height: 4.7rem;
  border: 0;
  border-radius: 1.15rem;
  background: transparent;
  color: var(--ink);
}

.calendar-day.outside {
  color: #bbb1c4;
}

.calendar-day.has-items {
  background: #d9e8f4;
}

.calendar-day.selected,
.calendar-day.today {
  background: var(--purple);
  color: white;
}

.event-dot {
  display: block;
  width: 0.3rem;
  height: 0.3rem;
  margin: 0.45rem auto 0;
  border-radius: 50%;
  background: currentColor;
}

.day-agenda {
  max-width: 45rem;
  margin-top: 1.4rem;
  padding: 1.3rem;
}

.day-agenda h2 {
  margin: 0 0 0.8rem;
}

.agenda-item {
  padding: 0.65rem 0;
  border-top: 1px solid var(--line);
}

.focus-stage {
  min-height: 29rem;
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) minmax(18rem, 1.1fr);
  align-items: center;
  gap: 2rem;
}

.mini-calendar {
  padding: 1.2rem;
  transform: scale(0.92);
  transform-origin: left center;
}

.timer-card {
  display: grid;
  justify-items: center;
  gap: 1.7rem;
  padding: 2rem;
  background: transparent;
  box-shadow: none;
  border: 0;
}

.timer-ring {
  display: grid;
  width: 16rem;
  height: 16rem;
  place-items: center;
  align-content: center;
  border: 0.55rem solid #e9e4ee;
  border-radius: 50%;
}

.timer-ring strong {
  font-size: 2.4rem;
}

.timer-ring span {
  color: var(--muted);
}

.timer-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.play-button {
  width: 4rem;
  height: 4rem;
  font-size: 2rem;
}

.ambient-panel h2 {
  color: var(--muted);
}

.ambient-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ambient-grid button {
  min-height: 5.7rem;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--muted);
  background: rgba(251, 253, 255, 0.86);
}

.ambient-grid button.active-sound {
  border-color: var(--gold);
  background: #fff7df;
  color: var(--ink);
}

.ambient-grid span {
  display: block;
}

.custom-minutes {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: auto;
  color: var(--muted);
}

.custom-minutes input {
  width: 5.4rem;
  padding: 0.62rem 0.75rem;
  border-radius: 999px;
  text-align: center;
}

.sound-status {
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.compose-dialog {
  width: min(92vw, 35rem);
  border: 0;
  padding: 0;
  background: transparent;
}

.compose-dialog::backdrop {
  background: rgba(25, 19, 43, 0.25);
  backdrop-filter: blur(6px);
}

.compose-dialog form {
  display: grid;
  gap: 1rem;
  padding: 1.4rem;
}

label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 0.8rem 0.9rem;
  background: white;
  color: var(--ink);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.primary-button {
  border: 0;
  border-radius: 1rem;
  padding: 0.9rem 1.2rem;
  background: var(--purple);
  color: white;
  font-weight: 800;
}

.dialog-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.settings-note,
.sync-status {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(0.35rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 10;
    height: auto;
    padding: 0.6rem;
    display: block;
    width: 100%;
    max-width: 100%;
  }

  .brand {
    display: none;
  }

  .nav-list {
    position: fixed;
    left: 4vw;
    right: auto;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 74vw;
    max-width: 74vw;
    gap: 0;
    padding: 0.55rem 0.25rem;
    background: rgba(251, 253, 255, 0.9);
    backdrop-filter: blur(18px);
  }

  .nav-item {
    min-width: 0;
    text-align: center;
    padding: 0.65rem 0.1rem;
    font-size: 0.8rem;
  }

  .ghost-button {
    display: none;
  }

  .workspace {
    padding: 2rem 1.15rem 6.5rem;
    width: 100vw;
    max-width: 100vw;
  }

  .filter-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.25rem;
  }

  .filter-pill {
    flex: 0 0 auto;
  }

  .empty-state {
    padding: 1.7rem 1.2rem;
  }

  .empty-state p {
    max-width: 17rem;
  }

  .mood-row,
  .stats-grid,
  .ambient-grid,
  .focus-stage {
    grid-template-columns: 1fr;
  }

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

  .mini-calendar {
    display: none;
  }

  .calendar-day {
    min-height: 3.6rem;
  }
}

@media (max-width: 430px) {
  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .nav-item {
    min-width: 0;
    padding: 0.6rem 0.1rem;
    font-size: 0.72rem;
    overflow: visible;
  }
}
