/* jc10.ai: one set of pages, two views.
   Site view (default): a scrolling web page, sections alternate text left and right.
   IDE view (html[data-view="ide"]): the jc10 IDE window (title bar, activity bar, explorer, tabs, editor, terminal, status bar).
   The title bar is the same element with the same size and positions in both views, both themes and both languages.
   Colors are the jc10 IDE themes (011_jc10_ai_ide jc10-dark.json, jc10-light.json) and the v09 logo (#54b9db). */
:root {
  --title: #eef2f5; --act: #eef2f5; --side: #f5f7f9; --ed: #ffffff; --panel: #f5f7f9; --status: #eef2f5;
  --fg: #1b222c; --mut: #556270; --dim: #6b7884; --line: #dfe5ea; --hover: #e6ecf0; --sel: #d6eef7;
  --acc: #1a6e91; --btn: #1f7fa6; --btn2: #1a6e91; --on-btn: #ffffff;
  --k: #1a6e91; --s: #8a4b08; --c: #6b7884; --ok: #1a7f37; --bad: #cf222e; --warn: #9a6700;
  --card: #ffffff; --shadow: 0 1px 2px rgba(18, 23, 30, .06); --lift: 0 24px 60px rgba(18, 23, 30, .16);
  --ui: "Segoe UI", system-ui, -apple-system, sans-serif; --mono: "Cascadia Mono", "Cascadia Code", Consolas, monospace;
  --tb: 44px; --wrap: 1120px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --title: #12171e; --act: #12171e; --side: #161c24; --ed: #1b222c; --panel: #161c24; --status: #12171e;
    --fg: #d5dce3; --mut: #8b98a5; --dim: #6f7c89; --line: #26303b; --hover: #1f2832; --sel: #24405a;
    --acc: #54b9db; --btn: #237a9e; --btn2: #1f6d8e; --on-btn: #ffffff;
    --k: #54b9db; --s: #e5b97a; --c: #6f7c89; --ok: #7ee787; --bad: #f85149; --warn: #e3b341;
    --card: #161c24; --shadow: none; --lift: 0 24px 60px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --title: #12171e; --act: #12171e; --side: #161c24; --ed: #1b222c; --panel: #161c24; --status: #12171e;
  --fg: #d5dce3; --mut: #8b98a5; --dim: #6f7c89; --line: #26303b; --hover: #1f2832; --sel: #24405a;
  --acc: #54b9db; --btn: #237a9e; --btn2: #1f6d8e; --on-btn: #ffffff;
  --k: #54b9db; --s: #e5b97a; --c: #6f7c89; --ok: #7ee787; --bad: #f85149; --warn: #e3b341;
  --card: #161c24; --shadow: none; --lift: 0 24px 60px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scrollbar-gutter: stable; }
html, body { height: 100%; }
body { margin: 0; background: var(--ed); color: var(--fg); font: 14px/1.5 var(--ui); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 1px solid var(--acc); outline-offset: -1px; }
.notrans, .notrans * { transition: none !important; }

/* the window (IDE view) */
.app { display: grid; height: 100vh; grid-template-columns: 56px 230px minmax(0, 1fr); grid-template-rows: var(--tb) minmax(0, 1fr) 190px 24px;
  grid-template-areas: "title title title" "act side editor" "act side panel" "status status status"; }

/* title bar: identical in both views */
.titlebar { grid-area: title; display: flex; align-items: center; gap: 16px; height: var(--tb); padding: 0 12px 0 14px; background: var(--title); border-bottom: 1px solid var(--line); }
.tb-brand { flex: none; display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600; font-size: 14px; }
.tb-brand img { display: block; border-radius: 5px; }
.tb-menu { flex: none; display: flex; gap: 2px; }
.tb-menu a { text-decoration: none; color: var(--mut); font-size: 13px; line-height: 26px; padding: 0 8px; border-radius: 5px; white-space: nowrap; }
.tb-menu a:hover { background: var(--hover); color: var(--fg); }
.tb-menu a.on { color: var(--fg); background: var(--hover); }
.tb-center { flex: 1 1 0; min-width: 0; max-width: 420px; margin: 0 auto; display: flex; align-items: center; justify-content: center; gap: 8px; height: 26px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--side); color: var(--dim); font-size: 12px; white-space: nowrap; overflow: hidden; }
.tb-center span { overflow: hidden; text-overflow: ellipsis; }
.tb-center svg { width: 13px; height: 13px; }
.tb-right { flex: none; margin-left: auto; display: flex; align-items: center; gap: 10px; }
.seg { display: flex; padding: 2px; border: 1px solid var(--line); border-radius: 7px; background: var(--side); }
.seg a, .seg button { display: block; height: 22px; line-height: 22px; padding: 0 9px; border-radius: 5px; font-size: 12px; font-weight: 600; color: var(--mut); text-decoration: none; }
.seg a:hover, .seg button:hover { color: var(--fg); }
.seg [aria-current="true"], .seg [aria-pressed="true"] { background: var(--btn); color: var(--on-btn); }
.seg [aria-current="true"]:hover, .seg [aria-pressed="true"]:hover { color: var(--on-btn); }
.tb-theme { width: 30px; height: 26px; display: grid; place-items: center; border-radius: 5px; color: var(--mut); }
.tb-theme:hover { background: var(--hover); color: var(--fg); }
.tb-theme .i-sun { display: none; }
:root[data-theme="dark"] .tb-theme .i-sun { display: block; }
:root[data-theme="dark"] .tb-theme .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tb-theme .i-sun { display: block; }
  :root:not([data-theme="light"]) .tb-theme .i-moon { display: none; }
}

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 0 16px; border-radius: 6px; white-space: nowrap;
  background: var(--btn); color: var(--on-btn); font-weight: 600; font-size: 14px; text-decoration: none; border: 1px solid var(--btn); transition: background .12s, border-color .12s; }
