:root {
  --paper: #ffffff;
  --ink: #000000;
  --muted: #3f3f3f;
  --accent: #ea1d30;
  --accent-soft: rgba(234, 29, 48, 0.08);
  --panel: #ffffff;
  --line: #dadada;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "ivypresto-headline", serif;
  font-size: 18px;
  line-height: 1.5;
  font-weight: 300;
  letter-spacing: 0.04em;
}

.page-shell {
  position: relative;
  max-width: 90%;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.hero {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
}

.hero-copy h1,
.panel-heading h2,
.section-label h3,
#todayHeading {
  font-family: "ivypresto-headline", serif;
  font-weight: 300;
  letter-spacing: 0.01em;
  margin: 0 0 20px 0;
}

.hero-copy h1 {
  font-size: clamp(2.5rem, 5vw, 4.6rem);
  line-height: 1.02;
}

.hero-text {
  max-width: 46ch;
  margin: 14px 0 0;
  font-size: 1.05rem;
  color: var(--muted);
}

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

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.stat-card,
.panel,
.task-card {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.stat-card {
  border-radius: 22px;
  padding: 18px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

.stat-card strong {
  font-size: clamp(2rem, 3vw, 3rem);
  font-family: "ivypresto-headline", serif;
  font-weight: 300;
}

.app-grid {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.hero > *,
.app-grid > *,
.board > *,
.column-grid > *,
.task-form > * {
  min-width: 0;
}

.panel {
  border-radius: var(--radius);
  padding: 20px;
}

.compose-panel {
  position: sticky;
  top: 20px;
}

.panel-heading {
  margin-bottom: 16px;
}

.task-modal {
  width: min(760px, calc(100% - 28px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition:
    opacity 180ms ease,
    transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.task-modal::backdrop {
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(3px);
  transition: background 180ms ease;
}

.task-modal.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.task-modal.is-open::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

.task-modal.is-closing {
  opacity: 0;
  transform: translateY(12px) scale(0.98);
}

.task-modal.is-closing::backdrop {
  background: rgba(0, 0, 0, 0);
}

.modal-panel {
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.18);
}

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

.modal-heading h2 {
  margin: 0;
  font-family: "ivypresto-headline", serif;
  font-weight: 300;
  letter-spacing: 0.01em;
}

.task-form {
  display: grid;
  gap: 16px;
}

.task-form label {
  display: grid;
  gap: 8px;
}

.task-form span {
  font-size: 0.88rem;
  color: var(--muted);
}

input,
textarea,
button {
  font: inherit;
}

input[type="text"],
input[type="date"],
textarea {
  width: 100%;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 13px 14px;
  color: var(--ink);
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: none;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.date-row,
.action-row,
.quick-actions,
.board-toolbar,
.task-card-top,
.task-card-actions,
.toolbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.date-row input {
  flex: 1 1 100%;
  min-width: 0;
}

.date-row {
  flex-wrap: wrap;
}

.date-row .ghost-button {
  flex: 0 0 auto;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 11px 19px;
  cursor: pointer;
  font-weight: 300;
}

.primary-button {
  background: var(--accent);
  color: white;
  box-shadow: none;
}

.task-form > .primary-button,
.task-form > .danger-button,
.action-row > .primary-button,
.action-row > .danger-button {
  width: 100%;
}

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

.danger-button {
  background: var(--accent);
  color: white;
  box-shadow: none;
}

.ghost-button.small,
.danger-button.small {
  padding: 6px 10px;
  font-size: 0.78rem;
}

.icon-button {
  width: 31px;
  height: 31px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 31px;
  border-radius: 50%;
  padding: 0;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.icon-button svg {
  width: 16px;
  height: 16px;
  display: block;
  fill: currentColor;
}

.delete-button {
  background: #000000;
  border-color: #000000;
  color: #ffffff;
}

.command-card {
  display:none;
  margin-top: 18px;
  padding: 16px;
  border-radius: 3px;
  background: #000000;
  color: #ffffff;
}

.command-card p {
  margin: 0 0 10px;
}

.command-card code {
  display: inline-block;
  padding: 8px 10px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
}

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

.board-toolbar {
  justify-content: space-between;
}

.column-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.column-panel,
.completed-panel {
  min-height: 280px;
}

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

.editor-span-2 {
  grid-column: 1 / -1;
}

.task-column,
.task-strip {
  display: grid;
  gap: 14px;
  align-content: start;
}

.drop-zone {
  min-height: 96px;
  border-radius: 14px;
  transition: background-color 160ms ease, box-shadow 160ms ease;
}

.drop-zone.drag-over {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.drop-zone.drag-over .empty-state {
  display: none;
}

.task-strip {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.task-card {
  position: relative;
  border-radius: 14px;
  padding: 16px;
  display: grid;
  gap: 12px;
  overflow: hidden;
  transform: scale(1);
  transform-origin: center;
  transition:
    transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 220ms ease,
    border-color 220ms ease,
    opacity 180ms ease;
  will-change: transform;
}

.task-card[draggable="true"] {
  cursor: grab;
}

.task-card.drag-pressing {
  transform: scale(1.03);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.12);
}

.task-card-top {
  justify-content: space-between;
}

.task-card-top .check-row {
  flex: 1 1 auto;
  min-width: 0;
}

.task-card-actions {
  flex: 0 0 auto;
}

.task-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.task-card.dragging {
  z-index: 20;
  cursor: grabbing;
  opacity: 0.96;
  transform: scale(1.1);
  box-shadow: 0 26px 58px rgba(0, 0, 0, 0.2);
}

.task-card.done {
  opacity: 0.72;
}

.task-title {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.task-meta {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.task-notes {
  margin: 0;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.check-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

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

.overdue-wrap {
  display: grid;
  gap: 14px;
  padding: 18px 20px 22px;
  border-radius: var(--radius);
  background: #ffffff;
  border: 1px solid var(--accent);
}

.empty-state,
.empty-editor {
  padding: 20px;
  border-radius: 3px;
  border: 1px dashed var(--line);
  color: var(--muted);
  background: #ffffff;
}

.hidden {
  display: none !important;
}

.compact .task-card {
  gap: 10px;
}

.archive-month {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  overflow: hidden;
}

.archive-month + .archive-month {
  margin-top: 12px;
}

.archive-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  color: var(--ink);
  list-style: none;
}

.archive-summary::-webkit-details-marker {
  display: none;
}

.archive-summary::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 180ms ease;
}

.archive-month[open] .archive-summary::before {
  transform: rotate(45deg);
}

.archive-month-title {
  flex: 1 1 auto;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.archive-month-count {
  min-width: 30px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #000000;
  color: #ffffff;
  font-size: 0.78rem;
  text-align: center;
}

.archive-month-body {
  display: grid;
  gap: 12px;
  padding: 0 12px 12px;
}

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.auth-shell {
  width: min(100%, 560px);
  padding: 24px;
}

.auth-card {
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 32px;
}

.auth-card h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 300;
  line-height: 1.05;
}

.auth-text {
  margin: 0 0 24px;
  color: var(--muted);
}

.auth-error {
  margin: 0;
  color: var(--accent);
}

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

  .compose-panel {
    position: static;
  }

  .column-grid {
    grid-template-columns: 1fr;
  }
}

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

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

  .editor-grid {
    grid-template-columns: 1fr;
  }

  .editor-span-2 {
    grid-column: auto;
  }
}

@media (max-width: 620px) {
  .page-shell {
    padding-inline: 0px;
  }

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

  .date-row,
  .action-row,
  .quick-actions,
  .task-card-top,
  .board-toolbar,
  .toolbar-actions {
    flex-wrap: wrap;
  }

  .quick-actions > button,
  .action-row > button {
    width: 100%;
  }
}
