:root {
  --ink: #182337;
  --ink-soft: #3f4b60;
  --paper: #f5f5f0;
  --surface: #fffefa;
  --line: #e5e5dd;
  --line-strong: #d5d6ce;
  --indigo: #5e5af1;
  --indigo-dark: #4642d9;
  --lime: #d8fb6c;
  --lime-soft: #efffc0;
  --muted: #7a8291;
  --done: #9ca3af;
  --danger: #c94d4d;
  --shadow: 0 18px 50px rgba(26, 35, 55, 0.08);
  --serif: "DM Serif Display", Georgia, serif;
  --sans: "DM Sans", Inter, system-ui, sans-serif;
  --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--paper); }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 2%, rgba(216, 251, 108, 0.22), transparent 22rem),
    var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button,
input { font: inherit; }

button { cursor: pointer; }

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(94, 90, 241, 0.35);
  outline-offset: 3px;
}

.app-shell {
  display: flex;
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
}

.sidebar {
  display: flex;
  position: sticky;
  top: 0;
  flex: 0 0 340px;
  flex-direction: column;
  min-height: 100vh;
  padding: 34px 36px 26px;
  color: #f8fbff;
  background: var(--ink);
  overflow: hidden;
}

.sidebar::before,
.sidebar::after {
  position: absolute;
  z-index: 0;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.sidebar::before { top: -216px; left: -126px; }
.sidebar::after { right: -246px; bottom: -225px; }

.sidebar > * { position: relative; z-index: 1; }

.brand {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 10px;
  color: inherit;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.06em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--ink);
  background: var(--lime);
  border-radius: 9px 9px 9px 2px;
  box-shadow: 4px 4px 0 rgba(216, 251, 108, 0.23);
}

.brand-mark svg { width: 21px; height: 21px; }

.date-block { margin-top: 66px; }

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar .eyebrow { color: rgba(247, 251, 255, 0.52); }

.date-text {
  max-width: 180px;
  margin: 8px 0 0;
  font-family: var(--serif);
  font-size: 29px;
  line-height: 1.08;
}

.momentum-card {
  margin-top: 40px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  backdrop-filter: blur(12px);
}

.card-label-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: rgba(248, 251, 255, 0.72);
  font-size: 12px;
}

.card-label-row p { margin: 0; }
.card-label-row span { color: var(--lime); font-family: var(--mono); }

.progress-display {
  display: grid;
  position: relative;
  width: 150px;
  height: 150px;
  margin: 18px auto 15px;
  place-items: center;
}

.progress-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.progress-track,
.progress-value {
  fill: none;
  stroke-width: 8;
}

.progress-track { stroke: rgba(255, 255, 255, 0.12); }

.progress-value {
  stroke: var(--lime);
  stroke-linecap: round;
  stroke-dasharray: 320.44;
  stroke-dashoffset: 320.44;
  transition: stroke-dashoffset 540ms cubic-bezier(0.25, 1, 0.5, 1);
}

.progress-center {
  display: grid;
  position: absolute;
  text-align: center;
}

.progress-center strong {
  font-family: var(--serif);
  font-size: 39px;
  font-weight: 400;
  line-height: 0.9;
}