.btn:hover { background: var(--btn2); border-color: var(--btn2); }
.btn-sm { min-height: 26px; padding: 0 12px; font-size: 12px; }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn-ghost:hover { background: var(--hover); border-color: var(--acc); }

/* activity bar: icon with a small name under it */
.activity { grid-area: act; display: flex; flex-direction: column; background: var(--act); border-right: 1px solid var(--line); }
.activity a { position: relative; display: grid; justify-items: center; align-content: center; gap: 3px; height: 54px; color: var(--dim); text-decoration: none; }
.activity a svg { width: 20px; height: 20px; stroke-width: 1.5; }
.activity a span { font-size: 10px; line-height: 1; }
.activity a:hover, .activity a.on { color: var(--fg); }
.activity a.on::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--acc); }
.act-bottom { margin-top: auto; }

/* explorer */
.sidebar { grid-area: side; grid-row: 2 / 4; background: var(--side); border-right: 1px solid var(--line); overflow: auto; font-size: 13px; }
.side-head { height: 34px; display: flex; align-items: center; padding: 0 18px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--mut); }
.side-head2 { margin-top: 10px; }
.tree { display: flex; flex-direction: column; }
.folder { display: flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.folder svg { width: 14px; height: 14px; }
.tree a, .tree button { display: flex; align-items: center; gap: 7px; height: 24px; padding: 0 10px 0 24px; text-decoration: none; text-align: left; color: var(--fg); white-space: nowrap; }
.tree a:hover, .tree button:hover { background: var(--hover); }
.tree a.on { background: var(--sel); }
.tree .l1 { padding-left: 24px; } .tree .l2 { padding-left: 38px; } .tree .l3 { padding-left: 52px; }
.tree .grp, .tree .planned { display: flex; align-items: center; gap: 5px; height: 24px; padding-right: 10px; color: var(--mut); white-space: nowrap; }
.tree .grp svg { width: 13px; height: 13px; margin-left: -2px; }
.tree .planned, .tree .planned .fi { color: var(--dim); }
.tree em { margin-left: auto; font-style: normal; font-size: 10px; padding: 0 6px; border: 1px solid var(--line); border-radius: 8px; color: var(--dim); }
.fi { font-style: normal; width: 14px; flex: none; text-align: center; font: 700 10px var(--mono); color: var(--acc); }
.fi.k-c { color: var(--warn); } .fi.k-r { color: var(--s); } .fi.k-p, .fi.k-a, .fi.k-h, .fi.k-u { color: var(--acc); }
.fi.k-t, .fi.k-l { color: var(--ok); } .fi.k-o { color: var(--mut); }
.fi.ln { color: var(--mut); font-family: var(--ui); }

/* editor */
.editor { grid-area: editor; display: flex; flex-direction: column; min-height: 0; background: var(--ed); }
.tabs { display: flex; height: 36px; flex: none; background: var(--side); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab { display: flex; align-items: center; gap: 7px; padding: 0 8px 0 14px; height: 36px; border-right: 1px solid var(--line); color: var(--mut); font-size: 13px; white-space: nowrap; cursor: pointer; position: relative; }
.tab.on { background: var(--ed); color: var(--fg); }
.tab.on::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--acc); }
.tab.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--ed); }
.tab .x { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 4px; color: var(--dim); visibility: hidden; }
.tab.on .x, .tab:hover .x { visibility: visible; }
.tab .x:hover { background: var(--hover); color: var(--fg); }
.tab .x svg { width: 12px; height: 12px; }
.crumbs { flex: none; display: flex; gap: 6px; align-items: center; height: 24px; padding: 0 18px; font-size: 12px; color: var(--dim); }
.docs { flex: 1; overflow: auto; }
.doc { max-width: 860px; padding: 26px 40px 48px; }
.js .doc { display: none; }
.js .doc.on { display: block; }
html[data-view="ide"] #readme .d-vis { display: none; }

