.lt-code-agent-root {
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.9);
  background: #101010;
}

.code-agent-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  padding: clamp(0.75rem, 1.35vw, 1.15rem);
  gap: 0.75rem;
}

.code-agent-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
  min-height: 3.25rem;
}

.code-agent-head h2,
.code-agent-panel h3 {
  margin: 0;
  color: #fff;
}

.code-agent-head p,
.code-agent-panel p,
.code-agent-muted {
  margin: 0;
  color: rgba(255, 255, 255, 0.55);
}

.code-agent-main {
  display: grid;
  grid-template-columns: minmax(18rem, 22rem) minmax(0, 1fr);
  gap: 0.75rem;
  min-height: 0;
}

.code-agent-actions,
.code-agent-file-actions {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex-wrap: wrap;
}

.code-agent-actions .primary-button,
.code-agent-actions .secondary-button {
  min-width: 0;
  flex: 1 1 auto;
  justify-content: center;
  white-space: normal;
}

.code-agent-input,
.code-agent-textarea {
  width: 100%;
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
}

.code-agent-input {
  min-height: 2.6rem;
  padding: 0 0.8rem;
}

.code-agent-textarea {
  min-height: 8.5rem;
  padding: 0.8rem;
  resize: vertical;
}

.code-agent-sidebar {
  display: grid;
  grid-template-rows: auto auto minmax(4rem, 0.25fr) auto auto minmax(4rem, 0.25fr) auto minmax(9rem, 0.9fr) minmax(7rem, 0.6fr) auto auto;
  align-content: stretch;
  gap: 0.65rem;
  min-height: 0;
  overflow: hidden;
  padding: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(22, 22, 22, 0.94);
}

.code-agent-tool-section {
  display: grid;
  align-content: start;
  gap: 0.55rem;
  min-width: 0;
  min-height: 0;
}

.code-agent-file-section {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.code-agent-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  min-width: 0;
}

.code-agent-section-head strong {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.86rem;
}

.code-agent-section-head span {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.44);
  font-size: 0.8rem;
}

.code-agent-auth-steps {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.code-agent-auth-steps li {
  display: grid;
  grid-template-columns: 1.35rem minmax(0, 1fr);
  gap: 0.45rem;
  align-items: center;
  min-height: 1.9rem;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.8rem;
}

.code-agent-auth-steps b {
  display: grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.72rem;
}

.code-agent-auth-steps li.done {
  color: rgba(255, 255, 255, 0.86);
}

.code-agent-auth-steps li.done b {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.code-agent-hint {
  margin: 0;
  color: rgba(255, 255, 255, 0.46);
  font-size: 0.78rem;
  line-height: 1.55;
}

.code-agent-sidebar-title,
.code-agent-chat-head span,
.code-agent-section-head span,
.code-agent-details summary,
.code-agent-bubble-title span {
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.82rem;
}

.code-agent-project-list,
.code-agent-agent-list {
  display: grid;
  align-content: start;
  gap: 0.35rem;
  overflow: auto;
  min-height: 0;
}

.code-agent-project-list {
  max-height: none;
}

.code-agent-agent-list {
  max-height: none;
}

.code-agent-project-item,
.code-agent-agent-item {
  display: grid;
  gap: 0.25rem;
  width: 100%;
  padding: 0.65rem 0.7rem;
  text-align: left;
  color: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.code-agent-project-item.active,
.code-agent-agent-item.active {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.11);
}

.code-agent-project-item strong,
.code-agent-agent-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-agent-project-item small,
.code-agent-agent-item small {
  color: rgba(255, 255, 255, 0.45);
}

.code-agent-task-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-width: 0;
}

.code-agent-center {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(18, 18, 18, 0.9);
}

.code-agent-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.6rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.code-agent-chat-head h3 {
  margin: 0;
  color: #fff;
}

.code-agent-chat-scroll {
  min-height: 0;
  overflow: auto;
  padding: 1.1rem;
}

.code-agent-thread {
  display: grid;
  align-content: start;
  gap: 0.9rem;
  width: min(100%, 860px);
  margin: 0 auto;
}

.code-agent-bubble {
  display: grid;
  gap: 0.7rem;
  width: min(86%, 820px);
  padding: 0.9rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
}

.code-agent-bubble.user {
  justify-self: end;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.075);
}

.code-agent-bubble.assistant {
  justify-self: start;
}

.code-agent-bubble p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.code-agent-bubble-title,
.code-agent-bubble-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.code-agent-bubble-title strong {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  color: #fff;
}

