:root {
  color-scheme: light;
  --bg: #f7f9fb;
  --surface: #ffffff;
  --surface-low: #f2f4f6;
  --surface-muted: #eceef0;
  --surface-high: #e6e8ea;
  --surface-highest: #e0e3e5;
  --line: #dfe3e8;
  --line-strong: #c5c6d0;
  --text: #191c1e;
  --text-muted: #5c6470;
  --primary: #263c67;
  --primary-hover: #3e5380;
  --primary-soft: #d8e2ff;
  --accent: var(--primary);
  --blue: var(--primary);
  --blue-soft: #edf2ff;
  --teal: #314672;
  --teal-soft: #eef3ff;
  --amber: #b45309;
  --amber-soft: #fff4df;
  --red: #b91c1c;
  --red-soft: #feecec;
  --green: #16794c;
  --green-soft: #e7f6ed;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-float: 0 18px 45px rgba(15, 23, 42, 0.10);
  --radius: 6px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1180px;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

.auth-loading-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background: #f4f4f2;
  padding: 32px;
}

.auth-loading-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 260px;
  border: 1px solid rgba(0, 0, 0, 0.10);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}

.auth-loading-mark {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 6px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 750;
  font-size: 13px;
}

.auth-loading-card strong,
.auth-loading-card span {
  display: block;
  line-height: 1.4;
}

.auth-loading-card strong {
  font-weight: 680;
}

.auth-loading-card span {
  color: var(--text-muted);
  font-size: 12px;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background: #f4f4f2;
  padding: 32px;
}

.auth-loading-shell.is-hidden,
.login-shell.is-hidden,
.app-shell.is-hidden,
.is-hidden {
  display: none;
}

.login-card {
  width: min(322px, 100%);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  background: var(--surface);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.08),
    0 1px 2px rgba(0, 0, 0, 0.06);
  padding: 28px 20px 22px;
}

.login-title {
  margin: 0 0 24px;
  color: var(--text);
  font-size: 22px;
  font-weight: 650;
  line-height: 1.18;
  letter-spacing: 0;
  text-align: center;
}

.login-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 16px 0;
}

.login-tabs-single {
  grid-template-columns: 1fr;
}

.login-tabs.is-hidden {
  display: none;
}

#loginForm,
#registerForm {
  display: grid;
  gap: 11px;
}

#loginForm.is-hidden,
#registerForm.is-hidden {
  display: none;
}

#loginForm .field-label,
#registerForm .field-label {
  margin: 0;
}

#loginForm .field-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

#loginForm .primary-action,
#registerForm .primary-action {
  margin-top: 7px;
}

#loginForm .primary-action {
  min-height: 44px;
  border-radius: 999px;
  border-color: #111111;
  background: #111111;
  color: #ffffff;
  font-size: 13px;
  font-weight: 650;
}

#loginForm .primary-action:hover:not(:disabled) {
  border-color: #000000;
  background: #000000;
}

.text-input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #c9c9c3;
  border-radius: var(--radius);
  padding: 0 14px;
  background: #ffffff;
}

textarea.text-input {
  padding: 10px 14px;
  line-height: 1.5;
}

.text-input::placeholder {
  color: #8a8f98;
}

.text-input:focus {
  border-color: #111111;
  outline: none;
}

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

button {
  cursor: pointer;
}

.app-shell {
  --sidebar-width: 232px;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 180ms ease;
}

.app-shell.is-sidebar-collapsed {
  --sidebar-width: 52px;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #f7f7f5;
  padding: 10px;
  overflow: visible;
  z-index: 30;
}

.brand-block {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 28px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.brand-block > div:not(.brand-mark) {
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(38, 60, 103, 0.2);
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 800;
  font-size: 11px;
}

.brand-block h1 {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin: 0;
  font-size: 14px;
  line-height: 1.2;
}

.brand-name {
  display: block;
  min-width: 0;
}

.service-status-tools {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.sidebar-toggle-button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0;
  cursor: pointer;
}

.sidebar-toggle-button::before {
  content: "‹";
  font-size: 17px;
  line-height: 1;
}

.sidebar-toggle-button:hover {
  border-color: rgba(197, 198, 208, 0.56);
  background: rgba(255, 255, 255, 0.64);
  color: var(--text);
}

.local-enhancement-tools {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.local-enhancement-tools.is-install {
  opacity: 0.78;
}

.local-enhancement-tools.is-install .service-indicator {
  max-width: 92px;
  border-color: transparent;
  background: transparent;
  padding-left: 0;
}

.local-enhancement-tools.is-install .bridge-restart-button {
  min-width: 40px;
  border-color: rgba(144, 155, 171, 0.34);
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
}

.local-enhancement-tools.is-install .bridge-restart-button:hover {
  border-color: rgba(63, 73, 91, 0.28);
  background: rgba(255, 255, 255, 0.56);
}

.local-enhancement-tools.is-hidden {
  display: none;
}

.service-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 1 auto;
  min-height: 16px;
  max-width: 118px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  padding: 0;
  font-size: 10px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}

.service-indicator span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-indicator i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line-strong);
}

.service-indicator.is-ready i {
  background: #3f8f62;
}

.service-indicator.is-offline i {
  background: #c96c5a;
}

.service-indicator.is-checking i {
  background: #9aa4b2;
}

.bridge-restart-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 22px;
  min-width: 58px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--text-muted);
  padding: 0 8px;
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.bridge-restart-button:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.bridge-restart-button:disabled {
  cursor: wait;
  opacity: 0.64;
}

.brand-block p,
.panel-header p,
.workspace-header p {
  margin: 4px 0 0;
  color: var(--text-muted);
  line-height: 1.45;
}

.sidebar-section {
  margin-top: 14px;
}

.sidebar-main {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  padding-bottom: 14px;
}

.sidebar-generation {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 10px;
}

.user-menu-shell {
  position: relative;
  display: grid;
  gap: 5px;
  flex: 0 0 auto;
  margin-top: 10px;
}

.bottom-service-status {
  display: flex;
  min-width: 0;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  overflow: hidden;
  padding: 0 6px;
  white-space: nowrap;
}

.bottom-service-status .service-indicator {
  max-width: 78px;
}

.bottom-service-status .local-enhancement-tools {
  flex: 0 0 auto;
}

.user-menu-trigger {
  display: grid;
  width: 100%;
  grid-template-columns: 28px minmax(0, 1fr) 16px;
  gap: 8px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  padding: 6px;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.user-menu-trigger:hover,
.user-menu-trigger[aria-expanded="true"] {
  border-color: rgba(197, 198, 208, 0.64);
  background: rgba(255, 255, 255, 0.72);
}

.user-avatar {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: #0f8f70;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.user-menu-identity,
.user-menu-popover-head div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.user-menu-identity strong,
.user-menu-popover-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  white-space: nowrap;
}

.user-menu-identity span,
.user-menu-popover-head span {
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
}

.user-menu-chevron {
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  text-align: center;
}

.user-menu-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 80;
  display: grid;
  width: 320px;
  gap: 6px;
  border: 1px solid rgba(197, 198, 208, 0.72);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 18px 44px rgba(15, 23, 42, 0.16),
    0 1px 2px rgba(15, 23, 42, 0.08);
  padding: 8px;
}

.user-menu-popover.is-hidden {
  display: none;
}

.user-menu-popover-head {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  padding: 4px 4px 8px;
  margin-bottom: 2px;
}

.user-menu-quota {
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  padding: 0 2px 8px;
  margin-bottom: 2px;
}

.user-menu-action {
  display: flex;
  min-height: 34px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 0 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}

.user-menu-action:hover {
  background: rgba(243, 245, 247, 0.96);
}

.user-menu-action.is-danger {
  color: #b42318;
}

.app-shell.is-sidebar-collapsed .sidebar {
  align-items: center;
  padding: 10px 8px;
}

.app-shell.is-sidebar-collapsed .brand-block {
  grid-template-columns: 28px;
  justify-items: center;
}

.app-shell.is-sidebar-collapsed .brand-block > div:not(.brand-mark),
.app-shell.is-sidebar-collapsed .sidebar-main,
.app-shell.is-sidebar-collapsed .sidebar-generation {
  display: none;
}

.app-shell.is-sidebar-collapsed .sidebar-toggle-button {
  width: 28px;
  height: 28px;
  margin-top: 2px;
}

.app-shell.is-sidebar-collapsed .sidebar-toggle-button::before {
  content: "›";
}

.app-shell.is-sidebar-collapsed #newRequirementButton {
  display: grid;
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  place-items: center;
  margin-top: 8px;
  border: 1px solid transparent;
  background: transparent;
  box-shadow: none;
  padding: 0;
  position: relative;
  border-radius: 8px;
  font-size: 0;
}

.app-shell.is-sidebar-collapsed #newRequirementButton::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 15px;
  height: 2px;
  margin: 0;
  border-radius: 999px;
  background: var(--text-muted);
  transform: translate(-50%, -50%);
}

.app-shell.is-sidebar-collapsed #newRequirementButton::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 15px;
  border-radius: 999px;
  background: var(--text-muted);
  transform: translate(-50%, -50%);
}

.app-shell.is-sidebar-collapsed #newRequirementButton:hover {
  border-color: rgba(197, 198, 208, 0.44);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: none;
}

.app-shell.is-sidebar-collapsed .user-menu-shell {
  width: 32px;
  margin-top: auto;
}

.app-shell.is-sidebar-collapsed .bottom-service-status {
  display: none;
}

.app-shell.is-sidebar-collapsed .user-menu-trigger {
  width: 32px;
  grid-template-columns: 28px;
  justify-content: center;
  padding: 2px;
}

.app-shell.is-sidebar-collapsed .user-menu-identity,
.app-shell.is-sidebar-collapsed .user-menu-chevron {
  display: none;
}

.app-shell.is-sidebar-collapsed .user-menu-popover {
  left: 0;
}

.data-controls {
  display: grid;
  gap: 8px;
}

.data-status {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
  padding: 8px 10px;
}

.codex-usage-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px;
}

.user-menu-quota .codex-usage-card {
  gap: 3px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.codex-usage-card.is-error {
  border-color: rgba(192, 86, 33, 0.35);
  background: #fff9f6;
}

.codex-usage-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 6px;
  align-items: center;
}

.codex-usage-header strong {
  display: block;
  color: var(--text);
  font-size: 12px;
}

.codex-usage-header p {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
}

.codex-usage-header #refreshCodexUsageButton {
  display: grid;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  place-items: center;
  border-radius: 999px;
  padding: 0;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1;
}

.codex-usage-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
}

.user-menu-quota .codex-usage-grid {
  grid-template-columns: 1fr;
  gap: 1px;
}

.codex-usage-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-low);
  padding: 8px;
}

.user-menu-quota .codex-usage-item {
  display: flex;
  min-height: 22px;
  gap: 10px;
  align-items: baseline;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0 2px;
  white-space: nowrap;
}

.codex-usage-item span,
.codex-usage-item strong,
.codex-usage-item small {
  display: block;
}

.codex-usage-item span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
}

.codex-usage-item strong {
  margin-top: 4px;
  color: var(--text);
  font-size: 14px;
}

.codex-usage-item small {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.3;
}

.user-menu-quota .codex-usage-item strong {
  margin-top: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
}

.user-menu-quota .codex-usage-item small {
  margin-left: 2px;
  margin-top: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.2;
  text-align: right;
}

.user-menu-quota .codex-usage-item span {
  flex: 0 0 42px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 760px) {
  .codex-usage-header {
    grid-template-columns: 1fr;
  }
}

.codex-settings {
  display: grid;
  gap: 8px;
  padding-top: 4px;
}

.codex-settings label {
  display: grid;
  gap: 4px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
}

.codex-settings select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 34px;
  font-size: 12px;
  color: var(--text);
}

.task-model-grid,
.codex-reasoning-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.model-checkbox-field .checkbox-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.model-checkbox-field input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.model-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.model-tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  padding: 5px 7px;
}

.model-tag.is-vision {
  border-color: rgba(37, 131, 204, 0.28);
  background: rgba(37, 131, 204, 0.08);
  color: var(--accent);
}

.model-list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.model-config-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto auto;
  align-items: end;
  gap: 10px;
}

.gemini-config-grid {
  grid-template-columns: minmax(220px, 1fr) auto;
}

.task-model-grid label,
.model-config-grid label,
.codex-reasoning-grid label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.model-role-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.model-role-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
}

.model-role-badge.is-brain {
  border-color: rgba(30, 64, 175, 0.22);
  background: #eef4ff;
  color: #1e3a8a;
}

.model-role-badge.is-hand {
  border-color: rgba(4, 120, 87, 0.22);
  background: #ecfdf5;
  color: #047857;
}

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

.model-list-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
  padding: 9px 10px;
}

.model-list-item strong,
.model-list-item span {
  display: block;
}

.model-list-item span {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
}

.custom-api-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px;
}

.custom-api-panel.has-config-issue {
  border-color: rgba(180, 83, 9, 0.42);
  background: #fffaf0;
}

.custom-api-toggle {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  text-align: left;
}

.custom-api-toggle strong,
.custom-api-toggle em {
  display: block;
}

.custom-api-toggle strong {
  font-size: 14px;
}

.custom-api-toggle em {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.custom-api-toggle i {
  color: var(--text-muted);
  font-style: normal;
  transition: transform 120ms ease;
}

.custom-api-toggle.is-expanded i {
  transform: rotate(180deg);
}

.custom-api-body {
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.custom-api-body.is-hidden {
  display: none;
}

.custom-api-block {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
  padding: 12px;
}

.custom-api-block.is-api-focus {
  border-color: rgba(180, 83, 9, 0.52);
  background: #fff7ed;
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.12);
}

.oauth-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px;
}

.setup-step {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
  padding: 9px;
}

.setup-step + .oauth-actions {
  margin-top: 10px;
}

.setup-step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--text);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.setup-step strong {
  display: block;
  color: var(--text);
  font-size: 12px;
}

.setup-step p {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
}

