/* Shared shell — Precept site term-view · catalyst discovery terminal */
:root{
  --bg:#121212; --panel:#1a1a1a; --ink:#e8e8e8; --muted:#9a9a9a; --dim:#6a6a6a;
  --border:rgba(255,255,255,.10); --ok:#8fbc8f; --warn:#c4b06a; --bad:#d98989; --steel:#7a9bb8;
  --mono:"IBM Plex Mono",ui-monospace,monospace; --sans:"IBM Plex Sans",sans-serif;
}
*{box-sizing:border-box}
html,body{height:100%;margin:0;background:var(--bg);color:var(--ink);font:11px/1.4 var(--mono)}
.banner{padding:.55rem 1.1rem;border-bottom:1px solid var(--border);background:#1c1c1c;
  font:500 .68rem var(--mono);color:var(--muted);letter-spacing:.02em}
.banner strong{color:var(--ink)} .banner a{color:var(--ok);text-decoration:none}
.banner a:hover{text-decoration:underline}
.stage{
  max-width:920px;margin:0 auto;padding:1.1rem 1.1rem 3.5rem;
  min-height:calc(100% - 2.2rem);
}
.term{
  background:var(--panel);border:1px solid var(--border);border-radius:2px;
  overflow:hidden;min-height:420px;display:flex;flex-direction:column;
}
.term-bar{
  display:flex;align-items:center;gap:.75rem;flex-wrap:wrap;
  padding:.45rem .75rem;border-bottom:1px solid var(--border);background:#141414;
  font-size:.68rem;letter-spacing:.06em;text-transform:uppercase;color:var(--dim);
}
.term-bar .ok{color:var(--ok)}
.term-body{flex:1;padding:.85rem 1rem 1.1rem;overflow:auto}
.line{margin:0 0 .35rem;color:#c8c8c8;white-space:pre-wrap}
.line.gate-line{
  display:grid;
  grid-template-columns: 10ch 22ch max-content minmax(0,1fr);
  column-gap: 1ch;
  padding-left: 2ch;
  white-space: normal;
  align-items: baseline;
}
.line.gate-line .g-id{color:#c8c8c8}
.line.gate-line .g-lab{color:#c8c8c8}
.line.gate-line .g-detail{min-width:0}

@media (max-width: 720px) {
  .line.gate-line{
    grid-template-columns: minmax(0,1fr);
    row-gap: 0.1rem;
    column-gap: 0;
  }
}
.line .dim{color:var(--dim)}
.line .ok{color:var(--ok)}
.line .warn{color:var(--warn)}
.line .steel{color:var(--steel)}
.line .bad{color:var(--bad)}
.line .hi{color:var(--ink);font-weight:600}
.prompt{color:var(--dim)}
.cursor{
  display:inline-block;width:.55ch;height:1em;margin-left:1px;
  background:var(--ok);vertical-align:-2px;animation:blink 1s steps(1) infinite;
}
@keyframes blink{50%{opacity:0}}
.big{
  font-size:clamp(1.6rem,4vw,2.4rem);font-weight:600;letter-spacing:-.02em;
  color:var(--ink);margin:.15rem 0 .55rem;
}
.big .unit{font-size:.55em;color:var(--dim);font-weight:500;margin-left:.35rem}
.rule{border:0;border-top:1px solid var(--border);margin:.75rem 0}
.card{
  margin-top:.75rem;padding:.75rem .85rem;border:1px solid color-mix(in srgb,var(--warn) 45%,transparent);
  background:rgba(196,176,106,.07);
}
.card .ck{font-size:.65rem;letter-spacing:.1em;text-transform:uppercase;color:var(--warn);margin:0 0 .4rem}
.card p{margin:.25rem 0;font-size:.8rem;color:#d4d4d4}
.card .bound{margin-top:.55rem;padding-top:.45rem;border-top:1px solid var(--border);
  font-size:.68rem;color:var(--dim)}
.chips{display:flex;flex-wrap:wrap;gap:.35rem;margin:.4rem 0 .55rem}
.chip{
  display:inline-block;padding:.12rem .4rem;border:1px solid var(--border);
  font-size:.65rem;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);
}
.chip-warn{border-color:color-mix(in srgb,var(--warn) 50%,transparent);color:var(--warn)}
.chip-ok{border-color:color-mix(in srgb,var(--ok) 45%,transparent);color:var(--ok)}
.chip-steel{border-color:color-mix(in srgb,var(--steel) 50%,transparent);color:var(--steel)}
.gate{
  margin-top:.85rem;padding:.7rem .85rem;border:1px solid color-mix(in srgb,var(--ok) 40%,transparent);
  background:rgba(143,188,143,.06);
}
.gate .gk{font-size:.65rem;letter-spacing:.1em;text-transform:uppercase;color:var(--ok);margin:0 0 .35rem}
.gate p{margin:0;font-size:.8rem;color:#d0d0d0}
.split{display:grid;grid-template-columns:1.05fr .95fr;gap:0;min-height:420px}
@media (max-width:720px){.split{grid-template-columns:1fr}}
.split > *{border:1px solid var(--border);background:var(--panel)}
.split > *:first-child{border-right:0}
@media (max-width:720px){.split > *:first-child{border-right:1px solid var(--border);border-bottom:0}}
.doc{padding:.85rem 1rem;font-size:.78rem;line-height:1.55;color:#b8b8b8}
.doc .meta{font-size:.65rem;letter-spacing:.08em;text-transform:uppercase;color:var(--dim);margin:0 0 .65rem}
.doc mark{
  background:rgba(196,176,106,.22);color:var(--ink);padding:.05rem .15rem;
  box-decoration-break:clone;
}
.bar-track{height:.35rem;background:rgba(255,255,255,.08);border-radius:999px;overflow:hidden;margin:.35rem 0 .7rem;max-width:22rem}
.bar-fill{height:100%;width:0;background:var(--ok);transition:width .4s linear}
.nav{margin-top:1rem;font:500 .68rem var(--mono);color:var(--dim);max-width:40rem}
.back{
  position:fixed;bottom:1rem;right:1rem;font:500 .65rem var(--mono);letter-spacing:.06em;
  text-transform:uppercase;color:var(--muted);text-decoration:none;border:1px solid var(--border);
  padding:.4rem .65rem;background:var(--panel);z-index:10;
}
.back:hover{color:var(--ink)}
@media (prefers-reduced-motion:reduce){
  .cursor{animation:none}
  .bar-fill{transition:none}
}

/* Iframe term-view — fill chapter card, no mockup chrome */
html.term-view, html.term-view body{
  height:100%;
  overflow:hidden;
  background:#000;
  color:#e8e8e8;
}
html.term-view .stage{
  max-width:none;
  margin:0;
  padding:.55rem .7rem .65rem;
  height:100%;
  min-height:0;
  box-sizing:border-box;
  display:flex;
  flex-direction:column;
  background:#000;
}
html.term-view .term{
  flex:1;
  min-height:0;
  border:0;
  border-radius:0;
  background:transparent;
}
html.term-view .term-bar{
  padding:.35rem 0 .5rem;
  border-bottom:1px solid rgba(255,255,255,.12);
  background:transparent;
  font-size:.62rem;
}
html.term-view .term-body{
  overflow:auto;
  padding:.65rem 0 .4rem;
  font-size:10.5px;
  line-height:1.4;
}
html.term-view .dots{
  background:#0c0c0e;
}

/* Pack (brief/book) — match claim-card wash, not terminal black */
html.term-view-pack,
html.term-view-pack body,
html.term-view-pack .stage{
  background:transparent;
}
html.term-view-pack .dots{
  background:#0c0c0e;
}

/* Dual beat — internal L→R scroll (name run → ask) */
html.term-view .stage-carousel{
  padding-bottom:0;
}
html.term-view .track{
  display:flex;
  flex:1;
  min-height:0;
  overflow-x:auto;
  overflow-y:hidden;
  scroll-snap-type:x mandatory;
  scroll-behavior:smooth;
  scrollbar-width:none;
}
html.term-view .track::-webkit-scrollbar{display:none}
html.term-view .slide{
  flex:0 0 100%;
  width:100%;
  height:100%;
  scroll-snap-align:start;
  scroll-snap-stop:always;
  display:flex;
  flex-direction:column;
  min-width:0;
  padding:0 .15rem;
}
html.term-view .slide .term{
  flex:1;
  min-height:0;
  display:flex;
  flex-direction:column;
}
html.term-view .slide .term-body{flex:1;min-height:0}
html.term-view .dots{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:.4rem;
  margin:.55rem 0 0;
  padding:.35rem .4rem;
  flex:0 0 auto;
  background:#0c0c0e;
  border-top:1px solid rgba(242,240,234,.38);
  font-size:.62rem;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#c8c4bc;
}
html.term-view .dot-cluster{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:.4rem;
  flex:1;
  min-width:0;
}
html.term-view .dot{
  width:7px;height:7px;border-radius:50%;
  border:0;padding:0;
  background:rgba(255,255,255,.28);cursor:pointer;flex:0 0 auto;
}
html.term-view .dot[aria-current="true"]{background:#f2f0ea}

/* Mobile swipe affordance */
.swipe-hint{
  display:none;
}
@media (max-width: 899px) {
  html.term-view .stage-carousel{
    position:relative;
  }
  .swipe-hint{
    display:flex;
    align-items:center;
    justify-content:center;
    flex:0 0 32px;
    width:32px;
    height:32px;
    margin:0;
    padding:0;
    border:0;
    border-radius:0;
    background:transparent;
    color:#b8b0a4;
    line-height:0;
    cursor:pointer;
    pointer-events:auto;
    -webkit-tap-highlight-color:transparent;
  }
  .swipe-hint svg{
    display:block;
    width:18px;
    height:18px;
  }
  .swipe-hint--prev svg{
    transform:scaleX(-1);
  }
  .swipe-hint.is-gone{
    opacity:0;
    pointer-events:none;
    visibility:hidden;
  }
}
@keyframes swipe-hint-pulse-next{
  0%,100%{transform:translateX(0); opacity:0.85}
  50%{transform:translateX(4px); opacity:1}
}
@keyframes swipe-hint-pulse-prev{
  0%,100%{transform:translateX(0); opacity:0.85}
  50%{transform:translateX(-4px); opacity:1}
}
@media (prefers-reduced-motion:reduce){
  html.term-view .track{scroll-behavior:auto}
  .swipe-hint{animation:none}
}

/* Phone: horizontal section snaps — no nested vertical scroll */
@media (max-width: 899px) {
  html.term-view .stage {
    padding: 0.45rem 0.55rem 0.35rem;
  }
  html.term-view .stage-carousel .track {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  html.term-view .stage-carousel .slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0;
    border: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }
  html.term-view .stage-carousel .slide .term {
    min-height: 0;
    height: 100%;
  }
  /* Parent page (phone) renders its own pager under the card */
  html.term-view.parent-nav .stage-carousel .dots {
    display: none;
  }
  html.term-view .term {
    min-height: 0;
  }
  html.term-view .term-bar {
    font-size: 0.58rem;
    padding: 0.25rem 0 0.4rem;
  }
  html.term-view .term-body {
    overflow: hidden;
    font-size: 9.5px;
    line-height: 1.35;
    padding: 0.45rem 0 0.25rem;
  }
  html.term-view .line {
    margin: 0 0 0.22rem;
  }
  html.term-view .line.gate-line {
    font-size: 9px;
  }
  html.term-view-pack .block p,
  html.term-view-pack .block li {
    font-size: 11px;
    line-height: 1.4;
  }
  html.term-view-pack .doc {
    padding-top: 0.55rem;
  }
  html.term-view-pack .hero .t {
    font-size: 1.15rem;
  }
}
