/* Annex — Lumen Civic team wiki.
   Charcoal top bar, stone page tree, paper document. Ochre marks the open page. */

[hidden] { display: none !important; }

:root {
  --brand: #24211E;
  --brand-accent: #E0A23A;
  --brand-ink: #1E1C19;
  --charcoal: var(--brand);
  --board: #312C27;
  --ochre: var(--brand-accent);
  --ochre-ink: #6B4A0C;
  --ochre-soft: rgba(224, 162, 58, 0.16);
  --leaf: #E6E2DA;
  --stone: #efebe3;
  --paper: #faf8f3;
  --ink: var(--brand-ink);
  --muted: #5C564E;
  --muted-2: #8d867a;
  --line: #ddd6ca;
  --spine-muted: #C8BEB2;
  --seam: #4A453E;
  --error: #8C2F1B;
  --serif: Petrona, Georgia, "Iowan Old Style", Palatino, serif;
  --sans: "Public Sans", "Segoe UI", sans-serif;
  --bar-h: 50px;
  --r: 6px;
  /* motion: one ease-out curve, three durations */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --dur-fast: 160ms;
  --dur: 180ms;
  --dur-slow: 220ms;
}

@keyframes ax-fade-in { from { opacity: 0; } }
@keyframes ax-rise-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes ax-toast-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes ax-appear { to { opacity: 1; } }
@keyframes ax-bar-run { from { background-position-x: -70%; } to { background-position-x: 170%; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, dl, dd { margin: 0; }
ul { margin: 0; padding: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; }

:focus-visible { outline: 2px solid var(--ochre-ink); outline-offset: 2px; }
.bar :focus-visible { outline-color: var(--ochre); }
::selection { background: var(--ochre); color: var(--charcoal); }

.skip {
  position: absolute;
  left: 0.5rem;
  top: 0.5rem;
  z-index: 30;
  padding: 0.55rem 0.9rem;
  background: var(--ochre);
  color: var(--charcoal);
  transform: translateY(-150%);
}
.skip:focus { transform: none; }

.noscript { margin: 0; padding: 0.8rem 1rem; background: var(--ochre); color: var(--charcoal); }

.toast {
  position: fixed;
  z-index: 25;
  left: 1rem;
  bottom: 1rem;
  max-width: min(24rem, calc(100vw - 2rem));
  padding: 0.75rem 1rem;
  background: var(--charcoal);
  color: var(--leaf);
  border-left: 4px solid var(--ochre);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  animation: ax-toast-in var(--dur-slow) var(--ease);
}
.toast.is-err { border-left-color: #E07A5F; }

/* ---------- boot ---------- */
.boot {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.4rem;
  padding: 2rem;
  background: var(--charcoal);
  color: var(--leaf);
  transition: opacity var(--dur-slow) var(--ease);
}
.boot.is-done { opacity: 0; pointer-events: none; }
#shell:not([hidden]) { animation: ax-fade-in var(--dur-slow) var(--ease); }
.boot-name { font-family: var(--serif); font-size: 3.4rem; line-height: 1; color: var(--ochre); }
.boot-line { color: var(--spine-muted); }

/* ---------- buttons + fields ---------- */
.btn, .btn-primary, .tree-toggle, .find button, #resetBtn, #resetYes, #demoBtn, #signinBtn, #newSubmit, #createTeamToggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 34px;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}
.btn:hover { background: var(--stone); }
.btn-primary, #signinBtn, #newSubmit, #resetYes, #demoBtn, .find button, .tree-toggle, .form-actions .btn-primary {
  background: var(--ochre);
  border-color: var(--ochre);
  color: var(--charcoal);
}
.btn-primary:hover, #signinBtn:hover, #newSubmit:hover { background: #e9b05a; }
.btn-danger { color: var(--error); }
.btn-danger:hover { background: #f6e8e3; }
.leaf a.btn-primary, a.btn-primary { color: var(--charcoal); }
.btn-quiet {
  min-height: 34px;
  padding: 0.3rem 0.1rem;
  background: none;
  border: 0;
  color: var(--ochre-ink);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  font-weight: 600;
}
button:disabled { opacity: 0.65; cursor: wait; }

.field { margin: 0 0 1rem; }
.field label, fieldset legend { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.3rem; color: var(--muted); }
.leaf input[type="text"],
.leaf input[type="email"],
.leaf input[type="password"],
.leaf input[type="number"],
.leaf textarea,
.leaf select,
.field select,
.gate-sheet input {
  width: 100%;
  min-height: 38px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 0.5rem 0.7rem;
  color: var(--ink);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.leaf input:focus-visible, .leaf textarea:focus-visible, .leaf select:focus-visible, .gate-sheet input:focus-visible {
  outline: 2px solid var(--ochre-ink);
  outline-offset: 0;
  border-color: var(--ochre-ink);
}
.leaf textarea { min-height: 14rem; resize: vertical; font-family: var(--serif); font-size: 1.05rem; line-height: 1.55; }
.page-preview { min-height: 12rem; padding: 1rem 1.2rem; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
#previewToggle { margin-bottom: 0.4rem; }
#draftStatus { min-height: 1.5rem; }
fieldset { border: 0; margin: 0 0 1rem; padding: 0; }
.choice { display: flex; gap: 0.5rem; align-items: center; min-height: 36px; font-weight: 500; color: var(--ink); }
.form-err { color: var(--error); font-weight: 600; margin: 0.2rem 0 0.8rem; max-width: 62ch; }
.form-actions { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.hint { color: var(--muted); font-size: 0.9rem; max-width: 66ch; }

/* ---------- top bar ---------- */
.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.75rem 1rem;
  min-height: var(--bar-h);
  padding: 0.35rem 1rem;
  background: var(--charcoal);
  color: var(--leaf);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1;
  text-decoration: none;
  color: var(--leaf);
}
.brand-mark { display: block; width: 1.6rem; height: 1.6rem; flex: none; }
.brand-mark svg { display: block; width: 100%; height: 100%; }
.org { margin: 0; color: var(--spine-muted); font-size: 0.9rem; }
.find {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 1 24rem;
  min-width: 0;
  margin-left: 1rem;
  padding: 0.15rem 0.2rem 0.15rem 0.7rem;
  background: rgba(255, 255, 255, 0.07);
  border-radius: var(--r);
}
.find label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.find input {
  flex: 1;
  min-width: 0;
  min-height: 32px;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0.3rem 0;
  color: var(--leaf);
}
.find input::placeholder { color: #A3988C; }
.find button { min-height: 28px; padding: 0.15rem 0.65rem; font-size: 0.85rem; }
.seat { margin-left: auto; display: flex; align-items: center; gap: 0.6rem; white-space: nowrap; }
.seat-text { display: flex; flex-direction: column; line-height: 1.2; }
.seat-name { font-weight: 600; font-size: 0.9rem; }
.seat-role { color: var(--spine-muted); font-size: 0.78rem; }
.seat .btn-quiet { color: #cfc8bd; margin-left: 0.4rem; font-size: 0.85rem; text-decoration: none; }
.seat .btn-quiet:hover { color: var(--leaf); text-decoration: underline; }
.tree-toggle { display: none; min-height: 34px; }

/* ---------- avatars ---------- */
.av {
  --av-h: 36;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: hsl(var(--av-h) 32% 86%);
  color: hsl(var(--av-h) 40% 26%);
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  user-select: none;
}
.av-xs { width: 20px; height: 20px; font-size: 0.56rem; }
.av-top { background: rgba(255, 255, 255, 0.14); color: var(--leaf); }
.seat-av { display: inline-flex; }

/* ---------- workspace: tree rail + document ---------- */
.binder {
  display: grid;
  grid-template-columns: 17rem minmax(0, 1fr);
  min-height: calc(100dvh - var(--bar-h));
  background: var(--paper);
}
.spine {
  position: sticky;
  top: var(--bar-h);
  align-self: start;
  height: calc(100dvh - var(--bar-h));
  overflow: auto;
  background: var(--stone);
  border-right: 1px solid var(--line);
  padding: 0.75rem 0.6rem 1.5rem;
  min-width: 0;
}
.tree-home {
  display: block;
  padding: 0.35rem 0.6rem;
  margin-bottom: 0.5rem;
  border-radius: var(--r);
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  transition: background-color var(--dur-fast) var(--ease);
}
.tree-home:hover { background: rgba(0, 0, 0, 0.05); }
.tree-home[aria-current="page"] { background: var(--ochre-soft); }
.index, .tree, .contents { list-style: none; margin: 0; padding: 0; }
.index > .space + .space { margin-top: 0.9rem; }
.space-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0 0.2rem 0 0.6rem;
}
.space-name {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.25rem 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color var(--dur-fast) var(--ease);
}
.space-name:hover, .space-name[aria-current="page"] { color: var(--ochre-ink); }
.space-add {
  flex: none;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  color: var(--muted);
  text-decoration: none;
  font-size: 1.1rem;
  line-height: 1;
}
.space-add:hover { background: rgba(0, 0, 0, 0.07); color: var(--ink); }
.space-add { transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.tree .tree { margin-left: 0.95rem; }
.node-row { display: flex; align-items: flex-start; gap: 0.1rem; }
.twist {
  flex: none;
  width: 20px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted-2);
  position: relative;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.twist::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 10px;
  width: 5px;
  height: 5px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: translate(1px, 1px) rotate(45deg);
  transition: transform var(--dur) var(--ease);
}
.twist[aria-expanded="false"]::before { transform: translate(0, 1px) rotate(-45deg); }
.twist:hover { background: rgba(0, 0, 0, 0.07); color: var(--ink); }
.twist-none { pointer-events: none; }
.twist-none::before { content: none; }
/* subtrees stay in the DOM and open with a grid-row ease, so a twist never snaps */
.node-kids {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows var(--dur-slow) var(--ease);
}
.node-kids > .tree { min-height: 0; overflow: hidden; }
.node.is-collapsed > .node-kids { grid-template-rows: 0fr; }
.node.is-collapsed > .node-kids > .tree { visibility: hidden; transition: visibility 0s var(--dur-slow); }
.tree a {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  gap: 0.4rem;
  align-items: center;
  padding: 0.28rem 0.5rem 0.28rem 0.3rem;
  border-radius: var(--r);
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.3;
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.tree a:hover { background: rgba(0, 0, 0, 0.05); }
.tree a[aria-current="page"] { background: var(--ochre-soft); color: var(--ink); font-weight: 600; }
.pg-ico { flex: none; width: 15px; height: 15px; color: var(--muted-2); }
.tree a[aria-current="page"] .pg-ico { color: var(--ochre-ink); }
.lock-ico { width: 12px; height: 12px; vertical-align: -1px; }
.tag {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.item-title { overflow-wrap: anywhere; flex: 1 1 auto; min-width: 0; }
.tree-empty { margin: 0.2rem 0.6rem; color: var(--muted-2); font-size: 0.85rem; }
.tree-tools { margin-top: 1.1rem; padding-top: 0.75rem; border-top: 1px solid var(--line); display: grid; gap: 0.1rem; }
.tree-tools a, .team-nav {
  display: block;
  padding: 0.3rem 0.6rem;
  border-radius: var(--r);
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.tree-tools a:hover { background: rgba(0, 0, 0, 0.05); color: var(--ink); }
.tree-foot { margin-top: 1rem; padding: 0.75rem 0.6rem 0; border-top: 1px solid var(--line); }
.tree-foot button { min-height: 34px; }
.reset-ask { margin-top: 0.6rem; color: var(--muted); font-size: 0.9rem; }
.reset-ask p { margin-bottom: 0.45rem; }
.reset-actions { display: flex; gap: 0.75rem; align-items: center; }

/* the open page is a document */
#main { min-width: 0; }
#main:focus { outline: none; }
.leaf {
  min-width: 0;
  padding: 1.1rem clamp(1.25rem, 4vw, 3.5rem) 5rem;
  color: var(--ink);
  transition: opacity var(--dur-fast) var(--ease);
}
/* a freshly opened document rises into the frame; the bar and spine stay put */
.leaf.is-in { animation: ax-rise-in var(--dur-slow) var(--ease); }
/* while the next route is being read, the current document stays and dims a touch
   (after a short grace period so quick hops never flicker), under a thin ochre bar */
#main[aria-busy="true"] .leaf:not([hidden]) { opacity: 0.6; transition-delay: 180ms; }
#main[aria-busy="true"]::before {
  content: "";
  position: fixed;
  top: var(--bar-h);
  left: 17rem;
  right: 0;
  height: 2px;
  z-index: 11;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--ochre) 30%, var(--ochre) 70%, transparent) -70% 0 / 40% 100% no-repeat;
  opacity: 0;
  animation: ax-appear 1ms 180ms forwards, ax-bar-run 1.1s var(--ease) 180ms infinite;
}
.doc { max-width: 58rem; margin: 0 auto; }
.doc-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  min-height: 40px;
  margin: 0 0 2.25rem;
}
.where { margin: 0; color: var(--muted); font-size: 0.9rem; }
.where a { color: var(--muted); text-decoration: none; }
.where a:hover { color: var(--ochre-ink); text-decoration: underline; }
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.1rem;
  min-width: 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.crumbs a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  max-width: 18rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.crumbs a:hover { background: var(--stone); color: var(--ink); }
.crumb-sep { color: var(--muted-2); padding: 0 0.1rem; }
.crumb-here { color: var(--ink); padding: 0.2rem 0.4rem; font-weight: 500; overflow-wrap: anywhere; }
.doc-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; margin-left: auto; }
.doc-flag { color: var(--muted); font-weight: 600; margin-right: 0.3rem; }
.leaf h1, .gate-sheet h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.9rem, 3.2vw, 2.6rem);
  line-height: 1.12;
  letter-spacing: -0.005em;
  margin: 0 0 0.5rem;
  overflow-wrap: anywhere;
}
.byline { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; margin: 0 0 2rem; color: var(--muted); font-size: 0.9rem; }
.byline-sep { color: var(--muted-2); }
.share { display: inline-flex; align-items: center; gap: 0.3rem; font-weight: 600; color: var(--ochre-ink); }
.share--private { color: var(--muted); }
.reading { font-family: var(--serif); font-size: 1.15rem; line-height: 1.65; max-width: 70ch; }
.reading p, .reading ul { margin: 0 0 1rem; }
.reading h2, .reading h3, .reading h4, .leaf h2, .demo h2 { font-family: var(--serif); font-weight: 500; line-height: 1.25; }
.reading h2 { font-size: 1.55rem; margin: 1.8rem 0 0.5rem; }
.reading h3 { font-size: 1.28rem; margin: 1.3rem 0 0.35rem; }
.reading h4 { font-size: 1.12rem; margin: 1rem 0 0.3rem; }
.reading ul { padding-left: 1.3rem; }
.reading li { margin: 0.25rem 0; }
.reading strong { font-weight: 600; }
.leaf a { color: var(--ochre-ink); }
.under { margin-top: 2.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.under h2 { font-size: 0.78rem; font-family: var(--sans); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.5rem; }
.contents a {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.4rem 0.6rem;
  margin: 0 -0.6rem;
  border-radius: var(--r);
  color: var(--ink);
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease);
}
.contents a { gap: 0.5rem; align-items: center; }
.contents a .pg-ico { width: 16px; height: 16px; }
.contents a .item-title { flex: 1 1 auto; }
.contents a:hover { background: var(--stone); }
.contents .contents { margin-left: 1.4rem; }
.doc-foot { margin-top: 2.5rem; padding-top: 0.75rem; border-top: 1px solid var(--line); }
.doc-foot .hint { font-size: 0.82rem; color: var(--muted-2); }

/* home: a dense hub, not a title page */
.doc-home .doc-bar { margin-bottom: 0.9rem; }
.doc-home h1 { font-size: 1.45rem; line-height: 1.2; margin-bottom: 0.15rem; }
.doc-home .byline { margin-bottom: 1rem; font-size: 0.86rem; }
.doc-home .home-section { margin-top: 1.2rem; }
.doc-home .space-card { padding: 0.75rem 0.9rem; }
.doc-home .recent-row { padding: 0.42rem 0.5rem; }
.home-section { margin-top: 2rem; }
.home-section h2 { font-size: 0.78rem; font-family: var(--sans); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.75rem; }
.space-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 0.85rem; }
.space-card {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.95rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  text-decoration: none;
  color: var(--ink);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.space-card:hover { border-color: var(--ochre); box-shadow: 0 2px 10px rgba(36, 33, 30, 0.06); }
.space-card-mark {
  flex: none;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--ochre-soft);
  color: var(--ochre-ink);
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
}
.space-card-body { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.space-card-name { font-weight: 600; font-size: 1rem; }
.space-card-sum { color: var(--muted); font-size: 0.9rem; }
.space-card-meta { color: var(--muted-2); font-size: 0.82rem; margin-top: 0.25rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.recent li { border-bottom: 1px solid var(--line); }
.recent-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.5rem;
  margin: 0 -0.5rem;
  border-radius: var(--r);
  text-decoration: none;
  color: var(--ink);
  transition: background-color var(--dur-fast) var(--ease);
}
.recent-row:hover { background: var(--stone); }
.recent-title { flex: 1 1 auto; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.recent-meta { display: flex; align-items: center; gap: 0.5rem; color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.recent-space { color: var(--muted-2); }
.recent-space::before { content: "·"; margin-right: 0.5rem; }
.recent-meta time { color: var(--muted-2); font-variant-numeric: tabular-nums; min-width: 6.5rem; text-align: right; }

.space-block { margin-top: 2rem; }
.space-block h2 { font-size: 1.35rem; margin: 0 0 0.3rem; }
.space-block h2 a { text-decoration: none; color: var(--ink); }
.space-block h2 a:hover { color: var(--ochre-ink); }
.space-block > .lede { color: var(--muted); font-size: 0.95rem; margin-bottom: 0.4rem; }
.lede { font-size: 1.02rem; margin-bottom: 0.9rem; max-width: 66ch; }

.results { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.result { margin: 0; padding: 0.55rem 0; border-bottom: 1px solid var(--line); max-width: 62ch; }
.result a { font-weight: 600; text-decoration: none; color: var(--ink); }
.result a:hover { color: var(--ochre-ink); text-decoration: underline; text-underline-offset: 0.12em; }
.result p { margin-top: 0.1rem; color: var(--muted); font-size: 0.9rem; }
.results.recent .result a { font-family: var(--sans); font-size: 1rem; }
.empty { max-width: 56ch; }
.empty h1 { margin-bottom: 0.6rem; }
#view-missing .lede[role="status"] { color: var(--muted); }

/* editor + management views reuse the document frame */
#view-new h1, #view-manage h1 { margin-bottom: 0.6rem; }
#view-new, #view-manage, #view-search, #view-missing { max-width: calc(58rem + 2 * clamp(1.25rem, 4vw, 3.5rem)); margin: 0 auto; }
#view-new form, #view-manage form { max-width: 46rem; }
#view-new .lede { color: var(--muted); font-size: 0.95rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.lifecycle-confirm { flex-basis: 100%; padding: 0.9rem 1rem; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.lifecycle-confirm p { margin: 0 0 0.6rem; }
.lifecycle-confirm button { margin-right: 0.4rem; }
.seat-roster { padding: 0; list-style: none; }
.seat-roster li { padding: 0.9rem 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.seat-roster p { margin: 0.2rem 0 0.6rem; color: var(--muted); }

/* ---------- sign in ---------- */
.shell.is-gate .bar, .shell.is-gate .spine { display: none; }
.shell.is-gate .binder { display: block; min-height: 100dvh; }
#shell:has(#gate:not([hidden])) .bar,
#shell:has(#gate:not([hidden])) .spine { display: none; }
#shell:has(#gate:not([hidden])) .binder { display: block; }
#gate.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px 16px 48px;
  background: var(--charcoal);
}
.gate-layout { width: min(460px, 100%); }
.gate-tab { display: none; }
.gate-sheet {
  background: #f4f0e8;
  color: var(--ink);
  padding: 28px 26px 22px;
  border-radius: 2px 16px 16px 2px;
  box-shadow: -10px 0 0 var(--ochre), 0 20px 50px rgba(0, 0, 0, 0.35);
}
.gate-brand { display: flex; align-items: center; gap: 0.75rem; margin: 0 0 1.4rem; }
.gate-names { display: flex; flex-direction: column; gap: 0.1rem; }
.gate-product { font-family: var(--serif); font-size: 1.6rem; line-height: 1; }
.gate-company { color: var(--muted); font-size: 0.9rem; }
.gate-sheet h1 { font-size: 1.7rem; }
.gate-sheet .lede { color: var(--muted); font-size: 0.95rem; }
.team-setup { margin-top: 1.3rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.team-setup h2 { margin: 1rem 0 0.3rem; font-size: 1.25rem; }
.demo { margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.demo h2 { font-size: 1.25rem; margin-bottom: 0.2rem; }
.demo dl { margin: 0.6rem 0 0.8rem; }
.demo div { display: grid; grid-template-columns: 6.5rem 1fr; gap: 0.4rem; padding: 0.15rem 0; }
.demo dt { font-weight: 600; color: var(--muted); }
.demo dd { overflow-wrap: anywhere; font-weight: 600; }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .tree-toggle { display: inline-flex; }
  .bar { flex-wrap: wrap; padding: 0.5rem 0.75rem; }
  .brand { font-size: 1.2rem; }
  .org { display: none; }
  .find { flex: 1 1 100%; order: 5; margin: 0; }
  .seat { gap: 0.5rem; }
  .seat-role { display: none; }
  .binder { display: block; }
  #main[aria-busy="true"]::before { left: 0; }
  .spine { display: none; position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .binder.is-open .spine { display: block; }
  .leaf { padding: 1.1rem 1rem 3.5rem; }
  .doc-bar { margin-bottom: 1.1rem; }
  .doc-actions { margin-left: 0; width: 100%; }
  .doc-actions .btn { flex: 1 1 auto; }
  .recent-row { flex-wrap: wrap; }
  .recent-meta { flex: 1 1 100%; flex-wrap: wrap; padding-left: 1.6rem; white-space: normal; }
  .recent-meta time { min-width: 0; text-align: left; }
  .reading { font-size: 1.08rem; }
  .gate-sheet { padding: 1.4rem 1rem 1.5rem; border-radius: 10px; box-shadow: 0 0 0 4px var(--ochre); }
  .demo div { grid-template-columns: 1fr; gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
  #main[aria-busy="true"]::before { opacity: 1; background-position-x: 30%; }
}