.oauth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.oauth-card a {
  display: inline-block;
  margin-top: 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.oauth-code {
  margin-top: 8px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
  padding: 8px;
  text-align: center;
}

.oauth-hint {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
  margin-top: 8px;
}

.section-heading {
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sidebar-requirement-title {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 26px;
  gap: 6px;
  align-items: start;
  margin: 10px 0 4px;
}

.sidebar-requirement-title-copy {
  min-width: 0;
}

.sidebar-requirement-title strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 780;
  line-height: 1.28;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-requirement-title p {
  display: block;
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-requirement-actions {
  position: relative;
}

.sidebar-menu-button {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.sidebar-menu-button:hover,
.sidebar-menu-button[aria-expanded="true"] {
  border-color: rgba(197, 198, 208, 0.56);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
}

.sidebar-menu-button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.requirement-action-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 90;
  display: grid;
  min-width: 116px;
  border: 1px solid rgba(197, 198, 208, 0.72);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow:
    0 14px 34px rgba(15, 23, 42, 0.14),
    0 1px 2px rgba(15, 23, 42, 0.08);
  padding: 5px;
}

.requirement-action-menu.is-hidden {
  display: none;
}

.requirement-action-menu button {
  min-height: 30px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  padding: 0 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.requirement-action-menu button:hover {
  background: rgba(243, 245, 247, 0.96);
}

.status-stack {
  position: relative;
  display: block;
}

.requirement-list {
  display: grid;
  gap: 4px;
}

.requirement-item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  padding: 7px 8px;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.requirement-item:hover {
  border-color: rgba(197, 198, 208, 0.56);
  background: rgba(255, 255, 255, 0.62);
}

.requirement-item strong {
  display: block;
  font-size: 12px;
  line-height: 1.28;
}

.status-filter-dropdown {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.status-filter-trigger {
  display: grid;
  width: 100%;
  min-height: 34px;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(197, 198, 208, 0.7);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--text);
  padding: 0 34px 0 10px;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.status-filter-trigger:hover,
.status-filter-dropdown.is-open .status-filter-trigger {
  border-color: rgba(38, 60, 103, 0.2);
  background: #ffffff;
}

.status-filter-trigger span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.status-filter-trigger strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-filter-caret,
.status-filter-clear {
  position: absolute;
  right: 9px;
  z-index: 2;
}

.status-filter-caret {
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
}

.status-filter-clear {
  min-height: 22px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--primary);
  padding: 0 4px;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.status-filter-clear:hover {
  background: var(--primary-soft);
}

.status-filter-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  z-index: 85;
  display: grid;
  gap: 2px;
  border: 1px solid rgba(197, 198, 208, 0.72);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow:
    0 14px 34px rgba(15, 23, 42, 0.14),
    0 1px 2px rgba(15, 23, 42, 0.08);
  padding: 5px;
}

.status-filter-menu.is-hidden {
  display: none;
}

.status-filter-menu button {
  display: grid;
  min-height: 30px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  padding: 0 7px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.status-filter-menu button:hover,
.status-filter-menu button.is-selected {
  background: rgba(243, 245, 247, 0.96);
}

.status-filter-menu em {
  color: var(--text-muted);
  font-style: normal;
  font-size: 11px;
}

.requirement-filter-chip {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 7px 9px;
  color: var(--text-muted);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.requirement-filter-chip span {
  float: right;
  color: var(--primary);
  font-weight: 700;
}

.requirement-item.is-active {
  border-color: rgba(197, 198, 208, 0.72);
  background: #ffffff;
  box-shadow: inset 2px 0 0 var(--primary);
  color: var(--text);
}

.requirement-meta {
  display: flex;
  flex-wrap: wrap;
  min-width: 0;
  gap: 4px 6px;
  align-items: center;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.2;
}

.requirement-meta span,
.requirement-meta em {
  display: inline-flex;
  min-width: 0;
  margin-top: 0;
  overflow: hidden;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.requirement-meta em {
  max-width: 88px;
  border: 1px solid rgba(197, 198, 208, 0.48);
  border-radius: 999px;
  color: var(--text-muted);
  padding: 1px 5px;
  font-size: 10px;
}

.workspace {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.workspace-header {
  position: relative;
  flex: 0 0 auto;
  z-index: 22;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  min-height: 40px;
  gap: 12px;
  align-items: center;
  border-bottom: 0;
  background: transparent;
  padding: 5px 12px 5px 16px;
  pointer-events: none;
}

.workspace-header:has([data-tooltip]:hover, [data-tooltip]:focus-visible) {
  z-index: 120;
}

.workspace-title-block {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(180px, auto) minmax(120px, 1fr);
  gap: 4px 8px;
  align-items: center;
}

.workspace-header h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.12;
  letter-spacing: 0;
}

.workspace-header p {
  max-width: min(42vw, 760px);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.25;
}

.requirement-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.requirement-title-row h2 {
  min-width: 0;
  max-width: min(36vw, 560px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.title-edit-button {
  flex: 0 0 auto;
  min-height: 24px;
  padding: 0 7px;
  font-size: 11px;
}

.eyebrow {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.workspace-header .header-actions {
  flex: 0 0 auto;
  grid-column: 3;
  flex-wrap: nowrap;
  align-items: center;
  justify-self: end;
  max-width: 62vw;
  gap: 4px;
  overflow: visible;
  pointer-events: auto;
}

.workspace-mode-switch {
  grid-column: 2;
  justify-self: center;
  pointer-events: auto;
}

.workspace-header .header-actions .ghost-button {
  min-height: 26px;
  border-color: transparent;
  background: transparent;
  padding: 0 8px;
  color: var(--text);
  font-size: 11px;
  font-weight: 750;
}

.workspace-header .header-actions .badge {
  min-height: 24px;
  border-color: transparent;
  background: var(--surface-low);
  padding: 0 8px;
  font-size: 11px;
}

.workspace-header .header-actions .ghost-button:hover,
.workspace-header .header-actions .ghost-button.is-active {
  border-color: rgba(38, 60, 103, 0.18);
  background: var(--primary-soft);
  color: var(--primary);
}

.header-action-divider {
  width: 1px;
  height: 18px;
  margin: 0 4px;
  background: rgba(197, 198, 208, 0.72);
}

.header-menu-switch {
  min-width: 28px;
  padding: 0 6px !important;
  color: var(--text-muted) !important;
  font-size: 13px !important;
}

[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  width: max-content;
  max-width: 240px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: var(--radius);
  background: #111827;
  box-shadow: var(--shadow-float);
  color: #ffffff;
  content: attr(data-tooltip);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
  opacity: 0;
  padding: 8px 10px;
  pointer-events: none;
  transform: translateY(-2px);
  transition: opacity 120ms ease, transform 120ms ease;
  white-space: normal;
}

[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.view {
  display: none;
  flex: 1;
  padding: 8px 16px 16px;
  min-height: 0;
}

.view.is-active {
  display: block;
}

.layout-two {
  display: grid;
  grid-template-columns: minmax(420px, 0.95fr) minmax(560px, 1.15fr);
  gap: 18px;
}

.export-workspace {
  display: grid;
  grid-template-columns:
    minmax(520px, var(--export-left-width, 1fr))
    12px
    minmax(340px, var(--export-right-width, 420px));
  gap: 8px;
  align-items: stretch;
  height: calc(100vh - 96px);
  min-height: 640px;
  transition: grid-template-columns 160ms ease;
}

.workbench-layout {
  grid-template-columns:
    minmax(560px, var(--workbench-left-width, 1fr))
    12px
    minmax(340px, var(--workbench-right-width, 0.52fr));
  gap: 8px;
  align-items: stretch;
  height: calc(100vh - 96px);
  min-height: 640px;
  justify-content: stretch;
  transition: grid-template-columns 160ms ease;
}

.workbench-layout.is-spec-collapsed {
  grid-template-columns: minmax(0, var(--conversation-expanded-width, 980px)) 48px;
  gap: 12px;
  justify-content: center;
}

.workbench-layout.is-spec-collapsed.has-no-spec {
  grid-template-columns: minmax(0, var(--conversation-expanded-width, 980px));
}

.workbench-layout.is-spec-collapsed.has-no-spec .spec-panel {
  display: none;
}

.workbench-layout.is-spec-collapsed .workbench-resizer {
  display: none;
}

.workbench-layout.is-chat-focus .conversation {
  justify-items: stretch;
  padding: 28px 20px 18px;
}

.workbench-layout.is-chat-focus .workbench-start-guide,
.workbench-layout.is-chat-focus .discussion-plan-card,
.workbench-layout.is-chat-focus .preview-draft-message {
  justify-self: center;
  width: min(820px, 100%);
}

.workbench-layout.is-chat-focus .agent-run-message {
  justify-self: start;
}

.workbench-layout.is-chat-focus .message-shell {
  max-width: min(760px, 88%);
}

.workbench-layout.is-chat-focus .message {
  max-width: min(760px, 100%);
}

.workbench-layout.is-chat-focus .composer {
  display: grid;
  justify-items: center;
}

.conversation-panel .composer-input-shell,
.conversation-panel .preview-draft-refinement-bar,
.conversation-panel .pending-attachments {
  width: min(880px, 100%);
}

.layout-review {
  display: grid;
  grid-template-columns: minmax(720px, 1fr) minmax(390px, 440px);
  gap: 16px;
  height: calc(100vh - 96px);
}

.layout-library {
  display: grid;
  grid-template-columns: minmax(720px, 1fr) 360px;
  gap: 18px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: none;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
}

.panel-header h3 {
  margin: 0;
  font-size: 16px;
}

.conversation-panel > .panel-header {
  display: none;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(211, 216, 224, 0.62);
  padding: 8px 12px;
}

.conversation-panel > .panel-header h3 {
  font-size: 15px;
  line-height: 1.25;
}

.conversation-panel > .panel-header p {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.3;
}

.conversation-header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.conversation-panel .conversation-header-tools {
  gap: 8px;
}

.workbench-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.conversation-header-tools .workbench-mode-switch {
  padding: 1px;
}

.mode-tab {
  min-height: 28px;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  padding: 0 9px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.conversation-header-tools .mode-tab {
  min-height: 26px;
  padding: 0 8px;
  font-size: 11px;
}

.mode-tab.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.primary-action,
.secondary-button,
.ghost-button {
  min-height: 34px;
  border-radius: var(--radius);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.primary-action {
  width: 100%;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.primary-action:hover {
  background: var(--primary-hover);
}

#newRequirementButton {
  display: flex;
  width: 100%;
  min-height: 32px;
  justify-content: flex-start;
  gap: 7px;
  align-items: center;
  border-color: transparent;
  background: transparent;
  color: var(--text);
  padding: 0 8px;
  font-size: 12px;
  font-weight: 750;
}

#newRequirementButton::before {
  content: "+";
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.06);
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
}

#newRequirementButton:hover {
  border-color: rgba(197, 198, 208, 0.56);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
}

.compact-action {
  width: auto;
}

.secondary-button {
  border: 1px solid var(--line-strong);
  background: var(--surface-low);
  color: var(--text);
}

.ghost-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.secondary-button:hover,
.ghost-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-low);
}

.danger-button {
  border-color: #f1b8b8;
  color: var(--red);
}

.ghost-button.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.icon-button {
  min-width: 36px;
  padding: 0 10px;
  font-size: 20px;
  line-height: 1;
}

.full-width {
  width: 100%;
}

.has-modal-open {
  overflow: hidden;
}

.settings-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 28px;
}

.settings-modal.is-hidden {
  display: none;
}

.settings-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
}

.settings-dialog {
  position: relative;
  display: flex;
  width: min(1040px, calc(100vw - 56px));
  max-height: calc(100vh - 56px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22);
}

.settings-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
}

.settings-header h2 {
  margin: 0;
  font-size: 22px;
}

.settings-header p {
  margin: 4px 0 0;
  color: var(--text-muted);
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  overflow: auto;
  padding: 14px;
}

.settings-section {
  display: grid;
  gap: 10px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
  padding: 12px;
}

.settings-modal.has-settings-guide .settings-section {
  opacity: 0.24;
  transition: opacity 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.settings-modal.has-settings-guide .settings-section.is-guide-target {
  position: relative;
  z-index: 2;
  opacity: 1;
  border-color: rgba(47, 111, 98, 0.52);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(47, 111, 98, 0.14), var(--shadow-float);
  transform: translateY(-1px);
}

.settings-guide-callout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 12px;
  align-items: center;
  border: 1px solid rgba(47, 111, 98, 0.34);
  border-radius: var(--radius);
  background: #f2fbf6;
  padding: 10px;
}

.settings-guide-callout span {
  color: #2f6f62;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.settings-guide-callout strong {
  color: var(--text);
  font-size: 14px;
}

.settings-guide-callout p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.settings-guide-callout .primary-action {
  grid-row: 1 / span 2;
  grid-column: 2;
}

.settings-section-wide {
  grid-column: 1 / -1;
}

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

.settings-primary-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.settings-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.settings-subdetails,
.settings-advanced {
  min-width: 0;
}

.settings-subdetails summary,
.settings-advanced summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.settings-subdetails summary::-webkit-details-marker,
.settings-advanced summary::-webkit-details-marker {
  display: none;
}

.settings-subdetails summary {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  padding: 8px 10px;
}

.settings-subdetails summary i,
.settings-advanced summary i {
  color: var(--text-muted);
  font-style: normal;
  transition: transform 120ms ease;
}

.settings-subdetails[open] summary i,
.settings-advanced[open] summary i {
  transform: rotate(180deg);
}

.settings-subdetails[open] .codex-usage-card {
  margin-top: 8px;
}

.settings-advanced summary strong,
.settings-advanced summary em {
  display: block;
}

.settings-advanced summary strong {
  color: var(--text);
  font-size: 13px;
}

.settings-advanced summary em {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.35;
}

.advanced-settings-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding-top: 8px;
}

@media (max-width: 760px) {
  .settings-primary-status,
  .advanced-settings-body {
    grid-template-columns: 1fr;
  }

  .settings-inline-actions {
    justify-content: stretch;
  }

  .settings-inline-actions > button,
  .advanced-settings-body > button {
    width: 100%;
  }
}

.profile-modal {
  position: fixed;
  inset: 0;
  z-index: 1600;
  display: grid;
  place-items: start center;
  padding: 10vh 24px 24px;
}

.profile-modal.is-hidden {
  display: none;
}

.profile-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.34);
}

.profile-dialog {
  position: relative;
  display: grid;
  width: min(560px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
}

.profile-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
}

.profile-header h2 {
  margin: 0;
  font-size: 20px;
}

.profile-header p {
  margin: 4px 0 0;
  color: var(--text-muted);
  line-height: 1.45;
}

.profile-body {
  display: grid;
  gap: 14px;
  padding: 16px 18px 18px;
}

.profile-grid,
.profile-password-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

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

.profile-field-wide {
  grid-column: 1 / -1;
}

.profile-field span,
.profile-section-title {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-field small {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.profile-field input[readonly],
.profile-field textarea[readonly] {
  background: #f8fafc;
  color: var(--text-muted);
}

.profile-password-section {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
  padding: 12px;
}

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

@media (max-width: 760px) {
  .profile-modal {
    padding-top: 7vh;
  }

  .profile-grid,
  .profile-password-grid {
    grid-template-columns: 1fr;
  }
}

.form-dialog-modal {
  position: fixed;
  inset: 0;
  z-index: 1700;
  display: grid;
  place-items: start center;
  padding: 16vh 24px 24px;
}

.form-dialog-modal.is-hidden {
  display: none;
}

.form-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.34);
}

.form-dialog {
  position: relative;
  display: grid;
  width: min(520px, calc(100vw - 32px));
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
}

.form-dialog-header h2 {
  margin: 0;
  font-size: 20px;
}

.form-dialog-header p {
  margin: 5px 0 0;
  color: var(--text-muted);
  line-height: 1.45;
}

.form-dialog-fields {
  display: grid;
  gap: 12px;
}

.form-dialog-field {
  display: grid;
  gap: 6px;
}

.form-dialog-field span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.form-dialog-field small {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.form-dialog .text-input,
.form-dialog-select {
  min-height: 42px;
  border-color: var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
}

.form-dialog .text-input:focus,
.form-dialog-select:focus {
  border-color: var(--primary);
}

.form-dialog-notice {
  border: 1px solid #9fdbbf;
  border-radius: var(--radius-sm);
  background: #edf9f2;
  color: #14532d;
  padding: 10px 12px;
}

.form-dialog-notice strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
}

.form-dialog-notice p {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.form-dialog-textarea {
  min-height: 112px;
  padding: 10px 12px;
  line-height: 1.45;
}

.form-dialog-error {
  border: 1px solid #f1b8b8;
  border-radius: var(--radius);
  background: var(--red-soft);
  color: var(--red);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
}

.form-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.form-dialog-actions .primary-action {
  width: auto;
}

.image-viewer-modal {
  position: fixed;
  inset: 0;
  z-index: 1900;
  display: grid;
  place-items: center;
  padding: 24px;
}

.image-viewer-modal.is-hidden {
  display: none;
}

.image-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
}

.image-viewer-dialog {
  position: relative;
  display: grid;
  width: min(1340px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.35);
}

.image-viewer-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
}

.image-viewer-header h2 {
  margin: 0;
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-viewer-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
}

.image-viewer-stage {
  display: grid;
  min-height: 220px;
  place-items: center;
  overflow: auto;
  background: #0f172a;
  padding: 16px;
}

.image-viewer-stage img {
  max-width: 100%;
  max-height: calc(100vh - 156px);
  object-fit: contain;
  border-radius: 6px;
  background: #ffffff;
}

.image-viewer-stage.is-code-preview {
  display: block;
  background: var(--surface-muted);
  padding: 12px;
}

.visual-code-review {
  display: grid;
  min-height: min(680px, calc(100vh - 142px));
  min-width: 1172px;
  grid-template-columns: 402px 402px minmax(320px, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 12px;
}

.visual-code-original,
.visual-code-rendered,
.visual-code-source,
.visual-code-empty,
.visual-code-loading {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.visual-code-original {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  overflow: hidden;
  padding: 10px;
}

.visual-code-original-frame {
  width: 402px;
  height: 874px;
  max-height: min(874px, calc(100vh - 244px));
  overflow: auto;
  border-radius: 6px;
  background: #0f172a;
}

.visual-code-original-frame img {
  width: 100%;
  height: auto;
  object-fit: contain;
  background: #0f172a;
}

.visual-code-original strong,
.visual-code-original span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visual-code-original span {
  color: var(--text-muted);
  font-size: 12px;
}

.visual-code-rendered,
.visual-code-source {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.visual-code-panel-title {
  border-bottom: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 10px;
}

.visual-code-frame-shell {
  width: 100%;
  height: 100%;
  overflow: auto;
  background: #dfe5ec;
}

.visual-code-frame {
  display: block;
  width: 402px;
  height: 874px;
  min-width: 402px;
  max-width: 402px;
  border: 0;
  background: #ffffff;
}

.visual-code-source-box {
  width: 100%;
  height: 100%;
  min-height: 0;
  resize: none;
  border: 0;
  background: #0f172a;
  color: #e5eefb;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  outline: 0;
  padding: 10px;
}

.visual-code-empty,
.visual-code-loading {
  display: grid;
  min-height: 280px;
  place-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
}

.visual-code-empty strong,
.visual-code-loading strong {
  font-size: 16px;
}

.visual-code-empty span,
.visual-code-loading span {
  max-width: 460px;
  color: var(--text-muted);
  line-height: 1.6;
}

@media (max-width: 760px) {
  .image-viewer-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .image-viewer-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .visual-code-review {
    min-height: auto;
    min-width: 402px;
    grid-template-columns: 1fr;
    grid-template-rows: auto 520px 260px;
  }

  .visual-code-original,
  .visual-code-rendered,
  .visual-code-source {
    width: 402px;
    justify-self: center;
  }
}

.model-action-modal {
  position: fixed;
  inset: 0;
  z-index: 1800;
  display: grid;
  place-items: start center;
  padding-top: 18vh;
}

.model-action-modal.is-hidden {
  display: none;
}

.model-action-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
}

.model-action-dialog {
  position: relative;
  display: grid;
  width: min(480px, calc(100vw - 32px));
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.22);
}

.model-action-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.model-action-header h2 {
  margin: 0;
  font-size: 18px;
}

.model-action-header p,
.model-action-summary,
.model-action-reason p {
  margin: 4px 0 0;
  color: var(--text-muted);
  line-height: 1.45;
}

.model-action-summary {
  color: var(--text);
  font-size: 14px;
}

.model-action-reason {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-low);
  padding: 10px;
}

.model-action-reason span {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.model-action-reason p {
  font-size: 13px;
}

.model-action-convergence {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 10px;
}

.convergence-summary {
  display: grid;
  gap: 8px;
}

.convergence-summary.is-compact {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.convergence-summary div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.convergence-summary span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.convergence-summary ul {
  display: grid;
  gap: 3px;
  margin: 0;
  padding-left: 16px;
}

.convergence-summary li {
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
}

.model-action-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.model-action-buttons .primary-action {
  width: auto;
}

.agent-run-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 1850;
  display: grid;
  place-items: center;
  padding: 24px;
}

.agent-run-detail-modal.is-hidden {
  display: none;
}

.agent-run-detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
}

.agent-run-detail-dialog {
  position: relative;
  display: flex;
  width: min(1060px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 28px 72px rgba(15, 23, 42, 0.24);
}

.agent-run-detail-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding: 18px 20px;
}

.agent-run-detail-header h2 {
  margin: 3px 0 0;
  color: var(--text);
  font-size: 22px;
  line-height: 1.25;
}

.agent-run-detail-header p {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.agent-run-detail-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
}

.agent-run-detail-body {
  display: grid;
  gap: 14px;
  overflow: auto;
  padding: 16px;
}

.agent-chat-shell {
  display: grid;
  gap: 14px;
}

.agent-chat-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #f8fafc;
  padding: 14px;
}

