/* ECAI Control Plane · self-contained: no third-party UI dependencies. */
:root {
  color-scheme: var(--theme-color-scheme, light);
  --canvas: var(--theme-bg, #f5f7fb);
  --paper: var(--theme-surface, #fff);
  --ink: var(--theme-text, #14223d);
  --muted: var(--theme-muted, #6e7a90);
  --line: var(--theme-border, #e6ebf2);
  --navy: var(--theme-surface, #111d34);
  --navy-soft: var(--theme-surface-alt, #202f4b);
  --blue: var(--theme-accent, #465dec);
  --blue-strong: var(--theme-accent-hover, #364dd8);
  --sky: var(--theme-accent-soft, #e9edff);
  --mint: var(--theme-success, #22bd9f);
  --alert: var(--theme-danger, #b63a4b);
  --shadow: 0 9px 28px var(--theme-shadow, rgba(14, 30, 70, .035));
  --radius: 16px;
  /* Semantic adapters also serve Quick Index; the NFT stylesheet overrides
     these on both :root and body. Neutral surfaces always travel with text. */
  --surface: var(--theme-surface, var(--paper));
  --surface-2: var(--theme-surface-alt, color-mix(in srgb, var(--paper) 94%, var(--ink)));
  --text: var(--theme-text, var(--ink));
  --border: var(--theme-border, var(--line));
  --border-strong: var(--theme-control-border, color-mix(in srgb, var(--line) 60%, var(--ink)));
  --accent: var(--theme-accent, var(--blue));
  --accent-soft: var(--theme-accent-soft, color-mix(in srgb, var(--blue) 12%, var(--paper)));
  --link: var(--theme-link, var(--blue-strong));
  --on-accent: var(--theme-on-accent, #ffffff);
  --focus: var(--theme-focus, var(--blue));
  --success: var(--theme-success, #17694f);
  --danger: var(--theme-danger, #a72c43);
  --warning: var(--theme-warning, #795917);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--canvas); font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .48; cursor: not-allowed; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.console-shell { min-height: 100vh; display: flex; }
.console-sidebar { background: var(--navy); color: var(--theme-text, #ebf0fc); width: 244px; flex: 0 0 244px; position: sticky; height: 100vh; top: 0; display: flex; flex-direction: column; z-index: 15; overflow-y: auto; }
.brand-block { min-height: 105px; display: flex; align-items: center; gap: 12px; padding: 23px 23px 18px; }
.brand-symbol { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: #fff; background: linear-gradient(135deg,#5a66ee,#7f4fcb); box-shadow: 0 7px 20px #313c9c60; font-size: 28px; font-weight: 720; letter-spacing: -.08em; }
.brand-symbol span { color: #7ce4d3; }
.brand-name { font-size: 21px; font-weight: 800; letter-spacing: .12em; line-height: 1.15; }
.brand-caption { color: var(--theme-muted, #8495bb); font-size: 8px; letter-spacing: .19em; font-weight: 700; margin-top: 5px; white-space: nowrap; }
.sidebar-label { padding: 20px 25px 10px; color: var(--theme-muted, #7587a8); font-size: 10px; letter-spacing: .14em; font-weight: 750; }
.main-nav { display: flex; flex-direction: column; gap: 3px; padding: 0 12px 20px; }
.nav-link { border: 0; display: flex; align-items: center; gap: 13px; background: transparent; color: var(--theme-muted, #aab7d0); padding: 11px 14px; border-radius: 9px; text-align: left; font-weight: 550; font-size: 12.8px; width: 100%; transition: background .15s, color .15s; }
.nav-link:hover { background: var(--theme-accent, #21314e); color: var(--theme-on-accent, #fff); }
.nav-link.is-active { background: var(--theme-accent, #2c3c68); color: var(--theme-on-accent, white); font-weight: 680; box-shadow: inset 3px 0 0 var(--theme-shadow, #8ea0ff); }
.nav-icon { color: var(--theme-text, #9eb5ea); font-size: 18px; width: 23px; text-align: center; font-family: ui-monospace,monospace; line-height: 20px; }
.nav-link.is-active .nav-icon { color: var(--theme-text, #fff); }
.sidebar-bottom { margin-top: auto; border-top: 1px solid var(--theme-border, #2a3852); padding-bottom: 10px; }
.sidebar-bottom .sidebar-label { padding-top: 20px; }
.subtle-link { color: var(--theme-muted, #a9b8d3); font-size: 12px; display: flex; justify-content: space-between; padding: 8px 25px; }
.subtle-link:hover { color: var(--theme-text, white); }
.node-mark { border-top: 1px solid var(--theme-border, #26344e); margin: 16px 16px 0; padding: 17px 8px 4px; display: flex; gap: 8px; align-items: center; font-size: 11px; color: var(--theme-muted, #98a9c6); }
.node-dot { width: 7px; height: 7px; flex: 0 0 7px; background: var(--theme-accent, #6e7d95); border-radius: 50%; }
.node-dot.online { background: var(--theme-accent, #28d6ae); box-shadow: 0 0 0 4px var(--theme-shadow, #28d6ae18); }
.node-version { margin-left: auto; font-size: 10px; }
.sidebar-close { display: none !important; }
.console-body { min-width: 0; flex: 1; }
.console-topbar { position: sticky; top: 0; z-index: 10; height: 73px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 clamp(19px, 3.6vw, 52px); border-bottom: 1px solid var(--line); background: var(--theme-danger-soft, #fffefef2); backdrop-filter: blur(16px); }
.breadcrumb { color: var(--muted); font-size: 12px; }
.breadcrumb span { padding: 0 13px; color: var(--theme-text, #bbc3d0); }
.breadcrumb strong { color: var(--ink); font-size: 13px; }
.topbar-actions, .topbar-leading, .inline-actions { display: flex; align-items: center; gap: 10px; }
.topbar-runtime { color: var(--muted); font-size: 11px; white-space: nowrap; }
.topbar-divider { border-left: 1px solid var(--line); height: 25px; margin: 0 8px; }
.signed-in { color: var(--muted); font-size: 11px; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-button { display: inline-grid; place-items: center; min-width: 32px; min-height: 32px; border-radius: 9px; border: 0; background: transparent; font-size: 21px; color: var(--muted); }
.icon-button:hover { background: var(--theme-accent-soft, #eff2f8); color: var(--ink); }
.mobile-nav-trigger { display: none; }
.console-main { width: 100%; max-width: 1640px; padding: 32px clamp(19px, 3.6vw, 52px) 70px; margin: 0 auto; }
.view { display: none; animation: view-enter .2s ease-out; }
.view.is-visible { display: block; }
@keyframes view-enter { from { opacity: .5; transform: translateY(5px); } to { opacity: 1; transform: none; } }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(25px, 2.8vw, 34px); letter-spacing: -.047em; line-height: 1.25; font-weight: 770; margin-bottom: 8px; }
h2 { font-size: 16px; letter-spacing: -.02em; margin: 0; line-height: 1.4; }
h3 { font-size: 13px; margin: 0 0 5px; }
p { color: var(--muted); }
.eyebrow { color: var(--link); font-size: 10px; letter-spacing: .15em; font-weight: 800; margin-bottom: 10px; }
.eyebrow-light { color: var(--theme-muted, #aabafc); }
.dot-separator { padding: 0 4px; }
.page-intro { margin-bottom: 26px; }
.page-intro p { margin: 0; max-width: 760px; font-size: 13px; }
.page-intro-actions { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.welcome-banner { display: flex; position: relative; isolation: isolate; overflow: hidden; justify-content: space-between; align-items: center; min-height: 225px; margin-bottom: 21px; border-radius: 21px; color: var(--theme-text, #fff); padding: clamp(25px,3vw,41px) clamp(28px,4vw,50px); background: radial-gradient(ellipse at 82% 12%, var(--theme-surface, #4b569e) 0%, transparent 45%), linear-gradient(112deg, var(--theme-surface, #18263f) 0%, var(--theme-surface, #233965) 68%, var(--theme-surface, #30356a) 100%); }
.welcome-banner h1 { color: var(--theme-text, white); margin-bottom: 10px; font-size: clamp(27px,3.1vw,39px); }
.welcome-banner p { color: var(--theme-text, #bbc8e2); max-width: 510px; font-size: 13px; line-height: 1.7; margin-bottom: 20px; }
.banner-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.button { background: var(--paper); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border: 1px solid transparent; border-radius: 9px; font-weight: 650; font-size: 12px; min-height: 38px; white-space: nowrap; transition: background .15s,transform .15s; }
.button:not(:disabled):active { transform: translateY(1px); }
.button-primary { background: var(--blue); color: var(--on-accent); border-color: var(--blue); }
.button-primary:hover { background: var(--blue-strong); }
.button-outline { background: var(--paper); color: var(--ink); border-color: var(--line); }
.button-outline:hover { background: var(--surface-2); border-color: var(--focus); text-decoration: none; }
.button-light { background: var(--theme-surface, white); color: var(--theme-link, #263e7b); }
.button-light:hover { background: var(--theme-accent-soft, #eef1ff); text-decoration: none; }
.button-glass { background: var(--theme-surface, #ffffff12); border-color: var(--theme-border, #ffffff42); color: var(--theme-text, #fff); }
.button-glass:hover { background: var(--theme-accent-soft, #ffffff20); }
.button-sm { font-size: 11px; min-height: 32px; padding: 6px 11px; }
.danger-outline { border-color: var(--theme-danger, #f3ccd1); color: var(--alert); }
.danger-outline:hover { background: var(--theme-danger-soft, #fff0f3); }
.orbit-art { flex: 0 0 270px; height: 180px; position: relative; margin-right: 10px; }
.orbit { position: absolute; border: 1px solid var(--theme-border, #8aa2fd55); border-radius: 50%; width: 180px; height: 180px; left: 45px; top: 0; transform: rotate(-24deg); }
.orbit-2 { transform: rotate(62deg) scaleX(.45); border-color: var(--theme-border, #b6adffb5); }
.orbit-3 { transform: rotate(-60deg) scaleX(.45); border-color: var(--theme-border, #55d5cc92); }
.orbit-core { position: absolute; left: 124px; top: 79px; width: 20px; height: 20px; background: #b5c2ff; border: 5px solid #8a9cf9; border-radius: 50%; box-shadow: 0 0 42px 18px #6b78e683; }
.orbit-node { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--theme-accent, #69f6df); box-shadow: 0 0 20px var(--theme-shadow, #58dfce); }
.orbit-node.n1 { left: 48px; top: 71px; }
.orbit-node.n2 { left: 212px; top: 33px; }
.orbit-node.n3 { left: 173px; top: 164px; background: var(--theme-surface-alt, #edc5ff); }
.metric-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; margin-bottom: 22px; }
.metric-card, .surface { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.metric-card { padding: 19px 21px; }
.metric-label { color: var(--theme-muted, #607089); display: flex; justify-content: space-between; gap: 10px; font-size: 11px; font-weight: 560; }
.metric-label span { color: var(--theme-muted, #8c9bbb); font-size: 17px; }
.metric-value { font-size: 31px; font-weight: 750; letter-spacing: -.06em; margin: 9px 0 4px; font-variant-numeric: tabular-nums; line-height: 1.3; }
.metric-word { font-size: 23px; letter-spacing: -.03em; }
.metric-foot { color: var(--theme-muted, #95a0b2); font-size: 10px; }
.two-column { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 20px; margin-bottom: 20px; align-items: start; }
.panel-pad { padding: 23px; margin-bottom: 20px; }
.two-column > .panel-pad { margin-bottom: 0; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 19px; }
.panel-heading .eyebrow { margin-bottom: 5px; }
.panel-heading > div { min-width: 0; }
.text-button { border: 0; padding: 3px; white-space: nowrap; background: transparent; color: var(--link); font-size: 11px; font-weight: 680; }
.text-button:not(:disabled):hover { text-decoration: underline; }
.context-hint { font-size: 11px; line-height: 1.65; margin: 10px 0 17px; }
.service-list { display: flex; flex-direction: column; }
.service-row, .overview-job { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--theme-border, #eef0f5); }
.service-row:last-child, .overview-job:last-child { border-bottom: none; }
.service-dot { flex: 0 0 9px; height: 9px; border-radius: 50%; background: var(--theme-accent, #b6c0d1); }
.service-dot.is-good { background: var(--theme-success, #22bd9f); }
.service-dot.is-bad { background: var(--theme-warning, #e0a153); }
.service-name { flex: 1; font-weight: 650; font-size: 12px; }
.service-state { font-size: 11px; color: var(--muted); }
.overview-job-icon { width: 34px; height: 34px; border-radius: 10px; color: var(--blue); background: var(--theme-surface, #f1f2ff); display: grid; place-items: center; font-size: 17px; }
.overview-job-copy { min-width: 0; flex: 1; }
.overview-job-copy strong { font-size: 12px; display: block; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.overview-job-copy small { color: var(--muted); }
.status-tag { border: 1px solid var(--theme-border, #e0e7fa); background: var(--theme-surface, #f2f5ff); padding: 4px 8px; color: var(--theme-muted, #52639f); border-radius: 7px; font-size: 10px; white-space: nowrap; }
.status-tag.state-running, .status-tag.state-completed, .status-tag.state-minted { border-color: var(--theme-success, #bdeee0); background: var(--theme-success-soft, #e8fbf5); color: var(--theme-success, #13765d); }
.status-tag.state-failed, .status-tag.state-canceled { border-color: var(--theme-danger, #f8d2d9); background: var(--theme-danger-soft, #fff1f2); color: var(--theme-danger, #a33149); }
.status-tag.state-queued, .status-tag.state-paused { border-color: var(--theme-warning, #ebddbc); background: var(--theme-warning-soft, #fff9e8); color: var(--theme-warning, #8d6817); }
.empty-state { color: var(--muted); text-align: center; padding: 27px 16px; font-size: 12px; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 10px; }
.empty-cell { text-align: center; color: var(--muted); padding: 20px !important; }
.search-form { display: flex; gap: 9px; align-items: center; position: relative; }
.search-form > input[type="search"] { flex: 1; min-width: 90px; padding-left: 37px; }
.search-leading { position: absolute; left: 12px; font-size: 24px; color: var(--theme-muted, #95a0b5); pointer-events: none; }
label { display: flex; flex-direction: column; gap: 6px; color: var(--ink); font-size: 11px; font-weight: 650; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea { background: var(--paper); color: var(--ink); padding: 10px 12px; min-width: 0; min-height: 39px; border: 1px solid var(--line); border-radius: 9px; font-size: 12px; width: 100%; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-color: var(--focus); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-height: 0; flex: 0 0 18px; margin: 0; padding: 0; accent-color: var(--accent); }
label.checkbox-label { flex-direction: row; align-items: center; gap: 8px; }
textarea { resize: vertical; line-height: 1.6; }
input::placeholder,textarea::placeholder { color: var(--muted); opacity: 1; }
.compact-field { max-width: 92px; white-space: nowrap; }
.compact-field input { width: 100%; }
.form-meta { display: flex; justify-content: space-between; gap: 15px; padding: 12px 1px 0; font-size: 10px; color: var(--theme-muted, #8590a4); }
.result-stack { padding-top: 19px; display: flex; flex-direction: column; gap: 10px; }
.result-card { border: 1px solid var(--theme-border, #e4eaf3); padding: 14px 16px; border-radius: 10px; }
.result-card strong { display: block; margin-bottom: 4px; overflow-wrap: anywhere; }
.result-card p { margin: 0 0 9px; font-size: 11px; overflow-wrap: anywhere; }
.result-meta { font-size: 10px; color: var(--theme-muted, #71809a); display: flex; gap: 15px; }
.expandable { margin-bottom: 20px; overflow: hidden; }
.expandable summary { padding: 17px 22px; cursor: pointer; font-size: 12px; font-weight: 700; }
.expandable .expand-arrow { margin-left: 12px; color: var(--muted); }
.details-content { padding: 0 22px 22px; }
.details-content form { display: flex; flex-direction: column; gap: 13px; }
.code-display { border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); padding: 14px 15px; margin: 12px 0 0; font: 11px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas,monospace; color: var(--ink); overflow: auto; max-height: 410px; min-height: 61px; white-space: pre-wrap; word-break: break-word; tab-size: 2; }
.code-input { font-family: ui-monospace,SFMono-Regular,Consolas,monospace; font-size: 11px; line-height: 1.6; }
.chat-layout { max-width: 1020px; min-height: 585px; display: flex; flex-direction: column; }
.chat-toolbar { border-bottom: 1px solid var(--line); padding: 17px 21px; display: flex; align-items: center; gap: 18px; }
.chat-toolbar .text-button { margin-left: auto; }
.status-indicator { font-size: 12px; font-weight: 680; display: flex; align-items: center; gap: 8px; }
.status-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); }
.mono { font-family: ui-monospace,Consolas,monospace; }
.small { font-size: 11px; }
.muted { color: var(--muted); }
.chat-messages { flex: 1; min-height: 380px; max-height: 600px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; padding: 21px; }
.chat-welcome { margin: auto; text-align: center; max-width: 330px; }
.chat-welcome h2 { font-size: 19px; margin: 9px 0; }
.chat-welcome p { font-size: 12px; }
.welcome-icon { width: 58px; height: 58px; margin: 0 auto; background: linear-gradient(135deg,var(--theme-surface, #566af0),var(--theme-surface, #8a76d9)); color: var(--theme-text, white); border-radius: 18px; display: grid; place-items: center; font-size: 25px; }
.chat-bubble { padding: 12px 15px; max-width: 78%; border-radius: 13px; font-size: 12px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-bubble.from-user { background: var(--theme-accent-soft, #edf0ff); color: var(--theme-text, #24345e); margin-left: auto; border-bottom-right-radius: 4px; }
.chat-bubble.from-agent { background: var(--theme-surface, #f5f7fb); margin-right: auto; border-bottom-left-radius: 4px; }
.composer { display: flex; align-items: end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }
.composer textarea { flex: 1; min-height: 45px; max-height: 170px; }
.chat-layout > .form-meta { padding: 0 21px 13px; }
/* Conversation history + projects. Durable history is account-scoped server state. */
.chat-workspace { display:grid; grid-template-columns:260px minmax(0,1fr); gap:16px; align-items:stretch; max-width:1320px; }
.chat-workspace .chat-layout { max-width:none; min-width:0; }
.chat-history-panel { min-height:585px; max-height:720px; padding:12px; display:flex; flex-direction:column; overflow:hidden; }
.chat-history-actions { display:grid; gap:8px; padding-bottom:12px; border-bottom:1px solid var(--line); }
.chat-new-button { width:100%; justify-content:center; }
.chat-search-button { min-height:38px; width:100%; border:1px solid var(--theme-border, #dfe5ef); border-radius:9px; background:var(--theme-surface, #f8faff); color:var(--theme-text, #42516d); display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:8px; padding:8px 10px; text-align:left; font-size:11px; }
.chat-search-button:hover:not(:disabled) { border-color:var(--theme-link, #bec9ee); background:var(--theme-accent-soft, #f1f4ff); }
.chat-search-button kbd { border:1px solid var(--theme-border, #dfe5ef); border-bottom-width:2px; border-radius:5px; background:var(--theme-surface, white); color:var(--theme-muted, #8390a5); font:9px/1.2 ui-monospace,Consolas,monospace; padding:3px 5px; }
.chat-history-auth { margin:11px 0 2px; padding:10px; border:1px solid var(--theme-border, #e6eaf4); border-radius:9px; background:var(--theme-surface, #fafbfe); color:var(--theme-muted, #6d7a91); font-size:10px; line-height:1.55; }
.chat-history-section { padding-top:13px; }
.chat-history-recent { min-height:0; flex:1; display:flex; flex-direction:column; }
.chat-history-heading { display:flex; align-items:center; justify-content:space-between; min-height:25px; color:var(--theme-muted, #8a95a8); font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.08em; padding:0 6px 5px; }
.chat-history-icon-button, .chat-project-edit, .chat-history-toggle, .chat-dialog-close { border:0; background:transparent; color:var(--theme-muted, #70809c); border-radius:7px; display:grid; place-items:center; cursor:pointer; }
.chat-history-icon-button { width:25px; height:25px; font-size:16px; }
.chat-history-icon-button:hover:not(:disabled), .chat-project-edit:hover, .chat-history-toggle:hover, .chat-dialog-close:hover { background:var(--theme-accent-soft, #eef2fb); color:var(--theme-text, #354b79); }
.chat-project-list, .chat-history-list { display:grid; gap:3px; }
.chat-history-list { overflow-y:auto; min-height:0; padding-right:2px; }
.chat-project-row { display:grid; grid-template-columns:minmax(0,1fr) 24px; gap:2px; align-items:center; }
.chat-history-item { width:100%; border:0; border-radius:8px; background:transparent; color:var(--theme-text, #43526e); min-width:0; display:flex; align-items:center; gap:8px; padding:8px 9px; text-align:left; }
.chat-history-item:hover { background:var(--theme-accent-soft, #f4f6fb); }
.chat-history-item.is-active { background:var(--theme-accent-soft, #edf1ff); color:var(--theme-link, #253c78); }
.chat-history-icon { flex:0 0 18px; color:var(--theme-muted, #7e8cac); font-size:13px; text-align:center; }
.chat-history-copy { min-width:0; flex:1; display:grid; gap:2px; }
.chat-history-copy strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; font-weight:650; }
.chat-history-copy small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--theme-muted, #8b96a8); font-size:9px; }
.chat-thread-item { align-items:flex-start; }
.chat-history-pin { color:var(--theme-link, #7188e8); font-size:7px; padding-top:4px; }
.chat-project-edit { width:24px; height:27px; font-weight:800; }
.chat-history-empty { color:var(--theme-muted, #8a96aa); font-size:10px; line-height:1.55; padding:10px 8px; }
.chat-history-toggle { display:none; width:31px; height:31px; flex:0 0 31px; font-size:16px; }
.chat-thread-heading { min-width:0; flex:1; display:grid; gap:2px; }
.chat-thread-heading strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; }
.chat-thread-actions { display:flex; align-items:center; gap:7px; margin-left:auto; }
.chat-thread-actions .text-button { margin-left:0; }
.chat-delete-button { color:var(--theme-danger, #a94b5c); }
.chat-project-select { width:auto; max-width:175px; min-height:31px; padding:5px 28px 5px 8px; font-size:10px; }
.chat-dialog { width:min(620px,calc(100vw - 28px)); max-width:620px; border:1px solid var(--line); border-radius:16px; background:var(--theme-surface, white); color:var(--ink); padding:0; box-shadow:0 23px 80px var(--theme-shadow, #07132c61); }
.chat-dialog::backdrop { background:var(--theme-backdrop, #0d182f94); backdrop-filter:blur(4px); }
.chat-dialog-header { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; padding:21px 22px 15px; border-bottom:1px solid var(--line); }
.chat-dialog-header h2 { margin:2px 0 0; font-size:19px; }
.chat-dialog-close { width:31px; height:31px; font-size:21px; }
.chat-dialog-form { display:grid; grid-template-columns:minmax(0,1fr) minmax(150px,190px) auto; gap:9px; align-items:end; padding:17px 20px; }
.chat-dialog-form label { min-width:0; }
.chat-search-results { max-height:min(56vh,520px); overflow:auto; display:grid; gap:7px; padding:0 20px 20px; }
.chat-search-result { width:100%; border:1px solid var(--theme-border, #e4eaf3); background:var(--theme-surface, white); color:var(--ink); border-radius:10px; padding:12px 13px; text-align:left; }
.chat-search-result:hover { border-color:var(--theme-link, #bdc9ee); background:var(--theme-accent-soft, #f9faff); }
.chat-search-result strong { display:block; font-size:12px; margin-bottom:5px; }
.chat-search-result p { margin:0 0 7px; color:var(--theme-muted, #5f6f8d); font-size:11px; line-height:1.5; white-space:pre-wrap; overflow-wrap:anywhere; }
.chat-search-result small { color:var(--theme-muted, #909bad); font-size:9px; }
.chat-project-dialog .stack-form { padding:19px 21px 21px; }
.chat-project-dialog textarea { min-height:130px; }
@media (max-width:980px) {
  .chat-workspace { grid-template-columns:minmax(0,1fr); }
  .chat-history-panel { position:fixed; z-index:35; top:74px; bottom:18px; left:18px; width:min(310px,calc(100vw - 36px)); max-height:none; min-height:0; transform:translateX(calc(-100% - 30px)); opacity:0; pointer-events:none; transition:transform .18s ease,opacity .18s ease; box-shadow:0 18px 55px var(--theme-shadow, #12213c33); }
  .chat-history-panel.is-open { transform:none; opacity:1; pointer-events:auto; }
  .chat-history-toggle { display:grid; }
  .chat-toolbar { gap:10px; }
  .chat-thread-actions { flex-wrap:wrap; justify-content:flex-end; }
}
@media (max-width:700px) {
  .chat-toolbar { align-items:flex-start; flex-wrap:wrap; }
  .chat-thread-heading { flex-basis:calc(100% - 110px); }
  #chatSessionLabel { display:none; }
  .chat-thread-actions { width:100%; margin-left:41px; justify-content:flex-start; }
  .chat-project-select { max-width:210px; }
  .chat-dialog-form { grid-template-columns:minmax(0,1fr); }
}
@media (max-width:560px) {
  .chat-history-panel { top:67px; left:10px; bottom:10px; width:calc(100vw - 20px); }
  .chat-thread-actions { margin-left:0; }
  .chat-thread-actions .chat-project-select { flex:1; min-width:140px; }
}

.three-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-bottom: 18px; }
.mini-stat { display: flex; justify-content: space-between; align-items: center; gap: 5px; padding: 15px 20px; color: var(--muted); }
.mini-stat strong { font-size: 24px; color: var(--ink); }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(210px,1fr)); gap: 11px; }
.preset-card { border: 1px solid var(--theme-border, #e6ebf3); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 11px; min-width: 0; }
.preset-card p { font-size: 11px; line-height: 1.6; margin: 0; flex: 1; }
.preset-card .button { align-self: start; }
.preset-card small { color: var(--theme-muted, #8290a7); }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th { color: var(--theme-muted, #8b96a8); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; border-bottom: 1px solid var(--line); padding: 12px 10px; white-space: nowrap; }
.data-table td { border-bottom: 1px solid var(--theme-border, #f0f2f7); padding: 15px 10px; font-size: 11px; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table strong { font-size: 12px; }
.table-link { border: none; background: transparent; color: var(--blue); text-decoration: underline; padding: 0; font-family: ui-monospace,monospace; font-size: 11px; text-align: left; }
.table-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.table-actions button { border: 1px solid var(--line); background: var(--theme-surface, white); border-radius: 6px; padding: 4px 7px; color: var(--theme-muted, #576986); font-size: 10px; }
.table-actions button:hover { background: var(--sky); }
.progress-track { background: var(--theme-surface-alt, #ebeff8); border-radius: 50px; width: 92px; height: 5px; overflow: hidden; margin-top: 7px; }
.progress-fill { height: 100%; background: var(--blue); border-radius: inherit; }
.stack-form { display: flex; flex-direction: column; gap: 12px; }
.stack-form > .button { align-self: flex-start; }
.stack-form .inline-actions input { flex: 1; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(140px,1fr)); gap: 12px; margin-bottom: 15px; }
.field-grid > label, .field-grid input { min-width: 0; }
.privacy-label { padding: 4px 8px; font-size: 10px; background: var(--theme-surface-alt, #e9f7f3); color: var(--theme-link, #188269); border-radius: 6px; }
.section-rule { height: 1px; border: 0; background: var(--line); margin: 17px 0; }
.wrap-actions { flex-wrap: wrap; margin: 12px 0; }
.api-explorer { display: grid; grid-template-columns: minmax(225px, 320px) minmax(0,1fr); gap: 18px; align-items: start; }
.api-list-panel { overflow: hidden; position: sticky; top: 89px; max-height: calc(100vh - 111px); display: flex; flex-direction: column; }
.api-filter { border-radius: 0; border: 0; border-bottom: 1px solid var(--line); padding: 16px; font-size: 12px; flex-shrink: 0; }
.api-route-list { overflow-y: auto; padding: 8px; }
.api-route-group { color: var(--theme-muted, #8292aa); font-size: 10px; text-transform: uppercase; padding: 13px 10px 8px; font-weight: 800; letter-spacing: .08em; }
.api-route { width: 100%; display: flex; gap: 9px; align-items: center; text-align: left; background: var(--theme-surface, white); border: 0; border-radius: 8px; padding: 10px 9px; }
.api-route:hover, .api-route.is-selected { background: var(--theme-accent-soft, #f0f3ff); }
.api-route.is-selected { box-shadow: inset 2px 0 0 var(--blue); }
.http-method { min-width: 44px; font-size: 9px; font-weight: 900; color: var(--theme-text, #11725d); }
.http-method.post { color: var(--theme-warning, #b77b25); }
.http-method.sse, .http-method.ws { color: var(--theme-muted, #7756b8); }
.api-route-path { font: 10px/1.5 ui-monospace,monospace; overflow-wrap: anywhere; }
.api-request-panel { min-height: 400px; }
.api-request-panel .stack-form > div:not(:empty) { display: flex; flex-direction: column; gap: 11px; }
.api-request-panel .stack-form > div > label { display: flex; flex-direction: column; }
.console-toast { position: fixed; right: 22px; bottom: 21px; max-width: min(390px,calc(100vw - 35px)); z-index: 40; border-radius: 10px; border: 1px solid var(--theme-border, #b9e9d9); background: var(--theme-surface-alt, #e9faf5); color: var(--theme-text, #146b55); box-shadow: 0 14px 44px var(--theme-shadow, #12213c23); padding: 13px 17px; font-weight: 620; font-size: 12px; }
.console-toast.error { background: var(--theme-danger-soft, #fff0f2); color: var(--theme-danger, #aa364b); border-color: var(--theme-danger, #f5ccd3); }
.auth-dialog { max-width: 440px; width: calc(100% - 24px); border: 1px solid var(--line); border-radius: 17px; background: var(--theme-surface, white); padding: 28px; box-shadow: 0 23px 80px var(--theme-shadow, #07132c61); color: var(--ink); }
.auth-dialog::backdrop { background: var(--theme-backdrop, #0d182f94); backdrop-filter: blur(4px); }
.auth-dialog form { margin: 0; }
.login-header { display: flex; gap: 8px; justify-content: space-between; }
.login-header h2 { font-size: 21px; }
.login-header p { font-size: 12px; margin-top: 7px; }
.form-error { color: var(--alert); font-size: 12px; margin: 0; min-height: 0; }
@media (max-width: 1120px) { .metric-grid { grid-template-columns: repeat(2,1fr); } .orbit-art { flex: 0 0 200px; transform: scale(.85); transform-origin: center; margin-right: -20px; } .topbar-runtime { display: none; } }
@media (max-width: 800px) { .console-sidebar { position: fixed; transform: translateX(-100%); transition: transform .2s; box-shadow: 10px 0 40px var(--theme-shadow, #0b173c33); } .console-sidebar.is-open { transform: none; } .sidebar-close { display: inline-grid !important; margin-left: auto; color: var(--theme-text, #b6c4df); } .mobile-nav-trigger { display: inline-grid; } .mobile-scrim:not([hidden]) { position: fixed; inset: 0; z-index: 14; background: var(--theme-surface-alt, #0b173c82); display: block; } .console-topbar { padding: 0 19px; height: 62px; } .console-main { padding: 24px 19px 50px; } .two-column, .api-explorer { grid-template-columns: minmax(0,1fr); } .api-list-panel { position: static; max-height: 310px; } .page-intro-actions { align-items: flex-start; flex-direction: column; } }
@media (max-width: 560px) { .signed-in, .topbar-divider { display: none; } .welcome-banner { min-height: 230px; } .orbit-art { position: absolute; opacity: .25; right: -65px; top: 30px; z-index: -1; } .metric-grid { gap: 10px; } .metric-card { padding: 15px; } .metric-value { font-size: 26px; } .metric-word { font-size: 18px; } .three-stats { gap: 9px; } .mini-stat { padding: 12px; } .mini-stat strong { font-size: 17px; } .mini-stat span { font-size: 11px; } .panel-pad { padding: 17px; } .panel-heading { align-items: flex-start; } .search-form, .composer { flex-wrap: wrap; } .search-form > input[type="search"] { flex-basis: 100%; } .search-form .search-leading { top: 8px; } .chat-bubble { max-width: 95%; } .topbar-actions { gap: 4px; } .breadcrumb span { padding: 0 5px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; } }
/* Privileged code learning, repair and human review queue. */
.code-status-columns { margin-top: 17px; }
.code-status { max-height: 270px; overflow: auto; font-size: 11px; }
.code-review-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
.code-review-grid > * { min-width: 0; }
.code-diff-label { margin-top: 18px; }
.code-diff { margin-top: 8px; max-height: 650px; overflow: auto; text-align: left; font-size: 11px; line-height: 1.55; tab-size: 2; }
.code-review-grid label { display: block; margin: 10px 0; }
.code-review-grid label input:not([type="checkbox"]):not([type="radio"]), .code-review-grid label textarea { width: 100%; margin-top: 6px; }
#codeReviewNote { min-height: 115px; }
#codeReviewDetail { max-height: 225px; overflow: auto; }
#codeReviewRows .table-link { max-width: 180px; overflow-wrap: anywhere; }
#codeAdminNotice { margin-bottom: 12px; }
@media (max-width: 950px) { .code-review-grid { grid-template-columns: minmax(0,1fr); } }


.job-progress-cell { min-width: 180px; }
.job-progress-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.job-progress-percent { font-weight: 700; color: var(--ink); }
.job-progress-fallback { color: var(--muted); font-size: 12px; }
.job-progress-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.progress-meta-pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; background: var(--theme-surface, #f4f7fc); color: var(--theme-muted, #5f6f92); padding: 4px 8px; font-size: 10px; line-height: 1.1; }
.progress-track { position: relative; background: var(--theme-surface-alt, #ebeff8); border-radius: 50px; width: 92px; height: 5px; overflow: hidden; margin-top: 7px; }
.progress-track.progress-track-wide { width: 100%; height: 10px; margin-top: 10px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--theme-accent, #6f83ff), var(--theme-accent, #6be4c7)); border-radius: inherit; }
.progress-fill.is-animated { background-size: 200% 100%; animation: ecaiProgressShift 1.25s linear infinite; }
.progress-track::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(255,255,255,0) 0%, var(--theme-surface, rgba(255,255,255,.55)) 50%, rgba(255,255,255,0) 100%); transform: translateX(-120%); opacity: 0; }
.progress-track.is-running::after { opacity: 1; animation: ecaiProgressSheen 1.8s ease-in-out infinite; }
.job-inspector { margin-top: 14px; border: 1px solid var(--theme-border, #e5ebf5); border-radius: 14px; background: linear-gradient(180deg, var(--theme-surface, #fbfcff) 0%, var(--theme-surface, #f6f9ff) 100%); padding: 16px; }
.job-inspector.empty { color: var(--muted); font-size: 14px; }
.job-hero { display: grid; gap: 14px; }
.job-hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.job-hero-copy { min-width: 0; }
.job-hero-copy h3 { margin: 0; font-size: 18px; color: var(--ink); }
.job-hero-copy p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.job-progress-headline { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 6px; }
.job-progress-value { font-size: 30px; font-weight: 800; color: var(--ink); letter-spacing: -0.04em; }
.job-progress-caption { color: var(--muted); font-size: 12px; }
.job-pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.job-pill { border: 1px solid var(--theme-border, #dde5f5); border-radius: 999px; background: var(--theme-surface, #fff); padding: 6px 10px; color: var(--theme-muted, #4d628f); font-size: 11px; }
.job-stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.job-stat-card { border: 1px solid var(--theme-border, #e6ecf8); background: var(--theme-surface, #fff); border-radius: 12px; padding: 12px; }
.job-stat-label { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.job-stat-value { display: block; margin-top: 6px; color: var(--ink); font-size: 18px; font-weight: 700; }
.job-stat-value.smallish { font-size: 15px; }
.job-stage-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.job-stage-card { border-radius: 12px; border: 1px solid var(--theme-border, #e6ecf8); background: var(--theme-surface, #fff); padding: 11px 12px; min-height: 80px; }
.job-stage-card.is-active { border-color: var(--theme-link, #cfd9ff); box-shadow: 0 0 0 1px var(--theme-shadow, rgba(111,131,255,.08)); }
.job-stage-card.is-done { border-color: var(--theme-border, #cdeedd); background: var(--theme-surface, #f3fdfa); }
.job-stage-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; font-weight: 700; color: var(--ink); }
.job-stage-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--theme-accent, #d5dcec); flex: 0 0 auto; }
.job-stage-card.is-active .job-stage-dot { background: var(--theme-accent, #6f83ff); box-shadow: 0 0 0 5px var(--theme-shadow, rgba(111,131,255,.15)); }
.job-stage-card.is-done .job-stage-dot { background: var(--theme-accent, #18a36d); }
.job-stage-copy { margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.job-checkpoint-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.job-checkpoint-card { border: 1px solid var(--theme-border, #e6ecf8); background: var(--theme-surface, #fff); border-radius: 12px; padding: 12px; }
.job-checkpoint-card h4 { margin: 0 0 8px; font-size: 12px; color: var(--ink); }
.job-checkpoint-list { display: grid; gap: 8px; }
.job-checkpoint-item { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--theme-muted, #4d628f); }
.job-checkpoint-key { color: var(--muted); }
.job-checkpoint-value { color: var(--ink); font-weight: 600; text-align: right; }
.nested-expandable { margin-top: 14px; }
@keyframes ecaiProgressShift { from { background-position: 0% 50%; } to { background-position: 200% 50%; } }
@keyframes ecaiProgressSheen { 0% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
@media (max-width: 980px) { .job-stats-grid, .job-stage-list, .job-checkpoint-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .job-hero-top, .job-progress-headline { flex-direction: column; align-items: flex-start; } .job-stats-grid, .job-stage-list, .job-checkpoint-grid { grid-template-columns: 1fr; } .job-progress-cell { min-width: 150px; } }

/* Per-job accordion. A single expanded job owns the authenticated live stream. */
.index-job-list { display: grid; gap: 11px; margin-top: 18px; }
.index-job-item { min-width: 0; border: 1px solid var(--theme-border, #e4eaf5); border-radius: 14px; background: var(--theme-surface, #fff); box-shadow: 0 2px 8px var(--theme-shadow, #142d5910); overflow: hidden; }
.index-job-item[open] { border-color: var(--theme-border, #cbd6ff); box-shadow: 0 7px 25px var(--theme-shadow, #354aba14); }
.index-job-summary { cursor: pointer; list-style: none; display: grid; grid-template-columns: minmax(0,1.35fr) max-content minmax(150px,1fr) minmax(75px,.35fr); align-items: center; gap: 18px; min-height: 91px; padding: 18px 19px; }
.index-job-summary::-webkit-details-marker { display: none; }
.index-job-summary:hover { background: var(--theme-accent-soft, #fbfcff); }
.index-job-summary:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.index-job-identity { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.index-job-identity > strong { font-size: 14px; font-weight: 750; line-height: 1.3; color: var(--ink); }
.index-job-id { color: var(--theme-muted, #546eaf); font-size: 11px; overflow-wrap: anywhere; }
.index-job-source { color: var(--muted); font-size: 11px; }
.index-job-meter { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.index-job-meter .progress-track { margin: 0; height: 7px; }
.index-job-meter-label { display: flex; justify-content: space-between; gap: 9px; align-items: baseline; min-width: 0; }
.index-job-meter-label strong { color: var(--ink); font-size: 13px; }
.index-job-meter-label small { font-size: 11px; color: var(--muted); white-space: nowrap; }
.index-job-trailing { display: flex; align-items: center; justify-content: flex-end; gap: 13px; white-space: nowrap; }
.index-job-trailing small { color: var(--theme-muted, #62718c); font-size: 11px; }
.index-job-chevron { font-size: 25px; line-height: 1; color: var(--theme-muted, #8292b0); transition: transform .18s ease; }
.index-job-item[open] .index-job-chevron { transform: rotate(180deg); }
.index-job-expanded { border-top: 1px solid var(--theme-border, #ebeff7); background: var(--theme-surface, #fbfcff); padding: clamp(15px,2vw,24px); min-width: 0; animation: indexJobReveal .2s ease-out; }
.index-job-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.index-job-tracking { color: var(--theme-muted, #50658c); font-size: 12px; overflow-wrap: anywhere; }
.index-job-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.index-job-actions { margin: 0; }
.index-job-actions button { min-height: 31px; padding: 5px 11px; font-size: 11px; }
.index-job-layout { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,440px),1fr)); gap: 14px; align-items: start; min-width: 0; }
.index-job-layout > * { min-width: 0; }
.index-job-layout .job-inspector { margin: 0; }
.index-job-feed { min-width: 0; background: var(--theme-surface, #fff); border: 1px solid var(--theme-border, #e6ecf8); border-radius: 12px; padding: 16px; }
.index-job-feed h3 { font-size: 14px; margin-bottom: 7px; }
.index-job-feed .context-hint { margin: 0 0 11px; }
.index-job-event-log { height: clamp(170px,23vh,280px); min-height: 170px; max-height: none; white-space: pre-wrap; font-size: 11px; overflow: auto; margin: 0; }
.index-job-raw { margin-top: 16px; }
.index-job-raw > summary { cursor: pointer; color: var(--theme-muted, #50658c); font-size: 12px; padding: 7px 0; }
.index-job-raw > .code-display { margin-top: 7px; }
/* The cards need to respond to their own container width, not the device width. */
.index-job-layout .job-stats-grid { grid-template-columns: repeat(auto-fit,minmax(min(100%,140px),1fr)); }
.index-job-layout .job-stage-list { grid-template-columns: repeat(auto-fit,minmax(min(100%,160px),1fr)); }
.index-job-layout .job-checkpoint-grid { grid-template-columns: repeat(auto-fit,minmax(min(100%,230px),1fr)); }
.index-job-layout .job-pill { min-width: 0; max-width: 100%; overflow-wrap: anywhere; white-space: normal; }
.index-job-layout .job-hero, .index-job-layout .job-hero-top, .index-job-layout .job-hero-copy, .index-job-layout .job-progress-headline { min-width: 0; }
.index-job-layout .job-stat-value { overflow-wrap: anywhere; }
.index-job-item .progress-track { max-width: 100%; }
@keyframes indexJobReveal { from { opacity: .5; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
@media (max-width: 1080px) { .index-job-summary { grid-template-columns: minmax(0,1fr) auto; gap: 11px 15px; } .index-job-summary > .index-job-meter { grid-column: 1; } .index-job-summary > .index-job-trailing { grid-column: 2; grid-row: 2; } .index-job-summary > .status-tag { grid-column: 2; grid-row: 1; justify-self: end; } }
@media (max-width: 520px) { .index-job-summary { padding: 14px; } .index-job-expanded { padding: 12px; } .index-job-layout .job-stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .index-job-trailing small { display: none; } .index-job-controls { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .index-job-expanded { animation: none; } .index-job-chevron { transition: none; } .index-job-item .progress-track::after, .index-job-item .progress-fill { animation: none; } }

/* Job-runtime panel uses existing dashboard components; no chart dependency. */
.job-runtime-panel { margin: 14px 0; padding: 15px; background: var(--theme-surface, #f6f8fd); border: 1px solid var(--theme-border, #e3e9f6); border-radius: 12px; min-width: 0; }
.job-runtime-heading { display:flex; gap: 12px; justify-content: space-between; align-items: baseline; flex-wrap: wrap; }
.job-runtime-heading h4 { margin: 0; font-size: 13px; color: var(--ink); }
.job-runtime-note { color: var(--muted); font-size: 11px; line-height: 1.5; overflow-wrap:anywhere; }
.job-runtime-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(126px, 1fr)); gap: 9px; margin-top: 10px; }
.job-runtime-stat { min-width: 0; background: var(--theme-surface, white); border: 1px solid var(--theme-border, #e3e9f6); border-radius: 9px; padding: 10px 11px; }
.job-runtime-stat-title { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.job-runtime-stat-value { display: block; color: var(--ink); font-size: 14px; font-weight: 700; margin-top: 6px; min-width: 0; overflow-wrap: anywhere; }
.job-resource-grid .job-runtime-stat-value { font-size: 13px; }
.job-hero .job-pill, .job-checkpoint-value { min-width: 0; max-width: 100%; overflow-wrap:anywhere; word-break: break-word; }
.index-job-time-spent { white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .progress-fill.is-animated, .progress-track.is-running::after { animation: none !important; } }

/* Human-gated code-repair workbench: filters, inline review cards, file diffs. */
.code-filter-toolbar { display:grid; grid-template-columns: minmax(190px, 1.8fr) repeat(3, minmax(128px, 1fr)) auto; align-items:end; gap: 10px; margin: 17px 0 9px; }
.code-filter-toolbar label { display:flex; flex-direction:column; gap: 6px; min-width:0; font-size:11px; font-weight:600; color:var(--theme-muted, #61718f); }
.code-filter-toolbar input:not([type="checkbox"]), .code-filter-toolbar select { margin:0; width:100%; min-width:0; height:39px; padding:8px 11px; border:1px solid var(--theme-control-border, #dce4f1); border-radius:9px; background:var(--theme-input, white); color:var(--ink); font:inherit; font-size:12px; }
.code-filter-toolbar .code-filter-checkbox { align-self:center; flex-direction:row; align-items:center; gap:8px; white-space:nowrap; font-size:11px; font-weight:500; }
.code-filter-checkbox input { accent-color:var(--theme-accent, #6476f2); }
.code-filter-clear { margin-bottom:0; align-self:end; height:39px; }
.code-filter-count { color:var(--theme-muted, #6a7a98); font-size:12px; margin:2px 0 12px; }
.code-repair-list, .code-review-list { display:grid; gap:10px; min-width:0; }
.code-repair-row { display:grid; grid-template-columns:minmax(0,1fr) auto auto auto; gap:14px; align-items:center; padding:13px 15px; background:var(--theme-surface, #fafdff); border:1px solid var(--theme-border, #e5eaf6); border-radius:12px; min-width:0; }
.code-repair-row-main, .code-review-title { min-width:0; }
.code-repair-row-main strong, .code-review-title strong { color:var(--ink); font-size:13px; overflow-wrap:anywhere; }
.code-row-summary { color:var(--theme-muted, #6a7795); font-size:11px; line-height:1.45; margin:4px 0 0; max-width:100%; overflow-wrap:anywhere; }
.code-row-hash { display:block; margin-top:4px; overflow-wrap:anywhere; }
.code-repair-row-actions { display:flex; align-items:center; white-space:nowrap; }
.code-review-card { border:1px solid var(--theme-border, #dfe6f6); border-radius:14px; background:var(--theme-surface, white); overflow:hidden; min-width:0; }
.code-review-card[open] { border-color:var(--theme-border, #c5d1ff); box-shadow:0 8px 22px var(--theme-shadow, rgba(34,51,107,.055)); }
.code-review-summary { display:grid; grid-template-columns:minmax(210px,2fr) auto auto auto minmax(110px,.7fr) 18px; gap:12px; align-items:center; padding:17px 18px; cursor:pointer; list-style:none; user-select:none; min-width:0; }
.code-review-summary::-webkit-details-marker { display:none; }
.code-review-summary::marker { content:""; }
.code-review-summary:hover { background:var(--theme-accent-soft, #f8faff); }
.code-review-summary:focus-visible, .code-file-button:focus-visible, .code-repair-row button:focus-visible { outline:3px solid var(--theme-focus, #aab9ff); outline-offset:2px; }
.code-review-summary .code-row-summary { margin:7px 0 0; font-size:11px; font-weight:400; line-height:1.5; }
.code-review-title .code-row-hash { margin-top:5px; }
.code-review-time { justify-self:end; text-align:right; overflow-wrap:anywhere; }
.code-review-approval-count { white-space:nowrap; }
.code-validation-label { border:1px solid var(--theme-border, #e1e8f5); background:var(--theme-surface, #f5f7fb); padding:5px 9px; color:var(--theme-muted, #6b7894); border-radius:999px; font-size:10px; white-space:nowrap; font-weight:700; }
.code-validation-label.verified { color:var(--theme-success, #14805c); background:var(--theme-success-soft, #e9faf2); border-color:var(--theme-success, #bee9da); }
.code-review-chevron { display:block; color:var(--theme-muted, #60729c); font-size:21px; line-height:1; transition:transform .2s ease; }
.code-review-card[open] .code-review-chevron { transform:rotate(180deg); }
.code-review-content { border-top:1px solid var(--theme-border, #e4ebf8); padding:18px; background:var(--theme-surface, #fafbff); min-width:0; }
.code-review-content > .context-hint { margin:0 0 14px; overflow-wrap:anywhere; }
.code-review-workspace { min-width:0; }
.code-review-workspace[hidden], .code-bearer-notice[hidden] { display:none !important; }
.code-review-workspace .code-review-grid { grid-template-columns:minmax(0,1.2fr) minmax(0, .9fr); align-items:start; gap:14px; }
.code-review-workspace .code-review-grid > .surface { box-shadow:none; border:1px solid var(--theme-border, #e3eaf8); }
.code-review-verification { border-radius:10px; border:1px solid var(--theme-border, #e3eaf7); background:var(--theme-surface, #f7faff); padding:14px; margin-top:12px; }
.code-verification-hero { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:9px; margin-bottom:10px; }
.code-verification-facts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.code-verification-fact { display:flex; flex-direction:column; gap:5px; padding:9px 10px; border:1px solid var(--theme-border, #e5eaf4); background:var(--theme-surface, white); border-radius:8px; min-width:0; }
.code-verification-fact span { font-size:10px; color:var(--theme-muted, #73809c); }
.code-verification-fact strong { font:11px/1.6 ui-monospace,Menlo,Consolas,monospace; color:var(--theme-text, #394c6e); overflow-wrap:anywhere; }
.code-verification-steps { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; }
.code-verification-step { border-radius:6px; padding:5px 8px; background:var(--theme-surface, white); border:1px solid var(--theme-border, #e0e8f8); font-size:10px; color:var(--theme-muted, #677998); }
.code-verification-step.passed { color:var(--theme-success, #178363); background:var(--theme-success-soft, #effbf6); border-color:var(--theme-border, #d3eee1); }
.code-review-metadata { margin:12px 0; border-radius:10px; border:1px solid var(--theme-border, #e3eaf8); background:var(--theme-surface, white); }
.code-review-metadata summary { cursor:pointer; padding:10px 13px; font-size:12px; color:var(--theme-muted, #53688e); }
.code-review-metadata .code-display { margin:0 11px 11px; }
.code-diff-toolbar { display:flex; justify-content:space-between; flex-wrap:wrap; align-items:flex-start; gap:12px; margin-top:16px; }
.code-diff-toolbar .code-diff-label { margin:0 0 5px; }
.code-diff-file-list { display:flex; flex-wrap:wrap; gap:6px; max-width:100%; }
.code-file-button { max-width:100%; font-size:11px; color:var(--theme-muted, #536b9c); padding:7px 10px; border:1px solid var(--theme-border, #dfe6f6); background:var(--theme-surface, #fff); border-radius:8px; cursor:pointer; overflow-wrap:anywhere; text-align:left; }
.code-file-button:hover { border-color:var(--theme-link, #a9b9f4); background:var(--theme-accent-soft, #f5f7ff); }
.code-file-button.is-active { color:var(--theme-link, #4055b4); background:var(--theme-accent-soft, #edf1ff); border-color:var(--theme-link, #b8c5ff); font-weight:700; }
.code-review-workspace .code-diff { background:var(--theme-surface, #f6f8fc); border:1px solid var(--theme-border, #e4eafa); border-radius:10px; max-height:680px; overflow:auto; margin-top:10px; padding:5px 0 9px; font:11px/1.55 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; color:var(--theme-muted, #465571); tab-size:2; }
.code-diff-file-heading { background:var(--theme-surface-alt, #eaf0fa); border-bottom:1px solid var(--theme-border, #dce4f1); padding:9px 12px; font-weight:700; color:var(--theme-muted, #344e81); overflow-wrap:anywhere; position:sticky; top:0; }
.code-diff-line { padding:0 12px; white-space:pre; width:max-content; min-width:100%; }
.code-diff-line.is-addition { color:var(--theme-text, #14683d); background:var(--theme-surface-alt, #e9f9f0); }
.code-diff-line.is-removal { color:var(--theme-danger, #a0394e); background:var(--theme-danger-soft, #fff0f3); }
.code-diff-line.is-hunk { color:var(--theme-link, #426ab0); background:var(--theme-surface-alt, #eaf1ff); font-weight:600; }
.code-diff-line.is-meta { color:var(--theme-muted, #70819f); }
.code-bearer-notice { background:var(--theme-warning-soft, #fff8e9); border:1px solid var(--theme-warning, #f4ddb4); color:var(--theme-warning, #785a21); font-size:12px; line-height:1.6; padding:12px; border-radius:9px; margin:0 0 15px; }
.code-bearer-notice .text-button { font-weight:700; color:var(--theme-muted, #6850b1); }
@media (max-width:1200px) { .code-filter-toolbar { grid-template-columns:repeat(2,minmax(0,1fr)); } .code-filter-toolbar .code-filter-search { grid-column:1/-1; } .code-review-summary { grid-template-columns:minmax(0,1fr) auto auto; } .code-review-summary .code-review-approval-count, .code-review-summary .code-review-time { display:none; } }
@media (max-width:1000px) { .code-review-workspace .code-review-grid { grid-template-columns:minmax(0,1fr); } }
@media (max-width:680px) { .code-filter-toolbar { grid-template-columns:minmax(0,1fr); } .code-filter-toolbar .code-filter-search { grid-column:auto; } .code-repair-row { grid-template-columns:minmax(0,1fr) auto; } .code-repair-row .status-tag { justify-self:end; } .code-repair-row-actions { justify-self:end; } .code-review-summary { grid-template-columns:minmax(0,1fr) auto; gap:7px 10px; } .code-review-summary .code-review-title { grid-column:1/-1; } .code-review-summary .code-validation-label { grid-column:1; } .code-review-summary .code-review-chevron { grid-column:2; grid-row:2; } .code-review-summary .status-tag { grid-column:1; grid-row:2; justify-self:start; } .code-review-summary .code-validation-label { grid-row:3; } .code-review-summary .code-review-chevron { grid-row:2/4; align-self:center; } .code-review-content { padding:10px; } .code-verification-facts { grid-template-columns:1fr; } }
@media (prefers-reduced-motion:reduce) { .code-review-chevron { transition:none; } .code-review-card, .code-review-content { scroll-behavior:auto; } }

/* Node-admin operations overview: live counts, diagnostics and publication gate. */
.code-status-heading { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:end; gap:12px; margin:23px 0 14px; }
.code-status-heading .eyebrow { margin-bottom:4px; }
.code-status-heading h3 { font-size:16px; margin:0; }
.code-metrics-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.code-metric { position:relative; min-width:0; border:1px solid var(--theme-border, #e0e7f4); border-radius:13px; background:linear-gradient(180deg,var(--theme-surface, #fff),var(--theme-surface, #fafcff)); padding:15px 17px; }
.code-metric-label { color:var(--theme-muted, #687998); font-size:11px; font-weight:650; }
.code-metric-value { display:block; color:var(--theme-text, #182947); font-size:clamp(21px,2.3vw,29px); letter-spacing:-.045em; font-weight:760; margin:5px 0 3px; overflow-wrap:anywhere; }
.code-metric-caption { color:var(--theme-muted, #71809d); font-size:11px; line-height:1.5; overflow-wrap:anywhere; }
.code-metric.has-attention { border-color:var(--theme-warning, #f4d5bc); background:linear-gradient(180deg,var(--theme-warning-soft, #fffdf9),var(--theme-warning-soft, #fff9f3)); }
.code-metric.has-success { border-color:var(--theme-success, #ccece3); }
.code-services-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-top:13px; }
.code-service { min-width:0; border:1px solid var(--theme-border, #e1e8f5); border-radius:13px; background:var(--theme-surface, #f9fbff); padding:15px; }
.code-service-head { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:9px; }
.code-service h4 { margin:0; font-size:13px; }
.code-service-state { border:1px solid var(--theme-border, #d9e2f1); background:var(--theme-surface-alt, #eef2fa); color:var(--theme-muted, #586a8b); font-size:10px; font-weight:700; padding:4px 8px; border-radius:999px; }
.code-service-state.ok { background:var(--theme-success-soft, #e8f9f1); color:var(--theme-success, #147858); border-color:var(--theme-success, #bdebd9); }
.code-service-state.warn { background:var(--theme-warning-soft, #fff3e7); color:var(--theme-warning, #965d1d); border-color:var(--theme-warning, #f1d9b7); }
.code-service-state.bad { background:var(--theme-danger-soft, #fff0f3); color:var(--theme-danger, #a03049); border-color:var(--theme-danger, #f3c6d0); }
.code-service-description { margin:10px 0; color:var(--theme-muted, #64748f); font-size:11px; min-height:32px; line-height:1.55; overflow-wrap:anywhere; }
.code-service-facts { display:grid; gap:7px; margin-top:10px; }
.code-service-fact { display:flex; gap:10px; justify-content:space-between; align-items:baseline; color:var(--theme-muted, #74829c); font-size:11px; min-width:0; }
.code-service-fact strong { color:var(--theme-text, #273a5d); font-size:11px; overflow-wrap:anywhere; text-align:right; }
.code-mini-progress { width:100%; height:8px; border-radius:999px; background:var(--theme-surface-alt, #e5ebf7); overflow:hidden; margin-top:12px; }
.code-mini-progress > span { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,var(--theme-accent, #6476f0),var(--theme-accent, #32b9a8)); transition:width .25s ease; }
.code-raw-telemetry { margin-top:15px; border:1px solid var(--theme-border, #e2e9f6); border-radius:11px; background:var(--theme-surface, #fff); }
.code-raw-telemetry summary { cursor:pointer; padding:12px 15px; color:var(--theme-muted, #536a99); font-size:12px; font-weight:650; }
.code-raw-telemetry .code-status-columns { padding:0 13px 14px; }
.code-publish-gate { border:1px solid var(--theme-border, #e0e7f4); background:var(--theme-surface, #f8faff); color:var(--theme-muted, #4d628b); border-radius:11px; padding:13px; margin:10px 0 14px; font-size:12px; }
.code-publish-gate.is-ready { background:var(--theme-success-soft, #f0fbf5); border-color:var(--theme-success, #c2ebd5); color:var(--theme-success, #236b4f); }
.code-publish-gate.is-blocked { background:var(--theme-warning-soft, #fff9f0); border-color:var(--theme-warning, #f0dabb); color:var(--theme-warning, #755522); }
.code-publish-gate-title { display:block; font-weight:760; font-size:13px; color:inherit; margin-bottom:6px; }
.code-publish-gate ul { margin:8px 0 0; padding-left:18px; line-height:1.7; }
.code-publish-gate p { font-size:11px; margin:7px 0 0; color:inherit; }
@media(max-width:1160px) { .code-metrics-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .code-services-grid { grid-template-columns:minmax(0,1fr); } .code-service-description { min-height:0; } }
@media(max-width:620px) { .code-metrics-grid { grid-template-columns:minmax(0,1fr); } .code-raw-telemetry .code-status-columns { grid-template-columns:minmax(0,1fr); } }
@media(prefers-reduced-motion:reduce) { .code-mini-progress > span { transition:none; } }

.code-settings-surface { margin-top:16px; }
.code-settings-surface > summary { cursor:pointer; display:flex; align-items:center; justify-content:space-between; gap:16px; }
.code-settings-surface > summary strong { display:block; margin-top:3px; font-size:16px; color:var(--theme-text, #20304f); }
.code-settings-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin-top:16px; }
.code-settings-card { min-width:0; padding:16px; border:1px solid var(--theme-border, #e2e9f6); border-radius:12px; background:var(--theme-surface, #fbfcff); }
.code-settings-card h3 { margin:4px 0 13px; font-size:14px; color:var(--theme-text, #273a5d); }
.code-settings-card > label, .code-settings-card .field-grid > label, .code-role-group { display:grid; gap:6px; margin:10px 0; font-size:11px; font-weight:650; color:var(--theme-muted, #536889); }
.code-settings-card input:not([type="checkbox"]) { width:100%; min-width:0; }
.code-settings-card small { color:var(--theme-muted, #7b8ba5); line-height:1.45; font-weight:500; }
.code-toggle { display:flex !important; align-items:center; gap:8px; grid-template-columns:auto 1fr; }
.code-toggle input[type="checkbox"] { width:16px; height:16px; margin:0; accent-color:var(--blue); }
.code-role-list { display:flex; flex-wrap:wrap; gap:7px; min-height:30px; align-items:center; }
.code-role-chip { display:inline-flex; align-items:center; gap:8px; max-width:100%; border:1px solid var(--theme-border, #dbe4f5); background:var(--theme-surface, #fff); border-radius:999px; padding:5px 7px 5px 10px; font-size:10px; font-weight:600; color:var(--theme-muted, #435675); }
.code-role-chip > span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:290px; }
.code-role-remove { border:0; border-radius:999px; background:var(--theme-surface-alt, #eef2fa); color:var(--theme-muted, #64748f); padding:3px 7px; cursor:pointer; font-size:10px; }
.code-role-remove:disabled { opacity:.5; cursor:not-allowed; }
.code-bundle-list { display:grid; gap:6px; margin-top:10px; max-height:180px; overflow:auto; }
.code-bundle { border:1px solid var(--theme-border, #e1e8f5); border-radius:8px; background:var(--theme-surface, #fff); padding:8px 10px; color:var(--theme-muted, #526481); font:10px/1.45 ui-monospace,SFMono-Regular,Menlo,monospace; overflow-wrap:anywhere; }
.code-settings-footer { display:flex; gap:14px; justify-content:space-between; align-items:center; flex-wrap:wrap; margin-top:16px; padding-top:14px; border-top:1px solid var(--theme-border, #e8edf6); }
.code-settings-footer .context-hint { margin:0; flex:1 1 300px; }
.code-sharing-card { grid-column:span 2; }
@media(max-width:900px) { .code-settings-grid { grid-template-columns:minmax(0,1fr); } .code-sharing-card { grid-column:auto; } }
@media(max-width:620px) { .code-settings-card .field-grid { grid-template-columns:minmax(0,1fr); } .code-role-group .inline-actions { align-items:stretch; } .code-role-group .inline-actions input { flex-basis:100%; } }

/* Wikimedia source picker: compact project selection and server-reviewed plans. */
.wiki-picker-surface, .wiki-custom-surface { margin-bottom: 18px; }
.wiki-picker-surface .context-hint, .wiki-custom-surface .context-hint { margin: 8px 0 14px; }
.wiki-picker-tools { display: flex; align-items: center; gap: 12px; margin: 16px 0; }
.wiki-search-label { display: block; flex: 1; max-width: 360px; }
.wiki-search-label input { width: 100%; }
.wiki-preset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 245px), 1fr)); gap: 11px; }
.wiki-project-card { display: flex; flex-direction: column; gap: 11px; cursor: pointer; background: var(--theme-surface, #fbfcff); border: 1px solid var(--theme-border, #e2e8f3); padding: 17px; border-radius: 13px; min-width: 0; transition: border-color .15s, background .15s; }
.wiki-project-card:hover { border-color: var(--theme-link, #abbcfb); }
.wiki-project-card.is-selected { border-color: var(--theme-control-border, #7189f3); background: var(--theme-accent-soft, #f0f3ff); box-shadow: inset 0 0 0 1px var(--theme-shadow, #9cafff); }
.wiki-project-card:focus-within { outline: 3px solid var(--theme-focus, #a5b5ff); outline-offset: 2px; }
.wiki-project-card-head { display: flex; align-items: flex-start; gap: 11px; }
.wiki-project-card input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--blue); margin: 2px 0 0; flex: 0 0 18px; }
.wiki-project-card-copy { display: grid; gap: 2px; min-width: 0; }
.wiki-project-card-copy strong { font-size: 13px; color: var(--theme-text, #1e2b44); }
.wiki-project-card-copy small { color: var(--theme-muted, #6b7c9a); font-size: 11px; }
.wiki-project-description { font-size: 12px; line-height: 1.55; color: var(--theme-muted, #60718f); }
.wiki-project-active { color: var(--theme-warning, #9c7117); background: var(--theme-warning-soft, #fff6df); border: 1px solid var(--theme-warning, #f8e9bd); border-radius: 7px; padding: 6px 8px; font-size: 11px; }
.wiki-picker-footer { margin-top: 17px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; border-top: 1px solid var(--theme-border, #ebeff7); padding-top: 17px; }
.wiki-picker-count { display: grid; gap: 1px; }
.wiki-picker-count strong { font-size: 15px; }
.wiki-picker-count span { color: var(--muted); font-size: 11px; }
.wiki-picker-notice { margin-top: 13px; font-size: 12px; color: var(--theme-muted, #536889); }
.wiki-enqueue-results { display: grid; gap: 7px; margin-top: 8px; }
.wiki-queue-result { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; justify-content: space-between; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--theme-border, #deebdf); background: var(--theme-surface, #f4fcf6); font-size: 12px; color: var(--theme-link, #24734e); }
.wiki-queue-result.is-error { background: var(--theme-danger-soft, #fff5f5); border-color: var(--theme-danger, #f5d4d6); color: var(--theme-danger, #a42e45); }
.wiki-custom-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, 1fr); gap: 19px; align-items: stretch; margin-top: 14px; }
.wiki-custom-config { min-width: 0; }
.wiki-custom-fields { grid-template-columns: repeat(3, minmax(0,1fr)); }
.wiki-source-choice-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 16px 0 8px; }
.wiki-source-choice-head > label, .wiki-field-label { font-size: 12px; color: var(--theme-muted, #455675); font-weight: 650; }
.wiki-field-label small { color: var(--theme-muted, #7b8ba5); font-size: 10px; font-weight: 500; margin-left: 7px; }
.wiki-custom-config > select { width: 100%; }
.wiki-month-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; }
.wiki-month-choice { display: flex; gap: 7px; align-items: center; border: 1px solid var(--theme-border, #e3e9f3); background: var(--theme-surface, #fbfcff); border-radius: 8px; padding: 9px 10px; font-size: 12px; color: var(--theme-muted, #566889); cursor: pointer; white-space: nowrap; }
.wiki-month-choice.is-selected { border-color: var(--theme-control-border, #b0bfff); color: var(--theme-link, #3349b7); background: var(--theme-accent-soft, #eff2ff); }
.wiki-month-choice:focus-within { outline: 2px solid var(--theme-focus, #8ca0fb); outline-offset: 1px; }
.wiki-month-choice input { accent-color: var(--blue); width: 15px; height: 15px; margin: 0; }
.wiki-plan-card { min-width: 0; border: 1px solid var(--theme-border, #dfe7f6); border-radius: 13px; padding: 17px; background: linear-gradient(165deg,var(--theme-surface, #f6f8ff),var(--theme-surface, #fff)); }
.wiki-plan-card h3 { font-size: 17px; margin: 0 0 13px; }
.wiki-plan-summary { display: grid; gap: 8px; }
.wiki-plan-summary-line { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--theme-border, #e7ecf7); padding-bottom: 9px; font-size: 12px; }
.wiki-plan-summary-line span { color: var(--theme-muted, #6b7e9c); }
.wiki-plan-summary-line strong { text-align: right; color: var(--theme-text, #293a5a); overflow-wrap: anywhere; }
.wiki-plan-warning, .wiki-plan-approved { margin-top: 12px; padding: 9px 11px; border: 1px solid var(--theme-warning, #f0dfa4); border-radius: 8px; color: var(--theme-warning, #836a2a); background: var(--theme-warning-soft, #fff9e7); font-size: 11px; }
.wiki-plan-approved { color: var(--theme-text, #147956); background: var(--theme-surface-alt, #eafbf3); border-color: var(--theme-border, #b8e8d3); }
.wiki-plan-actions { display: flex; flex-wrap: wrap; gap: 9px; margin: 17px 0 8px; }
.wiki-plan-actions .button { flex: 1 1 130px; }
.wiki-json-details { margin-top: 16px; }
.wiki-json-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 12px 15px 16px; }
.wiki-json-grid section { min-width: 0; }
.wiki-json-grid h3 { margin-bottom: 8px; }
.wiki-json-grid .code-display { margin: 0; min-height: 130px; max-height: 260px; }
@media (max-width: 1100px) { .wiki-custom-layout { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .wiki-custom-fields { grid-template-columns: 1fr; } .wiki-json-grid { grid-template-columns: 1fr; } .wiki-picker-tools { flex-wrap: wrap; } .wiki-search-label { max-width: none; flex-basis: 100%; } .wiki-picker-footer .button { width: 100%; } .wiki-plan-card { padding: 14px; } }
@media (prefers-reduced-motion: reduce) { .wiki-project-card { transition: none; } }

/* Owned personality selection is scoped to the current conversation. */
.chat-personality-bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:12px 20px;background:var(--theme-surface, #f9fbfd);border-bottom:1px solid var(--line)}
.chat-personality-choice{display:flex;align-items:center;gap:10px;flex:1;min-width:0}.chat-personality-choice label{font-size:9px;letter-spacing:.12em;font-weight:750;color:var(--theme-muted, #7989a1);flex-shrink:0}.chat-personality-choice select{font-size:12px;border:1px solid var(--theme-control-border, #dce4ed);border-radius:7px;padding:7px 9px;max-width:100%;min-width:0;width:min(100%,320px);background:var(--theme-input, #fff);color:var(--theme-text, #344761)}.chat-personality-bar>.text-button{font-size:10px;margin-left:auto}.chat-personality-status{flex-basis:100%;font-size:10px;line-height:1.6;margin:0;color:var(--theme-muted, #728198);overflow-wrap:anywhere}.chat-personality-status[data-error=true]{color:var(--theme-danger, #a13e4c)}
@media(max-width:560px){.chat-personality-bar{padding:12px;gap:8px}.chat-personality-choice{flex-basis:calc(100% - 40px);flex-wrap:wrap;gap:6px}.chat-personality-choice label{flex-basis:100%}.chat-personality-choice select{width:100%}.chat-personality-bar>.text-button{margin-left:0}.chat-personality-status{font-size:11px}}

/* Index mint review: all surfaces use node palette tokens, not fixed white. */
.job-mint-panel[hidden] { display: none !important; }
.job-mint-panel { margin: 0 0 18px; padding: 18px; min-width: 0;
  border: 1px solid var(--border, var(--line, #dce4f1)); border-radius: 12px;
  background: var(--surface, var(--panel, #fff)); color: var(--text, var(--ink, #182746)); }
.job-mint-heading, .job-mint-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.job-mint-panel h3 { margin: 0; color: inherit; }
.job-mint-form, .job-mint-fields { display: grid; gap: 12px; min-width: 0; }
.job-mint-fields { margin: 0; padding: 0; border: 0; }
.job-mint-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,210px),1fr)); gap: 12px; }
.job-mint-field { display: grid; gap: 6px; min-width: 0; font-size: 12px; color: inherit; }
.job-mint-panel .job-mint-field input, .job-mint-panel .job-mint-field textarea {
  box-sizing: border-box; width: 100%; min-width: 0; padding: 11px; border-radius: 9px;
  border: 1px solid var(--border, var(--line, #dce4f1)); font: inherit;
  background: var(--surface-2, var(--panel, #f7f9fd)); color: var(--text, var(--ink, #182746)); }
.job-mint-field textarea { resize: vertical; }
.job-mint-panel :is(input,textarea,button):focus-visible { outline: 3px solid var(--accent,#6476f2); outline-offset: 2px; }
.job-mint-panel :is(.context-hint,.job-mint-hint) { color: var(--muted,#61718f); font-size: 12px; line-height: 1.5; }
.job-mint-message { font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.job-mint-message.is-error { border-left: 3px solid var(--danger,#bd354d); padding-left: 12px; }

/* Policy switches are inline controls, not full-width stacked text fields. */
.code-settings-card label.code-toggle,
.code-role-group label.code-toggle {
  display:flex; flex-direction:row; align-items:flex-start; gap:9px;
  color:var(--theme-text, var(--ink)); line-height:1.6;
}
.code-settings-card .code-toggle input:is([type="checkbox"],[type="radio"]) {
  flex:0 0 18px; inline-size:18px; block-size:18px; min-height:0;
  padding:0; margin:2px 0 0; border-radius:0; accent-color:var(--blue);
}



/* Conversation-focused layout: scoped and theme-token driven. */
.chat-workspace { max-width:none; grid-template-columns:minmax(265px,318px) minmax(0,1fr); align-items:stretch; }
.chat-workspace.history-collapsed { grid-template-columns:minmax(0,1fr); }
.chat-workspace.history-collapsed .chat-history-panel { display:none; }
.chat-workspace .chat-layout { min-width:0; max-width:none; min-height:clamp(600px,calc(100dvh - 240px),1150px); }
.chat-workspace .chat-history-panel { min-height:0; max-height:none; }
.chat-workspace .chat-history-toggle { display:grid; width:36px; height:36px; flex:0 0 36px; color:var(--theme-text,var(--ink)); }
.chat-workspace .chat-messages { min-height:350px; max-height:none; flex:1; padding:clamp(15px,2.5vw,28px); gap:18px; background:var(--theme-surface,var(--paper)); }
.chat-workspace .chat-turn { display:grid; gap:5px; width:100%; }
.chat-workspace .chat-turn.from-user { justify-items:end; }
.chat-workspace .chat-turn.from-agent { justify-items:start; }
.chat-workspace .chat-turn-meta { color:var(--theme-muted,var(--muted)); font-size:11px; padding-inline:4px; }
.chat-workspace .chat-turn .chat-bubble { white-space:pre-wrap; overflow-wrap:anywhere; max-width:min(85%,78ch); line-height:1.65; }
.chat-workspace .chat-turn.is-pending .chat-bubble { opacity:.75; border:1px dashed var(--theme-border,var(--line)); }
.chat-workspace .chat-composer { display:block; padding:16px clamp(12px,2.5vw,24px) 8px; background:var(--theme-surface,var(--paper)); }
.chat-workspace .chat-composer-shell { border:1px solid var(--theme-border,var(--line)); border-radius:16px; background:var(--theme-surface,var(--paper)); overflow:hidden; }
.chat-workspace .chat-composer-shell:focus-within { outline:2px solid var(--theme-accent,var(--accent)); outline-offset:1px; }
.chat-workspace .chat-composer textarea { box-sizing:border-box; display:block; width:100%; min-height:72px; max-height:220px; height:auto; padding:16px 16px 10px; resize:none; border:0; box-shadow:none; outline:none; background:transparent; color:var(--theme-text,var(--ink)); }
.chat-workspace .chat-composer-bottom { display:flex; align-items:center; gap:12px; justify-content:space-between; padding:9px 12px 12px; }
.chat-workspace .chat-composer-tools { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.chat-workspace .chat-composer-shortcut { font-size:11px; color:var(--theme-muted,var(--muted)); }
.chat-workspace .chat-attachment-list { display:flex; flex-wrap:wrap; gap:7px; padding:11px 12px 0; }
.chat-workspace .chat-attachment-list[hidden] { display:none; }
.chat-workspace .chat-attachment { display:inline-flex; align-items:center; gap:6px; border:1px solid var(--theme-border,var(--line)); border-radius:999px; padding:5px 8px; background:var(--theme-surface-alt,var(--canvas)); color:var(--theme-text,var(--ink)); font-size:11px; max-width:100%; }
.chat-workspace .chat-attachment .chat-attachment-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:28ch; }
.chat-workspace .chat-attachment button { border:0; background:none; color:inherit; cursor:pointer; padding:0 4px; }
@media (max-width:980px) {
  .chat-workspace, .chat-workspace.history-collapsed { grid-template-columns:minmax(0,1fr); }
  .chat-workspace.history-collapsed .chat-history-panel { display:flex; }
  .chat-workspace .chat-history-panel { max-height:none; }
}
@media (max-width:600px) {
  .chat-workspace .chat-composer-bottom { align-items:stretch; flex-direction:column; }
  .chat-workspace .chat-composer-bottom > button { align-self:flex-end; }
  .chat-workspace .chat-turn .chat-bubble { max-width:100%; }
  .chat-workspace .chat-composer-shortcut { display:none; }
}

/* Compact the global navigation while reading conversations. Other workspaces
   keep their full navigation; the two chat toggles remain independent. */
.chat-workspace .chat-nav-toggle { display:grid; width:36px; height:36px; flex:0 0 36px; color:var(--theme-text,var(--ink)); }
.chat-workspace .chat-layout > .chat-toolbar { min-width:0; flex-wrap:wrap; }
.chat-workspace .chat-composer-shortcut { overflow-wrap:anywhere; }
@media (min-width:801px) {
  .console-shell.chat-nav-compact[data-active-view="chat"] > .console-sidebar {
    width:72px; flex-basis:72px; overflow-x:hidden;
  }
  .console-shell.chat-nav-compact[data-active-view="chat"] .console-sidebar .brand-block {
    padding:14px 9px; min-height:70px; justify-content:center;
  }
  .console-shell.chat-nav-compact[data-active-view="chat"] .console-sidebar .brand-block > div:not(.brand-symbol),
  .console-shell.chat-nav-compact[data-active-view="chat"] .console-sidebar .sidebar-label,
  .console-shell.chat-nav-compact[data-active-view="chat"] .console-sidebar .node-mark #sidebarNodeState,
  .console-shell.chat-nav-compact[data-active-view="chat"] .console-sidebar .node-version { display:none; }
  .console-shell.chat-nav-compact[data-active-view="chat"] .console-sidebar .brand-symbol { flex:none; }
  .console-shell.chat-nav-compact[data-active-view="chat"] .console-sidebar .main-nav { padding-inline:6px; }
  .console-shell.chat-nav-compact[data-active-view="chat"] .console-sidebar .nav-link {
    font-size:0; gap:0; padding:11px 6px; justify-content:center;
  }
  .console-shell.chat-nav-compact[data-active-view="chat"] .console-sidebar .nav-link .nav-icon {
    width:25px; font-size:20px;
  }
  .console-shell.chat-nav-compact[data-active-view="chat"] .console-sidebar .sidebar-tools > summary { font-size:0; text-align:center; }
  .console-shell.chat-nav-compact[data-active-view="chat"] .console-sidebar .sidebar-tools > summary::after { content:"···"; font-size:18px; }
  .console-shell.chat-nav-compact[data-active-view="chat"] .console-sidebar .node-mark { justify-content:center; padding-inline:0; }
}
@media (max-width:800px) {
  .chat-workspace .chat-nav-toggle { display:none; }
}
@media (max-width:600px) {
  .chat-workspace .chat-composer-shell { border-radius:12px; }
  .chat-workspace .chat-composer-tools { flex-wrap:wrap; }
  .chat-workspace .chat-composer-bottom { gap:10px; }
}

/* Dashboard-flush conversation layout.
   The global navbar owns the header; the conversation workspace starts directly
   under it with no nested card frames. History and messages scroll separately. */
#ecaiConsole[data-active-view="chat"] .console-main {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  height: calc(100dvh - 73px);
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
#ecaiConsole[data-active-view="chat"] [data-panel="chat"].is-visible {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
/* Keep the labeled heading accessible but do not spend a second row on a
   title already conveyed by the breadcrumb and conversation toolbar. */
#ecaiConsole[data-active-view="chat"] [data-panel="chat"] > .page-intro {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  white-space: nowrap;
  clip-path: inset(50%);
  border: 0;
}
#ecaiConsole[data-active-view="chat"] .chat-workspace {
  flex: 1 1 0%;
  display: grid;
  grid-template-columns: minmax(260px, 292px) minmax(0, 1fr);
  gap: 0;
  width: 100%;
  max-width: none;
  min-height: 0;
  overflow: hidden;
  margin: 0;
  background: var(--theme-surface, var(--paper));
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
#ecaiConsole[data-active-view="chat"] .chat-workspace.history-collapsed {
  grid-template-columns: minmax(0, 1fr);
}
#ecaiConsole[data-active-view="chat"] .chat-workspace.history-collapsed .chat-history-panel {
  display: none;
}
#ecaiConsole[data-active-view="chat"] .chat-workspace .chat-history-panel.surface {
  min-width: 0;
  min-height: 0;
  max-height: none;
  overflow: hidden;
  padding: 12px;
  border: 0;
  border-right: 1px solid var(--theme-border, var(--line));
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
#ecaiConsole[data-active-view="chat"] .chat-workspace .chat-layout.surface {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
#ecaiConsole[data-active-view="chat"] .chat-workspace .chat-toolbar {
  flex: 0 0 auto;
  gap: 11px;
  padding: 10px 15px;
}
#ecaiConsole[data-active-view="chat"] .chat-workspace .chat-personality-bar {
  flex: 0 0 auto;
  gap: 7px 10px;
  padding: 9px 15px;
  background: transparent;
}
#ecaiConsole[data-active-view="chat"] .chat-workspace .chat-personality-status {
  line-height: 1.35;
}
#ecaiConsole[data-active-view="chat"] .chat-workspace .chat-messages {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 17px clamp(16px, 2.2vw, 30px);
  background: transparent;
}
#ecaiConsole[data-active-view="chat"] .chat-workspace .chat-composer {
  flex: 0 0 auto;
  min-width: 0;
  padding: 11px clamp(12px, 2vw, 22px) 7px;
  border-top: 1px solid var(--theme-border, var(--line));
  background: transparent;
}
#ecaiConsole[data-active-view="chat"] .chat-workspace .chat-composer-shell {
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}
#ecaiConsole[data-active-view="chat"] .chat-workspace .chat-composer-shell:focus-within {
  outline: none;
}
#ecaiConsole[data-active-view="chat"] .chat-workspace .chat-composer textarea {
  display: block;
  width: 100%;
  min-height: 64px;
  max-height: min(170px, 24dvh);
  padding: 12px 14px;
  border: 1px solid var(--theme-control-border, var(--line));
  border-radius: 12px;
  color: var(--theme-text, var(--ink));
  background: var(--theme-surface-alt, var(--surface-2));
}
#ecaiConsole[data-active-view="chat"] .chat-workspace .chat-composer textarea:focus-visible {
  outline: 2px solid var(--theme-focus, var(--focus));
  outline-offset: 1px;
}
#ecaiConsole[data-active-view="chat"] .chat-workspace .chat-composer-bottom {
  padding: 9px 0 1px;
}
#ecaiConsole[data-active-view="chat"] .chat-workspace .chat-attachment-list {
  max-height: 82px;
  overflow-y: auto;
  padding: 0 0 8px;
}
#ecaiConsole[data-active-view="chat"] .chat-workspace .chat-layout > .form-meta {
  flex: 0 0 auto;
  gap: 8px;
  flex-wrap: wrap;
  padding: 1px clamp(12px, 2vw, 22px) 10px;
}
@media (max-width: 980px) {
  #ecaiConsole[data-active-view="chat"] .chat-workspace,
  #ecaiConsole[data-active-view="chat"] .chat-workspace.history-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }
  #ecaiConsole[data-active-view="chat"] .chat-workspace.history-collapsed .chat-history-panel {
    display: flex;
  }
  /* History becomes an independently toggled drawer on narrow screens. */
  #ecaiConsole[data-active-view="chat"] .chat-workspace .chat-history-panel.surface {
    max-height: none;
    padding: 12px;
    border: 1px solid var(--theme-border, var(--line));
    border-radius: 13px;
    background: var(--theme-surface, var(--paper));
    box-shadow: 0 18px 45px var(--theme-shadow, rgba(0, 0, 0, .16));
  }
}
@media (max-width: 800px) {
  #ecaiConsole[data-active-view="chat"] .console-main {
    height: calc(100dvh - 62px);
    padding: 0;
  }
}
@media (max-height: 600px) {
  /* Very short viewports scroll the page instead of clipping the composer. */
  #ecaiConsole[data-active-view="chat"] .console-main {
    height: auto;
    min-height: calc(100dvh - 73px);
    overflow: visible;
  }
  #ecaiConsole[data-active-view="chat"] .chat-workspace { flex: none; min-height: 380px; }
  #ecaiConsole[data-active-view="chat"] .chat-workspace .chat-layout.surface {
    min-height: 380px;
  }
}
@media (max-width: 800px) and (max-height: 600px) {
  #ecaiConsole[data-active-view="chat"] .console-main {
    min-height: calc(100dvh - 62px);
  }
}
@media (max-width: 600px) {
  #ecaiConsole[data-active-view="chat"] .chat-workspace .chat-toolbar {
    gap: 7px;
    padding: 8px 11px;
  }
  #ecaiConsole[data-active-view="chat"] .chat-workspace .chat-personality-bar {
    padding: 7px 11px;
  }
  #ecaiConsole[data-active-view="chat"] .chat-workspace .chat-composer {
    padding: 9px 10px 6px;
  }
  #ecaiConsole[data-active-view="chat"] .chat-workspace .chat-composer textarea {
    min-height: 56px;
    max-height: min(140px, 21dvh);
  }
  #ecaiConsole[data-active-view="chat"] .chat-workspace .chat-composer-bottom {
    flex-direction: row;
    align-items: center;
    padding-top: 7px;
  }
  #ecaiConsole[data-active-view="chat"] .chat-workspace .chat-composer-bottom > button {
    align-self: center;
    flex: 0 0 auto;
  }
  #ecaiConsole[data-active-view="chat"] .chat-workspace .chat-layout > .form-meta {
    padding: 0 10px 8px;
  }
}

/* Distinguish conversation history from the active thread in the flush view.
   Mobile history is a drawer and retains its own border. */
@media (min-width: 981px) {
  #ecaiConsole[data-active-view="chat"] .chat-workspace .chat-layout.surface {
    border-left: 2px solid color-mix(in srgb, var(--theme-accent, #9bd46c) 24%, var(--theme-border, #45546d));
    box-shadow: -9px 0 20px -19px var(--theme-text, #dce6fa);
  }
  #ecaiConsole[data-active-view="chat"] .chat-workspace .chat-history-panel.surface {
    border-right: 0;
  }
}
