:root {
    --navy: #1A2E42; --navy-mid: #243B52; --olive: #C5D44E; --olive-pale: #EEF1C8;
    --off-white: #F8F9F2; --gray-200: #D8DEB8; --muted: #5A6A40; --coral: #D85A30;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  body { font-family: 'Public Sans', sans-serif; font-weight: 300; color: var(--navy); background: var(--off-white); line-height: 1.6; }
  .wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
  .home { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding-bottom: 12vh; transition: all .3s; }
  body.asked .home { min-height: 0; padding: 28px 0 8px; }
  .brand { font-weight: 900; font-size: clamp(40px, 8vw, 64px); letter-spacing: -1.5px; text-align: center; }
  .brand span { color: var(--olive); background: var(--navy); padding: 0 10px; border-radius: 8px; margin-left: 6px; }
  body.asked .brand { font-size: 28px; text-align: left; }
  .tag { text-align: center; color: var(--muted); margin: 8px 0 28px; font-size: 17px; }
  body.asked .tag { display: none; }
  form { display: flex; gap: 8px; background: #fff; border: 1px solid var(--gray-200); border-radius: 28px; padding: 6px 6px 6px 20px; box-shadow: 0 4px 24px rgba(26,46,66,.08); }
  form:focus-within { border-color: var(--navy); }
  textarea { flex: 1; border: 0; outline: 0; resize: none; font: inherit; font-weight: 400; font-size: 17px; padding: 10px 0; background: transparent; color: var(--navy); max-height: 50vh; }
  form { align-items: flex-end; } form.tall { border-radius: 18px; }
  form.expanded textarea { min-height: 40vh; }
  form button { min-height: 44px; }
  [hidden] { display: none !important; }
  .left { text-align: center; color: var(--muted); font-size: 13.5px; margin: 10px 0 0; }
  .gate { background: #fff; border: 1px solid var(--gray-200); border-radius: 18px; padding: 18px 22px; text-align: center; font-size: 16px; color: var(--navy); }
  .gate p { margin: 0 0 10px; } .gate p:last-child { margin: 0; }
  .gate-link { display: inline-block; background: var(--navy); color: #fff; font-weight: 700; text-decoration: none; border-radius: 22px; padding: 10px 20px; }
  .grow { background: transparent; color: var(--muted); padding: 0 10px; font-size: 18px; font-weight: 400; }
  .grow:hover, .grow[aria-pressed="true"] { color: var(--navy); }
  button { font: inherit; font-weight: 700; border: 0; cursor: pointer; border-radius: 22px; padding: 0 20px; background: var(--navy); color: #fff; }
  button:disabled { opacity: .5; cursor: default; }
  .chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
  body.asked .chips { display: none; }
  .chip { background: #fff; color: var(--navy); border: 1px solid var(--gray-200); font-weight: 400; font-size: 14px; padding: 8px 14px; }
  .chip:hover { border-color: var(--navy); }
  .thread { padding: 16px 0 80px; }
  /* FND-005: after the first answer the question box is pinned to the bottom, so follow-ups never need a scroll to the top. */
  .new-q { display: none; padding: 0 16px; white-space: nowrap; }
  body.asked .new-q { display: inline-flex; align-items: center; }
  .brand-row { display: flex; align-items: center; justify-content: center; gap: 12px; }
  body.asked .brand-row { justify-content: space-between; }
  body.asked form { position: fixed; left: 50%; transform: translateX(-50%); bottom: 12px; width: min(728px, calc(100% - 24px)); z-index: 10; box-shadow: 0 8px 32px rgba(26,46,66,.18); }
  body.asked .thread { padding-bottom: 140px; }
  .loading { color: var(--muted); padding: 20px 0; }
  .loading small { display: block; font-size: 13px; margin-top: 2px; }
  .q { font-weight: 700; margin: 28px 0 10px; font-size: 18px; }
  .card { background: #fff; border-radius: 12px; border-top: 5px solid var(--olive); padding: 24px 28px; box-shadow: 0 4px 24px rgba(26,46,66,.08); }
  .card.clarify { border-top-color: var(--navy-mid); }
  .card.warn { border-top-color: var(--coral); }
  .card h2 { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); margin: 22px 0 6px; }
  .card h2:first-child { margin-top: 0; }
  .card p, .card li { font-size: 16.5px; margin-bottom: 8px; }
  .card ol, .card ul { padding-left: 22px; }
  .card strong { font-weight: 700; }
  /* FND-005: citation numbers keep their small look but get a 44 px touch area. */
  sup a { position: relative; display: inline-block; font-size: 11px; font-weight: 700; text-decoration: none; background: var(--olive-pale); color: var(--navy); border-radius: 4px; padding: 0 4px; margin-left: 2px; line-height: 1.5; }
  sup a::after { content: ""; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); }
  .jump { display: inline-flex; align-items: center; min-height: 44px; margin: -8px 0 6px; font-size: 14px; font-weight: 700; color: var(--navy); }
  .answer-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
  .answer-actions button, .new-q { min-height: 44px; font-size: 14px; border: 1px solid var(--navy); }
  .answer-actions .ghost, .new-q { background: #fff; color: var(--navy); }
  .deeper { margin-top: 18px; border-top: 1px solid var(--gray-200); padding-top: 4px; }
  .deeper > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); }
  .deeper[open] > summary { margin-bottom: 8px; }
  .src-group { margin-bottom: 14px; }
  .src-title { display: inline-flex; align-items: center; min-height: 32px; font-weight: 700; font-size: 14.5px; color: var(--navy); }
  .src { display: grid; grid-template-columns: 26px 1fr; gap: 4px 8px; margin: 6px 0 10px; font-size: 14px; border-radius: 6px; }
  .src .n { font-weight: 700; background: var(--olive-pale); border-radius: 4px; text-align: center; height: 20px; font-size: 12px; line-height: 20px; }
  .src blockquote { grid-column: 2; color: var(--muted); font-style: italic; border-left: 2px solid var(--gray-200); padding-left: 10px; }
  .passage-link { font-style: normal; font-weight: 700; font-size: 13px; color: var(--navy); white-space: nowrap; }
  .src.flash { animation: flash 1.6s ease-out; }
  @keyframes flash { 0% { background: var(--olive-pale); } 100% { background: transparent; } }
  .loading b { font-weight: 400; font-style: italic; }
  .loading b::after { content: ""; animation: dots 1.2s steps(4) infinite; }
  @keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
  .follow { margin-top: 18px; }
  .meta { font-size: 12px; color: var(--muted); margin-top: 10px; }
  .still-writing { font-size: 13px; color: var(--muted); font-style: italic; margin: 14px 0 6px; }
  .still-writing::after { content: ""; animation: dots 1.2s steps(4) infinite; }
  .cta { margin-top: 14px; font-size: 14px; }
  .cta a { color: var(--navy); font-weight: 700; }
  @media (max-width: 560px) { .card { padding: 18px; } body.asked .brand { font-size: 22px; letter-spacing: -1px; } .new-q { padding: 0 12px; font-size: 13px; } .brand-row { gap: 8px; } }

.applied { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--navy-mid); background: #E4EAF0; border-radius: 4px; padding: 1px 6px; margin-left: 4px; vertical-align: 1px; }
.card .kit { margin-top: 10px; border: 1px solid var(--gray-200); border-radius: 10px; background: var(--off-white); }
.card .kit-head { display: flex; gap: 12px; align-items: center; padding: 12px 14px; }
.card .kit-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--olive); display: grid; place-items: center; font-weight: 900; font-size: 13px; flex: none; }
.card .kit-name { font-weight: 700; font-size: 15px; }
.card .kit-desc { font-size: 13.5px; color: var(--muted); }
.card .kit-actions { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 14px 12px; }
.card .kit-actions button, .card .kit-actions a { font: inherit; font-size: 13px; font-weight: 700; border-radius: 18px; padding: 7px 14px; text-decoration: none; cursor: pointer; border: 1px solid var(--navy); }
.card .kit-actions .primary { background: var(--navy); color: #fff; }
.card .kit-actions .ghost { background: #fff; color: var(--navy); }
.card details.prompt { padding: 0 14px 12px; }
.card details.prompt summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--navy-mid); }
.card details.prompt pre { white-space: pre-wrap; font: 13px/1.5 ui-monospace, Menlo, monospace; background: #fff; border: 1px solid var(--gray-200); border-radius: 8px; padding: 12px; margin-top: 8px; max-height: 320px; overflow: auto; }

/* KIT-001: prompts under each move, compact. */
.kit-privacy { font-size: 13px !important; color: var(--muted); margin: 0 0 8px; }
.card li .kit-inline { margin: 8px 0 14px; }
.card .kit-inline .kit-head { padding: 10px 12px 6px; }
.card .kit-inline .kit-name { font-size: 14px; }
.card .kit-inline .kit-desc { font-size: 13px; }
.card .kit-inline .kit-actions { padding: 0 12px 6px; }
.card .kit-actions button, .card .kit-actions a { min-height: 44px; display: inline-flex; align-items: center; }
.card .kit-inline details.prompt { padding: 0 12px 10px; }
.card .kit-inline details.prompt summary { min-height: 32px; display: flex; align-items: center; }
.kit-note { font-size: 13px; color: var(--navy-mid); padding: 0 12px; }
.kit-note:empty { display: none; }

/* KIT-001 revision 3: one line saying what the reader's AI will ask for first. */
.kit-asks { font-size: 13px; color: var(--navy-mid); padding: 0 12px 8px; }

/* CAP-003: reader feedback */
.fb { margin: 16px 0 4px; padding: 12px 14px; border: 1px solid var(--gray-200); border-radius: 10px; background: var(--off-white); }
.fb-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fb-q { font-weight: 700; margin-right: 4px; }
.fb button[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.fb-ask { margin: 12px 0 8px; font-size: 14px; }
.fb-reasons { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-note { display: block; width: 100%; box-sizing: border-box; margin-top: 10px; font: inherit; padding: 8px 10px; border: 1px solid var(--gray-200); border-radius: 8px; }
.fb-send { margin-top: 10px; }
.fb-thanks { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.fb-thanks:empty { display: none; }
.fb .ghost { background: #fff; color: var(--navy); border: 1px solid var(--gray-200); }
.fb button.ghost[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }

/* FN-001: a Field Note from Tim among the sources */
.src-group.field-note .src-title { color: var(--navy); font-weight: 700; text-decoration: none; }
.src-group.field-note blockquote { border-left-color: var(--navy); }
