/*
 * Product-faithful Codex workspace. This is application chrome inside the
 * Learn layout, not a second operating-system window. Colors, sizes, pane
 * hierarchy, and composer treatment come from @openai/codex-mini/src/index.css
 * and the package's actual Sidebar, Composer, and App components.
 */

.lab-shell {
  --lesson-rail-width: clamp(352px, 30.5vw, 414px);
  --codex-ui-text-size: 13px;
  --codex-ui-text-size-sm: 12px;
  --codex-ui-text-size-header: 24px;
  --codex-ink: #1a1c1f;
  --codex-ink-secondary: rgb(26 28 31 / 75%);
  --codex-muted: rgb(26 28 31 / 50%);
  --codex-faint: rgb(26 28 31 / 43%);
  --codex-line: rgb(26 28 31 / 8%);
  --codex-line-strong: rgb(26 28 31 / 12%);
  --codex-paper: #fff;
  --codex-canvas: #fff;
  --codex-sidebar: #f9f9f9;
  --codex-hover: rgb(26 28 31 / 5%);
  --codex-blue: #339cff;
  --codex-green: #00a240;
  --codex-red: #ba2623;
  --codex-editor-background: rgb(237 237 237 / 40%);
  --codex-editor-added: rgb(0 162 64 / 15%);
  --codex-editor-deleted: rgb(186 38 35 / 15%);
  --codex-shadow-elevated: 0 4px 16px rgb(0 0 0 / 5%);
  --codex-sidebar-width: 224px;
  --codex-thread-width: 768px;
  --codex-composer-width: 768px;
  --codex-drawer-width: clamp(310px, 27vw, 370px);
  --codex-product-font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Match the production Codex Mini component's own verified dark tokens. */
html[data-theme="dark"] .lab-shell {
  --codex-ink: #fff;
  --codex-ink-secondary: rgb(255 255 255 / 70%);
  --codex-muted: rgb(255 255 255 / 50%);
  --codex-faint: rgb(255 255 255 / 43%);
  --codex-line: rgb(255 255 255 / 8%);
  --codex-line-strong: rgb(255 255 255 / 16%);
  --codex-paper: #181818;
  --codex-canvas: #181818;
  --codex-sidebar: #000;
  --codex-hover: rgb(255 255 255 / 8%);
  --codex-green: #40c977;
  --codex-red: #ff6764;
  --codex-editor-background: #212121;
  --codex-editor-added: rgb(64 201 119 / 23%);
  --codex-editor-deleted: rgb(255 103 100 / 23%);
  --codex-shadow-elevated: 0 4px 16px rgb(0 0 0 / 36%);
}

@media (min-width: 691px) {
  .lab-shell .lab-header {
    background: linear-gradient(
      90deg,
      #111110 0,
      #111110 var(--lesson-rail-width),
      var(--codex-canvas) var(--lesson-rail-width),
      var(--codex-canvas) 100%
    );
  }

  .lab-shell .lab-brand {
    color: #f6f4ef;
  }

  .lab-shell .lab-brand span + span {
    color: #aaa59d;
  }
}

.lab-shell .lab-main {
  grid-template-columns: var(--lesson-rail-width) minmax(0, 1fr);
}

.lab-shell .lesson-panel .lesson-scroll {
  padding-right: clamp(27px, 3.1vw, 45px);
  padding-left: clamp(27px, 3.1vw, 45px);
}

/*
 * The production Codex Mini component renders into its own Shadow DOM and
 * supplies its authentic interface, tokens, and interactions. Style only its
 * outer mount point; the source-matched rules below are an offline fallback.
 */

.lab-shell .workspace-panel.codex-mini-live,
.lab-shell .workspace-panel:has(> .codex-mini-live-stage) {
  display: grid;
  min-width: max-content;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
  background: var(--codex-paper);
}

.lab-shell .workspace-panel.codex-mini-live {
  container-type: inline-size;
}

.codex-mini-live-stage,
.codex-mini-stage {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
  isolation: isolate;
  background: var(--codex-paper);
  color: var(--codex-ink);
  font-family: var(--codex-product-font);
}

.codex-mini-host {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  grid-column: 1;
  grid-row: 1;
  overflow: hidden;
  background: var(--codex-paper);
}

.codex-mini-host > * {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

/*
 * React can resolve before the official Mini shadow tree has hydrated and the
 * course bridge has applied its source-backed workspace state. Keep that raw
 * surface out of both the visual and focus trees until the workspace itself
 * publishes ready; the adjacent status remains the honest loading surface.
 */
.workspace-panel[data-codex-mini-state="loading"] .codex-mini-host {
  visibility: hidden;
  pointer-events: none;
}

.codex-mini-host[data-codex-mini="loading"] {
  display: grid;
  place-items: center;
  color: var(--codex-muted);
  font-size: var(--codex-ui-text-size);
}

.codex-mini-loading {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--codex-paper);
  color: var(--codex-muted);
  font-size: var(--codex-ui-text-size);
  pointer-events: none;
}

.workspace-panel[data-codex-mini-state="ready"] .codex-mini-loading,
.workspace-panel[data-codex-mini-state="fallback"] .codex-mini-loading {
  display: none;
}

.codex-mini-host[data-codex-mini="fallback"] {
  display: none;
}

.codex-mini-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  grid-column: 1;
  grid-row: 1;
  grid-template-columns: var(--codex-sidebar-width) minmax(0, 1fr);
  overflow: hidden;
  background: var(--codex-paper);
}

.codex-mini-fallback[hidden],
.workspace-panel[data-codex-mini-state="loading"] > .codex-mini-fallback,
.workspace-panel[data-codex-mini-state="ready"] > .codex-mini-fallback,
.codex-mini-host[data-codex-mini="ready"] ~ .codex-mini-fallback {
  display: none !important;
}

.workspace-panel[data-codex-mini-state="fallback"] > .codex-mini-live-stage {
  display: none;
}

.workspace-panel[data-codex-mini-state="fallback"] > .codex-mini-fallback {
  display: grid;
}

.codex-mini-course-overlay {
  position: absolute;
  z-index: 4;
  top: 56px;
  right: 13px;
  display: grid;
  width: max-content;
  max-width: min(340px, calc(100% - 26px));
  justify-items: end;
  gap: 8px;
  pointer-events: none;
}

.codex-mini-course-overlay > * {
  max-width: 100%;
  pointer-events: auto;
}

.codex-mini-course-overlay[hidden],
.codex-mini-course-overlay:empty {
  display: none;
}

/* Course guidance may point at real controls without entering the Codex UI. */

.codex-course-cue {
  position: absolute;
  z-index: 95;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.codex-course-cue[hidden] {
  display: none;
}

.codex-course-cue-halo {
  position: absolute;
  top: var(--codex-cue-y);
  left: var(--codex-cue-x);
  box-sizing: border-box;
  width: var(--codex-cue-width);
  height: var(--codex-cue-height);
  border: 2px solid var(--codex-blue);
  border-radius: var(--codex-cue-radius, 9px);
  background: transparent;
  box-shadow: 0 0 0 4px rgb(51 156 255 / 14%);
  pointer-events: none;
  animation: codex-course-cue-flash 700ms ease-out 2;
}

.codex-course-cue-label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
  pointer-events: none;
}

@keyframes codex-course-cue-flash {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgb(51 156 255 / 14%);
  }

  55% {
    box-shadow: 0 0 0 8px rgb(51 156 255 / 4%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .codex-course-cue-halo {
    animation: none !important;
  }
}

.codex-mini-overlay-card,
.codex-mini-approval,
.codex-mini-guidance,
.codex-mini-error {
  display: grid;
  min-width: 0;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid var(--codex-line);
  border-radius: 12px;
  background: rgb(255 255 255 / 96%);
  box-shadow: var(--codex-shadow-elevated);
  color: var(--codex-ink);
  font-size: var(--codex-ui-text-size-sm);
  line-height: 1.5;
  backdrop-filter: blur(12px);
}

.codex-mini-course-action,
.codex-mini-plan-toggle,
.codex-mini-course-overlay button {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid var(--codex-line-strong);
  border-radius: 999px;
  background: var(--codex-paper);
  color: var(--codex-ink);
  font-size: var(--codex-ui-text-size-sm);
  font-weight: 500;
}

.codex-mini-course-action:hover,
.codex-mini-plan-toggle:hover,
.codex-mini-course-overlay button:hover {
  background: var(--codex-sidebar);
}

.codex-mini-course-overlay .primary-button,
.codex-mini-approval .codex-mini-course-action {
  border-color: transparent;
  background: var(--codex-ink);
  color: #fff;
}

.codex-mini-course-overlay .primary-button:hover,
.codex-mini-approval .codex-mini-course-action:hover {
  background: #34363a;
}

.codex-mini-plan-toggle[aria-pressed="true"] {
  border-color: rgb(51 156 255 / 30%);
  background: rgb(51 156 255 / 8%);
  color: #196cb9;
}

.codex-mini-course-overlay svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

/* Course-only approvals live in the dark guide, never over the real product. */

.lab-shell .lesson-panel .codex-mini-lesson-actions {
  display: grid;
  justify-items: start;
  gap: 10px;
  margin: 19px 0 8px;
}

.lab-shell .lesson-panel .codex-mini-lesson-actions .primary-button,
.lab-shell .lesson-panel .codex-mini-lesson-actions .codex-mini-course-action {
  min-height: 39px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: #f5f2ec;
  color: #161513;
  font-size: 12px;
  font-weight: 580;
}

.lab-shell .lesson-panel .codex-mini-lesson-actions .primary-button:hover,
.lab-shell .lesson-panel .codex-mini-lesson-actions .codex-mini-course-action:hover {
  background: #fff;
}

.lab-shell .lesson-panel .codex-mini-plan-toggle {
  min-height: 39px;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid rgb(255 255 255 / 19%);
  border-radius: 9px;
  background: rgb(255 255 255 / 5%);
  color: #f6f4ef;
  font-size: 12px;
  font-weight: 540;
}

.lab-shell .lesson-panel .codex-mini-plan-toggle:hover {
  border-color: rgb(255 255 255 / 28%);
  background: rgb(255 255 255 / 9%);
}

.lab-shell .lesson-panel .codex-mini-plan-toggle.active,
.lab-shell .lesson-panel .codex-mini-plan-toggle[aria-pressed="true"] {
  border-color: rgb(169 211 255 / 43%);
  background: rgb(169 211 255 / 13%);
  color: #d9ebff;
}

.lab-shell .lesson-panel .codex-mini-plan-toggle svg,
.lab-shell .lesson-panel .codex-mini-lesson-actions .primary-button svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
}

.lab-shell .lesson-panel .codex-mini-lesson-actions.codex-mini-approval {
  padding: 14px;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 11px;
  background: #191918;
  box-shadow: none;
  color: #f6f4ef;
}

.lab-shell .lesson-panel .codex-mini-lesson-actions .approval-note,
.lab-shell .lesson-panel .codex-mini-lesson-actions .composer-validation {
  width: auto;
  margin: 0;
  color: #c5c1ba;
  font-size: 11px;
  line-height: 1.55;
}

.lab-shell .lesson-panel .codex-mini-lesson-actions .composer-validation {
  color: #f5d39c;
}

/* Source-matched fallback; the genuine mounted component remains untouched. */

.workspace-panel.codex-desktop-window {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-columns: var(--codex-sidebar-width) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
  background: var(--codex-canvas);
  color: var(--codex-ink);
  font-family: var(--codex-product-font);
  font-size: var(--codex-ui-text-size);
  line-height: 20px;
}

.desktop-main {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: 46px minmax(0, 1fr);
  overflow: hidden;
  background: var(--codex-paper);
}

.desktop-windowbar {
  display: grid;
  min-width: 0;
  height: 46px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  border-bottom: 1px solid var(--codex-line);
  background: var(--codex-canvas);
}

.desktop-project-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  color: var(--codex-ink);
  font-size: var(--codex-ui-text-size);
}

.desktop-project-selector {
  display: inline-flex;
  min-width: 0;
  min-height: 28px;
  align-items: center;
  gap: 8px;
  padding: 0 5px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--codex-ink);
  font: inherit;
  font-weight: 500;
}

.desktop-project-selector:hover {
  background: var(--codex-hover);
}

.desktop-project-selector > svg,
.desktop-project-identity > svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: var(--codex-muted);
}

.desktop-project-icon {
  display: grid;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  place-items: center;
  border-radius: 4px;
  background: transparent;
}

.desktop-project-icon svg {
  width: 13px;
  height: 13px;
}

.desktop-project-name,
.desktop-task-context,
.desktop-session-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desktop-project-divider {
  color: #c5c4bf;
}

.desktop-task-context,
.desktop-session-label {
  color: var(--codex-ink);
  font-weight: 500;
}

