/* The Guardian Protocol — v0.1. Calm, quiet, holding-page aesthetic.
   Zero web fonts (offline-first). Respects light/dark. — C1n, 2026-06-12. */

:root {
  --bg: #f4f1ea;          /* warm parchment */
  --panel: #fbfaf6;
  --ink: #20262e;
  --ink-soft: #4a535e;
  --line: #ddd6c8;
  --accent: #2f4858;      /* deep slate-teal */
  --accent-soft: #e7eced;
  --accent-ink: #1d2733;
  --crisis-bg: #f7ece8;
  --crisis-ink: #6e2a1e;
  --crisis-line: #e3c4ba;
  --good: #2e5d43;
  --flag: #8a4b2a;
  --shadow: 0 1px 3px rgba(30,30,30,.06), 0 6px 24px rgba(30,30,30,.05);
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161b21;
    --panel: #1d242c;
    --ink: #e7e3d8;
    --ink-soft: #a9b1ba;
    --line: #2c353f;
    --accent: #8fb3c4;
    --accent-soft: #233038;
    --accent-ink: #cfe0ea;
    --crisis-bg: #2a1f1c;
    --crisis-ink: #f0c6b8;
    --crisis-line: #4a322b;
    --good: #87c2a0;
    --flag: #d39b76;
    --shadow: 0 1px 3px rgba(0,0,0,.3), 0 6px 24px rgba(0,0,0,.25);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-ink); }

/* crisis bar */
.crisis {
  background: var(--crisis-bg);
  border-bottom: 1px solid var(--crisis-line);
  color: var(--crisis-ink);
  padding: 10px 18px;
}
.crisis p { margin: 0 auto; max-width: 760px; font-size: 14.5px; line-height: 1.5; }
.crisis a { color: var(--crisis-ink); font-weight: 600; }

/* masthead */
.masthead { max-width: 760px; margin: 0 auto; padding: 38px 22px 18px; text-align: center; }
.wordmark .inst { letter-spacing: .18em; font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.masthead h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(30px, 6vw, 42px); margin: 8px 0 12px; letter-spacing: -.01em; }
.tagline { color: var(--ink-soft); max-width: 560px; margin: 0 auto; font-size: 16px; }

/* tabs */
.tabs {
  position: sticky; top: 0; z-index: 5;
  display: flex; gap: 4px; justify-content: center;
  max-width: 760px; margin: 14px auto 0; padding: 8px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.tab {
  flex: 1 1 0; max-width: 150px;
  font-family: var(--sans); font-size: 15px; font-weight: 600;
  color: var(--ink-soft); background: transparent;
  border: 0; border-radius: 9px; padding: 10px 6px; cursor: pointer;
  transition: background .15s, color .15s;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--accent-ink); background: var(--accent-soft); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* screens */
main { max-width: 720px; margin: 0 auto; padding: 24px 22px 8px; }
.screen { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.lede { font-size: 18px; color: var(--ink); border-left: 3px solid var(--accent); padding-left: 16px; margin: 6px 0 26px; }
.sub { color: var(--ink-soft); font-size: 15.5px; margin-top: -8px; }
h2 { font-family: var(--serif); font-weight: 600; font-size: 23px; margin: 34px 0 12px; }
h3 { font-size: 18px; margin: 22px 0 8px; }
.footnote { font-size: 14px; color: var(--ink-soft); border-top: 1px solid var(--line); padding-top: 16px; margin-top: 30px; }

/* read: layers */
ol.layers, ol.steps { padding-left: 0; list-style: none; counter-reset: n; }
ol.layers li, ol.steps li {
  counter-increment: n; position: relative;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 18px 16px 56px; margin: 10px 0; box-shadow: var(--shadow);
}
ol.layers li::before, ol.steps li::before {
  content: counter(n); position: absolute; left: 16px; top: 16px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-ink);
  font-weight: 700; font-size: 14px; display: grid; place-items: center;
}

/* check: markers */
.markers { display: grid; gap: 8px; margin: 14px 0 4px; }
.markers .m {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 11px;
  padding: 13px 15px; cursor: pointer;
}
.markers .m input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--accent); flex: 0 0 auto; }
.markers .m span { font-size: 15.5px; }
.markers .m .mq { font-weight: 600; }
.result { margin: 16px 0 6px; padding: 0; font-size: 16px; min-height: 1px; }
.result .box { background: var(--accent-soft); border-radius: 11px; padding: 14px 16px; }
.result strong { color: var(--accent-ink); }