.agent-chat-hero h3 {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.3;
}

.agent-chat-hero p {
  margin: 8px 0 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
}

.agent-chat-hero-side {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.agent-chat-intervention {
  display: grid;
  gap: 5px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px 14px;
}

.agent-chat-intervention.is-blocking {
  border-color: #fecaca;
  background: #fff7f7;
}

.agent-chat-intervention.is-ready {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.agent-chat-intervention.is-self-revision {
  border-color: #fde68a;
  background: #fffbeb;
}

.agent-chat-intervention span,
.agent-chat-attachment span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.agent-chat-intervention strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}

.agent-chat-intervention p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

.agent-chat-thread {
  display: grid;
  gap: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

.agent-chat-thread.is-live {
  border-style: dashed;
  background: #fbfdff;
}

.live-generation-trace {
  display: grid;
  gap: 6px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  margin: 2px 0 10px;
  padding: 8px 10px;
}

.live-generation-trace-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.live-generation-trace-head small {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}

.live-generation-trace-list {
  display: grid;
  gap: 3px;
  max-height: calc((11px * 1.35 + 3px) * 3);
  overflow: hidden;
}

.live-generation-trace-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 6px;
  align-items: start;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
}

.live-generation-trace-row time {
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

.live-generation-trace-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-generation-trace-row.is-success span {
  color: #15803d;
}

.live-generation-trace-row.is-warn span {
  color: #b45309;
}

.live-generation-trace-row.is-error span {
  color: #b91c1c;
}

.agent-chat-message {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.agent-chat-avatar-wrap {
  padding-top: 22px;
}

.agent-chat-content {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.agent-chat-speaker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
}

.agent-chat-speaker strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
}

.agent-chat-speaker span {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.25;
}

.agent-chat-bubble {
  display: grid;
  gap: 8px;
  max-width: 760px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px;
}

.agent-chat-message.is-product .agent-chat-bubble,
.agent-chat-message.is-preview .agent-chat-bubble {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.agent-chat-message.is-design .agent-chat-bubble,
.agent-chat-message.is-copy .agent-chat-bubble {
  border-color: #fde68a;
  background: #fffdf5;
}

.agent-chat-message.is-reviewer .agent-chat-bubble,
.agent-chat-message.is-pm .agent-chat-bubble {
  border-color: #fecaca;
  background: #fffafa;
}

.agent-chat-message.is-judge .agent-chat-bubble {
  border-color: #cbd5e1;
  background: #f3f4f6;
}

.agent-chat-bubble p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}

.agent-chat-attachments {
  display: grid;
  gap: 8px;
}

.agent-chat-attachment {
  display: grid;
  gap: 5px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  padding: 9px;
}

.agent-chat-attachment.is-warning {
  border-color: #fde68a;
  background: #fffbeb;
}

.agent-chat-attachment.is-danger {
  border-color: #fecaca;
  background: #fff7f7;
}

.agent-chat-attachment strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.agent-chat-attachment p,
.agent-chat-attachment li {
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.agent-chat-attachment p {
  margin: 0;
}

.agent-chat-attachment ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
}

.agent-chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.agent-steer-composer,
.agent-legacy-summary {
  display: grid;
  gap: 12px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

.agent-legacy-summary > div:first-child {
  display: grid;
  gap: 5px;
}

.agent-legacy-summary strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
}

.agent-legacy-summary p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.agent-steer-composer textarea {
  min-height: 68px;
  resize: vertical;
}

.agent-steer-composer > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.agent-steer-composer span {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.agent-detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 14px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius);
  background: #f8fafc;
  padding: 14px;
}

.agent-detail-hero p {
  margin: 5px 0 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
}

.agent-detail-score {
  display: grid;
  place-items: center;
  align-content: center;
  border: 1px solid #dbe3ef;
  border-radius: var(--radius);
  background: #ffffff;
  padding: 10px;
}

.agent-detail-score span {
  color: var(--text);
  font-size: 24px;
  font-weight: 850;
  line-height: 1;
}

.agent-detail-score small {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
}

.agent-decision-guidance {
  display: grid;
  gap: 10px;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  background: #fffbeb;
  padding: 12px;
}

.agent-decision-guidance.is-blocking {
  border-color: #fecaca;
  background: #fff7f7;
}

.agent-decision-guidance-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.agent-decision-guidance-header > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.agent-decision-guidance-header span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.agent-decision-guidance-header strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.3;
}

