:root {
  --canvas: #f4f1ea; --card: #ffffff; --ink: #211e18; --muted: #79725f;
  --teal: #1f6f5c; --violet: #6a4fc0; --border: #e7e2d8; --focus: #3a72cf;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Hanken Grotesk', system-ui, sans-serif; color: var(--ink); background: var(--canvas); -webkit-font-smoothing: antialiased; }
button, input, textarea { font-family: inherit; }
a { color: inherit; }
:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

/* ── Topbar ── */
.topbar { height: 60px; display: flex; align-items: center; gap: 11px; padding: 0 22px; background: var(--card); border-bottom: 1px solid var(--border); position: relative; z-index: 30; }
.logo { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 9px; background: var(--teal); color: #fff; font-weight: 800; font-size: 16px; letter-spacing: -.5px; box-shadow: 0 1px 2px rgba(31,111,92,.35); flex: 0 0 30px; }
.brand { font-weight: 700; font-size: 15.5px; letter-spacing: -.2px; color: #1f1c16; }
.brand-sub { font-size: 11px; color: var(--muted); font-weight: 500; border-left: 1px solid var(--border); padding-left: 11px; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 10px; background: #f6f4ee; border: 1px solid #e9e4d9; border-radius: 999px; white-space: nowrap; flex: 0 0 auto; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #2a9d6f; box-shadow: 0 0 0 3px rgba(42,157,111,.16); flex: 0 0 7px; }
.status-dot-warn { background: #b8791f; box-shadow: 0 0 0 3px rgba(184,121,31,.16); }
.status-label { font-size: 12.5px; color: #56503f; font-weight: 500; }
.topbar-spacer { flex: 1; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ── Sign-in page (standalone — no topbar/sidebar chrome) ── */
.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--canvas); }
.login-card { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; max-width: 320px; margin: 0 16px; padding: 32px 28px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 1px 3px rgba(33,30,24,.08); }
.login-card h1 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.2px; }
.login-card input[type="password"] { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: 9px; font-size: 14px; }
.login-card .btn-take { width: 100%; }

/* ── Shell layout ── */
.shell { display: grid; grid-template-columns: 228px 1fr; min-height: calc(100vh - 60px); }

/* ── Sidebar ── */
.sidebar { padding: 18px 14px; background: #fbfaf6; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 3px; }
.nav-label { margin: 0; padding: 6px 12px 8px; font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: #857c6b; }
.sidebar a { display: flex; align-items: center; padding: 9px 12px; border-radius: 10px; text-decoration: none; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.sidebar a[aria-current="page"] { background: #edeae2; }
.sidebar a:hover:not([aria-disabled="true"]) { background: #f0ede5; }
.nav-soon { color: #aaa393; cursor: default; font-weight: 500; pointer-events: none; }

/* ── Content area ── */
.content { padding: 34px 40px 80px; max-width: 1100px; }

/* ── Fleet screen ── */
.lede { color: var(--muted); margin-top: 6px; font-size: 14px; }
.rollup { display: flex; gap: 14px; margin: 22px 0 26px; }
.rollup-pill { font-size: 12.5px; font-weight: 700; padding: 4px 12px; border-radius: 999px; max-width: 42ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rollup-pill.behind { color: #92541a; background: #fbeede; }
.rollup-pill.ahead  { color: #553aa6; background: #f0ebfb; }
.rollup-pill.current { color: #1d7350; background: #e3f0e8; }
.rollup-pill.portal-up_to_date { color: #1d7350; background: #e3f0e8; }
.rollup-pill.portal-stale { color: #92541a; background: #fbeede; }
.rollup-pill.portal-cannot_build { color: #a3311a; background: #fbe3de; }
.rollup-pill.portal-never_built { color: var(--muted); background: #f0ede5; }
.fleet-table { background: var(--card); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: 0 1px 2px rgba(40,35,25,.03); }
.fleet-head, .fleet-row { display: grid; grid-template-columns: 1.8fr 1.2fr 1fr 1.4fr 1.2fr; gap: 14px; padding: 14px 22px; align-items: center; }
.fleet-head { background: #faf8f3; border-bottom: 1px solid #eee9df; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #857c6b; }
.fleet-row { border-bottom: 1px solid #f1ece2; }
.fleet-row:last-child { border-bottom: none; }
.fleet-row:hover { background: #f8f6f0; }
.cell-client { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
.cell-program { font-size: 13px; color: #56503f; font-weight: 500; }
.cell-tools { display: flex; flex-wrap: wrap; gap: 5px; }
.tool { font-size: 11px; font-weight: 600; color: #56503f; background: #f0ede5; border: 1px solid #e7e2d8; border-radius: 6px; padding: 2px 8px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.cell-code { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--muted); }
.tag { font-size: 11px; font-weight: 600; color: var(--muted); background: #f0ede5; border-radius: 5px; padding: 1px 6px; margin-left: 7px; }
.err { color: #92541a; margin-left: 6px; }

/* ── Session compose screen ── */
.session-wrap { padding-bottom: 40px; }
.crumb { font-size: 12.5px; color: var(--muted); margin: 0 0 10px; }
.crumb a { text-decoration: none; color: var(--muted); }
.session-sub { color: #56503f; font-size: 13.5px; margin-top: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mono { font-family: 'JetBrains Mono', monospace; font-size: .92em; }
.muted { color: var(--muted); }
.session-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 20px 0 22px; }
.stab { border: none; background: none; padding: 10px 4px; margin-right: 18px; font-size: 14px; font-weight: 500; color: #79725f; cursor: pointer; border-bottom: 2px solid transparent; }
.stab.on, .stab[aria-selected="true"] { font-weight: 700; color: #1f1c16; border-bottom-color: var(--teal); }
.stab[aria-disabled="true"] { color: #aaa393; cursor: default; }
.tab-count { font-size: 11px; font-weight: 700; color: #92541a; background: #fbeede; border-radius: 999px; padding: 1px 7px; }
.legend { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; font-size: 11.5px; color: var(--muted); }
.legend-label { font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: 10.5px; color: #857c6b; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.page-group { margin-bottom: 26px; }
.page-head { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #857c6b; margin: 0 0 12px; }
.block-card { position: relative; background: #fff; border: 1px solid var(--border); border-radius: 13px; padding: 15px 18px; margin-bottom: 12px; overflow: hidden; }
.rail { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.block-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.block-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.byline { font-size: 11.5px; color: var(--muted); }
.block-head .spacer { flex: 1; }
.block-id { font-size: 11px; color: var(--muted); }
.block-body { font-size: 14px; line-height: 1.55; color: #211e18; }
.fill { font-family: 'JetBrains Mono', monospace; font-size: .86em; background: #eef3fa; color: #345b91; border: 1px solid #dde6f2; border-radius: 5px; padding: 0 5px; white-space: nowrap; }
.fill.muted { background: #eee9df; color: var(--muted); border-color: #e0dacd; }
.compare { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 12px; }
.compare-label { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #827a6c; margin: 0 0 6px; }
.compare-label .sw.base { background: #b8b0a0; }
.compare-label .sw.master { background: #2a9d6f; }
.compare-text { font-size: 13.5px; line-height: 1.55; color: var(--muted); background: #faf8f3; border-radius: 9px; padding: 10px 12px; margin-bottom: 10px; }
.orphan-alert { font-size: 12.5px; color: #8a4a4a; background: #faf0ee; border: 1px solid #ecdada; border-radius: 9px; padding: 9px 12px; margin-top: 10px; }
.client-link { text-decoration: none; color: inherit; font-weight: 700; }
.client-link:hover { text-decoration: underline; }
/* preview panel */
.preview-panel { margin-top: 30px; border: 1px solid var(--border); border-radius: 14px; background: #fff; overflow: hidden; }
.preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: #faf8f3; }
.tool-toggle { display: flex; align-items: center; gap: 8px; }
.preview-as { font-size: 12px; color: var(--muted); font-weight: 600; }
.tool-tab { border: 1px solid transparent; background: transparent; border-radius: 7px; padding: 5px 10px; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; }
.tool-tab.on { background: #fff; color: #1f1c16; box-shadow: 0 1px 2px rgba(40,35,25,.12); border-color: var(--border); }
.page-select { font: inherit; font-size: 12.5px; padding: 4px 8px; border-radius: 7px; border: 1px solid var(--border); background: #fff; }
.page-select-label { font-size: 12px; color: var(--muted); display: inline-flex; gap: 7px; align-items: center; }
#preview-frame { width: 100%; height: 560px; border: none; display: block; background: #fff; }

/* ── Pre-class board ── */
.board { background: #fff; border: 1px solid var(--border); border-radius: 18px; overflow: hidden; }
.board-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #857c6b; margin: 0; padding: 18px 22px 0; }
.board-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.board-cell { padding: 22px 24px; border-right: 1px solid #f1ece2; }
.board-cell:last-child { border-right: none; }
.board-n { font-size: 32px; font-weight: 800; line-height: 1; }
.board-lab { font-size: 12.5px; color: var(--muted); margin-top: 7px; }
/* ── Accept inbox ── */
.inbox-intro { margin: 0 0 18px; }
.inbox-empty { text-align: center; padding: 60px 20px; background: #fff; border: 1px solid var(--border); border-radius: 16px; }
.inbox-check { width: 52px; height: 52px; border-radius: 14px; background: #e3f0e8; color: #1d7350; font-size: 26px; display: grid; place-items: center; margin: 0 auto 14px; }
.inbox-empty-title { font-size: 16px; font-weight: 700; color: #1f1c16; margin: 0; }
.inbox-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin-bottom: 14px; }
.inbox-head { padding: 13px 18px; border-bottom: 1px solid #f1ece2; background: #faf8f3; font-size: 11px; color: var(--muted); }
.inbox-base { padding: 13px 18px 0; }
.inbox-compare { display: grid; grid-template-columns: 1fr 1fr; }
.inbox-col { padding: 16px 18px; border-right: 1px solid #f1ece2; }
.inbox-col.edit { border-right: none; }
.inbox-text { font-size: 13.5px; line-height: 1.55; color: #322f29; }
.inbox-orphan-text { font-size: 13.5px; line-height: 1.55; color: #322f29; background: #faf0ee; border: 1px solid #ecdada; border-radius: 9px; padding: 11px 13px; margin: 0 18px; }
.compare-label.orphan { color: #8a4a4a; padding: 16px 18px 0; }
.inbox-orphan-note { padding: 8px 18px 0; margin: 0; font-size: 12px; }
.inbox-actions { display: flex; gap: 9px; flex-wrap: wrap; padding: 13px 18px; border-top: 1px solid #f1ece2; }
.btn-take { height: 34px; padding: 0 14px; border-radius: 9px; border: none; background: #1f6f5c; color: #fff; font-weight: 600; font-size: 12.5px; cursor: pointer; }
.btn-keep { height: 34px; padding: 0 14px; border-radius: 9px; border: 1px solid #cfd9e8; background: #fff; color: #345b91; font-weight: 600; font-size: 12.5px; cursor: pointer; }
.btn-rewrite { height: 34px; padding: 0 14px; border-radius: 9px; border: 1px solid #ddd0f0; background: #faf8fe; color: #5a44ad; font-weight: 600; font-size: 12.5px; cursor: pointer; }
.btn-discard { height: 34px; padding: 0 14px; border-radius: 9px; border: 1px solid #ecc9c9; background: #fbf0f0; color: #9a4444; font-weight: 600; font-size: 12.5px; cursor: pointer; }
.btn-plain { height: 34px; padding: 0 12px; border: none; background: none; color: var(--muted); font-weight: 600; font-size: 12.5px; cursor: pointer; }
.rewrite-form { padding: 0 18px 14px; display: flex; flex-direction: column; gap: 8px; }
.rewrite-form[hidden] { display: none; }   /* a class display rule otherwise overrides the [hidden] attribute */
.rewrite-form textarea { font: inherit; font-size: 13px; line-height: 1.5; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; resize: vertical; }
.rewrite-actions { display: flex; gap: 9px; }
/* ── Confirm dialog ── */
.dialog-backdrop { position: fixed; inset: 0; background: rgba(33,30,24,.42); z-index: 80; display: grid; place-items: center; }
.dialog { width: 540px; max-width: 96vw; background: #fff; border-radius: 18px; box-shadow: 0 30px 80px rgba(33,30,24,.32); overflow: hidden; }
.dialog-head { padding: 22px 26px 18px; border-bottom: 1px solid #f1ece2; }
.dialog-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #857c6b; margin: 0; }
.dialog-title { font-size: 19px; font-weight: 800; margin: 7px 0 0; color: #1f1c16; }
.dialog-body { padding: 22px 26px; }
.dialog-note { margin: 14px 0 20px; font-size: 12.5px; }
.dialog-actions { display: flex; gap: 10px; }
.btn-discard-solid { flex: 1; height: 44px; border-radius: 11px; border: none; background: #9a4444; color: #fff; font-weight: 700; font-size: 14px; cursor: pointer; }

/* ── Block editing + fold-back ── */
.block-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.btn-edit { height: 30px; padding: 0 11px; border-radius: 8px; border: 1px solid #e6e0d4; background: #fff; color: #615a4b; font-weight: 600; font-size: 12px; cursor: pointer; }
.btn-revert { height: 30px; padding: 0 11px; border-radius: 8px; border: 1px solid #e6e0d4; background: #fff; color: #79725f; font-weight: 600; font-size: 12px; cursor: pointer; }
.btn-fold { height: 30px; padding: 0 11px; border-radius: 8px; border: 1px solid #d7cdeb; background: #f6f1fd; color: #553aa6; font-weight: 600; font-size: 12px; cursor: pointer; }
.edit-form { margin-top: 13px; border: 1px solid #cfd9e8; background: #fbfcfe; border-radius: 12px; overflow: hidden; display: block; }
.edit-form[hidden] { display: none; }   /* a class display rule otherwise overrides [hidden] */
.edit-head { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: #f1f5fb; border-bottom: 1px solid #e1e8f2; }
.edit-label { font-size: 11.5px; font-weight: 700; color: #345b91; }
.edit-form textarea { width: 100%; border: none; resize: vertical; min-height: 84px; padding: 13px; font: inherit; font-size: 14px; line-height: 1.6; color: #322f29; background: transparent; }
.edit-actions { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-top: 1px solid #e8edf4; }
/* fold-back dialog */
.fold-diff { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 16px; }
.fold-before { padding: 12px 15px; border-bottom: 1px solid #f1ece2; }
.fold-after { padding: 12px 15px; background: #fbfcff; }
.fold-text { font-size: 14px; line-height: 1.6; color: #322f29; }
.fold-text.strike { color: var(--muted); text-decoration: line-through; text-decoration-color: #d8c9b3; font-size: 13.5px; }
.compare-label.after { color: #553aa6; }
.affects { background: #faf8f3; border: 1px solid #eee9df; border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.affects-label { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #857c6b; margin: 0 0 10px; }
.affects-row { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.affects-who { font-size: 13px; color: #322f29; font-weight: 500; flex: 1; }
.affects-row .muted { font-size: 12px; }
.btn-fold-solid { flex: 1; height: 44px; border-radius: 11px; border: none; background: #553aa6; color: #fff; font-weight: 700; font-size: 14px; cursor: pointer; }

/* ── Programs index + overview ── */
.program-list { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.program-card { display: block; text-decoration: none; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; color: inherit; }
.program-card:hover { background: #faf8f3; }
.program-name { font-size: 16px; font-weight: 800; color: #1f1c16; }
.program-meta { font-size: 13px; color: var(--muted); margin-top: 4px; }
.drift-tag { color: #2c5a3c; font-weight: 600; }
.heat-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; margin: 18px 0 22px; }
.heat-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 14px; }
.heat-title { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #857c6b; }
.heat-head .muted { font-size: 12px; }
.heat-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.heat-cell { flex: 1; min-width: 88px; height: 62px; border-radius: 9px; border: 1px solid; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.heat-ratio { font-size: 15px; font-weight: 800; }
.heat-bucket { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.drifters-label { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #857c6b; margin: 0 0 10px; }
.drifters { display: flex; flex-direction: column; gap: 9px; }
.drifter { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; }
.drifter-swatch { width: 48px; height: 48px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 48px; font-size: 14px; font-weight: 800; }
.drifter-page { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #827a6c; }
.drifter-id { font-size: 14px; font-weight: 600; color: #1f1c16; margin-top: 2px; }
.drifter-body .muted { font-size: 12.5px; margin-top: 2px; }
/* The non-fatal warnings strip — amber “worth a look”, never an error red */
.program-warnings { background: #fdf6ec; border: 1px solid #efdcbc; border-radius: 12px; padding: 13px 18px; margin: 16px 0 4px; }
.program-warnings-label { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #92541a; }
.program-warnings-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.program-warnings-list li { font-size: 13px; color: #56503f; }
.program-empty { text-align: center; padding: 54px 24px; background: #fff; border: 1px solid var(--border); border-radius: 16px; margin-top: 22px; }
.program-empty-icon { width: 52px; height: 52px; border-radius: 14px; background: #eef1ec; color: #5c7a66; font-size: 24px; display: grid; place-items: center; margin: 0 auto 14px; }
.program-empty-title { font-size: 16px; font-weight: 700; color: #1f1c16; margin: 0; }

/* ── Lifecycle modals + publish ── */
.dialog-wide { width: 600px; }
.session-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.create-btn { margin: 14px 0 4px; }
.form-label { display: block; font-size: 12px; font-weight: 700; color: #615a4b; margin: 16px 0 6px; }
.form-label:first-child { margin-top: 0; }
.tok { color: #345b91; font-weight: 500; font-size: .92em; }
.form-input { width: 100%; height: 42px; border: 1px solid var(--border); border-radius: 10px; padding: 0 13px; font: inherit; font-size: 14px; background: #fff; }
.program-picker, .tool-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.pick { display: inline-flex; align-items: center; gap: 7px; border: 1.5px solid #e2dcd0; background: #fff; border-radius: 10px; padding: 9px 13px; font-size: 13px; cursor: pointer; }
.pick:has(input:checked) { border-color: #1f6f5c; background: #f0f6f2; color: #1f6f5c; font-weight: 600; }
.dup-note { background: #f3f6fb; border: 1px solid #dde6f2; border-radius: 11px; padding: 13px 15px; font-size: 13px; color: #345b91; margin: 0 0 4px; }
.form-error { background: #fbf0f0; border: 1px solid #ecc9c9; border-radius: 10px; padding: 10px 13px; font-size: 13px; color: #9a4444; margin-top: 14px; }
.publish-target { display: flex; align-items: center; gap: 8px; background: #f0f6f2; border: 1px solid #d4e6da; border-radius: 10px; padding: 11px 13px; margin-bottom: 14px; }
.outcome-head { display: flex; align-items: center; gap: 11px; margin-bottom: 16px; }
.outcome-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 20px; font-weight: 800; background: #e3f0e8; color: #1d7350; flex: 0 0 40px; }
.outcome-icon.bad { background: #f7e4e1; color: #9a4444; }
.outcome-title { font-size: 17px; font-weight: 800; color: #1f1c16; }
.outcome-err { color: #9a4444; }
.outcome-label { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #857c6b; margin: 0 0 8px; }
.publish-files { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; }
.ok-check { color: #1d7350; font-weight: 800; }
.outcome-untouched { font-size: 12.5px; color: #1d7350; font-weight: 600; margin: 14px 0 0; }
.outcome-warn { font-size: 12.5px; color: #6b4a1e; line-height: 1.5; margin: 14px 0 0; padding: 12px 14px; background: #fbeede; border: 1px solid #f0dcb8; border-radius: 10px; }
.btn-quiet { display: block; height: 30px; padding: 0 12px; margin-top: 10px; border-radius: 8px; border: 1px solid #e2c48c; background: #fff; color: #92541a; font-weight: 600; font-size: 12px; cursor: pointer; }

/* ---- Programs index header + New program ---- */
.programs-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.btn-new-program { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--border); background: #fff; color: #56503f; font-weight: 600; font-size: 13.5px; text-decoration: none; cursor: pointer; }
.btn-new-program:hover { background: #faf8f3; }
.program-empty .btn-new-program { margin-top: 16px; }

/* ---- Surface 6: authoring canvas ---- */
.authoring-overlay { position: fixed; inset: 0; z-index: 60; background: var(--canvas); display: flex; flex-direction: column; }
.authoring-bar { height: 60px; flex: 0 0 60px; display: flex; align-items: center; gap: 14px; padding: 0 22px; background: #fff; border-bottom: 1px solid var(--border); }
.authoring-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #857c6b; }
.authoring-name { font-size: 16px; font-weight: 800; color: #1f1c16; border: none; background: transparent; min-width: 220px; outline: none; }
.authoring-spacer { flex: 1; }
.authoring-main { flex: 1; min-height: 0; display: flex; }
.authoring-canvas { flex: 1; min-width: 0; overflow-y: auto; padding: 28px 36px 80px; }
.authoring-canvas h1 { font-size: 20px; font-weight: 800; color: #1f1c16; margin: 4px 0; }
.authoring-canvas > .muted { max-width: 560px; margin: 0 0 22px; font-size: 13px; }
.authoring-rail { width: 380px; flex: 0 0 380px; border-left: 1px solid var(--border); background: #fbfaf6; overflow-y: auto; padding: 22px 22px 60px; }
.auth-section { margin-bottom: 22px; }
.auth-section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.auth-section-label { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #79725f; border: none; background: transparent; outline: none; }
.auth-section-file { font-size: 11px; color: #827a6c; margin-left: auto; }
.auth-blocks { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.auth-block { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 13px 15px; }
.auth-block-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; row-gap: 6px; margin-bottom: 8px; }
.auth-block-id { font-size: 11px; font-weight: 700; color: #79725f; border: 1px solid transparent; background: transparent; flex: 1 1 90px; min-width: 70px; border-radius: 6px; padding: 2px 4px; }
.auth-block-id:focus { border-color: #e0dacd; background: #fbfaf6; outline: none; }
.auth-blank-badge { font-size: 10.5px; font-weight: 700; color: #345b91; background: #eef3fa; border: 1px solid #dde6f2; border-radius: 5px; padding: 1px 6px; }
.auth-blank-badge[hidden] { display: none; }
.auth-bar-spacer { flex: 1; }
.auth-icon-btn, .auth-mark { height: 26px; border-radius: 7px; border: 1px solid #e6e0d4; background: #fff; color: #79725f; cursor: pointer; font-size: 12px; }
.auth-icon-btn { width: 26px; }
.auth-icon-btn:hover, .auth-mark:hover { background: #faf8f3; }
.auth-mark { padding: 0 9px; border-color: #cfd9e8; background: #f3f6fb; color: #345b91; font-weight: 600; font-size: 11.5px; }
.auth-del { border-color: #ecc9c9; background: #fbf3f3; color: #9a4444; }
.auth-block-text { width: 100%; box-sizing: border-box; border: 1px solid #eee9df; border-radius: 8px; resize: vertical; min-height: 54px; padding: 10px; font-size: 13.5px; line-height: 1.55; color: #322f29; background: #fbfaf6; font-family: inherit; }
.auth-add-block, #auth-add-section { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 8px; border: 1px dashed #cfc8b8; background: transparent; color: #79725f; font-weight: 600; font-size: 12.5px; cursor: pointer; }
#auth-add-section { margin-top: 6px; }
.authoring-rail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
#auth-tools { display: flex; gap: 3px; background: #efece4; border: 1px solid #e3ddd1; border-radius: 9px; padding: 3px; }
.auth-tool { padding: 4px 9px; border: none; border-radius: 6px; cursor: pointer; font-size: 11.5px; font-weight: 600; color: #615a4b; background: transparent; }
.auth-tool[aria-selected="true"] { background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.auth-preview-page { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 12px; }
.auth-preview-file { font-size: 11px; color: #827a6c; margin-bottom: 8px; }
.auth-preview-frame { width: 100%; height: 340px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.auth-problems { margin-top: 18px; background: #faf0ee; border: 1px solid #ecdada; border-radius: 11px; padding: 13px 15px; color: #8a4a4a; font-size: 13px; }
.auth-problems-title { font-weight: 700; margin: 0 0 6px; }
.auth-problems ul { margin: 0; padding-left: 18px; }
.auth-problems li { margin: 2px 0; }

/* ---- Surface 7: element palette (typed blocks) ---- */
.auth-kind-select { height: 26px; border-radius: 7px; border: 1px solid #d9dbe6; background: #f4f5fa; color: #444a66; font-size: 11.5px; font-weight: 600; padding: 0 4px; cursor: pointer; }
.auth-kind-select:disabled { opacity: .5; cursor: default; }
.auth-raw { height: 26px; padding: 0 8px; border-radius: 7px; border: 1px solid #e6e0d4; background: #fff; color: #79725f; cursor: pointer; font-size: 11px; font-family: 'JetBrains Mono', monospace; }
.auth-raw.on { background: #2f2b22; color: #f4f1ea; border-color: #2f2b22; }
.auth-add-menu { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.auth-add-kind { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 11px; border-radius: 8px; border: 1px dashed #cfc8b8; background: transparent; color: #79725f; font-weight: 600; font-size: 12px; cursor: pointer; }
.auth-add-kind:hover { background: #faf8f3; border-style: solid; }
.auth-mini { margin-top: 2px; }
.auth-mini-input, .auth-mini-area { width: 100%; box-sizing: border-box; border: 1px solid #eee9df; border-radius: 8px; padding: 9px 10px; font-size: 13.5px; line-height: 1.5; color: #322f29; background: #fbfaf6; font-family: inherit; }
.auth-mini-area { resize: vertical; min-height: 52px; }
.auth-mini-stack { display: flex; flex-direction: column; gap: 9px; }
.auth-mini-field { display: flex; flex-direction: column; gap: 4px; }
.auth-mini-label { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #857c6b; }
.auth-items { display: flex; flex-direction: column; gap: 6px; }
.auth-item-row { display: flex; align-items: center; gap: 6px; }
.auth-item-row .auth-mini-input { flex: 1; }
.auth-item-rm { flex: 0 0 auto; }
.auth-item-add { align-self: flex-start; height: 28px; padding: 0 10px; border-radius: 7px; border: 1px dashed #cfc8b8; background: transparent; color: #79725f; font-weight: 600; font-size: 11.5px; cursor: pointer; }
.auth-preview-empty { background: #fff; border: 1px dashed var(--border); border-radius: 12px; padding: 28px 18px; text-align: center; }
.auth-preview-empty-title { font-size: 14px; font-weight: 700; color: #56503f; margin: 0 0 4px; }

/* ---- Surface 8: multi-tool authoring ---- */
.auth-pagesettings { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 2px 0 12px; padding: 8px 10px; background: #f7f5ef; border: 1px solid #eee9df; border-radius: 9px; }
.auth-toggle { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: #56503f; cursor: pointer; }
.auth-setting-input { flex: 1; min-width: 120px; border: 1px solid #eee9df; border-radius: 7px; padding: 5px 8px; font-size: 12.5px; background: #fff; color: #322f29; }
.auth-toolword { height: 26px; border-radius: 7px; border: 1px solid #cfd9e8; background: #f3f6fb; color: #345b91; font-size: 11.5px; font-weight: 600; padding: 0 4px; cursor: pointer; }
.auth-scope-btn { height: 26px; padding: 0 10px; border-radius: 7px; border: 1px solid #e6e0d4; background: #fff; color: #79725f; cursor: pointer; font-size: 11.5px; font-weight: 600; }
.auth-scope-btn.scoped { border-color: #d7cdeb; background: #f6f1fd; color: #553aa6; }
.auth-scope-panel-wrap { margin-top: 8px; }
.auth-scope-panel { display: flex; flex-wrap: wrap; gap: 16px; padding: 11px 13px; background: #faf8fd; border: 1px solid #e7ddf5; border-radius: 9px; }
.auth-scope-grp { display: flex; flex-direction: column; gap: 5px; }
.auth-scope-grp-label { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #857c6b; }
.auth-scope-check { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: #56503f; cursor: pointer; }
.auth-scope-select { height: 28px; border-radius: 7px; border: 1px solid #e0dacd; background: #fff; color: #322f29; font-size: 12.5px; padding: 0 6px; }

/* ---- Surface 10: edit a live master ---- */
.master-edit { max-width: 760px; }
.master-edit-banner { background: #fbf3e6; border: 1px solid #f0e0c4; border-radius: 10px; padding: 10px 13px; font-size: 13px; color: #8a6a2a; margin: 6px 0 20px; }
.master-page { margin-bottom: 22px; }
.master-page-name { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #857c6b; margin-bottom: 10px; }
.master-block { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.master-block-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.master-block-id { font-size: 11px; font-weight: 700; color: #79725f; }
.master-saved { font-size: 11.5px; font-weight: 600; color: #1d7350; background: #e3f0e8; border-radius: 6px; padding: 1px 8px; }
.master-block-text { width: 100%; box-sizing: border-box; border: 1px solid #eee9df; border-radius: 8px; resize: vertical; min-height: 56px; padding: 10px; font-size: 13px; line-height: 1.55; color: #322f29; background: #fbfaf6; font-family: 'JetBrains Mono', monospace; }
.master-block [data-save] { margin-top: 8px; }
.master-block [data-save][data-dirty] { box-shadow: 0 0 0 2px #cfe3d8; }
.affects-list { list-style: none; padding: 0; margin: 10px 0 16px; display: flex; flex-direction: column; gap: 5px; font-size: 13px; }

.program-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

/* ── Settings (A1) ── */
.settings-wrap { max-width: 680px; }
.settings-head h1 { margin: 0; }
.settings-saved { background: #e3f0e8; border: 1px solid #c5e0d1; color: #1d7350; border-radius: 10px; padding: 10px 13px; font-size: 13px; font-weight: 600; margin: 16px 0 0; }
.form-error-title { font-weight: 700; margin: 0 0 6px; }
.form-error ul { margin: 0; padding-left: 18px; }
.settings-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 20px 22px; margin-top: 18px; }
.settings-card-label { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #857c6b; margin: 0 0 6px; }
.field-hint { font-size: 12px; color: var(--muted); margin: 5px 0 0; }
.form-textarea { width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 10px 13px; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12.5px; line-height: 1.55; background: #fff; resize: vertical; }
.settings-actions { margin-top: 20px; }
.doc-block { padding: 14px 0; border-top: 1px solid #f1ece2; }
.doc-block:first-of-type { border-top: none; padding-top: 6px; }
.doc-title { font-size: 13.5px; font-weight: 700; color: #1f1c16; margin: 0 0 5px; }
.doc-body { font-size: 13px; color: #56503f; line-height: 1.55; margin: 0; }
.doc-paths { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: 12.5px; }
.doc-paths dt { color: var(--muted); font-weight: 600; }
.doc-paths dd { margin: 0; color: #56503f; word-break: break-all; }

/* ── Platforms (A2a) ── */
.platform-card-head { display: flex; align-items: center; gap: 10px; }
.kind-badge { font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; border-radius: 999px; padding: 2px 10px; }
.kind-agent { color: #2b5da8; background: #e8f0fb; }
.kind-chat { color: #1d7350; background: #e3f0e8; }
.form-warn { background: #fbf4e8; border: 1px solid #ecd9b6; border-radius: 10px; padding: 10px 13px; font-size: 13px; color: #84602a; margin-top: 14px; }
.form-warn ul { margin: 0; padding-left: 18px; }

/* ---- Structure tools: hide / restore / own blocks (session) ---- */
.page-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.page-head-row .page-head { margin: 0; }
.btn-hide-section { height: 28px; padding: 0 10px; border-radius: 7px; border: 1px solid #e6e0d4; background: #fff; color: #79725f; font-weight: 600; font-size: 11.5px; cursor: pointer; }
.btn-hide-section:hover { background: #faf8f3; }
.block-card.block-hidden { opacity: .62; background: #fbfaf7; }
.block-card.block-hidden .block-body { color: #6b6459; }
.btn-add-below { height: 30px; padding: 0 11px; border-radius: 8px; border: 1px dashed #cfc8b8; background: transparent; color: #79725f; font-weight: 600; font-size: 12px; cursor: pointer; }
.btn-add-below:hover { background: #faf8f3; }
.btn-add-block { margin-top: 4px; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 9px; border: 1px dashed #cfc8b8; background: transparent; color: #56503f; font-weight: 600; font-size: 12.5px; cursor: pointer; }
.btn-add-block:hover { background: #faf8f3; }
.add-own-form { margin-top: 13px; border: 1px solid #cfe3d8; background: #fbfefc; border-radius: 12px; overflow: hidden; display: block; }
.add-own-form[hidden] { display: none; }
.add-own-form textarea { width: 100%; border: none; resize: vertical; min-height: 72px; padding: 13px; font: inherit; font-size: 14px; line-height: 1.6; color: #322f29; background: transparent; }
/* board: notices + 5th cell */
.board-grid-5 { grid-template-columns: repeat(5, 1fr); }
.board-notices { padding: 16px 22px 20px; border-top: 1px solid #f1ece2; }
.board-notices-label { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #857c6b; margin: 0 0 8px; }
.board-notice { font-size: 13px; color: #56503f; margin: 0 0 6px; }
/* ---- Structure tools: master editor (add / delete / move) ---- */
.master-block-move { display: inline-flex; gap: 4px; margin-right: 6px; }
.btn-move { width: 26px; height: 26px; border-radius: 7px; border: 1px solid #e6e0d4; background: #fff; color: #79725f; font-weight: 700; cursor: pointer; }
.btn-move:hover:not(:disabled) { background: #faf8f3; }
.btn-move:disabled { opacity: .35; cursor: default; }
.btn-move-master { height: 30px; padding: 0 11px; border-radius: 8px; border: 1px solid #e6e0d4; background: #fff; color: #79725f; font-weight: 600; font-size: 12px; cursor: pointer; }
.btn-move-master:hover { background: #faf8f3; color: #56503f; }
.btn-delete-master { height: 30px; padding: 0 11px; border-radius: 8px; border: 1px solid #ecc9c9; background: #fbf3f3; color: #9a4444; font-weight: 600; font-size: 12px; cursor: pointer; }
.btn-delete-master:hover { background: #f7e9e9; }
.master-block-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.master-add-block { margin: 10px 0 16px; border: 1px dashed #cfe3d8; border-radius: 12px; padding: 12px 14px; background: #fbfefc; }
.master-add-block textarea { width: 100%; box-sizing: border-box; border: 1px solid #eee9df; border-radius: 8px; resize: vertical; min-height: 56px; padding: 10px; font-size: 13px; line-height: 1.55; color: #322f29; background: #fff; font-family: 'JetBrains Mono', monospace; margin-bottom: 8px; }
.btn-add-master { height: 32px; padding: 0 12px; border-radius: 8px; border: 1px dashed #cfc8b8; background: transparent; color: #56503f; font-weight: 600; font-size: 12.5px; cursor: pointer; }
.btn-add-master:hover { background: #faf8f3; }

/* ── Session tree lens — page → section → block, one-gesture hides ── */
.tree { display: flex; flex-direction: column; gap: 10px; }
.tree-error { border: 1px solid #ecd3c3; background: #fdf3ec; color: #8a4a2b; border-radius: 10px; padding: 10px 14px; font-size: 13px; margin: 0 0 6px; }
.tree-page { background: var(--card); border: 1px solid var(--border); border-radius: 13px; padding: 4px 6px 8px; }
.tree-page > summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 10px; border-radius: 9px; cursor: pointer; }
.tree-page > summary:hover { background: #faf8f3; }
.tree-title { font-weight: 700; font-size: 13.5px; }
.tree-file { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--muted); }
.tree-section { margin: 4px 0 4px 24px; border-left: 2px solid var(--border); padding-left: 12px; }
.tree-section > summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.tree-section > summary:hover { background: #faf8f3; }
.tree-label { font-weight: 650; font-size: 12px; color: #56503f; font-family: 'JetBrains Mono', monospace; }
.tree-block { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 2px 0 2px 24px; padding: 5px 8px; border-radius: 8px; }
.tree-block:hover { background: #faf8f3; }
.tree-section .tree-block { margin-left: 8px; }
.tree-id { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--muted); flex-shrink: 0; }
.tree-preview { font-size: 12.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 42ch; }
.tree-note { font-size: 11.5px; color: var(--muted); font-style: italic; }
.tree-act { height: 26px; padding: 0 10px; border-radius: 7px; border: 1px solid #e6e0d4; background: #fff; color: #79725f; font-weight: 600; font-size: 11.5px; cursor: pointer; margin-left: auto; }
.tree-act:hover { background: #faf8f3; color: #56503f; }
.tree-hidden > summary, .tree-block.tree-hidden { opacity: .5; }
.tree-rollup { display: inline-flex; gap: 5px; }
.tree-rollup .badge { padding: 2px 8px; font-size: 10.5px; background: #f0ede5; color: #79725f; }
.tree-rollup .r-clash { background: #fbeede; color: #9a5d1c; }
.tree-rollup .r-custom { background: #e8f0fb; color: #2b5da8; }
.tree-empty { background: #fbeede; color: #9a5d1c; }
.tree-verbs { display: inline-flex; gap: 6px; margin-left: auto; }
.tree-verbs .tree-act { margin-left: 0; }
.tree-toolbar { display: flex; justify-content: flex-end; }
.tree-toolbar .tree-act { margin-left: 0; }
