@font-face {
  font-family: "IDI Inter";
  src: url("/idi/static/fonts/Inter-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "IDI Inter";
  src: url("/idi/static/fonts/Inter-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --ink: #182230;
  --muted: #667085;
  --line: #d8dee8;
  --accent: #1769ff;
  --blue: #1769ff;
  --blue-soft: #eff8ff;
  --cyan: #06aed4;
  --danger: #b42318;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "IDI Inter", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

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

.shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.nav { background: #111827; color: #fff; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.brand small { display: block; color: #aeb7c2; margin-top: 2px; }
.mark { width: 40px; height: 40px; display: grid; place-items: center; background: var(--accent); border-radius: 8px; font-weight: 800; }
.nav a { color: #d7dee8; text-decoration: none; padding: 10px 12px; border-radius: 8px; }
.nav a:hover { background: rgba(255,255,255,0.1); color: #fff; }
.nav-group { display: grid; gap: 6px; }
.nav-group > span {
  color: #8ea0b8;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  padding: 0 12px 2px;
}
.nav-section {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 8px;
}
.nav-section summary {
  color: #f9fafb;
  list-style: none;
  padding: 4px;
}
.nav-section summary::-webkit-details-marker { display: none; }
.nav-section summary::after {
  content: "+";
  float: right;
  color: #aeb7c2;
}
.nav-section[open] summary::after { content: "-"; }
.nav-section div {
  display: grid;
  gap: 4px;
  padding-top: 8px;
}
.nav-section a { font-size: 14px; padding: 8px 10px; }
.nav-form { margin-top: auto; }
.nav-form button { width: 100%; background: rgba(255,255,255,0.1); text-align: left; }
.main { padding: 28px; min-width: 0; }
.page-header { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 22px; }
h1, h2, h3, p { margin-top: 0; }
.page-header p, .muted { color: var(--muted); }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 22px; }
.page-head h1 { margin: 0; }
.page-head p { color: var(--muted); max-width: 760px; }
.dashboard-grid.two { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 18px; align-items: start; }
.knowledge-finding-list { display: grid; gap: 14px; }
.knowledge-finding textarea { min-height: 140px; resize: vertical; }
.activity-list { display: grid; gap: 10px; }
.activity-list div { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.activity-list div:last-child { border-bottom: 0; padding-bottom: 0; }
.activity-list span { color: var(--muted); font-size: 12px; }
.lexie-message-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.lexie-message-actions form { margin: 0; }
.lexie-message-actions button { padding: 7px 10px; font-size: 12px; }
.local-only-chip {
  align-items: center;
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  color: #047857;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 10px;
}
.button, button {
  border: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, #108a80, var(--accent));
  color: #fff;
  padding: 10px 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.16);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.button:hover, button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.22);
}
.button:active, button:active {
  transform: translateY(0);
  box-shadow: 0 5px 12px rgba(15, 118, 110, 0.16);
}
.button-icon {
  width: 17px;
  height: 17px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 17px;
}
.button-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
button.danger { background: var(--danger); }
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.login-body {
  background:
    radial-gradient(circle at 22% 18%, rgba(43, 127, 255, 0.16), transparent 30%),
    linear-gradient(180deg, #08111d 0%, #0d1727 100%);
  color: #f8fbff;
  min-height: 100vh;
}
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-panel {
  width: min(460px, 100%);
  background:
    radial-gradient(circle at 16% 18%, rgba(41, 122, 255, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(24, 39, 64, 0.96), rgba(15, 27, 47, 0.96));
  border: 1px solid rgba(181, 205, 255, 0.78);
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: 28px;
}
.login-brand {
  border-bottom: 1px solid rgba(181, 205, 255, 0.18);
  color: #f8fbff;
  margin-bottom: 24px;
  padding-bottom: 20px;
}
.login-brand strong {
  color: #ffffff;
  font-size: 30px;
  line-height: 1;
}
.login-brand small {
  color: #f0f7ff;
  font-size: 13px;
  font-weight: 600;
}
.login-brand .mark {
  width: 50px;
  height: 50px;
}
.login-brand .mark svg {
  width: 40px;
  height: 40px;
}
.login-panel h1 {
  color: #f8fbff;
  font-size: 34px;
  letter-spacing: 0;
  margin-bottom: 22px;
}
.login-panel .form {
  gap: 16px;
}
.login-panel label {
  color: #dbeafe;
  display: grid;
  font-size: 13px;
  font-weight: 700;
  gap: 8px;
}
.login-panel input[type="password"] {
  appearance: none;
  background: #f8fbff;
  border: 2px solid #73a8ff;
  border-radius: 9px;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.16);
  color: #071426;
  font-size: 18px;
  font-weight: 800;
  height: 44px;
  outline: none;
  padding: 0 14px;
}
.login-panel input[type="password"]:focus {
  border-color: #ffffff;
  box-shadow: 0 0 0 3px #1769ff, 0 0 0 7px rgba(96, 165, 250, 0.24);
}
.login-panel input[type="password"]::placeholder {
  color: #5b6b84;
}
.login-panel button[type="submit"] {
  background: linear-gradient(180deg, #2c86ff 0%, #0f5de9 100%);
  border: 1px solid rgba(191, 219, 254, 0.38);
  box-shadow: 0 14px 28px rgba(23, 105, 255, 0.28);
  color: #ffffff;
  min-height: 44px;
  width: 100%;
}
.login-panel button[type="submit"]:hover {
  background: linear-gradient(180deg, #60a5fa 0%, #1769ff 100%);
  box-shadow: 0 18px 34px rgba(23, 105, 255, 0.34);
}
.error-text {
  background: rgba(251, 113, 133, 0.12);
  border: 1px solid rgba(251, 113, 133, 0.36);
  border-radius: 8px;
  color: #fecdd3;
  padding: 10px 12px;
}

.login-panel-wide {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1fr);
  gap: 52px;
  max-width: 1160px;
  min-height: 540px;
  padding: 64px 68px;
  position: relative;
}

.login-panel-wide::before {
  background:
    radial-gradient(circle at 12% 90%, rgba(22, 119, 255, 0.32), transparent 22%),
    linear-gradient(130deg, transparent 35%, rgba(59, 130, 246, 0.12) 60%, transparent 72%);
  border-radius: inherit;
  bottom: 0;
  content: "";
  left: 0;
  opacity: 0.8;
  pointer-events: none;
  position: absolute;
  right: 0;
  top: 0;
}

.login-hero,
.login-form-card {
  position: relative;
  z-index: 1;
}

.login-hero {
  border-right: 1px solid rgba(181, 205, 255, 0.18);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-right: 52px;
}

.login-panel-wide .login-brand {
  border-bottom: 0;
  margin: 0;
  padding: 0;
}

.login-panel-wide .login-brand .mark {
  width: 76px;
  height: 76px;
  border-radius: 24px;
}

.login-panel-wide .login-brand .mark svg {
  width: 58px;
  height: 58px;
}

.login-panel-wide .login-brand strong {
  font-size: 56px;
  letter-spacing: 0;
}

.login-panel-wide .login-brand small {
  color: #b6c7df;
  font-size: 22px;
  margin-top: 6px;
}

.login-welcome-copy h1 {
  color: #f8fbff;
  font-size: clamp(42px, 5vw, 58px);
  line-height: 1.12;
  margin: 0 0 22px;
}

.login-welcome-copy h1 span {
  color: #4291ff;
}

.login-welcome-copy p {
  color: #b8c8dd;
  font-size: 21px;
  line-height: 1.55;
  max-width: 410px;
}

.login-form-card {
  align-self: center;
}

.login-form-card h2 {
  color: #ffffff;
  font-size: clamp(34px, 4vw, 46px);
  line-height: 1.1;
  margin: 0 0 14px;
}

.login-form-card > p {
  color: #b8c8dd;
  font-size: 21px;
  margin-bottom: 56px;
}

.login-form {
  max-width: none;
}

.login-form-card .login-form > label:not(.login-remember) {
  color: #f3f8ff;
  font-size: 20px;
  font-weight: 800;
}

.login-password-shell {
  align-items: center;
  background: rgba(7, 16, 31, 0.82);
  border: 2px solid #2f86ff;
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(111, 178, 255, 0.18), 0 0 32px rgba(47, 134, 255, 0.16);
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  min-height: 72px;
  padding: 0 16px 0 20px;
}

.login-field-icon {
  border: 2px solid #c7d7ec;
  border-radius: 4px;
  display: block;
  height: 19px;
  position: relative;
  width: 18px;
}

.login-field-icon::before {
  border: 2px solid #c7d7ec;
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  content: "";
  height: 11px;
  left: 2px;
  position: absolute;
  top: -11px;
  width: 10px;
}

.login-field-icon::after {
  background: #c7d7ec;
  border-radius: 99px;
  content: "";
  height: 5px;
  left: 5px;
  position: absolute;
  top: 5px;
  width: 5px;
}

.login-panel .login-password-shell input[type="password"],
.login-panel .login-password-shell input[type="text"] {
  appearance: none;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: #f8fbff;
  font-size: 22px;
  font-weight: 800;
  height: 68px;
  min-width: 0;
  outline: none;
  padding: 0 14px;
  -webkit-text-security: disc;
}

.login-panel .login-password-shell input[type="text"] {
  -webkit-text-security: none;
}

.login-panel .login-password-shell input::placeholder {
  color: #91a3bd;
  font-weight: 600;
}

.login-password-shell:focus-within {
  border-color: #73b4ff;
  box-shadow: 0 0 0 4px rgba(23, 105, 255, 0.24), 0 0 38px rgba(47, 134, 255, 0.22);
}

.login-password-toggle {
  background: transparent;
  border: 1px solid rgba(181, 205, 255, 0.28);
  border-radius: 9px;
  box-shadow: none;
  color: #dbeafe;
  min-width: 64px;
  padding: 10px 12px;
}

.login-password-toggle:hover {
  background: rgba(96, 165, 250, 0.14);
  box-shadow: none;
  color: #ffffff;
}

.login-remember {
  align-items: center;
  color: #f8fbff;
  display: flex;
  font-size: 18px;
  gap: 12px;
}

.login-remember input {
  accent-color: #1769ff;
  height: 20px;
  width: 20px;
}

.login-panel .login-submit-button {
  background: linear-gradient(180deg, #2585ff 0%, #0757e8 100%);
  border: 1px solid rgba(147, 197, 253, 0.45);
  border-radius: 12px;
  box-shadow: 0 18px 38px rgba(15, 98, 255, 0.34);
  font-size: 22px;
  min-height: 76px;
}

.login-panel .login-submit-button span {
  font-size: 28px;
  margin-left: auto;
}

@media (max-width: 900px) {
  .login-panel-wide {
    grid-template-columns: 1fr;
    gap: 30px;
    min-height: 0;
    padding: 34px;
  }

  .login-hero {
    border-right: 0;
    border-bottom: 1px solid rgba(181, 205, 255, 0.18);
    gap: 34px;
    padding: 0 0 30px;
  }

  .login-form-card > p {
    margin-bottom: 28px;
  }
}
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px; margin-bottom: 18px; overflow: hidden; }
.attention-panel, .success-panel {
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}
.attention-panel { background: #fff8e6; border: 1px solid #fedf89; color: #7a2e0e; }
.success-panel { background: #ecfdf3; border: 1px solid #abefc6; color: #067647; }
.attention-panel p, .success-panel p { margin: 4px 0 0; }
.attention-panel ul { grid-column: 1 / -1; margin: 0; padding-left: 20px; }
.attention-panel .button { justify-self: end; }
.status-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.status-card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.dot { width: 10px; height: 10px; display: inline-block; border-radius: 50%; margin-right: 8px; background: #d92d20; }
.dot.ok { background: #12b76a; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--line); text-align: left; padding: 10px; vertical-align: top; }
.table-wrap { overflow-x: auto; }
.truncate { max-width: 480px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form { display: grid; gap: 16px; max-width: 920px; }
.command-form { display: grid; gap: 16px; }
.command-form textarea {
  min-height: 180px;
  font-size: 16px;
  line-height: 1.5;
}
.command-form.compact textarea { min-height: 120px; }
.command-submit {
  justify-self: start;
  min-width: 180px;
  font-weight: 700;
}
.chat-command-shell {
  min-height: calc(100vh - 170px);
  padding-bottom: 150px;
}
body.lexie-page-body,
body:has(.lexie-shell) {
  overflow: hidden;
}
body.lexie-page-body .shell,
body:has(.lexie-shell) .shell {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}
body.lexie-page-body .nav,
body:has(.lexie-shell) .nav {
  height: 100vh;
  overflow-y: auto;
}
body.lexie-page-body .main,
body:has(.lexie-shell) .main {
  height: 100vh;
  overflow: hidden;
}
.lexie-shell {
  height: calc(100vh - 56px);
  min-height: 0;
  padding-bottom: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}
.lexie-claude-shell {
  max-width: 100%;
}
.chat-command-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 22px;
}
.chat-command-header h1 { font-size: 46px; line-height: 1; margin-bottom: 10px; }
.chat-command-header p { color: var(--muted); max-width: 760px; font-size: 17px; }
.lexie-status-pill {
  align-items: center;
  background: #eef6ff;
  border: 1px solid #cfe0ff;
  border-radius: 999px;
  color: #174ea6;
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  min-height: 38px;
  padding: 0 14px;
  white-space: nowrap;
}
.project-selector-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 18px;
}
.project-selector-card span { color: var(--muted); display: block; font-size: 12px; margin-bottom: 3px; }
.project-selector-card strong { display: block; overflow-wrap: anywhere; }
.project-selector-card label { min-width: min(360px, 100%); }
.lexie-learning-hint {
  align-items: center;
  background: #f8fbff;
  border: 1px solid #cfe0ff;
  border-radius: 8px;
  color: #42526e;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin: -6px 0 16px;
  padding: 10px 14px;
}
.lexie-learning-hint strong {
  color: #071b46;
  flex: 0 0 auto;
}
.lexie-learning-hint span {
  color: #52627a;
  text-align: right;
}
.chat-thread {
  display: grid;
  gap: 14px;
  max-width: 1020px;
  margin: 0 auto;
}
.chat-message { display: flex; gap: 10px; align-items: flex-start; }
.user-message { justify-content: flex-end; }
.chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  flex: 0 0 auto;
}
.chat-bubble {
  max-width: min(720px, 85%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
  overflow-wrap: anywhere;
}
.idi-message .chat-bubble { border-top-left-radius: 8px; }
.user-message .chat-bubble {
  background: #eff8ff;
  border-color: #b2ddff;
  border-top-right-radius: 8px;
}
.chat-bubble > strong { display: block; margin-bottom: 6px; }
.message-card-head {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  justify-content: space-between;
  margin-bottom: 8px;
}
.message-card-head strong {
  color: var(--ink);
  font-size: 15px;
}
.message-card-head span {
  color: #667085;
  font-size: 12px;
  font-weight: 750;
}
.chat-bubble p { margin: 0; color: var(--muted); line-height: 1.45; }
.chat-content {
  color: #344054;
  font-size: 16px;
  line-height: 1.62;
}
.chat-content p { margin: 0 0 12px; color: inherit; }
.chat-content p:last-child { margin-bottom: 0; }
.chat-content h3, .chat-content h4, .chat-content h5 {
  margin: 16px 0 8px;
  color: var(--ink);
  line-height: 1.25;
}
.chat-content ul, .chat-content ol {
  margin: 8px 0 14px;
  padding-left: 24px;
}
.chat-content li { margin: 5px 0; }
.chat-content code {
  background: #eef4ff;
  color: #175cd3;
  border-radius: 5px;
  padding: 2px 5px;
  font-size: 0.92em;
}
.chat-content pre {
  margin: 12px 0;
  max-height: none;
  overflow: auto;
  white-space: pre-wrap;
}
.chat-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}
.message-attachment-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 12px;
}
.message-attachment-card {
  align-items: center;
  background: #fff;
  border: 1px solid #dbe8ff;
  border-radius: 12px;
  color: #071836;
  display: grid;
  gap: 10px;
  grid-template-columns: 52px minmax(0, 1fr);
  min-height: 66px;
  padding: 8px;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.message-attachment-card:hover {
  border-color: #7fb0ff;
  box-shadow: 0 12px 26px rgba(23, 105, 255, 0.12);
  transform: translateY(-1px);
}
.message-attachment-card img,
.attachment-file-icon {
  width: 52px;
  height: 52px;
  border-radius: 10px;
}
.message-attachment-card img {
  display: block;
  object-fit: cover;
  background: #eef5ff;
}
.attachment-file-icon {
  align-items: center;
  background: #eef5ff;
  color: #075ee8;
  display: inline-flex;
  font-size: 11px;
  font-weight: 950;
  justify-content: center;
}
.message-attachment-card strong,
.message-attachment-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.message-attachment-card strong {
  font-size: 13px;
}
.message-attachment-card small {
  color: #667085;
  font-size: 11px;
  margin-top: 3px;
}
.worker-status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.worker-status-strip div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}
.worker-status-strip span {
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 50%;
  background: #12b76a;
  margin-right: 7px;
}
.worker-status-strip strong { font-size: 14px; }
.worker-status-strip p { color: var(--muted); font-size: 12px; margin: 6px 0 0; }
.chat-composer-wrap {
  position: fixed;
  bottom: 0;
  left: 288px;
  right: 28px;
  z-index: 20;
  display: grid;
  gap: 8px;
  background: linear-gradient(180deg, rgba(245,247,250,0), var(--bg) 28%);
  padding: 20px 0 18px;
}
.chat-composer {
  display: grid;
  gap: 10px;
  align-items: stretch;
  max-width: 1020px;
  width: 100%;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #b2ddff;
  border-radius: 24px;
  padding: 10px;
  box-shadow: 0 18px 50px rgba(16, 24, 40, 0.18);
}
.chat-composer-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 2px 4px 0;
}
.chat-composer-toolbar button {
  min-height: 32px;
  border-radius: 999px;
  background: #eef5ff;
  border: 1px solid #cfe0ff;
  color: #075ee8;
  font-size: 12px;
  font-weight: 850;
  padding: 7px 10px;
}
.chat-composer-toolbar button:hover {
  background: #dbeafe;
}
.composer-input-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}
.chat-composer textarea {
  border: 0;
  border-radius: 16px;
  min-height: 132px;
  max-height: 420px;
  resize: none;
  padding: 12px 6px;
  outline: none;
  overflow-y: auto;
  line-height: 1.45;
}
.icon-button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eef4ff;
  color: var(--blue);
  font-size: 26px;
  line-height: 1;
  padding: 0;
}
.send-button {
  min-width: 82px;
  height: 44px;
  border-radius: 999px;
  font-weight: 800;
}
.attachment-menu-wrap { position: relative; }
.attachment-menu {
  position: absolute;
  left: 0;
  bottom: 54px;
  width: min(280px, 82vw);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(16, 24, 40, 0.18);
  padding: 8px;
}
.attachment-menu button {
  width: 100%;
  background: transparent;
  color: var(--ink);
  text-align: left;
  border-radius: 7px;
}
.attachment-menu button:hover { background: #f2f4f7; }
.attachment-chip-row {
  max-width: 1020px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}
.attachment-chip {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #cfe0ff;
  border-radius: 12px;
  padding: 7px;
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.07);
}
.attachment-preview {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #eef4ff;
  color: var(--blue);
  font-size: 10px;
  font-weight: 900;
}
.attachment-preview img { width: 100%; height: 100%; object-fit: cover; }
.attachment-chip strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.attachment-chip small {
  color: #61708a;
  display: block;
  font-size: 11px;
  margin-top: 2px;
}
.attachment-chip a,
.attachment-chip button {
  background: #f8fbff;
  border: 1px solid #dbe8ff;
  border-radius: 999px;
  color: #075ee8;
  font-size: 11px;
  font-weight: 850;
  min-height: 28px;
  padding: 5px 8px;
  text-decoration: none;
}
.lexie-drop-zone {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  place-items: center;
  background: rgba(7, 24, 54, 0.46);
  backdrop-filter: blur(3px);
}
.lexie-drop-zone.active {
  display: grid;
}
.lexie-drop-zone div {
  display: grid;
  gap: 8px;
  min-width: min(520px, calc(100vw - 44px));
  border: 2px dashed #93c5fd;
  border-radius: 24px;
  background: #f8fbff;
  box-shadow: 0 24px 70px rgba(7, 24, 54, 0.26);
  color: #071836;
  padding: 46px;
  text-align: center;
}
.lexie-drop-zone strong {
  color: #075ee8;
  font-size: 28px;
}
.lexie-drop-zone span {
  color: #52627a;
  font-size: 16px;
}
.advanced-drawer {
  max-width: 1020px;
  width: 100%;
  margin: 0 auto;
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
.advanced-drawer summary { color: var(--muted); }
.advanced-drawer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-top: 12px;
}
.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}
.toggle-row input { width: auto; }
.mission-hero {
  background: linear-gradient(135deg, #0b1220 0%, #123b7a 58%, #0f766e 100%);
  color: #fff;
  border-radius: 8px;
  padding: 22px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(340px, 1.25fr);
  gap: 20px;
  margin-bottom: 18px;
  box-shadow: 0 16px 45px rgba(16, 24, 40, 0.18);
}
.mission-copy h1 { font-size: 44px; line-height: 1; margin-bottom: 12px; letter-spacing: 0; }
.mission-copy p { color: #dbeafe; max-width: 620px; }
.eyebrow { display: block; color: #93c5fd; font-weight: 800; margin-bottom: 8px; }
.mission-status {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.mission-status > div {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 14px;
  min-width: 0;
}
.mission-status span, .mission-mini-grid span { display: block; color: #bfdbfe; font-size: 12px; margin-bottom: 6px; }
.mission-status strong {
  display: block;
  font-size: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mission-mini-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.mission-mini-grid p { margin: 0; color: #fff; }
.hero-progress {
  height: 9px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}
.hero-progress span { display: block; height: 100%; background: #38bdf8; }
.mission-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.mission-actions button { background: rgba(255, 255, 255, 0.14); }
.mission-actions .button { background: #fff; color: #123b7a; font-weight: 800; }
.mission-command { border-color: #b2ddff; background: #f5fbff; }
.command-row { align-items: end; }
.system-gauges {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.gauge-card {
  background: var(--panel);
  border: 1px solid #c7d7fe;
  border-radius: 8px;
  padding: 16px;
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}
.gauge-ring {
  --value: 0;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, #fff 58%, transparent 59%),
    conic-gradient(var(--blue) calc(var(--value) * 1%), #e4e7ec 0);
}
.gauge-ring span { font-size: 22px; font-weight: 900; color: var(--ink); }
.gauge-card strong { display: block; font-size: 18px; margin-bottom: 4px; }
.gauge-card p, .gauge-card small { color: var(--muted); margin: 0; }
.mission-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.35fr) minmax(320px, 0.65fr);
  gap: 18px;
}
.company-panel { min-height: 420px; }
.org-chart {
  display: grid;
  justify-items: center;
  gap: 10px;
}
.org-node {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  min-width: 190px;
  text-align: center;
}
.org-node strong { display: block; }
.org-node span { color: var(--muted); font-size: 12px; }
.org-node.working {
  border-color: #84caff;
  background: var(--blue-soft);
  box-shadow: 0 0 0 3px rgba(23, 92, 211, 0.11), 0 10px 25px rgba(23, 92, 211, 0.12);
}
.org-node.waiting { opacity: 0.68; }
.org-node.idle { opacity: 0.42; }
.org-line.vertical {
  width: 2px;
  height: 28px;
  background: var(--line);
}
.org-line.horizontal {
  width: min(620px, 90%);
  height: 2px;
  background: var(--line);
  position: relative;
}
.org-line.active {
  background: linear-gradient(90deg, #84caff, #38bdf8, #175cd3);
  background-size: 220% 100%;
  animation: handoff 1.3s linear infinite;
}
.org-team-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}
.org-node.worker { min-width: 0; }
@keyframes handoff {
  from { background-position: 0 0; }
  to { background-position: 220% 0; }
}
.attention-feed .attention-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  background: #f8fafc;
}
.attention-item.critical { border-color: #fecdca; background: #fff1f3; }
.attention-item.warning { border-color: #fedf89; background: #fff8e6; }
.attention-item.ok { border-color: #abefc6; background: #ecfdf3; }
.attention-item p { margin: 4px 0 0; color: var(--muted); }
.recent-feed { margin-top: 16px; }
.recent-feed h3 { font-size: 16px; }
.recent-feed a {
  display: block;
  border-top: 1px solid var(--line);
  padding: 10px 0;
  color: var(--ink);
  text-decoration: none;
}
.recent-feed span { color: var(--muted); font-size: 12px; margin-left: 8px; }
.recent-feed p { color: var(--muted); margin: 5px 0 0; font-size: 13px; }
.worker-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.ai-worker-card {
  border: 1px solid #dbe6fb;
  border-radius: 12px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(31, 65, 121, 0.04);
}
.ai-worker-card.working {
  border-color: #72a8ff;
  background: #f1f7ff;
  box-shadow: inset 4px 0 0 #1769ff, 0 14px 34px rgba(23, 105, 255, 0.08);
}
.ai-worker-card.active {
  border-color: #b9efd2;
  background: #fbfffd;
  box-shadow: inset 4px 0 0 #16a34a, 0 12px 28px rgba(22, 163, 74, 0.05);
}
.ai-worker-card.waiting { opacity: 1; }
.ai-worker-card.idle { opacity: 0.5; }
.ai-worker-card header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.ai-worker-card header > div {
  min-width: 0;
  flex: 1;
}
.ai-worker-card header strong {
  display: block;
  color: #071836;
  font-size: 16px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-worker-card header span, .ai-worker-card em { display: block; color: var(--muted); font-size: 12px; font-style: normal; }
.ai-worker-card em {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 9px;
  background: #eef5ff;
  color: #0b57d0;
  font-weight: 850;
}
.ai-worker-card.active em {
  background: #e8f8ef;
  color: #067647;
}
.ai-worker-card.working em {
  background: #eaf3ff;
  color: #0b57d0;
}
.ai-worker-card p {
  color: #536784;
  min-height: 42px;
  line-height: 1.4;
}
.ai-worker-card dl {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  font-size: 12px;
  gap: 6px 10px;
  margin-bottom: 12px;
}
.ai-worker-card dt {
  color: #8190a7;
  font-weight: 800;
}
.ai-worker-card dd { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.worker-ai-label {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #175cd3;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 10px;
  padding: 5px 9px;
}
.mission-worker-panel {
  border-color: #cfe0ff;
  border-radius: 16px;
  box-shadow: 0 14px 42px rgba(31, 65, 121, 0.06);
}
.pipeline-panel { overflow: hidden; }
.pipeline {
  display: grid;
  grid-template-columns: repeat(9, minmax(180px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.pipeline-stage {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  min-height: 190px;
}
.pipeline-stage header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.pipeline-stage header span {
  display: grid;
  place-items: center;
  background: #dbeafe;
  color: var(--blue);
  border-radius: 999px;
  min-width: 24px;
  height: 24px;
  font-size: 12px;
  font-weight: 900;
}
.pipeline-card {
  display: block;
  color: var(--ink);
  text-decoration: none;
  background: #fff;
  border: 1px solid #c7d7fe;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
}
.pipeline-card > span { float: right; color: var(--blue); font-weight: 900; }
.pipeline-card small { color: var(--muted); display: block; margin-top: 6px; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; }
input, select, textarea { border: 1px solid var(--line); border-radius: 8px; color: var(--ink); padding: 11px 12px; font: inherit; background: #fff; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.inline-rename-form {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: min(420px, 100%);
}
.inline-rename-form input,
.inline-rename-form select {
  min-width: 220px;
  height: 40px;
}
.inline-rename-form button { height: 40px; }
.lexie-project-action-form select {
  min-width: 190px;
  border-color: #b8cdfd;
  background: #f8fbff;
  color: #0b2a5b;
  font-weight: 800;
}
.linked-project-pill {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  max-width: 260px;
  padding: 0 14px;
  border: 1px solid #b8cdfd;
  border-radius: 8px;
  background: #f8fbff;
  color: #0b2a5b;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.advanced-actions { margin: 16px 0 0; }
details summary { cursor: pointer; font-weight: 700; }
.work-log-entry {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}
.work-log-entry:first-of-type { border-top: 0; padding-top: 0; }
.work-log-entry strong { display: inline-block; margin-right: 8px; text-transform: capitalize; }
.work-log-entry small { color: var(--muted); }
.work-log-entry p { margin: 8px 0 0; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.section-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 14px; }
.metric-grid { display: grid; grid-template-columns: 1.2fr 1.2fr 0.8fr; gap: 14px; margin-bottom: 18px; }
.metric-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  min-width: 0;
}
.metric-card span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.metric-card strong { display: block; font-size: 34px; line-height: 1; margin-bottom: 10px; }
.metric-card p { color: var(--muted); margin-bottom: 10px; }
.metric-card canvas { width: 100%; height: 110px; border: 1px solid var(--line); border-radius: 8px; display: block; }
.worker-services { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kanban {
  display: grid;
  grid-template-columns: repeat(6, minmax(240px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.kanban-column {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  min-height: 240px;
}
.kanban-column header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.kanban-column header span {
  background: #e4e7ec;
  color: var(--ink);
  border-radius: 999px;
  min-width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
}
.kanban-card {
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  color: var(--ink);
  text-decoration: none;
}
.kanban-card:hover { border-color: var(--accent); }
.kanban-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.kanban-card-head span {
  color: var(--accent);
  font-size: 12px;
  text-align: right;
}
.kanban-card p { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.kanban-card small {
  display: block;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mini-progress {
  height: 8px;
  background: #e4e7ec;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}
.mini-progress span { display: block; height: 100%; background: var(--accent); }
.worker-note {
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding-top: 10px;
}
.worker-note strong { text-transform: capitalize; }
.worker-note p { margin: 6px 0 0; }
.empty-column { color: var(--muted); font-size: 13px; }
pre { white-space: pre-wrap; word-break: break-word; background: #101828; color: #edf2f7; border-radius: 8px; padding: 14px; max-height: 520px; overflow: auto; }
dl { display: grid; grid-template-columns: 120px 1fr; gap: 8px; }
dt { color: var(--muted); }
.screenshot { max-width: 100%; border: 1px solid var(--line); border-radius: 8px; }
.session-attachments { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.session-attachment-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}
.session-attachment-card img, .file-tile {
  width: 96px;
  height: 72px;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.session-attachment-card img { object-fit: cover; background: #fff; }
.file-tile {
  display: grid;
  place-items: center;
  background: #eef4ff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  text-align: center;
  padding: 8px;
}
.session-attachment-card p { color: var(--muted); margin: 4px 0; overflow-wrap: anywhere; }
.score { font-size: 38px; font-weight: 800; }
.roadmap-summary { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.progress-bar { height: 10px; background: #e4e7ec; border-radius: 999px; overflow: hidden; margin-top: 14px; }
.progress-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.2s ease; }
.roadmap { display: grid; gap: 18px; }
.phase-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 12px; }
.phase-status { background: #ecfdf3; color: #067647; border-radius: 999px; padding: 6px 10px; }
.roadmap-item { border-top: 1px solid var(--line); padding: 14px 0; display: grid; gap: 10px; }
.roadmap-item:first-of-type { border-top: 0; }
.roadmap-item-head { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.roadmap-item-head h3 { margin-bottom: 2px; font-size: 16px; }
.roadmap-item-head p { margin: 0; color: var(--muted); font-size: 13px; }
.locked-status { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; }
.locked-status.verified { background: #dcfae6; color: #067647; }
.locked-status.pending { background: #fff3cd; color: #93370d; }
.status-pill { border-radius: 999px; padding: 6px 10px; font-size: 12px; white-space: nowrap; }
.status-pill.verified { background: #ecfdf3; color: #067647; }
.status-pill.pending { background: #fff8e6; color: #93370d; }
.small-button { padding: 7px 10px; font-size: 12px; display: inline-block; }
.status-badge {
  display: inline-grid;
  place-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 5px 9px;
  background: #eef4ff;
  color: #175cd3;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.status-badge.active, .status-badge.done, .status-badge.step_completed, .status-badge.worker_idle { background: #ecfdf3; color: #067647; }
.status-badge.paused, .status-badge.waiting, .status-badge.waiting_for_approval { background: #fff8e6; color: #93370d; }
.status-badge.blocked, .status-badge.failed, .status-badge.step_blocked, .status-badge.step_failed, .status-badge.worker_busy { background: #fff1f3; color: #b42318; }
.status-badge.running, .status-badge.check_started, .status-badge.step_started { background: #eff8ff; color: #175cd3; }
.status-badge.low { background: #ecfdf3; color: #067647; }
.status-badge.medium { background: #fff8e6; color: #93370d; }
.status-badge.high { background: #fff1f3; color: #b42318; }
.brief-editor { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.brief-editor summary { cursor: pointer; font-weight: 800; color: var(--accent); margin-bottom: 12px; }
.brief-editor textarea { min-height: 92px; resize: vertical; }
.next-action-panel { border-color: #99f6e4; box-shadow: inset 4px 0 0 var(--accent); }
.current-work-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
}
.current-doing-panel {
  border-color: #bae6fd;
  box-shadow: inset 4px 0 0 #0ea5e9;
}
.intelligence-panel { border-color: #bfdbfe; }
.intelligence-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.intelligence-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fafc;
}
.intelligence-grid h3 { margin-bottom: 6px; }
.intelligence-grid pre {
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 260px;
  overflow: auto;
  border-radius: 8px;
  background: #101828;
  color: #edf2f7;
  padding: 12px;
  font-size: 12px;
}
.floating-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
}
.floating-project-drawer {
  position: fixed;
  top: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 81;
  width: min(860px, calc(100vw - 36px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 28px 90px rgba(15, 23, 42, 0.26);
}
.floating-drawer-backdrop[hidden],
.floating-project-drawer[hidden] {
  display: none;
}
.floating-drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 20px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}
.floating-drawer-head span {
  display: block;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.floating-drawer-head h2 {
  margin: 0 0 4px;
}
.floating-drawer-head p {
  color: var(--muted);
  margin: 0;
}
.floating-drawer-scroll {
  overflow: auto;
  padding: 18px;
}
.floating-drawer-scroll .panel {
  margin-bottom: 16px;
}
.floating-drawer-open {
  overflow: hidden;
}
.lexie-layout {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  min-height: 0;
  overflow: hidden;
}
.lexie-claude-shell .lexie-layout {
  grid-template-columns: minmax(220px, 292px) minmax(0, 1fr);
}
.lexie-sidebar {
  height: 100%;
  max-height: none;
  overflow: auto;
  margin-bottom: 0;
}
.lexie-thread {
  align-content: start;
  height: 100%;
  max-width: 980px;
  overflow: auto;
  padding: 8px 0 130px;
  width: 100%;
}
.lexie-welcome {
  display: grid;
  gap: 16px;
  justify-items: center;
  margin: clamp(32px, 10vh, 120px) auto 0;
  max-width: 760px;
  padding: 0 18px;
  text-align: center;
}
.lexie-welcome-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #1264f6;
  color: #fff;
  font-weight: 900;
  box-shadow: 0 14px 32px rgba(18, 100, 246, 0.18);
}
.lexie-welcome h2 {
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.05;
  margin: 0;
}
.lexie-welcome p {
  color: #52627a;
  font-size: 17px;
  margin: -4px 0 8px;
}
.lexie-choice-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(720px, 100%);
}
.lexie-choice-card {
  appearance: none;
  background: #fff;
  border: 1px solid #cfe0ff;
  border-radius: 12px;
  box-shadow: 0 12px 26px rgba(7, 24, 54, 0.06);
  color: #071b46;
  cursor: pointer;
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 16px;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.lexie-choice-card:hover,
.lexie-choice-card:focus-visible {
  border-color: #1264f6;
  box-shadow: 0 18px 36px rgba(18, 100, 246, 0.14);
  outline: none;
  transform: translateY(-1px);
}
.lexie-choice-card strong {
  font-size: 16px;
}
.lexie-choice-card span {
  color: #52627a;
  font-size: 13px;
  line-height: 1.35;
}
.conversation-list { display: grid; gap: 8px; }
.conversation-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}
.conversation-row .conversation-link {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 2px 28px 2px 2px;
  text-decoration: none;
  color: var(--ink);
}
.conversation-row form {
  margin: 0;
}
.conversation-action-button {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  padding: 0;
}
.conversation-action-button:hover {
  border-color: #bfdbfe;
  background: #eaf2ff;
  color: var(--primary);
}
.conversation-row.active {
  border-color: var(--primary);
  background: #eff6ff;
  box-shadow: inset 4px 0 0 var(--primary);
}
.conversation-row.archived { opacity: 0.72; }
.conversation-list span { color: var(--muted); font-size: 12px; }
.archived-conversations {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 12px;
}
.archived-conversations summary {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}
.project-attachment-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  margin: 4px auto 0;
  padding: 10px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 13px;
}
.project-attachment-strip strong {
  color: #0052ff;
}
.project-attachment-strip span {
  color: #53627a;
}
.lexie-thread {
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: auto;
  padding: 8px 12px 340px;
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  gap: 22px;
  align-content: start;
}
.lexie-thread .chat-message { width: 100%; }
.lexie-thread .idi-message .chat-bubble {
  max-width: min(860px, 100%);
  border-color: transparent;
  box-shadow: none;
  background: transparent;
  padding: 8px 4px;
}
.lexie-thread .user-message .chat-bubble {
  max-width: min(680px, 78%);
  box-shadow: none;
}
.lexie-thread .chat-bubble > strong {
  color: var(--ink);
  font-size: 15px;
  margin-bottom: 8px;
}
.lexie-thread .user-message .chat-content {
  color: #475467;
}
.lexie-thread .system-message .chat-bubble {
  color: #93370d;
  background: #fff8e6;
  border-color: #fedf89;
}
.lexie-memory-strip { margin-bottom: 190px; }

/* Lexie dark advisor room */
body.lexie-page-body {
  background:
    radial-gradient(circle at 74% 6%, rgba(50, 94, 185, 0.24), transparent 34%),
    radial-gradient(circle at 20% 18%, rgba(55, 65, 155, 0.18), transparent 28%),
    linear-gradient(180deg, #050b14 0%, #09111f 100%);
  color: #edf4ff;
}
body.lexie-page-body .shell {
  background: transparent;
}
body.lexie-page-body .nav {
  background:
    radial-gradient(circle at 46px 42px, rgba(62, 150, 255, 0.34), transparent 48px),
    linear-gradient(180deg, rgba(17, 28, 47, 0.98) 0%, rgba(9, 19, 35, 0.98) 100%);
  border-right: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 20px 0 70px rgba(0, 0, 0, 0.28);
}
body.lexie-page-body .main {
  background:
    radial-gradient(circle at 78% 12%, rgba(37, 99, 235, 0.16), transparent 32%),
    linear-gradient(180deg, #06101d 0%, #08111d 100%);
  color: #edf4ff;
  padding: 24px 34px 0;
}
body.lexie-page-body .lexie-shell {
  height: calc(100vh - 24px);
  grid-template-rows: auto auto minmax(0, 1fr);
}
body.lexie-page-body .chat-command-header {
  align-items: center;
  margin-bottom: 18px;
}
body.lexie-page-body .chat-command-header .eyebrow {
  color: #9fc5ff;
  font-weight: 900;
}
body.lexie-page-body .chat-command-header h1 {
  color: #f8fbff;
  font-size: 30px;
  margin-bottom: 2px;
}
body.lexie-page-body .chat-command-header p {
  color: #aebbd0;
  font-size: 15px;
  margin: 0;
}
body.lexie-page-body .chat-command-header .actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
body.lexie-page-body .lexie-control-card {
  align-items: flex-start;
  background: linear-gradient(180deg, rgba(26, 39, 62, 0.92), rgba(16, 28, 47, 0.92));
  border: 1px solid rgba(137, 161, 196, 0.2);
  border-radius: 10px;
  color: #f8fbff;
  display: grid;
  gap: 3px;
  min-width: 160px;
  padding: 10px 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
body.lexie-page-body .lexie-control-card small {
  color: #aebbd0;
  font-size: 12px;
  font-weight: 750;
}
body.lexie-page-body .lexie-control-card strong {
  align-items: center;
  display: inline-flex;
  gap: 7px;
  color: #f8fbff;
}
body.lexie-page-body .lexie-status-pill {
  background: rgba(37, 99, 235, 0.14);
  border-color: rgba(96, 165, 250, 0.26);
  color: #b8d6ff;
}
body.lexie-page-body .chat-command-header .button,
body.lexie-page-body .chat-command-header .secondary-button {
  background: rgba(29, 44, 70, 0.88);
  border: 1px solid rgba(137, 161, 196, 0.24);
  color: #eaf2ff;
  box-shadow: none;
}
body.lexie-page-body .chat-command-header .button {
  background: linear-gradient(180deg, #2675ff, #3946d3);
  border-color: rgba(147, 197, 253, 0.3);
}
body.lexie-page-body .inline-rename-form input {
  background: rgba(9, 19, 35, 0.86);
  border-color: rgba(137, 161, 196, 0.26);
  color: #f8fbff;
}
.lexie-context-panel {
  background: linear-gradient(180deg, rgba(19, 31, 52, 0.92), rgba(14, 25, 43, 0.92));
  border: 1px solid rgba(137, 161, 196, 0.17);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  margin-bottom: 20px;
  overflow: hidden;
}
.lexie-context-head {
  align-items: center;
  border-bottom: 1px solid rgba(137, 161, 196, 0.14);
  display: flex;
  justify-content: space-between;
  padding: 14px 18px;
}
.lexie-context-head strong {
  color: #f8fbff;
}
.lexie-memory-active {
  align-items: center;
  background: rgba(22, 163, 74, 0.12);
  border-radius: 8px;
  color: #80e2a4;
  display: inline-flex;
  gap: 8px;
  font-size: 13px;
  font-weight: 900;
  padding: 8px 12px;
}
.lexie-memory-active span,
.lexie-mini-dot {
  border-radius: 999px;
  display: inline-block;
  height: 9px;
  width: 9px;
}
.lexie-memory-active span,
.lexie-mini-dot.green {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}
.lexie-mini-dot.purple {
  background: #7c5cff;
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.12);
}
.lexie-context-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.lexie-context-grid div {
  border-right: 1px solid rgba(137, 161, 196, 0.14);
  display: grid;
  gap: 5px;
  padding: 14px 18px;
}
.lexie-context-grid div:last-child {
  border-right: 0;
}
.lexie-context-grid span {
  color: #aebbd0;
  font-size: 13px;
}
.lexie-context-grid strong {
  align-items: center;
  color: #f8fbff;
  display: inline-flex;
  gap: 8px;
  overflow-wrap: anywhere;
}
body.lexie-page-body .lexie-layout {
  grid-template-columns: 278px minmax(0, 1fr);
  gap: 28px;
}
body.lexie-page-body .lexie-sidebar.panel {
  background: rgba(12, 22, 38, 0.78);
  border-color: rgba(137, 161, 196, 0.18);
  border-radius: 14px;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.18);
  color: #edf4ff;
  padding: 16px;
}
body.lexie-page-body .lexie-sidebar h2 {
  color: #f8fbff;
  font-size: 22px;
}
body.lexie-page-body .conversation-row {
  background: rgba(17, 30, 51, 0.86);
  border-color: rgba(137, 161, 196, 0.18);
  border-radius: 10px;
  color: #edf4ff;
}
body.lexie-page-body .conversation-row .conversation-link {
  color: #edf4ff;
}
body.lexie-page-body .conversation-list span,
body.lexie-page-body .archived-conversations summary {
  color: #94a3b8;
}
body.lexie-page-body .conversation-row.active {
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.34), rgba(29, 78, 216, 0.22));
  border-color: rgba(96, 165, 250, 0.74);
  box-shadow: inset 4px 0 0 #3b82f6, 0 14px 30px rgba(37, 99, 235, 0.16);
}
body.lexie-page-body .conversation-action-button {
  color: #aebbd0;
}
body.lexie-page-body .conversation-action-button:hover {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(96, 165, 250, 0.5);
  color: #ffffff;
}
body.lexie-page-body .lexie-thread {
  max-width: 1180px;
  padding: 0 12px 220px;
}
body.lexie-page-body .lexie-thread .chat-message {
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
}
body.lexie-page-body .lexie-thread .user-message {
  justify-content: flex-end;
}
body.lexie-page-body .lexie-thread .user-message .chat-bubble,
body.lexie-page-body .lexie-thread .idi-message .chat-bubble {
  background: linear-gradient(180deg, rgba(25, 41, 67, 0.94), rgba(19, 32, 53, 0.94));
  border: 1px solid rgba(137, 161, 196, 0.16);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  color: #dbe7f9;
  padding: 18px 22px;
}
body.lexie-page-body .lexie-thread .user-message .chat-bubble {
  max-width: min(850px, 78%);
}
body.lexie-page-body .lexie-thread .idi-message .chat-bubble {
  max-width: min(1020px, 100%);
}
body.lexie-page-body .message-card-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 10px;
}
body.lexie-page-body .message-card-head strong {
  color: #f8fbff;
}
body.lexie-page-body .message-card-head span {
  color: #94a3b8;
  font-size: 12px;
}
body.lexie-page-body .lexie-thread .chat-content,
body.lexie-page-body .lexie-thread .user-message .chat-content {
  color: #dbe7f9;
  line-height: 1.55;
}
body.lexie-page-body .lexie-thread .chat-content h1,
body.lexie-page-body .lexie-thread .chat-content h2,
body.lexie-page-body .lexie-thread .chat-content h3,
body.lexie-page-body .lexie-thread .chat-content strong {
  color: #f8fbff;
}
body.lexie-page-body .chat-avatar,
body.lexie-page-body .lexie-welcome-mark {
  background: linear-gradient(180deg, #2f80ff, #463bd7);
  box-shadow: 0 14px 32px rgba(47, 128, 255, 0.22);
  color: #ffffff;
}
body.lexie-page-body .lexie-welcome h2,
body.lexie-page-body .lexie-welcome p {
  color: #f8fbff;
}
body.lexie-page-body .lexie-welcome p {
  color: #aebbd0;
}
body.lexie-page-body .lexie-choice-card {
  background: rgba(17, 30, 51, 0.86);
  border-color: rgba(137, 161, 196, 0.18);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.18);
  color: #f8fbff;
}
body.lexie-page-body .lexie-choice-card span {
  color: #aebbd0;
}
body.lexie-page-body .lexie-choice-card:hover,
body.lexie-page-body .lexie-choice-card:focus-visible {
  border-color: rgba(96, 165, 250, 0.82);
  box-shadow: 0 22px 54px rgba(37, 99, 235, 0.18);
}
body.lexie-page-body .lexie-message-actions .secondary-button,
body.lexie-page-body .lexie-message-actions button {
  background: rgba(24, 39, 64, 0.88);
  border: 1px solid rgba(137, 161, 196, 0.24);
  color: #dbe7f9;
  box-shadow: none;
}
body.lexie-page-body .lexie-actions-menu {
  display: inline-block;
  margin-top: 10px;
  position: relative;
}
body.lexie-page-body .lexie-actions-menu > summary {
  align-items: center;
  display: inline-flex;
  height: 34px;
  justify-content: center;
  line-height: 1;
  list-style: none;
  min-width: 38px;
  padding: 0 11px;
  user-select: none;
}
body.lexie-page-body .lexie-actions-menu > summary::-webkit-details-marker {
  display: none;
}
body.lexie-page-body .lexie-actions-menu[open] > summary {
  background: rgba(37, 99, 235, 0.26);
  border-color: rgba(96, 165, 250, 0.58);
  color: #ffffff;
}
body.lexie-page-body .lexie-actions-panel {
  background: rgba(9, 18, 31, 0.98);
  border: 1px solid rgba(137, 161, 196, 0.26);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.36);
  display: grid;
  gap: 6px;
  left: 0;
  min-width: 190px;
  padding: 8px;
  position: absolute;
  top: calc(100% + 6px);
  z-index: 80;
}
body.lexie-page-body .lexie-actions-panel form {
  margin: 0;
}
body.lexie-page-body .lexie-actions-panel .secondary-button,
body.lexie-page-body .lexie-actions-panel button {
  justify-content: flex-start;
  min-height: 34px;
  text-align: left;
  width: 100%;
}
body.lexie-page-body .lexie-actions-panel .local-only-chip {
  justify-content: flex-start;
  min-height: 30px;
  width: 100%;
}
body.lexie-page-body .lexie-message-actions .secondary-button:hover,
body.lexie-page-body .lexie-message-actions button:hover {
  background: rgba(37, 99, 235, 0.24);
  color: #ffffff;
}
body.lexie-page-body .local-only-chip {
  background: rgba(22, 163, 74, 0.13);
  border-color: rgba(74, 222, 128, 0.28);
  color: #86efac;
}
body.lexie-page-body .chat-composer-wrap {
  background: linear-gradient(180deg, rgba(8, 17, 29, 0), #08111d 34%);
  left: 264px;
  right: 34px;
  padding-bottom: 22px;
}
body.lexie-page-body .chat-composer {
  background: linear-gradient(180deg, rgba(24, 39, 64, 0.96), rgba(17, 30, 51, 0.96));
  border-color: rgba(137, 161, 196, 0.24);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  max-width: 1180px;
  padding: 12px;
}
body.lexie-page-body .chat-composer-toolbar button,
body.lexie-page-body .icon-button {
  background: rgba(12, 22, 38, 0.75);
  border: 1px solid rgba(137, 161, 196, 0.22);
  color: #dbe7f9;
  box-shadow: none;
}
body.lexie-page-body .chat-composer-toolbar button:hover,
body.lexie-page-body .icon-button:hover {
  background: rgba(37, 99, 235, 0.24);
  color: #ffffff;
}
body.lexie-page-body .chat-composer textarea {
  background: transparent;
  color: #f8fbff;
  min-height: 96px;
}
body.lexie-page-body .chat-composer textarea::placeholder {
  color: #94a3b8;
}
body.lexie-page-body .send-button {
  background: linear-gradient(180deg, #4d67ff, #4f35d8);
  border: 1px solid rgba(147, 197, 253, 0.36);
  color: #ffffff;
  box-shadow: 0 12px 26px rgba(79, 70, 229, 0.3);
}
body.lexie-page-body .attachment-menu,
body.lexie-page-body .attachment-chip {
  background: rgba(17, 30, 51, 0.96);
  border-color: rgba(137, 161, 196, 0.22);
  color: #dbe7f9;
}
body.lexie-page-body .attachment-menu button {
  color: #dbe7f9;
}
body.lexie-page-body .attachment-menu button:hover {
  background: rgba(37, 99, 235, 0.22);
}
body.lexie-page-body .lexie-memory-strip.panel {
  display: none;
}
.thinking-message .chat-bubble {
  border-color: #99f6e4;
  background: #f0fdfa;
}
.typing-dots {
  display: inline-flex;
  gap: 4px;
  margin-right: 6px;
  vertical-align: middle;
}
.typing-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: lexiePulse 1s ease-in-out infinite;
}
.typing-dots i:nth-child(2) { animation-delay: 0.15s; }
.typing-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes lexiePulse {
  0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}
.memory-suggestion-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.memory-suggestion-row .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.settings-switches {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.settings-switches label {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}
.settings-switches input { width: auto; }
.model-option-notes {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
  padding: 12px 14px;
  display: grid;
  gap: 6px;
}
.model-option-notes p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}
.model-option-notes strong { color: var(--ink); }
.compact-switches { grid-template-columns: 1fr; }
.idi-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.idi-status-grid .status-card span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.idi-status-grid .status-card strong { display: block; font-size: 20px; margin-bottom: 8px; overflow-wrap: anywhere; }
.checklist-list { display: grid; gap: 14px; }
.checklist-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}
.checklist-item:not(.expanded) {
  padding-bottom: 10px;
}
.checklist-item.running { border-color: #84caff; box-shadow: inset 4px 0 0 var(--blue); }
.checklist-item.blocked, .checklist-item.failed { border-color: #fecdca; background: #fff8f8; }
.checklist-item.done { border-color: #abefc6; background: #fbfffd; }
.checklist-item-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}
.checklist-item:not(.expanded) .checklist-item-head {
  margin-bottom: 0;
}
.checklist-item-head h3 { margin-bottom: 4px; font-size: 18px; }
.checklist-item-head p { color: var(--muted); margin: 0; }
.checklist-toggle-button {
  min-width: 94px;
  background: #eef4ff;
  color: var(--blue);
  box-shadow: none;
  border: 1px solid #c7d7fe;
}
.checklist-toggle-button:hover {
  background: #dbeafe;
  box-shadow: 0 8px 18px rgba(23, 92, 211, 0.12);
}
.checklist-toggle-button .button-icon {
  transition: transform 0.18s ease;
}
.checklist-item.expanded .checklist-toggle-button {
  background: #f8fafc;
  color: var(--muted);
  border-color: var(--line);
}
.checklist-item.expanded .checklist-toggle-button .button-icon {
  transform: rotate(180deg);
}
.checklist-item-body {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.checklist-guidance {
  border: 1px solid #c7d7fe;
  border-radius: 8px;
  background: #eef4ff;
  color: #1849a9;
  padding: 12px;
  margin: 12px 0;
}
.checklist-guidance strong {
  display: block;
  color: var(--ink);
  margin-bottom: 4px;
}
.checklist-guidance p {
  color: #475467;
  margin: 0;
}
.checklist-guidance.running {
  border-color: #84caff;
  background: #eff8ff;
}
.checklist-guidance.waiting {
  border-color: #fedf89;
  background: #fff8e6;
}
.checklist-guidance.blocked,
.checklist-guidance.failed {
  border-color: #fecdca;
  background: #fff1f3;
}
.checklist-guidance.done {
  border-color: #abefc6;
  background: #ecfdf3;
}
.evidence-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 12px;
}
.evidence-form textarea { min-height: 86px; resize: vertical; }
.evidence-list { display: grid; gap: 8px; }
.evidence-card, .evidence-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}
.evidence-empty { color: var(--muted); }
.evidence-card strong { display: block; margin-bottom: 8px; }
.evidence-card code {
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
  background: #101828;
  color: #edf2f7;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
}
.evidence-card p { margin: 0 0 6px; }
.system-improvement-metrics {
  margin-bottom: 18px;
}
.system-improvement-panel {
  margin-bottom: 18px;
}
.system-improvement-list {
  display: grid;
  gap: 14px;
}
.system-improvement-list.compact {
  gap: 10px;
}
.system-improvement-card .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.system-improvement-card .actions form {
  margin: 0;
}
.system-improvement-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.system-improvement-details div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}
.system-improvement-details dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.system-improvement-details dd {
  margin: 0;
  color: var(--ink);
}
.roadmap-notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.roadmap-item textarea { width: 100%; resize: vertical; min-height: 88px; }
.memory-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.secondary-button {
  background: #eef4ff;
  color: var(--blue);
  border: 1px solid #c7d7fe;
  box-shadow: 0 8px 18px rgba(23, 92, 211, 0.08);
}
.secondary-button:hover {
  background: #dbeafe;
  box-shadow: 0 12px 24px rgba(23, 92, 211, 0.12);
}
.dashboard-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  margin-bottom: 22px;
}
.dashboard-header h1 {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 10px;
}
.dashboard-header p {
  color: var(--muted);
  font-size: 17px;
  max-width: 720px;
}
.dashboard-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.dashboard-primary-action {
  background: linear-gradient(180deg, #0b63ff, #0647d9);
  border: 1px solid #74a7ff;
  box-shadow: 0 12px 24px rgba(11, 99, 255, 0.22);
}
.idi-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.idi-metric-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.05);
}
.idi-metric-card.ok { border-color: #abefc6; box-shadow: inset 4px 0 0 #12b76a; }
.idi-metric-card.warning { border-color: #fedf89; background: #fffaf0; box-shadow: inset 4px 0 0 #f79009; }
.idi-metric-card.danger { border-color: #fecdca; background: #fff8f8; box-shadow: inset 4px 0 0 var(--danger); }
.metric-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.metric-topline > div {
  display: flex;
  align-items: center;
  gap: 12px;
}
.metric-topline span { color: var(--muted); font-size: 13px; font-weight: 800; }
.metric-icon {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #0f9f6e;
  background: #e8f8ef;
  flex: 0 0 38px;
}
.metric-topline .metric-icon {
  color: #0f9f6e;
}
.metric-icon.memory {
  color: #dc6803;
  background: #fff4e5;
}
.metric-icon.disk {
  color: #0b8a53;
  background: #e8f8ef;
}
.metric-icon.queue {
  color: #d92d20;
  background: #fee4e2;
}
.metric-topline .metric-icon svg,
.metric-icon svg,
.room-icon svg,
.worker-status-dot svg {
  width: 20px;
  height: 20px;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.metric-topline em {
  border-radius: 999px;
  background: #f2f4f7;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  padding: 5px 8px;
  white-space: nowrap;
}
.idi-metric-card.warning .metric-topline em { background: #fff3cd; color: #93370d; }
.idi-metric-card.danger .metric-topline em { background: #fee4e2; color: var(--danger); }
.idi-metric-card strong {
  display: block;
  font-size: 38px;
  line-height: 1;
  margin-bottom: 10px;
}
.idi-metric-card p { color: var(--muted); min-height: 40px; margin-bottom: 12px; }
.idi-metric-card small { color: var(--muted); display: block; line-height: 1.35; }
.metric-bar, .large-progress {
  height: 10px;
  background: #e4e7ec;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
}
.metric-bar span, .large-progress span {
  display: block;
  height: 100%;
  background: var(--accent);
}
.idi-metric-card.warning .metric-bar span { background: #f79009; }
.idi-metric-card.danger .metric-bar span { background: var(--danger); }
.dashboard-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.7fr);
  gap: 18px;
}
.stage-overview { min-height: 260px; }
.stage-facts {
  grid-template-columns: 150px minmax(0, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  margin: 0 0 16px;
}
.stage-facts dd {
  overflow-wrap: anywhere;
  margin: 0;
}
.large-progress { height: 14px; }
.completed-card {
  background: linear-gradient(160deg, #0f766e, #175cd3);
  color: #fff;
}
.completed-card span { color: #dbeafe; font-weight: 800; }
.completed-card strong { display: block; font-size: 72px; line-height: 1; margin: 12px 0; }
.completed-card p { color: #e0f2fe; }
.completed-card a { color: #fff; font-weight: 800; }
.dashboard-work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.dashboard-active-workers-panel {
  grid-column: 1 / -1;
}
.compact-worker-grid, .activity-card-list, .attention-list, .daily-link-grid, .checklist-summary-grid {
  display: grid;
  gap: 10px;
}
.dashboard-active-workers-panel .compact-worker-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.compact-worker-card {
  border: 1px solid #dbe6fb;
  border-radius: 12px;
  background: #fff;
  padding: 14px;
  box-shadow: 0 12px 28px rgba(31, 65, 121, 0.04);
}
.compact-worker-card.active { border-color: #b9efd2; box-shadow: inset 4px 0 0 #16a34a; }
.compact-worker-card.working { border-color: #84caff; background: #f5fbff; box-shadow: inset 4px 0 0 var(--blue); }
.compact-worker-card.waiting { border-color: #dbe6fb; background: #fff; }
.compact-worker-card div {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  margin-bottom: 10px;
}
.compact-worker-card strong {
  color: #071836;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.compact-worker-card span { color: var(--muted); font-size: 12px; }
.compact-worker-card p { color: var(--muted); margin-bottom: 10px; }
.compact-worker-card footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.worker-status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #0b57d0;
  border-radius: 999px;
  background: #eef5ff;
  padding: 5px 9px;
  font-weight: 850;
}
.worker-status-dot i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1769ff;
}
.worker-status-dot.active {
  color: #067647;
  background: #e8f8ef;
}
.worker-status-dot.active i {
  background: #16a34a;
}
.dashboard-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}
.dashboard-carousel-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #dbe6fb;
}
.dashboard-carousel-dots i.active {
  background: #1769ff;
}
.attention-list .attention-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}
.attention-list .attention-item p { color: var(--muted); margin: 6px 0 0; }
.activity-card-list a, .daily-link-grid a, .checklist-summary-card {
  display: block;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}
.activity-card-list a:hover, .daily-link-grid a:hover, .project-status-card:hover, .checklist-summary-card:hover { border-color: var(--accent); }
.activity-card-list span, .daily-link-grid span, .checklist-summary-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}
.activity-card-list p {
  color: var(--muted);
  margin: 8px 0 0;
  line-height: 1.35;
}
.daily-link-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.daily-link-grid a {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 12px;
}
.daily-link-grid a::after {
  content: ">";
  color: #0b63ff;
  font-weight: 900;
  justify-self: end;
}
.room-icon {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  color: #0b63ff;
  background: #eef5ff;
  border-radius: 50%;
}
.daily-link-grid a strong,
.daily-link-grid a span:not(.room-icon) {
  grid-column: 2;
}
.dashboard-worker-status dt {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.dashboard-service-details {
  margin-top: 16px;
  border-top: 1px solid #dbe6fb;
  padding-top: 12px;
}
.dashboard-service-details summary {
  color: #42526e;
  font-weight: 850;
}
.dashboard-service-details dl {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin: 12px 0 0;
}
.mission-focus {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.current-mission-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}
.current-mission-card h2 {
  overflow-wrap: anywhere;
  margin-bottom: 8px;
}
.project-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.project-status-card {
  display: grid;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  min-width: 0;
}
.project-status-card > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.project-status-card strong {
  display: block;
  overflow-wrap: anywhere;
}
.project-status-card span, .project-status-card small {
  color: var(--muted);
  font-size: 12px;
}
.project-status-card p {
  color: var(--muted);
  overflow-wrap: anywhere;
  margin: 0;
}
.project-card-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.checklist-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.checklist-summary-card strong { display: block; margin-bottom: 10px; overflow-wrap: anywhere; }
.checklist-summary-card .status-badge { margin-bottom: 10px; }
.idi-live-console {
  border-color: #a7d8ff;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.06);
}
.action-required-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-radius: 8px;
}
.action-required-panel span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.action-required-panel h2 {
  margin-bottom: 6px;
}
.action-required-panel p {
  color: var(--muted);
  margin: 0;
}
.action-required-panel.clear {
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.action-required-panel.needs-approval {
  border-color: #facc15;
  background: #fffbeb;
}
.action-required-panel.needs-approval span,
.action-required-panel.needs-approval h2 {
  color: #7c2d12;
}
.live-console-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}
.pulse-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #94a3b8;
  box-shadow: 0 0 0 0 rgba(20, 184, 166, 0);
}
.pulse-dot.active {
  background: var(--teal);
  animation: idiPulse 1.4s infinite;
}
@keyframes idiPulse {
  0% { box-shadow: 0 0 0 0 rgba(20, 184, 166, 0.45); }
  70% { box-shadow: 0 0 0 12px rgba(20, 184, 166, 0); }
  100% { box-shadow: 0 0 0 0 rgba(20, 184, 166, 0); }
}
.live-console-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.live-console-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fbff;
  min-width: 0;
}
.live-console-grid span,
.live-progress-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
}
.live-console-grid strong,
.live-progress-row strong {
  display: block;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.live-console-grid p {
  color: var(--muted);
  margin: 6px 0 0;
  overflow-wrap: anywhere;
}
.live-progress-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: end;
  gap: 14px;
  margin: 10px 0 16px;
}
.cli-panel {
  background: #07111f;
  color: #d9f99d;
  border-radius: 8px;
  padding: 14px;
  max-height: 340px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}
.cli-panel div {
  display: grid;
  grid-template-columns: 160px 170px minmax(0, 1fr);
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}
.cli-panel div:last-child { border-bottom: 0; }
.cli-panel span { color: #93c5fd; }
.cli-panel code {
  color: #5eead4;
  white-space: normal;
}
.cli-panel p {
  margin: 0;
  color: #e5e7eb;
  overflow-wrap: anywhere;
}
#roadmap input[type="checkbox"] {
  pointer-events: none;
  opacity: 0.35;
  filter: grayscale(1);
}
.legacy-checkbox-blocked {
  background: #fff8e6;
}

/* IDI command center refresh */
.shell {
  background: #f7faff;
}
.nav {
  background:
    radial-gradient(circle at 22% 5%, rgba(49, 112, 255, 0.34), transparent 24%),
    linear-gradient(180deg, #06183a 0%, #071b3f 45%, #092a54 100%);
  border-right: 1px solid rgba(110, 168, 255, 0.18);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.06);
}
.brand {
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.brand strong {
  color: #fff;
  font-size: 24px;
}
.mark {
  background:
    radial-gradient(circle at 34% 30%, rgba(113, 197, 255, 0.52), transparent 22%),
    radial-gradient(circle at 66% 34%, rgba(37, 99, 235, 0.4), transparent 32%),
    linear-gradient(145deg, #07306d, #061a44 70%);
  border-radius: 13px;
  box-shadow:
    0 0 18px rgba(55, 132, 255, 0.75),
    inset 0 0 18px rgba(46, 144, 250, 0.34);
  overflow: visible;
}
.mark svg {
  width: 34px;
  height: 34px;
  overflow: visible;
}
.idi-network-logo .network-line {
  fill: none;
  stroke: #75c5ff;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.9;
  filter: url(#idiLogoGlow);
}
.idi-network-logo .network-line.soft {
  opacity: 0.5;
}
.idi-network-logo .network-node {
  fill: #dff6ff;
  stroke: #8fd8ff;
  stroke-width: 1.7;
  filter: url(#idiLogoGlow);
}
.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #f4f8ff;
  border-radius: 8px;
  font-weight: 750;
}
.nav-icon {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 20px;
  color: #ffffff;
}
.nav-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav a:hover {
  background: rgba(50, 116, 255, 0.2);
}
.nav-group > span {
  color: #91a7cc;
}
.nav-section {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(2, 16, 43, 0.18);
}
.nav-section summary {
  color: #d8e5ff;
  font-weight: 750;
}
.main {
  background:
    radial-gradient(circle at 52% 0%, rgba(60, 125, 255, 0.08), transparent 30%),
    #f7faff;
}
.ghost-button,
.icon-button,
.quiet-button,
.checklist-tab {
  background: #fff;
  color: #0b57d0;
  border: 1px solid #cfe0ff;
  box-shadow: 0 8px 18px rgba(25, 82, 174, 0.06);
  text-decoration: none;
}
.ghost-button:hover,
.icon-button:hover,
.quiet-button:hover,
.checklist-tab:hover {
  background: #f5f9ff;
  box-shadow: 0 12px 22px rgba(25, 82, 174, 0.1);
}
.icon-button,
.quiet-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
}
.ghost-button {
  min-height: 44px;
}
.quiet-button {
  color: #48607d;
}
.checklist-desktop,
.workers-command-page {
  color: #071836;
}
.checklist-dashboard-header,
.workers-command-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 22px;
  margin-bottom: 24px;
}
.checklist-title-lockup {
  display: flex;
  gap: 16px;
  align-items: center;
}
.title-icon,
.side-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: #1769ff;
  background: #eef5ff;
  border: 1px solid #cfe0ff;
}
.title-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
}
.title-icon svg,
.side-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.checklist-dashboard-header h1,
.workers-command-header h1 {
  margin: 0 0 6px;
  font-size: 28px;
  line-height: 1;
}
.checklist-dashboard-header p,
.workers-command-header p {
  color: #42526e;
  margin: 0;
}
.checklist-top-actions,
.workers-command-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.active-project-chip {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid #cfe0ff;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(25, 82, 174, 0.06);
  color: #071836;
}
.active-project-chip strong {
  color: #0b57d0;
}
.active-project-chip span:last-child {
  color: #42526e;
  font-size: 13px;
}
.chip-dot,
.auto-refresh-dot i,
.status-dot,
.command-node i,
.command-worker-node i,
.worker-state-pill i {
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 50%;
  background: #16a34a;
}
.checklist-hidden-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.checklist-workspace-grid {
  display: grid;
  grid-template-columns: minmax(520px, 0.9fr) minmax(680px, 1.1fr);
  gap: 20px;
  align-items: start;
}
.checklist-board-card,
.checklist-side-stack,
.side-insight-card,
.workers-table-panel,
.command-org-panel {
  min-width: 0;
}
.checklist-board-card,
.side-insight-card,
.command-org-panel,
.workers-table-panel,
.workers-advanced,
.checklist-note {
  border-color: #cfe0ff;
  border-radius: 16px;
  box-shadow: 0 14px 42px rgba(31, 65, 121, 0.06);
}
.checklist-board-card {
  padding: 14px 18px;
}
.checklist-tabs {
  display: flex;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  border-bottom: 1px solid #dbe6fb;
  padding-bottom: 10px;
  margin-bottom: 6px;
}
.checklist-tab {
  color: #30466b;
  min-height: 38px;
  padding: 8px 13px;
  box-shadow: none;
  white-space: nowrap;
}
.checklist-tab.active {
  color: #0b63ff;
  border-color: #86b7ff;
  box-shadow: inset 0 -2px 0 #1769ff;
}
.checklist-tab strong {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: #eef5ff;
  color: #1769ff;
  font-size: 12px;
}
.checklist-board-card .checklist-list {
  gap: 0;
}
.checklist-board-card .checklist-item {
  border: 0;
  border-bottom: 1px solid #dbe6fb;
  border-radius: 0;
  box-shadow: none;
  padding: 11px 8px;
}
.checklist-board-card .checklist-item:last-child {
  border-bottom: 0;
}
.checklist-board-card .checklist-item.expanded {
  margin: 8px 0;
  border: 1px solid #82b5ff;
  border-radius: 14px;
  box-shadow: inset 4px 0 0 #1769ff, 0 14px 24px rgba(23, 105, 255, 0.08);
}
.checklist-board-card .checklist-item.running:not(.expanded) {
  box-shadow: inset 3px 0 0 #1769ff;
}
.checklist-item-head {
  grid-template-columns: 46px minmax(0, 1fr) auto auto;
  gap: 14px;
}
.checklist-item-head h3 {
  color: #071836;
  font-size: 15px;
  font-weight: 850;
}
.checklist-item-head p {
  color: #42526e;
  font-size: 13px;
}
.locked-status {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #eef2ff;
  color: #295fd6;
  font-size: 12px;
  font-weight: 900;
}
.locked-status.verified {
  background: #0f9f6e;
  color: #fff;
}
.checklist-item.waiting .locked-status,
.checklist-item.running .locked-status {
  background: #fff4d4;
  color: #a14908;
}
.checklist-item.pending .locked-status {
  background: #efe8ff;
  color: #6422d6;
}
.status-badge {
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 850;
}
.status-badge.done { background: #e8f8ef; color: #0b7a52; }
.status-badge.running { background: #eaf3ff; color: #1769ff; }
.status-badge.waiting { background: #fff4de; color: #9a4a05; }
.status-badge.pending { background: #f0eaff; color: #6422d6; }
.checklist-toggle-button {
  min-width: 78px;
  height: 38px;
  border-radius: 8px;
  background: #f7fbff;
}
.checklist-board-footer {
  display: grid;
  grid-template-columns: auto minmax(140px, 1fr) auto;
  gap: 18px;
  align-items: center;
  border-top: 1px solid #dbe6fb;
  padding: 13px 6px 4px;
  color: #42526e;
  font-size: 13px;
}
.checklist-board-footer > div:first-child {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.checklist-board-footer strong {
  color: #42526e;
}
.checklist-side-stack {
  display: grid;
  gap: 16px;
  min-width: 0;
}
.checklist-side-stack .action-required-panel.clear {
  display: none;
}
.checklist-worker-org-panel {
  padding: 18px;
}
.checklist-worker-org-panel .org-command-layout {
  grid-template-columns: minmax(0, 1fr) 170px;
  gap: 18px;
  align-items: start;
}
.checklist-worker-org-panel .command-org-chart,
.checklist-worker-org-panel .org-command-chart {
  min-width: 0;
}
.checklist-worker-org-panel .command-team-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}
.checklist-worker-org-panel .command-worker-node {
  min-height: 54px;
  padding: 10px;
}
.checklist-worker-org-panel .command-worker-node strong,
.checklist-worker-org-panel .command-worker-node small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.checklist-worker-org-panel .command-summary-card {
  position: static;
}
.checklist-worker-table-panel {
  overflow: hidden;
  padding: 20px;
}
.checklist-worker-table-panel .section-head {
  align-items: start;
}
.checklist-worker-table-panel .workers-filter-row {
  justify-content: flex-end;
}
.checklist-worker-table-wrap {
  overflow-x: auto;
  padding-bottom: 4px;
}
.checklist-worker-table-panel .workers-command-table {
  min-width: 860px;
}
.checklist-worker-table-panel .workers-command-table th,
.checklist-worker-table-panel .workers-command-table td {
  vertical-align: top;
}
.checklist-worker-table-panel .workers-command-table td:nth-child(3) {
  max-width: 220px;
}
.checklist-worker-table-panel .workers-command-table td:nth-child(4),
.checklist-worker-table-panel .workers-command-table td:nth-child(5) {
  max-width: 180px;
}
.side-insight-card {
  margin-bottom: 0;
  padding: 24px;
}
.side-card-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.side-card-title h2 {
  margin: 0;
  font-size: 18px;
}
.side-card-title a {
  margin-left: auto;
  color: #0b63ff;
  text-decoration: none;
  font-weight: 750;
  font-size: 13px;
}
.side-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
}
.side-icon.target { color: #6a5cff; background: #f1efff; border-color: #dcd7ff; }
.side-icon.pulse { color: #1769ff; background: #eef5ff; }
.side-icon.people { color: #1769ff; background: #eef5ff; }
.side-icon.bell { color: #1769ff; background: #eef5ff; }
.side-icon.info { color: #1769ff; background: #eef5ff; }
.side-insight-card dl {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px 16px;
  margin: 0;
}
.side-insight-card dt {
  color: #536784;
  font-weight: 700;
}
.side-insight-card dd {
  margin: 0;
  color: #071836;
  overflow-wrap: anywhere;
  min-width: 0;
}
.compact-live-grid {
  margin-top: 18px;
  gap: 10px;
}
.compact-live-grid article {
  background: #f7faff;
  border-color: #dbe6fb;
}
.console-details {
  margin-top: 14px;
}
.console-details summary {
  color: #0b63ff;
  cursor: pointer;
  font-weight: 850;
}
.checklist-side-two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}
.compact-table table,
.workers-command-table {
  font-size: 13px;
}
.compact-table th,
.compact-table td,
.workers-command-table th,
.workers-command-table td {
  border-bottom-color: #dbe6fb;
}
.mini-link {
  display: inline-flex;
  margin-top: 16px;
  color: #0b63ff;
  text-decoration: none;
  font-weight: 850;
}
.adr-list {
  display: grid;
  gap: 10px;
}
.adr-list div {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}
.adr-list p {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.checklist-note {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-top: 18px;
  background: #fafdff;
}
.checklist-note > div {
  display: flex;
  align-items: center;
  gap: 14px;
}
.checklist-note p {
  margin: 0;
  color: #42526e;
}
.workers-command-header h1 {
  font-size: 26px;
}
.auto-refresh-dot {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: #42526e;
  font-weight: 700;
}
.auto-refresh-dot strong,
.good-text {
  color: #0b8a53;
}
.org-command-layout {
  display: grid;
  grid-template-columns: minmax(560px, 1fr) 270px;
  gap: 20px;
  align-items: start;
}
.org-command-chart {
  display: grid;
  justify-items: center;
}
.command-node {
  min-width: 260px;
  display: grid;
  justify-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #dbe6fb;
  border-radius: 10px;
  padding: 10px 18px;
  box-shadow: 0 12px 24px rgba(31, 65, 121, 0.06);
}
.command-node.leader {
  border-color: #72a8ff;
  box-shadow: 0 0 0 2px rgba(23, 105, 255, 0.12), 0 14px 30px rgba(31, 65, 121, 0.08);
}
.command-node.leader::before {
  content: "";
  width: 18px;
  height: 18px;
  display: block;
  background: linear-gradient(180deg, #ffd76a, #ffaf1a);
  clip-path: polygon(8% 38%, 30% 58%, 50% 28%, 70% 58%, 92% 38%, 82% 82%, 18% 82%);
  filter: drop-shadow(0 5px 8px rgba(255, 176, 26, 0.28));
}
.command-node.working,
.command-node.active {
  border-color: #72a8ff;
  background: linear-gradient(180deg, #ffffff, #f4f8ff);
}
.command-node.active span i,
.command-node.working span i {
  background: #16a34a;
}
.command-node strong {
  color: #071836;
  font-size: 18px;
}
.command-node span {
  color: #0b63ff;
  font-weight: 750;
}
.command-node.coordinator span,
.command-node.manager span {
  color: #536784;
  font-size: 13px;
}
.command-line {
  width: 2px;
  height: 20px;
  background: #1769ff;
}
.command-branch {
  width: min(760px, 84%);
  height: 18px;
  border-top: 2px solid #1769ff;
  border-left: 2px solid #1769ff;
  border-right: 2px solid #1769ff;
  border-radius: 12px 12px 0 0;
  margin-top: 10px;
}
.command-team-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(5, minmax(116px, 1fr));
  gap: 8px;
}
.command-worker-node {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid #dbe6fb;
  border-radius: 10px;
  background: #fff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.command-worker-node.active {
  border-color: #b9efd2;
  background: #fbfffd;
}
.command-worker-node.active small {
  color: #067647;
}
.command-worker-node.working {
  border-color: #72a8ff;
  background: #f1f7ff;
  box-shadow: 0 0 0 2px rgba(23, 105, 255, 0.1);
}
.command-worker-node > div {
  min-width: 0;
}
.command-worker-node strong {
  display: block;
  color: #071836;
  font-size: 14px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.worker-symbol,
.worker-row-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #eef5ff;
  color: #1769ff;
  font-weight: 900;
}
.worker-symbol svg,
.worker-row-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.command-worker-node.active .worker-symbol,
.worker-row-icon[data-worker="idi"] {
  background: #ecfdf3;
  color: #0f9f6e;
}
.command-worker-node.working .worker-symbol,
.worker-row-icon[data-worker="architect"],
.worker-row-icon[data-worker="coder"],
.worker-row-icon[data-worker="vision"],
.worker-row-icon[data-worker="scanner"],
.worker-row-icon[data-worker="reviewer"],
.worker-row-icon[data-worker="tester"],
.worker-row-icon[data-worker="deployment"] {
  background: #eef5ff;
  color: #1769ff;
}
.worker-row-icon[data-worker="database"] {
  background: #eef2ff;
  color: #155eef;
}
.command-worker-node small {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #536784;
  margin-top: 4px;
}
.command-worker-node.working small i,
.worker-state-pill.working i,
.status-dot.working {
  background: #1769ff;
}
.command-worker-node.active small i,
.worker-state-pill.active i {
  background: #16a34a;
}
.command-worker-node.waiting small i,
.worker-state-pill.waiting i,
.status-dot.waiting {
  background: #1769ff;
}
.command-worker-node.idle small i,
.worker-state-pill.idle i {
  background: #94a3b8;
}
.command-summary-card {
  border: 1px solid #dbe6fb;
  border-radius: 12px;
  padding: 16px;
  background: #fff;
}
.command-summary-card dl {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  margin: 0;
}
.command-summary-card dt {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #30466b;
}
.command-summary-card dd {
  margin: 0;
  font-weight: 900;
}
.status-dot.active,
.status-dot.good {
  background: #16a34a;
}
.workers-table-head {
  align-items: center;
}
.workers-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.workers-table-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  align-items: center;
  margin: -4px 0 12px;
}
.workers-table-toolbar > div {
  display: inline-flex;
  gap: 8px;
}
.worker-group-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #b9d3ff;
  border-radius: 8px;
  color: #0b57d0;
  background: #fff;
  font-weight: 850;
}
.worker-group-control span {
  color: #0b57d0;
}
.worker-group-control select {
  appearance: none;
  border: 0;
  outline: 0;
  color: #0b57d0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.icon-button.active {
  color: #0b63ff;
  background: #eef5ff;
}
.workers-command-table td:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}
.worker-state-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 850;
  border: 1px solid #dbe6fb;
  background: #f7faff;
}
.worker-state-pill.working {
  color: #0b57d0;
  background: #eaf3ff;
  border-color: #b9d3ff;
}
.worker-group-row td {
  padding-top: 18px;
  color: #0b1b3a;
  font-weight: 900;
  background: #f8fbff;
  border-top: 1px solid #dbe6fb;
}
.worker-group-row span {
  display: inline-flex;
  min-width: 22px;
  min-height: 22px;
  margin-left: 8px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #0b57d0;
  background: #eaf3ff;
  font-size: 12px;
}
.worker-grid-view {
  margin-top: 14px;
}
.worker-grid-group + .worker-grid-group {
  margin-top: 18px;
}
.worker-grid-group h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: #0b1b3a;
}
.worker-grid-group h3 span {
  display: inline-flex;
  min-width: 24px;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #0b57d0;
  background: #eaf3ff;
  font-size: 12px;
}
.worker-grid-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.worker-grid-card {
  border: 1px solid #dbe6fb;
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(11, 27, 58, 0.05);
}
.worker-grid-card.active {
  border-color: #b9efd2;
  box-shadow: inset 4px 0 0 #16a34a, 0 10px 24px rgba(11, 27, 58, 0.05);
}
.worker-grid-card.working {
  border-color: #84caff;
  background: #f5fbff;
  box-shadow: inset 4px 0 0 #0b63ff, 0 10px 24px rgba(11, 27, 58, 0.05);
}
.worker-grid-card header {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}
.worker-grid-card strong,
.worker-grid-card small,
.worker-grid-card dd {
  overflow: hidden;
  text-overflow: ellipsis;
}
.worker-grid-card small {
  display: block;
  color: #5f6f89;
  white-space: nowrap;
}
.worker-grid-card p {
  min-height: 44px;
  margin: 18px 0;
  color: #30466b;
}
.worker-grid-card dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 14px;
  margin: 0 0 14px;
}
.worker-grid-card dt {
  color: #8a97ac;
  font-weight: 850;
}
.worker-grid-card dd {
  margin: 0;
  color: #0b1b3a;
  white-space: nowrap;
}
.worker-grid-card footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  color: #30466b;
}
.worker-state-pill.active {
  color: #067647;
  background: #e8f8ef;
  border-color: #abeccf;
}
.worker-state-pill.done {
  color: #067647;
  background: #ecfdf3;
  border-color: #abefc6;
}
.worker-state-pill.waiting {
  color: #0b57d0;
  background: #eef5ff;
}
.worker-state-pill.idle {
  color: #536784;
}
.row-menu {
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  background: transparent;
  color: #42526e;
  border: 0;
  box-shadow: none;
}
.row-menu:hover {
  background: #eef5ff;
  box-shadow: none;
}
.workers-advanced summary {
  cursor: pointer;
  font-weight: 850;
  color: #0b57d0;
}
.workers-advanced .status-grid,
.workers-advanced .metric-grid {
  margin-top: 18px;
}
.dashboard-process-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.75fr);
  gap: 18px;
  margin-bottom: 18px;
}
.process-control-panel,
.process-status-panel {
  border-color: #cfe0ff;
  border-radius: 16px;
  box-shadow: 0 14px 42px rgba(31, 65, 121, 0.06);
}
.process-title {
  display: flex;
  align-items: center;
  gap: 14px;
}
.side-icon.gear {
  color: #1769ff;
}
.process-control-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}
.process-action-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  text-align: left;
  min-height: 128px;
  padding: 20px;
  border-radius: 14px;
  box-shadow: none;
  border: 1px solid;
}
.process-action-card:hover {
  transform: translateY(-2px);
}
.process-action-card.start {
  background: #effcf6;
  border-color: #abeccf;
  color: #067647;
}
.process-action-card.stop {
  background: #fff3f3;
  border-color: #fecaca;
  color: #b42318;
}
.process-action-icon {
  width: 64px;
  height: 64px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
}
.process-action-card.start .process-action-icon {
  background: linear-gradient(180deg, #0f9f6e, #087443);
}
.process-action-card.stop .process-action-icon {
  background: linear-gradient(180deg, #ef4444, #b91c1c);
}
.process-action-icon svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 2;
}
.process-action-card strong,
.process-action-card small,
.process-action-card em {
  display: block;
}
.process-action-card strong {
  font-size: 20px;
  margin-bottom: 6px;
}
.process-action-card small {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 18px;
}
.process-action-card em {
  font-size: 13px;
  font-style: normal;
}
.process-control-message {
  margin: 16px 0 0;
  color: #42526e;
}
.process-status-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  margin: 0;
}
.process-status-list dt {
  color: #42526e;
  font-weight: 800;
}
.process-status-list dd {
  margin: 0;
  font-weight: 900;
}
.process-state.running {
  color: #067647;
}
.process-state.busy,
.process-state.waiting-to-stop {
  color: #b54708;
}
.process-state.stopped,
.process-state.error {
  color: #b42318;
}
.process-toast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 80;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #071836;
  color: #fff;
  box-shadow: 0 18px 38px rgba(7, 24, 54, 0.28);
  font-weight: 800;
}
.process-toast[hidden],
.process-modal-backdrop[hidden] {
  display: none !important;
}
.process-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(7, 24, 54, 0.42);
}
.process-modal {
  width: min(520px, 100%);
  background: #fff;
  border-radius: 16px;
  border: 1px solid #cfe0ff;
  box-shadow: 0 30px 80px rgba(7, 24, 54, 0.28);
  padding: 24px;
}
.process-modal h2 {
  margin-bottom: 8px;
}
.process-modal p {
  color: #42526e;
}
.process-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

@media (max-width: 1320px) {
  .org-command-layout {
    grid-template-columns: 1fr;
  }
  .command-summary-card {
    width: min(340px, 100%);
    justify-self: end;
  }
  .command-team-grid {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
  }
}

@media (max-width: 900px) {
  .shell, .grid, .status-grid, .form-grid, .roadmap-notes, .memory-grid, .metric-grid, .worker-services, .mission-hero, .system-gauges, .mission-grid, .worker-card-grid, .worker-grid-cards, .idi-status-grid, .settings-switches, .evidence-form, .worker-status-strip, .advanced-drawer-grid, .session-attachments, .intelligence-grid, .lexie-layout, .memory-suggestion-row, .idi-metric-grid, .dashboard-header, .dashboard-overview-grid, .dashboard-work-grid, .dashboard-process-grid, .process-control-actions, .mission-focus, .project-card-grid, .checklist-summary-grid, .live-console-grid, .live-progress-row, .checklist-workspace-grid, .checklist-side-two, .org-command-layout, .command-team-grid { grid-template-columns: 1fr; }
  .checklist-dashboard-header, .workers-command-header, .checklist-note { flex-direction: column; align-items: stretch; }
  .checklist-top-actions, .workers-command-actions { justify-content: flex-start; }
  .checklist-board-footer { grid-template-columns: 1fr; }
  .side-insight-card dl { grid-template-columns: 1fr; }
  .command-branch { display: none; }
  .cli-panel div { grid-template-columns: 1fr; gap: 4px; }
  .attention-panel, .success-panel, .action-required-panel { grid-template-columns: 1fr; }
  .action-required-panel { flex-direction: column; align-items: stretch; }
  .attention-panel .button { justify-self: start; }
  .dashboard-actions { justify-content: flex-start; }
  .dashboard-header h1 { font-size: 36px; }
  .roadmap-item-head { grid-template-columns: 34px minmax(0, 1fr); }
  .status-pill { grid-column: 2; width: fit-content; }
  .mission-copy h1 { font-size: 34px; }
  .mission-status, .mission-mini-grid { grid-template-columns: 1fr; }
  .gauge-card { grid-template-columns: 96px minmax(0, 1fr); }
  .gauge-ring { width: 92px; height: 92px; }
  .org-team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chat-command-header, .project-selector-card, .lexie-learning-hint { flex-direction: column; align-items: stretch; }
  .lexie-learning-hint span { text-align: left; }
  .chat-command-header h1 { font-size: 34px; }
  .lexie-choice-grid { grid-template-columns: 1fr; }
  .lexie-welcome { margin-top: 22px; }
  .lexie-status-pill { width: fit-content; }
  .chat-bubble { max-width: 94%; }
  .chat-composer-wrap { left: 0; right: 0; padding: 12px 28px 14px; }
  .chat-composer { border-radius: 18px; }
  .composer-input-row { grid-template-columns: 40px minmax(0, 1fr) 72px; }
  .chat-composer-toolbar { max-height: 86px; overflow: auto; }
  .chat-composer textarea { min-height: 116px; max-height: 300px; }
  .attachment-chip { grid-template-columns: 42px minmax(0, 1fr) auto; }
  .attachment-chip a,
  .attachment-chip button { min-width: 30px; padding: 5px 7px; }
  .icon-button, .send-button { height: 40px; }
  .icon-button { width: 40px; }
  .session-attachment-card { grid-template-columns: 72px minmax(0, 1fr); }
  .session-attachment-card img, .file-tile { width: 72px; height: 56px; }
  body.lexie-page-body .main { padding: 18px 18px 0; }
  body.lexie-page-body .lexie-shell { height: calc(100vh - 18px); }
  body.lexie-page-body .lexie-context-grid { grid-template-columns: 1fr; }
  body.lexie-page-body .lexie-context-grid div {
    border-right: 0;
    border-bottom: 1px solid rgba(137, 161, 196, 0.14);
  }
  body.lexie-page-body .lexie-context-grid div:last-child { border-bottom: 0; }
  body.lexie-page-body .lexie-thread .user-message .chat-bubble,
  body.lexie-page-body .lexie-thread .idi-message .chat-bubble {
    max-width: 100%;
  }
  body.lexie-page-body .chat-composer-wrap {
    left: 0;
    right: 0;
    padding-left: 18px;
    padding-right: 18px;
  }
}

/* IDI visual alignment pass: match the supplied blue command-center references. */
.shell {
  grid-template-columns: 230px 1fr;
  background: #f7faff;
}
.nav {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background:
    radial-gradient(circle at 32px 44px, rgba(37, 124, 255, 0.38), transparent 42px),
    linear-gradient(180deg, #061836 0%, #08285b 100%);
  border-right: 1px solid rgba(122, 173, 255, 0.18);
  padding: 28px 18px 16px;
  gap: 14px;
}
.brand {
  margin-bottom: 20px;
}
.brand strong {
  font-size: 28px;
  letter-spacing: 0;
}
.brand small {
  color: #d5e5ff;
  font-size: 12px;
}
.nav a,
.nav-section summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  border-radius: 8px;
  color: #f4f8ff;
  font-weight: 760;
}
.nav a:hover,
.nav a[aria-current="page"] {
  background: rgba(23, 105, 255, 0.42);
  color: #fff;
}
.nav-group > span {
  color: #a8bddc;
  margin-top: 4px;
}
.nav-section {
  padding: 0;
  border: 0;
  background: transparent;
}
.nav-section summary {
  padding: 10px 12px;
  text-transform: uppercase;
  color: #a8bddc;
  font-size: 12px;
  min-height: 34px;
  justify-content: space-between;
}
.nav-section summary::after {
  content: none;
}
.nav-chevron {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 18px;
  color: #d5e5ff;
  transition: transform 160ms ease;
}
.nav-chevron svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-section[open] .nav-chevron {
  transform: rotate(180deg);
}
.nav-section div {
  padding-top: 6px;
  gap: 3px;
}
.nav-user-card {
  margin-top: 6px;
  border: 1px solid rgba(158, 196, 255, 0.2);
  border-radius: 12px;
  background: rgba(6, 25, 58, 0.52);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
}
.nav-section[open] + .nav-user-card {
  margin-top: 12px;
}
.nav-user-main {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 13px 12px;
}
.nav-avatar {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #2f7bff, #0b57d0);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}
.nav-user-main strong,
.nav-user-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-user-main small {
  color: #b8c8e2;
}
.nav-form {
  margin-top: 0;
  border-top: 1px solid rgba(158, 196, 255, 0.14);
}
.nav-form button {
  width: 100%;
  min-height: 42px;
  justify-content: flex-start;
  border-radius: 0;
  background: transparent;
  color: #f4f8ff;
  box-shadow: none;
}
.nav-form button:hover {
  background: rgba(23, 105, 255, 0.24);
  box-shadow: none;
}
.nav-system-online {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 13px;
  color: #d5e5ff;
  font-size: 12px;
  font-weight: 760;
}
.nav-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.12);
}
.main {
  padding: 32px;
  background:
    radial-gradient(circle at 52% 0%, rgba(23, 105, 255, 0.08), transparent 34%),
    #f7faff;
}
.button,
button,
.dashboard-primary-action {
  background: linear-gradient(180deg, #1769ff, #0b57d0);
  border: 1px solid #74a7ff;
  color: #fff;
  box-shadow: 0 12px 24px rgba(23, 105, 255, 0.2);
}
button:disabled,
button:disabled:hover {
  cursor: not-allowed;
  background: #eaf1ff;
  border-color: #cfe0ff;
  color: #6f7f98;
  box-shadow: none;
}
.button:hover,
button:hover,
.dashboard-primary-action:hover {
  background: linear-gradient(180deg, #2a7bff, #0b57d0);
  box-shadow: 0 16px 28px rgba(23, 105, 255, 0.25);
}
button.lexie-choice-card,
.lexie-choice-card {
  background: #fff;
  border: 1px solid #cfe0ff;
  color: #071b46;
  box-shadow: 0 12px 26px rgba(7, 24, 54, 0.06);
}
button.lexie-choice-card strong,
.lexie-choice-card strong {
  color: inherit;
}
button.lexie-choice-card span,
.lexie-choice-card span {
  color: #52627a;
}
button.lexie-choice-card:hover,
button.lexie-choice-card:focus-visible,
button.lexie-choice-card:active {
  background: linear-gradient(180deg, #1769ff, #0b57d0);
  border-color: #74a7ff;
  color: #fff;
  box-shadow: 0 18px 36px rgba(18, 100, 246, 0.18);
}
button.lexie-choice-card:hover span,
button.lexie-choice-card:focus-visible span,
button.lexie-choice-card:active span {
  color: #eaf2ff;
}
.ghost-button,
.icon-button,
.quiet-button,
.checklist-tab,
.secondary-button {
  background: #fff;
  color: #0b57d0;
  border: 1px solid #bdd5ff;
  box-shadow: 0 8px 18px rgba(23, 105, 255, 0.07);
}
.danger-soft-button {
  background: #fff;
  border-color: #fecaca;
  color: #b91c1c;
  box-shadow: 0 8px 18px rgba(185, 28, 28, 0.08);
}
.danger-soft-button:hover {
  background: #fff5f5;
  border-color: #fca5a5;
  color: #991b1b;
  box-shadow: 0 12px 22px rgba(185, 28, 28, 0.12);
}
.ghost-button:hover,
.icon-button:hover,
.quiet-button:hover,
.checklist-tab:hover,
.secondary-button:hover {
  background: #f2f7ff;
  border-color: #86b7ff;
  box-shadow: 0 14px 24px rgba(23, 105, 255, 0.12);
}
.dashboard-header,
.workers-command-header,
.checklist-dashboard-header {
  align-items: center;
}
.dashboard-header h1 {
  font-size: 44px;
  color: #071836;
}
.dashboard-header p,
.workers-command-header p,
.checklist-dashboard-header p {
  color: #30466b;
}
.idi-metric-card,
.panel,
.command-worker-node,
.command-node,
.worker-grid-card,
.compact-worker-card,
.activity-card-list a,
.daily-link-grid a {
  border-color: #d4e2fa;
  box-shadow: 0 14px 40px rgba(31, 65, 121, 0.055);
}
.idi-metric-card {
  border-radius: 10px;
}
.idi-metric-card.ok {
  border-color: #b9efd2;
  box-shadow: inset 4px 0 0 #16a34a, 0 14px 40px rgba(31, 65, 121, 0.055);
}
.idi-metric-card.warning .metric-topline em {
  background: #fff4de;
  color: #c85a00;
}
.metric-bar span,
.large-progress span,
.mini-progress span {
  background: linear-gradient(90deg, #0b63ff, #3d8bff);
}
.idi-metric-card.ok .metric-bar span {
  background: linear-gradient(90deg, #0b63ff, #3d8bff);
}
.idi-metric-card.warning .metric-bar span {
  background: linear-gradient(90deg, #ff9f1a, #ffb84d);
}
.idi-metric-card.danger .metric-bar span {
  background: linear-gradient(90deg, #d92d20, #f04438);
}
.completed-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #126dff 0%, #0845d6 100%);
}
.completed-card::after {
  content: "";
  position: absolute;
  inset: auto -12px -24px 30%;
  height: 160px;
  opacity: 0.24;
  background:
    linear-gradient(135deg, transparent 0 18%, rgba(255,255,255,0.7) 18% 19%, transparent 19% 34%, rgba(255,255,255,0.5) 34% 35%, transparent 35%),
    linear-gradient(45deg, transparent 0 38%, rgba(255,255,255,0.42) 38% 39%, transparent 39%);
}
.completed-card > * {
  position: relative;
  z-index: 1;
}
.process-action-card.start {
  background: #effcf6;
  border-color: #abeccf;
  color: #067647;
}
.process-action-card.stop {
  background: #fff3f3;
  border-color: #fecaca;
  color: #b42318;
}
.status-dot.active,
.status-dot.good,
.chip-dot,
.auto-refresh-dot i,
.nav-status-dot,
.worker-state-pill.active i,
.worker-state-pill.done i,
.worker-status-dot.active i,
.command-worker-node.active small i,
.command-worker-node.done small i,
.command-node.active span i,
.command-node.working span i {
  background: #16a34a;
}
.good-text,
.auto-refresh-dot strong,
.worker-state-pill.active,
.worker-state-pill.done,
.worker-status-dot.active {
  color: #067647;
}
.worker-state-pill.working,
.worker-status-dot.working,
.command-worker-node.working small {
  color: #0b57d0;
}
.status-dot.working,
.worker-state-pill.working i,
.worker-status-dot.working i,
.command-worker-node.working small i {
  background: #1769ff;
}
.command-org-panel {
  padding: 22px;
}
.command-line {
  background-color: #1769ff;
}
.command-branch {
  background: transparent;
  border-color: #1769ff;
}
.command-worker-node.working,
.worker-grid-card.working,
.compact-worker-card.working {
  border-color: #72a8ff;
  background: #f1f7ff;
  box-shadow: inset 4px 0 0 #1769ff, 0 12px 32px rgba(23, 105, 255, 0.08);
}
.worker-ai-label,
.worker-grid-card small,
.worker-state-pill.waiting,
.worker-status-dot {
  color: #0b57d0;
}
.worker-ai-label,
.worker-grid-card small,
.compact-worker-card small.worker-ai-label {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 5px 10px;
  border-radius: 999px;
  background: #eef5ff;
  border: 1px solid #b9d3ff;
  font-weight: 850;
}
.workers-filter-row .checklist-tab,
.checklist-tabs .checklist-tab {
  border-radius: 8px;
}
.checklist-tabs .checklist-tab.active,
.workers-filter-row .checklist-tab.active {
  background: #fff;
  color: #0b63ff;
  border-color: #86b7ff;
  box-shadow: inset 0 -2px 0 #1769ff;
}
.checklist-tabs {
  scrollbar-width: none;
}
.checklist-tabs::-webkit-scrollbar {
  display: none;
}
.checklist-tabs .checklist-tab {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 8px;
  gap: 5px;
  font-size: 12px;
}
.checklist-tabs .checklist-tab .button-icon {
  width: 13px;
  height: 13px;
  flex-basis: 13px;
}
.checklist-tabs .checklist-tab strong {
  min-width: 18px;
  height: 18px;
  font-size: 11px;
}
.checklist-top-actions .button-icon {
  margin-right: 2px;
}
.active-project-chip {
  border-color: #bdd5ff;
}
.active-project-chip strong {
  color: #0b57d0;
}
.checklist-board-card .checklist-item.expanded {
  border-color: #72a8ff;
  box-shadow: inset 4px 0 0 #1769ff, 0 14px 24px rgba(23, 105, 255, 0.08);
}
.checklist-toggle-button {
  color: #0b57d0;
  background: #f7fbff;
  border: 1px solid #bdd5ff;
}
.checklist-toggle-button[aria-expanded="true"] {
  background: #fff;
}
.locked-status.verified {
  background: #0f9f6e;
}
.checklist-item.pending .locked-status {
  background: #f0eaff;
  color: #6422d6;
}
.status-badge.done {
  background: #e8f8ef;
  color: #067647;
}
.status-badge.running,
.status-badge.working,
.worker-state-pill.working {
  background: #eaf3ff;
  color: #0b57d0;
}
.status-badge.waiting {
  background: #fff4de;
  color: #a14908;
}
.status-badge.pending {
  background: #f0eaff;
  color: #6422d6;
}
.room-icon,
.side-icon,
.title-icon,
.metric-icon,
.worker-symbol,
.worker-row-icon {
  color: #1769ff;
  background: #eef5ff;
  border-color: #cfe0ff;
}
.side-icon.target {
  color: #6a5cff;
  background: #f1efff;
}
.side-icon.gear,
.metric-icon.cpu {
  color: #0f9f6e;
  background: #e8f8ef;
}
.metric-icon.memory {
  color: #ff8a00;
  background: #fff4de;
}
.metric-icon.queue {
  color: #d92d20;
  background: #fee4e2;
}
.worker-group-control,
.workers-table-toolbar .icon-button {
  min-height: 44px;
}
.row-menu {
  color: #0b57d0;
  border-radius: 8px;
}
.row-menu:hover {
  background: #eef5ff;
}
.process-toast.worker-toast {
  bottom: 30px;
  right: 30px;
  background: #071836;
  color: #fff;
}
@media (max-width: 900px) {
  .nav {
    position: static;
    height: auto;
  }
  .shell {
    grid-template-columns: 1fr;
  }
}

/* IDI dashboard repair pass: route-aware nav and polished action controls. */
.nav a[aria-current="page"] {
  background: linear-gradient(135deg, rgba(23, 105, 255, 0.78), rgba(11, 87, 208, 0.54));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(158, 196, 255, 0.34), 0 10px 26px rgba(0, 76, 201, 0.18);
}

.nav a[aria-current="page"] .nav-icon {
  color: #fff;
}

.nav-form button {
  border: 0;
  outline: 0;
  padding: 10px 12px;
  gap: 9px;
  box-shadow: none;
  transform: none;
}

.nav-form button:hover {
  transform: none;
}

.nav-system-online {
  border-top: 1px solid rgba(158, 196, 255, 0.08);
  padding-top: 11px;
}

.ghost-button,
.secondary-button,
.quiet-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  padding: 10px 14px;
  background: #fff;
  color: #075be8;
  border: 1px solid #bdd5ff;
  text-decoration: none;
  font-weight: 850;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(23, 105, 255, 0.07);
}

.ghost-button:hover,
.secondary-button:hover,
.quiet-button:hover {
  background: #f4f8ff;
  border-color: #7fb0ff;
  color: #0647d9;
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(23, 105, 255, 0.13);
}

.button,
.dashboard-primary-action {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  padding: 10px 16px;
  text-decoration: none;
}

.button-icon,
.ghost-button .button-icon,
.button .button-icon,
.dashboard-primary-action .button-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-grid;
  place-items: center;
  color: currentColor;
}

.button-icon svg,
.ghost-button .button-icon svg,
.button .button-icon svg,
.dashboard-primary-action .button-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-actions .ghost-button,
.dashboard-actions .button {
  min-width: 150px;
}

.section-head .ghost-button {
  align-self: flex-start;
  white-space: nowrap;
}

.dashboard-active-workers-panel {
  min-height: 0;
}

.dashboard-active-workers-panel .compact-worker-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  align-items: stretch;
}

.compact-worker-card {
  min-height: 168px;
}

.compact-worker-card .worker-ai-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-card-list a {
  border-radius: 8px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.activity-card-list a:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(23, 105, 255, 0.1);
}

.daily-link-grid a {
  min-height: 84px;
  border-radius: 8px;
  padding: 14px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.daily-link-grid a:hover {
  background: #fbfdff;
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(23, 105, 255, 0.1);
}

.daily-link-grid a::after {
  content: "›";
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #eef5ff;
  color: #075be8;
  font-size: 22px;
  line-height: 1;
}

.room-icon {
  color: #075be8;
  background: #eef5ff;
}

.room-icon svg {
  width: 20px;
  height: 20px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.panel .section-head {
  align-items: flex-start;
}

/* Projects page: match the IDI command-center/sidebar presentation. */
.projects-page {
  display: grid;
  gap: 18px;
}

.projects-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}

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

.projects-title-row.compact {
  align-items: flex-start;
}

.projects-title-row h1 {
  margin: 0 0 6px;
  color: #071836;
  font-size: 42px;
  line-height: 1;
}

.projects-title-row h2 {
  margin: 0 0 6px;
  color: #071836;
}

.projects-title-row p {
  margin: 0;
  color: #42526e;
}

.projects-title-icon,
.project-card-icon,
.project-summary-plus {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 42px;
  border-radius: 9px;
  color: #075be8;
  background: linear-gradient(180deg, #f5f9ff, #eaf3ff);
  border: 1px solid #b9d3ff;
  box-shadow: 0 10px 22px rgba(23, 105, 255, 0.1);
}

.projects-title-icon.small {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
}

.projects-title-icon svg,
.project-card-icon svg,
.project-summary-plus svg {
  width: 22px;
  height: 22px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.projects-header-actions .button,
.projects-header-actions .ghost-button {
  min-width: 132px;
  justify-content: center;
}

.cody-toggle-form {
  margin: 0;
}

.cody-status-pill {
  align-items: center;
  border-radius: 10px;
  display: inline-flex;
  gap: 8px;
  min-height: 42px;
  padding: 8px 12px;
  white-space: nowrap;
}

.cody-status-pill strong {
  color: inherit;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.cody-status-pill span {
  font-weight: 900;
}

.cody-status-pill.off {
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #b45309;
}

.cody-status-pill.advisor {
  background: #eef5ff;
  border: 1px solid #b9d4ff;
  color: #075be8;
}

.cody-status-pill.builder {
  background: #f5f3ff;
  border: 1px solid #c4b5fd;
  color: #5b21b6;
}

.cody-toggle {
  align-items: center;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  justify-content: center;
  min-height: 42px;
  min-width: 132px;
  padding: 10px 14px;
}

.cody-toggle.on {
  background: #ecfdf5;
  border: 1px solid #86efac;
  color: #067647;
  box-shadow: none;
}

.cody-toggle.on:hover {
  background: #d1fae5;
}

.cody-toggle.off {
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #b45309;
  box-shadow: none;
}

.cody-toggle.off:hover {
  background: #ffedd5;
}

.cody-toggle.advisor {
  background: #eef5ff;
  border: 1px solid #b9d4ff;
  color: #075be8;
  box-shadow: none;
}

.cody-toggle.advisor:hover {
  background: #dceaff;
}

.cody-toggle.advisor.active {
  background: #dbeafe;
  border-color: #1769ff;
  box-shadow: inset 0 0 0 2px #1769ff;
}

.cody-toggle.builder {
  background: #f5f3ff;
  border: 1px solid #c4b5fd;
  color: #5b21b6;
  box-shadow: none;
}

.cody-toggle.builder:hover {
  background: #ede9fe;
}

.cody-toggle.builder.active {
  background: #ede9fe;
  border-color: #7c3aed;
  box-shadow: inset 0 0 0 2px #7c3aed;
}

.cody-toggle:disabled,
.cody-toggle.active:disabled {
  cursor: default;
  opacity: 1;
}

.cody-toggle:disabled:hover {
  filter: none;
}

.cody-control-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.cody-control-row .cody-toggle {
  min-width: 158px;
}

.projects-control-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 14px;
  margin-bottom: 0;
  border-radius: 10px;
}

.project-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.project-filter-chip {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  padding: 9px 13px;
  background: #fff;
  color: #30466b;
  border: 1px solid #d4e2fa;
  box-shadow: 0 8px 18px rgba(31, 65, 121, 0.04);
  font-weight: 850;
}

.project-filter-chip strong {
  min-width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #075be8;
  background: #eaf3ff;
  font-size: 12px;
}

.project-filter-chip.active {
  color: #075be8;
  border-color: #91bcff;
  background: #f8fbff;
  box-shadow: inset 0 -2px 0 #1769ff, 0 8px 18px rgba(23, 105, 255, 0.08);
}

.project-filter-chip.active-state {
  color: #067647;
  background: #f4fff9;
}

.project-filter-chip.active-state strong {
  color: #067647;
  background: #e8f8ef;
}

.project-filter-chip.paused-state {
  color: #c85a00;
  background: #fff9f1;
}

.project-filter-chip.paused-state strong {
  color: #a14908;
  background: #fff4de;
}

.project-filter-chip.not-init-state {
  color: #536784;
  background: #f8fafc;
}

.project-filter-chip.completed-state {
  color: #075be8;
  background: #f6f9ff;
}

.project-view-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.project-view-control > span {
  color: #42526e;
  font-size: 13px;
  font-weight: 850;
}

.project-view-control .icon-button {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  box-shadow: none;
}

.project-view-control .icon-button.active {
  color: #075be8;
  border-color: #75aaff;
  background: #eef5ff;
  box-shadow: inset 0 0 0 1px rgba(23, 105, 255, 0.12);
}

.projects-card-grid {
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  align-items: stretch;
}

.projects-card-grid.list-view {
  grid-template-columns: 1fr;
}

.projects-card {
  position: relative;
  gap: 14px;
  min-height: 228px;
  border-radius: 10px;
  border-color: #d4e2fa;
  box-shadow: 0 14px 40px rgba(31, 65, 121, 0.055);
}

.projects-card:hover {
  transform: translateY(-1px);
  border-color: #8db8ff;
  box-shadow: 0 18px 44px rgba(31, 65, 121, 0.09);
}

.projects-card.active {
  border-color: #abeccf;
  box-shadow: inset 4px 0 0 #16a34a, 0 14px 40px rgba(31, 65, 121, 0.055);
}

.projects-card.paused {
  border-color: #ffc46b;
  box-shadow: inset 4px 0 0 #f79009, 0 14px 40px rgba(31, 65, 121, 0.055);
}

.projects-card.not-initialized {
  border-color: #d4e2fa;
  background: #fff;
}

.projects-card.completed {
  border-color: #91bcff;
  box-shadow: inset 4px 0 0 #1769ff, 0 14px 40px rgba(31, 65, 121, 0.055);
}

.projects-card header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 32px;
  gap: 12px;
  align-items: start;
}

.projects-card header strong {
  color: #071836;
  font-size: 17px;
}

.projects-card header span:not(.project-card-icon) {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  margin-top: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #536784;
  background: #eef2f7;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-card-rename {
  min-width: 0;
  width: 100%;
}

.project-card-rename input {
  min-width: 0;
  flex: 1 1 auto;
  height: 36px;
  border-color: #cfe0ff;
  background: #f8fbff;
  font-weight: 800;
}

.project-card-rename button {
  flex: 0 0 auto;
  height: 36px;
  padding: 0 12px;
}

.project-path {
  min-height: 42px;
  color: #42526e;
  line-height: 1.35;
}

.projects-card .mini-progress,
.projects-summary-card .mini-progress {
  background: #e5eaf2;
}

.projects-card small,
.projects-summary-card small {
  color: #536784;
}

.project-empty-note {
  color: #42526e;
  min-height: 34px;
}

.project-card-action {
  width: 100%;
  margin-top: auto;
  justify-content: center;
  color: #075be8;
  background: #fbfdff;
}

.project-card-action .button-icon {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
}

.project-card-test-actions {
  border: 1px solid #dbe8ff;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding: 12px;
  background: #f8fbff;
}

.project-card-test-actions > span {
  color: #52627a;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.project-card-test-actions > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.project-card-test-button {
  justify-content: center;
  min-height: 34px;
  padding: 8px 10px;
  font-size: 13px;
}

.project-card-menu {
  position: relative;
}

.project-card-menu > summary {
  cursor: pointer;
  display: inline-grid;
  list-style: none;
  place-items: center;
}

.project-card-menu > summary::-webkit-details-marker {
  display: none;
}

.project-card-menu-panel {
  background: #fff;
  border: 1px solid #cfe0ff;
  border-radius: 10px;
  box-shadow: 0 16px 36px rgba(7, 24, 54, 0.16);
  display: grid;
  gap: 4px;
  min-width: 210px;
  padding: 8px;
  position: absolute;
  right: 0;
  top: 38px;
  z-index: 30;
}

.project-card-menu-panel a,
.project-card-menu-panel button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: #071836;
  cursor: pointer;
  display: flex;
  font: inherit;
  font-weight: 800;
  justify-content: flex-start;
  padding: 10px 12px;
  text-align: left;
  text-decoration: none;
  width: 100%;
}

.project-card-menu-panel a:hover,
.project-card-menu-panel button:hover {
  background: #eef5ff;
}

.project-card-menu-panel .project-menu-danger {
  color: #b42318;
}

.project-card-menu-panel .project-menu-danger:hover {
  background: #fff1f3;
}

.project-notice {
  align-items: center;
  border-radius: 14px;
  display: flex;
  gap: 10px;
  margin: 10px 0 18px;
  padding: 14px 16px;
}

.project-notice.error {
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #7c2d12;
}

.project-notice.success {
  background: #ecfdf5;
  border: 1px solid #86efac;
  color: #065f46;
}

.project-danger-zone {
  margin-top: 10px;
}

.project-more-panel {
  margin-top: 14px;
}

.project-more-panel > summary {
  list-style: none;
}

.project-more-panel > summary::-webkit-details-marker {
  display: none;
}

.project-more-panel[open] > summary {
  margin-bottom: 12px;
}

.project-more-panel[open] .project-more-icon {
  transform: rotate(180deg);
}

.project-more-icon {
  transition: transform 160ms ease;
}

.project-more-content {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  padding-top: 12px;
}

.project-danger-zone summary {
  list-style: none;
}

.project-danger-zone summary::-webkit-details-marker {
  display: none;
}

.project-delete-form {
  border: 1px solid #fecaca;
  border-radius: 12px;
  background: #fff7f7;
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
}

.project-delete-form label {
  color: #7f1d1d;
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
}

.project-delete-form input {
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #071b46;
  font: inherit;
  padding: 10px 12px;
}

.project-add-card {
  min-height: 228px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
  color: #075be8;
  text-decoration: none;
  border: 1px dashed #b9d3ff;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.7);
}

.project-add-card:hover {
  background: #fbfdff;
  border-color: #75aaff;
}

.project-add-card > span {
  width: 46px;
  height: 46px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid #75aaff;
  background: #eef5ff;
}

.project-add-card svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.project-add-card small {
  max-width: 220px;
  color: #42526e;
  line-height: 1.4;
}

.projects-overview-panel {
  border-radius: 10px;
}

.projects-summary-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.projects-summary-card {
  min-height: 118px;
  border-color: #d4e2fa;
  box-shadow: 0 10px 24px rgba(31, 65, 121, 0.04);
}

.projects-summary-card.add {
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  border-style: dashed;
}

.projects-summary-card.add strong {
  color: #075be8;
  margin: 4px 0 0;
}

.project-summary-plus {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border-radius: 50%;
  box-shadow: none;
}

.projects-tip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border: 1px solid #cfe0ff;
  border-radius: 8px;
  color: #075be8;
  background: linear-gradient(180deg, #f8fbff, #eef5ff);
}

.projects-tip p {
  margin: 0;
  color: #30466b;
}

.projects-tip strong {
  color: #075be8;
}

@media (max-width: 1200px) {
  .projects-card-grid,
  .projects-summary-grid {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }
}

@media (max-width: 900px) {
  .projects-header,
  .projects-control-bar,
  .projects-card-grid,
  .projects-summary-grid {
    grid-template-columns: 1fr;
  }

  .projects-header-actions {
    justify-content: flex-start;
  }

  .project-view-control {
    justify-content: flex-start;
  }
}

/* Checklist action controls: convert text links into clear IDI buttons. */
.action-required-panel {
  align-items: center;
}

.action-required-panel > div {
  min-width: 0;
  flex: 1 1 auto;
}

.approval-action-form {
  flex: 0 0 auto;
  margin: 0;
}

.approval-primary-button,
.approval-inactive-button {
  min-width: 180px;
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 8px;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
}

.approval-primary-button {
  color: #fff;
  background: linear-gradient(180deg, #1769ff, #0b57d0);
  border: 1px solid #75aaff;
  box-shadow: 0 14px 28px rgba(23, 105, 255, 0.26);
}

.approval-primary-button span:last-child,
.approval-inactive-button span:last-child {
  max-width: 110px;
}

.approval-inactive-button {
  color: #a66a4f;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid #ead8cf;
  box-shadow: none;
}

.approval-inactive-button:disabled {
  opacity: 0.82;
  cursor: default;
}

.approval-inactive-button:disabled:hover {
  transform: none;
  box-shadow: none;
}

.side-card-title {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.side-card-title h2 {
  min-width: 0;
  line-height: 1.1;
}

.side-card-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 11px;
  border-radius: 8px;
  color: #075be8;
  background: #f8fbff;
  border: 1px solid #bdd5ff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(23, 105, 255, 0.06);
}

.side-card-button:hover {
  color: #0647d9;
  background: #eef5ff;
  border-color: #86b7ff;
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(23, 105, 255, 0.12);
}

.side-card-button.full-width {
  width: 100%;
  min-height: 44px;
  margin-top: 16px;
  justify-content: center;
}

.side-card-button.full-width .button-icon:last-child {
  margin-left: auto;
}

.side-card-button .button-icon {
  width: 15px;
  height: 15px;
  flex-basis: 15px;
}

.side-card-button .button-icon svg {
  width: 15px;
  height: 15px;
}

.console-details summary {
  width: fit-content;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid #bdd5ff;
  border-radius: 8px;
  color: #075be8;
  background: #f8fbff;
  box-shadow: 0 8px 18px rgba(23, 105, 255, 0.06);
}

.console-details summary:hover {
  background: #eef5ff;
  border-color: #86b7ff;
}

.checklist-review-panel {
  display: grid;
  gap: 18px;
  padding: 18px;
  border: 1px solid #cfe0ff;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.review-panel-head,
.review-section-title,
.review-action-row,
.inline-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.review-panel-head span:first-child,
.review-summary-grid span {
  color: #61708d;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.review-panel-head h4,
.review-section-title h5,
.review-artifact-grid h5 {
  margin: 0;
  color: #10203a;
}

.review-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
}

.review-summary-grid article {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #dbe7fb;
  border-radius: 8px;
  background: #fff;
}

.review-summary-grid strong {
  color: #075be8;
  font-size: 18px;
}

.review-ai-summary {
  padding: 14px;
  border: 1px solid #dbe7fb;
  border-radius: 8px;
  background: #fff;
}

.review-ai-summary strong {
  color: #10203a;
}

.review-ai-summary p,
.review-artifact-grid p,
.missing-evidence-panel p {
  margin: 6px 0 0;
  color: #53627d;
}

.evidence-token-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px;
}

.evidence-token {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbe7fb;
  border-radius: 8px;
  background: #fff;
}

.evidence-token > span {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  background: #8a96aa;
  font-weight: 900;
}

.evidence-token.collected {
  border-color: #9be7bf;
  background: #f5fff9;
}

.evidence-token.collected > span {
  background: #11a66a;
}

.evidence-token.needs_review > span,
.evidence-token.missing > span {
  background: #ff9f1c;
}

.evidence-token strong {
  color: #10203a;
}

.evidence-token p {
  overflow: hidden;
  margin: 3px 0 0;
  color: #53627d;
  font-size: 13px;
  text-overflow: ellipsis;
}

.missing-evidence-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #ffd36c;
  border-radius: 8px;
  background: #fff8e6;
}

.missing-evidence-panel strong {
  color: #7d2f12;
}

.review-artifact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px;
}

.review-artifact-grid article {
  min-width: 0;
  padding: 12px;
  border: 1px solid #dbe7fb;
  border-radius: 8px;
  background: #fff;
}

.review-artifact-grid ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: #30466b;
}

.review-action-row {
  justify-content: flex-start;
  flex-wrap: wrap;
  padding-top: 4px;
}

.review-action-row form {
  margin: 0;
}

.review-action-row .approval-primary-button,
.review-action-row .secondary-button,
.review-action-row .ghost-button {
  min-height: 46px;
}

.approval-primary-button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.approval-inline-details {
  position: relative;
}

.approval-inline-details summary {
  list-style: none;
  cursor: pointer;
}

.approval-inline-details summary::-webkit-details-marker {
  display: none;
}

.approval-inline-details form {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 0;
  width: min(420px, 82vw);
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #bdd5ff;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(16, 32, 58, 0.18);
}

.approval-inline-details.danger form {
  border-color: #ffc5c5;
}

.approval-inline-details textarea,
.advanced-evidence-editor textarea {
  min-height: 90px;
  resize: vertical;
}

.advanced-evidence-editor {
  padding-top: 8px;
  border-top: 1px solid #dbe7fb;
}

.advanced-evidence-editor summary {
  width: fit-content;
  cursor: pointer;
  color: #61708d;
  font-weight: 850;
}

.advanced-evidence-editor .evidence-form {
  margin-top: 12px;
}

.mini-link {
  display: none;
}

.checklist-note .ghost-button {
  min-width: 190px;
}

@media (max-width: 900px) {
  .approval-action-form,
  .approval-primary-button,
  .approval-inactive-button,
  .side-card-button.full-width,
  .checklist-note .ghost-button {
    width: 100%;
  }

  .side-card-title {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .side-card-title .side-card-button {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .review-summary-grid,
  .evidence-token-grid,
  .review-artifact-grid {
    grid-template-columns: 1fr;
  }

  .review-action-row,
  .review-panel-head,
  .review-section-title,
  .inline-action-row {
    align-items: stretch;
    flex-direction: column;
  }

  .approval-inline-details,
  .review-action-row form,
  .review-action-row .approval-primary-button,
  .review-action-row .secondary-button,
  .review-action-row .ghost-button {
    width: 100%;
  }

  .approval-inline-details form {
    position: static;
    width: 100%;
    margin-top: 8px;
  }
}

/* IDI Operating Model diagnostics */
.operating-model-header {
  align-items: flex-start;
}

.operating-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.operating-status-grid .metric-card h2 {
  margin: 12px 0 8px;
  font-size: 20px;
}

.operating-status-grid .metric-card p {
  margin: 0;
  color: #53627d;
}

.operating-grid {
  align-items: stretch;
}

.check-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  color: #10203a;
  font-weight: 800;
}

.status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 999px;
  background: #8a96aa;
}

.status-dot.ok {
  background: #19c777;
  box-shadow: 0 0 0 5px rgba(25, 199, 119, 0.13);
}

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

.pipeline-row span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid #bdd5ff;
  border-radius: 999px;
  color: #075be8;
  background: #f8fbff;
  font-weight: 850;
}

.file-proof-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
}

.file-proof {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #d7e3f7;
  border-radius: 8px;
  background: #fff;
}

.file-proof strong {
  color: #10203a;
}

.file-proof span {
  color: #53627d;
}

.file-proof code {
  display: block;
  overflow: hidden;
  max-width: 100%;
  padding: 8px;
  border-radius: 6px;
  color: #075be8;
  background: #eef5ff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.numbered-flow {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 22px;
}

.numbered-flow li {
  padding-left: 4px;
  color: #30466b;
}

@media (max-width: 1100px) {
  .operating-status-grid,
  .file-proof-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 700px) {
  .operating-status-grid,
  .file-proof-grid {
    grid-template-columns: 1fr;
  }
}

/* Project preview and live visit controls */
.preview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.preview-control {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.preview-control.compact {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e2eafe;
}

.preview-control-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.preview-control-head > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.preview-kicker {
  color: #667085;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.preview-control strong {
  color: #071b46;
}

.preview-control small {
  overflow: hidden;
  color: #53627d;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #46546d;
  background: #eef3fb;
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
  white-space: nowrap;
}

.preview-status.online {
  color: #067647;
  background: #dcfae6;
}

.preview-status.offline,
.preview-status.error {
  color: #b42318;
  background: #fff1f3;
}

.preview-status.starting {
  color: #175cd3;
  background: #eff8ff;
}

.preview-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preview-inline-form {
  display: contents;
}

.preview-button {
  min-height: 36px;
  padding: 8px 10px;
  color: #075be8;
}

.preview-feedback {
  position: relative;
}

.preview-feedback summary {
  width: fit-content;
  list-style: none;
  cursor: pointer;
}

.preview-feedback summary::-webkit-details-marker {
  display: none;
}

.preview-feedback form {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #bdd5ff;
  border-radius: 8px;
  background: #f8fbff;
}

.preview-feedback textarea {
  min-height: 92px;
  resize: vertical;
}

.preview-message {
  min-height: 20px;
  margin: 0;
  color: #067647;
  font-weight: 750;
}

.preview-message.error {
  color: #b42318;
}

.preview-shot-summary {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e2eafe;
}

.preview-shot-summary img {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  border: 1px solid #d7e3f7;
  border-radius: 8px;
  background: #f8fbff;
}

.project-location-panel,
.project-runnable-panel {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #d7e3f7;
  border-radius: 8px;
  background: #f8fbff;
}

.project-runnable-panel.ready {
  border-color: #abefc6;
  background: #f6fef9;
}

.project-runnable-panel.missing {
  border-color: #fedf89;
  background: #fffbeb;
}

.project-location-panel h2,
.project-runnable-panel h2 {
  margin: 0;
  font-size: 18px;
}

.project-location-panel p,
.project-runnable-panel p {
  margin: 0;
}

.project-files-page .dashboard-actions form {
  margin: 0;
}

.project-file-location {
  display: grid;
  gap: 8px;
}

.project-file-location code {
  display: block;
  overflow: hidden;
  padding: 12px;
  border-radius: 8px;
  color: #075be8;
  background: #eef5ff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-file-table {
  overflow-x: auto;
}

.project-file-table code {
  color: #071b46;
  font-weight: 800;
}

.project-no-code-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.preview-settings-panel .form {
  display: grid;
  gap: 12px;
}

.preview-settings-panel input {
  width: 100%;
}

.preview-start-form {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e2eafe;
}

.checklist-preview-strip {
  margin-bottom: 18px;
}

.checklist-preview-strip .preview-control.compact,
.mission-preview-card .preview-control.compact {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.dashboard-preview-panel .preview-facts {
  margin-top: 14px;
}

.projects-card .preview-control .preview-button-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.projects-card .preview-button {
  font-size: 12px;
  white-space: normal;
}

.knowledge-search-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.knowledge-search-form {
  display: grid;
  gap: 8px;
}

.knowledge-search-form label {
  color: #b8c7dd;
  font-weight: 800;
}

.knowledge-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.knowledge-search-row input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(147, 197, 253, 0.28);
  border-radius: 8px;
  background: rgba(5, 12, 25, 0.78);
  color: #eef6ff;
  font-weight: 700;
}

.knowledge-search-row input::placeholder {
  color: #8ea0b8;
}

.knowledge-stats,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.knowledge-stats span,
.tag-row span {
  padding: 7px 10px;
  border: 1px solid rgba(147, 197, 253, 0.3);
  border-radius: 999px;
  color: #cfe2ff;
  background: rgba(37, 99, 235, 0.12);
  font-size: 13px;
  font-weight: 800;
}

.knowledge-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.8fr);
  gap: 18px;
}

.knowledge-side {
  display: grid;
  align-content: start;
  gap: 18px;
}

.knowledge-project-tree {
  display: grid;
  gap: 10px;
}

.knowledge-project-node {
  border: 1px solid rgba(147, 197, 253, 0.22);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(16, 31, 54, 0.96), rgba(12, 24, 43, 0.96));
  color: #d9e7fb;
}

.knowledge-project-node summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  cursor: pointer;
  list-style: none;
}

.knowledge-project-node summary::-webkit-details-marker {
  display: none;
}

.knowledge-project-node summary strong {
  display: block;
  color: #f7fbff;
  font-size: 17px;
}

body.knowledge-page-body .project-badge {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid rgba(147, 197, 253, 0.24);
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: #b9c8dd;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.knowledge-project-node summary small,
.knowledge-section-grid small,
.knowledge-row-link small {
  display: block;
  color: #aebed4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-node-body {
  display: grid;
  gap: 14px;
  padding: 0 14px 14px;
  border-top: 1px solid rgba(147, 197, 253, 0.16);
}

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

.knowledge-action-grid .ghost-button,
.knowledge-action-grid .button {
  justify-content: center;
}

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

.knowledge-section-grid div,
.knowledge-relation,
.knowledge-row-link {
  padding: 12px;
  border: 1px solid rgba(147, 197, 253, 0.2);
  border-radius: 8px;
  background: rgba(8, 18, 34, 0.62);
}

.knowledge-section-grid strong,
.knowledge-relation strong,
.knowledge-row-link span {
  color: #f0f7ff;
  font-weight: 900;
}

.knowledge-relation p {
  margin: 5px 0 0;
  color: #b8c7dd;
}

.knowledge-row-link {
  display: grid;
  gap: 4px;
  color: inherit;
  text-decoration: none;
}

.knowledge-row-link:hover {
  border-color: rgba(147, 197, 253, 0.54);
  background: rgba(20, 38, 66, 0.82);
  box-shadow: 0 10px 24px rgba(11, 99, 246, 0.14);
}

.knowledge-mini-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.model-pull-notice {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.model-pull-notice.started {
  border-color: rgba(74, 222, 128, 0.32);
}

.model-pull-notice.error {
  border-color: rgba(248, 113, 113, 0.38);
}

.model-pull-notice strong {
  color: #f7fbff;
}

.model-pull-notice p {
  margin: 0;
  color: #b8c7dd;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.model-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

.model-stat-grid .stat-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(147, 197, 253, 0.2);
  border-radius: 8px;
  background: rgba(8, 18, 34, 0.66);
}

.model-stat-grid .stat-card span {
  color: #93a8c4;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.model-stat-grid .stat-card strong {
  overflow: hidden;
  color: #f7fbff;
  font-size: 22px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-stat-grid .stat-card small {
  color: #b8c7dd;
  line-height: 1.35;
}

.model-pull-heading,
.model-pull-job-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.model-pull-job-list {
  display: grid;
  gap: 10px;
}

.model-pull-job {
  display: grid;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid rgba(147, 197, 253, 0.2);
  border-radius: 8px;
  background: rgba(8, 18, 34, 0.66);
}

.model-pull-job.succeeded {
  border-color: rgba(74, 222, 128, 0.3);
}

.model-pull-job.failed,
.model-pull-job.unknown {
  border-color: rgba(248, 113, 113, 0.34);
}

.model-pull-job-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-pull-job-row span {
  flex: 0 0 auto;
  color: #dbeafe;
  font-size: 12px;
  font-weight: 800;
}

.model-pull-job p {
  max-width: 100%;
  font-size: 13px;
}

.model-progress-track {
  height: 9px;
  overflow: hidden;
  border: 1px solid rgba(147, 197, 253, 0.22);
  border-radius: 999px;
  background: rgba(7, 18, 32, 0.86);
}

.model-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #38bdf8, #4ade80);
  transition: width 0.28s ease;
}

.model-progress-fill[style="width: 0%;"] {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.48), rgba(74, 222, 128, 0.48));
}

.model-recommendation-panel,
.model-defaults-panel,
.model-download-grid {
  margin-bottom: 18px;
}

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

.model-setup-grid article,
.model-download-card {
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(147, 197, 253, 0.2);
  border-radius: 8px;
  background: rgba(8, 18, 34, 0.62);
}

.model-setup-grid span,
.model-card-kicker {
  display: block;
  color: #93a8c4;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.model-setup-grid strong,
.model-download-card h3 {
  display: block;
  margin: 5px 0 0;
  color: #f7fbff;
}

.model-setup-grid p,
.model-download-card p {
  margin: 7px 0 0;
  color: #b8c7dd;
  line-height: 1.45;
}

.model-setup-grid code,
.model-download-card code {
  display: block;
  margin-top: 9px;
  overflow: hidden;
  color: #dbeafe;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.model-download-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.model-download-card.installed {
  border-color: rgba(74, 222, 128, 0.26);
}

.model-download-card.recommended {
  border-color: rgba(74, 222, 128, 0.36);
  background:
    radial-gradient(circle at 100% 0%, rgba(34, 197, 94, 0.14), transparent 32%),
    rgba(8, 18, 34, 0.72);
}

.model-card-role {
  display: block;
  margin-top: 4px;
  color: #c7d2fe;
  font-size: 13px;
}

.model-download-card form {
  margin: 0;
}

.model-download-card button,
.model-download-card .status-badge {
  white-space: nowrap;
}

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

.model-default-row {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(147, 197, 253, 0.2);
  border-radius: 8px;
  background: rgba(8, 18, 34, 0.62);
}

.model-default-row span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.model-default-row strong {
  color: #f7fbff;
  font-size: 15px;
}

.model-default-row small,
.model-default-actions p {
  color: #b8c7dd;
  line-height: 1.4;
}

.model-default-row select {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(147, 197, 253, 0.24);
  border-radius: 8px;
  padding: 10px;
  background: #071326;
  color: #f7fbff;
  font: inherit;
}

.model-default-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}

.model-default-actions p {
  margin: 0;
}

.model-learning-note {
  display: grid;
  gap: 5px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(147, 197, 253, 0.2);
  border-radius: 8px;
  background: rgba(8, 18, 34, 0.62);
}

.model-learning-note strong {
  color: #f7fbff;
}

.model-learning-note p {
  margin: 0;
  color: #b8c7dd;
}

.model-learning-note small {
  color: #93a8c4;
  line-height: 1.45;
}

.manual-builder-header {
  align-items: flex-start;
}

.manual-builder-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.manual-builder-tabs a,
.manual-project-card,
.manual-inventory-grid a,
.manual-export-list a {
  border: 1px solid rgba(147, 197, 253, 0.22);
  border-radius: 8px;
  background: rgba(8, 18, 34, 0.62);
  color: #dbeafe;
  text-decoration: none;
}

.manual-builder-tabs a {
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 800;
}

.manual-project-list,
.manual-card-list,
.manual-search-results,
.manual-export-list {
  display: grid;
  gap: 10px;
}

.manual-project-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px;
}

.manual-project-card strong,
.manual-card-list strong,
.manual-search-results strong {
  display: block;
  color: #f7fbff;
}

.manual-project-card span,
.manual-project-card small,
.manual-card-list small,
.manual-search-results span {
  display: block;
  margin-top: 4px;
  color: #93a8c4;
  font-size: 12px;
}

.manual-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 14px 0;
}

.manual-action-row form {
  margin: 0;
}

.manual-action-row.compact {
  margin-bottom: 0;
}

.manual-action-row.compact button,
.manual-action-row.compact .secondary-button {
  padding: 8px 10px;
  font-size: 12px;
}

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

.manual-stat-grid article,
.manual-card-list article,
.manual-search-results article {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(147, 197, 253, 0.2);
  border-radius: 8px;
  background: rgba(8, 18, 34, 0.62);
}

.manual-stat-grid span {
  display: block;
  color: #93a8c4;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.manual-stat-grid strong {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: #f7fbff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manual-inventory-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.manual-inventory-grid a {
  display: grid;
  gap: 4px;
  padding: 13px;
}

.manual-inventory-grid strong {
  color: #f7fbff;
  font-size: 24px;
}

.manual-inventory-grid span {
  color: #b8c7dd;
}

.manual-columns {
  align-items: start;
  margin-bottom: 18px;
}

.manual-card-list article p,
.manual-search-results article p {
  margin: 8px 0 0;
  color: #b8c7dd;
  line-height: 1.45;
}

.manual-review-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.manual-steps {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding-left: 20px;
  color: #b8c7dd;
}

.manual-steps li {
  line-height: 1.4;
}

.manual-steps code {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.manual-card-list textarea {
  width: 100%;
  resize: vertical;
}

.manual-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 14px;
}

.manual-export-list a,
.manual-export-list span {
  padding: 10px 12px;
}

.project-quality-strip,
.generation-status-grid {
  display: grid;
  gap: 8px;
}

.project-quality-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 10px;
  border: 1px solid #dbe8ff;
  border-radius: 8px;
  background: #f8fbff;
  margin: 10px 0;
}

.project-quality-strip span {
  color: #52627a;
  font-size: 12px;
}

.project-quality-strip strong {
  display: block;
  color: #071b46;
  font-size: 11px;
  text-transform: uppercase;
}

.project-quality-strip.clean {
  border-color: #b7f0cf;
  background: #f1fff7;
}

.project-quality-strip.warning {
  border-color: #fed7aa;
  background: #fff8ed;
}

.project-quality-strip.contaminated {
  border-color: #fecaca;
  background: #fff5f5;
}

.project-generation-panel {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.project-generation-panel.contaminated {
  border-color: #fca5a5;
  box-shadow: inset 4px 0 0 #dc2626;
}

.project-quality-control-panel {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.contract-mode-panel {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
  border-color: #bde9ff;
  background:
    radial-gradient(circle at top left, rgba(34, 211, 238, 0.12), transparent 42%),
    linear-gradient(180deg, #ffffff 0%, #f6fbff 100%);
}

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

.contract-mode-grid article {
  min-width: 0;
  padding: 14px;
  border: 1px solid #d6edff;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
}

.contract-mode-grid span,
.contract-mode-form label {
  display: block;
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.contract-mode-grid strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: #071b46;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contract-mode-grid p {
  margin: 6px 0 0;
  color: #52627a;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.contract-mode-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto auto;
  align-items: end;
  gap: 12px;
}

.contract-mode-form label > input {
  width: 100%;
  min-height: 42px;
  margin-top: 5px;
}

.contract-mode-form .inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.contract-mode-form .inline-check input {
  margin: 0;
}

.checker-mode-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border: 1px solid #bdd5ff;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
  box-shadow: 0 14px 36px rgba(23, 105, 255, 0.09);
}

.checker-mode-card.on {
  border-color: #86efac;
  box-shadow: inset 4px 0 0 #16a34a, 0 14px 36px rgba(23, 105, 255, 0.08);
}

.checker-mode-card.off {
  border-color: #fed7aa;
  background: linear-gradient(180deg, #fffaf2 0%, #fff7ed 100%);
  box-shadow: inset 4px 0 0 #f59e0b, 0 14px 36px rgba(245, 158, 11, 0.08);
}

.checker-mode-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #eaf2ff;
  color: #1769ff;
}

.checker-mode-card.on .checker-mode-icon {
  background: #dcfce7;
  color: #15803d;
}

.checker-mode-card.off .checker-mode-icon {
  background: #ffedd5;
  color: #c2410c;
}

.checker-mode-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.checker-mode-card h3 {
  color: #071b46;
  margin: 2px 0 4px;
}

.checker-mode-card h2 {
  color: #071b46;
  margin: 2px 0 4px;
}

.checker-mode-card p {
  margin: 0;
  color: #52627a;
}

.dashboard-checker-panel {
  margin-top: 18px;
  margin-bottom: 18px;
}

.mode-note {
  padding: 10px 12px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412 !important;
  font-weight: 760;
}

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

.quality-control-grid article,
.quality-correction-list article {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid #dbe8ff;
  border-radius: 8px;
  padding: 16px;
}

.quality-control-grid h3,
.quality-correction-list strong {
  color: #071b46;
  margin: 0 0 8px;
}

.quality-control-grid p,
.quality-correction-list p {
  color: #52627a;
  margin: 0 0 14px;
}

.quality-control-grid form {
  display: grid;
  gap: 10px;
}

.quality-correction-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.generation-status-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.generation-status-grid article {
  border: 1px solid #dbe8ff;
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.generation-status-grid span {
  color: #60708a;
  display: block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.generation-status-grid strong {
  color: #071b46;
  display: block;
  margin-top: 6px;
}

.danger-soft-button {
  align-items: center;
  background: #fff5f5;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  color: #b91c1c;
  cursor: pointer;
  display: inline-flex;
  font-weight: 900;
  gap: 8px;
  justify-content: center;
  padding: 12px 16px;
  text-decoration: none;
}

.danger-soft-button:hover {
  background: #fee2e2;
  border-color: #ef4444;
}

.work-explainer,
.technical-details {
  background: #f8fbff;
  border: 1px solid #dbe8ff;
  border-radius: 8px;
  color: #24405f;
  margin-top: 12px;
  padding: 12px;
}

.work-explainer p,
.technical-details p {
  margin: 0 0 8px;
}

.work-explainer p:last-child,
.technical-details p:last-child {
  margin-bottom: 0;
}

.technical-details summary {
  color: #0b63f6;
  cursor: pointer;
  font-weight: 800;
}

.worker-model-stack {
  display: grid;
  gap: 3px;
  min-width: 190px;
  font-size: 0.82rem;
  line-height: 1.25;
}

.worker-model-stack strong {
  color: var(--ink);
  font-weight: 900;
}

.worker-model-stack span {
  color: var(--muted);
}

.worker-model-stack small {
  color: var(--blue);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-mini-list {
  border-top: 1px solid #dbe8ff;
  counter-reset: queue-item;
  list-style: none;
  margin: 14px 0 0;
  padding: 10px 0 0;
}

.queue-mini-list li {
  align-items: center;
  counter-increment: queue-item;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 7px 0;
}

.queue-mini-list li::before {
  align-items: center;
  background: #eef5ff;
  border-radius: 999px;
  color: #0b63f6;
  content: counter(queue-item);
  display: inline-flex;
  flex: 0 0 24px;
  font-size: 12px;
  font-weight: 900;
  height: 24px;
  justify-content: center;
}

.queue-mini-list span {
  color: #071b46;
  flex: 1;
  font-weight: 800;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-mini-list small {
  color: #61708a;
  font-weight: 800;
}

@media (max-width: 980px) {
  .preview-layout {
    grid-template-columns: 1fr;
  }

  .preview-button-row,
  .projects-card .preview-control .preview-button-row {
    grid-template-columns: 1fr;
  }

  .preview-button,
  .preview-feedback summary {
    width: 100%;
  }

  .knowledge-layout,
  .knowledge-search-row,
  .knowledge-action-grid,
  .knowledge-section-grid,
  .model-stat-grid,
  .model-setup-grid,
  .model-default-grid,
  .model-download-card,
  .model-default-actions,
  .manual-stat-grid,
  .manual-inventory-grid,
  .manual-search-form,
  .checker-mode-card,
  .project-quality-strip,
  .generation-status-grid,
  .quality-control-grid,
  .quality-correction-list {
    grid-template-columns: 1fr;
  }
}

.idi-mode-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.idi-mode-choice-card {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border: 1px solid #c9dcff;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(15, 48, 107, 0.08);
  text-decoration: none;
  color: #071b46;
}

.idi-mode-choice-card:hover {
  border-color: #0b63f6;
  box-shadow: 0 18px 42px rgba(22, 101, 216, 0.14);
}

.idi-mode-choice-card strong {
  display: block;
  font-size: 20px;
  color: #071b46;
}

.idi-mode-choice-card p {
  grid-column: 2;
  margin: -4px 0 0;
  color: #61708a;
}

.mode-choice-icon {
  grid-row: span 2;
  width: 54px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #eff6ff;
  color: #0b63f6;
}

.mode-choice-icon svg,
.test-project-header .projects-title-icon svg,
.new-project-page .projects-title-icon svg,
.test-project-page .button-icon svg,
.test-project-page .side-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.test-project-page {
  display: grid;
  gap: 18px;
}

.test-project-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  gap: 18px;
}

.test-command-panel {
  overflow: hidden;
}

.test-command-chart .command-node.manager {
  max-width: 360px;
}

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

.test-workflow-panel article {
  align-items: start;
  background: #f8fbff;
  border: 1px solid #dbe8ff;
  border-radius: 8px;
  display: grid;
  gap: 6px;
  grid-template-columns: 36px minmax(0, 1fr);
  padding: 14px;
}

.test-workflow-panel article > span {
  align-items: center;
  background: #0b63f6;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-weight: 950;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.test-workflow-panel strong {
  color: #071b46;
  font-size: 15px;
}

.test-workflow-panel p {
  color: #52627a;
  grid-column: 2;
  line-height: 1.35;
  margin: 0;
}

.test-team-grid {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
}

.test-workers-panel {
  overflow: hidden;
}

.test-task-panel {
  overflow: hidden;
}

.test-task-card-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.test-task-card {
  border: 1px solid #dbe8ff;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(23, 105, 255, 0.06);
  overflow: hidden;
}

.test-task-card summary {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  list-style: none;
  min-height: 82px;
  padding: 13px 14px;
}

.test-task-card summary::-webkit-details-marker {
  display: none;
}

.test-task-card summary strong,
.test-task-card summary small {
  display: block;
}

.test-task-card summary strong {
  color: #071b46;
  font-size: 15px;
}

.test-task-card summary small {
  color: #52627a;
  line-height: 1.35;
  margin-top: 4px;
}

.test-task-card summary em {
  border-radius: 999px;
  color: #075be8;
  background: #eef5ff;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  padding: 6px 9px;
  white-space: nowrap;
}

.test-task-card[open] {
  border-color: #7fb0ff;
  box-shadow: 0 14px 30px rgba(23, 105, 255, 0.12);
}

.test-task-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #2b71ff;
}

.test-task-card.done .test-task-status-dot,
.test-task-card.done summary em {
  background: #dcfae6;
  color: #067647;
}

.test-task-card.waiting .test-task-status-dot {
  background: #f59e0b;
}

.test-task-card.waiting summary em {
  background: #fff3cd;
  color: #92400e;
}

.test-task-card.blocked .test-task-status-dot {
  background: #ef4444;
}

.test-task-card.blocked summary em {
  background: #fee2e2;
  color: #b42318;
}

.test-task-card-body {
  border-top: 1px solid #e4edff;
  display: grid;
  gap: 12px;
  padding: 12px 14px 14px;
}

.test-task-card-body dl {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.test-task-card-body dl div {
  border: 1px solid #e4edff;
  border-radius: 8px;
  background: #f8fbff;
  padding: 9px;
}

.test-task-card-body dt {
  color: #61708a;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.test-task-card-body dd {
  color: #071b46;
  font-weight: 850;
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}

.test-task-card-body p {
  color: #42526e;
  line-height: 1.45;
  margin: 0;
  white-space: pre-wrap;
}

.test-workers-table th:nth-child(3),
.test-workers-table td:nth-child(3) {
  min-width: 260px;
}

.test-workers-table th:nth-child(4),
.test-workers-table td:nth-child(4) {
  min-width: 260px;
}

.test-artifacts-panel {
  align-self: start;
}

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

.test-project-form label {
  display: grid;
  gap: 7px;
  color: #61708a;
  font-weight: 800;
}

.test-project-form label.full,
.test-engine-picker,
.test-project-submit {
  grid-column: 1 / -1;
}

.test-engine-picker {
  border: 0;
  display: grid;
  gap: 10px;
  margin: 0;
  min-width: 0;
  padding: 0;
}

.test-engine-picker legend {
  color: #071b46;
  font-size: 16px;
  font-weight: 950;
  margin-bottom: 8px;
}

.test-engine-options {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.test-engine-card {
  border: 1px solid #c9dcff;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  gap: 8px;
  padding: 12px;
  position: relative;
  background: #fff;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.test-engine-card input {
  height: 1px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  width: 1px;
}

.test-engine-card:hover,
.test-engine-card.selected,
.test-engine-card:has(input:checked) {
  background: #eef5ff;
  border-color: #0b63f6;
  box-shadow: 0 12px 28px rgba(22, 101, 216, 0.12);
}

.test-engine-card-head {
  align-items: start;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.test-engine-card strong {
  color: #071b46;
  font-size: 16px;
}

.test-engine-card em {
  background: #ecfdf3;
  border-radius: 999px;
  color: #067647;
  flex: 0 0 auto;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  padding: 4px 7px;
}

.test-engine-card small {
  color: #52627a;
  line-height: 1.35;
}

.test-project-form select,
.test-project-form input,
.test-project-form textarea {
  width: 100%;
  border: 1px solid #c9dcff;
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  color: #071b46;
  font: inherit;
}

.test-project-form textarea {
  resize: vertical;
}

.test-project-submit:disabled {
  cursor: wait;
  opacity: 0.72;
}

.test-run-status-card {
  display: grid;
  gap: 9px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #cfe0ff;
  border-radius: 8px;
  background: #f8fbff;
}

.test-engine-notice {
  border-color: #abefc6;
  background: #ecfdf3;
  color: #067647;
}

.test-run-status-card strong {
  color: #071836;
  line-height: 1.35;
}

.test-run-status-card p {
  margin: 0;
  color: #51617f;
  line-height: 1.45;
}

.test-findings-summary {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid #fedf89;
  border-radius: 8px;
  background: #fffbeb;
}

.test-findings-summary strong,
.test-findings-summary b {
  color: #93370d;
}

.inline-action-form {
  display: flex;
  margin: 0;
}

.inline-action-form .button {
  width: 100%;
  justify-content: center;
}

.test-output-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding-left: 0;
  list-style: none;
}

.test-output-list li {
  border: 1px solid #dbe8ff;
  border-radius: 8px;
  padding: 9px 10px;
  background: #f8fbff;
}

.test-artifact-list {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.test-artifact-list article,
.test-artifact-list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  padding: 12px;
  border: 1px solid #dbe8ff;
  border-radius: 8px;
  background: #fff;
  color: inherit;
  text-decoration: none;
}

.test-artifact-list article.done,
.test-artifact-list a.done {
  border-color: #b9efd2;
  background: #fbfffd;
}

.test-artifact-list a:hover {
  border-color: #7fb0ff;
  box-shadow: 0 12px 24px rgba(23, 105, 255, 0.1);
  transform: translateY(-1px);
}

.test-artifact-list strong {
  color: #071836;
}

.test-artifact-list span {
  color: #61708a;
  overflow-wrap: anywhere;
}

.test-artifact-list small {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  border-radius: 999px;
  padding: 5px 9px;
  color: #067647;
  background: #e8f8ef;
  font-weight: 850;
}

.test-artifact-list article.waiting small,
.test-artifact-list a.waiting small {
  color: #0b57d0;
  background: #eef5ff;
}

.test-run-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.test-run-list article {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid #dbe8ff;
  border-radius: 8px;
  background: #fff;
}

.test-run-list .ghost-button {
  margin: 6px 0 0;
  min-height: 36px;
  width: 100%;
}

.test-run-list code,
.test-run-success code {
  white-space: normal;
  overflow-wrap: anywhere;
}

.test-run-success dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 14px;
  margin: 10px 0 0;
}

.test-run-success dt {
  color: #61708a;
  font-weight: 800;
}

.test-report-view {
  display: grid;
  gap: 16px;
}

.test-report-header {
  align-items: center;
}

.test-report-document {
  max-width: 1100px;
}

.test-report-meta {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid #dbe8ff;
  border-radius: 8px;
  background: #f8fbff;
}

.test-report-meta strong {
  color: #071836;
  font-size: 16px;
}

.test-report-meta code {
  color: #52627a;
  white-space: normal;
  overflow-wrap: anywhere;
}

.test-report-content {
  max-width: 920px;
}

.test-report-content h3:first-child,
.test-report-content h4:first-child {
  margin-top: 0;
}

.test-project-page .project-notice {
  margin: 0;
}

@media (max-width: 980px) {
  .idi-mode-choice-grid,
  .test-workflow-panel,
  .test-project-grid,
  .test-team-grid,
  .test-engine-options,
  .test-project-form {
    grid-template-columns: 1fr;
  }

  .idi-mode-choice-card p {
    grid-column: 1 / -1;
  }

  .project-card-test-actions > div {
    grid-template-columns: 1fr;
  }
}

.writing-studio-heading {
  align-items: center;
}

.writing-studio-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr) minmax(240px, 320px);
  gap: 16px;
  align-items: start;
}

.writing-source-panel,
.writing-history-panel {
  position: sticky;
  top: 18px;
}

.writing-source-panel textarea {
  min-height: 180px;
  resize: vertical;
}

.goal-grid {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 12px;
  border: 1px solid #dbe8ff;
  border-radius: 8px;
  background: #f8fbff;
}

.goal-grid legend {
  padding: 0 6px;
  color: #071836;
  font-weight: 900;
}

.goal-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #263a58;
  font-weight: 750;
}

.writing-workspace {
  display: grid;
  gap: 16px;
}

.writing-three-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.writing-column {
  min-height: 520px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.writing-text-preview {
  flex: 1;
  max-height: 540px;
  overflow: auto;
  padding: 14px;
  border: 1px solid #dbe8ff;
  border-radius: 8px;
  background: #fbfdff;
  color: #10213f;
  font-size: 14px;
  line-height: 1.62;
  white-space: pre-wrap;
}

.writing-version {
  display: grid;
  gap: 12px;
}

.writing-version summary {
  cursor: pointer;
  padding: 12px;
  border: 1px solid #bfdbff;
  border-radius: 8px;
  color: #071836;
  font-weight: 900;
  background: #f8fbff;
}

.compact-form {
  padding: 12px;
  border: 1px solid #dbe8ff;
  border-radius: 8px;
  background: #ffffff;
}

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

.score-grid article {
  padding: 10px;
  border: 1px solid #dbe8ff;
  border-radius: 8px;
  background: #f8fbff;
}

.score-grid span {
  display: block;
  color: #61708a;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.score-grid strong {
  color: #075ee8;
  font-size: 20px;
}

.path-code {
  display: block;
  margin: 8px 0 12px;
  padding: 10px;
  border: 1px solid #dbe8ff;
  border-radius: 8px;
  color: #263a58;
  background: #f8fbff;
  white-space: normal;
  overflow-wrap: anywhere;
}

.writing-empty {
  min-height: 420px;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.writing-run-list {
  display: grid;
  gap: 10px;
}

.writing-run-card {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #dbe8ff;
  border-radius: 8px;
  background: #ffffff;
  color: #071836;
  text-decoration: none;
}

.writing-run-card:hover,
.writing-run-card:focus-visible {
  border-color: #7fb1ff;
  box-shadow: 0 8px 22px rgba(27, 102, 255, 0.12);
}

.writing-run-card span,
.writing-run-card small {
  color: #61708a;
}

.danger-notice {
  border-color: #fecaca;
  color: #7f1d1d;
  background: #fff7f7;
}

@media (max-width: 1250px) {
  .writing-studio-layout,
  .writing-three-columns {
    grid-template-columns: 1fr;
  }

  .writing-source-panel,
  .writing-history-panel {
    position: static;
  }
}

/* IDI global dark-blue system theme. Lexie is the visual model; every workspace now shares it. */
:root {
  --bg: #08111d;
  --panel: #111e33;
  --ink: #edf4ff;
  --muted: #aebbd0;
  --line: rgba(137, 161, 196, 0.22);
  --accent: #3b82f6;
  --blue: #4f8cff;
  --blue-soft: rgba(37, 99, 235, 0.14);
  --cyan: #38bdf8;
  --danger: #fb7185;
}

body:not(.login-body) {
  background:
    radial-gradient(circle at 76% 7%, rgba(50, 94, 185, 0.23), transparent 34%),
    radial-gradient(circle at 19% 20%, rgba(55, 65, 155, 0.16), transparent 28%),
    linear-gradient(180deg, #050b14 0%, #08111d 100%);
  color: #edf4ff;
}

body:not(.login-body) .shell {
  background: transparent;
}

body:not(.login-body) .main {
  background:
    radial-gradient(circle at 78% 12%, rgba(37, 99, 235, 0.13), transparent 32%),
    linear-gradient(180deg, #06101d 0%, #08111d 100%);
  color: #edf4ff;
}

body:not(.login-body) .nav {
  background:
    radial-gradient(circle at 46px 42px, rgba(62, 150, 255, 0.34), transparent 48px),
    linear-gradient(180deg, rgba(17, 28, 47, 0.98) 0%, rgba(9, 19, 35, 0.98) 100%);
  border-right: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 20px 0 70px rgba(0, 0, 0, 0.28);
}

body:not(.login-body) h1,
body:not(.login-body) h2,
body:not(.login-body) h3,
body:not(.login-body) h4,
body:not(.login-body) strong,
body:not(.login-body) label,
body:not(.login-body) th {
  color: #f8fbff;
}

body:not(.login-body) p,
body:not(.login-body) td,
body:not(.login-body) li,
body:not(.login-body) dd,
body:not(.login-body) .muted,
body:not(.login-body) .page-header p,
body:not(.login-body) .page-head p {
  color: #aebbd0;
}

body:not(.login-body) a {
  color: #9fc5ff;
}

body:not(.login-body) :where(
  .panel,
  .status-card,
  .page-card,
  .dashboard-card,
  .dashboard-panel,
  .evidence-card,
  .project-card,
  .project-selector-card,
  .project-notice,
  .project-attachment-strip,
  .checklist-item,
  .checklist-side-panel,
  .checklist-workspace-card,
  .review-panel,
  .worker-card,
  .compact-worker-card,
  .worker-status-strip div,
  .idi-metric-card,
  .metric-card,
  .side-insight-card,
  .intelligence-grid article,
  .mission-command,
  .mission-card,
  .gauge-card,
  .health-card,
  .model-card,
  .memory-card,
  .test-card,
  .test-report-card,
  .test-run-card,
  .writing-run-card,
  .writing-version summary,
  .writing-text-preview,
  .compact-form,
  .goal-grid,
  .score-grid article,
  .path-code,
  .floating-project-drawer,
  .floating-drawer-head,
  .attachment-chip,
  .attachment-menu,
  .message-attachment-card,
  .session-attachment-card
) {
  background: linear-gradient(180deg, rgba(24, 39, 64, 0.94), rgba(17, 30, 51, 0.94));
  border-color: rgba(137, 161, 196, 0.22);
  color: #edf4ff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

body:not(.login-body) :where(
  .panel,
  .status-card,
  .page-card,
  .dashboard-card,
  .dashboard-panel,
  .evidence-card,
  .project-card,
  .checklist-item,
  .worker-card,
  .idi-metric-card,
  .metric-card,
  .side-insight-card,
  .model-card,
  .memory-card,
  .test-card,
  .writing-run-card
) p,
body:not(.login-body) :where(
  .panel,
  .status-card,
  .page-card,
  .dashboard-card,
  .dashboard-panel,
  .evidence-card,
  .project-card,
  .checklist-item,
  .worker-card,
  .idi-metric-card,
  .metric-card,
  .side-insight-card,
  .model-card,
  .memory-card,
  .test-card,
  .writing-run-card
) span,
body:not(.login-body) :where(
  .panel,
  .status-card,
  .page-card,
  .dashboard-card,
  .dashboard-panel,
  .evidence-card,
  .project-card,
  .checklist-item,
  .worker-card,
  .idi-metric-card,
  .metric-card,
  .side-insight-card,
  .model-card,
  .memory-card,
  .test-card,
  .writing-run-card
) small {
  color: #aebbd0;
}

body:not(.login-body) :where(input, select, textarea) {
  background: rgba(9, 19, 35, 0.86);
  border-color: rgba(137, 161, 196, 0.28);
  color: #f8fbff;
}

body:not(.login-body) :where(input, select, textarea)::placeholder {
  color: #8090a8;
}

body:not(.login-body) :where(table, .table-wrap) {
  background: rgba(12, 22, 38, 0.62);
  border-color: rgba(137, 161, 196, 0.18);
  color: #edf4ff;
}

body:not(.login-body) :where(th, td) {
  border-color: rgba(137, 161, 196, 0.18);
}

body:not(.login-body) thead th {
  background: rgba(15, 27, 46, 0.86);
}

body:not(.login-body) :where(pre, code, .cli-panel, .test-report-content, .report-body) {
  background: rgba(6, 12, 22, 0.86);
  border-color: rgba(137, 161, 196, 0.2);
  color: #e5edf8;
}

body:not(.login-body) .button,
body:not(.login-body) button:not(.conversation-action-button) {
  background: linear-gradient(180deg, #3b82f6, #4f46e5);
  border: 1px solid rgba(147, 197, 253, 0.32);
  color: #ffffff;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.22);
}

body:not(.login-body) .secondary-button,
body:not(.login-body) .small-button,
body:not(.login-body) .filter-button,
body:not(.login-body) .view-button,
body:not(.login-body) .tab-button,
body:not(.login-body) .project-menu-button {
  background: rgba(24, 39, 64, 0.88);
  border: 1px solid rgba(137, 161, 196, 0.24);
  color: #dbe7f9;
  box-shadow: none;
}

body:not(.login-body) .button:hover,
body:not(.login-body) button:not(.conversation-action-button):hover,
body:not(.login-body) .secondary-button:hover,
body:not(.login-body) .small-button:hover {
  background: rgba(37, 99, 235, 0.34);
  color: #ffffff;
}

body:not(.login-body) .progress-bar,
body:not(.login-body) .metric-bar,
body:not(.login-body) .worker-progress,
body:not(.login-body) .test-progress {
  background: rgba(148, 163, 184, 0.22);
}

body:not(.login-body) .progress-bar span,
body:not(.login-body) .metric-bar span,
body:not(.login-body) .worker-progress span,
body:not(.login-body) .test-progress span {
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

body:not(.login-body) .status-badge,
body:not(.login-body) .status-pill,
body:not(.login-body) .phase-status {
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(96, 165, 250, 0.22);
  color: #b8d6ff;
}

body:not(.login-body) .status-badge.active,
body:not(.login-body) .status-badge.done,
body:not(.login-body) .status-badge.step_completed,
body:not(.login-body) .status-badge.worker_idle,
body:not(.login-body) .status-pill.verified,
body:not(.login-body) .phase-status {
  background: rgba(22, 163, 74, 0.14);
  border-color: rgba(74, 222, 128, 0.24);
  color: #86efac;
}

body:not(.login-body) .status-badge.paused,
body:not(.login-body) .status-badge.waiting,
body:not(.login-body) .status-badge.pending,
body:not(.login-body) .status-badge.waiting_for_approval,
body:not(.login-body) .status-pill.pending,
body:not(.login-body) .status-badge.medium {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(251, 191, 36, 0.26);
  color: #fcd58b;
}

body:not(.login-body) .status-badge.blocked,
body:not(.login-body) .status-badge.failed,
body:not(.login-body) .status-badge.step_blocked,
body:not(.login-body) .status-badge.step_failed,
body:not(.login-body) .status-badge.worker_busy,
body:not(.login-body) .status-badge.high,
body:not(.login-body) .danger-notice {
  background: rgba(244, 63, 94, 0.13);
  border-color: rgba(251, 113, 133, 0.28);
  color: #fda4af;
}

body:not(.login-body) .attention-panel,
body:not(.login-body) .attention-item.warning,
body:not(.login-body) .project-warning,
body:not(.login-body) .review-warning {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(251, 191, 36, 0.28);
  color: #fde68a;
}

body:not(.login-body) .success-panel,
body:not(.login-body) .attention-item.ok,
body:not(.login-body) .review-success {
  background: rgba(22, 163, 74, 0.13);
  border-color: rgba(74, 222, 128, 0.28);
  color: #86efac;
}

body:not(.login-body) .attention-item.critical,
body:not(.login-body) .checklist-item.blocked,
body:not(.login-body) .checklist-item.failed,
body:not(.login-body) .idi-metric-card.danger {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(251, 113, 133, 0.28);
}

body:not(.login-body) .checklist-item.done,
body:not(.login-body) .compact-worker-card.working {
  background: linear-gradient(180deg, rgba(22, 101, 52, 0.28), rgba(17, 30, 51, 0.94));
  border-color: rgba(74, 222, 128, 0.28);
}

body:not(.login-body) .idi-metric-card.warning,
body:not(.login-body) .compact-worker-card.waiting {
  background: linear-gradient(180deg, rgba(146, 64, 14, 0.2), rgba(17, 30, 51, 0.94));
  border-color: rgba(251, 191, 36, 0.24);
}

body:not(.login-body) :where(.dropdown-menu, .project-menu, .popover, .modal, .drawer, .floating-drawer-scroll) {
  background: #0f1b2e;
  border-color: rgba(137, 161, 196, 0.22);
  color: #edf4ff;
}

body:not(.login-body) .file-tile,
body:not(.login-body) .locked-status,
body:not(.login-body) .side-icon,
body:not(.login-body) .nav-icon {
  background: rgba(37, 99, 235, 0.15);
  color: #bfdbfe;
}

body:not(.login-body) .message-attachment-card img,
body:not(.login-body) .session-attachment-card img {
  background: #0b1424;
}

body:not(.login-body) .writing-text-preview,
body:not(.login-body) .test-report-content {
  line-height: 1.62;
}

body:not(.login-body) .score-grid strong,
body:not(.login-body) .metric-value,
body:not(.login-body) .score {
  color: #93c5fd;
}

body:not(.login-body) hr {
  border-color: rgba(137, 161, 196, 0.18);
}

body:not(.login-body) ::selection {
  background: rgba(96, 165, 250, 0.34);
  color: #ffffff;
}

/* Writing Studio dark workspace polish */
.writing-studio-heading {
  margin-bottom: 22px;
}

.writing-studio-heading h1 {
  font-size: clamp(34px, 4vw, 52px);
  letter-spacing: 0;
}

.writing-studio-heading .ghost-button {
  background: rgba(37, 99, 235, 0.18);
  border-color: rgba(96, 165, 250, 0.34);
  color: #dbeafe;
}

.writing-status-notice {
  align-items: center;
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.writing-toast {
  position: fixed;
  top: 18px;
  right: 24px;
  z-index: 100;
  max-width: min(420px, calc(100vw - 48px));
  padding: 13px 16px;
  border: 1px solid rgba(96, 165, 250, 0.36);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(24, 39, 64, 0.98), rgba(17, 30, 51, 0.98));
  color: #f8fbff;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.34);
  font-weight: 850;
}

.writing-studio-layout {
  grid-template-columns: minmax(330px, 390px) minmax(520px, 1fr) minmax(260px, 320px);
  gap: 18px;
}

.writing-source-panel,
.writing-history-panel,
.writing-empty,
.writing-run-summary,
.writing-column,
.writing-bottom-panel {
  border-radius: 16px;
}

.writing-source-panel {
  max-height: calc(100vh - 150px);
  overflow: auto;
}

.writing-source-panel .section-head {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(137, 161, 196, 0.16);
}

.writing-source-panel h2,
.writing-history-panel h2,
.writing-column h2,
.writing-empty h2 {
  font-size: 22px;
}

.writing-studio-form {
  gap: 14px;
}

.writing-studio-form label {
  display: grid;
  gap: 7px;
  color: #dbe7f9;
}

.writing-studio-form label > span {
  color: #dbe7f9;
  font-size: 13px;
  font-weight: 900;
}

.writing-studio-form input[type="file"] {
  min-height: 46px;
  padding: 10px;
}

.writing-studio-form textarea {
  min-height: 190px;
  resize: vertical;
}

.writing-studio-form textarea[name="custom_instructions"] {
  min-height: 104px;
}

.writing-analyze-state {
  align-items: center;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(96, 165, 250, 0.34);
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.14);
}

.writing-analyze-state[hidden],
.writing-toast[hidden],
.button-busy[hidden],
.button-text[hidden] {
  display: none !important;
}

.writing-analyze-state strong {
  display: block;
  margin-bottom: 3px;
}

.writing-analyze-state small {
  color: #aebbd0;
}

.writing-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(147, 197, 253, 0.25);
  border-top-color: #60a5fa;
  border-radius: 999px;
  animation: writingSpin 0.85s linear infinite;
}

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

.goal-grid {
  grid-template-columns: 1fr;
  gap: 7px;
  border-radius: 12px;
  padding: 14px;
}

.goal-grid legend {
  color: #f8fbff;
}

.goal-grid label {
  min-height: 32px;
  padding: 6px 8px;
  border-radius: 8px;
  color: #dbe7f9;
}

.goal-grid label:hover {
  background: rgba(59, 130, 246, 0.12);
}

.goal-grid input {
  accent-color: #60a5fa;
}

.writing-operation-grid {
  border-color: rgba(96, 165, 250, 0.34);
  background: rgba(37, 99, 235, 0.1);
}

.writing-operation-grid label:first-of-type,
.writing-operation-grid label:nth-of-type(2) {
  background: rgba(59, 130, 246, 0.18);
}

.writing-format-lock {
  display: grid;
  gap: 6px;
  padding: 13px 14px;
  border: 1px solid rgba(74, 222, 128, 0.28);
  border-radius: 12px;
  background: rgba(22, 163, 74, 0.12);
}

.writing-format-lock strong {
  color: #bbf7d0;
}

.writing-format-lock span {
  color: #c9d8ea;
  font-size: 13px;
  line-height: 1.4;
}

.writing-primary-action {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  margin-top: 4px;
}

.writing-primary-action:disabled {
  opacity: 0.78;
}

.writing-empty {
  min-height: 470px;
  padding: clamp(28px, 6vw, 70px);
  text-align: center;
}

.writing-empty-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 8px;
  border-radius: 18px;
  background: linear-gradient(180deg, #2f80ff, #463bd7);
  color: #ffffff;
  font-size: 24px;
  font-weight: 950;
  box-shadow: 0 16px 34px rgba(47, 128, 255, 0.24);
}

.writing-empty p {
  max-width: 760px;
}

.writing-step-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: min(760px, 100%);
  margin: 12px 0;
}

.writing-step-grid article {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 16px;
  border: 1px solid rgba(137, 161, 196, 0.2);
  border-radius: 14px;
  background: rgba(12, 22, 38, 0.48);
}

.writing-step-grid strong {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.2);
  color: #bfdbfe;
}

.writing-step-grid span {
  color: #dbe7f9;
  font-weight: 850;
}

.writing-run-summary {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 0;
}

.writing-run-summary h2 {
  margin-bottom: 4px;
}

.writing-run-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.writing-run-meta span {
  display: inline-flex;
  gap: 6px;
  min-height: 34px;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid rgba(96, 165, 250, 0.24);
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: #b8d6ff;
  font-size: 12px;
  font-weight: 850;
}

.writing-instruction-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 0;
}

.writing-instruction-summary div {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(137, 161, 196, 0.16);
  border-radius: 12px;
  background: rgba(6, 12, 22, 0.34);
}

.writing-instruction-summary strong {
  display: block;
  margin-bottom: 6px;
}

.writing-instruction-summary p {
  margin: 0;
  display: -webkit-box;
  max-height: 4.4em;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-height: 1.45;
}

.writing-three-columns {
  gap: 14px;
}

.writing-column {
  min-height: 560px;
}

.writing-text-preview {
  border-radius: 12px;
  background: rgba(6, 12, 22, 0.55);
  color: #e5edf8;
}

.writing-version summary {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.writing-run-card {
  border-radius: 12px;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.writing-run-card:hover,
.writing-run-card:focus-visible {
  background: rgba(37, 99, 235, 0.18);
  border-color: rgba(96, 165, 250, 0.54);
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.16);
}

@media (max-width: 1350px) {
  .writing-studio-layout {
    grid-template-columns: minmax(310px, 360px) minmax(0, 1fr);
  }

  .writing-history-panel {
    grid-column: 1 / -1;
    position: static;
  }
}

@media (max-width: 980px) {
  .writing-studio-layout,
  .writing-step-grid,
  .writing-run-summary,
  .writing-instruction-summary {
    grid-template-columns: 1fr;
  }

  .writing-run-summary {
    display: grid;
  }

  .writing-run-meta {
    justify-content: flex-start;
  }
}

/* Writing Studio dashboard reference layout */
.writing-studio-heading {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  max-width: 1500px;
}

.writing-studio-heading h1 {
  align-items: center;
  display: flex;
  gap: 12px;
}

.writing-title-icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(147, 197, 253, 0.26);
  background: rgba(15, 23, 42, 0.56);
  color: #f8fbff;
  font-size: 23px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.24);
}

.writing-studio-heading .header-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  min-width: min(690px, 100%);
}

.lexie-control-card {
  display: grid;
  gap: 5px;
  min-width: 175px;
  padding: 12px 14px;
  border: 1px solid rgba(137, 161, 196, 0.26);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(21, 34, 56, 0.86), rgba(13, 24, 42, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.lexie-control-card small,
.writing-user-chip small {
  color: #9fb0c7;
  font-weight: 750;
}

.lexie-control-card strong,
.writing-user-chip strong {
  color: #f8fbff;
}

.lexie-mini-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 6px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}

.lexie-mini-dot.purple {
  background: #8b5cf6;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.13);
}

.lexie-memory-active {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  min-height: 42px;
  padding: 0 15px;
  border-radius: 10px;
  background: rgba(22, 163, 74, 0.16);
  color: #86efac;
  font-weight: 900;
}

.lexie-memory-active span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
}

.writing-header-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(137, 161, 196, 0.24);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.54);
  color: #dbeafe;
  font-size: 20px;
}

.writing-user-chip {
  display: grid;
  gap: 2px;
}

.writing-ask-lexie {
  width: max-content;
  margin-top: 14px;
  min-height: 40px;
  padding-inline: 18px;
}

.writing-studio-dashboard {
  display: grid;
  gap: 16px;
  max-width: 1500px;
}

.writing-current-draft {
  align-items: center;
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  gap: 18px;
  min-height: 104px;
  padding: 20px 24px;
  border-radius: 16px;
}

.writing-draft-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(160deg, #3358e8, #6d5dfc);
  color: #eff6ff;
  font-size: 30px;
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.26);
}

.writing-current-draft h2 {
  margin: 2px 0 8px;
  color: #ffffff;
  font-size: 20px;
  line-height: 1.25;
}

.writing-current-draft p {
  margin: 0;
  color: #aebbd0;
}

.writing-current-draft .writing-run-meta {
  max-width: 260px;
}

.writing-current-draft .writing-run-meta span:last-child strong {
  color: #86efac;
}

.writing-studio-layout {
  display: grid;
  grid-template-columns: minmax(300px, 330px) minmax(620px, 1fr) minmax(310px, 330px);
  gap: 14px;
  align-items: start;
}

.writing-source-panel {
  max-height: none;
}

.writing-source-panel .section-head {
  border-bottom: 0;
  padding-bottom: 0;
}

.writing-source-panel textarea {
  background: rgba(6, 12, 22, 0.56);
}

.writing-upload-zone {
  position: relative;
  display: grid !important;
  place-items: center;
  min-height: 112px;
  padding: 18px;
  border: 1px dashed rgba(96, 165, 250, 0.46);
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.12), transparent 62%),
    rgba(6, 12, 22, 0.33);
  color: #e8f2ff;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
}

.writing-upload-zone:hover {
  border-color: rgba(147, 197, 253, 0.68);
  background: rgba(37, 99, 235, 0.12);
}

.writing-upload-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.writing-upload-zone strong {
  margin-top: 6px;
  font-size: 14px;
}

.writing-upload-zone small {
  color: #93c5fd;
  font-weight: 800;
}

.writing-upload-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #dbeafe;
  font-size: 25px;
}

.writing-workspace {
  display: grid;
  gap: 14px;
  min-width: 0;
}

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

.writing-document-grid .writing-column {
  min-height: 628px;
}

.writing-column h2 {
  margin-bottom: 10px;
}

.writing-column .muted {
  min-height: 36px;
}

.writing-text-preview {
  max-height: 455px;
  overflow: auto;
  padding: 16px;
  border: 1px solid rgba(137, 161, 196, 0.18);
  white-space: pre-wrap;
}

.writing-version {
  display: grid;
  gap: 12px;
}

.writing-version summary {
  width: max-content;
  max-width: 100%;
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.24);
  color: #dbeafe;
  font-weight: 900;
  cursor: pointer;
}

.writing-quality-gate {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.54);
  color: #dbeafe;
}

.writing-quality-gate strong {
  color: #f8fafc;
}

.writing-quality-gate span,
.writing-quality-gate small {
  color: #cbd5e1;
  line-height: 1.4;
}

.writing-quality-gate.gate-pass {
  border-color: rgba(34, 197, 94, 0.42);
  background: rgba(22, 101, 52, 0.18);
}

.writing-quality-gate.gate-fail {
  border-color: rgba(248, 113, 113, 0.56);
  background: rgba(127, 29, 29, 0.26);
}

.writing-version .compact-form {
  margin-top: 12px;
}

.writing-model-default,
.writing-saved-strip {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid rgba(96, 165, 250, 0.34);
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.14);
  color: #dbeafe;
}

.writing-model-default strong,
.writing-saved-strip strong {
  color: #f8fafc;
}

.writing-model-default span,
.writing-saved-strip span {
  color: #cbd5e1;
  overflow-wrap: anywhere;
}

.writing-processor-step {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(96, 165, 250, 0.34);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(8, 15, 28, 0.16)),
    rgba(15, 23, 42, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.writing-processor-step small {
  color: #93c5fd;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.writing-processor-step h3 {
  margin: 3px 0 4px;
  color: #f8fafc;
  font-size: 1.05rem;
}

.writing-processor-step p {
  margin: 0;
  color: #cbd5e1;
  line-height: 1.35;
}

.writing-processor-picker {
  display: grid;
  gap: 8px;
}

.writing-processor-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  align-items: start;
  padding: 11px 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.58);
  color: #dbeafe;
  cursor: pointer;
}

.writing-processor-card input {
  grid-row: span 2;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: #60a5fa;
}

.writing-processor-card strong {
  color: #f8fafc;
  line-height: 1.2;
}

.writing-processor-card span {
  color: #a8b6cc;
  line-height: 1.35;
}

.writing-processor-card.is-selected {
  border-color: rgba(96, 165, 250, 0.8);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.35), rgba(79, 70, 229, 0.18));
  box-shadow:
    0 0 0 1px rgba(96, 165, 250, 0.12),
    0 14px 30px rgba(37, 99, 235, 0.12);
}

.writing-options-opener {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(96, 165, 250, 0.38);
  border-radius: 14px;
  background: rgba(30, 64, 175, 0.18);
  color: #dbeafe;
  text-align: left;
  cursor: pointer;
}

.writing-options-opener:hover {
  border-color: rgba(147, 197, 253, 0.72);
  background: rgba(37, 99, 235, 0.24);
}

.writing-options-opener strong,
.writing-options-opener small {
  display: block;
}

.writing-options-opener strong {
  color: #f8fafc;
  line-height: 1.2;
}

.writing-options-opener small {
  margin-top: 4px;
  color: #a8b6cc;
  line-height: 1.35;
}

.writing-options-dialog {
  width: min(980px, calc(100vw - 40px));
  max-height: min(780px, calc(100vh - 50px));
  padding: 0;
  border: 1px solid rgba(96, 165, 250, 0.42);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(15, 32, 58, 0.98)),
    #0f172a;
  color: #e5eefb;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.48);
}

.writing-options-dialog::backdrop {
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(5px);
}

.writing-options-header,
.writing-options-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.writing-options-footer {
  justify-content: flex-end;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  border-bottom: 0;
}

.writing-options-header small {
  color: #93c5fd;
  font-weight: 800;
  text-transform: uppercase;
}

.writing-options-header h3 {
  margin: 4px 0;
  color: #f8fafc;
  font-size: 1.4rem;
}

.writing-options-header p {
  margin: 0;
  color: #a8b6cc;
}

.writing-options-header button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.72);
  color: #dbeafe;
  font-size: 1.35rem;
  cursor: pointer;
}

.writing-options-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-height: min(560px, calc(100vh - 230px));
  overflow: auto;
  padding: 20px;
}

.writing-options-body .goal-grid {
  max-height: none;
  overflow: visible;
}

.writing-saved-strip {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(22, 101, 52, 0.16);
}

.inline-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.inline-action-row .ghost-button,
.inline-action-row form {
  width: 100%;
}

.writing-side-rail {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 22px;
}

.writing-score-panel,
.writing-output-panel,
.writing-history-panel {
  border-radius: 16px;
}

.writing-score-panel h2,
.writing-output-panel h2 {
  margin-bottom: 18px;
}

.writing-score-ring {
  --score: 0;
  position: relative;
  display: grid;
  place-items: center;
  width: 126px;
  height: 126px;
  margin: 6px 0 18px;
  border-radius: 999px;
  background: conic-gradient(#4ade80 calc(var(--score) * 1%), rgba(148, 163, 184, 0.18) 0);
  box-shadow: 0 18px 46px rgba(34, 197, 94, 0.12);
}

.writing-score-ring::before {
  position: absolute;
  inset: 11px;
  content: "";
  border-radius: inherit;
  background: linear-gradient(180deg, #13223b, #0c1729);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.writing-score-ring strong,
.writing-score-ring span {
  position: relative;
  z-index: 1;
}

.writing-score-ring strong {
  color: #ffffff;
  font-size: 28px;
}

.writing-score-ring span {
  margin-top: -22px;
  color: #c5d1e2;
  font-weight: 800;
}

.writing-score-list {
  display: grid;
  gap: 0;
  margin-bottom: 18px;
}

.writing-score-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(137, 161, 196, 0.14);
}

.writing-score-list span {
  color: #c8d5e8;
  font-weight: 850;
}

.writing-score-list strong {
  color: #f8fbff;
}

.writing-output-panel .path-code {
  display: block;
  max-height: 118px;
  overflow: auto;
  margin: 12px 0 16px;
  padding: 14px;
  border: 1px solid rgba(137, 161, 196, 0.18);
  border-radius: 10px;
  background: rgba(2, 6, 14, 0.62);
  color: #dbeafe;
  white-space: pre-wrap;
  word-break: break-word;
}

.writing-output-panel .button {
  width: 100%;
}

.writing-history-panel {
  max-height: 430px;
  overflow: auto;
}

.writing-run-list {
  display: grid;
  gap: 9px;
}

.writing-run-card {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(137, 161, 196, 0.18);
  background: rgba(6, 12, 22, 0.34);
  color: inherit;
  text-decoration: none;
}

.writing-run-card strong {
  color: #f8fbff;
}

.writing-run-card span,
.writing-run-card small {
  color: #aebbd0;
}

.writing-lexie-composer {
  display: grid;
  gap: 10px;
  width: min(1260px, calc(100% - 52px));
  margin: 20px auto 0;
  padding: 18px;
  border: 1px solid rgba(137, 161, 196, 0.22);
  border-radius: 18px;
  background:
    radial-gradient(circle at 90% 0%, rgba(69, 56, 230, 0.16), transparent 38%),
    linear-gradient(180deg, rgba(22, 34, 55, 0.92), rgba(13, 23, 40, 0.94));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.writing-lexie-composer p {
  margin: 0;
  color: #dbe7f9;
  font-weight: 850;
}

.chat-composer-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chat-composer-toolbar .secondary-button {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 8px;
  color: #dbeafe;
  font-size: 12px;
}

.writing-lexie-input {
  align-items: center;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 92px;
  gap: 12px;
  min-height: 68px;
  padding: 10px 12px;
  border: 1px solid rgba(137, 161, 196, 0.22);
  border-radius: 15px;
  background: rgba(6, 12, 22, 0.44);
  color: inherit;
  text-decoration: none;
}

.writing-lexie-input span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(147, 197, 253, 0.34);
  border-radius: 999px;
  color: #93c5fd;
  font-size: 24px;
  font-weight: 600;
}

.writing-lexie-input strong {
  color: #9fb0c7;
  font-weight: 750;
}

.writing-lexie-input em {
  display: grid;
  place-items: center;
  min-height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #3358e8, #6d5dfc);
  color: #ffffff;
  font-style: normal;
  font-weight: 950;
  box-shadow: 0 15px 34px rgba(79, 70, 229, 0.28);
}

@media (max-width: 1420px) {
  .writing-studio-layout {
    grid-template-columns: minmax(300px, 330px) minmax(0, 1fr);
  }

  .writing-side-rail {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    position: static;
  }

  .writing-history-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1100px) {
  .writing-studio-heading {
    display: grid;
  }

  .writing-studio-heading .header-actions {
    justify-content: flex-start;
    min-width: 0;
  }

  .writing-studio-layout,
  .writing-document-grid,
  .writing-side-rail,
  .writing-current-draft {
    grid-template-columns: 1fr;
  }

  .writing-current-draft .writing-run-meta {
    max-width: none;
    justify-content: flex-start;
  }

  .writing-lexie-composer {
    width: 100%;
  }
}

/* Writing Studio usability corrections: prevent cramped and cut-off controls */
.writing-studio-dashboard,
.writing-studio-heading {
  width: min(100%, 1520px);
}

.writing-studio-layout {
  grid-template-columns: minmax(340px, 380px) minmax(620px, 1fr) minmax(300px, 340px);
}

.writing-source-panel {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 20px;
}

.writing-source-panel::-webkit-scrollbar,
.writing-text-preview::-webkit-scrollbar,
.goal-grid::-webkit-scrollbar,
.writing-history-panel::-webkit-scrollbar {
  width: 10px;
}

.writing-source-panel::-webkit-scrollbar-thumb,
.writing-text-preview::-webkit-scrollbar-thumb,
.goal-grid::-webkit-scrollbar-thumb,
.writing-history-panel::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(147, 197, 253, 0.36);
  background-clip: content-box;
}

.writing-studio-form {
  gap: 12px;
}

.writing-studio-form input,
.writing-studio-form textarea,
.writing-studio-form select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.writing-studio-form textarea {
  min-height: 128px;
}

.writing-studio-form textarea[name="custom_instructions"] {
  min-height: 88px;
}

.writing-studio-form label > span,
.writing-studio-form label {
  min-width: 0;
}

.writing-upload-zone {
  min-height: 104px;
}

.goal-grid {
  max-height: 290px;
  overflow: auto;
  align-content: start;
  padding: 12px;
}

.writing-operation-grid {
  max-height: 250px;
}

.goal-grid label,
.writing-studio-form .goal-grid label {
  display: grid !important;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-height: auto;
  padding: 9px 10px;
  line-height: 1.25;
  word-break: normal;
  overflow-wrap: anywhere;
}

.goal-grid input[type="checkbox"],
.writing-studio-form .goal-grid input[type="checkbox"] {
  width: 15px;
  height: 15px;
  min-width: 15px;
  margin: 1px 0 0;
}

.writing-operation-grid label:first-of-type,
.writing-operation-grid label:nth-of-type(2) {
  border: 1px solid rgba(96, 165, 250, 0.24);
}

.writing-format-lock {
  padding: 12px;
}

.writing-source-panel .muted {
  overflow-wrap: anywhere;
}

.writing-primary-action {
  position: sticky;
  bottom: 0;
  z-index: 2;
  box-shadow:
    0 -18px 0 14px rgba(22, 34, 55, 0.98),
    0 -12px 24px rgba(8, 15, 28, 0.62),
    0 16px 34px rgba(79, 70, 229, 0.24);
}

.writing-document-grid .writing-column {
  min-height: 600px;
}

.writing-column,
.writing-score-panel,
.writing-output-panel,
.writing-history-panel,
.writing-source-panel {
  min-width: 0;
}

.writing-text-preview {
  max-height: 440px;
  overflow-wrap: anywhere;
}

.writing-version .compact-form {
  gap: 11px;
}

.writing-version .compact-form input,
.writing-version .compact-form select {
  min-height: 42px;
}

.writing-side-rail {
  max-width: 100%;
}

.writing-score-panel p,
.writing-output-panel p,
.writing-history-panel p {
  overflow-wrap: anywhere;
}

.writing-lexie-composer {
  width: min(100%, 1260px);
}

@media (max-width: 1500px) {
  .writing-studio-layout {
    grid-template-columns: minmax(340px, 380px) minmax(0, 1fr);
  }

  .writing-side-rail {
    grid-column: 1 / -1;
    grid-template-columns: minmax(280px, 0.75fr) minmax(280px, 1fr);
  }
}

@media (max-width: 1180px) {
  .writing-studio-layout,
  .writing-document-grid,
  .writing-side-rail {
    grid-template-columns: 1fr;
  }

  .writing-source-panel,
  .writing-side-rail {
    position: static;
    max-height: none;
  }

  .goal-grid,
  .writing-operation-grid {
    max-height: none;
  }
}

/* Writing Studio vertical rhythm fixes */
.writing-studio-heading {
  margin-bottom: 18px;
}

.writing-studio-heading h1 {
  font-size: clamp(34px, 3.2vw, 44px);
  line-height: 1.05;
}

.writing-studio-heading p {
  max-width: 720px;
  margin-top: 10px;
  line-height: 1.35;
}

.writing-ask-lexie {
  margin-top: 10px;
}

.writing-current-draft {
  min-height: 94px;
  padding: 16px 22px;
}

.writing-draft-icon {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  font-size: 26px;
}

.writing-current-draft h2 {
  margin-bottom: 5px;
}

.writing-source-panel {
  max-height: 590px;
}

.writing-source-panel .section-head h2 {
  margin-bottom: 8px;
}

.writing-source-panel .section-head p {
  margin-bottom: 12px;
}

.writing-analyze-state {
  grid-template-columns: 34px minmax(0, 1fr);
  padding: 10px;
}

.writing-spinner {
  width: 26px;
  height: 26px;
}

.writing-upload-zone {
  min-height: 86px;
  padding: 14px;
}

.writing-studio-form textarea {
  min-height: 108px;
}

.writing-studio-form textarea[name="custom_instructions"] {
  min-height: 76px;
}

.goal-grid {
  max-height: 220px;
}

.writing-operation-grid {
  max-height: 200px;
}

.goal-grid label,
.writing-studio-form .goal-grid label {
  padding: 7px 9px;
}

.writing-format-lock {
  font-size: 13px;
}

.writing-primary-action {
  min-height: 44px;
  margin-bottom: -2px;
}

.writing-column h2,
.writing-score-panel h2,
.writing-output-panel h2,
.writing-history-panel h2,
.writing-source-panel h2 {
  font-size: 22px;
}

@media (min-height: 1150px) {
  .writing-source-panel {
    max-height: 720px;
  }
}

/* Writing Studio focused workspace */
.writing-studio-heading {
  margin-bottom: 16px;
}

.writing-studio-heading .writing-ask-lexie {
  display: none;
}

.writing-studio-dashboard {
  min-height: calc(100vh - 210px);
}

.writing-studio-layout {
  min-height: calc(100vh - 260px);
  align-items: stretch;
}

.writing-source-panel {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 290px);
  min-height: 620px;
  max-height: none;
  overflow: auto;
}

.writing-source-panel .section-head {
  flex: 0 0 auto;
}

.writing-studio-form {
  flex: 1 1 auto;
  min-height: 0;
}

.writing-empty {
  display: grid;
  align-content: center;
  min-height: calc(100vh - 310px);
}

.writing-side-rail {
  align-self: start;
}

.writing-analyze-state {
  align-items: start;
  grid-template-columns: 34px minmax(0, 1fr);
}

.writing-progress-track {
  display: block;
  width: 100%;
  height: 8px;
  margin-top: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(147, 197, 253, 0.16);
}

.writing-progress-track span {
  display: block;
  width: 8%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #38bdf8, #4f46e5, #8b5cf6);
  box-shadow: 0 0 18px rgba(96, 165, 250, 0.52);
  transition: width 0.55s ease;
}

.writing-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 7px;
  color: #b8c8de;
  font-size: 12px;
  font-weight: 850;
}

.writing-progress-meta span:last-child {
  color: #93c5fd;
  font-variant-numeric: tabular-nums;
}

.writing-live-work {
  margin-top: 12px;
  padding: 12px 13px;
  border: 1px solid rgba(147, 197, 253, 0.24);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(15, 23, 42, 0.36)),
    rgba(2, 6, 23, 0.24);
}

.writing-live-work strong {
  display: block;
  color: #f8fbff;
  font-size: 13px;
  line-height: 1.35;
}

.writing-live-work small {
  display: block;
  margin-top: 4px;
  color: #b8c8de;
  line-height: 1.45;
}

.writing-live-work pre {
  max-height: 150px;
  margin: 9px 0 0;
  padding: 10px 11px;
  overflow: auto;
  white-space: pre-wrap;
  border: 1px solid rgba(147, 197, 253, 0.16);
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.42);
  color: #dbeafe;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

@media (max-width: 1180px) {
  .writing-source-panel,
  .writing-empty {
    height: auto;
    min-height: 0;
  }

  .writing-studio-layout,
  .writing-studio-dashboard {
    min-height: 0;
  }
}

/* Keep Writing Studio side-by-side on normal desktop widths */
@media (min-width: 1281px) {
  .writing-studio-layout {
    grid-template-columns: minmax(300px, 330px) minmax(440px, 1fr) minmax(260px, 300px);
  }

  .writing-side-rail {
    grid-column: auto;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1280px) and (min-width: 1181px) {
  .writing-studio-layout {
    grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
  }

  .writing-side-rail {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* IDI Dashboard v2: dark command-center layout */
.idi-dashboard-v2 {
  --dash-bg: #07111f;
  --dash-card: rgba(17, 31, 52, 0.84);
  --dash-card-strong: rgba(24, 43, 70, 0.92);
  --dash-line: rgba(119, 156, 210, 0.22);
  --dash-line-bright: rgba(93, 143, 255, 0.44);
  --dash-text: #f5f8ff;
  --dash-soft: #aebbd0;
  --dash-muted: #8290a8;
  --dash-blue: #2f80ff;
  --dash-indigo: #6b5cff;
  --dash-green: #32d583;
  --dash-orange: #fb923c;
  --dash-red: #f05252;
  max-width: 1180px;
  margin: 0 auto;
  color: var(--dash-text);
}

.idi-dashboard-v2 svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.idi-dashboard-hero {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: flex-start;
  margin-bottom: 26px;
}

.dash-greeting {
  margin: 0 0 8px;
  color: #8d7cff;
  font-weight: 900;
}

.idi-dashboard-hero h1 {
  margin: 0 0 8px;
  color: #ffffff;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 0.98;
}

.idi-dashboard-hero p:not(.dash-greeting) {
  margin: 0;
  color: #d4deee;
  font-size: 17px;
}

.dash-hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dash-button,
.dash-wide-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--dash-line);
  border-radius: 9px;
  color: #f8fbff;
  text-decoration: none;
  font-weight: 900;
  background: linear-gradient(180deg, rgba(31, 48, 78, 0.92), rgba(16, 28, 48, 0.92));
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.18);
}

.dash-button.primary {
  border-color: rgba(118, 113, 255, 0.62);
  background: linear-gradient(135deg, #357bff, #604bff);
}

.dash-button:hover,
.dash-wide-link:hover {
  transform: translateY(-1px);
  border-color: rgba(147, 197, 253, 0.65);
}

.dash-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.dash-quick-card,
.dash-panel {
  border: 1px solid var(--dash-line);
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(27, 45, 74, 0.74), rgba(12, 25, 45, 0.84)),
    rgba(11, 21, 36, 0.76);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 20px 54px rgba(0, 0, 0, 0.18);
}

.dash-quick-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 84px;
  padding: 16px 18px;
  color: var(--dash-text);
  text-decoration: none;
}

.dash-quick-card strong,
.dash-quick-card small {
  display: block;
}

.dash-quick-card strong {
  font-size: 17px;
}

.dash-quick-card small {
  margin-top: 6px;
  color: var(--dash-soft);
  line-height: 1.35;
}

.dash-quick-card i {
  color: #9bb5d9;
  font-size: 28px;
  font-style: normal;
}

.dash-quick-icon,
.dash-section-icon,
.dash-metric-icon,
.dash-cody-icon,
.activity-dot {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.dash-quick-icon {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  color: #9fc3ff;
  background: rgba(42, 101, 215, 0.24);
}

.dash-quick-icon.indigo {
  color: #a9b6ff;
  background: rgba(77, 89, 255, 0.22);
}

.dash-quick-icon.purple {
  color: #d8b4fe;
  background: rgba(147, 51, 234, 0.22);
}

.dash-panel {
  padding: 20px;
}

.dash-health-panel,
.dash-cody-panel,
.dash-main-grid,
.dash-lower-grid {
  margin-bottom: 20px;
}

.dash-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.dash-section-head > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dash-section-head.compact {
  margin-bottom: 16px;
}

.dash-section-head h2,
.dash-cody-panel h2,
.dash-completed-card h2,
.dash-activity-card h2 {
  margin: 0;
  color: #f8fbff;
  font-size: 20px;
}

.dash-section-head p,
.dash-muted,
.dash-work-card p,
.dash-completed-card p,
.dash-activity-list p {
  color: var(--dash-soft);
}

.dash-section-head p {
  margin: 4px 0 0;
}

.dash-section-head a {
  color: #99b8ef;
  text-decoration: none;
  font-weight: 800;
}

.dash-section-icon {
  width: 32px;
  height: 32px;
  color: #8fb6ff;
  border-radius: 9px;
  background: rgba(52, 111, 255, 0.14);
}

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

.dash-metric-card {
  min-height: 176px;
  padding: 16px;
  border: 1px solid var(--dash-line);
  border-radius: 10px;
  background: rgba(7, 19, 36, 0.52);
}

.dash-metric-top {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.dash-metric-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #9ec4ff;
  background: rgba(47, 128, 255, 0.2);
}

.dash-metric-card.memory .dash-metric-icon {
  color: #fdba74;
  background: rgba(251, 146, 60, 0.18);
}

.dash-metric-card.disk .dash-metric-icon {
  color: #86efac;
  background: rgba(34, 197, 94, 0.16);
}

.dash-metric-card.queue .dash-metric-icon {
  color: #c084fc;
  background: rgba(168, 85, 247, 0.16);
}

.dash-metric-top strong {
  overflow: hidden;
  text-overflow: ellipsis;
  color: #f9fbff;
  white-space: nowrap;
}

.dash-metric-top em {
  padding: 4px 8px;
  border-radius: 999px;
  color: #86efac;
  background: rgba(34, 197, 94, 0.16);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.dash-metric-card.warning .dash-metric-top em {
  color: #fed7aa;
  background: rgba(251, 146, 60, 0.16);
}

.dash-metric-card.danger .dash-metric-top em {
  color: #fecaca;
  background: rgba(248, 113, 113, 0.16);
}

.dash-metric-value {
  margin-bottom: 4px;
  color: #ffffff;
  font-size: 38px;
  font-weight: 950;
  line-height: 1;
}

.dash-sparkline {
  display: block;
  width: 100%;
  height: 40px;
  margin: 6px 0 10px;
}

.dash-sparkline path {
  fill: none;
  stroke: #2f80ff;
  stroke-width: 4;
}

.dash-metric-card.memory .dash-sparkline path {
  stroke: #fb923c;
}

.dash-metric-card.disk .dash-sparkline path {
  stroke: #22c55e;
}

.dash-metric-card.queue .dash-sparkline path {
  stroke: #a855f7;
}

.dash-metric-card p {
  margin: 0;
  color: var(--dash-soft);
  font-size: 13px;
  line-height: 1.45;
}

.dash-cody-panel {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  border-left: 3px solid #22c55e;
}

.dash-cody-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  color: #07111f;
  background: linear-gradient(135deg, #86efac, #22c55e);
}

.dash-cody-icon svg {
  width: 30px;
  height: 30px;
  stroke-width: 2.4;
}

.dash-cody-panel p {
  margin: 6px 0 0;
  color: var(--dash-soft);
}

.dash-cody-toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 132px;
  min-height: 44px;
  padding: 0 14px 0 18px;
  border: 1px solid var(--dash-line-bright);
  border-radius: 999px;
  color: #d7e3f6;
  background: rgba(8, 18, 33, 0.68);
  box-shadow: none;
}

.dash-cody-toggle i {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.2);
}

.dash-cody-toggle i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #e5e7eb;
  transition: transform 0.18s ease;
}

.dash-cody-toggle.on i {
  background: rgba(34, 197, 94, 0.38);
}

.dash-cody-toggle.on i::after {
  transform: translateX(14px);
  background: #86efac;
}

.dash-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(310px, 0.75fr);
  gap: 16px;
}

.dash-process-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.dash-process-action {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  grid-template-areas:
    "icon title"
    "icon subtitle"
    "icon note";
  align-items: center;
  min-height: 104px;
  padding: 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  text-align: left;
  box-shadow: none;
}

.dash-process-action span {
  grid-area: icon;
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  color: #fff;
}

.dash-process-action span svg {
  width: 28px;
  height: 28px;
}

.dash-process-action strong {
  grid-area: title;
  color: #fff;
  font-size: 20px;
}

.dash-process-action small {
  grid-area: subtitle;
  color: #e5eefb;
  font-weight: 800;
}

.dash-process-action em {
  grid-area: note;
  color: rgba(230, 241, 255, 0.78);
  font-size: 12px;
  font-style: normal;
}

.dash-process-action.start {
  border-color: rgba(34, 197, 94, 0.35);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.38), rgba(9, 96, 70, 0.34));
}

.dash-process-action.start span {
  background: linear-gradient(135deg, #22c55e, #059669);
}

.dash-process-action.stop {
  border-color: rgba(248, 113, 113, 0.35);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.36), rgba(127, 29, 29, 0.3));
}

.dash-process-action.stop span {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.dash-process-note {
  margin: 16px 0 0;
  color: var(--dash-soft);
}

.dash-kv-list,
.dash-status-list,
.dash-service-details dl {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin: 0;
}

.dash-kv-list dt,
.dash-status-list dt,
.dash-service-details dt {
  color: var(--dash-muted);
  font-weight: 800;
}

.dash-kv-list dd,
.dash-status-list dd,
.dash-service-details dd {
  margin: 0;
  color: #f4f8ff;
  font-weight: 900;
  text-align: right;
  overflow-wrap: anywhere;
}

.dash-queue-list {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.dash-queue-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--dash-line);
  border-radius: 8px;
  color: #dbeafe;
  background: rgba(8, 18, 33, 0.42);
}

.dash-wide-link {
  width: 100%;
  margin-top: 16px;
  min-height: 40px;
}

.dash-lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.52fr) minmax(270px, 0.75fr);
  gap: 16px;
  align-items: stretch;
}

.dash-work-card {
  grid-column: 1 / 3;
}

.dash-activity-card {
  grid-column: 3;
  grid-row: 2 / span 1;
}

.dash-status-list dt {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dot,
.activity-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.dot.hollow {
  border: 2px solid #8fa4c7;
}

.dot.blue {
  background: #3b82f6;
}

.dot.green {
  background: #22c55e;
}

.dash-status-list .good {
  color: #35e58b;
}

.dash-service-details {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--dash-line);
}

.dash-service-details summary {
  color: #b7c6dd;
  cursor: pointer;
  font-weight: 900;
}

.dash-service-details dl {
  margin-top: 14px;
}

.dash-gauge-card {
  display: grid;
  align-content: center;
  text-align: center;
}

.dash-gauge {
  width: 150px;
  height: 150px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #102033 0 52%, transparent 53%),
    conic-gradient(from 230deg, #2f80ff 0deg, #59e093 calc(var(--gauge-value) * 1.8deg), rgba(75, 95, 128, 0.42) calc(var(--gauge-value) * 1.8deg), rgba(75, 95, 128, 0.42) 300deg, transparent 300deg);
}

.dash-gauge span,
.dash-gauge strong,
.dash-gauge small {
  grid-area: 1 / 1;
}

.dash-gauge span {
  transform: translateY(-18px);
  color: #d9f4ff;
}

.dash-gauge strong {
  transform: translateY(12px);
  color: #f8fbff;
  font-size: 24px;
}

.dash-gauge small {
  transform: translateY(42px);
  max-width: 82px;
  color: #c2d3eb;
  font-size: 12px;
  line-height: 1.2;
}

.dash-completed-card strong {
  display: block;
  margin: 12px 0;
  color: #fff;
  font-size: 64px;
  line-height: 0.92;
}

.dash-completed-card a {
  color: #78a6ff;
  text-decoration: none;
  font-weight: 900;
}

.dash-work-card p {
  margin: 12px 0 0;
}

.dash-work-card p span {
  float: right;
}

.dash-state-pill {
  padding: 7px 12px;
  border-radius: 999px;
  color: #fed7aa;
  background: rgba(251, 146, 60, 0.16);
  font-weight: 900;
}

.dash-state-pill.active {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.16);
}

.dash-work-list {
  padding: 14px 0;
  border-top: 1px solid var(--dash-line);
  border-bottom: 1px solid var(--dash-line);
}

.dash-progress {
  height: 12px;
  margin-top: 18px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(226, 232, 240, 0.84);
}

.dash-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #62a6ff, #8a6bff);
}

.dash-activity-list {
  display: grid;
  gap: 12px;
}

.dash-activity-list a,
.dash-empty-activity {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 4px 10px;
  color: #f7fbff;
  text-decoration: none;
}

.dash-activity-list strong,
.dash-empty-activity strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-activity-list small,
.dash-empty-activity small {
  justify-self: end;
  white-space: nowrap;
}

.dash-activity-list p,
.dash-empty-activity p {
  grid-column: 2 / -1;
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
}

.dash-activity-list small,
.dash-empty-activity small {
  color: var(--dash-muted);
  font-size: 12px;
}

.activity-dot {
  grid-row: 1 / span 2;
  width: 34px;
  height: 34px;
  background: rgba(34, 197, 94, 0.18);
}

.activity-dot::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
}

.activity-dot.dot-2::after {
  background: #3b82f6;
}

.activity-dot.dot-3::after {
  background: #8b5cf6;
}

.dash-footer {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 18px 0 0;
  color: #9aabc5;
}

.dash-footer strong {
  color: #32d583;
}

.dash-footer em {
  margin-left: auto;
  color: #d5def0;
  font-style: normal;
}

@media (max-width: 1240px) {
  .dash-health-grid,
  .dash-lower-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-work-card,
  .dash-activity-card {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 900px) {
  .idi-dashboard-hero,
  .dash-cody-panel {
    grid-template-columns: 1fr;
    display: grid;
  }

  .dash-hero-actions {
    justify-content: flex-start;
  }

  .dash-quick-grid,
  .dash-main-grid,
  .dash-health-grid,
  .dash-lower-grid,
  .dash-process-actions {
    grid-template-columns: 1fr;
  }
}

/* CPGee Modules dark library view */
.cpgee-page-v2 {
  --cpgee-bg: #06111f;
  --cpgee-panel: rgba(19, 34, 55, 0.88);
  --cpgee-panel-strong: rgba(24, 43, 69, 0.96);
  --cpgee-line: rgba(126, 166, 222, 0.28);
  --cpgee-line-strong: rgba(83, 137, 255, 0.58);
  --cpgee-text: #f7fbff;
  --cpgee-muted: #b8c8df;
  --cpgee-soft: #8fa4c1;
  --cpgee-blue: #2e7cff;
  max-width: 1220px;
  margin: 0 auto;
  color: var(--cpgee-text);
}

.cpgee-page-v2 *,
.cpgee-page-v2 *::before,
.cpgee-page-v2 *::after {
  box-sizing: border-box;
}

.cpgee-page-v2 svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.cpgee-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.cpgee-title-wrap {
  display: flex;
  gap: 16px;
  align-items: center;
  min-width: 0;
}

.cpgee-title-icon,
.cpgee-summary-icon,
.cpgee-reuse-icon,
.cpgee-module-icon,
.cpgee-rule-row > span {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.cpgee-title-icon {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  color: #c8e3ff;
  background: linear-gradient(145deg, #1e57d7, #16358d);
  box-shadow: 0 16px 38px rgba(41, 108, 255, 0.24);
}

.cpgee-title-wrap h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1;
}

.cpgee-title-wrap p {
  margin: 8px 0 0;
  color: var(--cpgee-muted);
  font-size: 16px;
}

.cpgee-json-button,
.cpgee-reuse-panel header a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(82, 139, 255, 0.76);
  border-radius: 8px;
  color: #eef6ff;
  background: linear-gradient(145deg, rgba(22, 38, 61, 0.9), rgba(10, 24, 42, 0.88));
  text-decoration: none;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

.cpgee-json-button:hover,
.cpgee-reuse-panel header a:hover {
  border-color: #75a7ff;
  background: rgba(40, 83, 160, 0.35);
}

.cpgee-summary-bar,
.cpgee-tools,
.cpgee-reuse-panel,
.cpgee-module-card,
.cpgee-empty {
  border: 1px solid var(--cpgee-line);
  border-radius: 8px;
  background:
    radial-gradient(circle at top left, rgba(55, 112, 209, 0.16), transparent 42%),
    linear-gradient(145deg, rgba(20, 37, 61, 0.92), rgba(9, 23, 40, 0.9));
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.22);
}

.cpgee-summary-bar {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(300px, 1.8fr) minmax(220px, 0.8fr);
  gap: 0;
  align-items: stretch;
  min-height: 72px;
  margin-bottom: 20px;
  overflow: hidden;
}

.cpgee-summary-item {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 16px 18px;
  border-right: 1px solid rgba(126, 166, 222, 0.2);
}

.cpgee-summary-item:last-child {
  border-right: 0;
}

.cpgee-summary-item small {
  display: block;
  margin-bottom: 4px;
  color: var(--cpgee-soft);
  font-size: 12px;
  font-weight: 900;
}

.cpgee-summary-item strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cpgee-summary-item b {
  margin-left: auto;
  color: #fff;
  font-size: 32px;
  line-height: 1;
}

.cpgee-summary-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: #9ec3ff;
  background: rgba(54, 108, 207, 0.24);
}

.cpgee-tools {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 220px auto;
  gap: 14px;
  align-items: center;
  padding: 0;
  margin-bottom: 18px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.cpgee-search,
.cpgee-select {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--cpgee-line);
  border-radius: 8px;
  color: #9ab5d7;
  background: rgba(9, 22, 38, 0.92);
}

.cpgee-search input,
.cpgee-select select {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: #f8fbff;
  background: transparent;
  font: inherit;
}

.cpgee-search input::placeholder {
  color: #98a9c0;
}

.cpgee-select select {
  appearance: none;
  cursor: pointer;
  font-weight: 800;
}

.cpgee-view-toggle {
  display: inline-flex;
  gap: 6px;
}

.cpgee-view-toggle button {
  width: 48px;
  height: 48px;
  border: 1px solid var(--cpgee-line);
  border-radius: 8px;
  color: #9fc3ff;
  background: rgba(13, 27, 48, 0.92);
  cursor: pointer;
}

.cpgee-view-toggle button.active {
  color: #e8f2ff;
  border-color: var(--cpgee-line-strong);
  background: linear-gradient(145deg, #1f56d6, #183a99);
}

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

.cpgee-module-grid.list {
  grid-template-columns: 1fr;
}

.cpgee-module-card {
  min-height: 252px;
  padding: 18px;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.cpgee-module-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 156, 255, 0.76);
  background:
    radial-gradient(circle at top left, rgba(80, 138, 245, 0.2), transparent 48%),
    linear-gradient(145deg, rgba(24, 45, 74, 0.98), rgba(11, 25, 43, 0.94));
}

.cpgee-module-card[hidden] {
  display: none;
}

.cpgee-card-head {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 32px;
  gap: 14px;
  align-items: center;
}

.cpgee-card-head h2 {
  margin: 0;
  overflow: hidden;
  color: #fff;
  font-size: 20px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cpgee-card-head p {
  margin: 6px 0 0;
  overflow: hidden;
  color: var(--cpgee-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cpgee-menu-button {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(91, 142, 255, 0.38);
  border-radius: 8px;
  color: #d8e8ff;
  background: linear-gradient(145deg, rgba(82, 122, 255, 0.92), rgba(83, 70, 224, 0.88));
  cursor: pointer;
}

.cpgee-menu-button svg circle {
  fill: currentColor;
  stroke: none;
}

.cpgee-module-icon {
  width: 56px;
  height: 56px;
  border-radius: 8px;
}

.cpgee-module-icon.icon-cinema {
  color: #d4b5ff;
  background: rgba(126, 63, 255, 0.34);
}

.cpgee-module-icon.icon-facial-recognition {
  color: #74d7ff;
  background: rgba(21, 116, 212, 0.32);
}

.cpgee-module-icon.icon-gallery {
  color: #52eba5;
  background: rgba(25, 153, 98, 0.32);
}

.cpgee-module-icon.icon-payments-wallet {
  color: #ffa26f;
  background: rgba(195, 84, 36, 0.34);
}

.cpgee-module-icon.icon-qr-code {
  color: #64ecff;
  background: rgba(14, 150, 185, 0.28);
}

.cpgee-module-icon.icon-shared-media {
  color: #ffd66e;
  background: rgba(178, 124, 25, 0.3);
}

.cpgee-module-summary {
  min-height: 64px;
  margin: 18px 0 16px;
  color: #d5dfef;
  font-size: 15px;
  line-height: 1.48;
}

.cpgee-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 58px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(126, 166, 222, 0.18);
}

.cpgee-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  max-width: 100%;
  padding: 0 12px;
  border: 1px solid rgba(85, 139, 255, 0.28);
  border-radius: 6px;
  overflow: hidden;
  color: #9cc3ff;
  background: rgba(38, 96, 190, 0.18);
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cpgee-module-card:nth-child(3n) .cpgee-tags span,
.cpgee-module-card:nth-child(3n) .cpgee-status {
  color: #4ade80;
}

.cpgee-module-card:nth-child(3n + 1) .cpgee-tags span {
  color: #c4a6ff;
}

.cpgee-module-card:nth-child(3n + 2) .cpgee-tags span {
  color: #87c2ff;
}

.cpgee-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  color: #c9d7ea;
  font-weight: 800;
}

.cpgee-card-foot span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cpgee-card-foot svg {
  width: 17px;
  height: 17px;
}

.cpgee-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #24d26c;
}

.cpgee-status i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 18px currentColor;
}

.cpgee-module-grid.list .cpgee-module-card {
  min-height: 0;
}

.cpgee-module-grid.list .cpgee-card-head {
  grid-template-columns: 56px minmax(0, 1fr) 32px;
}

.cpgee-module-grid.list .cpgee-module-summary {
  min-height: 0;
}

.cpgee-empty {
  grid-column: 1 / -1;
  padding: 28px;
}

.cpgee-empty h2 {
  margin: 0 0 8px;
}

.cpgee-empty p {
  margin: 0;
  color: var(--cpgee-muted);
}

.cpgee-reuse-panel {
  margin-top: 18px;
  padding: 18px;
}

.cpgee-reuse-panel header {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.cpgee-reuse-icon {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  color: #b8ffd5;
  background: rgba(34, 197, 94, 0.28);
}

.cpgee-reuse-panel h2 {
  margin: 0;
  color: #fff;
  font-size: 20px;
}

.cpgee-reuse-panel p {
  margin: 6px 0 0;
  color: var(--cpgee-muted);
}

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

.cpgee-rule-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 24px;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 8px;
  border: 1px solid rgba(126, 166, 222, 0.16);
  border-radius: 8px;
  background: rgba(10, 25, 43, 0.56);
}

.cpgee-rule-row > span {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: #f0b4ff;
  background: rgba(185, 75, 230, 0.26);
}

.cpgee-rule-row.rule-2 > span {
  color: #9ec3ff;
  background: rgba(46, 124, 255, 0.26);
}

.cpgee-rule-row.rule-3 > span {
  color: #74f5ad;
  background: rgba(29, 160, 95, 0.26);
}

.cpgee-rule-row p {
  margin: 0;
  color: #e7effb;
  font-size: 14px;
  line-height: 1.4;
}

.cpgee-rule-row b {
  justify-self: center;
  color: #9bb7db;
  font-size: 24px;
  font-weight: 500;
}

.cpgee-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 18px 0 0;
  color: #9fb0c9;
}

.cpgee-footer strong {
  color: #32d583;
}

@media (max-width: 1120px) {
  .cpgee-summary-bar,
  .cpgee-module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cpgee-summary-item.path {
    grid-column: 1 / -1;
    border-top: 1px solid rgba(126, 166, 222, 0.2);
  }
}

@media (max-width: 820px) {
  .cpgee-hero,
  .cpgee-reuse-panel header {
    grid-template-columns: 1fr;
    display: grid;
  }

  .cpgee-summary-bar,
  .cpgee-tools,
  .cpgee-module-grid {
    grid-template-columns: 1fr;
  }

  .cpgee-summary-item {
    border-right: 0;
    border-bottom: 1px solid rgba(126, 166, 222, 0.2);
  }

  .cpgee-summary-item:last-child {
    border-bottom: 0;
  }
}

/* Projects dark workspace */
.projects-page {
  --projects-panel: rgba(18, 34, 56, 0.9);
  --projects-line: rgba(126, 166, 222, 0.28);
  --projects-line-strong: rgba(75, 135, 255, 0.62);
  --projects-text: #f7fbff;
  --projects-muted: #b9c8df;
  --projects-soft: #8da1bc;
  max-width: 1220px;
  margin: 0 auto;
  color: var(--projects-text);
}

.projects-page *,
.projects-page *::before,
.projects-page *::after {
  box-sizing: border-box;
}

.projects-page svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.projects-page .projects-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 22px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.projects-page .projects-title-row {
  display: flex;
  gap: 16px;
  align-items: center;
  min-width: 0;
}

.projects-page .projects-title-row.compact {
  gap: 12px;
}

.projects-page .projects-title-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(88, 143, 255, 0.42);
  border-radius: 8px;
  color: #cde6ff;
  background: linear-gradient(145deg, #1d56d4, #15398e);
  box-shadow: 0 16px 38px rgba(40, 108, 255, 0.24);
}

.projects-page .projects-title-icon.small {
  width: 42px;
  height: 42px;
  color: #a9ceff;
  background: rgba(35, 91, 181, 0.34);
}

.projects-page .projects-header h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(36px, 4vw, 46px);
  line-height: 1;
}

.projects-page .projects-header p,
.projects-page .muted {
  margin: 8px 0 0;
  color: var(--projects-muted);
}

.projects-page .projects-header-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 12px;
}

.projects-page .button,
.projects-page .ghost-button,
.projects-page .cody-toggle,
.projects-page .icon-button,
.projects-page .danger-soft-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(84, 139, 255, 0.44);
  border-radius: 8px;
  color: #f5f9ff;
  background: rgba(14, 29, 50, 0.9);
  text-decoration: none;
  font-weight: 900;
  font-size: 14px;
  cursor: pointer;
}

.projects-page .button,
.projects-page .project-filter-chip.active {
  border-color: rgba(95, 143, 255, 0.82);
  background: linear-gradient(145deg, #2f7cff, #503ce8);
  box-shadow: 0 18px 44px rgba(47, 124, 255, 0.22);
}

.projects-page .ghost-button:hover,
.projects-page .cody-toggle:hover,
.projects-page .icon-button:hover {
  border-color: rgba(114, 168, 255, 0.86);
  background: rgba(43, 82, 149, 0.34);
}

.projects-page .cody-toggle.active,
.projects-page .cody-toggle:disabled {
  opacity: 1;
  border-color: rgba(96, 165, 250, 0.72);
  background: rgba(38, 86, 173, 0.32);
}

.projects-page .projects-control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  padding: 16px;
  border: 1px solid var(--projects-line);
  border-radius: 8px;
  background:
    radial-gradient(circle at top left, rgba(55, 112, 209, 0.14), transparent 42%),
    linear-gradient(145deg, rgba(20, 37, 61, 0.94), rgba(9, 23, 40, 0.92));
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.24);
}

.projects-page .project-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.projects-page .project-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--projects-line);
  border-radius: 8px;
  color: #eaf3ff;
  background: rgba(12, 27, 47, 0.9);
  font-weight: 900;
  cursor: pointer;
}

.projects-page .project-filter-chip:not(.active) {
  background: rgba(12, 27, 47, 0.9);
  box-shadow: none;
}

.projects-page .project-filter-chip strong {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border-radius: 999px;
  color: #fff;
  background: rgba(98, 154, 255, 0.24);
}

.projects-page .project-filter-chip.active-state strong {
  color: #062814;
  background: #79f2a8;
}

.projects-page .project-filter-chip.paused-state strong {
  color: #2f1700;
  background: #fbbf24;
}

.projects-page .project-filter-chip.not-init-state strong {
  color: #190d3d;
  background: #c4b5fd;
}

.projects-page .project-filter-chip.completed-state strong {
  background: rgba(70, 132, 255, 0.68);
}

.projects-page .project-view-control {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--projects-muted);
}

.projects-page .icon-button {
  width: 44px;
  min-height: 44px;
  padding: 0;
}

.projects-page .icon-button.active {
  border-color: var(--projects-line-strong);
  background: linear-gradient(145deg, #1f56d6, #513fe8);
}

.projects-page .project-card-grid.projects-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.projects-page .project-card-grid.projects-card-grid.list-view {
  grid-template-columns: 1fr;
}

.projects-page .project-status-card {
  position: relative;
  min-height: 372px;
  padding: 24px;
  border: 1px solid var(--projects-line);
  border-radius: 8px;
  overflow: visible;
  color: var(--projects-text);
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.16), transparent 42%),
    linear-gradient(145deg, rgba(20, 37, 61, 0.96), rgba(8, 22, 39, 0.94));
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.26);
}

.projects-page .project-status-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: 8px 0 0 8px;
  background: #f59e0b;
}

.projects-page .project-status-card.active::before,
.projects-page .project-status-card.completed::before {
  background: #22c55e;
}

.projects-page .project-status-card.not-initialized::before {
  background: #94a3b8;
}

.projects-page .project-status-card[hidden] {
  display: none;
}

.projects-page .project-status-card > header {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.projects-page .project-card-icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  color: #9fc3ff;
  background: rgba(35, 91, 181, 0.34);
}

.projects-page .project-status-card.active .project-card-icon,
.projects-page .project-status-card.completed .project-card-icon {
  color: #73f2aa;
  background: rgba(34, 197, 94, 0.2);
}

.projects-page .project-status-card > header strong {
  display: block;
  margin-top: 58px;
  overflow: hidden;
  color: #fff;
  font-size: 24px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.projects-page .project-status-card > header span:not(.project-card-icon) {
  display: none;
}

.projects-page .project-card-menu {
  position: relative;
  justify-self: end;
  z-index: 5;
}

.projects-page .project-card-menu summary {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 30px;
  border: 1px solid rgba(91, 142, 255, 0.38);
  border-radius: 7px;
  color: #d8e8ff;
  background: linear-gradient(145deg, rgba(82, 122, 255, 0.64), rgba(83, 70, 224, 0.58));
  cursor: pointer;
  list-style: none;
  font-size: 0;
}

.projects-page .project-card-menu summary::before {
  content: "...";
  transform: translateY(-4px);
  font-size: 18px;
  letter-spacing: 1px;
}

.projects-page .project-card-menu summary::-webkit-details-marker {
  display: none;
}

.projects-page .project-card-menu-panel {
  position: absolute;
  top: 36px;
  right: 0;
  display: grid;
  min-width: 210px;
  padding: 8px;
  border: 1px solid var(--projects-line);
  border-radius: 8px;
  background: #0c192b;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.38);
}

.projects-page .project-card-menu-panel a,
.projects-page .project-card-menu-panel button {
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 6px;
  color: #eaf3ff;
  background: transparent;
  text-align: left;
  text-decoration: none;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.projects-page .project-card-menu-panel a:hover,
.projects-page .project-card-menu-panel button:hover {
  background: rgba(59, 130, 246, 0.18);
}

.projects-page .project-card-menu-panel .project-menu-danger {
  color: #fecaca;
}

.projects-page .project-rename-popover {
  position: absolute;
  top: 92px;
  right: 24px;
  z-index: 4;
}

.projects-page .project-rename-popover > summary {
  list-style: none;
}

.projects-page .project-rename-popover > summary::-webkit-details-marker {
  display: none;
}

.projects-page .project-rename-popover form {
  position: absolute;
  top: 52px;
  right: 0;
  display: grid;
  gap: 10px;
  width: 270px;
  padding: 14px;
  border: 1px solid var(--projects-line);
  border-radius: 8px;
  background: #0c192b;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.38);
}

.projects-page .project-rename-popover label {
  display: grid;
  gap: 6px;
  color: var(--projects-muted);
  font-size: 12px;
  font-weight: 900;
}

.projects-page .project-rename-popover input {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(126, 166, 222, 0.32);
  border-radius: 8px;
  color: #fff;
  background: rgba(5, 15, 28, 0.9);
  padding: 0 12px;
  font: inherit;
}

.projects-page .project-path {
  margin: 14px 0 26px;
  overflow: hidden;
  color: var(--projects-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.projects-page .project-quality-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 22px;
  border: 1px solid rgba(126, 166, 222, 0.22);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(7, 18, 32, 0.62);
}

.projects-page .project-quality-strip span {
  min-width: 0;
  padding: 12px 14px;
  border-right: 1px solid rgba(126, 166, 222, 0.18);
  overflow: hidden;
  color: #cbd8ea;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.projects-page .project-quality-strip span:last-child {
  border-right: 0;
}

.projects-page .project-quality-strip strong {
  display: block;
  margin: 0 0 4px;
  color: #eef6ff;
  font-size: 11px;
  text-transform: uppercase;
}

.projects-page .project-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.projects-page .project-card-row small,
.projects-page .project-status-card > small {
  color: var(--projects-muted);
}

.projects-page .status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(251, 191, 36, 0.48);
  border-radius: 8px;
  color: #ffd66e;
  background: rgba(180, 83, 9, 0.24);
  font-weight: 900;
}

.projects-page .status-badge.active {
  border-color: rgba(34, 197, 94, 0.5);
  color: #86efac;
  background: rgba(22, 101, 52, 0.28);
}

.projects-page .status-badge.completed {
  border-color: rgba(96, 165, 250, 0.55);
  color: #bfdbfe;
  background: rgba(29, 78, 216, 0.34);
}

.projects-page .status-badge.waiting,
.projects-page .status-badge.not-initialized {
  border-color: rgba(148, 163, 184, 0.38);
  color: #cbd5e1;
  background: rgba(71, 85, 105, 0.24);
}

.projects-page .mini-progress {
  height: 7px;
  margin: 14px 0 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(40, 58, 85, 0.92);
}

.projects-page .mini-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f80ff, #6b5cff);
}

.projects-page .project-card-action {
  width: 100%;
  margin-top: 20px;
  justify-content: center;
}

.projects-page .project-card-action .button-icon {
  margin-left: auto;
}

.projects-page .project-empty-note {
  color: var(--projects-muted);
}

.projects-page .project-card-test-actions {
  display: grid;
  gap: 12px;
  margin-top: 24px;
  padding: 14px;
  border: 1px solid rgba(126, 166, 222, 0.22);
  border-radius: 8px;
  background: rgba(7, 18, 32, 0.62);
}

.projects-page .project-card-test-actions > span {
  color: #d3dfef;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.projects-page .project-card-test-actions > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.projects-page .project-card-test-button {
  min-height: 46px;
  border-color: rgba(83, 139, 255, 0.36);
  color: #dceaff;
  background: rgba(28, 42, 74, 0.86);
}

.projects-page .project-card-test-button:nth-child(2) {
  color: #dacbff;
  background: rgba(74, 53, 130, 0.42);
}

.projects-page .project-card-test-button:hover {
  color: #fff;
  background: rgba(51, 92, 166, 0.62);
}

.projects-page .project-more-panel {
  margin-top: 14px;
}

.projects-page .project-more-panel > summary {
  list-style: none;
  cursor: pointer;
}

.projects-page .project-more-panel > summary::-webkit-details-marker {
  display: none;
}

.projects-page .project-more-panel[open] .project-more-icon {
  transform: rotate(180deg);
}

.projects-page .project-more-content {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.projects-page .preview-card {
  border-color: rgba(126, 166, 222, 0.24);
  background: rgba(7, 18, 32, 0.58);
}

.projects-overview-panel {
  margin-top: 8px;
  padding: 24px;
  border: 1px solid var(--projects-line);
  border-radius: 8px;
  background:
    radial-gradient(circle at top left, rgba(55, 112, 209, 0.16), transparent 42%),
    linear-gradient(145deg, rgba(20, 37, 61, 0.94), rgba(9, 23, 40, 0.92));
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.24);
}

.projects-overview-panel .section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.projects-overview-panel h2 {
  margin: 0;
  color: #fff;
  font-size: 22px;
}

.projects-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.projects-summary-card {
  display: grid;
  gap: 10px;
  min-height: 152px;
  padding: 16px;
  border: 1px solid var(--projects-line);
  border-radius: 8px;
  color: #f6fbff;
  background: rgba(11, 28, 50, 0.72);
  text-decoration: none;
}

.projects-summary-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.projects-summary-card small {
  color: var(--projects-muted);
}

.projects-tip {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  padding: 18px 22px;
  border: 1px solid var(--projects-line);
  border-radius: 8px;
  color: #dbe8fb;
  background: linear-gradient(145deg, rgba(23, 49, 84, 0.88), rgba(12, 30, 52, 0.92));
}

.projects-tip .button-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #79a9ff;
  background: rgba(47, 124, 255, 0.18);
}

.projects-tip p {
  margin: 0;
}

.projects-tip strong {
  color: #83aefe;
}

@media (max-width: 1180px) {
  .projects-page .projects-header,
  .projects-page .projects-control-bar,
  .projects-overview-panel .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .projects-page .projects-header-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .projects-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 940px) {
  .projects-page .project-card-grid.projects-card-grid,
  .projects-summary-grid {
    grid-template-columns: 1fr;
  }

  .projects-page .project-quality-strip,
  .projects-page .project-card-test-actions > div {
    grid-template-columns: 1fr;
  }

  .projects-page .project-quality-strip span {
    border-right: 0;
    border-bottom: 1px solid rgba(126, 166, 222, 0.18);
  }

  .projects-page .project-quality-strip span:last-child {
    border-bottom: 0;
  }
}

/* Project Tests dark workspace */
.test-project-page {
  --test-panel: rgba(18, 34, 56, 0.92);
  --test-line: rgba(126, 166, 222, 0.28);
  --test-line-strong: rgba(75, 135, 255, 0.62);
  --test-text: #f7fbff;
  --test-muted: #b9c8df;
  --test-soft: #8da1bc;
  max-width: 1220px;
  margin: 0 auto;
  color: var(--test-text);
}

.test-project-page *,
.test-project-page *::before,
.test-project-page *::after {
  box-sizing: border-box;
}

.test-project-page svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.test-project-page .projects-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.test-project-page .projects-title-row {
  display: flex;
  gap: 16px;
  align-items: center;
  min-width: 0;
}

.test-project-page .projects-title-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(88, 143, 255, 0.42);
  border-radius: 8px;
  color: #cde6ff;
  background: linear-gradient(145deg, #1d56d4, #15398e);
  box-shadow: 0 16px 38px rgba(40, 108, 255, 0.24);
}

.test-project-page .projects-header h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(36px, 4vw, 46px);
  line-height: 1;
}

.test-project-page .projects-header p,
.test-project-page .muted {
  margin: 8px 0 0;
  color: var(--test-muted);
}

.test-project-page .projects-header-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 12px;
}

.test-project-page .button,
.test-project-page .ghost-button,
.test-project-page .checklist-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(84, 139, 255, 0.44);
  border-radius: 8px;
  color: #f5f9ff;
  background: rgba(14, 29, 50, 0.9);
  text-decoration: none;
  font-weight: 900;
  cursor: pointer;
}

.test-project-page .button {
  border-color: rgba(95, 143, 255, 0.82);
  background: linear-gradient(145deg, #2f7cff, #503ce8);
  box-shadow: 0 18px 44px rgba(47, 124, 255, 0.22);
}

.test-project-page .ghost-button:hover,
.test-project-page .checklist-tab:hover {
  border-color: rgba(114, 168, 255, 0.86);
  background: rgba(43, 82, 149, 0.34);
}

.test-project-page .panel,
.test-project-page .project-notice,
.test-workflow-panel article,
.test-task-card,
.test-run-list article,
.test-artifact-list article,
.test-artifact-list a,
.test-run-status-card {
  border: 1px solid var(--test-line);
  border-radius: 8px;
  color: var(--test-text);
  background:
    radial-gradient(circle at top left, rgba(55, 112, 209, 0.14), transparent 42%),
    linear-gradient(145deg, rgba(20, 37, 61, 0.94), rgba(9, 23, 40, 0.92));
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.22);
}

.test-project-page .project-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  color: #dbeafe;
}

.test-project-page .project-notice strong {
  color: #fff;
}

.test-engine-notice {
  border-color: rgba(96, 165, 250, 0.34);
  background:
    radial-gradient(circle at left, rgba(59, 130, 246, 0.16), transparent 34%),
    rgba(13, 29, 50, 0.94);
}

.test-workflow-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.test-workflow-panel article {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px 14px;
  min-height: 136px;
  padding: 22px;
}

.test-workflow-panel article > span {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(145deg, #2f7cff, #5d49ee);
  font-size: 18px;
  font-weight: 950;
  box-shadow: 0 12px 28px rgba(47, 124, 255, 0.24);
}

.test-workflow-panel strong {
  color: #9cc7ff;
  font-size: 18px;
}

.test-workflow-panel p {
  grid-column: 2;
  margin: 0;
  color: #d5dfef;
  line-height: 1.6;
}

.test-command-panel {
  padding: 24px;
  overflow: hidden;
}

.test-command-panel .org-command-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 24px;
  align-items: start;
}

.test-command-chart .command-node,
.test-command-chart .command-worker-node,
.test-command-panel .command-summary-card {
  border-color: rgba(91, 142, 255, 0.38);
  color: #f5f9ff;
  background: linear-gradient(145deg, rgba(18, 42, 76, 0.96), rgba(10, 25, 45, 0.94));
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.24);
}

.test-command-chart .command-node.leader::before {
  content: "";
  display: block;
  width: 20px;
  height: 4px;
  margin: 0 auto 4px;
  border-radius: 999px;
  background: #fbbf24;
  line-height: 1;
}

.test-command-chart .command-line,
.test-command-chart .command-branch {
  background: #2f7cff;
}

.test-team-grid {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.test-command-chart .command-worker-node {
  min-height: 56px;
  border-radius: 8px;
}

.test-command-chart .command-worker-node strong {
  color: #f8fbff;
}

.test-command-chart .command-worker-node small {
  color: #9fc3ff;
}

.test-command-panel .command-summary-card {
  padding: 14px;
}

.test-command-panel .command-summary-card dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.test-command-panel .command-summary-card dt,
.test-command-panel .command-summary-card dd {
  margin: 0;
}

.test-command-panel .command-summary-card dt {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #d3dfef;
}

.test-command-panel .command-summary-card dd {
  justify-self: end;
  margin-top: -30px;
  min-width: 32px;
  padding: 3px 9px;
  border-radius: 8px;
  color: #eaf3ff;
  background: rgba(100, 116, 139, 0.28);
  text-align: center;
  font-weight: 950;
}

.test-task-panel {
  padding: 22px;
  overflow: hidden;
}

.test-project-page .section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.test-project-page h2 {
  margin: 0;
  color: #fff;
  font-size: 24px;
}

.test-task-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.test-task-card {
  min-height: 108px;
  overflow: hidden;
  box-shadow: none;
}

.test-task-card summary {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  min-height: 100px;
  padding: 14px;
  cursor: pointer;
  list-style: none;
}

.test-task-card summary::-webkit-details-marker {
  display: none;
}

.test-task-card summary strong {
  display: block;
  overflow: hidden;
  color: #c8ddff;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.test-task-card summary small {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  margin-top: 6px;
  overflow: hidden;
  color: #d2ddec;
  line-height: 1.35;
}

.test-task-card summary em {
  align-self: start;
  border-radius: 999px;
  padding: 4px 8px;
  color: #8df7b5;
  background: rgba(34, 197, 94, 0.2);
  font-size: 11px;
  font-style: normal;
  font-weight: 950;
  white-space: nowrap;
}

.test-task-card.waiting summary em {
  color: #c8d8ff;
  background: rgba(59, 130, 246, 0.18);
}

.test-task-card.blocked summary em {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.2);
}

.test-task-status-dot {
  width: 20px;
  height: 20px;
  border-radius: 7px;
  background: rgba(47, 124, 255, 0.22);
  position: relative;
}

.test-task-status-dot::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: #2f7cff;
}

.test-task-card.done .test-task-status-dot::after {
  background: #22c55e;
}

.test-task-card.blocked .test-task-status-dot::after {
  background: #ef4444;
}

.test-task-card[open] {
  border-color: rgba(96, 165, 250, 0.76);
  box-shadow: 0 14px 30px rgba(23, 105, 255, 0.12);
}

.test-task-card-body {
  display: grid;
  gap: 12px;
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(126, 166, 222, 0.2);
}

.test-task-card-body dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.test-task-card-body dl div {
  padding: 9px;
  border: 1px solid rgba(126, 166, 222, 0.2);
  border-radius: 8px;
  background: rgba(7, 18, 32, 0.62);
}

.test-task-card-body dt {
  color: var(--test-soft);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.test-task-card-body dd {
  margin: 3px 0 0;
  color: #fff;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.test-task-card-body p {
  margin: 0;
  color: #d4deed;
  line-height: 1.45;
  white-space: pre-wrap;
}

.workers-table-panel.test-workers-panel,
.test-project-form-panel,
.test-artifacts-panel,
.test-project-page > .panel:last-of-type {
  padding: 22px;
}

.test-activity-details {
  padding: 0;
  overflow: hidden;
}

.test-activity-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 0 22px;
  color: #f8fbff;
  cursor: pointer;
  list-style: none;
}

.test-activity-details > summary::-webkit-details-marker {
  display: none;
}

.test-activity-details > summary span {
  font-size: 20px;
  font-weight: 950;
}

.test-activity-details > summary small {
  color: #9fc3ff;
  font-weight: 900;
}

.test-activity-details-body {
  padding: 0 22px 22px;
}

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

.test-project-form label {
  display: grid;
  gap: 7px;
  color: #d4deed;
  font-weight: 800;
}

.test-project-form label.full,
.test-engine-picker,
.test-project-submit {
  grid-column: 1 / -1;
}

.test-engine-picker {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.test-engine-picker legend {
  margin-bottom: 8px;
  color: #fff;
  font-size: 16px;
  font-weight: 950;
}

.test-engine-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.test-engine-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(126, 166, 222, 0.28);
  border-radius: 8px;
  color: #eaf3ff;
  background: rgba(7, 18, 32, 0.62);
  cursor: pointer;
}

.test-engine-card:hover,
.test-engine-card.selected,
.test-engine-card:has(input:checked) {
  border-color: rgba(96, 165, 250, 0.78);
  background: rgba(37, 99, 235, 0.18);
}

.test-engine-card strong {
  color: #fff;
}

.test-engine-card em {
  color: #86efac;
  background: rgba(34, 197, 94, 0.18);
}

.test-engine-card small {
  color: var(--test-muted);
}

.test-project-form select,
.test-project-form input,
.test-project-form textarea {
  width: 100%;
  border: 1px solid rgba(126, 166, 222, 0.3);
  border-radius: 8px;
  padding: 11px 12px;
  background: rgba(5, 15, 28, 0.88);
  color: #fff;
  font: inherit;
}

.test-project-form textarea {
  resize: vertical;
}

.test-run-status-card {
  display: grid;
  gap: 9px;
  margin-top: 14px;
  padding: 12px;
  box-shadow: none;
}

.test-run-status-card strong {
  color: #fff;
}

.test-run-status-card p {
  margin: 0;
  color: var(--test-muted);
}

.test-findings-summary {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(251, 191, 36, 0.42);
  border-radius: 8px;
  background: rgba(180, 83, 9, 0.18);
}

.test-findings-summary strong,
.test-findings-summary b {
  color: #fbbf24;
}

.test-artifact-list {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.test-artifact-list article,
.test-artifact-list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  padding: 12px;
  color: #eaf3ff;
  text-decoration: none;
  box-shadow: none;
}

.test-artifact-list article:not(.done):not(.waiting),
.test-artifact-list a:not(.done):not(.waiting) {
  background: rgba(7, 18, 32, 0.62);
}

.test-artifact-list article.done,
.test-artifact-list a.done {
  background: rgba(22, 101, 52, 0.16);
  border-color: rgba(34, 197, 94, 0.3);
}

.test-artifact-list article.waiting,
.test-artifact-list a.waiting {
  background: rgba(37, 99, 235, 0.14);
}

.test-artifact-list strong {
  color: #fff;
}

.test-artifact-list span {
  color: var(--test-muted);
  overflow-wrap: anywhere;
}

.test-artifact-list small {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  border-radius: 999px;
  padding: 5px 9px;
  color: #86efac;
  background: rgba(34, 197, 94, 0.18);
  font-weight: 850;
}

.test-run-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.test-run-list article {
  display: grid;
  gap: 6px;
  padding: 14px;
  box-shadow: none;
}

.test-run-list article strong {
  color: #fff;
}

.test-run-list article span,
.test-run-list article small {
  color: var(--test-muted);
}

.test-run-list code,
.test-run-success code {
  color: #dbeafe;
  white-space: normal;
  overflow-wrap: anywhere;
}

.test-run-list .ghost-button {
  width: 100%;
  min-height: 38px;
  margin: 8px 0 0;
}

.test-project-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  gap: 18px;
}

.test-workers-panel {
  overflow: hidden;
}

.test-workers-table {
  color: #eaf3ff;
}

.test-workers-table th {
  color: #9fb4d0;
}

.test-workers-table td {
  border-color: rgba(126, 166, 222, 0.18);
}

@media (max-width: 1180px) {
  .test-project-page .projects-header,
  .test-project-page .section-head,
  .test-command-panel .org-command-layout {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .test-project-page .projects-header-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .test-task-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .test-workflow-panel,
  .test-task-card-grid,
  .test-project-grid,
  .test-project-form,
  .test-engine-options,
  .test-task-card-body dl {
    grid-template-columns: 1fr;
  }
}

/* Mission Control dark command-center workspace */
.mission-command-page {
  max-width: 1260px;
  margin: 0 auto;
  display: grid;
  gap: 16px;
  color: #edf4ff;
}

.mission-command-page .workers-command-header {
  margin-bottom: 0;
  align-items: center;
}

.mission-title-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mission-title-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  color: #93c5fd;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.34), rgba(30, 41, 59, 0.82));
  border: 1px solid rgba(96, 165, 250, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 28px rgba(37, 99, 235, 0.16);
}

.mission-command-page .workers-command-header h1 {
  font-size: 34px;
  letter-spacing: 0;
  margin: 0 0 6px;
}

.mission-command-page .workers-command-header p {
  color: #c3cee0;
  max-width: 720px;
}

.mission-command-page .workers-command-actions {
  gap: 10px;
}

.mission-command-page .workers-command-actions .ghost-button,
.mission-command-page .workers-command-actions .auto-refresh-dot,
.mission-command-page .workers-command-actions .icon-button {
  min-height: 46px;
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(24, 39, 64, 0.98), rgba(13, 25, 43, 0.98));
  border: 1px solid rgba(137, 161, 196, 0.26);
  color: #eaf2ff;
  box-shadow: none;
}

.mission-command-page .workers-command-actions .ghost-button,
.mission-command-page .workers-command-actions .auto-refresh-dot {
  padding: 0 16px;
}

.mission-command-page .workers-command-actions .auto-refresh-dot strong {
  color: #7ee787;
}

.mission-command-page .command-org-panel,
.mission-command-page .mission-worker-panel {
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.13), transparent 46%),
    linear-gradient(180deg, rgba(20, 34, 57, 0.94), rgba(11, 24, 42, 0.95));
  border: 1px solid rgba(137, 161, 196, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 22px 60px rgba(0, 0, 0, 0.2);
}

.mission-command-page .command-org-panel {
  padding: 18px 18px 14px;
}

.mission-command-page .org-command-layout {
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 20px;
  align-items: start;
}

.mission-command-page .org-command-chart {
  min-width: 0;
}

.mission-command-page .command-node {
  min-width: 270px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(16, 31, 53, 0.96), rgba(9, 21, 37, 0.96));
  border: 1px solid rgba(96, 165, 250, 0.36);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 12px 32px rgba(0, 0, 0, 0.2);
}

.mission-command-page .command-node.leader::before {
  width: 20px;
  height: 15px;
  margin-bottom: 0;
}

.mission-command-page .command-node strong {
  color: #f8fbff;
  font-size: 16px;
}

.mission-command-page .command-node span,
.mission-command-page .command-node.coordinator span,
.mission-command-page .command-node.manager span {
  color: #cbd7eb;
}

.mission-command-page .command-line {
  height: 23px;
  background: linear-gradient(180deg, #2f80ff, #60a5fa);
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.36);
}

.mission-command-page .command-branch {
  width: min(760px, 78%);
  height: 20px;
  border-color: #2f80ff;
  box-shadow: 0 -7px 18px rgba(37, 99, 235, 0.12);
}

.mission-command-page .command-team-grid {
  grid-template-columns: repeat(5, minmax(136px, 1fr));
  gap: 10px;
  max-width: 910px;
}

.mission-command-page .command-worker-node {
  min-height: 58px;
  padding: 10px 12px;
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(15, 30, 52, 0.98), rgba(9, 21, 37, 0.96));
  border: 1px solid rgba(96, 165, 250, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.mission-command-page .command-worker-node.working {
  border-color: rgba(96, 165, 250, 0.76);
  background: linear-gradient(180deg, rgba(30, 64, 122, 0.86), rgba(12, 30, 58, 0.94));
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.mission-command-page .command-worker-node.active {
  border-color: rgba(52, 211, 153, 0.42);
  background: linear-gradient(180deg, rgba(13, 54, 45, 0.76), rgba(10, 34, 37, 0.9));
}

.mission-command-page .command-worker-node strong {
  color: #eff6ff;
  font-size: 13px;
}

.mission-command-page .command-worker-node small {
  color: #93a4bc;
}

.mission-command-page .command-worker-node.working small {
  color: #bfdbfe;
}

.mission-command-page .worker-symbol {
  background: rgba(37, 99, 235, 0.16);
  color: #8ec5ff;
  border: 1px solid rgba(96, 165, 250, 0.12);
}

.mission-command-page .command-worker-node.active .worker-symbol {
  background: rgba(16, 185, 129, 0.16);
  color: #7ee787;
}

.mission-command-page .command-summary-card {
  border-radius: 10px;
  padding: 16px 18px;
  background: rgba(12, 25, 44, 0.82);
  border: 1px solid rgba(137, 161, 196, 0.26);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.mission-command-page .command-summary-card dl {
  gap: 0;
}

.mission-command-page .command-summary-card dt,
.mission-command-page .command-summary-card dd {
  min-height: 42px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(137, 161, 196, 0.14);
}

.mission-command-page .command-summary-card dt {
  color: #cbd7eb;
}

.mission-command-page .command-summary-card dd {
  justify-content: flex-end;
  color: #f8fbff;
  font-size: 16px;
}

.mission-command-page .command-summary-card dt:last-of-type,
.mission-command-page .command-summary-card dd:last-of-type {
  border-bottom: 0;
}

.mission-command-page .good-text {
  color: #86efac !important;
}

.mission-command-page .mission-worker-panel {
  padding: 18px;
}

.mission-command-page .workers-table-head {
  align-items: flex-start;
  margin-bottom: 16px;
}

.mission-command-page .workers-table-head h2 {
  font-size: 26px;
  margin-bottom: 6px;
}

.mission-command-page .workers-table-head .muted {
  color: #b7c4d7;
}

.mission-command-page .workers-filter-row .checklist-tab {
  min-height: 42px;
  border-radius: 9px;
  border: 1px solid rgba(137, 161, 196, 0.24);
  background: rgba(13, 25, 43, 0.92);
  color: #dce8fa;
  box-shadow: none;
}

.mission-command-page .workers-filter-row .checklist-tab strong {
  background: rgba(137, 161, 196, 0.12);
  color: #eaf2ff;
}

.mission-command-page .workers-filter-row .checklist-tab.active[data-worker-filter="active"] {
  background: rgba(6, 78, 59, 0.62);
  border-color: rgba(52, 211, 153, 0.28);
  color: #86efac;
}

.mission-command-page .workers-filter-row .checklist-tab.active[data-worker-filter="working"] {
  background: rgba(29, 78, 216, 0.62);
  border-color: rgba(96, 165, 250, 0.32);
  color: #dbeafe;
}

.mission-command-page .workers-filter-row .checklist-tab.active[data-worker-filter="waiting"] {
  background: rgba(88, 28, 135, 0.58);
  border-color: rgba(192, 132, 252, 0.3);
  color: #e9d5ff;
}

.mission-command-page .workers-table-toolbar {
  margin: 0 0 12px;
}

.mission-command-page .worker-group-control {
  min-height: 42px;
  border-radius: 9px;
  color: #cbd7eb;
  background: rgba(13, 25, 43, 0.92);
  border-color: rgba(137, 161, 196, 0.24);
}

.mission-command-page .worker-group-control span,
.mission-command-page .worker-group-control select {
  color: #eaf2ff;
}

.mission-command-page .workers-table-toolbar .icon-button {
  background: rgba(13, 25, 43, 0.92);
  border-color: rgba(137, 161, 196, 0.24);
  color: #b7c4d7;
}

.mission-command-page .workers-table-toolbar .icon-button.active {
  background: linear-gradient(180deg, #1d4ed8, #1e40af);
  border-color: rgba(147, 197, 253, 0.35);
  color: #ffffff;
}

.mission-command-page .table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid rgba(137, 161, 196, 0.18);
  background: rgba(5, 13, 24, 0.42);
}

.mission-command-page .workers-command-table {
  min-width: 1080px;
  width: 100%;
  border-collapse: collapse;
  background: transparent;
  color: #eaf2ff;
}

.mission-command-page .workers-command-table th {
  padding: 13px 12px;
  color: #cbd7eb;
  background: rgba(8, 18, 32, 0.72);
  border-bottom: 1px solid rgba(137, 161, 196, 0.18);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mission-command-page .workers-command-table td {
  padding: 14px 12px;
  vertical-align: top;
  color: #dbe7f9;
  border-bottom: 1px solid rgba(137, 161, 196, 0.12);
}

.mission-command-page .workers-command-table tr:last-child td {
  border-bottom: 0;
}

.mission-command-page .workers-command-table td:first-child {
  align-items: flex-start;
}

.mission-command-page .workers-command-table td:first-child strong {
  color: #f8fbff;
  line-height: 1.25;
}

.mission-command-page .worker-row-icon {
  background: rgba(219, 234, 254, 0.95);
  color: #2563eb;
}

.mission-command-page .worker-state-pill {
  min-width: 72px;
  justify-content: center;
  border-radius: 8px;
  padding: 6px 10px;
  color: #dbe7f9;
  background: rgba(71, 85, 105, 0.58);
  border-color: rgba(148, 163, 184, 0.18);
}

.mission-command-page .worker-state-pill.working {
  color: #dbeafe;
  background: #1d4ed8;
  border-color: rgba(147, 197, 253, 0.35);
}

.mission-command-page .worker-state-pill.active,
.mission-command-page .worker-state-pill.done {
  color: #bbf7d0;
  background: rgba(22, 101, 52, 0.72);
  border-color: rgba(74, 222, 128, 0.22);
}

.mission-command-page .worker-state-pill.waiting {
  color: #e9d5ff;
  background: rgba(109, 40, 217, 0.64);
  border-color: rgba(192, 132, 252, 0.22);
}

.mission-command-page .worker-state-pill.idle {
  color: #dbe7f9;
  background: rgba(71, 85, 105, 0.58);
}

.mission-command-page .worker-model-stack {
  color: #aebbd0;
  font-size: 12px;
}

.mission-command-page .worker-model-stack strong {
  color: #f8fbff;
}

.mission-command-page .worker-model-stack span,
.mission-command-page .worker-model-stack small {
  color: #b7c4d7;
}

.mission-command-page .mini-progress {
  height: 7px;
  width: 80px;
  margin-top: 6px;
  background: rgba(226, 232, 240, 0.78);
  border-radius: 999px;
  overflow: hidden;
}

.mission-command-page .mini-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #60a5fa, #2563eb);
}

.mission-command-page .row-menu {
  background: rgba(24, 39, 64, 0.9);
  border: 1px solid rgba(137, 161, 196, 0.18);
  color: #dbe7f9;
}

.mission-command-page .row-menu:hover {
  background: rgba(37, 99, 235, 0.22);
}

@media (max-width: 1180px) {
  .mission-command-page .org-command-layout {
    grid-template-columns: 1fr;
  }

  .mission-command-page .command-summary-card {
    width: 100%;
  }

  .mission-command-page .command-team-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .mission-command-page .workers-command-header,
  .mission-title-lockup,
  .mission-command-page .workers-table-head {
    align-items: stretch;
    flex-direction: column;
  }

  .mission-command-page .workers-command-actions,
  .mission-command-page .workers-filter-row,
  .mission-command-page .workers-table-toolbar {
    justify-content: flex-start;
  }

  .mission-command-page .command-team-grid {
    grid-template-columns: 1fr;
  }

  .mission-command-page .command-node {
    min-width: 0;
    width: 100%;
  }
}

.live-projects-page {
  display: grid;
  gap: 22px;
}

.live-projects-intro {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  padding: 0;
}

.live-projects-intro > div {
  background: rgba(15, 29, 51, 0.72);
  padding: 18px 20px;
}

.live-projects-intro strong {
  color: #f8fbff;
  display: block;
  margin-bottom: 6px;
}

.live-projects-intro p {
  color: #b7c4d7;
  margin: 0;
  overflow-wrap: anywhere;
}

.live-project-card .button {
  justify-content: center;
  margin-top: 18px;
  width: 100%;
}

.empty-state-panel {
  color: #b7c4d7;
  min-height: 240px;
}

.empty-state-panel h2 {
  color: #f8fbff;
  margin-top: 0;
}

@media (max-width: 900px) {
  .live-projects-intro {
    grid-template-columns: 1fr;
  }
}

/* Lexie visual contract shared across IDI pages. */
:root {
  --idi-bg-dark: #07101d;
  --idi-surface: rgba(17, 30, 51, 0.92);
  --idi-surface-strong: rgba(24, 39, 64, 0.96);
  --idi-surface-soft: rgba(12, 22, 38, 0.78);
  --idi-border: rgba(137, 161, 196, 0.24);
  --idi-border-strong: rgba(96, 165, 250, 0.62);
  --idi-border-purple: rgba(139, 92, 246, 0.58);
  --idi-text: #f8fbff;
  --idi-text-soft: #dbe7f9;
  --idi-muted-dark: #aebbd0;
  --idi-primary: linear-gradient(180deg, #4d67ff, #4f35d8);
  --idi-primary-hover: linear-gradient(180deg, #5f7dff, #5a46ea);
  --idi-ghost: linear-gradient(180deg, rgba(24, 39, 64, 0.92), rgba(13, 25, 43, 0.92));
  --idi-card: linear-gradient(180deg, rgba(24, 39, 64, 0.94), rgba(17, 30, 51, 0.94));
  --idi-card-radial: radial-gradient(circle at top left, rgba(59, 130, 246, 0.15), transparent 42%);
  --idi-card-shadow: 0 20px 58px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body:not(.login-body) {
  --bg: var(--idi-bg-dark);
  --panel: var(--idi-surface);
  --ink: var(--idi-text);
  --muted: var(--idi-muted-dark);
  --line: var(--idi-border);
  background:
    radial-gradient(circle at 72% 8%, rgba(37, 99, 235, 0.18), transparent 34%),
    radial-gradient(circle at 17% 15%, rgba(76, 29, 149, 0.12), transparent 30%),
    linear-gradient(180deg, #050b14 0%, #08111d 100%);
  color: var(--idi-text-soft);
}

body:not(.login-body) .main {
  background:
    radial-gradient(circle at 78% 12%, rgba(37, 99, 235, 0.14), transparent 32%),
    linear-gradient(180deg, #06101d 0%, #08111d 100%);
  color: var(--idi-text-soft);
}

body:not(.login-body) .panel,
body:not(.login-body) .status-card,
body:not(.login-body) .metric-card,
body:not(.login-body) .gauge-card,
body:not(.login-body) .ai-worker-card,
body:not(.login-body) .pipeline-stage,
body:not(.login-body) .pipeline-card,
body:not(.login-body) .kanban-column,
body:not(.login-body) .kanban-card,
body:not(.login-body) .project-status-card,
body:not(.login-body) .project-card,
body:not(.login-body) .test-task-card,
body:not(.login-body) .test-workflow-panel article,
body:not(.login-body) .test-run-status-card,
body:not(.login-body) .test-run-list article,
body:not(.login-body) .test-artifact-list article,
body:not(.login-body) .test-artifact-list a,
body:not(.login-body) .mission-command-page .command-org-panel,
body:not(.login-body) .mission-command-page .mission-worker-panel,
body:not(.login-body) .mission-command-page .command-node,
body:not(.login-body) .mission-command-page .command-worker-node,
body:not(.login-body) .mission-command-page .command-summary-card,
body:not(.login-body) .lexie-control-card,
body:not(.login-body) .lexie-context-panel,
body:not(.login-body) .lexie-sidebar.panel,
body:not(.login-body) .lexie-choice-card,
body:not(.login-body) .chat-bubble,
body:not(.login-body) .chat-composer,
body:not(.login-body) .writing-card,
body:not(.login-body) .writing-studio-card,
body:not(.login-body) .live-project-card,
body:not(.login-body) .live-projects-intro {
  background: var(--idi-card-radial), var(--idi-card);
  border: 1px solid var(--idi-border);
  border-radius: 14px;
  box-shadow: var(--idi-card-shadow);
  color: var(--idi-text-soft);
}

body:not(.login-body) .panel h1,
body:not(.login-body) .panel h2,
body:not(.login-body) .panel h3,
body:not(.login-body) .status-card strong,
body:not(.login-body) .metric-card strong,
body:not(.login-body) .gauge-card strong,
body:not(.login-body) .project-status-card strong,
body:not(.login-body) .project-card strong,
body:not(.login-body) .test-task-card strong,
body:not(.login-body) .chat-bubble strong,
body:not(.login-body) .lexie-choice-card strong {
  color: var(--idi-text);
}

body:not(.login-body) .button,
body:not(.login-body) button.button,
body:not(.login-body) .send-button,
body:not(.login-body) button[type="submit"]:not(.ghost-button):not(.quiet-button):not(.icon-button):not(.secondary-button):not(.cody-toggle):not(.checklist-tab):not(.danger-soft-button) {
  background: var(--idi-primary);
  border: 1px solid rgba(147, 197, 253, 0.36);
  border-radius: 10px;
  box-shadow: 0 14px 32px rgba(79, 70, 229, 0.28);
  color: #ffffff;
}

body:not(.login-body) .button:hover,
body:not(.login-body) button.button:hover,
body:not(.login-body) .send-button:hover,
body:not(.login-body) button[type="submit"]:not(.ghost-button):not(.quiet-button):not(.icon-button):not(.secondary-button):not(.cody-toggle):not(.checklist-tab):not(.danger-soft-button):hover {
  background: var(--idi-primary-hover);
  border-color: rgba(165, 202, 255, 0.56);
  box-shadow: 0 18px 38px rgba(79, 70, 229, 0.34);
  color: #ffffff;
}

body:not(.login-body) .ghost-button,
body:not(.login-body) .secondary-button,
body:not(.login-body) .icon-button,
body:not(.login-body) .quiet-button,
body:not(.login-body) .checklist-tab,
body:not(.login-body) .cody-toggle,
body:not(.login-body) .project-filter-chip,
body:not(.login-body) .side-card-button,
body:not(.login-body) .chat-composer-toolbar button,
body:not(.login-body) .lexie-message-actions button,
body:not(.login-body) .lexie-message-actions .secondary-button,
body:not(.login-body) .projects-page .ghost-button,
body:not(.login-body) .projects-page .cody-toggle,
body:not(.login-body) .projects-page .icon-button,
body:not(.login-body) .test-project-page .ghost-button,
body:not(.login-body) .mission-command-page .workers-command-actions .ghost-button,
body:not(.login-body) .mission-command-page .workers-command-actions .icon-button,
body:not(.login-body) .mission-command-page .workers-filter-row .checklist-tab,
body:not(.login-body) .mission-command-page .workers-table-toolbar .icon-button {
  background: var(--idi-ghost);
  border: 1px solid var(--idi-border);
  border-radius: 10px;
  box-shadow: none;
  color: var(--idi-text-soft);
}

body:not(.login-body) .ghost-button:hover,
body:not(.login-body) .secondary-button:hover,
body:not(.login-body) .icon-button:hover,
body:not(.login-body) .quiet-button:hover,
body:not(.login-body) .checklist-tab:hover,
body:not(.login-body) .cody-toggle:hover,
body:not(.login-body) .project-filter-chip:hover,
body:not(.login-body) .side-card-button:hover,
body:not(.login-body) .chat-composer-toolbar button:hover,
body:not(.login-body) .lexie-message-actions button:hover {
  background: linear-gradient(180deg, rgba(31, 54, 88, 0.94), rgba(20, 38, 66, 0.94));
  border-color: var(--idi-border-strong);
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.16);
  color: #ffffff;
}

body:not(.login-body) .project-filter-chip.active,
body:not(.login-body) .icon-button.active,
body:not(.login-body) .cody-toggle.active,
body:not(.login-body) .projects-page .project-filter-chip.active,
body:not(.login-body) .projects-page .icon-button.active,
body:not(.login-body) .mission-command-page .workers-table-toolbar .icon-button.active {
  background: var(--idi-primary);
  border-color: rgba(147, 197, 253, 0.48);
  box-shadow: 0 16px 34px rgba(79, 70, 229, 0.26);
  color: #ffffff;
}

body:not(.login-body) .lexie-choice-card:nth-child(even) {
  border-color: var(--idi-border-purple);
}

body:not(.login-body) .danger-soft-button,
body:not(.login-body) button.danger {
  background: linear-gradient(180deg, rgba(127, 29, 29, 0.82), rgba(69, 10, 10, 0.86));
  border-color: rgba(248, 113, 113, 0.36);
  color: #fecaca;
}

body:not(.login-body) input,
body:not(.login-body) select,
body:not(.login-body) textarea {
  background: rgba(7, 16, 31, 0.82);
  border: 1px solid rgba(137, 161, 196, 0.24);
  color: var(--idi-text);
}

body:not(.login-body) input::placeholder,
body:not(.login-body) textarea::placeholder {
  color: #7f8da3;
}

body:not(.login-body) table,
body:not(.login-body) .table-wrap {
  color: var(--idi-text-soft);
}

body:not(.login-body) th,
body:not(.login-body) td {
  border-bottom-color: rgba(137, 161, 196, 0.16);
}

body:not(.login-body) .muted,
body:not(.login-body) small,
body:not(.login-body) label,
body:not(.login-body) dt {
  color: var(--idi-muted-dark);
}

/* Dark-mode legacy sweep: keep older project/checklist pages aligned with Lexie. */
body:not(.login-body) :where(
  .project-selector-card,
  .message-attachment-card,
  .worker-status-strip div,
  .attachment-menu,
  .attachment-card,
  .advanced-drawer,
  .company-node,
  .org-node,
  .attention-item,
  .idi-metric-card,
  .compact-worker-card,
  .activity-card-list a,
  .daily-link-grid a,
  .checklist-summary-card,
  .checklist-item,
  .checklist-guidance,
  .checklist-review-panel,
  .review-summary-grid article,
  .review-ai-summary,
  .evidence-token,
  .missing-evidence-panel,
  .review-artifact-grid article,
  .approval-inline-details form,
  .advanced-evidence-editor,
  .evidence-card,
  .evidence-empty,
  .quality-correction-list article,
  .generation-status-grid article,
  .quality-control-grid article,
  .checker-mode-card,
  .project-generation-panel,
  .project-quality-control-panel,
  .side-insight-card,
  .action-required-panel,
  .floating-project-drawer,
  .floating-drawer-scroll,
  .intelligence-panel,
  .project-preview-panel,
  .preview-card,
  .live-console-grid article,
  .cli-panel,
  .console-details,
  .compact-table,
  .table-wrap
) {
  background: var(--idi-card-radial), var(--idi-card);
  border-color: var(--idi-border);
  color: var(--idi-text-soft);
}

body:not(.login-body) :where(
  .checklist-review-panel,
  .review-summary-grid article,
  .review-ai-summary,
  .evidence-token,
  .missing-evidence-panel,
  .review-artifact-grid article,
  .approval-inline-details form,
  .generation-status-grid article,
  .quality-control-grid article,
  .checker-mode-card,
  .side-insight-card,
  .action-required-panel,
  .floating-project-drawer,
  .compact-table,
  .table-wrap
) {
  border: 1px solid var(--idi-border);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

body:not(.login-body) :where(
  .checklist-item,
  .checklist-review-panel,
  .review-summary-grid article,
  .review-ai-summary,
  .evidence-token,
  .missing-evidence-panel,
  .review-artifact-grid article,
  .quality-control-grid article,
  .generation-status-grid article,
  .checker-mode-card
) :where(h1, h2, h3, h4, h5, strong) {
  color: var(--idi-text);
}

body:not(.login-body) :where(
  .review-panel-head span:first-child,
  .review-summary-grid span,
  .generation-status-grid span,
  .evidence-token p,
  .review-ai-summary p,
  .review-artifact-grid p,
  .review-artifact-grid ul,
  .missing-evidence-panel p,
  .quality-control-grid p,
  .checker-mode-card p,
  .checklist-guidance p,
  .checklist-item-head p,
  .evidence-empty,
  .advanced-evidence-editor summary
) {
  color: var(--idi-muted-dark);
}

body:not(.login-body) .review-summary-grid strong {
  color: #8fb9ff;
}

body:not(.login-body) .checklist-guidance,
body:not(.login-body) .checklist-guidance.running {
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.16), rgba(17, 30, 51, 0.9));
  border-color: rgba(96, 165, 250, 0.28);
}

body:not(.login-body) .checklist-guidance.waiting,
body:not(.login-body) .missing-evidence-panel {
  background: linear-gradient(180deg, rgba(146, 64, 14, 0.22), rgba(17, 30, 51, 0.94));
  border-color: rgba(251, 191, 36, 0.3);
  color: #fde68a;
}

body:not(.login-body) .checklist-guidance.blocked,
body:not(.login-body) .checklist-guidance.failed,
body:not(.login-body) .approval-inline-details.danger form {
  background: linear-gradient(180deg, rgba(127, 29, 29, 0.28), rgba(17, 30, 51, 0.94));
  border-color: rgba(248, 113, 113, 0.3);
}

body:not(.login-body) .checklist-guidance.done,
body:not(.login-body) .evidence-token.collected,
body:not(.login-body) .checker-mode-card.on {
  background: linear-gradient(180deg, rgba(22, 101, 52, 0.26), rgba(17, 30, 51, 0.94));
  border-color: rgba(74, 222, 128, 0.3);
}

body:not(.login-body) .checker-mode-card.off {
  background: linear-gradient(180deg, rgba(146, 64, 14, 0.18), rgba(17, 30, 51, 0.94));
  border-color: rgba(251, 191, 36, 0.26);
}

body:not(.login-body) .checklist-item {
  border-color: rgba(137, 161, 196, 0.2);
}

body:not(.login-body) .checklist-item.expanded,
body:not(.login-body) .checklist-item.running,
body:not(.login-body) .checklist-board-card .checklist-item.expanded {
  background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(25, 45, 76, 0.96), rgba(17, 30, 51, 0.96));
  border-color: rgba(96, 165, 250, 0.5);
  box-shadow: inset 4px 0 0 #3b82f6, 0 20px 48px rgba(0, 0, 0, 0.18);
}

body:not(.login-body) .checklist-item.done {
  background: linear-gradient(180deg, rgba(22, 101, 52, 0.22), rgba(17, 30, 51, 0.94));
  border-color: rgba(74, 222, 128, 0.32);
}

body:not(.login-body) .checklist-item.blocked,
body:not(.login-body) .checklist-item.failed {
  background: linear-gradient(180deg, rgba(127, 29, 29, 0.24), rgba(17, 30, 51, 0.94));
  border-color: rgba(248, 113, 113, 0.34);
}

body:not(.login-body) .locked-status,
body:not(.login-body) .locked-status.pending,
body:not(.login-body) .checklist-item.pending .locked-status,
body:not(.login-body) .checklist-item.waiting .locked-status,
body:not(.login-body) .checklist-item.running .locked-status {
  background: rgba(96, 165, 250, 0.15);
  border: 1px solid rgba(96, 165, 250, 0.24);
  color: #bfdbfe;
}

body:not(.login-body) .locked-status.verified {
  background: rgba(22, 163, 74, 0.16);
  border-color: rgba(74, 222, 128, 0.28);
  color: #86efac;
}

body:not(.login-body) .checklist-toggle-button,
body:not(.login-body) .approval-primary-button,
body:not(.login-body) .approval-inactive-button,
body:not(.login-body) .row-menu,
body:not(.login-body) .preview-control,
body:not(.login-body) .attachment-menu button {
  background: var(--idi-ghost);
  border: 1px solid var(--idi-border);
  border-radius: 10px;
  color: var(--idi-text-soft);
}

body:not(.login-body) .approval-primary-button,
body:not(.login-body) .review-action-row .approval-primary-button {
  background: var(--idi-primary);
  border-color: rgba(147, 197, 253, 0.42);
  box-shadow: 0 14px 32px rgba(79, 70, 229, 0.28);
  color: #ffffff;
}

body:not(.login-body) .checklist-toggle-button:hover,
body:not(.login-body) .row-menu:hover,
body:not(.login-body) .preview-control:hover,
body:not(.login-body) .attachment-menu button:hover {
  background: linear-gradient(180deg, rgba(31, 54, 88, 0.94), rgba(20, 38, 66, 0.94));
  border-color: var(--idi-border-strong);
  color: #ffffff;
}

body:not(.login-body) .evidence-token > span {
  background: rgba(148, 163, 184, 0.22);
  border: 1px solid rgba(203, 213, 225, 0.2);
  color: #dbe7f9;
}

body:not(.login-body) .evidence-token.collected > span {
  background: rgba(22, 163, 74, 0.26);
  border-color: rgba(74, 222, 128, 0.28);
  color: #86efac;
}

body:not(.login-body) .evidence-token.needs_review > span,
body:not(.login-body) .evidence-token.missing > span {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(251, 191, 36, 0.28);
  color: #fde68a;
}

body:not(.login-body) .active-project-chip,
body:not(.login-body) .worker-state-pill,
body:not(.login-body) .worker-row-icon,
body:not(.login-body) .side-icon,
body:not(.login-body) .side-icon.pulse,
body:not(.login-body) .side-icon.people,
body:not(.login-body) .side-icon.bell,
body:not(.login-body) .side-icon.info {
  background: rgba(96, 165, 250, 0.14);
  border-color: rgba(96, 165, 250, 0.22);
  color: #bfdbfe;
}

body:not(.login-body) .mode-note {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.28);
  border-radius: 10px;
  color: #fde68a;
}

body:not(.login-body) .compact-table th,
body:not(.login-body) .workers-command-table th {
  color: #dbe7f9;
}

body:not(.login-body) .compact-table td,
body:not(.login-body) .workers-command-table td {
  color: #b7c4d7;
}

body:not(.login-body) .project-rename-form input,
body:not(.login-body) .inline-rename-form input,
body:not(.login-body) .worker-group-control select {
  background: rgba(7, 16, 31, 0.84);
  border-color: rgba(137, 161, 196, 0.26);
  color: var(--idi-text);
}

body:not(.login-body) .message-attachment-card img,
body:not(.login-body) .attachment-preview,
body:not(.login-body) .attachment-preview img,
body:not(.login-body) .session-attachment-card img {
  background: rgba(7, 16, 31, 0.72);
  border-color: rgba(137, 161, 196, 0.22);
}

body:not(.login-body) a:not(.button):not(.ghost-button):not(.secondary-button):not(.side-card-button) {
  color: #93c5fd;
}

body:not(.login-body) .checklist-tabs .checklist-tab,
body:not(.login-body) .workers-filter-row .checklist-tab,
body:not(.login-body) .workers-table-toolbar .icon-button {
  background: var(--idi-ghost);
  border: 1px solid var(--idi-border);
  color: var(--idi-text-soft);
}

body:not(.login-body) .checklist-tabs .checklist-tab.active,
body:not(.login-body) .workers-filter-row .checklist-tab.active,
body:not(.login-body) .workers-table-toolbar .icon-button.active {
  background: var(--idi-primary);
  border-color: rgba(147, 197, 253, 0.48);
  box-shadow: 0 16px 34px rgba(79, 70, 229, 0.26);
  color: #ffffff;
}

body:not(.login-body) .checklist-tabs .checklist-tab strong,
body:not(.login-body) .workers-filter-row .checklist-tab strong {
  background: rgba(96, 165, 250, 0.14);
  border: 1px solid rgba(147, 197, 253, 0.2);
  color: #dbe7f9;
}

body:not(.login-body) .checklist-tabs .checklist-tab.active strong,
body:not(.login-body) .workers-filter-row .checklist-tab.active strong {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

body:not(.login-body) button.secondary-button,
body:not(.login-body) summary.secondary-button,
body:not(.login-body) .quality-control-grid button.secondary-button,
body:not(.login-body) .review-action-row .secondary-button,
body:not(.login-body) .inline-action-row .secondary-button,
body:not(.login-body) .floating-drawer-head .secondary-button {
  background: var(--idi-ghost);
  border: 1px solid var(--idi-border);
  box-shadow: none;
  color: var(--idi-text-soft);
}

body:not(.login-body) button.secondary-button:hover,
body:not(.login-body) summary.secondary-button:hover,
body:not(.login-body) .quality-control-grid button.secondary-button:hover,
body:not(.login-body) .review-action-row .secondary-button:hover,
body:not(.login-body) .inline-action-row .secondary-button:hover,
body:not(.login-body) .floating-drawer-head .secondary-button:hover {
  background: linear-gradient(180deg, rgba(31, 54, 88, 0.94), rgba(20, 38, 66, 0.94));
  border-color: var(--idi-border-strong);
  color: #ffffff;
}

/* Final legacy dark-mode cleanup for old project/test widgets. */
body:not(.login-body) .preview-feedback form,
body:not(.login-body) .project-card .preview-feedback form,
body:not(.login-body) .technical-details,
body:not(.login-body) .project-card details.technical-details,
body:not(.login-body) .test-project-page details.technical-details,
body:not(.login-body) .project-checklist-page details.technical-details {
  background:
    linear-gradient(145deg, rgba(18, 33, 56, 0.96), rgba(9, 19, 33, 0.96)) !important;
  border: 1px solid rgba(137, 161, 196, 0.24) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
  color: #dbe7f9 !important;
}

body:not(.login-body) .preview-feedback label,
body:not(.login-body) .preview-feedback summary,
body:not(.login-body) .technical-details,
body:not(.login-body) .technical-details summary,
body:not(.login-body) .technical-details p,
body:not(.login-body) .technical-details small,
body:not(.login-body) .technical-details code {
  color: #dbe7f9 !important;
}

body:not(.login-body) .preview-feedback textarea,
body:not(.login-body) .preview-feedback input,
body:not(.login-body) .preview-feedback select {
  background: rgba(6, 16, 29, 0.94) !important;
  border: 1px solid rgba(137, 161, 196, 0.28) !important;
  color: #f8fbff !important;
}

body:not(.login-body) .preview-feedback textarea::placeholder,
body:not(.login-body) .preview-feedback input::placeholder {
  color: #7f93b3 !important;
}

body:not(.login-body) .preview-status,
body:not(.login-body) .preview-status.unknown,
body:not(.login-body) .preview-status.offline,
body:not(.login-body) .preview-status.error,
body:not(.login-body) .preview-status.starting {
  background: rgba(15, 31, 53, 0.92) !important;
  border: 1px solid rgba(137, 161, 196, 0.22) !important;
  color: #dbe7f9 !important;
}

body:not(.login-body) .preview-status.online {
  background: rgba(12, 77, 45, 0.42) !important;
  border: 1px solid rgba(46, 213, 115, 0.34) !important;
  color: #6ee7a8 !important;
}

body:not(.login-body) .title-icon,
body:not(.login-body) .project-checklist-page .title-icon,
body:not(.login-body) .worker-symbol,
body:not(.login-body) .command-worker-node .worker-symbol,
body:not(.login-body) .test-project-page .worker-symbol,
body:not(.login-body) .project-checklist-page .worker-symbol,
body:not(.login-body) .workers-page .worker-symbol {
  background:
    linear-gradient(145deg, rgba(30, 60, 108, 0.78), rgba(13, 28, 51, 0.92)) !important;
  border: 1px solid rgba(96, 165, 250, 0.32) !important;
  color: #9cc8ff !important;
}

body:not(.login-body) .title-icon svg,
body:not(.login-body) .worker-symbol svg {
  color: #9cc8ff !important;
  stroke: currentColor !important;
}

body:not(.login-body) .command-worker-node small,
body:not(.login-body) .test-project-page .command-worker-node small,
body:not(.login-body) .project-checklist-page .command-worker-node small,
body:not(.login-body) .mission-command-page .command-worker-node small {
  background: rgba(15, 31, 53, 0.92) !important;
  border: 1px solid rgba(96, 165, 250, 0.24) !important;
  color: #b9d6ff !important;
}

body:not(.login-body) .command-worker-node.active small,
body:not(.login-body) .command-worker-node.working small {
  background: rgba(37, 99, 235, 0.24) !important;
  border-color: rgba(96, 165, 250, 0.38) !important;
  color: #dbeafe !important;
}

body:not(.login-body) .dash-progress {
  background: rgba(15, 31, 53, 0.86) !important;
  border: 1px solid rgba(137, 161, 196, 0.18) !important;
}

body:not(.login-body) .test-artifact-list article small {
  background: rgba(15, 31, 53, 0.92) !important;
  border: 1px solid rgba(96, 165, 250, 0.24) !important;
  border-radius: 999px !important;
  color: #b9d6ff !important;
  padding: 3px 8px !important;
}

body:not(.login-body) .test-artifact-list article.passed small,
body:not(.login-body) .test-artifact-list article.done small {
  background: rgba(22, 163, 74, 0.18) !important;
  border-color: rgba(74, 222, 128, 0.26) !important;
  color: #86efac !important;
}

body:not(.login-body) .test-artifact-list article.blocked small,
body:not(.login-body) .test-artifact-list article.failed small {
  background: rgba(127, 29, 29, 0.34) !important;
  border-color: rgba(248, 113, 113, 0.28) !important;
  color: #fecaca !important;
}

/* Checklist worker chart must never fall back to the old white node CSS. */
body:not(.login-body) .project-checklist-page .checklist-worker-org-panel,
body:not(.login-body) .project-checklist-page .checklist-worker-org-panel .command-node,
body:not(.login-body) .project-checklist-page .checklist-worker-org-panel .command-worker-node,
body:not(.login-body) .project-checklist-page .checklist-worker-org-panel .command-summary-card {
  background:
    radial-gradient(circle at 16% 12%, rgba(37, 99, 235, 0.20), transparent 34%),
    linear-gradient(145deg, rgba(19, 36, 62, 0.98), rgba(8, 18, 34, 0.98)) !important;
  border: 1px solid rgba(96, 165, 250, 0.28) !important;
  box-shadow: 0 18px 48px rgba(2, 8, 23, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.045) !important;
  color: #f8fbff !important;
}

body:not(.login-body) .project-checklist-page .checklist-worker-org-panel .command-node.working,
body:not(.login-body) .project-checklist-page .checklist-worker-org-panel .command-worker-node.working {
  background:
    radial-gradient(circle at 12% 18%, rgba(59, 130, 246, 0.32), transparent 34%),
    linear-gradient(145deg, rgba(29, 78, 216, 0.30), rgba(11, 25, 45, 0.98)) !important;
  border-color: rgba(96, 165, 250, 0.62) !important;
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.18), 0 18px 48px rgba(37, 99, 235, 0.20) !important;
}

body:not(.login-body) .project-checklist-page .checklist-worker-org-panel .command-node.active,
body:not(.login-body) .project-checklist-page .checklist-worker-org-panel .command-worker-node.active {
  background:
    radial-gradient(circle at 12% 18%, rgba(34, 197, 94, 0.28), transparent 34%),
    linear-gradient(145deg, rgba(13, 78, 54, 0.44), rgba(8, 18, 34, 0.98)) !important;
  border-color: rgba(74, 222, 128, 0.48) !important;
}

body:not(.login-body) .project-checklist-page .checklist-worker-org-panel .command-node strong,
body:not(.login-body) .project-checklist-page .checklist-worker-org-panel .command-worker-node strong,
body:not(.login-body) .project-checklist-page .checklist-worker-org-panel .command-summary-card dd {
  color: #ffffff !important;
  text-shadow: 0 1px 12px rgba(15, 23, 42, 0.30);
}

body:not(.login-body) .project-checklist-page .checklist-worker-org-panel .command-node span,
body:not(.login-body) .project-checklist-page .checklist-worker-org-panel .command-node.coordinator span,
body:not(.login-body) .project-checklist-page .checklist-worker-org-panel .command-node.manager span,
body:not(.login-body) .project-checklist-page .checklist-worker-org-panel .command-summary-card dt {
  color: #c6d5ea !important;
}

body:not(.login-body) .project-checklist-page .checklist-worker-org-panel .command-node span i,
body:not(.login-body) .project-checklist-page .checklist-worker-org-panel .command-worker-node small i {
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.12);
}

body:not(.login-body) .project-checklist-page .checklist-worker-org-panel .command-summary-card .button-icon,
body:not(.login-body) .project-checklist-page .checklist-worker-org-panel .worker-symbol {
  background:
    linear-gradient(145deg, rgba(30, 64, 175, 0.60), rgba(15, 31, 53, 0.96)) !important;
  border: 1px solid rgba(96, 165, 250, 0.34) !important;
  color: #bfdbfe !important;
}

body:not(.login-body) .project-checklist-page .checklist-worker-org-panel .command-worker-node.active .worker-symbol {
  background:
    linear-gradient(145deg, rgba(22, 163, 74, 0.32), rgba(15, 31, 53, 0.96)) !important;
  border-color: rgba(74, 222, 128, 0.34) !important;
  color: #86efac !important;
}

body:not(.login-body) .project-checklist-page .checklist-worker-org-panel .command-line {
  background: linear-gradient(180deg, rgba(96, 165, 250, 0.95), rgba(59, 130, 246, 0.55)) !important;
  box-shadow: 0 0 16px rgba(37, 99, 235, 0.34);
}

body:not(.login-body) .project-checklist-page .checklist-worker-org-panel .command-branch {
  border-color: rgba(96, 165, 250, 0.90) !important;
  box-shadow: 0 -10px 24px rgba(37, 99, 235, 0.16);
}

/* Button text must stay white on the dark UI. */
body:not(.login-body) button,
body:not(.login-body) .button,
body:not(.login-body) a.button,
body:not(.login-body) .ghost-button,
body:not(.login-body) a.ghost-button,
body:not(.login-body) .secondary-button,
body:not(.login-body) a.secondary-button,
body:not(.login-body) summary.secondary-button,
body:not(.login-body) .icon-button,
body:not(.login-body) .quiet-button,
body:not(.login-body) .row-menu,
body:not(.login-body) .preview-button,
body:not(.login-body) .preview-control,
body:not(.login-body) .checklist-tab,
body:not(.login-body) .checklist-toggle-button,
body:not(.login-body) .project-filter-chip,
body:not(.login-body) .project-card-action,
body:not(.login-body) .project-card-test-button,
body:not(.login-body) .cody-toggle,
body:not(.login-body) .dash-cody-toggle,
body:not(.login-body) .dash-process-action,
body:not(.login-body) .conversation-action-button,
body:not(.login-body) .writing-options-opener,
body:not(.login-body) .writing-primary-action,
body:not(.login-body) .danger-soft-button,
body:not(.login-body) .approval-primary-button,
body:not(.login-body) .approval-inactive-button,
body:not(.login-body) .test-project-submit {
  color: #ffffff !important;
}

body:not(.login-body) button *,
body:not(.login-body) .button *,
body:not(.login-body) .ghost-button *,
body:not(.login-body) .secondary-button *,
body:not(.login-body) .icon-button *,
body:not(.login-body) .quiet-button *,
body:not(.login-body) .row-menu *,
body:not(.login-body) .preview-button *,
body:not(.login-body) .preview-control *,
body:not(.login-body) .checklist-tab *,
body:not(.login-body) .checklist-toggle-button *,
body:not(.login-body) .project-filter-chip *,
body:not(.login-body) .project-card-action *,
body:not(.login-body) .project-card-test-button *,
body:not(.login-body) .cody-toggle *,
body:not(.login-body) .dash-cody-toggle *,
body:not(.login-body) .dash-process-action *,
body:not(.login-body) .conversation-action-button *,
body:not(.login-body) .writing-options-opener *,
body:not(.login-body) .writing-primary-action *,
body:not(.login-body) .danger-soft-button *,
body:not(.login-body) .approval-primary-button *,
body:not(.login-body) .approval-inactive-button *,
body:not(.login-body) .test-project-submit * {
  color: #ffffff !important;
  stroke: currentColor !important;
}

/* Cody command center — option 2. */
body.cody-page-body .main {
  padding: 16px 16px 24px;
}

.cody-page {
  --cody-panel: rgba(10, 27, 49, 0.86);
  --cody-panel-strong: rgba(12, 31, 56, 0.94);
  --cody-line: rgba(125, 158, 206, 0.26);
  --cody-line-strong: rgba(82, 140, 225, 0.55);
  --cody-muted: #aebed6;
  --cody-blue: #2f73ff;
  max-width: 1480px;
  margin: 0 auto;
  color: var(--idi-text);
}

.cody-page *,
.cody-page *::before,
.cody-page *::after {
  box-sizing: border-box;
}

.cody-page h1,
.cody-page h2,
.cody-page p,
.cody-page dl,
.cody-page dd,
.cody-page ol {
  margin: 0;
}

.cody-page a {
  color: inherit;
  text-decoration: none;
}

.cody-page svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.cody-command-bar,
.cody-work-stage,
.cody-activity-panel,
.cody-queue-panel {
  border: 1px solid var(--cody-line);
  border-radius: 8px;
  background: var(--cody-panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025), 0 18px 44px rgba(0, 0, 0, 0.1);
}

.cody-command-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 92px;
  gap: 28px;
  padding: 16px 24px;
  background: rgba(10, 26, 47, 0.9);
}

.cody-command-title {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 18px;
}

.cody-command-title h1 {
  color: #f8fbff;
  font-size: clamp(34px, 3vw, 44px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1;
}

.cody-on-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 38px;
  padding: 6px 14px;
  border: 1px solid rgba(74, 222, 128, 0.42);
  border-radius: 999px;
  background: linear-gradient(180deg, #24a451, #167336);
  color: #f5fff8;
  box-shadow: 0 6px 20px rgba(22, 163, 74, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.cody-on-badge.off {
  border-color: rgba(148, 163, 184, 0.38);
  background: #334155;
  box-shadow: none;
  color: #e2e8f0;
}

.cody-power-form,
.cody-permission-control form {
  margin: 0;
}

body:not(.login-body) .cody-page .cody-power-switch {
  position: relative;
  display: block;
  width: 72px;
  min-width: 72px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border: 1px solid rgba(96, 165, 250, 0.6);
  border-radius: 999px;
  background: #1f7af0;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.22), 0 5px 16px rgba(30, 117, 240, 0.2);
  transform: none;
}

body:not(.login-body) .cody-page .cody-power-switch:hover {
  border-color: #93c5fd;
  background: #2d83f4;
  transform: none;
}

body:not(.login-body) .cody-page .cody-power-switch.off {
  border-color: rgba(148, 163, 184, 0.4);
  background: #475569;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.24);
}

.cody-power-switch > span {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.38);
  transition: transform 160ms ease;
}

.cody-power-switch.on > span {
  transform: translateX(34px);
}

.cody-permission-control {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  gap: 18px;
}

.cody-permission-control > span {
  flex: 0 0 auto;
  color: #c3d0e3;
  font-size: 16px;
  font-weight: 600;
}

.cody-permission-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(175px, 1fr));
  width: min(100%, 430px);
  min-width: 370px;
  padding: 0;
  border: 1px solid rgba(91, 139, 209, 0.45);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(5, 17, 33, 0.62);
}

.cody-permission-options form + form {
  border-left: 1px solid rgba(91, 139, 209, 0.32);
}

body:not(.login-body) .cody-page .cody-permission-button {
  display: grid;
  width: 100%;
  min-height: 50px;
  place-content: center;
  padding: 8px 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #b9c7dc !important;
  text-align: center;
  transform: none;
}

body:not(.login-body) .cody-page .cody-permission-button:hover {
  background: rgba(42, 77, 128, 0.42);
  transform: none;
}

body:not(.login-body) .cody-page .cody-permission-button.selected {
  background: linear-gradient(180deg, #3766ff, #1746e8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.17), 0 8px 24px rgba(37, 99, 235, 0.2);
  color: #ffffff !important;
}

.cody-permission-button strong,
.cody-permission-button small {
  display: block;
  color: inherit !important;
}

.cody-permission-button strong {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.15;
}

.cody-permission-button small {
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.2;
  opacity: 0.72;
}

.cody-console-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(285px, 0.95fr);
  grid-template-rows: minmax(500px, auto) auto;
  gap: 8px;
  margin-top: 8px;
  align-items: stretch;
}

.cody-work-stage,
.cody-activity-panel,
.cody-queue-panel {
  min-width: 0;
}

.cody-work-stage {
  position: relative;
  min-height: 500px;
  padding: 24px;
}

.cody-section-label {
  color: #aebed8;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.cody-stage-content {
  display: flex;
  min-height: 438px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 12px 0;
  text-align: center;
}

.cody-agent-icon {
  display: grid;
  width: 116px;
  height: 116px;
  margin-bottom: 20px;
  place-items: center;
  border: 2px solid #2563eb;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(69, 121, 255, 0.18), rgba(14, 30, 55, 0.94) 64%);
  color: #dce8ff;
  box-shadow: 0 0 34px rgba(37, 99, 235, 0.18), inset 0 0 24px rgba(96, 165, 250, 0.09);
}

.cody-agent-icon svg {
  width: 66px;
  height: 66px;
  stroke-width: 1.55;
}

.cody-stage-content h2 {
  color: #f7faff;
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.cody-stage-content > p {
  max-width: 620px;
  margin-top: 8px;
  color: var(--cody-muted);
  font-size: 20px;
  line-height: 1.4;
}

.cody-stage-content > p strong {
  color: #dbeafe;
}

.cody-stage-actions {
  display: grid;
  grid-template-columns: minmax(220px, 270px) minmax(180px, 215px);
  gap: 16px;
  margin-top: 30px;
}

.cody-stage-actions a {
  display: inline-flex;
  min-height: 60px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 17px;
  font-weight: 700;
}

.cody-stage-actions svg {
  width: 20px;
  height: 20px;
}

.cody-primary-action {
  border: 1px solid #3b82f6;
  background: linear-gradient(180deg, #2168ff, #1046e6);
  box-shadow: 0 12px 28px rgba(29, 78, 216, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  color: #ffffff !important;
}

.cody-secondary-action {
  border: 1px solid rgba(112, 156, 222, 0.55);
  background: rgba(10, 25, 46, 0.88);
  color: #d8e4f7;
}

.cody-step-rail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(100%, 720px);
  margin-top: 40px;
  padding: 0;
  list-style: none;
}

.cody-step-rail li {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 11px;
  color: #c3d1e6;
  font-size: 14px;
}

.cody-step-rail li::after {
  position: absolute;
  top: 23px;
  left: calc(50% + 35px);
  width: calc(100% - 70px);
  height: 1px;
  background: rgba(117, 155, 211, 0.48);
  content: "";
}

.cody-step-rail li:last-child::after {
  content: none;
}

.cody-step-rail li > span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid #86a2cc;
  border-radius: 50%;
  background: #0b1b31;
  color: #f8fbff;
  box-shadow: 0 0 0 5px rgba(9, 24, 44, 0.88);
  font-size: 16px;
  font-weight: 700;
}

.cody-step-rail li.current > span {
  border-color: #2f73ff;
  background: #1457f2;
  box-shadow: 0 7px 22px rgba(37, 99, 235, 0.32), 0 0 0 5px rgba(9, 24, 44, 0.88);
}

.cody-step-rail strong {
  color: #c9d5e7;
  font-size: inherit;
  font-weight: 500;
}

.cody-activity-panel {
  padding: 14px 24px 12px;
}

.cody-activity-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.cody-activity-heading h2 {
  margin-top: 4px;
  color: #dce8f8;
  font-size: 13px;
  font-weight: 500;
}

.cody-activity-heading > span {
  color: #8fa3bf;
  font-size: 12px;
}

.cody-project-table {
  min-width: 0;
}

.cody-project-row {
  display: grid;
  grid-template-columns: minmax(180px, 2.25fr) minmax(46px, 0.55fr) minmax(52px, 0.62fr) minmax(46px, 0.55fr) minmax(150px, 1.35fr) 36px;
  min-height: 47px;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(125, 158, 206, 0.19);
}

.cody-project-head {
  min-height: 29px;
  color: #b8c6da;
  font-size: 12px;
  font-weight: 500;
}

.cody-project-name {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  border-radius: 7px;
}

.cody-project-name > span:last-child,
.cody-project-name strong,
.cody-project-name small {
  min-width: 0;
}

.cody-project-name strong,
.cody-project-name small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cody-project-name strong {
  color: #edf4ff;
  font-size: 14px;
  font-weight: 600;
}

.cody-project-name small,
.cody-count small {
  color: #7f93af;
  font-size: 9px;
}

.cody-project-name small {
  margin-top: 2px;
}

.cody-project-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 6px;
  background: #1671f6;
  color: #ffffff;
  box-shadow: 0 5px 13px rgba(0, 0, 0, 0.24);
}

.cody-project-icon.violet {
  background: #7542e8;
}

.cody-project-icon.teal {
  background: #0aa9a2;
}

.cody-project-icon.orange {
  background: #f4820b;
}

.cody-project-icon.green {
  background: #5dbb3a;
}

.cody-project-icon svg {
  width: 18px;
  height: 18px;
}

.cody-count {
  color: #edf4ff;
  text-align: center;
}

.cody-count strong,
.cody-count small {
  display: block;
}

.cody-count strong {
  color: #edf4ff;
  font-size: 14px;
  font-weight: 500;
}

.cody-count small {
  display: none;
}

.cody-progress-cell {
  display: grid;
  grid-template-columns: minmax(68px, 1fr) auto;
  align-items: center;
  gap: 9px;
}

.cody-progress-cell > strong {
  color: #dbe7f8;
  font-size: 12px;
  font-weight: 500;
}

.cody-progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #30425f;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.cody-progress-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #3988ff;
}

.cody-progress-track > span.violet {
  background: #8754ef;
}

.cody-progress-track > span.teal {
  background: #13b2aa;
}

.cody-progress-track > span.orange {
  background: #ff8b0c;
}

.cody-progress-track > span.green {
  background: #73c847;
}

.cody-row-actions {
  display: flex;
  justify-content: flex-end;
}

.cody-open-project {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  color: #a9bfdf !important;
}

.cody-open-project svg {
  width: 18px;
  height: 18px;
}

.cody-project-empty {
  padding: 20px 0;
  color: var(--cody-muted);
}

.cody-help-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  color: #4b8cff !important;
  font-size: 13px;
  font-weight: 500;
}

.cody-help-link svg {
  width: 21px;
  height: 21px;
}

.cody-queue-panel {
  display: flex;
  min-height: 100%;
  grid-column: 2;
  grid-row: 1 / 3;
  flex-direction: column;
  padding: 24px;
}

.cody-page .cody-queue-counts {
  display: grid;
  grid-template-columns: 1fr;
  margin-top: 44px;
}

.cody-queue-counts > div {
  min-height: 140px;
  padding: 0 0 30px;
  border-bottom: 1px solid rgba(125, 158, 206, 0.2);
}

.cody-queue-counts > div + div {
  padding-top: 30px;
}

.cody-queue-counts dt {
  color: #c5d3e6;
  font-size: 15px;
}

.cody-queue-counts dd {
  margin-top: 14px;
  color: #347aff;
  font-size: 46px;
  font-weight: 500;
  line-height: 1;
}

.cody-queue-list {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}

.cody-queue-list a {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  padding: 12px;
  border: 1px solid rgba(125, 158, 206, 0.2);
  border-radius: 9px;
  background: rgba(7, 20, 38, 0.58);
}

.cody-queue-list strong,
.cody-queue-list small {
  display: block;
}

.cody-queue-list strong {
  color: #edf4ff;
  font-size: 13px;
}

.cody-queue-list small {
  margin-top: 3px;
  color: #9fb0c8;
  font-size: 11px;
  line-height: 1.35;
}

.cody-task-state {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.12);
}

.cody-task-state.active {
  background: #34d399;
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.12);
}

.cody-queue-empty {
  display: grid;
  flex: 1 1 auto;
  align-content: center;
  justify-items: center;
  min-height: 260px;
  padding: 26px 8px 74px;
  text-align: center;
}

.cody-inbox-icon {
  display: grid;
  width: 72px;
  height: 72px;
  margin-bottom: 24px;
  place-items: center;
  color: #377cff;
}

.cody-inbox-icon svg {
  width: 62px;
  height: 62px;
  stroke-width: 1.45;
}

.cody-queue-empty strong {
  color: #b9c7da;
  font-size: 18px;
  font-weight: 500;
}

.cody-queue-empty p {
  margin-top: 7px;
  color: #8396b1;
  font-size: 12px;
}

.cody-page a:hover,
.cody-page button:hover {
  filter: brightness(1.07);
}

.cody-page a:focus-visible,
.cody-page button:focus-visible {
  outline: 3px solid rgba(96, 165, 250, 0.86);
  outline-offset: 3px;
}

@media (max-width: 1180px) {
  .cody-command-bar {
    align-items: flex-start;
  }

  .cody-permission-control {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .cody-console-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .cody-queue-panel {
    min-height: 360px;
    grid-column: 1;
    grid-row: auto;
  }

  .cody-page .cody-queue-counts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 22px;
  }

  .cody-queue-counts > div {
    min-height: 105px;
    padding: 0 22px 22px 0;
  }

  .cody-queue-counts > div + div {
    padding: 0 0 22px 22px;
    border-left: 1px solid rgba(125, 158, 206, 0.2);
  }

  .cody-queue-empty {
    min-height: 210px;
    padding-bottom: 30px;
  }
}

@media (max-width: 820px) {
  .cody-command-bar {
    display: grid;
  }

  .cody-permission-control {
    width: 100%;
  }

  .cody-permission-options {
    width: 100%;
  }

  .cody-project-row {
    grid-template-columns: minmax(180px, 2fr) repeat(3, minmax(42px, 0.5fr)) minmax(120px, 1fr) 34px;
  }
}

@media (max-width: 700px) {
  body.cody-page-body .main {
    padding-right: 12px !important;
    padding-left: 12px !important;
  }

  .cody-command-bar,
  .cody-work-stage,
  .cody-activity-panel,
  .cody-queue-panel {
    padding: 18px;
  }

  .cody-command-title {
    flex-wrap: wrap;
    gap: 12px;
  }

  .cody-command-title h1 {
    margin-right: auto;
    font-size: 34px;
  }

  .cody-on-badge {
    min-height: 34px;
    font-size: 14px;
  }

  .cody-permission-options {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .cody-permission-options form + form {
    border-top: 1px solid rgba(91, 139, 209, 0.32);
    border-left: 0;
  }

  body:not(.login-body) .cody-page .cody-permission-button {
    min-height: 56px;
  }

  .cody-work-stage {
    min-height: 0;
  }

  .cody-stage-content {
    min-height: 0;
    padding: 34px 0 4px;
  }

  .cody-agent-icon {
    width: 94px;
    height: 94px;
  }

  .cody-agent-icon svg {
    width: 54px;
    height: 54px;
  }

  .cody-stage-content h2 {
    font-size: 28px;
  }

  .cody-stage-content > p {
    font-size: 17px;
  }

  .cody-stage-actions {
    grid-template-columns: 1fr;
    width: 100%;
    margin-top: 24px;
  }

  .cody-step-rail {
    margin-top: 34px;
  }

  .cody-step-rail li {
    gap: 9px;
    font-size: 11px;
  }

  .cody-step-rail li::after {
    left: calc(50% + 29px);
    width: calc(100% - 58px);
    top: 20px;
  }

  .cody-step-rail li > span {
    width: 40px;
    height: 40px;
  }

  .cody-project-head {
    display: none;
  }

  .cody-project-table {
    display: grid;
    gap: 10px;
  }

  .cody-project-row:not(.cody-project-head) {
    grid-template-columns: repeat(3, minmax(0, 1fr)) 42px;
    gap: 8px;
    padding: 12px;
    border: 1px solid rgba(125, 158, 206, 0.2);
    border-radius: 9px;
    background: rgba(6, 18, 35, 0.48);
  }

  .cody-project-name {
    grid-column: 1 / -1;
  }

  .cody-count {
    padding: 8px 4px;
    border-radius: 7px;
    background: rgba(29, 50, 79, 0.44);
  }

  .cody-count small {
    display: block;
    margin-top: 2px;
  }

  .cody-progress-cell {
    grid-column: 1 / 4;
  }

  .cody-row-actions {
    grid-column: 4;
  }

  .cody-activity-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cody-power-switch > span {
    transition: none;
  }
}

/* IDI Himu: protected project memory and assignment workspace */
.himu-page {
  --himu-panel: rgba(14, 29, 49, 0.92);
  --himu-panel-soft: rgba(20, 39, 64, 0.82);
  --himu-line: rgba(125, 163, 218, 0.24);
  --himu-line-strong: rgba(96, 165, 250, 0.54);
  --himu-text: #f7fbff;
  --himu-muted: #b8c7dc;
  --himu-soft: #8fa4c1;
  --himu-blue: #60a5fa;
  --himu-purple: #a78bfa;
  max-width: 1360px;
  margin: 0 auto;
  color: var(--himu-text);
}

.himu-page *,
.himu-page *::before,
.himu-page *::after {
  box-sizing: border-box;
}

.himu-page > .panel,
.himu-source-grid,
.himu-overview-grid,
.himu-card-grid,
.himu-area-grid {
  margin-bottom: 18px;
}

.himu-page .panel,
.himu-task-card,
.himu-area-grid > a,
.himu-metrics > article {
  border: 1px solid var(--himu-line);
  background:
    linear-gradient(145deg, rgba(26, 46, 74, 0.78), rgba(9, 21, 38, 0.94)),
    var(--himu-panel);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 18px 48px rgba(0, 0, 0, 0.18);
}

.himu-page .panel {
  border-radius: 16px;
  padding: 22px;
}

.himu-page h1,
.himu-page h2,
.himu-page h3,
.himu-page strong,
.himu-page dt {
  color: var(--himu-text);
}

.himu-page p,
.himu-page dd,
.himu-page small,
.himu-page li {
  color: var(--himu-muted);
}

.himu-page a {
  color: #bfdbfe;
}

.himu-page code {
  color: #dbeafe;
  overflow-wrap: anywhere;
}

.himu-page .eyebrow {
  margin: 0 0 6px;
  color: #93c5fd;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.himu-page .muted {
  color: var(--himu-muted);
}

.himu-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 174px;
  margin-bottom: 16px;
  padding: 28px 30px;
  overflow: hidden;
  border: 1px solid rgba(96, 165, 250, 0.34);
  border-radius: 18px;
  background:
    radial-gradient(circle at 88% 18%, rgba(124, 58, 237, 0.28), transparent 33%),
    radial-gradient(circle at 8% 88%, rgba(37, 99, 235, 0.25), transparent 40%),
    linear-gradient(135deg, rgba(22, 46, 78, 0.98), rgba(7, 18, 34, 0.98));
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
}

.himu-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(147, 197, 253, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(147, 197, 253, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(90deg, transparent, #000 58%, #000);
}

.himu-hero > * {
  position: relative;
  z-index: 1;
}

.himu-hero h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.himu-hero p:last-child {
  max-width: 760px;
  margin: 13px 0 0;
  color: #c4d3e8;
  font-size: 1rem;
  line-height: 1.6;
}

.himu-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.himu-private-pill,
.himu-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.himu-private-pill {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(167, 139, 250, 0.42);
  color: #ddd6fe;
  background: rgba(109, 40, 217, 0.2);
}

.himu-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  padding: 8px;
  overflow-x: auto;
  border: 1px solid var(--himu-line);
  border-radius: 14px;
  background: rgba(7, 18, 33, 0.78);
  scrollbar-width: thin;
}

.himu-tabs a,
.himu-filter-row a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #b8c7dc;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 850;
  white-space: nowrap;
  transition: 140ms ease;
}

.himu-tabs a:hover,
.himu-filter-row a:hover {
  border-color: rgba(96, 165, 250, 0.34);
  color: #ffffff;
  background: rgba(37, 99, 235, 0.14);
}

.himu-tabs a[aria-current="page"],
.himu-filter-row a[aria-current="page"] {
  border-color: rgba(96, 165, 250, 0.54);
  color: #ffffff;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.72), rgba(109, 40, 217, 0.62));
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.18);
}

.himu-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.himu-metrics > article {
  min-height: 118px;
  padding: 18px;
  border-radius: 14px;
}

.himu-metrics span,
.himu-metrics small,
.himu-metrics strong {
  display: block;
}

.himu-metrics span {
  color: #9fb2cc;
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.himu-metrics strong {
  margin: 8px 0 5px;
  font-size: 2rem;
  line-height: 1;
}

.himu-metrics small {
  color: var(--himu-soft);
  line-height: 1.35;
}

.himu-overview-grid,
.himu-source-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.8fr);
  gap: 18px;
}

.himu-contract-card ol {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding-left: 22px;
}

.himu-contract-card li::marker {
  color: var(--himu-blue);
  font-weight: 900;
}

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

.himu-area-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.himu-area-grid > a {
  position: relative;
  min-height: 148px;
  padding: 18px;
  overflow: hidden;
  border-radius: 14px;
  text-decoration: none;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.himu-area-grid > a::after {
  content: "→";
  position: absolute;
  right: 17px;
  bottom: 14px;
  color: #93c5fd;
  font-size: 1.15rem;
}

.himu-area-grid > a:hover {
  transform: translateY(-2px);
  border-color: var(--himu-line-strong);
  box-shadow: 0 22px 46px rgba(0, 0, 0, 0.26);
}

.himu-area-grid span,
.himu-area-grid strong,
.himu-area-grid small {
  display: block;
}

.himu-area-grid span {
  color: #93c5fd;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.himu-area-grid strong {
  margin: 10px 0 7px;
  font-size: 1.05rem;
}

.himu-area-grid small {
  max-width: 88%;
  color: #9fb1c9;
  line-height: 1.45;
}

.himu-compact-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.himu-compact-list > article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 64px;
  padding: 12px 14px;
  border: 1px solid rgba(125, 163, 218, 0.18);
  border-radius: 11px;
  background: rgba(7, 18, 33, 0.5);
}

.himu-compact-list strong,
.himu-compact-list small {
  display: block;
}

.himu-compact-list small {
  margin-top: 5px;
  color: var(--himu-soft);
}

.himu-connected-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0;
  margin: 14px 0 0;
}

.himu-connected-list dt,
.himu-connected-list dd {
  margin: 0;
  padding: 11px 0;
  border-bottom: 1px solid rgba(125, 163, 218, 0.15);
}

.himu-connected-list dd {
  color: #bfdbfe;
  font-weight: 850;
  text-align: right;
}

.himu-connected-card {
  align-self: start;
}

.himu-connected-card > strong {
  display: block;
  margin: 16px 0 8px;
  color: #bfdbfe;
  font-size: 1.2rem;
}

.himu-connected-card .ghost-button {
  margin-top: 10px;
}

.himu-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.himu-form.compact {
  gap: 10px;
  margin-top: 12px;
}

.himu-form label {
  display: grid;
  align-content: start;
  gap: 7px;
  color: #c8d7eb;
  font-size: 0.78rem;
  font-weight: 850;
}

.himu-form label.wide,
.himu-form button {
  grid-column: 1 / -1;
}

.himu-form input,
.himu-form select,
.himu-form textarea,
.himu-task-toolbar select {
  width: 100%;
  border: 1px solid rgba(125, 163, 218, 0.28);
  border-radius: 9px;
  color: #f8fbff;
  background: rgba(5, 15, 29, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.himu-form input,
.himu-form select,
.himu-task-toolbar select {
  min-height: 43px;
  padding: 0 11px;
}

.himu-form textarea {
  min-height: 84px;
  padding: 11px;
  resize: vertical;
  line-height: 1.5;
}

.himu-form input:focus,
.himu-form select:focus,
.himu-form textarea:focus,
.himu-task-toolbar select:focus {
  outline: 2px solid rgba(96, 165, 250, 0.25);
  outline-offset: 1px;
  border-color: rgba(96, 165, 250, 0.72);
}

.himu-form button,
.himu-record-card button {
  min-height: 43px;
  border: 1px solid rgba(96, 165, 250, 0.55);
  border-radius: 9px;
  background: linear-gradient(135deg, #2563eb, #6d28d9);
  font-weight: 900;
  cursor: pointer;
}

.himu-form button:hover,
.himu-record-card button:hover {
  filter: brightness(1.1);
}

.himu-task-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.himu-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.himu-task-toolbar form {
  flex: 0 0 190px;
}

.himu-task-toolbar label {
  display: grid;
  gap: 5px;
  color: var(--himu-soft);
  font-size: 0.72rem;
  font-weight: 850;
}

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

.himu-task-card {
  position: relative;
  min-width: 0;
  padding: 18px;
  border-radius: 14px;
  overflow: hidden;
}

.himu-task-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #64748b;
}

.himu-task-card.active::before { background: #34d399; }
.himu-task-card.pending::before { background: #60a5fa; }
.himu-task-card.blocked::before { background: #fb7185; }
.himu-task-card.done::before { background: #a78bfa; }
.himu-task-card.archived::before,
.himu-task-card.superseded::before { background: #94a3b8; }

.himu-task-card > header,
.himu-group-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.himu-task-card header span,
.himu-group-card header span,
.himu-record-card > span {
  color: #93c5fd;
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.himu-task-card h3,
.himu-record-card h3 {
  margin: 6px 0 0;
  font-size: 1rem;
  line-height: 1.35;
}

.himu-task-card > p,
.himu-record-card > p {
  line-height: 1.55;
}

.himu-task-card > dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.himu-task-card > dl > div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(125, 163, 218, 0.14);
  border-radius: 8px;
  background: rgba(5, 15, 29, 0.44);
}

.himu-task-card dt,
.himu-task-card dd {
  margin: 0;
}

.himu-task-card dt {
  color: var(--himu-soft);
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.himu-task-card dd {
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: #d7e3f3;
  font-size: 0.78rem;
  font-weight: 750;
}

.himu-status {
  min-height: 27px;
  padding: 0 9px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #cbd5e1;
  background: rgba(71, 85, 105, 0.22);
}

.himu-status.active {
  border-color: rgba(52, 211, 153, 0.42);
  color: #a7f3d0;
  background: rgba(5, 150, 105, 0.18);
}

.himu-status.pending,
.himu-status.open {
  border-color: rgba(96, 165, 250, 0.42);
  color: #bfdbfe;
  background: rgba(37, 99, 235, 0.18);
}

.himu-status.blocked {
  border-color: rgba(251, 113, 133, 0.45);
  color: #fecdd3;
  background: rgba(190, 24, 93, 0.18);
}

.himu-status.done,
.himu-status.added-to-tasks {
  border-color: rgba(167, 139, 250, 0.45);
  color: #ddd6fe;
  background: rgba(109, 40, 217, 0.18);
}

.himu-proof-block {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 9px;
  background: rgba(3, 11, 22, 0.58);
}

.himu-proof-block strong {
  margin-bottom: 2px;
  color: #9fb4d0;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.himu-proof-block code,
.himu-proof-block a {
  display: block;
  font-size: 0.73rem;
  line-height: 1.45;
}

.himu-task-card details,
.himu-record-card details {
  margin-top: 12px;
  border-top: 1px solid rgba(125, 163, 218, 0.16);
  padding-top: 10px;
}

.himu-task-card summary,
.himu-record-card summary {
  color: #bfdbfe;
  font-size: 0.78rem;
  font-weight: 850;
  cursor: pointer;
}

.himu-log-list {
  display: grid;
  gap: 7px;
  margin-top: 9px;
}

.himu-log-list p {
  margin: 0;
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(5, 15, 29, 0.58);
  color: #d6e2f2;
  font-size: 0.78rem;
  white-space: pre-line;
}

.himu-log-list small {
  display: block;
  margin-bottom: 4px;
  color: var(--himu-soft);
  font-size: 0.65rem;
}

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

.himu-record-card,
.himu-group-card {
  min-width: 0;
}

.himu-record-card {
  min-height: 220px;
  padding: 17px;
  border: 1px solid rgba(125, 163, 218, 0.2);
  border-radius: 13px;
  background: rgba(7, 18, 33, 0.56);
}

.himu-record-card form {
  margin-top: 14px;
}

.himu-record-card button {
  width: 100%;
}

.himu-record-card > small {
  display: block;
  margin-top: 13px;
  color: #c4b5fd;
  font-weight: 800;
}

.himu-group-card p {
  min-height: 56px;
  line-height: 1.5;
}

.himu-group-card dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 12px;
}

.himu-group-card dt,
.himu-group-card dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.himu-group-card dt {
  color: var(--himu-soft);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.himu-group-card dd {
  color: #d7e3f3;
  font-size: 0.78rem;
}

.himu-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.himu-table th,
.himu-table td {
  padding: 12px 13px;
  border-bottom: 1px solid rgba(125, 163, 218, 0.16);
  vertical-align: top;
  text-align: left;
}

.himu-table th {
  color: #9fb4d0;
  font-size: 0.69rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: rgba(5, 15, 29, 0.72);
}

.himu-table td {
  color: #d1deef;
  font-size: 0.78rem;
  line-height: 1.48;
}

.himu-table td small,
.himu-table td a {
  display: block;
  margin-top: 5px;
}

.himu-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 24px;
  border: 1px dashed rgba(125, 163, 218, 0.28);
  border-radius: 11px;
  color: var(--himu-soft);
  text-align: center;
}

.himu-page .preline {
  white-space: pre-line;
}

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

  .himu-task-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  body.himu-body .nav {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 68px;
    min-height: 68px;
    padding: 9px 16px;
    overflow: hidden;
    flex-direction: row;
    align-items: center;
  }

  body.himu-body .nav > :not(.brand) {
    display: none;
  }

  body.himu-body .brand {
    margin: 0;
    padding: 0;
    border: 0;
  }

  body.himu-body .brand .mark {
    width: 42px;
    height: 42px;
  }

  body.himu-body .brand strong {
    font-size: 1.3rem;
  }

  body.himu-body .main {
    padding: 16px;
  }

  .himu-hero,
  .himu-task-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .himu-hero-actions {
    justify-content: flex-start;
  }

  .himu-metrics,
  .himu-overview-grid,
  .himu-source-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .himu-overview-grid,
  .himu-source-grid {
    grid-template-columns: 1fr;
  }

  .himu-task-toolbar form {
    width: 100%;
    flex-basis: auto;
  }
}

@media (max-width: 620px) {
  .himu-hero,
  .himu-page .panel {
    padding: 18px;
  }

  .himu-metrics,
  .himu-area-grid,
  .himu-area-grid.compact,
  .himu-card-grid,
  .himu-form,
  .himu-task-card > dl {
    grid-template-columns: 1fr;
  }

  .himu-tabs {
    margin-right: -4px;
  }

  .himu-filter-row {
    flex-wrap: nowrap;
    width: 100%;
    padding-bottom: 3px;
    overflow-x: auto;
  }

  .himu-compact-list > article,
  .himu-task-card > header,
  .himu-group-card > header {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Projects: make Cody's power and role understandable at a glance. */
.projects-page .projects-header {
  align-items: start;
  grid-template-columns: minmax(520px, 1fr) minmax(360px, 0.72fr);
  column-gap: 24px;
}

.projects-page .projects-header-main {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.projects-page .projects-header-actions {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  width: min(100%, 540px);
  gap: 12px;
  justify-items: stretch;
}

.projects-page .projects-primary-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.projects-page .cody-simple-control {
  display: grid;
  width: 100%;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(126, 166, 222, 0.28);
  border-radius: 12px;
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.15), transparent 42%),
    linear-gradient(145deg, rgba(20, 37, 61, 0.96), rgba(9, 23, 40, 0.94));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}

.projects-page .heartbeat-control {
  display: grid;
  gap: 13px;
  width: calc(100% - 56px);
  margin-left: 56px;
  max-width: 640px;
  padding: 15px;
  border: 1px solid rgba(125, 211, 252, 0.32);
  border-radius: 12px;
  background:
    radial-gradient(circle at 12% 0%, rgba(20, 184, 166, 0.18), transparent 42%),
    linear-gradient(145deg, rgba(12, 31, 50, 0.98), rgba(7, 19, 33, 0.96));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}

.projects-page .heartbeat-head {
  display: grid;
  align-items: start;
  gap: 14px;
}

.projects-page .heartbeat-title {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}

.projects-page .heartbeat-dot {
  width: 12px;
  height: 12px;
  margin-top: 8px;
  border-radius: 50%;
  background: #22d3ee;
  box-shadow: 0 0 0 5px rgba(34, 211, 238, 0.12), 0 0 18px rgba(34, 211, 238, 0.28);
}

.projects-page .heartbeat-title span,
.projects-page .heartbeat-metrics small,
.projects-page .heartbeat-interval-form label {
  display: block;
  color: #91a7c6;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.projects-page .heartbeat-title strong {
  display: block;
  margin-top: 2px;
  color: #f8fbff;
  font-size: 19px;
  line-height: 1.25;
}

.projects-page .heartbeat-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.projects-page .heartbeat-actions form,
.projects-page .heartbeat-interval-form {
  margin: 0;
}

.projects-page .heartbeat-start-form {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.projects-page .heartbeat-start-form label {
  grid-column: 1 / -1;
  color: #91a7c6;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.projects-page .heartbeat-start-form select {
  min-width: 0;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid rgba(125, 211, 252, 0.24);
  border-radius: 9px;
  background: rgba(4, 14, 26, 0.72);
  color: #f8fbff;
}

body:not(.login-body) .projects-page .heartbeat-button.ghost-button,
body:not(.login-body) .projects-page .heartbeat-save.ghost-button {
  min-width: 0;
  min-height: 38px;
  padding: 8px 10px;
  border-color: rgba(125, 211, 252, 0.3);
  background: rgba(8, 21, 39, 0.72);
  color: #e9faff;
}

.projects-page .heartbeat-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.projects-page .heartbeat-metrics > span:first-child {
  grid-column: 1 / -1;
}

.projects-page .heartbeat-metrics > span {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(125, 211, 252, 0.16);
  border-radius: 10px;
  background: rgba(4, 14, 26, 0.42);
}

.projects-page .heartbeat-metrics strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: #f8fbff;
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.projects-page .heartbeat-interval-form {
  display: grid;
  grid-template-columns: auto 72px auto auto;
  align-items: center;
  gap: 8px;
  color: #b9c8df;
  font-size: 12px;
}

.projects-page .heartbeat-interval-form input {
  width: 72px;
  min-height: 36px;
  padding: 6px 9px;
  border: 1px solid rgba(125, 211, 252, 0.24);
  border-radius: 9px;
  background: rgba(4, 14, 26, 0.72);
  color: #f8fbff;
}

.projects-page .heartbeat-details {
  width: 100%;
  min-height: 104px;
  padding: 11px 12px;
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 10px;
  background: rgba(2, 8, 18, 0.66);
  color: #c9e9ff;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  resize: vertical;
}

.projects-page .heartbeat-control {
  gap: 14px;
  padding: 16px;
  border-color: rgba(45, 212, 191, 0.36);
  border-radius: 14px;
  background:
    radial-gradient(circle at 0% 0%, rgba(45, 212, 191, 0.2), transparent 38%),
    linear-gradient(145deg, rgba(10, 43, 55, 0.95), rgba(6, 18, 32, 0.98));
}

.projects-page .heartbeat-head {
  gap: 12px;
}

.projects-page .heartbeat-title {
  grid-template-columns: 14px minmax(0, 1fr);
  align-items: center;
}

.projects-page .heartbeat-dot {
  width: 13px;
  height: 13px;
  margin-top: 1px;
  background: #22d3ee;
}

.projects-page .heartbeat-title span {
  margin-bottom: 2px;
  color: #94c9d8;
}

.projects-page .heartbeat-title strong {
  font-size: 22px;
  line-height: 1.1;
}

.projects-page .heartbeat-actions {
  grid-template-columns: 1fr;
  gap: 10px;
}

.projects-page .heartbeat-start-form {
  grid-template-columns: minmax(0, 1fr) minmax(130px, auto);
  gap: 8px;
}

.projects-page .heartbeat-start-form select,
.projects-page .heartbeat-interval-form input {
  min-height: 40px;
  border-color: rgba(103, 232, 249, 0.32);
  background: rgba(2, 12, 24, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.projects-page .heartbeat-stop-form {
  justify-self: start;
}

body:not(.login-body) .projects-page .heartbeat-button.ghost-button,
body:not(.login-body) .projects-page .heartbeat-save.ghost-button {
  min-height: 40px;
  border-color: rgba(103, 232, 249, 0.32);
  border-radius: 10px;
}

.projects-page .heartbeat-metrics {
  grid-template-columns: minmax(0, 1.25fr) minmax(110px, 0.45fr) minmax(145px, 0.6fr);
  gap: 8px;
}

.projects-page .heartbeat-metrics > span:first-child {
  grid-column: auto;
}

.projects-page .heartbeat-metrics > span {
  min-height: 58px;
  padding: 10px 11px;
  border-color: rgba(103, 232, 249, 0.2);
  background: rgba(2, 14, 26, 0.58);
}

.projects-page .heartbeat-metrics strong {
  font-size: 13px;
}

.projects-page .heartbeat-interval-form {
  grid-template-columns: auto 74px auto minmax(120px, 160px);
  padding-top: 2px;
}

.projects-page .heartbeat-log-label {
  margin-bottom: -8px;
  color: #94c9d8;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.projects-page .heartbeat-details {
  min-height: 116px;
  max-height: 156px;
  border-color: rgba(103, 232, 249, 0.2);
  background:
    linear-gradient(180deg, rgba(2, 10, 20, 0.84), rgba(1, 6, 13, 0.78));
  color: #d7f6ff;
  font-size: 12px;
  scrollbar-color: rgba(103, 232, 249, 0.48) rgba(2, 10, 20, 0.72);
  scrollbar-width: thin;
}

.projects-page .heartbeat-details::-webkit-scrollbar {
  width: 9px;
}

.projects-page .heartbeat-details::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(2, 10, 20, 0.72);
}

.projects-page .heartbeat-details::-webkit-scrollbar-thumb {
  border: 2px solid rgba(2, 10, 20, 0.72);
  border-radius: 999px;
  background: rgba(103, 232, 249, 0.52);
}

@media (max-width: 1280px) {
  .projects-page .cody-role-options {
    grid-template-columns: 1fr;
  }

  body:not(.login-body) .projects-page .cody-role-choice.cody-toggle {
    min-height: 58px;
    grid-template-columns: 20px minmax(145px, 1fr) auto;
  }
}

.projects-page .cody-simple-control.on {
  border-color: rgba(52, 211, 153, 0.42);
}

.projects-page .cody-simple-control {
  grid-column: 1;
}

.projects-page .cody-simple-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.projects-page .cody-current-state {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  min-width: 0;
}

.projects-page .cody-state-dot {
  width: 12px;
  height: 12px;
  margin-top: 7px;
  border-radius: 50%;
  background: #94a3b8;
  box-shadow: 0 0 0 5px rgba(148, 163, 184, 0.12);
}

.projects-page .cody-simple-control.on .cody-state-dot {
  background: #34d399;
  box-shadow: 0 0 0 5px rgba(52, 211, 153, 0.14), 0 0 18px rgba(52, 211, 153, 0.34);
}

.projects-page .cody-state-kicker,
.projects-page .cody-power-label {
  display: block;
  color: #91a7c6;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.projects-page .cody-current-state strong {
  display: block;
  margin-top: 2px;
  color: #f8fbff;
  font-size: 19px;
  line-height: 1.25;
}

.projects-page .cody-current-state small {
  display: block;
  margin-top: 4px;
  color: #b9c8df;
  font-size: 13px;
  line-height: 1.4;
}

.projects-page .cody-power-form {
  flex: 0 0 auto;
}

body:not(.login-body) .projects-page .cody-power-switch.cody-toggle {
  display: grid;
  grid-template-columns: auto auto minmax(64px, auto);
  align-items: center;
  justify-content: start;
  gap: 9px;
  min-width: 198px;
  min-height: 62px;
  padding: 8px 11px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 10px;
  background: rgba(7, 18, 34, 0.84);
  color: #eef4ff;
  box-shadow: none;
  text-align: left;
  transform: none;
}

body:not(.login-body) .projects-page .cody-power-switch.cody-toggle:hover {
  border-color: rgba(147, 197, 253, 0.65);
  background: rgba(18, 39, 67, 0.94);
  transform: none;
}

.projects-page .cody-switch-track {
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: #64748b;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  transition: background 160ms ease;
}

.projects-page .cody-switch-track > span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.34);
  transition: transform 160ms ease;
}

.projects-page .cody-power-switch.on .cody-switch-track {
  background: #10b981;
}

.projects-page .cody-power-switch.on .cody-switch-track > span {
  transform: translateX(20px);
}

.projects-page .cody-power-copy strong,
.projects-page .cody-power-copy small {
  display: block;
  color: inherit;
  white-space: nowrap;
}

.projects-page .cody-power-copy strong {
  font-size: 14px;
  line-height: 1.1;
}

.projects-page .cody-power-copy small {
  margin-top: 3px;
  color: #aebdd2;
  font-size: 10px;
}

.projects-page .cody-role-row {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(126, 166, 222, 0.18);
}

.projects-page .cody-role-row > p {
  margin: 0;
  color: #dce8f8;
  font-size: 13px;
  font-weight: 800;
}

.projects-page .cody-role-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.projects-page .cody-role-options form {
  min-width: 0;
  margin: 0;
}

body:not(.login-body) .projects-page .cody-role-choice.cody-toggle {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  justify-content: stretch;
  width: 100%;
  min-width: 0;
  min-height: 70px;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(126, 166, 222, 0.25);
  border-radius: 10px;
  background: rgba(8, 21, 39, 0.72);
  color: #e9f1fc;
  box-shadow: none;
  text-align: left;
  transform: none;
}

body:not(.login-body) .projects-page .cody-role-choice.cody-toggle:hover {
  border-color: rgba(114, 168, 255, 0.72);
  background: rgba(21, 45, 77, 0.88);
  transform: none;
}

body:not(.login-body) .projects-page .cody-role-choice.cody-toggle.selected {
  border-color: rgba(96, 165, 250, 0.88);
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.34), rgba(79, 70, 229, 0.22));
  box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.18);
}

.projects-page .cody-role-choice .button-icon {
  color: #8db8ff;
}

.projects-page .cody-role-copy {
  min-width: 0;
}

.projects-page .cody-role-copy strong,
.projects-page .cody-role-copy small {
  display: block;
  color: inherit;
  white-space: normal;
}

.projects-page .cody-role-copy strong {
  font-size: 14px;
  line-height: 1.25;
}

.projects-page .cody-role-copy small {
  margin-top: 3px;
  color: #aebdd2;
  font-size: 11px;
  line-height: 1.35;
}

.projects-page .cody-choice-state {
  padding: 4px 7px;
  border: 1px solid rgba(110, 168, 255, 0.42);
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.18);
  color: #bfdbfe;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.projects-page .cody-simple-control.off .cody-choice-state {
  border-color: rgba(148, 163, 184, 0.34);
  background: rgba(100, 116, 139, 0.16);
  color: #cbd5e1;
}

.projects-page .cody-power-switch:focus-visible,
.projects-page .cody-role-choice:focus-visible {
  outline: 3px solid rgba(96, 165, 250, 0.72);
  outline-offset: 3px;
}

@media (max-width: 1180px) {
  .projects-page .projects-header-actions {
    width: 100%;
  }

  .projects-page .projects-primary-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 980px) {
  .projects-page .projects-header {
    grid-template-columns: 1fr;
  }

  .projects-page .projects-header-actions {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .projects-page .heartbeat-control,
  .projects-page .cody-simple-control,
  .projects-page .projects-primary-actions {
    grid-column: 1;
  }
}

@media (max-width: 700px) {
  .projects-page .heartbeat-control {
    width: 100%;
    margin-left: 0;
  }

  .projects-page .heartbeat-head,
  .projects-page .cody-simple-head {
    display: grid;
    align-items: stretch;
  }

  .projects-page .heartbeat-actions,
  .projects-page .heartbeat-metrics,
  .projects-page .heartbeat-interval-form,
  .projects-page .heartbeat-start-form {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .projects-page .heartbeat-interval-form input,
  .projects-page .heartbeat-start-form select,
  body:not(.login-body) .projects-page .heartbeat-button.ghost-button,
  body:not(.login-body) .projects-page .heartbeat-save.ghost-button {
    width: 100%;
  }

  .projects-page .cody-power-form,
  body:not(.login-body) .projects-page .cody-power-switch.cody-toggle {
    width: 100%;
  }

  .projects-page .cody-role-options {
    grid-template-columns: 1fr;
  }

  .projects-page .projects-primary-actions > a {
    flex: 1 1 150px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .projects-page .cody-switch-track,
  .projects-page .cody-switch-track > span {
    transition: none;
  }
}

/* Projects Heartbeat: compact by default, detailed only when expanded. */
.projects-page .projects-header {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px 16px;
}

.projects-page .projects-header-main,
.projects-page .projects-header-actions {
  display: contents;
}

.projects-page .projects-title-row {
  grid-column: 1;
  order: 1;
}

.projects-page .projects-header-actions {
  width: 100%;
  max-width: none;
  justify-self: end;
}

.projects-page .projects-primary-actions {
  grid-column: 2;
  order: 2;
  align-self: start;
  justify-self: end;
}

.projects-page .cody-simple-control {
  grid-column: 1 / -1;
  order: 3;
  width: 100%;
  max-width: none;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

.projects-page .cody-simple-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
  gap: 14px;
}

.projects-page .cody-current-state {
  align-items: center;
}

.projects-page .cody-state-dot {
  margin-top: 0;
}

.projects-page .cody-current-state small,
.projects-page .cody-role-copy strong,
.projects-page .cody-role-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.projects-page .cody-role-row {
  align-self: center;
  justify-self: end;
  gap: 0;
  padding-top: 0;
  border-top: 0;
}

.projects-page .cody-role-row > p {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.projects-page .cody-role-options {
  grid-template-columns: repeat(2, max-content);
  gap: 8px;
}

body:not(.login-body) .projects-page .cody-power-switch.cody-toggle {
  grid-template-columns: auto;
  justify-content: center;
  width: 66px;
  min-width: 0;
  min-height: 42px;
  padding: 7px 9px;
}

.projects-page .cody-power-label,
.projects-page .cody-power-copy,
.projects-page .cody-role-copy small,
.projects-page .cody-choice-state {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

body:not(.login-body) .projects-page .cody-role-choice.cody-toggle {
  grid-template-columns: 18px auto;
  width: auto;
  min-width: 104px;
  min-height: 42px;
  gap: 8px;
  padding: 8px 11px;
}

.projects-page .heartbeat-control {
  grid-column: 1 / -1;
  order: 4;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.42fr);
  align-items: stretch;
  width: 100%;
  max-width: none;
  margin-left: 0;
  gap: 12px;
  padding: 14px 16px 16px;
}

.projects-page .heartbeat-head {
  grid-column: 1;
  display: grid;
  grid-template-columns: minmax(86px, max-content) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.projects-page .heartbeat-head .heartbeat-title {
  align-self: start;
  padding-top: 16px;
}

.projects-page .heartbeat-head .heartbeat-dot {
  margin-top: 13px;
}

.projects-page .heartbeat-actions {
  width: min(100%, 340px);
  grid-template-columns: repeat(2, 100px);
  align-items: end;
  justify-content: start;
  align-content: start;
  min-height: 105px;
  padding-left: 18px;
  border-left: 1px solid rgba(103, 232, 249, 0.24);
  gap: 7px 8px;
}

.projects-page .heartbeat-start-form {
  display: contents;
}

.projects-page .heartbeat-start-form label {
  position: static;
  grid-column: 1 / -1;
  grid-row: 1;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  color: #94c9d8;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
  white-space: normal;
}

.projects-page .heartbeat-start-form select {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 321px;
}

.projects-page .heartbeat-start-form .heartbeat-button {
  grid-column: 1;
  grid-row: 3;
  min-width: 100px;
}

.projects-page .heartbeat-stop-form {
  grid-column: 2;
  grid-row: 3;
  justify-self: start;
}

body:not(.login-body) .projects-page .heartbeat-start-form .heartbeat-button.ghost-button,
body:not(.login-body) .projects-page .heartbeat-stop-form .heartbeat-button.ghost-button {
  width: 100px;
  min-width: 100px;
}

.projects-page .heartbeat-advanced {
  grid-column: 2;
  align-self: stretch;
  display: grid;
  margin-top: 0;
  border: 1px solid rgba(103, 232, 249, 0.22);
  border-radius: 12px;
  background: rgba(2, 12, 24, 0.42);
}

.projects-page .heartbeat-advanced[open] {
  grid-column: 1 / -1;
}

.projects-page .heartbeat-advanced summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 10px 12px;
  color: #e9fbff;
  cursor: pointer;
  list-style: none;
}

.projects-page .heartbeat-advanced summary::-webkit-details-marker {
  display: none;
}

.projects-page .heartbeat-advanced summary::after {
  content: "Expand";
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  min-width: 72px;
  padding: 4px 9px;
  border: 1px solid rgba(103, 232, 249, 0.28);
  border-radius: 999px;
  color: #a8ecff;
  font-size: 11px;
  font-weight: 850;
  text-align: center;
}

.projects-page .heartbeat-advanced[open] summary::after {
  content: "Collapse";
}

.projects-page .heartbeat-advanced summary span {
  grid-column: 1;
  grid-row: 1;
  color: #f8fbff;
  font-size: 13px;
  font-weight: 850;
}

.projects-page .heartbeat-advanced summary small {
  display: block;
  grid-column: 1;
  grid-row: 2;
  margin-top: 2px;
  color: #94c9d8;
  font-size: 11px;
  line-height: 1.35;
}

.projects-page .heartbeat-advanced-body {
  display: grid;
  gap: 11px;
  padding: 0 12px 12px;
}

.projects-page .heartbeat-advanced .heartbeat-metrics {
  grid-template-columns: minmax(0, 1.25fr) minmax(96px, 0.45fr) minmax(120px, 0.55fr);
}

.projects-page .heartbeat-advanced .heartbeat-interval-form {
  grid-template-columns: auto 74px auto minmax(100px, 150px);
}

.projects-page .heartbeat-advanced .heartbeat-details {
  min-height: 104px;
  max-height: 138px;
}

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

  .projects-page .projects-title-row,
  .projects-page .projects-primary-actions,
  .projects-page .cody-simple-control,
  .projects-page .heartbeat-control,
  .projects-page .heartbeat-advanced {
    grid-column: 1;
  }

  .projects-page .projects-header-actions {
    max-width: none;
    justify-self: stretch;
  }

  .projects-page .heartbeat-control {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: none;
    margin-left: 0;
  }

  .projects-page .heartbeat-head,
  .projects-page .cody-simple-control {
    grid-template-columns: 1fr;
  }

  .projects-page .heartbeat-actions {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-left: 0;
    border-left: 0;
  }

  .projects-page .heartbeat-start-form select {
    width: 100%;
  }

  .projects-page .projects-primary-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 700px) {
  .projects-page .heartbeat-advanced .heartbeat-metrics,
  .projects-page .heartbeat-advanced .heartbeat-interval-form,
  .projects-page .heartbeat-start-form {
    grid-template-columns: 1fr;
  }
}

/* Memory Evolution: plain-language conversation learning coverage. */
.memory-evolution-page .memory-evolution-header p {
  max-width: 840px;
  font-size: 17px;
  line-height: 1.55;
}

.memory-evolution-page .memory-eyebrow {
  display: block;
  margin-bottom: 7px;
  color: #8bb8ff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.memory-evolution-page .memory-notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(96, 165, 250, 0.34);
  border-radius: 10px;
  background: rgba(30, 64, 175, 0.16);
  color: #dbeafe;
  line-height: 1.45;
}

.memory-evolution-page .memory-notice.success {
  border-color: rgba(52, 211, 153, 0.34);
  background: rgba(6, 78, 59, 0.28);
  color: #d1fae5;
}

.memory-evolution-page .memory-notice.error {
  border-color: rgba(248, 113, 113, 0.36);
  background: rgba(127, 29, 29, 0.22);
  color: #fecaca;
}

.memory-evolution-page .conversation-learning-panel,
.memory-evolution-page .conversation-review-panel {
  margin-bottom: 18px;
}

.memory-evolution-page .conversation-learning-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 20px;
}

.memory-evolution-page .conversation-learning-head h2,
.memory-evolution-page .conversation-learning-head p {
  margin-top: 0;
}

.memory-evolution-page .conversation-learning-head p {
  max-width: 760px;
  margin-bottom: 0;
  line-height: 1.5;
}

.memory-evolution-page .conversation-learning-head form {
  flex: 0 0 auto;
  margin: 0;
}

.memory-evolution-page .conversation-coverage-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.memory-evolution-page .conversation-stat-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(132, 157, 193, 0.22);
  border-top: 3px solid #60a5fa;
  border-radius: 12px;
  background: linear-gradient(155deg, rgba(23, 40, 66, 0.92), rgba(11, 24, 43, 0.94));
}

.memory-evolution-page .conversation-stat-card.good {
  border-top-color: #34d399;
}

.memory-evolution-page .conversation-stat-card.caution {
  border-top-color: #fbbf24;
}

.memory-evolution-page .conversation-stat-card.attention,
.memory-evolution-page .conversation-stat-card.privacy {
  border-top-color: #fb7185;
}

.memory-evolution-page .conversation-stat-card.proposed {
  border-top-color: #a78bfa;
}

.memory-evolution-page .conversation-stat-card > span,
.memory-evolution-page .conversation-stat-card > strong,
.memory-evolution-page .conversation-stat-card > small {
  display: block;
}

.memory-evolution-page .conversation-stat-card > span {
  min-height: 34px;
  color: #bdcce1;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.memory-evolution-page .conversation-stat-card > strong {
  margin: 7px 0 6px;
  color: #f8fbff;
  font-size: 30px;
  line-height: 1;
}

.memory-evolution-page .conversation-stat-card > small {
  color: #91a2ba;
  font-size: 11px;
  line-height: 1.4;
}

.memory-evolution-page .conversation-safety-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.memory-evolution-page .conversation-project-coverage {
  margin-top: 18px;
}

.memory-evolution-page .conversation-project-coverage h3 {
  margin: 0 0 9px;
  color: #eaf2ff;
  font-size: 15px;
}

.memory-evolution-page .conversation-project-coverage th,
.memory-evolution-page .conversation-project-coverage td {
  font-size: 12px;
}

.memory-evolution-page .conversation-safety-grid article {
  padding: 15px;
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 10px;
  background: rgba(7, 18, 34, 0.58);
}

.memory-evolution-page .conversation-safety-grid strong {
  display: block;
  color: #eaf2ff;
  font-size: 13px;
}

.memory-evolution-page .conversation-safety-grid p {
  margin: 7px 0 0;
  color: #aebdd2;
  font-size: 12px;
  line-height: 1.5;
}

.memory-evolution-page .conversation-sync-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(137, 161, 196, 0.16);
  color: #aebdd2;
  font-size: 12px;
}

.memory-evolution-page .conversation-sync-meta strong {
  color: #dbe7f9;
}

.memory-evolution-page .conversation-review-list {
  display: grid;
  gap: 12px;
}

.memory-evolution-page .conversation-review-item {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(360px, 0.9fr);
  gap: 24px;
  align-items: center;
  padding: 17px;
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(50, 39, 20, 0.34), rgba(10, 23, 42, 0.74));
}

.memory-evolution-page .conversation-source-kind {
  display: inline-block;
  padding: 3px 7px;
  border: 1px solid rgba(96, 165, 250, 0.34);
  border-radius: 999px;
  color: #bfdbfe;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.memory-evolution-page .conversation-source-copy h3 {
  margin: 8px 0 5px;
  color: #f8fbff;
  font-size: 16px;
}

.memory-evolution-page .conversation-source-copy p {
  margin: 0 0 5px;
  color: #b7c4d7;
  font-size: 12px;
  line-height: 1.45;
}

.memory-evolution-page .conversation-review-actions {
  display: grid;
  gap: 9px;
}

.memory-evolution-page .conversation-review-actions form {
  margin: 0;
}

.memory-evolution-page .conversation-assign-form label {
  display: block;
  margin-bottom: 5px;
  color: #dbe7f9;
  font-size: 11px;
  font-weight: 800;
}

.memory-evolution-page .conversation-assign-form > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.memory-evolution-page .conversation-assign-form select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
}

body:not(.login-body).memory-evolution-page .conversation-review-actions .secondary-button,
body:not(.login-body).memory-evolution-page .conversation-review-actions .danger-soft-button {
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 800;
}

.memory-evolution-page .memory-empty-state {
  padding: 18px;
  border: 1px solid rgba(52, 211, 153, 0.28);
  border-radius: 11px;
  background: rgba(6, 78, 59, 0.2);
}

.memory-evolution-page .memory-empty-state strong {
  color: #d1fae5;
}

.memory-evolution-page .memory-empty-state p {
  margin: 5px 0 0;
  color: #a7d8c8;
  font-size: 13px;
}

@media (max-width: 1120px) {
  .memory-evolution-page .conversation-coverage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .memory-evolution-page .conversation-review-item {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .memory-evolution-page .conversation-learning-head,
  .memory-evolution-page .conversation-learning-head form,
  .memory-evolution-page .conversation-learning-head .button {
    display: grid;
    width: 100%;
  }

  .memory-evolution-page .conversation-coverage-grid,
  .memory-evolution-page .conversation-safety-grid {
    grid-template-columns: 1fr;
  }

  .memory-evolution-page .conversation-stat-card > span {
    min-height: 0;
  }

  .memory-evolution-page .conversation-assign-form > div {
    grid-template-columns: 1fr;
  }
}

/* Lexie layout repair: keep the composer inside the chat column and make
   medium-width conversation history an on-demand drawer. */
body.lexie-page-body .chat-command-header {
  gap: 16px;
}

body.lexie-page-body .chat-command-header .actions {
  align-content: center;
  gap: 8px;
}

body.lexie-page-body .lexie-context-panel {
  margin-bottom: 16px;
}

body.lexie-page-body .lexie-layout {
  position: relative;
  grid-template-columns: minmax(220px, 250px) minmax(0, 1fr);
  gap: 18px;
  min-height: 0;
  overflow: hidden;
}

.lexie-chat-pane {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

body.lexie-page-body .lexie-thread {
  width: 100%;
  height: auto;
  min-height: 0;
  max-width: none;
  margin: 0;
  padding: 10px 12px 20px;
  overflow-x: hidden;
  overflow-y: auto;
}

body.lexie-page-body .lexie-sidebar,
body.lexie-page-body .lexie-thread {
  scrollbar-color: rgba(125, 158, 209, 0.52) transparent;
  scrollbar-width: thin;
}

body.lexie-page-body .lexie-sidebar::-webkit-scrollbar,
body.lexie-page-body .lexie-thread::-webkit-scrollbar {
  width: 6px;
}

body.lexie-page-body .lexie-sidebar::-webkit-scrollbar-track,
body.lexie-page-body .lexie-thread::-webkit-scrollbar-track {
  background: transparent;
}

body.lexie-page-body .lexie-sidebar::-webkit-scrollbar-thumb,
body.lexie-page-body .lexie-thread::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(125, 158, 209, 0.52);
}

body.lexie-page-body .lexie-welcome {
  margin-top: clamp(24px, 6vh, 72px);
}

body.lexie-page-body .lexie-chat-pane .chat-composer-wrap {
  position: static;
  inset: auto;
  z-index: auto;
  width: 100%;
  min-width: 0;
  padding: 0;
  background: none;
}

body.lexie-page-body .lexie-chat-pane .chat-composer {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 10px;
}

body.lexie-page-body .lexie-chat-pane .chat-composer:focus-within {
  border-color: rgba(96, 165, 250, 0.82);
  box-shadow: 0 18px 48px rgba(37, 99, 235, 0.2), inset 0 0 0 1px rgba(96, 165, 250, 0.2);
}

body.lexie-page-body .lexie-chat-pane .chat-composer-toolbar button {
  min-height: 38px;
  padding: 8px 10px;
}

body.lexie-page-body .lexie-chat-pane .chat-composer textarea {
  min-height: 64px;
  max-height: 220px;
  padding: 10px 12px;
}

body.lexie-page-body button.lexie-choice-card {
  background: var(--idi-card-radial), var(--idi-card);
  border-color: var(--idi-border);
  color: var(--idi-text);
  box-shadow: var(--idi-card-shadow);
}

body.lexie-page-body button.lexie-choice-card:hover,
body.lexie-page-body button.lexie-choice-card:focus-visible {
  background: linear-gradient(180deg, rgba(31, 54, 88, 0.96), rgba(20, 38, 66, 0.96));
  border-color: var(--idi-border-strong);
  color: #ffffff;
}

body.lexie-page-body .conversation-row .conversation-link {
  padding-right: 42px;
}

body.lexie-page-body .conversation-action-button {
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
}

.lexie-conversations-toggle,
.lexie-conversations-backdrop {
  display: none;
}

@media (max-width: 1180px) {
  body.lexie-page-body .main {
    padding-right: 24px;
    padding-left: 24px;
  }

  body.lexie-page-body .lexie-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  body.lexie-page-body .lexie-context-head {
    padding: 10px 14px;
  }

  body.lexie-page-body .lexie-context-grid div {
    gap: 4px;
    padding: 10px 14px;
  }

  body.lexie-page-body .lexie-context-grid span {
    font-size: 12px;
  }

  body.lexie-page-body .lexie-context-grid strong {
    font-size: 14px;
  }

  body.lexie-page-body .lexie-conversations-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  body.lexie-page-body .lexie-sidebar.panel {
    position: absolute;
    inset: 0 auto 0 0;
    z-index: 32;
    width: min(320px, calc(100% - 24px));
    height: 100%;
    transform: translateX(calc(-100% - 20px));
    visibility: hidden;
    pointer-events: none;
    transition: transform 180ms ease, visibility 180ms ease;
  }

  body.lexie-page-body .conversation-rail-open .lexie-sidebar.panel {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  body.lexie-page-body button.lexie-conversations-backdrop {
    position: absolute;
    inset: 0;
    z-index: 24;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: rgba(1, 8, 20, 0.7);
    box-shadow: none;
  }

  body.lexie-page-body button.lexie-conversations-backdrop[hidden] {
    display: none;
  }

  body.lexie-page-body .lexie-welcome {
    margin-top: clamp(20px, 5vh, 54px);
  }
}

@media (max-width: 900px) {
  body.lexie-page-body .main {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    padding: 68px 16px 16px !important;
  }

  body.lexie-page-body .lexie-shell {
    height: 100%;
    min-height: 0;
  }

  body.lexie-page-body .chat-command-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    margin-bottom: 12px;
  }

  body.lexie-page-body .chat-command-header h1 {
    font-size: 27px;
  }

  body.lexie-page-body .chat-command-header p {
    display: none;
  }

  body.lexie-page-body .chat-command-header .actions {
    justify-content: flex-start;
    gap: 7px;
  }

  body.lexie-page-body .chat-command-header .actions > a,
  body.lexie-page-body .chat-command-header .actions > button,
  body.lexie-page-body .lexie-status-pill {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 12px;
  }

  body.lexie-page-body .lexie-context-panel {
    margin-bottom: 12px;
  }

  body.lexie-page-body .lexie-context-head {
    padding: 9px 12px;
  }

  body.lexie-page-body .lexie-memory-active {
    padding: 6px 9px;
    font-size: 11px;
  }

  body.lexie-page-body .lexie-context-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.lexie-page-body .lexie-context-grid div {
    gap: 3px;
    padding: 9px 12px;
    border-right: 1px solid rgba(137, 161, 196, 0.14);
    border-bottom: 1px solid rgba(137, 161, 196, 0.14);
  }

  body.lexie-page-body .lexie-context-grid div:nth-child(2n) {
    border-right: 0;
  }

  body.lexie-page-body .lexie-context-grid div:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  body.lexie-page-body .lexie-context-grid span {
    font-size: 11px;
  }

  body.lexie-page-body .lexie-context-grid strong {
    font-size: 13px;
  }

  .lexie-chat-pane {
    gap: 8px;
  }

  body.lexie-page-body .lexie-thread {
    padding: 6px 5px 12px;
  }

  body.lexie-page-body .lexie-chat-pane .chat-composer {
    padding: 8px;
  }

  body.lexie-page-body .lexie-chat-pane .chat-composer-toolbar {
    flex-wrap: nowrap;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  body.lexie-page-body .lexie-chat-pane .chat-composer-toolbar::-webkit-scrollbar {
    display: none;
  }

  body.lexie-page-body .lexie-chat-pane .chat-composer-toolbar button {
    flex: 0 0 auto;
    min-height: 36px;
  }

  body.lexie-page-body .composer-input-row {
    grid-template-columns: 40px minmax(0, 1fr) 64px;
    gap: 8px;
  }

  body.lexie-page-body .icon-button,
  body.lexie-page-body .send-button {
    min-height: 40px;
  }

  body.lexie-page-body .lexie-welcome {
    margin-top: 16px;
    padding: 0 8px;
  }

  body.lexie-page-body .lexie-welcome h2 {
    font-size: clamp(25px, 8vw, 34px);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.lexie-page-body .lexie-sidebar.panel {
    transition: none;
  }
}

/* Mission Control final polish: keep the page on the same dark command-center system. */
body:not(.login-body) .mission-command-page {
  width: 100%;
  max-width: 1320px;
  color: #eaf2ff;
}

body:not(.login-body) .mission-command-page .workers-command-header {
  gap: 18px;
  align-items: center;
}

body:not(.login-body) .mission-command-page .mission-title-icon {
  color: #bfdbfe;
  background:
    radial-gradient(circle at 34% 28%, rgba(125, 211, 252, 0.22), transparent 42%),
    linear-gradient(180deg, rgba(37, 99, 235, 0.44), rgba(15, 30, 52, 0.95));
  border-color: rgba(96, 165, 250, 0.42);
}

body:not(.login-body) .mission-command-page .workers-command-header h1,
body:not(.login-body) .mission-command-page .workers-table-head h2,
body:not(.login-body) .mission-command-page .command-node strong,
body:not(.login-body) .mission-command-page .command-worker-node strong,
body:not(.login-body) .mission-command-page .workers-command-table td:first-child strong,
body:not(.login-body) .mission-command-page .worker-model-stack strong {
  color: #f8fbff;
}

body:not(.login-body) .mission-command-page .workers-command-header p,
body:not(.login-body) .mission-command-page .workers-table-head .muted,
body:not(.login-body) .mission-command-page .command-node span,
body:not(.login-body) .mission-command-page .command-worker-node small,
body:not(.login-body) .mission-command-page .worker-model-stack,
body:not(.login-body) .mission-command-page .worker-model-stack span,
body:not(.login-body) .mission-command-page .worker-model-stack small {
  color: #b7c4d7;
}

body:not(.login-body) .mission-command-page .command-org-panel,
body:not(.login-body) .mission-command-page .mission-worker-panel {
  background:
    radial-gradient(circle at 18% 0%, rgba(34, 211, 238, 0.1), transparent 34%),
    radial-gradient(circle at 74% 0%, rgba(59, 130, 246, 0.14), transparent 36%),
    linear-gradient(180deg, rgba(17, 30, 51, 0.97), rgba(8, 19, 35, 0.97));
  border-color: rgba(96, 165, 250, 0.24);
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

body:not(.login-body) .mission-command-page .command-node,
body:not(.login-body) .mission-command-page .command-worker-node,
body:not(.login-body) .mission-command-page .command-summary-card,
body:not(.login-body) .mission-command-page .table-wrap {
  background: linear-gradient(180deg, rgba(13, 27, 48, 0.96), rgba(7, 17, 31, 0.96));
  border-color: rgba(126, 166, 222, 0.24);
}

body:not(.login-body) .mission-command-page .command-node.leader {
  border-color: rgba(147, 197, 253, 0.42);
  background:
    radial-gradient(circle at 50% 0%, rgba(250, 204, 21, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(27, 43, 70, 0.96), rgba(10, 22, 39, 0.96));
}

body:not(.login-body) .mission-command-page .command-node.coordinator,
body:not(.login-body) .mission-command-page .command-node.manager,
body:not(.login-body) .mission-command-page .command-worker-node.working {
  border-color: rgba(96, 165, 250, 0.58);
  background: linear-gradient(180deg, rgba(30, 64, 122, 0.72), rgba(11, 30, 55, 0.96));
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

body:not(.login-body) .mission-command-page .command-worker-node.active {
  border-color: rgba(45, 212, 191, 0.4);
  background: linear-gradient(180deg, rgba(13, 76, 67, 0.6), rgba(8, 36, 40, 0.94));
}

body:not(.login-body) .mission-command-page .command-worker-node.waiting {
  border-color: rgba(251, 191, 36, 0.28);
  background: linear-gradient(180deg, rgba(73, 50, 20, 0.48), rgba(26, 27, 30, 0.94));
}

body:not(.login-body) .mission-command-page .worker-symbol,
body:not(.login-body) .mission-command-page .worker-row-icon {
  background: rgba(37, 99, 235, 0.16);
  border: 1px solid rgba(96, 165, 250, 0.18);
  color: #93c5fd;
}

body:not(.login-body) .mission-command-page .command-worker-node.active .worker-symbol {
  background: rgba(20, 184, 166, 0.16);
  color: #5eead4;
}

body:not(.login-body) .mission-command-page .command-line {
  background: linear-gradient(180deg, #60a5fa, #2563eb);
}

body:not(.login-body) .mission-command-page .command-branch {
  border-color: rgba(96, 165, 250, 0.72);
}

body:not(.login-body) .mission-command-page .command-summary-card dt,
body:not(.login-body) .mission-command-page .command-summary-card dd {
  border-bottom-color: rgba(137, 161, 196, 0.13);
}

body:not(.login-body) .mission-command-page .command-summary-card dt,
body:not(.login-body) .mission-command-page .workers-command-table th {
  color: #aebbd0;
}

body:not(.login-body) .mission-command-page .command-summary-card dd,
body:not(.login-body) .mission-command-page .workers-command-table td {
  color: #dbe7f9;
}

body:not(.login-body) .mission-command-page .workers-filter-row .checklist-tab,
body:not(.login-body) .mission-command-page .worker-group-control,
body:not(.login-body) .mission-command-page .workers-table-toolbar .icon-button,
body:not(.login-body) .mission-command-page .workers-command-actions .ghost-button,
body:not(.login-body) .mission-command-page .workers-command-actions .auto-refresh-dot,
body:not(.login-body) .mission-command-page .workers-command-actions .icon-button {
  background: linear-gradient(180deg, rgba(20, 38, 66, 0.96), rgba(10, 22, 39, 0.96));
  border-color: rgba(126, 166, 222, 0.24);
  color: #dbe7f9;
}

body:not(.login-body) .mission-command-page .workers-filter-row .checklist-tab.active,
body:not(.login-body) .mission-command-page .workers-table-toolbar .icon-button.active {
  color: #ffffff;
  background: linear-gradient(180deg, #315ee8, #2444b8);
  border-color: rgba(147, 197, 253, 0.48);
}

body:not(.login-body) .mission-command-page .workers-command-table th {
  background: rgba(6, 14, 26, 0.88);
  border-bottom-color: rgba(137, 161, 196, 0.18);
}

body:not(.login-body) .mission-command-page .workers-command-table td {
  background: rgba(8, 18, 32, 0.36);
  border-bottom-color: rgba(137, 161, 196, 0.1);
}

body:not(.login-body) .mission-command-page .workers-command-table tbody tr:hover td {
  background: rgba(37, 99, 235, 0.1);
}

body:not(.login-body) .mission-command-page .worker-state-pill {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(51, 65, 85, 0.62);
  color: #dbe7f9;
}

body:not(.login-body) .mission-command-page .worker-state-pill.working {
  background: rgba(37, 99, 235, 0.84);
  border-color: rgba(147, 197, 253, 0.38);
  color: #eff6ff;
}

body:not(.login-body) .mission-command-page .worker-state-pill.active,
body:not(.login-body) .mission-command-page .worker-state-pill.done {
  background: rgba(13, 148, 136, 0.56);
  border-color: rgba(94, 234, 212, 0.3);
  color: #ccfbf1;
}

body:not(.login-body) .mission-command-page .worker-state-pill.waiting {
  background: rgba(146, 64, 14, 0.46);
  border-color: rgba(251, 191, 36, 0.28);
  color: #fde68a;
}

body:not(.login-body) .mission-command-page .worker-state-pill.idle {
  background: rgba(51, 65, 85, 0.58);
  color: #cbd5e1;
}

body:not(.login-body) .mission-command-page .status-dot.waiting,
body:not(.login-body) .mission-command-page .worker-state-pill.waiting i,
body:not(.login-body) .mission-command-page .command-worker-node.waiting small i {
  background: #fbbf24;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.14);
}

body:not(.login-body) .mission-command-page .mini-progress {
  background: rgba(51, 65, 85, 0.82);
}

body:not(.login-body) .mission-command-page .mini-progress span {
  background: linear-gradient(90deg, #22d3ee, #3b82f6);
}

body:not(.login-body) .mission-command-page .row-menu {
  background: rgba(15, 30, 52, 0.95);
  border-color: rgba(126, 166, 222, 0.22);
  color: #dbe7f9;
}

body:not(.login-body) .mission-command-page select option {
  background: #08111d;
  color: #eaf2ff;
}

/* Lexie compact workspace: keep context and helpers available without
   letting them crowd the conversation. */
body.lexie-page-body .main {
  padding: 14px 24px 0;
}

body.lexie-page-body .lexie-shell {
  height: calc(100vh - 14px);
  grid-template-rows: auto auto minmax(0, 1fr);
}

body.lexie-page-body .chat-command-header {
  align-items: center;
  min-height: 36px;
  gap: 12px;
  margin-bottom: 4px;
}

body.lexie-page-body .chat-command-header > h1 {
  margin: 0;
  color: var(--idi-text);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

body.lexie-page-body .chat-command-header .actions {
  flex-wrap: nowrap;
  gap: 6px;
}

body.lexie-page-body .chat-command-header .actions > button,
body.lexie-page-body .lexie-header-more > summary {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 7px 11px;
  border: 1px solid var(--idi-border);
  border-radius: 9px;
  background: rgba(22, 38, 63, 0.88);
  color: #e8f1ff;
  box-shadow: none;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

body.lexie-page-body .lexie-conversations-toggle {
  display: inline-flex;
}

body.lexie-page-body .lexie-header-more {
  position: relative;
  z-index: 70;
}

body.lexie-page-body .lexie-header-more > summary,
body.lexie-page-body .lexie-tools-disclosure > summary,
body.lexie-page-body .lexie-starters > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}

body.lexie-page-body .lexie-header-more > summary::-webkit-details-marker,
body.lexie-page-body .lexie-tools-disclosure > summary::-webkit-details-marker,
body.lexie-page-body .lexie-starters > summary::-webkit-details-marker {
  display: none;
}

body.lexie-page-body .lexie-header-more[open] > summary {
  border-color: var(--idi-border-strong);
  background: rgba(37, 99, 235, 0.26);
}

body.lexie-page-body .lexie-header-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 80;
  display: grid;
  width: min(280px, calc(100vw - 40px));
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--idi-border);
  border-radius: 11px;
  background: rgba(9, 22, 40, 0.98);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
}

body.lexie-page-body .lexie-header-menu > a,
body.lexie-page-body .lexie-header-menu > form > button {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  justify-content: flex-start;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #dbe7f9;
  box-shadow: none;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
}

body.lexie-page-body .lexie-header-menu > a:hover,
body.lexie-page-body .lexie-header-menu > form > button:hover {
  border-color: rgba(96, 165, 250, 0.36);
  background: rgba(37, 99, 235, 0.18);
}

body.lexie-page-body .lexie-header-menu form {
  display: grid;
  width: 100%;
  margin: 0;
}

body.lexie-page-body .lexie-header-menu .inline-rename-form {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(137, 161, 196, 0.16);
}

body.lexie-page-body .lexie-header-menu .inline-rename-form input {
  min-width: 0;
  min-height: 38px;
  padding: 7px 9px;
  font-size: 12px;
}

body.lexie-page-body .lexie-header-menu .inline-rename-form button {
  min-height: 38px;
  padding: 7px 9px;
  font-size: 11px;
}

body.lexie-page-body .lexie-context-trail {
  display: flex;
  min-width: 0;
  min-height: 30px;
  align-items: center;
  margin-bottom: 6px;
  overflow: hidden;
  border-bottom: 1px solid rgba(137, 161, 196, 0.15);
}

body.lexie-page-body .lexie-context-trail ol {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 2px 3px 6px;
  list-style: none;
}

body.lexie-page-body .lexie-context-trail li {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  color: #91a4bf;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

body.lexie-page-body .lexie-context-trail li > strong {
  overflow: hidden;
  color: #dbe7f9;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
}

body.lexie-page-body .lexie-context-trail .lexie-context-separator {
  color: #60738e;
  font-size: 16px;
}

body.lexie-page-body .lexie-context-status {
  padding: 4px 7px;
  border: 1px solid rgba(137, 161, 196, 0.16);
  border-radius: 999px;
  background: rgba(16, 31, 52, 0.66);
}

body.lexie-page-body .lexie-mini-dot {
  width: 7px;
  height: 7px;
  box-shadow: none;
}

body.lexie-page-body .lexie-mini-dot.blue {
  background: #60a5fa;
}

body.lexie-page-body .lexie-layout {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

body.lexie-page-body .lexie-sidebar.panel {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 32;
  width: min(320px, calc(100% - 24px));
  height: 100%;
  transform: translateX(calc(-100% - 20px));
  visibility: hidden;
  pointer-events: none;
  transition: transform 180ms ease, visibility 180ms ease;
}

body.lexie-page-body .conversation-rail-open .lexie-sidebar.panel {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

body.lexie-page-body button.lexie-conversations-backdrop {
  position: absolute;
  inset: 0;
  z-index: 24;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: rgba(1, 8, 20, 0.7);
  box-shadow: none;
}

body.lexie-page-body button.lexie-conversations-backdrop[hidden] {
  display: none;
}

body.lexie-page-body .lexie-chat-pane {
  gap: 8px;
}

body.lexie-page-body .lexie-thread {
  padding: 6px 10px 12px;
}

body.lexie-page-body .lexie-welcome {
  display: grid;
  max-width: 820px;
  gap: 9px;
  justify-items: center;
  margin: clamp(10px, 2vh, 20px) auto 0;
  padding: 0 12px;
  text-align: center;
}

body.lexie-page-body .lexie-welcome-copy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  text-align: left;
}

body.lexie-page-body .lexie-welcome-mark {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  font-size: 12px;
}

body.lexie-page-body .lexie-welcome h2 {
  margin: 0;
  color: #f8fbff;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.08;
}

body.lexie-page-body .lexie-welcome p {
  margin: 3px 0 0;
  color: #9dafc7;
  font-size: 13px;
  line-height: 1.3;
}

body.lexie-page-body .lexie-starters {
  width: min(100%, 820px);
}

body.lexie-page-body .lexie-starters > summary,
body.lexie-page-body .lexie-tools-disclosure > summary {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border: 1px solid rgba(137, 161, 196, 0.22);
  border-radius: 8px;
  background: rgba(18, 34, 57, 0.82);
  color: #c7d4e7;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

body.lexie-page-body .lexie-starters-open {
  display: none;
}

body.lexie-page-body .lexie-starters[open] .lexie-starters-open {
  display: inline;
}

body.lexie-page-body .lexie-starters[open] .lexie-starters-closed {
  display: none;
}

body.lexie-page-body .lexie-choice-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  margin-top: 8px;
}

body.lexie-page-body button.lexie-choice-card {
  min-height: 66px;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  text-align: left;
}

body.lexie-page-body button.lexie-choice-card strong {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

body.lexie-page-body button.lexie-choice-card span {
  font-size: 11px;
  line-height: 1.25;
}

body.lexie-page-body .lexie-chat-pane .chat-composer {
  position: relative;
  gap: 6px;
  padding: 8px;
  border-radius: 12px;
  overflow: visible;
}

body.lexie-page-body .lexie-tools-disclosure {
  position: relative;
  z-index: 62;
  align-self: center;
  margin: 0;
}

body.lexie-page-body .lexie-tools-disclosure > summary {
  min-height: 40px;
}

body.lexie-page-body .lexie-tools-disclosure[open] > summary {
  border-color: rgba(96, 165, 250, 0.56);
  background: rgba(37, 99, 235, 0.2);
  color: #eaf2ff;
}

body.lexie-page-body .lexie-chat-pane .chat-composer-toolbar {
  position: absolute;
  bottom: calc(100% + 8px);
  left: -48px;
  z-index: 64;
  width: min(520px, calc(100vw - 32px));
  flex-wrap: wrap;
  gap: 6px;
  max-height: none;
  margin: 0;
  padding: 8px;
  overflow: visible;
  border: 1px solid var(--idi-border);
  border-radius: 10px;
  background: rgba(9, 22, 40, 0.98);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.36);
}

body.lexie-page-body .lexie-chat-pane .chat-composer-toolbar button {
  min-height: 30px;
  padding: 6px 9px;
  font-size: 11px;
}

body.lexie-page-body .lexie-chat-pane .chat-composer textarea {
  min-height: 44px;
  max-height: 128px;
  padding: 8px 10px;
  font-size: 14px;
  line-height: 1.4;
}

body.lexie-page-body .composer-input-row {
  grid-template-columns: 44px auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

body.lexie-page-body .attachment-chip-row:empty {
  display: none;
}

body.lexie-page-body .composer-input-row .icon-button,
body.lexie-page-body .composer-input-row .send-button {
  min-height: 40px;
}

body.lexie-page-body .lexie-header-more > summary:focus-visible,
body.lexie-page-body .lexie-header-menu a:focus-visible,
body.lexie-page-body .lexie-header-menu button:focus-visible,
body.lexie-page-body .lexie-starters > summary:focus-visible,
body.lexie-page-body .lexie-tools-disclosure > summary:focus-visible,
body.lexie-page-body button.lexie-choice-card:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

@media (max-width: 900px) {
  body.lexie-page-body .lexie-shell {
    height: 100%;
  }

  body.lexie-page-body .chat-command-header {
    display: flex;
    grid-template-columns: none;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
  }

  body.lexie-page-body .chat-command-header > h1 {
    font-size: 22px;
  }

  body.lexie-page-body .chat-command-header .actions {
    justify-content: flex-end;
  }

  body.lexie-page-body .chat-command-header .actions > button,
  body.lexie-page-body .lexie-header-more > summary {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 11px;
  }

  body.lexie-page-body .lexie-context-trail {
    min-height: 28px;
    margin-bottom: 4px;
  }

  body.lexie-page-body .lexie-context-trail ol {
    gap: 6px;
    padding-bottom: 5px;
  }

  body.lexie-page-body .lexie-context-trail li,
  body.lexie-page-body .lexie-context-trail li > strong {
    font-size: 11px;
  }

  body.lexie-page-body .lexie-welcome {
    margin-top: 10px;
  }

  body.lexie-page-body .lexie-welcome h2 {
    font-size: 20px;
  }

  body.lexie-page-body .lexie-welcome p {
    font-size: 12px;
  }

  body.lexie-page-body .lexie-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.lexie-page-body .lexie-chat-pane .chat-composer-toolbar {
    flex-wrap: wrap;
    overflow: visible;
  }

  body.lexie-page-body .lexie-chat-pane .chat-composer-toolbar button {
    min-height: 36px;
  }

  body.lexie-page-body .lexie-tools-disclosure > summary,
  body.lexie-page-body .composer-input-row .icon-button,
  body.lexie-page-body .composer-input-row .send-button {
    height: 44px;
    min-height: 44px;
  }
}

@media (max-width: 520px) {
  body.lexie-page-body .chat-command-header .actions > button,
  body.lexie-page-body .lexie-header-more > summary {
    min-height: 40px;
  }

  body.lexie-page-body .lexie-context-status.local {
    display: none;
  }

  body.lexie-page-body .lexie-context-trail li:first-child,
  body.lexie-page-body .lexie-context-trail li:nth-child(3) {
    max-width: 112px;
  }

  body.lexie-page-body .lexie-welcome-copy {
    text-align: center;
  }

  body.lexie-page-body .lexie-welcome-mark {
    display: none;
  }

  body.lexie-page-body .lexie-choice-grid {
    grid-template-columns: 1fr;
  }

  body.lexie-page-body button.lexie-choice-card {
    min-height: 44px;
    padding: 9px 10px;
  }

  body.lexie-page-body button.lexie-choice-card span {
    display: none;
  }

  body.lexie-page-body .lexie-header-menu {
    position: fixed;
    top: 116px;
    right: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.lexie-page-body .lexie-sidebar.panel {
    transition: none;
  }
}
