/* JBNX — E1 "Paper" (owner pick 2026-11-01, canvas board E1).
   Loaded after os.css/command.css and overrides them: white paper, Inter, one 220px left nav
   that becomes the project's page nav inside a project, a full-width top bar with the
   breadcrumb and the page address, flat sections with small uppercase labels, a grey stat
   strip instead of KPI tiles, and an orange-edged Traps box. Color stays functional. */
:root {
  --bg: #ffffff; --surface: #ffffff; --panel: #fafaf7; --sunk: #f6f5f1;
  --ink1: #161614; --ink2: #4b4a46; --ink3: #6b6a65; --rule: #e3e2dd; --rule2: #d7d6d0;
  --red: #b42318; --red-bg: #fef2f2; --red-bd: #fecaca;
  --ok: #146b36; --ok-bg: #dff3e4; --ok-bd: #b7e2c4;
  --amb: #8a4a0b; --amb-bg: #fff8ef; --amb-bd: #f3d9b8; --amb-edge: #d9822b;
  --blu: #1f4fb8; --blu-bg: #eef1f8; --blu-bd: #c9d5f0;
  --vio: #5b2d91; --vio-bg: #efe6fb;
  --gry-bg: #f0efea; --gry: #4b4a46;
  --accent-bg: transparent; --accent-ink: var(--ink2);
  --shadow: none;
  --serif: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --side: 220px; --topbar: 52px;
}
body.dark {
  --bg: #121212; --surface: #121212; --panel: #181817; --sunk: #1f1f1d;
  --ink1: #ecebe6; --ink2: #b9b7af; --ink3: #8e8c85; --rule: #2a2a27; --rule2: #353531;
  --blu: #8fb0ff; --blu-bg: #1b2333; --blu-bd: #2c3c5e; --vio: #c9a0ff; --vio-bg: #2a2038;
  --amb: #f3cf9a; --amb-bg: #2b2316; --amb-bd: #4d3a1d; --amb-edge: #d9822b;
  --ok: #7fd7a0; --ok-bg: #12261a; --ok-bd: #24452f; --gry-bg: #232321; --gry: #b9b7af;
}
body { font: 14px/1.5 var(--sans); background: var(--bg); }
h2 { font-family: var(--sans); font-weight: 700; font-size: 16px; letter-spacing: 0; }

