:root {
  color-scheme: light;
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-muted: #f3f6fb;
  --line: #d7dfec;
  --text: #172033;
  --muted: #53607a;
  --accent: #2f5bdb;
  --accent-soft: #eaf0ff;
  --good: #127a3b;
  --bad: #b12a2a;
  --shadow: 0 14px 32px rgba(21, 35, 67, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  line-height: 1.55;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.page-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
  gap: 20px;
  align-items: start;
  margin-bottom: 24px;
}

.hero-copy,
.hero-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 28px;
}

.hero-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 70ch;
}

.hero-stack {
  display: grid;
  gap: 16px;
}

.hero-card {
  padding: 20px;
}

.hero-card-title {
  margin: 0 0 8px;
  font-weight: 700;
}

.hero-inline-link {
  margin-top: 12px;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 3vw, 2.9rem);
  line-height: 1.12;
}

h2 {
  margin-bottom: 0;
  font-size: 1.15rem;
}

.panel {
  padding: 20px;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.participant-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1.35fr);
  gap: 20px;
}

.research-grid {
  display: grid;
  grid-template-columns: minmax(250px, 0.85fr) minmax(0, 1.15fr) minmax(290px, 0.95fr);
  gap: 20px;
}

.support-mode-grid {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.mode-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 14px 15px;
  text-align: left;
  display: grid;
  gap: 6px;
  cursor: pointer;
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.mode-card:hover {
  border-color: rgba(47, 91, 219, 0.55);
  transform: translateY(-1px);
}

.mode-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.mode-title {
  font-weight: 700;
}

.mode-description,
.mode-note {
  color: var(--muted);
  font-size: 0.94rem;
}

.mode-summary {
  margin-top: 16px;
  padding: 14px 15px;
  border-radius: 14px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
}

.mode-summary-title {
  margin-bottom: 8px;
  font-weight: 700;
}

.mode-summary-copy:last-child {
  margin-bottom: 0;
}

.field-group {
  margin-bottom: 18px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

select,
textarea,
button,
input[type="range"] {
  font: inherit;
}

select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
}

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

textarea:focus,
select:focus,
button:focus,
input:focus,
summary:focus {
  outline: 2px solid rgba(47, 91, 219, 0.18);
  outline-offset: 2px;
}

.helper-text {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.helper-emphasis {
  color: var(--text);
  font-weight: 500;
}

.range-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.button-row,
.composer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.compact-row {
  margin-top: 14px;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  cursor: pointer;
  font-weight: 700;
}

.primary-button {
  background: var(--accent);
  color: #fff;
}

.secondary-button {
  background: #eef2fb;
  color: var(--text);
}

button[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
}

.status-box {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-muted);
  color: var(--text);
}

.chat-log {
  min-height: 420px;
  max-height: 62vh;
  overflow-y: auto;
  padding-right: 6px;
}

.message {
  margin-bottom: 14px;
  padding: 14px 15px;
  border-radius: 16px;
  border: 1px solid var(--line);
}

.message.user {
  background: #f5f7ff;
}

.message.assistant {
  background: #fff;
}

.starter-message {
  background: var(--surface-muted);
}

.message-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}

.message-role {
  font-weight: 700;
}

.message-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.message-note {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.composer {
  margin-top: 14px;
}

.subtle-details {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-muted);
  padding: 12px 14px;
}

.subtle-details summary {
  cursor: pointer;
  font-weight: 700;
}

.subtle-details p {
  margin-top: 10px;
  margin-bottom: 0;
  color: var(--muted);
}

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

.metric {
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-muted);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.metric-wide {
  grid-column: 1 / -1;
}

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

.metric-value {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.metric-value.good {
  color: var(--good);
}

.metric-value.bad {
  color: var(--bad);
}

.evaluation-results {
  margin-top: 18px;
}

.table-wrap {
  overflow-x: auto;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.result-table th,
.result-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.footer {
  margin-top: 22px;
  color: var(--muted);
}

.simple-footer {
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 1120px) {
  .research-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .hero,
  .participant-grid {
    grid-template-columns: 1fr;
  }

  .page-shell {
    padding: 20px 14px 36px;
  }

  .chat-log {
    min-height: 320px;
    max-height: none;
  }
}

@media (max-width: 640px) {
  .panel,
  .hero-copy,
  .hero-card {
    padding: 16px;
  }

  .message-header,
  .panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .button-row,
  .composer-actions {
    flex-direction: column;
  }

  button {
    width: 100%;
  }
}


/* Method-audit revision additions */
.style-picker[open] {
  padding-bottom: 1rem;
}

.style-picker .support-mode-grid {
  margin-top: 0.9rem;
}

.wrap-row {
  flex-wrap: wrap;
}

.metric-value code,
.result-table code {
  white-space: pre-wrap;
  word-break: break-word;
}
