:root {
  --bg: #f6f4ef; --card: #ffffff; --text: #1d1d1b; --muted: #66655f;
  --line: #d9d5ca; --accent: #1b6e52; --accent-text: #ffffff; --chip: #eaf1ed;
  --code: #f0ede6;
  --shadow: 0 0 0 1px oklch(0 0 0 / 0.06), 0 1px 2px oklch(0 0 0 / 0.06), 0 4px 12px oklch(0 0 0 / 0.04);
  --bar-shadow: 0 -1px 0 oklch(0 0 0 / 0.08), 0 -8px 24px oklch(0 0 0 / 0.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141513; --card: #1e1f1c; --text: #ecebe6; --muted: #a8a79f;
    --line: #3a3b35; --accent: #4cb98f; --accent-text: #0d1410; --chip: #22302a;
    --code: #2a2b27;
    --shadow: 0 0 0 1px oklch(1 0 0 / 0.07), 0 1px 2px oklch(0 0 0 / 0.4), 0 4px 12px oklch(0 0 0 / 0.25);
    --bar-shadow: 0 -1px 0 oklch(1 0 0 / 0.08), 0 -8px 24px oklch(0 0 0 / 0.3);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
main { max-width: 880px; margin: 0 auto; padding: 32px 16px 200px; }
main.doc { max-width: 760px; padding-bottom: 64px; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem); line-height: 1.2; margin: 0 0 8px; text-wrap: balance; letter-spacing: -0.01em; }
h2 { font-size: 1.2rem; margin: 40px 0 12px; text-wrap: balance; }
h3 { font-size: 1.02rem; margin: 20px 0 8px; }
p { margin: 0 0 12px; text-wrap: pretty; }
a { color: var(--accent); text-underline-offset: 2px; }
.muted { color: var(--muted); font-size: .95rem; }
.back { display: inline-block; margin-bottom: 16px; text-decoration: none; }

/* surfaces: shadow for elevation; transparent border keeps an edge in forced-colors */
.card {
  background: var(--card); border: 1px solid transparent; border-radius: 14px;
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 12px;
}
.task-title { font-weight: 600; }
.task-now { color: var(--muted); font-size: .92rem; margin: 2px 0 12px; max-width: 70ch; }

/* form fields */
label { display: block; font-size: .85rem; color: var(--muted); margin: 10px 0 4px; }
input[type=text], textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px;
  transition-property: border-color, background-color; transition-duration: 150ms; transition-timing-function: ease-out;
}
textarea { min-height: 76px; resize: vertical; }
input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.fields .wide { grid-column: 1 / -1; }
.fields label { margin-top: 6px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 520px) {
  .fields, .row { grid-template-columns: 1fr; }
}
/* desktop: one line per task (who · time · automate · notes) */
@media (min-width: 900px) {
  .fields { grid-template-columns: 1fr 0.8fr auto 1.4fr; align-items: end; }
  .fields .wide { grid-column: auto; }
}
.choices { display: flex; gap: 6px; flex-wrap: wrap; }
.choices label {
  margin: 0; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  background: var(--chip); color: var(--text); border-radius: 999px; padding: 8px 14px; font-size: .95rem;
  border: 1px solid transparent;
  transition-property: background-color, border-color; transition-duration: 150ms; transition-timing-function: ease-out;
}
.choices label:has(input:checked) { border-color: var(--accent); }
.choices input { accent-color: var(--accent); margin: 0; }

.pickup { border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 8px; }
.pickup:first-child { border-top: 0; margin-top: 0; padding-top: 0; }

/* buttons */
button {
  font: inherit; border-radius: 10px; padding: 12px 18px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  transition-property: background-color, border-color, scale; transition-duration: 150ms; transition-timing-function: ease-out;
}
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
button.link { border: 0; background: none; color: var(--accent); padding: 8px 0; }
@media (prefers-reduced-motion: no-preference) {
  button:not(:disabled):active { scale: 0.96; }
}
@media (hover: hover) {
  button:not(.primary):not(.link):hover { background: var(--chip); }
  button.primary:hover { background: color-mix(in oklch, var(--accent), white 8%); }
  .choices label:hover { border-color: var(--line); }
  .tile:hover { box-shadow: var(--shadow), 0 0 0 2px var(--accent); }
}

/* sticky send bar */
.bar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); box-shadow: var(--bar-shadow); padding: 12px 16px; }
.bar-inner { max-width: 880px; margin: 0 auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.bar-inner button { flex: 1 1 200px; }
#status { width: 100%; font-size: .9rem; color: var(--muted); min-height: 1.2em; }
@media (min-width: 900px) {
  .bar-inner { flex-wrap: nowrap; }
  .bar-inner button { flex: 0 0 auto; }
  #status { flex: 1; width: auto; order: -1; }
}

/* start page tiles */
.tiles { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 20px 0; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
.tile {
  display: block; text-decoration: none; color: var(--text); background: var(--card);
  border: 1px solid transparent; border-radius: 14px; box-shadow: var(--shadow); padding: 20px;
  transition-property: box-shadow; transition-duration: 150ms; transition-timing-function: ease-out;
}
.tile strong { display: block; color: var(--accent); font-size: 1.05rem; margin-bottom: 4px; }
.tile span { color: var(--muted); font-size: .95rem; }

/* documents */
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { color: var(--muted); font-weight: 600; font-size: .85rem; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid transparent; border-radius: 14px; box-shadow: var(--shadow); margin-bottom: 16px; }
ol li, ul li { margin-bottom: 8px; }
code {
  font: .9em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--code);
  border-radius: 6px; padding: 2px 6px;
}
td code { white-space: nowrap; }
pre.msg {
  font: .88rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap;
  background: var(--code); border-radius: 10px; padding: 12px 14px; margin: 8px 0 12px; overflow-x: auto;
}
.note { border-left: 3px solid var(--accent); padding: 4px 0 4px 14px; margin: 16px 0; }
.note p:last-child { margin-bottom: 0; }
