:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #c9d1d9;
  background: #1f2229;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}

:root {
  --cc-bg: #151821;
  --cc-panel: #1e2330;
  --cc-panel-2: #252a39;
  --cc-line: #31384a;
  --cc-line-soft: #2a3243;
  --cc-text: #d9e1ed;
  --cc-text-dim: #a7b2c5;
  --cc-success: #3ecf8a;
  --cc-warn: #f8c255;
  --cc-primary: #5f65ff;
  --cc-primary-weak: #8a8dff;
  --cc-card: #252c3a;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #3a404d;
  border-radius: 4px;
  padding: 7px 8px;
  color: #dfe5ed;
  background: #171a21;
  outline: none;
}

textarea:focus,
input:focus,
select:focus {
  border-color: #a66cff;
  box-shadow: 0 0 0 2px rgba(166, 108, 255, 0.22);
}

pre {
  margin: 0;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.ide-shell {
  height: 100vh;
  min-height: 620px;
  display: grid;
  grid-template-rows: 38px minmax(0, 1fr) 24px;
  background: #1f2229;
}

.ide-titlebar {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 0 10px;
  border-bottom: 1px solid #333844;
  color: #e3e8ef;
  background: #252934;
}

.ide-header,
.ide-titlebar {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 0 10px;
  border-bottom: 1px solid #333844;
  color: #e3e8ef;
  background: #252934;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-lockup strong {
  display: block;
  font-size: 14px;
}

.brand-lockup p,
.brand-lockup span {
  margin: 0;
  color: #9da7b4;
  font-size: 11px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.project-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.header-actions,
.titlebar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.header-actions button,
.project-topbar-actions button,
.titlebar-actions button {
  min-height: 28px;
  border: 1px solid #3a404d;
  border-radius: 4px;
  padding: 0 9px;
  color: #d6dce5;
  background: #2b303c;
  font-size: 12px;
}

.user-pill {
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 10px;
  border: 1px solid #3a404d;
  color: #c5cfdd;
  background: #1f242f;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.project-mark {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: #ffffff;
  background: #fc6d26;
  font-weight: 700;
  font-size: 11px;
}

.project-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.project-meta strong {
  font-size: 13px;
}

.project-meta span {
  min-width: 0;
  overflow: hidden;
  color: #9da7b4;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-select {
  width: auto;
  max-width: 260px;
  min-height: 26px;
  padding: 3px 7px;
  color: #dfe5ed;
  background: #1b1e26;
  font-size: 12px;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #dfe5ed;
  background: #1f2229;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--cc-bg);
}

.auth-loading.card {
  width: min(460px, 100%);
  background: var(--cc-panel);
  border: 1px solid var(--cc-line);
  border-radius: 12px;
  padding: 24px;
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
}

.auth-layout {
  width: min(1020px, calc(100vw - 22px));
  min-height: min(620px, 94vh);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  border: 1px solid var(--cc-line);
  background: var(--cc-panel);
  border-radius: 14px;
  overflow: hidden;
}

.auth-brief {
  background: linear-gradient(145deg, #0d1320, #1d2434);
  padding: 34px;
  display: grid;
  gap: 14px;
  align-content: start;
  border-right: 1px solid var(--cc-line);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(130deg, #4e54d6, #3a87ff);
  font-weight: 700;
}

.auth-brand strong {
  color: #f4f8ff;
}

.auth-brand span {
  color: #aeb6c5;
  font-size: 12px;
}

.auth-brief h1 {
  margin: 8px 0 0;
  color: #f5f8ff;
  font-size: clamp(2rem, 4vw, 2.45rem);
  line-height: 1.05;
}

.auth-brief p {
  margin: 0;
  color: #aab3c5;
  line-height: 1.5;
  max-width: 48ch;
}

.auth-highlights {
  display: grid;
  gap: 8px;
  margin-top: 2px;
}

.auth-highlight {
  display: inline-grid;
  grid-template-columns: 1fr;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 8px 10px;
  width: fit-content;
  min-width: 190px;
}

.auth-highlight strong {
  color: #fff;
  font-size: 14px;
}

.auth-highlight span {
  color: #a8b2c3;
  font-size: 12px;
}

.auth-note {
  margin-top: auto;
  color: #9aa4b7;
  font-size: 12px;
  line-height: 1.4;
}

.auth-form-wrap {
  padding: 34px;
  display: grid;
  align-content: center;
}

.auth-card {
  width: min(420px, 100%);
  display: grid;
  gap: 12px;
  border: 1px solid #333844;
  border-radius: 8px;
  padding: 22px;
  background: #252934;
}

.auth-form-wrap h2,
.auth-form-wrap .auth-card p {
  margin: 0;
}

.auth-card h2 {
  color: #ecf1fa;
  margin-bottom: 6px;
  font-size: 1.45rem;
}

.auth-card p {
  color: #95a0b1;
  font-size: 13px;
}

.auth-support {
  font-size: 12px;
  color: #8e9aac;
  text-align: center;
}

.project-mark.large {
  width: 40px;
  height: 40px;
}

.auth-card h1 {
  margin: 0;
  font-size: 22px;
}

.auth-card p {
  margin: 0 0 4px;
  color: #9da7b4;
  line-height: 1.5;
}

.auth-card label {
  display: grid;
  gap: 6px;
  color: #b7c0cc;
  font-size: 12px;
}

.auth-error {
  border: 1px solid #7b3329;
  border-radius: 4px;
  padding: 8px 9px;
  color: #ffd2c8;
  background: #3b1d1a;
  font-size: 12px;
}

.project-screen {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 46px minmax(0, 1fr);
  color: #dfe5ed;
  background: #1f2229;
}

.project-topbar {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-bottom: 1px solid #333844;
  background: #252934;
}

.project-topbar strong {
  display: block;
  font-size: 13px;
}

.project-topbar span {
  min-width: 0;
  overflow: hidden;
  color: #9da7b4;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--cc-line);
}

.project-search-wrap {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 6px;
  color: #99a4b6;
  font-size: 12px;
}

.project-search-wrap input {
  background: #171b24;
  border-color: #343e54;
}

.project-search-wrap span {
  font-size: 11px;
  color: #9aa5b8;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.project-view-switch {
  display: inline-flex;
  border: 1px solid #343e54;
  border-radius: 8px;
  overflow: hidden;
}

.project-view-switch button {
  border: 0;
  min-width: 66px;
  padding: 7px 10px;
  background: #222b3b;
  color: #b5bfcd;
  cursor: pointer;
}

.project-view-switch button.active {
  background: #2d3850;
  color: #ffffff;
}

.project-row {
  text-align: left;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--cc-line);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  color: #cad5e6;
  background: var(--cc-card);
}

.project-row-title {
  font-weight: 600;
  color: #eef2f8;
  font-size: 13px;
}

.project-row-meta {
  min-width: 0;
  display: grid;
  gap: 2px;
  justify-items: start;
  color: #9aa7b9;
  font-size: 11px;
}

.project-row-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 32ch;
}

.project-row.selected {
  border-color: #5b62ff;
  box-shadow: 0 0 0 1px rgba(95, 101, 255, 0.4);
}

.project-topbar-actions button,
.project-list-header button {
  min-height: 28px;
  border: 1px solid #3a404d;
  border-radius: 4px;
  padding: 0 9px;
  color: #d6dce5;
  background: #2b303c;
  font-size: 12px;
}

.project-select-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 0;
}

.project-list-panel,
.project-create-panel {
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.project-list-panel {
  border-right: 1px solid #333844;
}

.project-list-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid #333844;
}

.project-list-header h1,
.project-create-panel h2,
.runtime-panel h2 {
  margin: 0;
  color: #e3e8ef;
  font-size: 16px;
}

.project-list-header p {
  margin: 4px 0 0;
  color: #9da7b4;
  font-size: 12px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  padding: 16px;
}

.project-list {
  display: grid;
  padding: 16px;
  gap: 8px;
}

.project-card {
  min-width: 0;
  display: grid;
  grid-template-rows: minmax(54px, auto) auto auto;
  gap: 12px;
  border: 1px solid #333844;
  border-radius: 6px;
  padding: 14px;
  background: #252934;
}

.project-card.selected {
  border-color: #fc6d26;
}

.project-card h2 {
  margin: 0 0 4px;
  color: #ffffff;
  font-size: 15px;
}

.project-card span {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #9da7b4;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-card-meta small,
.runtime-chip {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #3a404d;
  border-radius: 999px;
  padding: 0 8px;
  color: #d6dce5;
  background: #1b1e26;
  font-size: 11px;
}

.runtime-chip.ok,
.runtime-summary .ok {
  color: #c8f6dd;
  border-color: #2d6848;
  background: #193426;
}

.status-chip {
  min-height: 22px;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  border: 1px solid #495066;
  border-radius: 999px;
  padding: 0 8px;
  color: #d6dce5;
  background: #1e2430;
  font-size: 11px;
}

.status-chip.ok {
  color: #b4f7da;
  border-color: #245e45;
  background: #17362c;
}

.status-chip.warn {
  color: #f7dfa6;
  border-color: #705b19;
  background: #2f2812;
}

.runtime-chip.warn,
.runtime-summary .warn {
  color: #ffe9a3;
  border-color: #7b6429;
  background: #302a18;
}

.project-create-panel {
  display: grid;
  align-content: start;
  gap: 0;
  background: #222631;
}

.project-create-panel form,
.runtime-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid #333844;
}

.project-create-panel label {
  display: grid;
  gap: 6px;
  color: #b7c0cc;
  font-size: 12px;
}

.runtime-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #9da7b4;
  font-size: 12px;
}

.runtime-row strong {
  color: #dfe5ed;
}

.project-error {
  grid-column: 1 / -1;
  border: 1px solid #7b3329;
  border-radius: 4px;
  padding: 8px 9px;
  color: #ffd2c8;
  background: #3b1d1a;
  font-size: 12px;
}

.menubar {
  display: flex;
  align-items: center;
  gap: 2px;
}

.menubar button,
.titlebar-actions button {
  min-height: 28px;
  border-radius: 4px;
  padding: 0 9px;
  color: #c9d1d9;
  font-size: 12px;
}

.menubar button:hover,
.titlebar-actions button:hover {
  background: #343946;
}

.titlebar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.connection {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #3a404d;
  border-radius: 4px;
  padding: 0 8px;
  font-size: 12px;
}

.connection.ok {
  color: #c8f6dd;
  border-color: #2d6848;
  background: #193426;
}

.connection.bad {
  color: #ffd2c8;
  border-color: #7b3329;
  background: #3b1d1a;
}

.titlebar-actions .runtime-chip,
.statusbar .runtime-chip {
  white-space: nowrap;
}

.ide-body {
  min-height: 0;
  display: grid;
  grid-template-columns: 48px minmax(250px, 320px) minmax(0, 1fr);
}

.activitybar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border-right: 1px solid #333844;
  background: #1b1e26;
}

.activity-button {
  position: relative;
  height: 52px;
  display: grid;
  place-items: center;
  border-left: 3px solid transparent;
  color: #8f9aaa;
  font-size: 10px;
  font-weight: 700;
}

.activity-button:hover,
.activity-button.active {
  color: #ffffff;
  background: #252934;
}

.activity-button.active {
  border-left-color: #fc6d26;
}

.activity-button small {
  position: absolute;
  top: 6px;
  right: 5px;
  min-width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: #db3b21;
  font-size: 10px;
}

.sidebar {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #333844;
  background: #222631;
}

.side-header {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
  border-bottom: 1px solid #333844;
}

.side-header h2 {
  margin: 0;
  color: #e3e8ef;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.side-header button,
.path-tools button,
.run-card button {
  min-height: 28px;
  border: 1px solid #3a404d;
  border-radius: 4px;
  padding: 0 8px;
  color: #d6dce5;
  background: #2b303c;
  font-size: 12px;
}

.side-header button:hover,
.path-tools button:hover,
.run-card button:hover {
  background: #363c49;
}

.workspace-title {
  padding: 10px 12px 6px;
  color: #dfe5ed;
  font-size: 12px;
  font-weight: 700;
}

.path-tools {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 6px 10px 8px;
}

.path-tools span {
  min-width: 0;
  overflow: hidden;
  color: #9da7b4;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-list,
.change-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 4px 6px 10px;
}

.file-row,
.change-row {
  width: 100%;
  min-height: 28px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  border-radius: 4px;
  padding: 4px 6px;
  color: #d6dce5;
  text-align: left;
}

.change-row {
  grid-template-columns: auto minmax(0, 1fr);
}

.file-row:hover,
.file-row.selected,
.change-row:hover {
  background: #303644;
}

.file-icon {
  color: #9da7b4;
  font-size: 11px;
}

.file-row span:nth-child(2),
.change-row span:nth-child(2) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-row small {
  color: #7f8998;
  font-size: 11px;
}

.workbench {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 36px 32px minmax(0, 1fr) 260px;
  background: #1f2229;
}

.ide-stage {
  min-height: 0;
  display: grid;
  grid-template-columns: 48px minmax(250px, 320px) minmax(0, 1fr);
}

.tabs {
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  border-bottom: 1px solid #333844;
  background: #252934;
}

.workspace-tabs {
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  border-bottom: 1px solid #333844;
  background: #252934;
}

.tab {
  min-width: 128px;
  max-width: 240px;
  display: flex;
  align-items: center;
  border-right: 1px solid #333844;
  padding: 0 12px;
  color: #aeb7c5;
  font-size: 12px;
  text-align: left;
}

.tab.active {
  color: #ffffff;
  background: #1f2229;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 0 12px;
  border-bottom: 1px solid #333844;
  color: #9da7b4;
  background: #1f2229;
  font-size: 12px;
}

.breadcrumbs strong {
  color: #dfe5ed;
}

.dirty-dot {
  border: 1px solid #8c6d1f;
  border-radius: 999px;
  padding: 2px 7px;
  color: #ffe9a3;
  background: #302a18;
  font-size: 11px;
}

.editor-area {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-toolbar {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  border-bottom: 1px solid #333844;
  background: #1f2229;
}

.editor-toolbar strong {
  display: block;
  color: #e3e8ef;
  font-size: 13px;
}

.editor-toolbar span {
  color: #8f9aaa;
  font-size: 12px;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
}

.toolbar-actions button,
.primary {
  min-height: 30px;
  border: 1px solid #3a404d;
  border-radius: 4px;
  padding: 0 10px;
  color: #dfe5ed;
  background: #2b303c;
  font-size: 12px;
}

.toolbar-actions button:hover {
  background: #363c49;
}

.primary {
  border-color: #7b4ee2;
  color: #ffffff;
  background: #6f42c1;
}

.primary:hover {
  background: #7b4ee2;
}

.notice {
  margin: 10px 12px 0;
  border: 1px solid #3b5563;
  border-radius: 4px;
  padding: 8px 9px;
  color: #c8eef8;
  background: #1b3139;
  font-size: 12px;
}

.notice.compact {
  margin: 0 12px 8px;
}

.editor {
  flex: 1;
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 14px 16px;
  resize: none;
  color: #dfe5ed;
  background: #1f2229;
  box-shadow: none;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.58;
}

.welcome-pane {
  max-width: 680px;
  margin: 72px auto 0;
  padding: 0 28px;
}

.welcome-pane h2 {
  margin: 0 0 10px;
  color: #e3e8ef;
  font-size: 20px;
}

.welcome-pane p {
  margin: 0 0 18px;
  color: #9da7b4;
  line-height: 1.55;
}

.welcome-pane button {
  min-height: 34px;
  border: 1px solid #3a404d;
  border-radius: 4px;
  padding: 0 12px;
  color: #ffffff;
  background: #2b303c;
}

.runtime-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.runtime-summary span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #3a404d;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
}

.bottom-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: 34px minmax(0, 1fr);
  border-top: 1px solid #333844;
  background: #1b1e26;
}

.bottom-tabs {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid #333844;
}

.bottom-tabs button {
  min-width: 98px;
  padding: 0 12px;
  color: #9da7b4;
  border-right: 1px solid #333844;
  font-size: 12px;
  text-align: left;
}

.bottom-tabs button.active {
  color: #ffffff;
  background: #252934;
}

.terminal-form {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #333844;
}

.command-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.terminal-output {
  height: 100%;
  overflow: auto;
  padding: 10px 12px;
  color: #d8edf0;
  background: #10141a;
}

.model-panel,
.problems-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.model-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px 12px;
}

.model-output {
  overflow: auto;
  padding: 10px 12px;
  color: #d6dce5;
  background: #171a21;
}

.empty-panel {
  padding: 14px 12px;
  color: #9da7b4;
  font-size: 12px;
}

.scm-summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #333844;
  font-size: 12px;
}

.scm-summary strong {
  min-width: 0;
  overflow: hidden;
  color: #dfe5ed;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scm-summary span {
  color: #9da7b4;
}

.commit-box,
.settings-stack label {
  display: grid;
  gap: 6px;
  color: #9da7b4;
  font-size: 12px;
}

.commit-box {
  padding: 10px 12px;
  border-bottom: 1px solid #333844;
}

.scm-section-title {
  padding: 9px 12px 4px;
  color: #dfe5ed;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.change-badge {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  color: #ffffff;
  background: #6f42c1;
  font-size: 11px;
  font-weight: 700;
}

.run-card,
.settings-stack,
.member-form {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid #333844;
}

.members-list,
.resource-list {
  display: grid;
  gap: 4px;
  padding: 6px;
  border-bottom: 1px solid #333844;
}

.member-row,
.resource-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 8px;
  border-radius: 4px;
  padding: 7px 8px;
  background: #1f2229;
}

.member-row strong,
.resource-row strong {
  min-width: 0;
  overflow: hidden;
  color: #dfe5ed;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-row span,
.resource-row span {
  min-width: 0;
  overflow: hidden;
  color: #9da7b4;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-row small,
.resource-row small {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  border: 1px solid #3a404d;
  border-radius: 999px;
  padding: 2px 7px;
  color: #d6dce5;
  font-size: 11px;
}

.resource-metrics {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.resource-metrics span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  border: 1px solid #343b47;
  border-radius: 5px;
  padding: 2px 6px;
  color: #9da7b4;
  background: #171a21;
  font-size: 10.5px;
}

.resource-metrics code {
  overflow: hidden;
  color: #dfe5ed;
  font-family: var(--cc-font-mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.run-card strong {
  color: #dfe5ed;
  font-size: 13px;
}

.run-card p {
  margin: 0;
  color: #9da7b4;
  font-size: 12px;
  line-height: 1.45;
}

.statusbar {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px;
  color: #ffffff;
  background: #6f42c1;
  font-size: 12px;
}

.statusbar button {
  min-height: 22px;
  padding: 0 4px;
  color: #ffffff;
  font-size: 12px;
}

.statusbar button:hover {
  background: rgba(255, 255, 255, 0.13);
}

.statusbar span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-spacer {
  flex: 1;
}

@media (max-width: 1040px) {
  .auth-layout {
    width: min(1020px, 100%);
    margin: 0 12px;
    grid-template-columns: 1fr;
  }

  .auth-brief,
  .auth-form-wrap {
    padding: 24px;
  }

  .ide-stage,
  .ide-body {
    grid-template-columns: 48px minmax(220px, 290px) minmax(0, 1fr);
  }

  .menubar {
    display: none;
  }

  .project-select-layout {
    grid-template-columns: 1fr;
  }

  .project-list-panel {
    border-right: 0;
  }
}

@media (max-width: 760px) {
  .ide-header,
  .ide-titlebar {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .titlebar-actions .connection {
    display: none;
  }

  .titlebar-actions .runtime-chip {
    display: none;
  }

  .project-topbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .project-topbar-actions {
    grid-column: 1 / -1;
    padding-bottom: 8px;
  }

  .project-grid {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .ide-body {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .ide-stage {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .sidebar {
    display: none;
  }

  .auth-brief {
    display: none;
  }

  .workbench {
    grid-template-rows: 36px 32px minmax(0, 1fr) 300px;
  }

  .terminal-form,
  .model-form {
    grid-template-columns: 1fr;
  }
}

/* Handoff visual-system alignment: light app chrome, dark workspace. */
:root {
  color-scheme: light dark;
  --cc-canvas: #f6f8fb;
  --cc-surface: #ffffff;
  --cc-surface-raised: #fbfcfe;
  --cc-soft: #f0f3f8;
  --cc-line: #dce2ea;
  --cc-line-soft: #edf0f5;
  --cc-ink: #111827;
  --cc-text: #263244;
  --cc-text-dim: #647084;
  --cc-text-faint: #8b96a8;
  --cc-brand: #f38020;
  --cc-brand-2: #f9ab00;
  --cc-primary: #2563eb;
  --cc-primary-strong: #1d4ed8;
  --cc-primary-soft: #e8f0ff;
  --cc-primary-line: #c8d9ff;
  --cc-success: #1f8a5b;
  --cc-success-soft: #e7f6ed;
  --cc-success-line: #b8dfc6;
  --cc-warn: #b7791f;
  --cc-warn-soft: #fff7df;
  --cc-danger: #b42318;
  --cc-danger-soft: #fff1ef;
  --cc-dark: #0d1426;
  --cc-dark-2: #101827;
  --cc-dark-3: #151f33;
  --cc-dark-line: #24314d;
  --cc-dark-line-soft: rgba(255, 255, 255, 0.07);
  --cc-dark-text: #d6deec;
  --cc-dark-dim: #8f9db5;
  --cc-card: #ffffff;
  --cc-radius-sm: 6px;
  --cc-radius: 8px;
  --cc-radius-lg: 14px;
  --cc-shadow: 0 18px 46px rgba(15, 23, 42, 0.08);
  --cc-shadow-soft: 0 10px 28px rgba(15, 23, 42, 0.06);
  color: var(--cc-text);
  background: var(--cc-canvas);
}

body {
  color: var(--cc-text);
  background: var(--cc-canvas);
}

input,
textarea,
select {
  border-color: var(--cc-line);
  border-radius: var(--cc-radius);
  color: var(--cc-ink);
  background: var(--cc-surface);
}

textarea:focus,
input:focus,
select:focus {
  border-color: var(--cc-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.primary,
.btn-primary,
.ide-btn.primary,
.ai-send {
  border-color: var(--cc-primary);
  color: #ffffff;
  background: var(--cc-primary);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.18);
}

.primary:hover,
.btn-primary:hover,
.ide-btn.primary:hover,
.ai-send:hover {
  border-color: var(--cc-primary-strong);
  background: var(--cc-primary-strong);
}

.brand-mark,
.project-mark,
.eb-mark,
.ai-mark,
.ai-head .ai-mark {
  color: #ffffff;
  background: linear-gradient(135deg, var(--cc-brand), var(--cc-brand-2));
  box-shadow: 0 6px 16px rgba(243, 128, 32, 0.22);
}

.eb-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  flex: 0 0 auto;
  font-weight: 800;
}

.eb-mark.sm {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.eb-mark.lg {
  width: 44px;
  height: 44px;
  border-radius: 13px;
}

.eb-lockup {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.eb-lockup .text,
.eb-lockup > div:not(.eb-mark) {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.eb-lockup strong {
  color: var(--cc-ink);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.eb-lockup span {
  color: var(--cc-text-dim);
  font-size: 12px;
  white-space: nowrap;
}

.auth-screen,
.auth-shell {
  color: var(--cc-text);
  background:
    radial-gradient(circle at 12% 12%, rgba(243, 128, 32, 0.12), transparent 25rem),
    radial-gradient(circle at 88% 12%, rgba(37, 99, 235, 0.09), transparent 25rem),
    var(--cc-canvas);
}

.auth-layout {
  border-color: var(--cc-line);
  border-radius: var(--cc-radius-lg);
  background: var(--cc-surface);
  box-shadow: var(--cc-shadow);
}

.auth-brief {
  border-right-color: var(--cc-line);
  background:
    radial-gradient(circle at 100% 0, rgba(243, 128, 32, 0.18), transparent 28rem),
    linear-gradient(140deg, #ffffff, #f7f9fc);
}

.auth-brand strong,
.auth-brief h1,
.auth-card h1,
.auth-card h2 {
  color: var(--cc-ink);
}

.auth-brand span,
.auth-brief p,
.auth-note,
.auth-card p,
.auth-support,
.auth-card label {
  color: var(--cc-text-dim);
}

.auth-highlight {
  border-color: var(--cc-line);
  color: var(--cc-text);
  background: var(--cc-surface);
  box-shadow: var(--cc-shadow-soft);
}

.auth-highlight strong {
  color: var(--cc-ink);
}

.auth-highlight span {
  color: var(--cc-text-dim);
}

.auth-card,
.auth-loading.card {
  border-color: var(--cc-line);
  border-radius: var(--cc-radius-lg);
  background: var(--cc-surface);
  box-shadow: var(--cc-shadow-soft);
}

.auth-error,
.project-error {
  border-color: #fecaca;
  color: var(--cc-danger);
  background: var(--cc-danger-soft);
}

.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  color: var(--cc-text);
  background: var(--cc-surface);
}

.login-aside {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 28px;
  border-right: 1px solid var(--cc-line);
  padding: 52px 60px;
}

.login-aside.warm {
  background:
    radial-gradient(circle at 100% 0, rgba(243, 128, 32, 0.16), transparent 30rem),
    radial-gradient(circle at 0 100%, rgba(37, 99, 235, 0.07), transparent 26rem),
    linear-gradient(135deg, #ffffff, #f7f9fc);
}

.login-pitch {
  max-width: 30rem;
  display: grid;
  align-content: center;
  gap: 22px;
}

.login-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #c45f00;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.login-pitch h1 {
  margin: 0;
  color: var(--cc-ink);
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 700;
  line-height: 1.02;
}

.login-pitch .lede {
  max-width: 44ch;
  margin: 0;
  color: var(--cc-text-dim);
  font-size: 16px;
  line-height: 1.55;
}

.proof-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.proof {
  min-width: 120px;
  display: grid;
  gap: 2px;
  border: 1px solid var(--cc-line);
  border-radius: 12px;
  padding: 11px 14px;
  background: var(--cc-surface);
}

.proof .pv {
  color: var(--cc-ink);
  font-size: 19px;
  font-weight: 700;
}

.proof .pl {
  color: var(--cc-text-dim);
  font-size: 12px;
}

.login-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--cc-text-faint);
  font-size: 13px;
}

.login-foot .status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.login-foot .live-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--cc-success);
  box-shadow: 0 0 0 3px rgba(31, 138, 91, 0.16);
}

.login-foot code {
  border: 1px solid var(--cc-line);
  border-radius: 5px;
  padding: 2px 7px;
  color: var(--cc-text);
  background: var(--cc-surface);
}

.login-side {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 392px);
  display: grid;
  gap: 20px;
}

.login-card h2 {
  margin: 0;
  color: var(--cc-ink);
  font-size: 23px;
}

.login-card .sub {
  margin: 6px 0 0;
  color: var(--cc-text-dim);
  font-size: 14px;
  line-height: 1.5;
}

.form {
  display: grid;
  gap: 13px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--cc-text);
  font-size: 13px;
  font-weight: 650;
}

.field input {
  min-height: 42px;
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--cc-surface);
}

.btn-primary.block {
  width: 100%;
  min-height: 42px;
}

.login-legal {
  margin: 0;
  color: var(--cc-text-faint);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.bs-spin {
  width: 12px;
  height: 12px;
  display: block;
  border: 2px solid rgba(37, 99, 235, 0.2);
  border-top-color: var(--cc-primary);
  border-radius: 999px;
  animation: cc-spin 700ms linear infinite;
}

@keyframes cc-spin {
  to {
    transform: rotate(360deg);
  }
}

.project-screen {
  color: var(--cc-text);
  background: var(--cc-canvas);
}

.utility-bar {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--cc-line);
  padding: 0 28px;
  background: var(--cc-surface);
}

.utility-bar .ub-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tenant-chip {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--cc-line);
  border-radius: var(--cc-radius);
  padding: 6px 11px;
  color: var(--cc-ink);
  background: var(--cc-surface-raised);
  font-size: 13px;
  font-weight: 600;
}

.tenant-chip .dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--cc-success);
}

.avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--cc-primary), var(--cc-primary-strong));
  font-size: 12px;
  font-weight: 800;
}

.projects-scroll {
  height: calc(100vh - 60px);
  overflow: auto;
}

.projects-wrap {
  width: min(1120px, 100%);
  display: grid;
  gap: 22px;
  margin: 0 auto;
  padding: 36px 28px 64px;
}

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

.projects-head h1 {
  margin: 0;
  color: var(--cc-ink);
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1;
}

.projects-head p {
  max-width: 68ch;
  margin: 8px 0 0;
  color: var(--cc-text-dim);
  line-height: 1.5;
}

.btn,
.btn-primary,
.btn-ghost-dark,
.btn-resume,
.card-open {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--cc-line);
  border-radius: var(--cc-radius);
  padding: 7px 12px;
  color: var(--cc-text);
  background: var(--cc-surface);
  font-size: 13px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}

.btn-primary,
.btn.btn-primary,
.btn-resume,
.card-open {
  border-color: var(--cc-primary);
  color: #ffffff;
  background: var(--cc-primary);
  box-shadow: 0 7px 18px rgba(37, 99, 235, 0.18);
}

.btn-primary:hover,
.btn.btn-primary:hover,
.btn-resume:hover,
.card-open:hover {
  border-color: var(--cc-primary-strong);
  background: var(--cc-primary-strong);
}

.featured {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  border: 1px solid #1c2740;
  border-radius: var(--cc-radius-lg);
  padding: 26px 28px;
  color: #ffffff;
  background:
    radial-gradient(circle at 100% 0, rgba(243, 128, 32, 0.16), transparent 26rem),
    linear-gradient(135deg, #0b1220, #141d30 62%, #241a0d);
  box-shadow: 0 18px 46px rgba(11, 18, 32, 0.18);
}

.featured .f-eyebrow {
  color: var(--cc-brand-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.featured h2 {
  margin: 8px 0 4px;
  color: #ffffff;
  font-size: 24px;
}

.featured .f-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: #aab4c4;
  font-size: 13px;
}

.featured .label {
  margin-right: 6px;
  color: #778398;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.featured code {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  padding: 1px 7px;
  color: #d6dde8;
  background: rgba(255, 255, 255, 0.07);
}

.featured .ok {
  color: #6cd39a;
}

.f-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.btn-ghost-dark {
  border-color: rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.06);
}

.btn-ghost-dark:hover {
  background: rgba(255, 255, 255, 0.1);
}

.statline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--cc-text-dim);
}

.statline .item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.statline .label {
  color: var(--cc-text-faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.statline strong {
  color: var(--cc-ink);
}

.statline .green {
  color: var(--cc-success);
}

.statline .amber {
  color: var(--cc-warn);
}

.statline .sep {
  width: 1px;
  height: 18px;
  background: var(--cc-line);
}

.proj-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--cc-line);
  border-radius: var(--cc-radius);
  padding: 10px;
  background: var(--cc-surface);
}

.proj-toolbar h3 {
  margin: 0;
  color: var(--cc-ink);
  font-size: 15px;
}

.toolbar-count {
  min-width: 24px;
  border-radius: 999px;
  padding: 2px 7px;
  color: var(--cc-text-dim);
  background: var(--cc-soft);
  font-size: 12px;
  text-align: center;
}

.grow {
  flex: 1;
}

.search-inline {
  width: min(360px, 100%);
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--cc-line);
  border-radius: var(--cc-radius);
  padding: 0 10px;
  color: var(--cc-text-faint);
  background: var(--cc-surface-raised);
}

.search-inline input {
  min-height: 34px;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.seg {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--cc-line);
  border-radius: var(--cc-radius);
}

.seg button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  color: var(--cc-text-dim);
  background: var(--cc-surface);
}

.seg button + button {
  border-left: 1px solid var(--cc-line);
}

.seg button.active {
  color: var(--cc-primary-strong);
  background: var(--cc-primary-soft);
}

.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.proj-list {
  display: grid;
  gap: 8px;
}

.proj-card,
.pl-row,
.proj-new-card,
.runtime-card {
  min-width: 0;
  border: 1px solid var(--cc-line);
  border-radius: var(--cc-radius);
  background: var(--cc-surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.proj-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.proj-card.selected,
.pl-row.selected {
  border-color: var(--cc-brand);
  box-shadow: 0 0 0 1px rgba(243, 128, 32, 0.24), var(--cc-shadow-soft);
}

.pc-top,
.pc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pc-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--cc-line);
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--cc-text-dim);
  background: var(--cc-soft);
  font-size: 11px;
  font-weight: 650;
}

.pill.green,
.pill.running {
  border-color: var(--cc-success-line);
  color: var(--cc-success);
  background: var(--cc-success-soft);
}

.pill.yellow {
  border-color: #f6d98d;
  color: var(--cc-warn);
  background: var(--cc-warn-soft);
}

.pill.muted {
  color: var(--cc-text-dim);
}

.pc-name,
.pl-name {
  color: var(--cc-ink);
  font-weight: 750;
}

.pc-desc,
.pl-desc,
.pl-when {
  overflow: hidden;
  color: var(--cc-text-dim);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pc-langs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.lang-chip,
.pc-branch {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--cc-text-dim);
  font-size: 12px;
}

.ld {
  width: 7px;
  height: 7px;
  border-radius: 999px;
}

.pl-row {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  text-align: left;
}

.proj-new-card {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.proj-new-card .np-ico {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--cc-primary);
  background: var(--cc-primary-soft);
}

.proj-new-card strong {
  color: var(--cc-ink);
}

.proj-new-card label {
  display: grid;
  gap: 6px;
  color: var(--cc-text-dim);
  font-size: 12px;
}

.runtime-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.runtime-card {
  display: grid;
  gap: 5px;
  padding: 14px;
}

.runtime-card span {
  color: var(--cc-text-dim);
  font-size: 12px;
}

.runtime-card strong {
  color: var(--cc-ink);
}

.project-topbar,
.ide-header,
.ide-titlebar {
  min-height: 52px;
  border-bottom-color: var(--cc-line);
  color: var(--cc-text);
  background: var(--cc-surface);
}

.project-topbar strong,
.project-list-header h1,
.project-create-panel h2,
.runtime-panel h2 {
  color: var(--cc-ink);
}

.project-topbar span,
.project-list-header p {
  color: var(--cc-text-dim);
}

.project-topbar-actions button,
.project-list-header button,
.header-actions button,
.titlebar-actions button,
.side-header button,
.path-tools button,
.run-card button,
.toolbar-actions button,
.welcome-pane button,
.icon-btn,
.ide-btn,
.ai-chip-btn {
  border: 1px solid var(--cc-line);
  border-radius: var(--cc-radius);
  color: var(--cc-text);
  background: var(--cc-surface);
}

.project-topbar-actions button:hover,
.project-list-header button:hover,
.header-actions button:hover,
.titlebar-actions button:hover,
.side-header button:hover,
.path-tools button:hover,
.run-card button:hover,
.toolbar-actions button:hover,
.welcome-pane button:hover,
.icon-btn:hover,
.ide-btn:hover,
.ai-chip-btn:hover {
  border-color: #cfd8e5;
  color: var(--cc-ink);
  background: var(--cc-surface-raised);
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
}

.project-select-layout {
  background: var(--cc-canvas);
}

.project-list-panel {
  border-right-color: var(--cc-line);
  background: var(--cc-canvas);
}

.project-list-header,
.project-toolbar,
.project-create-panel form,
.runtime-panel {
  border-bottom-color: var(--cc-line);
}

.project-toolbar,
.project-create-panel {
  background: var(--cc-surface);
}

.project-search-wrap,
.project-create-panel label,
.runtime-row {
  color: var(--cc-text-dim);
}

.project-search-wrap input {
  border-color: var(--cc-line);
  background: var(--cc-surface);
}

.project-view-switch {
  border-color: var(--cc-line);
  background: var(--cc-surface);
}

.project-view-switch button {
  color: var(--cc-text-dim);
  background: var(--cc-surface);
}

.project-view-switch button.active {
  color: var(--cc-primary-strong);
  background: var(--cc-primary-soft);
}

.project-grid,
.project-list {
  gap: 12px;
}

.project-card,
.project-row {
  border-color: var(--cc-line);
  border-radius: var(--cc-radius);
  color: var(--cc-text);
  background: var(--cc-surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.project-card:hover,
.project-row:hover {
  border-color: #cfd8e5;
  box-shadow: var(--cc-shadow-soft);
}

.project-card.selected,
.project-row.selected {
  border-color: var(--cc-brand);
  box-shadow: 0 0 0 1px rgba(243, 128, 32, 0.24), var(--cc-shadow-soft);
}

.project-card h2,
.project-row-title,
.runtime-row strong {
  color: var(--cc-ink);
}

.project-card span,
.project-row-meta,
.project-row-meta span {
  color: var(--cc-text-dim);
}

.project-card-meta small,
.runtime-chip,
.status-chip,
.connection,
.runtime-summary span {
  border-color: var(--cc-line);
  color: var(--cc-text-dim);
  background: var(--cc-soft);
}

.runtime-chip.ok,
.status-chip.ok,
.connection.ok,
.runtime-summary .ok,
.sandbox {
  border-color: var(--cc-success-line);
  color: var(--cc-success);
  background: var(--cc-success-soft);
}

.runtime-chip.warn,
.status-chip.warn,
.runtime-summary .warn {
  border-color: #f6d98d;
  color: var(--cc-warn);
  background: var(--cc-warn-soft);
}

.sandbox {
  min-height: 32px;
  display: inline-flex;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--cc-success-line);
  border-radius: 9px;
}

.sandbox .sb-lead,
.sandbox > strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  color: var(--cc-success);
  font-size: 12px;
  font-weight: 700;
}

.sandbox .sb-lead .sb-dot,
.sandbox > strong::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--cc-success);
  box-shadow: 0 0 0 3px rgba(31, 138, 91, 0.16);
}

.sandbox .sb-facts {
  display: inline-flex;
  align-items: center;
  border-left: 1px solid var(--cc-success-line);
  background: var(--cc-surface);
}

.sandbox .sb-fact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  color: var(--cc-text-dim);
  font-size: 12px;
  white-space: nowrap;
}

.ide-shell {
  background: var(--cc-canvas);
}

.brand-lockup strong,
.project-meta strong {
  color: var(--cc-ink);
}

.brand-lockup p,
.brand-lockup span,
.project-meta span,
.user-pill {
  color: var(--cc-text-dim);
}

.project-select,
.user-pill {
  border-color: var(--cc-line);
  background: var(--cc-surface);
}

.ide-body {
  background: var(--cc-dark);
}

.ide-stage {
  min-height: 0;
  display: grid;
  grid-template-columns: 48px minmax(250px, 320px) minmax(0, 1fr) minmax(300px, 360px);
  background: var(--cc-dark);
}

.ide-stage.no-assistant {
  grid-template-columns: 48px minmax(250px, 320px) minmax(0, 1fr);
}

.activitybar {
  border-right-color: var(--cc-dark-line);
  background: #0a1020;
}

.activity-button {
  color: #73819a;
}

.activity-button:hover,
.activity-button.active {
  color: #ffffff;
  background: var(--cc-dark-3);
}

.activity-button.active {
  border-left-color: var(--cc-brand);
}

.sidebar {
  border-right-color: var(--cc-dark-line);
  background: var(--cc-dark-2);
}

.side-header,
.workspace-tabs,
.tabs,
.breadcrumbs,
.scm-summary,
.commit-box,
.run-card,
.settings-stack,
.member-form,
.members-list,
.resource-list,
.bottom-tabs {
  border-color: var(--cc-dark-line);
}

.side-header,
.workspace-tabs,
.tabs {
  background: var(--cc-dark-3);
}

.side-header h2,
.workspace-title,
.scm-summary strong,
.scm-section-title,
.run-card strong,
.member-row strong,
.resource-row strong,
.editor-toolbar strong,
.welcome-pane h2 {
  color: var(--cc-dark-text);
}

.workspace-title,
.path-tools span,
.file-row,
.change-row,
.scm-summary span,
.commit-box,
.settings-stack label,
.run-card p,
.member-row span,
.resource-row span,
.editor-toolbar span,
.welcome-pane p,
.empty-panel {
  color: var(--cc-dark-dim);
}

.file-list,
.change-list {
  background: var(--cc-dark-2);
}

.file-row,
.change-row {
  border-radius: var(--cc-radius-sm);
}

.file-row:hover,
.file-row.selected,
.change-row:hover {
  color: var(--cc-dark-text);
  background: #1d2940;
}

.file-icon {
  color: #8aa0bd;
}

.workbench,
.breadcrumbs,
.editor-toolbar,
.editor,
.bottom-panel {
  background: var(--cc-dark);
}

.workbench {
  color: var(--cc-dark-text);
}

.workspace-tabs,
.tabs {
  border-bottom-color: var(--cc-dark-line);
}

.tab {
  border-right-color: var(--cc-dark-line);
  color: var(--cc-dark-dim);
  background: var(--cc-dark-3);
}

.tab:hover {
  color: var(--cc-dark-text);
  background: #1b2943;
}

.tab.active {
  color: #ffffff;
  background: var(--cc-dark);
}

.tab.active::after {
  background: var(--cc-primary);
}

.breadcrumbs {
  border-bottom-color: var(--cc-dark-line);
  color: var(--cc-dark-dim);
}

.breadcrumbs strong {
  color: var(--cc-dark-text);
}

.dirty-dot {
  border-color: #f6d98d;
  color: #ffd877;
  background: rgba(183, 121, 31, 0.16);
}

.editor-toolbar {
  border-bottom-color: var(--cc-dark-line);
}

.editor {
  color: var(--cc-dark-text);
  background: var(--cc-dark);
  caret-color: #ffffff;
}

.notice {
  border-color: #7dd3fc;
  color: #d9f6ff;
  background: rgba(14, 116, 144, 0.24);
}

.bottom-panel {
  border-top-color: var(--cc-dark-line);
}

.bottom-tabs {
  border-bottom-color: var(--cc-dark-line);
  background: #0a1020;
}

.bottom-tabs button {
  border-right-color: var(--cc-dark-line);
  color: var(--cc-dark-dim);
}

.bottom-tabs button.active {
  color: #ffffff;
  background: var(--cc-dark-3);
}

.terminal-form,
.model-form {
  border-bottom-color: var(--cc-dark-line);
  background: var(--cc-dark-2);
}

.sidebar input,
.sidebar textarea,
.sidebar select,
.terminal-form input,
.terminal-form select,
.model-form input,
.model-form textarea,
.model-form select {
  border-color: var(--cc-dark-line);
  color: var(--cc-dark-text);
  background: #0a0f1c;
}

.sidebar input::placeholder,
.sidebar textarea::placeholder,
.terminal-form input::placeholder,
.model-form input::placeholder,
.model-form textarea::placeholder {
  color: #6f7d96;
}

.sidebar input:focus,
.sidebar textarea:focus,
.sidebar select:focus,
.terminal-form input:focus,
.terminal-form select:focus,
.model-form input:focus,
.model-form textarea:focus,
.model-form select:focus {
  border-color: var(--cc-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.terminal-output,
.model-output,
.ai-codeblock {
  color: #c9d3e3;
  background: #0a0f1c;
}

.model-output {
  border-top: 1px solid var(--cc-dark-line-soft);
}

.change-badge {
  background: var(--cc-primary);
}

.member-row,
.resource-row {
  background: #111b2d;
}

.member-row small,
.resource-row small {
  border-color: var(--cc-dark-line);
  color: var(--cc-dark-text);
}

.statusbar {
  color: #ffffff;
  background: var(--cc-primary);
}

.model-workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  color: var(--cc-dark-text);
  background: var(--cc-dark);
}

.assistant-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-left: 1px solid var(--cc-line);
  color: var(--cc-text);
  background: var(--cc-surface);
}

.assistant-panel .ai-head {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--cc-line-soft);
  padding: 11px 14px;
}

.assistant-panel .ai-t {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.assistant-panel .ai-t strong {
  color: var(--cc-ink);
  font-size: 14px;
}

.assistant-panel .ai-t span {
  overflow: hidden;
  color: var(--cc-text-dim);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-panel .spacer {
  flex: 1;
}

.assistant-panel .ai-x {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: var(--cc-radius-sm);
  color: var(--cc-text-dim);
}

.assistant-panel .ai-x:hover {
  color: var(--cc-ink);
  background: var(--cc-soft);
}

.ai-thread {
  min-width: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 16px 14px;
}

.ai-msg {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.ai-msg .who {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--cc-text-faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ai-msg .ub,
.ai-msg .bb {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: #ffffff;
  font-size: 10px;
}

.ai-msg .ub {
  background: linear-gradient(135deg, var(--cc-primary), var(--cc-primary-strong));
}

.ai-msg .bb {
  background: linear-gradient(135deg, var(--cc-brand), var(--cc-brand-2));
}

.ai-bubble {
  min-width: 0;
  color: var(--cc-text);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.ai-bubble.user {
  border: 1px solid var(--cc-primary-line);
  border-radius: 10px;
  padding: 9px 12px;
  background: var(--cc-primary-soft);
}

.ai-bubble p {
  margin: 0 0 7px;
}

.ai-bubble p:last-child {
  margin-bottom: 0;
}

.ai-output {
  max-height: 220px;
  border: 1px solid var(--cc-line);
  border-radius: var(--cc-radius);
}

.ai-compose {
  display: grid;
  gap: 9px;
  border-top: 1px solid var(--cc-line-soft);
  padding: 12px 14px;
}

.ai-context {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ai-ctx,
.ai-mode {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--cc-line-soft);
  border-radius: var(--cc-radius-sm);
  padding: 3px 8px;
  color: var(--cc-text-dim);
  background: var(--cc-soft);
  font-size: 12px;
}

.ai-input-wrap {
  display: grid;
  gap: 8px;
  border: 1px solid var(--cc-line);
  border-radius: 11px;
  padding: 9px 10px;
  background: var(--cc-surface);
}

.ai-input-wrap:focus-within {
  border-color: var(--cc-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.ai-input-wrap textarea {
  min-height: 54px;
  max-height: 120px;
  resize: vertical;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.ai-input-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.assistant-panel textarea,
.assistant-panel input {
  background: var(--cc-surface);
}

@media (max-width: 1040px) {
  .login {
    grid-template-columns: 1fr;
  }

  .login-aside {
    display: none;
  }

  .project-create-panel {
    border-top: 1px solid var(--cc-line);
  }

  .ide-stage {
    grid-template-columns: 48px minmax(220px, 290px) minmax(0, 1fr);
  }

  .ide-stage .assistant-panel {
    display: none;
  }

  .model-workspace {
    grid-template-columns: 1fr;
  }

  .assistant-panel {
    border-left: 0;
    border-top: 1px solid var(--cc-line);
  }
}

@media (max-width: 760px) {
  .utility-bar {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 14px;
  }

  .utility-bar .ub-right {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
  }

  .utility-bar .tenant-chip { flex: 1 1 180px; max-width: 100%; }
  .utility-bar .cli-btn { flex: 1 1 170px; width: auto; justify-content: center; }

  .projects-scroll {
    height: auto;
    min-height: calc(100vh - 88px);
  }

  .projects-wrap {
    padding: 22px 14px 40px;
  }

  .projects-head,
  .featured,
  .proj-toolbar {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .f-actions {
    justify-content: stretch;
  }

  .f-actions > *,
  .projects-head .btn,
  .search-inline {
    width: 100%;
  }

  .runtime-strip {
    grid-template-columns: 1fr;
  }

  .pl-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .pl-row .pc-branch,
  .pl-row .pl-when,
  .pl-row .pill {
    grid-column: 2;
    justify-self: start;
  }

  .ide-stage {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .ide-stage .assistant-panel {
    display: none;
  }

  .project-topbar,
  .ide-header,
  .ide-titlebar {
    min-height: auto;
  }

  .project-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .project-view-switch button {
    flex: 1;
  }

  .auth-screen,
  .auth-shell {
    padding: 14px;
  }

  .auth-card,
  .auth-loading.card {
    padding: 18px;
  }
}

/* CC Web handoff skin -------------------------------------------------- */
:root {
  color-scheme: light;
  --cc-canvas: #f7f9fc;
  --cc-surface: #ffffff;
  --cc-surface-2: #fbfcfe;
  --cc-ink: #1f2937;
  --cc-muted: #5b6470;
  --cc-faint: #98a0aa;
  --cc-line: #e6eaef;
  --cc-line-soft: #eef0f4;
  --cc-blue: #2563eb;
  --cc-blue-strong: #1d4ed8;
  --cc-blue-soft: #eef3fe;
  --cc-blue-line: #d2dfff;
  --cc-orange: #f38020;
  --cc-amber: #f9ab00;
  --cc-green: #1f8a5b;
  --cc-green-soft: #e7f5ee;
  --cc-yellow: #b06000;
  --cc-yellow-soft: #fdf3d8;
  --cc-red: #c5392e;
  --cc-red-soft: #fdebe9;
  --cc-dark: #0d1426;
  --cc-dark-2: #101a2e;
  --cc-dark-3: #15223a;
  --cc-dark-line: #1d2a44;
  --cc-dark-text: #c9d3e3;
  --cc-dark-dim: #73829a;
  --cc-shadow-1: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.05);
  --cc-shadow-2: 0 8px 22px rgba(15, 23, 42, 0.08);
  --cc-font-ui: "Roboto Flex", "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --cc-font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-family: var(--cc-font-ui);
  color: var(--cc-ink);
  background: var(--cc-canvas);
}

body {
  color: var(--cc-ink);
  background: var(--cc-canvas);
}

#app {
  min-height: 100vh;
}

svg {
  display: block;
}

button,
input,
textarea,
select {
  font-family: inherit;
}

input,
textarea,
select {
  border-color: var(--cc-line);
  border-radius: 10px;
  color: var(--cc-ink);
  background: var(--cc-surface);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--cc-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 14px;
  color: var(--cc-ink);
  background: var(--cc-surface);
  font-weight: 650;
  font-size: 13px;
  white-space: nowrap;
}

.btn-primary,
.primary {
  color: #ffffff;
  background: var(--cc-blue);
}

.btn-primary:hover,
.primary:hover {
  background: var(--cc-blue-strong);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.22);
}

.btn-compact {
  padding: 6px 10px;
  font-size: 12px;
}

.eb-mark,
.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--cc-orange), var(--cc-amber));
  box-shadow: 0 6px 16px rgba(243, 128, 32, 0.22);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.03em;
}

.eb-mark.sm {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 10px;
}

.eb-mark.lg {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  font-size: 14px;
}

.eb-lockup {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.eb-lockup .text {
  display: grid;
  line-height: 1.15;
  min-width: 0;
}

.eb-lockup strong {
  color: var(--cc-ink);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.eb-lockup span {
  color: var(--cc-muted);
  font-size: 11px;
  white-space: nowrap;
}

.auth-shell {
  background: var(--cc-canvas);
}

.auth-loading.card {
  border-color: var(--cc-line);
  color: var(--cc-ink);
  background: var(--cc-surface);
  box-shadow: var(--cc-shadow-2);
}

.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  background: var(--cc-surface);
}

.login-aside {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 28px;
  padding: 52px 60px;
  border-right: 1px solid var(--cc-line-soft);
}

.login-aside.warm {
  background:
    radial-gradient(circle at 100% 0, rgba(243, 128, 32, 0.16), transparent 30rem),
    radial-gradient(circle at 0 100%, rgba(37, 99, 235, 0.07), transparent 26rem),
    linear-gradient(135deg, #ffffff, #f7f9fc);
}

.login-pitch {
  display: grid;
  align-content: center;
  gap: 22px;
  max-width: 500px;
}

.login-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #c45f00;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.login-pitch h1 {
  margin: 0;
  color: var(--cc-ink);
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 650;
  line-height: 1.03;
}

.login-pitch .lede {
  max-width: 42ch;
  margin: 0;
  color: var(--cc-muted);
  font-size: 16px;
  line-height: 1.55;
}

.proof-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.proof {
  min-width: 120px;
  display: grid;
  gap: 2px;
  border: 1px solid var(--cc-line);
  border-radius: 12px;
  padding: 11px 14px;
  background: var(--cc-surface);
}

.proof .pv {
  color: var(--cc-ink);
  font-family: var(--cc-font-mono);
  font-size: 18px;
  font-weight: 700;
}

.proof .pl {
  color: var(--cc-muted);
  font-size: 11px;
}

.login-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--cc-faint);
  font-size: 12px;
}

.login-foot .status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.live-dot,
.tenant-chip .dot,
.sb-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cc-green);
  box-shadow: 0 0 0 3px rgba(31, 138, 91, 0.18);
}

.login-foot code {
  border: 1px solid var(--cc-line);
  border-radius: 5px;
  padding: 2px 7px;
  color: var(--cc-ink);
  background: var(--cc-surface);
  font-family: var(--cc-font-mono);
  font-size: 11px;
}

.login-side {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 392px);
  display: grid;
  gap: 20px;
}

.login-card h2 {
  margin: 0;
  color: var(--cc-ink);
  font-size: 22px;
  font-weight: 700;
}

.login-card .sub {
  margin: 6px 0 0;
  color: var(--cc-muted);
  font-size: 14px;
  line-height: 1.5;
}

.form {
  display: grid;
  gap: 13px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label,
.login-card label {
  color: var(--cc-ink);
  font-size: 12px;
  font-weight: 650;
}

.field input {
  padding: 11px 12px;
}

.btn.block {
  width: 100%;
  padding: 12px;
}

.login-legal {
  margin: 0;
  color: var(--cc-faint);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.auth-error,
.project-error {
  border-color: #f6c5be;
  color: var(--cc-red);
  background: var(--cc-red-soft);
}

/* Friendly, non-alarming notice for a benign re-auth (session timed out). */
.auth-note {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--cc-blue-line, #d2dfff);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--cc-blue-strong, #1d4ed8);
  background: var(--cc-blue-soft, #eef3fe);
  font-size: 12.5px;
  line-height: 1.45;
}

.auth-note svg {
  flex: 0 0 auto;
  stroke: currentColor;
}

.utility-bar,
.project-topbar {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  border-bottom: 1px solid var(--cc-line);
  color: var(--cc-ink);
  background: var(--cc-surface);
}

.utility-bar .ub-right,
.project-topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.tenant-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--cc-line);
  border-radius: 8px;
  padding: 6px 11px;
  color: var(--cc-ink);
  background: var(--cc-surface-2);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--cc-line);
  border-radius: 8px;
  color: var(--cc-muted);
  background: var(--cc-surface);
}

.icon-btn:hover {
  color: var(--cc-ink);
  background: var(--cc-surface-2);
}

.avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(135deg, var(--cc-blue), var(--cc-blue-strong));
  font-size: 11px;
  font-weight: 800;
}

.project-screen {
  min-height: 100vh;
  grid-template-rows: 60px minmax(0, 1fr);
  color: var(--cc-ink);
  background: var(--cc-canvas);
}

.projects-scroll {
  height: calc(100vh - 60px);
  overflow-y: auto;
}

.projects-wrap {
  max-width: 1120px;
  display: grid;
  gap: 22px;
  margin: 0 auto;
  padding: 36px 28px 64px;
}

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

.projects-head h1 {
  margin: 0;
  color: var(--cc-ink);
  font-size: 30px;
  font-weight: 700;
}

.projects-head p {
  max-width: 62ch;
  margin: 7px 0 0;
  color: var(--cc-muted);
  font-size: 14px;
  line-height: 1.5;
}

.featured {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  border: 1px solid #1c2740;
  border-radius: 18px;
  padding: 26px 28px;
  color: #ffffff;
  background:
    radial-gradient(circle at 100% 0, rgba(243, 128, 32, 0.12), transparent 26rem),
    linear-gradient(135deg, #0b1220, #141d30 60%, #241a0d);
  box-shadow: 0 18px 46px rgba(11, 18, 32, 0.18);
}

.featured .f-eyebrow {
  color: var(--cc-amber);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.featured h2 {
  margin: 8px 0 4px;
  color: #ffffff;
  font-size: 24px;
  font-weight: 650;
}

.f-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 10px;
  color: #aab4c4;
  font-size: 13px;
}

.f-meta > span {
  white-space: nowrap;
}

.f-meta .ok {
  color: #6cd39a;
}

.f-meta .label {
  margin-right: 6px;
  color: #6f7c91;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.f-meta code {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  padding: 1px 7px;
  color: #d6dde8;
  background: rgba(255, 255, 255, 0.07);
  font-family: var(--cc-font-mono);
  font-size: 12px;
}

.f-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-resume,
.btn-ghost-dark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}

.btn-resume {
  color: var(--cc-ink);
  background: #ffffff;
}

.btn-ghost-dark {
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e6ebf2;
  background: rgba(255, 255, 255, 0.06);
}

.statline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 18px;
  padding: 2px 6px 4px;
  color: var(--cc-muted);
  font-size: 13px;
}

.statline .item {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.statline .label {
  color: var(--cc-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.statline strong {
  color: var(--cc-ink);
  font-family: var(--cc-font-mono);
  font-size: 16px;
  font-weight: 700;
}

.statline strong.green {
  color: var(--cc-green);
}

.statline strong.amber {
  color: var(--cc-yellow);
}

.statline .sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--cc-faint);
  opacity: 0.5;
}

.proj-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.proj-toolbar h3 {
  margin: 0;
  color: var(--cc-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.toolbar-count {
  color: var(--cc-faint);
  font-size: 12px;
}

.grow {
  flex: 1;
}

.search-inline {
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--cc-line);
  border-radius: 9px;
  padding: 7px 11px;
  color: var(--cc-muted);
  background: var(--cc-surface);
}

.search-inline input {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 0;
  outline: none;
  background: transparent;
  box-shadow: none;
}

.seg {
  display: inline-flex;
  gap: 2px;
  border: 1px solid var(--cc-line);
  border-radius: 9px;
  padding: 3px;
  background: var(--cc-surface);
}

.seg button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  padding: 5px 10px;
  color: var(--cc-muted);
  font-size: 12px;
  font-weight: 600;
}

.seg button.active {
  color: var(--cc-blue-strong);
  background: var(--cc-blue-soft);
}

.proj-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.proj-card {
  min-width: 0;
  display: grid;
  gap: 12px;
  border: 1px solid var(--cc-line);
  border-radius: 14px;
  padding: 16px;
  color: var(--cc-ink);
  background: var(--cc-surface);
  box-shadow: var(--cc-shadow-1);
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.proj-card:focus-visible { outline: 2px solid var(--cc-blue-strong, #2563eb); outline-offset: 2px; }

.proj-card:hover {
  border-color: var(--cc-blue-line);
  box-shadow: var(--cc-shadow-2);
}

.proj-card.selected {
  border-color: var(--cc-blue-line);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.08), var(--cc-shadow-1);
}

.pc-top,
.pc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pc-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  color: #ffffff;
  font-family: var(--cc-font-mono);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.pc-name,
.pl-name {
  color: var(--cc-ink);
  font-size: 15px;
  font-weight: 700;
}

.pc-desc,
.pl-desc {
  margin-top: 2px;
  color: var(--cc-muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.pc-langs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lang-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  padding: 3px 8px;
  color: var(--cc-muted);
  background: #f3f5f9;
  font-size: 11px;
  font-weight: 600;
}

.lang-chip .ld,
.lang-dot {
  width: 7px;
  height: 7px;
  display: block;
  border-radius: 2px;
}

.pc-branch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--cc-muted);
  font-family: var(--cc-font-mono);
  font-size: 11px;
  min-width: 0;
}

.card-open {
  border-radius: 7px;
  padding: 6px 9px;
  color: var(--cc-blue-strong);
  background: var(--cc-blue-soft);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 3px 9px 3px 8px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.pill.green {
  color: var(--cc-green);
  background: var(--cc-green-soft);
}

.pill.yellow {
  color: var(--cc-yellow);
  background: var(--cc-yellow-soft);
}

.pill.muted {
  color: var(--cc-muted);
  background: #f1f3f5;
}

.pill.running::before {
  animation: pulse-dot 1.8s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.proj-list {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--cc-line);
  border-radius: 14px;
  background: var(--cc-surface);
  box-shadow: var(--cc-shadow-1);
}

.pl-row {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--cc-line-soft);
  padding: 14px 18px;
  color: var(--cc-ink);
  background: var(--cc-surface);
  text-align: left;
}

.pl-row:last-child {
  border-bottom: 0;
}

.pl-row:hover,
.pl-row.selected {
  background: #fafbfc;
}

.pl-when {
  color: var(--cc-faint);
  font-size: 12px;
  white-space: nowrap;
}

.proj-new-card {
  min-height: 190px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  border: 1.5px dashed var(--cc-line);
  border-radius: 14px;
  padding: 18px;
  color: var(--cc-ink);
  background: #fcfdff;
}

.proj-new-card .np-ico {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--cc-blue-strong);
  background: var(--cc-blue-soft);
}

.proj-new-card strong {
  font-size: 14px;
}

.proj-new-card label {
  width: 100%;
  display: grid;
  gap: 6px;
  color: var(--cc-muted);
  font-size: 12px;
}

.runtime-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.runtime-card {
  display: grid;
  gap: 4px;
  border: 1px solid var(--cc-line);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--cc-surface);
  box-shadow: var(--cc-shadow-1);
}

.runtime-card span {
  color: var(--cc-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.runtime-card strong {
  min-width: 0;
  color: var(--cc-ink);
  font-family: var(--cc-font-mono);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bs-spin {
  width: 16px;
  height: 16px;
  border: 2px solid var(--cc-blue-soft);
  border-top-color: var(--cc-blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 760px) {

  .bs-spin {
    width: 15px;
    height: 15px;
  }
}

.runtime-chip,
.status-chip {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--cc-line);
  border-radius: 8px;
  padding: 4px 9px;
  color: var(--cc-muted);
  background: var(--cc-surface-2);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.runtime-chip.ok,
.status-chip.ok,
.runtime-summary .ok {
  color: var(--cc-green);
  border-color: #b7dfc4;
  background: var(--cc-green-soft);
}

.runtime-chip.warn,
.status-chip.warn,
.runtime-summary .warn {
  color: var(--cc-yellow);
  border-color: #ead392;
  background: var(--cc-yellow-soft);
}

.ide-shell {
  height: 100vh;
  min-height: 620px;
  display: grid;
  grid-template-rows: 52px minmax(0, 1fr) 24px;
  color: var(--cc-ink);
  background: var(--cc-canvas);
}

.ide-top {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--cc-line);
  padding: 0 14px;
  background: var(--cc-surface);
}

.ide-top .crumbs {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--cc-muted);
  font-size: 13px;
  white-space: nowrap;
}

.crumb-link {
  color: var(--cc-muted);
  font-weight: 600;
}

.crumb-link:hover {
  color: var(--cc-blue-strong);
}

.ide-top .crumbs strong {
  max-width: 22ch;
  overflow: hidden;
  color: var(--cc-ink);
  font-weight: 700;
  text-overflow: ellipsis;
}

.ide-top .sep {
  color: var(--cc-faint);
}

.ide-top .branch {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--cc-line-soft);
  border-radius: 6px;
  padding: 2px 8px;
  color: var(--cc-muted);
  background: #f3f5f9;
  font-family: var(--cc-font-mono);
  font-size: 11px;
}

.project-switcher.compact {
  max-width: 220px;
}

.project-select {
  min-height: 30px;
  max-width: 220px;
  border-radius: 8px;
  color: var(--cc-ink);
  background: var(--cc-surface-2);
}

.ide-top .spacer,
.ai-head .spacer {
  flex: 1;
}

.sandbox {
  display: inline-flex;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid #b7dfc4;
  border-radius: 9px;
  background: var(--cc-green-soft);
}

.sandbox .sb-lead,
.sandbox .sb-facts,
.sandbox .sb-fact {
  display: inline-flex;
  align-items: center;
}

.sandbox .sb-lead {
  gap: 7px;
  padding: 5px 11px;
  color: var(--cc-green);
  font-size: 12px;
  font-weight: 750;
}

.sandbox .sb-facts {
  border-left: 1px solid #b7dfc4;
  background: #ffffff;
}

.sandbox .sb-fact {
  gap: 6px;
  padding: 5px 10px;
  color: var(--cc-ink);
  font-size: 11px;
  white-space: nowrap;
}

.sandbox .sb-fact + .sb-fact {
  border-left: 1px solid var(--cc-line-soft);
}

.sandbox code {
  font-family: var(--cc-font-mono);
}

.ide-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ide-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--cc-line);
  border-radius: 8px;
  padding: 6px 11px;
  color: var(--cc-ink);
  background: var(--cc-surface);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.ide-btn.active {
  color: var(--cc-blue-strong);
  border-color: var(--cc-blue-line);
  background: var(--cc-blue-soft);
}

.ide-stage {
  min-height: 0;
  display: grid;
  grid-template-columns: 48px minmax(240px, 280px) minmax(0, 1fr) minmax(320px, 360px);
}

.ide-stage.no-assistant {
  grid-template-columns: 48px minmax(240px, 280px) minmax(0, 1fr);
}

.activitybar {
  border-right: 1px solid var(--cc-line);
  background: #fbfcfe;
}

.activity-button {
  height: 58px;
  display: grid;
  place-items: center;
  gap: 3px;
  border-left: 3px solid transparent;
  color: var(--cc-muted);
  font-size: 9px;
  font-weight: 800;
}

.activity-button:hover,
.activity-button.active {
  color: var(--cc-blue-strong);
  background: var(--cc-blue-soft);
}

.activity-button.active {
  border-left-color: var(--cc-blue);
}

.activity-icon {
  display: grid;
  place-items: center;
}

.activity-label {
  font-size: 9px;
}

.activity-button small {
  background: var(--cc-red);
}

.sidebar {
  min-height: 0;
  border-right: 1px solid var(--cc-line);
  color: var(--cc-ink);
  background: var(--cc-surface);
}

.side-header {
  min-height: 42px;
  border-bottom: 1px solid var(--cc-line-soft);
  padding: 0 12px;
}

.side-header h2 {
  color: var(--cc-muted);
  font-size: 11px;
  font-weight: 800;
}

.side-header button,
.path-tools button,
.run-card button,
.settings-stack button,
.member-form button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--cc-line);
  border-radius: 7px;
  padding: 5px 8px;
  color: var(--cc-ink);
  background: var(--cc-surface-2);
  font-size: 11px;
  font-weight: 650;
}

.workspace-title {
  color: var(--cc-ink);
}

.path-tools span {
  color: var(--cc-muted);
}

.file-list,
.change-list {
  padding: 6px 8px 12px;
  background: var(--cc-surface);
}

.file-row,
.change-row {
  min-height: 30px;
  border-radius: 7px;
  color: var(--cc-ink);
  background: transparent;
}

.file-row:hover,
.file-row.selected,
.change-row:hover {
  color: var(--cc-blue-strong);
  background: var(--cc-blue-soft);
}

.file-icon {
  width: 16px;
  display: grid;
  place-items: center;
  color: var(--cc-orange);
}

.file-row span:nth-child(2),
.change-row span:nth-child(2) {
  color: var(--cc-ink);
}

.file-row:hover span:nth-child(2),
.file-row.selected span:nth-child(2),
.change-row:hover span:nth-child(2) {
  color: var(--cc-blue-strong);
}

.file-row small {
  color: var(--cc-faint);
}

.scm-summary,
.run-card,
.commit-box,
.member-row,
.resource-row,
.empty-panel {
  border-color: var(--cc-line);
  color: var(--cc-ink);
  background: var(--cc-surface-2);
}

.scm-summary span,
.run-card p,
.member-row span,
.resource-row span,
.empty-panel {
  color: var(--cc-muted);
}

.workbench {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 38px 32px minmax(0, 1fr) minmax(190px, 252px);
  background: var(--cc-dark);
}

.workspace-tabs {
  border-bottom: 1px solid var(--cc-line);
  background: var(--cc-surface);
}

.tab {
  min-width: 130px;
  height: 38px;
  align-items: center;
  border-right: 1px solid var(--cc-line-soft);
  color: var(--cc-muted);
  background: var(--cc-surface-2);
  font-size: 12px;
}

.tab.active {
  position: relative;
  color: var(--cc-dark-text);
  background: var(--cc-dark);
}

.tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--cc-blue);
}

.breadcrumbs {
  border-bottom: 1px solid var(--cc-dark-line);
  color: var(--cc-dark-dim);
  background: var(--cc-dark);
}

.breadcrumbs strong {
  color: var(--cc-dark-text);
}

.editor-area {
  min-height: 0;
  color: var(--cc-dark-text);
  background: var(--cc-dark);
}

/* Live preview pane (frames the guest /api/preview/ static server) ----- */
.preview-pane {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: var(--ic-editor, #fff);
}
.preview-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  flex: 0 0 auto;
  padding: 0 10px;
  border-bottom: 1px solid var(--ic-border, #1d2740);
  background: var(--ic-tab-bar, #0a0f1c);
}
.preview-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ic-fg, #eef2f8);
}
.preview-title svg { color: var(--cc-blue); }
.preview-url {
  font-size: 12px;
  color: var(--ic-fg-muted, #8b96aa);
  background: var(--ic-chip, #16213a);
  border: 1px solid var(--ic-border-soft, #161f33);
  border-radius: 6px;
  padding: 2px 8px;
}
.preview-bar .spacer { flex: 1; }
.preview-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--ic-border, #1d2740);
  border-radius: 7px;
  background: var(--ic-panel, #0e1424);
  color: var(--ic-fg-2, #c4cddd);
  cursor: pointer;
}
.preview-btn:hover { background: var(--ic-hover, #182238); color: var(--ic-fg, #fff); }
.preview-frame {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  border: 0;
  background: #ffffff;
}

.welcome-pane {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  min-height: 100%;
  padding: 28px;
  color: var(--cc-dark-text);
  text-align: center;
}

.welcome-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: var(--cc-green);
  background: rgba(31, 138, 91, 0.14);
}

.welcome-pane h2,
.welcome-pane p {
  margin: 0;
}

.welcome-pane h2 {
  color: #ffffff;
  font-size: 22px;
}

.welcome-pane p {
  max-width: 54ch;
  color: var(--cc-dark-dim);
  line-height: 1.5;
}

.runtime-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.editor-toolbar {
  border-bottom: 1px solid var(--cc-dark-line);
  color: var(--cc-dark-text);
  background: var(--cc-dark-2);
}

.editor-toolbar strong {
  color: #ffffff;
}

.editor-toolbar span {
  color: var(--cc-dark-dim);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-actions button:not(.btn) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--cc-dark-line);
  border-radius: 7px;
  padding: 6px 10px;
  color: var(--cc-dark-text);
  background: var(--cc-dark-3);
  font-size: 12px;
}

/* Rename/Delete/Discard reskin with the IDE theme tokens instead of the
   hardcoded dark navy, so they don't stay dark on the white IDE. */
.ide-shell .toolbar-actions button:not(.btn) {
  color: var(--ic-fg);
  background: var(--ic-chip);
  border-color: var(--ic-border);
}
.ide-shell .toolbar-actions button:not(.btn):hover {
  background: var(--ic-hover);
}
.ide-shell .toolbar-actions button:not(.btn):disabled {
  opacity: 0.55;
  cursor: default;
}

.code-editor {
  flex: 1;
  min-height: 0;
  width: 100%;
  border: 0;
  border-radius: 0;
  padding: 16px 18px;
  color: var(--cc-dark-text);
  background: var(--cc-dark);
  box-shadow: none;
  font-family: var(--cc-font-mono);
  font-size: 13px;
  line-height: 1.62;
  resize: none;
  tab-size: 2;
}

.code-editor:focus {
  border: 0;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.45);
}

.bottom-panel {
  border-top: 1px solid var(--cc-line);
  color: var(--cc-dark-text);
  background: var(--cc-dark);
}

.bottom-tabs {
  border-bottom: 1px solid var(--cc-dark-line);
  background: #0a1020;
}

.bottom-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-right: 1px solid var(--cc-dark-line);
  color: var(--cc-dark-dim);
}

.bottom-tabs button.active {
  color: #ffffff;
  background: var(--cc-dark-3);
}

.terminal-form,
.model-form {
  border-bottom: 1px solid var(--cc-dark-line);
  background: var(--cc-dark-2);
}

.terminal-form input,
.model-form textarea {
  border-color: var(--cc-dark-line);
  color: var(--cc-dark-text);
  background: #0a0f1c;
}

.command-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.terminal-output,
.model-output {
  color: var(--cc-dark-text);
  background: #0a0f1c;
  font-family: var(--cc-font-mono);
}

.statusbar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 0 10px;
  color: #ffffff;
  background: var(--cc-blue);
  font-size: 11px;
}

.statusbar button {
  color: #ffffff;
}

.status-spacer {
  flex: 1;
}

.assistant-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-left: 1px solid var(--cc-line);
  color: var(--cc-ink);
  background: var(--cc-surface);
}

.ai-head {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--cc-line-soft);
  padding: 11px 14px;
}

.ai-mark,
.bb {
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, var(--cc-orange), var(--cc-amber));
}

.ai-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
}

.ai-t {
  min-width: 0;
  display: grid;
}

.ai-t strong {
  color: var(--cc-ink);
  font-size: 13px;
}

.ai-t span {
  overflow: hidden;
  color: var(--cc-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-x {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--cc-faint);
}

.ai-x:hover {
  color: var(--cc-ink);
  background: #f3f5f9;
}

.ai-thread {
  min-width: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 16px 14px;
}

.ai-msg {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.ai-msg .who {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--cc-faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ub,
.bb {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 800;
}

.ub {
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, var(--cc-blue), var(--cc-blue-strong));
}

.ai-bubble {
  min-width: 0;
  color: var(--cc-ink);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.ai-bubble.user {
  border: 1px solid var(--cc-blue-line);
  border-radius: 10px;
  padding: 9px 12px;
  background: var(--cc-blue-soft);
}

.ai-bubble p {
  margin: 0 0 7px;
}

.ai-bubble p:last-child {
  margin-bottom: 0;
}

.ai-bubble code,
.ai-ctx {
  border-radius: 5px;
  color: var(--cc-ink);
  background: #f3f5f9;
  font-family: var(--cc-font-mono);
}

.ai-bubble code {
  padding: 1px 5px;
  font-size: 12px;
}

.ai-output {
  max-height: none;
  min-height: 180px;
  border: 1px solid var(--cc-line);
  border-radius: 9px;
  padding: 10px 12px;
  color: var(--cc-dark-text);
  white-space: pre-wrap;
}

.ai-compose {
  display: grid;
  gap: 9px;
  border-top: 1px solid var(--cc-line-soft);
  padding: 12px 14px;
}

.ai-context {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ai-ctx {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--cc-line-soft);
  padding: 2px 8px;
  color: var(--cc-muted);
  font-size: 11px;
}

.ai-input-wrap {
  display: grid;
  gap: 8px;
  border: 1px solid var(--cc-line);
  border-radius: 11px;
  padding: 9px 10px;
  background: var(--cc-surface);
}

.ai-input-wrap:focus-within {
  border-color: var(--cc-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.ai-input-wrap textarea {
  min-height: 54px;
  max-height: 120px;
  border: 0;
  padding: 0;
  resize: vertical;
  color: var(--cc-ink);
  background: transparent;
  box-shadow: none;
  line-height: 1.45;
}

.ai-input-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ai-mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--cc-line-soft);
  border-radius: 7px;
  padding: 4px 9px;
  color: var(--cc-muted);
  background: #f3f5f9;
  font-size: 11px;
  white-space: nowrap;
}

.ai-send {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  color: #ffffff;
  background: var(--cc-blue);
}

.notice {
  border-color: var(--cc-blue-line);
  color: var(--cc-blue-strong);
  background: var(--cc-blue-soft);
}

.notice.compact {
  padding: 7px 9px;
  font-size: 12px;
}

@media (max-width: 1180px) {
  .proj-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sandbox .sb-facts {
    display: none;
  }

  .ide-stage {
    grid-template-columns: 48px minmax(220px, 260px) minmax(0, 1fr);
  }

  .assistant-panel {
    display: none;
  }
}

@media (max-width: 860px) {
  .login {
    grid-template-columns: 1fr;
  }

  .login-aside {
    display: none;
  }

  .utility-bar {
    align-items: flex-start;
    flex-direction: column;
    height: auto;
    min-height: 0;
    padding: 12px 14px;
  }

  .utility-bar .ub-right {
    width: 100%;
    justify-content: space-between;
  }

  .projects-scroll {
    height: auto;
    min-height: calc(100vh - 88px);
  }

  .projects-wrap {
    padding: 22px 14px 40px;
  }

  .projects-head,
  .featured,
  .proj-toolbar {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .f-actions,
  .f-actions > *,
  .projects-head .btn,
  .search-inline {
    width: 100%;
  }

  .proj-grid,
  .runtime-strip {
    grid-template-columns: 1fr;
  }

  .pl-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .pl-row .pc-branch,
  .pl-row .pl-when,
  .pl-row .pill {
    grid-column: 2;
    justify-self: start;
  }

  .ide-top {
    gap: 8px;
  }

  .project-switcher.compact,
  .sandbox,
  .ide-actions .ide-btn {
    display: none;
  }

  .ide-stage,
  .ide-stage.no-assistant {
    grid-template-columns: 44px minmax(180px, 230px) minmax(0, 1fr);
  }

  .statusbar .runtime-chip,
  .statusbar span:nth-child(3) {
    display: none;
  }
}

@media (max-width: 640px) {
  .ide-shell {
    min-height: 720px;
  }

  .ide-stage,
  .ide-stage.no-assistant {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .sidebar {
    display: none;
  }

  .workbench {
    grid-column: 2;
  }

  .bottom-panel {
    min-height: 220px;
  }
}

/* Exact handoff IDE layout -------------------------------------------- */
.ide-shell {
  height: 100vh;
  min-height: 620px;
  display: grid;
  grid-template-rows: 52px minmax(0, 1fr);
  background: var(--cc-canvas);
}

.ide-stage {
  --ai-w: 360px;
  min-height: 0;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr) var(--ai-w);
}

.ide-stage.no-assistant {
  grid-template-columns: 248px minmax(0, 1fr) 0;
}

.ide-stage.no-assistant .assistant-panel {
  display: none;
}

.activitybar,
.statusbar,
.breadcrumbs {
  display: none;
}

.sidebar.filetree,
.sidebar {
  width: 248px;
  min-width: 248px;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  border-right: 1px solid var(--cc-line);
  background: var(--cc-surface);
}

.side-header {
  min-height: 42px;
}

.file-list,
.ft-list {
  min-height: 0;
  overflow-y: auto;
  padding: 8px 8px 14px;
}

.file-row,
.ft-row {
  min-height: 30px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  border-radius: 7px;
  padding: 4px 8px;
  color: var(--cc-ink);
  font-size: 13px;
}

.ft-badge {
  margin-left: auto;
  border-radius: 4px;
  padding: 0 5px;
  font-family: var(--cc-font-mono);
  font-size: 10px;
  font-weight: 700;
}

.ft-badge.M {
  color: var(--cc-yellow);
  background: var(--cc-yellow-soft);
}

.ft-badge.U,
.ft-badge.A {
  color: var(--cc-green);
  background: var(--cc-green-soft);
}

.ft-badge.D {
  color: var(--cc-red);
  background: var(--cc-red-soft);
}

.ft-foot {
  min-height: 35px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--cc-line-soft);
  padding: 8px 14px;
  color: var(--cc-muted);
  font-size: 11px;
}

.ft-foot .gb {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  font-family: var(--cc-font-mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ft-foot span:last-child {
  margin-left: auto;
  color: var(--cc-yellow);
  white-space: nowrap;
}

.workbench,
.editor-col {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 38px minmax(0, 1fr) auto;
  background: var(--ed-bg);
}

.workbench.dark {
  --ed-bg: #0d1426;
  --ed-fg: #c9d3e3;
  --ed-gutter: #41506b;
  --ed-line: rgba(255, 255, 255, 0.05);
  --ed-hl: rgba(255, 255, 255, 0.04);
  --ed-tab-fg: #e6ebf3;
  --ed-panel: #101a2e;
  --ed-panel-2: #0a0f1c;
}

.workbench.light {
  --ed-bg: #ffffff;
  --ed-fg: #2b3445;
  --ed-gutter: #c2c9d6;
  --ed-line: #eef0f4;
  --ed-hl: #f3f6fc;
  --ed-tab-fg: #1f2937;
  --ed-panel: #fbfcfe;
  --ed-panel-2: #ffffff;
}

.workspace-tabs,
.tabbar {
  height: 38px;
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  border-bottom: 1px solid var(--cc-line);
  background: var(--cc-surface);
}

.tab {
  min-width: 128px;
  max-width: 240px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-right: 1px solid var(--cc-line-soft);
  padding: 0 10px 0 14px;
  color: var(--cc-muted);
  background: #fbfcfe;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.tab.active {
  color: var(--ed-tab-fg);
  background: var(--ed-bg);
}

.tab-lang {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 2px;
}

.tab-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tdot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--cc-yellow);
}

.tclose {
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 4px;
  color: inherit;
  opacity: 0.55;
}

.tclose:hover {
  opacity: 1;
  background: rgba(127, 127, 127, 0.16);
}

.editor-area,
.code-editor {
  background: var(--ed-bg);
  color: var(--ed-fg);
}

.editor-area {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.code-editor {
  flex: 1;
  min-height: 0;
  width: 100%;
  border: 0;
  border-radius: 0;
  padding: 14px 18px;
  box-shadow: none;
  font-family: var(--cc-font-mono);
  font-size: 13px;
  line-height: 1.62;
  resize: none;
}

.code-editor:focus {
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.45);
}

.editor-toolbar {
  min-height: 42px;
  border-bottom: 1px solid var(--ed-line);
  color: var(--ed-fg);
  background: var(--ed-panel);
}

.editor-toolbar strong {
  color: var(--ed-tab-fg);
}

.bottom-panel,
.terminal {
  height: var(--term-h, 196px);
  min-height: 0;
  display: grid;
  grid-template-rows: 34px minmax(0, 1fr);
  border-top: 1px solid var(--cc-line);
  background: var(--ed-bg);
  color: var(--ed-fg);
}

.bottom-tabs {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--ed-line);
  padding: 0 10px;
  background: var(--ed-bg);
}

.bottom-tabs button {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 6px;
  padding: 5px 10px;
  color: var(--ed-gutter);
  background: transparent;
  font-size: 12px;
}

.bottom-tabs button.active {
  color: var(--ed-fg);
  background: rgba(127, 127, 127, 0.14);
}

.term-spacer {
  flex: 1;
}

.term-count {
  color: var(--ed-gutter);
  font-size: 11px;
  white-space: nowrap;
}

.terminal-form,
.model-form {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 8px;
  border-bottom: 0;
  padding: 10px 14px 0;
  background: var(--ed-bg);
}

.model-form {
  grid-template-columns: minmax(0, 1fr) auto;
}

.terminal-form input,
.model-form textarea {
  border-color: var(--ed-line);
  color: var(--ed-fg);
  background: var(--ed-panel-2);
}

.terminal-output,
.model-output {
  min-height: 0;
  overflow: auto;
  padding: 10px 14px;
  color: var(--ed-fg);
  background: var(--ed-bg);
}

.assistant-panel,
.ai-panel {
  width: var(--ai-w, 360px);
  min-width: var(--ai-w, 360px);
}

.settings-drawer {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 16px 14px;
}

.settings-section {
  display: grid;
  gap: 10px;
}

.settings-section h3 {
  margin: 0;
  color: var(--cc-faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.settings-section label {
  display: grid;
  gap: 6px;
  color: var(--cc-muted);
  font-size: 12px;
  font-weight: 650;
}

.theme-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.theme-switch button,
.muted-section button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--cc-line);
  border-radius: 8px;
  color: var(--cc-ink);
  background: var(--cc-surface);
  font-weight: 700;
  font-size: 12px;
}

.theme-switch button.active {
  border-color: var(--cc-blue-line);
  color: var(--cc-blue-strong);
  background: var(--cc-blue-soft);
}

.settings-kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--cc-line-soft);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--cc-muted);
  background: var(--cc-surface-2);
  font-size: 12px;
}

.settings-kv strong {
  min-width: 0;
  overflow: hidden;
  color: var(--cc-ink);
  font-family: var(--cc-font-mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-list {
  display: grid;
  gap: 8px;
}

.muted-section button:disabled {
  color: var(--cc-faint);
  background: #f3f5f9;
  cursor: not-allowed;
}

.sso-btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--cc-line);
  border-radius: 10px;
  color: var(--cc-muted);
  background: var(--cc-surface-2);
  font-weight: 750;
}

.sso-ico {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--cc-blue-strong);
  background: var(--cc-blue-soft);
}

.or-div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: var(--cc-faint);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.or-div::before,
.or-div::after {
  content: "";
  height: 1px;
  background: var(--cc-line-soft);
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--cc-muted);
  font-size: 12px;
}

.form-row button {
  color: var(--cc-blue-strong);
  font-weight: 700;
}
/* A disabled form-row control (e.g. "Forgot password?") must not look clickable. */
.form-row button:disabled {
  color: var(--cc-faint, #98a0aa);
  font-weight: 600;
  cursor: default;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.check input {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  margin: 0;
}

.icon-btn:disabled,
.btn-ghost-dark:disabled {
  opacity: 0.5;
  filter: grayscale(0.25);
}

.ide-btn.run {
  border-color: #a5d6b8;
  color: var(--cc-green);
  background: var(--cc-green-soft);
}

.sandbox .sb-label {
  display: none;
}

.sandbox .sb-fact:nth-child(n + 4) {
  display: none;
}

.workbench.light .welcome-pane h2 {
  color: var(--ed-tab-fg);
}

.workbench.light .welcome-pane p {
  color: #64748b;
}

.workbench.light .welcome-mark {
  color: var(--cc-green);
  background: var(--cc-green-soft);
}

@media (max-width: 1180px) {
  .ide-stage,
  .ide-stage.no-assistant {
    grid-template-columns: 248px minmax(0, 1fr);
  }

  .assistant-panel {
    display: none;
  }
}

@media (max-width: 760px) {
  .ide-stage,
  .ide-stage.no-assistant {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar.filetree,
  .sidebar {
    display: none;
  }
}

/* =====================================================================
   Ember alignment — cohesive full-IDE theming (light + dark)
   ---------------------------------------------------------------------
   Previously only the editor/terminal column was themed (via --ed-*),
   so "dark" mode rendered a dark editor wedged into permanently-light
   chrome, file tree, tabs, and assistant panel. These rules drive every
   IDE surface from a single set of --ic-* tokens set on the .ide-shell
   root, so the sun/moon toggle (and the Settings appearance switch) flips
   the entire workspace into one cohesive theme — a crisp white IDE or a
   true dark IDE. Brand accents (blue action, green sandbox, orange mark)
   stay constant across themes.
   ===================================================================== */
.ide-shell.ide-theme-light {
  --ic-bg: #eef1f6;
  /* Side chrome/panels carry a subtle gray tint so the white editor reads as a
     distinct surface (VS Code-style). With pure-white panels AND a near-white
     border the explorer↔editor seam was invisible — this gives both a background
     delta AND a clearly visible 1px border. */
  --ic-chrome: #f5f7fb;
  --ic-panel: #f5f7fb;
  --ic-editor: #ffffff;
  --ic-tab-bar: #eef1f6;
  --ic-tab-inactive: #e7ebf3;
  --ic-border: #cdd4e1;
  --ic-border-soft: #dde3ec;
  --ic-fg: #1b2230;
  --ic-fg-2: #3a4354;
  --ic-fg-muted: #6b7689;
  --ic-fg-faint: #98a1b2;
  --ic-hover: #f0f3f8;
  --ic-active-bg: #eef3fe;
  --ic-active-fg: #1d4ed8;
  --ic-chip: #eef1f6;
  --ic-code-bg: #f6f8fb;
  --ic-code-border: #e3e7ee;
  --ic-sandbox-bg: #e7f5ee;
  --ic-sandbox-line: #b7dfc4;
  --ic-sandbox-fg: #1f8a5b;
  --ic-danger-bg: #fdecea;
  --ic-danger-line: #f3b9b2;
  --ic-danger-fg: #b42318;
}
.ide-shell.ide-theme-dark {
  --ic-bg: #0a0f1c;
  --ic-chrome: #0e1424;
  --ic-panel: #0e1424;
  --ic-editor: #0b1120;
  --ic-tab-bar: #0a0f1c;
  --ic-tab-inactive: #111a2c;
  --ic-border: #1d2740;
  --ic-border-soft: #161f33;
  --ic-fg: #eef2f8;
  --ic-fg-2: #c4cddd;
  --ic-fg-muted: #8b96aa;
  --ic-fg-faint: #5d6883;
  --ic-hover: #182238;
  --ic-active-bg: rgba(37, 99, 235, 0.22);
  --ic-active-fg: #93b4ff;
  --ic-chip: #16213a;
  --ic-code-bg: #070b16;
  --ic-code-border: #1d2740;
  --ic-sandbox-bg: rgba(31, 138, 91, 0.14);
  --ic-sandbox-line: rgba(108, 211, 154, 0.34);
  --ic-sandbox-fg: #6cd39a;
  --ic-danger-bg: rgba(244, 63, 47, 0.14);
  --ic-danger-line: rgba(248, 113, 99, 0.42);
  --ic-danger-fg: #ff9c8f;
}

/* shell + top chrome -------------------------------------------------- */
.ide-shell { background: var(--ic-bg); color: var(--ic-fg); }
.ide-shell .ide-top { background: var(--ic-chrome); border-bottom-color: var(--ic-border); }
.ide-shell .ide-top .crumbs { color: var(--ic-fg-muted); }
.ide-shell .crumb-link { color: var(--ic-fg-muted); }
.ide-shell .crumb-link:hover { color: var(--cc-blue); }
.ide-shell .ide-top .crumbs strong { color: var(--ic-fg); }
.ide-shell .ide-top .sep { color: var(--ic-fg-faint); }
.ide-shell .ide-top .branch {
  color: var(--ic-fg-muted); background: var(--ic-chip); border-color: var(--ic-border-soft);
}
.ide-shell .ide-top .crumbs {
  flex: 0 1 auto;
}
.ide-shell .ide-top .crumbs strong {
  min-width: 12ch;
}
.ide-shell .ide-top .branch {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ide-shell .project-select {
  color: var(--ic-fg); background: var(--ic-chip); border-color: var(--ic-border);
}

/* persistent sandbox / isolation cluster ------------------------------ */
.ide-shell .sandbox { background: var(--ic-sandbox-bg); border-color: var(--ic-sandbox-line); }
.ide-shell .sandbox .sb-lead { color: var(--ic-sandbox-fg); }
.ide-shell .sandbox .sb-lead .sb-dot {
  background: var(--ic-sandbox-fg); box-shadow: 0 0 0 3px rgba(31, 138, 91, 0.18);
}
.ide-shell .sandbox {
  flex: 0 1 auto;
  max-width: min(720px, 42vw);
}
.ide-shell .sandbox .sb-lead {
  flex: 0 0 auto;
  padding-inline: 9px;
  white-space: nowrap;
}
.ide-shell .sandbox .sb-facts {
  min-width: 0;
  overflow: hidden;
  background: var(--ic-panel);
  border-left-color: var(--ic-sandbox-line);
}
.ide-shell .sandbox .sb-fact { color: var(--ic-fg-2); }
.ide-shell .sandbox .sb-fact + .sb-fact { border-left-color: var(--ic-border-soft); }
.ide-shell .sandbox .sb-fact svg { color: var(--ic-fg-muted); }
.ide-shell .sandbox code { color: var(--ic-fg); }
.ide-shell .sandbox .sb-label { display: inline; color: var(--ic-fg-muted); }
.ide-shell .sandbox .sb-fact:nth-child(n + 4) { display: inline-flex; }
.ide-shell .sandbox .sb-fact {
  flex: 0 0 auto;
  gap: 5px;
  padding: 5px 8px;
}
.ide-shell .sandbox .sb-fact:last-child {
  min-width: 0;
  flex-shrink: 1;
}

@media (max-width: 1800px) {
  .ide-shell .sandbox {
    max-width: 560px;
  }

  .ide-shell .sandbox .sb-fact:nth-child(n + 5) {
    display: none;
  }
}

/* top-bar buttons + theme toggle -------------------------------------- */
.ide-shell .ide-btn { color: var(--ic-fg); background: var(--ic-chrome); border-color: var(--ic-border); }
.ide-shell .ide-btn:hover { background: var(--ic-hover); border-color: var(--ic-fg-faint); }
.ide-shell .ide-btn.active { color: var(--ic-active-fg); background: var(--ic-active-bg); border-color: transparent; }
.ide-shell .ide-btn.run { color: #ffffff; background: var(--cc-green); border-color: var(--cc-green); }
.ide-shell .ide-btn.run:hover { background: #197a4f; }
.ide-shell button:focus-visible,
.ide-shell [role="button"]:focus-visible {
  outline: 2px solid var(--cc-blue);
  outline-offset: 2px;
}

/* file tree ----------------------------------------------------------- */
.ide-shell .sidebar.filetree,
.ide-shell .sidebar { background: var(--ic-panel); border-right-color: var(--ic-border); }
.ide-shell .ide-stage.explorer-collapsed {
  grid-template-columns: 0 minmax(0, 1fr) var(--ai-w);
}
.ide-shell .ide-stage.no-assistant.explorer-collapsed {
  grid-template-columns: 0 minmax(0, 1fr) 0;
}
.ide-shell .ide-stage.explorer-collapsed .sidebar {
  display: none;
}
.ide-shell .side-header { background: var(--ic-panel); border-bottom-color: var(--ic-border-soft); }
.ide-shell .side-header h2 { color: var(--ic-fg-muted); }
.ide-shell .side-header button { color: var(--ic-fg-muted); }
.ide-shell .side-header button:hover { color: var(--ic-fg); background: var(--ic-hover); }
.ide-shell .workspace-title { color: var(--ic-fg-muted); }
.ide-shell .path-tools { color: var(--ic-fg-muted); }
.ide-shell .path-tools button {
  color: var(--ic-fg-muted); background: var(--ic-chip); border-color: var(--ic-border-soft);
}
.ide-shell .file-row,
.ide-shell .ft-row { color: var(--ic-fg-2); }
.ide-shell .file-row:hover,
.ide-shell .ft-row:hover { background: var(--ic-hover); }
.ide-shell .file-row.selected,
.ide-shell .ft-row.active,
.ide-shell .ft-row.selected { color: var(--ic-active-fg); background: var(--ic-active-bg); }
.ide-shell .file-icon,
.ide-shell .ft-ico { color: var(--ic-fg-faint); }
.ide-shell .file-row small { color: var(--ic-fg-faint); }
.ide-shell .ft-foot { color: var(--ic-fg-muted); border-top-color: var(--ic-border-soft); }

/* editor tabs --------------------------------------------------------- */
.ide-shell .workspace-tabs,
.ide-shell .tabbar { background: var(--ic-tab-bar); border-bottom-color: var(--ic-border); }
.ide-shell .tab {
  color: var(--ic-fg-muted); background: var(--ic-tab-inactive); border-right-color: var(--ic-border-soft);
}
.ide-shell .tab:hover { color: var(--ic-fg); background: var(--ic-hover); }
.ide-shell .tab.active { position: relative; color: var(--ic-fg); background: var(--ic-editor); }
.ide-shell .tab.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--cc-blue);
}

/* editor surface + welcome pane --------------------------------------- */
.ide-shell .editor-area,
.ide-shell .code-editor { background: var(--ic-editor); color: var(--ic-fg-2); }
.ide-shell .editor-toolbar {
  background: var(--ic-chrome); border-bottom-color: var(--ic-border-soft); color: var(--ic-fg-2);
}
.ide-shell .editor-toolbar strong { color: var(--ic-fg); }
.ide-shell .welcome-pane { color: var(--ic-fg-muted); }
.ide-shell .welcome-pane h2 { color: var(--ic-fg); }
.ide-shell .welcome-pane p { color: var(--ic-fg-muted); }

/* terminal / bottom panel --------------------------------------------- */
.ide-shell .bottom-panel,
.ide-shell .terminal { background: var(--ic-editor); color: var(--ic-fg-2); border-top-color: var(--ic-border); }
.ide-shell .bottom-tabs { background: var(--ic-editor); border-bottom-color: var(--ic-border-soft); }
.ide-shell .bottom-tabs button { color: var(--ic-fg-muted); }
.ide-shell .bottom-tabs button.active { color: var(--ic-fg); background: var(--ic-hover); }
.ide-shell .term-count { color: var(--ic-fg-faint); }
.ide-shell .terminal-output,
.ide-shell .model-output { color: var(--ic-fg-2); background: var(--ic-editor); }

/* assistant panel ----------------------------------------------------- */
.ide-shell .assistant-panel { background: var(--ic-panel); border-left-color: var(--ic-border); color: var(--ic-fg); }
.ide-shell .ai-head { border-bottom-color: var(--ic-border-soft); }
.ide-shell .ai-t strong { color: var(--ic-fg); }
.ide-shell .ai-t span { color: var(--ic-fg-muted); }
.ide-shell .ai-x { color: var(--ic-fg-faint); }
.ide-shell .ai-x:hover { color: var(--ic-fg); background: var(--ic-hover); }
.ide-shell .ai-msg .who { color: var(--ic-fg-faint); }
.ide-shell .ai-bubble { color: var(--ic-fg-2); }
.ide-shell .ai-bubble.user { color: var(--ic-fg-2); background: var(--ic-active-bg); border-color: var(--ic-border); }
.ide-shell .ai-bubble code,
.ide-shell .ai-ctx,
.ide-shell .ai-mode { color: var(--ic-fg); background: var(--ic-chip); border-color: var(--ic-border-soft); }
.ide-shell .ai-output { color: var(--ic-fg-2); background: var(--ic-code-bg); border-color: var(--ic-code-border); }
.ide-shell .ai-compose { border-top-color: var(--ic-border-soft); }
.ide-shell .ai-ctx,
.ide-shell .ai-mode { color: var(--ic-fg-muted); }
.ide-shell .ai-input-wrap { background: var(--ic-chrome); border-color: var(--ic-border); }
.ide-shell .ai-input-wrap textarea { color: var(--ic-fg); background: transparent; }

/* settings drawer (shares the right-panel chrome) --------------------- */
.ide-shell .settings-section h3 { color: var(--ic-fg-faint); }
.ide-shell .settings-section label { color: var(--ic-fg-muted); }
.ide-shell .settings-kv {
  color: var(--ic-fg-muted); background: var(--ic-code-bg); border-color: var(--ic-border-soft);
}
.ide-shell .settings-kv strong { color: var(--ic-fg); }
.ide-shell .theme-switch button,
.ide-shell .muted-section button {
  color: var(--ic-fg); background: var(--ic-chrome); border-color: var(--ic-border);
}
.ide-shell .theme-switch button.active { color: var(--ic-active-fg); background: var(--ic-active-bg); border-color: transparent; }
.ide-shell .scm-section-title,
.ide-shell .scm-summary strong { color: var(--ic-fg); }
.ide-shell .empty-panel,
.ide-shell .member-row span,
.ide-shell .resource-row span { color: var(--ic-fg-muted); }
.ide-shell .member-row strong,
.ide-shell .resource-row strong { color: var(--ic-fg); }
.ide-shell .resource-metrics span {
  color: var(--ic-fg-muted);
  background: var(--ic-chip);
  border-color: var(--ic-border-soft);
}
.ide-shell .resource-metrics code { color: var(--ic-fg); }

/* form controls inside the themed panels (terminal/model/settings) ---- */
.ide-shell .assistant-panel input,
.ide-shell .assistant-panel textarea,
.ide-shell .assistant-panel select,
.ide-shell .bottom-panel input,
.ide-shell .bottom-panel textarea {
  color: var(--ic-fg); background: var(--ic-code-bg); border-color: var(--ic-border);
}
.ide-shell .ai-input-wrap textarea { background: transparent; }

/* =====================================================================
   Ember alignment v2 — nested file tree, highlighted editor, leak audit.
   ---------------------------------------------------------------------
   This block is intentionally LAST so it wins the cascade over the older
   layered rules that hard-coded light --cc-* surfaces (e.g. .file-list
   used var(--cc-surface) = white, which leaked white into dark mode).
   Every IDE surface is re-pinned to the --ic-* / --ed-* token system set
   on the .ide-shell.ide-theme-* root, so each theme is fully cohesive.
   ===================================================================== */

/* ---- editor syntax tokens (per theme) ------------------------------- */
.ide-shell.ide-theme-light {
  --ed-gutter: #b8c0cf;
  --ed-line: #eef0f4;
  --ed-hl: #f3f6fc;
  --ed-key: #9333ea;
  --ed-str: #1f8a5b;
  --ed-com: #9aa0a6;
  --ed-fn: #2563eb;
  --ed-num: #c45f00;
  --ed-typ: #b06000;
  --ed-pun: #5b6470;
  --ed-tag: #c5392e;
}
.ide-shell.ide-theme-dark {
  --ed-gutter: #41506b;
  --ed-line: rgba(255, 255, 255, 0.06);
  --ed-hl: rgba(255, 255, 255, 0.045);
  --ed-key: #c792ea;
  --ed-str: #c3e88d;
  --ed-com: #5b6b86;
  --ed-fn: #82aaff;
  --ed-num: #f78c6c;
  --ed-typ: #ffcb6b;
  --ed-pun: #89a4c7;
  --ed-tag: #f07178;
}

/* ---- workbench column (own background; not the legacy --ed-bg) ------- */
.ide-shell .workbench,
.ide-shell .editor-col {
  background: var(--ic-editor);
}

/* ---- file tree: nested + collapsible -------------------------------- */
/* Keep Explorer actions visible after legacy side-header overrides. */
.ide-shell .side-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
}

.ide-shell .ft-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.ide-shell .ft-act {
  min-width: 30px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--ic-border);
  border-radius: 8px;
  padding: 0 8px;
  color: var(--ic-fg);
  background: var(--ic-chip);
  font-weight: 700;
}

.ide-shell .ft-act:hover {
  color: var(--ic-fg);
  background: var(--ic-hover);
}

.ide-shell .ft-new-file {
  color: var(--ic-active-fg);
  background: var(--ic-active-bg);
  border-color: transparent;
}

.ide-shell .ft-new-file span {
  font-size: 12px;
}

.ide-shell .ft-create-row {
  border-bottom: 1px solid var(--ic-border-soft);
  padding: 8px 12px;
}

.ide-shell .ft-create-main {
  width: 100%;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ic-active-fg);
  background: var(--ic-active-bg);
  font-size: 12px;
  font-weight: 800;
}

.ide-shell .ft-create-main:hover {
  filter: brightness(1.06);
}

/* Kill the legacy white --cc-surface on the scroll list (the dark-mode leak). */
.ide-shell .file-list,
.ide-shell .ft-list {
  background: var(--ic-panel);
  padding: 8px 8px 14px;
  overflow: auto;
}

.ide-shell .ft-empty {
  display: grid;
  justify-items: start;
  gap: 10px;
  padding: 14px 8px;
}

.ide-shell .ft-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

/* Plan A — file-type icon badges (tree + tabs + search) */
.ide-shell .ft-typeico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; flex: 0 0 auto; border-radius: 4px;
  font: 700 8.5px/1 var(--mra-font-mono, ui-monospace, monospace);
  color: var(--ti, var(--ic-fg-muted));
  background: color-mix(in srgb, var(--ti, #9aa0a6) 16%, transparent);
}
.ide-shell .tab .ft-typeico { width: 15px; height: 15px; font-size: 8px; }

/* Plan A — indent guides: a faint vertical line per nested level, under the chevron */
.ide-shell .ft-children.guided { position: relative; }
.ide-shell .ft-children.guided::before {
  content: ""; position: absolute; left: var(--gx, 18px); top: 0; bottom: 2px;
  width: 1px; background: var(--ic-border); opacity: .65; pointer-events: none;
}

/* Plan A — breadcrumb path bar */
.ide-shell .ide-breadcrumb {
  display: flex; align-items: center; gap: 5px; flex-wrap: nowrap; overflow: hidden;
  height: 28px; padding: 0 13px; background: var(--ic-bg);
  border-bottom: 1px solid var(--ic-border-soft);
  font: 500 12px/1 var(--mra-font, -apple-system, system-ui, sans-serif);
  color: var(--ic-fg-muted); white-space: nowrap;
}
.ide-shell .ide-breadcrumb .bc-root { color: var(--ic-fg-muted); }
.ide-shell .ide-breadcrumb .bc-seg {
  border: 0; background: transparent; color: var(--ic-fg-muted);
  font: inherit; cursor: pointer; padding: 2px 4px; border-radius: 5px;
}
.ide-shell .ide-breadcrumb .bc-seg:hover { background: var(--ic-hover); color: var(--ic-fg); }
.ide-shell .ide-breadcrumb .bc-sep { color: var(--ic-fg-faint); display: inline-flex; opacity: .6; }
.ide-shell .ide-breadcrumb .bc-file { display: inline-flex; align-items: center; gap: 6px; color: var(--ic-fg); min-width: 0; }
.ide-shell .ide-breadcrumb .bc-fname { overflow: hidden; text-overflow: ellipsis; }

/* Plan A — tab strip overflow: scroll horizontally instead of wrapping/clipping */
.ide-shell .tabbar { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.ide-shell .tabbar::-webkit-scrollbar { height: 0; }

.ide-shell .ft-empty-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ide-shell .ft-children { display: block; }
.ide-shell .ft-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  padding: 4px 8px;
  border: 0;
  border-radius: 7px;
  color: var(--ic-fg-2);
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  user-select: none;
  transition: background 120ms ease, color 120ms ease;
}
.ide-shell .ft-row:hover { background: var(--ic-hover); color: var(--ic-fg); }
.ide-shell .ft-row.active {
  color: var(--ic-active-fg);
  background: var(--ic-active-bg);
  font-weight: 650;
}
/* Drag-and-drop (VS Code style): the dragged row dims, the destination folder gets
   a highlighted ring, and the list background highlights when dropping to the root. */
.ide-shell .ft-row.dragging { opacity: 0.45; }
.ide-shell .ft-row.drop-target,
.ide-shell .ft-list.drop-target {
  background: var(--ic-active-bg);
  box-shadow: inset 0 0 0 1px var(--mra-blue, #2563eb);
  border-radius: 7px;
}
.ide-shell .ft-list.drop-target { box-shadow: inset 0 0 0 2px var(--mra-blue, #2563eb); }
.ide-shell .ft-row .ft-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ide-shell .ft-chev {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 14px;
  color: var(--ic-fg-faint);
  transition: transform 120ms ease;
}
.ide-shell .ft-chev.open { transform: rotate(90deg); }
.ide-shell .ft-ico {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 16px;
  color: var(--ic-fg-faint);
}
.ide-shell .ft-ico.folder { color: var(--cc-orange); }
.ide-shell .ft-row.active .ft-ico:not(.folder) { color: var(--ic-active-fg); }
.ide-shell .ft-dot-lang {
  width: 8px;
  height: 8px;
  display: block;
  border-radius: 2px;
}
.ide-shell .ft-badge {
  margin-left: auto;
  flex: 0 0 auto;
  font-family: var(--cc-font-mono);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
  padding: 0 5px;
  border-radius: 4px;
}
.ide-shell .ft-badge.M { color: var(--cc-yellow); background: var(--cc-yellow-soft); }
.ide-shell .ft-badge.U,
.ide-shell .ft-badge.A { color: var(--cc-green); background: var(--cc-green-soft); }
.ide-shell .ft-badge.D { color: var(--cc-red); background: var(--cc-red-soft); }
.ide-shell.ide-theme-dark .ft-badge.M { color: #f9c455; background: rgba(249, 171, 0, 0.16); }
.ide-shell.ide-theme-dark .ft-badge.U,
.ide-shell.ide-theme-dark .ft-badge.A { color: #6cd39a; background: rgba(31, 138, 91, 0.18); }
.ide-shell.ide-theme-dark .ft-badge.D { color: #f0a59e; background: rgba(217, 48, 37, 0.16); }
.ide-shell .ft-empty,
.ide-shell .ft-loading {
  padding: 10px 12px;
  color: var(--ic-fg-faint);
  font-size: 12px;
}
.ide-shell .workspace-title {
  padding: 10px 14px 4px;
  color: var(--ic-fg-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ide-shell .ft-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--ic-border-soft);
  padding: 9px 14px;
  color: var(--ic-fg-muted);
  font-size: 12px;
}
.ide-shell .ft-foot .gb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--cc-font-mono);
}
.ide-shell .ft-foot .ft-changes { margin-left: auto; color: var(--cc-amber); }

/* ---- editor tabs: lang dot + filename + unsaved dot + close + rule --- */
.ide-shell .workspace-tabs,
.ide-shell .tabbar { background: var(--ic-tab-bar); border-bottom-color: var(--ic-border); }
.ide-shell .tab {
  color: var(--ic-fg-muted);
  background: var(--ic-tab-inactive);
  border-right-color: var(--ic-border-soft);
}
.ide-shell .tab:hover { color: var(--ic-fg); background: var(--ic-hover); }
.ide-shell .tab.active { color: var(--ic-fg); background: var(--ic-editor); }
.ide-shell .tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--cc-blue);
}
.ide-shell .tab { position: relative; }
.ide-shell .tab .tclose:hover { background: rgba(127, 127, 127, 0.18); }

/* ---- editor: line-number gutter + highlight overlay + textarea ------- */
.ide-shell .editor-area { background: var(--ic-editor); }
.ide-shell .code-editor-wrap {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  background: var(--ic-editor);
  overflow: hidden;
}
.ide-shell .code-gutter {
  overflow: hidden;
  padding: 14px 12px 14px 18px;
  border-right: 1px solid var(--ed-line);
  color: var(--ed-gutter);
  font-family: var(--cc-font-mono);
  font-size: 13px;
  line-height: 1.62;
  text-align: right;
  user-select: none;
  white-space: pre;
}
.ide-shell .code-gutter div { height: 21.06px; }
@supports (height: 1lh) {
  .ide-shell .code-gutter { line-height: 1.62; }
  .ide-shell .code-gutter div { height: 1lh; }
}
.ide-shell .code-scroll {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
/* The highlight layer and the textarea must align glyph-for-glyph. */
.ide-shell .code-highlight,
.ide-shell .code-editor {
  margin: 0;
  padding: 14px 18px;
  border: 0;
  font-family: var(--cc-font-mono);
  font-size: 13px;
  line-height: 1.62;
  tab-size: 2;
  -moz-tab-size: 2;
  white-space: pre;
  word-wrap: normal;
  overflow-wrap: normal;
}
.ide-shell .code-highlight {
  position: absolute;
  inset: 0;
  overflow: auto;
  background: var(--ic-editor);
  color: var(--ic-fg);
  pointer-events: none;
}
.ide-shell .code-highlight code {
  font: inherit;
  white-space: pre;
}
.ide-shell .code-editor {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  resize: none;
  overflow: auto;
  background: transparent;
  color: transparent;
  caret-color: var(--ic-fg);
  -webkit-text-fill-color: transparent;
  box-shadow: none;
}
.ide-shell .code-editor::selection { background: rgba(37, 99, 235, 0.30); }
.ide-shell.ide-theme-dark .code-editor::selection { background: rgba(130, 170, 255, 0.30); }
.ide-shell .code-editor:focus { box-shadow: none; outline: none; }
.ide-shell .code-editor::placeholder { color: var(--ic-fg-faint); }

/* syntax token colors (used by both the overlay and the AI diff blocks) */
.ide-shell .tk-key { color: var(--ed-key); }
.ide-shell .tk-str { color: var(--ed-str); }
.ide-shell .tk-com { color: var(--ed-com); font-style: italic; }
.ide-shell .tk-fn { color: var(--ed-fn); }
.ide-shell .tk-num { color: var(--ed-num); }
.ide-shell .tk-typ { color: var(--ed-typ); }
.ide-shell .tk-pun { color: var(--ed-pun); }
.ide-shell .tk-tag { color: var(--ed-tag); }

/* ---- editor toolbar (re-pin off legacy --ed-panel) ------------------ */
.ide-shell .editor-toolbar {
  background: var(--ic-chrome);
  border-bottom-color: var(--ic-border-soft);
  color: var(--ic-fg-2);
}
.ide-shell .editor-toolbar strong { color: var(--ic-fg); }
.ide-shell .editor-toolbar span { color: var(--ic-fg-muted); }

/* ---- terminal / bottom panel (196px) — re-pin off legacy --ed-* ----- */
.ide-shell .bottom-panel,
.ide-shell .terminal {
  height: var(--term-h, 196px);
  background: var(--ic-editor);
  color: var(--ic-fg-2);
  border-top-color: var(--ic-border);
}
.ide-shell .bottom-tabs { background: var(--ic-editor); border-bottom-color: var(--ic-border-soft); }
.ide-shell .bottom-tabs button { color: var(--ic-fg-muted); }
.ide-shell .bottom-tabs button.active { color: var(--ic-fg); background: var(--ic-hover); }
.ide-shell .term-count { color: var(--ic-fg-faint); }
.ide-shell .terminal-form,
.ide-shell .model-form { background: var(--ic-editor); }
.ide-shell .terminal-form input,
.ide-shell .model-form textarea,
.ide-shell .model-panel textarea {
  color: var(--ic-fg);
  background: var(--ic-code-bg);
  border-color: var(--ic-border);
}
.ide-shell .terminal-output,
.ide-shell .model-output {
  color: var(--ic-fg-2);
  background: var(--ic-editor);
}
.ide-shell .model-panel { background: var(--ic-editor); }
.ide-shell .problems-panel { background: var(--ic-editor); }

/* ---- source-control / project panels in the sidebar (leak audit) ---- */
.ide-shell .change-list { background: var(--ic-panel); }
.ide-shell .change-row { color: var(--ic-fg-2); background: transparent; }
.ide-shell .change-row:hover { color: var(--ic-active-fg); background: var(--ic-hover); }
.ide-shell .change-row span { color: inherit; }
.ide-shell .change-badge {
  font-family: var(--cc-font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--cc-amber);
}
.ide-shell .scm-summary,
.ide-shell .run-card,
.ide-shell .commit-box,
.ide-shell .member-row,
.ide-shell .resource-row,
.ide-shell .empty-panel,
.ide-shell .settings-kv {
  color: var(--ic-fg-2);
  background: var(--ic-code-bg);
  border-color: var(--ic-border-soft);
}
.ide-shell .scm-summary span,
.ide-shell .run-card p,
.ide-shell .member-row span,
.ide-shell .resource-row span,
.ide-shell .empty-panel { color: var(--ic-fg-muted); }
.ide-shell .scm-section-title { color: var(--ic-fg); }
.ide-shell .commit-box textarea,
.ide-shell .member-form input,
.ide-shell .member-form select,
.ide-shell .settings-stack input,
.ide-shell .settings-stack select {
  color: var(--ic-fg);
  background: var(--ic-code-bg);
  border-color: var(--ic-border);
}
.ide-shell .side-header button,
.ide-shell .path-tools button,
.ide-shell .run-card button,
.ide-shell .settings-stack button,
.ide-shell .member-form button {
  color: var(--ic-fg);
  background: var(--ic-chip);
  border-color: var(--ic-border);
}
.ide-shell .side-header button:hover,
.ide-shell .run-card button:hover,
.ide-shell .settings-stack button:hover,
.ide-shell .member-form button:hover { background: var(--ic-hover); }

/* ---- welcome pane (re-pin off legacy --ed-bg) ----------------------- */
.ide-shell .welcome-pane { background: var(--ic-editor); color: var(--ic-fg-muted); }
.ide-shell .welcome-pane h2 { color: var(--ic-fg); }
.ide-shell .welcome-pane p { color: var(--ic-fg-muted); }

/* ---- notice strip inside editor ------------------------------------- */
.ide-shell .editor-area .notice {
  color: var(--ic-fg-2);
  background: var(--ic-code-bg);
  border-color: var(--ic-border-soft);
}

/* ---- reusable error notice (NO silent failures) --------------------- */
/* Surfaces the server's real failure message in a visible, danger-themed
   strip. Used across the editor area, explorer, source control, and the
   project-access panels so every backend-backed action that fails shows
   *why*. Themed via --ic-danger-* so it reads correctly in light + dark. */
.ide-shell .ic-error {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 10px 12px 0;
  padding: 8px 10px;
  border: 1px solid var(--ic-danger-line);
  border-radius: 6px;
  color: var(--ic-danger-fg);
  background: var(--ic-danger-bg);
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}
.ide-shell .ic-error.compact {
  margin: 8px 0 4px;
}
.ide-shell .ic-error svg {
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--ic-danger-fg);
}
.ide-shell .ic-error span {
  min-width: 0;
}

/* Narrow error row for list surfaces (file tree, members, resources,
   search results) where a full notice block would break the column rhythm. */
.ide-shell .ic-error-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 4px 8px;
  padding: 7px 9px;
  border: 1px solid var(--ic-danger-line);
  border-radius: 6px;
  color: var(--ic-danger-fg);
  background: var(--ic-danger-bg);
  font-size: 12px;
  line-height: 1.4;
  word-break: break-word;
}
.ide-shell .ic-error-row.nested {
  margin: 2px 8px 2px 0;
}
.ide-shell .ic-error-row svg {
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--ic-danger-fg);
}
.ide-shell .ic-error-row span {
  min-width: 0;
}

/* ---- in-chrome sun/moon theme toggle (matches the design's .ide-seg) - */
.ide-shell .ide-seg {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--ic-border);
  border-radius: 8px;
  overflow: hidden;
}
.ide-shell .ide-seg button {
  display: grid;
  place-items: center;
  padding: 6px 9px;
  border: 0;
  color: var(--ic-fg-muted);
  background: var(--ic-chrome);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.ide-shell .ide-seg button + button { border-left: 1px solid var(--ic-border); }
.ide-shell .ide-seg button:hover { color: var(--ic-fg); background: var(--ic-hover); }
.ide-shell .ide-seg button.active { color: var(--ic-active-fg); background: var(--ic-active-bg); }

/* =====================================================================
   Terminal console — design-compliant + functional + honest.
   ---------------------------------------------------------------------
   Matches the Ember spec: a 34px .term-head with shell / dev server / ports
   tabs, a scrolling mono .term-body that renders REAL command output as
   styled console lines, an inline (invisible) live prompt input, and a
   blinking green cursor. All colors read the --ic-* / --cc-* / --ed-*
   token system, so both light and dark themes are cohesive. Appended last
   so it wins the cascade over the legacy .terminal-form/.terminal-output
   rules left above.
   ===================================================================== */

/* collapse: the whole bottom panel shrinks to just its 34px tab strip */
.ide-shell .bottom-panel.collapsed,
.ide-shell .terminal.collapsed {
  height: 34px;
  grid-template-rows: 34px;
}
.ide-shell .bottom-tabs .th-btn {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 0;
  border-radius: 6px;
  color: var(--ic-fg-muted);
  background: transparent;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.ide-shell .bottom-tabs .th-btn:hover { color: var(--ic-fg); background: var(--ic-hover); }
.ide-shell .bottom-tabs .th-chev {
  display: grid;
  place-items: center;
  transition: transform 120ms ease;
  transform: rotate(90deg);
}
.ide-shell .bottom-tabs .th-chev.collapsed { transform: rotate(-90deg); }

/* the terminal view fills row 2 of the panel with its own head + body grid */
.ide-shell .terminal-console {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: 34px minmax(0, 1fr);
  overflow: hidden;
}

/* sub-tab head */
.ide-shell .term-head {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  border-bottom: 1px solid var(--ic-border-soft);
  background: var(--ic-editor);
}
.ide-shell .term-head .spacer { flex: 1; }
.ide-shell .term-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 6px;
  padding: 5px 11px;
  color: var(--ic-fg-muted);
  background: transparent;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms ease, color 120ms ease;
}
.ide-shell .term-tab:hover { color: var(--ic-fg); background: var(--ic-hover); }
.ide-shell .term-tab.active { color: var(--ic-fg); font-weight: 650; background: var(--ic-hover); }
.ide-shell .term-tab svg { width: 13px; height: 13px; flex: 0 0 auto; }
.ide-shell .term-cwd {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 6px;
  color: var(--ic-fg-faint);
  font-family: var(--cc-font-mono);
  font-size: 11px;
  white-space: nowrap;
}
.ide-shell .term-cwd svg { flex: 0 0 auto; }

/* console body — real output as styled lines */
.ide-shell .term-body {
  min-height: 0;
  overflow-y: auto;
  padding: 10px 14px;
  background: var(--ic-editor);
  color: var(--ic-fg-2);
  font-family: var(--cc-font-mono);
  font-size: 12.5px;
  line-height: 1.6;
}
.ide-shell .term-body .t-line {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ide-shell .term-body .t-prompt { color: var(--cc-green); }
.ide-shell .term-body .t-path { color: var(--cc-blue); }
.ide-shell.ide-theme-dark .term-body .t-path { color: #82aaff; }
.ide-shell .term-body .t-dim { color: var(--ed-com); }
.ide-shell .term-body .t-ok { color: var(--cc-green); }
.ide-shell.ide-theme-dark .term-body .t-ok { color: #6cd39a; }
.ide-shell .term-body .t-warn { color: var(--cc-amber); }
.ide-shell .term-body .t-err { color: var(--cc-red); }
.ide-shell.ide-theme-dark .term-body .t-err { color: #f0a59e; }

/* inline live prompt: an invisible input that sits on the prompt line */
.ide-shell .term-body .t-live { display: flex; align-items: baseline; flex-wrap: wrap; }
.ide-shell .term-body .t-input-wrap { flex: 1 1 60px; min-width: 60px; }
.ide-shell .term-body .t-input {
  width: 100%;
  margin: 0 0 0 6px;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ic-fg);
  font-family: var(--cc-font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  caret-color: transparent;
}
.ide-shell .term-body .t-input:disabled { color: var(--ic-fg-muted); }
.ide-shell .term-body .t-input::placeholder { color: var(--ic-fg-faint); }

.ide-shell .guest-term-body {
  position: relative;
  cursor: text;
}

.ide-shell .guest-term-body:focus-within {
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.22);
}

.ide-shell .guest-term-body .t-raw-input,
.ide-shell .guest-term-body .t-raw-input:hover,
.ide-shell .guest-term-body .t-raw-input:focus,
.ide-shell .guest-term-body .t-raw-input:focus-visible {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  min-height: 1px;
  margin: 0;
  padding: 0;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  resize: none;
  opacity: 0.01;
  color: transparent;
  background: transparent !important;
  caret-color: transparent;
  appearance: none;
  overflow: hidden;
}

/* blinking green block cursor on the live line */
.ide-shell .term-cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  margin-left: 1px;
  background: var(--cc-green);
  vertical-align: text-bottom;
  animation: term-blink 1.1s step-end infinite;
}
.ide-shell.ide-theme-dark .term-cursor { background: #6cd39a; }
.ide-shell .term-cursor.busy { animation: none; opacity: 0.5; }
@keyframes term-blink { 50% { opacity: 0; } }

/* inline action links inside the console (ports refresh, open bash) */
.ide-shell .term-body .t-link,
.ide-shell .ft-empty .t-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  padding: 0;
  color: var(--cc-blue);
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.ide-shell.ide-theme-dark .term-body .t-link,
.ide-shell.ide-theme-dark .ft-empty .t-link { color: #82aaff; }
.ide-shell .term-body .t-link:hover,
.ide-shell .ft-empty .t-link:hover { text-decoration: underline; }
.ide-shell .term-body .t-link svg,
.ide-shell .ft-empty .t-link svg { flex: 0 0 auto; }

/* The bottom panel IS the terminal (Ember design): a single term-head row
   (shell / dev server / ports + collapse), no redundant outer tab strip.
   The .terminal-console fills the whole panel and supplies its own 34px head
   + 1fr body grid. Collapsed shows only the 34px head. */
.ide-shell .bottom-panel.terminal { grid-template-rows: minmax(0, 1fr); }
.ide-shell .bottom-panel.terminal.collapsed { height: 34px; grid-template-rows: 34px; }
.ide-shell .term-head .th-btn {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 0;
  border-radius: 6px;
  color: var(--ic-fg-muted);
  background: transparent;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.ide-shell .term-head .th-btn:hover { color: var(--ic-fg); background: var(--ic-hover); }
.ide-shell .term-head .th-chev { display: grid; place-items: center; transition: transform 120ms ease; transform: rotate(90deg); }
.ide-shell .term-head .th-chev.collapsed { transform: rotate(-90deg); }

.ide-shell .t-pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ic-fg);
  font: inherit;
}

/* Keep Explorer file creation unmistakable in both IDE themes. */
.ide-shell .sidebar.filetree,
.ide-shell .sidebar {
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
}

.ide-shell .side-header,
.ide-shell .workspace-title,
.ide-shell .ft-create-row,
.ide-shell .file-list,
.ide-shell .ft-list,
.ide-shell .ft-foot {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.ide-shell .side-header .ft-new-file,
.ide-shell .ft-create-main {
  color: #ffffff !important;
  background: #2563eb !important;
  border-color: #2563eb !important;
}

.ide-shell .side-header .ft-new-file:hover,
.ide-shell .ft-create-main:hover {
  color: #ffffff !important;
  background: #1d4ed8 !important;
  border-color: #1d4ed8 !important;
  filter: none;
}

.ide-shell .ft-new-file .ft-plus,
.ide-shell .ft-create-main .ft-plus,
.ide-shell .ft-new-file .ft-label,
.ide-shell .ft-create-main .ft-label {
  display: inline-block;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff;
  white-space: nowrap;
}

.ide-shell .ft-new-file .ft-plus,
.ide-shell .ft-create-main .ft-plus {
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

/* OpenCoder-style assistant session panel -------------------------- */
.ide-shell .cc-agent-panel {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-width: 0;
  color: var(--ic-fg);
  background: var(--ic-panel);
}

.ide-shell .cc-agent-head {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid var(--ic-border-soft);
  padding: 10px 12px;
}

.ide-shell .cc-agent-mark,
.ide-shell .cc-agent-card-icon,
.ide-shell .cc-agent-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.ide-shell .cc-agent-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: #ffffff;
  background: #f59e0b;
}

.ide-shell .cc-agent-title {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.ide-shell .cc-agent-title strong {
  color: var(--ic-fg);
  font-size: 13px;
  line-height: 1.2;
}

.ide-shell .cc-agent-title span {
  overflow: hidden;
  color: var(--ic-fg-muted);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ide-shell .cc-agent-icon-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--ic-fg-muted);
  background: transparent;
}

.ide-shell .cc-agent-icon-btn:hover {
  color: var(--ic-fg);
  background: var(--ic-hover);
  border-color: var(--ic-border-soft);
}

.ide-shell .cc-agent-route,
.ide-shell .cc-agent-compose-context,
.ide-shell .cc-agent-templates,
.ide-shell .cc-agent-send-group {
  display: flex;
  align-items: center;
}

.ide-shell .cc-agent-route {
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--ic-border-soft);
  padding: 8px 12px;
}

.ide-shell .cc-agent-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--ic-border-soft);
  border-radius: 6px;
  padding: 3px 7px;
  color: var(--ic-fg-muted);
  background: var(--ic-chip);
  font-size: 11px;
  white-space: nowrap;
}

.ide-shell .cc-agent-pill.ok {
  color: var(--ic-sandbox-fg);
  border-color: var(--ic-sandbox-line);
  background: rgba(31, 138, 91, 0.12);
}

.ide-shell .cc-agent-body {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.ide-shell .cc-agent-context-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border-bottom: 1px solid var(--ic-border-soft);
  padding: 10px 12px;
}

.ide-shell .cc-agent-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  border: 1px solid var(--ic-border-soft);
  border-radius: 7px;
  padding: 8px;
  background: var(--ic-code-bg);
}

.ide-shell .cc-agent-card.wide {
  grid-column: 1 / -1;
}

.ide-shell .cc-agent-card-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  color: var(--ic-active-fg);
  background: var(--ic-active-bg);
}

.ide-shell .cc-agent-card div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.ide-shell .cc-agent-card span,
.ide-shell .cc-agent-card em {
  overflow: hidden;
  color: var(--ic-fg-muted);
  font-size: 10px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ide-shell .cc-agent-card strong {
  overflow: hidden;
  color: var(--ic-fg);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ide-shell .cc-agent-transcript {
  min-width: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 12px;
}

.ide-shell .cc-agent-entry {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.ide-shell .cc-agent-entry-head {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.ide-shell .cc-agent-entry-head strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ic-fg);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ide-shell .cc-agent-avatar {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: #ffffff;
  background: var(--ic-active-bg);
  font-size: 9px;
  font-weight: 800;
}

.ide-shell .cc-agent-avatar.system {
  color: var(--ic-sandbox-fg);
  background: rgba(31, 138, 91, 0.16);
}

.ide-shell .cc-agent-avatar.user {
  background: #2563eb;
}

.ide-shell .cc-agent-entry-status {
  flex: 0 0 auto;
  border: 1px solid var(--ic-border-soft);
  border-radius: 999px;
  padding: 2px 7px;
  color: var(--ic-fg-muted);
  background: var(--ic-chip);
  font-size: 10px;
}

.ide-shell .cc-agent-entry-status.streaming {
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.32);
  background: rgba(37, 99, 235, 0.1);
}

.ide-shell .cc-agent-entry-status.done,
.ide-shell .cc-agent-entry-status.ready {
  color: var(--ic-sandbox-fg);
  border-color: var(--ic-sandbox-line);
  background: rgba(31, 138, 91, 0.12);
}

.ide-shell .cc-agent-entry-status.error,
.ide-shell .cc-agent-entry-status.stopped {
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.38);
  background: rgba(245, 158, 11, 0.13);
}

.ide-shell .cc-agent-entry-body {
  min-width: 0;
  border: 1px solid var(--ic-border-soft);
  border-radius: 7px;
  padding: 9px 10px;
  color: var(--ic-fg-2);
  background: var(--ic-code-bg);
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.ide-shell .cc-agent-entry.user .cc-agent-entry-body {
  color: var(--ic-active-fg);
  background: var(--ic-active-bg);
  border-color: transparent;
}

.ide-shell .cc-agent-entry.system .cc-agent-entry-body {
  color: var(--ic-fg-muted);
  background: var(--ic-chip);
}

.ide-shell .cc-agent-entry.assistant .cc-agent-entry-body {
  max-height: none;
  margin: 0;
  font-family: var(--cc-font-mono);
}

.ide-shell .cc-agent-permission,
.ide-shell .cc-agent-diff-box {
  display: grid;
  gap: 9px;
}

.ide-shell .cc-agent-permission dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 8px;
  margin: 0;
  color: var(--ic-fg-muted);
  font-size: 11px;
}

.ide-shell .cc-agent-permission dt {
  color: var(--ic-fg-faint);
}

.ide-shell .cc-agent-permission dd {
  min-width: 0;
  margin: 0;
  color: var(--ic-fg);
  overflow-wrap: anywhere;
}

.ide-shell .cc-agent-permission pre,
.ide-shell .cc-agent-diff {
  max-height: 210px;
  margin: 0;
  overflow: auto;
  border: 1px solid var(--ic-border-soft);
  border-radius: 6px;
  padding: 8px;
  color: var(--ic-fg-2);
  background: var(--ic-editor);
  font-family: var(--cc-font-mono);
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.ide-shell .cc-agent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.ide-shell .cc-agent-actions button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--ic-border-soft);
  border-radius: 6px;
  padding: 5px 9px;
  color: var(--ic-fg);
  background: var(--ic-chip);
  font-size: 11px;
  font-weight: 750;
}

.ide-shell .cc-agent-actions button:hover:not(:disabled) {
  background: var(--ic-hover);
}

.ide-shell .cc-agent-actions button:disabled {
  cursor: default;
  opacity: 0.48;
}

.ide-shell .cc-agent-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  border: 1px dashed var(--ic-border-soft);
  border-radius: 8px;
  padding: 18px 14px;
  color: var(--ic-fg-muted);
  text-align: center;
}

.ide-shell .cc-agent-empty span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #ffffff;
  background: #f59e0b;
}

.ide-shell .cc-agent-empty strong {
  color: var(--ic-fg);
  font-size: 13px;
}

.ide-shell .cc-agent-empty p {
  max-width: 28ch;
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.ide-shell .cc-agent-compose {
  gap: 8px;
  padding: 10px 12px 12px;
}

.ide-shell .cc-agent-templates {
  flex-wrap: wrap;
  gap: 6px;
}

.ide-shell .cc-agent-templates button {
  border: 1px solid var(--ic-border-soft);
  border-radius: 6px;
  padding: 4px 8px;
  color: var(--ic-fg);
  background: var(--ic-chip);
  font-size: 11px;
  font-weight: 700;
}

.ide-shell .cc-agent-templates button:hover {
  background: var(--ic-hover);
}

.ide-shell .cc-agent-input textarea {
  min-height: 78px;
  max-height: 180px;
  font-size: 12.5px;
  line-height: 1.45;
}

.ide-shell .cc-agent-send-group {
  gap: 7px;
}

.ide-shell .cc-agent-stop {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(245, 158, 11, 0.42);
  border-radius: 8px;
  color: #b45309;
  background: rgba(245, 158, 11, 0.12);
}

@media (max-width: 1280px) {
  .ide-shell .cc-agent-context-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* =====================================================================
   EMBER — Secure Workspaces. Dashboard surfaces ported from the design
   handoff (MRA visual system). Tokens below alias the design's MRA and
   Ember token names to the exact handoff values so the new-surface
   rules can be pasted verbatim and render pixel-identically. These are
   additive and do not collide with the existing CC-web dashboard tokens.
   ===================================================================== */
:root {
  --mra-blue: #2563eb;
  --mra-blue-strong: #1d4ed8;
  --mra-blue-soft: #eef3fe;
  --mra-blue-line: #d2dfff;
  --mra-orange: #f38020;
  --mra-amber: #f9ab00;
  --mra-orange-strong: #c45f00;
  --mra-ink: #1f2937;
  --mra-fg-2: #1f2937;
  --mra-fg-muted: #5b6470;
  /* Darkened from #98a0aa (~2.5:1 on white, failed WCAG AA) to ~4.8:1 so faint
     timestamps, fact icons and counts are legible while staying de-emphasized. */
  --mra-fg-faint: #6b7280;
  --mra-line: #e6eaef;
  --mra-soft-line: #eef0f4;
  --mra-canvas: #f7f9fc;
  --mra-surface: #ffffff;
  --mra-green: #1f8a5b;
  --mra-green-soft: #e7f5ee;
  --mra-yellow: #b06000;
  --mra-yellow-soft: #fdf3d8;
  --mra-red: #c5392e;
  --mra-red-soft: #fdebe9;
  --mra-shadow-1: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.05);
  --mra-shadow-2: 0 6px 16px rgba(15, 23, 42, 0.08);
  --mra-shadow-3: 0 18px 46px rgba(11, 18, 32, 0.08);
  --mra-shadow-modal: 0 30px 80px rgba(10, 15, 25, 0.26);
  --mra-font-ui: "Roboto Flex", system-ui, sans-serif;
  --mra-font-num: "Geist", "Roboto Flex", system-ui, sans-serif;
  --mra-font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --mra-radius-xl: 18px;
  --mra-tint-warm: #fff6e5;
  --mra-border-green: #b7dfc4;
  --mra-border-red: #f3c0bc;
  --mra-border-amber: #f5dca0;
  --eb-orange: #f38020;
  --eb-amber: #f9ab00;
  --eb-radius-card: 14px;
}

/* brand mark holds the flame glyph */
.eb-mark svg { color: #fff; }

/* global small spinner (SCM, deploy, CI/CD, repo controls) */
.bs-spin {
  display: inline-block; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--mra-blue-soft); border-top-color: var(--mra-blue);
  animation: spin 0.7s linear infinite; vertical-align: -2px;
}
.bs-spin.sm { width: 13px; height: 13px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* shared lite button + danger button used across repo/CI controls */
.ide-btn-lite { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--mra-line); background: var(--mra-surface); color: var(--mra-ink); border-radius: 8px; padding: 8px 12px; font: inherit; font-size: .84rem; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background 120ms ease, border-color 120ms ease, transform 120ms ease; }
.ide-btn-lite:hover:not(:disabled) { background: #fbfcfe; border-color: #d6dde5; }
.ide-btn-lite:disabled { opacity: .6; cursor: progress; }
.ide-btn-lite.sm { padding: 6px 10px; font-size: .8rem; }
.ide-btn-lite.ghost { border-color: transparent; color: var(--mra-fg-muted); }
.btn.btn-primary.sm { padding: 8px 13px; font-size: .84rem; }
.btn-danger { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--mra-border-red); background: var(--mra-red-soft); color: var(--mra-red); border-radius: 9px; padding: 9px 14px; font: inherit; font-size: .84rem; font-weight: 600; cursor: pointer; justify-self: start; transition: background 120ms ease; }
.btn-danger:hover { background: #fbdcd9; }
.np-prefix { font-family: var(--mra-font-mono); font-size: .82rem; color: var(--mra-fg-faint); white-space: nowrap; }

/* dashboard view switcher (next to the action button) + head actions */
.head-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
/* i18n: longer (e.g. Russian) tab/button labels must not overflow the header row —
   let the segmented tabs and the action row wrap instead of pushing buttons off-screen. */
.dash-tabs { display: inline-flex; gap: 2px; border: 1px solid var(--mra-line); border-radius: 10px; padding: 3px; background: var(--mra-surface); flex-wrap: wrap; }
.dash-tabs button { display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; color: var(--mra-fg-muted); font: inherit; font-size: .85rem; font-weight: 500; padding: 7px 13px; border-radius: 7px; cursor: pointer; transition: background 120ms ease, color 120ms ease; }
.dash-tabs button svg { color: var(--mra-fg-faint); }
.dash-tabs button:hover { color: var(--mra-ink); }
.dash-tabs button.active { background: var(--mra-blue-soft); color: var(--mra-blue-strong); font-weight: 600; }
.dash-tabs button.active svg { color: var(--mra-blue); }

/* utility-bar badge + dropdown menus */
.pop-wrap { position: relative; }
.pop-wrap:has(> .util-menu) { z-index: 80; }
.icon-btn { position: relative; }
.ub-badge { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--mra-orange); box-shadow: 0 0 0 2px var(--mra-surface); }
.util-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 80; min-width: 248px; background: var(--mra-surface); border: 1px solid var(--mra-line); border-radius: 12px; box-shadow: var(--mra-shadow-modal); padding: 7px; }
.util-menu.left { right: auto; left: 0; }
.um-label { font-size: .62rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mra-fg-faint); padding: 7px 9px 5px; }
.um-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; color: var(--mra-fg-2); font: inherit; font-size: .86rem; text-align: left; padding: 8px 9px; border-radius: 8px; cursor: pointer; transition: background 120ms ease; }
.um-item:hover { background: #f3f5f9; }
.um-item.active { color: var(--mra-ink); font-weight: 600; }
.um-item.col { align-items: flex-start; }
.um-item.col div { display: grid; gap: 1px; }
.um-item.col strong { font-size: .86rem; color: var(--mra-ink); font-weight: 650; }
.um-item.col span { font-size: .76rem; color: var(--mra-fg-muted); line-height: 1.4; }
.um-ico { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; color: #fff; font-size: .72rem; font-weight: 700; flex: 0 0 auto; }
.um-ico.big { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--mra-blue), var(--mra-blue-strong)); font-size: .8rem; }
.um-sep { height: 1px; background: var(--mra-soft-line); margin: 6px 4px; }
.um-acct { display: flex; align-items: center; gap: 11px; padding: 9px; }
.um-acct strong { display: block; font-size: .88rem; color: var(--mra-ink); font-weight: 650; }
.um-acct span { font-size: .77rem; color: var(--mra-fg-muted); }
.um-notif { display: flex; align-items: flex-start; gap: 10px; padding: 9px; border-radius: 8px; }
.um-notif:hover { background: #f3f5f9; }
.um-notif strong { display: block; font-size: .82rem; color: var(--mra-ink); font-weight: 600; }
.um-notif span { font-size: .76rem; color: var(--mra-fg-muted); line-height: 1.4; }
.um-notif .un-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mra-fg-faint); margin-top: 6px; flex: 0 0 auto; }
.um-notif .un-dot.ok { background: var(--mra-green); }
.um-notif .un-dot.warn { background: var(--eb-amber); }

/* git status on workspace cards */
.proj-card { gap: 12px; padding: 16px 16px 14px; border-radius: var(--eb-radius-card); }
.proj-card .pc-desc { line-height: 1.45; margin-top: 2px; min-height: 2.3em; white-space: normal; }
.proj-card .pc-foot { border-top: 1px solid var(--mra-soft-line); padding-top: 11px; }
.proj-card .pc-branch { color: var(--mra-fg-muted); font-size: .78rem; font-family: var(--mra-font-mono); }
.proj-card .pc-when { color: var(--mra-fg-faint); font-size: .76rem; white-space: nowrap; flex: 0 0 auto; }
.pc-git { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pc-git-link { margin: 0 -8px; padding: 7px 8px; border-radius: 8px; cursor: pointer; transition: background 120ms ease; }
.pc-git-link:hover { background: var(--mra-blue-soft); }
.pc-git-link:focus-visible { outline: 2px solid var(--mra-blue); outline-offset: 1px; }
.pc-git-right { display: inline-flex; align-items: center; gap: 8px; }
.pc-git-chev { color: var(--mra-fg-faint); opacity: 0; transition: opacity 120ms ease; }
.pc-git-link:hover .pc-git-chev { opacity: 1; color: var(--mra-blue-strong); }
.pl-git-link { display: inline-flex; padding: 4px 6px; margin: -4px -6px; border-radius: 7px; cursor: pointer; transition: background 120ms ease; }
.pl-git-link:hover { background: var(--mra-blue-soft); }
.pc-commit { display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--mra-fg-muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-commit code { font-family: var(--mra-font-mono); font-size: .72rem; color: var(--mra-fg-2); background: #f3f5f9; padding: 1px 5px; border-radius: 4px; flex: 0 0 auto; }
/* The message is a flex child, so the ellipsis must live on the message span itself
   (text-overflow on the flex container doesn't truncate a child). */
.pc-commit-msg { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.git-status { display: inline-flex; align-items: center; gap: 9px; }
.git-status.compact { gap: 8px; }
.gs-remote { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.gs-prov { width: 18px; height: 18px; border-radius: 5px; color: #fff; display: grid; place-items: center; flex: 0 0 auto; }
.gs-prov.ember { background: linear-gradient(135deg, var(--eb-orange), var(--eb-amber)); }
.gs-host { font-family: var(--mra-font-mono); font-size: .74rem; color: var(--mra-fg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-track { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mra-font-num); font-size: .74rem; font-variant-numeric: tabular-nums; color: var(--mra-fg-faint); }
.gs-track span { display: inline-flex; align-items: center; gap: 1px; }
.gs-track span.on { color: var(--mra-fg-2); }
.gs-dirty { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mra-font-num); font-size: .74rem; color: var(--mra-orange-strong); }
.gs-dirty .gd-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--mra-yellow); }

/* featured "jump back in" git row */
.featured .f-meta .f-sync { display: inline-flex; align-items: center; gap: 5px; color: #aab4c4; }
.featured .f-meta .f-sync .f-dirty { color: var(--eb-amber); }
.featured .f-meta .f-sync .ok-i { color: #6cd39a; }
.featured .f-remote-link { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; font: inherit; color: inherit; cursor: pointer; padding: 2px 6px; margin: -2px -6px; border-radius: 6px; transition: background 120ms ease; }
.featured .f-remote-link:hover { background: rgba(255,255,255,0.08); }
.featured .f-remote-link svg { color: var(--eb-amber); }
.featured .f-commit { margin-top: 12px; font-size: .82rem; color: #aab4c4; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.featured .f-commit code { font-family: var(--mra-font-mono); background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.08); padding: 1px 7px; border-radius: 5px; color: #d6dde8; font-size: .76rem; }
.featured .f-commit .f-cwhen { color: #6f7c91; }
.btn-ghost-dark:disabled { opacity: .7; cursor: default; }

/* =====================================================================
   Repositories view
   ===================================================================== */
.repos-view, .activity-view, .cicd-view { display: grid; gap: 22px; }
/* Repository cards — a GitHub-style grid (rich per-repo metadata) */
.repo-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1000px) { .repo-list { grid-template-columns: minmax(0, 1fr); } }
.rr-tag { font-family: var(--mra-font-ui); font-size: .64rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--mra-blue-strong); background: var(--mra-blue-soft); border-radius: 999px; padding: 2px 8px; flex: 0 0 auto; }
.rr-tag.muted { color: var(--mra-fg-muted); background: var(--mra-bg-subtle, #eef1f5); }
.repo-card { display: flex; flex-direction: column; gap: 11px; width: 100%; text-align: left; min-width: 0; background: var(--mra-surface); border: 1px solid var(--mra-line); border-radius: var(--eb-radius-card); box-shadow: var(--mra-shadow-1); padding: 16px 18px; cursor: pointer; transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease; }
.repo-card:hover { border-color: var(--mra-blue-line); box-shadow: var(--mra-shadow-2); transform: translateY(-2px); }
.repo-card.is-primary { border-color: var(--mra-blue-line); box-shadow: inset 0 0 0 1px var(--mra-blue-line), var(--mra-shadow-1); }
.rc-top { display: flex; align-items: center; gap: 11px; }
.rc-ico { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex: 0 0 auto; }
.rc-id { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; flex: 1; }
.rc-name { font-family: var(--mra-font-mono); font-weight: 650; font-size: .98rem; color: var(--mra-ink); letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.rc-vis { display: inline-flex; align-items: center; gap: 4px; font-size: .66rem; font-weight: 600; color: var(--mra-fg-muted); border: 1px solid var(--mra-line); border-radius: 999px; padding: 1px 8px; flex: 0 0 auto; }
.rc-vis svg { color: var(--mra-fg-faint); }
.rc-chev { color: var(--mra-fg-faint); flex: 0 0 auto; transition: transform 120ms ease, color 120ms ease; }
.repo-card:hover .rc-chev { color: var(--mra-blue-strong); transform: translateX(3px); }
.rc-desc { margin: 0; color: var(--mra-fg-muted); font-size: .84rem; line-height: 1.45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-commit { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: .8rem; background: #f6f8fa; border: 1px solid var(--mra-line); border-radius: 8px; padding: 6px 10px; }
.rc-commit svg { color: var(--mra-fg-faint); flex: 0 0 auto; }
.rc-commit code { font-family: var(--mra-font-mono); font-size: .72rem; color: var(--mra-blue-strong); flex: 0 0 auto; }
.rc-commit-msg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--mra-fg-2); flex: 1; min-width: 0; }
.rc-commit-by { color: var(--mra-fg-faint); flex: 0 0 auto; white-space: nowrap; }
.rc-commit.empty { color: var(--mra-fg-faint); }
.rc-stats { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.rc-stat { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; color: var(--mra-fg-muted); }
.rc-stat svg { color: var(--mra-fg-faint); }
.rc-stat strong { color: var(--mra-ink); font-family: var(--mra-font-num); font-weight: 650; }
.rc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--mra-line); padding-top: 11px; margin-top: auto; }
.rc-branch { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mra-font-mono); font-size: .76rem; color: var(--mra-fg-2); background: #f3f5f9; border-radius: 6px; padding: 2px 9px; }
.rc-branch svg { color: var(--mra-fg-faint); }
.rc-when { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; color: var(--mra-fg-faint); white-space: nowrap; }
.rc-when svg { color: var(--mra-fg-faint); }

.repo-detail { display: grid; gap: 20px; }
.rd-bar { display: flex; align-items: center; gap: 10px; }
.rd-back { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--mra-fg-muted); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; padding: 6px 4px; border-radius: 7px; }
.rd-back:hover { color: var(--mra-blue-strong); }
.rd-bar .grow { flex: 1; }
.rd-head { display: flex; align-items: flex-start; gap: 16px; }
.rd-ico { width: 52px; height: 52px; border-radius: 13px; display: grid; place-items: center; color: #fff; font-family: var(--mra-font-mono); font-weight: 700; font-size: 1rem; flex: 0 0 auto; }
.rd-title h2 { margin: 0; font-size: 1.5rem; font-weight: 650; letter-spacing: -0.02em; color: var(--mra-ink); font-family: var(--mra-font-mono); display: inline-flex; align-items: center; gap: 11px; }
.rd-title p { margin: 6px 0 0; color: var(--mra-fg-muted); font-size: .92rem; max-width: 70ch; }
.rd-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.rd-badge { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; color: var(--mra-fg-2); background: #f3f5f9; border: 1px solid var(--mra-soft-line); border-radius: 8px; padding: 4px 10px; white-space: nowrap; }
.rd-badge svg { color: var(--mra-fg-muted); }
.rd-badge code { font-family: var(--mra-font-mono); color: var(--mra-ink); }
.remote-field { display: flex; align-items: center; gap: 10px; border: 1px solid var(--mra-line); border-radius: 10px; background: var(--mra-surface); padding: 10px 12px; }
.remote-field > svg { color: var(--mra-fg-muted); flex: 0 0 auto; }
.remote-field code { flex: 1; min-width: 0; font-family: var(--mra-font-mono); font-size: .84rem; color: var(--mra-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.remote-copy { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--mra-line); background: #fbfcfe; color: var(--mra-fg-2); border-radius: 7px; padding: 5px 10px; font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; flex: 0 0 auto; transition: background 120ms ease; }
.remote-copy:hover { background: #f3f6fb; }
.rd-stats { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 10px; }
.rd-stat { display: flex; align-items: center; gap: 10px; border: 1px solid var(--mra-line); border-radius: 11px; background: var(--mra-surface); padding: 12px; box-shadow: var(--mra-shadow-1); }
.rds-ico { width: 32px; height: 32px; border-radius: 9px; background: var(--mra-blue-soft); color: var(--mra-blue-strong); display: grid; place-items: center; flex: 0 0 auto; }
.rds-v { font-family: var(--mra-font-num); font-size: 1.12rem; font-weight: 500; color: var(--mra-ink); letter-spacing: -0.01em; }
.rds-l { font-size: .74rem; color: var(--mra-fg-muted); }
.rd-section { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px; border: 1px solid var(--mra-line); border-radius: var(--eb-radius-card); background: var(--mra-surface); padding: 16px 18px; box-shadow: var(--mra-shadow-1); }
.rd-section.col { display: grid; grid-template-columns: 1fr; }
.rd-section.danger { border-color: var(--mra-border-red); background: var(--mra-red-soft); }
.rd-sec-head h3 { margin: 0; font-size: 1rem; font-weight: 650; color: var(--mra-ink); }
.rd-sec-head .rd-sec-sub { display: block; margin-top: 3px; font-size: .82rem; color: var(--mra-fg-muted); }
.rd-sec-head.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.rd-defbtn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--mra-line); background: #fbfcfe; color: var(--mra-ink); border-radius: 9px; padding: 9px 12px; font: inherit; font-size: .86rem; font-family: var(--mra-font-mono); cursor: pointer; }
.rd-defbtn:hover, .rd-defbtn.on { border-color: #d6dde5; }
.rd-defpop { position: absolute; top: calc(100% + 5px); right: 0; z-index: 30; min-width: 220px; background: var(--mra-surface); border: 1px solid var(--mra-line); border-radius: 9px; box-shadow: var(--mra-shadow-modal); padding: 5px; display: grid; gap: 1px; }
.rd-defitem { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 7px; border: 0; background: transparent; color: var(--mra-fg-2); font: inherit; font-size: .84rem; font-family: var(--mra-font-mono); cursor: pointer; text-align: left; }
.rd-defitem:hover { background: #f3f5f9; }
.rd-defitem.active { color: var(--mra-blue-strong); }
.branch-table { display: grid; gap: 2px; }
.branch-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto auto; align-items: center; gap: 16px; padding: 10px 10px; border-radius: 9px; transition: background 120ms ease; }
.branch-row:hover { background: #fafbfc; }
.br-name { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mra-font-mono); font-size: .86rem; color: var(--mra-ink); min-width: 0; }
.br-name svg { color: var(--mra-fg-muted); flex: 0 0 auto; }
.br-chip { font-family: var(--mra-font-ui); font-size: .66rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; border-radius: 999px; padding: 2px 8px; display: inline-flex; align-items: center; gap: 4px; }
.br-chip.def { color: var(--mra-blue-strong); background: var(--mra-blue-soft); }
.br-chip.prot { color: var(--mra-orange-strong); background: var(--mra-tint-warm); }
.br-track { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mra-font-num); font-size: .78rem; color: var(--mra-fg-faint); }
.br-track span { display: inline-flex; align-items: center; gap: 1px; }
.br-track span.on { color: var(--mra-fg-2); }
.br-when { font-size: .78rem; color: var(--mra-fg-muted); white-space: nowrap; }
.br-actions { display: inline-flex; gap: 4px; }
.br-toggle, .br-del { border: 1px solid var(--mra-line); background: var(--mra-surface); color: var(--mra-fg-muted); width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; transition: background 120ms ease, color 120ms ease, border-color 120ms ease; }
.br-toggle:hover { background: #fbfcfe; color: var(--mra-ink); }
.br-toggle.on { background: var(--mra-tint-warm); border-color: var(--mra-border-amber); color: var(--mra-orange-strong); }
.br-del:hover:not(:disabled) { background: var(--mra-red-soft); border-color: var(--mra-border-red); color: var(--mra-red); }
.br-del:disabled { opacity: .4; cursor: not-allowed; }
.branch-new { display: flex; align-items: center; gap: 9px; padding: 9px 10px; }
.branch-new svg { color: var(--mra-fg-muted); }
.branch-new input { flex: 1; min-width: 0; border: 1px solid var(--mra-blue); border-radius: 8px; background: #fff; color: var(--mra-ink); font: inherit; font-size: .86rem; font-family: var(--mra-font-mono); padding: 6px 10px; outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,0.14); }
.connect-card { border: 1px solid var(--mra-blue-line); border-radius: var(--eb-radius-card); background: var(--mra-surface); padding: 18px; box-shadow: var(--mra-shadow-2); display: grid; gap: 10px; }
.connect-url { display: flex; align-items: center; gap: 9px; border: 1px solid var(--mra-line); border-radius: 10px; background: #fff; padding: 9px 12px; }
.connect-url svg { color: var(--mra-fg-muted); }
.connect-url input { flex: 1; border: 0; outline: none; font: inherit; font-size: .86rem; font-family: var(--mra-font-mono); color: var(--mra-ink); background: transparent; }
.connect-actions { display: flex; gap: 9px; margin-top: 4px; }
.pop-label { font-size: .7rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--mra-fg-muted); }
.pop-seg { display: inline-flex; gap: 2px; border: 1px solid var(--mra-line); border-radius: 9px; padding: 3px; background: #fbfcfe; }
.pop-seg button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--mra-fg-muted); font: inherit; font-size: .82rem; font-weight: 500; padding: 6px 11px; border-radius: 6px; cursor: pointer; }
.pop-seg button.active { background: var(--mra-blue-soft); color: var(--mra-blue-strong); font-weight: 600; }

/* =====================================================================
   Activity feed
   ===================================================================== */
.activity-feed { display: grid; gap: 2px; border: 1px solid var(--mra-line); border-radius: var(--eb-radius-card); background: var(--mra-surface); box-shadow: var(--mra-shadow-1); overflow: hidden; }
.act-row { display: flex; align-items: flex-start; gap: 13px; padding: 14px 18px; border-bottom: 1px solid var(--mra-soft-line); }
.act-row:last-child { border-bottom: 0; }
.act-row:hover { background: #fafbfc; }
.act-ico { width: 30px; height: 30px; border-radius: 8px; background: #f3f5f9; display: grid; place-items: center; flex: 0 0 auto; }
.act-line { font-size: .9rem; color: var(--mra-fg-2); }
.act-line strong { color: var(--mra-ink); font-weight: 650; }
.act-meta { display: flex; align-items: center; gap: 10px; margin-top: 4px; font-size: .78rem; color: var(--mra-fg-faint); flex-wrap: wrap; }
.act-meta code { font-family: var(--mra-font-mono); color: var(--mra-fg-2); }
.act-meta .act-hash { background: #f3f5f9; padding: 0 6px; border-radius: 4px; }
.act-branch { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mra-font-mono); }
.act-empty, .repo-empty, .pipe-empty { border: 1px dashed var(--mra-line); border-radius: var(--eb-radius-card); background: #fcfdff; padding: 30px; text-align: center; color: var(--mra-fg-muted); font-size: .9rem; display: grid; gap: 6px; justify-items: center; }
.act-empty strong, .repo-empty strong, .pipe-empty strong { color: var(--mra-ink); font-weight: 650; font-size: .96rem; }

/* =====================================================================
   CI/CD view
   ===================================================================== */
.cicd-stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.cicd-stat { display: grid; gap: 4px; text-align: left; border: 1px solid var(--mra-line); border-radius: var(--eb-radius-card); background: var(--mra-surface); box-shadow: var(--mra-shadow-1); padding: 14px 16px; cursor: pointer; transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease; }
.cicd-stat:hover { border-color: var(--mra-blue-line); transform: translateY(-1px); }
.cicd-stat.active { border-color: var(--mra-blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
.cicd-stat .cs-v { font-family: var(--mra-font-num); font-size: 1.5rem; font-weight: 500; color: var(--mra-ink); letter-spacing: -0.02em; }
.cicd-stat .cs-l { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; color: var(--mra-fg-muted); }
.cicd-stat.ok .cs-v { color: var(--mra-green); }
.cicd-stat.ok .cs-l svg { color: var(--mra-green); }
.cicd-stat.run .cs-v { color: var(--mra-blue-strong); }
.cicd-stat.fail .cs-v { color: var(--mra-red); }
.cicd-stat.fail .cs-l svg { color: var(--mra-red); }
.pipe-list { display: grid; gap: 10px; }
.pipe-card { border: 1px solid var(--mra-line); border-radius: var(--eb-radius-card); background: var(--mra-surface); box-shadow: var(--mra-shadow-1); overflow: hidden; transition: border-color 120ms ease, box-shadow 120ms ease; }
.pipe-card:hover { border-color: var(--mra-blue-line); }
.pipe-card.open { box-shadow: var(--mra-shadow-2); }
.pipe-row { display: grid; grid-template-columns: 32px minmax(0, 1.4fr) auto auto 18px; align-items: center; gap: 16px; width: 100%; text-align: left; background: transparent; border: 0; padding: 14px 16px; cursor: pointer; }
.pipe-status { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: 0 0 auto; }
.pipe-status.ok { background: var(--mra-green-soft); color: var(--mra-green); }
.pipe-status.run { background: var(--mra-blue-soft); color: var(--mra-blue-strong); }
.pipe-status.fail { background: var(--mra-red-soft); color: var(--mra-red); }
.pipe-status.pend { background: #f3f5f9; color: var(--mra-fg-muted); }
.pipe-main { min-width: 0; }
.pipe-title { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.pipe-num { font-family: var(--mra-font-num); font-weight: 600; color: var(--mra-fg-muted); font-size: .82rem; }
.pipe-repo { font-family: var(--mra-font-mono); font-size: .88rem; font-weight: 600; color: var(--mra-ink); }
.pipe-branch { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mra-font-mono); font-size: .76rem; color: var(--mra-fg-muted); }
.env-chip { font-size: .66rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; border-radius: 999px; padding: 2px 8px; }
.env-chip.production { color: #9e2b22; background: var(--mra-red-soft); }
.env-chip.staging { color: var(--mra-blue-strong); background: var(--mra-blue-soft); }
.env-chip.preview { color: var(--mra-orange-strong); background: var(--mra-tint-warm); }
.pipe-sub { display: flex; align-items: center; gap: 7px; margin-top: 4px; font-size: .8rem; color: var(--mra-fg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pipe-sub code { font-family: var(--mra-font-mono); font-size: .74rem; color: var(--mra-fg-2); background: #f3f5f9; padding: 0 5px; border-radius: 4px; flex: 0 0 auto; }
/* Flex-child truncation: ellipsis only applies to a block, not a bare text node in a
   flex row — wrap the message/body and give it min-width:0 so long commit messages and
   stage/activity labels clip cleanly instead of overflowing their cards. */
.pipe-msg { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-body { flex: 1; min-width: 0; }
.tl-body { flex: 1; min-width: 0; }
.pipe-stages-inline { display: flex; }
.pipe-meta { display: grid; justify-items: end; gap: 3px; }
.pipe-trigger { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; color: var(--mra-fg-muted); text-transform: capitalize; }
.pipe-when { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; color: var(--mra-fg-faint); white-space: nowrap; }
.pipe-chev { color: var(--mra-fg-faint); transition: transform 120ms ease; }
.pipe-chev.open { transform: rotate(90deg); }
@media (max-width: 1180px) { .pipe-stages-inline { display: none; } }
.stage-bar { display: flex; align-items: center; gap: 0; }
.stage-pill { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 500; color: var(--mra-fg-2); background: #f3f5f9; border: 1px solid var(--mra-soft-line); border-radius: 7px; padding: 4px 9px; white-space: nowrap; }
.stage-pill .sp-mark { display: grid; place-items: center; }
.stage-pill .sp-dur { color: var(--mra-fg-faint); font-family: var(--mra-font-num); font-size: .7rem; }
.stage-pill .sp-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--mra-fg-faint); }
.stage-pill.ok { color: var(--mra-green); background: var(--mra-green-soft); border-color: var(--mra-border-green); }
.stage-pill.ok .sp-dur { color: #4a9e72; }
.stage-pill.run { color: var(--mra-blue-strong); background: var(--mra-blue-soft); border-color: var(--mra-blue-line); }
.stage-pill.fail { color: var(--mra-red); background: var(--mra-red-soft); border-color: var(--mra-border-red); }
.stage-pill.skip { color: var(--mra-fg-faint); }
.stage-conn { width: 14px; height: 2px; background: var(--mra-line); flex: 0 0 auto; }
.pipe-detail { border-top: 1px solid var(--mra-soft-line); padding: 16px; display: grid; gap: 16px; background: #fbfcfd; }
.pipe-timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tl-stage { display: flex; align-items: center; gap: 10px; border: 1px solid var(--mra-line); border-radius: 10px; background: var(--mra-surface); padding: 11px 13px; }
.tl-mark { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; flex: 0 0 auto; background: #f3f5f9; color: var(--mra-fg-muted); }
.tl-stage.ok .tl-mark { background: var(--mra-green-soft); color: var(--mra-green); }
.tl-stage.run .tl-mark { background: var(--mra-blue-soft); color: var(--mra-blue-strong); }
.tl-stage.fail .tl-mark { background: var(--mra-red-soft); color: var(--mra-red); }
.tl-name { font-size: .84rem; font-weight: 600; color: var(--mra-ink); }
.tl-dur { font-size: .74rem; color: var(--mra-fg-muted); font-family: var(--mra-font-num); margin-top: 1px; }
.pipe-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pipe-actions .grow { flex: 1; }
.pipe-by { font-size: .8rem; color: var(--mra-fg-muted); }
.pipe-by code { font-family: var(--mra-font-mono); color: var(--mra-fg-2); }
.pipe-log { grid-column: 1 / -1; border: 1px solid var(--mra-line); border-radius: 10px; background: var(--cc-dark, #0d1426); color: #c9d3e3; font-family: var(--mra-font-mono); font-size: .76rem; line-height: 1.6; padding: 12px 14px; max-height: 240px; overflow: auto; white-space: pre-wrap; }
@media (max-width: 1100px) { .rd-stats { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 760px) { .pipe-timeline { grid-template-columns: repeat(2,1fr); } }

/* git-provider glyph: restore the design's mono / .56rem / 700 lettering. */
.gs-prov { font-family: var(--mra-font-mono); font-size: .56rem; font-weight: 700; }

/* =====================================================================
   Large-display optimization for big Mac logical viewports. Additive
   min-width tiers only — the design's <=1120px proportions are untouched.
   Widens the dashboard container, adds a 4th workspace column, and lets
   the wide stat/pipeline grids breathe so the dashboard fills 16" / Studio
   Display / Pro Display XDR screens instead of sitting marooned with huge
   gutters. The IDE shell is already full-bleed and is intentionally not
   touched. (width + max-width are both set so the base width:min(1120px)
   rule is actually widened, not just capped.)
   ===================================================================== */
/* 14" MacBook Pro (1512): widen + go 4-up so 3 projects + the New-project card
   sit on one row and the FILES/CONSOLE/MODEL footer stays above the fold. */
@media (min-width: 1500px) {
  .projects-wrap { width: min(1340px, 100%); max-width: 1340px; }
  .proj-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1700px) {
  .projects-wrap { width: min(1480px, 100%); max-width: 1480px; }
  .proj-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* Studio / Pro Display XDR: the workspaces grid uses the extra width (wider
   container + 5-up grid). List/detail views stay at a readable 1600px so their
   rows don't strand content across a hollow center. */
@media (min-width: 2200px) {
  .projects-wrap { width: min(1600px, 100%); max-width: 1600px; }
  .projects-wrap.dash-wide { width: min(1840px, 100%); max-width: 1840px; }
  .dash-wide .proj-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
/* Keep list-style views readable on very wide displays even inside a wide wrap. */
.repos-view, .activity-view, .cicd-view { max-width: 1320px; margin-inline: auto; }


/* =====================================================================
   EMBER WEB IDE — design ide.css ported verbatim. The IDE root keeps the
   `ide-shell` class so a handful of higher-specificity `.ide-shell …` rules
   ABOVE still apply intentionally (sandbox theming via --ic-sandbox-*, the
   editable-editor overlay, danger tokens). Plain `.ide …` selectors here win
   only over equal/ lower specificity; where both layers target the same
   element the `.ide-shell` rule can still win, so they are NOT all inert —
   prefer editing the matching `.ide-shell` rule when an override looks dead.
   ===================================================================== */
/* =====================================================================
   Ember — Web IDE chrome + panels.
   Fully themed: every surface (top bar, file tree, tabs, editor, terminal,
   AI panel) reads --ic-* tokens set by .ide-theme-light / .ide-theme-dark,
   so each theme is one cohesive workspace — a clean white IDE or a true
   dark IDE. Syntax + brand accents stay constant across themes.
   ===================================================================== */

/* ---- theme tokens --------------------------------------------------- */
.ide-theme-light {
  --ic-bg: #f4f6fa;          /* base canvas behind panels */
  --ic-chrome: #ffffff;      /* top bar, panel headers */
  --ic-panel: #ffffff;       /* file tree, AI panel */
  --ic-editor: #ffffff;      /* editor + terminal surface */
  --ic-tab-bar: #f4f6fa;     /* inactive tab strip */
  --ic-tab-inactive: #eef1f6;
  --ic-border: #e3e7ee;
  --ic-border-soft: #eef0f4;
  --ic-fg: #1b2230;          /* ink */
  --ic-fg-2: #3a4354;        /* body */
  --ic-fg-muted: #6b7689;    /* muted */
  --ic-fg-faint: #98a1b2;    /* faint */
  --ic-hover: #f0f3f8;
  --ic-active-bg: var(--mra-blue-soft);
  --ic-active-fg: var(--mra-blue-strong);
  --ic-chip: #eef1f6;
  --ic-code-bg: #f6f8fb;     /* AI code/diff base */
  --ic-code-border: #e3e7ee;
  /* editor syntax (light) */
  --ed-gutter: #b8c0cf; --ed-line: #eef0f4; --ed-hl: #f3f6fc;
  --ed-key: #9333ea; --ed-str: #1f8a5b; --ed-com: #9aa0a6; --ed-fn: #2563eb;
  --ed-num: #c45f00; --ed-typ: #b06000; --ed-pun: #5b6470; --ed-tag: #c5392e;
}
.ide-theme-dark {
  --ic-bg: #0a0f1c;
  --ic-chrome: #0e1424;
  --ic-panel: #0e1424;
  --ic-editor: #0b1120;
  --ic-tab-bar: #0a0f1c;
  --ic-tab-inactive: #111a2c;
  --ic-border: #1d2740;
  --ic-border-soft: #161f33;
  --ic-fg: #eef2f8;
  --ic-fg-2: #c4cddd;
  --ic-fg-muted: #8b96aa;
  --ic-fg-faint: #5d6883;
  --ic-hover: #182238;
  --ic-active-bg: rgba(37,99,235,0.22);
  --ic-active-fg: #93b4ff;
  --ic-chip: #16213a;
  --ic-code-bg: #070b16;
  --ic-code-border: #1d2740;
  /* editor syntax (dark) */
  --ed-gutter: #41506b; --ed-line: rgba(255,255,255,0.05); --ed-hl: rgba(255,255,255,0.045);
  --ed-key: #c792ea; --ed-str: #c3e88d; --ed-com: #5b6b86; --ed-fn: #82aaff;
  --ed-num: #f78c6c; --ed-typ: #ffcb6b; --ed-pun: #89a4c7; --ed-tag: #f07178;
}

/* --uiz is the adjustable UI scale (zoom). The width/height are divided by it so the
   zoomed element still exactly fills the viewport (zoom × size = 100vw/100vh). zoom
   reflows the grid at the larger logical size, so scaling DOWN gives the IDE more room. */
.ide { zoom: var(--uiz, 1); width: calc(100vw / var(--uiz, 1)); height: calc(100dvh / var(--uiz, 1)); display: grid; grid-template-rows: 52px minmax(0, 1fr) 23px; background: var(--ic-bg); }

/* Bottom status bar (VS Code style) ----------------------------------- */
.ide-status {
  grid-row: 3;
  display: flex; align-items: center; justify-content: space-between;
  height: 23px; padding: 0 8px;
  background: var(--ic-chrome); border-top: 1px solid var(--ic-border);
  font-size: 11.5px; color: var(--ic-fg-muted); user-select: none;
}
.ide-status .sb-left, .ide-status .sb-right { display: flex; align-items: center; gap: 2px; }
.ide-status .sb-item {
  display: inline-flex; align-items: center; gap: 5px;
  height: 23px; padding: 0 7px; border: 0; background: transparent;
  color: var(--ic-fg-muted); font: inherit; cursor: pointer; white-space: nowrap;
}
.ide-status button.sb-item:hover { background: var(--ic-hover); color: var(--ic-fg); }
.ide-status .sb-item svg { width: 12px; height: 12px; opacity: .85; }
.ide-status .sb-accent { color: var(--mra-blue); }
/* UI zoom control (status bar) */
.ide-status .sb-zoom { display: inline-flex; align-items: center; gap: 0; margin: 0 2px; }
.ide-status .sb-zbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 19px; height: 19px; padding: 0; border: 0; background: transparent;
  color: var(--ic-fg-muted); font: 600 13px/1 inherit; cursor: pointer; border-radius: 4px;
}
.ide-status .sb-zbtn:hover { background: var(--ic-hover); color: var(--ic-fg); }
.ide-status .sb-zlevel { min-width: 40px; justify-content: center; padding: 0 4px; font-variant-numeric: tabular-nums; }

/* Command palette / quick-open ---------------------------------------- */
.cmdp-backdrop { position: fixed; inset: 0; z-index: 60; background: transparent; }
.cmdp {
  position: fixed; z-index: 61; top: 8%; left: 50%; transform: translateX(-50%);
  width: min(640px, 92vw); max-height: 60vh; display: flex; flex-direction: column;
  background: var(--ic-panel); border: 1px solid var(--ic-border);
  border-radius: 10px; box-shadow: 0 18px 60px rgba(0,0,0,.45), 0 2px 8px rgba(0,0,0,.25);
  overflow: hidden;
}
.cmdp-input {
  appearance: none; border: 0; outline: 0; margin: 0;
  padding: 12px 14px; font-size: 14px; line-height: 1.2;
  background: var(--ic-editor); color: var(--ic-fg);
  border-bottom: 1px solid var(--ic-border);
}
.cmdp-input::placeholder { color: var(--ic-fg-faint); }
.cmdp-list { overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 1px; }
.cmdp-item {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 7px 10px; border: 0; border-radius: 6px; background: transparent;
  color: var(--ic-fg-2); font-size: 13px; cursor: pointer;
}
.cmdp-item .cmdp-ico { color: var(--ic-fg-faint); display: inline-flex; flex: 0 0 auto; }
.cmdp-item .cmdp-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdp-item .cmdp-hint { color: var(--ic-fg-faint); font-size: 11px; font-family: var(--mra-font-mono, monospace); flex: 0 0 auto; }
.cmdp-item.active, .cmdp-item:hover { background: var(--ic-active-bg); color: var(--ic-fg); }
.cmdp-item.active .cmdp-ico, .cmdp-item.active .cmdp-label { color: var(--ic-active-fg); }
.cmdp-empty { padding: 14px; text-align: center; color: var(--ic-fg-faint); font-size: 13px; }

/* In-buffer Find & Replace (⌘F / ⌘H) --------------------------------- */
.ide-shell .code-editor-wrap { position: relative; }
.ide-shell .ed-find {
  position: absolute; top: 8px; right: 18px; z-index: 30;
  background: var(--ic-panel); border: 1px solid var(--ic-border); border-radius: 9px;
  box-shadow: 0 10px 28px rgba(0,0,0,.4); padding: 7px; display: flex; flex-direction: column; gap: 6px; min-width: 320px;
}
.ide-shell .ed-find-row { display: flex; align-items: center; gap: 4px; }
.ide-shell .ed-find-input { flex: 1; min-width: 0; background: var(--ic-bg); border: 1px solid var(--ic-border); border-radius: 6px; padding: 4px 8px; color: var(--ic-fg); font-size: 12.5px; }
.ide-shell .ed-find-input:focus { outline: none; border-color: var(--mra-blue, #2563eb); }
.ide-shell .ed-find-tg, .ide-shell .ed-find-nav, .ide-shell .ed-find-x, .ide-shell .ed-find-act {
  display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 6px;
  border: 1px solid transparent; background: transparent; color: var(--ic-fg-muted); border-radius: 6px; cursor: pointer; font: 600 11px/1 var(--mra-font-mono, monospace);
}
.ide-shell .ed-find-tg:hover, .ide-shell .ed-find-nav:hover, .ide-shell .ed-find-x:hover, .ide-shell .ed-find-act:hover { background: var(--ic-hover); color: var(--ic-fg); }
.ide-shell .ed-find-tg.on { background: var(--ic-active-bg); color: var(--mra-blue, #2563eb); border-color: var(--mra-blue, #2563eb); }
.ide-shell .ed-find-nav svg { transform: rotate(-90deg); }
.ide-shell .ed-find-nav[data-find-nav="-1"] svg { transform: rotate(90deg); }
.ide-shell .ed-find-count { font: 600 11px/1 var(--mra-font-mono, monospace); color: var(--ic-fg-muted); padding: 0 6px; white-space: nowrap; min-width: 54px; text-align: right; }
.ide-shell .ed-find-count.bad { color: var(--ic-danger-fg); }
.ide-shell .ed-find-expand { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; color: var(--ic-fg-muted); font-size: 11.5px; cursor: pointer; padding: 2px 4px; }
.ide-shell .ed-find-expand:hover { color: var(--ic-fg); }

/* Cursor-style inline ⌘K AI menu -------------------------------------- */
.ide-shell .inlineai-backdrop { position: fixed; inset: 0; z-index: 72; }
.ide-shell .inlineai {
  position: fixed; left: 50%; top: 130px; transform: translateX(-50%); z-index: 73;
  width: min(560px, 60vw); background: var(--ic-panel); border: 1px solid var(--ic-border);
  border-radius: 12px; box-shadow: 0 18px 48px rgba(0,0,0,.5); padding: 12px; display: flex; flex-direction: column; gap: 9px;
}
.ide-shell .inlineai-head { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--ic-fg-2); }
.ide-shell .inlineai-head .bb { display: inline-flex; width: 20px; height: 20px; align-items: center; justify-content: center; border-radius: 6px; background: linear-gradient(135deg, #7c5cff, #9d7bff); color: #fff; }
.ide-shell .inlineai-head code { background: var(--ic-code-bg); padding: 1px 6px; border-radius: 5px; font-family: var(--mra-font-mono); }
.ide-shell .inlineai-code { margin: 0; max-height: 84px; overflow: auto; padding: 8px 10px; background: var(--ic-code-bg); border: 1px solid var(--ic-border-soft); border-radius: 8px; font: .74rem/1.5 var(--mra-font-mono, monospace); color: var(--ic-fg-2); white-space: pre; }
.ide-shell .inlineai-input { width: 100%; background: var(--ic-bg); border: 1px solid var(--mra-blue, #2563eb); border-radius: 8px; padding: 9px 12px; color: var(--ic-fg); font-size: 13px; }
.ide-shell .inlineai-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.ide-shell .inlineai-act { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--ic-border); background: var(--ic-bg); color: var(--ic-fg-2); border-radius: 8px; padding: 6px 11px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.ide-shell .inlineai-act:hover { background: var(--ic-active-bg); color: var(--ic-fg); border-color: var(--mra-blue, #2563eb); }
.ide-shell .inlineai-hint { font-size: 11px; color: var(--ic-fg-faint); }
.ide-shell .inlineai-hint kbd { background: var(--ic-code-bg); border: 1px solid var(--ic-border); border-radius: 4px; padding: 1px 5px; font-family: var(--mra-font-mono); }
.ide-shell .tb-ai { color: var(--mra-blue, #2563eb) !important; }

/* File-tree context menu ---------------------------------------------- */
.ctxm-backdrop { position: fixed; inset: 0; z-index: 70; }
.ctxm {
  position: fixed; z-index: 71; min-width: 200px; padding: 5px;
  background: var(--ic-panel); border: 1px solid var(--ic-border);
  border-radius: 8px; box-shadow: 0 12px 36px rgba(0,0,0,.4);
  display: flex; flex-direction: column; gap: 1px;
}
.ctxm-item {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 6px 10px; border-radius: 5px; color: var(--ic-fg-2); font-size: 13px; cursor: pointer;
}
.ctxm-item:hover { background: var(--ic-active-bg); color: var(--ic-fg); }
.ctxm-item.danger { color: var(--mra-red, #d64545); }
.ctxm-item.danger:hover { background: var(--ic-danger-bg, rgba(214,69,69,.15)); }
.ctxm-sep { height: 1px; margin: 4px 6px; background: var(--ic-border); }

/* ---- top chrome ----------------------------------------------------- */
.ide-top {
  display: flex; align-items: center; gap: 14px;
  padding: 0 14px; background: var(--ic-chrome); border-bottom: 1px solid var(--ic-border);
}
.ide-top .crumbs { display: flex; align-items: center; gap: 8px; font-size: .86rem; color: var(--ic-fg-muted); min-width: 0; overflow: hidden; }
/* Truncate the project name (instead of spilling over the sandbox pill on narrow chrome). */
.ide-top .crumbs strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
/* The flame mark + branch chip keep their size; only the crumbs text shrinks. */
.ide-top > .eb-mark, .ide-top .crumbs .branch, .ide-top .crumbs .pop-wrap { flex: 0 0 auto; }
.ide-top .crumbs .crumb-link { border: 0; padding: 0; color: var(--ic-fg-muted); background: transparent; font: inherit; text-decoration: none; cursor: pointer; }
.ide-top .crumbs .crumb-link:hover { color: var(--mra-blue); }
.ide-top .crumbs .crumb-link:focus-visible { outline: 2px solid var(--mra-blue); outline-offset: 3px; border-radius: 3px; }
.ide-top .crumbs strong { color: var(--ic-fg); font-weight: 650; }
.ide-top .crumbs .sep { color: var(--ic-fg-faint); }
.ide-top .crumbs .branch { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mra-font-mono); font-size: .74rem; color: var(--ic-fg-muted); background: var(--ic-chip); border: 1px solid var(--ic-border-soft); padding: 2px 8px; border-radius: 6px; }
.ide-top .spacer { flex: 1; }

/* sandbox / security indicator cluster — the persistent isolation signal */
.sandbox {
  display: inline-flex; align-items: stretch; gap: 0;
  border: 1px solid var(--mra-border-green, #b7dfc4); border-radius: 9px; overflow: hidden; background: var(--mra-green-soft);
}
.ide-theme-dark .sandbox { background: rgba(31,138,91,0.14); border-color: rgba(108,211,154,0.34); }
.sandbox .sb-lead { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; color: var(--mra-green); font-weight: 650; font-size: .78rem; }
.ide-theme-dark .sandbox .sb-lead { color: #6cd39a; }
.sandbox .sb-lead .sb-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mra-green); box-shadow: 0 0 0 3px rgba(31,138,91,0.18); }
.ide-theme-dark .sandbox .sb-lead .sb-dot { background: #6cd39a; }
.sandbox .sb-facts { display: inline-flex; align-items: center; background: var(--ic-panel); border-left: 1px solid var(--mra-border-green, #b7dfc4); }
.ide-theme-dark .sandbox .sb-facts { border-left-color: rgba(108,211,154,0.34); }
.sandbox .sb-fact { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; font-size: .76rem; color: var(--ic-fg-2); white-space: nowrap; }
.sandbox .sb-fact + .sb-fact { border-left: 1px solid var(--ic-border-soft); }
.sandbox .sb-fact svg { color: var(--ic-fg-muted); }
.sandbox .sb-fact code { font-family: var(--mra-font-mono); font-size: .74rem; color: var(--ic-fg); }
.sandbox .sb-fact b { font-family: var(--mra-font-num); font-weight: 500; color: var(--ic-fg); font-variant-numeric: tabular-nums; }

.ide-btn {
  display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--ic-border); background: var(--ic-chrome);
  color: var(--ic-fg); border-radius: 8px; padding: 6px 12px; font-weight: 600; font-size: .82rem; cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease; white-space: nowrap;
}
.ide-btn:hover { background: var(--ic-hover); border-color: var(--ic-fg-faint); }
.ide-btn.run { background: var(--mra-green); border-color: var(--mra-green); color: #fff; }
.ide-btn.run:hover { background: #197a4f; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(31,138,91,0.24); }
.ide-btn.deploy { background: var(--mra-blue); border-color: var(--mra-blue); color: #fff; position: relative; }
.ide-btn.deploy:hover { background: var(--mra-blue-strong); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(37,99,235,0.26); }
.ide-btn.deploy.on { background: var(--mra-blue-strong); }
.ide-btn.deploy .deploy-dot { width: 7px; height: 7px; border-radius: 50%; margin-left: 1px; }
.ide-btn.deploy .deploy-dot.ready { background: #ffd9b0; }
.ide-btn.deploy .deploy-dot.running { background: var(--eb-amber); animation: pulse-dot 1.2s ease-in-out infinite; }
.ide-btn.deploy .deploy-dot.passed { background: #6cd39a; }
.ide-seg { display: inline-flex; border: 1px solid var(--ic-border); border-radius: 8px; overflow: hidden; }
.ide-seg button { border: 0; background: var(--ic-chrome); color: var(--ic-fg-muted); padding: 6px 9px; cursor: pointer; display: grid; place-items: center; transition: background 120ms ease, color 120ms ease; }
.ide-seg button + button { border-left: 1px solid var(--ic-border); }
.ide-seg button.active { background: var(--ic-active-bg); color: var(--ic-active-fg); }

/* ---- body grid ------------------------------------------------------ */
.ide-body { display: grid; grid-template-columns: 48px 256px minmax(0,1fr) var(--ai-w, 360px); min-height: 0; }
.ide-body.no-ai { grid-template-columns: 48px 256px minmax(0,1fr) 0; }
.ide-body.no-ai .ai-panel { display: none; }
/* Explorer/sidebar collapse (Cmd+B / activity-bar toggle). The .sidepane stays
   in the DOM as a 0-width grid track (removing it would shift grid
   auto-placement and collapse the editor), so clip its overflow. */
.ide-body.explorer-collapsed { grid-template-columns: 48px 0 minmax(0,1fr) var(--ai-w, 360px); }
.ide-body.explorer-collapsed.no-ai { grid-template-columns: 48px 0 minmax(0,1fr) 0; }
.ide-body.explorer-collapsed .sidepane { overflow: hidden; }

/* side pane wraps explorer / scm / search */
.sidepane { min-height: 0; min-width: 0; display: grid; }
.sidepane > * { min-height: 0; }

/* ---- file tree ------------------------------------------------------ */
.filetree { background: var(--ic-panel); border-right: 1px solid var(--ic-border); display: grid; grid-template-rows: auto 1fr auto; min-height: 0; }
.ft-head { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; border-bottom: 1px solid var(--ic-border-soft); }
.ft-head .ft-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .68rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ic-fg-muted); }
.ft-head .ft-actions { display: inline-flex; gap: 4px; flex: 0 0 auto; }
.ft-head .ft-actions button { border: 0; background: transparent; color: var(--ic-fg-faint); width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; cursor: pointer; }
.ft-head .ft-actions button:hover { background: var(--ic-hover); color: var(--ic-fg); }
.ft-list { overflow-y: auto; padding: 8px 8px 14px; }
.ft-row { display: flex; align-items: center; gap: 7px; padding: 4px 8px; border-radius: 7px; cursor: pointer; font-size: .82rem; color: var(--ic-fg-2); user-select: none; white-space: nowrap; transition: background 120ms ease; }
.ft-row:hover { background: var(--ic-hover); }
.ft-row.active { background: var(--ic-active-bg); color: var(--ic-active-fg); font-weight: 600; }
.ft-row.active svg { color: var(--ic-active-fg); }
.ft-row .ft-ico { color: var(--ic-fg-faint); flex: 0 0 auto; display: grid; place-items: center; }
.ft-row .ft-ico.folder { color: var(--mra-orange); }
.ft-row .ft-chev { color: var(--ic-fg-faint); transition: transform 120ms ease; }
.ft-row .ft-chev.open { transform: rotate(90deg); }
.ft-row .ft-dot { margin-left: auto; width: 6px; height: 6px; border-radius: 50%; }
.ft-row .ft-dot.mod { background: var(--mra-yellow); }
.ft-row .ft-dot.add { background: var(--mra-green); }
.ft-row .ft-badge { margin-left: auto; font-family: var(--mra-font-mono); font-size: .66rem; font-weight: 600; padding: 0 5px; border-radius: 4px; }
.ft-row .ft-badge.M { color: var(--mra-yellow); background: var(--mra-yellow-soft); }
.ft-row .ft-badge.U { color: var(--mra-green); background: var(--mra-green-soft); }
.ide-theme-dark .ft-row .ft-badge.M { background: rgba(249,171,0,0.16); }
.ide-theme-dark .ft-row .ft-badge.U { background: rgba(31,138,91,0.18); }
.ft-children { display: grid; }
.ft-row.creating { color: var(--ic-fg); }
.ft-newinput {
  flex: 1; min-width: 0; border: 1px solid var(--mra-blue); border-radius: 4px;
  background: var(--ic-editor); color: var(--ic-fg); font: inherit; font-size: .82rem;
  padding: 1px 6px; outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,0.18);
}
.ft-newinput::placeholder { color: var(--ic-fg-faint); }
.ft-foot { border-top: 1px solid var(--ic-border-soft); padding: 9px 14px; display: flex; align-items: center; gap: 8px; color: var(--ic-fg-muted); font-size: .76rem; }
.ft-foot .gb { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mra-font-mono); }

/* ---- editor column -------------------------------------------------- */
/* Rows: tabstrip (tabs + optional breadcrumb, auto) · editor (1fr) · terminal (auto).
   The tabstrip wraps the tabbar + breadcrumb so a present/absent breadcrumb never
   changes the grid child count (which previously stole the 1fr row). */
.editor-col { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-width: 0; min-height: 0; background: var(--ic-editor); }
.ide-shell .ide-tabstrip { display: flex; flex-direction: column; min-width: 0; }

.tabbar { display: flex; align-items: stretch; background: var(--ic-tab-bar); border-bottom: 1px solid var(--ic-border); overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; height: 38px; border-right: 1px solid var(--ic-border-soft); color: var(--ic-fg-muted); font-size: .82rem; cursor: pointer; white-space: nowrap; background: var(--ic-tab-inactive); transition: background 120ms ease, color 120ms ease; }
.tab:hover { background: var(--ic-hover); color: var(--ic-fg); }
.tab.active { background: var(--ic-editor); color: var(--ic-fg); position: relative; }
.tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--mra-blue); }
.tab .tdot { width: 7px; height: 7px; border-radius: 50%; background: var(--mra-yellow); flex: 0 0 auto; }
.tab .tclose { width: 16px; height: 16px; border-radius: 4px; display: grid; place-items: center; color: inherit; opacity: .55; }
.tab .tclose:hover { opacity: 1; background: rgba(127,127,127,0.18); }

/* editor surface */
.editor {
  background: var(--ic-editor); color: var(--ic-fg-2);
  font-family: var(--mra-font-mono); font-size: 13px; line-height: 1.62;
  overflow: auto; min-height: 0; position: relative;
}
.editor .code { display: grid; grid-template-columns: auto 1fr; min-height: 100%; }
.editor .gutter { text-align: right; padding: 14px 12px 14px 18px; color: var(--ed-gutter); user-select: none; border-right: 1px solid var(--ed-line); }
.editor .lines { padding: 14px 18px; white-space: pre; tab-size: 2; color: var(--ic-fg); }
.editor .ln { display: block; }
.editor .ln.hl { background: var(--ed-hl); margin: 0 -18px; padding: 0 18px; }
/* syntax colors */
.tk-key { color: var(--ed-key); }
.tk-str { color: var(--ed-str); }
.tk-com { color: var(--ed-com); font-style: italic; }
.tk-fn  { color: var(--ed-fn); }
.tk-num { color: var(--ed-num); }
.tk-typ { color: var(--ed-typ); }
.tk-pun { color: var(--ed-pun); }
.tk-tag { color: var(--ed-tag); }

/* ---- terminal panel ------------------------------------------------- */
.terminal { background: var(--ic-editor); border-top: 1px solid var(--ic-border); display: block; height: var(--term-h, 196px); min-height: 0; overflow: hidden; }
.terminal.collapsed { height: 34px; }
.terminal-console { min-height: 0; height: 100%; display: grid; grid-template-rows: 34px minmax(0, 1fr); overflow: hidden; }
.terminal.collapsed .terminal-console { grid-template-rows: 34px; }
.term-head { height: 34px; display: flex; align-items: center; gap: 4px; padding: 0 10px; border-bottom: 1px solid var(--ic-border-soft); }
.term-tab { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; font-size: .76rem; color: var(--ic-fg-muted); cursor: pointer; border-radius: 6px; }
.term-tab.active { color: var(--ic-fg); font-weight: 600; }
.term-tab svg { width: 13px; height: 13px; }
.term-head .spacer { flex: 1; }
.term-head .th-btn { border: 0; background: transparent; color: var(--ic-fg-muted); width: 24px; height: 24px; border-radius: 5px; display: grid; place-items: center; cursor: pointer; }
.term-head .th-btn:hover { background: var(--ic-hover); color: var(--ic-fg); }
.term-body { min-height: 0; overflow-y: auto; padding: 10px 14px; font-family: var(--mra-font-mono); font-size: 12.5px; line-height: 1.6; color: var(--ic-fg-2); }
.term-body .t-line { white-space: pre-wrap; }
.term-body .t-prompt { color: var(--mra-green); }
.term-body .t-path { color: var(--mra-blue); }
.ide-theme-dark .term-body .t-path { color: #82aaff; }
.term-body .t-dim { color: var(--ed-com); }
.term-body .t-ok { color: var(--mra-green); }
.term-body .t-warn { color: var(--eb-amber); }
.term-cursor { display: inline-block; width: 7px; height: 14px; background: var(--mra-green); vertical-align: text-bottom; animation: blink 1.1s step-end infinite; }
.t-pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ic-fg); font: inherit; }
@keyframes blink { 50% { opacity: 0; } }

.guest-term-body.xterm-mounted {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  padding: 0;
  overflow: hidden;
}
.xterm-host {
  min-height: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  padding: 8px 10px 6px;
  background: var(--ic-editor);
}
/* Terminal panel resize handle (drag the top edge, like iTerm/VS Code). */
.terminal { position: relative; }
.term-resize {
  position: absolute;
  top: -3px;
  left: 0;
  right: 0;
  height: 7px;
  cursor: ns-resize;
  z-index: 6;
  background: transparent;
}
.term-resize:hover,
.term-resize.dragging { background: var(--ic-active-bg); }
.term-resize:focus-visible { outline: 2px solid var(--ic-active-bg); outline-offset: -2px; }
body.term-resizing { cursor: ns-resize; user-select: none; }
/* Connection status chip in the term-head. */
.term-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ic-fg-muted);
  padding: 0 6px;
  white-space: nowrap;
}
.term-status-chip .ts-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ic-fg-faint); flex: 0 0 auto; }
.term-status-chip.ok { color: var(--mra-green, #1f8a5b); }
.term-status-chip.ok .ts-dot { background: var(--mra-green, #1f8a5b); box-shadow: 0 0 0 3px rgba(31, 138, 91, 0.16); }
.term-status-chip.warn { color: var(--eb-amber, #b45309); }
.term-status-chip.warn .ts-dot { background: var(--eb-amber, #d97706); animation: pulse-dot 1.2s ease-in-out infinite; }
.term-status-chip.off { color: var(--ic-fg-faint); }
/* Theme the xterm viewport scrollbar to match the IDE. */
.xterm-host .xterm-viewport::-webkit-scrollbar { width: 10px; }
.xterm-host .xterm-viewport::-webkit-scrollbar-thumb { background: var(--ic-border); border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
.xterm-host .xterm-viewport::-webkit-scrollbar-thumb:hover { background: var(--ic-fg-faint); background-clip: content-box; }
.xterm-host .xterm-viewport { scrollbar-width: thin; }
.xterm-host > .terminal.xterm {
  height: 100%;
  min-height: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}
.xterm-host .xterm-screen,
.xterm-host .xterm-viewport {
  background: transparent !important;
}
.xterm-host .xterm {
  font-feature-settings: "liga" 0;
}

@media (max-width: 1180px) {
  .ide-shell {
    min-height: 0;
    overflow: hidden;
  }
  .ide { min-width: 0; }
  .ide-top {
    min-width: 0;
    overflow-x: auto;
  }
  /* Panel visibility is now driven by state (applyResponsiveLayout, which is UI-scale
     aware) via the .no-ai / .explorer-collapsed classes — NOT a hard CSS display:none
     here (that fought the zoom control + manual toggles). Grid columns follow those
     classes (base rules). Only keep the legacy .ide-stage layout collapse below. */
  .ide-stage,
  .ide-stage.no-assistant { grid-template-columns: 48px minmax(0, 1fr); }
  .ide-stage > .assistant-panel { display: none; }
  .ide-top .crumbs {
    flex: 1 1 auto;
    min-width: 0;
  }
  .ide-top .runtime-cluster {
    flex: 0 0 auto;
  }
  .term-tab {
    flex: 0 0 auto;
  }
  .term-head {
    min-width: 0;
    overflow-x: auto;
  }
}

@media (max-width: 760px) {
  /* 4-track grid that follows the state classes (slimmer 44px activity bar at narrow
     widths). The previous 2-track override (`44px minmax(0,1fr)`) only defined 2 tracks
     for 4 grid children, so the still-present sidepane grabbed the 1fr and the editor
     collapsed to ~44px — the "narrow layout is broken" bug. applyResponsiveLayout
     auto-collapses both side panels below their breakpoints, so the editor stays primary. */
  .ide-body { grid-template-columns: 44px 256px minmax(0, 1fr) var(--ai-w, 360px); }
  .ide-body.no-ai { grid-template-columns: 44px 256px minmax(0, 1fr) 0; }
  .ide-body.explorer-collapsed { grid-template-columns: 44px 0 minmax(0, 1fr) var(--ai-w, 360px); }
  .ide-body.explorer-collapsed.no-ai { grid-template-columns: 44px 0 minmax(0, 1fr) 0; }
  .sidepane { overflow: hidden; }
  .ide-top {
    gap: 8px;
    padding: 0 8px;
  }
  .terminal {
    height: min(240px, 36vh);
  }
  .term-body {
    padding: 8px 10px;
    font-size: 12px;
  }
  .term-tab {
    padding: 5px 9px;
    font-size: .72rem;
  }
}

@media (max-height: 620px) {
  .terminal {
    height: clamp(120px, 32dvh, 196px);
  }
}

/* ---- AI / vibe panel ------------------------------------------------ */
.ai-panel { background: var(--ic-panel); border-left: 1px solid var(--ic-border); display: grid; grid-template-rows: auto 1fr auto; min-height: 0; min-width: 0; }
.ai-head { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--ic-border-soft); }
.ai-head .ai-mark { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, var(--eb-orange), var(--eb-amber)); display: grid; place-items: center; color: #fff; flex: 0 0 auto; }
.ai-head .ai-t { display: grid; gap: 0; }
.ai-head .ai-t strong { font-size: .86rem; font-weight: 650; color: var(--ic-fg); }
.ai-head .ai-t span { font-size: .72rem; color: var(--ic-fg-muted); }
.ai-head .spacer { flex: 1; }
.ai-head .ai-x { border: 0; background: transparent; color: var(--ic-fg-faint); width: 26px; height: 26px; border-radius: 6px; cursor: pointer; display: grid; place-items: center; }
.ai-head .ai-x:hover { background: var(--ic-hover); color: var(--ic-fg); }

.ai-thread-wrap { position: relative; min-height: 0; display: grid; grid-template-rows: 1fr; }
.ai-thread { overflow-y: auto; overflow-x: hidden; padding: 16px 14px; display: grid; gap: 11px; align-content: start; min-width: 0; min-height: 0; overscroll-behavior: contain; }
.ai-thread.is-empty { align-content: center; }
/* Floating "jump to latest" pill — shown only when the user has scrolled up off the
   bottom of an overflowing thread (toggled via the .show class by the scroll handler). */
.ai-jumpbtn { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%) translateY(6px); display: none; align-items: center; gap: 5px; padding: 5px 12px 5px 9px; font-size: .74rem; font-weight: 600; color: var(--ic-fg); background: var(--ic-panel); border: 1px solid var(--ic-border); border-radius: 999px; box-shadow: 0 6px 18px rgba(0,0,0,0.18); cursor: pointer; opacity: 0; transition: opacity .14s ease, transform .14s ease; z-index: 4; }
.ai-jumpbtn svg { transform: rotate(90deg); }
.ai-jumpbtn:hover { background: var(--ic-hover); }
.ai-jumpbtn.show { display: inline-flex; opacity: 1; transform: translateX(-50%) translateY(0); }
.ai-msg { display: grid; gap: 5px; min-width: 0; }
.ai-msg .who { display: flex; align-items: center; gap: 7px; font-size: .72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ic-fg-faint); }
.ai-msg.user .who .ub { width: 18px; height: 18px; border-radius: 5px; background: linear-gradient(135deg, var(--mra-blue), var(--mra-blue-strong)); color: #fff; display: grid; place-items: center; font-size: .6rem; font-weight: 700; }
.ai-msg.bot .who .bb { width: 18px; height: 18px; border-radius: 5px; background: linear-gradient(135deg, var(--eb-orange), var(--eb-amber)); display: grid; place-items: center; color: #fff; }
.ai-bubble { font-size: .85rem; line-height: 1.55; color: var(--ic-fg-2); min-width: 0; overflow-wrap: anywhere; }
.ai-bubble.user { background: var(--ic-active-bg); border: 1px solid var(--ic-border); border-radius: 10px; padding: 9px 12px; color: var(--ic-fg-2); }
.ide-theme-dark .ai-bubble.user { border-color: rgba(37,99,235,0.4); }
.ai-bubble p { margin: 0 0 7px; }
.ai-bubble p:last-child { margin: 0; }
.ai-bubble code { font-family: var(--mra-font-mono); font-size: .8rem; background: var(--ic-chip); padding: 1px 5px; border-radius: 4px; color: var(--ic-fg); }
.ai-codeblock { background: var(--ic-code-bg); border: 1px solid var(--ic-code-border); border-radius: 9px; padding: 10px 12px; font-family: var(--mra-font-mono); font-size: .76rem; line-height: 1.6; color: var(--ic-fg-2); overflow-x: auto; margin: 4px 0; white-space: pre; max-width: 100%; }
.ai-diff { border: 1px solid var(--ic-border); border-radius: 9px; overflow: hidden; margin: 4px 0; font-family: var(--mra-font-mono); font-size: .75rem; max-width: 100%; }
.ai-diff .dscroll { overflow-x: auto; }
.ai-diff .dh { background: var(--ic-chip); padding: 5px 10px; color: var(--ic-fg-muted); border-bottom: 1px solid var(--ic-border-soft); display: flex; justify-content: space-between; }
.ai-diff .dl { padding: 1px 10px; white-space: pre; }
.ai-diff .dl.add { background: var(--mra-green-soft); color: #14663f; }
.ai-diff .dl.del { background: var(--mra-red-soft); color: #9e2b22; }
.ide-theme-dark .ai-diff .dl.add { background: rgba(31,138,91,0.18); color: #8fe0b3; }
.ide-theme-dark .ai-diff .dl.del { background: rgba(217,48,37,0.16); color: #f0a59e; }
.ai-actions { display: flex; gap: 7px; margin-top: 2px; }
.ai-actions.choice-actions { flex-wrap: wrap; margin-top: 9px; }
.ai-chip-btn { border: 1px solid var(--ic-border); background: var(--ic-chrome); color: var(--ic-fg); font: inherit; font-size: .76rem; font-weight: 600; padding: 5px 10px; border-radius: 7px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; transition: background 120ms ease, border-color 120ms ease; }
.ai-chip-btn:hover { background: var(--ic-hover); border-color: var(--ic-fg-faint); }
.ai-chip-btn.apply { background: var(--mra-blue); border-color: var(--mra-blue); color: #fff; }
.ai-chip-btn.apply:hover { background: var(--mra-blue-strong); }
.ai-typing { display: inline-flex; gap: 4px; align-items: center; padding: 4px 0; }
.ai-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ic-fg-faint); animation: typing 1.2s ease-in-out infinite; }
.ai-typing i:nth-child(2) { animation-delay: .2s; }
.ai-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes typing { 0%,60%,100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.ai-compose { border-top: 1px solid var(--ic-border-soft); padding: 12px 14px; display: grid; gap: 9px; }
.ai-ctx { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; color: var(--ic-fg-muted); background: var(--ic-chip); border: 1px solid var(--ic-border-soft); border-radius: 6px; padding: 2px 8px; font-family: var(--mra-font-mono); }
.ai-input-wrap { border: 1px solid var(--ic-border); border-radius: 11px; background: var(--ic-chrome); padding: 9px 10px; display: grid; gap: 8px; transition: border-color 120ms ease, box-shadow 120ms ease; }
.ai-input-wrap:focus-within { border-color: var(--mra-blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.14); }
.ai-input-wrap textarea { border: 0; outline: none; resize: none; font: inherit; font-size: .85rem; color: var(--ic-fg); background: transparent; line-height: 1.45; min-height: 20px; max-height: 110px; }
.ai-input-wrap textarea::placeholder { color: var(--ic-fg-faint); }
.ai-input-row { display: flex; align-items: center; justify-content: space-between; }
.ai-send { width: 30px; height: 30px; border-radius: 8px; border: 0; background: var(--mra-blue); color: #fff; display: grid; place-items: center; cursor: pointer; transition: background 120ms ease, transform 120ms ease; }
.ai-send:hover { background: var(--mra-blue-strong); transform: translateY(-1px); }
.ai-send:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* avatar border adapts in dark */
.ide-theme-dark .ide-top .avatar { box-shadow: 0 0 0 1px rgba(255,255,255,0.12); }

/* status bar bottom — thin (now an active VS Code-style status bar; see .ide-status above) */

/* =====================================================================
   CHROME POPOVERS — egress policy, source control, deploy / CI-CD
   ===================================================================== */
.pop-wrap { position: relative; z-index: 45; display: inline-flex; }
.pop-backdrop { position: fixed; inset: 0; z-index: 40; }
.popover {
  position: absolute; top: calc(100% + 9px); z-index: 50; width: 334px;
  background: var(--ic-panel); border: 1px solid var(--ic-border); border-radius: 13px;
  box-shadow: var(--mra-shadow-modal); padding: 15px; color: var(--ic-fg-2);
}
.popover.deploy { width: 392px; }
.popover.right { right: 0; }
.popover.left { left: 0; }

.pop-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pop-head h4 { margin: 0; font-size: .94rem; font-weight: 650; color: var(--ic-fg); letter-spacing: -0.01em; }
.pop-sub { margin: 4px 0 0; font-size: .77rem; color: var(--ic-fg-muted); line-height: 1.5; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pop-sub code { font-family: var(--mra-font-mono); font-size: .72rem; color: var(--ic-fg-2); background: var(--ic-chip); padding: 1px 6px; border-radius: 5px; }
.pop-label { display: flex; align-items: center; gap: 7px; font-size: .64rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ic-fg-muted); margin: 14px 0 7px; }
.pop-label span { font-family: var(--mra-font-num); letter-spacing: 0; color: var(--ic-fg-faint); background: var(--ic-chip); border-radius: 999px; padding: 1px 7px; font-size: .68rem; }
.pop-foot { margin: 11px 0 0; font-size: .73rem; color: var(--ic-fg-faint); line-height: 1.5; }

.pop-badge { display: inline-flex; align-items: center; gap: 6px; font-size: .68rem; font-weight: 700; letter-spacing: 0.02em; color: var(--mra-green); background: var(--mra-green-soft); border: 1px solid var(--mra-border-green, #b7dfc4); padding: 3px 9px; border-radius: 999px; white-space: nowrap; flex: 0 0 auto; }
.pop-badge .pd { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ide-theme-dark .pop-badge { background: rgba(31,138,91,0.16); border-color: rgba(108,211,154,0.34); color: #6cd39a; }
/* Neutral badge for a display-only editor that isn't wired to live state. */
.pop-badge.muted { color: var(--ic-fg-muted); background: var(--ic-chip); border-color: var(--ic-border); }
.ide-theme-dark .pop-badge.muted { color: var(--ic-fg-muted); background: var(--ic-chip); border-color: var(--ic-border); }

.pop-seg { display: inline-flex; width: 100%; border: 1px solid var(--ic-border); border-radius: 8px; overflow: hidden; }
.pop-seg button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: var(--ic-chrome); color: var(--ic-fg-muted); padding: 8px 10px; font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; transition: background 120ms ease, color 120ms ease; }
.pop-seg button + button { border-left: 1px solid var(--ic-border); }
.pop-seg button.active { background: var(--ic-active-bg); color: var(--ic-active-fg); }

.pop-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--ic-border); background: var(--ic-chrome); color: var(--ic-fg); border-radius: 8px; padding: 8px 12px; font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease; }
.pop-btn:hover:not(:disabled) { background: var(--ic-hover); border-color: var(--ic-fg-faint); }
.pop-btn.primary { background: var(--mra-blue); border-color: var(--mra-blue); color: #fff; }
.pop-btn.primary:hover:not(:disabled) { background: var(--mra-blue-strong); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(37,99,235,0.24); }
.pop-btn:disabled { opacity: .5; cursor: not-allowed; }

/* egress */
.egress-list { display: grid; gap: 1px; max-height: 188px; overflow: auto; }
.egress-row { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 7px; }
.egress-row:hover { background: var(--ic-hover); }
.egress-row .estat { width: 7px; height: 7px; border-radius: 50%; background: var(--mra-green); box-shadow: 0 0 0 3px rgba(31,138,91,0.16); flex: 0 0 auto; }
.egress-row .eh { flex: 1; min-width: 0; font-family: var(--mra-font-mono); font-size: .8rem; color: var(--ic-fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.egress-row .ep { font-family: var(--mra-font-num); font-size: .73rem; color: var(--ic-fg-muted); }
.egress-row .edel { border: 0; background: transparent; color: var(--ic-fg-faint); width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; cursor: pointer; flex: 0 0 auto; }
.egress-row .edel:hover { background: var(--mra-red-soft); color: var(--mra-red); }
.ide-theme-dark .egress-row .edel:hover { background: rgba(217,48,37,0.18); color: #f0a59e; }
.egress-empty { font-size: .78rem; color: var(--ic-fg-muted); padding: 9px 8px; line-height: 1.45; }
.egress-add { display: flex; gap: 8px; margin-top: 9px; }
.egress-add input { flex: 1; min-width: 0; border: 1px solid var(--ic-border); border-radius: 8px; background: var(--ic-chrome); color: var(--ic-fg); font: inherit; font-size: .8rem; font-family: var(--mra-font-mono); padding: 7px 10px; outline: none; transition: border-color 120ms ease, box-shadow 120ms ease; }
.egress-add input:focus { border-color: var(--mra-blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.14); }

/* source control */
.repo-branch { display: flex; align-items: center; gap: 8px; width: 100%; border: 1px solid var(--ic-border); background: var(--ic-chrome); color: var(--ic-fg); border-radius: 9px; padding: 9px 11px; cursor: pointer; font: inherit; }
.repo-branch:hover { border-color: var(--ic-fg-faint); }
.repo-branch .rb-name { font-family: var(--mra-font-mono); font-size: .82rem; }
.repo-branch .rb-track { margin-left: auto; font-family: var(--mra-font-num); font-size: .74rem; color: var(--ic-fg-muted); }
.repo-branchlist { display: grid; gap: 1px; margin-top: 6px; border: 1px solid var(--ic-border); border-radius: 9px; padding: 5px; }
.repo-branchitem { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 7px; border: 0; background: transparent; color: var(--ic-fg-2); font: inherit; font-size: .82rem; font-family: var(--mra-font-mono); cursor: pointer; text-align: left; }
.repo-branchitem:hover { background: var(--ic-hover); }
.repo-branchitem.active { color: var(--ic-active-fg); }
.repo-branchitem.new { font-family: var(--mra-font-ui); color: var(--ic-fg-muted); }
.repo-changes { display: grid; gap: 1px; max-height: 156px; overflow: auto; }
.repo-change { display: flex; align-items: center; gap: 9px; padding: 5px 8px; border-radius: 7px; }
.repo-change:hover { background: var(--ic-hover); }
.repo-change .rc-path { font-family: var(--mra-font-mono); font-size: .78rem; color: var(--ic-fg-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.repo-msg { width: 100%; border: 1px solid var(--ic-border); border-radius: 9px; background: var(--ic-chrome); color: var(--ic-fg); font: inherit; font-size: .82rem; padding: 8px 10px; resize: none; outline: none; margin: 8px 0 0; transition: border-color 120ms ease, box-shadow 120ms ease; }
.repo-msg:focus { border-color: var(--mra-blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.14); }
.repo-msg:disabled { opacity: .55; }
.repo-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 9px; }

/* deploy */
.dep-providers { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.dep-prov { border: 1px solid var(--ic-border); border-radius: 10px; background: var(--ic-chrome); padding: 10px 9px; display: grid; gap: 7px; cursor: pointer; text-align: left; transition: border-color 120ms ease, box-shadow 120ms ease; }
.dep-prov:hover { border-color: var(--ic-fg-faint); }
.dep-prov.active { border-color: var(--mra-blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.14); }
.dp-ico { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; color: #fff; font-family: var(--mra-font-mono); font-size: .68rem; font-weight: 700; }
.dp-ico.sm { width: 16px; height: 16px; border-radius: 5px; font-size: .54rem; display: inline-grid; vertical-align: -3px; }
.dep-prov .dp-name { font-size: .76rem; font-weight: 650; color: var(--ic-fg); line-height: 1.2; }
.dep-stages { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dep-stage { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; color: var(--ic-fg-2); background: var(--ic-chip); border: 1px solid var(--ic-border-soft); border-radius: 7px; padding: 5px 9px; }
.dep-stage.ok { color: var(--mra-green); background: var(--mra-green-soft); border-color: var(--mra-border-green, #b7dfc4); }
.ide-theme-dark .dep-stage.ok { background: rgba(31,138,91,0.16); border-color: rgba(108,211,154,0.3); color: #6cd39a; }
.dep-stage.run { color: var(--mra-blue-strong); background: var(--ic-active-bg); border-color: transparent; }
.dep-arrow { color: var(--ic-fg-faint); }
.ds-dot { width: 7px; height: 7px; border-radius: 50%; }
.ds-dot.ok { background: var(--mra-green); }
.ide-theme-dark .ds-dot.ok { background: #6cd39a; }
.ds-dot.wait { background: var(--ic-fg-faint); }
.bs-spin.sm { width: 12px; height: 12px; border-width: 2px; }
.dep-status { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: .78rem; color: var(--ic-fg-2); background: var(--ic-chip); border: 1px solid var(--ic-border-soft); border-radius: 9px; padding: 9px 11px; }
.dep-status code { font-family: var(--mra-font-mono); font-size: .73rem; color: var(--ic-fg); }
.dep-trigger { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--ic-border); border-radius: 9px; padding: 9px 11px; }
.dep-trigger .dt-t { font-size: .82rem; font-weight: 600; color: var(--ic-fg); }
.dep-trigger .dt-s { font-size: .73rem; color: var(--ic-fg-muted); margin-top: 1px; }
.dep-trigger .dt-s code { font-family: var(--mra-font-mono); }
.dep-switch { width: 36px; height: 20px; border: 0; padding: 0; border-radius: 999px; background: var(--ic-border); position: relative; cursor: pointer; transition: background 120ms ease; flex: 0 0 auto; }
.dep-switch.on { background: var(--mra-blue); }
.dep-switch i { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left 120ms ease; box-shadow: 0 1px 2px rgba(0,0,0,0.25); }
.dep-switch.on i { left: 18px; }

/* triggers in the chrome */
.ide-top .crumbs .branch.trigger { border: 0; cursor: pointer; font: inherit; transition: background 120ms ease, color 120ms ease; }
.ide-top .crumbs .branch.trigger:hover, .ide-top .crumbs .branch.trigger.on { color: var(--ic-fg); background: var(--ic-active-bg); border-color: transparent; }
/* The egress trigger reuses the global .btn class, which sets a white resting
   background that clashed in the dark IDE. Reset it so the dark sandbox panel
   shows through (light theme keeps a white --ic-panel, so it stays white). */
.sb-fact.btn { border: 0; font: inherit; cursor: pointer; background: transparent; color: var(--ic-fg-2); box-shadow: none; border-radius: 0; transition: background 120ms ease, color 120ms ease; }
.sb-fact.btn:hover, .sb-fact.btn.on { background: var(--ic-hover); color: var(--ic-fg); }
.ide-theme-dark .sb-fact.btn:hover, .ide-theme-dark .sb-fact.btn.on { background: var(--ic-chip); }
.sandbox[role="button"] { cursor: pointer; }
.sandbox.on { box-shadow: inset 0 0 0 1px var(--ic-sandbox-line); }
.vm-pop { width: 292px; }
.vm-usage { display: grid; gap: 7px; margin-top: 13px; }
.vm-usage span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--ic-border-soft);
  border-radius: 8px;
  padding: 7px 9px;
  color: var(--ic-fg-muted);
  font-size: .78rem;
}
.vm-usage svg { color: var(--ic-fg-faint); }
.vm-usage code {
  margin-left: auto;
  color: var(--ic-fg);
  font-family: var(--mra-font-mono);
  font-size: .76rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ft-changes { border: 0; background: transparent; font: inherit; font-size: .76rem; cursor: pointer; margin-left: auto; padding: 2px 6px; border-radius: 6px; }
.ft-changes:hover { background: var(--ic-hover); }
.ft-foot .gbtn { border: 0; background: transparent; font: inherit; color: var(--ic-fg-muted); cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.ft-foot .gbtn:hover { background: var(--ic-hover); color: var(--ic-fg); }

/* =====================================================================
   ACTIVITY BAR + SIDE PANELS (Explorer / Source Control / Search)
   ===================================================================== */
.activitybar { background: var(--ic-chrome); border-right: 1px solid var(--ic-border); display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 8px 0; }
.activitybar .ab-top, .activitybar .ab-bottom { display: grid; gap: 4px; }
.ab-btn { position: relative; width: 40px; height: 40px; border: 0; background: transparent; color: var(--ic-fg-faint); border-radius: 9px; display: grid; place-items: center; cursor: pointer; transition: background 120ms ease, color 120ms ease; }
.ab-btn:hover { color: var(--ic-fg); background: var(--ic-hover); }
.ab-btn.active { color: var(--ic-fg); }
.ab-btn.active::before { content: ""; position: absolute; left: -8px; top: 9px; bottom: 9px; width: 2px; border-radius: 2px; background: var(--mra-orange); }
.ab-badge { position: absolute; top: 3px; right: 3px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 999px; background: var(--mra-blue); color: #fff; font-family: var(--mra-font-num); font-size: .58rem; font-weight: 700; display: grid; place-items: center; }

/* shared side panel header */
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 11px 12px 11px 14px; border-bottom: 1px solid var(--ic-border-soft); }
.side-title { font-size: .68rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ic-fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-actions { display: inline-flex; gap: 2px; flex: 0 0 auto; }
.side-actions button { border: 0; background: transparent; color: var(--ic-fg-faint); width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; cursor: pointer; }
.side-actions button:hover { background: var(--ic-hover); color: var(--ic-fg); }

/* ---- Source Control panel ------------------------------------------ */
.scm-panel { background: var(--ic-panel); border-right: 1px solid var(--ic-border); display: grid; grid-template-rows: auto auto 1fr; min-height: 0; min-width: 0; }
.scm-tabs { display: flex; padding: 6px 8px; gap: 4px; border-bottom: 1px solid var(--ic-border-soft); }
.scm-tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: transparent; color: var(--ic-fg-muted); font: inherit; font-size: .78rem; font-weight: 600; padding: 6px 8px; border-radius: 7px; cursor: pointer; transition: background 120ms ease, color 120ms ease; }
.scm-tabs button:hover { background: var(--ic-hover); color: var(--ic-fg); }
.scm-tabs button.active { background: var(--ic-active-bg); color: var(--ic-active-fg); }
.scm-count { font-family: var(--mra-font-num); font-size: .64rem; font-weight: 700; background: var(--ic-chip); color: var(--ic-fg-muted); border-radius: 999px; padding: 1px 6px; }
.scm-tabs button.active .scm-count { background: rgba(37,99,235,0.18); color: var(--ic-active-fg); }
.scm-scroll { overflow-y: auto; overflow-x: hidden; min-height: 0; }

.scm-commit { padding: 12px 12px 10px; display: grid; gap: 8px; border-bottom: 1px solid var(--ic-border-soft); }
.scm-commit textarea { width: 100%; border: 1px solid var(--ic-border); border-radius: 8px; background: var(--ic-chrome); color: var(--ic-fg); font: inherit; font-size: .82rem; padding: 8px 10px; resize: none; outline: none; transition: border-color 120ms ease, box-shadow 120ms ease; }
.scm-commit textarea:focus { border-color: var(--mra-blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.14); }
.scm-commit-actions { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.scm-commit-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; background: var(--mra-blue); color: #fff; border-radius: 8px; padding: 8px 12px; font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; transition: background 120ms ease, transform 120ms ease; }
.scm-commit-btn:hover:not(:disabled) { background: var(--mra-blue-strong); transform: translateY(-1px); }
.scm-commit-btn:disabled { opacity: .5; cursor: not-allowed; }
.scm-commit-split { border: 0; background: var(--mra-blue); color: #fff; border-radius: 8px; width: 38px; display: grid; place-items: center; cursor: pointer; transition: background 120ms ease; }
.scm-commit-split:hover:not(:disabled) { background: var(--mra-blue-strong); }
.scm-commit-split:disabled { opacity: .5; cursor: not-allowed; }

.scm-sync { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--ic-border-soft); }
.scm-branch { display: flex; align-items: center; gap: 7px; width: 100%; border: 1px solid var(--ic-border); background: var(--ic-chrome); color: var(--ic-fg); border-radius: 8px; padding: 7px 10px; cursor: pointer; font: inherit; font-size: .8rem; }
.scm-branch:hover, .scm-branch.on { border-color: var(--ic-fg-faint); }
.scm-branch .b-name { font-family: var(--mra-font-mono); flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scm-branchpop { position: absolute; top: calc(100% + 5px); left: 0; right: 0; z-index: 30; background: var(--ic-panel); border: 1px solid var(--ic-border); border-radius: 9px; box-shadow: var(--mra-shadow-modal); padding: 5px; display: grid; gap: 1px; max-height: 200px; overflow: auto; }
.scm-branchitem { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 7px; border: 0; background: transparent; color: var(--ic-fg-2); font: inherit; font-size: .8rem; font-family: var(--mra-font-mono); cursor: pointer; text-align: left; }
.scm-branchitem:hover { background: var(--ic-hover); }
.scm-branchitem.active { color: var(--ic-active-fg); }
.scm-syncbtn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--ic-border); background: var(--ic-chrome); color: var(--ic-fg); border-radius: 8px; padding: 7px 10px; cursor: pointer; font: inherit; flex: 0 0 auto; transition: background 120ms ease, border-color 120ms ease; }
.scm-syncbtn:hover:not(:disabled) { background: var(--ic-hover); border-color: var(--ic-fg-faint); }
.scm-syncbtn:disabled { opacity: .7; cursor: progress; }
.scm-syncbtn .sy-counts { display: inline-flex; align-items: center; gap: 2px; font-family: var(--mra-font-num); font-size: .72rem; font-variant-numeric: tabular-nums; color: var(--ic-fg-muted); }
.scm-syncbtn .sy-counts svg { margin-left: 3px; }

.scm-section { padding: 6px 6px 2px; }
.scm-sec-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px; font-size: .64rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ic-fg-muted); }
.scm-sec-actions { display: inline-flex; align-items: center; gap: 2px; }
.scm-sec-actions button { border: 0; background: transparent; color: var(--ic-fg-faint); width: 22px; height: 22px; border-radius: 5px; display: grid; place-items: center; cursor: pointer; }
.scm-sec-actions button:hover { background: var(--ic-hover); color: var(--ic-fg); }

.scm-row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 7px; cursor: pointer; transition: background 120ms ease; }
.scm-row:hover { background: var(--ic-hover); }
.scm-ico { flex: 0 0 auto; display: grid; place-items: center; }
.scm-name { font-size: .82rem; color: var(--ic-fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; }
.scm-path { font-size: .72rem; color: var(--ic-fg-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.scm-actions { display: none; align-items: center; gap: 1px; flex: 0 0 auto; }
.scm-row:hover .scm-actions { display: inline-flex; }
.scm-row:hover .scm-stat { display: none; }
.scm-mini { border: 0; background: transparent; color: var(--ic-fg-muted); width: 24px; height: 24px; border-radius: 5px; display: grid; place-items: center; cursor: pointer; }
.scm-mini:hover { background: var(--ic-active-bg); color: var(--ic-active-fg); }
.scm-stat { flex: 0 0 auto; }
.st-letter { font-family: var(--mra-font-mono); font-size: .74rem; font-weight: 700; width: 16px; text-align: center; }
.st-letter.st-M { color: var(--mra-yellow); }
.st-letter.st-U, .st-letter.st-A { color: var(--mra-green); }
.st-letter.st-D { color: var(--mra-red); }
.scm-empty { display: flex; align-items: center; gap: 8px; padding: 16px 14px; font-size: .8rem; color: var(--ic-fg-muted); line-height: 1.5; }
.scm-empty svg { color: var(--mra-green); flex: 0 0 auto; }

/* commit history graph */
.scm-graph { padding: 8px 12px 16px; }
.commit-row { display: grid; grid-template-columns: 18px 1fr; gap: 10px; }
.commit-rail { position: relative; display: flex; justify-content: center; padding-top: 5px; }
.commit-node { width: 10px; height: 10px; border-radius: 50%; background: var(--ic-panel); border: 2px solid var(--mra-orange); z-index: 1; }
.commit-line { position: absolute; top: 14px; bottom: -10px; width: 2px; background: var(--ic-border); }
.commit-body { padding-bottom: 14px; min-width: 0; }
.commit-msg { font-size: .83rem; color: var(--ic-fg); line-height: 1.4; }
.commit-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: .73rem; color: var(--ic-fg-muted); flex-wrap: wrap; }
.commit-hash { font-family: var(--mra-font-mono); font-size: .72rem; color: var(--ic-fg-2); background: var(--ic-chip); padding: 0 5px; border-radius: 4px; }
.commit-meta .dot-sep { opacity: .5; }
.commit-refs { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.commit-ref { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mra-font-mono); font-size: .68rem; color: var(--ic-fg-muted); background: var(--ic-chip); border: 1px solid var(--ic-border-soft); border-radius: 999px; padding: 1px 8px; }
.commit-ref.head { color: var(--mra-blue-strong); background: var(--ic-active-bg); border-color: transparent; font-weight: 700; }
.commit-ref.remote { color: var(--mra-orange-strong); }
.ide-theme-dark .commit-ref.remote { color: #f7b27a; }

/* repo popover additions */
.repo-newbranch { display: flex; align-items: center; gap: 8px; padding: 6px 9px; }
.repo-newbranch input { flex: 1; min-width: 0; border: 1px solid var(--mra-blue); border-radius: 6px; background: var(--ic-editor); color: var(--ic-fg); font: inherit; font-size: .8rem; font-family: var(--mra-font-mono); padding: 4px 8px; outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,0.16); }
.repo-openscm { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; margin-top: 10px; border: 0; background: transparent; color: var(--mra-blue-strong); font: inherit; font-size: .8rem; font-weight: 600; padding: 8px; border-radius: 8px; cursor: pointer; }
.ide-theme-dark .repo-openscm { color: #93b4ff; }
.repo-openscm:hover { background: var(--ic-active-bg); }

/* ---- Search panel --------------------------------------------------- */
.search-panel { background: var(--ic-panel); border-right: 1px solid var(--ic-border); display: grid; grid-template-rows: auto auto 1fr; min-height: 0; min-width: 0; }
.search-box { padding: 11px 12px; display: grid; gap: 8px; border-bottom: 1px solid var(--ic-border-soft); }
.search-field { display: flex; align-items: center; gap: 7px; border: 1px solid var(--ic-border); border-radius: 8px; background: var(--ic-chrome); padding: 6px 9px; color: var(--ic-fg-muted); transition: border-color 120ms ease, box-shadow 120ms ease; }
.search-field:focus-within { border-color: var(--mra-blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.14); }
.search-field input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font: inherit; font-size: .82rem; color: var(--ic-fg); }
.search-summary { font-size: .74rem; color: var(--ic-fg-muted); }
.search-group { padding: 2px 0; }
.search-file { display: flex; align-items: center; gap: 7px; padding: 6px 12px; cursor: pointer; color: var(--ic-fg); font-size: .8rem; }
.search-file:hover { background: var(--ic-hover); }
.search-file .sf-name { font-family: var(--mra-font-mono); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-hit { display: flex; gap: 10px; padding: 3px 12px 3px 30px; cursor: pointer; font-family: var(--mra-font-mono); font-size: .74rem; color: var(--ic-fg-muted); }
.search-hit:hover { background: var(--ic-hover); }
.search-hit .sh-n { color: var(--ic-fg-faint); min-width: 22px; text-align: right; flex: 0 0 auto; }
.search-hit .sh-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-hit mark { background: rgba(249,171,0,0.32); color: inherit; border-radius: 2px; }
.ide-theme-dark .search-hit mark { background: rgba(249,171,0,0.28); color: #ffd479; }

/* ---- Diff view ------------------------------------------------------ */
.diffview { background: var(--ic-editor); overflow: auto; min-height: 0; display: grid; grid-template-rows: auto 1fr; }
.diff-head { display: flex; align-items: center; gap: 12px; padding: 9px 16px; border-bottom: 1px solid var(--ic-border); position: sticky; top: 0; background: var(--ic-editor); }
.diff-file { display: inline-flex; align-items: center; gap: 7px; font-size: .82rem; font-weight: 600; color: var(--ic-fg); }
.diff-sub { font-size: .74rem; color: var(--ic-fg-muted); }
.diff-body { font-family: var(--mra-font-mono); font-size: 12.5px; line-height: 1.7; padding: 8px 0; }
.diff-hunk-head { padding: 2px 16px; color: var(--ic-fg-faint); background: var(--ic-tab-inactive); }
.diff-line { display: grid; grid-template-columns: 44px 44px 16px 1fr; align-items: baseline; padding: 0 12px 0 0; white-space: pre; }
.diff-line .dn { text-align: right; padding-right: 10px; color: var(--ed-gutter); user-select: none; }
.diff-line .dsign { text-align: center; color: var(--ic-fg-faint); }
.diff-line .dtext { white-space: pre; }
.diff-line.add { background: rgba(31,138,91,0.12); }
.diff-line.add .dsign { color: var(--mra-green); }
.diff-line.del { background: rgba(217,48,37,0.12); }
.diff-line.del .dsign { color: var(--mra-red); }
.ide-theme-dark .diff-line.add { background: rgba(31,138,91,0.16); }
.ide-theme-dark .diff-line.del { background: rgba(217,48,37,0.15); }

/* tab tweaks for diff tabs */
.tab .tab-diffico { display: grid; place-items: center; color: var(--mra-orange); }
.tab .tab-diffsuffix { color: var(--ic-fg-faint); font-size: .74rem; }

/* terminal tab buttons (now interactive) */
.term-tab { border: 0; background: transparent; font: inherit; }
.term-tab:hover { color: var(--ed-fg, var(--ic-fg)); }

/* deploy inline logs */
.dep-logs { margin-top: 10px; background: var(--ic-code-bg); border: 1px solid var(--ic-code-border); border-radius: 9px; padding: 9px 11px; font-family: var(--mra-font-mono); font-size: .72rem; line-height: 1.7; color: var(--ic-fg-2); max-height: 160px; overflow: auto; }
.dep-logs .dl-line.ok { color: var(--mra-green); }
.ide-theme-dark .dep-logs .dl-line.ok { color: #6cd39a; }
.dep-logs .dl-line.warn { color: var(--eb-amber); }
.pop-btn.active-soft { background: var(--ic-active-bg); border-color: transparent; color: var(--ic-active-fg); }

/* =====================================================================
   OpenCoder-style assistant: markdown, tool cards, slash menu,
   onboarding, copy buttons. Scoped to .ide-shell so it uses --ic-* theme
   tokens (cohesive in light + dark). Appended last to win the cascade.
   ===================================================================== */
/* --- markdown in assistant bubbles --- */
.ide-shell .ai-md { display: flow-root; }
.ide-shell .ai-md > :first-child { margin-top: 0; }
.ide-shell .ai-md > :last-child { margin-bottom: 0; }
.ide-shell .md-p { margin: 0 0 8px; line-height: 1.55; }
.ide-shell .md-h { margin: 12px 0 6px; font-weight: 650; line-height: 1.3; }
.ide-shell h3.md-h { font-size: .92rem; }
.ide-shell h4.md-h, .ide-shell h5.md-h, .ide-shell h6.md-h { font-size: .84rem; }
.ide-shell .ai-md ul.md-list, .ide-shell .ai-md ol.md-list { margin: 4px 0 10px; padding-left: 18px; }
.ide-shell .ai-md li { margin: 2px 0; line-height: 1.5; }
.ide-shell .md-bq { margin: 6px 0; padding: 4px 10px; border-left: 3px solid var(--ic-border); color: var(--ic-fg-muted); }
.ide-shell .md-hr { border: 0; border-top: 1px solid var(--ic-border-soft); margin: 10px 0; }
/* GFM tables inside the IDE (assistant panel): the shared .md-table base is
   styled for the light dashboard — re-token it from --ic-* so both IDE themes
   render it natively, and keep code spans (file paths) on one line so the
   table scrolls horizontally instead of crushing columns. */
.ide-shell .md-tablewrap { margin: 8px 0 12px; border: 1px solid var(--ic-border); border-radius: 8px; width: max-content; max-width: 100%; }
.ide-shell .md-table { font-size: .78rem; max-width: 560px; }
.ide-shell .md-table th, .ide-shell .md-table td { border: 0; border-bottom: 1px solid var(--ic-border-soft); border-right: 1px solid var(--ic-border-soft); padding: 6px 10px; color: var(--ic-fg-2); }
.ide-shell .md-table th:last-child, .ide-shell .md-table td:last-child { border-right: 0; }
.ide-shell .md-table tbody tr:last-child td { border-bottom: 0; }
.ide-shell .md-table th { background: var(--ic-chip); color: var(--ic-fg); }
.ide-shell .md-table tr:nth-child(even) td { background: color-mix(in srgb, var(--ic-chip) 45%, transparent); }
.ide-shell .md-table code { white-space: nowrap; }
.ide-shell .md-code { font-family: var(--mra-font-mono); font-size: .82em; background: var(--ic-code-bg); border: 1px solid var(--ic-code-border); border-radius: 5px; padding: 0.5px 5px; }
.ide-shell .ai-md a { color: var(--ic-link, #4b9fff); text-decoration: underline; text-underline-offset: 2px; }
.ide-shell .md-pre { margin: 8px 0; border: 1px solid var(--ic-code-border); border-radius: 9px; overflow: hidden; background: var(--ic-code-bg); }
.ide-shell .md-pre-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 4px 11px; border-bottom: 1px solid var(--ic-code-border); background: var(--ic-panel); }
.ide-shell .md-lang { font-size: .66rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ic-fg-muted); }
.ide-shell .md-pre-actions { display: inline-flex; align-items: center; gap: 2px; }
.ide-shell .md-copy, .ide-shell .ai-tool-copy, .ide-shell .ai-msg-copy { display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; color: var(--ic-fg-muted); font-size: .68rem; cursor: pointer; border-radius: 6px; padding: 3px 6px; }
.ide-shell .md-copy:hover, .ide-shell .ai-tool-copy:hover, .ide-shell .ai-msg-copy:hover { background: var(--ic-hover); color: var(--ic-fg); }
.ide-shell .md-copy.copied, .ide-shell .ai-tool-copy.copied, .ide-shell .ai-msg-copy.copied { color: var(--mra-green, #1f8a5b); }
.ide-shell .md-pre pre { margin: 0; padding: 9px 11px; overflow-x: auto; }
.ide-shell .md-pre code { font-family: var(--mra-font-mono); font-size: .78rem; line-height: 1.6; color: var(--ic-fg); }

/* message copy button (hover-reveal, top-right of bubble) */
.ide-shell .ai-bubble { position: relative; }
.ide-shell .ai-msg-copy { position: absolute; top: 5px; right: 5px; opacity: 0; transition: opacity 120ms ease; }
.ide-shell .ai-msg:hover .ai-msg-copy, .ide-shell .ai-msg-copy:focus-visible { opacity: 1; }

/* --- tool-call cards --- */
.ide-shell .ai-msg.tool { padding-left: 0; }
.ide-shell .ai-tool { border: 1px solid var(--ic-border); border-left: 2px solid var(--ic-border); border-radius: 9px; background: var(--ic-panel); overflow: hidden; }
.ide-shell .ai-tool.running { border-left-color: var(--mra-blue, #2563eb); }
.ide-shell .ai-tool.done { border-left-color: var(--mra-green, #1f8a5b); }
.ide-shell .ai-tool.error { border-color: var(--ic-danger-line); border-left-color: var(--mra-red, #dc2626); }
.ide-shell .ai-tool-head { width: 100%; display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: transparent; border: 0; cursor: pointer; color: var(--ic-fg-2); font-size: .78rem; text-align: left; }
.ide-shell .ai-tool-head[disabled] { cursor: default; }
.ide-shell .ai-tool-head:hover:not([disabled]) { background: var(--ic-hover); }
.ide-shell .ai-tool-head .spacer { flex: 1; }
.ide-shell .ai-tool-ico { color: var(--ic-fg-muted); display: inline-flex; }
.ide-shell .ai-tool-verb { font-weight: 600; color: var(--ic-fg); flex: 0 0 auto; }
.ide-shell .ai-tool-target { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ic-fg-muted); }
.ide-shell .ai-tool-target.mono { font-family: var(--mra-font-mono); font-size: .74rem; }
.ide-shell .ai-tool-ok { color: var(--mra-green, #1f8a5b); display: inline-flex; }
.ide-shell .ai-tool-x { color: var(--mra-red, #dc2626); display: inline-flex; }
.ide-shell .ai-tool-chev { color: var(--ic-fg-faint); display: inline-flex; transition: transform 120ms ease; }
.ide-shell .ai-tool-spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ic-border); border-top-color: var(--mra-blue, #2563eb); animation: spin 0.7s linear infinite; }
.ide-shell .ai-tool-body { position: relative; border-top: 1px solid var(--ic-border-soft); background: var(--ic-code-bg); }
.ide-shell .ai-tool-body pre { margin: 0; padding: 9px 11px; max-height: 240px; overflow: auto; font-family: var(--mra-font-mono); font-size: .74rem; line-height: 1.55; color: var(--ic-fg-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.ide-shell .ai-tool-copy { position: absolute; top: 5px; right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Assistant diff cards (Plan C) — a real +/- diff of an Edit/Write tool's change */
.ide-shell .ai-tool.is-diff { border-left-color: var(--mra-blue, #2563eb); }
.ide-shell .ai-diff-stat { display: inline-flex; gap: 6px; font: 600 .68rem/1 var(--mra-font-mono, monospace); margin-right: 2px; }
.ide-shell .ai-diff-stat .add { color: var(--mra-green, #1f8a5b); }
.ide-shell .ai-diff-stat .del { color: var(--mra-red, #d64545); }
.ide-shell .ai-tool-body.diff { background: var(--ic-code-bg); }
.ide-shell .ai-diff { max-height: 280px; overflow: auto; font: .74rem/1.55 var(--mra-font-mono, monospace); }
.ide-shell .ai-diff-row { display: flex; white-space: pre; }
.ide-shell .ai-diff-row.add { background: rgba(31, 138, 91, .12); }
.ide-shell .ai-diff-row.del { background: rgba(214, 69, 69, .12); }
.ide-shell .ai-diff-gutter { flex: 0 0 auto; width: 16px; text-align: center; color: var(--ic-fg-faint); user-select: none; }
.ide-shell .ai-diff-row.add .ai-diff-gutter { color: var(--mra-green, #1f8a5b); }
.ide-shell .ai-diff-row.del .ai-diff-gutter { color: var(--mra-red, #d64545); }
.ide-shell .ai-diff-code { flex: 1; min-width: 0; padding-right: 10px; overflow-wrap: anywhere; white-space: pre-wrap; color: var(--ic-fg-2); }
.ide-shell .ai-diff-more { padding: 4px 11px; color: var(--ic-fg-faint); font-size: .7rem; }
.ide-shell .ai-diff-actions { padding: 7px 9px; border-top: 1px solid var(--ic-border-soft); }
.ide-shell .ai-diff-open { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--ic-border); background: var(--ic-panel); color: var(--ic-fg-2); border-radius: 7px; padding: 4px 10px; font-size: .72rem; font-weight: 600; cursor: pointer; }
.ide-shell .ai-diff-open:hover { background: var(--ic-hover); color: var(--ic-fg); }

/* --- permission card --- */
.ide-shell .ai-perm-what { margin: 6px 0; font-size: .8rem; color: var(--ic-fg); }
.ide-shell .ai-perm-details { margin: 4px 0 8px; }
.ide-shell .ai-perm-details summary { cursor: pointer; color: var(--ic-fg-muted); font-size: .72rem; }
.ide-shell .ai-perm-resolved { font-size: .74rem; font-weight: 600; }
.ide-shell .ai-perm-resolved.ok { color: var(--mra-green, #1f8a5b); }
.ide-shell .ai-perm-resolved.off { color: var(--ic-fg-muted); }
.ide-shell .ai-bubble.ai-perm { border: 1px solid var(--ic-border); border-radius: 10px; padding: 10px 12px; background: var(--ic-panel); }
.ide-shell .ai-bubble.ai-perm p { margin: 0 0 4px; }

/* --- OpenCoder: thinking block --- */
/* Thinking card — state-driven (div, not <details>) so its open state survives the
   re-renders that streaming triggers. .live = the in-flight turn's block. */
.ide-shell .ai-think { border: 1px dashed var(--ic-border); border-radius: 9px; background: var(--ic-code-bg); overflow: hidden; }
.ide-shell .ai-think.live { border-color: var(--ic-active-fg, #4b9fff); border-style: solid; }
.ide-shell .ai-think-head { width: 100%; cursor: pointer; border: 0; background: transparent; text-align: left; display: flex; align-items: center; gap: 6px; padding: 6px 10px; font-size: .74rem; font-weight: 600; color: var(--ic-fg-muted); }
.ide-shell .ai-think-head:hover { background: var(--ic-hover); }
.ide-shell .ai-think-head .spacer { flex: 1; }
.ide-shell .ai-think-ico { display: inline-flex; }
.ide-shell .ai-think.open .ai-think-head { border-bottom: 1px solid var(--ic-border-soft); }
.ide-shell .ai-think-chev { display: inline-flex; transition: transform .12s ease; opacity: .6; }
.ide-shell .ai-think-spin { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--ic-border); border-top-color: var(--ic-active-fg, #4b9fff); animation: ai-spin .7s linear infinite; }
.ide-shell .ai-think-body { padding: 8px 11px; font-size: .76rem; line-height: 1.55; color: var(--ic-fg-muted); font-style: italic; max-height: 280px; overflow: auto; overscroll-behavior: contain; }
/* Themed thin scrollbars for EVERY scroll area in the assistant panel. The
   default OS scrollbar renders light/chunky over the dark IDE (a visual bug),
   and the nested thinking-card scroll chained into the thread scroll (felt
   laggy). overscroll-behavior:contain stops the chaining; the webkit + Firefox
   rules theme the bar with the same --ic-* tokens the terminal already uses. */
.ide-shell .ai-panel ::-webkit-scrollbar,
.ide-shell .ai-think-body::-webkit-scrollbar { width: 9px; height: 9px; }
.ide-shell .ai-panel ::-webkit-scrollbar-track,
.ide-shell .ai-think-body::-webkit-scrollbar-track { background: transparent; }
.ide-shell .ai-panel ::-webkit-scrollbar-thumb,
.ide-shell .ai-think-body::-webkit-scrollbar-thumb { background: var(--ic-border); border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
.ide-shell .ai-panel ::-webkit-scrollbar-thumb:hover,
.ide-shell .ai-think-body::-webkit-scrollbar-thumb:hover { background: var(--ic-fg-faint); background-clip: content-box; }
.ide-shell .ai-panel ::-webkit-scrollbar-corner { background: transparent; }
.ide-shell .ai-panel, .ide-shell .ai-panel *,
.ide-shell .ai-think-body { scrollbar-width: thin; scrollbar-color: var(--ic-border) transparent; }
@keyframes ai-spin { to { transform: rotate(360deg); } }

/* --- OpenCoder: live task list (TodoWrite) --- */
.ide-shell .ai-todos { border: 1px solid var(--ic-border); border-radius: 9px; background: var(--ic-panel); overflow: hidden; }
.ide-shell .ai-todos-head { display: flex; align-items: center; gap: 6px; padding: 7px 10px; font-size: .74rem; font-weight: 700; color: var(--ic-fg); border-bottom: 1px solid var(--ic-border-soft); text-transform: uppercase; letter-spacing: 0.04em; }
.ide-shell .ai-todos-count { margin-left: auto; font-weight: 600; color: var(--ic-fg-muted); }
.ide-shell .ai-todos ul { list-style: none; margin: 0; padding: 6px 8px; display: grid; gap: 3px; }
.ide-shell .ai-todo { display: flex; align-items: flex-start; gap: 8px; font-size: .8rem; color: var(--ic-fg-2); padding: 2px 2px; line-height: 1.4; }
.ide-shell .ai-todo-g { flex: 0 0 auto; margin-top: 1px; display: inline-flex; }
.ide-shell .ai-todo.completed { color: var(--ic-fg-muted); }
.ide-shell .ai-todo.completed span:last-child { text-decoration: line-through; }
.ide-shell .ai-todo.in_progress { color: var(--ic-fg); font-weight: 600; }
.ide-shell .ai-todo.completed .ai-todo-g { color: var(--mra-green, #1f8a5b); }
.ide-shell .ai-todo-pending { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--ic-fg-faint); }
.ide-shell .ai-todo-doing { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--mra-blue, #2563eb); background: conic-gradient(var(--mra-blue, #2563eb) 50%, transparent 50%); animation: spin 1.4s linear infinite; }

/* --- OpenCoder: per-turn usage footer --- */
.ide-shell .ai-foot { display: inline-flex; align-items: center; gap: 6px; font-size: .7rem; color: var(--ic-fg-faint); font-family: var(--mra-font-mono); padding: 2px 0; }
.ide-shell .ai-foot.err { color: var(--mra-red, #dc2626); }

/* --- OpenCoder: streaming caret --- */
.ide-shell .ai-caret { display: inline-block; width: 7px; height: 1.05em; vertical-align: text-bottom; margin-left: 1px; background: var(--eb-orange, #f97316); border-radius: 1px; animation: aiCaret 1s steps(2) infinite; }
@keyframes aiCaret { 50% { opacity: 0; } }

/* --- onboarding empty state --- */
.ide-shell .ai-empty { display: grid; align-content: center; justify-items: center; gap: 9px; padding: 24px 16px; text-align: center; color: var(--ic-fg-2); }
.ide-shell .ai-empty-mark { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--eb-orange, #f97316), var(--eb-amber, #f59e0b)); }
.ide-shell .ai-empty h3 { margin: 0; font-size: 1rem; font-weight: 650; color: var(--ic-fg); }
.ide-shell .ai-empty > p { margin: 0; max-width: 290px; font-size: .8rem; color: var(--ic-fg-muted); line-height: 1.5; }
.ide-shell .ai-empty-jobs { display: grid; gap: 6px; margin-top: 5px; width: 100%; }
.ide-shell .ai-job { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border: 1px solid var(--ic-border); border-radius: 9px; background: var(--ic-panel); color: var(--ic-fg-2); cursor: pointer; text-align: left; font-size: .8rem; transition: background 120ms ease, border-color 120ms ease, transform 120ms ease; }
.ide-shell .ai-job:hover { background: var(--ic-hover); border-color: var(--ic-fg-faint); transform: translateY(-1px); }
.ide-shell .ai-job-ico { color: var(--eb-orange, #f97316); display: inline-flex; flex: 0 0 auto; }
.ide-shell .ai-job-t { flex: 1; min-width: 0; }
.ide-shell .ai-job-go { color: var(--ic-fg-faint); flex: 0 0 auto; }
.ide-shell .ai-job:hover .ai-job-go { color: var(--ic-fg-muted); transform: translateX(2px); transition: transform 120ms ease; }
.ide-shell kbd { font-family: var(--mra-font-mono); font-size: .68rem; background: var(--ic-chip); border: 1px solid var(--ic-border); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; color: var(--ic-fg-2); }

/* --- slash-command menu --- */
.ide-shell .ai-input-wrap { position: relative; }
.ide-shell .ai-slash-menu { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); background: var(--ic-chrome, var(--ic-panel)); border: 1px solid var(--ic-border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.18); padding: 5px; z-index: 30; max-height: 260px; overflow: auto; }
.ide-shell .slash-item { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 4px 8px; width: 100%; border: 0; background: transparent; cursor: pointer; padding: 6px 9px; border-radius: 7px; text-align: left; color: var(--ic-fg-2); }
.ide-shell .slash-item:hover, .ide-shell .slash-item.active { background: var(--ic-active-bg); color: var(--ic-active-fg); }
.ide-shell .slash-cmd { font-family: var(--mra-font-mono); font-size: .8rem; font-weight: 600; color: var(--ic-fg); }
.ide-shell .slash-args { font-family: var(--mra-font-mono); font-size: .72rem; color: var(--ic-fg-faint); }
.ide-shell .slash-desc { grid-column: 1 / -1; font-size: .72rem; color: var(--ic-fg-muted); }
.ide-shell .slash-item.active .slash-cmd, .ide-shell .slash-item.active .slash-desc, .ide-shell .slash-item.active .slash-args { color: var(--ic-active-fg); }


/* Narrow viewports: let the top chrome's clusters scroll instead of clipping the
   Deploy button / avatar off the right edge. (Side panels auto-collapse via JS.) */
@media (max-width: 1000px) {
  .ide-shell .ide-top { overflow-x: auto; overflow-y: hidden; }
  .ide-shell .ide-top::-webkit-scrollbar { height: 0; }
}
/* =====================================================================
   GitHub-style repository browser (Code / Commits / Blob / Diff)
   Scoped to .ghx; lives on the light Ember dashboard surface.
   ===================================================================== */
.repo-detail.ghx { display: grid; gap: 14px; }

/* Top bar: back, mark, title, open-workspace */
.ghx-top { display: flex; align-items: center; gap: 12px; }
.ghx-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex: 0 0 auto; }
.ghx-titles { min-width: 0; }
.ghx-titles h2 { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 1.18rem; font-weight: 650; color: var(--mra-ink); font-family: var(--mra-font-mono); letter-spacing: -0.01em; }
.ghx-vis { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mra-font-ui); font-size: .68rem; font-weight: 600; color: var(--mra-fg-muted); border: 1px solid var(--mra-line); border-radius: 999px; padding: 2px 9px; text-transform: capitalize; }
.ghx-vis svg { color: var(--mra-fg-faint); }

/* Tab strip */
.ghx-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--mra-line); padding: 0 2px; }
.ghx-tab { display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; color: var(--mra-fg-muted); font: inherit; font-size: .88rem; font-weight: 500; padding: 9px 12px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color 120ms ease, border-color 120ms ease; }
.ghx-tab svg { color: var(--mra-fg-faint); }
.ghx-tab:hover { color: var(--mra-ink); }
.ghx-tab.active { color: var(--mra-ink); font-weight: 650; border-bottom-color: var(--mra-orange); }
.ghx-tab.active svg { color: var(--mra-orange-strong); }
.ghx-count { font-family: var(--mra-font-num); font-size: .72rem; font-weight: 600; color: var(--mra-fg-muted); background: #eef1f5; border-radius: 999px; padding: 1px 7px; }
.ghx-tab.active .ghx-count { background: var(--mra-blue-soft); color: var(--mra-blue-strong); }

/* Two-column layout: file panel + About sidebar */
.ghx-codewrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.ghx-codewrap.solo { grid-template-columns: minmax(0, 1fr); }
.ghx-main { min-width: 0; display: grid; gap: 12px; }

/* Sub-bar: ref selector + breadcrumb + commits pill */
.ghx-subbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ghx-subbar-label { display: inline-flex; align-items: center; gap: 7px; font-size: .85rem; font-weight: 600; color: var(--mra-fg-2); }
.ghx-subbar-label svg { color: var(--mra-fg-faint); }

/* Ref selector */
.ghx-refwrap { position: relative; }
.ghx-refbtn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--mra-line); background: var(--mra-surface); color: var(--mra-ink); font: inherit; font-size: .84rem; font-weight: 600; border-radius: 8px; padding: 7px 11px; cursor: pointer; box-shadow: var(--mra-shadow-1); transition: border-color 120ms ease, background 120ms ease; }
.ghx-refbtn svg { color: var(--mra-fg-faint); }
.ghx-refbtn:hover, .ghx-refbtn.on { border-color: var(--mra-blue-line); background: var(--mra-blue-soft); }
.ghx-refname { font-family: var(--mra-font-mono); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ghx-refpop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; min-width: 260px; max-height: 320px; overflow: auto; background: var(--mra-surface); border: 1px solid var(--mra-line); border-radius: 11px; box-shadow: var(--mra-shadow-modal); padding: 6px; display: grid; gap: 1px; }
.ghx-refpop-head { font-size: .64rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mra-fg-faint); padding: 6px 8px; }
.ghx-refitem { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; color: var(--mra-fg-2); font: inherit; font-size: .84rem; text-align: left; padding: 8px 9px; border-radius: 7px; cursor: pointer; }
.ghx-refitem span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mra-font-mono); }
.ghx-refitem svg:first-child { color: var(--mra-fg-faint); flex: 0 0 auto; }
.ghx-refitem:hover { background: var(--mra-blue-soft); }
.ghx-refitem.active { color: var(--mra-blue-strong); font-weight: 650; }
.ghx-refitem.active svg { color: var(--mra-blue); }
.ghx-deftag { flex: 0 0 auto; font-family: var(--mra-font-ui); font-size: .6rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--mra-fg-muted); border: 1px solid var(--mra-line); border-radius: 999px; padding: 1px 6px; }

/* Breadcrumb */
.ghx-crumb { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; font-family: var(--mra-font-mono); font-size: .92rem; min-width: 0; }
.ghx-crumb-ref { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mra-font-ui); font-size: .76rem; color: var(--mra-fg-muted); background: #f3f5f9; border-radius: 6px; padding: 2px 8px; }
.ghx-crumb-ref svg { color: var(--mra-fg-faint); }
.ghx-crumb-root, .ghx-crumb-link { border: 0; background: transparent; color: var(--mra-blue-strong); font: inherit; font-weight: 600; cursor: pointer; padding: 2px 2px; border-radius: 5px; }
.ghx-crumb-root:hover, .ghx-crumb-link:hover { text-decoration: underline; }
.ghx-crumb-cur { color: var(--mra-ink); font-weight: 650; }
.ghx-crumb-sep { color: var(--mra-fg-faint); }

/* Commits pill */
.ghx-pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--mra-line); background: var(--mra-surface); color: var(--mra-fg-2); font: inherit; font-size: .82rem; border-radius: 8px; padding: 7px 11px; cursor: pointer; box-shadow: var(--mra-shadow-1); transition: border-color 120ms ease, background 120ms ease; }
.ghx-pill svg { color: var(--mra-fg-faint); }
.ghx-pill strong { font-family: var(--mra-font-num); color: var(--mra-ink); }
.ghx-pill:hover { border-color: var(--mra-blue-line); background: var(--mra-blue-soft); }
.ghx-pill.sm { padding: 4px 9px; font-size: .76rem; }

/* Avatar */
.gh-av { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; font-family: var(--mra-font-ui); flex: 0 0 auto; line-height: 1; }

/* Latest commit bar */
.ghx-latest { display: flex; align-items: center; gap: 10px; padding: 11px 16px; background: #f6f8fa; border: 1px solid var(--mra-line); border-bottom: 0; border-radius: 12px 12px 0 0; }
.ghx-latest.empty { border-radius: 12px; border-bottom: 1px solid var(--mra-line); color: var(--mra-fg-muted); font-size: .85rem; }
.ghx-latest-msg { min-width: 0; flex: 1; display: inline-flex; gap: 8px; align-items: baseline; border: 0; background: transparent; font: inherit; font-size: .85rem; color: var(--mra-fg-muted); text-align: left; cursor: pointer; overflow: hidden; }
.ghx-latest-msg strong { color: var(--mra-ink); font-weight: 650; flex: 0 0 auto; }
.ghx-latest-msg span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ghx-latest-msg:hover span { color: var(--mra-blue-strong); text-decoration: underline; }
.ghx-latest-when { font-size: .78rem; color: var(--mra-fg-faint); white-space: nowrap; flex: 0 0 auto; }
.ghx-hash { display: inline-flex; align-items: center; gap: 5px; border: 1px solid transparent; background: transparent; font-family: var(--mra-font-mono); font-size: .78rem; color: var(--mra-fg-muted); cursor: pointer; border-radius: 6px; padding: 2px 6px; }
.ghx-hash svg { color: var(--mra-fg-faint); }
.ghx-hash:hover { background: var(--mra-blue-soft); color: var(--mra-blue-strong); }
.ghx-hash.static { cursor: default; }
.ghx-iconcopy { display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; color: var(--mra-fg-faint); cursor: pointer; border-radius: 6px; padding: 4px 6px; font: inherit; font-size: .78rem; }
.ghx-iconcopy:hover { background: #eef1f5; color: var(--mra-fg-2); }
.ghx-iconcopy.copied { color: var(--mra-green); }
.ghx-iconcopy.lite { border: 1px solid var(--mra-line); }

/* File table */
.ghx-files { border: 1px solid var(--mra-line); border-top: 0; border-radius: 0 0 12px 12px; overflow: hidden; background: var(--mra-surface); }
.ghx-row { display: grid; grid-template-columns: minmax(170px, 2.4fr) minmax(0, 5fr) auto; align-items: center; gap: 16px; width: 100%; text-align: left; border: 0; border-top: 1px solid var(--mra-line); background: transparent; font: inherit; padding: 9px 16px; cursor: pointer; transition: background 110ms ease; }
.ghx-row:hover { background: #f6f8fa; }
.ghx-row.static { cursor: default; }
.ghx-row.static:hover { background: transparent; }
.ghx-submod { font-size: .62rem; font-weight: 600; color: var(--mra-fg-muted); border: 1px solid var(--mra-line); border-radius: 999px; padding: 0 6px; margin-left: 4px; }
.ghx-cell { min-width: 0; }
.ghx-cell.name { display: inline-flex; align-items: center; gap: 9px; }
.gh-ico { display: inline-grid; place-items: center; color: var(--mra-fg-faint); flex: 0 0 auto; }
.gh-ico.dir { color: var(--mra-blue); }
.gh-ico.sub { color: var(--mra-fg-muted); }
.ghx-name { font-size: .88rem; color: var(--mra-fg-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ghx-row:hover .ghx-name { color: var(--mra-blue-strong); text-decoration: underline; }
.ghx-name.dir { font-weight: 600; }
.ghx-rowmsg { display: block; font-size: .82rem; color: var(--mra-fg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ghx-cell.age { font-size: .8rem; color: var(--mra-fg-faint); white-space: nowrap; text-align: right; }
.ghx-trunc { display: inline-flex; align-items: center; gap: 7px; font-size: .78rem; color: var(--mra-fg-muted); padding: 4px 2px; }
.ghx-trunc svg { color: var(--mra-fg-faint); }

/* README card */
.ghx-readme { border: 1px solid var(--mra-line); border-radius: 12px; background: var(--mra-surface); overflow: hidden; margin-top: 4px; }
.ghx-readme-head { display: flex; align-items: center; gap: 8px; padding: 11px 16px; border-bottom: 1px solid var(--mra-line); background: #f6f8fa; font-size: .85rem; color: var(--mra-fg-2); }
.ghx-readme-head svg { color: var(--mra-fg-faint); }
.ghx-readme-body { padding: 22px 28px; }
.ghx-readme-pre { font-family: var(--mra-font-mono); font-size: .82rem; color: var(--mra-fg-2); white-space: pre-wrap; word-break: break-word; margin: 0; }

/* Markdown body (README + markdown blob preview) */
.ghx-md { color: var(--mra-fg-2); font-size: .92rem; line-height: 1.65; }
.ghx-md > :first-child { margin-top: 0; }
.ghx-md .md-h { color: var(--mra-ink); font-weight: 650; line-height: 1.3; margin: 22px 0 12px; }
.ghx-md h3.md-h { font-size: 1.5rem; padding-bottom: 7px; border-bottom: 1px solid var(--mra-line); }
.ghx-md h4.md-h { font-size: 1.2rem; padding-bottom: 6px; border-bottom: 1px solid var(--mra-line); }
.ghx-md h5.md-h { font-size: 1rem; }
.ghx-md h6.md-h { font-size: .9rem; }
.ghx-md .md-p { margin: 0 0 14px; }
.ghx-md .md-list { margin: 0 0 14px; padding-left: 26px; }
.ghx-md .md-list li { margin: 4px 0; }
.ghx-md .md-code { font-family: var(--mra-font-mono); font-size: .85em; background: #eff1f4; border-radius: 5px; padding: 0.15em 0.4em; }
.ghx-md .md-bq { margin: 0 0 14px; padding: 2px 16px; border-left: 3px solid var(--mra-line); color: var(--mra-fg-muted); }
.ghx-md .md-hr { border: 0; border-top: 1px solid var(--mra-line); margin: 22px 0; }
.ghx-md a { color: var(--mra-blue-strong); text-decoration: none; }
.ghx-md a:hover { text-decoration: underline; }
.ghx-md .md-pre { margin: 0 0 14px; border: 1px solid var(--mra-line); border-radius: 10px; overflow: hidden; background: #f6f8fa; }
.ghx-md .md-pre-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px; border-bottom: 1px solid var(--mra-line); }
.ghx-md .md-lang { font-family: var(--mra-font-mono); font-size: .72rem; color: var(--mra-fg-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.ghx-md .md-copy { display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; color: var(--mra-fg-faint); font: inherit; font-size: .72rem; cursor: pointer; border-radius: 5px; padding: 3px 6px; }
.ghx-md .md-copy:hover { background: #eef1f5; color: var(--mra-fg-2); }
.ghx-md .md-pre pre { margin: 0; padding: 14px 16px; overflow: auto; }
.ghx-md .md-pre code { font-family: var(--mra-font-mono); font-size: .82rem; color: var(--mra-fg-2); }
.ghx-md img { max-width: 100%; border-radius: 8px; }

/* Markdown tables (shared). width:max-content + max-width lets columns take
   their natural width and overflow into the scrolling wrap instead of the
   auto table layout crushing them to fit a narrow container. The cells reset
   overflow-wrap because an inherited `anywhere` (e.g. .ai-bubble) collapses
   every column's min-content width to ~1 character. */
.md-tablewrap { overflow-x: auto; max-width: 100%; margin: 0 0 14px; }
.md-table { border-collapse: collapse; font-size: .86rem; width: max-content; max-width: 100%; }
.md-table th, .md-table td {
  border: 1px solid var(--mra-line); padding: 7px 13px; text-align: left;
  vertical-align: top; overflow-wrap: normal; word-break: normal; min-width: 7ch;
}
.md-table th { background: #f6f8fa; font-weight: 650; color: var(--mra-ink); }
.md-table tr:nth-child(even) td { background: #fbfcfd; }

/* About sidebar */
.ghx-about { display: grid; gap: 16px; align-content: start; position: sticky; top: 12px; }
.ghx-about h4 { margin: 0; font-size: .92rem; font-weight: 650; color: var(--mra-ink); }
.ghx-about-desc { margin: -6px 0 0; font-size: .86rem; color: var(--mra-fg-muted); line-height: 1.55; }
.ghx-clone { display: grid; gap: 6px; }
.ghx-clone-label { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 600; color: var(--mra-fg-faint); text-transform: uppercase; letter-spacing: 0.04em; }
.ghx-clone-label svg { color: var(--eb-orange); }
.ghx-clone-row { display: flex; align-items: center; gap: 6px; border: 1px solid var(--mra-line); border-radius: 8px; background: #f6f8fa; padding: 5px 6px 5px 10px; }
.ghx-clone-row code { flex: 1; min-width: 0; font-family: var(--mra-font-mono); font-size: .76rem; color: var(--mra-fg-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ghx-stats { display: grid; gap: 2px; border-top: 1px solid var(--mra-line); padding-top: 14px; }
.ghx-stat { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; color: var(--mra-fg-muted); font: inherit; font-size: .84rem; text-align: left; padding: 6px 6px; border-radius: 7px; cursor: pointer; }
.ghx-stat:disabled { cursor: default; }
.ghx-stat svg { color: var(--mra-fg-faint); }
.ghx-stat strong { color: var(--mra-ink); font-family: var(--mra-font-num); font-weight: 650; }
.ghx-stat:not(:disabled):hover { background: #f6f8fa; color: var(--mra-fg-2); }
.ghx-langs { border-top: 1px solid var(--mra-line); padding-top: 14px; display: grid; gap: 10px; }
.ghx-langbar { display: flex; height: 9px; border-radius: 999px; overflow: hidden; background: #eef1f5; }
.ghx-langseg { height: 100%; }
.ghx-langlegend { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.ghx-langitem { display: inline-flex; align-items: center; gap: 6px; font-size: .79rem; color: var(--mra-fg-2); }
.ghx-langdot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.ghx-langpct { color: var(--mra-fg-faint); }

/* Loading / empty states */
.ghx-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 48px 18px; color: var(--mra-fg-muted); font-size: .88rem; }
.ghx-empty { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 52px 18px; border: 1px dashed var(--mra-line); border-radius: 12px; background: var(--mra-surface); }
.ghx-empty-ic { color: var(--mra-fg-faint); }
.ghx-empty strong { font-size: 1rem; color: var(--mra-ink); }
.ghx-empty span { color: var(--mra-fg-muted); font-size: .86rem; max-width: 420px; }

/* Blob viewer */
.ghx-bloh { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 9px 14px; border: 1px solid var(--mra-line); border-bottom: 0; border-radius: 12px 12px 0 0; background: #f6f8fa; }
.ghx-bloh-meta { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-size: .86rem; color: var(--mra-fg-2); }
.ghx-bloh-meta svg { color: var(--mra-fg-faint); }
.ghx-bloh-stat { color: var(--mra-fg-faint); font-size: .78rem; }
.ghx-bloh-actions { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
.ghx-seg { display: inline-flex; border: 1px solid var(--mra-line); border-radius: 8px; overflow: hidden; background: var(--mra-surface); }
.ghx-seg button { border: 0; background: transparent; color: var(--mra-fg-muted); font: inherit; font-size: .78rem; font-weight: 600; padding: 5px 11px; cursor: pointer; }
.ghx-seg button.on { background: var(--mra-blue-soft); color: var(--mra-blue-strong); }
.ghx-blob { border: 1px solid var(--mra-line); border-radius: 0 0 12px 12px; overflow: hidden; background: var(--mra-surface); }
.ghx-blob.ispreview { padding: 24px 28px; }
.ghx-blob.ispreview .ghx-md { font-size: .92rem; }
.ghx-imgwrap { display: grid; place-items: center; padding: 32px; border: 1px solid var(--mra-line); border-radius: 0 0 12px 12px; background: repeating-conic-gradient(#f0f2f5 0% 25%, #fff 0% 50%) 50% / 22px 22px; }
.ghx-img { max-width: 100%; max-height: 460px; image-rendering: auto; box-shadow: var(--mra-shadow-1); background: #fff; }
.ghx-binary { display: grid; justify-items: center; gap: 8px; padding: 48px; border: 1px solid var(--mra-line); border-radius: 0 0 12px 12px; color: var(--mra-fg-muted); }
.ghx-binary svg { color: var(--mra-fg-faint); }
.ghx-binary-sub { font-size: .78rem; color: var(--mra-fg-faint); }

/* Code syntax tokens (explicit so highlighting works without IDE --ed-* vars).
   Covers the blob/blame line table (.ghx-codetable) and the diff (.ghx-diff). */
.ghx-codetable .tk-key, .ghx-diff .tk-key { color: #cf222e; }
.ghx-codetable .tk-str, .ghx-diff .tk-str { color: #0a3069; }
.ghx-codetable .tk-num, .ghx-diff .tk-num { color: #0550ae; }
.ghx-codetable .tk-com, .ghx-diff .tk-com { color: #6e7781; font-style: italic; }
.ghx-codetable .tk-fn, .ghx-diff .tk-fn { color: #8250df; }
.ghx-codetable .tk-typ, .ghx-diff .tk-typ { color: #953800; }

/* Commits list */
.ghx-commits { border: 1px solid var(--mra-line); border-radius: 12px; overflow: hidden; background: var(--mra-surface); }
.ghx-cgroup { display: flex; align-items: center; gap: 8px; padding: 9px 16px; background: #f6f8fa; border-top: 1px solid var(--mra-line); font-size: .82rem; font-weight: 600; color: var(--mra-fg-2); }
.ghx-cgroup:first-child { border-top: 0; }
.ghx-cgroup svg { color: var(--mra-fg-faint); }
.ghx-crow { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--mra-line); }
.ghx-crow-main { min-width: 0; flex: 1; }
.ghx-crow-msg { display: block; border: 0; background: transparent; font: inherit; font-size: .9rem; font-weight: 600; color: var(--mra-ink); text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; padding: 0; }
.ghx-crow-msg:hover { color: var(--mra-blue-strong); text-decoration: underline; }
.ghx-crow-sub { font-size: .78rem; color: var(--mra-fg-muted); margin-top: 2px; }
.ghx-crow-sub strong { color: var(--mra-fg-2); font-weight: 600; }
.ghx-crow-actions { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.ghx-crow-actions .ghx-hash { border: 1px solid var(--mra-line); background: #f6f8fa; }
.ghx-more { width: 100%; border: 1px solid var(--mra-line); background: var(--mra-surface); color: var(--mra-blue-strong); font: inherit; font-size: .85rem; font-weight: 600; padding: 10px; border-radius: 10px; cursor: pointer; box-shadow: var(--mra-shadow-1); }
.ghx-more:hover { background: var(--mra-blue-soft); }
.ghx-more[disabled] { color: var(--mra-fg-muted); cursor: default; }

/* Commit detail */
.ghx-diffback { align-self: start; }
.ghx-commitcard { border: 1px solid var(--mra-line); border-radius: 12px; background: var(--mra-surface); padding: 16px 18px; display: grid; gap: 10px; }
.ghx-commit-subj { font-size: 1.05rem; font-weight: 650; color: var(--mra-ink); }
.ghx-commit-body { font-family: var(--mra-font-mono); font-size: .82rem; color: var(--mra-fg-muted); white-space: pre-wrap; margin: 0; background: #f6f8fa; border-radius: 8px; padding: 10px 12px; }
.ghx-commit-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .82rem; color: var(--mra-fg-muted); border-top: 1px solid var(--mra-line); padding-top: 12px; }
.ghx-commit-meta strong { color: var(--mra-fg-2); font-weight: 600; }
.ghx-diffstat { display: flex; align-items: center; gap: 10px; font-size: .85rem; color: var(--mra-fg-muted); padding: 0 2px; }
.ghx-diffstat strong { color: var(--mra-ink); }
.ghx-add { color: #1a7f37; font-family: var(--mra-font-num); font-weight: 600; }
.ghx-del { color: #cf222e; font-family: var(--mra-font-num); font-weight: 600; }
.ghx-statbar { display: inline-flex; gap: 2px; }
.ghx-statbar span { width: 9px; height: 9px; border-radius: 2px; }
.ghx-statbar span.a { background: #2da44e; }
.ghx-statbar span.d { background: #f1aeb5; }
.ghx-difffile { border: 1px solid var(--mra-line); border-radius: 12px; overflow: hidden; background: var(--mra-surface); }
.ghx-difffile-head { display: flex; align-items: center; gap: 10px; padding: 9px 14px; background: #f6f8fa; border-bottom: 1px solid var(--mra-line); }
.ghx-dbadge { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; font-family: var(--mra-font-mono); font-size: .66rem; font-weight: 700; color: #fff; background: var(--mra-fg-muted); flex: 0 0 auto; }
.ghx-dbadge.added { background: #2da44e; }
.ghx-dbadge.deleted { background: #cf222e; }
.ghx-dbadge.renamed, .ghx-dbadge.copied { background: #9333ea; }
.ghx-dbadge.modified { background: #bf8700; }
.ghx-dpath { font-family: var(--mra-font-mono); font-size: .82rem; color: var(--mra-fg-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ghx-renamed { display: inline-flex; align-items: center; gap: 6px; }
.ghx-dcount { display: inline-flex; gap: 7px; font-size: .76rem; }
.ghx-diff { width: 100%; border-collapse: collapse; font-family: var(--mra-font-mono); font-size: 12.2px; line-height: 1.5; }
.ghx-dr td { padding: 0; }
.ghx-dn { width: 1%; min-width: 42px; text-align: right; padding: 0 10px !important; color: var(--mra-fg-faint); background: #f6f8fa; border-right: 1px solid var(--mra-line); user-select: none; vertical-align: top; white-space: nowrap; }
.ghx-dl { padding: 0 10px !important; color: var(--mra-fg-2); white-space: pre-wrap; word-break: break-word; vertical-align: top; }
.ghx-dsign { display: inline-block; width: 1ch; color: var(--mra-fg-faint); }
.ghx-dr.add td.ghx-dl { background: #e6ffec; }
.ghx-dr.add td.ghx-dn { background: #ccffd8; color: #1a7f37; }
.ghx-dr.add .ghx-dsign { color: #1a7f37; }
.ghx-dr.del td.ghx-dl { background: #ffebe9; }
.ghx-dr.del td.ghx-dn { background: #ffd7d5; color: #cf222e; }
.ghx-dr.del .ghx-dsign { color: #cf222e; }
.ghx-hunk td { background: #f6f8fb; color: var(--mra-fg-muted); padding: 3px 10px !important; font-size: 11.5px; border-top: 1px solid var(--mra-line); border-bottom: 1px solid var(--mra-line); }
.ghx-diff-binary { padding: 22px; text-align: center; color: var(--mra-fg-muted); font-size: .82rem; }

/* Branches / Settings tab body */
.ghx-tabbody { display: grid; gap: 18px; }
.ghx-branch-actions { display: inline-flex; gap: 8px; }

@media (max-width: 1000px) {
  .ghx-codewrap { grid-template-columns: minmax(0, 1fr); }
  .ghx-about { position: static; order: -1; }
}

/* =====================================================================
   Git browser — advanced surfaces (blame, split diff, expand, filters,
   tags, contributors, line anchors). Light Ember dashboard theme.
   ===================================================================== */

/* Per-line code table (blob + blame) with clickable line anchors */
.ghx-codeview.rows { display: block; border: 1px solid var(--mra-line); border-radius: 0 0 12px 12px; overflow-x: auto; background: var(--mra-surface); }
.ghx-codetable { border-collapse: collapse; width: 100%; font-family: var(--mra-font-mono); font-size: 12.5px; line-height: 1.55; }
.ghx-codetable td { padding: 0; vertical-align: top; }
.ghx-codetable td.ghx-ln { width: 1%; white-space: nowrap; text-align: right; background: #f6f8fa; border-right: 1px solid var(--mra-line); user-select: none; }
.ghx-codetable td.ghx-ln button { border: 0; background: transparent; color: var(--mra-fg-faint); font: inherit; font-family: var(--mra-font-mono); padding: 0 14px; cursor: pointer; display: block; width: 100%; text-align: right; }
.ghx-codetable td.ghx-ln button:hover { color: var(--mra-ink); }
.ghx-codetable td.ghx-lc { padding: 0 16px; white-space: pre; color: var(--mra-fg-2); }
.ghx-cline.hl td.ghx-lc { background: #fff8c5; }
.ghx-cline.hl td.ghx-ln { background: #fbef9d; }
.ghx-cline:target td.ghx-lc { background: #fff8c5; }

/* Blame */
.ghx-blame td.ghx-blame-att-cell { width: 270px; min-width: 270px; max-width: 270px; border-right: 1px solid var(--mra-line); background: #fbfcfd; }
.ghx-blame-row.blockstart td { border-top: 1px solid var(--mra-line); }
.ghx-blame-row:first-child td { border-top: 0; }
.ghx-blame-att { display: flex; flex-direction: column; gap: 1px; width: 100%; border: 0; background: transparent; text-align: left; cursor: pointer; padding: 2px 10px; }
.ghx-blame-msg { font-family: var(--mra-font-ui); font-size: 11px; line-height: 1.4; color: var(--mra-fg-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 245px; }
.ghx-blame-att:hover .ghx-blame-msg { color: var(--mra-blue-strong); text-decoration: underline; }
.ghx-blame-meta { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--mra-fg-faint); font-family: var(--mra-font-ui); }
.ghx-blame-when { white-space: nowrap; }

/* Split (side-by-side) diff */
.ghx-diff.split { table-layout: fixed; }
.ghx-diff.split td.ghx-sl { padding: 0 10px; white-space: pre-wrap; word-break: break-word; vertical-align: top; color: var(--mra-fg-2); }
.ghx-diff.split td.ghx-dn { width: 44px; min-width: 44px; }
.ghx-diff.split tr.ghx-dr td:nth-child(3) { border-left: 1px solid var(--mra-line); }
.ghx-diff.split td.ghx-dn.empty, .ghx-diff.split td.ghx-sl.empty { background: #fafbfc; }
.ghx-diff.split td.ghx-sl.add { background: #e6ffec; }
.ghx-diff.split td.ghx-sl.del { background: #ffebe9; }
.ghx-diff.split td.ghx-dn.add { background: #ccffd8; color: #1a7f37; }
.ghx-diff.split td.ghx-dn.del { background: #ffd7d5; color: #cf222e; }

/* Expand-context rows */
.ghx-expand td { background: #f1f6ff; border-top: 1px solid var(--mra-line); border-bottom: 1px solid var(--mra-line); }
.ghx-expand td.ex button { border: 0; background: transparent; color: var(--mra-blue-strong); font: inherit; font-size: 11.5px; padding: 4px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.ghx-expand td.ex button:hover { text-decoration: underline; }

/* Ref switcher filter + tags */
.ghx-refsearch { display: flex; align-items: center; gap: 6px; padding: 6px 9px; border-bottom: 1px solid var(--mra-line); margin: -6px -6px 4px; }
.ghx-refsearch svg { color: var(--mra-fg-faint); flex: 0 0 auto; }
.ghx-refsearch input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: .82rem; outline: none; color: var(--mra-ink); }
.ghx-refempty { padding: 7px 10px; font-size: .78rem; color: var(--mra-fg-faint); }
.ghx-refitem .tag, .ghx-refitem svg { flex: 0 0 auto; }

/* Branch filter */
.ghx-bfilter { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--mra-line); border-radius: 8px; padding: 7px 11px; background: var(--mra-surface); }
.ghx-bfilter svg { color: var(--mra-fg-faint); }
.ghx-bfilter input { border: 0; background: transparent; font: inherit; font-size: .82rem; outline: none; width: 150px; color: var(--mra-ink); }

/* Contributors panel (About sidebar) */
.ghx-contribs { border-top: 1px solid var(--mra-line); padding-top: 14px; display: grid; gap: 9px; }
.ghx-contribs-head { font-size: .92rem; font-weight: 650; color: var(--mra-ink); }
.ghx-contrib { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ghx-contrib-l { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.ghx-contrib-name { font-size: .82rem; color: var(--mra-fg-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ghx-contrib-n { font-size: .74rem; color: var(--mra-fg-faint); white-space: nowrap; }
.ghx-cload { font-size: .8rem; color: var(--mra-fg-muted); display: flex; align-items: center; gap: 7px; }

/* =====================================================================
   Ember Assistant redesign — status pill, conversation rail, composer bar
   (IDE-scoped; themes via --ic-* in both .ide-theme-dark / .ide-theme-light)
   ===================================================================== */

/* Header live-status pill (real session state only; no synthetic counter) */
.ide-shell .ai-status { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; color: var(--ic-fg-muted); min-width: 0; }
.ide-shell .ai-status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ic-fg-faint); flex: 0 0 auto; }
.ide-shell .ai-status--connected .ai-status-dot, .ide-shell .ai-status--ready .ai-status-dot { background: var(--mra-green); }
.ide-shell .ai-status--running .ai-status-dot { background: var(--mra-blue); animation: ai-dot-pulse 1.2s ease-in-out infinite; }
.ide-shell .ai-status--error .ai-status-dot { background: var(--mra-red); }
@keyframes ai-dot-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .ide-shell .ai-status--running .ai-status-dot { animation: none; } }

/* Conversation rail: only the plain assistant-text bubble gets the left rail
   (cards — thinking/todos/footer/permission — stay rail-less). Orange while it streams. */
.ide-shell .ai-msg.bot.plain { border-left: 2px solid var(--ic-border-soft); padding-left: 11px; }
.ide-shell .ai-msg.bot.plain.is-streaming { border-left-color: var(--eb-orange); }

/* Composer: a single context/command bar + a quiet hint row */
.ide-shell .ai-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ide-shell .ai-bar .spacer { flex: 1; }
.ide-shell .ai-bar .ai-ctx { max-width: 46%; overflow: hidden; }
.ide-shell .ai-bar .ai-ctx .ai-ctx-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ide-shell .ai-model { display: inline-flex; align-items: center; gap: 4px; background: var(--ic-chip); border: 1px solid var(--ic-border-soft); border-radius: 6px; padding: 1px 6px 1px 7px; max-width: 50%; }
.ide-shell .ai-model .ai-model-ic { display: inline-flex; align-items: center; color: var(--ic-accent, var(--ic-fg-muted)); }
.ide-shell .ai-model select { appearance: none; -webkit-appearance: none; background: transparent; border: 0; outline: none; color: var(--ic-fg); font-family: var(--mra-font-mono); font-size: .72rem; line-height: 1.6; padding: 1px 14px 1px 2px; max-width: 100%; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: right 5px center, right 1px center; background-size: 4px 4px, 4px 4px; background-repeat: no-repeat; }
.ide-shell .ai-model select:focus-visible { outline: 1px solid var(--ic-accent, var(--ic-border)); border-radius: 4px; }
.ide-shell .ai-model option, .ide-shell .ai-model optgroup { background: var(--ic-panel, #16181d); color: var(--ic-fg); }
.ide-shell .ai-chip { font-size: .72rem; padding: 3px 9px; border: 1px solid var(--ic-border-soft); border-radius: 7px; background: var(--ic-chip); color: var(--ic-fg-muted); cursor: pointer; white-space: nowrap; transition: background 120ms ease, color 120ms ease; }
.ide-shell .ai-chip:hover { color: var(--ic-fg); background: var(--ic-hover); }
.ide-shell .ai-hint { font-size: .7rem; color: var(--ic-fg-faint); display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.ide-shell .ai-hint kbd { font-family: var(--mra-font-mono); font-size: .66rem; background: var(--ic-chip); border: 1px solid var(--ic-border-soft); border-radius: 4px; padding: 0 4px; color: var(--ic-fg-muted); }
.ide-shell .ai-hint-ask { color: var(--eb-amber); }

/* System notes (rate_limit / error) — compact meta, not a railed bubble */
.ide-shell .ai-sys { display: flex; align-items: center; gap: 6px; font-size: .74rem; color: var(--ic-fg-muted); background: var(--ic-chip); border: 1px solid var(--ic-border-soft); border-radius: 7px; padding: 5px 9px; }
.ide-shell .ai-sys svg { color: var(--ic-fg-faint); flex: 0 0 auto; }
.ide-shell .ai-sys strong { color: var(--ic-fg-2); font-weight: 600; }
.ide-shell .ai-sys span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ide-shell .ai-sys.err { color: var(--ic-danger-fg); background: var(--ic-danger-bg); border-color: var(--ic-danger-line); }
.ide-shell .ai-sys.err svg, .ide-shell .ai-sys.err strong { color: var(--ic-danger-fg); }

/* User messages lean right (matches the de-chromed conversation treatment) */
.ide-shell .ai-msg.user { justify-items: end; }
.ide-shell .ai-bubble.user { max-width: 88%; }

/* ---------------------------------------------------------------------------
   IDE viewport containment (always-on — fixes "bits render over each other").
   The IDE root applies CSS `zoom`, so its EFFECTIVE layout width is innerWidth/zoom.
   The older overflow guards were gated behind `@media (max-width:1180px)`, which keys
   off the ACTUAL viewport — so when zoomed in (effective width small but actual width
   large) they never engaged and the top chrome escaped the box, overflowing the document
   horizontally and rendering over the editor/explorer. These rules clip unconditionally.
   --------------------------------------------------------------------------- */
.ide.ide-shell { overflow: hidden; }
.ide.ide-shell .ide-body { min-width: 0; overflow: hidden; }
/* Top chrome shrinks instead of pushing the IDE wider: the flexible middle (crumbs +
   runtime cluster) may compress/truncate; the flame, theme, Preview, Deploy, avatar stay. */
.ide.ide-shell .ide-top { min-width: 0; }
.ide.ide-shell .ide-top .runtime-cluster { min-width: 0; overflow: hidden; }

@media (max-width: 1400px) {
  .ide.ide-shell .runtime-cluster .sb-facts > .sb-fact:first-child { display: none; }
}

/* Explorer must not spill over the editor (the file tree's min-content can exceed its
   grid column — e.g. a long filename + change badge — and, being min-width:auto +
   overflow:visible, it overflowed the .sidepane and painted over the editor column).
   Clip the panel and let the tree + filenames shrink/truncate to the column width. */
.ide.ide-shell .sidepane { overflow: hidden; }
/* THE fix: .filetree is a grid with only grid-template-ROWS set, so its implicit COLUMN is
   `auto` (= max-content) — every child (head/list/foot) was forced to the widest content
   and overflowed the panel onto the editor. Constrain the column to the panel width. */
.ide.ide-shell .filetree { min-width: 0; overflow: hidden; grid-template-columns: minmax(0, 1fr); }
.ide.ide-shell .ft-head,
.ide.ide-shell .ft-list,
.ide.ide-shell .ft-foot,
.ide.ide-shell .ft-children { min-width: 0; }
.ide.ide-shell .ft-list { overflow-y: auto; overflow-x: hidden; }
.ide.ide-shell .ft-row { min-width: 0; max-width: 100%; }
.ide.ide-shell .ft-row .ft-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Explorer header title truncates so the action icons stay visible (don't get clipped). */
.ide.ide-shell .ft-head .ft-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ide.ide-shell .ft-head .ft-actions { flex: 0 0 auto; }
/* The SCM (Source Control) + Search panels live in the same sidepane — same guard. */
.ide.ide-shell .scm-panel,
.ide.ide-shell .search-panel { min-width: 0; overflow: hidden; }

/* ===== Knowledge graph (kg-*) ==========================================
   IDE editor-area view: toolbar + force-directed SVG canvas + floating
   details drawer + search results (nodes + indexed workspace code).
   Themed entirely from the --ic-* tokens set by .ide-theme-light /
   .ide-theme-dark (plus --mra-* accents), so both IDE themes stay
   cohesive. Node type accent colors are fixed brand hexes carried on
   --kgc per node/edge (same pattern as the file-type badges). */

.kg-view {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  background: var(--ic-editor, #fff);
  color: var(--ic-fg, #1b2230);
}

/* toolbar ------------------------------------------------------------- */
.kg-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--ic-border, #d9dee8);
  background: var(--ic-panel, #f7f8fb);
  min-height: 44px;
}
.kg-toolbar .spacer { flex: 1; }
.kg-tb-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.kg-tb-title svg { color: var(--mra-amber, #f9ab00); }
.kg-tb-counts {
  font-size: 11.5px;
  color: var(--ic-fg-muted, #5d6678);
  white-space: nowrap;
}
.kg-tb-idx {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--ic-border, #d9dee8);
  background: var(--ic-chip, #eef1f6);
  color: var(--ic-fg-muted, #5d6678);
  white-space: nowrap;
}
.kg-tb-idx svg { color: var(--mra-blue, #2563eb); }
.kg-tb-idx.warn {
  border-color: color-mix(in srgb, var(--mra-amber, #f9ab00) 55%, transparent);
  color: color-mix(in srgb, var(--mra-amber, #f9ab00) 80%, var(--ic-fg, #1b2230));
}
.kg-tb-idx.warn svg { color: var(--mra-amber, #f9ab00); }
.kg-tb-search {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 1 300px;
  min-width: 170px;
  border: 1px solid var(--ic-border, #d9dee8);
  border-radius: 8px;
  background: var(--ic-editor, #fff);
  padding: 5px 9px;
  color: var(--ic-fg-muted, #5d6678);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.kg-tb-search:focus-within {
  border-color: var(--mra-blue, #2563eb);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mra-blue, #2563eb) 14%, transparent);
}
.kg-tb-search input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: var(--ic-fg, #1b2230);
  font: inherit;
  font-size: 12px;
}
.kg-tb-search input::placeholder { color: var(--ic-fg-faint, #98a1b3); }
.kg-tb-hits {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--mra-blue, #2563eb) 45%, transparent);
  background: color-mix(in srgb, var(--mra-blue, #2563eb) 10%, transparent);
  color: var(--mra-blue, #2563eb);
  cursor: pointer;
  white-space: nowrap;
}
.kg-tb-hits:hover { background: color-mix(in srgb, var(--mra-blue, #2563eb) 18%, transparent); }
.kg-tb-err { font-size: 11px; color: var(--ic-danger-fg, #c43b3b); }
.kg-zoomctl {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--ic-border, #d9dee8);
  border-radius: 8px;
  overflow: hidden;
  background: var(--ic-editor, #fff);
}
.kg-zoomctl .kg-iconbtn { border-radius: 0; border: none; width: 26px; }
.kg-zoomlevel {
  border: none;
  border-left: 1px solid var(--ic-border-soft, #e4e8f0);
  border-right: 1px solid var(--ic-border-soft, #e4e8f0);
  background: none;
  color: var(--ic-fg-muted, #5d6678);
  font-size: 11px;
  width: 48px;
  cursor: pointer;
}
.kg-zoomlevel:hover { color: var(--ic-fg, #1b2230); background: var(--ic-hover, #eef1f6); }
.kg-iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 7px;
  background: none;
  color: var(--ic-fg-muted, #5d6678);
  cursor: pointer;
  flex: 0 0 auto;
}
.kg-iconbtn:hover:not(:disabled) { background: var(--ic-hover, #eef1f6); color: var(--ic-fg, #1b2230); }
.kg-iconbtn:disabled { opacity: 0.45; cursor: default; }
.kg-tb-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 560;
  padding: 5px 11px;
  border-radius: 8px;
  border: 1px solid var(--ic-border, #d9dee8);
  background: var(--ic-editor, #fff);
  color: var(--ic-fg, #1b2230);
  cursor: pointer;
  white-space: nowrap;
}
.kg-tb-btn:hover:not(:disabled) { background: var(--ic-hover, #eef1f6); }
.kg-tb-btn:disabled { opacity: 0.55; cursor: default; }
.kg-tb-btn.primary {
  border-color: transparent;
  background: var(--mra-blue, #2563eb);
  color: #fff;
}
.kg-tb-btn.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--mra-blue, #2563eb) 88%, #000); }

/* stage + canvas ------------------------------------------------------- */
.kg-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(1100px 640px at 50% 28%, color-mix(in srgb, var(--mra-blue, #2563eb) 5%, transparent), transparent 70%),
    var(--ic-editor, #fff);
}
.kg-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.kg-canvas.grabbing { cursor: grabbing; }
.kg-pat-dot { fill: color-mix(in srgb, var(--ic-fg, #1b2230) 9%, transparent); }
.kg-bgrect { pointer-events: none; }

/* edges ---------------------------------------------------------------- */
.kg-edge {
  fill: none;
  stroke: color-mix(in srgb, var(--kgc, #9aa0a6) 46%, transparent);
  stroke-width: 1.5px;
  transition: opacity 0.18s, stroke 0.18s;
}
.kg-edge.dashed { stroke-dasharray: 5 5; }
.kg-edge.hot {
  stroke: var(--kgc, #9aa0a6);
  stroke-width: 2.2px;
}
.kg-edge.dim { opacity: 0.12; }
.kg-canvas.hovering .kg-edge:not(.nbe) { opacity: 0.12; }
.kg-edge.nbe {
  stroke: var(--kgc, #9aa0a6);
  stroke-width: 2px;
  opacity: 1;
}

/* nodes (shared) -------------------------------------------------------- */
.kg-node { cursor: pointer; outline: none; }
.kg-node.dragging { cursor: grabbing; }
.kg-node .kg-in { transition: opacity 0.18s, filter 0.18s; }
.kg-canvas.kg-anim .kg-node .kg-in {
  animation: kg-enter 0.5s cubic-bezier(0.2, 0.85, 0.3, 1.25) both;
  animation-delay: var(--kgd, 0ms);
}
@keyframes kg-enter {
  from { opacity: 0; transform: scale(0.55); }
  to { opacity: 1; transform: scale(1); }
}
.kg-node.dim .kg-in { opacity: 0.16; filter: saturate(0.4); }
.kg-canvas.hovering .kg-node:not(.hov):not(.nb) .kg-in { opacity: 0.2; }
.kg-node.hit .kg-in {
  filter: drop-shadow(0 0 13px color-mix(in srgb, var(--kgc, #9aa0a6) 65%, transparent));
}
.kg-node.linkable { cursor: crosshair; }
.kg-node.linksrc .kg-in {
  filter: drop-shadow(0 0 12px color-mix(in srgb, var(--mra-blue, #2563eb) 70%, transparent));
}
.kg-node:focus-visible .kg-in {
  filter: drop-shadow(0 0 9px color-mix(in srgb, var(--mra-blue, #2563eb) 80%, transparent));
}
.kg-glyph { pointer-events: none; }

/* feature hub cards ------------------------------------------------------ */
.kg-hub .kg-in {
  filter: drop-shadow(0 5px 16px color-mix(in srgb, var(--kgc, #f9ab00) 24%, transparent));
}
.kg-hub-card {
  fill: color-mix(in srgb, var(--kgc, #f9ab00) 8%, var(--ic-panel, #f7f8fb));
  stroke: color-mix(in srgb, var(--kgc, #f9ab00) 52%, transparent);
  stroke-width: 1.4px;
  transition: stroke 0.15s, fill 0.15s;
}
.kg-hub:hover .kg-hub-card,
.kg-hub.hov .kg-hub-card,
.kg-hub.sel .kg-hub-card {
  stroke: var(--kgc, #f9ab00);
  stroke-width: 2px;
  fill: color-mix(in srgb, var(--kgc, #f9ab00) 13%, var(--ic-panel, #f7f8fb));
}
.kg-hub-icbg { fill: color-mix(in srgb, var(--kgc, #f9ab00) 17%, transparent); }
.kg-glyph.hubic { color: var(--kgc, #f9ab00); }
.kg-hub-label {
  fill: var(--ic-fg, #1b2230);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  pointer-events: none;
}
.kg-hub-sub {
  fill: var(--ic-fg-muted, #5d6678);
  font-size: 10px;
  pointer-events: none;
}

/* aspect nodes ------------------------------------------------------------ */
.kg-asp-halo {
  fill: color-mix(in srgb, var(--kgc, #9aa0a6) 13%, transparent);
  opacity: 0.9;
  transition: opacity 0.15s, fill 0.15s;
}
.kg-asp-body {
  fill: color-mix(in srgb, var(--kgc, #9aa0a6) 20%, var(--ic-panel, #f7f8fb));
  stroke: color-mix(in srgb, var(--kgc, #9aa0a6) 68%, transparent);
  stroke-width: 1.4px;
  transition: stroke 0.15s, fill 0.15s;
}
.kg-asp:hover .kg-asp-body,
.kg-asp.hov .kg-asp-body,
.kg-asp.sel .kg-asp-body {
  stroke: var(--kgc, #9aa0a6);
  stroke-width: 2.2px;
}
.kg-asp:hover .kg-asp-halo,
.kg-asp.hov .kg-asp-halo,
.kg-asp.sel .kg-asp-halo { opacity: 1; fill: color-mix(in srgb, var(--kgc, #9aa0a6) 20%, transparent); }
.kg-asp .kg-glyph { color: color-mix(in srgb, var(--kgc, #9aa0a6) 82%, var(--ic-fg, #1b2230)); }
.kg-asp-label {
  fill: var(--ic-fg, #1b2230);
  font-size: 11px;
  font-weight: 560;
  paint-order: stroke;
  stroke: var(--ic-editor, #fff);
  stroke-width: 3px;
  stroke-linejoin: round;
  pointer-events: none;
}

/* node adornments ---------------------------------------------------------- */
.kg-stale {
  fill: var(--mra-amber, #f9ab00);
  stroke: var(--ic-editor, #fff);
  stroke-width: 1.4px;
}
.kg-busy {
  fill: none;
  stroke: var(--mra-blue, #2563eb);
  stroke-width: 2px;
  stroke-dasharray: 10 7;
  stroke-linecap: round;
  animation: kg-busyspin 1.1s linear infinite;
}
@keyframes kg-busyspin {
  to { stroke-dashoffset: -68; }
}
.kg-scorechip rect {
  fill: var(--ic-panel, #f7f8fb);
  stroke: color-mix(in srgb, var(--kgc, #9aa0a6) 55%, transparent);
  stroke-width: 1px;
}
.kg-scorechip text {
  fill: var(--ic-fg-muted, #5d6678);
  font-size: 9.5px;
  font-family: 'SF Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  pointer-events: none;
}

/* legend ------------------------------------------------------------------- */
.kg-legend {
  position: absolute;
  left: 12px;
  bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 60%;
  z-index: 5;
  pointer-events: none;
}
.kg-leg-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  padding: 2.5px 9px;
  border-radius: 999px;
  border: 1px solid var(--ic-border-soft, #e4e8f0);
  background: color-mix(in srgb, var(--ic-panel, #f7f8fb) 84%, transparent);
  color: var(--ic-fg-muted, #5d6678);
  backdrop-filter: blur(4px);
}
.kg-leg-chip i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--kgc, #9aa0a6);
}

/* search results panel ------------------------------------------------------ */
.kg-results {
  position: absolute;
  top: 10px;
  left: 12px;
  width: min(380px, calc(100% - 24px));
  max-height: min(62%, 460px);
  overflow: auto;
  background: color-mix(in srgb, var(--ic-panel, #f7f8fb) 96%, transparent);
  border: 1px solid var(--ic-border, #d9dee8);
  border-radius: 11px;
  box-shadow: 0 14px 38px rgba(8, 12, 24, 0.22);
  backdrop-filter: blur(8px);
  z-index: 30;
}
.kg-res-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 7px 7px 12px;
  font-size: 11px;
  color: var(--ic-fg-muted, #5d6678);
  background: inherit;
  border-bottom: 1px solid var(--ic-border-soft, #e4e8f0);
}
.kg-res-sec {
  padding: 8px 12px 3px;
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ic-fg-faint, #98a1b3);
}
.kg-res-row {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 6px 12px;
  border: none;
  background: none;
  text-align: left;
  color: var(--ic-fg, #1b2230);
  cursor: pointer;
}
.kg-res-row:hover { background: var(--ic-hover, #eef1f6); }
.kg-res-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--kgc, #9aa0a6) 15%, transparent);
  color: var(--kgc, #9aa0a6);
  flex: 0 0 auto;
}
.kg-res-ic.file {
  background: var(--ic-chip, #eef1f6);
  color: var(--ic-fg-muted, #5d6678);
}
.kg-res-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.kg-res-title {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kg-res-title.mono,
.kg-res-sub.mono {
  font-family: 'SF Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
}
.kg-res-sub {
  font-size: 10.5px;
  color: var(--ic-fg-muted, #5d6678);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kg-res-score {
  width: 44px;
  height: 4px;
  border-radius: 4px;
  background: var(--ic-chip, #eef1f6);
  overflow: hidden;
  flex: 0 0 auto;
}
.kg-res-score i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--mra-blue, #2563eb) 60%, transparent), var(--mra-blue, #2563eb));
}
.kg-res-empty {
  padding: 14px 12px;
  font-size: 11.5px;
  color: var(--ic-fg-muted, #5d6678);
}

/* fallback / empty ------------------------------------------------------------ */
.kg-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 12.5px;
  color: var(--ic-fg-muted, #5d6678);
}
.kg-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 24px;
  overflow: auto;
}
.kg-empty-art {
  width: 210px;
  height: auto;
  margin-bottom: 4px;
}
.kg-empty-art path {
  stroke: color-mix(in srgb, var(--ic-fg, #1b2230) 22%, transparent);
  stroke-width: 1.4;
  stroke-dasharray: 4 4;
}
.kg-empty-art circle {
  fill: color-mix(in srgb, var(--mra-blue, #2563eb) 18%, var(--ic-panel, #f7f8fb));
  stroke: color-mix(in srgb, var(--mra-blue, #2563eb) 55%, transparent);
  stroke-width: 1.4;
}
.kg-empty-art rect {
  fill: color-mix(in srgb, var(--mra-amber, #f9ab00) 14%, var(--ic-panel, #f7f8fb));
  stroke: color-mix(in srgb, var(--mra-amber, #f9ab00) 65%, transparent);
  stroke-width: 1.4;
}
.kg-empty h3 { margin: 0; font-size: 16px; }
.kg-empty p {
  margin: 0 0 10px;
  max-width: 520px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ic-fg-muted, #5d6678);
}

/* forms ------------------------------------------------------------------------ */
.kg-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(440px, 100%);
  text-align: left;
}
.kg-formpanel {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 32;
  background: var(--ic-panel, #f7f8fb);
  border: 1px solid var(--ic-border, #d9dee8);
  border-radius: 12px;
  box-shadow: 0 16px 42px rgba(8, 12, 24, 0.25);
  padding: 12px;
  width: min(400px, calc(100% - 24px));
}
.kg-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.kg-form-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 650;
}
.kg-form-title svg { color: var(--mra-amber, #f9ab00); }
.kg-input,
.kg-textarea {
  width: 100%;
  border: 1px solid var(--ic-border, #d9dee8);
  border-radius: 8px;
  background: var(--ic-editor, #fff);
  color: var(--ic-fg, #1b2230);
  font: inherit;
  font-size: 12.5px;
  padding: 7px 10px;
  outline: none;
}
.kg-input:focus,
.kg-textarea:focus {
  border-color: var(--mra-blue, #2563eb);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mra-blue, #2563eb) 13%, transparent);
}
.kg-input.mono {
  font-family: 'SF Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11.5px;
}
.kg-textarea { resize: vertical; min-height: 50px; }
.kg-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--ic-fg-muted, #5d6678);
}
.kg-form-actions { display: flex; gap: 8px; }
.kg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 560;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--ic-border, #d9dee8);
  background: var(--ic-editor, #fff);
  color: var(--ic-fg, #1b2230);
  cursor: pointer;
}
.kg-btn:hover:not(:disabled) { background: var(--ic-hover, #eef1f6); }
.kg-btn:disabled { opacity: 0.55; cursor: default; }
.kg-btn.primary {
  border-color: transparent;
  background: var(--mra-blue, #2563eb);
  color: #fff;
}
.kg-btn.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--mra-blue, #2563eb) 88%, #000); }
.kg-btn.danger {
  border-color: color-mix(in srgb, var(--ic-danger-fg, #c43b3b) 45%, transparent);
  color: var(--ic-danger-fg, #c43b3b);
}
.kg-btn.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--ic-danger-fg, #c43b3b) 10%, transparent); }

/* floating notices --------------------------------------------------------------- */
.kg-float {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 34;
  width: min(560px, calc(100% - 32px));
  pointer-events: none;
}
.kg-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 10px 9px 13px;
  border-radius: 10px;
  font-size: 12px;
  border: 1px solid var(--ic-border, #d9dee8);
  background: color-mix(in srgb, var(--ic-panel, #f7f8fb) 96%, transparent);
  box-shadow: 0 10px 30px rgba(8, 12, 24, 0.2);
  backdrop-filter: blur(8px);
  pointer-events: auto;
}
.kg-notice-body { flex: 1; min-width: 0; }
.kg-notice-body div + div { margin-top: 3px; }
.kg-notice.ok { border-color: color-mix(in srgb, #1f8a5b 45%, transparent); }
.kg-notice.warn { border-color: color-mix(in srgb, var(--mra-amber, #f9ab00) 55%, transparent); }
.kg-notice.err { border-color: color-mix(in srgb, var(--ic-danger-fg, #c43b3b) 55%, transparent); color: var(--ic-danger-fg, #c43b3b); }

/* link-mode hint ------------------------------------------------------------------ */
.kg-hint {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--mra-blue, #2563eb) 45%, transparent);
  background: color-mix(in srgb, var(--ic-panel, #f7f8fb) 96%, transparent);
  font-size: 11.5px;
  color: var(--ic-fg, #1b2230);
  box-shadow: 0 10px 28px rgba(8, 12, 24, 0.2);
  backdrop-filter: blur(8px);
  z-index: 36;
}
.kg-hint svg { color: var(--mra-blue, #2563eb); }
.kg-hint kbd {
  font-size: 10px;
  padding: 1px 5px;
  border: 1px solid var(--ic-border, #d9dee8);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--ic-chip, #eef1f6);
}
.kg-hint-err { color: var(--ic-danger-fg, #c43b3b); }

/* details drawer ------------------------------------------------------------------- */
.kg-drawer {
  position: absolute;
  top: 10px;
  right: 12px;
  bottom: 10px;
  width: min(330px, calc(100% - 24px));
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 13px;
  border: 1px solid var(--ic-border, #d9dee8);
  border-radius: 13px;
  background: color-mix(in srgb, var(--ic-panel, #f7f8fb) 96%, transparent);
  box-shadow: 0 18px 46px rgba(8, 12, 24, 0.26);
  backdrop-filter: blur(9px);
  z-index: 31;
}
.kg-d-head { display: flex; align-items: center; gap: 7px; }
.kg-d-head .spacer { flex: 1; }
.kg-d-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--kgc, #9aa0a6) 16%, transparent);
  color: var(--kgc, #9aa0a6);
  flex: 0 0 auto;
}
.kg-chip {
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
  padding: 2.5px 9px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--kgc, #9aa0a6) 50%, transparent);
  background: color-mix(in srgb, var(--kgc, #9aa0a6) 11%, transparent);
  color: color-mix(in srgb, var(--kgc, #9aa0a6) 80%, var(--ic-fg, #1b2230));
}
.kg-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--ic-border, #d9dee8);
  background: var(--ic-chip, #eef1f6);
  color: var(--ic-fg-muted, #5d6678);
}
.kg-badge.o-auto { border-color: color-mix(in srgb, var(--mra-blue, #2563eb) 45%, transparent); color: var(--mra-blue, #2563eb); }
.kg-badge.o-refined { border-color: color-mix(in srgb, #9333ea 45%, transparent); color: #9333ea; }
.kg-d-titlerow { display: flex; align-items: center; gap: 6px; }
.kg-d-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 14.5px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.kg-d-titlerow .kg-input { flex: 1; }
.kg-d-desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ic-fg, #1b2230);
  overflow-wrap: anywhere;
}
.kg-d-desc.muted { color: var(--ic-fg-faint, #98a1b3); }
.kg-d-meta { font-size: 10.5px; color: var(--ic-fg-faint, #98a1b3); }
.kg-d-sec {
  margin-top: 3px;
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ic-fg-faint, #98a1b3);
}
.kg-d-anchors { display: flex; flex-direction: column; gap: 4px; }
.kg-anchor {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border: 1px solid var(--ic-border-soft, #e4e8f0);
  border-radius: 8px;
  background: var(--ic-code-bg, #f2f4f9);
  cursor: pointer;
  text-align: left;
  color: var(--ic-fg, #1b2230);
}
.kg-anchor:hover { border-color: var(--mra-blue, #2563eb); }
.kg-a-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1f8a5b;
  flex: 0 0 auto;
}
.kg-anchor.stale .kg-a-dot { background: var(--mra-amber, #f9ab00); }
.kg-anchor code {
  flex: 1;
  min-width: 0;
  font-family: 'SF Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kg-stalechip {
  font-size: 9.5px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1.5px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--mra-amber, #f9ab00) 18%, transparent);
  color: color-mix(in srgb, var(--mra-amber, #f9ab00) 85%, var(--ic-fg, #1b2230));
}
.kg-d-none { font-size: 11.5px; color: var(--ic-fg-faint, #98a1b3); }
.kg-d-conns { display: flex; flex-wrap: wrap; gap: 5px; }
.kg-conn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  padding: 3.5px 9px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--kgc, #9aa0a6) 40%, transparent);
  background: color-mix(in srgb, var(--kgc, #9aa0a6) 8%, transparent);
  color: var(--ic-fg, #1b2230);
  cursor: pointer;
  max-width: 100%;
}
.kg-conn:hover { background: color-mix(in srgb, var(--kgc, #9aa0a6) 16%, transparent); }
.kg-conn svg { color: var(--kgc, #9aa0a6); flex: 0 0 auto; }
.kg-conn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kg-conn em {
  font-style: normal;
  font-size: 9.5px;
  color: var(--ic-fg-faint, #98a1b3);
}
.kg-sec-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  border: none;
  background: none;
  padding: 2px 0;
  font-size: 11.5px;
  font-weight: 560;
  color: var(--mra-blue, #2563eb);
  cursor: pointer;
}
.kg-sec-toggle:disabled { opacity: 0.5; cursor: default; }
.kg-aspectform { display: flex; flex-direction: column; gap: 7px; }
.kg-d-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--ic-border-soft, #e4e8f0);
}

/* narrow stages -------------------------------------------------------------------- */
@media (max-width: 900px) {
  .kg-tb-search { flex-basis: 200px; }
  .kg-drawer { width: min(300px, calc(100% - 20px)); }
  .kg-legend { display: none; }
}

/* plan section (drawer) ------------------------------------------------------ */
.kg-plan-head { display: flex; align-items: center; gap: 7px; }
.kg-plan-head .spacer { flex: 1; }
.kg-plan-count {
  font-size: 10px;
  font-weight: 650;
  padding: 1.5px 8px;
  border-radius: 999px;
  background: var(--ic-chip, #eef1f6);
  color: var(--ic-fg-muted, #5d6678);
  text-transform: none;
  letter-spacing: 0;
}
.kg-plan { display: flex; flex-direction: column; gap: 5px; }
.kg-step {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--ic-border-soft, #e4e8f0);
  border-radius: 9px;
  background: var(--ic-code-bg, #f2f4f9);
}
.kg-step.done { opacity: 0.75; }
.kg-step.in_progress { border-color: color-mix(in srgb, var(--mra-blue, #2563eb) 50%, transparent); }
.kg-step-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex: 0 0 auto;
  margin-top: 1px;
  background: var(--ic-chip, #eef1f6);
  color: var(--ic-fg-muted, #5d6678);
}
.kg-step-ic.done { background: color-mix(in srgb, #1f8a5b 18%, transparent); color: #1f8a5b; }
.kg-step-ic.in_progress { background: color-mix(in srgb, var(--mra-blue, #2563eb) 14%, transparent); color: var(--mra-blue, #2563eb); }
.kg-step-n { font-size: 10px; font-weight: 650; }
.kg-step-main { flex: 1; min-width: 0; }
.kg-step-title { font-size: 12px; font-weight: 560; line-height: 1.35; overflow-wrap: anywhere; }
.kg-step-targets {
  font-family: 'SF Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  color: var(--ic-fg-muted, #5d6678);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kg-step-sum { font-size: 10.5px; color: color-mix(in srgb, #1f8a5b 80%, var(--ic-fg, #1b2230)); }
.kg-step-acts { display: inline-flex; gap: 2px; flex: 0 0 auto; opacity: 0; transition: opacity 0.12s; }
.kg-step:hover .kg-step-acts,
.kg-step:focus-within .kg-step-acts,
.kg-step.busy .kg-step-acts,
.kg-step.in_progress .kg-step-acts { opacity: 1; }
.kg-plan-note { font-size: 11px; line-height: 1.5; color: var(--ic-fg-faint, #98a1b3); }
.kg-addstep { display: flex; flex-direction: column; gap: 6px; }
.kg-addstep-row { display: flex; gap: 6px; }
.kg-addstep-row select { flex: 1; min-width: 0; }

/* hub plan progress (canvas) -------------------------------------------------- */
.kg-hub-prog .bg { fill: color-mix(in srgb, var(--ic-fg, #1b2230) 12%, transparent); }
.kg-hub-prog .fill { fill: #1f8a5b; }

/* chat turn-grounding chip ----------------------------------------------------- */
.ai-ctxchip {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 2px 6px;
  font-size: 10.5px;
  color: var(--ic-fg-faint, #98a1b3);
  min-width: 0;
}
.ai-ctxchip svg { color: var(--mra-amber, #f9ab00); flex: 0 0 auto; }
.ai-ctxchip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-ctxchip-link {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--mra-blue, #2563eb);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ai-ctxchip-link:hover { text-decoration: underline; }

/* feature autotest accountability ---------------------------------------------- */
.kg-d-testwarn {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 11px;
  line-height: 1.45;
  border: 1px solid color-mix(in srgb, var(--mra-amber, #f9ab00) 50%, transparent);
  background: color-mix(in srgb, var(--mra-amber, #f9ab00) 9%, transparent);
  color: color-mix(in srgb, var(--mra-amber, #f9ab00) 75%, var(--ic-fg, #1b2230));
}
.kg-d-testwarn svg { flex: 0 0 auto; margin-top: 1px; }
.kg-conn em { white-space: nowrap; }

/* thinking-chain readability ---------------------------------------------------- */
.ai-think-label { flex: 0 0 auto; }
.ai-think-prev {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10.5px;
  font-weight: 400;
  color: var(--ic-fg-faint, #98a1b3);
  text-align: left;
}

/* in-thread "working…" placeholder ---------------------------------------------- */
.ai-pending {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border-radius: 11px;
  border: 1px solid var(--ic-border-soft, #e4e8f0);
  background: var(--ic-chip, #eef1f6);
  font-size: 11.5px;
  color: var(--ic-fg-muted, #5d6678);
  max-width: 100%;
}
.ai-pending-dots { display: inline-flex; gap: 3px; flex: 0 0 auto; }
.ai-pending-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mra-blue, #2563eb);
  animation: ai-pending-bounce 1.2s ease-in-out infinite;
}
.ai-pending-dots i:nth-child(2) { animation-delay: 0.15s; }
.ai-pending-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes ai-pending-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-3.5px); opacity: 1; }
}
.ai-pending-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* one-button feature implementation ---------------------------------------------- */
.kg-implement { width: 100%; justify-content: center; }
/* Run-all driver: running label + Stop side by side; the secondary single-step
   action sits under the primary Run-all. */
.kg-runrow { display: flex; gap: 6px; }
.kg-runrow .kg-implement.running { flex: 1; min-width: 0; opacity: 1; }
.kg-runrow .kg-runctl { flex: 0 0 auto; }
.kg-implement-one { width: 100%; justify-content: center; margin-top: 6px; font-size: 11.5px; color: var(--ic-fg-muted); }
.kg-implement.done {
  border-color: color-mix(in srgb, #1f8a5b 45%, transparent);
  color: #1f8a5b;
  opacity: 1;
}

/* shared-code structure (multi-feature) ------------------------------------------ */
.kg-edge.kg-shared {
  stroke: color-mix(in srgb, var(--mra-amber, #f9ab00) 55%, transparent);
  stroke-width: 1.6px;
  stroke-dasharray: 2.5 6;
  stroke-linecap: round;
}
.kg-edge.kg-shared:hover { stroke: var(--mra-amber, #f9ab00); }
.kg-sharedpill rect {
  fill: color-mix(in srgb, var(--mra-amber, #f9ab00) 16%, var(--ic-panel, #f7f8fb));
  stroke: color-mix(in srgb, var(--mra-amber, #f9ab00) 60%, transparent);
  stroke-width: 1px;
}
.kg-sharedpill text {
  fill: color-mix(in srgb, var(--mra-amber, #f9ab00) 85%, var(--ic-fg, #1b2230));
  font-size: 9.5px;
  font-weight: 700;
  pointer-events: none;
}
.kg-node.kg-isshared .kg-asp-halo { opacity: 1; }
.kg-badge.o-shared {
  border-color: color-mix(in srgb, var(--mra-amber, #f9ab00) 55%, transparent);
  color: color-mix(in srgb, var(--mra-amber, #f9ab00) 80%, var(--ic-fg, #1b2230));
  background: color-mix(in srgb, var(--mra-amber, #f9ab00) 10%, transparent);
}
.kg-leg-dash {
  width: 14px !important;
  height: 0 !important;
  border-radius: 0 !important;
  border-top: 2px dashed var(--mra-amber, #f9ab00);
  background: none !important;
}
.kg-d-commonfiles {
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--ic-fg-muted, #5d6678);
  font-family: 'SF Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  overflow-wrap: anywhere;
}

/* empty-state self-discovery ------------------------------------------------------ */
.kg-discover {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(440px, 100%);
  margin-bottom: 6px;
}
.kg-discover .kg-plan-note { text-align: center; }
.kg-discover-btn { width: 100%; justify-content: center; font-size: 13px; padding: 9px 14px; }
.kg-discover.running {
  flex-direction: row;
  align-items: flex-start;
  text-align: left;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--mra-blue, #2563eb) 45%, transparent);
  border-radius: 11px;
  background: color-mix(in srgb, var(--mra-blue, #2563eb) 7%, transparent);
}
.kg-discover.running .bs-spin { margin-top: 2px; flex: 0 0 auto; }
.kg-discover-copy { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.kg-discover-copy strong { font-size: 12.5px; }
.kg-discover-copy span { color: var(--ic-fg-muted, #5d6678); line-height: 1.5; }
.kg-empty-or {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ic-fg-faint, #98a1b3);
  margin: 2px 0 4px;
}

/* feature surgery (merge / split) -------------------------------------------------- */
.kg-surgery {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px;
  border: 1px solid var(--ic-border-soft, #e4e8f0);
  border-radius: 10px;
  background: var(--ic-code-bg, #f2f4f9);
}
.kg-split-list { display: flex; flex-direction: column; gap: 4px; max-height: 180px; overflow-y: auto; }
.kg-split-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border: 1px solid var(--ic-border-soft, #e4e8f0);
  border-radius: 8px;
  background: var(--ic-editor, #fff);
  color: var(--ic-fg, #1b2230);
  font-size: 11.5px;
  cursor: pointer;
  text-align: left;
}
.kg-split-row svg { color: var(--kgc, #9aa0a6); flex: 0 0 auto; }
.kg-split-row span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kg-split-row.on { border-color: var(--mra-blue, #2563eb); background: color-mix(in srgb, var(--mra-blue, #2563eb) 8%, var(--ic-editor, #fff)); }
.kg-split-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border: 1px solid var(--ic-border, #d9dee8);
  border-radius: 4px;
  background: var(--ic-editor, #fff);
  color: var(--mra-blue, #2563eb);
  flex: 0 0 auto;
}
.kg-split-row.on .kg-split-check { border-color: var(--mra-blue, #2563eb); }
.kg-d-actions { flex-wrap: wrap; }

/* built-feature change flow ---------------------------------------------------- */
.kg-badge.o-built {
  border-color: color-mix(in srgb, #1f8a5b 50%, transparent);
  color: #1f8a5b;
  background: color-mix(in srgb, #1f8a5b 10%, transparent);
}
.kg-improve { display: flex; flex-direction: column; gap: 7px; }

/* queued-message tag ------------------------------------------------------------ */
.ai-queued-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 1px 6px;
  margin-right: 6px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--mra-amber, #f9ab00) 55%, transparent);
  color: color-mix(in srgb, var(--mra-amber, #f9ab00) 85%, var(--ic-fg, #1b2230));
  vertical-align: 1px;
}

/* ── OpenCoder CLI download modal (Part 3) ─────────────────────────────────── */
.cli-btn { gap: 6px; }
.btn-ghost {
  color: var(--cc-text);
  background: var(--cc-surface);
  border: 1px solid var(--cc-line);
}
.btn-ghost:hover { background: var(--cc-soft); }
.btn-ghost.danger { color: var(--cc-danger); border-color: var(--cc-danger-soft); }
.btn-ghost.danger:hover { background: var(--cc-danger-soft); }

.oc-modal {
  position: fixed;
  z-index: 50;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  overflow: auto;
  background: var(--cc-surface);
  border: 1px solid var(--cc-line);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(13, 20, 38, 0.28);
  padding: 18px 20px 16px;
}
.oc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.oc-title { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--cc-ink); }
.oc-title strong { font-weight: 700; }
.oc-error {
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--cc-danger-soft);
  color: var(--cc-danger);
  font-size: 13px;
}
.oc-body { color: var(--cc-text); font-size: 13.5px; }
.oc-note { margin: 10px 0 6px; color: var(--cc-text-dim); display: block; line-height: 1.55; }
.oc-note > svg { vertical-align: -2px; margin-right: 5px; }
.oc-loading { display: flex; align-items: center; gap: 8px; padding: 18px 0; color: var(--cc-text-dim); }
.oc-facts { list-style: none; margin: 6px 0 14px; padding: 0; display: grid; gap: 6px; }
.oc-facts li { display: flex; align-items: center; gap: 7px; color: var(--cc-text); }
.oc-facts code, .oc-tokenrow code, .oc-env code { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.oc-tokenrow {
  display: flex; align-items: center; gap: 8px; margin: 4px 0 6px;
}
.oc-token {
  flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap;
  padding: 8px 10px; border-radius: 8px;
  background: var(--cc-soft); border: 1px solid var(--cc-line);
  font-size: 12.5px; color: var(--cc-ink);
}
.oc-env {
  margin: 4px 0 12px; padding: 10px 12px; border-radius: 8px;
  background: var(--cc-dark); color: #d7e0f0; overflow-x: auto;
  font-size: 12.5px; line-height: 1.5;
}
.oc-env code { color: inherit; white-space: pre; }
.oc-ostabs { display: inline-flex; gap: 4px; margin: 8px 0 4px; padding: 3px; border-radius: 9px; background: var(--cc-soft); border: 1px solid var(--cc-line); }
.oc-ostab {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  padding: 5px 13px; border-radius: 6px; font: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--cc-text-dim);
}
.oc-ostab:hover { color: var(--cc-ink); }
.oc-ostab.active { background: var(--cc-card, #fff); color: var(--cc-ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.oc-cmd {
  margin: 4px 0 12px; padding: 10px 12px; border-radius: 8px;
  background: var(--cc-dark); color: #d7e0f0; overflow-x: auto;
  font-size: 12.5px; line-height: 1.5;
}
.oc-cmd code { font-family: ui-monospace, "SF Mono", Menlo, monospace; color: inherit; white-space: pre-wrap; word-break: break-all; }
.oc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.oc-foot { margin: 14px 0 0; padding-top: 10px; border-top: 1px solid var(--cc-line-soft); color: var(--cc-text-faint); font-size: 12px; }
.oc-foot code { font-family: ui-monospace, "SF Mono", Menlo, monospace; color: var(--cc-text-dim); }

/* ===================================================================
   Billing / usage windows (docs/BILLING-PLAN.md). Light dashboard theme.
   One gauge vocabulary: ring = rolling 5h, bar = fixed weekly, number = EC.
   =================================================================== */
.usage-ring { display: inline-block; vertical-align: middle; }
.usage-ring .ur-track { stroke: var(--mra-line); }
.usage-ring .ur-val { stroke: var(--mra-blue); transition: stroke-dashoffset 400ms ease; }
.usage-ring.is-warn .ur-val { stroke: var(--mra-amber); }
.usage-ring.is-danger .ur-val { stroke: var(--mra-red); }
.usage-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--mra-line); overflow: hidden; }
.usage-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--mra-blue); transition: width 400ms ease; }
.usage-bar.is-warn > span { background: var(--mra-amber); }
.usage-bar.is-danger > span { background: var(--mra-red); }

/* utility-bar fuel-gauge chip */
.ub-gauge {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px;
  border: 1px solid var(--mra-line); border-radius: 999px; background: var(--mra-surface);
  color: var(--mra-fg-muted); font: inherit; font-size: 12px; font-weight: 500; cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.ub-gauge:hover { border-color: var(--mra-blue-line); background: var(--mra-blue-soft); }
.ub-gauge svg { color: var(--mra-amber); }
.ub-gauge .ubg-plan { font-weight: 600; color: var(--mra-ink); }
.ub-gauge .ubg-ec { font-family: var(--mra-font-num); font-weight: 600; color: var(--mra-ink); }
.ub-gauge .ubg-d { width: 3px; height: 3px; border-radius: 50%; background: var(--mra-line); }
.ub-gauge.is-danger { border-color: var(--mra-border-red); background: var(--mra-red-soft); }
.ub-gauge.is-danger svg { color: var(--mra-red); }

/* Usage & Plan tab */
.usage-view { display: flex; flex-direction: column; }
.usage-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 6px; }
.usage-card {
  background: var(--mra-surface); border: 1px solid var(--mra-line); border-radius: 14px;
  padding: 18px 20px; box-shadow: var(--mra-shadow-1);
}
.usage-card.span2 { grid-column: 1 / -1; }
.usage-card .uc-h { font-size: 12px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--mra-fg-faint); margin-bottom: 14px; display: flex; align-items: center; gap: 6px; }
.usage-card .uc-big { font-family: var(--mra-font-num); font-size: 34px; font-weight: 700; color: var(--mra-ink); line-height: 1; }
.usage-card .uc-big span { font-size: 15px; font-weight: 600; color: var(--mra-fg-muted); }
.usage-card .uc-sub { font-size: 12.5px; color: var(--mra-fg-muted); margin-top: 8px; }

.usage-windows { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; }
.usage-windows .uw { text-align: center; }
.usage-windows .uw-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.usage-windows .uw-head span { font-size: 13px; font-weight: 600; color: var(--mra-ink); }
.usage-windows .uw-head em { font-style: normal; font-size: 11px; color: var(--mra-fg-faint); }
.usage-windows .uw-ring { position: relative; width: 116px; height: 116px; margin: 0 auto; }
.usage-windows .uw-ringtxt { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.usage-windows .uw-ringtxt strong { font-family: var(--mra-font-num); font-size: 26px; font-weight: 700; color: var(--mra-ink); }
.usage-windows .uw-barbig { display: flex; align-items: center; gap: 12px; margin: 30px 0 18px; }
.usage-windows .uw-barbig strong { font-family: var(--mra-font-num); font-size: 22px; font-weight: 700; color: var(--mra-ink); }
.usage-windows .uw-sub { font-size: 13px; color: var(--mra-fg-muted); font-family: var(--mra-font-num); }
.usage-windows .uw-reset { font-size: 12px; color: var(--mra-fg-faint); margin-top: 4px; }

.um-row, .ut-row { display: flex; align-items: center; gap: 10px; margin: 9px 0; }
.um-name, .ut-name { flex: 0 0 92px; font-size: 12.5px; color: var(--mra-fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.um-bar, .ut-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--mra-line); overflow: hidden; }
.um-bar > span { display: block; height: 100%; background: var(--mra-blue); border-radius: 999px; }
.ut-bar > span { display: block; height: 100%; border-radius: 999px; }
.ut-bar.t-read > span { background: #6366f1; }
.ut-bar.t-recall > span { background: #14b8a6; }
.ut-bar.t-think > span { background: #f59e0b; }
.ut-bar.t-reply > span { background: var(--mra-blue); }
.um-val, .ut-val { flex: 0 0 auto; font-family: var(--mra-font-num); font-size: 12.5px; color: var(--mra-fg-muted); min-width: 54px; text-align: right; }

.usage-plan { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.usage-plan .up-actions { display: flex; gap: 8px; }
.usage-test .ut-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.usage-test .ut-actions > span { font-size: 12.5px; color: var(--mra-fg-muted); }
.usage-test .btn.on { border-color: var(--mra-blue); color: var(--mra-blue-strong); background: var(--mra-blue-soft); }
.usage-note { display: flex; align-items: center; gap: 8px; color: var(--mra-fg-muted); font-size: 13px; background: var(--mra-canvas); }
.usage-empty { padding: 30px; text-align: center; color: var(--mra-fg-muted); }
.usage-empty.sm { padding: 10px 0; font-size: 12.5px; }

@media (max-width: 880px) {
  .usage-grid { grid-template-columns: 1fr; }
  .usage-windows { grid-template-columns: 1fr; }
}

/* IDE-scoped billing surfaces (status bar, assistant footer breakdown, near-limit
   banner, hard-limit block). Theme via --ic-* so they read in dark + light IDE. */
.ide-status .sb-item.sb-usage { display: inline-flex; align-items: center; gap: 5px; }
.ide-status .sb-item.sb-usage .usage-ring { width: 12px; height: 12px; }
.ide-status .sb-item.sb-usage.is-danger { color: var(--ic-danger-fg); }
.ide-shell .ai-foot-bd { font-size: .66rem; color: var(--ic-fg-faint); font-family: var(--mra-font-mono); padding: 0 0 2px 17px; letter-spacing: -.01em; }
.ide-shell .ai-nearlimit {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 10px 8px;
  padding: 7px 10px; border-radius: 9px; font-size: .76rem; font-weight: 500;
  background: #fff6e5; border: 1px solid #f5dca0; color: #8a5a00;
}
.ide-theme-dark .ai-nearlimit { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.4); color: #f0b760; }
.ide-shell .ai-nearlimit svg { color: #d08700; flex: 0 0 auto; }
.ide-theme-dark .ai-nearlimit svg { color: #f0b760; }
.ide-shell .ai-limitblock {
  margin: 0 10px 8px; padding: 11px 13px; border-radius: 11px;
  background: var(--ic-danger-bg); border: 1px solid var(--ic-danger-line);
}
.ide-shell .ai-limitblock .ai-lb-h { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: .82rem; color: var(--ic-danger-fg); }
.ide-shell .ai-limitblock .ai-lb-h svg { color: var(--ic-danger-fg); }
.ide-shell .ai-limitblock .ai-lb-sub { font-size: .76rem; color: var(--ic-fg-muted); margin: 5px 0 9px; }
.ide-shell .ai-limitblock .ai-lb-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.ide-shell .ai-chip-btn.ghost { background: transparent; }
/* ---------- Observability (telemetry) view --------------------------- */
.obs-view .obs-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 16px; }
.obs-windows { display: inline-flex; gap: 2px; background: var(--mra-bg-subtle, #f1f3f5); border: 1px solid var(--mra-border, #e5e7eb); border-radius: 9px; padding: 3px; }
.obs-windows button { border: 0; background: transparent; padding: 5px 14px; border-radius: 6px; font: inherit; font-size: 13px; font-weight: 600; color: var(--mra-fg-muted, #6b7280); cursor: pointer; }
.obs-windows button.active { background: #fff; color: var(--mra-fg, #111827); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.obs-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.obs-card { background: #fff; border: 1px solid var(--mra-border, #e5e7eb); border-radius: 12px; padding: 14px 16px; }
.obs-card-v { font-size: 24px; font-weight: 700; letter-spacing: -.02em; color: var(--mra-fg, #111827); }
.obs-card-l { font-size: 12px; font-weight: 600; color: var(--mra-fg-muted, #6b7280); margin-top: 2px; text-transform: uppercase; letter-spacing: .03em; }
.obs-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.obs-panel { background: #fff; border: 1px solid var(--mra-border, #e5e7eb); border-radius: 12px; padding: 16px; }
.obs-panel h3 { margin: 0 0 12px; font-size: 13px; font-weight: 700; color: var(--mra-fg, #111827); display: flex; align-items: center; gap: 8px; }
.obs-none { color: var(--mra-fg-muted, #6b7280); font-size: 13px; margin: 6px 0; }
.obs-bar-row { display: grid; grid-template-columns: 130px 1fr 40px; align-items: center; gap: 10px; margin: 7px 0; font-size: 13px; }
.obs-bar-l { color: var(--mra-fg, #111827); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.obs-bar { height: 8px; background: var(--mra-bg-subtle, #f1f3f5); border-radius: 5px; overflow: hidden; }
.obs-bar span { display: block; height: 100%; border-radius: 5px; min-width: 3px; }
.obs-bar-v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--mra-fg-muted, #6b7280); }
.obs-mrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--mra-border-soft, #f3f4f6); font-size: 13px; }
.obs-mrow:last-child { border-bottom: 0; }
.obs-mrow code { font-family: ui-monospace, "SF Mono", Menlo, monospace; color: var(--mra-fg, #111827); }
.obs-mrow span { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--mra-fg-muted, #6b7280); }
.obs-table { font-size: 12.5px; }
.obs-row { display: grid; grid-template-columns: 18px 70px 76px 92px 48px 156px 150px 110px 1fr; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 7px; cursor: pointer; }
.obs-row:not(.obs-head):hover { background: var(--mra-bg-subtle, #f6f8fa); }
.obs-row.open { background: var(--mra-bg-subtle, #f1f3f5); box-shadow: inset 2px 0 0 var(--mra-blue, #2563eb); }
.obs-row[role="button"]:focus-visible { outline: 2px solid var(--mra-blue, #2563eb); outline-offset: -2px; }
.obs-caret { color: var(--mra-fg-muted, #9ca3af); font-size: 10px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; transition: transform .12s ease, color .12s ease; }
.obs-row.open .obs-caret { transform: rotate(90deg); color: var(--mra-blue, #2563eb); }
.obs-head { color: var(--mra-fg-muted, #6b7280); font-weight: 700; text-transform: uppercase; font-size: 10.5px; letter-spacing: .04em; cursor: default; border-bottom: 1px solid var(--mra-border, #e5e7eb); border-radius: 0; }
.obs-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.obs-when { color: var(--mra-fg-muted, #6b7280); font-variant-numeric: tabular-nums; }
.obs-kind { font-weight: 600; color: var(--mra-fg, #111827); }
.obs-src, .obs-user { color: var(--mra-fg-muted, #6b7280); }
.obs-model { font-family: ui-monospace, "SF Mono", Menlo, monospace; color: var(--mra-blue, #2563eb); font-size: 11.5px; }
.obs-snip { color: var(--mra-fg-muted, #6b7280); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11.5px; }
.obs-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--mra-bg-subtle, #f1f3f5); color: var(--mra-fg-muted, #6b7280); justify-self: start; }
.obs-badge.ok { background: rgba(22,163,74,.12); color: #16a34a; }
.obs-badge.err { background: color-mix(in srgb, var(--c, #dc2626) 14%, #fff); color: var(--c, #dc2626); }
.obs-detail { margin: 0 8px 10px; padding: 10px 12px; background: var(--mra-bg-subtle, #f6f8fa); border: 1px solid var(--mra-border, #e5e7eb); border-radius: 8px; }
.obs-detail-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 16px; margin-bottom: 9px; }
.obs-dt { display: flex; gap: 8px; font-size: 12px; min-width: 0; align-items: baseline; }
.obs-dk { color: var(--mra-fg-muted, #6b7280); flex: 0 0 82px; }
.obs-dv { color: var(--mra-fg, #111827); font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.obs-dbh { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--mra-fg-muted, #6b7280); margin-bottom: 5px; }
.obs-dtrunc { color: #b45309; text-transform: none; letter-spacing: 0; font-weight: 600; }
.obs-detail-pre { margin: 0; padding: 10px 12px; background: #0d1117; color: #e6edf3; border-radius: 6px; font-size: 11.5px; line-height: 1.5; max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.obs-detail-empty { margin: 0; color: var(--mra-fg-muted, #6b7280); font-style: italic; font-size: 12px; }
.obs-proj { color: var(--mra-fg-muted, #6b7280); }
/* toolbar right side + range note + soft inline error banner */
.obs-toolbar-r { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.obs-range { font-size: 12px; font-weight: 600; color: var(--mra-fg-muted, #6b7280); font-variant-numeric: tabular-nums; }
/* Grafana-style auto-refresh control + refresh affordances */
.obs-ar { display: inline-flex; align-items: center; gap: 8px; }
.obs-arpick { position: relative; display: inline-flex; align-items: center; }
.obs-arpick select { appearance: none; -webkit-appearance: none; padding: 6px 26px 6px 24px; border: 1px solid var(--mra-border, #e5e7eb); border-radius: 8px; background: #fff; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--mra-fg, #111827); cursor: pointer; }
.obs-arpick select:hover { border-color: var(--mra-fg-muted, #cbd5e1); }
.obs-arpick::after { content: ""; position: absolute; right: 10px; top: 50%; width: 6px; height: 6px; border-right: 2px solid var(--mra-fg-muted, #9ca3af); border-bottom: 2px solid var(--mra-fg-muted, #9ca3af); transform: translateY(-68%) rotate(45deg); pointer-events: none; }
.obs-ardot { position: absolute; left: 9px; top: 50%; width: 7px; height: 7px; border-radius: 999px; background: var(--mra-fg-muted, #cbd5e1); transform: translateY(-50%); }
.obs-ar.live .obs-ardot { background: #16a34a; animation: obs-pulse 1.7s ease-out infinite; }
.obs-ar.live .obs-arpick select { border-color: rgba(22,163,74,.55); color: #15803d; }
@keyframes obs-pulse { 0% { box-shadow: 0 0 0 0 rgba(22,163,74,.5); } 70% { box-shadow: 0 0 0 6px rgba(22,163,74,0); } 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); } }
@keyframes obs-spin { to { transform: rotate(360deg); } }
.obs-spin { animation: obs-spin .7s linear infinite; transform-origin: 50% 50%; }
.obs-h3refresh { background: none; border: 0; padding: 3px; margin-left: 2px; cursor: pointer; color: var(--mra-fg-muted, #9ca3af); vertical-align: middle; border-radius: 6px; line-height: 0; }
.obs-h3refresh:hover { background: var(--mra-bg-subtle, #f1f3f5); color: var(--mra-fg, #111827); }
.obs-banner { background: color-mix(in srgb, #d97706 12%, #fff); border: 1px solid color-mix(in srgb, #d97706 35%, #fff); color: #92400e; border-radius: 9px; padding: 8px 12px; font-size: 12.5px; margin-bottom: 12px; }
.obs-card.warn .obs-card-v { color: #dc2626; }
.obs-card.good .obs-card-v { color: #16a34a; }
/* Workstream C — turn funnel */
.obs-funnel-top { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.obs-srbig { flex: 0 0 auto; min-width: 116px; text-align: center; padding: 12px 18px; border: 1px solid var(--mra-border, #e5e7eb); border-radius: 12px; background: var(--mra-bg-subtle, #f8fafc); }
.obs-srnum { font-size: 40px; font-weight: 800; line-height: 1; letter-spacing: -.02em; color: var(--mra-fg, #111827); }
.obs-srbig.good .obs-srnum { color: #16a34a; }
.obs-srbig.warn .obs-srnum { color: #d97706; }
.obs-srlbl { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--mra-fg-muted, #6b7280); margin-top: 5px; }
.obs-funnel-meta { flex: 1 1 320px; min-width: 240px; }
.obs-funnel-head { font-size: 15px; color: var(--mra-fg, #111827); }
.obs-funnel-sub { font-size: 12px; color: var(--mra-fg-muted, #6b7280); margin: 4px 0 10px; }
.obs-funnelbar { display: flex; height: 16px; border-radius: 6px; overflow: hidden; background: var(--mra-bg-subtle, #f1f3f5); }
.obs-fseg { height: 100%; min-width: 2px; }
.obs-odot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: middle; }
.obs-badge.act { background: rgba(37,99,235,.12); color: var(--mra-blue, #2563eb); }
.obs-curbuild { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px; font-size: 10px; font-weight: 700; background: rgba(22,163,74,.14); color: #16a34a; vertical-align: middle; }
.obs-uturns { display: flex; flex-direction: column; }
.obs-utrow { display: grid; grid-template-columns: minmax(140px, 1.6fr) 60px 92px 64px minmax(80px, 2fr); align-items: center; gap: 10px; padding: 8px; border-radius: 8px; font-size: 13px; }
.obs-utrow > span:nth-child(2), .obs-utrow > span:nth-child(3), .obs-utrow > span:nth-child(4) { text-align: right; font-variant-numeric: tabular-nums; }
.obs-utrow:not(.obs-uthead) { cursor: pointer; }
.obs-utrow:not(.obs-uthead):hover { background: var(--mra-bg-subtle, #f1f3f5); }
.obs-uthead { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--mra-fg-muted, #6b7280); }
.obs-uname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--mra-fg, #111827); }
.obs-uother { color: var(--mra-fg-muted, #6b7280); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* turn drill-down: child /gw requests */
.obs-children { margin-top: 10px; }
.obs-children-list { display: flex; flex-direction: column; gap: 2px; }
.obs-child { display: grid; grid-template-columns: 64px auto minmax(0, 1fr) 72px 56px; align-items: center; gap: 8px; padding: 3px 6px; border-radius: 6px; font-size: 12px; }
.obs-child:hover { background: var(--mra-bg-subtle, #f1f3f5); }
.obs-cmodel { color: var(--mra-blue, #2563eb); font-family: ui-monospace, SFMono-Regular, monospace; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.obs-ctoks, .obs-cdur { text-align: right; font-variant-numeric: tabular-nums; color: var(--mra-fg-muted, #6b7280); }
/* errors deep-dive */
.obs-cards-sm { margin-bottom: 14px; }
.obs-err-row { display: grid; grid-template-columns: auto 46px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--mra-border, #eef0f2); font-size: 13px; }
.obs-err-row:last-child { border-bottom: 0; }
.obs-err-cnt { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; color: var(--mra-fg, #111827); }
.obs-err-msg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--mra-fg, #111827); font-family: ui-monospace, SFMono-Regular, monospace; font-size: 12px; }
.obs-err-meta { color: var(--mra-fg-muted, #6b7280); font-size: 11.5px; white-space: nowrap; }
.obs-err-meta code { font-family: ui-monospace, monospace; }
.obs-mrow-act { cursor: pointer; }
.obs-mrow-act:hover { background: var(--mra-bg-subtle, #f1f3f5); border-radius: 6px; }
/* content feed */
.obs-feed { padding: 8px 10px 12px; }
.obs-feedbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.obs-feedbar input[type="search"] { flex: 1; min-width: 0; padding: 7px 11px; border: 1px solid var(--mra-border, #e5e7eb); border-radius: 8px; font: inherit; font-size: 13px; background: #fff; }
.obs-chipx { border: 0; background: var(--mra-bg-subtle, #f1f3f5); border-radius: 6px; padding: 4px 6px; cursor: pointer; color: var(--mra-fg-muted, #6b7280); display: inline-flex; align-items: center; }
.obs-feedcard { border: 1px solid var(--mra-border, #e5e7eb); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; background: #fff; }
.obs-feedhead { display: flex; align-items: center; gap: 10px; font-size: 12px; margin-bottom: 6px; color: var(--mra-fg-muted, #6b7280); }
.obs-feeduser { font-weight: 600; color: var(--mra-fg, #111827); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 50%; }
.obs-feedmodel { margin-left: auto; }
.obs-feedhead code { color: var(--mra-blue, #2563eb); font-family: ui-monospace, SFMono-Regular, monospace; font-size: 11px; }
.obs-feedprompt { font-size: 13px; line-height: 1.5; color: var(--mra-fg, #111827); white-space: pre-wrap; word-break: break-word; max-height: 7.6em; overflow: hidden; }
.obs-feedfoot { margin-top: 8px; display: flex; align-items: center; gap: 8px; font-size: 12px; flex-wrap: wrap; }
/* sub-tabs */
.obs-subtabs { display: inline-flex; flex-wrap: wrap; gap: 2px; background: var(--mra-bg-subtle, #f1f3f5); border: 1px solid var(--mra-border, #e5e7eb); border-radius: 10px; padding: 4px; margin-bottom: 18px; }
.obs-subtabs button { border: 0; background: transparent; padding: 7px 15px; border-radius: 7px; font: inherit; font-size: 13px; font-weight: 600; color: var(--mra-fg-muted, #6b7280); cursor: pointer; display: inline-flex; align-items: center; }

/* Observability · embedded Sentry (public/app.js obsSentrySection). The frame itself is a
   fixed-position host on <body> laid over .obs-sentry-slot, so dashboard re-renders never
   reload it. */
.obs-sentry-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; font-size: 13px; color: var(--mra-fg-muted, #6b7280); }
.obs-sentry-bar span { display: inline-flex; align-items: center; gap: 6px; }
.obs-sentry-bar code { font-size: 12px; }
.obs-sentry-views { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.obs-sentry-view { font: inherit; font-size: 12.5px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--mra-border, #d6d9de); background: var(--mra-surface, #fff); color: var(--mra-fg, #1f2937); cursor: pointer; }
.obs-sentry-view:hover { border-color: var(--mra-accent, #4f46e5); }
.obs-sentry-view.active { background: var(--mra-accent, #4f46e5); border-color: var(--mra-accent, #4f46e5); color: #fff; }
.obs-sentry-slot { height: max(480px, calc(100vh - 280px)); border: 1px solid var(--mra-border, #e5e7eb); border-radius: 12px; background: var(--mra-bg-subtle, #f1f3f5); }
.obs-sentry-host { position: fixed; z-index: 30; border-radius: 12px; overflow: hidden; background: #0f1012; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.obs-sentry-host iframe { display: block; width: 100%; height: 100%; border: 0; }
.obs-subtabs button:hover { color: var(--mra-fg, #111827); }
.obs-subtabs button.active { background: #fff; color: var(--mra-fg, #111827); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.obs-tabn { display: inline-block; margin-left: 7px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--mra-bg-subtle, #eef1f4); color: var(--mra-fg-muted, #6b7280); font-variant-numeric: tabular-nums; }
.obs-subtabs button.active .obs-tabn { background: var(--mra-blue, #2563eb); color: #fff; }
/* Inner sub-nav for the consolidated Health + People tabs (lighter, underline style). */
.obs-subnav { display: inline-flex; flex-wrap: wrap; gap: 4px; margin: -4px 0 16px; padding-bottom: 2px; border-bottom: 1px solid var(--mra-border, #e5e7eb); }
.obs-subnav button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px 7px 0 0; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--mra-fg-muted, #6b7280); cursor: pointer; display: inline-flex; align-items: center; border-bottom: 2px solid transparent; margin-bottom: -3px; }
.obs-subnav button:hover { color: var(--mra-fg, #111827); background: var(--mra-bg-subtle, #f6f8fa); }
.obs-subnav button.active { color: var(--mra-blue, #2563eb); border-bottom-color: var(--mra-blue, #2563eb); }
.obs-subnav .obs-tabn { margin-left: 6px; padding: 0 6px; border-radius: 999px; font-size: 10.5px; font-weight: 700; background: var(--mra-bg-subtle, #eef1f4); color: var(--mra-fg-muted, #6b7280); font-variant-numeric: tabular-nums; }
.obs-subnav button.active .obs-tabn { background: var(--mra-blue, #2563eb); color: #fff; }

/* Hero KPI band */
.obs-hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 12px; margin-bottom: 10px; }
.obs-hero-tile { background: #fff; border: 1px solid var(--mra-border, #e5e7eb); border-radius: 14px; padding: 16px 18px; }
.obs-hero-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.obs-hero-v { font-size: 30px; font-weight: 750; letter-spacing: -.025em; color: var(--mra-fg, #111827); line-height: 1.05; }
.obs-hero-l { font-size: 11.5px; font-weight: 600; color: var(--mra-fg-muted, #6b7280); margin-top: 9px; text-transform: uppercase; letter-spacing: .04em; }
.obs-hero-tile.warn .obs-hero-v { color: #dc2626; }
.obs-hero-tile.good .obs-hero-v { color: #16a34a; }
.obs-hero-trend { font-size: 12px; font-weight: 700; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.obs-hero-trend.good { background: rgba(22,163,74,.12); color: #16a34a; }
.obs-hero-trend.bad { background: rgba(220,38,38,.12); color: #dc2626; }
.obs-hero-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; padding: 10px 15px; background: var(--mra-bg-subtle, #f6f8fa); border: 1px solid var(--mra-border-soft, #eef1f4); border-radius: 10px; font-size: 13px; color: var(--mra-fg-muted, #6b7280); }
.obs-hero-strip b { color: var(--mra-fg, #111827); font-weight: 700; font-variant-numeric: tabular-nums; }
.obs-dot { color: #c7ccd3; font-style: normal; }

/* Conversations transcript */
.obs-conv { padding: 12px 14px 14px; }
.obs-convbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.obs-convsearch { position: relative; display: flex; align-items: center; gap: 6px; flex: 1; min-width: 220px; }
.obs-convsearch input[type="search"] { flex: 1; min-width: 0; padding: 8px 12px; border: 1px solid var(--mra-border, #e5e7eb); border-radius: 9px; font: inherit; font-size: 13px; background: #fff; }
.obs-person-picker { min-width: 150px; max-width: 260px; min-height: 38px; padding: 8px 28px 8px 10px; border: 1px solid var(--mra-border, #e5e7eb); border-radius: 8px; font: inherit; font-size: 13px; background-color: #fff; text-overflow: ellipsis; }
/* The active tab must be legible at a glance: this control decides which
   conversations are visible at all, and when it read as decoration an active
   "Errors" filter was mistaken for an empty log. The track is always darker
   than the selected pill so the selection reads as raised, and inactive labels
   clear WCAG AA against the track. */
.obs-segfilter { display: inline-flex; gap: 2px; background: var(--mra-bg-subtle, #eef1f5); border: 1px solid var(--mra-border, #dfe4eb); border-radius: 8px; padding: 3px; }
.obs-segfilter button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; background: transparent; padding: 5px 12px; border-radius: 6px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--mra-fg, #394457); cursor: pointer; transition: background .12s ease, color .12s ease, border-color .12s ease; }
.obs-segfilter button:hover:not(.active) { background: rgba(15, 23, 42, .05); }
.obs-segfilter button.active { background: #fff; color: var(--mra-blue, #1d4ed8); border-color: var(--mra-border, #cbd3df); box-shadow: 0 1px 2px rgba(15, 23, 42, .12); }
/* Count chip: an empty list is only self-explanatory next to its own total. */
.obs-segcount { font-size: 11px; font-weight: 700; line-height: 1; padding: 3px 6px; border-radius: 999px; background: rgba(15, 23, 42, .08); color: inherit; font-variant-numeric: tabular-nums; }
.obs-segfilter button.active .obs-segcount { background: var(--mra-blue-soft, #eef3fe); }
.obs-linkbtn { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--mra-blue, #1d4ed8); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.obs-linkbtn:hover { color: var(--mra-blue-strong, #1e40af); }
.obs-convcount { font-size: 12.5px; color: var(--mra-fg-muted, #6b7280); font-weight: 600; margin-left: auto; white-space: nowrap; }
.obs-cx { border: 1px solid var(--mra-border, #e5e7eb); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; background: #fff; transition: border-color .12s ease; }
.obs-cx:hover { border-color: #d1d5db; }
.obs-cx-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 12.5px; }
.obs-cx-user { display: inline-flex; align-items: center; gap: 7px; max-width: 42%; margin: -2px 0 -2px -2px; padding: 2px 7px 2px 2px; border: 0; border-radius: 999px; background: transparent; color: var(--mra-fg, #111827); font: inherit; font-weight: 600; cursor: pointer; overflow: hidden; white-space: nowrap; transition: color .12s ease, background-color .12s ease; }
.obs-cx-user > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.obs-cx-user:hover, .obs-cx-user.is-active { background: rgba(37,99,235,.09); color: var(--mra-blue, #2563eb); }
.obs-cx-user:focus-visible { outline: 2px solid var(--mra-blue, #2563eb); outline-offset: 2px; }
.obs-av { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--mra-blue, #2563eb); color: #fff; font-size: 11px; font-weight: 700; flex: 0 0 auto; }
.obs-cx-model { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11px; color: var(--mra-blue, #2563eb); background: rgba(37,99,235,.08); padding: 2px 7px; border-radius: 6px; white-space: nowrap; }
.obs-cx-badge { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--c, #6b7280) 13%, transparent); color: var(--c, #6b7280); }
.obs-cx-badge.ok { background: rgba(22,163,74,.12); color: #16a34a; }
.obs-cx-badge.err { background: rgba(220,38,38,.12); color: #dc2626; }
/* Conversation steps chip + expandable per-round timeline */
.obs-cx-steps { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 4px 66px; padding: 4px 12px; border: 1px solid var(--mra-border, #e5e7eb); background: var(--mra-bg-subtle, #f6f8fa); border-radius: 999px; font: inherit; font-size: 12px; color: var(--mra-fg-muted, #6b7280); cursor: pointer; }
.obs-cx-steps:hover { border-color: var(--mra-blue, #2563eb); color: var(--mra-fg, #111827); }
.obs-cx-steps strong { color: var(--mra-fg, #111827); font-weight: 700; }
.obs-cx-stepic { font-size: 12px; opacity: .8; }
.obs-cx-tools { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11px; }
.obs-cx-caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; margin-left: 2px; transition: transform .12s; }
.obs-cx-steps.open .obs-cx-caret { transform: rotate(180deg); }
.obs-cx-timeline { margin: 2px 0 6px 66px; padding: 6px 0 6px 12px; border-left: 2px solid var(--mra-border, #e5e7eb); display: flex; flex-direction: column; gap: 3px; }
.obs-cx-step { display: grid; grid-template-columns: 22px auto auto 1fr; align-items: center; gap: 10px; font-size: 12px; color: var(--mra-fg-muted, #6b7280); }
.obs-cx-step.aux { opacity: .72; }
.obs-cx-stepkind { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border-radius: 4px; padding: 1px 5px; }
.obs-cx-stepkind.sub { background: rgba(37,99,235,.10); color: #2563eb; }
.obs-cx-stepkind.int { background: var(--mra-bg-subtle, #eef1f4); color: var(--mra-fg-muted, #6b7280); }
.obs-cx-unlinked { font-size: 11px; font-weight: 600; color: var(--mra-fg-muted, #6b7280); border: 1px dashed var(--mra-border, #e5e7eb); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
/* Model-fallback badge: the /gw proxy rewrote a non-served model to a Flash profile */
.obs-cx-fallback { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: #b45309; background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.35); border-radius: 999px; padding: 1px 8px; white-space: nowrap; max-width: 340px; overflow: hidden; cursor: help; }
.obs-cx-fbl { font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: 9.5px; }
.obs-cx-fallback code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 10.5px; color: #92400e; background: none; overflow: hidden; text-overflow: ellipsis; }
.obs-cx-fbarrow { color: #d97706; font-weight: 700; }
.obs-cx-steptags { display: inline-flex; align-items: center; gap: 6px; }
.obs-cx-stepfb { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border-radius: 4px; padding: 1px 5px; background: rgba(245,158,11,.14); color: #b45309; cursor: help; }
.obs-cx-stepn { width: 20px; height: 20px; border-radius: 50%; background: var(--mra-bg-subtle, #eef1f4); color: var(--mra-fg-muted, #6b7280); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.obs-cx-step.final .obs-cx-stepn { background: rgba(22,163,74,.14); color: #16a34a; }
.obs-cx-step.bad .obs-cx-stepn { background: rgba(220,38,38,.14); color: #dc2626; }
.obs-cx-stepstop { font-weight: 600; color: var(--mra-fg, #111827); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11.5px; }
.obs-cx-step.bad .obs-cx-stepstop { color: #dc2626; }
.obs-cx-stepmeta { text-align: right; font-variant-numeric: tabular-nums; }
/* Tool-step rows: tool name + bounded input head + result head/error */
.obs-cx-step.tool { grid-template-columns: 22px minmax(64px, auto) minmax(0, 1.2fr) minmax(0, 1fr) auto; }
.obs-cx-steptool { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11.5px; font-weight: 700; color: var(--mra-fg, #111827); background: var(--mra-bg-subtle, #eef1f4); border-radius: 5px; padding: 1px 6px; white-space: nowrap; }
.obs-cx-step.bad .obs-cx-steptool { background: rgba(220,38,38,.10); color: #dc2626; }
.obs-cx-stepio { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11px; color: var(--mra-fg-muted, #6b7280); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.obs-cx-stepres { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11px; color: #16a34a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.obs-cx-stepres.err { color: #dc2626; }
.obs-cx-when { margin-left: auto; color: var(--mra-fg-muted, #6b7280); font-variant-numeric: tabular-nums; white-space: nowrap; }
.obs-cx-msg { display: grid; grid-template-columns: 66px 1fr; gap: 12px; padding: 8px 0; }
.obs-cx-msg + .obs-cx-msg { border-top: 1px solid var(--mra-border-soft, #f3f4f6); }
/* 4.5:1 contrast at this size — #9ca3af (2.8:1) failed WCAG AA. */
.obs-cx-role { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--mra-fg-muted, #6b7280); padding-top: 2px; }
.obs-cx-msg.a .obs-cx-role { color: var(--mra-blue, #2563eb); }
.obs-cx-msg.e .obs-cx-role { color: #dc2626; }
.obs-cx-body { min-width: 0; }
.obs-cx-text { font-size: 13px; line-height: 1.55; color: var(--mra-fg, #111827); white-space: pre-wrap; word-break: break-word; max-height: 15em; overflow: auto; }
/* The answer is the card's payoff — a tinted panel with an accent edge makes
   prompt vs answer scannable at a glance in a long list. */
.obs-cx-msg.a .obs-cx-text { background: rgba(37,99,235,.045); border-left: 3px solid rgba(37,99,235,.4); border-radius: 0 8px 8px 0; padding: 8px 12px; }
.obs-cx-msg.a .obs-cx-text.obs-none { background: var(--mra-bg-subtle, #f6f8fa); border-left-color: var(--mra-border, #d7dce3); }
.obs-cx-msg.e .obs-cx-text { background: rgba(220,38,38,.05); border-left: 3px solid rgba(220,38,38,.4); border-radius: 0 8px 8px 0; padding: 8px 12px; }
.obs-cx-trunc { color: var(--mra-fg-muted, #6b7280); font-style: italic; }
.obs-cx-msg.e .obs-cx-text { color: #b91c1c; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; }
/* Condensed local-command prompts: the command chips replace the raw XML. */
.obs-cx-cmds { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.obs-cx-cmd { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11.5px; font-weight: 600; color: var(--mra-fg, #111827); background: var(--mra-bg-subtle, #eef1f4); border: 1px solid var(--mra-border, #e5e7eb); border-radius: 6px; padding: 2px 8px; }
.obs-cx-cmdl { font-size: 10.5px; font-weight: 600; color: var(--mra-fg-muted, #6b7280); text-transform: uppercase; letter-spacing: .04em; }
.obs-cx-foot { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--mra-border-soft, #f3f4f6); font-size: 12px; color: var(--mra-fg-muted, #6b7280); font-variant-numeric: tabular-nums; }
/* Keyboard reachability: the chips/filters are real buttons — show it. */
.obs-cx-steps:focus-visible, .obs-segfilter button:focus-visible { outline: 2px solid var(--mra-blue, #2563eb); outline-offset: 2px; }
/* Narrow screens: the 66px label gutter and fixed indents eat too much width — stack. */
@media (max-width: 650px) {
  .obs-cx-head { flex-wrap: wrap; row-gap: 4px; }
  .obs-cx-user { max-width: 100%; }
  .obs-cx-msg { grid-template-columns: 1fr; gap: 3px; }
  .obs-cx-role { padding-top: 0; }
  .obs-cx-steps, .obs-cx-timeline { margin-left: 0; }
}
/* Performance view */
.obs-perf-note { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--mra-border-soft, #f3f4f6); font-size: 12.5px; color: var(--mra-fg-muted, #6b7280); }
.obs-perf-note strong { color: var(--mra-fg, #111827); font-variant-numeric: tabular-nums; }
.obs-lm { display: flex; flex-direction: column; }
.obs-lmrow { display: grid; grid-template-columns: 1fr auto auto 46px; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--mra-border-soft, #f3f4f6); font-size: 12.5px; }
.obs-lmrow:last-child { border-bottom: 0; }
.obs-lmname { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11.5px; color: var(--mra-blue, #2563eb); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.obs-lmv { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--mra-fg, #111827); white-space: nowrap; }
.obs-lmv .muted { font-weight: 500; }
.obs-lmn { text-align: right; font-variant-numeric: tabular-nums; color: var(--mra-fg-muted, #6b7280); }
/* charts */
.obs-h-sub { font-size: 11px; font-weight: 600; color: var(--mra-fg-muted, #9ca3af); text-transform: none; letter-spacing: 0; }
.obs-chart-wrap { width: 100%; }
.obs-chart { width: 100%; height: auto; display: block; }
.obs-chart .obs-axis { fill: var(--mra-fg-muted, #758094); font-size: 10px; font-family: ui-sans-serif, system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.obs-chart .obs-axis-title { font-size: 9px; font-weight: 750; letter-spacing: .025em; }
.obs-chart .obs-axis-y-right { text-anchor: start; }
.obs-chart .obs-axisline { stroke: var(--mra-border, #dce2ea); stroke-width: 1; }
.obs-chart .obs-grid { stroke: var(--mra-border-soft, #e9edf3); stroke-width: 1; stroke-dasharray: 2 4; shape-rendering: geometricPrecision; }
.obs-chart-line { stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.obs-chart-area { opacity: .09; }
.obs-chart-hit { fill: transparent; cursor: crosshair; }
.obs-chart-last { stroke: #fff; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.obs-linechart { overflow: visible; }

/* Backend / infra load view */
.obs-infra-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 4px 0 20px; }
.obs-infra-head > div:first-child { min-width: 0; }
.obs-infra-eyebrow { display: block; margin-bottom: 5px; color: var(--mra-blue, #2563eb); font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.obs-infra-head h2 { margin: 0; color: var(--mra-fg, #111827); font-size: 25px; letter-spacing: -.025em; }
.obs-infra-head p { margin: 6px 0 0; color: var(--mra-fg-muted, #667085); font-size: 12.5px; }
.obs-infra-controls { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.obs-infra-windows { margin: 0; padding: 3px; gap: 2px; border: 1px solid var(--mra-border, #dfe4eb); border-radius: 10px; background: var(--mra-bg-subtle, #f6f8fa); }
.obs-infra-windows button { min-width: 46px; border-radius: 7px; border-bottom: 0; margin-bottom: 0; padding: 6px 12px; }
.obs-infra-windows button.active { background: var(--mra-blue, #2563eb); color: #fff; }
.obs-refresh-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--mra-border, #dfe4eb); background: #fff; color: var(--mra-fg-muted, #667085); cursor: pointer; font-size: 17px; line-height: 1; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.obs-refresh-btn:hover { background: var(--mra-bg-subtle, #f6f8fa); color: var(--mra-fg, #111827); }
.obs-infra-nodes { margin: 0 0 12px; border-bottom: 0; gap: 7px; }
.obs-infra-nodes button { border: 1px solid var(--mra-border, #dfe4eb); border-radius: 999px; border-bottom: 1px solid var(--mra-border, #dfe4eb); margin-bottom: 0; padding: 6px 13px; gap: 7px; background: #fff; }
.obs-infra-nodes button.active { background: var(--mra-blue, #2563eb); color: #fff; border-color: var(--mra-blue, #2563eb); }
.obs-node-dot { width: 7px; height: 7px; border-radius: 999px; flex: 0 0 auto; background: var(--mra-fg-muted, #9ca3af); }
.obs-node-dot.ok { background: #16a34a; }
.obs-node-dot.warn { background: #f59e0b; }
.obs-node-dot.bad { background: #dc2626; }
.obs-infra-nodes button.active .obs-node-dot.ok { background: #86efac; }
.obs-infra-stale { display: flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: 12px; border-radius: 11px; background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.3); color: #8a5a08; font-size: 12.5px; font-weight: 600; }
.obs-infra-status { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 16px 18px; border: 1px solid var(--mra-border, #dfe4eb); border-radius: 14px 14px 0 0; background: linear-gradient(120deg, #fff, #f8faff); }
.obs-infra-status-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(37,99,235,.08); }
.obs-infra-status-icon .obs-node-dot { width: 10px; height: 10px; }
.obs-infra-status > div:nth-child(2) { display: grid; gap: 2px; min-width: 0; }
.obs-infra-status span { color: var(--mra-fg-faint, #8b94a3); font-size: 9.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.obs-infra-status strong { color: var(--mra-fg, #111827); font-size: 17px; }
.obs-infra-status p { margin: 0; color: var(--mra-fg-muted, #667085); font-size: 12px; }
.obs-infra-status.good strong { color: #168154; }
.obs-infra-status.warn strong { color: #b56b08; }
.obs-infra-status.bad strong { color: #c4322b; }
.obs-infra-status-fresh { display: grid; gap: 4px; text-align: right; }
.obs-infra-status-fresh b { color: var(--mra-fg, #111827); font-size: 12px; font-variant-numeric: tabular-nums; }
.obs-infra-cards { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--mra-border, #dfe4eb); border-top: 0; border-radius: 0 0 14px 14px; background: #fff; }
.obs-infra-card { min-width: 0; padding: 15px 16px 16px; border-left: 1px solid var(--mra-border-soft, #edf0f4); }
.obs-infra-card:first-child { border-left: 0; }
.obs-infra-card-l { display: block; color: var(--mra-fg-muted, #667085); font-size: 10px; font-weight: 750; letter-spacing: .045em; text-transform: uppercase; }
.obs-infra-card strong { display: block; margin-top: 7px; color: var(--mra-fg, #111827); font-family: var(--mra-font-num, ui-monospace); font-size: 24px; font-weight: 720; letter-spacing: -.025em; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.obs-infra-card small { display: block; margin-top: 7px; color: var(--mra-fg-faint, #8b94a3); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.obs-infra-card.warn strong { color: #c56e00; }
.obs-infra-card.bad strong { color: #c4322b; }
.obs-infra-details { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; margin: 10px 2px 18px; color: var(--mra-fg-muted, #667085); font-size: 11px; }
.obs-infra-details span { display: inline-flex; align-items: baseline; gap: 5px; }
.obs-infra-details b { color: var(--mra-fg, #111827); font-family: var(--mra-font-num, ui-monospace); font-variant-numeric: tabular-nums; }
.obs-infra-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.obs-infra-chart-card { min-width: 0; padding: 17px 18px 14px; border: 1px solid var(--mra-border, #dfe4eb); border-radius: 14px; background: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.025); }
.obs-infra-chart-card.is-primary { border-color: #ccd8ef; box-shadow: 0 5px 18px rgba(37,99,235,.055); }
.obs-infra-chart-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; min-height: 55px; }
.obs-infra-chart-card > header > div { min-width: 0; }
.obs-infra-chart-card > header span, .obs-infra-gpus > header span { display: block; margin-bottom: 3px; color: var(--mra-blue, #2563eb); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.obs-infra-chart-card h3, .obs-infra-gpus h3 { margin: 0; color: var(--mra-fg, #111827); font-size: 14px; letter-spacing: -.01em; }
.obs-infra-chart-card header p { margin: 4px 0 0; color: var(--mra-fg-muted, #667085); font-size: 10.5px; line-height: 1.35; }
.obs-infra-chart-card header > strong { flex: 0 0 auto; color: var(--mra-fg, #111827); font-family: var(--mra-font-num, ui-monospace); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.obs-infra-chart-card .obs-chart-wrap { margin-top: 5px; }
.obs-infra-chart-card .obs-legend { margin: 2px 0 0 56px; }
.obs-infra-gpus { margin-top: 14px; padding: 18px; border: 1px solid var(--mra-border, #dfe4eb); border-radius: 14px; background: #fff; }
.obs-infra-gpus > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.obs-infra-gpus > header > strong { color: var(--mra-fg-muted, #667085); font-size: 11px; }
.obs-infra-gpu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 8px; }
.obs-infra-gpu { min-width: 0; padding: 12px; border: 1px solid var(--mra-border-soft, #e9edf3); border-radius: 10px; background: var(--mra-bg-subtle, #fafbfc); }
.obs-infra-gpu > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.obs-infra-gpu b { color: var(--mra-fg, #111827); font-size: 11.5px; }
.obs-infra-gpu strong { color: var(--mra-blue, #2563eb); font-family: var(--mra-font-num, ui-monospace); font-size: 14px; font-variant-numeric: tabular-nums; }
.obs-infra-gpu > span { display: block; margin-top: 2px; color: var(--mra-fg-faint, #8b94a3); font-size: 9px; }
.obs-infra-gpu > i { display: block; height: 5px; margin-top: 9px; overflow: hidden; border-radius: 999px; background: #e6eaf0; }
.obs-infra-gpu > i em { display: block; height: 100%; border-radius: inherit; background: var(--mra-blue, #2563eb); }
.obs-infra-gpu > i.mem { margin-top: 7px; height: 3px; }
.obs-infra-gpu > i.mem em { background: #8b5cf6; }
.obs-infra-gpu dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 11px 0 0; }
.obs-infra-gpu dl div { min-width: 0; }
.obs-infra-gpu dt { color: var(--mra-fg-faint, #8b94a3); font-size: 8.5px; text-transform: uppercase; }
/* Serving capacity from Prometheus: the engine id on a product tab, the source line, GPU cards grouped by host, the topology table. */
.obs-infra-node-model { margin-left: 7px; font-family: var(--mra-font-num, ui-monospace); font-size: 9.5px; opacity: .7; }
.obs-infra-nodes button.active .obs-infra-node-model { opacity: .85; }
.obs-infra-source { display: block; margin-top: 4px; color: var(--mra-fg-faint, #8b94a3); font-size: 10px; }
.obs-infra-gpu-host { margin: 12px 0 7px; color: var(--mra-fg-muted, #667085); font-family: var(--mra-font-num, ui-monospace); font-size: 11px; font-weight: 600; }
.obs-infra-gpu-host:first-child { margin-top: 0; }
.obs-infra-gpu-host small { margin-left: 6px; font-family: inherit; font-size: 10px; font-weight: 400; color: var(--mra-fg-faint, #8b94a3); }
.obs-infra-topology .obs-kv-tablewrap { margin-top: 14px; }
.obs-infra-grafana > header .obs-fleet-actions { flex: 0 0 auto; display: flex; gap: 8px; align-items: center; }
.obs-infra-grafana-panels { display: flex; flex-wrap: wrap; gap: 6px; }
.obs-infra-grafana-panels a { font-size: 11px; }
.obs-infra-workers td code { font-size: 10.5px; }
.obs-infra-cells { margin-top: 14px; }
/* A Dynamo model has seven cards: running, waiting, queue time, throughput, KV, GPU, window. */
.obs-infra-cards.obs-infra-cards-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
/* Request path: frontend → prefill → decode, each stage's own count and what it means. */
.obs-reqpath-stages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--mra-border-soft, #e9edf3); border-radius: 11px; background: var(--mra-bg-subtle, #fafbfc); }
.obs-reqpath-stage { position: relative; min-width: 0; padding: 13px 16px 14px; border-left: 1px solid var(--mra-border-soft, #e9edf3); }
.obs-reqpath-stage:first-child { border-left: 0; }
.obs-reqpath-stage + .obs-reqpath-stage::before { content: "→"; position: absolute; top: 12px; left: -9px; width: 16px; height: 16px; border: 1px solid var(--mra-border-soft, #e9edf3); border-radius: 4px; background: #fff; color: var(--mra-fg-faint, #8b94a3); font-size: 10px; line-height: 15px; text-align: center; }
.obs-reqpath-stage > span { display: block; color: var(--mra-fg-faint, #8b94a3); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.obs-reqpath-stage h4 { margin: 3px 0 0; color: var(--mra-fg, #111827); font-size: 12.5px; font-weight: 650; }
.obs-reqpath-figures { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 5px; margin-top: 9px; }
.obs-reqpath-figures b { color: var(--mra-fg, #111827); font-family: var(--mra-font-num, ui-monospace); font-size: 20px; font-weight: 720; line-height: 1; font-variant-numeric: tabular-nums; }
.obs-reqpath-figures b.warn { color: #b45309; }
.obs-reqpath-figures b.bad { color: #b91c1c; }
.obs-reqpath-figures small { margin-right: 11px; color: var(--mra-fg-muted, #667085); font-size: 10.5px; }
.obs-reqpath-stage p { margin: 8px 0 0; color: var(--mra-fg-muted, #667085); font-size: 10.5px; line-height: 1.4; }
.obs-reqpath-stage p em { color: var(--mra-fg, #111827); font-style: normal; font-weight: 650; }
.obs-reqpath-stage p.obs-reqpath-at { color: var(--mra-fg, #111827); font-family: var(--mra-font-num, ui-monospace); font-size: 10.5px; }
.obs-reqpath-at code { padding: 1px 4px; border: 1px solid var(--mra-border-soft, #e9edf3); border-radius: 3px; background: #fff; font-size: 10px; }
.obs-reqpath-note { margin: 10px 2px 0; color: var(--mra-fg-muted, #667085); font-size: 10.5px; line-height: 1.45; }
.obs-reqpath-note b { color: var(--mra-fg, #111827); font-weight: 650; }
.obs-infra-cells .obs-kv-tablewrap { margin-top: 0; }
.obs-infra-cells-table th, .obs-infra-cells-table td { white-space: nowrap; font-variant-numeric: tabular-nums; }
.obs-infra-cells-table td strong { color: var(--mra-blue, #2563eb); }
.obs-infra-cells-table td small { color: var(--mra-fg-faint, #8b94a3); font-size: 9.5px; }
.obs-infra-cells-table td.warn { color: #b45309; font-weight: 600; }
.obs-infra-cells-table td.bad { color: #b91c1c; font-weight: 700; }
/* Per-cell bars: decode and prefill throughput against the busiest cell, KV against the engine's own capacity. */
.obs-cellbars { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; margin-bottom: 16px; }
.obs-cellbar { padding: 12px 14px; border: 1px solid var(--mra-border-soft, #e9edf3); border-left: 3px solid var(--cell, #2563eb); border-radius: 10px; background: var(--mra-bg-subtle, #fafbfc); }
.obs-cellbar-name { display: flex; align-items: baseline; gap: 8px; margin-bottom: 9px; min-width: 0; }
.obs-cellbar-name code { font-size: 11.5px; font-weight: 700; color: var(--mra-fg, #111827); }
.obs-cellbar-name small { color: var(--mra-fg-faint, #8b94a3); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.obs-cellbar-dot { display: inline-block; width: 8px; height: 8px; border-radius: 999px; background: var(--cell, #2563eb); flex: 0 0 auto; margin-right: 6px; vertical-align: middle; }
.obs-cellbar-track { position: relative; height: 18px; margin-top: 5px; border-radius: 4px; background: #e9edf3; overflow: hidden; }
.obs-cellbar-track em { display: block; height: 100%; background: var(--cell, #2563eb); opacity: .85; transition: width .4s ease; }
.obs-cellbar-track.pre em { opacity: .45; }
.obs-cellbar-track.kv em { background: #7c3aed; }
.obs-cellbar-track.kv.warn em { background: #d97706; }
.obs-cellbar-track.kv.bad em { background: #dc2626; }
.obs-cellbar-track b { position: absolute; inset: 0; display: flex; align-items: center; padding: 0 8px; color: var(--mra-fg, #111827); font-family: var(--mra-font-num, ui-monospace); font-size: 10.5px; font-variant-numeric: tabular-nums; text-shadow: 0 0 2px #fff, 0 0 2px #fff; }
.obs-cellbar-track b small { margin-left: 4px; font-size: 9px; color: var(--mra-fg-muted, #667085); }
.obs-cellbar-facts { display: flex; gap: 12px; margin-top: 8px; color: var(--mra-fg-muted, #667085); font-size: 10px; }
.obs-cellbar-facts b { color: var(--mra-fg, #111827); font-family: var(--mra-font-num, ui-monospace); font-variant-numeric: tabular-nums; }
.obs-infra-cells-table .obs-cellbar-dot { width: 7px; height: 7px; }
.obs-infra-gpu dd { margin: 3px 0 0; color: var(--mra-fg, #111827); font-family: var(--mra-font-num, ui-monospace); font-size: 10.5px; font-variant-numeric: tabular-nums; }
/* Host health — the box under the cell. Same card visual language as the
   serving cards so the two read as one panel, but its own bordered section
   because it describes the HOST, not the model (two cells on one box report
   identical numbers here). */
.obs-infra-host { margin-top: 14px; padding: 18px; border: 1px solid var(--mra-border, #dfe4eb); border-radius: 14px; background: #fff; }
.obs-infra-host > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.obs-infra-host > header > div { min-width: 0; }
.obs-infra-host > header span { display: block; margin-bottom: 3px; color: var(--mra-blue, #2563eb); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.obs-infra-host h3 { margin: 0; color: var(--mra-fg, #111827); font-size: 14px; letter-spacing: -.01em; }
.obs-infra-host header p { margin: 4px 0 0; color: var(--mra-fg-muted, #667085); font-size: 10.5px; line-height: 1.35; }
.obs-infra-host > header > strong { flex: 0 0 auto; color: var(--mra-fg-muted, #667085); font-family: var(--mra-font-num, ui-monospace); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.obs-infra-host-cards { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--mra-border-soft, #e9edf3); border-radius: 11px; background: var(--mra-bg-subtle, #fafbfc); }
.obs-infra-host-cards .obs-infra-card { padding: 13px 14px 14px; border-left: 1px solid var(--mra-border-soft, #e9edf3); }
.obs-infra-host-cards .obs-infra-card:first-child { border-left: 0; }
.obs-infra-host-cards .obs-infra-card strong { font-size: 20px; }
.obs-infra-mounts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; margin-top: 10px; }
.obs-infra-mount { min-width: 0; padding: 11px 12px; border: 1px solid var(--mra-border-soft, #e9edf3); border-radius: 10px; background: var(--mra-bg-subtle, #fafbfc); }
.obs-infra-mount > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.obs-infra-mount b { color: var(--mra-fg, #111827); font-family: var(--mra-font-num, ui-monospace); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.obs-infra-mount strong { color: var(--mra-blue, #2563eb); font-family: var(--mra-font-num, ui-monospace); font-size: 13px; font-variant-numeric: tabular-nums; }
.obs-infra-mount.warn strong { color: #c56e00; }
.obs-infra-mount.bad strong { color: #c4322b; }
.obs-infra-mount > i { display: block; height: 5px; margin-top: 8px; overflow: hidden; border-radius: 999px; background: #e6eaf0; }
.obs-infra-mount > i em { display: block; height: 100%; border-radius: inherit; background: var(--mra-blue, #2563eb); }
.obs-infra-mount.warn > i em { background: #f59e0b; }
.obs-infra-mount.bad > i em { background: #dc2626; }
.obs-infra-mount > span { display: block; margin-top: 7px; color: var(--mra-fg-faint, #8b94a3); font-size: 9.5px; }
@media (max-width: 1180px) {
  .obs-infra-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .obs-infra-card:nth-child(4) { border-left: 0; }
  .obs-infra-card:nth-child(n+4) { border-top: 1px solid var(--mra-border-soft, #edf0f4); }
  .obs-infra-host-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .obs-infra-host-cards .obs-infra-card:nth-child(4) { border-left: 0; }
  .obs-infra-host-cards .obs-infra-card:nth-child(n+4) { border-top: 1px solid var(--mra-border-soft, #e9edf3); }
  .obs-infra-cards.obs-infra-cards-7 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .obs-infra-cards-7 .obs-infra-card:nth-child(7) { border-left: 0; }
}
@media (max-width: 820px) {
  .obs-infra-head { align-items: flex-start; flex-direction: column; gap: 14px; }
  .obs-infra-controls { width: 100%; }
  .obs-infra-controls .obs-refresh-btn { margin-left: auto; }
  .obs-infra-charts { grid-template-columns: 1fr; }
  .obs-reqpath-stages { grid-template-columns: 1fr; }
  .obs-reqpath-stage { border-left: 0; border-top: 1px solid var(--mra-border-soft, #e9edf3); }
  .obs-reqpath-stage:first-child { border-top: 0; }
  .obs-reqpath-stage + .obs-reqpath-stage::before { content: "↓"; top: -9px; left: 16px; }
}
@media (max-width: 580px) {
  .obs-infra-cards, .obs-infra-cards.obs-infra-cards-7 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .obs-infra-card { border-left: 1px solid var(--mra-border-soft, #edf0f4); }
  .obs-infra-card:nth-child(odd) { border-left: 0; }
  .obs-infra-card:nth-child(n+3) { border-top: 1px solid var(--mra-border-soft, #edf0f4); }
  .obs-infra-host-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .obs-infra-host-cards .obs-infra-card:nth-child(odd) { border-left: 0; }
  .obs-infra-host-cards .obs-infra-card:nth-child(n+3) { border-top: 1px solid var(--mra-border-soft, #e9edf3); }
  .obs-infra-host > header { flex-direction: column; gap: 8px; }
  .obs-infra-status { grid-template-columns: auto minmax(0, 1fr); }
  .obs-infra-status-fresh { grid-column: 2; text-align: left; }
  .obs-infra-card strong { font-size: 20px; }
  .obs-infra-chart-card { padding-inline: 10px; }
  .obs-infra-chart-card > header { padding-inline: 6px; }
  .obs-infra-chart-card .obs-legend { margin-left: 50px; flex-wrap: wrap; }
}

/* KV analysis — engine-truth accounting stays visually separate from the
   aggregate backend pressure dashboard above. */
[data-obs-kv-surface] { min-width: 0; width: 100%; max-width: 100%; }
.obs-kv-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 12px 0; color: var(--mra-fg-muted, #667085); font-size: 11px; }
.obs-kv-selected-title { display: flex; flex-direction: column; gap: 2px; min-width: 220px; }
.obs-kv-selected-title span { color: var(--mra-fg-muted, #667085); font-size: 10px; font-weight: 760; letter-spacing: .08em; text-transform: uppercase; }
.obs-kv-selected-title strong { color: var(--mra-fg, #111827); font-size: 15px; letter-spacing: -.01em; }
.obs-kv-selector { display: grid; gap: 5px; min-width: min(430px, 100%); color: var(--mra-fg-muted, #667085); font-size: 10px; font-weight: 750; letter-spacing: .045em; text-transform: uppercase; }
.obs-kv-selector select { min-height: 36px; padding: 7px 34px 7px 10px; border: 1px solid var(--mra-border, #dfe4eb); border-radius: 9px; background: #fff; color: var(--mra-fg, #111827); font: 500 12px/1.3 var(--mra-font-num, ui-monospace); text-transform: none; letter-spacing: 0; }
.obs-kv-selector select:focus-visible, .obs-kv-simulator input:focus-visible, .obs-kv-submit:focus-visible { outline: 2px solid var(--mra-blue, #2563eb); outline-offset: 2px; }
.obs-kv-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.obs-kv-badge { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 8px; border: 1px solid rgba(245,158,11,.28); border-radius: 999px; background: rgba(245,158,11,.09); color: #8a5a08; font-size: 9.5px; font-weight: 750; line-height: 1.2; }
.obs-kv-badge.warn { border-color: rgba(245,158,11,.28); background: rgba(245,158,11,.09); color: #8a5a08; }
.obs-kv-badge.good { border-color: rgba(22,163,74,.25); background: rgba(22,163,74,.09); color: #137044; }
.obs-kv-badge.bad { border-color: rgba(220,38,38,.24); background: rgba(220,38,38,.08); color: #b42318; }
.obs-kv-badge.muted { border-color: var(--mra-border, #dfe4eb); background: var(--mra-bg-subtle, #f6f8fa); color: var(--mra-fg-muted, #667085); }
.obs-kv-scopegrid { display: grid; grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr); gap: 10px; }
.obs-kv-capability-group { min-width: 0; padding: 10px 12px; border: 1px solid var(--mra-border-soft, #e9edf3); border-radius: 10px; background: var(--mra-bg-subtle, #fafbfc); }
.obs-kv-capability-group > b { display: block; margin-bottom: 7px; color: var(--mra-fg-muted, #667085); font-size: 9px; letter-spacing: .055em; text-transform: uppercase; }
.obs-kv-scope-note { margin: -2px 0 8px; color: var(--mra-fg-muted, #667085); font-size: 9.5px; line-height: 1.4; }
.obs-kv-capability-group .obs-kv-badges { margin-bottom: 0; }
.obs-kv-headline-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-top: 12px; }
.obs-kv-headline { position: relative; min-width: 0; overflow: hidden; padding: 14px; border: 1px solid var(--mra-border, #dfe4eb); border-radius: 12px; background: #fff; }
.obs-kv-headline::before { position: absolute; inset: 0 auto 0 0; width: 3px; background: #94a3b8; content: ""; }
.obs-kv-headline.retained::before { background: #35a671; }
.obs-kv-headline.union::before { background: #0f9f8f; }
.obs-kv-headline.active::before { background: #2563eb; }
.obs-kv-headline.reclaimable::before { background: #f59e0b; }
.obs-kv-headline.cpu::before { background: #855ad8; }
.obs-kv-headline > span { display: block; color: var(--mra-fg-muted, #667085); font-size: 8.5px; font-weight: 800; letter-spacing: .055em; text-transform: uppercase; }
.obs-kv-headline > strong { display: block; margin-top: 6px; color: var(--mra-fg, #111827); font: 700 22px/1.1 var(--mra-font-num, ui-monospace); font-variant-numeric: tabular-nums; }
.obs-kv-headline > p { margin: 6px 0 0; color: var(--mra-fg-muted, #667085); font-size: 9.5px; line-height: 1.4; }
.obs-kv-proof-boundary { display: grid; grid-template-columns: minmax(180px, .75fr) minmax(0, 2fr); align-items: center; gap: 18px; margin-top: 12px; padding: 13px 15px; border: 1px solid rgba(37,99,235,.22); border-radius: 12px; background: linear-gradient(120deg, rgba(37,99,235,.075), rgba(37,99,235,.025)); }
.obs-kv-proof-boundary span { display: block; color: var(--mra-blue, #2563eb); font-size: 8.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.obs-kv-proof-boundary strong { display: block; margin-top: 3px; color: var(--mra-fg, #111827); font-size: 11px; }
.obs-kv-proof-boundary p { margin: 0; color: var(--mra-fg-muted, #667085); font-size: 10.5px; line-height: 1.5; }
.obs-kv-warning, .obs-kv-error { display: flex; align-items: flex-start; gap: 9px; margin: 10px 0 0; padding: 10px 12px; border: 1px solid rgba(245,158,11,.28); border-radius: 10px; background: rgba(245,158,11,.08); color: #8a5a08; font-size: 11.5px; line-height: 1.45; }
.obs-kv-warning strong { flex: 0 0 auto; }
.obs-kv-warning ul { display: grid; gap: 7px; width: 100%; margin: 0; padding: 0; list-style: none; }
.obs-kv-warning li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 10px; }
.obs-kv-warning li span, .obs-kv-warning li b { display: block; }
.obs-kv-warning li b { color: #704707; font-size: 10.5px; }
.obs-kv-warning li code { padding: 2px 5px; border-radius: 4px; background: rgba(255,255,255,.55); color: #704707; font-size: 8.5px; white-space: nowrap; }
.obs-kv-error { border-color: rgba(220,38,38,.24); background: rgba(220,38,38,.07); color: #b42318; }
.obs-kv-panel { min-width: 0; margin-top: 12px; padding: 18px; border: 1px solid var(--mra-border, #dfe4eb); border-radius: 14px; background: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.025); }
.obs-kv-panel > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.obs-kv-panel > header > div { min-width: 0; }
.obs-kv-panel > header span { display: block; margin-bottom: 3px; color: var(--mra-blue, #2563eb); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.obs-kv-panel h3 { margin: 0; color: var(--mra-fg, #111827); font-size: 14px; letter-spacing: -.01em; }
.obs-kv-panel header p { max-width: 720px; margin: 4px 0 0; color: var(--mra-fg-muted, #667085); font-size: 10.5px; line-height: 1.4; }
.obs-kv-panel > header > strong { flex: 0 0 auto; color: var(--mra-fg, #111827); font: 650 11px/1.3 var(--mra-font-num, ui-monospace); font-variant-numeric: tabular-nums; white-space: nowrap; }
.obs-kv-panel > header > strong.warn { color: #b56b08; }
.obs-kv-fleet { border-color: #ccd8ef; background: linear-gradient(130deg, #fff, #f8faff); }
.obs-kv-fleet .obs-kv-capability-group { margin-top: -2px; }
.obs-kv-fleet-facts { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.obs-kv-opsgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.obs-kv-opsgrid > .obs-kv-panel { margin-top: 0; }
.obs-kv-poolbar { display: flex; width: 100%; height: 26px; overflow: hidden; border: 1px solid rgba(16,24,40,.07); border-radius: 8px; background: #eef1f5; box-shadow: inset 0 1px 2px rgba(16,24,40,.06); }
.obs-kv-poolbar > span { display: block; min-width: 0; height: 100%; }
.obs-kv-poolbar .active, .obs-kv-legend i.active { background: #2563eb; }
.obs-kv-poolbar .idle, .obs-kv-legend i.idle { background: #35a671; }
.obs-kv-poolbar .reserved, .obs-kv-legend i.reserved { background: #855ad8; }
.obs-kv-poolbar .used, .obs-kv-legend i.used { background: #64748b; }
.obs-kv-poolbar .free, .obs-kv-legend i.free { background: #65c8be; }
.obs-kv-poolbar .safety, .obs-kv-legend i.safety { background: #f0ad3d; }
.obs-kv-poolbar .unknown, .obs-kv-legend i.unknown { background: #cbd2dc; }
.obs-kv-poolbar .occupied, .obs-kv-legend i.occupied { background: #506784; }
.obs-kv-poolbar .unoccupied, .obs-kv-legend i.unoccupied { background: #d8dee8; }
.obs-kv-poolbar .allocator-active, .obs-kv-legend i.allocator-active { background: #2563eb; }
.obs-kv-poolbar .allocator-free, .obs-kv-legend i.allocator-free { background: #65c8be; }
.obs-kv-poolbar .allocator-unavailable, .obs-kv-legend i.allocator-unavailable { background: #a4adba; }
.obs-kv-poolbar .cpu-used, .obs-kv-legend i.cpu-used { background: #855ad8; }
.obs-kv-poolbar .cpu-free, .obs-kv-legend i.cpu-free { background: #d9c9f5; }
.obs-kv-poolbar .tier-gpu, .obs-kv-legend i.tier-gpu { background: #2563eb; }
.obs-kv-poolbar .tier-both, .obs-kv-legend i.tier-both { background: #f59e0b; }
.obs-kv-poolbar .tier-cpu, .obs-kv-legend i.tier-cpu { background: #855ad8; }
.obs-kv-union { border-color: rgba(15,159,143,.28); background: linear-gradient(145deg, #fff, rgba(15,159,143,.035)); }
.obs-kv-subpool { margin-top: 14px; padding: 12px; border: 1px solid var(--mra-border-soft, #e9edf3); border-radius: 10px; background: var(--mra-bg-subtle, #fafbfc); }
.obs-kv-subpool h4 { margin: 0; color: var(--mra-fg, #111827); font-size: 11px; }
.obs-kv-subpool > p { margin: 4px 0 10px; color: var(--mra-fg-muted, #667085); font-size: 9.5px; line-height: 1.45; }
.obs-kv-subpool .obs-kv-legend { margin-bottom: 0; }
.obs-kv-unavailable > strong { color: var(--mra-fg, #111827); }
.obs-kv-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 7px 12px; margin-top: 11px; }
.obs-kv-legend span { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; align-items: center; gap: 6px; min-width: 0; color: var(--mra-fg-muted, #667085); font-size: 10px; }
.obs-kv-legend i { width: 9px; height: 9px; border-radius: 3px; }
.obs-kv-legend b { overflow: hidden; color: var(--mra-fg, #111827); font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.obs-kv-legend em { font-style: normal; font-variant-numeric: tabular-nums; white-space: nowrap; }
.obs-kv-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 8px; margin: 14px 0 0; }
.obs-kv-facts > div { min-width: 0; padding: 10px 11px; border: 1px solid var(--mra-border-soft, #e9edf3); border-radius: 9px; background: var(--mra-bg-subtle, #fafbfc); }
.obs-kv-facts dt { color: var(--mra-fg-muted, #667085); font-size: 8.5px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.obs-kv-facts dd { margin: 4px 0 0; overflow: hidden; color: var(--mra-fg, #111827); font: 650 11px/1.3 var(--mra-font-num, ui-monospace); font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.obs-kv-facts dd.warn { color: #b56b08; }
.obs-kv-tiergrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.obs-kv-note { margin: 11px 0 0; color: var(--mra-fg-muted, #667085); font-size: 10.5px; line-height: 1.45; }
.obs-kv-note.warn { color: #9a6107; }
.obs-kv-unavailable { padding: 14px; border: 1px dashed var(--mra-border, #dfe4eb); border-radius: 9px; background: var(--mra-bg-subtle, #fafbfc); color: var(--mra-fg-muted, #667085); font-size: 11px; line-height: 1.45; }
.obs-kv-queue-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: -2px 0 10px; }
.obs-kv-queue-summary span { padding: 4px 8px; border-radius: 7px; background: var(--mra-bg-subtle, #f6f8fa); color: var(--mra-fg-muted, #667085); font-size: 10px; }
.obs-kv-queue-summary b { color: var(--mra-fg, #111827); font-variant-numeric: tabular-nums; }
.obs-kv-tablewrap { overflow-x: auto; border: 1px solid var(--mra-border-soft, #e9edf3); border-radius: 10px; }
.obs-kv-queue table { width: 100%; min-width: 720px; border-collapse: collapse; text-align: left; }
.obs-kv-queue th { padding: 8px 10px; border-bottom: 1px solid var(--mra-border, #dfe4eb); background: var(--mra-bg-subtle, #f6f8fa); color: var(--mra-fg-muted, #667085); font-size: 9px; letter-spacing: .045em; text-transform: uppercase; }
.obs-kv-queue td { padding: 9px 10px; border-top: 1px solid var(--mra-border-soft, #edf0f4); color: var(--mra-fg-muted, #667085); font-size: 10.5px; vertical-align: middle; }
.obs-kv-queue tbody tr:first-child td { border-top: 0; }
.obs-kv-queue td strong, .obs-kv-queue td small { display: block; }
.obs-kv-queue td strong { max-width: 210px; overflow: hidden; color: var(--mra-fg, #111827); font: 650 10.5px/1.35 var(--mra-font-num, ui-monospace); text-overflow: ellipsis; white-space: nowrap; }
.obs-kv-queue td small { margin-top: 2px; color: var(--mra-fg-faint, #8b94a3); font-size: 9px; }
.obs-kv-queue td code { color: var(--mra-fg-muted, #667085); font-size: 8.5px; }
.obs-kv-state { display: inline-block; padding: 3px 6px; border-radius: 5px; background: var(--mra-bg-subtle, #f1f3f5); color: var(--mra-fg, #111827); font: 700 9px/1.2 var(--mra-font-num, ui-monospace); }
.obs-kv-request-group + .obs-kv-request-group { margin-top: 16px; }
.obs-kv-request-group h4 { display: flex; align-items: center; gap: 7px; margin: 0 0 7px; color: var(--mra-fg, #111827); font-size: 11px; }
.obs-kv-request-group h4 span { min-width: 20px; padding: 2px 6px; border-radius: 999px; background: var(--mra-bg-subtle, #f1f3f5); color: var(--mra-fg-muted, #667085); font-size: 9px; text-align: center; }
.obs-kv-history-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 9px; margin-top: 12px; }
.obs-kv-history-card { min-width: 0; padding: 11px; border: 1px solid var(--mra-border-soft, #e9edf3); border-radius: 10px; background: var(--mra-bg-subtle, #fafbfc); }
.obs-kv-history-card.primary { grid-column: span 2; border-color: rgba(53,166,113,.28); background: linear-gradient(150deg, rgba(53,166,113,.06), var(--mra-bg-subtle, #fafbfc)); }
.obs-kv-history-card header h4 { margin: 0; color: var(--mra-fg, #111827); font-size: 11px; }
.obs-kv-history-card header p { min-height: 29px; margin: 3px 0 0; color: var(--mra-fg-muted, #667085); font-size: 9px; line-height: 1.35; }
.obs-kv-history-card .obs-chart-wrap { margin-top: 5px; }
.obs-kv-history-card .obs-chart { max-height: 165px; }
.obs-kv-history-card .obs-legend { flex-wrap: wrap; gap: 6px 11px; margin-top: 4px; font-size: 9px; }
.obs-kv-simulator form { display: grid; grid-template-columns: repeat(4, minmax(100px, 1fr)) auto; align-items: end; gap: 9px; }
.obs-kv-simulator label { display: grid; gap: 5px; color: var(--mra-fg-muted, #667085); font-size: 9.5px; font-weight: 700; }
.obs-kv-simulator input { width: 100%; min-height: 36px; padding: 7px 9px; border: 1px solid var(--mra-border, #dfe4eb); border-radius: 8px; background: #fff; color: var(--mra-fg, #111827); font: 600 11px/1.2 var(--mra-font-num, ui-monospace); }
.obs-kv-submit { min-height: 36px; padding: 7px 14px; border: 1px solid var(--mra-blue, #2563eb); border-radius: 8px; background: var(--mra-blue, #2563eb); color: #fff; font-size: 11px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.obs-kv-submit:hover:not(:disabled) { filter: brightness(.94); }
.obs-kv-submit:disabled { cursor: wait; opacity: .58; }
.obs-kv-sim-result { margin-top: 12px; padding: 12px; border: 1px solid var(--mra-border, #dfe4eb); border-radius: 10px; background: var(--mra-bg-subtle, #fafbfc); color: var(--mra-fg, #111827); }
.obs-kv-sim-result.good { border-color: rgba(22,163,74,.3); background: rgba(22,163,74,.055); }
.obs-kv-sim-result.bad { border-color: rgba(220,38,38,.28); background: rgba(220,38,38,.05); }
.obs-kv-sim-result > strong { font-size: 12px; }
.obs-kv-sim-result > div { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 7px; margin-top: 9px; }
.obs-kv-sim-result span { color: var(--mra-fg-muted, #667085); font-size: 10px; }
.obs-kv-sim-result b { display: block; margin-top: 2px; color: var(--mra-fg, #111827); font-family: var(--mra-font-num, ui-monospace); font-variant-numeric: tabular-nums; }
@media (max-width: 820px) {
  .obs-kv-tiergrid, .obs-kv-opsgrid, .obs-kv-scopegrid { grid-template-columns: 1fr; }
  .obs-kv-headline-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .obs-kv-proof-boundary { grid-template-columns: 1fr; gap: 7px; }
  .obs-kv-simulator form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 580px) {
  .obs-kv-toolbar { align-items: stretch; flex-direction: column; gap: 7px; }
  .obs-kv-selector { min-width: 0; }
  .obs-kv-panel { padding: 14px; }
  .obs-kv-panel > header { flex-direction: column; gap: 6px; }
  .obs-kv-headline-grid { grid-template-columns: 1fr; }
  .obs-kv-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .obs-kv-warning { flex-direction: column; }
  .obs-kv-warning li { grid-template-columns: 1fr; gap: 3px; }
  .obs-kv-warning li code { justify-self: start; white-space: normal; word-break: break-all; }
  .obs-kv-history-grid { grid-template-columns: 1fr; }
  .obs-kv-history-card.primary { grid-column: auto; }
  .obs-kv-simulator form { grid-template-columns: 1fr; }
}
.obs-legend { display: flex; gap: 16px; margin-top: 8px; font-size: 11.5px; color: var(--mra-fg-muted, #6b7280); font-weight: 600; }
.obs-legend span { display: inline-flex; align-items: center; gap: 6px; }
.obs-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.obs-pname { color: var(--mra-fg, #111827); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55%; }
/* shared numeric cells */
.obs-view .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--mra-fg, #111827); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.obs-view .num.bad { color: #dc2626; }
.obs-view .muted { color: var(--mra-fg-muted, #9ca3af); font-weight: 600; }
.obs-cwhen { color: var(--mra-fg-muted, #6b7280); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.obs-tag { display: inline-block; padding: 0 6px; border-radius: 999px; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; background: var(--mra-bg-subtle, #f1f3f5); color: var(--mra-fg-muted, #6b7280); vertical-align: middle; }
.obs-tag.owner { background: rgba(37,99,235,.12); color: var(--mra-blue, #2563eb); }
/* clients table */
.obs-clients, .obs-users-tbl { padding: 6px 8px 12px; }
.obs-crow { display: grid; grid-template-columns: 20px minmax(120px, 1.5fr) 78px 76px 64px 54px 132px 92px; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.obs-clients.has-cost .obs-crow { grid-template-columns: 20px minmax(120px, 1.5fr) 78px 76px 64px 54px 132px 78px 92px; }
.obs-crow:not(.obs-chead):hover { background: var(--mra-bg-subtle, #f6f8fa); }
.obs-crow.open { background: var(--mra-bg-subtle, #f1f3f5); }
.obs-chead { color: var(--mra-fg-muted, #6b7280); font-weight: 700; text-transform: uppercase; font-size: 10px; letter-spacing: .04em; cursor: default; border-bottom: 1px solid var(--mra-border, #e5e7eb); border-radius: 0; }
.obs-chead span:nth-child(n+3) { text-align: right; }
.obs-chead span:nth-child(2) { text-align: left; }
.obs-cexp { color: var(--mra-fg-muted, #9ca3af); display: inline-flex; }
.obs-cexp svg { transition: transform .15s ease; }
.obs-crow.open .obs-cexp svg { transform: rotate(90deg); }
.obs-cname { font-weight: 700; color: var(--mra-fg, #111827); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 7px; }
.obs-prov { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--mra-blue, #2563eb); background: rgba(37,99,235,.1); padding: 1px 6px; border-radius: 999px; flex: 0 0 auto; }
.obs-cusers { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--mra-fg, #111827); }
.obs-subusers { background: var(--mra-bg-subtle, #fafbfc); border-radius: 8px; margin: 0 0 6px; padding: 4px 0 4px 26px; border-left: 2px solid var(--mra-border, #e5e7eb); }
.obs-surow { display: grid; grid-template-columns: minmax(150px, 1.7fr) 76px 64px 132px minmax(80px, 1fr) 54px 104px 66px 92px; align-items: center; gap: 10px; padding: 6px 10px 6px 4px; border-radius: 6px; font-size: 12.5px; cursor: pointer; }
.obs-subusers.has-cost .obs-surow, .has-cost .obs-surow { grid-template-columns: minmax(150px, 1.7fr) 76px 64px 132px 78px minmax(80px, 1fr) 54px 104px 66px 92px; }
.obs-surow:hover { background: #fff; }
.obs-uname { color: var(--mra-fg, #111827); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.obs-umodel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.obs-umodel code { font-family: ui-monospace, "SF Mono", Menlo, monospace; color: var(--mra-blue, #2563eb); font-size: 11px; }
.obs-hint { color: var(--mra-fg-muted, #9ca3af); font-size: 11.5px; margin: 10px 4px 2px; }
/* users table */
.obs-urow { display: grid; grid-template-columns: minmax(160px, 1.6fr) minmax(110px, 1fr) 72px 62px 52px 80px 84px minmax(86px, 0.9fr) 54px 104px 66px 96px; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; font-size: 12.5px; cursor: pointer; }
.obs-users-tbl.has-cost .obs-urow { grid-template-columns: minmax(160px, 1.6fr) minmax(110px, 1fr) 72px 62px 52px 80px 84px 76px minmax(86px, 0.9fr) 54px 104px 66px 96px; }
.obs-plan { justify-self: start; display: inline-block; max-width: 100%; padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; background: var(--mra-bg-subtle, #f1f3f5); color: var(--mra-fg-muted, #6b7280); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.obs-plan.plan-pro { background: rgba(37,99,235,.12); color: var(--mra-blue, #2563eb); }
.obs-plan.plan-max { background: rgba(124,58,237,.14); color: #7c3aed; }
.obs-plan.custom { box-shadow: inset 0 0 0 1px rgba(180,83,9,.45); }
.obs-plan.none { background: transparent; color: var(--mra-fg-muted, #9ca3af); font-weight: 600; }
.obs-lim { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.obs-lim.muted { color: var(--mra-fg-muted, #9ca3af); }
.obs-limrow { display: grid; grid-template-columns: 17px 1fr 30px; align-items: center; gap: 5px; }
.obs-limlbl { font-size: 9px; color: var(--mra-fg-muted, #9ca3af); text-transform: uppercase; font-weight: 700; }
.obs-limbar { height: 5px; border-radius: 999px; background: var(--mra-border, #e5e7eb); overflow: hidden; }
.obs-limbar i { display: block; height: 100%; border-radius: 999px; background: #16a34a; }
.obs-limbar.t-warn i { background: #d97706; }
.obs-limbar.t-crit i { background: #dc2626; }
.obs-limpct { font-size: 9.5px; color: var(--mra-fg-muted, #6b7280); text-align: right; font-variant-numeric: tabular-nums; }
.obs-urow:not(.obs-uhead):hover { background: var(--mra-bg-subtle, #f6f8fa); }
.obs-uhead { color: var(--mra-fg-muted, #6b7280); font-weight: 700; text-transform: uppercase; font-size: 10px; letter-spacing: .04em; cursor: default; border-bottom: 1px solid var(--mra-border, #e5e7eb); border-radius: 0; }
.obs-uhead span:nth-child(n+3) { text-align: right; }
.obs-ucompany { color: var(--mra-fg-muted, #6b7280); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* events filter chip */
.obs-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; background: rgba(37,99,235,.1); color: var(--mra-blue, #2563eb); border-radius: 999px; padding: 2px 6px 2px 10px; text-transform: none; letter-spacing: 0; }
.obs-chip button { border: 0; background: transparent; color: inherit; cursor: pointer; display: inline-flex; padding: 2px; border-radius: 999px; }
.obs-chip button:hover { background: rgba(37,99,235,.18); }
.obs-export { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--mra-blue, #2563eb); text-decoration: none; border: 1px solid var(--mra-blue-line, rgba(37,99,235,.3)); border-radius: 999px; padding: 2px 10px; vertical-align: middle; }
.obs-export:hover { background: var(--mra-blue-soft, rgba(37,99,235,.08)); }
@media (max-width: 1100px) {
  .obs-cols { grid-template-columns: 1fr; }
  .obs-row { grid-template-columns: 18px 64px 70px 84px 1fr; }
  .obs-row .obs-src, .obs-row .obs-model, .obs-row .obs-user, .obs-row .obs-proj { display: none; }
  .obs-detail-meta { grid-template-columns: 1fr 1fr; }
  /* Wide breakdown tables scroll horizontally rather than reflow on narrow screens. */
  .obs-clients, .obs-users-tbl { overflow-x: auto; }
  .obs-crow { min-width: 660px; }
  .obs-urow, .obs-surow { min-width: 980px; }
}

/* ===================================================================
   Admin panel (owner-only): per-user limits + allowed models.
   =================================================================== */
.admin-note { display: flex; align-items: center; gap: 8px; margin: 4px 0 14px; padding: 9px 12px; border-radius: 9px; background: var(--mra-canvas); border: 1px solid var(--mra-line); color: var(--mra-fg-muted); font-size: 12.5px; }
.admin-note svg { color: var(--mra-blue); flex: 0 0 auto; }
.admin-table { border: 1px solid var(--mra-line); border-radius: 12px; overflow: hidden; background: var(--mra-surface); box-shadow: var(--mra-shadow-1); }
.admin-trow { display: grid; grid-template-columns: minmax(0, 2.4fr) 0.85fr 0.75fr 0.9fr 1.05fr 1.35fr 0.95fr 88px; align-items: center; gap: 10px; padding: 11px 16px; border-top: 1px solid var(--mra-soft-line); font-size: 13px; }
.admin-trow:not(.admin-th):not(.editing):hover { background: var(--mra-canvas); }
.admin-trow:first-child { border-top: 0; }
.admin-th { background: var(--mra-canvas); font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--mra-fg-faint); padding: 9px 16px; }
.admin-trow.editing { background: var(--mra-blue-soft); }
.admin-user { display: flex; flex-direction: row; align-items: center; gap: 10px; min-width: 0; }
.admin-uid { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.admin-user strong { color: var(--mra-ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-user em { font-style: normal; font-size: 11px; color: var(--mra-fg-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-ava { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; color: #fff; background: hsl(var(--ah, 215) 52% 46%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.admin-trow.is-disabled .admin-ava { filter: grayscale(1); }
.admin-planpill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--mra-chip, #eef1f6); color: var(--mra-fg-muted); text-transform: capitalize; }
.admin-planpill.pro { background: var(--mra-blue-soft); color: var(--mra-blue-strong); }
.admin-planpill.max { background: rgba(139,92,246,.12); color: #6d28d9; }
.admin-usage { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.admin-uline { display: grid; grid-template-columns: 20px minmax(0, 1fr) 34px; align-items: center; gap: 6px; }
.admin-uline em { font-style: normal; font-size: 10px; font-weight: 600; color: var(--mra-fg-faint); text-transform: uppercase; }
.admin-uline b { font-size: 10.5px; font-weight: 600; color: var(--mra-fg-muted); font-family: var(--mra-font-num); text-align: right; }
.admin-ubar { height: 5px; border-radius: 999px; background: var(--mra-chip, #eef1f6); overflow: hidden; }
.admin-ubar i { display: block; height: 100%; border-radius: 999px; background: var(--mra-blue, #2563eb); min-width: 2px; }
.admin-ubar i.is-warn { background: #d97706; }
.admin-ubar i.is-danger { background: #dc2626; }
.admin-lastlogin { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--mra-fg-muted); font-family: var(--mra-font-num); }
.admin-dot { width: 7px; height: 7px; border-radius: 999px; background: var(--mra-line, #d7dce3); flex: 0 0 auto; }
.admin-dot.on { background: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.15); }
.admin-hero { margin: 2px 0 16px; }
.admin-hero .obs-hero-tile { padding: 13px 16px; }
.admin-hero .obs-hero-v { font-size: 26px; }
.admin-tile-sub { font-size: 11.5px; color: var(--mra-fg-faint); margin-top: 4px; }
.admin-caps { white-space: nowrap; }
.admin-models-cell { font-size: 12.5px; color: var(--mra-fg-muted); }
.admin-manage { text-align: right; }
.admin-role { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--mra-chip, #eef1f6); color: var(--mra-fg-muted); font-size: 11.5px; font-weight: 500; }
.admin-role.owner { background: var(--mra-blue-soft); color: var(--mra-blue-strong); font-weight: 600; }
.admin-mono { font-family: var(--mra-font-num); color: var(--mra-fg-muted); font-size: 12.5px; }
.admin-customtag { font-size: 10px; font-weight: 600; color: var(--mra-orange-strong); text-transform: uppercase; }
.admin-editbtn { padding: 4px 12px !important; font-size: 12px !important; }
.admin-editor { padding: 16px 18px 18px; background: var(--mra-blue-soft); border-top: 1px dashed var(--mra-blue-line); display: flex; flex-direction: column; gap: 12px; }
.admin-esec { background: var(--mra-surface); border: 1px solid var(--mra-line); border-radius: 10px; padding: 14px 16px 15px; display: flex; flex-direction: column; gap: 12px; }
.admin-esec-title { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--mra-fg-faint); }
.admin-espacer { flex: 1; }
.admin-erow { display: flex; align-items: center; gap: 12px; }
.admin-erow > label, .admin-erow > .admin-elabel { flex: 0 0 120px; font-size: 12.5px; font-weight: 600; color: var(--mra-fg-muted); }
.admin-erow input[type=number] { width: 220px; padding: 7px 10px; border: 1px solid var(--mra-line); border-radius: 8px; font: inherit; font-size: 13px; background: var(--mra-surface); }
.admin-unit { font-size: 12px; color: var(--mra-fg-faint); }
.admin-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-chip { border: 1px solid var(--mra-line); background: var(--mra-surface); color: var(--mra-fg-muted); font: inherit; font-size: 12.5px; padding: 5px 12px; border-radius: 999px; cursor: pointer; transition: all 120ms ease; }
.admin-chip:hover { border-color: var(--mra-blue-line); }
.admin-chip.on { border-color: var(--mra-blue); background: var(--mra-blue); color: #fff; font-weight: 600; }
.admin-models { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 14px; }
.admin-modelchk { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--mra-fg-2); cursor: pointer; }
.admin-eactions { display: flex; gap: 8px; margin-top: 4px; }
@media (max-width: 1100px) {
  .admin-trow { grid-template-columns: minmax(0, 1.8fr) 0.8fr 0.7fr 1.2fr 0.9fr 76px; }
  .admin-trow > :nth-child(4), .admin-trow > :nth-child(5) { display: none; }
  .admin-models { grid-template-columns: 1fr 1fr; }
}

/* Admin: search, notices, account controls, audit trail */
.admin-searchrow { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.admin-search { flex: 0 1 360px; padding: 8px 12px; border: 1px solid var(--mra-line); border-radius: 9px; font: inherit; font-size: 13px; background: var(--mra-surface); }
.admin-search:focus { outline: none; border-color: var(--mra-blue-line); box-shadow: 0 0 0 3px var(--mra-blue-soft); }
.admin-searchcount { font-size: 12px; color: var(--mra-fg-faint); }
.admin-okline { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 8px 12px; border-radius: 9px; background: rgba(16,185,129,.08); border: 1px solid rgba(16,185,129,.3); color: #047857; font-size: 12.5px; }
.admin-dismiss { border: 0; background: transparent; color: inherit; cursor: pointer; display: inline-flex; padding: 2px; border-radius: 999px; margin-left: auto; }
.admin-dismiss:hover { background: rgba(0,0,0,.06); }
.ic-error .admin-dismiss { margin-left: 8px; }
.admin-trow.is-disabled { opacity: .55; }
.admin-disabledtag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: rgba(220,38,38,.1); color: #b91c1c; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.admin-tokrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--mra-fg-muted); }
.admin-minibtn { padding: 3px 10px !important; font-size: 11.5px !important; }
.admin-ownernote { font-style: normal; font-size: 11.5px; color: var(--mra-fg-faint); }
.admin-warnline { display: flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 8px; background: rgba(217,119,6,.08); border: 1px solid rgba(217,119,6,.3); color: #92400e; font-size: 12.5px; }
.admin-proj-more { font-size: 11.5px; color: var(--mra-fg-faint); }
.admin-audit { margin-top: 26px; }
.admin-audit-none { font-size: 12.5px; color: var(--mra-fg-faint); margin: 4px 2px; }
.admin-audit-list { border: 1px solid var(--mra-line); border-radius: 12px; overflow: hidden; background: var(--mra-surface); }
.admin-audit-row { display: grid; grid-template-columns: 80px 1.4fr 1.2fr 1.4fr 2fr; gap: 10px; align-items: center; padding: 8px 14px; border-top: 1px solid var(--mra-soft-line); font-size: 12.5px; }
.admin-audit-row:first-child { border-top: 0; }
.admin-audit-actor { color: var(--mra-ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-audit-action { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; font-family: var(--mra-font-num); background: var(--mra-blue-soft); color: var(--mra-blue-strong); white-space: nowrap; }
.admin-audit-action.bad { background: rgba(220,38,38,.1); color: #b91c1c; }
.admin-audit-action.good { background: rgba(22,163,74,.12); color: #15803d; }
.admin-audit-action.warn { background: rgba(234,88,12,.12); color: #c2410c; }
.admin-audit-action.amber { background: rgba(217,119,6,.12); color: #92400e; }
.admin-audit-target, .admin-audit-detail { color: var(--mra-fg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Admin: role management + SSO provenance + device tokens */
.admin-ssobadge { display: inline-block; padding: 1px 6px; border-radius: 4px; background: rgba(37,99,235,.1); color: var(--mra-blue-strong); font-size: 9.5px; font-weight: 700; font-style: normal; letter-spacing: .05em; }
.admin-ssobadge.lg { font-size: 10.5px; padding: 2px 8px; border-radius: 999px; }
.admin-linkbtn { border: 0; background: transparent; padding: 0; font: inherit; font-size: inherit; color: var(--mra-blue-strong); text-decoration: underline; cursor: pointer; }
.admin-toklist { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.admin-tokitem { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; }
.admin-tokitem > span:first-child { font-weight: 600; color: var(--mra-ink); }
.admin-tokitem em { font-style: normal; color: var(--mra-fg-faint); font-size: 11.5px; }

/* Admin: VM/storage inventory + deprovision checklist */
.admin-hostline { display: flex; align-items: center; gap: 7px; margin: 0 0 10px; font-size: 12.5px; color: var(--mra-fg-muted); }
.admin-vmrow { display: grid; grid-template-columns: minmax(0, 1.6fr) 1.2fr 1fr 110px; gap: 10px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--mra-soft-line); font-size: 13px; }
.admin-vmrow:first-child { border-top: 0; }
.admin-vmname { display: flex; flex-direction: column; min-width: 0; }
.admin-vmname em { font-style: normal; font-size: 11px; color: var(--mra-fg-faint); }
.admin-vmstate { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--mra-chip, #eef1f6); color: var(--mra-fg-muted); font-size: 11.5px; font-weight: 600; }
.admin-vmstate.on { background: rgba(22,163,74,.12); color: #15803d; }
.admin-reclaimed { color: #15803d; font-size: 11.5px; font-weight: 650; }
.admin-vmrow em { font-style: normal; font-size: 11px; color: var(--mra-fg-faint); }
.admin-checklist { margin-top: 12px; padding: 12px 14px; border: 1px solid rgba(217,119,6,.35); border-radius: 10px; background: rgba(217,119,6,.05); }
.admin-checklist pre { margin: 8px 0; font-size: 11.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-all; color: var(--mra-fg-2); }

/* Admin: alerts card + Observability alert banner */
.admin-alertcount { display: inline-flex; min-width: 18px; height: 18px; align-items: center; justify-content: center; padding: 0 5px; border-radius: 999px; background: #dc2626; color: #fff; font-size: 11px; font-weight: 700; }
.admin-alertactive { align-items: flex-start; }
.admin-webhook { width: min(460px, 100%); padding: 7px 10px; border: 1px solid var(--mra-line); border-radius: 8px; font: inherit; font-size: 12.5px; background: var(--mra-surface); }
.admin-erow input[data-admin-alert] { width: 140px; padding: 7px 10px; border: 1px solid var(--mra-line); border-radius: 8px; font: inherit; font-size: 13px; background: var(--mra-surface); }
.obs-alertbanner { display: flex; gap: 9px; align-items: flex-start; margin: 0 0 12px; padding: 10px 14px; border: 1px solid rgba(220,38,38,.4); border-radius: 10px; background: rgba(220,38,38,.06); color: #b91c1c; font-size: 13px; }
.obs-alertbanner svg { flex: 0 0 auto; margin-top: 2px; }

/* Observability: custom date range */
.obs-customrange { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--mra-fg-muted); }
.obs-customrange input[type=date] { padding: 5px 8px; border: 1px solid var(--mra-line); border-radius: 8px; font: inherit; font-size: 12.5px; background: var(--mra-surface); }

/* OpenCoder modal: device-token inventory */
.oc-toklist { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 10px; }
.oc-tokrow2 { display: grid; grid-template-columns: minmax(0, 1.2fr) 70px minmax(0, 1.6fr) 76px; gap: 10px; align-items: center; padding: 8px 12px; border: 1px solid var(--mra-line); border-radius: 9px; background: var(--mra-surface); font-size: 12.5px; }
.oc-toklabel { font-weight: 600; color: var(--mra-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-tokmeta { color: var(--mra-fg-faint); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-newtok { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.oc-labelinput { flex: 1; padding: 8px 11px; border: 1px solid var(--mra-line); border-radius: 9px; font: inherit; font-size: 13px; background: var(--mra-surface); }
.oc-projectpick { display: flex; align-items: center; gap: 10px; margin-top: 10px; color: var(--mra-fg-muted); font-size: 12.5px; }
.oc-projectpick > span { flex: 0 0 54px; font-weight: 600; }
.oc-projectpick select { min-width: 0; }
.oc-projectbound { display: flex; align-items: center; gap: 6px; margin: 10px 0 0; color: var(--mra-fg-muted); font-size: 12.5px; }
.oc-projectbound svg { color: var(--mra-blue); }
.oc-status { margin: 8px 0; padding: 8px 10px; border: 1px solid var(--mra-border-green, #b7dfc4); border-radius: 8px; background: var(--mra-green-soft, #eef9f2); color: var(--mra-green, #1f8a5b); font-size: 13px; }

/* Admin: company (SSO tenant) grouping + projects */
.admin-company { margin-bottom: 22px; }
.admin-company-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 2px 8px; }
.admin-co-title { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--mra-ink); }
.admin-co-title svg { color: var(--mra-blue); }
.admin-co-title strong { font-weight: 700; }
.admin-co-count { font-size: 11.5px; font-weight: 500; color: var(--mra-fg-faint); background: var(--mra-chip, #eef1f6); padding: 2px 9px; border-radius: 999px; }
.admin-conote { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; font-size: 12.5px; color: var(--mra-blue-strong); font-weight: 500; }
.admin-company .admin-editor { border: 1px solid var(--mra-blue-line); border-top: 1px solid var(--mra-blue-line); border-radius: 10px; margin-bottom: 10px; }
.admin-projects { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-proj { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--mra-fg-2); background: var(--mra-surface); border: 1px solid var(--mra-line); padding: 3px 9px; border-radius: 999px; }
.admin-proj em { font-style: normal; font-size: 10.5px; color: var(--mra-fg-faint); text-transform: uppercase; }

/* ---- Language switch (EN | RU) — theme-agnostic via currentColor -------- */
.lang-switch { display: inline-flex; align-items: stretch; border-radius: 8px; overflow: hidden; border: 1px solid color-mix(in srgb, currentColor 22%, transparent); background: color-mix(in srgb, currentColor 6%, transparent); flex: 0 0 auto; line-height: 1; }
.lang-switch button { appearance: none; border: 0; background: transparent; color: inherit; font-family: "Roboto Flex", system-ui, sans-serif; font-weight: 600; font-size: 11px; letter-spacing: .04em; padding: 0 8px; min-height: 26px; cursor: pointer; opacity: .6; transition: background .12s ease, opacity .12s ease; }
.lang-switch button + button { border-left: 1px solid color-mix(in srgb, currentColor 18%, transparent); }
.lang-switch button:hover { opacity: .92; }
.lang-switch button.active { opacity: 1; background: color-mix(in srgb, currentColor 16%, transparent); }
.lang-switch button:focus-visible { outline: 2px solid color-mix(in srgb, currentColor 45%, transparent); outline-offset: -2px; }
.login-side { position: relative; }
.lang-switch.on-login { position: absolute; top: 18px; right: 22px; z-index: 4; }
.lang-switch.on-dash { margin-right: 2px; }
.lang-switch.on-ide { align-self: center; }

/* =====================================================================
   Observability — Growth / Insights / Journey (user & chat analytics).
   Light dashboard theme only (the obs console has no dark mode).
   ===================================================================== */
.obs-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
@media (max-width: 1100px) { .obs-grid2 { grid-template-columns: 1fr; } }
.obs-gsub { font-size: 11.5px; color: #6b7280; margin-top: 3px; }
.obs-h3note { font-weight: 500; font-size: 11.5px; color: #98a0aa; margin-left: 8px; text-transform: none; letter-spacing: 0; }
/* funnel + adoption bars */
.obs-gfrow { display: grid; grid-template-columns: 172px 1fr 92px; gap: 12px; align-items: center; padding: 5px 0; }
.obs-gflabel { font-size: 12.5px; font-weight: 600; color: #5b6470; }
.obs-gftrack { height: 20px; border-radius: 5px; background: #f1f3f5; overflow: hidden; }
.obs-gftrack.subtle { height: 14px; }
.obs-gfbar { display: block; height: 100%; background: #2563eb; border-radius: 5px; position: relative; min-width: 2px; }
.obs-gfbar i { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); font-style: normal; color: #fff; font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.obs-gfconv { text-align: right; font-size: 12px; color: #111827; font-weight: 600; font-variant-numeric: tabular-nums; }
/* segments */
.obs-gsegs { display: flex; flex-wrap: wrap; gap: 8px; }
.obs-gseg { display: inline-flex; align-items: center; gap: 7px; border: 1px solid #e6eaef; border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; color: #5b6470; background: #fff; }
.obs-gseg i { width: 8px; height: 8px; border-radius: 50%; }
.obs-gseg strong { color: inherit; }
.obs-gseg.hot { border-color: #f5dca0; background: #fdf3d8; color: #b06000; }
.obs-grisk { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-top: 1px solid #eef0f4; font-size: 12.5px; cursor: pointer; }
.obs-grisk:hover { background: #f8fafc; }
.obs-followup-panel { margin-bottom: 14px; }
.obs-gdelta { margin-left: auto; color: #b06000; font-weight: 700; font-variant-numeric: tabular-nums; }
/* cohort grid */
.obs-cohort { border-collapse: separate; border-spacing: 3px; }
.obs-cohort th { font-size: 10.5px; font-weight: 700; color: #98a0aa; text-transform: uppercase; letter-spacing: .03em; padding: 2px 4px; }
.obs-cohort th.wk { text-align: left; }
.obs-cohort td { text-align: center; font-size: 11.5px; font-weight: 650; border-radius: 5px; padding: 7px 8px; min-width: 52px; font-variant-numeric: tabular-nums; }
.obs-cohort td.lbl { text-align: left; background: transparent; color: #5b6470; font-weight: 600; min-width: 86px; }
.obs-cohort td.lbl small { color: #98a0aa; }
.obs-cohort td.na { background: transparent; }
/* insights */
.obs-flag { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #eef0f4; color: #5b6470; white-space: nowrap; flex: 0 0 auto; }
.obs-flag.bad { background: #fdebe9; color: #c5392e; }
.obs-flag.warn { background: #fdf3d8; color: #b06000; }
.obs-hotrow { display: flex; gap: 10px; align-items: flex-start; padding: 9px 2px; border-top: 1px solid #eef0f4; font-size: 13px; cursor: pointer; }
.obs-hotrow:first-of-type { border-top: 0; }
.obs-hotrow:hover { background: #f8fafc; }
.obs-hottext { flex: 1; min-width: 0; color: #1f2937; }
.obs-hottext small { display: block; color: #98a0aa; font-size: 11.5px; margin-top: 2px; }
.obs-jlink { border: 0; background: transparent; color: #2563eb; font: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer; padding: 0 2px; }
.obs-jlink:hover { text-decoration: underline; }
/* journey */
.obs-jback { border: 1px solid #e6eaef; background: #fff; border-radius: 8px; padding: 5px 12px; font: inherit; font-size: 12.5px; font-weight: 600; color: #5b6470; cursor: pointer; margin-bottom: 10px; }
.obs-jback:hover { color: #111827; }
.obs-jhead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #fff; border: 1px solid #e6eaef; border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.obs-jid b { display: block; font-size: 15px; color: #111827; }
.obs-jid small { color: #98a0aa; font-size: 12px; }
.obs-jkpis { margin-left: auto; display: flex; gap: 22px; }
.obs-jk { text-align: right; }
.obs-jk .v { font-size: 17px; font-weight: 750; color: #111827; font-variant-numeric: tabular-nums; }
.obs-jk .v.bad { color: #c5392e; }
.obs-jk .l { font-size: 10px; font-weight: 700; color: #98a0aa; text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }
.obs-jgrid { grid-template-columns: 1.6fr 1fr; align-items: start; }
.obs-jday { font-size: 11px; font-weight: 800; color: #98a0aa; text-transform: uppercase; letter-spacing: .05em; margin: 14px 0 6px 2px; }
.obs-jsess { background: #fff; border: 1px solid #e6eaef; border-radius: 12px; padding: 11px 14px; margin-bottom: 8px; }
.obs-jshead { display: flex; align-items: center; gap: 9px; font-size: 12px; color: #98a0aa; margin-bottom: 4px; flex-wrap: wrap; }
.obs-jshead code { font-size: 11px; color: #1d4ed8; background: #eef3fe; border-radius: 5px; padding: 1px 6px; }
.obs-jsrc { font-size: 9.5px; font-weight: 800; letter-spacing: .03em; padding: 2px 7px; border-radius: 5px; text-transform: uppercase; background: #eef0f4; color: #5b6470; }
.obs-jsrc.guest { background: #eef3fe; color: #1d4ed8; }
.obs-jsrc.cli { background: #f1ebfd; color: #6d28d9; }
.obs-jdots { display: inline-flex; gap: 4px; margin-left: auto; }
.obs-jdots i, .obs-jdot { width: 8px; height: 8px; border-radius: 50%; background: #d6dae0; display: inline-block; }
.obs-jdot.ok, .obs-jdots i.ok { background: #16a34a; }
.obs-jdot.err, .obs-jdots i.err { background: #dc2626; }
.obs-jdot.stop, .obs-jdots i.stop { background: #f9ab00; }
.obs-jturn { display: flex; gap: 9px; align-items: flex-start; padding: 7px 0; border-top: 1px solid #eef0f4; font-size: 12.5px; }
.obs-jturn .obs-jdot { margin-top: 4px; flex: 0 0 auto; }
.obs-jttext { flex: 1; min-width: 0; color: #1f2937; overflow-wrap: anywhere; }
.obs-jttext small { display: block; color: #98a0aa; font-size: 11px; margin-top: 1px; }
.obs-jsig { display: flex; gap: 9px; align-items: flex-start; padding: 7px 0; border-top: 1px solid #eef0f4; font-size: 12.5px; }
.obs-jsig:first-of-type { border-top: 0; }
.obs-joutreach { margin-top: 12px; padding: 11px 12px; border: 1px solid rgba(37,99,235,.24); border-radius: 10px; background: rgba(37,99,235,.05); color: var(--mra-fg-2); font-size: 12.5px; }
.obs-joutreach > strong { color: var(--mra-ink); }
.obs-joutreach p { margin: 6px 0 10px; line-height: 1.5; }
.obs-joutreach-actions { display: flex; flex-wrap: wrap; gap: 7px; }
@media (max-width: 1100px) { .obs-jgrid { grid-template-columns: 1fr; } .obs-jkpis { margin-left: 0; width: 100%; justify-content: space-between; } }

/* OpenCoder modal: Windows no-command-line install steps + PS advanced toggle */
.oc-steps { margin: 10px 0 12px; padding-left: 22px; display: grid; gap: 6px; }
.oc-steps li { font-size: 13.5px; color: var(--mra-text, #1f2430); }
.oc-steps code { background: rgba(31, 36, 48, 0.07); border-radius: 5px; padding: 1px 6px; font-size: 12.5px; }
.oc-psadv { background: none; border: none; padding: 4px 0; margin: 2px 0 0; color: var(--mra-primary, #4653e8); font-size: 12.5px; cursor: pointer; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.oc-psadv:hover { opacity: 0.8; }

/* ---------- Team management view -------------------------------------- */
/* Chrome-style sub-tabs: rounded tabs that merge into the content panel,
   with outward bottom curls on the active tab (radial-gradient corners). */
.team-tabshell { margin-top: 14px; }
.team-tabs { display: flex; align-items: flex-end; gap: 6px; padding: 0 14px; position: relative; z-index: 2; margin-bottom: -1px; overflow-x: auto; scrollbar-width: none; }
.team-tabs::-webkit-scrollbar { display: none; }
.team-tabs button { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 9px 20px 10px; font: inherit; font-size: 13px; font-weight: 600; color: var(--mra-fg-muted, #6b7280); background: var(--mra-bg-subtle, #eef1f4); border: 1px solid var(--mra-border, #e5e7eb); border-bottom: none; border-radius: 11px 11px 0 0; cursor: pointer; white-space: nowrap; transition: background .12s ease, color .12s ease; }
.team-tabs button:hover { background: #f6f8fa; color: var(--mra-fg, #111827); }
.team-tabs button.active { background: #fff; color: var(--mra-fg, #111827); padding-bottom: 11px; z-index: 3; }
.team-tabs button.active::before,
.team-tabs button.active::after { content: ""; position: absolute; bottom: 0; width: 11px; height: 11px; pointer-events: none; }
.team-tabs button.active::before { left: -11px; background: radial-gradient(circle at 0 0, transparent 11px, #fff 11.5px); }
.team-tabs button.active::after { right: -11px; background: radial-gradient(circle at 100% 0, transparent 11px, #fff 11.5px); }
.team-tabs .obs-tabn { margin-left: 2px; }
.team-tabs button.active .obs-tabn { background: var(--mra-blue, #2563eb); color: #fff; }
.team-panel { position: relative; z-index: 1; background: #fff; border: 1px solid var(--mra-border, #e5e7eb); border-radius: 14px; padding: 18px; }

/* Members roster */
.team-listhead { display: flex; align-items: center; gap: 12px; }
.team-listhead h3 { margin: 0; font-size: 13px; font-weight: 700; color: var(--mra-fg, #111827); }
.team-gennote { font-size: 12px; color: var(--mra-fg-muted, #6b7280); display: inline-flex; gap: 6px; align-items: center; }

/* People → Safety tab. Everything else on the tab is the People page's own
   chrome (stat rail, six-column row, segfilter, drawer); these are only the
   pieces that tab adds: the control row, the paging foot, the message list in
   the review drawer and the rule cards in the automation drawer. */
.sf-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 12px; }
.sf-controls .obs-convsearch { flex: 1 1 240px; }
.sf-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 12px 2px 0; color: var(--mra-fg-muted, #5b6470); font-size: 11.5px; }
.sf-foot b { color: var(--mra-fg, #18202f); font-variant-numeric: tabular-nums; }
.sf-foot .sf-more { margin-left: auto; }
.sf-truncated { margin: 0 0 12px; }
.sf-msg { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 4px 12px; padding: 10px 0; border-top: 1px solid var(--mra-border-soft, #eef1f5); }
.sf-msg:first-of-type { border-top: 0; padding-top: 2px; }
.sf-when { padding-top: 2px; color: var(--mra-fg-faint, #8a94a6); font-size: 11px; font-variant-numeric: tabular-nums; }
.sf-body { min-width: 0; }
.sf-q { color: var(--mra-fg, #18202f); font-size: 12.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
/* A clipped message says so inline rather than trailing off silently. */
.sf-cut { color: #8a94a6; font-style: italic; }

.sf-q.none { color: var(--mra-fg-faint, #8a94a6); font-style: italic; }
.sf-why { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; color: var(--mra-fg-muted, #687386); font-size: 11px; }
.sf-rule { padding: 12px 0; border-top: 1px solid var(--mra-border-soft, #eef1f5); }
.sf-rule:first-of-type { border-top: 0; padding-top: 2px; }
.sf-rule.off { opacity: .62; }
.sf-rule-head { display: flex; align-items: center; gap: 10px; }
.sf-rule-head strong { flex: 1; min-width: 0; color: var(--mra-fg, #18202f); font-size: 13px; font-weight: 700; }
.sf-rule-when { margin: 6px 0 0; color: var(--mra-fg-2, #46536b); font-size: 12px; line-height: 1.5; }
.sf-rule-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; color: var(--mra-fg-faint, #8a94a6); font-size: 11px; }
.sf-rule-foot .grow { flex: 1; }
.sf-guards { margin: 0; padding-left: 18px; color: var(--mra-fg-2, #46536b); font-size: 11.5px; line-height: 1.6; }
.sf-expected { margin-left: 6px; }
.team-list { display: grid; gap: 10px; margin-top: 12px; }
.team-row { border: 1px solid var(--mra-border, #e5e7eb); border-radius: 12px; background: #fff; }
.team-row.open { box-shadow: 0 4px 14px rgba(16, 24, 40, .06); }
.team-row.off { opacity: .6; }
.team-row-main { display: grid; grid-template-columns: 44px minmax(180px, 250px) 1fr 128px 104px 118px 128px 22px; align-items: center; gap: 14px; width: 100%; padding: 12px 14px; background: none; border: 0; font: inherit; text-align: left; cursor: pointer; border-radius: 12px; }
.team-row-main:hover { background: #fafbfc; }
.team-avatar { position: relative; width: 38px; height: 38px; border-radius: 50%; background: var(--mra-bg-subtle, #eef1f4); color: var(--mra-fg, #111827); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.team-avatar .team-dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid #fff; background: #9ca3af; }
.team-avatar.live .team-dot { background: #16a34a; }
.team-avatar.warm .team-dot { background: #f59e0b; }
.team-avatar.off .team-dot { background: #d1d5db; }
.team-id { display: grid; gap: 2px; min-width: 0; }
.team-name { font-weight: 650; font-size: 13.5px; color: var(--mra-fg, #111827); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.team-mail { font-size: 12px; color: var(--mra-fg-muted, #6b7280); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-role { padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; background: #e0e7ff; color: #3730a3; }
.team-role.owner { background: #fef3c7; color: #92400e; }
.team-role.disabled { background: #fee2e2; color: #b91c1c; text-transform: none; }
/* Organisation-role chips (owner/admin/member/viewer) — org owner shares the
   amber "runs this place" tone; the ladder fades with privilege. */
.team-role.org.owner { background: #fef3c7; color: #92400e; }
.team-role.org.admin { background: #e0e7ff; color: #3730a3; }
.team-role.org.member { background: #e2e8f0; color: #334155; }
.team-role.org.viewer { background: #f1f5f9; color: #64748b; }
/* Read-only roster rows (org members/viewers): fewer columns, not clickable. */
.team-row-main.roster { grid-template-columns: 44px minmax(180px, 1fr) 130px 148px; cursor: default; }
.team-row-main.roster:hover { background: none; }
/* Org-management strip inside the expanded member detail (leads only). */
.team-manage { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 2px 2px; margin-top: 10px; border-top: 1px dashed var(--mra-line, #e5e7eb); }
.team-manage > label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--mra-fg-faint, #6b7280); }
.team-manage-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.team-manage em { font-size: 11px; font-style: normal; color: var(--mra-fg-faint, #6b7280); }
.ide-btn-lite.danger { color: #b91c1c; border-color: #fecaca; }
.ide-btn-lite.danger:hover { background: #fef2f2; }
/* Per-project permissions grid (write-through to MRA RoleBindings). */
.team-perms { display: grid; gap: 8px; padding: 10px 2px 2px; margin-top: 10px; border-top: 1px dashed var(--mra-line, #e5e7eb); }
.team-perms > label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--mra-fg-faint, #6b7280); }
.team-perms > em { font-size: 11px; font-style: normal; color: var(--mra-fg-faint, #6b7280); }
.team-permrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.team-permproj { font-size: 12.5px; font-weight: 600; min-width: 160px; color: var(--mra-fg, #111827); }
.team-permnote { font-size: 11px; font-style: normal; color: var(--mra-fg-faint, #6b7280); }
/* Scope chips beside the People title: exactly which projects this view covers. */
.team-scope-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.team-scope-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--mra-fg-faint, #6b7280); }
.team-scope-chip { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--mra-line, #e5e7eb); background: var(--mra-bg-subtle, #f4f6f8); color: var(--mra-fg, #111827); }
/* Invite panel — creates the member in MRA + shows the activation link. */
.team-invite { margin-top: 12px; padding: 14px; border: 1px solid var(--mra-line, #e5e7eb); border-radius: 12px; background: var(--mra-surface, #fff); display: grid; gap: 10px; }
.team-invite-grid { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.team-invite-grid label { display: grid; gap: 4px; font-size: 11px; font-weight: 600; color: var(--mra-fg-faint, #6b7280); }
.team-invite-grid input, .team-invite-grid select { font: inherit; font-size: 13px; padding: 7px 10px; border: 1px solid var(--mra-line, #e5e7eb); border-radius: 8px; min-width: 180px; }
.team-invite-result { display: grid; gap: 6px; font-size: 12.5px; padding: 10px; border-radius: 10px; background: var(--mra-bg-subtle, #f4f6f8); }
.team-invite-result code { font-size: 11.5px; word-break: break-all; padding: 6px 8px; background: #fff; border: 1px solid var(--mra-line, #e5e7eb); border-radius: 6px; }
.team-invite-result button { justify-self: start; }
/* The activation link is the deliverable: a real anchor, fully visible, wrapping
   rather than truncating — a lead must be able to read and verify the host. */
.team-invite-link { display: inline-flex; align-items: flex-start; gap: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; line-height: 1.5; word-break: break-all; padding: 7px 9px; background: #fff; border: 1px solid var(--mra-line, #e5e7eb); border-radius: 6px; color: var(--mra-blue, #2563eb); text-decoration: none; }
.team-invite-link:hover { border-color: var(--mra-blue, #2563eb); text-decoration: underline; }
.team-invite-link svg { flex: none; margin-top: 3px; }
.team-invite-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.team-invite-result .team-invite-actions button { justify-self: unset; }
.team-invite-note { display: flex; align-items: flex-start; gap: 6px; font-size: 11.5px; line-height: 1.5; color: var(--mra-fg-muted, #6b7280); }
.team-invite-note svg { flex: none; margin-top: 3px; }
.team-invite-warn { display: flex; align-items: flex-start; gap: 6px; font-size: 11.5px; line-height: 1.5; color: #92400e; }
.team-invite-warn svg { flex: none; margin-top: 3px; }
/* Admin: per-company seat pools (paid-plan seats the org owns). */
.admin-seats { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 8px 14px; margin: 0 0 8px; border: 1px dashed var(--mra-line, #e5e7eb); border-radius: 10px; background: var(--mra-bg-subtle, #f8fafc); }
.admin-seats-title { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--mra-fg-faint, #6b7280); }
.admin-seat { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--mra-fg-muted, #6b7280); }
.admin-seat input { width: 64px; font: inherit; font-size: 13px; padding: 4px 8px; border: 1px solid var(--mra-line, #e5e7eb); border-radius: 7px; text-align: center; }
.admin-seat em { font-size: 11px; font-style: normal; color: var(--mra-fg-faint, #9ca3af); }
.team-plan { padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 600; background: var(--mra-bg-subtle, #eef1f4); color: var(--mra-fg-muted, #6b7280); }
.team-seg { padding: 1px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700; }
.team-seg.power { background: #dcfce7; color: #166534; }
.team-seg.new { background: #dbeafe; color: #1d4ed8; }
.team-seg.steady { background: #f1f5f9; color: #475569; }
.team-seg.atrisk { background: #fef3c7; color: #92400e; }
.team-seg.dormant { background: #f3f4f6; color: #6b7280; }
.team-cell.num { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.team-cell.num b { font-size: 13.5px; color: var(--mra-fg, #111827); font-variant-numeric: tabular-nums; font-weight: 700; }
.team-cell.num small { font-size: 11px; color: var(--mra-fg-muted, #6b7280); white-space: nowrap; }
.team-last { color: var(--mra-fg, #111827); }
.team-last.none { color: var(--mra-fg-muted, #6b7280); font-weight: 500; }
.team-spark { display: flex; align-items: flex-end; gap: 2px; height: 34px; width: 120px; }
.team-spark i { flex: 1; background: var(--mra-blue, #2563eb); border-radius: 2px 2px 0 0; min-height: 2px; opacity: .85; }
.team-spark i.zero { background: #e5e7eb; }
.team-spark.hours { align-items: center; height: 14px; }
.team-spark.hours i { height: 10px; border-radius: 2px; }
.team-spark.hours.wide { width: 100%; max-width: 460px; }
.team-spark.hours.tall i { height: 18px; }

/* AI "worked on today" cell */
.team-ai { display: grid; gap: 4px; min-width: 0; }
.team-ai-head { display: flex; gap: 8px; align-items: center; min-width: 0; }
.team-ai-badge { display: inline-flex; gap: 4px; align-items: center; background: #f5f3ff; color: #6d28d9; border-radius: 6px; padding: 2px 7px; font-size: 10.5px; font-weight: 700; flex: none; }
.team-ai-focus { font-size: 12.5px; font-weight: 600; color: var(--mra-fg, #111827); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-ai-tasks { margin: 0; padding-left: 18px; display: grid; gap: 2px; }
.team-ai-tasks li { font-size: 12.3px; color: var(--mra-fg-muted, #6b7280); line-height: 1.45; }
.team-ai-tasks li strong { color: var(--mra-fg, #111827); font-weight: 600; }
.team-ai-loading, .team-ai-none { font-size: 12.5px; color: var(--mra-fg-muted, #6b7280); display: inline-flex; gap: 7px; align-items: center; }
.team-ai-err { color: #b45309; }

/* Expanded member detail */
.team-detail { border-top: 1px solid var(--mra-border, #e5e7eb); padding: 14px 16px; }
.team-dgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 16px; }
.team-dcol h4 { margin: 0 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--mra-fg-muted, #6b7280); }
.team-dcol .team-h4gap { margin-top: 12px; }
.team-drow { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--mra-fg-muted, #6b7280); padding: 2px 0; }
.team-drow span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-drow b { color: var(--mra-fg, #111827); font-variant-numeric: tabular-nums; flex: none; }
.team-qbar { display: block; height: 6px; border-radius: 999px; background: #eef1f4; overflow: hidden; margin: 2px 0 8px; }
.team-qbar i { display: block; height: 100%; background: var(--mra-blue, #2563eb); border-radius: 999px; }
.team-qbar i.warn { background: #d97706; }
.team-dactions { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.team-dmeta { font-size: 12px; color: var(--mra-fg-muted, #6b7280); }
.team-dmeta code { background: rgba(31, 36, 48, .06); border-radius: 5px; padding: 1px 6px; font-size: 11.5px; }

/* Usage + Insights cards */
.team-usagegrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.team-card { border: 1px solid var(--mra-border, #e5e7eb); border-radius: 12px; padding: 14px 16px; background: #fff; }
.team-card.wide { grid-column: 1 / -1; }
.team-card h3 { margin: 0 0 10px; font-size: 13px; font-weight: 700; color: var(--mra-fg, #111827); }
.team-card h3 small { font-weight: 500; color: var(--mra-fg-muted, #6b7280); }
.team-lb { display: grid; gap: 2px; }
.team-lbrow { display: grid; grid-template-columns: 22px minmax(140px, 210px) 1fr 120px 96px minmax(150px, 210px); gap: 10px; align-items: center; padding: 5px 0; font-size: 12.5px; }
.team-lbprompts { font-variant-numeric: tabular-nums; color: var(--mra-fg-muted, #6b7280); white-space: nowrap; }
.team-lbprompts b { color: var(--mra-fg, #111827); }
.team-lbrank { color: var(--mra-fg-muted, #6b7280); font-weight: 700; font-variant-numeric: tabular-nums; }
.team-lbname { color: var(--mra-fg, #111827); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-lbbar { height: 8px; border-radius: 999px; background: #eef1f4; overflow: hidden; }
.team-lbbar i { display: block; height: 100%; background: var(--mra-blue, #2563eb); border-radius: 999px; }
.team-lbbar i.warn { background: #d97706; }
.team-lbbar i.ok { background: #16a34a; }
.team-lbtok { font-variant-numeric: tabular-nums; color: var(--mra-fg, #111827); white-space: nowrap; }
.team-lbsub { color: var(--mra-fg-muted, #6b7280); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-mixrow { display: grid; grid-template-columns: minmax(130px, 1fr) 1fr 64px; gap: 10px; align-items: center; font-size: 12.5px; padding: 3px 0; }
.team-mixrow b { text-align: right; font-variant-numeric: tabular-nums; color: var(--mra-fg, #111827); }
.team-mixname { color: var(--mra-fg-muted, #6b7280); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-attn { grid-column: 2 / -1; justify-self: end; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.team-attn.err { background: #fee2e2; color: #b91c1c; }
.team-attn.warn { background: #fef3c7; color: #92400e; }
.team-segrow { display: flex; gap: 10px; align-items: center; padding: 6px 0; font-size: 12.5px; }
.team-segn { font-weight: 700; color: var(--mra-fg, #111827); font-variant-numeric: tabular-nums; }
.team-segwho { color: var(--mra-fg-muted, #6b7280); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-hint { font-size: 12px; color: var(--mra-fg-muted, #6b7280); margin: 8px 0 0; }

@media (max-width: 1280px) {
  .team-row-main { grid-template-columns: 44px minmax(150px, 220px) 1fr 120px 22px; }
  .team-cell.spark, .team-row-main .team-cell.num:not(.last) { display: none; }
  .team-lbrow { grid-template-columns: 22px minmax(120px, 170px) 1fr 110px 90px; }
  .team-lbsub { display: none; }
  .team-usagegrid { grid-template-columns: 1fr; }
}

/* Team usage: chart split toggle + model-segmented leaderboard bars */
.team-cardhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.team-cardhead h3 { margin: 0; }
.team-split { display: inline-flex; gap: 2px; background: var(--mra-bg-subtle, #f1f3f5); border: 1px solid var(--mra-border, #e5e7eb); border-radius: 8px; padding: 3px; }
.team-split button { border: 0; background: transparent; padding: 4px 12px; border-radius: 6px; font: inherit; font-size: 12px; font-weight: 600; color: var(--mra-fg-muted, #6b7280); cursor: pointer; }
.team-split button.active { background: #fff; color: var(--mra-fg, #111827); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.team-lbbar.split { display: block; background: #eef1f4; }
.team-lbfill { display: flex; height: 100%; border-radius: 999px; overflow: hidden; }
.team-lbfill i { display: block; height: 100%; }

/* Team: organisation filter stickers (multi-tenant admins) */
.team-orgfilters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.team-orgchip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--mra-fg-muted, #6b7280); background: #fff; border: 1px solid var(--mra-border, #e5e7eb); border-radius: 999px; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, color .12s ease; }
.team-orgchip:hover { transform: translateY(-1px) rotate(-.5deg); box-shadow: 0 3px 8px rgba(0, 0, 0, .1); border-color: var(--mra-blue-line, #b9c0ff); color: var(--mra-fg, #111827); }
.team-orgchip.on { background: var(--mra-blue, #5f65ff); border-color: var(--mra-blue, #5f65ff); color: #fff; box-shadow: 0 3px 8px rgba(95, 101, 255, .35); }
.team-orgchip b { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--mra-bg-subtle, #f1f3f5); color: var(--mra-fg-muted, #6b7280); font-variant-numeric: tabular-nums; }
.team-orgchip.on b { background: rgba(255, 255, 255, .22); color: #fff; }
.team-orgchip.on .team-orgdot { background: #fff !important; }
.team-orgdot { width: 9px; height: 9px; border-radius: 999px; flex: none; }

@media (max-width: 700px) {
  .oc-tokrow2 { grid-template-columns: minmax(0, 1fr) auto; }
  .oc-tokmeta { grid-column: 1 / -1; white-space: normal; }
  .oc-newtok { align-items: stretch; flex-direction: column; }
  .oc-newtok .btn { width: 100%; justify-content: center; }
  .oc-projectpick { align-items: stretch; flex-direction: column; gap: 5px; }
  .oc-projectpick > span { flex-basis: auto; }

  .admin-erow { align-items: stretch; flex-wrap: wrap; }
  .admin-erow > label, .admin-erow > .admin-elabel { flex: 1 0 100%; }
  .admin-erow input[type=number] { width: min(100%, 320px); }
  .admin-table { overflow-x: auto; }
  .admin-trow { min-width: 720px; }

  .team-list { overflow-x: auto; }
  .team-row { min-width: 680px; }
  .team-invite-grid { grid-template-columns: 1fr; }
}

/* =====================================================================
   Management shell rework — one stable navigation rail, quieter account
   controls, compact operational summaries, and task-oriented page cards.
   This final layer intentionally wins over the repository's older dashboard
   generations while their markup is gradually retired.
   ===================================================================== */
.project-screen {
  height: 100dvh;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}
.dash-shell-head {
  position: relative;
  z-index: 50;
  min-width: 0;
  background: var(--mra-surface, #fff);
  box-shadow: 0 1px 0 var(--mra-line, #e1e5eb);
}
.dash-shell-head .utility-bar {
  min-height: 58px;
  padding-inline: 28px;
  border-bottom: 0;
}
.projects-scroll {
  height: auto;
  min-height: 0;
  overflow-y: auto;
}

/* The dashboard destination bar now belongs to the shell instead of every
   individual page header. It stays one line and scrolls on narrow screens. */
.dash-shell-head > .dash-tabs {
  width: 100%;
  max-width: 100vw;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  border: 0;
  border-top: 1px solid var(--mra-soft-line, #eef0f4);
  border-radius: 0;
  padding: 0 max(14px, calc((100vw - 1120px) / 2 + 28px));
  background: var(--mra-surface, #fff);
}
.dash-shell-head > .dash-tabs::-webkit-scrollbar { display: none; }
.dash-shell-head > .dash-tabs button {
  position: relative;
  flex: 0 0 auto;
  min-height: 43px;
  padding: 0 12px;
  border-radius: 0;
  color: var(--mra-fg-muted, #5d6678);
  white-space: nowrap;
}
.dash-shell-head > .dash-tabs button::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 0;
  left: 12px;
  height: 2px;
  border-radius: 999px 999px 0 0;
  background: transparent;
}
.dash-shell-head > .dash-tabs button:hover {
  color: var(--mra-ink, #151a24);
  background: var(--mra-canvas, #f7f9fc);
}
.dash-shell-head > .dash-tabs button.active {
  color: var(--mra-blue-strong, #1d4ed8);
  background: transparent;
  font-weight: 650;
}
.dash-shell-head > .dash-tabs button.active::after { background: var(--mra-blue, #2563eb); }

/* Quiet, readable account status: plan + remaining credits + one risk meter. */
.ub-gauge {
  height: 36px;
  gap: 9px;
  padding: 0 11px;
  border-color: var(--mra-soft-line, #eef0f4);
  border-radius: 10px;
  background: var(--mra-canvas, #f7f9fc);
}
.ub-gauge .ubg-copy { display: grid; gap: 1px; text-align: left; line-height: 1.05; }
.ub-gauge .ubg-copy strong { color: var(--mra-ink, #151a24); font-size: 11.5px; font-weight: 700; }
.ub-gauge .ubg-copy small { color: var(--mra-fg-muted, #5d6678); font-size: 10px; font-weight: 550; }
.ub-gauge .ubg-meter { width: 40px; height: 5px; overflow: hidden; border-radius: 999px; background: var(--mra-line, #e1e5eb); }
.ub-gauge .ubg-meter i { display: block; min-width: 2px; height: 100%; border-radius: inherit; background: var(--mra-blue, #2563eb); }
.ub-gauge.is-danger .ubg-meter i { background: var(--mra-red, #c5392e); }

/* Page titles are now only titles and local actions; navigation no longer
   competes with them for the same row. */
.projects-head {
  min-width: 0;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 2px;
}
.projects-head h1 { font-size: clamp(28px, 3vw, 34px); letter-spacing: -.025em; }
.projects-head p { max-width: 64ch; margin-top: 8px; color: var(--mra-fg-muted, #5d6678); }
.projects-head .head-actions { min-width: 0; flex: 0 0 auto; gap: 8px; }
.repos-view,
.activity-view,
.cicd-view { width: 100%; }

/* Shared compact stat rail for people and operations. */
.dash-stat-rail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
  margin: 0 0 16px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--mra-line, #e1e5eb);
  border-radius: 14px;
  background: var(--mra-surface, #fff);
  box-shadow: var(--mra-shadow-1);
}
.dash-stat {
  min-width: 0;
  padding: 13px 16px 14px;
  border-left: 1px solid var(--mra-soft-line, #eef0f4);
}
.dash-stat:first-child { border-left: 0; }
.dash-stat dt {
  color: var(--mra-fg-faint, #8b94a3);
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.dash-stat dd {
  margin: 6px 0 0;
  color: var(--mra-ink, #151a24);
  font-family: var(--mra-font-num);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.dash-stat small { display: block; margin-top: 5px; color: var(--mra-fg-faint, #8b94a3); font-size: 10.5px; line-height: 1.35; }
.dash-stat.good dd { color: var(--mra-green, #1f8a5b); }
.dash-stat-value { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dash-stat-value > span { font-size: inherit; }

/* Usage now answers the primary question first: which limit is nearest? */
.usage-grid { gap: 14px; margin-top: 0; }
.usage-overview {
  display: grid;
  grid-template-columns: minmax(220px, .78fr) minmax(360px, 1.35fr);
  gap: 0;
  padding: 0;
  overflow: hidden;
}
.usage-plan-summary {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding: 22px 24px;
  border-right: 1px solid var(--mra-line, #e1e5eb);
  background: linear-gradient(145deg, #f8faff, #fff 65%);
}
.usage-kicker { color: var(--mra-blue-strong, #1d4ed8); font-size: 10.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.usage-plan-heading { display: flex; align-items: baseline; gap: 9px; margin-top: 7px; }
.usage-plan-heading strong { color: var(--mra-ink, #151a24); font-size: 20px; text-transform: capitalize; }
.usage-plan-heading span { color: var(--mra-fg-faint, #8b94a3); font-size: 11px; }
.usage-credit { display: flex; align-items: baseline; gap: 8px; margin-top: 18px; }
.usage-credit strong { color: var(--mra-ink, #151a24); font-family: var(--mra-font-num); font-size: 36px; font-weight: 720; letter-spacing: -.035em; line-height: 1; }
.usage-credit span { color: var(--mra-fg-muted, #5d6678); font-size: 12px; font-weight: 600; }
.usage-plan-facts { display: flex; flex-wrap: wrap; gap: 7px 12px; margin-top: 15px; color: var(--mra-fg-muted, #5d6678); font-size: 11.5px; }
.usage-plan-facts span { display: inline-flex; align-items: center; gap: 5px; }
.usage-plan-facts svg { color: var(--mra-fg-faint, #8b94a3); }
.usage-plan-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 20px; }
.usage-limit-list { display: grid; align-content: center; gap: 20px; padding: 22px 24px; }
.usage-limit { display: grid; gap: 9px; }
.usage-limit-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.usage-limit-head > div { display: grid; gap: 2px; }
.usage-limit-head strong { color: var(--mra-ink, #151a24); font-size: 13px; font-weight: 700; }
.usage-limit-head span { color: var(--mra-fg-faint, #8b94a3); font-size: 11px; }
.usage-limit-head b { color: var(--mra-ink, #151a24); font-family: var(--mra-font-num); font-size: 20px; font-weight: 720; }
.usage-limit .usage-bar { flex: none; width: 100%; height: 9px; background: #e9edf3; }
.usage-limit-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--mra-fg-muted, #5d6678); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.usage-grid > .usage-card:not(.usage-overview) { min-height: 160px; }
.usage-test { min-height: 0 !important; }

/* People: compact summary, useful first-run note, and quiet local tabs. */
.team-stat-rail { margin-top: 2px; margin-bottom: 10px; }
.team-zero-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 9px 12px;
  border: 1px solid #dbe5fb;
  border-radius: 10px;
  color: #49617d;
  background: #f5f8ff;
  font-size: 12px;
}
.team-tabshell {
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--mra-line, #e1e5eb);
  border-radius: 14px;
  background: var(--mra-surface, #fff);
  box-shadow: var(--mra-shadow-1);
}
.team-tabs {
  align-items: stretch;
  gap: 18px;
  margin: 0;
  padding: 0 18px;
  border-bottom: 1px solid var(--mra-line, #e1e5eb);
  background: var(--mra-surface, #fff);
}
.team-tabs button,
.team-tabs button.active {
  min-height: 43px;
  padding: 0 2px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--mra-fg-muted, #5d6678);
  background: transparent;
}
.team-tabs button:hover { color: var(--mra-ink, #151a24); background: transparent; }
.team-tabs button.active { border-bottom-color: var(--mra-blue, #2563eb); color: var(--mra-blue-strong, #1d4ed8); }
.team-tabs button.active::before,
.team-tabs button.active::after { content: none; }
.team-panel { border: 0; border-radius: 0; padding: 16px 18px 18px; }
.team-row { box-shadow: none; }

/* Admin: group every task as a real card and keep the user table visible. */
.admin-hero { margin: 2px 0 14px; }
.admin-view .admin-company {
  margin-bottom: 14px;
  padding: 15px 16px 16px;
  border: 1px solid var(--mra-line, #e1e5eb);
  border-radius: 14px;
  background: var(--mra-surface, #fff);
  box-shadow: var(--mra-shadow-1);
}
.admin-company-head { margin: 0 0 12px; }
.admin-company .admin-seats { margin-bottom: 10px; }
.admin-company .admin-table { margin-inline: -1px; }
.admin-infra .admin-company-head,
.admin-alerts .admin-company-head,
.admin-audit .admin-company-head { margin-bottom: 0; }
.admin-infra:has(.admin-audit-list) .admin-company-head,
.admin-alerts:has(.admin-esec) .admin-company-head,
.admin-audit:has(.admin-audit-list) .admin-company-head { margin-bottom: 12px; }
.admin-audit { margin-top: 0; }
.admin-searchrow { margin: 0 0 14px; }
.admin-search { flex-basis: 420px; min-height: 40px; }

@media (max-width: 1120px) {
  .dash-shell-head .utility-bar { padding-inline: 18px; }
  .utility-bar .tenant-chip { display: none; }
  .projects-wrap { padding: 28px 20px 52px; }
  .dash-stat { padding-inline: 13px; }
}

@media (max-width: 1100px) {
  /* Keep the trust state in the IDE header, but move detailed runtime facts to
     the welcome/status surfaces so Preview, Graph, Assistant, and Deploy fit. */
  .ide-top .runtime-cluster .sb-facts { display: none; }
}

@media (max-width: 900px) {
  .projects-head { flex-direction: row; align-items: flex-start; }
  .usage-grid { grid-template-columns: 1fr; }
  .usage-card.span2 { grid-column: 1; }
  .usage-overview { grid-template-columns: minmax(205px, .72fr) minmax(330px, 1.28fr); }
  .admin-hero { grid-template-columns: repeat(5, minmax(112px, 1fr)); overflow-x: auto; }
}

@media (max-width: 760px) {
  .dash-shell-head > .dash-tabs { gap: 0; padding-inline: 8px; }
  .dash-shell-head > .dash-tabs button { padding-inline: 8px; font-size: 12px; }
  .dash-shell-head > .dash-tabs button svg { display: none; }
  .dash-shell-head .utility-bar {
    min-height: 56px;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
  }
  .utility-bar .ub-right {
    width: auto;
    min-width: 0;
    margin-left: auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 6px;
  }
  .utility-bar .cli-btn { flex: 0 0 auto; width: auto; }
  .projects-wrap { padding: 22px 14px 42px; }
  .projects-head { flex-direction: column; gap: 14px; }
  .projects-head .head-actions { width: 100%; }
  .projects-head .head-actions .btn { width: auto; flex: 1 1 auto; }
  .usage-overview { grid-template-columns: 1fr; }
  .usage-plan-summary { border-right: 0; border-bottom: 1px solid var(--mra-line, #e1e5eb); }
  .dash-stat-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-stat { border-top: 1px solid var(--mra-soft-line, #eef0f4); }
  .dash-stat:nth-child(-n + 2) { border-top: 0; }
  .dash-stat:nth-child(odd) { border-left: 0; }
  .team-invite-grid { display: grid; grid-template-columns: 1fr; }
  .team-invite-grid label,
  .team-invite-grid input,
  .team-invite-grid select { width: 100%; min-width: 0; }
}

@media (max-width: 560px) {
  .eb-lockup .text span,
  .lang-switch.on-dash { display: none; }
  .ub-gauge .ubg-meter { display: none; }
  /* Keep the compact CLI action recognisable. Making the button text
     transparent also made currentColor icons disappear in some browsers. */
  .utility-bar .cli-btn { width: 36px; min-width: 36px; padding-inline: 0; overflow: hidden; color: var(--mra-ink, #151a24); font-size: 0; gap: 0; }
  .utility-bar .cli-btn svg { display: block; color: inherit; }
  .usage-limit-meta { align-items: flex-start; flex-direction: column; gap: 3px; }
  .usage-plan-actions { width: 100%; }
  .usage-plan-actions .btn { flex: 1 1 auto; }
}

/* ── Abuse watch (Observability → Health → Abuse) ─────────────────────────── */
.aw-detect { display: grid; grid-template-columns: 1.15fr 1fr; gap: 12px; margin-bottom: 14px; }
.aw-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.aw-grid2 { display: grid; grid-template-columns: 1.25fr 1fr; gap: 12px; }
@media (max-width: 1100px) { .aw-detect, .aw-charts, .aw-grid2 { grid-template-columns: 1fr; } }
.aw-rulerow { display: grid; grid-template-columns: 14px 1fr auto auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid #eef0f4; }
.aw-rulerow:last-of-type { border-bottom: none; }
.aw-rulename { font-weight: 700; font-size: 12.5px; color: #18202f; }
.aw-rulepred { color: #98a0aa; font-size: 11px; }
.aw-thr { font-size: 10.5px; color: #5b6b81; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 4px; padding: 1px 7px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.aw-rulest { font-size: 11px; font-weight: 700; white-space: nowrap; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.aw-rulest.bad { color: #c5392e; } .aw-rulest.ok { color: #178a50; }
.aw-finding { border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; background: #fbfcfe; }
.aw-finding.open { border-color: #f0b8b2; box-shadow: inset 3px 0 0 #c5392e; background: #fffbfa; }
.aw-fh { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.aw-ft { font-weight: 700; font-size: 12.5px; color: #18202f; }
.aw-fw { color: #98a0aa; font-size: 10.5px; white-space: nowrap; }
.aw-fev { font-size: 11.5px; color: #64748b; margin-bottom: 7px; }
.aw-fev b { color: #0f172a; }
.aw-facts { display: flex; gap: 12px; flex-wrap: wrap; }
.aw-faudit { font-size: 10.5px; color: #178a50; }
.aw-tblpanel { margin-bottom: 14px; }
.aw-tblwrap { overflow-x: auto; }
.aw-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.aw-table th { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: #98a0aa; text-align: left; padding: 6px 8px; border-bottom: 1px solid #e6eaef; white-space: nowrap; }
.aw-table td { padding: 8px; border-bottom: 1px solid #eef0f4; font-size: 12.5px; white-space: nowrap; vertical-align: middle; }
.aw-table tr:last-child td { border-bottom: none; }
.aw-num { text-align: right; }
.aw-cold { color: #c5392e; font-weight: 600; }
.aw-bar { display: inline-block; height: 6px; border-radius: 3px; background: #c5392e; vertical-align: middle; margin-right: 6px; }
.aw-bar.warm { background: #4a76e6; }
.aw-enfrow { display: grid; grid-template-columns: 1.3fr auto 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid #eef0f4; font-size: 12px; }
.aw-enfrow:last-of-type { border-bottom: none; }
.aw-count { font-size: 11px; color: #5b6470; text-align: right; }
.aw-count b { color: #111827; }
.aw-enfhist { color: #98a0aa; font-size: 11px; padding-top: 8px; border-top: 1px dashed #e6eaef; margin-top: 6px; }
.aw-gatehead { font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #98a0aa; margin: 10px 0 4px; }
.aw-gatehead:first-of-type { margin-top: 0; }
.aw-gaterow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid #eef0f4; font-size: 12px; }
.aw-gaterow:last-of-type { border-bottom: none; }
.aw-meter { height: 6px; background: #e9eef5; border-radius: 3px; overflow: hidden; width: 100px; display: inline-block; vertical-align: middle; margin-right: 8px; }
.aw-meter i { display: block; height: 100%; border-radius: 3px; }
/* drawer */
.aw-dbody { display: flex; flex-direction: column; }
.aw-dsec { padding: 14px 18px; border-bottom: 1px solid #eef1f5; }
.aw-dsec:last-child { border-bottom: none; }
.aw-dsec > h3 { margin: 0 0 8px; font-size: 12.5px; font-weight: 750; color: #18202f; }
.aw-dsub { font-size: 11.5px; color: #687386; margin: -4px 0 10px; }
.aw-dgrow { flex: 1; }
.aw-dfoot { margin-top: auto; font-size: 11.5px; color: #687386; }
.aw-evline { display: flex; gap: 6px; flex-wrap: wrap; }
.aw-actnav { border: 1px solid #e3e8ef; border-radius: 10px; overflow: hidden; background: #fff; }
.aw-anrow { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid #eef1f5; cursor: pointer; }
.aw-anrow:last-child { border-bottom: none; }
.aw-anrow:hover { background: #f8fafc; }
.aw-anic { width: 30px; height: 30px; border-radius: 8px; background: #eef2f8; color: #3b4c66; display: grid; place-items: center; font-size: 14px; flex: 0 0 auto; }
.aw-anrow.danger .aw-anic { background: #fdebe9; color: #c5392e; }
.aw-ant { font-size: 13px; font-weight: 700; color: #18202f; }
.aw-anrow.danger .aw-ant { color: #c5392e; }
.aw-and { font-size: 11px; color: #687386; margin-top: 1px; }
.aw-anchev { margin-left: auto; color: #b6bfcc; font-size: 14px; }
.aw-backsec { padding-bottom: 4px; }
.aw-backlink { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: #2563eb; font: inherit; font-size: 12px; font-weight: 700; padding: 0; cursor: pointer; }
.aw-flabel { font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: #98a0aa; margin: 14px 0 6px; }
.aw-flabel:first-child { margin-top: 0; }
.aw-flabel span { font-weight: 500; text-transform: none; letter-spacing: 0; }
.aw-modelrow { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid #e6eaef; border-radius: 8px; margin-bottom: 5px; font-size: 12.5px; color: #18202f; cursor: pointer; }
.aw-msub { color: #98a0aa; font-size: 10.5px; }
.aw-mright { margin-left: auto; }
.aw-ck { width: 15px; height: 15px; border-radius: 4px; border: 1.5px solid #c6cdd8; display: inline-block; position: relative; flex: 0 0 auto; background: #fff; }
.aw-ck.on { background: #2563eb; border-color: #2563eb; }
.aw-ck.on::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(40deg); }
.aw-ck.dis { background: #f1f3f7; border-color: #e0e5ec; }
.aw-seg { display: inline-flex; gap: 2px; background: #f1f3f7; border: 1px solid #e6eaef; border-radius: 8px; padding: 2px; flex-wrap: wrap; }
.aw-seg span { padding: 4px 11px; border-radius: 6px; font-size: 11.5px; font-weight: 650; color: #5b6470; cursor: pointer; }
.aw-seg span.on { background: #fff; color: #111827; box-shadow: 0 1px 2px rgba(8, 12, 24, .12); }
.aw-autorevert { margin-top: 7px; font-size: 11px; color: #5b6470; }
.aw-autorevert b { color: #178a50; }
.aw-txt { width: 100%; box-sizing: border-box; border: 1px solid #e6eaef; border-radius: 8px; padding: 7px 9px; font: inherit; font-size: 12px; color: #1f2937; background: #fff; min-height: 48px; }
.aw-conf { border: 1px solid #f0b8b2; background: #fff; border-radius: 8px; padding: 7px 9px; font: inherit; font-size: 12px; color: #1f2937; width: 100%; box-sizing: border-box; }
.aw-impact { margin-top: 11px; border: 1px solid #f3e3b8; background: #fdf8ea; border-radius: 8px; padding: 8px 11px; font-size: 11.5px; color: #7c5c10; }
.aw-impact b { color: #5c430a; }
.aw-impact.red { border-color: #f0b8b2; background: #fdf1ef; color: #a03b31; }
.aw-impact.red b { color: #7c2d24; }
.aw-impact ul { margin: 3px 0 0; padding-left: 15px; }
.aw-stepfoot { position: sticky; bottom: 0; display: flex; align-items: center; gap: 10px; padding: 12px 18px; background: #fff; border-top: 1px solid #eef1f5; margin-top: auto; }
.aw-fnote { font-size: 10px; color: #98a0aa; }
.aw-btnpri { margin-left: auto; background: #2563eb; color: #fff; border: none; border-radius: 8px; padding: 8px 16px; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.aw-btnpri.red { background: #c5392e; }
.aw-btnpri[disabled] { opacity: .5; cursor: default; }
.aw-btnsec { border: 1px solid #e6eaef; background: #fff; border-radius: 8px; padding: 7px 13px; font: inherit; font-size: 12px; font-weight: 600; color: #5b6470; cursor: pointer; }

/* Journey v2: activity strip + source-legend hint */
.obs-jactivity { margin-bottom: 12px; }
.obs-jbars { display: flex; gap: 10px; align-items: flex-end; padding-top: 4px; }
.obs-jbar { display: flex; flex-direction: column-reverse; align-items: center; gap: 2px; min-width: 26px; }
.obs-jbar small { color: #98a0aa; font-size: 9.5px; order: -1; }
.obs-jbar i { display: block; width: 16px; background: #4a76e6; border-radius: 3px 3px 0 0; }
.obs-jbar b { display: block; width: 16px; background: #c5392e; }
.obs-jbar i:only-of-type { border-radius: 3px; }
.aw-legendq { display: inline-grid; place-items: center; width: 13px; height: 13px; border-radius: 50%; background: #eef0f4; color: #5b6470; font-size: 9px; font-weight: 800; cursor: help; vertical-align: 1px; }

/* Surface chips: outlined, so "who is driving" reads apart from source pills */
.obs-flag.aw-surface { background: #fff; border: 1px solid #c6cdd8; color: #3b4c66; }
.obs-flag.aw-surface.warn { border-color: #eab308; background: #fffdf3; color: #a16207; }
.obs-flag.aw-surface.unverified { border-style: dashed; color: #7c8798; }

/* Fair-use classifier: the automation meter, humanity evidence, and burden */
.obs-flag.good { background: #e5f4ea; color: #1f7a3d; }
.obs-flag.aw-autochip { font-variant-numeric: tabular-nums; cursor: help; }
.aw-sub { display: block; color: #98a0aa; font-size: 9.5px; font-weight: 600; }

/* Admin impersonation banner. Fixed to the top of the viewport and rendered
   outside #app so it survives every innerHTML swap. The body offset keeps it
   from covering the IDE's own top bar. */
body.has-imp-banner { padding-top: 34px; }
.imp-banner {
  position: fixed; inset: 0 0 auto 0; z-index: 9999;
  display: flex; align-items: center; gap: 10px;
  height: 34px; padding: 0 12px; box-sizing: border-box;
  background: #7a2018; color: #fff;
  font-size: 12px; font-weight: 600; line-height: 1;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .25);
}
.imp-banner .imp-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #ffb4a8; flex: none;
}
.imp-banner .imp-text { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.imp-banner .imp-text strong { font-weight: 700; }
.imp-banner .imp-text small {
  font-weight: 500; opacity: .8; font-size: 11px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.imp-banner .imp-stop {
  margin-left: auto; flex: none; cursor: pointer;
  padding: 4px 10px; border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, .55);
  background: transparent; color: #fff;
  font-size: 11px; font-weight: 700;
}
.imp-banner .imp-stop:hover { background: rgba(255, 255, 255, .15); }

/* ── KV plain summary (simple-by-default KV tab) ─────────────────────────── */
.obs-kv-plaingrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 14px 0; }
@media (max-width: 900px) { .obs-kv-plaingrid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .obs-kv-plaingrid { grid-template-columns: 1fr; } }
.obs-kv-plain { border: 1px solid var(--border, #e2e8f0); border-radius: 10px; padding: 12px 14px; background: var(--panel, transparent); display: flex; flex-direction: column; gap: 4px; }
.obs-kv-plain span { font-size: 12px; opacity: 0.75; }
.obs-kv-plain strong { font-size: 20px; line-height: 1.2; }
.obs-kv-plain small { font-size: 12px; opacity: 0.7; }
.obs-kv-plain.good strong { color: #35a671; }
.obs-kv-plain.warn strong { color: #b45309; }
.obs-kv-plain.bad strong { color: #dc2626; }
.obs-kv-advanced { margin-top: 16px; }
.obs-kv-advanced > summary { cursor: pointer; font-weight: 600; padding: 10px 0; opacity: 0.85; }
.obs-kv-advanced > summary:hover { opacity: 1; }

/* ── Jobs in progress (Backend tab) ──────────────────────────────────────── */
.obs-infra-jobs { margin: 18px 0; padding: 16px; border: 1px solid var(--mra-border, #e5e7eb); border-radius: 12px; background: #fff; }
.obs-infra-jobs > header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.obs-infra-jobs > header > div:first-child { min-width: 0; }
.obs-infra-jobs > header span { display: block; margin-bottom: 5px; color: var(--mra-fg-muted, #667085); font-size: 9.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.obs-infra-jobs > header h3 { margin: 0; color: var(--mra-fg, #111827); font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.obs-infra-jobs > header p { margin: 4px 0 0; color: var(--mra-fg-muted, #667085); font-size: 11px; line-height: 1.45; }
.obs-infra-jobs > header strong { flex: 0 0 auto; color: var(--mra-fg, #111827); font: 650 11px/1.2 var(--mra-font-num, ui-monospace); font-variant-numeric: tabular-nums; white-space: nowrap; }
.obs-infra-jobs > .obs-kv-tablewrap table { width: 100%; min-width: 720px; border-collapse: collapse; text-align: left; }
.obs-infra-jobs > .obs-kv-tablewrap th { padding: 8px 10px; border-bottom: 1px solid var(--mra-border, #dfe4eb); background: var(--mra-bg-subtle, #f6f8fa); color: var(--mra-fg-muted, #667085); font-size: 9px; letter-spacing: .045em; text-transform: uppercase; white-space: nowrap; }
.obs-infra-jobs > .obs-kv-tablewrap td { padding: 9px 10px; border-top: 1px solid var(--mra-border-soft, #edf0f4); color: var(--mra-fg-muted, #667085); font-size: 10.5px; vertical-align: top; }
.obs-infra-jobs > .obs-kv-tablewrap tbody tr:first-child td { border-top: 0; }
.obs-infra-jobs > .obs-kv-tablewrap td strong, .obs-infra-jobs > .obs-kv-tablewrap td small { display: block; }
.obs-infra-jobs > .obs-kv-tablewrap td strong { max-width: 210px; overflow: hidden; color: var(--mra-fg, #111827); font: 650 10.5px/1.35 var(--mra-font-num, ui-monospace); text-overflow: ellipsis; white-space: nowrap; }
.obs-infra-jobs > .obs-kv-tablewrap td small { margin-top: 2px; color: var(--mra-fg-faint, #8b94a3); font-size: 9px; }
/* Numeric columns: right-aligned tabular figures. Rates and token counts of
   different widths (7.4k vs 229.5k) read as a ragged left edge otherwise, which
   is most of what makes this table look untidy — the eye compares magnitudes
   down a column, and proportional digits break that comparison. */
.obs-infra-jobs > .obs-kv-tablewrap td.num,
.obs-infra-jobs > .obs-kv-tablewrap th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.obs-infra-jobs > .obs-kv-tablewrap td.num { color: var(--mra-fg, #111827); font-family: var(--mra-font-num, ui-monospace); }
/* The identity column carries the most text; give it the slack and let the
   engine columns stay compact. */
.obs-infra-jobs > .obs-kv-tablewrap th:first-child { width: 34%; }
.obs-jobs-chip { display: inline-block; margin: 0 4px 3px 0; padding: 1px 7px; border: 1px solid var(--mra-border, #dfe4eb); border-radius: 999px; color: var(--mra-fg-muted, #667085); font-size: 9px; line-height: 1.5; white-space: nowrap; }
.obs-jobs-chip.good { color: #35a671; border-color: #35a67155; }
.obs-jobs-chip.warn { color: #b45309; border-color: #b4530955; }
.obs-jobs-chip.muted { opacity: 0.7; }
/* ── Serving-cell fleet (Backend tab) ────────────────────────────────────── */
/* Shares the Jobs panel's shell; only the pieces the fleet adds live here. */
.obs-cell-fleet > header strong { display: flex; flex-wrap: wrap; gap: 5px; font: inherit; }
.obs-cell-count { padding: 2px 8px; border: 1px solid var(--mra-border, #dfe4eb); border-radius: 999px; color: var(--mra-fg-muted, #667085); font-size: 9.5px; font-weight: 600; white-space: nowrap; }
.obs-cell-count.good { color: #35a671; border-color: #35a67155; }
.obs-cell-count.warn { color: #b45309; border-color: #b4530955; }
.obs-cell-count.bad { color: #dc2626; border-color: #dc262655; }
.obs-jobs-chip.bad { color: #dc2626; border-color: #dc262655; }
.obs-cell-detail { display: block; margin-top: 3px; color: var(--mra-fg-faint, #8b94a3); font-size: 9px; line-height: 1.4; }
.obs-cell-alert { margin: 0 0 10px; padding: 9px 11px; border: 1px solid var(--mra-border, #dfe4eb); border-left-width: 3px; border-radius: 8px; background: var(--mra-bg-subtle, #fafbfc); font-size: 10.5px; line-height: 1.5; }
.obs-cell-alert.bad { border-left-color: #dc2626; }
.obs-cell-alert.warn { border-left-color: #b45309; }
.obs-cell-alert strong { display: block; color: var(--mra-fg, #111827); font-size: 11px; }
.obs-cell-alert span { display: block; margin-top: 3px; color: var(--mra-fg-muted, #667085); }
.obs-cell-alert ul { margin: 5px 0 0; padding-left: 16px; color: var(--mra-fg-muted, #667085); }
.obs-cell-alert li + li { margin-top: 2px; }
.obs-cell-alert code { font-size: 9.5px; }
.obs-cell-btn { margin-right: 5px; padding: 3px 9px; border: 1px solid var(--mra-border, #dfe4eb); border-radius: 7px; background: #fff; color: var(--mra-fg, #111827); font-size: 9.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.obs-cell-btn:hover:not(:disabled) { border-color: var(--mra-fg-muted, #667085); }
.obs-cell-btn:disabled { opacity: .5; cursor: default; }
.obs-cell-btn.danger { color: #dc2626; border-color: #dc262640; }
.obs-jobs-planning { margin-top: 10px; }
.obs-jobs-planning > summary { cursor: pointer; color: var(--mra-fg-muted, #667085); font-size: 11px; font-weight: 600; padding: 6px 0; }
.obs-jobs-planning > summary:hover { color: var(--mra-fg, #111827); }

/* ── Admin → Workspaces console ──────────────────────────────────────────────
   Built from the admin surface vocabulary in management-v2.css, not a private
   one: --mg2-* tokens, full-bleed bands with a 16px inset, a tinted toolbar and
   table heads, .mg2-notice for anything the operator must act on, and the app's
   px type scale (15px title, 13px body, 11.5px secondary, 10.5px uppercase
   heads). Colour is reserved: blue = selected, amber = idle, red = a real
   problem (over licence, expired, more licensed than the node holds). */
.ws-console {
  --ws-live: var(--mg2-success); --ws-idle: var(--mg2-warning); --ws-bad: var(--mg2-danger);
  --ws-num: "Geist", "Roboto Flex", system-ui, sans-serif;
}
.mg2-surface.ws-console { overflow: visible; } /* the generic surface clips, which defeats position: sticky */
.ws-console .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ws-console button:focus-visible, .ws-console a:focus-visible, .ws-console input:focus-visible { outline: 2px solid var(--mg2-accent); outline-offset: 2px; }
.ws-console a.mg2-button, .ws-console a.mg2-button:hover { text-decoration: none; }
.ws-console .mg2-surface-head p { font-family: var(--ws-num); font-variant-numeric: tabular-nums; }
.ws-head-right { display: flex; align-items: center; gap: 10px; }
.ws-tone-ok { color: var(--mg2-muted); }
.ws-tone-muted { color: var(--mg2-faint); }
.ws-tone-bad { color: var(--ws-bad); font-weight: 650; }
.ws-flagdot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ws-bad); }
.ws-n { font-family: var(--ws-num); font-variant-numeric: tabular-nums; }

/* Capacity band */
.ws-cap { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 32px; padding: 16px; border-bottom: 1px solid var(--mg2-line); }
.ws-cap-cell { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.ws-cap-label { font-size: 11.5px; font-weight: 650; color: var(--mg2-muted); }
.ws-cap-value { display: flex; align-items: baseline; gap: 6px; font-family: var(--ws-num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ws-cap-value strong { font-size: 20px; font-weight: 650; color: var(--mg2-ink); letter-spacing: -.01em; }
.ws-cap-value span { font-size: 12.5px; color: var(--mg2-muted); }
.ws-cap-bar { position: relative; height: 5px; border-radius: 999px; background: #e9edf3; }
.ws-cap-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--mg2-accent); }
.ws-cap-bar b { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--mg2-ink); opacity: .4; }
.ws-cap-cell.is-high .ws-cap-bar i { background: var(--mg2-warning); }
.ws-cap-cell.is-over .ws-cap-bar i { background: var(--ws-bad); }
.ws-cap-cell.is-over .ws-cap-value strong { color: var(--ws-bad); }
.ws-cap-sub { min-height: 1.25em; font-family: var(--ws-num); font-variant-numeric: tabular-nums; font-size: 11.5px; color: var(--mg2-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Capacity by node (Kubernetes backend): "All nodes" and one row per node. A row is a button: it
   scopes the list to that node. Slots are drawn one cell each, at a fixed width, so a longer bar is
   a bigger node. Blue = running, pale blue = warm, grey-blue = other environments, grey = free;
   amber when a node is nearly full. */
.ws-nodes { border-bottom: 1px solid var(--mg2-line); }
.ws-node-row { display: grid; grid-template-columns: minmax(190px, 1.15fr) minmax(300px, 1.7fr) 124px 156px 124px 124px 14px; align-items: center; gap: 16px; width: 100%; min-height: 50px; box-sizing: border-box; padding: 0 16px; border: 0; border-top: 1px solid var(--mg2-line); border-radius: 0; background: transparent; color: var(--mg2-text); font: inherit; text-align: left; cursor: pointer; }
.ws-node-row:first-child { border-top: 0; }
.ws-node-head, .ws-node-head:hover { min-height: 36px; background: var(--mg2-subtle); color: var(--mg2-faint); font-size: 10.5px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; cursor: default; }
.ws-node-row:not(.ws-node-head):hover { background: var(--mg2-subtle); }
.ws-node-row.is-on, .ws-node-row.is-on:hover { background: var(--mg2-accent-soft); box-shadow: inset 2px 0 0 var(--mg2-accent); }
.ws-node-name { display: flex; align-items: center; gap: 9px; min-width: 0; }
.ws-node-name > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ws-node-name strong { font-family: var(--ws-num); font-size: 13px; font-weight: 650; color: var(--mg2-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-node-row.is-all .ws-node-name strong { font-family: inherit; font-weight: 700; }
.ws-node-name em { font-style: normal; font-size: 11.5px; color: var(--mg2-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-node-guests { display: grid; grid-template-columns: 78px minmax(0, 1fr); align-items: center; gap: 12px; min-width: 0; }
.ws-node-guests-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ws-node-slots { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ws-node-cells { display: flex; align-items: center; gap: 2px; min-width: 0; }
/* width, not flex-basis: an empty cell has no content size, so a basis alone would collapse the bar to its minimum */
.ws-node-cells i { flex: 0 1 auto; width: 7px; min-width: 2px; height: 12px; border-radius: 1.5px; background: #e4e9f0; }
.ws-node-bar { position: relative; display: flex; flex: 1 1 auto; min-width: 40px; height: 6px; border-radius: 2px; background: #e4e9f0; overflow: hidden; }
.ws-node-bar i { display: block; height: 100%; }
.ws-node-cells i.r, .ws-node-bar i.r, .ws-node-legend i.r { background: var(--mg2-accent); }
.ws-node-cells i.w, .ws-node-bar i.w, .ws-node-legend i.w { background: #b9cdf9; }
.ws-node-cells i.o, .ws-node-bar i.o, .ws-node-legend i.o { background: #9aa6b8; }
.ws-node-row.is-high .ws-node-cells i.r { background: var(--mg2-warning); }
.ws-node-row.is-high .ws-node-cells i.w { background: #ecc98c; }
.ws-node-row.is-high .ws-node-guests .ws-num strong, .ws-node-row.is-high .ws-node-free { color: var(--mg2-warning); }
.ws-node-row.is-high .ws-node-free { font-weight: 650; }
.ws-node-free { flex: 0 0 auto; font-family: var(--ws-num); font-variant-numeric: tabular-nums; font-size: 11.5px; color: var(--mg2-faint); white-space: nowrap; }
.ws-node-warm { font-family: var(--ws-num); font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--mg2-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-node-warm strong { font-weight: 650; color: var(--mg2-ink); }
.ws-node-head .ws-node-warm { font: inherit; color: inherit; }
.ws-node-chev { display: flex; color: var(--mg2-faint); }
.ws-node-row.is-on .ws-node-chev { color: var(--mg2-accent-strong); }
.ws-node-legend { display: flex; align-items: center; gap: 12px; margin-left: auto; font-size: 11.5px; font-weight: 500; letter-spacing: 0; text-transform: none; white-space: nowrap; overflow: hidden; }
.ws-node-legend > span { flex: 0 0 auto; }
.ws-node-legend i { display: inline-block; width: 7px; height: 10px; margin-right: 5px; border-radius: 1.5px; background: #e4e9f0; vertical-align: -1px; }
.ws-dot-bad { background: var(--ws-bad); }
/* the scope chip in the toolbar: one click returns to every node */
.ws-node-chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; box-sizing: border-box; padding: 0 10px 0 12px; border: 1px solid #c4d5fb; border-radius: 9px; background: var(--mg2-accent-soft); color: var(--mg2-accent-strong); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.ws-node-chip b { font-family: var(--ws-num); font-weight: 650; }
.ws-node-chip svg { flex: 0 0 auto; opacity: .7; }
.ws-node-chip:hover svg { opacity: 1; }
/* node panel: how the node's recent starts split */
.ws-node-start { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 12px; color: var(--mg2-muted); }
.ws-node-start b { font-family: var(--ws-num); font-weight: 650; color: var(--mg2-ink); }
.ws-node-start .ws-node-bar { height: 5px; }
.ws-kv strong em { font-style: normal; font-weight: 400; color: var(--mg2-faint); }

/* Notice band — the app's callout, full bleed */
.ws-band { display: flex; align-items: flex-start; gap: 9px; padding: 12px 16px; border-bottom: 1px solid var(--mg2-line); color: #98271f; background: var(--mg2-danger-soft); font-size: 12.5px; line-height: 1.45; }
.ws-band svg { flex: 0 0 auto; margin-top: 1px; }
/* a fact, not a fault: the same band without the alarm */
.ws-band.is-info { color: var(--mg2-text); background: var(--mg2-subtle); }
.ws-band.is-info svg { color: var(--mg2-muted); }

/* Toolbar band */
.ws-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--mg2-line); background: var(--mg2-subtle); }
/* The operation surface styles every input (management-v2.css, later in the
   cascade than .mg2-search input), so the field inside the search label is
   reset here. Compound selector: the console section IS the operation surface. */
.mg2-operation.ws-console .mg2-search input[type="search"] { min-height: 36px; flex: 1 1 auto; width: auto; min-width: 0; padding: 0; border: 0; border-radius: 0; appearance: none; outline: 0; background: transparent; font: inherit; font-size: 13px; color: var(--mg2-ink); }
/* The global input:focus rule (styles.css) paints a 3px ring on the input
   itself; on a bare input inside a field label that ring is a second box
   inside the field's own. The field carries the focus state, not the input. */
.mg2-operation.ws-console .mg2-search input[type="search"] { box-shadow: none; }
.mg2-operation.ws-console .mg2-search input[type="search"]::-webkit-search-decoration,
.mg2-operation.ws-console .mg2-search input[type="search"]::-webkit-search-cancel-button { appearance: none; }
.ws-seg { display: inline-flex; height: 38px; box-sizing: border-box; border: 1px solid var(--mg2-line-strong); border-radius: 9px; overflow: hidden; background: var(--mg2-surface); }
.ws-seg button { border: 0; background: transparent; color: var(--mg2-muted); font: inherit; font-size: 12.5px; font-weight: 600; padding: 0 13px; cursor: pointer; }
.ws-seg button + button { border-left: 1px solid var(--mg2-line); }
.ws-seg button:hover { color: var(--mg2-ink); }
.ws-seg button.is-on { background: var(--mg2-accent-soft); color: var(--mg2-accent-strong); }
.ws-toggle { display: inline-flex; align-items: center; gap: 8px; height: 38px; box-sizing: border-box; padding: 0 13px; border: 1px solid var(--mg2-line-strong); border-radius: 9px; background: var(--mg2-surface); font: inherit; font-size: 12.5px; font-weight: 600; color: var(--mg2-text); cursor: pointer; }
.ws-toggle em { font-style: normal; font-family: var(--ws-num); font-weight: 650; color: var(--mg2-faint); }
.ws-toggle.is-on { border-color: #efc5c1; background: var(--mg2-danger-soft); color: #98271f; }
.ws-toggle.is-on em { color: inherit; }
.ws-controls-links { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.ws-linkbtn { border: 0; background: transparent; padding: 4px 0; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--mg2-accent-strong); cursor: pointer; text-align: left; }
.ws-linkbtn:hover { text-decoration: underline; }
.ws-linkbtn.danger { color: var(--ws-bad); }
.ws-linkbtn:disabled { color: var(--mg2-faint); cursor: default; text-decoration: none; }

/* List column + side panel */
.ws-layout { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; }
.ws-layout.has-panel { grid-template-columns: minmax(0, 1fr) 340px; }
.ws-main { min-width: 0; }

/* Organisation rows */
.ws-orow { display: grid; grid-template-columns: minmax(220px, 1.6fr) 108px 104px 150px 150px minmax(150px, 1fr); align-items: center; gap: 16px; min-height: 60px; padding: 0 16px; }
.ws-ohead { min-height: 40px; border-bottom: 1px solid var(--mg2-line); background: var(--mg2-subtle); color: var(--mg2-faint); font-size: 10.5px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.ws-ohead > span:first-child { padding-left: 24px; }
.ws-org { border-bottom: 1px solid var(--mg2-line); }
.ws-orow:not(.ws-ohead):hover { background: var(--mg2-subtle); }
.ws-org.is-on > .ws-orow { background: var(--mg2-accent-soft); }
/* An open organisation keeps its row in view while its workspaces scroll. */
.ws-org.is-open > .ws-orow { position: sticky; top: 0; z-index: 1; background: var(--mg2-surface); border-bottom: 1px solid var(--mg2-line); }
.ws-org.is-open.is-on > .ws-orow { background: var(--mg2-accent-soft); }
.ws-o-name { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 0; border: 0; background: transparent; font: inherit; text-align: left; color: var(--mg2-faint); cursor: pointer; }
.ws-o-name svg { flex: 0 0 auto; transition: transform 140ms ease; }
.ws-org.is-open .ws-o-name svg { transform: rotate(90deg); }
.ws-o-name span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ws-o-name strong { font-size: 13px; font-weight: 650; color: var(--mg2-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-o-name em { font-style: normal; font-size: 11.5px; color: var(--mg2-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-num { display: flex; align-items: baseline; gap: 4px; font-family: var(--ws-num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ws-num strong { font-size: 13px; font-weight: 650; color: var(--mg2-ink); }
.ws-num span { font-size: 11.5px; color: var(--mg2-faint); }
.ws-num.is-bad strong { color: var(--ws-bad); }
.ws-o-lic { display: inline-flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; padding: 8px 0; border: 0; background: transparent; font: inherit; font-size: 12.5px; text-align: left; white-space: nowrap; cursor: pointer; }
.ws-o-lic svg { flex: 0 0 auto; opacity: .45; }
.ws-o-lic:hover { text-decoration: underline; }
/* Workspaces of an open organisation: a tinted region, indented under the name */
.ws-org > .ws-table { padding: 0 0 0 24px; background: var(--mg2-subtle); border-top: 1px solid var(--mg2-line); }
.ws-org > .ws-table .ws-row { border-color: #e7ecf3; }

/* Workspace rows */
.ws-row { display: grid; grid-template-columns: 34px minmax(200px, 1.6fr) minmax(200px, 1.3fr) 150px 90px; align-items: center; gap: 14px; min-height: 56px; padding: 0 16px; border-top: 1px solid var(--mg2-line); color: var(--mg2-text); font-size: 13px; }
.ws-table.has-org .ws-row { grid-template-columns: 34px minmax(200px, 1.5fr) minmax(140px, 1fr) minmax(200px, 1.3fr) 150px 90px; }
.ws-table > .ws-row:first-child { border-top: 0; }
.ws-row:hover { background: var(--mg2-surface); }
.ws-main > .ws-table > .ws-row:hover { background: var(--mg2-subtle); }
.ws-row.is-on, .ws-main > .ws-table > .ws-row.is-on { background: var(--mg2-accent-soft); }
.ws-head, .ws-head:hover { min-height: 40px; background: var(--mg2-subtle); border-bottom: 1px solid var(--mg2-line); color: var(--mg2-faint); font-size: 10.5px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.ws-c-sel { display: flex; align-items: center; justify-content: center; }
.ws-c-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 6px 0; border: 0; background: transparent; font: inherit; text-align: left; color: inherit; cursor: pointer; }
.ws-c-name strong { font-size: 13px; font-weight: 650; color: var(--mg2-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-c-name em { font-style: normal; font-size: 11.5px; color: var(--mg2-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-c-name:hover strong { color: var(--mg2-accent-strong); }
.ws-c-org { font-size: 12.5px; color: var(--mg2-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-c-status { display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; overflow: hidden; }
.ws-c-status strong { font-size: 13px; font-weight: 650; color: var(--mg2-ink); }
.ws-c-status em { font-style: normal; font-size: 11.5px; color: var(--mg2-muted); overflow: hidden; text-overflow: ellipsis; }
.ws-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; }
.ws-dot-live { background: var(--ws-live); }
.ws-dot-idle { background: var(--ws-idle); }
.ws-dot-off { background: #c5ccd6; }
/* Node column (Kubernetes backend): where a workspace runs, or where its disk is while it is stopped */
.ws-c-node { font-family: var(--ws-num); font-size: 12.5px; color: var(--mg2-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-c-node.is-off { color: var(--mg2-faint); }
.ws-has-node .ws-row { grid-template-columns: 34px minmax(190px, 1.5fr) minmax(190px, 1.2fr) 132px 140px 84px; }
.ws-has-node .ws-table.has-org .ws-row { grid-template-columns: 34px minmax(180px, 1.4fr) minmax(130px, .9fr) minmax(180px, 1.2fr) 132px 140px 84px; }
.ws-c-res, .ws-c-disk { font-family: var(--ws-num); font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--mg2-muted); white-space: nowrap; }
.ws-c-disk { text-align: right; }
/* Head cells reuse the column classes above, so they are reset after them. */
.ws-th { display: inline-flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 5px; padding: 3px 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ws-th:hover, .ws-th.is-on { color: var(--mg2-ink); }
.ws-th.ws-c-disk { justify-content: flex-end; }
.ws-empty { margin: 0; padding: 28px 16px; color: var(--mg2-muted); font-size: 13px; }
.ws-more { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--mg2-line); font-size: 11.5px; color: var(--mg2-faint); }

/* Side panel: its own region, not a floating card */
.ws-panel { position: sticky; top: 0; display: flex; flex-direction: column; max-height: calc(100vh - 120px); padding: 0 0 8px; border-left: 1px solid var(--mg2-line); background: var(--mg2-subtle); overflow: auto; }
.ws-panel header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--mg2-line); background: var(--mg2-surface); }
.ws-panel h3 { margin: 3px 0 0; font-size: 15px; font-weight: 700; letter-spacing: -.01em; color: var(--mg2-ink); }
.ws-panel header p { display: flex; align-items: center; gap: 7px; margin: 4px 0 0; font-size: 11.5px; line-height: 1.45; color: var(--mg2-muted); }
.ws-close { flex: 0 0 auto; padding: 5px; border: 0; border-radius: 7px; background: transparent; color: var(--mg2-faint); cursor: pointer; }
.ws-close:hover { background: rgba(15, 23, 42, .06); color: var(--mg2-ink); }
.ws-panel section { display: flex; flex-direction: column; gap: 7px; padding: 14px 16px; border-bottom: 1px solid var(--mg2-line); }
.ws-panel h4 { margin: 0 0 3px; font-size: 10.5px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; color: var(--mg2-faint); }
.ws-panel-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--mg2-line); background: var(--mg2-surface); }
.ws-panel-actions .mg2-button { min-width: 76px; justify-content: center; }
.ws-panel-org { margin: 0; font-size: 13px; font-weight: 650; color: var(--mg2-ink); }
.ws-kv { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 12.5px; }
.ws-kv span { color: var(--mg2-muted); }
.ws-kv strong { font-family: var(--ws-num); font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 650; color: var(--mg2-ink); text-align: right; }
.ws-kv strong em { font-style: normal; font-weight: 400; color: var(--mg2-muted); }
.ws-note { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--mg2-muted); }
.ws-form { display: flex; flex-direction: column; gap: 11px; }
.ws-field { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; font-weight: 600; color: var(--mg2-muted); }
.mg2-operation.ws-console .ws-field input { width: 100%; box-sizing: border-box; min-height: 36px; font-family: var(--ws-num); font-size: 13px; }
.ws-form-hint { margin: 1px 0 0; font-size: 11.5px; line-height: 1.45; color: var(--mg2-faint); }
.ws-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* Base image channel (stable / beta) in the workspace panel and rows */
.ws-seg.ws-seg-compact { height: 32px; align-self: flex-start; }
.ws-image .ws-merged-open { align-self: flex-start; }
.ws-seg button:disabled { cursor: not-allowed; opacity: .45; }
.ws-image-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; align-items: baseline; font-size: 12px; }
.ws-image-list > div { display: contents; }
.ws-image-list > div > span:first-child { color: var(--mg2-muted); }
.ws-image-file { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--ws-num); font-size: 11.5px; color: var(--mg2-ink); }
.ws-image-file.is-none { font-family: inherit; color: var(--mg2-faint); }
.ws-tone-warn { color: var(--ws-idle); }
.ws-chan { display: inline-block; margin-left: 7px; padding: 1px 6px; border-radius: 5px; background: var(--mg2-accent-soft); color: var(--mg2-accent-strong); font-size: 10.5px; font-weight: 700; letter-spacing: .02em; vertical-align: 1px; }
.ws-selection-group { display: inline-flex; align-items: center; gap: 10px; padding-left: 12px; border-left: 1px solid var(--mg2-line); }

/* Selection bar: fixed to the viewport (the page scrolls inside .projects-scroll, not the window) */
.ws-selection { position: fixed; left: 50%; bottom: 18px; z-index: 40; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; width: max-content; max-width: calc(100vw - 32px); padding: 10px 14px; border: 1px solid #cddbf8; border-radius: var(--mg2-radius-md); background: #f5f8ff; color: #36577d; font-size: 12.5px; box-shadow: 0 10px 30px rgba(15, 23, 42, .1); }
.ws-selection strong { font-family: var(--ws-num); font-weight: 700; }

/* With the panel open: workspace rows drop Resources, organisation rows drop Disk. At every width:
   the page is at most 1360px wide, so the panel never leaves the list room for all six columns. */
.ws-layout.has-panel .ws-c-res { display: none; }
.ws-layout.has-panel .ws-row { grid-template-columns: 34px minmax(170px, 1.5fr) minmax(170px, 1.2fr) 80px; }
.ws-layout.has-panel .ws-table.has-org .ws-row { grid-template-columns: 34px minmax(160px, 1.4fr) minmax(110px, .8fr) minmax(160px, 1.2fr) 80px; }
.ws-layout.has-panel .ws-orow { grid-template-columns: minmax(200px, 1.6fr) 100px 96px 132px minmax(130px, 1fr); }
.ws-layout.has-panel .ws-orow > :nth-child(5) { display: none; }
.ws-has-node .ws-layout.has-panel .ws-row { grid-template-columns: 34px minmax(170px, 1.5fr) minmax(170px, 1.2fr) 124px 80px; }
.ws-has-node .ws-layout.has-panel .ws-table.has-org .ws-row { grid-template-columns: 34px minmax(150px, 1.4fr) minmax(100px, .8fr) minmax(150px, 1.2fr) 116px 76px; }
/* ≤1400: the panel joins the flow above the list; same column drops for everyone */
@media (max-width: 1400px) {
  .ws-cap { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
  .ws-layout, .ws-layout.has-panel { grid-template-columns: minmax(0, 1fr); }
  .ws-panel { position: static; order: -1; max-height: none; border-left: 0; border-bottom: 1px solid var(--mg2-line); }
  .ws-c-res { display: none; }
  .ws-row, .ws-layout.has-panel .ws-row { grid-template-columns: 34px minmax(160px, 1.4fr) minmax(150px, 1.2fr) 90px; }
  .ws-table.has-org .ws-row, .ws-layout.has-panel .ws-table.has-org .ws-row { grid-template-columns: 34px minmax(160px, 1.4fr) minmax(110px, .8fr) minmax(150px, 1.2fr) 90px; }
  .ws-orow, .ws-layout.has-panel .ws-orow { grid-template-columns: minmax(200px, 1.6fr) 100px 96px 132px minmax(130px, 1fr); }
  .ws-orow > :nth-child(5) { display: none; }
  .ws-has-node .ws-row, .ws-has-node .ws-layout.has-panel .ws-row { grid-template-columns: 34px minmax(160px, 1.4fr) minmax(150px, 1.2fr) 124px 80px; }
  .ws-has-node .ws-table.has-org .ws-row, .ws-has-node .ws-layout.has-panel .ws-table.has-org .ws-row { grid-template-columns: 34px minmax(150px, 1.4fr) minmax(100px, .8fr) minmax(140px, 1.2fr) 116px 76px; }
  /* the node panel sits above the list here: its sections go side by side so the list stays in view */
  .ws-panel-node .ws-node-sections { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border-bottom: 1px solid var(--mg2-line); }
  .ws-panel-node .ws-node-sections > section { border-bottom: 0; }
  .ws-panel-node .ws-node-sections > section + section { border-left: 1px solid var(--mg2-line); }
  .ws-panel-node { padding-bottom: 0; }
  /* node table: vCPU goes first (the slots are the ceiling) */
  .ws-node-row { grid-template-columns: minmax(170px, 1.1fr) minmax(280px, 1.7fr) 156px 120px 116px 14px; gap: 14px; }
  .ws-node-vcpu { display: none; }
}
/* ≤1100: the node table drops Disks */
@media (max-width: 1100px) {
  .ws-node-row { grid-template-columns: minmax(160px, 1.1fr) minmax(260px, 1.7fr) 156px 116px 14px; }
  .ws-node-disks { display: none; }
  .ws-node-legend > span:not(:first-child):not(:nth-child(2)) { display: none; }
}
/* ≤900: organisation rows keep name, running, memory, licence */
@media (max-width: 900px) {
  .ws-orow, .ws-layout.has-panel .ws-orow { grid-template-columns: minmax(160px, 1.6fr) 90px 120px minmax(110px, 1fr); }
  .ws-orow > :nth-child(3) { display: none; }
  .ws-panel-node .ws-node-sections { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ws-panel-node .ws-node-sections > section:nth-child(odd) { border-left: 0; }
  .ws-panel-node .ws-node-sections > section:nth-child(n+3) { border-top: 1px solid var(--mg2-line); }
  /* node table keeps name, running and guest memory */
  .ws-node-row { grid-template-columns: minmax(140px, 1fr) minmax(230px, 1.6fr) 150px 14px; gap: 12px; }
  .ws-node-warm, .ws-node-legend { display: none; }
}
/* ≤720: narrow pane */
@media (max-width: 720px) {
  .ws-cap { grid-template-columns: 1fr; gap: 14px 0; }
  .ws-cap-cell { display: grid; grid-template-columns: 88px auto minmax(0, 1fr); grid-template-areas: "label value bar" "label sub sub"; align-items: center; column-gap: 12px; row-gap: 3px; }
  .ws-cap-label { grid-area: label; }
  .ws-cap-value { grid-area: value; }
  .ws-cap-bar { grid-area: bar; }
  .ws-cap-sub { grid-area: sub; }
  .ws-cap-value strong { font-size: 17px; }
  .ws-controls { flex-direction: column; align-items: stretch; }
  .ws-seg { display: flex; }
  .ws-seg button { flex: 1 1 0; }
  .ws-toggle { justify-content: center; }
  .ws-controls-links { margin-left: 0; }
  .ws-ohead { display: none; }
  .ws-orow, .ws-layout.has-panel .ws-orow { grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; min-height: 0; padding: 10px 16px; }
  .ws-orow > :nth-child(4) { display: none; }
  .ws-orow > .ws-num:nth-child(2)::after { content: "running"; margin-left: 2px; font-size: 11.5px; font-weight: 400; color: var(--mg2-faint); }
  .ws-o-lic { grid-column: 1 / -1; justify-content: flex-start; padding: 2px 0 0 24px; }
  .ws-org > .ws-table { padding-left: 8px; }
  .ws-row, .ws-table.has-org .ws-row, .ws-layout.has-panel .ws-row, .ws-layout.has-panel .ws-table.has-org .ws-row { grid-template-columns: 30px minmax(0, 1.4fr) minmax(0, 1fr) 72px; gap: 10px; padding: 0 16px 0 8px; }
  .ws-c-org, .ws-c-res, .ws-c-status em, .ws-c-node { display: none; }
  .ws-has-node .ws-row, .ws-has-node .ws-table.has-org .ws-row, .ws-has-node .ws-layout.has-panel .ws-row, .ws-has-node .ws-layout.has-panel .ws-table.has-org .ws-row { grid-template-columns: 30px minmax(0, 1.4fr) minmax(0, 1fr) 72px; }
  .ws-panel-node .ws-node-sections { grid-template-columns: minmax(0, 1fr); }
  .ws-panel-node .ws-node-sections > section + section { border-left: 0; border-top: 1px solid var(--mg2-line); }
  /* node table: name over its slots */
  .ws-node-head { display: none; }
  .ws-node-row { grid-template-columns: minmax(0, 1fr) 14px; gap: 6px 10px; min-height: 0; padding: 10px 16px; }
  .ws-node-name { grid-column: 1; }
  .ws-node-guests { grid-column: 1; grid-row: 2; grid-template-columns: 70px minmax(0, 1fr); }
  .ws-node-chev { grid-column: 2; grid-row: 1 / span 2; }
  .ws-node-mem { display: none; }
  .ws-node-chip { justify-content: center; }
  .ws-selection { left: 12px; right: 12px; width: auto; max-width: none; transform: none; flex-wrap: wrap; }
  .ws-console .mg2-surface-head { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* Bounded list pages: counts retain the full filtered result. */
.data-pager { display:flex; align-items:center; justify-content:flex-end; gap:12px; padding:14px 16px; border-top:1px solid var(--mg2-line, #e2e7ef); color:var(--mg2-muted, #657187); font-size:13px; }
.data-pager > span:first-child { margin-right:auto; }
.data-pager button { border:1px solid var(--mg2-line, #d1d9e6); background:var(--mg2-surface, white); color:var(--mg2-text, #283345); border-radius:8px; padding:7px 12px; cursor:pointer; }
.data-pager button:disabled { opacity:.4; cursor:default; }
.data-pager button:focus-visible { outline:2px solid var(--mg2-accent, #2960ee); outline-offset:2px; }
@media(max-width:600px) { .data-pager { gap:8px; flex-wrap:wrap; padding:12px 8px; } }

/* Observability → Fleet: served windows and the routing editor (public/model-routing-view.js) */
.obs-fleet-windows header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.obs-fleet-windows h3 { margin: 0; font-size: 14px; }
.obs-fleet-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.obs-fleet-chip { display: inline-flex; flex-direction: column; gap: 2px; min-width: 96px; padding: 8px 12px; border: 1px solid var(--dv3-border, #dfe3ea); border-radius: 10px; background: var(--dv3-surface, #fff); font-variant-numeric: tabular-nums; }
.obs-fleet-chip strong { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--dv3-text-muted, #5b6470); }
.obs-fleet-chip small { color: var(--dv3-text-muted, #5b6470); }
.obs-fleet-routing-panel header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.obs-fleet-active { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; }
.obs-fleet-routing td, .obs-fleet-routing th { vertical-align: middle; }
.obs-fleet-select { min-height: 32px; padding: 4px 8px; border: 1px solid var(--dv3-border, #dfe3ea); border-radius: 8px; background: var(--dv3-surface, #fff); font: inherit; }
.obs-fleet-select:disabled { opacity: .7; }
.obs-fleet-self { color: var(--dv3-text-muted, #5b6470); }
.obs-fleet-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 4px; }
.obs-fleet-note { color: var(--dv3-text-muted, #5b6470); font-size: 12px; }
.obs-fleet-why { display: block; color: var(--dv3-text-muted, #5b6470); font-size: 11px; margin-top: 2px; }
.obs-fleet-routing-panel h3 small { font-weight: 500; color: var(--dv3-text-muted, #5b6470); margin-left: 6px; }
/* Fleet tab head: the live pill sits beside the refresh button and says, in
   words, that the tables under it refresh themselves — the tick never touches
   the routing editors, so the pill is the only place that motion is stated. */
.obs-fleet-live-pill { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border: 1px solid var(--mra-border, #dfe4eb); border-radius: 10px; background: #fff; color: var(--mra-fg-muted, #667085); font-size: 11.5px; font-weight: 650; letter-spacing: .01em; white-space: nowrap; box-shadow: 0 1px 2px rgba(16,24,40,.04); font-variant-numeric: tabular-nums; }
.obs-fleet-live-pill .obs-node-dot { width: 8px; height: 8px; animation: obs-fleet-pulse 2.4s ease-in-out infinite; }
@keyframes obs-fleet-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(22,163,74,.35); } 50% { box-shadow: 0 0 0 4px rgba(22,163,74,0); } }
@media (prefers-reduced-motion: reduce) { .obs-fleet-live-pill .obs-node-dot { animation: none; } }
/* The live region: served windows, cells, jobs. The first card closes the gap
   to the page head; the cards keep the shared .obs-infra-jobs shell. */
[data-obs-fleet-live] > :first-child { margin-top: 0; }
[data-obs-fleet-live] > .obs-fleet-windows { margin-bottom: 18px; }
/* Registry provenance under the cells table: a labelled strip, one fact per
   row, instead of a run-on sentence. Long values (paths, cell lists) wrap
   inside their cell rather than pushing the strip wide. */
.obs-cell-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 22px; margin: 12px 0 0; padding: 10px 14px; border: 1px solid var(--mra-border-soft, #e9edf3); border-radius: 10px; background: var(--mra-bg-subtle, #fafbfc); }
.obs-cell-fact { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px; align-items: baseline; margin: 0; min-width: 0; }
.obs-cell-fact.wide { grid-column: 1 / -1; }
.obs-cell-fact dt { color: var(--mra-fg-faint, #8b94a3); font-size: 9.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; line-height: 1.5; }
.obs-cell-fact dd { margin: 0; color: var(--mra-fg-muted, #667085); font-size: 10.5px; line-height: 1.55; overflow-wrap: anywhere; }
.obs-cell-fact dd strong { color: var(--mra-fg, #111827); font-weight: 700; }
.obs-cell-fact dd code { font-size: 9.5px; }
.obs-cell-fact.warn dd { color: #9a6107; }
.obs-cell-fact.bad dd { color: #b42318; }
@media (max-width: 820px) {
  .obs-cell-facts { grid-template-columns: 1fr; gap: 8px; }
  .obs-cell-fact { grid-template-columns: 1fr; gap: 2px; }
}

/* Health → Errors: engine errors (obsErrorsSection) */
.obs-eerr-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 0 0 12px; flex-wrap: wrap; }
.obs-eerr-head h2 { margin: 0 0 4px; font-size: 17px; letter-spacing: -.01em; }
.obs-eerr-head p { margin: 0; color: var(--mra-fg-muted, #6b7280); font-size: 12.5px; max-width: 640px; }
.obs-eerr-tools { display: flex; align-items: center; gap: 8px; }
.obs-eerr-include { display: inline-flex; gap: 2px; background: var(--mra-bg-subtle, #f1f3f5); border: 1px solid var(--mra-border, #e5e7eb); border-radius: 9px; padding: 2px; }
.obs-eerr-include button { border: 0; background: transparent; padding: 5px 10px; border-radius: 7px; font: inherit; font-size: 12px; font-weight: 600; color: var(--mra-fg-muted, #6b7280); cursor: pointer; white-space: nowrap; }
.obs-eerr-include button:hover { color: var(--mra-fg, #111827); }
.obs-eerr-include button.active { background: #fff; color: var(--mra-fg, #111827); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.obs-eerr-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 12px; }
.obs-eerr-trend, .obs-trend { font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.obs-trend.bad { color: #dc2626; }
.obs-trend.good { color: #16a34a; }
.obs-trend.flat, .obs-trend.new { color: var(--mra-fg-muted, #6b7280); }
.obs-card .obs-eerr-trend { font-size: 12px; margin-left: 4px; vertical-align: middle; }
.obs-eerr-crow { display: grid; grid-template-columns: auto 46px 56px minmax(120px, auto) minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--mra-border, #e5e7eb); cursor: pointer; border-radius: 6px; }
.obs-eerr-crow:hover, .obs-eerr-crow.active { background: var(--mra-bg-subtle, #f6f8fa); }
.obs-eerr-crow.active .obs-err-cnt { color: var(--mra-blue, #2563eb); }
.obs-eerr-crow:last-child { border-bottom: 0; }
.obs-eerr-meta { color: var(--mra-fg-muted, #6b7280); font-size: 11.5px; white-space: nowrap; }
.obs-eerr-urow { display: grid; grid-template-columns: minmax(160px, 1.2fr) 46px minmax(120px, auto) auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--mra-border, #e5e7eb); cursor: pointer; border-radius: 6px; }
.obs-eerr-urow:hover { background: var(--mra-bg-subtle, #f6f8fa); }
.obs-eerr-urow:last-child { border-bottom: 0; }
.obs-eerr-user { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--mra-fg, #111827); }
.obs-eerr-classes { display: flex; gap: 4px; flex-wrap: wrap; }
.obs-eerr-flag { font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--mra-fg-muted, #6b7280); border: 1px solid var(--mra-border, #e5e7eb); border-radius: 999px; padding: 0 6px; margin-left: 4px; }
.obs-bar-row.active .obs-bar-l { color: var(--mra-blue, #2563eb); font-weight: 700; }
.obs-bar-row.obs-mrow-act { cursor: pointer; }
.obs-bar-l small, .obs-bar-v small { color: var(--mra-fg-muted, #6b7280); font-weight: 500; }
.obs-eerr-cols .obs-panel h3 + h3, .obs-eerr-cols .obs-panel .obs-bar-row + h3, .obs-eerr-cols .obs-panel p + h3 { margin-top: 18px; }
.obs-eerr-legacy { margin-top: 16px; }
.obs-eerr-legacy > summary { cursor: pointer; font-weight: 700; font-size: 13px; padding: 8px 0; color: var(--mra-fg, #111827); }
.obs-eerr-legacy[open] > summary { margin-bottom: 8px; }
@media (max-width: 820px) {
  .obs-eerr-crow, .obs-eerr-urow { grid-template-columns: auto 46px minmax(0, 1fr); }
  .obs-eerr-crow > :nth-child(n+4), .obs-eerr-urow > :nth-child(n+4) { display: none; }
  .obs-eerr-head { flex-direction: column; }
}
/* Health → Tools: tool-call validity (obsToolCallsPanel). Tables scroll sideways inside their
   wrapper on a narrow screen; the first column (the filter) stays readable. */
.obs-tc { margin-bottom: 16px; }
/* Model and build tables one above the other: side by side, the build table's six columns
   did not fit half of the dashboard's width. */
.obs-tc-stack { display: grid; gap: 16px; margin-bottom: 16px; }
.obs-tc.is-loading .obs-cards, .obs-tc.is-loading .obs-tc-stack, .obs-tc.is-loading .obs-tc-daypanel { opacity: .55; transition: opacity .15s; }
.obs-tc-cards .obs-card-v .obs-trend { font-size: inherit; }
.obs-tc-sub { margin-top: 4px; color: var(--mra-fg-muted, #6b7280); font-size: 11.5px; }
.obs-tc-stale { margin: 0 0 12px; }
/* The wide tables must not widen the page: without containment their no-wrap min-content
   width propagated up the dashboard grid (a 390 px phone laid the page out 992 px wide). Each
   wrapper fills its column and scrolls its own table sideways. */
.obs-tc .obs-kv-tablewrap { contain: inline-size; }
.obs-tc-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
.obs-tc-table th, .obs-tc-table td { padding: 7px 10px; white-space: nowrap; vertical-align: middle; }
.obs-tc-table thead th { border-bottom: 1px solid var(--mra-border, #dfe4eb); background: var(--mra-bg-subtle, #f6f8fa); color: var(--mra-fg-muted, #667085); font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.obs-tc-table tbody th, .obs-tc-table tbody td { border-top: 1px solid var(--mra-border-soft, #edf0f4); color: var(--mra-fg, #111827); font-weight: 500; }
.obs-tc-table tbody tr:first-child th, .obs-tc-table tbody tr:first-child td { border-top: 0; }
.obs-tc-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.obs-tc-table small { color: var(--mra-fg-muted, #6b7280); font-size: 10.5px; font-weight: 500; }
.obs-tc-table code { font-size: 11.5px; }
.obs-tc-table tr.active th, .obs-tc-table tr.active td { background: var(--mra-bg-subtle, #f6f8fa); }
.obs-tc-table tr.today th, .obs-tc-table tr.today td { font-weight: 700; }
.obs-tc-table tr.older th, .obs-tc-table tr.older td, .obs-tc-more th, .obs-tc-more td { color: var(--mra-fg-muted, #6b7280); }
.obs-tc-table tfoot th, .obs-tc-table tfoot td { border-top: 1px solid var(--mra-border, #dfe4eb); background: var(--mra-bg-subtle, #fafbfc); font-weight: 700; color: var(--mra-fg, #111827); }
.obs-tc-pick { border: 0; background: transparent; padding: 0; font: inherit; color: var(--mra-fg, #111827); cursor: pointer; text-align: left; display: inline-flex; align-items: baseline; gap: 4px; }
.obs-tc-pick:hover { color: var(--mra-blue, #2563eb); text-decoration: underline; }
.obs-tc-pick:focus-visible { outline: 2px solid var(--mra-blue, #2563eb); outline-offset: 2px; border-radius: 4px; }
.obs-tc-table tr.active .obs-tc-pick { color: var(--mra-blue, #2563eb); font-weight: 700; }
.obs-tc-muted { color: var(--mra-fg-muted, #6b7280); font-weight: 500; }
.obs-tc-chan { display: inline-block; padding: 0 6px; border-radius: 999px; background: rgba(37, 99, 235, .1); color: var(--mra-blue, #2563eb); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.obs-tc-days th:first-child { min-width: 92px; }
/* The engine-errors feed reuses the Events row, with room for the class, the place it broke and the build. */
.obs-eerr-recent .obs-row { grid-template-columns: 18px 70px 64px 118px 112px 64px 170px 76px 1fr; }
.obs-eerr-recent .obs-row .obs-src, .obs-eerr-recent .obs-row .obs-proj { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 820px) { .obs-eerr-recent .obs-row { grid-template-columns: 18px 70px 118px 1fr; } .obs-eerr-recent .obs-row > :nth-child(3), .obs-eerr-recent .obs-row > :nth-child(n+5):not(.obs-snip) { display: none; } }

/* Administration lives in one live root that render() re-attaches (app.js attachAdminPage); the wrapper takes no part in layout. */
.admin-root { display: contents; }

/* Request speeds stay distinct from the serving fleet's throughput counters. */
[data-obs-request-speeds] { margin-bottom: 16px; }
.obs-request-speeds-table { width: 100%; min-width: 620px; border-collapse: collapse; text-align: left; font-size: 12px; }
.obs-request-speeds-table th { padding: 10px 14px; background: var(--mra-bg-subtle, #f6f8fa); color: var(--mra-fg-muted, #667085); font-weight: 600; }
.obs-request-speeds-table td { padding: 10px 14px; border-top: 1px solid var(--mra-border-soft, #e9edf3); font-variant-numeric: tabular-nums; }
.obs-request-speeds-table th:not(:first-child), .obs-request-speeds-table td:not(:first-child) { text-align: right; white-space: nowrap; }

/* ---- Sign-in screen -----------------------------------------------------------------------
   The app's sign-in panel on the black-hole scene. The scene, the panel, the main button and
   the quiet line under the divider are drawn by entry-screen/entry-screen.css, as for the
   loading screen. These are the dashboard's own controls on it, with the base the app's
   stylesheet gives the same markup there. :where() keeps that base below every rule. */
.oc-signin {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.4px;
  text-align: left;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
:where(.oc-signin),
:where(.oc-signin) :where(*, ::before, ::after) { box-sizing: border-box; margin: 0; padding: 0; border: 0 solid; }
:where(.oc-signin) :where(button) { font: inherit; letter-spacing: inherit; color: inherit; border-radius: 0; background-color: transparent; text-rendering: auto; }
.oc-signin [hidden] { display: none !important; }
/* The page under the sign-in screen, and before it is drawn (index.html, rememberSignedIn). */
html.oc-signin-page,
html.oc-signin-page body { background: #080808; color-scheme: dark; }
.oc-signin button > svg { flex-shrink: 0; }

.oc-signin .oc-login-language {
  position: absolute;
  top: max(24px, env(safe-area-inset-top));
  right: max(32px, env(safe-area-inset-right));
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border: 1px solid #3a3a35;
  border-radius: 999px;
}
.oc-signin .oc-login-language button {
  min-width: 44px;
  min-height: 36px;
  padding: 4px 10px;
  border-radius: 999px;
  color: #9d9c95;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease;
}
.oc-signin .oc-login-language button[aria-pressed="true"] { color: #11110f; background: #f2f1ec; }

.oc-signin-note {
  margin-top: 20px;
  padding: 10px 12px;
  border: 1px solid #4a4435;
  border-radius: 8px;
  color: #dccfb4;
  background: #221f18;
  font-size: 13px;
  line-height: 20px;
}

/* The provider's button with nothing to open, and a sign-in under way. */
.oc-signin[data-signin-mode="none"] .oc-login-primary:disabled { cursor: not-allowed; }
.oc-signin .oc-login-primary:disabled:not([data-signin-busy]) { opacity: 0.55; }

.oc-signin-form { display: grid; gap: 14px; margin-top: 12px; }
.oc-signin[data-signin-mode="credentials"] .oc-signin-form { margin-top: 28px; }
.oc-signin-field { display: grid; gap: 6px; color: #b1ada5; font-size: 12px; line-height: 1.5; }
.oc-signin-field input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #3a3935;
  border-radius: 8px;
  color: #f4f1eb;
  background: #10100f;
  box-shadow: none;
  font-size: 14px;
  letter-spacing: 0;
  transition: border-color 150ms ease;
}
.oc-signin-field input:focus { border-color: #65635c; box-shadow: none; }
.oc-signin-field input:-webkit-autofill {
  -webkit-text-fill-color: #f4f1eb;
  box-shadow: 0 0 0 1000px #10100f inset;
  caret-color: #f4f1eb;
}
.oc-signin .oc-signin-submit { margin-top: 6px; }
/* Beside the provider's button the credentials are the quieter way in. */
.oc-signin[data-signin-mode="both"] .oc-signin-submit {
  border-color: #4a4944;
  color: #e8e4dc;
  background: transparent;
  box-shadow: none;
}

.oc-signin .oc-login-browser-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 22px 4px 0;
  color: #b9afa3;
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}
.oc-signin .oc-login-browser-note > svg { flex-shrink: 0; }
.oc-signin .oc-login-browser-note[data-signin-empty] { visibility: hidden; }

@media (hover: hover) {
  .oc-signin .oc-login-language button[aria-pressed="false"]:hover { color: #e7e6e0; }
  .oc-signin[data-signin-mode="both"] .oc-signin-submit:hover:not(:disabled) { background: #201f1d; box-shadow: none; }
}

@media (max-width: 520px) {
  .oc-signin .oc-login-language {
    top: max(20px, env(safe-area-inset-top));
    right: max(20px, env(safe-area-inset-right));
  }
  .oc-signin .oc-login-language button { min-height: 40px; }
  .oc-signin-field input { font-size: 16px; }
}