/* ---------- frame ---------- */
.app.e1 { display: flex; flex-direction: column; min-height: 100vh; }
.e1 .top { position: sticky; top: 0; z-index: 30; height: var(--topbar); display: flex; align-items: center; gap: 12px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--rule); backdrop-filter: none; font-size: 13px; }
.e1 .brand { font-weight: 700; font-size: 14px; color: var(--ink1); text-decoration: none; padding: 0; display: inline; }
.e1 .crumbs { font-size: 13px; color: var(--ink2); gap: 8px; }
.e1 .crumbs::before { content: '/'; color: #b9b8b2; }
.e1 .crumbs:empty::before { content: none; }
.e1 .crumbs .sep { color: #b9b8b2; }
.e1 .crumbs a { color: var(--ink2); }
.e1 .crumbs [aria-current] { color: var(--ink1); font-weight: 600; }
.e1 .search { border-radius: 8px; background: var(--sunk); border: 1px solid var(--rule2); padding: 6px 10px; min-width: 220px; color: var(--ink3); }
.e1 .path { font-family: var(--mono); font-size: 12px; color: var(--ink3); white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.e1 .path:empty { display: none; }
.e1 .icon-btn { width: 32px; height: 32px; border-radius: 8px; }
.e1 .acct button { border-radius: 8px; }
.e1 .body { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); flex: 1; min-height: 0; }
.e1 .side { position: sticky; top: var(--topbar); height: calc(100vh - var(--topbar)); overflow-y: auto; background: var(--panel); border-right: 1px solid var(--rule); padding: 18px 12px; display: flex; flex-direction: column; gap: 2px; }
.e1 main { padding: 28px 40px 64px; max-width: 1240px; width: 100%; }

/* left nav: plain text items, no icons, small uppercase group labels */
.e1 .nav-group { margin: 14px 0 4px; padding: 0 10px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); }
.e1 .nav-group:first-child { margin-top: 0; }
.e1 .nav-link { gap: 8px; padding: 7px 10px; border-radius: 6px; color: var(--ink2); font-size: 13px; }
.e1 .nav-link svg { display: none; }
.e1 .nav-link:hover { background: var(--sunk); color: var(--ink1); }
.e1 .nav-link[aria-current="page"] { background: var(--blu-bg); color: var(--ink1); font-weight: 600; }
.e1 .nav-link .count { font-family: var(--sans); font-size: 11.5px; font-weight: 600; background: none; padding: 0; color: var(--ink3); }
.e1 .nav-link[aria-current="page"] .count { background: none; color: var(--ink3); }
.e1 .nav-link .count.hot { background: none; color: var(--amb-edge); }
.e1 .nav-link.back { color: var(--ink3); margin-bottom: 8px; }
.e1 .nav-link.sub { font-size: 12px; color: var(--ink2); }
.e1 .side-foot { margin-top: auto; border-top: 1px solid var(--rule); padding: 10px 10px 0; font-size: 12px; }

/* ---------- page header ---------- */
.ph { align-items: flex-start; margin-bottom: 20px; }
.ph h1 { font-family: var(--sans); font-weight: 700; font-size: 30px; line-height: 1.15; letter-spacing: -.01em; }
.ph .sub { font-size: 14px; color: var(--ink2); margin-top: 6px; }
.ph .sub a { color: var(--blu); }
.ph .kicker { font-size: 12px; color: var(--ink3); margin-bottom: 4px; }
.tldr { background: none; color: var(--ink2); border-radius: 0; padding: 0; margin: -8px 0 20px; font-size: 14px; }
.tldr b { color: var(--ink1); }

/* ---------- buttons, chips ---------- */
.btn { border-radius: 8px; padding: 8px 14px; font-weight: 600; font-size: 13px; border-color: var(--rule2); }
.btn:hover { background: var(--sunk); }
.btn.primary { background: var(--blu); border-color: var(--blu); color: #fff; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.chip { border-radius: 999px; padding: 3px 9px; font-weight: 600; border: 0; }
.chip.info { background: var(--vio-bg); color: var(--vio); }

/* ---------- sections (cards become flat E1 sections) ---------- */
.card { border-radius: 10px; padding: 16px 18px; box-shadow: none; border-color: var(--rule); }
.card.flush .card-h { padding: 14px 18px 0; }
.card-h { margin-bottom: 10px; }
.card-h h2 { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); }
.card-h a.more { font-size: 12.5px; color: var(--blu); }
.err { border-radius: 8px; }
.empty { font-size: 13px; }

/* stat strip (replaces KPI tiles) */
.kpis { display: flex; flex-wrap: wrap; gap: 6px 28px; background: var(--sunk); border: 0; border-radius: 10px; padding: 14px 18px; margin-bottom: 22px; box-shadow: none; }
.kpi { padding: 0; border: 0; min-width: 0; }
.kpi:hover { background: none; }
.kpi .l { order: -1; font-size: 13px; color: var(--ink3); margin: 0; }
.kpi { display: flex; flex-direction: column; }
.kpi .v { font-family: var(--sans); font-size: 20px; font-weight: 700; letter-spacing: 0; line-height: 1.3; }
.kpi .v small { font-size: 12px; font-weight: 500; }
.kpi.warn .v { color: var(--amb); }
a.kpi:hover .v { text-decoration: underline; }
.kpi .bar { display: none; }

/* E1 brief sections */
.esec { display: flex; flex-direction: column; gap: 6px; margin: 0 0 20px; max-width: 860px; }
.esec h2 { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); margin: 0; }
.esec h2 span { font-weight: 400; text-transform: none; letter-spacing: 0; }
.esec p, .esec .prose { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ink1); white-space: pre-wrap; overflow-wrap: anywhere; }
.esec.trap { padding: 14px 16px; border-left: 3px solid var(--amb-edge); background: var(--amb-bg); }
.esec.trap h2 { color: var(--amb); }
.emeta { font-size: 12.5px; color: var(--ink3); margin: -6px 0 22px; }
.emeta a { color: var(--blu); }
.esub { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.esub > * { flex: 1 1 320px; min-width: 0; }

/* ---------- Projects: one-screen program index (no tiles) ---------- */
.pidx { columns: 3 300px; column-gap: 28px; }
.pblk { break-inside: avoid; margin: 0 0 22px; }
.pblk-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 0 0 6px; border-bottom: 1px solid var(--rule); margin-bottom: 2px; }
.pblk-h h2 { font-size: 13px; font-weight: 700; margin: 0; }
.pblk-h span { font-size: 12px; color: var(--ink3); white-space: nowrap; }
.prow { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 6px 4px; border-radius: 6px; text-decoration: none; color: var(--ink1); font-size: 13.5px; }
.prow:hover { background: var(--sunk); }
.prow .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .nm small { color: var(--ink3); font-size: 12px; margin-left: 6px; }
.prow .ct { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--ink3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.prow .ct b { color: var(--amb-edge); font-weight: 700; }
.prow .ct .stale { color: var(--amb); }
.prow .ct .held { color: var(--blu); font-weight: 600; }
.pidx-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 18px; }
.pidx-bar input[type=search] { border: 1px solid var(--rule2); background: var(--sunk); border-radius: 8px; padding: 7px 10px; min-width: 240px; }
.pidx-bar .sum { font-size: 13px; color: var(--ink3); margin-left: auto; }

