:root {
  --bg: #06101e;
  --bg-soft: #102039;
  --panel: rgba(7, 19, 34, 0.78);
  --panel-strong: rgba(10, 24, 43, 0.92);
  --border: rgba(255, 255, 255, 0.1);
  --text: #f5ede0;
  --muted: #b0bfd3;
  --accent: #f1c05f;
  --accent-deep: #e3845d;
  --teal: #70d2cb;
  --shadow: 0 30px 80px rgba(2, 8, 16, 0.45);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(112, 210, 203, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(241, 192, 95, 0.18), transparent 24%),
    linear-gradient(180deg, #10213a 0%, #06101e 40%, #040a12 100%);
  color: var(--text);
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
}

body {
  padding: 32px 20px 48px;
}

.page-shell {
  max-width: 1480px;
  margin: 0 auto;
  display: grid;
  gap: 22px;
}

.hero-card,
.panel,
.metric-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-card {
  padding: 28px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
}

.eyebrow,
.panel-kicker,
.metric-label {
  margin: 0 0 8px;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--teal);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  font-weight: 600;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1;
}

h2 {
  font-size: 1.55rem;
}

h3 {
  font-size: 1rem;
  color: var(--text);
}

.panel-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.hero-copy {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.button {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #20140d;
}

.button-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.12);
}

.metrics-grid,
.main-grid,
.bottom-grid {
  display: grid;
  gap: 22px;
}

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

.metric-card {
  padding: 22px;
}

.metric-value {
  display: block;
  font-size: clamp(2rem, 3vw, 2.8rem);
  letter-spacing: -0.04em;
}

.main-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.95fr);
}

.bottom-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
}

.panel {
  padding: 22px;
  min-width: 0;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 18px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(112, 210, 203, 0.22);
  color: var(--teal);
  background: rgba(112, 210, 203, 0.08);
  font-size: 0.85rem;
}

.status-neutral {
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.chat-transcript {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 320px;
  max-height: 580px;
  overflow-y: auto;
  padding-right: 6px;
}

.chat-empty {
  margin: 0;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

.message-card {
  border-radius: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--panel-strong);
}

.message-user {
  background: rgba(241, 192, 95, 0.1);
  border-color: rgba(241, 192, 95, 0.22);
}

.message-role {
  margin: 0 0 8px;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.message-body {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.6;
}

.tool-call {
  margin-top: 12px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.tool-call summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 16px;
  font-weight: 600;
}

.tool-call summary::-webkit-details-marker {
  display: none;
}

.tool-call-body {
  display: grid;
  gap: 12px;
  padding: 0 16px 16px;
}

.stack-form,
.panel-subsection,
.tool-catalog,
.jobs-list {
  display: grid;
  gap: 14px;
}

.field-group {
  display: grid;
  gap: 8px;
}

.field-label {
  font-size: 0.88rem;
  color: var(--muted);
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--text);
  padding: 14px 16px;
  font: inherit;
}

textarea {
  resize: vertical;
}

.inline-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.code-pane {
  margin: 0;
  min-height: 200px;
  max-height: 540px;
  overflow: auto;
  padding: 16px;
  border-radius: 18px;
  background: #020813;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #d7ecff;
  font-family: "SFMono-Regular", "Menlo", "Consolas", monospace;
  font-size: 0.86rem;
  line-height: 1.55;
}

.compact-pane {
  min-height: 120px;
}

.browser-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.checkbox-group {
  align-content: end;
}

.checkbox-label {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
}

.checkbox-label input {
  width: auto;
}

.browser-button {
  align-self: end;
}

.tool-entry {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.tool-entry h3 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.tool-entry p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.5;
}

.tool-entry code {
  display: block;
  white-space: pre-wrap;
  font-family: "SFMono-Regular", "Menlo", "Consolas", monospace;
  color: #d7ecff;
}

.job-item {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.job-item strong {
  display: block;
}

.job-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 1180px) {
  .metrics-grid,
  .main-grid,
  .bottom-grid,
  .browser-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  body {
    padding: 18px 14px 32px;
  }

  .hero-card,
  .panel {
    padding: 18px;
  }

  .hero-card,
  .panel-head,
  .inline-fields,
  .metrics-grid,
  .main-grid,
  .bottom-grid,
  .browser-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .hero-card {
    align-items: start;
  }

  .hero-actions {
    width: 100%;
  }

  .button {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}