/* document type */
.eyebrow { margin: 0 0 12px; color: var(--acc); font: 600 12px var(--mono); letter-spacing: .02em; }
.doc h1 { margin: 0; font-size: clamp(30px, 4vw, 46px); line-height: 1.1; letter-spacing: -.015em; font-weight: 700; }
.doc h2 { margin: 36px 0 6px; font-size: 20px; }
.doc h3 { margin: 0; font-size: 15px; }
.lead { margin: 16px 0 0; color: var(--mut); font-size: 17px; line-height: 1.6; max-width: 40em; }
.note { margin: 0 0 12px; color: var(--dim); font-size: 13px; }
.d-vis > .note:first-child { margin-top: 28px; }
.fine { margin: 14px 0 0; color: var(--dim); font-size: 13px; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.v-site, .v-ide { display: none; }
html[data-view="ide"] .v-ide, html:not([data-view="ide"]) .v-site { display: inline; }

.pipe { list-style: none; margin: 46px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; position: relative; counter-reset: p; }
.pipe::before { content: ""; position: absolute; left: 7px; right: 7px; top: 7px; height: 2px; background: linear-gradient(90deg, var(--acc), var(--btn)); opacity: .7; }
.pipe li { position: relative; padding-top: 28px; counter-increment: p; }
.pipe li::before { content: ""; position: absolute; left: 0; top: 0; width: 16px; height: 16px; border-radius: 50%; background: var(--ed); box-shadow: inset 0 0 0 2px var(--acc); }
.pipe li::after { content: "0" counter(p); position: absolute; left: 0; top: -22px; font: 600 11px var(--mono); color: var(--dim); }
.pipe b { display: block; font-size: 15px; }
.pipe span { display: block; margin-top: 4px; color: var(--mut); font-size: 13px; }

.code { margin: 0; padding: 14px 0; background: var(--side); border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; font: 13px/1.75 var(--mono); }
.code code { display: block; white-space: pre; }
.code .ln { display: inline-block; width: 44px; padding-right: 16px; text-align: right; color: var(--dim); user-select: none; }
.k { color: var(--k); } .s { color: var(--s); } .c { color: var(--c); font-style: italic; }

.feat, .checks { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 10px; max-width: 720px; }
.feat li, .checks li { position: relative; padding: 14px 16px 14px 44px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); box-shadow: var(--shadow); color: var(--mut); }
.feat b, .checks b { color: var(--fg); }
.feat li::before { content: ">"; position: absolute; left: 18px; top: 14px; font: 700 13px var(--mono); color: var(--acc); }
.checks li::before { content: ""; position: absolute; left: 16px; top: 16px; width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--ok); }
.checks li::after { content: ""; position: absolute; left: 21.5px; top: 19.5px; width: 4px; height: 7px; border: solid var(--ok); border-width: 0 1.8px 1.8px 0; transform: rotate(45deg); }

