:root {
  color-scheme: light;
  --ink: #172c2b; --muted: #72817e; --line: #dfe7e4; --paper: #ffffff; --wash: color-mix(in srgb, var(--accent) 4%, #f5f6f6);
  --accent: #187f70; /* set per Context (branding); everything below is derived from it */
  --teal: var(--accent); --teal-dark: color-mix(in srgb, var(--accent) 72%, #000); --mint: color-mix(in srgb, var(--accent) 16%, #fff);
  --tint: color-mix(in srgb, var(--accent) 7%, #fff); --tint-weak: color-mix(in srgb, var(--accent) 3.5%, #fff); --tint-line: color-mix(in srgb, var(--accent) 24%, #fff);
  --orange: #c1774c; --danger: #a8402f;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Noto Sans JP", sans-serif; font-synthesis: none; text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--wash); }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
[hidden] { display: none !important; }
code { font: 12px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--tint); padding: 1px 5px; border-radius: 4px; }

.topbar { min-height: 64px; display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 0 max(20px, calc((100vw - 1680px) / 2 + 20px)); background: #fff; border-bottom: 1px solid #e8eeec; }
.brand { color: inherit; display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand strong { display: block; font-size: 16px; line-height: 1; letter-spacing: .08em; }
.brand small { display: block; margin-top: 5px; color: #94a29e; font: 9px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .15em; }
.brand-mark { width: 31px; height: 31px; border: 1px solid var(--tint-line); border-radius: 9px; display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 3px; padding: 6px; background: var(--tint); }
.brand-mark i { display: block; height: 8px; background: var(--teal); border-radius: 2px; }
.brand-mark i:nth-child(2) { height: 14px; opacity: .7; }
.brand-mark i:nth-child(3) { height: 11px; opacity: .45; }
.crumbs { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: #5d6e69; }
.crumbs button { border: 0; background: transparent; color: var(--teal-dark); padding: 2px 4px; border-radius: 4px; }
.crumbs button:hover { background: var(--mint); }
.crumbs .sep { color: #aab8b4; }
.session-area { display: flex; gap: 14px; align-items: center; }
.account-name { font: 11px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #5d6e69; }
.quiet-button { border: 0; background: transparent; color: #60736d; font-size: 12px; padding: 8px 0; }
.quiet-button:hover { color: var(--teal); }

main { max-width: 1680px; margin: 0 auto; padding: 20px 20px 48px; }
.signin-card { margin-left: auto; margin-right: auto; }
.message { margin: 0 0 16px; padding: 12px 16px; border-radius: 10px; background: #fff1ec; color: #8a3a22; border: 1px solid #f3d3c7; font-size: 13px; }
.message.ok { background: #eaf6f1; color: #1c5f52; border-color: #cfe7de; }
.loading-panel { min-height: 120px; display: flex; justify-content: center; align-items: center; color: var(--muted); font-size: 13px; }

.signin-card { width: min(100%, 480px); margin: 40px auto; padding: 34px 38px; background: var(--paper); border: 1px solid #e4ebe8; border-radius: 15px; box-shadow: 0 16px 45px #183f3210; }
.signin-card h2 { margin: 12px 0 6px; font-size: 25px; }
.signin-card > p { margin: 0 0 24px; color: var(--muted); font-size: 13px; }
.card-kicker { color: #94a29e; font: 10px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .15em; }
.form-stack { display: grid; gap: 8px; }
label { color: #485d57; font-size: 12px; font-weight: 600; }
input, select { width: 100%; min-height: 40px; border: 1px solid #d6e1dd; border-radius: 8px; padding: 0 12px; background: #fff; color: var(--ink); }
input:focus, select:focus { outline: 2px solid var(--tint-line); border-color: var(--teal); }
.primary-button { min-height: 40px; border: 0; border-radius: 8px; background: var(--teal); color: white; padding: 0 16px; font-size: 12px; font-weight: 600; }
.primary-button:hover:not(:disabled) { background: var(--teal-dark); }
.primary-button:disabled { opacity: .55; cursor: wait; }
.dev-panel { margin-top: 22px; padding: 14px; border: 1px dashed var(--tint-line); border-radius: 10px; background: var(--tint-weak); font-size: 12px; color: #4d625c; }
.dev-panel p { margin: 6px 0; }
.dev-panel ul { margin: 6px 0; padding-left: 18px; }


.panel { border: 1px solid #e1e9e5; border-radius: 12px; background: var(--paper); box-shadow: 0 4px 15px #1c453608; padding: 18px; }
.panel h2 { margin: 0 0 12px; font-size: 14px; }
.tree { display: grid; gap: 2px; }
.tree-node { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: transparent; border-radius: 8px; padding: 7px 8px; color: var(--ink); font-size: 13px; }
.tree-node:hover { background: var(--tint); }
.tree-node[aria-selected="true"] { background: var(--mint); font-weight: 600; }
.kind { font: 10px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #7b8c87; border: 1px solid #dbe6e2; border-radius: 999px; padding: 1px 7px; }
.outside-only { color: var(--orange); border-color: #ecd3c4; }
.detail-panel { display: grid; gap: 20px; }
.detail-head h2 { font-size: 20px; margin: 0 0 6px; }
.detail-head p { margin: 0; color: var(--muted); font-size: 12px; }
.levels { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.level { background: var(--tint); border: 1px solid var(--tint-line); border-radius: 6px; padding: 2px 8px; font: 11px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.section { border-top: 1px solid var(--line); padding-top: 16px; display: grid; gap: 10px; }
.section h3 { margin: 0; font-size: 13px; }
.section p.hint { margin: 0; color: var(--muted); font-size: 12px; }
.row-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; }
.row-form > div { display: grid; gap: 6px; }
.checks { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; }
.checks label { display: inline-flex; align-items: center; gap: 4px; font-weight: 400; }
.checks input { width: auto; min-height: 0; }
.members { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.members li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; }
.danger-button { border: 1px solid #e8c7bf; background: #fff; color: var(--danger); border-radius: 6px; padding: 4px 10px; font-size: 11px; }
@media (max-width: 800px) { .topbar { flex-wrap: wrap; padding: 10px 16px; } }

textarea { width: 100%; border: 1px solid #d6e1dd; border-radius: 8px; padding: 10px 12px; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, "Noto Sans JP", monospace; resize: vertical; background: #fff; color: var(--ink); }
textarea:focus { outline: 2px solid var(--tint-line); border-color: var(--teal); }
.objects { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.objects li { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.object-link { flex: 1; text-align: left; border: 0; background: transparent; padding: 7px 8px; border-radius: 8px; color: var(--ink); font-size: 13px; }
.object-link:hover { background: var(--tint); }
.object-link.active { background: var(--mint); font-weight: 600; }
.object-viewer { display: grid; gap: 10px; }
.object-viewer:empty { display: none; }
.object-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.object-actions { display: flex; gap: 10px; align-items: center; }
.object-image { max-width: 100%; max-height: 420px; border: 1px solid var(--line); border-radius: 8px; background: #fafcfb; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
table.csv { border-collapse: collapse; width: 100%; font-size: 12px; }
table.csv th, table.csv td { border-bottom: 1px solid var(--line); padding: 6px 10px; text-align: left; white-space: nowrap; }
table.csv th { background: #f3f8f6; }
.object-create { display: grid; gap: 10px; border-top: 1px dashed var(--line); padding-top: 14px; }
.object-create h4 { margin: 0; font-size: 12px; color: #485d57; }

.agent-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 8px; background: var(--tint-weak); }
.agent-card summary { cursor: pointer; font-size: 12px; color: var(--teal-dark); font-weight: 600; }
.agent-delegate { display: grid; gap: 10px; padding-top: 10px; }
.agent-card .danger-button { justify-self: start; }

.chat-toggle { justify-self: start; }
.chat-box { display: grid; gap: 10px; border: 1px solid #d6e5df; border-radius: 10px; padding: 12px; background: #fff; }
.chat-head { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.chat-head select { width: auto; min-width: 220px; min-height: 32px; }
.chat-log { max-height: 380px; overflow: auto; display: grid; gap: 8px; padding: 4px; }
.chat-msg { max-width: 86%; padding: 9px 12px; border-radius: 12px; font-size: 13px; line-height: 1.65; display: grid; gap: 6px; }
.chat-user { justify-self: end; background: var(--mint); }
.chat-assistant { justify-self: start; background: #f3f7f5; border: 1px solid var(--line); }
.chat-system { justify-self: center; background: #fff8f0; border: 1px dashed #ecd3c4; color: #8a5a3a; font-size: 12px; }
.chat-text { white-space: pre-wrap; }
.chat-result { border-top: 1px dashed #cfdcd7; padding-top: 6px; font-size: 12px; color: #3c524b; }
.outcome-refused .chat-result { color: #8a3a22; }
.outcome-performed .chat-result .kind { background: #e4f4ec; border-color: #b9dccb; color: #1c5f52; }
.outcome-refused .chat-result .kind { background: #fff1ec; border-color: #f0cbbd; color: #8a3a22; }
.chat-meta { font: 10px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #93a39e; }
.chat-input { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }

.chat-cond { display: inline-flex; align-items: center; gap: 4px; margin-left: 10px; font-weight: 400; }
.chat-cond input { width: auto; min-height: 0; }
.chat-status { margin-left: auto; color: var(--orange); font-size: 11px; }
.chat-report { justify-self: start; max-width: 92%; background: #f7faf9; border: 1px dashed var(--tint-line); padding: 6px 10px; font-size: 12px; grid-auto-flow: column; justify-content: start; align-items: center; gap: 8px; }
.report-done { background: #eaf6f1; border-style: solid; border-color: #b9dccb; }
.report-error { background: #fff1ec; border-style: solid; border-color: #f0cbbd; color: #8a3a22; }

.chat-text.clamped { max-height: 7.2em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.chat-fold { padding: 2px 0; font-size: 11px; color: var(--teal-dark); }
a.object-ref { color: var(--teal-dark); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
a.object-ref:hover { background: var(--mint); border-radius: 3px; }

details.history, details.trash { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: var(--tint-weak); }
details.history summary, details.trash summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--teal-dark); }
.history-body { display: grid; gap: 10px; padding-top: 8px; }
ul.versions { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
li.version { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; background: #fff; }
li.v-agent { background: #f7f5fb; border-color: #e2dcf0; }
.v-no { font: 11px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 700; }
.kind.v-ai { background: #efe9fb; border-color: #d9cdf2; color: #5a3f9a; }
.history-detail { display: grid; gap: 6px; }
pre.version-text, pre.diff { margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, "Noto Sans JP", monospace; white-space: pre-wrap; max-height: 320px; overflow: auto; }
.diff-add { background: #e6f5ec; color: #16583f; }
.diff-del { background: #fdeeea; color: #8a3a22; }
.diff-same { color: #6b7e78; }

.outcome-pending { border-color: #e8d9a8; background: #fffaf0; }
.proposal { display: grid; gap: 8px; border: 1px solid #e8d9a8; border-radius: 8px; padding: 10px 12px; background: #fff; }
.proposal-approved { border-color: #b9dccb; background: #f4fbf7; }
.proposal-rejected, .proposal-stale { border-color: #e3e3e3; background: #f8f8f8; }
.proposal-actions { display: flex; gap: 10px; align-items: center; }
.proposal-list { margin: 0; padding-left: 18px; font-size: 12px; line-height: 1.8; }

/* ---- branding: header title/icon and a coloured header */
.brand-icon { width: 31px; height: 31px; border-radius: 9px; object-fit: cover; background: #fff; }
.topbar { transition: background .2s; }
.topbar.accent { background: var(--teal); border-bottom-color: var(--teal-dark); }
.topbar.accent .brand, .topbar.accent .crumbs, .topbar.accent .account-name, .topbar.accent .quiet-button { color: #fff; }
.topbar.accent .brand small { color: rgba(255,255,255,.78); }
.topbar.accent .crumbs button { color: #fff; }
.topbar.accent .crumbs button:hover { background: rgba(255,255,255,.18); }
.topbar.accent .crumbs .sep { color: rgba(255,255,255,.6); }
.topbar.accent .quiet-button:hover { color: rgba(255,255,255,.8); }
.topbar.accent .brand-mark { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.5); }
.topbar.accent .brand-mark i { background: #fff; }
.branding-form { display: grid; gap: 12px; }
.branding-choice { display: grid; gap: 8px; }
.branding-choice label { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: 13px; }
.branding-choice input { width: auto; min-height: 0; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); padding: 0; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
.color-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.color-row input[type=color] { width: 44px; min-height: 32px; padding: 2px; }
.icon-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.icon-preview { width: 48px; height: 48px; border-radius: 12px; border: 1px solid var(--line); object-fit: cover; background: #fff; }
.brand-warning { color: var(--danger); font-size: 12px; }
.brand-preview { display: flex; align-items: center; gap: 11px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.brand-preview.accent { background: var(--teal); color: #fff; border-color: var(--teal-dark); }
.brand-preview strong { display: block; font-size: 15px; letter-spacing: .06em; }
.brand-preview small { display: block; font-size: 10px; opacity: .75; letter-spacing: .12em; }
.brand-mark.has-icon { width: auto; height: auto; border: 0; background: none; padding: 0; display: block; }
.icon-row input[type=file] { width: auto; min-height: 0; border: 0; padding: 0; background: none; }
.icon-row .quiet-button { color: var(--danger); }

/* ---- three-column workspace: navigator and blocks | tabbed main pane | details */
.workspace { display: grid; grid-template-columns: 260px minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.left { display: grid; gap: 14px; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.nav-panel, .blocks-panel { padding: 14px; }
.nav-panel h2, .blocks-panel h2 { margin: 0 0 10px; font-size: 13px; }
.nav-panel .tree { max-height: 38vh; overflow: auto; margin-top: 8px; }
.blocks { display: grid; gap: 4px; }
.block { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; text-align: left; border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 8px 10px; font-size: 13px; color: var(--ink); }
.block:hover { background: var(--tint); }
.block.active { background: var(--mint); border-color: var(--tint-line); font-weight: 600; }
.count { font: 11px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--tint); border: 1px solid var(--tint-line); border-radius: 999px; padding: 0 8px; color: var(--teal-dark); }

.center { min-width: 0; display: grid; gap: 0; }
.tabbar { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line); padding: 0 4px; scrollbar-width: thin; }
.tabbar:empty { display: none; }
.tab { display: flex; align-items: stretch; border: 1px solid var(--line); border-bottom: 0; border-radius: 9px 9px 0 0; background: var(--tint-weak); max-width: 240px; flex: 0 0 auto; }
.tab.active { background: var(--paper); border-color: var(--tint-line); box-shadow: inset 0 2px 0 var(--teal); }
.tab-label { display: grid; text-align: left; border: 0; background: transparent; padding: 6px 4px 6px 12px; color: var(--ink); font-size: 12px; min-width: 0; }
.tab-label .tab-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.tab-label small { color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.tab-close { border: 0; background: transparent; color: var(--muted); padding: 0 9px; font-size: 15px; border-radius: 0 9px 0 0; }
.tab-close:hover { color: var(--danger); background: #fdeeea; }
.tab-panels { min-width: 0; }
.tab-panel { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 12px 12px; background: var(--paper); padding: 18px; min-height: 60vh; }
.tab-panel[hidden] { display: none; }
.tab-empty { padding: 40px 20px; text-align: center; border: 1px dashed var(--tint-line); border-radius: 12px; background: var(--paper); }
.panel-body { display: grid; gap: 14px; }
.panel-body > h3 { margin: 0; font-size: 16px; }
.panel-body .section { margin-top: 4px; }

.right { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; padding: 14px; display: grid; gap: 12px; align-content: start; }
.right > h3 { margin: 0; font-size: 13px; }
.insp-section { display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.insp-section h4 { margin: 0; font-size: 12px; color: #485d57; }
.kv { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.kv span { color: var(--muted); }
.kv strong { font-weight: 600; text-align: right; word-break: break-all; }
.kv.small { font-size: 11px; }
.insp-count { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 6px 10px; font-size: 12px; }
.insp-count:hover { background: var(--tint); border-color: var(--tint-line); }

/* ---- the standard list */
.list { display: grid; gap: 8px; }
.list-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.list-bar .list-search { flex: 1 1 180px; min-height: 34px; width: auto; }
.list-sort { width: auto; min-height: 34px; }
.list-count { margin-left: auto; font-size: 11px; color: var(--muted); }
.list-dir, .list-clear { padding: 4px 6px; }
.list-filters { position: relative; }
.list-filters > summary { cursor: pointer; list-style: none; border: 1px solid #d6e1dd; border-radius: 8px; padding: 7px 12px; font-size: 12px; background: #fff; }
.list-filters[open] > summary { border-color: var(--teal); }
.list-filters .filter-group { display: grid; gap: 4px; padding: 8px 4px 0; }
.list-filters[open] { flex-basis: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px 8px; background: var(--tint-weak); }
.list-filters[open] > summary { border: 0; background: transparent; padding-left: 4px; }
.list-body { display: grid; gap: 6px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 13px; }
.row-main { flex: 1 1 140px; text-align: left; border: 0; background: transparent; padding: 0; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
button.row-main:hover { color: var(--teal-dark); text-decoration: underline; }
.list.compact .row { padding: 5px 8px; font-size: 12px; }
.list.compact .list-bar { gap: 6px; }
.list.compact .list-sort, .list.compact .list-dir { display: none; }
.create-box { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: var(--tint-weak); }
.create-box > summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--teal-dark); }

/* ---- overview */
.overview { display: grid; gap: 16px; }
.overview-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.overview-card { display: grid; gap: 4px; text-align: left; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 12px 14px; }
.overview-card:hover { background: var(--tint); border-color: var(--tint-line); }
.overview-card .count { justify-self: start; font-size: 13px; }
.overview-card small { color: var(--muted); font-size: 11px; }

/* the chat fills its tab */
.chat-box { border: 0; padding: 0; }
.chat-log { max-height: none; min-height: 320px; height: 52vh; }
.chat-help { font-size: 12px; }
.chat-help summary { cursor: pointer; color: var(--teal-dark); font-weight: 600; }

/* wide screens: the controls that only the narrow layout needs are hidden */
.nav-toggle, .insp-bar { display: none; }
.tree-wrap { display: block; }
.insp-body { display: grid; gap: 12px; align-content: start; }

/* ---- narrow screens (1100px and below): the left column becomes a fixed top bar, the details a fixed bottom bar */
@media (max-width: 1100px) {
  :root { --topbar-h: 64px; --statusbar-h: 46px; }
  .topbar { position: sticky; top: 0; z-index: 60; }
  main { padding: 0 0 calc(var(--statusbar-h) + 16px); }
  .message { margin: 10px 12px 0; }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 0; }

  /* top navigation bar: the Context button (a drop-down with the tree) and the blocks as chips */
  .left { position: sticky; top: var(--topbar-h); z-index: 50; display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--paper); border-bottom: 1px solid var(--line); max-height: none; overflow: visible; }
  .nav-panel, .blocks-panel { padding: 0; border: 0; box-shadow: none; background: transparent; }
  .nav-panel h2, .blocks-panel h2 { display: none; }
  .nav-panel { position: static; flex: 0 0 auto; }
  .nav-toggle { display: inline-flex; align-items: center; max-width: 46vw; min-height: 34px; border: 1px solid var(--tint-line); border-radius: 999px; background: var(--tint); color: var(--teal-dark); padding: 0 14px; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tree-wrap { display: none; position: absolute; left: 8px; right: 8px; top: calc(100% + 4px); z-index: 70; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px #17362f33; padding: 10px; max-height: 62vh; overflow: auto; }
  .left.tree-open .tree-wrap { display: block; }
  .nav-panel .tree { max-height: none; }
  .blocks-panel { flex: 1 1 auto; min-width: 0; }
  .blocks { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: thin; padding: 2px 0; }
  .block { width: auto; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 12px; white-space: nowrap; gap: 6px; }

  .center { padding: 0 12px; margin-top: 8px; }
  .tab-panel { padding: 14px; min-height: 50vh; }

  /* bottom status bar: a one-line summary, and the details as a sheet that opens upward */
  .right { position: fixed; left: 0; right: 0; top: auto; bottom: 0; z-index: 55; max-height: none; padding: 0; border-radius: 14px 14px 0 0; border-bottom: 0; box-shadow: 0 -6px 24px #17362f26; display: block; overflow: visible; }
  .insp-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: var(--statusbar-h); padding: 0 14px; }
  .insp-summary { font-size: 12px; color: #3c524b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; flex: 1 1 auto; }
  .insp-toggle { flex: 0 0 auto; border: 1px solid var(--tint-line); border-radius: 999px; background: var(--tint); padding: 6px 14px; font-weight: 600; color: var(--teal-dark); }
  .insp-body { display: none; max-height: 62vh; overflow: auto; padding: 4px 14px 16px; border-top: 1px solid var(--line); }
  .right.open .insp-body { display: grid; }
  .right > .insp-body > h3 { display: none; }
  .chat-log { height: 46vh; }
}
@media (max-width: 800px) {
  .topbar { flex-wrap: wrap; padding: 8px 12px; min-height: 0; }
  .crumbs { display: none; }
  .tab-label .tab-title, .tab-label small { max-width: 120px; }
  .list-bar .list-search { flex-basis: 100%; }
}

.thread-list { display: grid; gap: 8px; margin: 10px 0; }
.thread-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.thread-start { display: grid; gap: 10px; }
.thread-input-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.thread-inputs { display: grid; gap: 6px; }
.thread-input-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(70px, .6fr) minmax(110px, 1fr) auto; gap: 6px; }
.thread-input-row select { min-width: 0; }
@media (max-width: 700px) { .thread-row, .thread-input-row { grid-template-columns: 1fr; } }