.agent-decision-guidance p,
.agent-decision-guidance small {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.agent-decision-guidance small {
  color: var(--text-muted);
}

.agent-decision-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.agent-decision-list li {
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.agent-decision-list strong,
.agent-decision-list span,
.agent-decision-list em {
  display: block;
}

.agent-decision-list strong {
  margin-bottom: 3px;
}

.agent-decision-list span {
  color: var(--text);
}

.agent-decision-list em {
  margin-top: 3px;
  color: var(--text-muted);
  font-style: normal;
}

.agent-detail-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 8px;
}

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

.agent-detail-section {
  display: grid;
  gap: 12px;
  align-content: start;
  border: 1px solid #dbe3ef;
  border-radius: var(--radius);
  background: #ffffff;
  padding: 14px;
}

.agent-detail-section-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.agent-detail-section-header > span,
.agent-detail-list-block > span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.agent-detail-definition-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.agent-detail-definition-list > div {
  display: grid;
  gap: 3px;
}

.agent-detail-definition-list dt {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
}

.agent-detail-definition-list dd {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.agent-detail-list-block {
  display: grid;
  gap: 6px;
}

.agent-detail-list-block ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
}

.agent-detail-list-block li,
.agent-detail-empty {
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

.agent-detail-empty {
  margin: 0;
  color: var(--text-muted);
}

.agent-next-action-list,
.agent-role-report-list,
.agent-collision-list,
.agent-screen-plan-list,
.agent-copy-review-list,
.agent-review-issue-list {
  display: grid;
  gap: 10px;
}

.agent-next-action,
.agent-role-report,
.agent-collision-item,
.agent-screen-plan-item,
.agent-copy-review-item,
.agent-review-issue-item {
  display: grid;
  gap: 8px;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  background: #fbfdff;
  padding: 12px;
}

.agent-next-action {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.agent-next-action strong,
.agent-role-report strong,
.agent-collision-item strong,
.agent-screen-plan-item strong,
.agent-copy-review-item strong,
.agent-review-issue-item strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.agent-next-action p,
.agent-role-report p,
.agent-collision-item p,
.agent-screen-plan-item p,
.agent-review-issue-item p {
  margin: 3px 0 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

.agent-next-action span,
.agent-role-report-header span,
.agent-collision-item span,
.agent-screen-plan-item span,
.agent-review-issue-item span {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.agent-role-report-header,
.agent-copy-review-header,
.agent-review-issue-item > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.agent-copy-review-section {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.agent-copy-review-item {
  background: #ffffff;
}

.agent-copy-review-item.is-blocking,
.agent-review-issue-item.is-blocking {
  border-color: #fecaca;
  background: #fffafa;
}

.agent-copy-review-item.is-major,
.agent-review-issue-item.is-major {
  border-color: #fde68a;
  background: #fffdf5;
}

.agent-copy-review-header span {
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  background: #f8fafc;
  padding: 3px 7px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
}

.agent-judge-card {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.agent-judge-card.is-pass,
.agent-judge-card.is-pass_with_assumptions {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.agent-judge-card.is-revise_team_run,
.agent-judge-card.is-reject_next_action {
  border-color: #fde68a;
  background: #fffbeb;
}

.agent-judge-card.is-block_for_pm {
  border-color: #fecaca;
  background: #fff7f7;
}

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

.agent-judge-list article {
  display: grid;
  gap: 5px;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  padding: 9px;
}

.agent-judge-list article.is-fail,
.agent-judge-list article.is-unknown {
  border-color: #fde68a;
  background: #fffdf5;
}

.agent-judge-list strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.agent-judge-list p {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.agent-judge-list small {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
}

@media (max-width: 760px) {
  .agent-run-detail-modal {
    padding: 12px;
  }

  .agent-run-detail-header {
    flex-direction: column;
  }

  .agent-run-detail-actions {
    width: 100%;
    justify-content: space-between;
  }

  .agent-detail-hero,
  .agent-detail-grid,
  .agent-next-action {
    grid-template-columns: 1fr;
  }

  .agent-decision-guidance-header {
    flex-direction: column;
  }

  .agent-detail-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .agent-chat-hero {
    grid-template-columns: 1fr;
  }

  .agent-chat-hero-side {
    justify-items: start;
  }

  .agent-chat-thread {
    padding: 10px;
  }

  .agent-chat-message {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .agent-chat-bubble {
    max-width: none;
  }

  .agent-steer-composer > div {
    align-items: stretch;
    flex-direction: column;
  }
}

.compact-header {
  border-bottom: 0;
  padding: 0;
}

.conversation-panel,
.spec-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.conversation-panel {
  position: relative;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.spec-panel {
  min-width: 0;
  overflow: hidden;
}

.workbench-resizer,
.export-resizer {
  position: relative;
  align-self: stretch;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: col-resize;
  outline: none;
}

.workbench-resizer::before,
.export-resizer::before {
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 50%;
  width: 4px;
  border-radius: 999px;
  background: var(--line);
  content: "";
  transform: translateX(-50%);
  transition: background 120ms ease, box-shadow 120ms ease;
}

.workbench-resizer:hover::before,
.workbench-resizer:focus-visible::before,
body.is-resizing-workbench .workbench-resizer::before,
.export-resizer:hover::before,
.export-resizer:focus-visible::before,
body.is-resizing-export .export-resizer::before {
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(38, 60, 103, 0.12);
}

body.is-resizing-workbench,
body.is-resizing-export {
  cursor: col-resize;
  user-select: none;
}

.conversation-panel > .panel-header,
.discussion-plan-host,
.spec-panel > .panel-header,
.reference-strip,
.composer {
  flex: 0 0 auto;
}

.spec-panel.is-sidebar-collapsed .panel-header {
  align-items: center;
  justify-content: center;
  height: 100%;
  border-bottom: 0;
  padding: 10px;
}

.spec-panel.is-sidebar-collapsed .panel-header > div:first-child,
.spec-panel.is-sidebar-collapsed .spec-metrics,
.spec-panel.is-sidebar-collapsed .spec-view-tabs,
.spec-panel.is-sidebar-collapsed #artifactWorkbenchPicker,
.spec-panel.is-sidebar-collapsed #copySpecButton,
.spec-panel.is-sidebar-collapsed #copyFigmaBridgeMenu,
.spec-panel.is-sidebar-collapsed .spec-body {
  display: none;
}

.spec-panel.is-sidebar-collapsed .header-actions {
  width: 100%;
  justify-content: center;
}

.spec-panel.is-sidebar-collapsed #toggleSpecButton {
  width: 36px;
  min-height: 128px;
  padding: 10px 0;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.conversation {
  display: grid;
  flex: 1 1 auto;
  gap: 14px;
  align-content: start;
  min-height: 0;
  overflow: auto;
  padding: 20px 20px 18px;
  scrollbar-color: rgba(15, 23, 42, 0.22) transparent;
  scrollbar-width: thin;
}

.conversation::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.conversation::-webkit-scrollbar-track {
  background: transparent;
}

.conversation::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.22);
  background-clip: padding-box;
}

.conversation::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 23, 42, 0.34);
  background-clip: padding-box;
}

.workbench-start-guide {
  display: grid;
  width: 100%;
  gap: 14px;
}

.conversation-panel.is-start-state {
  justify-content: center;
  gap: 12px;
}

.conversation-panel.is-start-state .discussion-plan-host,
.conversation-panel.is-start-state .reference-strip {
  display: none;
}

.conversation-panel.is-start-state .composer {
  order: 1;
  flex: 0 0 auto;
  padding: 0 20px;
}

.conversation-panel.is-start-state .conversation {
  order: 2;
  flex: 0 0 auto;
  justify-items: center;
  overflow: visible;
  padding: 0 20px;
}

.conversation-panel.is-start-state .composer-input-shell,
.conversation-panel.is-start-state .composer-start-hint,
.conversation-panel.is-start-state .preview-draft-refinement-bar,
.conversation-panel.is-start-state .pending-attachments,
.conversation-panel.is-start-state .workbench-start-guide {
  width: min(680px, 100%);
}

.conversation-panel.is-start-state .composer-input-shell {
  border-radius: 18px;
  box-shadow:
    0 20px 52px rgba(15, 23, 42, 0.1),
    0 1px 2px rgba(15, 23, 42, 0.06);
}

.conversation-panel.is-start-state .composer-start-hint,
.conversation-panel.is-start-state .workbench-start-guide {
  gap: 10px;
}

.composer-start-hint {
  display: grid;
  width: min(820px, 100%);
  gap: 10px;
  margin-bottom: 12px;
}

.composer-start-hint.is-hidden {
  display: none;
}

.start-guide-prompt {
  display: grid;
  gap: 10px;
}

.start-guide-inline-note {
  max-width: 680px;
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.start-guide-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 4px solid #2f6f62;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 18px;
}

.start-guide-kicker {
  display: block;
  margin-bottom: 7px;
  color: #2f6f62;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.start-guide-hero h3 {
  margin: 0;
  color: var(--text);
  font-size: 21px;
  line-height: 1.22;
}

.start-guide-hero p {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--text-muted);
  line-height: 1.55;
}

.start-guide-main-action {
  min-width: 132px;
}

.start-guide-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.start-guide-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 2px 8px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
  padding: 10px;
}

.start-guide-step span {
  display: grid;
  grid-row: 1 / span 2;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: #e7f6ed;
  color: #16794c;
  font-size: 12px;
  font-weight: 800;
}

.start-guide-step strong {
  min-width: 0;
  font-size: 13px;
  line-height: 1.25;
}

.start-guide-step p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.38;
}

.starter-template-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.starter-template-section {
  display: grid;
  gap: 8px;
}

.starter-template-heading {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.starter-template-button {
  display: grid;
  gap: 5px;
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 10px;
  text-align: left;
}

.starter-template-button:hover:not(:disabled) {
  border-color: #2f6f62;
  background: #f7fcf9;
}

.starter-template-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.starter-template-button strong {
  font-size: 13px;
  line-height: 1.25;
}

.starter-template-button span {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.38;
}

.starter-template-button.is-upload {
  border-color: #f1d29a;
  background: #fffaf0;
}

.starter-template-button.is-upload:hover:not(:disabled) {
  border-color: #b45309;
  background: #fff4df;
}

.message-shell {
  position: relative;
  display: grid;
  max-width: min(880px, 88%);
}

.message-shell.is-user {
  justify-self: end;
}

.message-shell.is-assistant,
.message-shell.is-reviewer {
  justify-self: start;
}

.message-shell .message {
  max-width: 100%;
}

.message {
  max-width: min(880px, 88%);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--surface);
}

.discussion-plan-host {
  position: absolute;
  top: 4px;
  left: 50%;
  z-index: 42;
  display: grid;
  gap: 6px;
  width: min(820px, calc(100% - 40px));
  justify-items: center;
  border-bottom: 0;
  background: transparent;
  padding: 0;
  pointer-events: none;
  transform: translateX(-50%);
}

.discussion-plan-host.is-hidden {
  display: none;
}

.discussion-plan-host.is-collapsed .discussion-plan-card,
.discussion-plan-host.is-collapsed .agent-runtime-card {
  width: 100%;
  max-width: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  pointer-events: auto;
}

.discussion-plan-host.is-expanded {
  position: absolute;
  top: 4px;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 48;
  width: auto;
  display: grid;
  place-items: start center;
  border-bottom: 0;
  background: transparent;
  padding: 0 20px 20px;
  pointer-events: none;
  transform: none;
}

.discussion-plan-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(248, 250, 252, 0.38);
  backdrop-filter: blur(1.5px);
  pointer-events: auto;
}

.discussion-plan-popover {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
  width: min(820px, calc(100% - 40px));
  max-height: min(58vh, 660px);
  flex-direction: column;
  pointer-events: auto;
}

.discussion-plan-popover .discussion-plan-card {
  display: flex;
  width: 100%;
  border-color: rgba(20, 83, 45, 0.28);
  border-radius: 10px;
  max-width: none;
  max-height: min(58vh, 660px);
  flex-direction: column;
  box-shadow:
    0 26px 80px rgba(15, 23, 42, 0.26),
    0 10px 28px rgba(15, 23, 42, 0.14),
    0 0 0 1px rgba(255, 255, 255, 0.92) inset;
}

.agent-runtime-card {
  display: grid;
  width: 100%;
  max-width: min(920px, 100%);
  gap: 4px;
  border: 1px solid #c8d3e1;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  padding: 7px 10px;
  pointer-events: auto;
}

.agent-runtime-main {
  display: flex;
  min-width: 0;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.agent-runtime-main strong {
  color: #253c67;
  font-size: 11px;
  font-weight: 900;
}

.agent-runtime-main span {
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  background: #f8fafc;
  color: var(--text-muted);
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 800;
}

.agent-runtime-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.agent-runtime-card.is-running {
  border-color: #b7c6e7;
  background: #f4f7ff;
}

.agent-runtime-card.is-waiting {
  border-color: #f3d18b;
  background: #fffaf0;
}

.agent-runtime-card.is-interrupted {
  border-color: #fecaca;
  background: #fff7f7;
}

.conversation-panel:has(.discussion-plan-host:not(.is-hidden)) .conversation {
  padding-top: 54px;
}

.discussion-plan-host.is-expanded .discussion-plan-summary {
  min-height: 36px;
  padding: 7px 10px;
}

.discussion-plan-host.is-expanded .discussion-plan-detail {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 10px;
}

.discussion-plan-host.is-expanded .discussion-plan-detail::-webkit-scrollbar {
  width: 8px;
}

.discussion-plan-host.is-expanded .discussion-plan-detail::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(20, 83, 45, 0.28);
}

.discussion-plan-card {
  display: grid;
  gap: 6px;
  max-width: min(920px, 100%);
  border: 1px solid #b8d8c5;
  border-radius: var(--radius-sm);
  background: #f2fbf6;
  color: var(--text);
  padding: 0;
  overflow: hidden;
}

.discussion-plan-card.has-blockers {
  border-color: #f3d18b;
  background: #fffaf0;
}

.discussion-plan-summary {
  display: flex;
  width: 100%;
  min-height: 28px;
  gap: 6px;
  align-items: flex-start;
  justify-content: space-between;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 4px 8px;
  text-align: left;
}

.discussion-plan-summary:hover {
  background: rgba(255, 255, 255, 0.58);
}

.discussion-plan-summary-main {
  display: flex;
  min-width: 0;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  overflow: hidden;
  white-space: normal;
}

.discussion-plan-summary-main strong {
  flex: 0 0 auto;
  color: #14532d;
  font-size: 11px;
  font-weight: 900;
}

.discussion-plan-summary-main span {
  flex: 0 1 auto;
  max-width: min(100%, 260px);
  min-width: 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
}

.discussion-plan-summary-main span::before {
  color: #9ab7a6;
  content: "·";
  margin-right: 6px;
}

.discussion-plan-summary em {
  flex: 0 0 auto;
  border: 1px solid #b8d8c5;
  border-radius: 999px;
  background: #ffffff;
  color: #14532d;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  padding: 2px 6px;
}

.discussion-plan-detail {
  display: grid;
  gap: 8px;
  border-top: 1px solid #cfe8d8;
  padding: 8px;
}

.discussion-current span {
  display: block;
  color: #197044;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.discussion-plan-detail p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.45;
}

.discussion-revision,
.discussion-gate,
.discussion-context-alignment {
  display: grid;
  gap: 5px;
  border: 1px solid #cfe8d8;
  border-radius: var(--radius-sm);
  background: #ffffff;
  padding: 7px;
}

.discussion-revision span,
.discussion-gate-head span,
.discussion-context-head span {
  color: #197044;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.discussion-revision strong,
.discussion-gate-head strong,
.discussion-context-head strong {
  font-size: 13px;
  line-height: 1.35;
}

.discussion-revision small {
  color: var(--text-muted);
  line-height: 1.35;
}

.discussion-gate.is-blocked {
  border-color: #f3d18b;
  background: #fff8e6;
}

.discussion-context-alignment.is-needs_confirmation {
  border-color: #f3d18b;
  background: #fffaf0;
}

.discussion-context-alignment.is-confirmed {
  border-color: #b8d8c5;
  background: #f2fbf6;
}

.discussion-context-head,
.discussion-gate-head {
  display: grid;
  gap: 3px;
}

.discussion-context-alignment p,
.discussion-context-question {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.35;
}

.discussion-context-evidence {
  display: grid;
  gap: 6px;
}

.discussion-context-evidence article {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(20, 83, 45, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
  padding: 7px;
}

.discussion-context-evidence strong {
  color: #14532d;
  font-size: 12px;
}

.discussion-context-evidence span,
.discussion-context-evidence small {
  color: var(--text-muted);
  line-height: 1.35;
}

.discussion-blocker-list {
  display: grid;
  gap: 6px;
}

.discussion-blocker-list article {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(146, 64, 14, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
  padding: 7px;
}

.discussion-blocker-list strong {
  color: #7c2d12;
  font-size: 12px;
}

.discussion-blocker-list span,
.discussion-blocker-list small {
  color: var(--text-muted);
  line-height: 1.35;
}

.discussion-assumption-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.discussion-assumption-strip span {
  border: 1px solid #d8e2ee;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 7px;
}

.discussion-current {
  display: grid;
  gap: 3px;
  border: 1px solid #cfe8d8;
  border-radius: var(--radius-sm);
  background: #ffffff;
  padding: 7px;
}

.discussion-current strong {
  font-size: 14px;
}

.discussion-current small {
  color: var(--text-muted);
  line-height: 1.4;
}

.discussion-point-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.discussion-point {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 7px;
}

.discussion-point.is-current {
  border-color: #1f7a4d;
  color: #14532d;
}

.discussion-point.is-confirmed {
  border-color: #b8d8c5;
  background: #ecfdf3;
  color: #166534;
}

.discussion-point.is-risk {
  border-color: #f5c2c2;
  background: #fff1f1;
  color: #b42318;
}

.discussion-point.is-needs_confirmation {
  border-color: #f3d18b;
  background: #fff8e6;
  color: #92400e;
}

.message-more {
  position: relative;
  display: flex;
  justify-content: flex-start;
  width: 32px;
  margin-top: 3px;
  opacity: 0.32;
  transition: opacity 140ms ease;
}

.message-shell.is-user .message-more {
  justify-self: end;
}

.message-shell.is-assistant .message-more,
.message-shell.is-reviewer .message-more {
  justify-self: start;
}

.message-shell:hover .message-more,
.message-shell:focus-within .message-more {
  opacity: 0.72;
}

.message-more-button {
  width: 28px;
  height: 22px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.message-shell.is-user .message-more-button {
  color: var(--text-muted);
}

.message-more-button:hover {
  background: transparent;
  color: var(--text);
}

.message-more-menu {
  position: absolute;
  bottom: 24px;
  z-index: 20;
  min-width: 116px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 6px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
}

.message-shell.is-user .message-more-menu {
  right: 0;
}

.message-shell.is-assistant .message-more-menu,
.message-shell.is-reviewer .message-more-menu {
  left: 0;
}

.message-more-menu.is-hidden {
  display: none;
}

.message-more-item {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 9px;
  text-align: left;
}

.message-more-item:hover {
  background: var(--surface-low);
}

.message-more-item.danger-button {
  color: var(--red);
}

.message-more-item.danger-button:hover {
  background: var(--red-soft);
}

.message.is-user {
  justify-self: end;
  border-color: var(--primary);
  border-top-right-radius: 3px;
  background: var(--primary);
  color: #ffffff;
}

.message.is-assistant {
  justify-self: start;
  border-top-left-radius: 3px;
  background: var(--surface-low);
}

.agent-run-message {
  width: min(860px, 96%);
  max-width: min(860px, 96%);
  padding: 0;
  overflow: visible;
  border-color: #cbd5e1;
  background: #fbfdff;
}

.agent-run-card {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.agent-run-card.is-discussion {
  gap: 12px;
  padding: 14px 16px;
}

.agent-run-header,
.agent-run-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.agent-run-header > div,
.agent-run-footer > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.agent-run-kicker,
.agent-run-goal span,
.agent-run-section > span,
.agent-run-footer span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.agent-run-header strong,
.agent-run-section strong,
.agent-run-footer strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.agent-run-header small {
  color: var(--text-muted);
  font-size: 11px;
}

.agent-run-participants {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.3;
}

.agent-avatar-stack {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
}

.agent-avatar {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #e2e8f0;
  color: #1f2937;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1);
}

.agent-avatar + .agent-avatar {
  margin-left: -7px;
}

.agent-avatar.is-goal,
.agent-avatar.is-lead {
  background: #dcfce7;
  color: #166534;
}

.agent-avatar.is-product,
.agent-avatar.is-pm {
  background: #dbeafe;
  color: #1d4ed8;
}

.agent-avatar.is-design,
.agent-avatar.is-designer {
  background: #fce7f3;
  color: #be185d;
}

.agent-avatar.is-preview,
.agent-avatar.is-engineer {
  background: #cffafe;
  color: #0e7490;
}

.agent-avatar.is-copy,
.agent-avatar.is-content {
  background: #fef3c7;
  color: #92400e;
}

.agent-avatar.is-specs {
  background: #ede9fe;
  color: #6d28d9;
}

.agent-avatar.is-reviewer,
.agent-avatar.is-qa {
  background: #fee2e2;
  color: #991b1b;
}

.agent-avatar.is-judge {
  background: #e5e7eb;
  color: #111827;
}

.agent-avatar.is-moderator {
  background: #d1fae5;
  color: #047857;
}

.agent-avatar.is-more {
  background: #f8fafc;
  color: var(--text-muted);
}

.agent-run-human-grid {
  display: grid;
  gap: 8px;
}

.agent-run-human-grid section {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  padding: 9px 10px;
}

.agent-run-human-grid span,
.agent-run-intervention span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.agent-run-human-grid p,
.agent-run-intervention p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.48;
}

.agent-run-intervention {
  display: grid;
  gap: 4px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px;
}

.agent-run-intervention strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.agent-run-intervention.is-blocking {
  border-color: #fecaca;
  background: #fff7f7;
}

.agent-run-intervention.is-ready {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.agent-run-intervention.is-self-revision {
  border-color: #fde68a;
  background: #fffbeb;
}

.agent-run-action-panel {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid #dbe3ef;
  border-radius: var(--radius);
  background: #f8fafc;
  padding: 10px 12px;
}

.agent-run-action-panel.is-blocking {
  border-color: #fecaca;
  background: #fff7f7;
}

.agent-run-action-panel > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.agent-run-action-panel span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.agent-run-action-panel strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.agent-run-action-panel p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.agent-run-action-panel .compact-action {
  flex: 0 0 auto;
}

.agent-run-footer small {
  max-width: 460px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
}

.agent-run-status {
  flex: 0 0 auto;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 4px 9px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.agent-run-status.is-blocked {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.agent-run-status.is-needs_iteration {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.agent-run-status.is-ready_for_preview,
.agent-run-status.is-ready_for_specs,
.agent-run-status.is-ready_for_next_action,
.agent-run-status.is-complete,
.agent-run-status.is-pass,
.agent-run-status.is-pass_with_assumptions {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.agent-run-status.is-revise_team_run,
.agent-run-status.is-self_revision,
.agent-run-status.is-reject_next_action {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.agent-run-status.is-block_for_pm {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.agent-run-goal,
.agent-run-section,
.agent-run-metric {
  border: 1px solid #dbe3ef;
  border-radius: var(--radius);
  background: #ffffff;
}

.agent-run-goal {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
}

.agent-run-goal p,
.agent-run-section p,
.agent-run-mini-list p,
.agent-run-agent-report p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

.agent-run-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
  gap: 8px;
}

.agent-run-metric {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px;
}

.agent-run-metric strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.2;
}

.agent-run-metric span {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.2;
}

.agent-run-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.agent-run-section {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  padding: 10px;
}

.agent-run-section.is-wide {
  grid-column: 1 / -1;
}

.agent-run-summary {
  background: #f8fbff;
}

.agent-run-list {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.agent-run-agent-list,
.agent-run-mini-list {
  display: grid;
  gap: 8px;
}

.agent-run-agent-report,
.agent-run-mini-list article {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid #edf2f7;
  border-radius: 8px;
  background: #fbfdff;
  padding: 9px;
}

.agent-run-agent-report > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.agent-run-agent-report span,
.agent-run-mini-list small {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
}

.agent-run-agent-report em {
  color: var(--text-muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.agent-tool-evidence {
  display: grid;
  gap: 6px;
  border-top: 1px solid #edf2f7;
  padding-top: 7px;
}

.agent-tool-evidence em {
  color: var(--text-muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.agent-tool-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.agent-tool-tags span {
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  background: #f8fafc;
  padding: 2px 6px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.25;
}

.agent-run-mini-list article.is-blocking {
  border-color: #fecaca;
  background: #fffafa;
}

.agent-run-mini-list article.is-major {
  border-color: #fde68a;
  background: #fffdf5;
}

.agent-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.agent-chip {
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  background: #f8fafc;
  padding: 4px 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.agent-run-footer {
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
}

.agent-run-footer .compact-action {
  flex: 0 0 auto;
}

.agent-run-footer-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 760px) {
  .agent-run-message {
    width: 100%;
    max-width: 100%;
  }

  .agent-run-header,
  .agent-run-action-panel,
  .agent-run-footer {
    flex-direction: column;
  }

  .agent-run-footer-actions {
    justify-content: flex-start;
  }

  .agent-run-metrics,
  .agent-run-sections {
    grid-template-columns: 1fr;
  }

  .agent-run-section.is-wide {
    grid-column: auto;
  }
}

.message.is-reviewer {
  border-color: #f5cf98;
  background: var(--amber-soft);
}

.message.is-typing {
  position: relative;
}

.message.is-typing.is-pending-copy .message-plain {
  display: inline-block;
  color: transparent;
  background: linear-gradient(90deg, var(--text) 0%, var(--text) 38%, rgba(255, 255, 255, 0.5) 50%, var(--text) 62%, var(--text) 100%);
  background-clip: text;
  background-size: 220% 100%;
  -webkit-background-clip: text;
  animation: reqpilotTextShimmer 1.8s ease-in-out infinite;
}

.message > strong {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
}

.message.is-user > strong,
.message.is-user .message-plain,
.message.is-user .message-markdown {
  color: #ffffff;
}

.message-plain {
  margin: 0;
  line-height: 1.5;
  white-space: pre-wrap;
}

.message-markdown {
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.message-markdown > * {
  margin: 0 0 8px;
}

.message-markdown > *:last-child {
  margin-bottom: 0;
}

.message-markdown h2,
.message-markdown h3,
.message-markdown h4,
.message-markdown h5 {
  color: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.35;
}

.message-markdown h2 {
  font-size: 14px;
}

.message-markdown ul,
.message-markdown ol {
  padding-left: 18px;
}

.message-markdown li + li {
  margin-top: 4px;
}

.message-markdown blockquote {
  border-left: 3px solid var(--line-strong);
  color: var(--text-muted);
  padding-left: 10px;
}

.message-markdown code {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.06);
  padding: 1px 5px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

.message-markdown pre {
  max-width: 100%;
  overflow: auto;
  border-radius: 8px;
  background: #111827;
  color: #e5e7eb;
  padding: 10px;
}

.message-markdown pre code {
  border: 0;
  background: transparent;
  color: inherit;
  display: block;
  padding: 0;
  white-space: pre;
}

.message-markdown a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.message-markdown a:hover {
  text-decoration: underline;
}

.message-table-wrap {
  max-width: 100%;
  overflow: auto;
}

.message-markdown table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.message-markdown th,
.message-markdown td {
  border: 1px solid var(--line);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

.message-markdown th {
  background: var(--surface);
  font-weight: 800;
}

.message.is-user .message-markdown a,
.message.is-user .message-markdown blockquote {
  color: #ffffff;
}

.message.is-user .message-markdown code {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.16);
  color: #ffffff;
}

.message.is-user .message-markdown pre {
  background: rgba(0, 0, 0, 0.28);
}

.message.is-user .message-markdown th {
  background: rgba(0, 0, 0, 0.16);
}

.message.is-user .message-markdown th,
.message.is-user .message-markdown td {
  border-color: rgba(255, 255, 255, 0.26);
}

.message.is-typing .message-markdown::after,
.review-chat-message.is-typing .message-markdown::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 1em;
  margin-left: 3px;
  border-radius: 4px;
  background: var(--primary);
  vertical-align: -2px;
  animation: cursorPulse 1s ease-in-out infinite;
}

@keyframes cursorPulse {
  0%,
  45% {
    opacity: 1;
  }
  46%,
  100% {
    opacity: 0.2;
  }
}

.message-token-usage {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
}

.message-token-usage span {
  font-weight: 700;
}

.message-token-usage small {
  color: inherit;
  font-size: inherit;
}

.message.is-user .message-token-usage {
  color: rgba(255, 255, 255, 0.8);
}

.message-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.message-quick-actions .convergence-summary {
  flex: 1 1 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-low);
  padding: 8px;
}

.message-quick-actions > span {
  flex: 1 1 220px;
  min-width: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
}

.message-quick-actions .compact-action {
  min-height: 30px;
  padding: 0 10px;
}

.message-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.message-attachments {
  margin-top: 10px;
}

.temporary-preview-card {
  width: min(760px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  overflow: hidden;
}

.temporary-preview-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
}

.temporary-preview-header strong {
  display: block;
  font-size: 13px;
}

.temporary-preview-header p {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
}

.temporary-preview-viewport {
  max-height: 640px;
  min-height: 180px;
  background: var(--surface-low);
}

.temporary-preview-frame {
  box-shadow: none;
}

.temporary-preview-image {
  display: block;
  width: 100%;
  height: auto;
}

.temporary-preview-markdown,
.temporary-preview-text {
  margin: 0;
  padding: 12px;
  max-height: 520px;
  overflow: auto;
}

.temporary-preview-text {
  white-space: pre-wrap;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.preview-draft-message {
  width: min(980px, 96%);
  max-width: min(980px, 96%);
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border-color: rgba(31, 63, 119, 0.28);
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(31, 63, 119, 0.08);
}

.preview-draft-message.is-applied {
  border-color: rgba(22, 101, 52, 0.28);
  box-shadow: 0 10px 28px rgba(22, 101, 52, 0.08);
}

.preview-draft-message.is-live-preview {
  border-color: rgba(31, 63, 119, 0.38);
  box-shadow: 0 14px 34px rgba(31, 63, 119, 0.12);
}

.preview-draft-card {
  display: grid;
  gap: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 12px;
  background: #ffffff;
}

.preview-draft-message.is-live-preview .preview-draft-card::before {
  display: block;
  height: 3px;
  background: linear-gradient(90deg, #1f3f77, #0f766e, #166534, #1f3f77);
  background-size: 220% 100%;
  animation: preview-draft-live-line 2.4s linear infinite;
  content: "";
}

@keyframes preview-draft-live-line {
  to {
    background-position: 220% 0;
  }
}

.preview-draft-author {
  display: block;
  margin: 0;
  padding: 14px 16px 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.preview-draft-body {
  display: grid;
  min-width: 0;
}

.preview-draft-body.has-preview {
  grid-template-columns: 402px minmax(0, 1fr);
  align-items: stretch;
}

.preview-draft-body.has-preview.is-live {
  grid-template-columns: 402px minmax(0, 1fr);
}

.preview-draft-body.has-preview.is-collapsed {
  grid-template-columns: 176px minmax(0, 1fr);
}

.preview-draft-preview-pane {
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: #ffffff;
}

.preview-draft-info-pane {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 14px 16px 16px;
  background: #ffffff;
}

.preview-draft-body.has-preview:not(.is-collapsed) .preview-draft-info-pane {
  min-height: var(--preview-draft-expanded-height, 874px);
}

.preview-draft-body.has-preview.is-collapsed .preview-draft-info-pane {
  min-height: 176px;
}

.preview-draft-header {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 0;
  border-bottom: 0;
  background: transparent;
}

.preview-draft-header strong,
.preview-draft-header small,
.preview-draft-kicker {
  display: block;
}

.preview-draft-header strong {
  margin: 2px 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}

.preview-draft-title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.preview-draft-title-row strong {
  min-width: 0;
}

.preview-draft-sync-badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  border: 1px solid rgba(22, 101, 52, 0.18);
  border-radius: var(--radius);
  background: #dcfce7;
  color: #166534;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.preview-draft-sync-badge.is-reverted {
  border-color: rgba(107, 114, 128, 0.22);
  background: #f3f4f6;
  color: #4b5563;
}

.preview-draft-header small,
.preview-draft-kicker {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.preview-draft-body.has-preview.is-collapsed .preview-draft-header small,
.preview-draft-body.has-preview.is-collapsed .preview-draft-status {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.preview-draft-body.has-preview.is-collapsed .preview-draft-header small {
  -webkit-line-clamp: 2;
}

.preview-draft-body.has-preview.is-collapsed .preview-draft-status {
  -webkit-line-clamp: 1;
}

.preview-draft-target {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(31, 63, 119, 0.12);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.96);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.preview-draft-target span {
  color: var(--text);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
}

.preview-draft-body.has-preview.is-collapsed .preview-draft-target {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.preview-draft-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  gap: 6px;
}

.preview-draft-apply-target {
  display: grid;
  gap: 4px;
  margin-top: -2px;
  padding: 8px 10px;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 8px;
  background: rgba(240, 253, 250, 0.82);
  color: #134e4a;
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.preview-draft-apply-target span {
  color: #0f766e;
  font-size: 10px;
  font-weight: 900;
}

.preview-draft-apply-target strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.preview-draft-apply-target em {
  color: #991b1b;
  font-style: normal;
  font-weight: 850;
}

.preview-draft-apply-target.has-warning {
  border-color: rgba(220, 38, 38, 0.24);
  background: #fef2f2;
}

.preview-draft-actions .compact-action {
  min-height: 36px;
  padding: 0 10px;
  white-space: nowrap;
}

.preview-draft-viewport {
  width: 402px;
  height: var(--preview-scaled-height, var(--preview-draft-expanded-height, 874px));
  flex: none;
  border: 0;
  background: #ffffff;
  place-items: start center;
  overflow: hidden;
  position: relative;
}

.preview-draft-viewport.is-live {
  min-height: var(--preview-draft-expanded-height, 874px);
  background: #f8fafc;
}

.code-preview-viewport.preview-draft-thumbnail-viewport {
  position: relative;
  display: grid;
  place-items: center;
  width: 176px;
  height: 176px;
  flex: none;
  overflow: hidden;
  pointer-events: none;
  background: var(--surface-low);
  padding: 0;
}

.preview-draft-body.is-collapsed .preview-draft-preview-pane {
  background: var(--surface-low);
}

.preview-draft-frame {
  box-shadow: none;
  transform-origin: top center;
}

.preview-draft-live-frame {
  background: #f8fafc;
}

.preview-draft-stream-overlay {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  max-width: calc(100% - 24px);
  gap: 2px;
  border: 1px solid rgba(31, 63, 119, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text-muted);
  padding: 8px 10px;
  box-shadow: 0 10px 22px rgba(16, 32, 47, 0.12);
  pointer-events: none;
}

.preview-draft-stream-overlay span {
  width: max-content;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 2px 6px;
  font-size: 9px;
  font-weight: 900;
}

.preview-draft-stream-overlay strong {
  color: var(--text);
  font-size: 12px;
  line-height: 1.25;
}

.preview-draft-stream-overlay small {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.3;
}

.preview-draft-stream-overlay.has-code {
  border-color: rgba(22, 101, 52, 0.22);
}

.preview-draft-stream-overlay.has-code span {
  background: #dcfce7;
  color: #166534;
}

.code-preview-viewport.preview-draft-thumbnail-viewport::before {
  display: none;
}

.code-preview-frame.preview-draft-thumbnail-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(var(--preview-scale, 1));
  transform-origin: center center;
}

.preview-draft-status {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.preview-draft-message.is-applied .preview-draft-status {
  color: #166534;
}

.preview-draft-loading {
  display: grid;
  place-content: center;
  gap: 6px;
  min-height: 180px;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  color: var(--text-muted);
  text-align: center;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.preview-draft-loading strong {
  color: var(--text);
  font-size: 13px;
}

.preview-draft-error {
  margin: 0;
  border: 1px solid #f1b8a8;
  border-radius: var(--radius);
  background: #fff1ed;
  color: #8a2f18;
  font-size: 12px;
  line-height: 1.45;
  padding: 8px 10px;
}

@media (max-width: 760px) {
  .preview-draft-message {
    width: 100%;
    max-width: 100%;
  }

  .preview-draft-body.has-preview {
    grid-template-columns: minmax(0, 1fr);
  }

  .preview-draft-body.has-preview.is-collapsed {
    grid-template-columns: 132px minmax(0, 1fr);
  }

  .preview-draft-preview-pane {
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .preview-draft-body.is-collapsed .preview-draft-preview-pane {
    overflow: hidden;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .preview-draft-body.has-preview .preview-draft-info-pane {
    min-height: 0;
  }

  .preview-draft-viewport {
    width: 402px;
    height: var(--preview-scaled-height, var(--preview-draft-expanded-height, 874px));
  }

  .preview-draft-thumbnail-viewport {
    width: 132px;
    height: 132px;
  }

  .preview-draft-refinement-pill {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .preview-draft-refinement-pill span,
  .preview-draft-refinement-pill small {
    grid-column: 1 / -1;
  }
}

.pending-attachments {
  display: block;
  margin-top: 8px;
}

.preview-draft-refinement-bar {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.preview-draft-refinement-bar:empty {
  display: none;
}

.preview-draft-refinement-pill {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.2fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(31, 63, 119, 0.2);
  border-radius: 8px;
  background: #f8fbff;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.preview-draft-refinement-pill span {
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 900;
}

.preview-draft-refinement-pill strong,
.preview-draft-refinement-pill small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-draft-refinement-pill strong {
  color: var(--text);
}

.preview-draft-refinement-pill small {
  color: var(--text-muted);
  font-size: 11px;
}

.reference-strip {
  align-self: center;
  width: min(880px, calc(100% - 40px));
  min-height: 46px;
  border-top: 1px solid var(--line);
  background: var(--surface-low);
  padding: 8px 16px;
}

.reference-strip:empty {
  display: none;
}

.reference-empty {
  display: flex;
  align-items: center;
  min-height: 30px;
  color: var(--text-muted);
  font-size: 12px;
}

.attachment-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "header thumbs"
    "status status";
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.attachment-strip.is-expanded {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "header"
    "status"
    "thumbs";
  align-items: stretch;
}

.pending-attachments .attachment-strip {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-low);
  padding: 8px;
}

.attachment-strip-header {
  grid-area: header;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.attachment-strip-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
  align-items: center;
}

.attachment-strip-title {
  display: flex;
  min-width: 0;
  gap: 6px;
  align-items: center;
}

.attachment-strip-title strong {
  font-size: 12px;
}

.attachment-strip-title span {
  color: var(--text-muted);
  font-size: 12px;
}

.attachment-thumb-row {
  grid-area: thumbs;
  display: flex;
  min-height: 40px;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.visual-code-backfill-status {
  grid-area: status;
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-low);
  padding: 7px 8px;
}

.visual-code-backfill-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.visual-code-backfill-row strong,
.visual-code-backfill-row span {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visual-code-backfill-row strong {
  color: var(--text);
  font-weight: 700;
}

.visual-code-backfill-row span {
  flex: 0 0 auto;
  color: var(--text-muted);
}

.visual-code-backfill-track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.24);
}

.visual-code-backfill-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2583cc;
  transition: width 180ms ease;
}

.visual-code-backfill-status.is-success .visual-code-backfill-track i {
  background: #149d6b;
}

.visual-code-backfill-status.is-error .visual-code-backfill-track i {
  background: #d97706;
}

.attachment-thumb-row.is-expanded {
  max-height: 164px;
  flex-wrap: wrap;
  align-content: start;
  overflow-x: hidden;
  overflow-y: auto;
}

.attachment-thumb {
  position: relative;
  width: 72px;
  height: 50px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.attachment-thumb.is-compact {
  flex: 0 0 auto;
  width: 54px;
  height: 38px;
  border-radius: 6px;
}

.attachment-preview-button {
  position: absolute;
  inset: 0;
  display: block;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: zoom-in;
  padding: 0;
}

.attachment-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.attachment-thumb span {
  position: absolute;
  right: 4px;
  bottom: 3px;
  left: 4px;
  overflow: hidden;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
  white-space: nowrap;
}

.remove-attachment {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background: rgba(24, 32, 47, 0.75);
  color: #ffffff;
  font-size: 12px;
  line-height: 16px;
  padding: 0;
  z-index: 1;
}

.attachment-thumb.is-compact .remove-attachment {
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  font-size: 11px;
  line-height: 14px;
}

.attachment-code-button {
  position: absolute;
  top: 2px;
  left: 2px;
  z-index: 1;
  min-height: 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.72);
  color: #ffffff;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  padding: 0 4px;
}

.attachment-code-button:hover {
  background: rgba(15, 23, 42, 0.9);
}

.attachment-code-button.has-visual-code {
  border-color: rgba(32, 201, 139, 0.95);
  background: rgba(20, 157, 107, 0.92);
  box-shadow: 0 0 0 1px rgba(20, 157, 107, 0.22);
}

.attachment-code-button.has-visual-code:hover {
  background: rgba(14, 127, 87, 0.96);
}

.composer {
  display: grid;
  justify-items: center;
  border-top: 0;
  background: transparent;
  padding: 10px 20px 16px;
}

.composer-input-shell {
  --composer-input-height: 116px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(211, 216, 224, 0.96);
  border-radius: 16px;
  background: #ffffff;
  box-shadow:
    0 16px 42px rgba(15, 23, 42, 0.08),
    0 1px 2px rgba(15, 23, 42, 0.06);
  padding-bottom: 48px;
}

.composer-resize-handle {
  position: relative;
  height: 9px;
  border: 0;
  background: transparent;
  cursor: ns-resize;
}

.composer-resize-handle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42px;
  height: 3px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.72);
  transform: translate(-50%, -50%);
}

.composer-resize-handle:hover::before,
.composer-resize-handle:focus-visible::before,
body.is-resizing-composer-input .composer-resize-handle::before {
  background: var(--accent);
}

.composer-resize-handle:focus-visible {
  outline: 3px solid rgba(38, 60, 103, 0.16);
  outline-offset: 1px;
}

textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--text);
  line-height: 1.5;
  padding: 10px 12px;
}

.composer-input-shell textarea {
  display: block;
  height: var(--composer-input-height);
  min-height: 92px;
  max-height: 360px;
  resize: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 8px 14px 48px;
}

.composer-input-shell textarea:focus {
  outline: none;
}

.composer-inline-toolbar {
  position: absolute;
  right: 12px;
  bottom: 10px;
  left: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.composer-inline-left,
.composer-inline-right {
  display: flex;
  min-width: 0;
  gap: 7px;
  align-items: center;
  pointer-events: auto;
}

.composer-inline-left .workbench-mode-switch {
  min-height: 34px;
  border-color: transparent;
  border-radius: 999px;
  background: transparent;
  padding: 0;
}

.composer-inline-left .mode-tab {
  min-height: 30px;
  border-radius: 999px;
  padding: 0 9px;
  color: var(--text-muted);
  font-size: 12px;
}

.composer-inline-left .mode-tab.is-active {
  background: rgba(38, 60, 103, 0.1);
  color: var(--primary);
  box-shadow: none;
}

.composer-inline-right {
  position: relative;
  margin-left: auto;
}

.composer-icon-button,
.composer-send-button {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  min-height: 34px;
  place-items: center;
  border-radius: 50%;
  padding: 0;
  line-height: 1;
}

.composer-icon-button {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 25px;
  font-weight: 300;
}

.composer-icon-button:hover:not(:disabled) {
  background: #f1f3f5;
  color: var(--text);
}

.composer-text-button {
  min-height: 32px;
  border-radius: 999px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 650;
}

.composer-send-button {
  border-color: #111111;
  background: #111111;
  color: #ffffff;
  font-size: 20px;
}

.composer-send-button.is-stop {
  font-size: 12px;
}

.composer-send-button:hover:not(:disabled) {
  border-color: #000000;
  background: #000000;
}

.composer-shortcut-bubble {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 5;
  border-radius: 9px;
  background: #111820;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.18);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 9px 11px;
  white-space: nowrap;
}

.composer-shortcut-bubble::after {
  position: absolute;
  right: 13px;
  bottom: -5px;
  width: 10px;
  height: 10px;
  background: #111820;
  content: "";
  transform: rotate(45deg);
}

body.is-resizing-composer-input,
body.is-resizing-composer-input * {
  cursor: ns-resize !important;
  user-select: none;
}

textarea:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(38, 60, 103, 0.16);
  outline-offset: 1px;
}

.composer-codex-usage {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: nowrap;
  min-width: 0;
  max-width: 100%;
  min-height: 0;
  gap: 4px;
  align-items: center;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.2;
  opacity: 0.72;
  padding: 0;
  white-space: nowrap;
}

.composer-codex-usage.is-hidden {
  display: none;
}

.composer-codex-usage.is-loading {
  opacity: 0.78;
}

.composer-codex-usage.is-error {
  color: #9a3412;
}

.composer-codex-usage span {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-weight: 700;
}

.composer-codex-usage strong,
.composer-codex-usage em {
  min-width: 0;
  overflow: hidden;
  font-style: normal;
  font-weight: 600;
  text-overflow: ellipsis;
}

.composer-codex-usage span::after,
.composer-codex-usage strong::after {
  content: "·";
  margin-left: 4px;
  color: var(--line-strong);
  font-weight: 400;
}

.composer-codex-usage strong {
  color: var(--text-muted);
}

.composer-codex-usage em {
  flex: 0 0 auto;
  color: var(--text-muted);
}

.pending-attachments {
  margin-top: 10px;
}

.generation-status {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-height: 44px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
  padding: 10px 12px;
  color: var(--text);
}

.sidebar-generation .generation-status {
  grid-template-columns: 16px minmax(0, 1fr);
  min-height: 0;
  margin-top: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.generation-status.is-idle {
  display: none;
}

.generation-status strong,
.generation-status small {
  display: block;
}

.generation-status.is-running strong {
  width: fit-content;
  max-width: 100%;
  color: transparent;
  background: linear-gradient(90deg, var(--text) 0%, var(--text) 38%, rgba(255, 255, 255, 0.5) 50%, var(--text) 62%, var(--text) 100%);
  background-clip: text;
  background-size: 220% 100%;
  -webkit-background-clip: text;
  animation: reqpilotTextShimmer 1.8s ease-in-out infinite;
}

.sidebar-generation .generation-status strong {
  font-size: 12px;
  line-height: 1.25;
}

.generation-status small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
}

.generation-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.generation-status-actions .compact-action {
  min-height: 30px;
  padding: 0 10px;
}

.sidebar-generation .generation-status small {
  display: -webkit-box;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.generation-indicator {
  width: 14px;
  height: 14px;
  margin-top: 2px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--blue);
  border-radius: 999px;
}

.generation-status.is-running .generation-indicator {
  animation: spin 0.9s linear infinite;
}

.generation-status.is-success {
  border-color: #b7dec7;
  background: var(--green-soft);
}

.generation-status.is-success .generation-indicator {
  border-color: var(--green);
  background: var(--green);
}

.generation-status.is-error {
  border-color: #f1b8b8;
  background: var(--red-soft);
}

.generation-status.is-error .generation-indicator {
  border-color: var(--red);
  background: var(--red);
}

.codex-run-log {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0f172a;
  color: #dbeafe;
  overflow: hidden;
}

.sidebar-generation .codex-run-log {
  margin-top: 9px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text);
}

.codex-run-log-header {
  display: flex;
  min-height: 34px;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid rgba(148, 163, 184, 0.26);
  padding: 8px 10px;
}

.sidebar-generation .codex-run-log-header {
  min-height: 28px;
  padding: 7px 0 3px;
}

.sidebar-generation .codex-run-log-header strong {
  color: var(--text-muted);
  font-size: 11px;
}

.codex-run-log-header strong {
  font-size: 12px;
}

.codex-run-log-header span {
  color: #94a3b8;
  font-size: 11px;
}

.sidebar-generation .codex-run-log-header span {
  display: none;
}

.codex-run-log-body {
  display: grid;
  gap: 4px;
  max-height: 168px;
  overflow: auto;
  padding: 8px 10px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
}

.sidebar-generation .codex-run-log-body {
  max-height: 96px;
  padding: 0;
  font-size: 10px;
  line-height: 1.35;
}

.codex-run-log-row {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 8px;
}

.sidebar-generation .codex-run-log-row {
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 6px;
}

.sidebar-generation .codex-run-log-row time {
  color: #94a3b8;
}

.sidebar-generation .codex-run-log-row span,
.sidebar-generation .codex-run-log-row.is-warn span,
.sidebar-generation .codex-run-log-row.is-error span,
.sidebar-generation .codex-run-log-row.is-success span {
  color: var(--text-muted);
}

.codex-run-log-row time {
  color: #64748b;
}

.codex-run-log-row span {
  color: #dbeafe;
  overflow-wrap: anywhere;
}

.codex-run-log-row.is-warn span {
  color: #fde68a;
}

.codex-run-log-row.is-error span {
  color: #fecaca;
}

.codex-run-log-row.is-success span {
  color: #bbf7d0;
}

button:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

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

@keyframes reqpilotTextShimmer {
  0% {
    background-position: 120% 0;
  }

  100% {
    background-position: -120% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .message.is-typing.is-pending-copy .message-plain,
  .generation-status.is-running strong {
    animation: none;
    color: var(--text);
    background: none;
    filter: none;
  }
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px 14px;
}

.library-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 16px 16px 0;
}

.library-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px 0;
}

.local-knowledge-panel {
  display: grid;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 16px;
}

.local-knowledge-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

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

.local-doc-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px;
}

.local-doc-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.local-doc-main strong,
.local-doc-detail h4 {
  margin: 0;
  font-size: 13px;
}

.local-doc-main span,
.local-doc-main p,
.local-doc-detail p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.38;
}

.local-doc-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.local-doc-detail {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-low);
  padding: 10px;
}

.local-doc-detail pre {
  max-height: 180px;
  overflow: auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--text-muted);
  white-space: pre-wrap;
  font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  padding: 9px;
}

.local-doc-analysis,
.local-doc-mini-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.local-doc-mini-list span {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 7px;
}

.metric {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-low);
  padding: 10px;
}

.metric span {
  display: block;
  font-size: 22px;
  font-weight: 700;
}

.metric small {
  color: var(--text-muted);
  font-weight: 700;
}

.spec-panel > .panel-header {
  align-items: center;
  padding: 8px 10px;
}

.spec-panel > .panel-header p {
  display: none;
}

.spec-panel .header-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.spec-header {
  align-items: center;
}

.spec-header > div:first-child {
  min-width: 128px;
}

.spec-header-controls {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.spec-panel .ghost-button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

.copy-figma-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.copy-figma-trigger {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.copy-figma-options {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  display: grid;
  min-width: 148px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-float);
  padding: 4px;
}

.copy-figma-options.is-hidden {
  display: none;
}

.copy-figma-option {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 0 9px;
  text-align: left;
  white-space: nowrap;
}

.copy-figma-option:hover,
.copy-figma-option:focus-visible {
  background: var(--primary-soft);
  color: var(--primary);
}

.copy-figma-option:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.spec-control-stack {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.spec-mode-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
}

.spec-metrics {
  display: flex;
  gap: 4px;
  padding: 0;
}

.spec-metrics .metric {
  min-width: 58px;
  padding: 4px 7px;
  background: var(--surface);
}

.spec-metrics .metric span {
  display: inline;
  margin-right: 4px;
  font-size: 14px;
}

.spec-metrics .metric small {
  font-size: 10px;
  line-height: 1;
}

.screen-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
}

.spec-view-tabs {
  display: flex;
  gap: 4px;
  border-top: 1px solid var(--line);
  background: var(--surface-low);
  padding: 8px 14px;
}

.spec-header-controls .spec-view-tabs {
  border: 0;
  border-radius: var(--radius);
  background: var(--surface-low);
  padding: 0;
}

.spec-page-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  background: var(--surface);
  padding: 6px 10px;
}

.spec-page-label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.spec-page-toolbar .screen-tabs {
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0;
  justify-content: flex-start;
}

.spec-page-toolbar .screen-tab {
  min-height: 28px;
  padding: 5px 9px;
  font-size: 12px;
}

.spec-view {
  display: none;
}

.spec-view.is-active {
  display: block;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

#specPreviewView.is-active {
  display: block;
  overflow: visible;
}

#specPreviewView.is-active.is-overview-preview {
  overflow: hidden;
}

.spec-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.spec-body.is-collapsed {
  display: none;
}

.team-list,
.team-form {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.team-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

.team-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.team-card-header > div {
  min-width: 0;
}

.team-card strong {
  display: block;
  margin-bottom: 4px;
}

.team-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.team-card-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.team-card-badge {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 8px;
}

.screen-tab {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 7px 10px;
  font-size: 13px;
  white-space: nowrap;
}

.screen-tab.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}

.screen-detail {
  padding: 10px 12px;
}

.spec-document {
  display: grid;
  gap: 10px;
}

.spec-document section {
  display: grid;
  gap: 8px;
}

.spec-document h3,
.spec-document h4 {
  margin: 0;
}

.spec-document p,
.spec-document li {
  color: var(--text-muted);
  line-height: 1.42;
}

.spec-document ol {
  margin: 0;
  padding-left: 20px;
}

.spec-document.is-dense {
  align-content: start;
}

.spec-summary-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.spec-summary-strip h3 {
  font-size: 16px;
}

.spec-summary-strip p {
  margin: 3px 0 0;
  font-size: 12px;
}

.spec-summary-strip .tag-row {
  justify-content: flex-end;
  margin-top: 0;
}

.spec-flow-strip {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-low);
  padding: 9px 10px;
}

.state-branch-panel {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 9px 10px;
}

.state-branch-panel.is-compact {
  background: var(--surface-low);
}

.state-branch-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.state-branch-header strong,
.state-branch-header span {
  display: block;
}

.state-branch-header strong {
  font-size: 12px;
}

.state-branch-header span {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
}

.state-branch-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.state-branch-chip {
  display: inline-flex;
  max-width: 100%;
  min-height: 30px;
  align-items: flex-start;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-low);
  color: var(--text);
  padding: 5px 8px;
  font-size: 11px;
  white-space: normal;
}

.state-branch-chip strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.state-branch-chip span {
  flex: 0 0 auto;
  color: var(--text-muted);
  white-space: nowrap;
}

.state-branch-chip.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
}

.state-branch-chip.is-missing {
  border-style: dashed;
}

.dense-list {
  display: grid;
  gap: 3px;
  font-size: 12px;
}

.spec-dense-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.dense-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 9px;
}

.dense-card h4 {
  margin-bottom: 6px;
  font-size: 12px;
}

.dense-fact-list {
  display: grid;
  gap: 4px;
}

.dense-fact {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 6px;
  font-size: 11px;
  line-height: 1.35;
}

.dense-fact strong {
  color: var(--text);
}

.dense-fact span {
  min-width: 0;
  color: var(--text-muted);
}

.spec-dense-section h4 {
  font-size: 13px;
}

.spec-disclosure {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-low);
}

.spec-disclosure summary {
  cursor: pointer;
  padding: 9px 10px;
  font-size: 12px;
  font-weight: 800;
}

.spec-disclosure-grid {
  display: grid;
  gap: 8px;
  padding: 0 10px 10px;
}

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

.spec-callout {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
  padding: 10px 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.spec-callout.is-risk {
  border-color: #f5cf98;
  background: var(--amber-soft);
  color: var(--amber);
}

.spec-preview-detail {
  display: block;
  min-height: 0;
  height: auto;
  padding: 8px 12px 12px;
}

.artifact-workbench-picker {
  display: grid;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding: 8px 12px;
}

.artifact-picker-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.artifact-picker-main label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.artifact-picker-main select {
  min-width: 0;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-low);
  color: var(--text);
  padding: 0 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.artifact-picker-meta {
  display: flex;
  min-width: 0;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
}

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

.artifact-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
  padding: 0 8px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
}

.artifact-status.is-ready {
  border-color: #b7dac7;
  background: #eef9f2;
  color: #16603a;
}

.artifact-status.is-needs_work,
.artifact-status.is-blocked {
  border-color: #f5cf98;
  background: var(--amber-soft);
  color: var(--amber);
}

.artifact-workbench-detail {
  min-height: 0;
  padding: 12px;
}

.artifact-workbench-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 9px 10px;
}

.artifact-workbench-header span,
.artifact-generic-header span {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
}

.artifact-workbench-header strong,
.artifact-generic-header strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 14px;
}

.artifact-document-workbench,
.artifact-table-workbench,
.artifact-json-workbench,
.artifact-agent-workbench,
.artifact-generic-workbench {
  display: grid;
  gap: 10px;
  min-height: 0;
}

.artifact-document-body {
  max-height: calc(100vh - 260px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
}

.artifact-table-scroll {
  max-height: calc(100vh - 260px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.artifact-table-scroll table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.artifact-table-scroll th,
.artifact-table-scroll td {
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.artifact-table-scroll th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
}

.artifact-json-workbench pre {
  max-height: calc(100vh - 260px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px;
  font-size: 11px;
  line-height: 1.5;
}

.spec-preview-detail.is-overview {
  display: flex;
  height: 100%;
  overflow: hidden;
  flex-direction: column;
}

.spec-preview-stack {
  display: grid;
  flex: 1;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
  gap: 10px;
}

.spec-preview-stack.is-single {
  display: block;
  min-height: 100%;
  width: 100%;
}

.spec-preview-stack.is-overview {
  flex: 1 1 auto;
  grid-template-rows: auto minmax(0, 1fr);
}

.preview-mode-toolbar,
.global-preview-toolbar {
  display: flex;
  min-height: 42px;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 8px 10px;
}

.preview-mode-toolbar strong,
.preview-mode-toolbar span,
.global-preview-toolbar strong,
.global-preview-toolbar span {
  display: block;
}

.preview-mode-toolbar span,
.global-preview-toolbar span {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
}

.preview-mode-actions,
.global-preview-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.preview-rationale-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px 12px;
}

.preview-rationale-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.preview-rationale-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.code-preview-shell {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.code-preview-shell.is-full-bleed-preview {
  display: block;
  min-height: 100%;
  width: 100%;
  overflow: visible;
  background: var(--surface-low);
}

.code-preview-toolbar {
  display: flex;
  min-height: 42px;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
}

.single-preview-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding: 7px 10px;
}

.single-preview-title {
  display: flex;
  min-width: 0;
  gap: 8px;
  align-items: center;
}

.single-preview-title strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.single-preview-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  align-items: center;
}

.single-preview-mode {
  display: inline-flex;
  gap: 4px;
  border-radius: var(--radius);
  background: var(--surface-low);
  padding: 2px;
}

.single-preview-state-switch {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  border-top: 1px solid var(--line);
  padding-top: 7px;
}

.single-preview-state-switch-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.single-preview-state-switch-label span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
}

.single-preview-state-switch-list {
  display: flex;
  min-width: 0;
  gap: 5px;
  overflow-x: auto;
}

.single-preview-state-switch-list.is-expanded {
  flex-wrap: wrap;
  overflow-x: visible;
}

.single-preview-state-switch-list.is-expanded .state-switch-chip {
  flex: 0 1 auto;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.state-switch-chip {
  flex: 0 0 auto;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-low);
  color: var(--text);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.state-switch-chip.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.state-switch-chip.is-missing {
  border-style: dashed;
  color: var(--text-muted);
}

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

.code-preview-frame {
  width: var(--preview-width, 402px);
  height: var(--preview-height, 874px);
  border: 0;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(16, 32, 47, 0.14);
  transform: scale(var(--preview-scale, 1));
  transform-origin: top center;
}

.code-preview-viewport {
  --preview-scale: 1;
  --preview-width: 402px;
  --preview-height: 874px;
  --preview-scaled-width: 402px;
  --preview-scaled-height: 874px;
  display: grid;
  flex: 1;
  min-height: 0;
  place-items: start center;
  overflow: auto;
  background: #ffffff;
  padding: 0;
}

.code-preview-viewport.is-full-bleed-preview {
  place-items: start;
  overflow: auto;
  background: var(--surface-low);
  padding: 0;
}

.code-preview-viewport.is-full-bleed-preview::before {
  display: none;
}

.code-preview-viewport.is-full-bleed-preview .code-preview-frame {
  grid-area: auto;
  box-shadow: none;
  transform: none;
  transform-origin: top left;
}

.code-preview-viewport::before {
  content: "";
  grid-area: 1 / 1;
  width: var(--preview-scaled-width);
  height: var(--preview-scaled-height);
}

.code-preview-viewport .code-preview-frame {
  grid-area: 1 / 1;
}

.code-preview-viewport:not(.is-scrollable-preview) {
  place-items: center;
}

.code-preview-viewport:not(.is-scrollable-preview)::before {
  display: none;
}

.code-preview-viewport:not(.is-scrollable-preview) .code-preview-frame {
  grid-area: auto;
}

.code-preview-frame {
  border: 0;
}

.spec-preview-empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-muted);
  padding: 18px;
  color: var(--text-muted);
  line-height: 1.5;
}

.spec-preview-empty strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
}

.spec-preview-warning {
  border: 1px solid #f0c56a;
  border-radius: var(--radius);
  background: #fff8e5;
  padding: 18px;
  color: #66501a;
  line-height: 1.5;
}

.spec-preview-warning strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
}

.requirement-map {
  display: grid;
  gap: 14px;
  padding: 14px;
}

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

.map-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-low);
  padding: 10px;
}