.flow { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.flow li { padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); box-shadow: var(--shadow); }
.flow span { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-bottom: 10px; border-radius: 50%; background: var(--btn); color: var(--on-btn); font: 700 12px var(--mono); }
.flow p { margin: 6px 0 0; color: var(--mut); font-size: 13px; }

.sig-card { margin-top: 26px; max-width: 520px; padding: 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); box-shadow: var(--shadow); }
.sig { display: flex; align-items: center; gap: 14px; }
.sig img { border-radius: 10px; }
.sig b { display: block; font-size: 16px; }
.sig span { color: var(--mut); font-size: 13px; }
.sig-card .cta { margin-top: 20px; }

/* governance */
.ladder { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0; }
.ladder li { display: flex; align-items: center; }
.ladder li + li::before { content: ""; width: 18px; height: 1px; background: var(--acc); opacity: .7; }
.ladder a, .ladder button { display: block; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); box-shadow: var(--shadow); text-decoration: none; text-align: left; }
.ladder a:hover, .ladder button:hover { border-color: var(--acc); }
.ladder b { display: block; font-size: 13px; }
.ladder span { display: block; font: 11px var(--mono); color: var(--acc); }
.ladder li:last-child a, .ladder li:last-child button { border-color: var(--ok); }
.ladder li:last-child span { color: var(--ok); }
.articles { margin: 26px 0 0; padding: 0; list-style: none; counter-reset: art; max-width: 760px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--card); box-shadow: var(--shadow); }
.articles li { counter-increment: art; position: relative; padding: 13px 18px 13px 74px; color: var(--mut); border-top: 1px solid var(--line); }
.articles li:first-child { border-top: 0; }
.articles li::before { content: "Art. " counter(art); position: absolute; left: 18px; top: 14px; font: 600 12px var(--mono); color: var(--warn); }
.articles b { color: var(--fg); }
.tree-code { margin-top: 24px; padding: 16px 18px; }
.tree-code .t { color: var(--dim); }
.ok { color: var(--ok); } .dimt { color: var(--dim); }
.levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.levels div { padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); box-shadow: var(--shadow); }
.levels b { display: block; }
.levels span { display: block; margin-top: 4px; color: var(--mut); font-size: 13px; }
.code.task { margin-top: 20px; padding: 14px 18px; max-width: 620px; }

/* updates sign-up */
.signup { max-width: 520px; margin-top: 26px; padding: 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); box-shadow: var(--shadow); }
.signup > label[for] { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.signup-row { display: flex; gap: 8px; }
.signup input[type="email"] { flex: 1; min-width: 0; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--ed); color: var(--fg); font: inherit; }
.signup input[type="email"]::placeholder { color: var(--dim); }
.signup input[type="email"]:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc); }
.signup .btn { min-height: 38px; }
.signup-check { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; font-size: 13px; color: var(--mut); cursor: pointer; }
.signup-check input { margin: 3px 0 0; accent-color: var(--btn); }
.signup-msg { margin: 12px 0 0; min-height: 20px; font-size: 13px; color: var(--mut); }
.signup-msg.ok { color: var(--ok); } .signup-msg.bad { color: var(--bad); }
.signup-lead { margin: 0 0 16px; color: var(--mut); }

/* updates window: email first, then the name if they want */
.dlg { width: min(440px, calc(100% - 32px)); max-height: calc(100% - 32px); margin: auto; padding: 0; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); color: var(--fg); box-shadow: var(--lift); overflow: auto; }
.dlg::backdrop { background: rgba(8, 12, 18, .55); }
.dlg[open] { animation: dlg-in .14s ease-out; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.dlg-step { padding: 28px 28px 24px; }
.dlg-step[hidden] { display: none; }
.dlg h2 { margin: 0 32px 6px 0; font-size: 20px; line-height: 1.3; }
.dlg-lead { margin: 0 0 18px; color: var(--mut); font-size: 14px; }
.dlg-label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.dlg-label span { font-weight: 400; color: var(--dim); }
.dlg input[type="email"], .dlg input[type="text"] { display: block; width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--ed); color: var(--fg); font: inherit; }
.dlg input::placeholder { color: var(--dim); }
.dlg input[type="email"]:focus, .dlg input[type="text"]:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.dlg-actions .btn { min-height: 38px; }
.dlg-x { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 6px;
  background: transparent; color: var(--mut); cursor: pointer; }