.desktop-window-actions,
.thread-header-actions {
  display: flex;
  min-width: 0;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.desktop-toolbar-action,
.inspector-toggle {
  display: inline-flex;
  min-width: 28px;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid var(--codex-line);
  border-radius: 999px;
  background: transparent;
  color: var(--codex-muted);
  font-size: var(--codex-ui-text-size-sm);
}

.desktop-toolbar-action:hover,
.inspector-toggle:hover,
.desktop-toolbar-action[aria-expanded="true"] {
  background: var(--codex-hover);
  color: var(--codex-ink);
}

.desktop-toolbar-action svg,
.inspector-toggle svg {
  width: 15px;
  height: 15px;
}

.desktop-environment-toggle {
  display: inline-flex;
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--codex-muted);
}

.desktop-files-toggle {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  border-radius: 8px;
  color: rgb(26 28 31 / 50%);
}

.desktop-environment-toggle:hover,
.desktop-environment-toggle[aria-expanded="true"] {
  background: var(--codex-hover);
  color: var(--codex-ink);
}

.desktop-files-toggle:hover {
  background: var(--codex-hover);
}

.desktop-files-toggle[aria-pressed="true"] {
  background: rgb(26 28 31 / 5%);
  color: var(--codex-ink);
}

.desktop-files-toggle[aria-pressed="true"]:hover {
  background: rgb(26 28 31 / 10%);
}

.desktop-environment-toggle svg {
  width: 17px;
  height: 17px;
}

.desktop-files-toggle svg {
  width: 16px;
  height: 16px;
  transform: rotate(180deg);
}

.desktop-files-toggle:focus-visible {
  outline: none;
}

.codex-mini-fallback .codex-side-panel-tooltip {
  position: fixed;
  z-index: 50;
  display: flex;
  max-width: min(320px, calc(100vw - 16px));
  max-height: calc(100vh - 16px);
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  padding: 4px 8px;
  border: 1px solid var(--codex-line);
  border-radius: 10px;
  background: var(--codex-paper);
  color: var(--codex-ink);
  font: 400 13px/19px var(--codex-product-font);
  overflow-wrap: anywhere;
  white-space: normal;
  pointer-events: none;
  user-select: none;
}

.codex-mini-fallback .codex-side-panel-tooltip[hidden] {
  display: none;
}

.codex-mini-fallback .codex-side-panel-tooltip kbd {
  display: inline-flex;
  padding: 2px 6px;
  border: 0;
  border-radius: 8px;
  background: color-mix(in srgb, currentColor 10%, transparent);
  color: currentColor;
  box-shadow: none;
  font: 400 12px/12px var(--codex-product-font);
}

html[data-theme="dark"] .codex-mini-fallback .codex-side-panel-tooltip {
  border-color: rgb(255 255 255 / 8.2%);
  background: #2d2d2d;
  color: #fff;
}

html[data-theme="dark"] .desktop-files-toggle[aria-pressed="true"] {
  background: rgb(255 255 255 / 5%);
  color: var(--codex-ink);
}

html[data-theme="dark"] .desktop-files-toggle:not([aria-pressed="true"]) {
  color: rgb(255 255 255 / 50%);
}

html[data-theme="dark"] .desktop-files-toggle[aria-pressed="true"]:hover {
  background: rgb(255 255 255 / 10%);
}

.codex-mini-fallback .codex-environment-panel {
  position: absolute;
  z-index: 5;
  top: 52px;
  right: 9px;
  box-sizing: border-box;
  width: min(292px, calc(100% - 18px));
  max-height: calc(100% - 62px);
  overflow: auto;
  padding: 12px 8px 9px;
  border: 1px solid var(--codex-line-strong);
  border-radius: 20px;
  background: var(--codex-paper);
  color: var(--codex-ink);
  box-shadow: 0 8px 28px rgb(26 28 31 / 11%);
  font-size: 13px;
  line-height: 19px;
}

.codex-mini-fallback .codex-environment-panel[hidden] {
  display: none;
}

.codex-environment-heading {
  margin: 0 0 6px;
  padding: 0 8px;
  color: var(--codex-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 20px;
}

.codex-environment-row {
  box-sizing: border-box;
  display: flex;
  width: 100%;
  height: 35px;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 0 7px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}

button.codex-environment-row:hover,
button.codex-environment-row:focus-visible {
  background: var(--codex-hover);
}

.codex-environment-row > svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}

.codex-environment-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.codex-environment-counts {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.codex-environment-additions {
  color: var(--codex-green);
}

.codex-environment-deletions {
  color: var(--codex-red);
}

/* Match the real searchable Codex branch-switching menu. */
.codex-mini-fallback .codex-environment-branch-trigger {
  cursor: pointer;
}

.codex-mini-fallback .codex-environment-branch-trigger > .codex-branch-chevron {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  margin-left: auto;
  color: var(--codex-muted);
}

.codex-mini-fallback .codex-environment-branch-trigger:disabled {
  opacity: 0.55;
  cursor: progress;
}

.codex-mini-fallback .codex-branch-picker {
  display: grid;
  box-sizing: border-box;
  width: min(288px, 100%);
  min-width: 0;
  gap: 6px;
  margin: 6px 0 2px auto;
  overflow: hidden;
  padding: 7px;
  border: 1px solid var(--codex-line-strong);
  border-radius: 12px;
  background: var(--codex-paper);
  color: var(--codex-ink);
  box-shadow: var(--codex-shadow-elevated);
}

.codex-mini-fallback .codex-branch-search-wrap {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  padding: 0 7px;
}

.codex-mini-fallback .codex-branch-search-wrap > svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  color: var(--codex-muted);
}

.codex-mini-fallback .codex-branch-search {
  box-sizing: border-box;
  width: 100%;
  height: 34px;
  min-width: 0;
  padding: 0 7px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--codex-ink);
  font: inherit;
}

.codex-mini-fallback .codex-branch-search-wrap > .codex-branch-search {
  padding-right: 0;
  padding-left: 0;
}

.codex-mini-fallback .codex-branch-search::placeholder {
  color: var(--codex-muted);
}

.codex-mini-fallback .codex-branch-section {
  margin: 0;
  padding: 5px 7px 2px;
  color: var(--codex-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
}

.codex-mini-fallback .codex-branch-list {
  display: grid;
  min-width: 0;
  max-height: 200px;
  gap: 2px;
  overflow-y: auto;
}

.codex-mini-fallback .codex-branch-option {
  display: flex;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 32px;
  align-items: center;
  gap: 8px;
  padding: 0 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.codex-mini-fallback .codex-branch-option:hover,
.codex-mini-fallback .codex-branch-option:focus-visible {
  background: var(--codex-hover);
}

.codex-mini-fallback .codex-branch-search:focus-visible,
.codex-mini-fallback .codex-branch-option:focus-visible {
  outline: 2px solid var(--codex-blue);
  outline-offset: -2px;
}

.codex-mini-fallback .codex-branch-option > svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
}

.codex-mini-fallback .codex-branch-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.codex-mini-fallback .codex-branch-option > .codex-branch-check {
  margin-left: auto;
  color: var(--codex-ink);
}

.codex-mini-fallback .codex-branch-empty {
  margin: 0;
  padding: 9px 7px;
  color: var(--codex-muted);
  font-size: 12px;
}

@media (max-width: 390px) {
  .codex-mini-fallback .codex-branch-picker {
    width: 100%;
  }

  .codex-mini-fallback .codex-branch-option {
    min-height: 34px;
  }
}

.desktop-sandbox-indicator {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  gap: 5px;
  padding: 0 7px;
  color: var(--codex-muted);
  font-size: 10px;
  white-space: nowrap;
}

.desktop-sandbox-indicator svg {
  width: 13px;
  height: 13px;
}

/* Project navigation, the task thread, and an optional document drawer. */

.desktop-workspace-body {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-columns: minmax(280px, 1fr) minmax(0, var(--codex-drawer-width));
  overflow: hidden;
  background: var(--codex-canvas);
}

.desktop-workspace-body[data-inspector-open="false"] {
  grid-template-columns: minmax(0, 1fr);
}

.desktop-workspace-body[data-inspector-open="false"] .inspector-pane {
  display: none;
}

.project-rail {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  gap: 1px;
  padding: 8px;
  overflow: hidden;
  border-right: 1px solid var(--codex-line);
  background: var(--codex-sidebar);
}

.project-rail-header {
  display: flex;
  min-height: 39px;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 0 8px;
  color: var(--codex-ink);
  font-size: 17px;
  font-weight: 600;
}

.project-rail-header .project-rail-label {
  font-size: 17px;
  font-weight: 600;
}

.project-rail-product-chevron {
  width: 13px;
  height: 13px;
  margin-left: -4px;
  color: var(--codex-muted);
}

.codex-product-mark {
  display: block;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  object-fit: contain;
}

.project-rail-header > svg,
.project-rail-icon svg {
  width: 16px;
  height: 16px;
}

.project-rail-item,
.project-rail-thread {
  display: flex;
  min-width: 0;
  min-height: 30px;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--codex-ink-secondary);
  text-align: left;
}

.project-rail-item:hover,
.project-rail-thread:hover {
  background: var(--codex-hover);
  color: var(--codex-ink);
}

.project-rail-item.active,
.project-rail-thread.active {
  background: rgb(26 28 31 / 8%);
  color: var(--codex-ink);
}

.project-rail-new-task {
  color: var(--codex-ink);
  font-weight: 540;
}

.project-rail-icon {
  display: grid;
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  place-items: center;
}

.project-rail-item > svg,
.project-rail-thread > svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.project-rail-label {
  min-width: 0;
  overflow: hidden;
  font-size: var(--codex-ui-text-size);
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-rail-section,
.project-rail-section-title {
  display: block;
  margin: 17px 8px 5px;
  color: var(--codex-muted);
  font-size: var(--codex-ui-text-size);
  font-weight: 530;
}

.project-rail-section .project-rail-section-title {
  margin: 0;
}

.project-rail-section:has(> .project-rail-add) {
  display: flex;
  min-height: 26px;
  align-items: center;
  justify-content: space-between;
}

.project-rail-add {
  display: inline-grid;
  width: 20px;
  height: 20px;
  flex: 0 0 26px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--codex-muted);
  cursor: pointer;
  opacity: .38;
  transition: background-color 120ms ease, color 120ms ease, opacity 120ms ease;
}

.project-rail-add svg {
  width: 15px;
  height: 15px;
}

.project-rail-section:hover > .project-rail-add,
.project-rail-section:focus-within > .project-rail-add,
.project-rail-add:focus-visible {
  color: var(--codex-ink-secondary);
  opacity: 1;
}

.project-rail-add:hover,
.project-rail-add:focus-visible {
  background: var(--codex-hover);
  color: var(--codex-ink);
}

.project-rail-add:focus-visible {
  outline: 2px solid var(--codex-blue);
  outline-offset: 2px;
}

.codex-project-picker {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgb(0 0 0 / 28%);
  font-family: var(--codex-product-font);
}

.codex-project-picker[hidden] {
  display: none;
}

.lab-shell.phase-practice:has(.codex-project-picker) {
  z-index: 90;
}

.lab-shell.phase-practice .practice-codex-frame:has(.codex-project-picker) {
  z-index: 20;
}

.codex-project-picker-dialog {
  display: grid;
  width: min(520px, 100%);
  max-height: min(560px, calc(100dvh - 48px));
  gap: 16px;
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--codex-line-strong);
  border-radius: 20px;
  background: var(--codex-paper);
  box-shadow: 0 18px 54px rgb(0 0 0 / 18%);
  color: var(--codex-ink);
}

.codex-project-picker-dialog.codex-project-type-dialog {
  width: min(680px, 100%);
  max-height: min(560px, calc(100dvh - 48px));
  gap: 36px;
  padding: 20px;
}

.codex-project-type-content {
  display: grid;
  min-width: 0;
  gap: 12px;
}