.map-toolbar strong,
.map-toolbar span {
  display: block;
}

.map-toolbar span {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
}

.map-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.map-stat {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-low);
  padding: 10px;
}

.map-stat strong,
.map-stat span {
  display: block;
}

.map-stat strong {
  font-size: 20px;
}

.map-stat span {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.map-section-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.map-section-heading h4 {
  margin: 0;
  font-size: 14px;
}

.map-section-heading span {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
  text-align: right;
}

.map-path-board {
  display: grid;
  gap: 10px;
}

.map-path-lane {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.map-path-lane.is-primary {
  background: #fbfcfd;
}

.map-path-lane.is-branch {
  background: var(--surface-low);
}

.map-lane-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
}

.map-lane-header strong,
.map-lane-header span {
  display: block;
}

.map-lane-header strong {
  font-size: 13px;
}

.map-lane-header span {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.3;
  text-align: right;
}

.map-primary-strip {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding: 12px 14px 16px;
}

.map-path-step {
  position: relative;
  flex: 0 0 156px;
  padding-right: 28px;
}

.map-path-step.has-next::after {
  position: absolute;
  top: 42px;
  right: 7px;
  width: 20px;
  height: 2px;
  background: var(--primary);
  content: "";
}

.map-path-step.has-next::before {
  position: absolute;
  top: 37px;
  right: 3px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 8px solid var(--primary);
  content: "";
}

.map-path-node {
  display: grid;
  width: 128px;
  min-height: 112px;
  align-content: start;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 9px;
  text-align: left;
  box-shadow: 0 8px 18px rgba(16, 32, 47, 0.08);
}

.map-path-node.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 3px rgba(38, 60, 103, 0.13);
}

