/* Connected workspace styles are scoped away from terminal tiles and Budget. */
body.jw-focused #sidebar-left,
body.jw-focused #sidebar-right {
  display: none;
}
body.jw-focused #main {
  grid-template-columns: minmax(0, 1fr);
}
body.jw-focused #panel-terminals > .view-surface > .panel-header {
  display: none;
}
.workspace-modern {
  min-width: 0;
  min-height: 0;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column;
  padding: 0 !important;
}
.workspace-modern.hidden {
  display: none !important;
}
.workspace-modern > :not(.jw) {
  display: none !important;
}
.jw {
  --jw-bg: #181818;
  --jw-panel: #262626;
  --jw-edge: #383838;
  --jw-text: #eeeeee;
  --jw-muted: #aaaaaa;
  --jw-cyan: #eeeeee;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  color: var(--jw-text);
  background: var(--jw-bg);
  font:
    14px/1.6 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  letter-spacing: normal;
  text-transform: none;
}
.jw * {
  box-sizing: border-box;
}
.jw h1,
.jw h2,
.jw h3,
.jw p {
  margin: 0;
}
.jw h1 {
  font-size: 21px;
  font-weight: 550;
  line-height: 1.35;
}
.jw h2 {
  font-size: 17px;
  font-weight: 550;
}
.jw h3 {
  font-size: 14px;
  font-weight: 550;
}
.jw small {
  font-size: 12px;
}
.jw a {
  color: var(--jw-cyan);
}
.jw-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 23px 28px;
  border-bottom: 1px solid var(--jw-edge);
  flex-shrink: 0;
}
.jw-head p {
  font-size: 13px;
  color: var(--jw-muted);
  margin-top: 5px;
}
.jw-row {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
}
.jw-between {
  justify-content: space-between;
}
.jw-muted {
  color: var(--jw-muted);
}
.jw-button {
  background: transparent;
  border: 1px solid var(--jw-edge);
  border-radius: 7px;
  padding: 8px 12px;
  color: var(--jw-text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  line-height: 1.4;
  letter-spacing: normal;
  text-transform: none;
}
.jw-button:hover,
.jw-button.selected {
  background: #343434;
  color: var(--jw-cyan);
}
.jw-button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.jw-button.jw-primary {
  background: var(--jw-cyan);
  border-color: var(--jw-cyan);
  color: #181818;
  font-weight: 550;
}
.jw-button:focus-visible,
.jw input:focus-visible,
.jw select:focus-visible,
.jw textarea:focus-visible {
  outline: 2px solid var(--jw-cyan);
  outline-offset: 2px;
}
.jw-toolbar {
  padding: 15px 28px;
  border-bottom: 1px solid var(--jw-edge);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
}
.jw input,
.jw textarea,
.jw select {
  background: var(--jw-panel);
  border: 1px solid var(--jw-edge);
  border-radius: 7px;
  color: var(--jw-text);
  font: inherit;
  line-height: 1.5;
  min-width: 0;
  padding: 9px 11px;
}
.jw-toolbar input {
  width: 320px;
  max-width: 100%;
}
.jw textarea {
  width: 100%;
  min-height: 170px;
  resize: vertical;
}
.jw label {
  font-size: 12px;
  color: var(--jw-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.jw-scroll {
  overflow: auto;
  min-height: 0;
  flex: 1;
  padding: 20px 28px;
}
.jw-empty {
  padding: 50px 24px;
  color: var(--jw-muted);
  text-align: center;
  overflow-wrap: anywhere;
}
.jw-empty p {
  margin-top: 15px;
}
.jw-task-row,
.jw-table-head {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) 105px 150px 105px;
  gap: 18px;
  align-items: center;
  padding: 18px 8px;
  border-bottom: 1px solid var(--jw-edge);
}
.jw-table-head {
  color: var(--jw-muted);
  font-size: 12px;
  padding-top: 0;
  padding-bottom: 12px;
}
.jw-task-title {
  border: 0;
  padding: 0;
  min-width: 0;
}
.jw-task-title strong {
  font-weight: 550;
  display: block;
}
.jw-task-title small {
  display: block;
  color: var(--jw-muted);
  margin-top: 5px;
}
.jw-badge {
  font-size: 11px;
  display: inline-block;
  justify-self: start;
  white-space: nowrap;
  padding: 3px 8px;
  border-radius: 5px;
  background: #303030;
  color: #dddddd;
}
.jw-badge[data-status="blocked"] {
  background: #393226;
  color: #f0cc8a;
}
.jw-badge[data-status="done"] {
  background: #303030;
  color: #dddddd;
}
.jw-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: 16px;
  min-width: 900px;
}
.jw-board-column {
  background: #212121;
  border-radius: 9px;
  padding: 13px;
  min-height: 300px;
}
.jw-board-column h2 {
  font-size: 13px;
  color: var(--jw-muted);
}
.jw-board-column h2 small {
  float: right;
}
.jw-task-card {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border: 1px solid var(--jw-edge);
  background: var(--jw-panel);
  border-radius: 9px;
  margin-top: 13px;
  padding: 15px;
  cursor: grab;
}
.jw-task-card .jw-task-title {
  width: 100%;
  margin-bottom: 6px;
}
.jw-task-card .jw-muted {
  font-size: 12px;
}
.jw-detail {
  max-width: 900px;
  margin: auto;
}
.jw-properties {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.jw-prose {
  line-height: 1.8;
  overflow-wrap: anywhere;
  margin-top: 22px;
}
.jw-prose h1,
.jw-prose h2,
.jw-prose h3 {
  margin: 25px 0 14px;
}
.jw-prose p {
  margin: 0 0 16px;
}
.jw-prose ul,
.jw-prose ol {
  padding-left: 22px;
  margin: 14px 0;
}
.jw-prose pre,
.jw pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font:
    12px/1.7 ui-monospace,
    SFMono-Regular,
    monospace;
}
.jw-prose table {
  border-collapse: collapse;
  display: block;
  overflow: auto;
}
.jw-prose td,
.jw-prose th {
  border: 1px solid var(--jw-edge);
  padding: 7px;
}
.jw-files {
  display: grid;
  grid-template-columns: 170px minmax(240px, 0.8fr) minmax(320px, 1.5fr);
  min-height: 0;
  min-width: 0;
  flex: 1;
}
.jw-folder-nav {
  padding: 17px 10px;
  border-right: 1px solid var(--jw-edge);
  overflow: auto;
}
.jw-folder-nav .jw-button {
  display: block;
  width: 100%;
  border: 0;
  margin-bottom: 5px;
}
.jw-crumbs {
  display: flex;
  gap: 3px;
  align-items: center;
  flex-wrap: wrap;
}
.jw-crumbs .jw-button {
  border: 0;
  padding: 4px;
}
.jw-file-list,
.jw-mail-list {
  padding: 13px;
  overflow: auto;
  border-right: 1px solid var(--jw-edge);
  min-width: 0;
}
.jw-file-item {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 7px;
  border-color: transparent;
  padding: 14px 11px;
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}
.jw-file-item small {
  color: var(--jw-muted);
}
.jw-file-preview {
  overflow: auto;
  min-width: 0;
  padding: 25px;
}
.jw-file-preview h2 {
  overflow-wrap: anywhere;
}
.jw-file-actions {
  margin: 18px 0;
}
.jw iframe {
  width: 100%;
  height: 440px;
  border: 1px solid var(--jw-edge);
  border-radius: 9px;
  background: var(--jw-panel);
  color-scheme: dark;
}
.jw img {
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;
}
.jw-file-preview pre {
  padding: 16px;
  background: var(--jw-panel);
  border: 1px solid var(--jw-edge);
  border-radius: 8px;
}
.jw-file-preview form textarea {
  font-family: ui-monospace, monospace;
  min-height: 380px;
}
.jw-file-preview form .jw-row {
  margin-top: 14px;
}
.jw-mail {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  min-width: 0;
}
.jw-mail-item {
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: 100%;
  border-color: transparent;
  padding: 16px 12px;
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}
.jw-mail-item > .jw-row {
  width: 100%;
}
.jw-mail-item small {
  color: var(--jw-muted);
}
.jw-mail-body {
  overflow: auto;
  min-width: 0;
  padding: 28px;
  overflow-wrap: anywhere;
}
.jw-mail-body > h2 {
  font-size: 21px;
  margin: 28px 0 10px;
}
.jw pre.jw-email-text {
  white-space: pre-wrap;
  font:
    14px/1.8 -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  margin: 28px 0;
}
.jw-draft {
  margin-top: 28px;
  padding: 20px;
  border: 1px solid #444444;
  border-radius: 10px;
  background: var(--jw-panel);
}
.jw-draft textarea {
  margin: 15px 0;
  background: var(--jw-bg);
}
.jw-draft p {
  font-size: 12px;
  margin-top: 13px;
}
.jw details {
  margin-top: 15px;
}
.jw summary {
  cursor: pointer;
  color: var(--jw-muted);
}
.jw-dialog {
  border: 1px solid #444444;
  border-radius: 12px;
  width: min(850px, 92vw);
  max-height: 90vh;
  overflow: auto;
  padding: 26px;
  margin: auto;
  display: none;
}
.jw-dialog[open] {
  display: block;
}
.jw-dialog::backdrop {
  background: #000a;
}
.jw-dialog .jw-close {
  float: right;
  margin-bottom: 15px;
}
.jw-dialog h2 {
  margin-bottom: 20px;
}
.jw-dialog form {
  clear: both;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.jw-dialog iframe {
  height: 65vh;
}
.jw-notice {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90vw;
  padding: 12px 18px;
  border: 1px solid #444444;
  border-radius: 8px;
  background: #303030;
  color: #eeeeee;
  font:
    13px/1.5 -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  z-index: 9999;
  box-shadow: 0 8px 30px #0005;
}
.jw-notice[hidden] {
  display: none;
}
/* Icon-only navigation, with names available on hover and keyboard focus. */
.jarvis-workspace-enabled header .view-rail__btn:focus-visible .view-rail__tip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
@media (max-width: 950px) {
  .jw-files {
    grid-template-columns: minmax(200px, 0.8fr) minmax(280px, 1.2fr);
  }
  .jw-folder-nav {
    display: none;
  }
  .jw-task-row,
  .jw-table-head {
    grid-template-columns: minmax(180px, 1fr) 85px 110px;
  }
  .jw-task-row > :last-child,
  .jw-table-head > :last-child {
    display: none;
  }
  .jw-mail {
    grid-template-columns: 260px minmax(0, 1fr);
  }
  .jw-properties {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 650px) {
  .jw-head,
  .jw-toolbar {
    padding: 17px;
  }
  .jw-scroll {
    padding: 14px;
  }
  .jw-files,
  .jw-mail {
    display: flex;
    flex-direction: column;
  }
  .jw-file-list,
  .jw-mail-list {
    max-height: 220px;
    flex-shrink: 0;
    border-right: 0;
    border-bottom: 1px solid var(--jw-edge);
  }
  .jw-file-preview,
  .jw-mail-body {
    padding: 18px;
    flex: 1;
  }
  .jw-task-row,
  .jw-table-head {
    grid-template-columns: minmax(120px, 1fr) 80px;
    gap: 12px;
  }
  .jw-task-row > :nth-child(3),
  .jw-table-head > :nth-child(3) {
    display: none;
  }
  .jw-dialog {
    padding: 18px;
  }
  .jw input,
  .jw textarea,
  .jw select {
    font-size: 16px;
  }
  .jw-board {
    min-width: 880px;
  }
}
/* Chat occupies the center only in Agents. Grid sizing changes only after Widen chat. */
body.jw-agent-focused #sidebar-left,
body.jw-agent-focused #sidebar-right {
  display: none;
}
body.jw-agent-focused #main {
  grid-template-columns: minmax(0, 1fr);
}
body.jw-agent-focused #panel-terminals > .view-surface > .panel-header {
  display: none;
}
.jarvis-workspace-enabled #agents-v2-shell {
  grid-template-columns: 260px minmax(0, 1fr);
  position: relative;
}
.jarvis-workspace-enabled #agent-stage-root.jw-overview-hidden {
  display: none;
}
#jw-agent-chat {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  border-left: 1px solid #333333;
}
.jw-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 21px 28px;
  border-bottom: 1px solid #333333;
  flex-shrink: 0;
}
.jw-chat-head h1 {
  font-size: 19px;
  line-height: 1.4;
}
.jw-chat-head p {
  font-size: 12px;
  color: #aaaaaa;
  margin-top: 4px;
}
#jw-chat-mount {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
#jw-chat-mount[hidden] {
  display: none;
}
body.jw-companion-wide {
  --right-w: 460px;
}
#jw-companion-toggle {
  margin-left: 12px;
  padding: 5px 10px;
  font-size: 12px;
}
#jw-companion-toggle[hidden] {
  display: none;
}
.jarvis-workspace-enabled #agent-stage-root:not(.jw-overview-hidden) {
  grid-column: 2;
  grid-row: 1;
  z-index: 2;
  margin-top: 82px;
  background: #181818;
}
.jarvis-workspace-enabled #jw-agent-chat {
  grid-column: 2;
  grid-row: 1;
}

