@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,700&family=Figtree:wght@400;500;600;700&display=swap");

:root {
  color-scheme: dark;
  --bg: #121614;
  --bg-glow: #1c2a24;
  --paper: #1a211e;
  --elevated: #222b27;
  --ink: #e8efeb;
  --muted: #9aaba3;
  --line: #2d3a34;
  --accent: #6fb5ab;
  --accent-soft: #243832;
  --warn: #e0a46a;
  --warn-soft: #3a2c1c;
  --ok: #8fbf9a;
  --ok-soft: #243329;
  --err: #e08b8b;
  --err-soft: #3a2222;
  --shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
  --display: "Fraunces", Georgia, serif;
  --ui: "Figtree", system-ui, sans-serif;
  --radius: 14px;
  --reach: 44px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--ui);
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 0% 0%, var(--bg-glow), transparent 60%),
    radial-gradient(700px 380px at 100% 8%, #18201c, transparent 55%),
    var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.shell {
  max-width: 780px;
  margin: 0 auto;
  padding: 1rem 1rem 6.5rem;
}

.top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.brand {
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1;
}

.brand:hover { text-decoration: none; color: var(--accent); }

.top-search {
  flex: 1;
  display: flex;
  min-width: 0;
}

.top-search input {
  width: 100%;
  min-height: var(--reach);
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--elevated);
  padding: 0 1rem;
  font: inherit;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.icon-btn,
.ghost-btn,
.primary-btn,
.soft-btn,
.danger-btn {
  min-height: var(--reach);
  min-width: var(--reach);
  border: none;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0 1rem;
}

.ghost-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.primary-btn {
  background: var(--accent);
  color: #0f1715;
}

.soft-btn {
  background: var(--accent-soft);
  color: var(--accent);
}

.danger-btn {
  background: var(--err-soft);
  color: var(--err);
}

.icon-btn {
  background: var(--paper);
  color: var(--muted);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.primary-btn:hover,
.soft-btn:hover,
.ghost-btn:hover,
.icon-btn:hover {
  filter: brightness(0.98);
  text-decoration: none;
}

main { display: grid; gap: 1.25rem; }

.home-status {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.25rem;
  padding: 0.15rem 0.1rem 0.25rem;
}

.home-status h1 {
  font-family: var(--display);
  font-size: clamp(1.55rem, 3.6vw, 1.95rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.25rem;
}

.home-status .lede {
  margin: 0;
  max-width: 28rem;
}

.status-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.status-pill {
  display: grid;
  gap: 0.05rem;
  min-width: 4.6rem;
  padding: 0.55rem 0.8rem;
  border-radius: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--muted);
  text-decoration: none;
  box-shadow: var(--shadow);
}

.status-pill strong {
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.1;
}

.status-pill span {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: lowercase;
}

.status-pill:hover {
  border-color: #4a5c54;
  color: var(--accent);
  text-decoration: none;
}

.status-pill.hot {
  background: var(--warn-soft);
  border-color: transparent;
}

.status-pill.hot strong { color: var(--warn); }
.status-pill.hot span { color: color-mix(in srgb, var(--warn) 80%, var(--muted)); }

.hero {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.25rem 1.25rem 1rem;
  box-shadow: var(--shadow);
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(1.7rem, 4vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.35rem;
}

.lede {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 1.02rem;
}

.composer textarea,
.composer input,
.stack input,
.stack textarea,
.stack select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--elevated);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  caret-color: var(--accent);
}

.composer textarea::placeholder,
.composer input::placeholder,
.stack input::placeholder,
.stack textarea::placeholder,
.top-search input::placeholder {
  color: color-mix(in srgb, var(--muted) 80%, transparent);
}

.composer textarea {
  min-height: 88px;
  resize: vertical;
  line-height: 1.45;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom: none;
}

.composer-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 12px 12px;
  background: color-mix(in srgb, var(--elevated) 70%, #000);
}

.composer-tools .grow { flex: 1; min-width: 8rem; }

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip {
  min-height: 36px;
  padding: 0 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
}

.chip:hover { color: var(--ink); text-decoration: none; border-color: #4a5c54; }
.chip.active { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem 1.1rem;
  box-shadow: var(--shadow);
}

.panel-focus {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 55%, var(--paper)), var(--paper) 42%);
  padding-top: 1.15rem;
}

.panel-focus .panel-head h2 {
  font-size: 1.4rem;
}

.panel-notes .item-note {
  border-left: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
}