.map-path-node.is-placeholder {
  border-style: dashed;
  background: #fffaf1;
}

.map-path-index {
  display: inline-flex;
  width: 22px;
  height: 22px;
  justify-content: center;
  align-items: center;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
}

.map-path-node strong {
  display: -webkit-box;
  min-height: 34px;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.map-path-node small,
.map-path-meta {
  overflow: hidden;
  color: var(--text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.map-branch-list {
  display: grid;
  gap: 7px;
  padding: 10px;
}

.map-branch-route {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 8px;
}

.map-branch-route button,
.map-branch-route span {
  min-width: 0;
  border-radius: var(--radius);
  padding: 6px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.map-branch-route button {
  border: 1px solid var(--line);
  background: var(--surface-low);
  color: var(--text);
  text-align: left;
}

.map-branch-route span {
  max-width: 120px;
  background: var(--amber-soft);
  color: var(--amber);
  font-weight: 800;
  text-align: center;
}

.map-branch-route.is-state-branch span {
  background: var(--primary-soft);
  color: var(--primary);
}

.map-branch-route.is-highlighted,
.map-branch-route:hover {
  border-color: var(--primary);
  background: #f8fbff;
}

.map-node-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.map-node,
.map-route,
.map-rationale-card,
.map-empty-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px;
}

.map-node.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.map-node.is-placeholder {
  border-style: dashed;
  background: #fffaf1;
}

.map-node-main {
  display: grid;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  gap: 4px;
  padding: 0;
  text-align: left;
}

.map-node-title {
  font-weight: 800;
}

.map-node-purpose {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.map-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.map-node-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.map-cta-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.map-cta-item {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-low);
  padding: 8px;
  outline: none;
}

.map-cta-item:hover,
.map-cta-item:focus,
.map-cta-item.is-highlighted {
  border-color: var(--primary);
  background: #f8fbff;
}

.map-cta-item.is-unresolved {
  border-style: dashed;
  background: #fffaf1;
}

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

.map-cta-label,
.map-cta-target {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 6px 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  text-align: left;
}

.map-cta-label {
  font-weight: 800;
}

.map-cta-target {
  cursor: pointer;
}

.map-cta-target.is-missing {
  border-style: dashed;
  color: var(--amber);
}

.map-cta-detail {
  display: none;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.map-cta-item:hover .map-cta-detail,
.map-cta-item:focus .map-cta-detail,
.map-cta-item.is-highlighted .map-cta-detail {
  display: grid;
  gap: 6px;
}

.map-cta-detail strong {
  color: var(--text);
  font-size: 12px;
}

.map-cta-detail p {
  margin: 0;
}

.map-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

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

.map-route {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.map-route.is-highlighted,
.map-node.is-path-highlight {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(38, 60, 103, 0.1);
}

.map-route button {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-low);
  color: var(--text);
  padding: 7px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-route-endpoint {
  min-width: 0;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: #fffaf1;
  color: var(--text-muted);
  padding: 7px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-route-arrow {
  color: var(--primary);
  font-weight: 800;
}

.map-route p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.map-rationale-card strong {
  display: block;
  margin-bottom: 6px;
}

.map-rationale-card p,
.map-empty-card {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.global-preview-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  height: 100%;
  gap: 10px;
}

.global-preview-scroll {
  min-height: 0;
  height: 100%;
  overflow: auto;
  cursor: grab;
  overscroll-behavior: contain;
  touch-action: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(#dfe3e8 1px, transparent 1px),
    linear-gradient(90deg, #dfe3e8 1px, transparent 1px);
  background-color: var(--surface-low);
  background-size: 24px 24px;
  padding: 18px;
}

.global-preview-scroll.is-panning {
  cursor: grabbing;
  user-select: none;
}

.global-preview-zoom-space {
  position: relative;
}

.global-preview-canvas {
  position: absolute;
  transform-origin: top left;
}

.global-preview-lines {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

.global-preview-lines marker path {
  fill: var(--primary);
}

.global-preview-lines .global-preview-arrow.is-cta path {
  fill: #1d7fc2;
}

.global-preview-lines .global-preview-arrow.is-flow path {
  fill: var(--green);
}

.global-preview-lines .global-preview-arrow.is-sequence path {
  fill: var(--text-muted);
}

.global-preview-lines .global-preview-arrow.is-mapping path {
  fill: var(--primary);
}

.global-preview-link {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2;
}

.global-preview-link.is-cta {
  stroke: #1d7fc2;
  stroke-width: 2.4;
}

.global-preview-link.is-flow {
  stroke: var(--green);
  stroke-dasharray: 8 6;
}

.global-preview-link.is-sequence {
  stroke: var(--text-muted);
  stroke-dasharray: 4 6;
}

.global-preview-link.is-mapping {
  stroke: var(--primary);
}

.global-preview-link-label {
  fill: var(--text-muted);
  font-size: 12.5px;
  font-weight: 800;
  paint-order: stroke;
  stroke: #ffffff;
  stroke-width: 5px;
  text-anchor: middle;
}

.global-preview-link-label.is-cta {
  fill: #145f93;
}

.global-preview-link-label.is-flow {
  fill: var(--green);
}

.global-preview-link-label.is-sequence {
  fill: var(--text-muted);
}

.global-preview-link-label.is-mapping {
  fill: var(--primary);
}

.global-preview-node {
  position: absolute;
  display: grid;
  grid-template-rows: 38px minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 16px 36px rgba(16, 32, 47, 0.12);
}

.global-preview-node.has-actions {
  grid-template-rows: 38px minmax(0, 1fr) auto 52px;
}

.global-preview-node.is-review-node {
  overflow: visible;
}

.global-preview-node.has-side-branches {
  grid-template-rows: 38px minmax(0, 1fr);
}

.global-preview-node.is-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(38, 60, 103, 0.14), 0 16px 36px rgba(16, 32, 47, 0.12);
}

.global-preview-node.is-placeholder {
  border-style: dashed;
  background: #fffaf1;
}

.global-preview-node-header {
  position: relative;
  z-index: 6;
  display: flex;
  min-height: 38px;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 0 8px;
  cursor: pointer;
}

.global-preview-node-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.global-preview-node-header strong {
  min-width: 0;
  color: var(--text);
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
}

.global-preview-node-header span {
  color: var(--text-muted);
  font-size: 11px;
}

.review-page-explanation {
  position: relative;
  flex: 0 0 auto;
}

.review-page-explanation summary {
  display: inline-flex;
  height: 22px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-low);
  color: var(--primary);
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  list-style: none;
  padding: 0 7px;
  user-select: none;
  white-space: nowrap;
}

.review-page-explanation summary::-webkit-details-marker {
  display: none;
}

.review-page-explanation[open] summary {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.review-page-explanation-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  display: grid;
  width: 320px;
  max-height: 360px;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 42px rgba(16, 32, 47, 0.18);
  cursor: default;
  overflow: auto;
  padding: 12px;
}

.review-page-explanation-head {
  display: grid;
  gap: 3px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.review-page-explanation-head div {
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
}

.review-page-explanation-head h4,
.review-page-explanation-section h5,
.review-page-explanation-section p {
  margin: 0;
}

.review-page-explanation-head h4 {
  color: var(--text);
  font-size: 13px;
}

.review-page-explanation-section {
  display: grid;
  gap: 4px;
}

.review-page-explanation-section h5 {
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
}

.review-page-explanation-section p {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.global-preview-node-body {
  min-height: 0;
  overflow: hidden;
  background: #ffffff;
}

.global-preview-frame {
  display: block;
  width: 402px;
  height: var(--global-preview-frame-height, 874px);
  border: 0;
  background: #ffffff;
  pointer-events: none;
  overflow: hidden;
  transform: scale(var(--global-preview-frame-scale, 1));
  transform-origin: top left;
}

.global-preview-frame.is-review-interactive {
  pointer-events: auto;
}

.global-preview-empty {
  display: grid;
  height: 100%;
  align-content: center;
  gap: 8px;
  padding: 16px;
  color: var(--text-muted);
  text-align: center;
}

.global-preview-empty strong {
  color: var(--text);
}

.global-preview-empty p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.global-preview-empty .compact-action {
  justify-self: center;
  min-width: 96px;
}

.global-preview-node-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  min-height: 52px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 8px;
}

.global-preview-node-actions .compact-action {
  display: inline-flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  justify-content: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-state-branches {
  display: flex;
  gap: 5px;
  min-height: 32px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  overflow-x: auto;
  padding: 5px 6px;
}

.global-state-branches button {
  flex: 0 0 auto;
  max-width: 92px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-low);
  color: var(--text-muted);
  padding: 3px 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}

.global-state-branches button.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
}

.global-state-branches button.is-missing {
  border-style: dashed;
}

.global-state-branches.is-side {
  position: absolute;
  top: 42px;
  right: calc(100% + 10px);
  z-index: 4;
  display: flex;
  width: 176px;
  max-height: calc(100% - 42px);
  min-height: 0;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 28px rgba(16, 32, 47, 0.14);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 8px;
}

.global-state-branches.is-side button {
  flex: 1 1 100%;
  width: 100%;
  max-width: none;
  min-height: 28px;
  padding: 5px 7px;
  line-height: 1.25;
  text-align: left;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.screen-summary {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.badge,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.badge {
  border: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--text-muted);
}

.conversation-header-tools .badge {
  min-height: 22px;
  padding: 0 8px;
  font-size: 11px;
}

.badge-green {
  border-color: #b7dec7;
  background: var(--green-soft);
  color: var(--green);
}

.tag {
  border: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--text-muted);
}

.tag-risk {
  border-color: #f5cf98;
  background: var(--amber-soft);
  color: var(--amber);
}

.tag-safe {
  border-color: #a8d8cf;
  background: var(--teal-soft);
  color: var(--teal);
}

.section-list,
.copy-list {
  display: grid;
  gap: 7px;
}

.copy-heading {
  margin-top: 16px;
}

.section-card,
.copy-card,
.principle-card,
.influence-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px;
}

.section-card h4,
.copy-card h4,
.principle-card h4,
.influence-card h4 {
  margin: 0 0 4px;
  font-size: 13px;
}

.section-card p,
.copy-card p,
.principle-card p,
.influence-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.38;
}

.principle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.principle-card {
  display: grid;
  gap: 10px;
  align-content: start;
  background: #ffffff;
}

.principle-card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.principle-card-head span {
  color: var(--text-muted);
  font-size: 11px;
}

.principle-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.principle-tags span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 6px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.2;
}

.principle-card strong,
.influence-card strong {
  display: block;
  color: var(--text);
  font-size: 12px;
  margin-bottom: 4px;
}

.principle-evidence {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.principle-evidence li {
  padding-left: 2px;
}

.principle-evidence strong {
  margin-bottom: 1px;
}

.principle-evidence span {
  display: block;
}

.influence-list {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.copy-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: start;
}

.copy-card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.copy-text {
  color: var(--text);
  white-space: pre-wrap;
}

.copy-key {
  margin-top: 4px;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
}

.prototype-panel,
.review-panel {
  min-height: 0;
  overflow: hidden;
}

.prototype-panel {
  display: flex;
  flex-direction: column;
}

.prototype-stage {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  place-items: center;
  background:
    linear-gradient(#dfe3e8 1px, transparent 1px),
    linear-gradient(90deg, #dfe3e8 1px, transparent 1px);
  background-color: var(--surface-low);
  background-size: 24px 24px;
  padding: 24px;
}

.review-preview-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  width: min(100%, 520px);
  height: 100%;
}

.review-preview-viewport {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #dfe6ee;
}

.review-preview-frame {
  border-radius: 0;
  background: transparent;
}

.prototype-frame {
  width: min(100%, 520px);
  height: 100%;
  min-height: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: var(--shadow-float);
  overflow: hidden;
}

.prototype-frame.is-global-preview {
  width: 100%;
  max-width: none;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.prototype-frame.is-global-preview .global-preview-shell,
.prototype-frame.is-global-preview .global-preview-scroll {
  height: 100%;
}

.review-preview-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}

.review-preview-controls select {
  min-width: 180px;
  max-width: 260px;
}

.phone-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 44px;
  border-bottom: 1px solid var(--line);
  padding: 0 18px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.phone-content {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.review-copy-list {
  display: grid;
  max-height: 210px;
  gap: 6px;
  overflow: auto;
  margin-top: 14px;
}

.review-copy-item {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--surface-low);
  padding: 8px 9px;
  text-align: left;
}

.review-copy-item:hover,
.review-copy-item.is-selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.review-copy-item strong {
  font-size: 12px;
}

.review-copy-item span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.prototype-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 12px;
}

.prototype-section strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}

.prototype-section p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.4;
}

.prototype-section.is-warning {
  border-color: #f3c98d;
  background: var(--amber-soft);
}

.prototype-section.is-summary {
  background: #f8fbff;
}

.prototype-copy {
  display: block;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  padding: 4px;
  text-align: left;
  white-space: pre-wrap;
}

.prototype-copy:hover,
.prototype-copy.is-selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.prototype-copy.copy-title {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.prototype-copy.copy-body {
  color: var(--text-muted);
  line-height: 1.45;
}

.prototype-copy.copy-button {
  min-height: 40px;
  margin-top: 8px;
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  text-align: center;
}

.prototype-copy.copy-secondary {
  min-height: 38px;
  margin-top: 8px;
  border-color: var(--line-strong);
  background: var(--surface-muted);
  color: var(--text);
  font-weight: 800;
  text-align: center;
}

.prototype-copy.copy-label {
  color: var(--text);
  font-weight: 800;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: 8px 0;
}

.review-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: auto;
  padding-bottom: 14px;
}

.review-panel .panel-header {
  margin-bottom: 0;
}

.review-panel > *:not(.panel-header) {
  margin-left: 14px;
  margin-right: 14px;
}

.selected-copy {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-low);
  padding: 10px;
  margin-top: 10px;
  color: var(--text-muted);
  line-height: 1.45;
}

.selected-copy strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
}

.selected-copy p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.review-map-summary {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-low);
  padding: 10px;
  margin-top: 14px;
}

