body {
  background: #f8fafc;
}

main {
  max-width: 1120px;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.item-actions .dropdown-menu {
  min-width: 12rem;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.page-actions .dropdown-menu {
  min-width: 12rem;
}

.details-card-summary {
  cursor: pointer;
  list-style-position: inside;
}

.details-card-summary::marker {
  color: #2563eb;
}

.message-content {
  white-space: pre-wrap;
  word-break: break-word;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 1rem;
}

.message-rendered {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.65rem;
  color: #1f2937;
  font-size: 0.98rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
  padding: 1rem 1.1rem;
}

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

.message-rendered h3,
.message-rendered h4,
.message-rendered h5,
.message-rendered h6 {
  color: #111827;
  font-weight: 700;
  line-height: 1.3;
  margin: 1.15rem 0 0.55rem;
}

.message-rendered h3:first-child,
.message-rendered h4:first-child,
.message-rendered h5:first-child,
.message-rendered h6:first-child {
  margin-top: 0;
}

.message-rendered h1,
.message-rendered h2 {
  border-bottom: 1px solid #e5e7eb;
  color: #0f172a;
  font-weight: 750;
  line-height: 1.25;
  margin: 1.2rem 0 0.75rem;
  padding-bottom: 0.35rem;
}

.message-rendered h1:first-child,
.message-rendered h2:first-child {
  margin-top: 0;
}

.message-rendered p {
  margin-bottom: 0.8rem;
}

.message-rendered ul,
.message-rendered ol {
  margin-bottom: 0.85rem;
  padding-left: 1.4rem;
}

.message-rendered li {
  margin-bottom: 0.3rem;
}

.message-rendered blockquote {
  background: #f8fafc;
  border-left: 0.25rem solid #94a3b8;
  color: #475569;
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.85rem;
}

.message-rendered code {
  background: #e0f2fe;
  border-radius: 0.35rem;
  color: #075985;
  font-size: 0.92em;
  padding: 0.1rem 0.35rem;
}

.message-code-shell {
  background: #0b1120;
  border: 1px solid #334155;
  border-radius: 0.65rem;
  box-shadow: 0 0.5rem 1.25rem rgba(15, 23, 42, 0.12);
  margin: 0 0 0.95rem;
  overflow-x: auto;
}

.message-code-toolbar {
  align-items: center;
  background: #111827;
  border-bottom: 1px solid #334155;
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0.55rem 0.35rem 0.75rem;
}

.message-code-label {
  color: #bfdbfe;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.message-code-copy {
  border-color: #64748b;
  color: #e2e8f0;
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
}

.message-code-copy:hover,
.message-code-copy:focus {
  background: #dbeafe;
  border-color: #dbeafe;
  color: #0f172a;
}

.message-rendered pre {
  background: #0b1120;
  margin: 0;
  overflow-x: auto;
  padding: 1rem;
}

.message-rendered pre code {
  background: transparent;
  color: #f8fafc;
  display: block;
  font-size: 0.9rem;
  line-height: 1.55;
  padding: 0;
}

.message-rendered table {
  border-collapse: collapse;
  display: block;
  margin-bottom: 0.9rem;
  overflow-x: auto;
  width: 100%;
}

.message-rendered th,
.message-rendered td {
  border: 1px solid #e5e7eb;
  padding: 0.45rem 0.6rem;
}

.message-rendered th {
  background: #f8fafc;
  color: #111827;
  font-weight: 700;
}

.message-rendered a {
  color: #2563eb;
}

.diff-viewer,
.history-output {
  max-height: 32rem;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 0.5rem;
  padding: 1rem;
}

.test-output {
  max-height: 24rem;
}

.template-preview {
  max-height: 10rem;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.75rem;
}

.instruction-preview {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  color: #334155;
  font-size: 0.85rem;
  line-height: 1.5;
  max-height: 8rem;
  overflow: auto;
  padding: 0.75rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.history-output {
  max-height: 8rem;
  margin: 0;
  font-size: 0.8rem;
}

.terminal-output {
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 0.65rem;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.08), 0 0.75rem 1.75rem rgba(15, 23, 42, 0.16);
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.88rem;
  line-height: 1.55;
  margin: 0;
  max-height: 34rem;
  overflow: auto;
  padding: 1rem;
  tab-size: 2;
  white-space: pre-wrap;
  word-break: normal;
}

.terminal-output-empty {
  color: #94a3b8;
}

.git-file-select {
  max-height: 12rem;
  overflow: auto;
}

.runtime-panel {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.runtime-panel[data-runtime-active="true"] {
  box-shadow: 0 0.5rem 1.5rem rgba(37, 99, 235, 0.12) !important;
}

.session-composer {
  border-color: #bfdbfe;
}

.session-composer .card-header {
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
}

.details-summary-button {
  cursor: pointer;
  font-weight: 600;
}

.details-summary-button::marker {
  color: #2563eb;
}

.prompt-options {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.55rem;
  padding: 0.75rem 0.9rem;
}

.voice-input-toolbar {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-bottom: 0;
  border-radius: 0.55rem 0.55rem 0 0;
  padding: 0.6rem 0.75rem;
}

.voice-input-toolbar + textarea {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.voice-input-button.is-listening {
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.18);
}

.voice-input-status {
  min-height: 1.25rem;
}

.runtime-facts > div {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.55rem;
  padding: 0.6rem 0.75rem;
}

.active-run-indicator {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 0.5rem;
  padding: 0.55rem 0.7rem;
}

.active-run-progress {
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
}

.active-run-waiting,
.cline-question-card {
  background: linear-gradient(180deg, #ecfeff 0%, #ffffff 100%);
}

.cline-question-text {
  background: #ffffff;
  border: 1px solid #a5f3fc;
  border-radius: 0.55rem;
  font-size: 1.02rem;
  padding: 0.75rem 0.9rem;
}

.active-run-facts > div {
  background: #ffffff;
  border: 1px solid #bfdbfe;
  border-radius: 0.55rem;
  padding: 0.6rem 0.75rem;
}

.active-run-preview {
  background: #f8fafc;
  border: 1px solid #bfdbfe;
  border-radius: 0.5rem;
  max-height: 10rem;
  overflow: auto;
  padding: 0.75rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.runtime-navbar-indicator {
  position: relative;
}

.runtime-navbar-toggle {
  max-width: 18rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.runtime-navbar-active .runtime-navbar-toggle {
  border-color: #93c5fd;
  color: #dbeafe;
}

.runtime-navbar-attention .runtime-navbar-toggle {
  border-color: #fbbf24;
  color: #fde68a;
}

.runtime-navbar-unavailable .runtime-navbar-toggle {
  border-color: #94a3b8;
  color: #cbd5e1;
}

.runtime-navbar-menu {
  min-width: 18rem;
  max-width: 22rem;
}

.runtime-navbar-link {
  border-left: 0;
  border-right: 0;
  padding: 0.45rem 0.5rem;
}

@media (max-width: 575.98px) {
  .item-actions,
  .item-actions > .btn,
  .item-actions > .dropdown,
  .item-actions > .dropdown > .btn,
  .page-actions,
  .page-actions > .btn,
  .page-actions > .dropdown,
  .page-actions > .dropdown > .btn,
  .page-actions > form,
  .page-actions > form > .btn {
    width: 100%;
  }

  .item-actions .dropdown-menu,
  .page-actions .dropdown-menu {
    width: 100%;
  }
}
