:root {
  color-scheme: light dark;
  --ink: #12141a;
  --ink-soft: #3a3f4b;
  --muted: #6b7280;
  --line: rgba(18, 20, 26, 0.1);
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --bg0: #eef1f6;
  --bg1: #f7f5f1;
  --accent: #0f766e;
  --accent-deep: #0b5f59;
  --accent-text: #ffffff;
  --danger: #b42318;
  --glow: rgba(15, 118, 110, 0.18);
  --radius: 18px;
  --nav: 72px;
  --font: "Sora", "Avenir Next", "Segoe UI", sans-serif;
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f4f6fb;
    --ink-soft: #c5cad6;
    --muted: #9aa3b5;
    --line: rgba(244, 246, 251, 0.12);
    --surface: rgba(22, 25, 34, 0.72);
    --surface-solid: #161922;
    --bg0: #0b0d12;
    --bg1: #141821;
    --accent: #2dd4bf;
    --accent-deep: #14b8a6;
    --accent-text: #06201d;
    --glow: rgba(45, 212, 191, 0.16);
  }
}

html[data-theme="light"] {
  color-scheme: light;
  --ink: #12141a;
  --ink-soft: #3a3f4b;
  --muted: #6b7280;
  --line: rgba(18, 20, 26, 0.1);
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --bg0: #eef1f6;
  --bg1: #f7f5f1;
  --accent: #0f766e;
  --accent-deep: #0b5f59;
  --accent-text: #ffffff;
  --glow: rgba(15, 118, 110, 0.18);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f4f6fb;
  --ink-soft: #c5cad6;
  --muted: #9aa3b5;
  --line: rgba(244, 246, 251, 0.12);
  --surface: rgba(22, 25, 34, 0.72);
  --surface-solid: #161922;
  --bg0: #0b0d12;
  --bg1: #141821;
  --accent: #2dd4bf;
  --accent-deep: #14b8a6;
  --accent-text: #06201d;
  --glow: rgba(45, 212, 191, 0.16);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  line-height: 1.5;
  background:
    radial-gradient(1200px 700px at 12% -10%, var(--glow), transparent 55%),
    radial-gradient(900px 600px at 100% 0%, rgba(180, 140, 90, 0.12), transparent 45%),
    linear-gradient(165deg, var(--bg0), var(--bg1));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.demo-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-bottom: 1px solid var(--line);
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 28px 20px 12px;
  animation: rise 0.55s var(--ease) both;
}
.brand {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
  color: var(--ink);
}
.page-title {
  font-family: var(--display);
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 560;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin: 0;
}
.topbar-actions { display: flex; gap: 4px; align-items: center; }

.main {
  flex: 1;
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 8px 20px calc(var(--nav) + 36px);
  animation: rise 0.65s var(--ease) 0.04s both;
}

.panel {
  margin-bottom: 28px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}