.review-map-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.review-map-header strong,
.review-map-header span {
  display: block;
}

.review-map-header span {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
}

.review-map-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.review-map-node {
  flex: 0 0 126px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 8px;
  text-align: left;
}

.review-map-node.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.review-map-node.is-placeholder {
  border-style: dashed;
  background: #fffaf1;
}

.review-map-node strong,
.review-map-node span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-map-node strong {
  font-size: 12px;
}

.review-map-node span {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 11px;
}

.review-map-summary p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.review-inspector-actions {
  margin-top: 10px;
}

.review-focus-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
  margin-top: 14px;
}

.review-focus-card strong {
  font-size: 15px;
}

.review-focus-card p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.45;
  white-space: pre-wrap;
}

.review-focus-eyebrow {
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.review-chat-popover {
  position: fixed;
  top: 96px;
  right: 24px;
  z-index: 1000;
  display: flex;
  width: min(380px, calc(100vw - 32px));
  height: min(760px, calc(100vh - 48px));
  min-height: min(520px, calc(100vh - 48px));
  max-height: calc(100vh - 48px);
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-float);
  padding: 10px;
}

.review-chat-popover.is-hidden {
  display: none;
}

.review-chat-popover.is-dragging {
  user-select: none;
}

.review-chat-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  cursor: grab;
  padding-bottom: 8px;
}