.progress-center span {
  margin-top: 7px;
  color: rgba(248, 251, 255, 0.58);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.momentum-copy {
  min-height: 36px;
  margin: 0;
  color: rgba(248, 251, 255, 0.65);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.sidebar-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin: 28px 0 0;
}

.sidebar-stats div {
  padding: 11px 6px 10px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.sidebar-stats dt {
  color: rgba(248, 251, 255, 0.5);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-stats dd {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 30px;
  color: rgba(248, 251, 255, 0.45);
  font-size: 11px;
}

.sidebar-footer p { margin: 0; }

.privacy-dot,
.status-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 4px rgba(216, 251, 108, 0.12);
}

.main-content {
  flex: 1;
  min-width: 0;
  padding: clamp(35px, 6vw, 78px) clamp(25px, 7vw, 106px) 72px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: clamp(34px, 5vw, 56px);
}

.page-header .eyebrow { margin-bottom: 12px; }

h1,
h2 { margin: 0; color: var(--ink); }

h1 {
  max-width: 580px;
  font-family: var(--serif);
  font-size: clamp(43px, 5vw, 68px);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 0.94;
}

h1 em { color: var(--indigo); font-weight: inherit; }

.header-note {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 5px;
  padding: 9px 12px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.03em;
  white-space: nowrap;
  background: rgba(255, 254, 250, 0.64);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.status-dot { width: 6px; height: 6px; box-shadow: none; }

.capture-section {
  position: relative;
  padding: clamp(22px, 3vw, 31px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.capture-section::after {
  position: absolute;
  top: 0;
  right: 30px;
  width: 50px;
  height: 4px;
  content: "";
  background: var(--lime);
  border-radius: 0 0 4px 4px;
}

.section-heading,
.list-heading,
.list-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.section-kicker { color: var(--indigo); }

h2 {
  margin-top: 8px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.keyboard-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

kbd {
  padding: 2px 5px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 9px;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
}

.task-form {
  display: flex;
  gap: 10px;
  margin-top: 23px;
}

.task-form input,
.edit-input {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  outline: none;
  background: #fbfbf8;
  border: 1px solid var(--line);
  border-radius: 11px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.task-form input {
  height: 51px;
  padding: 0 17px;
  font-size: 14px;
}

.task-form input::placeholder { color: #a6abb4; }

.task-form input:focus,
.edit-input:focus {
  background: #fff;
  border-color: rgba(94, 90, 241, 0.65);
  box-shadow: 0 0 0 4px rgba(94, 90, 241, 0.1);
}

.add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 130px;
  padding: 0 18px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  background: var(--indigo);
  border: 0;
  border-radius: 11px;
  box-shadow: 0 6px 15px rgba(94, 90, 241, 0.22);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.add-button svg { width: 18px; height: 18px; }
.add-button:hover { background: var(--indigo-dark); box-shadow: 0 9px 19px rgba(94, 90, 241, 0.28); transform: translateY(-1px); }
.add-button:active { transform: translateY(1px); }

.form-message { min-height: 17px; margin: 8px 2px 0; color: var(--danger); font-size: 11px; }

.tasks-section { margin-top: clamp(40px, 6vw, 70px); }

.clear-button {
  padding: 7px 0;
  color: var(--muted);
  font-size: 11px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid transparent;
  transition: color 160ms ease, border-color 160ms ease;
}

.clear-button:hover:not(:disabled) { color: var(--danger); border-color: currentColor; }
.clear-button:disabled { cursor: not-allowed; opacity: 0.38; }

.list-toolbar {
  align-items: center;
  margin-top: 24px;
  padding: 8px 0 13px;
  border-bottom: 1px solid var(--line-strong);
}

.filter-tabs { display: inline-flex; align-items: center; gap: 5px; }

.filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  background: transparent;
  border: 0;
  border-radius: 7px;
  transition: color 160ms ease, background 160ms ease;
}

.filter-tab span { color: inherit; font-family: var(--mono); font-size: 9px; }
.filter-tab:hover { color: var(--ink); background: rgba(24, 35, 55, 0.045); }
.filter-tab.is-active { color: var(--ink); background: var(--lime); }

.task-summary { margin: 0; color: var(--muted); font-family: var(--mono); font-size: 10px; }

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

.task-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 18px 4px;
  border-bottom: 1px solid var(--line);
  animation: slide-in 260ms ease both;
}

.task-card.is-completed .task-title { color: var(--done); text-decoration: line-through; text-decoration-color: rgba(156, 163, 175, 0.72); }
.task-card.is-completed .task-meta { color: #adb2bb; }

.check-button {
  display: grid;
  width: 25px;
  height: 25px;
  padding: 0;
  color: transparent;
  place-items: center;
  background: transparent;
  border: 1.5px solid #b8bec8;
  border-radius: 50%;
  transition: transform 160ms ease, color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.check-button svg { width: 15px; height: 15px; }
.check-button:hover { border-color: var(--indigo); transform: scale(1.06); }
.task-card.is-completed .check-button { color: var(--ink); background: var(--lime); border-color: var(--lime); }

.task-content { min-width: 0; }

.task-title {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
  transition: color 160ms ease;
}

.task-meta { display: block; margin-top: 5px; color: var(--muted); font-family: var(--mono); font-size: 9px; letter-spacing: 0.02em; text-transform: uppercase; }

.task-actions { display: flex; align-items: center; gap: 3px; opacity: 0; transition: opacity 160ms ease; }
.task-card:hover .task-actions,
.task-card:focus-within .task-actions { opacity: 1; }

.icon-button {
  display: grid;
  width: 29px;
  height: 29px;
  padding: 0;
  color: var(--muted);
  place-items: center;
  background: transparent;
  border: 0;
  border-radius: 7px;
  transition: color 160ms ease, background 160ms ease;
}

.icon-button svg { width: 15px; height: 15px; }
.icon-button:hover { color: var(--ink); background: #e9e9e3; }
.icon-button.delete-button:hover { color: var(--danger); background: #fff0ef; }

.edit-form { display: flex; align-items: center; gap: 8px; }
.edit-input { height: 37px; padding: 0 10px; font-size: 13px; }
.edit-save { padding: 7px 10px; color: white; font-size: 11px; font-weight: 600; background: var(--indigo); border: 0; border-radius: 7px; }
.edit-cancel { padding: 6px 4px; color: var(--muted); font-size: 11px; background: transparent; border: 0; }

.empty-state {
  display: grid;
  min-height: 210px;
  padding: 34px 20px;
  place-items: center;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.empty-symbol {
  display: grid;
  width: 46px;
  height: 46px;
  margin: 0 auto 13px;
  color: var(--indigo);
  place-items: center;
  background: #ecebff;
  border-radius: 16px 16px 16px 3px;
}

.empty-symbol svg { width: 25px; height: 25px; }
.empty-state h3 { margin: 0; font-size: 15px; letter-spacing: -0.02em; }
.empty-state p { max-width: 280px; margin: 7px auto 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

.toast {
  position: fixed;
  z-index: 10;
  right: 25px;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  width: max-content;
  max-width: calc(100vw - 40px);
  padding: 12px 14px;
  color: #f7fbff;
  font-size: 12px;
  background: var(--ink);
  border-radius: 11px;
  box-shadow: 0 12px 30px rgba(24, 35, 55, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.toast button { padding: 3px 0; color: var(--lime); font-size: 11px; font-weight: 600; background: transparent; border: 0; border-bottom: 1px solid currentColor; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes slide-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 940px) {
  .sidebar { flex-basis: 285px; padding: 30px 25px 22px; }
  .main-content { padding: 48px clamp(24px, 5vw, 52px) 58px; }
  .date-block { margin-top: 50px; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    min-height: 0;
    padding: 24px 23px 21px;
  }
  .sidebar::before { top: -255px; left: auto; right: -80px; }
  .sidebar::after { display: none; }
  .brand { grid-column: 1 / -1; }
  .date-block { margin: 0; }
  .date-text { margin-top: 6px; font-size: 24px; }
  .momentum-card { grid-row: 2 / span 2; grid-column: 2; width: 149px; margin: 0; padding: 13px; }
  .card-label-row { font-size: 9px; }
  .progress-display { width: 93px; height: 93px; margin: 12px auto 7px; }
  .progress-track, .progress-value { stroke-width: 9; }
  .progress-center strong { font-size: 28px; }
  .progress-center span { margin-top: 3px; font-size: 8px; }
  .momentum-copy { display: none; }
  .sidebar-stats { align-self: end; grid-template-columns: repeat(3, minmax(45px, 1fr)); width: 100%; margin: 0; }
  .sidebar-stats dd { font-size: 23px; }
  .sidebar-footer { display: none; }
  .main-content { padding: 36px 21px 55px; }
  .page-header { padding-bottom: 36px; }
  h1 { max-width: 430px; font-size: clamp(42px, 12vw, 59px); }
}

@media (max-width: 520px) {
  .header-note { display: none; }
  .capture-section { padding: 20px 16px 16px; border-radius: 18px; }
  .keyboard-hint { display: none; }
  .task-form { align-items: stretch; flex-direction: column; }
  .task-form input { height: 49px; }
  .add-button { min-height: 46px; }
  .list-toolbar { align-items: flex-start; flex-direction: column; gap: 8px; }
  .task-summary { margin-left: 4px; }
  .task-card { grid-template-columns: 30px minmax(0, 1fr); gap: 11px; padding: 16px 0; }
  .task-actions { grid-column: 2; opacity: 1; margin-top: -6px; }
  .icon-button { width: 27px; height: 27px; }
  .edit-form { align-items: stretch; flex-wrap: wrap; }
  .edit-input { flex-basis: 100%; }
  .clear-button { font-size: 10px; }
  .filter-tab { padding: 7px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}


/* Account sync additions */
.account-panel {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  min-height: 37px;
  margin-top: 4px;
}

.account-status,
.account-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  background: rgba(255, 254, 250, 0.64);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.account-user { color: var(--ink); }
.account-user-name { max-width: 115px; overflow: hidden; text-overflow: ellipsis; }

.account-button,
.signout-button,
.import-button,
.dismiss-button {
  min-height: 35px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.account-button,
.import-button {
  padding: 0 13px;
  color: var(--ink);
  background: var(--lime);
  border: 1px solid var(--lime);
}

.account-button:hover,
.import-button:hover { background: var(--lime-soft); border-color: var(--lime-soft); transform: translateY(-1px); }

.signout-button,
.dismiss-button {
  padding: 0 11px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
}

.signout-button:hover { color: var(--danger); border-color: #f4d1cf; background: #fff7f6; }
.dismiss-button:hover { color: var(--ink); background: rgba(24, 35, 55, 0.05); }

.sync-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  margin-top: 18px;
  padding: 14px 16px;
  background: #f1f8dc;
  border: 1px solid #dceab7;
  border-radius: 15px;
}

.sync-banner[hidden] { display: none; }

.sync-banner-icon {
  display: grid;
  width: 31px;
  height: 31px;
  color: var(--indigo);
  place-items: center;
  background: #fffefa;
  border-radius: 10px;
}

.sync-banner-icon svg { width: 18px; height: 18px; }
.sync-banner-title { margin: 0; color: var(--ink); font-size: 12px; font-weight: 600; }
.sync-banner-copy { margin: 3px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.4; }
.sync-banner-actions { display: inline-flex; align-items: center; gap: 3px; }

@media (max-width: 760px) {
  .account-panel { display: none; }
  .sync-banner { grid-template-columns: auto minmax(0, 1fr); }
  .sync-banner-actions { grid-column: 2; }
}

@media (max-width: 520px) {
  .sync-banner { align-items: flex-start; padding: 13px; }
  .sync-banner-actions { flex-wrap: wrap; }
  .import-button, .dismiss-button { min-height: 31px; }
}
