:root {
  --bg: #f7f6f2;
  --ink: #1a1a18;
  --muted: #9a978f;
  --faint: #ebe8e1;
  --card: #fffffe;
  --accent: #2f6f4f;
  --late: #c4492f;
  --soft: 0 1px 2px #0000000a, 0 10px 32px #00000010;
  /* Area colors: muted enough to sit quietly in a circle. */
  --c1: #3f7d5c; --c2: #c27b45; --c3: #5b72b0; --c4: #a05c8f; --c5: #8a8a3c;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111110;
    --ink: #eeede8;
    --muted: #77756e;
    --faint: #232321;
    --card: #1a1a19;
    --accent: #7fc8a1;
    --late: #ef8268;
    --soft: 0 1px 2px #0000004d, 0 10px 32px #00000066;
    --c1: #7fc8a1; --c2: #e3a06d; --c3: #8ea3e0; --c4: #d48cc0; --c5: #c3c36a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; margin: 0; }
html, body { background: var(--bg); color: var(--ink); }
body {
  font: 17px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; background: none; border: 0; outline: none; }
button { cursor: pointer; }
.muted { color: var(--muted); font-size: 14px; }
.error { color: var(--late); font-size: 14px; }
.mark { font-size: 30px; color: var(--accent); }

#app { max-width: 600px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 34px) 24px calc(env(safe-area-inset-bottom) + 130px); animation: rise 0.5s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* Login: a mark and one line. */
.login { min-height: 100dvh; display: grid; place-content: center; gap: 22px; justify-items: center; padding: 0 24px; grid-template-columns: minmax(0, 280px); }
.login .mark { font-size: 44px; }
.login input { width: 100%; border-bottom: 1px solid var(--faint); padding: 10px 2px; text-align: center; font-size: 19px; transition: border-color 0.2s; }
.login input:focus { border-color: var(--ink); }
.go {
  width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--bg);
  font-size: 17px; display: grid; place-items: center; flex: none; transition: transform 0.15s, opacity 0.2s, background 0.2s;
}
.go:active { transform: scale(0.92); }

/* Header: the day is the headline; everything else whispers. */
#app > header { display: flex; align-items: flex-start; gap: 2px; }
#app > header > div { flex: 1; }
h1 { font-size: 36px; font-weight: 700; letter-spacing: -0.035em; line-height: 1; }
#sub { margin-top: 8px; font-size: 15px; }
.icon { width: 34px; height: 34px; display: grid; place-items: center; color: var(--muted); border-radius: 50%; transition: background 0.15s; }
.icon:active { background: var(--faint); }
.icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sync { font-size: 12px; color: var(--muted); margin: 9px 6px 0 0; white-space: nowrap; }

.areas { display: flex; gap: 6px; margin: 18px -12px 0; padding: 8px 12px 12px; overflow-x: auto; scrollbar-width: none; }
.areas::-webkit-scrollbar { display: none; }
.areas button {
  display: flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 999px;
  color: var(--muted); font-size: 14px; white-space: nowrap; text-transform: capitalize; transition: background 0.2s, color 0.2s;
}
.areas button + button::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--a); }
.areas button.on { background: var(--card); color: var(--ink); box-shadow: var(--soft); }

/* Saved views, sections and list-or-board: one quiet row. */
.tools { display: flex; align-items: center; gap: 2px; margin-top: 10px; }
.views { flex: 1; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-left: -4px; padding: 2px 4px; }
.views::-webkit-scrollbar { display: none; }
.views button { padding: 5px 12px; border-radius: 999px; font-size: 13px; color: var(--muted); white-space: nowrap; box-shadow: inset 0 0 0 1px var(--faint); transition: background 0.2s, color 0.2s; }
.views button.on { background: var(--ink); color: var(--bg); box-shadow: none; }
.views .x { margin-left: 8px; opacity: 0.6; }
.views .add { box-shadow: none; padding-left: 4px; }
.tools select { font-size: 13px; color: var(--muted); padding: 6px 2px; cursor: pointer; text-align: right; }

.lens { display: flex; align-items: center; gap: 8px; margin-top: 22px; color: var(--accent); font-size: 15px; font-weight: 600; }
.lens::before { content: "✦"; font-size: 13px; }
.lens button { color: var(--muted); font-size: 19px; line-height: 1; padding: 0 4px; }