.review-chat-header > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
}

.review-chat-header-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
  align-items: flex-start;
}

.review-chat-popover.is-dragging .review-chat-header {
  cursor: grabbing;
}

.review-chat-header strong,
.review-chat-header span {
  display: block;
}

.review-chat-header span {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
}

.review-thread-select {
  width: 100%;
  height: 30px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-low);
  color: var(--text);
  font-size: 12px;
}

.review-chat-messages {
  display: grid;
  flex: 1 1 auto;
  align-content: start;
  align-items: start;
  grid-auto-rows: max-content;
  min-height: 320px;
  gap: 8px;
  overflow: auto;
  padding: 10px 0;
}

.review-chat-empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
  padding: 10px;
}

.review-chat-message {
  align-self: start;
  justify-self: start;
  max-width: 92%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-low);
  padding: 8px 10px;
}

.review-chat-message.is-reviewer {
  justify-self: end;
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.review-chat-message > strong {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
}

.review-chat-message .message-plain,
.review-chat-message .message-markdown {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.review-chat-message .message-plain {
  white-space: pre-wrap;
}

.review-chat-message .message-markdown h2,
.review-chat-message .message-markdown h3,
.review-chat-message .message-markdown h4,
.review-chat-message .message-markdown h5 {
  font-size: 12px;
}

.review-chat-message .message-markdown pre {
  padding: 8px;
}

.review-chat-message .message-token-usage {
  font-size: 10px;
}

.review-chat-message.is-reviewer .message-plain,
.review-chat-message.is-reviewer .message-markdown,
.review-chat-message.is-reviewer > strong {
  color: #ffffff;
}

.review-chat-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.review-copy-map,
.review-change-card {
  margin-top: 14px;
}

.field-label {
  display: block;
  margin-top: 14px;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
}

.history-block {
  margin-top: 18px;
}

.history-list {
  display: grid;
  max-height: 230px;
  gap: 8px;
  overflow: auto;
}

.history-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
}

.history-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
}

.history-item p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.export-box {
  min-height: 620px;
  border: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  font-size: 13px;
}

.export-document-panel,
.export-artifact-panel,
.export-copy-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.export-side-column {
  display: grid;
  grid-template-rows: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 16px;
  min-height: 0;
  overflow: hidden;
}

.export-document-panel .panel-header,
.export-artifact-panel .panel-header,
.export-copy-panel .panel-header {
  flex: 0 0 auto;
}

.prd-document-preview {
  flex: 0 0 auto;
  max-height: none;
  overflow: visible;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.prd-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 14px 0;
  color: var(--text-muted);
  font-size: 12px;
}

.prd-editor-box {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  resize: none;
  line-height: 1.55;
  outline: 0;
}

.export-artifact-panel {
  margin-bottom: 0;
}

.artifact-bundle-box {
  min-height: 0;
}

.export-side-column .export-box {
  flex: 1 1 auto;
  min-height: 0;
  resize: none;
}

.code-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.toast {
  position: fixed;
  top: 20vh;
  left: var(--toast-anchor-x, 50vw);
  z-index: 2000;
  transform: translate(-50%, -8px);
  max-width: min(420px, calc(100vw - 32px));
  opacity: 0;
  pointer-events: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--text);
  color: #ffffff;
  padding: 10px 13px;
  box-shadow: var(--shadow);
  text-align: center;
  transition:
    left 120ms ease,
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.share-page {
  height: 100vh;
  min-width: 0;
  overflow: hidden;
  background: #f5f7f8;
}

.share-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  width: min(1040px, 100%);
  height: 100vh;
  min-height: 0;
  margin: 0 auto;
  padding: 18px;
  overflow: hidden;
}

.share-header {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.share-header .brand-block {
  margin: 0;
}

.share-header-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.share-header-main h2 {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  line-height: 1.25;
}

.share-header-main p {
  margin: 0;
  max-width: 920px;
  color: var(--text-muted);
  line-height: 1.5;
}

.share-workspace {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 16px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.share-context-panel {
  display: grid;
  align-content: start;
  gap: 16px;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.share-panel,
.share-chat-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.share-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.share-panel .panel-header {
  padding: 0;
}

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

.share-stat-grid .metric {
  min-width: 0;
  padding: 8px;
}

.share-stat-grid .metric span {
  font-size: 18px;
}

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

.share-tool-item {
  display: grid;
  gap: 3px;
  border: 1px solid #d6e5dd;
  border-radius: var(--radius);
  background: #f4fbf7;
  padding: 9px;
}

.share-tool-item strong {
  color: #145238;
  font-size: 13px;
}

.share-tool-item span {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.share-config-form {
  display: grid;
  gap: 10px;
}

.share-config-form label {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

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

.share-chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.share-chat-header {
  display: flex;
  gap: 12px;
  align-items: start;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
}

.share-chat-header h3 {
  margin: 0 0 4px;
  font-size: 17px;
}

.share-chat-header p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.45;
}

.share-messages {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 16px;
}

.share-empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--text-muted);
  padding: 14px;
}

.share-message {
  display: grid;
  gap: 6px;
  max-width: min(820px, 100%);
}

.share-message.is-user {
  justify-self: end;
  width: min(720px, 100%);
}

.share-message-role {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.share-message .message-markdown {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-low);
  color: var(--text);
  padding: 12px;
}

.share-message.is-user .message-markdown {
  border-color: #c7d4eb;
  background: #eef3ff;
}

.share-message.is-streaming .message-markdown::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 1em;
  margin-left: 2px;
  border-radius: 2px;
  background: var(--primary);
  vertical-align: -0.15em;
  animation: share-caret-blink 900ms steps(2, start) infinite;
}

@keyframes share-caret-blink {
  50% {
    opacity: 0;
  }
}

.share-code-block {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.share-code-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  padding: 6px 8px;
  text-transform: uppercase;
}

.share-code-toolbar strong {
  color: var(--green);
  font-size: 11px;
}

.share-message .message-markdown .share-code-block pre {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #0f172a;
  color: #e5edf6;
}

.share-code-preview-frame {
  display: block;
  width: 100%;
  height: 260px;
  border: 0;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.share-code-preview-frame.is-compact {
  height: 190px;
}

.share-json-preview,
.share-markdown-preview {
  margin: 0;
  border-top: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  padding: 10px;
}

.share-markdown-preview {
  display: grid;
  gap: 8px;
}

.share-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 12px 16px;
}

.share-composer-body {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.share-composer textarea {
  width: 100%;
  min-height: 72px;
  max-height: 180px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 10px;
}

.share-composer-hint {
  min-width: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.share-composer-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.share-image-preview-list,
.share-message-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.share-image-preview-list.is-hidden {
  display: none;
}

.share-image-preview {
  position: relative;
  width: 112px;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-low);
}

.share-image-open-button {
  display: block;
  width: 100%;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  padding: 0;
  text-align: left;
}

.share-image-open-button img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.share-image-open-button:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.45);
  outline-offset: -2px;
}

.share-image-preview .share-image-remove-button {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.share-image-preview span {
  display: block;
  overflow: hidden;
  padding: 5px 6px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-message-images figure {
  width: min(220px, 100%);
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.share-message-images .share-image-open-button {
  background: #ffffff;
}

.share-message-images img {
  display: block;
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  background: #ffffff;
}

.share-message-images figcaption {
  padding: 5px 7px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.share-image-viewer-dialog {
  width: min(1120px, calc(100vw - 48px));
}

.share-image-viewer-dialog .image-viewer-header {
  flex-direction: row;
  align-items: center;
}

.share-image-viewer-dialog .image-viewer-actions {
  width: auto;
  flex-wrap: nowrap;
}

.share-composer .primary-action {
  flex: 0 0 auto;
  min-width: 86px;
}

.share-chat-panel > .data-status {
  margin: 0 16px 14px;
}

.data-status.is-error {
  border-color: #f1b8b8;
  background: var(--red-soft);
  color: var(--red);
}

@media (max-width: 900px) {
  .share-page {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .share-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
    padding: 10px;
  }

  .share-header,
  .share-workspace {
    grid-template-columns: 1fr;
  }

  .share-workspace {
    height: auto;
    overflow: visible;
  }

  .share-context-panel {
    height: auto;
    max-height: 42vh;
  }

  .share-chat-panel {
    height: 68vh;
    min-height: 520px;
  }

  .share-composer-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .share-composer .primary-action {
    width: 100%;
  }
}

select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0 10px;
}

@media (max-width: 1260px) {
  body {
    min-width: 1040px;
  }

  .layout-two,
  .layout-library {
    grid-template-columns: 1fr;
  }

  .workbench-layout {
    grid-template-columns:
      minmax(520px, var(--workbench-left-width, 1fr))
      12px
      minmax(300px, var(--workbench-right-width, 0.32fr));
  }

  .workbench-layout.is-spec-collapsed {
    grid-template-columns: minmax(0, var(--conversation-expanded-width, 900px)) 48px;
  }

  .workbench-layout.is-spec-collapsed.has-no-spec {
    grid-template-columns: minmax(0, var(--conversation-expanded-width, 900px));
  }

  .principle-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1120px) {
  .export-workspace {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .export-resizer {
    display: none;
  }

  .prd-editor-box {
    min-height: 720px;
  }

  .export-side-column {
    grid-template-rows: auto auto;
  }

  .export-side-column .export-box {
    min-height: 320px;
  }
}