.panel-quiet {
  box-shadow: none;
  background: transparent;
  border-style: dashed;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.panel-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.panel-head .count {
  color: var(--muted);
  font-size: 0.9rem;
}

.panel-foot {
  margin: 0.9rem 0 0;
}

.list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.65rem;
}

.list-priority {
  gap: 0.8rem;
}

.item {
  display: grid;
  gap: 0.35rem;
  padding: 0.9rem 0.95rem;
  border-radius: 12px;
  background: var(--elevated);
  border: 1px solid transparent;
}

.item:hover { border-color: var(--line); background: color-mix(in srgb, var(--elevated) 80%, #000); }

.list-priority .item-reminder {
  padding: 1.05rem 1.05rem;
  border-color: color-mix(in srgb, var(--line) 70%, transparent);
}

.item.compact {
  padding: 0.75rem 0.85rem;
  gap: 0.25rem;
}

.item-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}

.list-priority .item-title {
  font-size: 1.18rem;
  letter-spacing: -0.01em;
}

.item-title:hover { color: var(--accent); text-decoration: none; }

.item-body {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.para-tag {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.82rem;
}

.item-meta {
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  align-items: center;
}

.when {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.88rem;
}

.when.overdue { color: var(--warn); }

.recur {
  color: var(--ok);
  font-weight: 600;
  font-size: 0.82rem;
}

.edit-reminder { flex: 1 0 100%; }

.edit-reminder summary {
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  width: fit-content;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

.edit-reminder .stack { margin-top: 0.15rem; }

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.35rem;
}

.item-actions .soft-btn,
.item-actions .ghost-btn,
.item-actions .danger-btn,
.item-actions .primary-btn {
  min-height: 40px;
  font-size: 0.9rem;
}

.empty {
  color: var(--muted);
  padding: 0.35rem 0.15rem 0.15rem;
  margin: 0;
}

.flash {
  margin: 0;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  font-weight: 500;
}

.flash-ok { background: var(--ok-soft); color: var(--ok); }
.flash-error { background: var(--err-soft); color: var(--err); }

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

.dock {
  position: fixed;
  left: 50%;
  bottom: 0.85rem;
  transform: translateX(-50%);
  width: min(760px, calc(100% - 1.25rem));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  padding: 0.4rem;
  background: color-mix(in srgb, var(--paper) 88%, #000);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  z-index: 20;
}

.dock a {
  min-height: var(--reach);
  border-radius: 14px;
  display: grid;
  place-content: center;
  gap: 0.1rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
}

.dock a span { font-size: 1.05rem; line-height: 1; }
.dock a:hover,
.dock a.active {
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.login {
  width: min(400px, 100%);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.6rem;
  box-shadow: var(--shadow);
}

.login h1 {
  font-family: var(--display);
  margin: 0 0 0.35rem;
  font-size: 2rem;
}

.places {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.35rem;
}

.note-editor textarea { min-height: 280px; line-height: 1.5; }

.capture-drawer {
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 0;
  box-shadow: none;
}

.capture-drawer > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  min-height: var(--reach);
  padding: 0.85rem 1.1rem;
  user-select: none;
}

.capture-drawer > summary::-webkit-details-marker { display: none; }

.capture-drawer-title {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.capture-drawer > summary::after {
  content: "+";
  color: var(--muted);
  font-weight: 700;
  font-size: 1.1rem;
  margin-left: auto;
}

.capture-drawer[open] > summary::after { content: "–"; }

.capture-drawer[open] {
  border-style: solid;
  box-shadow: var(--shadow);
}

.capture-drawer-body {
  display: grid;
  gap: 0.85rem;
  padding: 0 1.1rem 1.1rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.muted { color: var(--muted); }

.quick-remind {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.15rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--line);
}

.quick-remind .row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.45rem;
}

.quick-remind select {
  width: 100%;
  max-width: 16rem;
  min-height: var(--reach);
  font: inherit;
  color: var(--ink);
  background: var(--elevated);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 0.75rem;
}

@media (max-width: 640px) {
  .shell { padding-inline: 0.85rem; }
  .home-status { align-items: stretch; }
  .status-pills { width: 100%; }
  .status-pill { flex: 1; text-align: center; }
  .quick-remind .row { grid-template-columns: 1fr; }
  .composer-tools { flex-direction: column; align-items: stretch; }
  .composer-tools .primary-btn,
  .composer-tools .soft-btn { width: 100%; }
}