/* ---------- Overview (Draft D in E1 paper) ---------- */
.queue { border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; margin-bottom: 22px; }
.queue-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--rule); }
.queue-h h2 { font-size: 15px; margin: 0; }
.queue-h span { font-size: 12.5px; color: var(--ink3); }
.qrow { display: grid; grid-template-columns: 26px minmax(160px, 1.2fr) 110px minmax(0, 2fr) 70px; gap: 14px; align-items: center; padding: 11px 16px; border-top: 1px solid #f0efea; text-decoration: none; color: inherit; font-size: 13.5px; }
.qrow:first-of-type { border-top: 0; }
.qrow:hover { background: var(--panel); }
.qrow .rk { width: 24px; height: 24px; border-radius: 6px; background: var(--ink1); color: var(--surface); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.qrow .nm b { font-weight: 600; } .qrow .nm span { color: var(--ink3); }
.qrow .ct b { color: var(--amb-edge); }
.qrow .nx { color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qrow .st { text-align: right; font-size: 12.5px; }
.qrow .st.fresh { color: var(--ok); } .qrow .st.stale { color: var(--amb); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { text-decoration: none; color: var(--ink1); padding: 7px 11px; border: 1px solid var(--rule); border-radius: 8px; background: var(--panel); font-size: 12.5px; }
.chips a.quiet { color: var(--ink3); background: none; }
.dormant { border: 1px dashed var(--rule2); background: var(--sunk); border-radius: 10px; padding: 14px 16px; font-size: 12.5px; color: var(--ink2); line-height: 1.7; }
.dormant h2 { font-size: 13px; margin: 0 0 4px; color: var(--ink2); }
.dormant a { color: var(--ink2); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .e1 .top { padding: 0 12px; gap: 8px; }
  .e1 .path, .e1 .live span, .e1 .crumbs, .e1 #themeBtn, .e1 [data-passkeys] { display: none; }
  .e1 .acct button { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .e1 .search { margin-left: auto; }
  .e1 .search { min-width: 0; }
  .e1 .body { grid-template-columns: 1fr; }
  .e1 .side { position: fixed; top: 0; left: 0; bottom: 0; height: 100vh; width: min(280px, 86vw); z-index: 50; transform: translateX(-102%); transition: transform .2s ease; }
  .e1 .side.open { transform: none; }
  .e1 main { padding: 18px 14px 56px; }
  .ph h1 { font-size: 24px; }
  .qrow { grid-template-columns: 26px minmax(0, 1fr) auto; }
  .qrow .nx, .qrow .st { display: none; }
  .pidx { columns: 1; }
}
