:root {
  --bg: #051418;
  --bg-2: #0a1e23;
  --panel: #0f2329;
  --panel-2: #122c34;
  --ink: #f7fbfc;
  --muted: #b7c4c8;
  --accent: #0f766e;
  --accent-2: #1f9d96;
  --line: rgba(214, 229, 233, 0.16);
  --line-strong: rgba(214, 229, 233, 0.3);
  --shadow: 0 22px 54px rgba(0, 0, 0, 0.38);
  --gray-card: #162126;
  --black: #020507;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(31, 157, 150, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.06), transparent 24%),
    linear-gradient(180deg, var(--bg), var(--black));
  font-family: "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

.shell {
  width: min(1280px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.masthead {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 20px;
  align-items: start;
  margin-bottom: 22px;
}

.eyebrow {
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8fd4cf;
  font-size: 0.78rem;
  font-weight: 700;
}

h1, h2 {
  margin: 0 0 12px;
}

h3 {
  margin: 0;
  font-size: 1rem;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4.4rem);
  line-height: 0.98;
  max-width: 11ch;
}

.lede {
  font-size: 1.1rem;
  max-width: 56ch;
  color: var(--muted);
}

.panel {
  background:
    linear-gradient(180deg, rgba(19, 44, 52, 0.96), rgba(10, 21, 25, 0.98));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 22px;
  padding: 20px;
  backdrop-filter: blur(10px);
}

.brand-block {
  min-height: 100%;
  position: relative;
  overflow: hidden;
}

.brand-block::after {
  content: "";
  position: absolute;
  inset: auto -60px -60px auto;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(31, 157, 150, 0.22), transparent 70%);
  pointer-events: none;
}

.workspace-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(143, 212, 207, 0.28);
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  background: rgba(143, 212, 207, 0.08);
}

.command-panel {
  background:
    linear-gradient(180deg, rgba(15, 38, 45, 0.98), rgba(8, 15, 18, 0.98));
}

.suggested-questions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.brand-title {
  font-size: clamp(3rem, 7vw, 5.2rem);
  line-height: 0.95;
  max-width: 12ch;
  margin-bottom: 6px;
}

.submark {
  margin: 0 0 14px;
  color: #8fd4cf;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

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

.panel-kicker {
  margin: 0 0 4px;
  color: #8fd4cf;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.conversation-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 18px;
  margin-bottom: 18px;
}

.wide {
  grid-column: span 2;
}

.form-grid,
.stack {
  display: grid;
  gap: 12px;
}

label span {
  display: block;
  margin-bottom: 6px;
  font-size: 0.92rem;
  color: var(--muted);
}

input,
textarea,
button {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  padding: 12px 14px;
  font: inherit;
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
}

input::placeholder,
textarea::placeholder {
  color: #93a6ac;
}

button {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--white);
  font-weight: 600;
  cursor: pointer;
}

button:disabled,
textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.status {
  margin: 0;
  color: var(--muted);
}

.conversation-panel {
  min-height: 100%;
}

.conversation-summary {
  margin-top: 0;
  font-size: 1.05rem;
  color: var(--white);
}

.chat-log {
  display: grid;
  gap: 12px;
  max-height: 420px;
  overflow: auto;
  padding: 6px 2px 4px;
}

.message {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.message.user {
  background: rgba(31, 157, 150, 0.12);
  border-color: rgba(143, 212, 207, 0.25);
}

.message-role {
  margin: 0 0 6px;
  font-size: 0.78rem;
  color: #8fd4cf;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.message p:last-child {
  margin-bottom: 0;
  overflow-wrap: anywhere;
}

.chat-form {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.voice-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.secondary-button {
  width: auto;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(143, 212, 207, 0.24);
}

.settings-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.session-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.session-button {
  text-align: left;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  line-height: 1.45;
  white-space: normal;
}

.session-button:hover {
  background: rgba(31, 157, 150, 0.14);
}

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

.toggle-row input {
  width: 16px;
  height: 16px;
}

.triple-chart {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

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

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

.options-filter-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.options-filter-actions .secondary-button {
  width: auto;
}

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

.options-table-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  padding: 14px;
}

.compact-head {
  margin-bottom: 10px;
}

.options-table-wrap {
  overflow: auto;
  max-height: 420px;
  border-radius: 12px;
  border: 1px solid rgba(214, 229, 233, 0.12);
}

.options-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.options-table th,
.options-table td {
  padding: 10px 12px;
  text-align: right;
  border-bottom: 1px solid rgba(214, 229, 233, 0.08);
  white-space: nowrap;
}

.options-table th:first-child,
.options-table td:first-child {
  text-align: left;
}

.options-table th {
  position: sticky;
  top: 0;
  background: #102329;
  z-index: 1;
}

.compact-chart {
  min-height: 360px;
}

.single-top-gap {
  margin-top: 16px;
}

.question-chip {
  border: 1px solid rgba(143, 212, 207, 0.24);
  background: rgba(255, 255, 255, 0.03);
  color: var(--white);
  padding: 10px 12px;
  border-radius: 999px;
  width: auto;
  font-size: 0.92rem;
}

.question-chip:hover {
  background: rgba(31, 157, 150, 0.14);
}

.chart {
  min-height: 420px;
}

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

.facts dt {
  font-size: 0.85rem;
  color: var(--muted);
}

.facts dd {
  margin: 0 0 8px;
  font-weight: 600;
  color: var(--white);
}

.card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

ul.stack {
  padding-left: 20px;
}

li {
  color: var(--white);
}

a {
  color: #8fd4cf;
}

@media (max-width: 900px) {
  .masthead,
  .conversation-grid,
  .grid {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: span 1;
  }

  h1 {
    max-width: none;
  }

  .triple-chart {
    grid-template-columns: 1fr;
  }

  .double-chart,
  .options-filter-grid,
  .options-table-grid {
    grid-template-columns: 1fr;
  }
}
