:root {
  --bg: #f4efe6;
  --panel: #fffaf4;
  --panel-strong: #fff;
  --text: #14213d;
  --muted: #5c677d;
  --accent: #cc5c33;
  --accent-2: #2a9d8f;
  --border: rgba(20, 33, 61, 0.12);
  --shadow: 0 24px 60px rgba(20, 33, 61, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(42, 157, 143, 0.18), transparent 32%),
    radial-gradient(circle at top right, rgba(204, 92, 51, 0.18), transparent 24%),
    linear-gradient(180deg, #fff8ee 0%, var(--bg) 100%);
}

.layout {
  max-width: 1320px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 24px;
  align-items: stretch;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.78rem;
}

h1,
h2,
h3 {
  font-family: Georgia, "Times New Roman", serif;
  margin-top: 0;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.8rem);
  line-height: 0.95;
  margin-bottom: 16px;
}

.lead {
  max-width: 720px;
  font-size: 1.1rem;
  color: var(--muted);
}

.hero.single {
  grid-template-columns: 1fr;
}

.secondary-link {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 16px;
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.7);
}

.prompt-box,
.chat-panel,
.card {
  background: rgba(255, 250, 244, 0.84);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.prompt-box {
  padding: 20px;
}

.example {
  width: 100%;
  display: block;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel-strong);
  color: var(--text);
  padding: 14px 16px;
  margin-top: 12px;
  text-align: left;
  cursor: pointer;
}

.chat-panel {
  margin-top: 24px;
  padding: 20px;
}

.panel-actions,
.prompt-actions {
  margin-bottom: 16px;
}

.prompt-editor {
  min-height: 360px;
}

label {
  display: block;
  font-weight: 700;
  margin-bottom: 10px;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 16px;
}

textarea {
  width: 100%;
  resize: vertical;
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 16px;
  font: inherit;
  min-height: 92px;
}

button[type="submit"] {
  border: none;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), #ef7f4d);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.status {
  min-height: 24px;
  color: var(--muted);
  margin-bottom: 0;
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}

.results-grid.wide {
  grid-template-columns: 1.15fr 0.85fr;
}

.card {
  padding: 20px;
  overflow: hidden;
}

.card h2 {
  margin-bottom: 16px;
}

pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 16px;
  min-height: 200px;
}

.chart-shell {
  position: relative;
  width: 100%;
  height: 420px;
  min-height: 420px;
  max-height: 420px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  padding: 12px;
}

#chart {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.table-wrapper {
  overflow: auto;
  max-height: 460px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.94rem;
  text-align: left;
}

th {
  position: sticky;
  top: 0;
  background: #fff6ed;
}

@media (max-width: 960px) {
  .hero,
  .results-grid,
  .results-grid.wide,
  .input-row {
    grid-template-columns: 1fr;
  }

  .chart-shell {
    height: 320px;
    min-height: 320px;
    max-height: 320px;
  }
}