/* check: prompts */
.prompts { display: grid; gap: 12px; margin-top: 8px; }
.pcard { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 15px 16px; box-shadow: var(--shadow); }
.pcard .ptitle { font-weight: 700; margin-bottom: 2px; }
.pcard .pwhy { color: var(--ink-soft); font-size: 14px; font-style: italic; margin-bottom: 10px; }
.pcard .ptext { font-size: 15px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 11px 13px; margin-bottom: 10px; white-space: pre-wrap; }
button.copy, .pcard button, .noteactions button, #noteForm button {
  font-family: var(--sans); font-size: 14.5px; font-weight: 600;
  background: var(--accent); color: #fff; border: 0; border-radius: 9px;
  padding: 9px 16px; cursor: pointer; transition: opacity .15s, transform .05s;
}
@media (prefers-color-scheme: dark) { button.copy, .pcard button, .noteactions button, #noteForm button { color: #10161b; } }
button.copy:hover, .pcard button:hover { opacity: .9; }
button.copy:active { transform: translateY(1px); }
button.copied { background: var(--good) !important; }
.fresh { background: var(--accent-soft); border-radius: 12px; padding: 18px; margin-top: 22px; }
.fresh h3 { margin-top: 0; }

/* anchor */
.oneline { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--flag); border-radius: 10px; padding: 14px 18px; margin: 22px 0; }
.resources { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 20px 16px; margin-top: 14px; }
.resources ul { list-style: none; padding: 0; }
.resources li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15.5px; }
.resources li:last-child { border-bottom: 0; }

/* note */
.notecompose textarea {
  width: 100%; font-family: var(--sans); font-size: 16px; line-height: 1.5;
  color: var(--ink); background: var(--panel);
  border: 1px solid var(--line); border-radius: 11px; padding: 13px 15px; resize: vertical;
}
.notecompose textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.noteactions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
button.secondary { background: transparent !important; color: var(--accent) !important; border: 1px solid var(--line) !important; }
button.danger { color: var(--flag) !important; }
.noteslist { margin-top: 22px; display: grid; gap: 10px; }
.notecard { background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 12px 15px; }
.notecard .nt { font-size: 12.5px; color: var(--ink-soft); letter-spacing: .02em; margin-bottom: 5px; display: flex; justify-content: space-between; align-items: center; }
.notecard .nt button { background: none; border: 0; color: var(--ink-soft); cursor: pointer; font-size: 12.5px; padding: 2px 4px; }
.notecard .nb { white-space: pre-wrap; font-size: 15.5px; }
.empty { color: var(--ink-soft); font-style: italic; text-align: center; padding: 20px; }

/* footer */
.sitefoot { max-width: 720px; margin: 28px auto 0; padding: 22px; border-top: 1px solid var(--line); text-align: center; color: var(--ink-soft); font-size: 13.5px; }
.sitefoot a { color: var(--ink-soft); }
.privacy { max-width: 520px; margin: 8px auto 0; }

/* companion (v0.2) */
.cstatus { border-radius: 11px; padding: 13px 16px; margin: 6px 0 16px; font-size: 15px; border: 1px solid var(--line); background: var(--panel); color: var(--ink-soft); }
.cstatus.ok { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.cstatus.off { background: var(--crisis-bg); color: var(--crisis-ink); border-color: var(--crisis-line); }
.csetup { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 4px 16px; margin-bottom: 18px; }
.csetup summary { cursor: pointer; font-weight: 600; padding: 12px 0; }
.csetup code { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: 14px; }
.csetup ol { padding-left: 20px; }
.csetup li { margin: 8px 0; }
.ccompose textarea {
  width: 100%; font-family: var(--sans); font-size: 15.5px; line-height: 1.5;
  color: var(--ink); background: var(--panel);
  border: 1px solid var(--line); border-radius: 11px; padding: 13px 15px; resize: vertical; margin-top: 8px;
}
.ccompose textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.cprivacy { color: var(--ink-soft); font-size: 13px; align-self: center; }
.cresult { margin: 18px 0 6px; display: grid; gap: 10px; }
.cresult .box { background: var(--accent-soft); border-radius: 11px; padding: 14px 16px; font-size: 15.5px; }
.cresult .box.danger { background: var(--crisis-bg); color: var(--crisis-ink); border: 1px solid var(--crisis-line); }
.csummary strong, .cscope strong, .cnext strong { color: var(--accent-ink); }
.cscc { font-size: 14px; color: var(--ink-soft); letter-spacing: .02em; margin: 0; }
.cmarker { background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 12px 15px; }
.cmarker.on { border-left: 3px solid var(--flag); }
.cmarker.off { opacity: .72; }
.cmarker .ch { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.cmarker .cn { font-weight: 700; font-size: 15px; }
.cbadge { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.sev-none { background: var(--accent-soft); color: var(--ink-soft); }
.sev-isolated { background: var(--accent-soft); color: var(--accent-ink); }
.sev-recurring { background: color-mix(in srgb, var(--flag) 22%, var(--panel)); color: var(--flag); }
.sev-escalating { background: var(--crisis-bg); color: var(--crisis-ink); border: 1px solid var(--crisis-line); }
.csig { font-size: 14.5px; margin-top: 8px; white-space: pre-wrap; }
.csig.muted { color: var(--ink-soft); font-style: italic; }
.cneg { font-size: 14px; color: var(--ink-soft); margin-top: 7px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
