@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;700;800&family=Space+Grotesk:wght@500;700&display=swap");

:root {
  --bg-main: #060a08;
  --bg-soft: #0e1511;
  --bg-panel: rgba(15, 24, 19, 0.85);
  --bg-panel-accent: rgba(38, 62, 45, 0.45);
  --line: rgba(143, 255, 173, 0.3);
  --line-strong: rgba(143, 255, 173, 0.72);
  --text-main: #f3ffee;
  --text-muted: #9bb8a5;
  --lime-main: #8fffad;
  --lime-press: #59db83;
  --danger: #ff7e7e;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow: 0 16px 44px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  margin: 0;
  min-height: 100%;
  font-family: "Manrope", "Segoe UI", sans-serif;
  background: radial-gradient(circle at 15% -10%, #1f3b2f 0%, transparent 40%),
    radial-gradient(circle at 90% 10%, #1d2f24 0%, transparent 35%),
    linear-gradient(165deg, var(--bg-main) 0%, #070d0a 100%);
  color: var(--text-main);
}

.app-root {
  max-width: 1720px;
  margin: 0 auto;
  padding: 28px 24px 42px;
}

.hero {
  margin-bottom: 20px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(17, 29, 22, 0.94), rgba(10, 16, 13, 0.92));
  box-shadow: var(--shadow);
  animation: rise 0.5s ease-out;
}

.hero h1 {
  font-family: "Space Grotesk", "Manrope", sans-serif;
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 3vw, 2.3rem);
  letter-spacing: 0.04em;
}

.hero p {
  margin: 0;
  color: var(--text-muted);
}

.layout-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.mode-switch-row {
  display: flex;
  gap: 8px;
  margin: 0 0 14px;
}

.panel-frame {
  grid-column: span 12;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, var(--bg-panel), rgba(10, 17, 13, 0.88));
  overflow: hidden;
  box-shadow: var(--shadow);
  animation: rise 0.4s ease-out;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, var(--bg-panel-accent), transparent 70%);
}

.panel-header h2 {
  margin: 0;
  font-size: 1.02rem;
  letter-spacing: 0.02em;
}

.panel-header p {
  margin: 6px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.panel-body {
  padding: 14px 18px 18px;
}

.status-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--lime-main);
  font-size: 0.78rem;
}

input,
select,
textarea,
button {
  font-family: "Manrope", sans-serif;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.84rem;
}

input,
select,
textarea {
  border: 1px solid rgba(170, 255, 194, 0.26);
  border-radius: var(--radius-md);
  background: rgba(7, 13, 10, 0.92);
  color: var(--text-main);
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(143, 255, 173, 0.2);
}

textarea {
  resize: vertical;
  min-height: 86px;
}

button {
  border: 1px solid rgba(176, 255, 199, 0.35);
  border-radius: 999px;
  background: linear-gradient(180deg, #8fffad 0%, #62e286 100%);
  color: #08100a;
  font-weight: 700;
  font-size: 0.83rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  padding: 9px 14px;
  transition: transform 0.16s ease, filter 0.2s ease, box-shadow 0.18s ease;
}

button:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(127, 255, 170, 0.32);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.checkbox-row {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

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

.full-width {
  grid-column: 1 / -1;
}

.tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tab {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--line);
}

.tab.active {
  border-color: var(--line-strong);
  background: linear-gradient(180deg, rgba(143, 255, 173, 0.25), rgba(143, 255, 173, 0.1));
}

.assistant-chat-list {
  max-height: 420px;
  overflow: auto;
  display: grid;
  gap: 10px;
  padding: 4px;
  border: 1px solid rgba(156, 255, 189, 0.2);
  border-radius: var(--radius-md);
  background: rgba(6, 10, 8, 0.65);
}

.assistant-empty {
  padding: 18px;
  text-align: center;
}

.assistant-msg {
  border: 1px solid rgba(157, 255, 190, 0.2);
  border-radius: 12px;
  background: rgba(11, 18, 14, 0.74);
  padding: 10px;
}

.assistant-msg.user {
  border-color: rgba(110, 198, 255, 0.38);
  background: rgba(13, 20, 24, 0.76);
}

.assistant-msg.assistant {
  border-color: rgba(157, 255, 190, 0.25);
}

.assistant-msg-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.assistant-msg-body {
  white-space: pre-wrap;
  line-height: 1.45;
  font-size: 0.9rem;
}

.assistant-trace {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.assistant-debug {
  margin-top: 8px;
}

.assistant-debug summary {
  cursor: pointer;
  color: var(--lime-main);
  font-size: 0.8rem;
}

.assistant-compose {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.json-view {
  margin: 0;
  width: 100%;
  min-height: 180px;
  max-height: 420px;
  overflow: auto;
  background: #050806;
  border: 1px solid rgba(156, 255, 189, 0.2);
  border-radius: var(--radius-md);
  padding: 12px;
  color: #d6ffdf;
  font-family: "JetBrains Mono", "Consolas", monospace;
  font-size: 0.78rem;
  line-height: 1.45;
}

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

.metrics-grid div {
  background: rgba(11, 18, 14, 0.7);
  border: 1px solid rgba(157, 255, 190, 0.24);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metrics-grid span {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.metrics-grid strong {
  font-size: 0.84rem;
  color: var(--lime-main);
}

.history-list {
  display: grid;
  gap: 8px;
  max-height: 340px;
  overflow: auto;
}

.history-item {
  width: 100%;
  text-align: left;
  border-radius: 12px;
  border: 1px solid rgba(157, 255, 190, 0.24);
  background: rgba(11, 18, 14, 0.78);
  color: var(--text-main);
  padding: 10px;
}

.history-item p {
  margin: 8px 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.history-item.selected {
  border-color: var(--line-strong);
}

.history-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.runtime-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 12px;
}

.runtime-runs {
  max-height: 360px;
  overflow: auto;
  display: grid;
  gap: 8px;
}

.eval-report-wrap {
  position: relative;
}

.copy-cube-button {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  padding: 0;
  min-width: 34px;
  display: grid;
  place-items: center;
  font-size: 0.92rem;
  line-height: 1;
}

.muted {
  color: var(--text-muted);
}

.diff-summary {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--lime-main);
}

.error-text {
  margin-top: 10px;
  color: var(--danger);
  font-size: 0.84rem;
}

@media (max-width: 1200px) {
  .metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .grid-two,
  .runtime-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .app-root {
    padding: 18px 12px 24px;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