.dlg-x:hover { background: var(--hover); color: var(--fg); }
.dlg-x svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
@media (max-width: 700px) { .dlg-step { padding: 24px 20px 20px; } .dlg-actions .btn { flex: 1; } }

/* mini IDE in the hero (site view): one click opens the IDE view */
.mini { position: relative; display: grid; grid-template-rows: 22px minmax(0, 1fr) 64px; width: 100%; aspect-ratio: 16 / 11; text-align: left; overflow: hidden;
  border: 1px solid var(--line); border-radius: 10px; background: var(--ed); box-shadow: var(--lift); transition: border-color .15s; }
.mini:hover { border-color: var(--acc); }
.mini i { display: block; font-style: normal; }
.mini-top { display: flex; align-items: center; gap: 6px; padding: 0 10px; background: var(--title); border-bottom: 1px solid var(--line); }
.mini-top i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.mini-body { display: grid; grid-template-columns: 34px 28% minmax(0, 1fr); min-height: 0; }
.mini-act { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 10px; background: var(--act); border-right: 1px solid var(--line); }
.mini-act i { width: 14px; height: 14px; border-radius: 4px; background: var(--dim); opacity: .35; }
.mini-act i.on { background: var(--acc); opacity: 1; }
.mini-side { display: flex; flex-direction: column; gap: 8px; padding: 12px 10px; background: var(--side); border-right: 1px solid var(--line); }
.mini-side i { height: 6px; border-radius: 3px; background: var(--line); }
.mini-side .w1 { width: 70%; } .mini-side .w2 { width: 85%; margin-left: 8%; } .mini-side .w3 { width: 60%; margin-left: 18%; }
.mini-side i.on { background: var(--acc); opacity: .8; }
.mini-ed { display: flex; flex-direction: column; gap: 9px; padding: 0 16px 12px; min-width: 0; }
.mini-tab { align-self: flex-start; margin: 0 0 4px -16px; padding: 4px 14px; font-size: 11px; color: var(--fg); background: var(--ed); box-shadow: inset 0 2px 0 var(--acc); }
.mini-ed b { font-size: 17px; line-height: 1.25; color: var(--fg); }
.mini-ed i { height: 6px; border-radius: 3px; background: var(--line); }
.mini-ed .w1 { width: 92%; } .mini-ed .w2 { width: 80%; } .mini-ed .w3 { width: 55%; }
.mini-term { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 0 16px; background: var(--panel); border-top: 1px solid var(--line); font: 11px/1.5 var(--mono); color: var(--mut); white-space: nowrap; overflow: hidden; }
.mini-cap { position: absolute; right: 14px; bottom: 78px; padding: 6px 12px; border-radius: 6px; background: var(--btn); color: var(--on-btn); font-size: 12px; font-weight: 600; }
.mini:hover .mini-cap { background: var(--btn2); }