.panel-title {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.panel-count {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.85rem;
}

.hero {
  margin-bottom: 32px;
  padding-bottom: 8px;
}
.hero-line {
  font-family: var(--display);
  font-size: clamp(1.45rem, 3.4vw, 1.9rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 0 0 10px;
  max-width: 22ch;
}
.hero-meta {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
}

.row { display: flex; align-items: center; gap: 10px; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

.btn, .btn-secondary, .btn-text {
  border-radius: 999px;
  border: 0;
  padding: 13px 18px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn:hover, .btn-secondary:hover { transform: translateY(-1px); }
.btn { background: var(--accent); color: var(--accent-text); }
.btn:hover { background: var(--accent-deep); }
.btn-secondary {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn-text {
  background: transparent;
  color: var(--muted);
  padding: 8px 10px;
  font-weight: 500;
  border-radius: 10px;
}
.btn-text:hover { color: var(--ink); }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.full { width: 100%; }

.field {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(12px);
  border-radius: 14px;
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field:focus {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: 0 0 0 4px var(--glow);
}
textarea.field { min-height: 96px; resize: vertical; }
label.field-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.task-list { display: flex; flex-direction: column; }
.task {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  animation: rise 0.45s var(--ease) both;
}
.task:first-child { border-top: 0; padding-top: 2px; }
.task button.check {
  width: 26px;
  height: 26px;
  margin-top: 2px;
  border-radius: 999px;
  border: 1.5px solid color-mix(in srgb, var(--ink) 35%, transparent);
  background: transparent;
  flex: none;
  color: var(--accent);
  font-size: 0.85rem;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.task button.check:hover,
.task.done button.check {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.task.done .title { color: var(--muted); text-decoration: line-through; }
.task .title {
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 1.02rem;
}
.task a { text-decoration: none; flex: 1; min-width: 0; }
.meta { font-size: 0.82rem; color: var(--muted); margin-top: 3px; }
.late { color: var(--danger); font-weight: 600; }

.tabs {
  position: fixed;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(520px, calc(100% - 24px));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  background: var(--surface);
  backdrop-filter: blur(18px) saturate(1.2);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 6px;
  z-index: 20;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}
.tabs a {
  text-decoration: none;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  padding: 12px 4px;
  border-radius: 16px;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.tabs a.active {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 7%, transparent);
}

.fab {
  position: fixed;
  right: max(20px, calc(50% - 460px + 20px));
  bottom: calc(var(--nav) + 20px);
  width: 58px;
  height: 58px;
  border-radius: 999px;
  border: 0;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 1.8rem;
  line-height: 1;
  z-index: 21;
  box-shadow: 0 14px 36px var(--glow);
  transition: transform 0.2s var(--ease);
}
.fab:hover { transform: scale(1.05); }

.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 14, 0.48);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 30;
  padding: 12px;
  animation: fade 0.25s var(--ease) both;
}
@media (min-width: 720px) {
  .modal-back { align-items: center; }
}
.modal {
  width: min(520px, 100%);
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  max-height: min(92vh, 760px);
  overflow: auto;
  animation: rise 0.35s var(--ease) both;
}
.modal h2, .modal .modal-title {
  font-family: var(--display);
  font-size: 1.45rem;
  letter-spacing: -0.03em;
  margin: 0 0 4px;
}

/* Auth / gate: web-first, apps optional */
.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 20px 40px;
}
.auth-compose {
  width: min(440px, 100%);
  animation: rise 0.6s var(--ease) both;
}
.auth-brand {
  font-family: var(--display);
  font-size: clamp(2.4rem, 8vw, 3.2rem);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 0.95;
  margin: 0 0 14px;
}
.auth-lead {
  font-size: 1.08rem;
  color: var(--ink-soft);
  margin: 0 0 28px;
  max-width: 28ch;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}
.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 4px;
}
.oauth-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 4px;
}
.btn-oauth {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 13px 18px;
  font-weight: 600;
  background: var(--surface-solid);
  color: var(--ink);
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}
.btn-oauth:hover { transform: translateY(-1px); }
.btn-oauth:disabled { opacity: 0.55; transform: none; }
.btn-oauth.apple {
  background: #000;
  color: #fff;
  border-color: #000;
}
html[data-theme="dark"] .btn-oauth.apple,
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .btn-oauth.apple {
    background: #fff;
    color: #000;
    border-color: #fff;
  }
}
.btn-oauth.google {
  background: var(--surface-solid);
}
.oauth-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
}
.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}
.auth-apps {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.auth-apps p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.9rem;
}
.auth-apps .apps-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.apps-screen {
  width: min(360px, 100%);
  margin: 0 auto;
}
.apps-screen .auth-brand { font-size: 2.2rem; margin-bottom: 8px; }

.score-block {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-bottom: 28px;
}
.score {
  width: 92px;
  height: 92px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 3px solid var(--accent);
  font-family: var(--display);
  font-size: 1.7rem;
  font-weight: 600;
  flex: none;
  box-shadow: 0 0 0 8px var(--glow);
}
.kpi {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.kpi-value {
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 560;
  letter-spacing: -0.03em;
}
.note {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.project-row {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.project-row:first-of-type { border-top: 0; }
.project-name {
  font-weight: 650;
  letter-spacing: -0.02em;
  font-size: 1.08rem;
}
.progress-track {
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  margin: 10px 0 8px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}

.blurred { filter: blur(5px); user-select: none; }
.error { color: var(--danger); font-size: 0.9rem; }
.kicker {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 8px;
}
.day-nav { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.day-nav input { flex: 1; }

.paywall { margin-top: 8px; }
.pay-note {
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin: 0 0 18px;
  max-width: 46ch;
  line-height: 1.5;
}
.plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 640px) {
  .plan-grid { grid-template-columns: 1fr; }
}
.plan-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: var(--surface);
}
.plan-card.highlight {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: 0 0 0 4px var(--glow);
}
.paypal-buttons { margin-top: 12px; min-height: 45px; }
.surface-soft {
  background: var(--surface);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