.codex-project-type-heading {
  margin: 0;
  color: var(--codex-ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.codex-project-type-options {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.codex-disabled-reason-wrap {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}

.codex-mini-fallback .codex-panel-picker-option,
.codex-project-source-list > .codex-disabled-reason-wrap > .codex-project-source-add {
  width: 100%;
}

.codex-project-type-option {
  display: flex;
  min-width: 0;
  min-height: 144px;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  border: 1px solid var(--codex-line);
  border-radius: 16px;
  background: transparent;
  color: var(--codex-ink);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.codex-project-type-option.is-selected,
.codex-project-type-option[aria-checked="true"] {
  border-color: transparent;
  background: rgb(0 0 0 / 5%);
}

.codex-project-type-option:disabled {
  cursor: default;
  opacity: .5;
}

.codex-project-type-option:hover:not(.is-selected) {
  background: var(--codex-hover);
}

.codex-project-type-option[aria-checked="false"] .codex-project-type-indicator-dot {
  display: none;
}

.codex-project-type-hint {
  margin: 0;
  color: var(--codex-ink-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.codex-project-type-hint[hidden] {
  display: none;
}

.lab-shell.phase-practice .codex-project-type-option:focus-visible {
  outline: 2px solid var(--codex-blue);
  outline-offset: -3px;
}

.codex-project-type-top {
  display: flex;
  width: 100%;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.codex-project-type-icon,
.codex-project-type-icon svg {
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  color: var(--codex-ink-secondary);
}

.codex-project-remote-icon {
  background: currentColor;
  mask: url("./project-remote-icon.svg") center / contain no-repeat;
}

.codex-project-type-indicator {
  display: grid;
  box-sizing: border-box;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  place-items: center;
  border: 1px solid var(--codex-ink-secondary);
  border-radius: 50%;
}

.codex-project-type-option[aria-checked="true"] .codex-project-type-indicator {
  border-color: var(--codex-blue);
}

.codex-project-type-indicator-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--codex-blue);
}

.codex-project-type-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
  margin-top: 24px;
}

.codex-project-type-label {
  color: var(--codex-ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
}

.codex-project-type-description {
  color: var(--codex-ink-secondary);
  font-size: 14px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.codex-project-create-header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.codex-project-picker-title {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -.04em;
  line-height: 1.2;
}

.codex-project-create-close {
  display: inline-grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--codex-ink-secondary);
  cursor: pointer;
}

.codex-project-create-close:hover:not(:disabled) {
  background: var(--codex-hover);
  color: var(--codex-ink);
}

.codex-project-create-close svg {
  width: 18px;
  height: 18px;
}

.codex-project-name-field {
  display: flex;
  height: 40px;
  min-width: 0;
  min-height: 40px;
  align-items: center;
  border: 1px solid var(--codex-line);
  border-radius: 12px;
  background: var(--codex-paper);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.codex-project-name-control {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.codex-project-name-field:focus-within {
  border-color: var(--codex-blue);
  box-shadow: 0 0 0 1px var(--codex-blue);
}

.codex-project-name-field.has-error,
.codex-project-name-field.has-error:focus-within {
  border-color: var(--codex-red);
  box-shadow: 0 0 0 1px var(--codex-red);
}

.codex-project-name-field > svg {
  box-sizing: content-box;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  padding: 10px 11px;
  border-right: 1px solid var(--codex-line);
  color: var(--codex-ink-secondary);
}

.codex-project-name-input {
  width: 100%;
  height: 38px;
  min-width: 0;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--codex-ink);
  font: inherit;
  font-size: 14px;
  outline: none;
}

.lab-shell .codex-project-name-field > .codex-project-name-input:focus-visible {
  outline: none;
  outline-offset: 0;
  box-shadow: none;
}

.codex-project-name-input::placeholder {
  color: var(--codex-muted);
}

.codex-project-name-error {
  margin: 0;
  color: var(--codex-red);
  font-size: 12px;
  line-height: 1.5;
}

.codex-project-source-heading {
  margin: 0 0 -7px;
  color: var(--codex-ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.codex-project-source-list {
  display: grid;
  width: 100%;
  min-width: 0;
  max-height: min(360px, calc(100dvh - 220px));
  overflow-y: auto;
  border: 1px solid var(--codex-line);
  border-radius: 10px;
  background: var(--codex-paper);
}

.codex-project-source-row,
.codex-project-source-add {
  display: flex;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 48px;
  min-height: 48px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--codex-ink);
  font: inherit;
  font-size: 12px;
  text-align: start;
}

.codex-project-source-add {
  cursor: pointer;
  transition: background-color 120ms ease;
}

.codex-project-source-row + .codex-project-source-add {
  border-top: 1px solid var(--codex-line);
}

.codex-project-source-row + .codex-disabled-reason-wrap {
  border-top: 1px solid var(--codex-line);
}

.codex-project-source-add.is-empty {
  height: 96px;
  min-height: 96px;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  text-align: center;
}

.codex-project-source-icon {
  display: grid;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  place-items: center;
  color: var(--codex-muted);
}

.codex-project-source-icon svg {
  width: 100%;
  height: 100%;
}

.codex-project-source-copy {
  max-width: 100%;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.codex-project-source-name {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  color: var(--codex-ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.codex-project-source-remove {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  margin-left: auto;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--codex-ink-secondary);
  cursor: pointer;
}

.codex-project-source-remove svg {
  width: 16px;
  height: 16px;
}

.codex-project-source-add-label {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.codex-project-source-add:hover:not(:disabled),
.codex-project-source-remove:hover:not(:disabled) {
  background: var(--codex-hover);
}

.codex-project-create-close:focus-visible,
.codex-project-source-add:focus-visible,
.codex-project-source-remove:focus-visible,
.codex-project-picker-actions button:focus-visible {
  outline: 2px solid var(--codex-blue);
  outline-offset: 2px;
}

.codex-project-picker-actions {
  display: flex;
  min-width: 0;
  justify-content: flex-end;
  gap: 12px;
}

.codex-project-picker-actions button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--codex-ink);
  color: var(--codex-paper);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.codex-project-picker-actions .codex-project-picker-cancel {
  border-color: transparent;
  background: transparent;
  color: var(--codex-ink-secondary);
}

.codex-project-picker-actions .codex-project-picker-cancel:hover {
  background: var(--codex-hover);
  color: var(--codex-ink);
}

.codex-project-picker-actions .codex-project-create-submit:hover:not(:disabled) {
  opacity: .88;
}

.codex-project-create-close:disabled,
.codex-project-source-add:disabled,
.codex-project-source-remove:disabled,
.codex-project-picker-actions button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.project-rail-project {
  font-weight: 540;
}

.project-rail-thread {
  min-height: 36px;
  align-items: flex-start;
  padding-top: 7px;
}

.project-rail-thread .project-rail-icon {
  margin-top: 1px;
}

.project-rail-thread-meta {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: var(--codex-faint);
  font-size: var(--codex-ui-text-size-sm);
  font-weight: 400;
  text-overflow: ellipsis;
}

.project-rail-footer {
  display: flex;
  min-height: 38px;
  min-width: 0;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding: 10px 7px 0;
  border-top: 1px solid var(--codex-line);
}

.project-rail-avatar {
  border-radius: 50%;
  background: #dddcd7;
  color: var(--codex-ink);
  font-size: 10px;
  font-weight: 620;
}

/* The conversation is the product, not a narrow pane between two cards. */

.desktop-thread-panel {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  border: 0;
  background: var(--codex-paper);
}

.thread-header {
  display: none;
  min-width: 0;
  min-height: 57px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 21px;
  border-bottom: 1px solid rgb(29 29 27 / 6%);
  background: var(--codex-paper);
}

.thread-heading {
  min-width: 0;
}

.thread-title {
  display: block;
  overflow: hidden;
  color: var(--codex-ink);
  font-size: 12px;
  font-weight: 590;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-subtitle,
.thread-context,
.thread-status-label {
  overflow: hidden;
  color: var(--codex-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-subtitle {
  display: block;
  margin-top: 3px;
}

.thread-context,
.thread-status-label {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  gap: 5px;
}

.thread-context svg,
.thread-status-label svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}

.desktop-thread-panel .codex-messages.thread-timeline {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 42px 16px 25px;
  overflow-y: auto;
  background: var(--codex-paper);
  scrollbar-color: rgb(29 29 27 / 20%) transparent;
}

.desktop-thread-panel .thread-timeline > *,
.desktop-thread-panel .thread-timeline > .codex-linear-activity {
  width: min(100%, calc(var(--codex-thread-width) - 32px));
}

.conversation-task-heading {
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 18px 0 8px;
  text-align: center;
}

.conversation-home-logo,
.conversation-home-logo.codex-product-mark {
  display: block;
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  color: var(--codex-ink);
  object-fit: contain;
  opacity: 0.3;
}

.conversation-task-title {
  margin: 0;
  color: var(--codex-ink);
  font-size: var(--codex-ui-text-size-header);
  font-weight: 580;
  letter-spacing: -0.045em;
  line-height: 1.18;
  text-wrap: balance;
}

.conversation-home-state {
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  margin-block: auto;
  text-align: center;
}

.conversation-home-state .conversation-task-heading {
  margin: 0;
  padding: 0;
  font: inherit;
  letter-spacing: inherit;
  line-height: inherit;
}

.conversation-task-subtitle {
  margin: -12px 0 5px;
  color: var(--codex-muted);
  font-size: var(--codex-ui-text-size-sm);
  line-height: 1.55;
}

.timeline-heading {
  display: flex;
  min-height: 30px;
  align-items: center;
  gap: 8px;
  color: var(--codex-ink);
  font-size: var(--codex-ui-text-size);
  font-weight: 560;
}

.timeline-heading svg {
  width: 18px;
  height: 18px;
}

.conversation-badge,
.timeline-session {
  color: var(--codex-muted);
  font-size: var(--codex-ui-text-size-sm);
  font-weight: 420;
}

.desktop-thread-panel .timeline-session.system-event {
  min-height: 24px;
  margin-top: -12px;
  padding: 0;
  border: 0;
  background: transparent;
}

.desktop-thread-panel .message {
  min-width: 0;
  gap: 11px;
}

.desktop-thread-panel .message-avatar {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border: 0;
  background: #f1f0ed;
}

.desktop-thread-panel .message-avatar svg {
  width: 15px;
  height: 15px;
}

.desktop-thread-panel .message-body {
  min-width: 0;
  color: #3b3b37;
  font-size: var(--codex-ui-text-size);
  line-height: 1.78;
  overflow-wrap: anywhere;
}

.desktop-thread-panel .message-body p,
.desktop-thread-panel .message-body ol {
  margin-top: 0;
}

.codex-mini-fallback .assistant-message .codex-staged-preview-action {
  margin: .7em 0 0;
}

.codex-mini-fallback .assistant-message .codex-staged-preview-link {
  color: #2563eb;
  text-decoration: none;
}

.codex-mini-fallback .assistant-message .codex-staged-preview-link:hover {
  text-decoration: underline;
}

.codex-mini-fallback .assistant-message .codex-staged-preview-link:focus-visible {
  border-radius: 3px;
  outline: 2px solid #339cff;
  outline-offset: 2px;
}

.codex-mini-fallback .assistant-message .message-body .codex-source-citation {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 4px;
  color: #2563eb;
  vertical-align: baseline;
}

.codex-mini-fallback .assistant-message .message-body .codex-source-citation:hover {
  text-decoration: underline;
}

.codex-mini-fallback .assistant-message .message-body .codex-source-citation .codex-repo-file-icon,
.codex-mini-fallback .assistant-message .message-body .codex-source-citation .codex-repo-type-glyph {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

.codex-mini-fallback .assistant-message .message-body li > ul,
.codex-mini-fallback .assistant-message .message-body li > ol {
  max-width: 100%;
  margin: .2em 0 .35em;
  padding-inline-start: 1.35em;
  overflow-wrap: anywhere;
}

.codex-mini-fallback .assistant-message .message-body li > ul {
  list-style: disc;
}

.codex-mini-fallback [data-codex-proposed-plan] {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  max-height: 200px;
  border-color: var(--codex-line-strong) !important;
  background: color-mix(in srgb, var(--codex-paper) 95%, var(--codex-ink)) !important;
  color: var(--codex-ink);
}

.codex-mini-fallback [data-codex-plan-header] {
  color: var(--codex-muted);
}

.codex-mini-fallback [data-codex-plan-icon] {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.codex-mini-fallback .codex-plan-open-button {
  display: inline-flex;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.codex-mini-fallback .codex-plan-open-button:hover {
  background: var(--codex-hover);
}

.codex-mini-fallback .codex-plan-open-button:focus-visible {
  outline: 2px solid var(--codex-blue);
  outline-offset: -2px;
}

.codex-mini-fallback [data-codex-plan-markdown] {
  min-width: 0;
  color: var(--codex-ink);
  font-size: 13px;
  line-height: 21px;
  overflow-wrap: anywhere;
}

.codex-mini-fallback [data-codex-plan-markdown] h1,
.codex-mini-fallback [data-codex-plan-markdown] h2,
.codex-mini-fallback [data-codex-plan-markdown] h3 {
  margin: 20px 0 10px;
  font-weight: 600;
  line-height: 1.25;
}

.codex-mini-fallback [data-codex-plan-markdown] h1 {
  font-size: 24px;
}

.codex-mini-fallback [data-codex-plan-markdown] h2 {
  font-size: 20px;
}

.codex-mini-fallback [data-codex-plan-markdown] h3 {
  font-size: 17px;
  line-height: 22px;
}

.codex-mini-fallback [data-codex-plan-markdown] > :first-child {
  margin-top: 0;
}

.codex-mini-fallback [data-codex-plan-markdown] > :last-child {
  margin-bottom: 0;
}

.codex-mini-fallback [data-codex-plan-markdown] p {
  margin: 0 0 11px;
}

.codex-mini-fallback [data-codex-plan-markdown] ul,
.codex-mini-fallback [data-codex-plan-markdown] ol {
  margin: 0 0 11px;
  padding-inline-start: 21px;
}

.codex-mini-fallback [data-codex-plan-markdown] li + li {
  margin-top: 8px;
}

.codex-mini-fallback [data-codex-plan-panel] {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  background: var(--codex-paper);
  color: var(--codex-ink);
}

.codex-mini-fallback [data-codex-plan-full] {
  overflow: hidden;
  border-radius: 8px;
  background: color-mix(in srgb, var(--codex-paper) 95%, var(--codex-ink));
}

.codex-mini-fallback [data-codex-plan-full-header] {
  display: flex;
  box-sizing: border-box;
  height: 40px;
  align-items: center;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
}

.codex-mini-fallback [data-codex-plan-panel] [data-codex-plan-markdown] {
  padding: 12px 16px;
}

.codex-mini-fallback .codex-plan-request {
  box-sizing: border-box;
  width: min(calc(100% - 32px), calc(var(--codex-composer-width) - 32px));
  min-width: 0;
  justify-self: center;
  margin: 0 0 19px;
  padding: 13px 10px 9px;
  border: 1px solid var(--codex-line-strong);
  border-radius: 20px;
  background: var(--codex-paper);
  color: var(--codex-ink);
  font-size: var(--codex-ui-text-size);
  font-weight: 400;
  line-height: 1.45;
  box-shadow: 0 6px 18px rgb(0 0 0 / 4.5%);
}

.codex-mini-fallback .codex-plan-request:focus-visible,
.codex-mini-fallback .codex-plan-request-option:focus-visible,
.codex-mini-fallback .codex-plan-request-close:focus-visible,
.codex-mini-fallback .codex-plan-request-next:focus-visible,
.codex-mini-fallback .codex-plan-request-input:focus-visible {
  outline: 2px solid var(--codex-blue);
  outline-offset: 2px;
}

.codex-mini-fallback .codex-plan-request-heading {
  display: flex;
  min-height: 32px;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 8px 8px;
}

.codex-mini-fallback .codex-plan-request-question {
  font-size: 14px;
  font-weight: 600;
}

.codex-mini-fallback .codex-plan-request-close {
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--codex-muted);
  cursor: pointer;
}

.codex-mini-fallback .codex-plan-request-options {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.codex-mini-fallback .codex-plan-request-option {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  gap: 9px;
  padding: 6px 10px 6px 7px;
  border: 0;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--codex-ink) 6%, transparent);
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.codex-mini-fallback .codex-plan-request-option:hover {
  background: color-mix(in srgb, var(--codex-ink) 9%, transparent);
}

.codex-mini-fallback .codex-plan-request-option:disabled {
  opacity: 1;
  cursor: default;
}

.codex-mini-fallback .codex-plan-request-option:disabled:hover {
  background: color-mix(in srgb, var(--codex-ink) 6%, transparent);
}

.codex-mini-fallback .codex-plan-request-option-number,
.codex-mini-fallback .codex-plan-request-pencil-circle {
  box-sizing: border-box;
  display: inline-flex;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, currentColor 17%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, currentColor 4%, transparent);
  color: var(--codex-muted);
  font-size: 12px;
}

.codex-mini-fallback .codex-plan-request-option-label {
  min-width: 0;
  flex: 1 1 auto;
  font-weight: 550;
}

.codex-mini-fallback .codex-plan-request-option-arrow {
  display: inline-flex;
  flex: 0 0 16px;
  color: var(--codex-muted);
}

.codex-mini-fallback .codex-plan-request-other {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding: 8px 4px 0;
}

.codex-mini-fallback .codex-plan-request-pencil {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: var(--codex-muted);
}

.codex-mini-fallback .codex-plan-request-input {
  box-sizing: border-box;
  min-width: 0;
  min-height: 30px;
  max-height: 112px;
  flex: 1 1 auto;
  resize: none;
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 20px;
}

.codex-mini-fallback .codex-plan-request-input::placeholder {
  color: var(--codex-muted);
}

.codex-mini-fallback .codex-plan-request-input:focus-visible {
  border-radius: 4px;
}

.codex-mini-fallback .codex-plan-request-next {
  min-height: 30px;
  flex: 0 0 auto;
  padding: 5px 10px;
  border: 1px solid color-mix(in srgb, currentColor 16%, transparent);
  border-radius: 9999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.codex-mini-fallback .codex-plan-request-next:hover {
  background: var(--codex-hover);
}

.desktop-thread-panel .user-message {
  align-self: center;
  justify-content: flex-end;
}

.desktop-thread-panel .user-message .message-body {
  max-width: min(87%, 515px);
  padding: 11px 14px;
  border-radius: 17px;
  background: #f1f1ef;
  color: #34342f;
}

/* Match the desktop app's unboxed, inline Linear mention. */
.codex-mini-fallback .codex-linear-mention[data-codex-linear-mention] {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 3px;
  padding-inline: 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #3267d4;
  font-weight: 500;
  vertical-align: bottom;
  white-space: normal;
}

.codex-mini-fallback .codex-linear-mention-icon[data-codex-linear-icon] {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.codex-mini-fallback .codex-linear-mention-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.assistant-label {
  display: block;
  margin-bottom: 4px;
  color: var(--codex-ink);
  font-size: var(--codex-ui-text-size);
  font-weight: 580;
}

/* Real streamed activity stays a quiet, compact line beneath Codex Thought. */

.codex-mini-fallback .codex-stream-activity {
  display: grid;
  min-width: 0;
  max-width: 100%;
  gap: 4px;
  padding: 4px 0;
}

.codex-mini-fallback .codex-stream-activity-row {
  display: inline-flex;
  min-width: 0;
  max-width: 100%;
  min-height: 28px;
  align-self: flex-start;
  align-items: center;
  gap: 6px;
  color: var(--codex-muted);
  font-size: var(--codex-ui-text-size-sm);
  font-weight: 400;
  line-height: 20px;
}

.codex-mini-fallback .codex-stream-activity-label {
  min-width: 0;
  max-width: 100%;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.codex-mini-fallback .codex-command-activity {
  display: grid;
  min-width: 0;
  max-width: 100%;
  padding: 2px 0;
  color: var(--codex-muted);
  font-size: var(--codex-ui-text-size-sm);
  font-weight: 400;
  line-height: 20px;
}

.codex-mini-fallback .codex-command-running,
.codex-mini-fallback .codex-command-summary,
.codex-mini-fallback .codex-command-row {
  display: flex;
  min-width: 0;
  max-width: 100%;
  min-height: 28px;
  align-items: center;
  gap: 6px;
}

.codex-mini-fallback .codex-command-summary {
  width: fit-content;
  cursor: pointer;
  list-style: none;
}

.codex-mini-fallback .codex-command-summary::-webkit-details-marker {
  display: none;
}

.codex-mini-fallback [data-codex-command-icon] {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.codex-mini-fallback .codex-command-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.codex-mini-fallback .codex-command-chevron {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  transform: rotate(-90deg);
}

.codex-mini-fallback .codex-command-activity[open] .codex-command-chevron {
  transform: rotate(0deg);
}

.codex-mini-fallback .codex-command-list {
  display: grid;
  min-width: 0;
}

.codex-mini-fallback .codex-worked-activity {
  display: block;
  min-width: 0;
  max-width: 100%;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--codex-line);
  color: var(--codex-muted);
  font-size: var(--codex-ui-text-size-sm);
  font-weight: 400;
  line-height: 20px;
}

.codex-mini-fallback .codex-worked-summary {
  display: flex;
  width: fit-content;
  min-height: 28px;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  list-style: none;
}

.codex-mini-fallback .codex-worked-summary::-webkit-details-marker {
  display: none;
}

.codex-mini-fallback .codex-worked-summary:focus-visible {
  outline: 2px solid #339cff;
  outline-offset: 2px;
  border-radius: 4px;
}

.codex-mini-fallback .codex-worked-chevron {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  transition: transform 120ms ease;
}

.codex-mini-fallback .codex-worked-activity[open] .codex-worked-chevron {
  transform: rotate(90deg);
}

.codex-mini-fallback .codex-worked-details {
  display: grid;
  min-width: 0;
  gap: 5px;
  padding: 5px 0 2px 12px;
}

.codex-mini-fallback .codex-worked-row {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

/* Tool calls read like a live Codex transcript, not stacked promotional cards. */

.tool-activity {
  overflow: hidden;
  padding: 1px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.tool-activity-header {
  display: flex;
  min-height: 30px;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  color: var(--codex-muted);
  font-size: var(--codex-ui-text-size-sm);
  font-weight: 510;
}

.tool-activity-header > span:first-child {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.tool-activity-header svg,
.tool-activity-icon svg {
  width: 13px;
  height: 13px;
}

.tool-activity-body,
.activity-transcript {
  display: grid;
  gap: 2px;
  margin: 3px 0 6px 6px;
  padding: 2px 0 3px 12px;
  border-left: 1px solid rgb(29 29 27 / 12%);
}

.tool-activity-row,
.activity-transcript-line {
  display: flex;
  min-height: 28px;
  min-width: 0;
  align-items: center;
  gap: 8px;
  color: var(--codex-ink-secondary);
  font-size: var(--codex-ui-text-size-sm);
}

.tool-activity-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.tool-activity-name {
  overflow: hidden;
  color: #454540;
  font-size: var(--codex-ui-text-size-sm);
  text-overflow: ellipsis;
}

.tool-activity-detail,
.activity-transcript-command,
.activity-transcript-result {
  overflow: hidden;
  color: var(--codex-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  text-overflow: ellipsis;
}

.activity-transcript-result {
  color: var(--codex-green);
}

.tool-activity-state {
  color: var(--codex-faint);
  font-size: 9px;
}

.tool-activity-icon {
  display: grid;
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  place-items: center;
}

.tool-activity-row .tool-activity-status {
  margin-left: auto;
  color: var(--codex-green);
  font-size: 9px;
}

.desktop-thread-panel .system-event {
  display: flex;
  min-height: 27px;
  align-items: center;
  gap: 7px;
  padding: 4px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--codex-muted);
  font-size: var(--codex-ui-text-size-sm);
}

.desktop-thread-panel .system-event.success {
  border: 0;
  background: transparent;
  color: var(--codex-green);
}

.desktop-thread-panel .system-event svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}

.tool-activity > .system-event.tool-activity-status {
  margin-top: 2px;
}

/* Match the desktop app's completed Linear tool result. */

.codex-mini-fallback .codex-linear-activity {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 12px;
  color: var(--codex-ink);
}

.codex-mini-fallback .codex-linear-work-status {
  display: flex;
  min-height: 32px;
  align-items: center;
  margin: 0;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--codex-line);
  color: var(--codex-muted);
  font-size: var(--codex-ui-text-size);
}

.codex-mini-fallback .codex-linear-tool-label {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--codex-muted);
  font-size: var(--codex-ui-text-size);
  line-height: 1.4;
}

.codex-mini-fallback .codex-linear-tool-label svg,
.codex-mini-fallback .codex-linear-tool-label img {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  object-fit: contain;
}

/* Match the official Codex Plugins catalog when the native bundle is unavailable. */

.codex-fallback-plugins {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: var(--codex-canvas);
  color: var(--codex-ink);
}

.codex-fallback-plugins-content {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 36px 32px 48px;
}

.codex-fallback-plugins-content > h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.codex-fallback-plugins-description {
  margin: 6px 0 0;
  color: var(--codex-muted);
  font-size: 14px;
  line-height: 24px;
}

.codex-fallback-plugins-content > h3 {
  margin: 28px 0 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}

.codex-fallback-plugin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.codex-fallback-plugin-card {
  display: flex;
  min-height: 132px;
  flex-direction: column;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--codex-line);
  border-radius: 12px;
  background: var(--codex-paper);
  color: var(--codex-ink);
  text-align: left;
  cursor: pointer;
}

button.codex-fallback-plugin-card:hover {
  background: var(--codex-hover);
}

button.codex-fallback-plugin-card:focus-visible {
  outline: 2px solid #339cff;
  outline-offset: 2px;
}

article.codex-fallback-plugin-card {
  cursor: default;
}

.codex-fallback-plugin-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--codex-line);
  border-radius: 9px;
  background: #fff;
}

.codex-fallback-plugin-icon img {
  width: 20px;
  height: 20px;
}

.codex-fallback-plugin-name {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.codex-fallback-plugin-provider {
  margin-top: 2px;
  color: var(--codex-muted);
  font-size: 11px;
  line-height: 1.35;
}

.codex-fallback-plugin-description {
  margin-top: 2px;
  color: var(--codex-muted);
  font-size: 12px;
  line-height: 1.4;
}

.codex-fallback-plugin-action {
  margin-top: auto;
  padding-top: 12px;
  color: var(--codex-muted);
  font-size: 12px;
  font-weight: 500;
}

/* A contextual connection remains visible within the genuine task response. */

.integration-context,
.conversation-inline-context {
  display: grid;
  min-width: 0;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--codex-line);
  border-radius: 10px;
  background: #fdfdfc;
}

.integration-context-row,
.integration-status-row,
.integration-issue-row {
  display: flex;
  min-height: 48px;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--codex-ink-secondary);
  font-size: var(--codex-ui-text-size-sm);
}

.integration-context-row + .integration-status-row,
.integration-context-row + .integration-issue-row,
.integration-status-row + .integration-issue-row {
  border-top: 1px solid var(--codex-line);
}

.integration-app-icon {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border-radius: 7px;
  background: #e9eef7;
  color: #275b96;
  font-size: 13px;
  font-weight: 650;
}

.integration-app-icon svg,
.integration-status-row svg,
.integration-issue-row svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.integration-context-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.integration-context-name {
  overflow: hidden;
  color: var(--codex-ink);
  font-size: var(--codex-ui-text-size);
  font-weight: 570;
  text-overflow: ellipsis;
}

.integration-context-meta {
  overflow: hidden;
  color: var(--codex-muted);
  font-size: var(--codex-ui-text-size-sm);
  text-overflow: ellipsis;
}

.integration-context-row > .pill,
.integration-context-row > button {
  margin-left: auto;
}

.integration-context-row > .integration-status-row {
  min-height: auto;
  margin-left: auto;
  padding: 0;
  border: 0;
  color: var(--codex-muted);
  font-size: 11px;
  white-space: nowrap;
}

.integration-context-row > .integration-status-row.connected {
  color: var(--codex-green);
}

.integration-context-action {
  min-height: 34px;
  margin: 7px 12px 12px;
  padding: 0 12px;
  border: 1px solid var(--codex-line);
  border-radius: 999px;
  background: var(--codex-paper);
  color: var(--codex-ink);
  font-size: var(--codex-ui-text-size-sm);
  font-weight: 510;
}

.integration-context-action:hover {
  background: var(--codex-hover);
}

/* Rounded, restrained native composer anchored to the same conversation width. */

.composer.desktop-composer {
  display: grid;
  width: min(calc(100% - 32px), calc(var(--codex-composer-width) - 32px));
  min-height: 0;
  align-items: stretch;
  gap: 0;
  justify-self: center;
  margin: 0 0 19px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.composer.desktop-composer:focus-within .composer-editor {
  border-color: rgb(26 28 31 / 23%);
  box-shadow: var(--codex-shadow-elevated);
}

.composer-project-shelf {
  position: relative;
  z-index: 0;
  top: 4px;
  display: flex;
  min-height: 48px;
  min-width: 0;
  align-items: flex-start;
  gap: 3px;
  margin: 0 6px -18px;
  padding: 6px 6px 27px;
  border-radius: 16px 16px 0 0;
  background: var(--codex-sidebar);
}

.composer-project {
  display: inline-flex;
  min-height: 25px;
  min-width: 0;
  align-items: center;
  gap: 5px;
  padding: 0 6px;
  color: var(--codex-ink);
  font-size: var(--codex-ui-text-size-sm);
  font-weight: 520;
  white-space: nowrap;
}

.composer-project svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--codex-muted);
}

.composer-editor {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 0;
  grid-template-rows: minmax(47px, auto) 39px;
  padding: 8px 10px 6px;
  border: 0.5px solid var(--codex-line-strong);
  border-radius: 24px;
  background: rgb(255 255 255 / 90%);
  box-shadow: var(--codex-shadow-elevated);
  backdrop-filter: blur(12px);
}

.composer-editor:has(> [data-codex-review-comments-rail="pending"]) {
  grid-template-rows: auto minmax(47px, auto) 39px;
}

.codex-review-comments-rail {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: flex-start;
}

.composer-editor > .codex-review-comments-rail {
  z-index: 2;
  justify-content: flex-start;
  margin: -8px -10px 0;
  padding: 8px 8px 6px;
}

.codex-review-comments-attachment {
  position: relative;
  display: inline-flex;
  max-width: min(100%, 320px);
  min-width: 0;
  align-items: center;
  color: #34342f;
}

.codex-review-comments-pill {
  box-sizing: border-box;
  display: inline-flex;
  min-width: 0;
  max-width: 320px;
  min-height: 34px;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border: 1px solid rgb(31 31 28 / 12%);
  border-radius: 999px;
  background: #fff;
  color: inherit;
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  white-space: nowrap;
}

.codex-review-comments-attachment button.codex-review-comments-pill {
  cursor: pointer;
}

.codex-review-comments-attachment button.codex-review-comments-pill:hover {
  background: #f1f1ef;
}

.codex-review-comments-pill:focus,
.codex-review-comments-remove:focus {
  outline: 0;
}

.codex-review-comments-pill > svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: #82817a;
}

.codex-review-comments-pill [data-codex-review-comments-count] {
  min-width: 0;
  overflow: hidden;
  padding-inline-end: 4px;
  font-weight: 500;
  text-overflow: ellipsis;
}

.codex-review-comments-remove {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 4px;
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #34342f;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
  transition: opacity 100ms ease, background-color 100ms ease;
}

.codex-review-comments-remove::before {
  position: absolute;
  inset-block: 0;
  right: 0;
  left: -32px;
  background: linear-gradient(to right, transparent, #fff, #fff);
  content: "";
  pointer-events: none;
}

.codex-review-comments-remove-circle {
  position: relative;
  display: inline-flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgb(31 31 28 / 12%);
  border-radius: 999px;
  background: #f1f1ef;
}

.codex-review-comments-attachment--pending:hover .codex-review-comments-remove,
.codex-review-comments-remove:focus-visible {
  opacity: 1;
  pointer-events: auto;
}

.codex-review-comments-attachment--pending:hover .codex-review-comments-remove::before {
  background: linear-gradient(to right, transparent, #f1f1ef, #f1f1ef);
}

.codex-review-comments-remove:hover .codex-review-comments-remove-circle,
.codex-review-comments-remove:focus-visible .codex-review-comments-remove-circle {
  background: color-mix(in srgb, #f1f1ef 88%, #34342f);
}

.codex-review-comments-remove svg {
  width: 14px;
  height: 14px;
}

.codex-review-comments-sent-turn {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.codex-review-comments-sent-rail {
  width: 100%;
  justify-content: flex-end;
}

.codex-review-comments-popover {
  position: absolute;
  z-index: 30;
  bottom: calc(100% + 4px);
  left: 0;
  display: flex;
  width: 384px;
  max-width: min(var(--radix-popover-content-available-width, 100vw), calc(100vw - 16px));
  max-height: min(20rem, var(--radix-popover-content-available-height, 100vh), calc(100vh - 16px));
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  visibility: hidden;
  padding: 4px;
  border: 0;
  border-radius: 12px;
  background: rgb(255 255 255 / 90%);
  box-shadow: 0 0 0 0.5px rgb(31 31 28 / 12%), 0 10px 15px -3px rgb(0 0 0 / 10%), 0 4px 6px -4px rgb(0 0 0 / 10%);
  backdrop-filter: blur(8px);
  color: #34342f;
  opacity: 0;
  pointer-events: none;
}

.codex-review-comments-attachment[data-open="true"] .codex-review-comments-popover {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.codex-review-comments-popover-list {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.codex-review-comments-popover-item {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 8px 10px;
}

.codex-review-comments-popover-item + .codex-review-comments-popover-item {
  border-top: 1px solid rgb(31 31 28 / 12%);
}

.codex-review-comments-popover-location {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 8px;
  row-gap: 4px;
  color: #6f6e68;
  font-size: 12px;
  line-height: 16px;
}

.codex-review-comments-popover-path {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.codex-review-comments-popover-side {
  color: #34342f;
  font-weight: 500;
}

.codex-review-comments-popover-item p {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 20px;
}

.desktop-composer .composer-input {
  min-height: 45px;
  max-height: 112px;
  padding: 8px 5px 5px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--codex-ink);
  font-size: var(--codex-ui-text-size);
  line-height: 20px;
}

.desktop-composer .composer-input::placeholder {
  color: #82817a;
}

.desktop-composer .composer-input:focus {
  border: 0;
  outline: 0;
}

.composer-controls,
.composer-controls-start,
.composer-controls-end {
  display: flex;
  min-width: 0;
  align-items: center;
}

.composer-controls {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 5px;
}

.composer-controls-start {
  gap: 4px;
  overflow: hidden;
}

.composer-controls-end {
  flex: 0 0 auto;
  gap: 5px;
}

.composer-model-picker {
  display: inline-flex;
  min-width: 0;
  min-height: 28px;
  align-items: center;
  justify-self: end;
  gap: 1px;
  padding: 0 3px;
  border-radius: 7px;
  white-space: nowrap;
}

.composer-model-picker:hover {
  background: var(--codex-hover);
}

.composer-model-picker > svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  color: var(--codex-muted);
}

.composer-tool,
.composer-mode,
.composer-model,
.composer-context,
.composer-branch,
.composer-reasoning {
  display: inline-flex;
  min-height: 27px;
  min-width: 0;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  padding: 0 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--codex-muted);
  font-size: var(--codex-ui-text-size-sm);
  white-space: nowrap;
}

.composer-tool:hover,
.composer-mode:hover,
.composer-model:hover {
  background: var(--codex-hover);
  color: var(--codex-ink);
}

.composer-tool svg,
.composer-mode svg,
.composer-model svg,
.composer-context svg,
.composer-branch svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.desktop-composer .mode-toggle {
  height: 27px;
  padding: 0 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
}

.desktop-composer .mode-toggle.active {
  background: #eeebf5;
  color: #604595;
}

.desktop-composer .send-button {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  background: var(--codex-ink);
  color: #fff;
}

.desktop-composer .send-button:hover:not(:disabled) {
  background: #363632;
}

.desktop-composer .send-button svg {
  width: 14px;
  height: 14px;
}

.desktop-thread-panel .composer-validation {
  width: min(calc(100% - 32px), calc(var(--codex-composer-width) - 32px));
  justify-self: center;
  margin: -12px 0 12px;
}

/* Optional document drawer; source artifacts are inspectable, not wallpaper. */

.codex-mini-fallback .codex-panel-picker {
  position: absolute;
  z-index: 12;
  top: 46px;
  right: 0;
  bottom: 0;
  display: flex;
  width: min(var(--codex-drawer-width), 100%);
  min-width: 0;
  min-height: 0;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: auto;
  border-left: 1px solid var(--codex-line);
  background: var(--codex-paper);
  color: var(--codex-ink);
}

.codex-mini-fallback .codex-panel-picker[hidden] {
  display: none;
}

.codex-mini-fallback .codex-panel-picker-options {
  display: flex;
  width: 100%;
  max-width: 576px;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.codex-mini-fallback .codex-panel-picker-option {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: rgba(26, 28, 31, .02);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

html[data-theme="dark"] .codex-mini-fallback .codex-panel-picker-option {
  background: rgba(255, 255, 255, .03);
}

.codex-mini-fallback .codex-panel-picker-option:hover:not(:disabled) {
  background: var(--codex-hover);
}

.codex-mini-fallback .codex-panel-picker-option:disabled {
  color: var(--codex-muted);
  cursor: default;
  opacity: .56;
}

.codex-mini-fallback .codex-panel-picker-option:focus-visible {
  outline: 2px solid var(--codex-blue);
  outline-offset: -2px;
}

.codex-mini-fallback .codex-panel-picker-icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  align-items: center;
  justify-content: center;
  color: var(--codex-ink-secondary);
}

.codex-mini-fallback .codex-panel-picker-icon svg {
  width: 100%;
  height: 100%;
}

.codex-mini-fallback .codex-panel-picker-label {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  color: var(--codex-ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.codex-mini-fallback .codex-panel-picker-shortcut {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding: 2px 6px;
  border: 0;
  border-radius: 8px;
  background: var(--codex-hover);
  color: var(--codex-muted);
  font: 500 11px var(--codex-product-font);
  white-space: nowrap;
}

.inspector-pane {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: 40px minmax(0, 1fr);
  overflow: hidden;
  border-left: 1px solid var(--codex-line);
  background: var(--codex-canvas);
}

.inspector-header,
.inspector-document-header {
  display: flex;
  min-height: 46px;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 13px;
  border-bottom: 1px solid var(--codex-line);
  background: var(--codex-canvas);
}

.inspector-heading {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  color: var(--codex-ink);
  font-size: var(--codex-ui-text-size-sm);
  font-weight: 550;
}

.inspector-heading svg {
  width: 14px;
  height: 14px;
}

.inspector-status {
  color: var(--codex-muted);
  font-family: var(--font-mono);
  font-size: 9px;
  white-space: nowrap;
}

.workspace-tabs.inspector-tabs {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 8px;
  overflow-x: auto;
  border-bottom: 1px solid var(--codex-line);
  background: var(--codex-canvas);
}

.workspace-tabs.inspector-tabs .codex-repo-tab-group {
  display: flex;
  width: clamp(
    calc(var(--codex-repo-tab-count) * 90px + (var(--codex-repo-tab-count) - 1) * 3px),
    100%,
    calc(var(--codex-repo-tab-count) * 160px + (var(--codex-repo-tab-count) - 1) * 3px)
  );
  min-width: 0;
  align-items: center;
  gap: 3px;
}

.workspace-tabs.inspector-tabs .codex-repo-tab-controller {
  position: relative;
  display: flex;
  box-sizing: border-box;
  width: 100%;
  max-width: 160px;
  min-width: 0;
  height: 28px;
  flex: 1 1 0;
  align-items: center;
  padding-right: 4px;
}

.workspace-tabs.inspector-tabs button[role="tab"] {
  position: relative;
  width: 100%;
  max-width: 156px;
  height: 28px;
  min-height: 28px;
  min-width: 0;
  flex: 1;
  gap: 8px;
  padding: 4px 8px;
  overflow: hidden;
  border-radius: 10px;
  color: var(--codex-muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 19px;
}

.workspace-tabs.inspector-tabs button[role="tab"]::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  border-radius: 8px;
  background: transparent;
  content: "";
  pointer-events: none;
}

.workspace-tabs.inspector-tabs button[role="tab"]::after {
  display: none !important;
  content: none !important;
}

.workspace-tabs.inspector-tabs button[role="tab"].active,
.workspace-tabs.inspector-tabs button[role="tab"][aria-selected="true"],
.workspace-tabs.inspector-tabs button[role="tab"].active:hover,
.workspace-tabs.inspector-tabs button[role="tab"][aria-selected="true"]:hover {
  background: transparent;
  color: var(--codex-ink);
}

.workspace-tabs.inspector-tabs button[role="tab"]:hover::before,
.workspace-tabs.inspector-tabs button[role="tab"].active::before,
.workspace-tabs.inspector-tabs button[role="tab"][aria-selected="true"]::before,
.workspace-tabs.inspector-tabs button[role="tab"].active:hover::before,
.workspace-tabs.inspector-tabs button[role="tab"][aria-selected="true"]:hover::before {
  background: color-mix(in srgb, var(--codex-ink) 5%, transparent);
}

.workspace-tabs.inspector-tabs .codex-repo-tab-icon {
  position: relative;
  display: flex;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  align-items: center;
  justify-content: center;
  overflow: visible;
  z-index: 1;
}

.workspace-tabs.inspector-tabs .codex-repo-tab-icon svg,
.workspace-tabs.inspector-tabs .codex-repo-tab-icon img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.workspace-tabs.inspector-tabs .codex-repo-tab-label {
  position: relative;
  z-index: 1;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.workspace-tabs.inspector-tabs .codex-repo-tab-label[data-overflow="true"]::after {
  position: absolute;
  z-index: 20;
  top: 0;
  right: 0;
  bottom: 0;
  width: 28px;
  background: linear-gradient(to right, transparent, var(--codex-canvas) 85%);
  content: "";
  pointer-events: none;
}

.workspace-tabs.inspector-tabs button[role="tab"]:hover .codex-repo-tab-label[data-overflow="true"]::after,
.workspace-tabs.inspector-tabs button[role="tab"].active .codex-repo-tab-label[data-overflow="true"]::after,
.workspace-tabs.inspector-tabs button[role="tab"][aria-selected="true"] .codex-repo-tab-label[data-overflow="true"]::after {
  background: linear-gradient(
    to right,
    transparent,
    color-mix(in srgb, var(--codex-ink) 5%, var(--codex-canvas)) 85%
  );
}

.workspace-tabs.inspector-tabs .codex-repo-tab-label > span {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-align: left;
  white-space: nowrap;
}

.workspace-content.inspector-content,
.inspector-document {
  min-width: 0;
  min-height: 0;
  background: var(--codex-canvas);
}

.codex-mini-fallback .inspector-pane:has(.codex-repo-empty-state) {
  grid-template-rows: 40px minmax(0, 1fr);
}

.codex-mini-fallback .codex-repo-empty-state {
  display: flex;
  min-width: 0;
  min-height: 0;
  grid-column: 1;
  grid-row: 1;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  padding: 24px 12px;
  color: var(--codex-ink);
  text-align: center;
}

.codex-mini-fallback .codex-repo-empty-icon {
  display: inline-flex;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  align-items: center;
  justify-content: center;
  color: var(--codex-muted);
}

.codex-mini-fallback .codex-repo-empty-icon svg {
  width: 100%;
  height: 100%;
}

.codex-mini-fallback .codex-repo-empty-title {
  margin: 0;
  color: var(--codex-ink);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}

.codex-mini-fallback .codex-repo-empty-copy {
  max-width: 18rem;
  margin: 0;
  color: var(--codex-ink-secondary);
  font-size: 14px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.codex-mini-fallback .workspace-content:has(> [data-codex-browser-panel]) {
  overflow: hidden;
}

.codex-mini-fallback .codex-fallback-browser {
  display: grid;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  grid-template-rows: 40px minmax(0, 1fr);
  overflow: hidden;
  background: var(--codex-canvas);
}

.codex-mini-fallback [data-browser-sidebar-toolbar] {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
  padding: 5px 7px;
  border-bottom: 1px solid var(--codex-line);
}

.codex-mini-fallback [data-browser-sidebar-toolbar] button {
  display: inline-flex;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--codex-ink);
}

.codex-mini-fallback [data-browser-sidebar-toolbar] button:hover:not(:disabled) {
  background: rgba(26, 28, 31, 0.06);
}

.codex-mini-fallback [data-browser-sidebar-toolbar] button:disabled {
  color: var(--codex-muted);
  opacity: 0.46;
}

.codex-mini-fallback [data-browser-sidebar-toolbar] button svg {
  width: 15px;
  height: 15px;
}

.codex-mini-fallback [data-browser-sidebar-address-input] {
  box-sizing: border-box;
  width: 100%;
  height: 28px;
  min-width: 0;
  padding: 0 9px;
  border: 1px solid var(--codex-line);
  border-radius: 8px;
  background: var(--codex-canvas);
  color: var(--codex-ink);
  font: 400 11px system-ui, -apple-system, sans-serif;
}

.codex-mini-fallback [data-browser-sidebar-address-input]:focus-visible {
  outline: 2px solid rgba(51, 156, 255, 0.62);
  outline-offset: 1px;
}

.codex-mini-fallback [data-codex-browser-frame] {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border: 0;
  background: #fff;
}

.inspector-document {
  padding: 14px;
}

.inspector-document-header {
  min-height: 38px;
  margin: -14px -14px 13px;
  font-size: var(--codex-ui-text-size-sm);
}

.inspector-document-header h3,
.inspector-document-header p {
  margin: 0;
}

.inspector-document-header h3 {
  font-size: var(--codex-ui-text-size);
  font-weight: 560;
}

.inspector-document-header p {
  color: var(--codex-muted);
  font-size: 11px;
}

.inspector-content .integration-context {
  margin: 13px;
  border-color: var(--codex-line);
  background: #fff;
}

.inspector-content > .inspector-document.integration-context {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.inspector-document .integration-context {
  margin: 0;
}

.inspector-content .linear-card,
.inspector-content .plan-card,
.inspector-content .test-results,
.inspector-content .pr-card {
  margin-right: 12px;
  margin-left: 12px;
  border-color: var(--codex-line);
  background: #fff;
  box-shadow: none;
}

.inspector-content .issue-details > h3 {
  font-size: 15px;
}

.inspector-content .diff-file-tabs {
  overflow-x: auto;
}

.inspector-content .preview-panel {
  margin: 12px;
  border-color: var(--codex-line);
  box-shadow: none;
}

.inspector-content .account-preview {
  margin: 10px;
  padding: 12px;
}

.inspector-content .file-tree,
.inspector-content .code-view,
.inspector-content .terminal-screen {
  max-width: 100%;
}

.inspector-content .code-view {
  background: var(--codex-editor-background);
}

.inspector-content .diff-view {
  display: grid;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  grid-template-columns: max-content;
  container-type: inline-size;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  white-space: pre;
}

.inspector-content .diff-view > .diff-row,
.inspector-content .diff-view > .diff-hunk {
  min-width: max-content;
}

.inspector-content .diff-added {
  background: var(--codex-editor-added);
}

.inspector-content .diff-removed {
  background: var(--codex-editor-deleted);
}

/*
 * Codex's diff utility and local-comment surface. The controls stay on the
 * genuine diff rows and use the same compact geometry as the desktop app.
 */
.codex-mini-fallback .diff-row[data-codex-review-line] {
  position: relative;
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: max-content max-content;
  align-items: stretch;
  padding-right: 12px;
  white-space: pre;
}

.codex-mini-fallback [data-codex-review-gutter] {
  position: sticky;
  z-index: 3;
  left: 0;
  display: grid;
  min-width: calc(5ch + 20px);
  grid-template-columns: 2ch minmax(3ch, max-content) 20px;
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  overflow: visible;
  box-sizing: border-box;
  padding-right: 0;
  padding-left: 0;
  white-space: nowrap;
  background-color: inherit;
}

.codex-mini-fallback [data-codex-review-select-line] {
  cursor: default;
  touch-action: none;
}

.codex-mini-fallback [data-codex-review-marker="true"] {
  grid-column: 1;
  grid-row: 1;
  display: block !important;
  width: 2ch;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
  text-align: center;
  pointer-events: none;
}

.codex-mini-fallback .codex-review-visible-line {
  grid-column: 2;
  grid-row: 1;
  min-width: 3ch;
  padding-right: 1ch;
  color: var(--codex-faint);
  text-align: right;
  user-select: none;
}

.codex-mini-fallback [data-codex-review-code] {
  min-width: max-content;
  white-space: pre;
}

.codex-mini-fallback .codex-review-add-comment {
  position: static;
  z-index: 4;
  grid-column: 3;
  grid-row: 1;
  display: flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: var(--codex-ink);
  color: var(--codex-paper);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  touch-action: none;
}

.codex-mini-fallback .codex-review-add-comment svg {
  width: 16px;
  height: 16px;
  fill: currentcolor;
}

.codex-mini-fallback .diff-row[data-codex-review-line]:hover .codex-review-add-comment,
.codex-mini-fallback .diff-row[data-codex-review-line]:focus-within .codex-review-add-comment,
.codex-mini-fallback .codex-review-add-comment:focus-visible {
  opacity: 1;
  pointer-events: auto;
}

.codex-mini-fallback .diff-row[data-codex-review-selected="true"] > [data-codex-review-gutter],
.codex-mini-fallback .diff-row[data-codex-review-selected="true"] > [data-codex-review-code] {
  background: #d9edff;
}

.codex-mini-fallback .diff-row[data-codex-review-selected="true"]:not([data-codex-review-selection-bottom="true"]) .codex-review-add-comment {
  opacity: 0;
  pointer-events: none;
}

.codex-mini-fallback .diff-row[data-codex-review-selection-bottom="true"] .codex-review-add-comment {
  opacity: 1;
  pointer-events: auto;
}

.codex-mini-fallback .codex-review-add-comment:focus-visible {
  outline: 2px solid var(--codex-blue);
  outline-offset: 2px;
}

@media (hover: none), (pointer: coarse) {
  .codex-mini-fallback .diff-row[data-codex-review-line] .codex-review-add-comment {
    opacity: 1;
    pointer-events: auto;
    touch-action: manipulation;
  }
}

.codex-mini-fallback [data-codex-review-composer],
.codex-mini-fallback [data-codex-review-thread] {
  box-sizing: border-box;
  width: min(768px, 100cqi);
  max-width: 100cqi;
  min-width: 0;
  padding: 6px;
  color: var(--codex-ink);
  font-family: var(--codex-product-font);
  white-space: normal;
}

.codex-mini-fallback .diff-view > [data-codex-review-composer],
.codex-mini-fallback .diff-view > [data-codex-review-thread] {
  position: sticky;
  left: 0;
  justify-self: start;
  margin-left: 0;
}

.codex-mini-fallback .codex-review-comment-surface,
.codex-mini-fallback .codex-review-comment-card {
  min-width: 0;
  overflow: hidden;
  border: 0.5px solid var(--codex-line-strong);
  border-radius: 16px;
  background: color-mix(in srgb, var(--codex-ink) 2%, var(--codex-paper));
  color: var(--codex-ink);
}

html[data-theme="dark"] .codex-mini-fallback .codex-review-comment-surface,
html[data-theme="dark"] .codex-mini-fallback .codex-review-comment-card {
  background: color-mix(in srgb, var(--codex-ink) 3%, var(--codex-paper));
}

.codex-mini-fallback .codex-review-comment-heading {
  display: flex;
  min-width: 0;
  min-height: 45px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--codex-line-strong) 24%, transparent);
}

.codex-mini-fallback .codex-review-comment-accessory {
  min-width: 0;
  overflow-wrap: anywhere;
}

.codex-mini-fallback .codex-review-comment-author {
  display: flex;
  min-width: 0;
  min-height: 24px;
  align-items: center;
  gap: 10px;
  color: var(--codex-ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}

.codex-mini-fallback .codex-review-comment-avatar {
  display: inline-flex;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--codex-line);
  border-radius: 50%;
  background: var(--codex-ink);
  color: var(--codex-paper);
}

.codex-mini-fallback .codex-review-comment-avatar svg {
  width: 16px;
  height: 16px;
}

.codex-mini-fallback .codex-review-comment-accessory {
  min-width: 0;
  color: var(--codex-muted);
  font-size: 12px;
  line-height: 16px;
}

.codex-mini-fallback .codex-review-comment-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  overflow-wrap: anywhere;
  color: var(--codex-ink);
  font-size: 14px;
  line-height: 20px;
}

.codex-mini-fallback .codex-review-comment-input {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-height: 56px;
  resize: vertical;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--codex-ink);
  font: inherit;
  outline: 0;
}

.codex-mini-fallback .codex-review-comment-input::placeholder {
  color: var(--codex-muted);
}

.codex-mini-fallback .codex-review-comment-actions {
  display: flex;
  min-height: 32px;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 12px 6px;
  color: var(--codex-muted);
}

.codex-mini-fallback .codex-review-comment-cancel,
.codex-mini-fallback .codex-review-comment-submit {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  font: 500 12px/18px var(--codex-product-font);
  cursor: pointer;
}

.codex-mini-fallback .codex-review-comment-cancel {
  background: transparent;
  color: var(--codex-muted);
}

.codex-mini-fallback .codex-review-comment-cancel:hover,
.codex-mini-fallback .codex-review-comment-cancel:focus-visible {
  background: var(--codex-hover);
  color: var(--codex-ink);
}

.codex-mini-fallback .codex-review-comment-submit {
  background: var(--codex-ink);
  color: var(--codex-paper);
}

.codex-mini-fallback .codex-review-comment-submit:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

@media (max-width: 390px) {
  .codex-mini-fallback .codex-review-comment-heading {
    align-items: flex-start;
    gap: 4px 10px;
  }

  .codex-mini-fallback .codex-review-comment-accessory {
    flex-basis: 100%;
    padding-left: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .codex-mini-fallback .codex-review-add-comment,
  .codex-review-comments-remove {
    transition: none;
  }
}

.workspace-panel.codex-desktop-window :focus-visible {
  outline-color: var(--codex-blue);
}

@media (max-width: 1480px) {
  .lab-shell {
    --codex-drawer-width: 320px;
  }

  .desktop-workspace-body {
    grid-template-columns: minmax(275px, 1fr) var(--codex-drawer-width);
  }

  .desktop-workspace-body[data-inspector-open="false"] {
    grid-template-columns: minmax(0, 1fr);
  }

  .desktop-thread-panel .codex-messages.thread-timeline {
    padding-right: 16px;
    padding-left: 16px;
  }

  .composer-reasoning {
    display: none;
  }
}

@media (max-width: 1210px) {
  .lab-shell {
    --lesson-rail-width: clamp(326px, 34vw, 368px);
    --codex-sidebar-width: 49px;
    --codex-drawer-width: 304px;
  }

  .desktop-workspace-body {
    grid-template-columns: minmax(250px, 1fr) var(--codex-drawer-width);
  }

  .desktop-workspace-body[data-inspector-open="false"] {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-rail {
    align-items: center;
    padding-right: 5px;
    padding-left: 5px;
  }

  .project-rail-header,
  .project-rail-item,
  .project-rail-thread {
    width: 36px;
    justify-content: center;
    padding-right: 0;
    padding-left: 0;
  }

  .project-rail-header .project-rail-label,
  .project-rail-item .project-rail-label,
  .project-rail-thread .project-rail-label,
  .project-rail-thread-meta,
  .project-rail-product-chevron,
  .project-rail-section,
  .project-rail-section-title {
    display: none;
  }

  .project-rail-section:has(> .project-rail-add) {
    display: flex;
    width: 36px;
    justify-content: center;
    margin: 12px 0 4px;
  }

  .project-rail-section > .project-rail-add {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    opacity: 1;
  }

  .project-rail-thread {
    min-height: 36px;
    align-items: center;
    margin-top: 13px;
    padding-top: 0;
  }

  .project-rail-thread .project-rail-icon {
    margin-top: 0;
  }

  .desktop-windowbar {
    gap: 7px;
    padding-right: 8px;
    padding-left: 8px;
  }

  .desktop-project-name {
    max-width: 135px;
  }

  .composer-context,
  .composer-branch {
    display: none;
  }
}

/* At narrow desktop widths the optional document pane becomes a real drawer. */

@media (max-width: 1020px) and (min-width: 721px) {
  .lab-shell {
    --lesson-rail-width: clamp(310px, 35vw, 352px);
  }

  .desktop-workspace-body,
  .desktop-workspace-body[data-inspector-open="false"] {
    grid-template-columns: minmax(0, 1fr);
  }

  .inspector-pane {
    position: absolute;
    z-index: 4;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(342px, 100%);
    box-shadow: -12px 0 34px rgb(26 28 31 / 9%);
  }

  .desktop-thread-panel .codex-messages.thread-timeline {
    padding: 30px 16px 18px;
  }

  .conversation-task-title {
    font-size: 22px;
  }

  .composer.desktop-composer {
    width: calc(100% - 32px);
  }

  .desktop-project-name {
    max-width: 96px;
  }
}

@media (max-width: 720px) {
  .lab-shell {
    --lesson-rail-width: 100%;
  }

  .lab-shell .lab-main {
    grid-template-columns: 1fr;
  }

  .lab-shell[data-mobile-view="lesson"] .lab-header {
    border-bottom-color: rgb(255 255 255 / 9%);
    background: #111110;
    color: #f6f4ef;
  }

  .lab-shell[data-mobile-view="lesson"] .lab-brand {
    color: #f6f4ef;
  }

  .lab-shell[data-mobile-view="lesson"] .lab-brand span + span {
    color: #b8b3ab;
  }

  .lab-shell[data-mobile-view="lesson"] .sandbox-pill {
    background: rgb(255 255 255 / 7%);
    color: #c5c1ba;
  }

  .lab-shell[data-mobile-view="lesson"] .lab-header-actions .icon-button {
    color: #e8e5df;
  }

  .workspace-panel.codex-desktop-window {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }

  .codex-mini-fallback {
    grid-template-columns: minmax(0, 1fr);
  }

  .codex-mini-course-overlay {
    top: 52px;
    right: 9px;
    max-width: min(305px, calc(100% - 18px));
  }

  .codex-project-picker {
    padding: 16px;
  }

  .codex-project-picker-dialog {
    max-height: calc(100dvh - 32px);
    gap: 14px;
    padding: 18px;
  }

  .codex-project-picker-dialog.codex-project-type-dialog {
    max-height: calc(100dvh - 32px);
    gap: 20px;
    padding: 20px;
  }

  .codex-project-picker-title {
    font-size: 22px;
  }

  .project-rail {
    display: none;
  }

  .desktop-main {
    grid-template-rows: 46px minmax(0, 1fr);
  }

  .codex-mini-fallback .codex-panel-picker {
    top: 46px;
    width: min(320px, 100%);
    padding: 12px;
  }

  .desktop-windowbar {
    height: 46px;
    gap: 7px;
    padding: 0 8px;
  }

  .desktop-project-selector {
    padding-right: 3px;
    padding-left: 3px;
  }

  .desktop-project-icon {
    width: 17px;
    height: 17px;
    flex-basis: 17px;
  }

  .desktop-sandbox-indicator {
    display: none;
  }

  .desktop-workspace-body {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) minmax(0, min(320px, 100%));
    grid-template-rows: minmax(0, 1fr);
  }

  .desktop-workspace-body[data-inspector-open="false"] {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }

  .inspector-pane {
    position: static;
    grid-column: 2;
    grid-row: 1;
    grid-template-rows: 40px minmax(0, 1fr);
    width: min(320px, 100%);
    border-bottom: 0;
    border-left: 1px solid var(--codex-line);
    box-shadow: none;
  }

  .codex-mini-fallback .inspector-pane:has(.codex-repo-empty-state) {
    grid-template-rows: 40px minmax(0, 1fr);
  }

  .codex-mini-fallback .codex-repo-empty-state {
    gap: 6px;
    padding: 12px 9px;
  }

  .codex-mini-fallback .codex-repo-empty-copy {
    font-size: 12px;
  }

  .inspector-header {
    min-height: 40px;
  }

  .workspace-tabs.inspector-tabs {
    height: 40px;
  }

  .codex-mini-fallback #codex-inspector > .inspector-content[role="tabpanel"][aria-label="Review"] {
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    overflow: hidden;
  }

  .codex-mini-fallback .inspector-content .diff-file-tabs {
    display: flex;
    overflow-x: auto;
  }

  .codex-mini-fallback .inspector-content .diff-file {
    max-width: calc(100vw - 86px);
    flex: 0 0 176px;
  }

  .codex-mini-fallback #codex-inspector > .inspector-content[role="tabpanel"][aria-label="Review"] > .code-view.diff-view {
    height: 100%;
    min-height: 0;
    overflow: auto;
  }

  .desktop-thread-panel {
    grid-column: 1;
    grid-row: 1;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .desktop-workspace-body[data-inspector-open="false"] .desktop-thread-panel {
    grid-row: 1;
  }

  .desktop-thread-panel .codex-messages.thread-timeline {
    gap: 14px;
    padding: 18px 16px 14px;
  }

  .conversation-task-title {
    font-size: 21px;
  }

  .conversation-home-state {
    gap: 12px;
  }

  .conversation-home-state .conversation-home-logo,
  .conversation-home-state .conversation-home-logo.codex-product-mark {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .conversation-task-subtitle {
    margin-top: -8px;
  }

  .composer.desktop-composer {
    width: calc(100% - 32px);
    min-height: 0;
    margin: 0 0 9px;
    padding: 0;
    border-radius: 0;
  }

  .composer-project-shelf {
    min-height: 42px;
    margin-right: 5px;
    margin-bottom: -16px;
    margin-left: 5px;
    padding: 4px 5px 23px;
  }

  .composer-editor {
    grid-template-rows: minmax(33px, auto) 35px;
    padding: 5px 7px 4px;
    border-radius: 22px;
  }

  .composer-editor:has(> [data-codex-review-comments-rail="pending"]) {
    grid-template-rows: auto minmax(33px, auto) 35px;
  }

  .desktop-composer .composer-input {
    min-height: 32px;
    padding-top: 5px;
  }

  .composer-controls-start {
    gap: 1px;
  }

  .composer-model {
    display: inline-flex;
  }

  .composer-context,
  .composer-branch,
  .composer-reasoning {
    display: none;
  }
}

@media (max-width: 390px) {
  .codex-mini-fallback .codex-plan-request {
    margin-bottom: 9px;
    padding-right: 7px;
    padding-left: 7px;
  }

  .codex-mini-fallback .codex-plan-request-other {
    gap: 5px;
    padding-right: 4px;
    padding-left: 4px;
  }

  .codex-mini-fallback .codex-plan-request-next {
    padding-right: 5px;
    padding-left: 5px;
  }

  .codex-project-picker {
    padding: 12px;
  }

  .codex-project-picker-dialog {
    max-height: calc(100dvh - 24px);
    gap: 12px;
    padding: 15px;
    border-radius: 16px;
  }

  .codex-project-picker-dialog.codex-project-type-dialog {
    max-height: calc(100dvh - 24px);
    gap: 16px;
    padding: 15px;
  }

  .codex-project-type-options {
    gap: 8px;
  }

  .codex-project-type-option {
    min-height: 132px;
    padding: 11px;
    border-radius: 12px;
  }

  .codex-project-type-copy {
    margin-top: 16px;
  }

  .codex-project-type-label {
    font-size: 14px;
  }

  .codex-project-type-description {
    font-size: 12px;
  }

  .codex-project-picker-title {
    font-size: 20px;
  }

  .codex-project-source-heading {
    margin-bottom: -5px;
  }

  .codex-project-source-copy {
    font-size: 12px;
  }

  .codex-project-picker-actions {
    gap: 8px;
  }

  .codex-project-picker-actions button {
    min-height: 32px;
    padding: 0 10px;
    font-size: 12px;
  }

  .desktop-project-name {
    max-width: 90px;
  }

  .desktop-toolbar-action {
    padding-right: 6px;
    padding-left: 6px;
  }

  .desktop-thread-panel .message-body {
    font-size: 12px;
  }

  .desktop-composer .composer-model {
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/*
 * Only the existing offline fallback and course-owned overlays need these
 * overrides. The genuine Codex application supplies its own Shadow DOM theme.
 */
html[data-theme="dark"] .codex-mini-overlay-card,
html[data-theme="dark"] .codex-mini-approval,
html[data-theme="dark"] .codex-mini-guidance,
html[data-theme="dark"] .codex-mini-error,
html[data-theme="dark"] .codex-mini-fallback .codex-environment-panel {
  border-color: var(--codex-line);
  background: rgb(33 33 33 / 96%);
  color: var(--codex-ink);
}

html[data-theme="dark"] .codex-project-picker {
  background: rgb(0 0 0 / 58%);
}

html[data-theme="dark"] .codex-project-picker-dialog {
  box-shadow: 0 20px 56px rgb(0 0 0 / 48%);
}

html[data-theme="dark"] .codex-project-type-option.is-selected,
html[data-theme="dark"] .codex-project-type-option[aria-checked="true"] {
  background: rgb(255 255 255 / 7%);
}

html[data-theme="dark"] .codex-project-name-field,
html[data-theme="dark"] .codex-project-source-list {
  background-color: var(--codex-editor-background);
}

html[data-theme="dark"] .codex-project-source-add:hover:not(:disabled),
html[data-theme="dark"] .codex-project-source-remove:hover:not(:disabled) {
  background-color: #282828;
}

html[data-theme="dark"] .codex-project-picker-actions .codex-project-create-submit {
  background: #fff;
  color: #0d0d0d;
}

html[data-theme="dark"] .codex-project-picker-actions .codex-project-create-submit:hover:not(:disabled) {
  background: #ededed;
  opacity: 1;
}

html[data-theme="dark"] .lab-shell.phase-practice .practice-codex-frame > .workspace-panel,
html[data-theme="dark"] .lab-shell.phase-practice .practice-codex-frame .workspace-panel.codex-mini-live,
html[data-theme="dark"] .codex-mini-fallback .desktop-thread-panel,
html[data-theme="dark"] .codex-mini-fallback .workspace-toolbar,
html[data-theme="dark"] .codex-mini-fallback .workspace-content {
  background-color: var(--codex-paper);
}

html[data-theme="dark"] .project-rail-item.active,
html[data-theme="dark"] .project-rail-thread.active,
html[data-theme="dark"] .desktop-thread-panel .message-avatar,
html[data-theme="dark"] .project-rail-avatar {
  background: rgb(255 255 255 / 8%);
  color: var(--codex-ink);
}

html[data-theme="dark"] .desktop-project-divider,
html[data-theme="dark"] .desktop-thread-panel .message-body,
html[data-theme="dark"] .tool-activity-name {
  color: var(--codex-ink-secondary);
}

html[data-theme="dark"] .desktop-thread-panel .user-message .message-body {
  background: #303030;
  color: var(--codex-ink);
}

html[data-theme="dark"] .codex-mini-fallback .desktop-thread-panel .user-message .message-body {
  background: #242424;
}

html[data-theme="dark"] .codex-mini-fallback .codex-branch-picker {
  border-color: var(--codex-line-strong);
  background: #212121;
}

html[data-theme="dark"] .codex-mini-fallback .codex-linear-mention[data-codex-linear-mention] {
  color: #8eabe6;
}

html[data-theme="dark"] .tool-activity-body,
html[data-theme="dark"] .activity-transcript {
  border-left-color: var(--codex-line-strong);
}

html[data-theme="dark"] .codex-fallback-plugin-card,
html[data-theme="dark"] .integration-context,
html[data-theme="dark"] .conversation-inline-context,
html[data-theme="dark"] .inspector-content .integration-context,
html[data-theme="dark"] .inspector-content .linear-card,
html[data-theme="dark"] .inspector-content .plan-card,
html[data-theme="dark"] .inspector-content .test-results,
html[data-theme="dark"] .inspector-content .pr-card {
  border-color: var(--codex-line);
  background: #212121;
  color: var(--codex-ink);
}

html[data-theme="dark"] button.codex-fallback-plugin-card:hover,
html[data-theme="dark"] .codex-fallback-plugin-icon {
  background: #282828;
}

html[data-theme="dark"] .integration-app-icon {
  background: rgb(2 133 255 / 18%);
  color: #99ceff;
}

html[data-theme="dark"] .composer-editor {
  border-color: var(--codex-line-strong);
  background: rgb(33 33 33 / 96%);
}

html[data-theme="dark"] .codex-review-comments-attachment {
  color: #efefed;
}

html[data-theme="dark"] .codex-mini-fallback .diff-row[data-codex-review-selected="true"] > [data-codex-review-gutter],
html[data-theme="dark"] .codex-mini-fallback .diff-row[data-codex-review-selected="true"] > [data-codex-review-code] {
  background: #16324f;
}

html[data-theme="dark"] .codex-review-comments-pill {
  border-color: rgb(255 255 255 / 12%);
  background: #272726;
}

html[data-theme="dark"] .codex-review-comments-attachment button.codex-review-comments-pill:hover {
  background: #30302f;
}

html[data-theme="dark"] .codex-review-comments-popover-location {
  color: #a9a8a2;
}

html[data-theme="dark"] .codex-review-comments-popover-side {
  color: #efefed;
}

html[data-theme="dark"] .codex-review-comments-remove {
  color: #efefed;
}

html[data-theme="dark"] .codex-review-comments-remove::before {
  background: linear-gradient(to right, transparent, #272726, #272726);
}

html[data-theme="dark"] .codex-review-comments-attachment--pending:hover .codex-review-comments-remove::before {
  background: linear-gradient(to right, transparent, #30302f, #30302f);
}

html[data-theme="dark"] .codex-review-comments-remove-circle {
  border-color: rgb(255 255 255 / 12%);
  background: #30302f;
}

html[data-theme="dark"] .codex-review-comments-remove:hover .codex-review-comments-remove-circle,
html[data-theme="dark"] .codex-review-comments-remove:focus-visible .codex-review-comments-remove-circle {
  background: color-mix(in srgb, #30302f 88%, #efefed);
}

html[data-theme="dark"] .codex-review-comments-popover {
  background: rgb(39 39 38 / 90%);
  box-shadow: 0 0 0 0.5px rgb(255 255 255 / 12%), 0 10px 15px -3px rgb(0 0 0 / 10%), 0 4px 6px -4px rgb(0 0 0 / 10%);
  color: #efefed;
}

html[data-theme="dark"] .codex-review-comments-popover-item + .codex-review-comments-popover-item {
  border-color: rgb(255 255 255 / 12%);
}

html[data-theme="dark"] .codex-mini-fallback .desktop-composer .composer-input {
  background-color: transparent;
}

html[data-theme="dark"] .composer.desktop-composer:focus-within .composer-editor {
  border-color: rgb(255 255 255 / 23%);
}

html[data-theme="dark"] .desktop-composer .composer-input::placeholder {
  color: var(--codex-muted);
}

html[data-theme="dark"] .desktop-composer .mode-toggle.active {
  background: rgb(146 79 247 / 18%);
  color: #ad7bf9;
}

html[data-theme="dark"] .codex-mini-course-overlay .primary-button,
html[data-theme="dark"] .codex-mini-approval .codex-mini-course-action,
html[data-theme="dark"] .desktop-composer .send-button {
  background: #fff;
  color: #0d0d0d;
}

html[data-theme="dark"] .codex-mini-course-overlay .primary-button:hover,
html[data-theme="dark"] .codex-mini-approval .codex-mini-course-action:hover,
html[data-theme="dark"] .desktop-composer .send-button:hover:not(:disabled) {
  background: #ededed;
  color: #0d0d0d;
}

html[data-theme="dark"] .codex-mini-plan-toggle[aria-pressed="true"] {
  border-color: rgb(51 156 255 / 40%);
  background: rgb(51 156 255 / 14%);
  color: #99ceff;
}

html[data-theme="dark"] .codex-mini-fallback [data-browser-sidebar-toolbar] button:hover:not(:disabled) {
  background: var(--codex-hover);
}

/* Alpha keys the right-dock breakpoint to the Codex shell, not the viewport. */
@container (max-width: 720px) {
  .codex-mini-fallback .desktop-workspace-body {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) minmax(0, min(320px, 100%));
    grid-template-rows: minmax(0, 1fr);
  }

  .codex-mini-fallback .desktop-workspace-body[data-inspector-open="false"] {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
  }

  .codex-mini-fallback .desktop-workspace-body > .desktop-thread-panel {
    grid-column: 1;
    grid-row: 1;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .codex-mini-fallback .desktop-workspace-body > #codex-inspector.inspector-pane {
    position: static;
    inset: auto;
    z-index: auto;
    grid-column: 2;
    grid-row: 1;
    width: min(320px, 100%);
    min-height: 0;
    grid-template-rows: 40px minmax(0, 1fr);
    border-bottom: 0;
    border-left: 1px solid var(--codex-line);
    box-shadow: none;
  }

  .codex-mini-fallback #codex-inspector > .inspector-content[role="tabpanel"][aria-label="Review"] {
    display: grid;
    min-height: 0;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    overflow: hidden;
  }

  .codex-mini-fallback #codex-inspector > .inspector-content[role="tabpanel"][aria-label="Review"] > .code-view.diff-view {
    height: 100%;
    min-height: 0;
    overflow: auto;
  }
}
.codex-review-command-menu {
  position: fixed;
  z-index: 100;
  box-sizing: border-box;
  max-height: 320px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--line, #ddd);
  border-radius: 16px;
  background: var(--surface, #fff);
  color: var(--ink, #171717);
  font-size: 13px;
  line-height: 20px;
  backdrop-filter: blur(8px);
}
.codex-review-command-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 5px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  opacity: .75;
  outline: none;
  box-shadow: none;
}
.codex-review-command-menu button[aria-current="true"],
.codex-review-command-menu button:focus {
  background: color-mix(in srgb, currentColor 8%, transparent);
  opacity: 1;
  outline: none;
  box-shadow: none;
}
.codex-review-command-title {
  flex: 0 0 auto;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.codex-review-command-description {
  min-width: 0;
  margin-left: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.codex-review-command-section,
.codex-review-command-muted,
.codex-review-command-description {
  color: var(--muted, #6e6e73);
}
.codex-review-command-section {
  margin: 0;
  padding: 8px 8px 4px;
  font: inherit;
}
.codex-review-command-icon,
.codex-review-command-icon svg {
  display: block;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}
html[data-theme="dark"] .codex-review-command-menu {
  --muted: #aaa;
  background: #252525;
  border-color: #ffffff26;
  color: #f5f5f5;
}
.codex-review-mode {
  display: block;
  margin-top: 4px;
  color: var(--muted, #6e6e73);
  font-size: 12px;
  line-height: 18px;
  text-align: right;
}
.codex-github-link {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}
.codex-github-link svg {
  width: 14px;
  height: 14px;
  align-self: center;
}
.codex-slack-link { white-space: nowrap; }
.codex-practice-notice {
  position: absolute;
  z-index: 100;
  right: 20px;
  bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(420px, calc(100% - 40px));
  padding: 12px 14px;
  border: 1px solid var(--line, #ddd);
  border-radius: 12px;
  background: var(--surface, #fff);
  color: var(--ink, #171717);
  box-shadow: 0 8px 24px #0002;
  font-size: 13px;
  line-height: 1.5;
}
.codex-practice-notice button {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.codex-practice-notice button:hover { background: #8882; }
.codex-practice-notice button:focus-visible { outline: 2px solid #339cff; }
.codex-practice-notice button svg { width: 16px; height: 16px; }
.codex-slack-link::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 4px;
  vertical-align: -2px;
  background: url("/images/codex/apps/slack.svg") center / contain no-repeat;
}
