/* Loops — mobile-first, dark by default, big touch targets.
   Min 18px body text; the capture box is the largest thing on the screen. */

:root {
  --bg: #12131a;
  --surface: #1b1d27;
  --surface-2: #242736;
  --text: #e8e9f0;
  --muted: #9aa0b4;
  --accent: #7c6cff;
  --accent-ink: #ffffff;
  --ok: #4bd39a;
  --warn: #f0b34a;
  --radius: 14px;
  --gap: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 18px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

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

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  background: var(--surface);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; letter-spacing: .04em; color: var(--text); text-decoration: none; }
.topbar nav a { color: var(--muted); text-decoration: none; margin-left: 18px; }
.topbar nav a:hover { color: var(--text); }

main { max-width: 640px; margin: 0 auto; padding: var(--gap); }

/* --- capture --- */
.capture form { display: flex; flex-direction: column; gap: 12px; }

#title {
  width: 100%;
  font-size: 22px;
  line-height: 1.4;
  padding: 18px;
  border-radius: var(--radius);
  border: 2px solid var(--surface-2);
  background: var(--surface);
  color: var(--text);
  resize: vertical;
}
#title:focus { outline: none; border-color: var(--accent); }

button {
  font-size: 18px;
  border: none;
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
}
.primary { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.primary:active { transform: translateY(1px); }
.ghost {
  background: transparent; color: var(--muted);
  padding: 8px; text-align: left; font-size: 16px;
}
.ghost:hover { color: var(--text); }

#detail { display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }
#detail label { display: flex; flex-direction: column; gap: 6px; font-size: 15px; color: var(--muted); }
#detail input, #detail select, #detail textarea {
  font-size: 18px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--surface-2);
  background: var(--surface);
  color: var(--text);
}

.flash { min-height: 1.4em; color: var(--ok); font-weight: 600; }

/* --- list --- */
.list h1 { font-size: 24px; margin: 8px 0 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip {
  background: var(--surface); color: var(--muted);
  padding: 8px 14px; font-size: 15px; border-radius: 999px;
}
.chip.active { background: var(--accent); color: var(--accent-ink); }

.loops { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.loop {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  border-left: 4px solid var(--surface-2);
}
.loop.status-doing  { border-left-color: var(--warn); }
.loop.status-done   { border-left-color: var(--ok); opacity: .6; }
.loop.status-someday, .loop.status-blocked { border-left-color: var(--muted); opacity: .7; }
.loop .title { font-size: 19px; }
.loop .meta { font-size: 14px; color: var(--muted); margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; }
.loop .tag { background: var(--surface-2); border-radius: 6px; padding: 1px 8px; }
.loop .actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.loop .actions button { font-size: 14px; padding: 8px 12px; background: var(--surface-2); color: var(--text); }

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

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f5f6fa; --surface: #ffffff; --surface-2: #e9ebf2;
    --text: #1a1c25; --muted: #5a6076; --accent-ink: #fff;
  }
}

/* --- auth pages --- */
.authbox { max-width: 420px; margin: 8vh auto 0; display: flex; flex-direction: column; gap: 14px; }
.authbox h1 { font-size: 24px; margin: 0; }
.authbox form { display: flex; flex-direction: column; gap: 12px; }
.authbox label { display: flex; flex-direction: column; gap: 6px; font-size: 15px; color: var(--muted); }
.authbox input, .authbox select {
  font-size: 18px; padding: 12px; border-radius: 10px;
  border: 1px solid var(--surface-2); background: var(--surface); color: var(--text);
}
.authbox a { color: var(--accent); }
.small { font-size: 14px; }