/* The list: just rows and air. */
section { margin-top: 26px; }
section h2 { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 2px; display: flex; gap: 6px; }
section h2 span { font-weight: 400; opacity: 0.6; }
section.overdue h2 { color: var(--late); }
.task { display: flex; gap: 14px; padding: 10px 0; align-items: flex-start; transition: opacity 0.35s, transform 0.35s; }
.task.new { animation: rise 0.35s ease-out; }
.ring {
  flex: none; width: 22px; height: 22px; margin-top: 0; border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--a) 70%, transparent); display: grid; place-items: center;
  transition: background 0.25s, border-color 0.25s, transform 0.15s;
}
.ring:active { transform: scale(0.88); }
.ring svg { width: 15px; height: 15px; fill: none; stroke: var(--bg); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 20; stroke-dashoffset: 20; transition: stroke-dashoffset 0.3s 0.05s ease-out; }
.task.done .ring { background: var(--a); border-color: var(--a); }
.task.done .ring svg { stroke-dashoffset: 0; }
.task.done .t { color: var(--muted); }
.task.leaving { opacity: 0; transform: translateX(12px); }
.task.pending .t { opacity: 0.55; }
.body { flex: 1; min-width: 0; cursor: pointer; }
.t { overflow-wrap: anywhere; line-height: 1.3; }
.meta { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 13px; color: var(--muted); margin-top: 3px; }
.meta .late { color: var(--late); }
.meta .soon { color: var(--accent); }
.meta .kind { color: var(--ink); opacity: 0.75; }
.meta a { color: inherit; text-decoration: none; }
.empty { color: var(--muted); text-align: center; padding: 22vh 0 0; display: grid; gap: 10px; }

