:root {
  color-scheme: light;
  --ink: #202124;
  --muted: #5f6368;
  --paper: #faf8f2;
  --line: #d7d0c2;
  --accent: #2f6f6d;
  --accent-2: #9a4f2f;
  --panel: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(47, 111, 109, 0.12), transparent 38%),
    linear-gradient(315deg, rgba(154, 79, 47, 0.10), transparent 42%),
    var(--paper);
  color: var(--ink);
  font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  padding: 24px;
}

.shell {
  width: min(980px, 100%);
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(32, 33, 36, 0.12);
  padding: clamp(24px, 4vw, 48px);
}

.narrow {
  width: min(680px, 100%);
}

.topbar {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

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

.back,
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 16px;
}

.mark {
  width: 12px;
  height: 12px;
  border: 2px solid var(--accent);
  transform: rotate(45deg);
}

h1 {
  margin: 0 0 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

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

.stack,
.reply {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

small {
  color: var(--muted);
  font-weight: 400;
}

ul.errorlist {
  margin: 0;
  padding: 0;
  list-style: none;
  color: #9a4f2f;
  font-size: 14px;
}

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

button {
  justify-self: start;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  padding: 12px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.chat {
  display: grid;
  gap: 14px;
  margin: 28px 0;
}

.turn {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.turn.interviewer {
  border-left: 5px solid var(--accent);
}

.turn.participant {
  border-left: 5px solid var(--accent-2);
}

.turn p {
  margin: 8px 0 0;
}

.notice {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: rgba(47, 111, 109, 0.08);
}

.notice p {
  margin: 8px 0 0;
}

.warning {
  border-color: rgba(154, 79, 47, 0.45);
  background: rgba(154, 79, 47, 0.10);
}

.checkbox {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 8px;
  align-items: start;
  color: var(--ink);
}

.checkbox label {
  color: var(--ink);
  font-weight: 700;
}

.checkbox input {
  width: 18px;
  height: 18px;
  margin: 4px 0 0;
}

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

.label-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.label-row label {
  display: block;
}

.help {
  position: relative;
  display: inline-block;
}

.help summary {
  list-style: none;
  color: var(--accent);
  cursor: help;
  font-size: 13px;
  font-weight: 700;
}

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

.help summary:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.help-text {
  display: none;
  position: absolute;
  z-index: 2;
  top: 22px;
  left: 0;
  width: min(280px, calc(100vw - 72px));
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
}

.help[open] .help-text {
  display: block;
}

@media (hover: hover) {
  .help:hover .help-text {
    display: block;
  }
}

.configuration {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.configuration legend {
  padding: 0 6px;
  color: var(--accent);
  font-weight: 700;
}

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

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

.prompt-editor-grid section {
  display: grid;
  align-content: start;
  gap: 16px;
}

.prompt-editor-grid h2 {
  color: var(--accent-2);
}

.footer {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  color: var(--muted);
  font-size: 14px;
}

.pill {
  color: var(--accent-2);
  font-weight: 700;
}

.table {
  display: grid;
  gap: 8px;
}

.section {
  margin-top: 32px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.row {
  display: grid;
  grid-template-columns: 180px 1fr 100px;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
}

.study-row {
  grid-template-columns: 220px 1fr 150px;
}

.actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

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

.metrics.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 18px 0;
}

.metrics div,
.prompt-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.metrics strong {
  display: block;
  overflow-wrap: anywhere;
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

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

.prompt-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 720px) {
  body {
    padding: 12px;
  }

  .row,
  .study-row,
  .metrics,
  .metrics.compact,
  .prompt-grid,
  .form-grid,
  .prompt-editor-grid {
    grid-template-columns: 1fr;
  }

  .actions {
    justify-content: flex-start;
  }

  .help-text {
    position: static;
    width: auto;
    margin-top: 8px;
  }
}
