/* Monday Morning Shepherd: the pastor's Monday screen, phone first. The material is notes on
   paper: an AI draft is a pencilled outline, and the pastor's own note is in ink. */
:root {
  --paper: #f6f3ec;
  --card: #fffdf8;
  --ink: #1f2933;
  --muted: #5b6573;
  --line: #e2ddd2;
  --pencil: #9aa3ae;
  --accent: #2c6450;
  --accent-ink: #ffffff;
  --accent-soft: #e3efe9;
  --flag: #8a5a00;
  --flag-soft: #fbf1dc;
  --now: #8f2d2d;
  --now-soft: #f9e9e7;
  --focus: #1d5fbf;
  --radius: 14px;
  --gutter: 16px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #15191e;
    --card: #1d2228;
    --ink: #ece8df;
    --muted: #a3acb8;
    --line: #313840;
    --pencil: #6f7883;
    --accent: #7cc4a6;
    --accent-ink: #0f1a15;
    --accent-soft: #1f3129;
    --flag: #f0c46b;
    --flag-soft: #33291a;
    --now: #f2a19a;
    --now-soft: #3a2223;
    --focus: #8ab4ff;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
}
#app { max-width: 640px; margin: 0 auto; padding: 0 var(--gutter) 64px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); }

/* Header */
.top { padding: 12px 0 8px; }
.banner { margin: 0; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-height: 44px; }
.banner .confirm { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: var(--ink); }
h1 { margin: 4px 0 0; font: 600 28px/1.15 var(--serif); letter-spacing: -0.01em; }
.eyebrow { display: block; font: 600 12px/1.4 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 2px; }

/* Sections */
.section { margin-top: 28px; }
h2 { display: flex; align-items: baseline; gap: 8px; margin: 0 0 12px; font: 600 20px/1.2 var(--serif); }
.n { font: 600 13px/1 var(--sans); color: var(--muted); }
.section.now h2 { color: var(--now); }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.card > header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
h3 { margin: 0; font-size: 19px; line-height: 1.25; }
.badge { flex: none; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.reasons { list-style: none; margin: 8px 0 12px; padding: 0; display: grid; gap: 6px; }
.reasons li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.chip { flex: none; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.chip-G1 { background: var(--now-soft); color: var(--now); }
.why { color: var(--muted); font-size: 15px; min-width: 0; overflow-wrap: anywhere; }

/* The note: pencil (AI) or ink (his). Two frames sit on top of each other and only their opacity changes. */
.note { position: relative; padding: 12px 14px; border-radius: 10px; background: var(--paper); }
.note::before, .note::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; }
.note::before { border: 1.5px dashed var(--pencil); opacity: 0; }
.note::after { border: 1.5px solid var(--ink); opacity: 0.85; }
.note.ai::before { opacity: 1; }
.note.ai::after { opacity: 0; }
.note.settling::before { animation: pencil-out var(--motion-duration-fill) var(--motion-easing-exit) both; }
.note.settling::after { animation: ink-in var(--motion-duration-fill) var(--motion-easing-enter) both; }
@keyframes pencil-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes ink-in { from { opacity: 0; } to { opacity: 0.85; } }
.ai-label { margin: 0 0 6px; font-size: 13px; font-style: italic; color: var(--muted); }
.yours { width: fit-content; margin: 8px 0 0; padding: 0 4px 0 0; font: italic 600 14px/1.3 var(--serif); color: var(--ink); }
/* While it travels down the note, the mark is a slip of paper sliding over the text. */
.yours.flying { position: relative; z-index: 1; background: var(--paper); box-shadow: 0 0 0 4px var(--paper); }
.yours span { font-weight: 400; color: var(--muted); }
.text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

.flags { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.flag { padding: 8px 10px; border-radius: 8px; background: var(--flag-soft); color: var(--ink); font-size: 14px; }
.flag strong { color: var(--flag); margin-right: 4px; }

/* Controls: every tap target is at least 44 px. */
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.btn {
  min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font: 600 15px/1 var(--sans); cursor: pointer;
  display: inline-flex; align-items: center; text-decoration: none;
  transition: background-color var(--motion-duration-hover) var(--motion-easing-standard);
}
.btn:active { background: var(--line); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--accent); padding: 0 8px; }
.btn.busy { opacity: 0.6; cursor: progress; }
.link { min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--accent); font: 600 13px/1 var(--sans); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.hint { margin: 0; flex-basis: 100%; font-size: 13px; color: var(--muted); }
.state { margin: 8px 0 0; color: var(--muted); }
.state.done { color: var(--accent); font-weight: 600; }
.error { margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--now-soft); color: var(--now); font-weight: 600; font-size: 14px; }

textarea, input, select {
  width: 100%; font: 16px/1.45 var(--sans); color: var(--ink); background: var(--card);
  border: 1px solid var(--pencil); border-radius: 10px; padding: 10px 12px;
}
textarea { resize: vertical; min-height: 160px; }
select, input { min-height: 44px; }
.row select { flex: 1 1 180px; width: auto; min-width: 0; }
.count { margin: 4px 0 0; font-size: 13px; color: var(--muted); text-align: right; }
.count.over { color: var(--flag); font-weight: 600; }
.label { margin: 12px 0 0; font-weight: 600; font-size: 15px; display: block; }
.follow { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.follow > .label:first-child, .follow > .hint:first-child { margin-top: 0; }
.picks { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.pick { min-height: 44px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font: 14px/1 var(--sans); cursor: pointer; }

/* Pastor now */
.card.now { border-color: var(--now); background: var(--now-soft); }
.card.now h3 { color: var(--now); }
.card.now .chip-G1 { background: var(--card); }
.lifeline { margin: 10px 0 0; font-weight: 600; }

/* Not listed, folded */
.not-listed summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 8px; min-height: 44px; }
.not-listed summary::-webkit-details-marker { display: none; }
.not-listed summary h2 { margin: 0; }
.not-listed summary::after { content: "Show"; margin-left: auto; font: 600 13px/1 var(--sans); color: var(--accent); }
.not-listed[open] summary::after { content: "Hide"; }
.not-listed ul { list-style: none; margin: 4px 0 0; padding: 0; }
.not-listed li { padding: 10px 0; border-top: 1px solid var(--line); }
.not-listed li .why { display: block; }

@media (prefers-reduced-motion: reduce) {
  .note.settling::before, .note.settling::after { animation: none; }
}