/* Carrying a task: a lifted copy follows the finger and the section under it lights up. */
.task { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.edit { -webkit-user-select: text; user-select: text; }
.task.lifted { opacity: 0.3; }
.ghost { position: fixed; left: 0; top: 0; z-index: 20; pointer-events: none; background: var(--card); border-radius: 14px; padding: 12px; box-shadow: var(--soft); }
section { border-radius: 18px; transition: background 0.15s; }
section.over { background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* The board: the same sections side by side, each a soft column of cards. */
#app.roomy { max-width: 1320px; }
.board { display: flex; gap: 12px; align-items: flex-start; overflow-x: auto; margin: 0 -24px; padding: 0 24px 8px; scroll-snap-type: x mandatory; scroll-padding: 0 24px; scrollbar-width: none; }
.board::-webkit-scrollbar { display: none; }
.board:has(.lifted) { scroll-snap-type: none; } /* or snapping undoes the scroll toward the edge */
.board section { flex: 0 0 min(290px, 80vw); margin-top: 22px; padding: 12px 8px 8px; min-height: 140px; scroll-snap-align: start; background: color-mix(in srgb, var(--faint) 55%, transparent); }
.board section.over { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.board section h2 { padding: 0 6px 4px; }
.board .task { background: var(--card); border-radius: 14px; padding: 12px; margin-top: 8px; gap: 10px; box-shadow: 0 1px 2px #0000000d; cursor: grab; }

/* Editing happens in a soft card under the row. */
.edit { scroll-margin-bottom: 110px; display: grid; gap: 4px; margin-top: 12px; padding: 6px 16px 12px; background: var(--card); border-radius: 16px; box-shadow: var(--soft); cursor: default; }
.task.open { background: var(--card); border-radius: 16px; box-shadow: var(--soft); padding: 6px 16px 12px; margin: 6px -16px; }
.task.open .ring { margin-top: 11px; }
.board .task.open { margin: 8px 0 0; padding: 6px 12px 12px; cursor: default; }
.task.open .edit { margin: 0; padding: 0; background: none; box-shadow: none; }
.edit input, .edit textarea, .edit select { width: 100%; border-bottom: 1px solid var(--faint); padding: 10px 0; font-size: 15px; }
.edit > input:first-child { font-size: 17px; font-weight: 500; }
.edit textarea { resize: none; min-height: 56px; }
.edit .row { gap: 14px; flex-wrap: nowrap; }
.edit .row > * { flex: 1; min-width: 0; }
.edit .row:last-child { margin-top: 8px; border: 0; }
.edit .row > .go { flex: none; }
.edit input[type="datetime-local"] { flex: 1.7; }
.edit .to-motion { font-size: 15px; flex: none !important; color: var(--muted); }
.edit .danger { font-size: 15px; flex: none !important; }

/* The bar: one field that adds, or asks when ✦ is lit. */
.bar { position: fixed; left: 0; right: 0; bottom: 0; padding: 0 16px calc(env(safe-area-inset-bottom) + 14px); pointer-events: none; }
.bar > * { pointer-events: auto; max-width: 600px; margin: 0 auto; }
.pill {
  display: flex; align-items: flex-end; gap: 4px; padding: 5px; border-radius: 24px;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: blur(24px) saturate(1.5); -webkit-backdrop-filter: blur(24px) saturate(1.5);
  box-shadow: var(--soft); transition: box-shadow 0.25s;
}
.pill textarea { flex: 1; resize: none; padding: 8px 4px; max-height: 180px; min-height: 34px; line-height: 1.3; }
.pill textarea::placeholder { color: var(--muted); }
.pill .go { opacity: 0; transform: scale(0.6); pointer-events: none; }
.bar.typed .pill .go { opacity: 1; transform: none; pointer-events: auto; }
.mode { width: 34px; height: 34px; border-radius: 50%; color: var(--muted); font-size: 15px; flex: none; transition: color 0.2s, background 0.2s; }
.bar.asking .pill { box-shadow: 0 0 0 1.5px var(--accent), 0 0 0 6px color-mix(in srgb, var(--accent) 14%, transparent), var(--soft); }
.bar.asking .mode { color: var(--accent); }
.bar.asking .go { background: var(--accent); }
.bar.thinking .mode { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.3; transform: rotate(45deg); } }
.answer {
  font-size: 15px; padding: 10px 16px; margin-bottom: 8px !important; border-radius: 18px; width: fit-content; max-width: 100%;
  background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--soft); animation: rise 0.3s ease-out;
}
.answer::before { content: "✦  "; color: var(--accent); font-size: 13px; }

/* Sheets */
dialog {
  border: 0; padding: 0; background: var(--bg); color: var(--ink); width: 100%; max-width: 540px;
  max-height: calc(100dvh - 40px); border-radius: 24px 24px 0 0; margin: auto auto 0; box-shadow: var(--soft);
}
dialog[open] { animation: up 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 640px) { dialog { margin: auto; border-radius: 24px; } }
dialog::backdrop { background: #0005; backdrop-filter: blur(4px); }
.sheet { padding: 10px 24px calc(env(safe-area-inset-bottom) + 28px); }
.sheet::before { content: ""; display: block; width: 36px; height: 4px; border-radius: 2px; background: var(--faint); margin: 0 auto 14px; }
.sheet header { display: flex; align-items: center; margin-bottom: 6px; }
.sheet h2 { flex: 1; font-size: 26px; letter-spacing: -0.03em; }
.sheet h3 { font-size: 15px; font-weight: 600; margin: 28px 0 2px; }
.sheet .muted { margin-bottom: 12px; line-height: 1.4; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sheet .row > button:not(.go), .wide, .copy button {
  padding: 8px 15px; border-radius: 999px; background: var(--card); box-shadow: var(--soft); font-size: 15px;
}
.wide { width: 100%; margin-top: 10px; }
.danger { color: var(--late); }
.row input { flex: 1; border-bottom: 1px solid var(--faint); padding: 8px 2px; }
.row input:focus { border-color: var(--ink); }
.copy { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 16px; background: var(--card); box-shadow: var(--soft); }
.copy code { flex: 1; font-size: 13px; overflow-wrap: anywhere; color: var(--muted); }
#bot-text { width: 100%; margin-top: 14px; padding: 14px; border-radius: 16px; background: var(--card); box-shadow: var(--soft); font: 12px/1.5 ui-monospace, Menlo, monospace; resize: none; color: var(--muted); }
.rows { list-style: none; padding: 0; margin-top: 4px; }
.rows li { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--faint); }
.rows li:last-child { border: 0; }
.rows li div { flex: 1; }
.rows li small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.rows li button { color: var(--muted); font-size: 14px; }

.toast {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 14px); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 9px 16px; border-radius: 999px; font-size: 14px; z-index: 10;
  max-width: calc(100% - 32px); animation: rise 0.25s ease-out;
}

@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }
.motion-ask { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; }
.motion-ask button { padding: 2px 10px; font-size: 13px; }