.jw-prose ul {
  list-style: disc;
}
.jw-prose ol {
  list-style: decimal;
}

/* Codex reference palette. Budget deliberately inherits the original shell
   tokens, so even its enclosing view keeps the previous appearance. */
.jarvis-workspace-enabled body:not(.view-active-budget) {
  --bg-void: #141414;
  --bg-base: #181818;
  --bg-raised: #242424;
  --bg-raised-2: #303030;
  --bg-overlay: rgba(20,20,20,.82);
  --surface-0: #212121;
  --surface-1: #262626;
  --surface-2: #303030;
  --surface-3: #383838;
  --bubble-out: #303030;
  --fg-primary: #eeeeee;
  --fg-secondary: #aaaaaa;
  --fg-tertiary: #a3a3a3;
  --fg-mute: #999999;
  --text-primary: #eeeeee;
  --text-secondary: #aaaaaa;
  --text-tertiary: #a3a3a3;
  --edge-hair: #303030;
  --edge-soft: #383838;
  --edge-strong: #505050;
  --edge-inner: rgba(255,255,255,.04);
  --edge-glow: transparent;
  --border: #303030;
  --border-subtle: #303030;
  --border-default: #3b3b3b;
  --accent: #eeeeee;
  --accent-dim: #bcbcbc;
  --accent-soft: rgba(255,255,255,.07);
  --accent-glow: transparent;
  --tg-blue: #eeeeee;
  --status-online: #bbbbbb;
  --status-working: #cccccc;
  --status-waiting: #999999;
  --status-done: #888888;
  background: #181818;
  color: #eeeeee;
}
.jarvis-workspace-enabled body:not(.view-active-budget)::before,
.jarvis-workspace-enabled body:not(.view-active-budget)::after { display: none; }
.jarvis-workspace-enabled body:not(.view-active-budget) #header {
  background: #212121;
  border-color: #333333;
  box-shadow: none;
}
.jarvis-workspace-enabled body:not(.view-active-budget) :is(.view-surface, .panel) {
  background: var(--surface-0);
  border-color: var(--border-subtle);
  box-shadow: none;
}
.jarvis-workspace-enabled body:not(.view-active-budget) :is(.view-rail__btn, .agent-sidebar__avatar) {
  box-shadow: none;
  text-shadow: none;
}
.jarvis-workspace-enabled body:not(.view-active-budget) .view-rail__btn.active {
  background: #343434;
  border-color: #555555;
  color: #f3f3f3;
}
.jarvis-workspace-enabled body:not(.view-active-budget) .view-rail__btn .view-rail__tip {
  background: #303030;
  color: #eeeeee;
  border-color: #444444;
}
.jarvis-workspace-enabled .agent-sidebar-root { background: #242424; }
.jarvis-workspace-enabled .agent-sidebar__row {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.jarvis-workspace-enabled .agent-sidebar__row:hover { background: #2c2c2c; border-color: #3b3b3b; }
.jarvis-workspace-enabled .agent-sidebar__row--selected { background: #343434; border-color: #505050; box-shadow: none; }
.jarvis-workspace-enabled .agent-sidebar__row--selected::before { background: #bdbdbd; box-shadow: none; }
.jarvis-workspace-enabled .agent-sidebar__avatar,
.jarvis-workspace-enabled .agent-sidebar__row--selected .agent-sidebar__avatar { background: #303030; border-color: #555555; box-shadow: none; }
/* Overlay only: preserve avatar geometry, image crop and fallback initials. */
.agent-sidebar__avatar--terminal-active::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  padding: 2px;
  pointer-events: none;
  background: conic-gradient(from 0deg, rgba(235, 239, 244, .08), rgba(235, 239, 244, .12) 65%, rgba(235, 239, 244, .5) 90%, rgba(235, 239, 244, .08));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  animation: avatar-terminal-sweep 2.6s linear infinite;
}
@keyframes avatar-terminal-sweep {
  0% { transform: rotate(0turn); opacity: .7; }
  50% { opacity: 1; }
  100% { transform: rotate(1turn); opacity: .7; }
}
@media (prefers-reduced-motion: reduce) {
  .agent-sidebar__avatar--terminal-active::before {
    animation: none;
    transform: none;
    opacity: .7;
    background: rgba(235, 239, 244, .3);
  }
}
.jarvis-workspace-enabled :is(.agent-sidebar__name, .agent-sidebar__row--selected .agent-sidebar__name) { color: #eeeeee; }
.jarvis-workspace-enabled :is(.agent-sidebar__time, .agent-sidebar__preview, .agent-sidebar__meta, .agent-sidebar__worker-meta, .agent-sidebar__row--selected .agent-sidebar__preview) { color: #aaaaaa; }
.jarvis-workspace-enabled :is(.agent-sidebar__title, .agent-sidebar__add, .agent-sidebar__count--unread) { color: #bcbcbc; background: transparent; border-color: #444444; }
.jarvis-workspace-enabled .agent-sidebar__badge { background: #dddddd; color: #202020; box-shadow: none; }
/* Status pills. Three cues, never one: the WORD, the shape, then the colour.
   The text label is load-bearing accessibility and is never hidden here. */
.jarvis-workspace-enabled .agent-sidebar__statuspill { color: #bcbcbc; background: #303030; border-color: #444444; border-style: solid; border-radius: 3px; }
.jarvis-workspace-enabled .agent-sidebar__statuspill.agent-status--working { color: #dedede; background: #383838; border-color: #555555; border-style: solid; border-radius: 3px; }
.jarvis-workspace-enabled .agent-sidebar__row:focus-visible { outline: 2px solid #cccccc; outline-offset: 2px; }

/* Subagent lines ("running: <name> - <elapsed>"), 2026-09-08. Astra's read:
   children sit INSIDE the parent row, below its pill, aligned with the preview
   text, behind a quiet vertical guide - so they read as belonging to that agent
   without suggesting a second chat target. The guide and the word "running"
   carry the meaning; no colour or animation is load-bearing, and the text keeps
   >=4.5:1 on both the selected and unselected row backgrounds. One visual line
   each, in the order reported - never carouselled, never reordered by elapsed,
   never with the third child hidden. The full detail (label and tokens) is on
   hover and keyboard focus via the title/aria-label. */
.jarvis-workspace-enabled .agent-sidebar__subagents {
  margin-top: 4px;
  padding-left: 8px;
  border-left: 1px solid #3a3a3a;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.jarvis-workspace-enabled .agent-sidebar__subagent {
  font-size: 11px;
  line-height: 16px;
  color: #b4b4b4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.jarvis-workspace-enabled .agent-sidebar__row--selected .agent-sidebar__subagent { color: #c8c8c8; }
.jarvis-workspace-enabled .agent-sidebar__subagent:focus-visible { outline: 2px solid #cccccc; outline-offset: 1px; }
/* The row grows to fit its children rather than clipping them, and the avatar
   stays with the top of the content as it does. */
.jarvis-workspace-enabled .agent-sidebar__row { align-items: flex-start; }
.jarvis-workspace-enabled #agent-stage-root:not(.jw-overview-hidden) { background: #181818; }

/* Waiting was amber and error was salmon. Under colour-vision simulation the
   two sat about 4 dE apart on the text and under 2 dE on the fill, which is no
   separation at all. Waiting moves to blue and takes the rounded shape; error
   keeps the warm hue and takes a dashed edge. Checked by
   workspace/status-colours.test.ts, which fails if the pair closes up again. */
.jarvis-workspace-enabled .agent-sidebar__statuspill:is(.agent-status--awaiting_approval, .agent-status--awaiting_input) { color: #8fb8f0; background: #232c39; border-color: #3d5a80; border-style: solid; border-radius: 999px; }
.jarvis-workspace-enabled .agent-sidebar__statuspill:is(.agent-status--errored, .agent-status--dead, .agent-status--stuck) { color: #ef988c; background: #392b29; border-color: #714b44; border-style: dashed; border-radius: 3px; }

.jarvis-workspace-enabled .agents-v2-shell { background: #181818; border-color: #303030; box-shadow: none; }
.jarvis-workspace-enabled .agents-v2-shell::before { display: none; }

/* Plans has legacy literal colours rather than shell tokens. */
.jarvis-workspace-enabled body:not(.view-active-budget) :is(.plans-sidebar, .plans-toolbar) { background: #242424; }
.jarvis-workspace-enabled body:not(.view-active-budget) .plans-canvas-wrap { background: #181818; }
.jarvis-workspace-enabled body:not(.view-active-budget) .plans-sidebar-item:hover { background: #2c2c2c; }
.jarvis-workspace-enabled body:not(.view-active-budget) .plans-sidebar-item.active { background: #343434; }
.jarvis-workspace-enabled body:not(.view-active-budget) .plans-sidebar-item-status:is(.status-in_progress, .status-done) { background: #383838; color: #dddddd; }

/* ChatGPT (Codex) usage card, under the three Claude rings in the usage panel.
   Lives here because public/style.css is fenced. Deliberately NOT a fourth
   ring: a ring has to draw an arc, and an arc cannot say "unknown". This card
   can, and it has to, because Codex only stamps its 5 hour window on some
   snapshots. Not a colour-only design either: the state is spelled out in
   words, in the same spirit as the status pills above. */
.usage-codex {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle, #303030);
  border-radius: 8px;
  background: var(--surface-0, #212121);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.usage-codex__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.usage-codex__name {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-dim, #bcbcbc);
}
.usage-codex__age {
  font-size: 10px;
  color: #9a9a9a;
}
.usage-codex__figures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.usage-codex__figure {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.usage-codex__value {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.1;
  color: #ededed;
}
/* An unreadable number is a word, never a zero. Smaller and dimmer than a
   real figure so it never reads as one at a glance. */
.usage-codex__value--unknown {
  font-size: 12px;
  font-weight: 500;
  font-style: italic;
  color: #9a9a9a;
}
.usage-codex__label {
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #9a9a9a;
}
.usage-codex__reset {
  font-size: 10px;
  color: #7d7d7d;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.usage-codex[data-state="not-connected"] {
  border-style: dashed;
}
.usage-codex__empty {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: #9a9a9a;
}

.header-usage {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  border-radius: 6px;
  padding: 3px 6px;
  margin: -3px -6px;
  outline: none;
}
.header-usage:hover { background: #2a2a2a; }
.header-usage:focus-visible { outline: 2px solid #dedede; outline-offset: 2px; }
.header-usage[aria-expanded="true"] { background: #2a2a2a; }
/* One compact row: bar + percent, nothing underneath (Rishi 2026-09-11:
   "This whole section looks terrible now. Just make it so if I click on the
   bars it gives me the extra info."). The detail lives in the click panel. */
.header-usage__slot {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #dedede;
  outline: none;
}
.header-usage__track { width: 32px; height: 4px; overflow: hidden; border-radius: 999px; background: #303030; }
.header-usage__track--unknown { background: repeating-linear-gradient(135deg, #626262 0 2px, #303030 2px 4px); }
.header-usage__fill { display: block; height: 100%; border-radius: inherit; }
.header-usage__slot--session .header-usage__fill { background: #3987e5; }
.header-usage__slot--week .header-usage__fill { background: #d95926; }
.header-usage__slot--fable .header-usage__fill { background: #199e70; }
.header-usage__slot--chatgpt .header-usage__fill { background: #c98500; }
.header-usage__value { width: 28px; font-variant-numeric: tabular-nums; text-align: left; }
.header-usage__slot[data-stale="true"] .header-usage__value {
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  opacity: .75;
}
/* Click panel: one small dialog under the meter row listing all four with
   the full reset date and time. Charcoal, grey border, no status colours -
   a stale reading is said in words, never in red or green. */
.header-right { position: relative; }
.usage-panel {
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  width: 400px;
  max-width: calc(100vw - 32px);
  box-sizing: border-box;
  padding: 16px 18px;
  background: #1c1c1c;
  border: 1px solid #3a3a3a;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
  color: #dedede;
  font-size: 14px;
  line-height: 1.45;
  z-index: 60;
  white-space: normal;
}
.usage-panel__title { font-size: 15px; font-weight: 600; color: #f2f2f2; }
.usage-panel__sub { font-size: 12px; color: #9a9a9a; margin-top: 2px; margin-bottom: 8px; }
.usage-panel__row { padding: 10px 0; border-top: 1px solid #2c2c2c; }
.usage-panel__row:last-child { padding-bottom: 0; }
.usage-panel__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 2px; }
.usage-panel__name { font-weight: 600; color: #f2f2f2; }
.usage-panel__pct { font-variant-numeric: tabular-nums; color: #f2f2f2; }
.usage-panel__line { color: #b8b8b8; }
/* end usage-panel */
/* The clock and the agent count must never be pushed off the bar, so the
   stats are the thing that goes when the header runs out of room. */
@media (max-width: 1100px) {
  .header-usage { display: none; }
}