/* terminal panel */
.panel { grid-area: panel; display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-top: 1px solid var(--line); }
.panel-tabs { flex: none; display: flex; align-items: center; gap: 18px; height: 34px; padding: 0 14px; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--dim); }
.panel-tabs span { height: 34px; display: flex; align-items: center; gap: 6px; }
.panel-tabs em { font-style: normal; padding: 0 6px; border-radius: 9px; background: var(--hover); color: var(--mut); }
.panel-tabs .on { color: var(--fg); box-shadow: inset 0 -1px 0 var(--acc); }
.panel-run { margin-left: auto; display: flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 5px; color: var(--acc); text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; }
.panel-run:hover { background: var(--hover); }
.panel-run svg { width: 12px; height: 12px; fill: currentColor; }
.term { flex: 1; overflow: auto; padding: 4px 18px 12px; font: 13px/1.7 var(--mono); }
.term p { margin: 0; white-space: pre-wrap; }
.term .dim { color: var(--dim); }
.term .who { color: var(--k); }
.term .ok { color: var(--ok); }
.term .bad { color: var(--bad); }
.term .warn { color: var(--warn); }
.term .cur span { display: inline-block; width: 8px; height: 15px; background: var(--fg); vertical-align: -2px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* status bar */
.statusbar { grid-area: status; display: flex; align-items: center; gap: 16px; padding: 0 10px; background: var(--status); border-top: 1px solid var(--line); color: var(--mut); font-size: 12px; white-space: nowrap; overflow: hidden; }
.statusbar span { display: flex; align-items: center; gap: 5px; }
.statusbar svg { width: 12px; height: 12px; }
.sb-brand { color: var(--fg); font-weight: 600; }
.sb-right { margin-left: auto; }
.statusbar a { color: var(--fg); }
#sb-evidence.ok { color: var(--ok); }
#sb-evidence.warn { color: var(--warn); }

@media (prefers-reduced-motion: reduce) { .term .cur span { animation: none; } }

/* ---------- site view (default) ---------- */
html:not([data-view="ide"]), html:not([data-view="ide"]) body { height: auto; }
html:not([data-view="ide"]) .app { display: flex; flex-direction: column; height: auto; min-height: 100vh; }
html:not([data-view="ide"]) .titlebar { position: sticky; top: 0; z-index: 5; }
html:not([data-view="ide"]) .tb-center { visibility: hidden; }
html:not([data-view="ide"]) .activity, html:not([data-view="ide"]) .sidebar, html:not([data-view="ide"]) .tabs, html:not([data-view="ide"]) .crumbs { display: none; }
html:not([data-view="ide"]) .editor, html:not([data-view="ide"]) .docs { display: contents; }
html:not([data-view="ide"]) .doc { display: block; max-width: none; padding: 96px max(24px, calc((100% - var(--wrap)) / 2)); border-top: 1px solid var(--line); scroll-margin-top: var(--tb); }
html:not([data-view="ide"]) .doc:nth-of-type(even) { background: var(--side); }
html:not([data-view="ide"]) .doc:nth-of-type(even) :is(.code, .levels div, .articles, .feat li, .checks li, .flow li, .ladder a, .ladder button, .signup, .sig-card) { background: var(--ed); }
html:not([data-view="ide"]) .doc:nth-of-type(even) .pipe li::before { background: var(--side); }
html:not([data-view="ide"]) #readme { border-top: 0; padding-top: 88px; }
html:not([data-view="ide"]) #readme h1 { font-size: clamp(38px, 4.6vw, 58px); }
html:not([data-view="ide"]) .d-wide > :first-child { margin-top: 0; }
html:not([data-view="ide"]) :is(#trust, #hub, #updates, #why-jc10) { order: 2; }
html:not([data-view="ide"]) .panel { order: 1; width: min(var(--wrap), calc(100% - 48px)); height: 340px; margin: 48px auto 96px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; box-shadow: var(--lift); }
html:not([data-view="ide"]) .statusbar { order: 3; height: var(--tb); padding: 0 max(16px, calc((100% - var(--wrap)) / 2)); }

/* site view, wide: text and visual side by side, alternating left and right */
@media (min-width: 1001px) {
  html:not([data-view="ide"]) .docs .doc { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); column-gap: 72px; align-items: center; }
  html:not([data-view="ide"]) .doc:nth-of-type(odd):not(#readme) { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
  html:not([data-view="ide"]) .doc:nth-of-type(odd):not(#readme) > .d-vis { order: -1; }
  html:not([data-view="ide"]) #readme { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
  html:not([data-view="ide"]) .d-wide { grid-column: 1 / -1; margin-top: 64px; }
  html:not([data-view="ide"]) .d-vis > :first-child { margin-top: 0; }
  html:not([data-view="ide"]) .d-vis :is(.feat, .checks, .articles, .signup, .sig-card) { max-width: none; }
}

/* ---------- narrower screens ---------- */
@media (max-width: 1280px) { .tb-center { visibility: hidden; } }
@media (max-width: 1100px) {
  .tb-menu { display: none; }
  html:not([data-view="ide"]) .app { padding-bottom: 56px; }
  html:not([data-view="ide"]) .activity { display: flex; position: fixed; z-index: 6; left: 0; right: 0; bottom: 0; height: 56px; flex-direction: row; border-right: 0; border-top: 1px solid var(--line); }
  html:not([data-view="ide"]) .activity a { flex: 1; height: 56px; }
  html:not([data-view="ide"]) .activity a.on::before { left: 20%; right: 20%; top: 0; bottom: auto; width: auto; height: 2px; }
  html:not([data-view="ide"]) .act-bottom { margin-top: 0; }
}
@media (max-width: 1000px) {
  .app { grid-template-columns: 56px minmax(0, 1fr); grid-template-areas: "title title" "act editor" "act panel" "status status"; }
  .sidebar { display: none; }
  .flow, .levels { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pipe { grid-template-columns: minmax(0, 1fr); gap: 18px; margin-top: 28px; }
  .pipe::before { left: 7px; right: auto; top: 8px; bottom: 8px; width: 2px; height: auto; background: linear-gradient(180deg, var(--acc), var(--btn)); }
  .pipe li { padding: 0 0 0 30px; }
  .pipe li::after { left: auto; right: 0; top: 0; }
  html:not([data-view="ide"]) .doc { padding-top: 64px; padding-bottom: 64px; }
  html:not([data-view="ide"]) .d-vis, html:not([data-view="ide"]) .d-wide { margin-top: 32px; }
  html:not([data-view="ide"]) .d-vis > :first-child { margin-top: 0; }
  html:not([data-view="ide"]) .mini { max-width: 560px; }
}

/* phone: both views scroll as a page; the sections bar sits at the bottom */
@media (max-width: 700px) {
  html, body { height: auto; }
  .app { display: block; height: auto; padding-bottom: 56px; }
  .titlebar { position: sticky; top: 0; z-index: 5; gap: 8px; padding: 0 10px; }
  .tb-brand span { display: none; }
  .tb-right { gap: 6px; }
  .seg a, .seg button { padding: 0 7px; }
  .activity, html:not([data-view="ide"]) .activity { display: flex; position: fixed; z-index: 6; left: 0; right: 0; bottom: 0; height: 56px; flex-direction: row; border-right: 0; border-top: 1px solid var(--line); }
  .activity a { flex: 1; height: 56px; }
  .activity a span { font-size: 9.5px; }
  .activity a.on::before { left: 20%; right: 20%; top: 0; bottom: auto; width: auto; height: 2px; }
  .activity .act-home { display: none; }
  .act-bottom { margin-top: 0; }
  .tabs { position: sticky; top: var(--tb); z-index: 4; }
  .docs { overflow: visible; }
  .doc { padding: 22px 16px 32px; }
  html:not([data-view="ide"]) .doc { padding: 48px 16px; }
  html:not([data-view="ide"]) #readme { padding-top: 48px; }
  html:not([data-view="ide"]) #readme .d-vis { display: none; }
  .lead { font-size: 16px; }
  .flow, .levels { grid-template-columns: minmax(0, 1fr); }
  .ladder { flex-direction: column; align-items: stretch; }
  .ladder li { flex-direction: column; align-items: stretch; }
  .ladder li + li::before { width: 1px; height: 10px; margin-left: 20px; }
  .articles li { padding-left: 18px; padding-top: 34px; }
  .articles li::before { top: 12px; }
  #readme .cta { flex-direction: column; }
  .cta .btn { flex: 1; }
  .signup-row { flex-direction: column; }
  .signup input[type="email"] { flex: none; }
  .panel { height: 300px; }
  html:not([data-view="ide"]) .panel { width: calc(100% - 32px); height: 320px; margin: 24px auto 48px; }
  .statusbar { height: 26px; }
  .statusbar .sb-branch, .statusbar .sb-right, .statusbar #sb-evidence { display: none; }
}