.code-agent-bubble-meta span {
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.78rem;
}

.code-agent-composer {
  display: grid;
  gap: 0.7rem;
  width: min(100%, 860px);
  margin: 0 auto;
  padding: 0.9rem 1.1rem 1rem;
}

.code-agent-composer .code-agent-textarea {
  min-height: 7.5rem;
  max-height: 28vh;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.065);
}

.code-agent-composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.code-agent-composer-actions span {
  color: rgba(255, 255, 255, 0.46);
  font-size: 0.82rem;
}

.code-agent-tree {
  display: grid;
  align-content: start;
  gap: 0.35rem;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding-right: 0.25rem;
}

.code-agent-tree button,
.code-agent-op {
  width: 100%;
  text-align: left;
  color: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.code-agent-tree button {
  padding: 0.5rem 0.6rem;
}

.code-agent-tree button.active {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
}

.code-agent-editor {
  min-height: 8rem;
  max-height: 20vh;
  overflow: auto;
  padding: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.82rem;
  line-height: 1.55;
}

.code-agent-plan {
  display: grid;
  align-content: start;
  gap: 0.6rem;
  min-height: 0;
  max-height: 22vh;
  overflow: auto;
  padding-right: 0.2rem;
}

.code-agent-op {
  padding: 0.7rem;
}

.code-agent-op strong {
  display: block;
  color: #fff;
}

.code-agent-op small {
  color: rgba(255, 255, 255, 0.48);
}

.code-agent-op.high {
  border-color: rgba(255, 255, 255, 0.35);
}

.code-agent-log {
  min-height: 7rem;
  max-height: 18vh;
  overflow: auto;
  padding: 0.75rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
  color: rgba(255, 255, 255, 0.78);
  white-space: pre-wrap;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.78rem;
}

.code-agent-step-bubble {
  gap: 0.55rem;
}

.code-agent-step-mark {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.68);
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.78rem;
}

.code-agent-step-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.code-agent-step-meta span {
  max-width: 100%;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.76rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-agent-step-results {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.code-agent-step-result {
  padding: 0.6rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
}

.code-agent-step-result strong {
  display: block;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.82rem;
  word-break: break-word;
}

.code-agent-step-result pre {
  margin: 0.45rem 0 0;
  color: rgba(255, 255, 255, 0.64);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.76rem;
  line-height: 1.5;
}

.code-agent-step-bubble.running .code-agent-step-mark {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.36);
}

.code-agent-step-bubble.waiting .code-agent-step-mark {
  border-color: rgba(255, 255, 255, 0.28);
}

.code-agent-step-bubble.failed .code-agent-step-mark,
.code-agent-op.high {
  border-color: rgba(255, 255, 255, 0.45);
}

.code-agent-step-bubble.failed {
  background: rgba(255, 255, 255, 0.075);
}

.code-agent-details {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.code-agent-details summary {
  cursor: pointer;
  margin-bottom: 0.45rem;
}

.code-agent-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.code-agent-status.ok {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.24);
}

.code-usage-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

.code-usage-summary div {
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
}

.code-usage-summary span,
.code-usage-summary small {
  display: block;
  color: rgba(255, 255, 255, 0.5);
}

.code-usage-summary b {
  display: block;
  margin: 0.2rem 0;
  color: #fff;
  font-size: 1.2rem;
}

.code-usage-table-wrap {
  overflow: auto;
  max-height: 22rem;
}

.code-usage-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 44rem;
}

.code-usage-table th,
.code-usage-table td {
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  color: rgba(255, 255, 255, 0.82);
}

.code-usage-table th {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.78rem;
}

.compact-pricing {
  grid-template-columns: minmax(0, 1fr) !important;
}

@media (max-width: 1180px) {
  .lt-code-agent-root {
    height: auto;
    overflow: visible;
  }

  .code-agent-shell {
    height: auto;
    min-height: 100vh;
  }

  .code-agent-main {
    grid-template-columns: 16rem minmax(0, 1fr);
  }
}

@media (max-width: 980px) {
  .code-agent-head {
    grid-template-columns: 1fr;
  }

  .code-agent-main {
    grid-template-columns: 1fr;
  }

  .code-agent-sidebar,
  .code-agent-center {
    max-height: none;
    overflow: visible;
  }

  .code-agent-sidebar {
    grid-template-rows: none;
  }

  .code-agent-chat-scroll {
    max-height: 54vh;
  }

  .code-agent-tree,
  .code-agent-project-list,
  .code-agent-agent-list {
    max-height: 18rem;
  }

  .code-usage-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
