:root {
  color-scheme: dark;
  --bg: #040a06;
  --panel: rgba(8, 20, 12, 0.88);
  --line: rgba(96, 224, 138, 0.16);
  --green: #60e08a;
  --text: #e9f4ec;
  --muted: #91a99a;
  --warn: #d9bd82;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background:
    radial-gradient(ellipse 80% 55% at 50% -8%, #60e08a1a, transparent 60%),
    linear-gradient(180deg, #040a06, #071009 55%, #0a140d);
  color: var(--text);
  font:
    14px/1.8 -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  min-height: 100vh;
}
button,
input,
textarea {
  font: inherit;
}
button,
a,
input,
textarea {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.45;
  cursor: wait;
}
a {
  color: #c4e9ce;
  text-underline-offset: 4px;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 4px;
}
input:focus,
textarea:focus {
  outline: 1px solid #60e08a80;
}
button:focus,
textarea:focus,
input:focus {
  scroll-margin-top: 40px;
}
.ambient {
  position: absolute;
  inset: 0 0 auto;
  height: 820px;
  pointer-events: none;
  background:
    radial-gradient(1.5px 1.5px at 26% 12%, #bef5d68c 50%, transparent 51%),
    radial-gradient(1px 1px at 8% 30%, #bef5d680 50%, transparent 51%),
    radial-gradient(1px 1px at 76% 44%, #bef5d64d 50%, transparent 51%),
    radial-gradient(
      ellipse 70% 60% at 50% 0,
      rgba(96, 224, 138, 0.11),
      transparent 70%
    ),
    linear-gradient(#60e08a06 1px, transparent 1px),
    linear-gradient(90deg, #60e08a06 1px, transparent 1px);
  background-size:
    100% 100%,
    100% 100%,
    100% 100%,
    auto,
    80px 80px,
    80px 80px;
  mask-image: linear-gradient(#000, transparent);
}
header,
main,
footer {
  position: relative;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 25px clamp(20px, 5vw, 60px);
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  font:
    600 11px ui-monospace,
    monospace;
  letter-spacing: 0.3em;
  color: var(--green);
  text-decoration: none;
}
.mark {
  font-size: 26px;
  letter-spacing: 0;
}
nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
nav a {
  font:
    11px ui-monospace,
    monospace;
  letter-spacing: 0.12em;
  text-decoration: none;
  color: var(--muted);
}
.text-button {
  background: transparent;
  border: 0;
  padding: 4px 0;
  color: var(--muted);
  font-size: 12px;
}
.text-button:hover,
nav a:hover {
  color: var(--green);
}
.hero {
  max-width: 780px;
  margin: auto;
  text-align: center;
  padding: 85px 28px 45px;
}
.eyebrow {
  font:
    10px ui-monospace,
    monospace;
  letter-spacing: 0.35em;
  color: #96f0afb3;
  margin: 0 0 25px;
}
h1 {
  font-size: clamp(36px, 6vw, 62px);
  font-weight: 600;
  letter-spacing: 0.025em;
  line-height: 1.25;
  margin: 0;
  background: linear-gradient(120deg, #f2fbf5, #b9efc8);
  background-clip: text;
  color: transparent;
}
.subtitle {
  max-width: 570px;
  margin: 25px auto 35px;
  font-size: 14px;
  line-height: 2;
  color: #a6bdae;
}
.search {
  display: flex;
  border: 1px solid #60e08a40;
  border-radius: 14px;
  background: #07100bed;
  padding: 8px;
  gap: 8px;
  align-items: center;
  transition: 0.2s;
}
.search:focus-within {
  border-color: #60e08a99;
  box-shadow: 0 0 35px #60e08a16;
}
.search textarea {
  min-width: 0;
  width: 100%;
  resize: vertical;
  border: 0;
  outline: 0 !important;
  background: transparent;
  padding: 12px;
  color: var(--text);
  font-size: 15px;
}
.search button,
.button {
  border: 1px solid #60e08a60;
  border-radius: 8px;
  background: linear-gradient(150deg, #60e08a22, #96f0af0c);
  color: #ccf7d6;
  padding: 10px 22px;
  white-space: nowrap;
}
.search button:hover,
.button:hover {
  background: #60e08a2b;
}
.search button span {
  margin-left: 8px;
}
.form-options {
  display: flex;
  justify-content: space-between;
  margin: 10px 4px;
  color: #8fa697;
  font-size: 11px;
}
.examples {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0;
}
.examples button,
.tag {
  border: 1px solid #60e08a24;
  background: #09120cbf;
  color: #a5bcad;
  border-radius: 20px;
  padding: 6px 13px;
  font-size: 11px;
}
.examples button:hover {
  border-color: #60e08a80;
}
#options {
  padding: 20px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
label {
  display: block;
  color: #a6bdae;
  font-size: 12px;
  margin: 10px 0;
}
input,
textarea {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #060e09;
  color: var(--text);
  padding: 10px;
  width: 100%;
}
textarea {
  resize: vertical;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
}
.check input {
  width: auto;
}
#message {
  font-size: 13px;
  min-height: 24px;
  color: var(--warn);
  white-space: pre-wrap;
}
.workspace {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 28px 35px;
}
.tabs {
  display: flex;
  gap: 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 26px;
  overflow: auto;
}
.tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  background: none;
  padding: 12px 0;
  font-size: 13px;
  white-space: nowrap;
}
.tabs .active {
  color: #ccf7d6;
  border-bottom-color: var(--green);
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin: 22px 0 16px;
}
#current-research {
  scroll-margin-top: 24px;
  padding: clamp(16px, 3vw, 28px);
  margin-bottom: 40px;
  border: 1px solid #60e08a55;
  border-top: 3px solid var(--green);
  border-radius: 14px;
  background: linear-gradient(150deg, #102118, #07110b);
}
#current-research > .section-heading,
.recent-research > .section-heading {
  margin-top: 0;
}
#current-research-title {
  color: #d5f6df;
  font-size: 19px;
  font-weight: 650;
}
.recent-research .section-heading p {
  margin-bottom: 0;
}
#active-run:has(+ #detail:empty) {
  margin-bottom: 0;
}
.run-question {
  margin: 12px 0 0;
  font-size: 16px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.recent-research {
  padding: clamp(16px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
h2 {
  font-size: 16px;
  font-weight: 500;
  margin: 0;
}
h3 {
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 10px;
}
p {
  margin: 8px 0;
}
.muted {
  color: var(--muted);
  font-size: 12px;
}
.panel,
details {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 20px;
  background: var(--panel);
  margin-bottom: 14px;
}
.history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #60e08a12;
  background: transparent;
  color: var(--text);
  padding: 16px 4px;
}
.history-row:hover {
  background: #60e08a06;
}
.history-row .question {
  flex: 1;
  min-width: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.status {
  font:
    10px ui-monospace,
    monospace;
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
}
.status.done,
.status.succeeded {
  color: #95d7a6;
}
.status.failed {
  color: var(--warn);
}
.empty {
  text-align: center;
  padding: 40px 20px;
  color: #789282;
  font-size: 13px;
}
.run-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}
.steps {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 17px 0 5px;
  color: #718d7a;
  font-size: 11px;
}
.steps .current {
  color: var(--green);
}
.progress {
  height: 2px;
  overflow: hidden;
  background: #60e08a15;
  margin: 18px 0;
}
.progress:after {
  content: '';
  display: block;
  width: 30%;
  height: 100%;
  background: var(--green);
  animation: progress 2s ease-in-out infinite;
}
@keyframes progress {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(430%);
  }
}
.result {
  margin-top: 28px;
}
.result-header {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 26px;
  background: linear-gradient(145deg, #102118, #07110b);
}
.result-header h2 {
  font-size: 20px;
  line-height: 1.7;
}
.probabilities {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.probability {
  font:
    500 36px ui-monospace,
    monospace;
  color: #d3f5dc;
  line-height: 1.4;
}
.probability small {
  display: block;
  color: var(--muted);
  font: 12px/1.8 system-ui;
}
.label-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0;
}
.tag {
  padding: 2px 10px;
  font-size: 10px;
}
.warning {
  color: var(--warn);
}
.quote {
  border-left: 2px solid #60e08a44;
  padding-left: 12px;
  margin: 12px 0;
  color: #acbeb2;
  font-size: 12px;
  white-space: pre-wrap;
}
.citation {
  font-size: 11px;
  color: #a2c5ad;
}
.detail-grid,
.lab-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.actor,
.hypothesis {
  padding: 12px 0;
  border-bottom: 1px solid #60e08a12;
}
summary {
  cursor: pointer;
  color: #b8d1c0;
  font-size: 13px;
}
details > div,
details > p {
  margin-top: 16px;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font:
    11px/1.8 ui-monospace,
    monospace;
  color: #95b19f;
  max-height: 500px;
  overflow: auto;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.metric {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.metric strong {
  font:
    28px ui-monospace,
    monospace;
  display: block;
  color: #d3f5dc;
}
.metric span {
  font-size: 11px;
  color: var(--muted);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
td,
th {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  overflow-wrap: anywhere;
}
.chart {
  width: 100%;
  height: 240px;
}
.chart text {
  fill: #9fb5a7;
  font: 10px system-ui;
}
.principles {
  max-width: 1080px;
  margin: 50px auto;
  padding: 0 28px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 45px;
}
.principles span {
  font:
    10px ui-monospace,
    monospace;
  letter-spacing: 0.2em;
  color: #60e08a70;
}
.principles h3 {
  margin: 10px 0;
  font-size: 15px;
}
.principles p {
  font-size: 12px;
  color: #7f9b89;
  line-height: 2;
}
footer {
  border-top: 1px solid #60e08a12;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 25px clamp(20px, 5vw, 60px);
  color: #63846e;
  font:
    10px/1.8 ui-monospace,
    monospace;
  letter-spacing: 0.08em;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
[hidden] {
  display: none !important;
}
.action-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.source-list {
  padding-left: 18px;
}
.source-list li {
  margin: 10px 0;
}
.lab-grid textarea {
  font:
    11px/1.7 ui-monospace,
    monospace;
}
#detail {
  scroll-margin-top: 20px;
}
.clarification-group {
  min-width: 0;
  margin: 20px 0;
  padding: 0;
  border: 0;
}
.clarification-group legend {
  margin-bottom: 10px;
  font-weight: 600;
}
.clarification-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 8px 0;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.clarification-option:has(input:checked) {
  border-color: var(--green);
  background: #60e08a0b;
}
.clarification-option input {
  flex: 0 0 auto;
  width: auto;
  margin: 7px 0 0;
  accent-color: var(--green);
}
.clarification-option > span {
  min-width: 0;
}
.option-description {
  display: block;
  font-size: 12px;
}
.clarification-custom {
  margin-top: 18px;
}
.clarification-custom textarea {
  display: block;
  width: 100%;
  min-height: 90px;
  margin: 14px 0;
}
.clarification-dialog {
  width: min(640px, calc(100% - 32px));
  max-height: calc(100dvh - 48px);
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid #60e08a40;
  border-radius: 16px;
  background: linear-gradient(150deg, #102118, #07110b);
  color: var(--text);
  box-shadow: 0 24px 100px #0009, 0 0 48px #60e08a12;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.clarification-dialog::backdrop {
  background: #020704cc;
  backdrop-filter: blur(8px);
}
body:has(.clarification-dialog[open]) { overflow: hidden; }
.clarification-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.clarification-heading .eyebrow { margin-bottom: 8px; }
.clarification-heading h2 { font-size: 21px; }
#clarification-close { font-size: 24px; line-height: 1; padding: 4px 8px; }
.confirmation-question { color: #c4e9ce; overflow-wrap: anywhere; }
#clarification-later { display: block; margin: 22px auto 0; }
#clarification-message { white-space: pre-wrap; font-size: 12px; }
.clarification-dialog .button { white-space: normal; }
@media (max-width: 680px) {
  header {
    padding: 20px;
    gap: 16px;
    flex-wrap: wrap;
  }
  nav {
    gap: 12px;
    margin-left: auto;
  }
  .wordmark {
    font-size: 9px;
    letter-spacing: 0.18em;
  }
  .hero {
    padding: 55px 20px 28px;
  }
  .eyebrow {
    font-size: 8px;
    letter-spacing: 0.15em;
  }
  .subtitle {
    font-size: 13px;
  }
  .search {
    align-items: stretch;
  }
  .search button {
    padding: 10px 13px;
    font-size: 12px;
  }
  .search textarea {
    font-size: 14px;
    padding: 9px;
  }
  .form-options {
    font-size: 10px;
  }
  .workspace {
    padding: 0 20px 20px;
  }
  .tabs {
    gap: 22px;
  }
  .section-heading {
    align-items: flex-start;
  }
  .detail-grid,
  .lab-grid {
    grid-template-columns: 1fr;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
  }
  .principles {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 0 20px;
    margin-top: 30px;
  }
  .probability {
    font-size: 29px;
  }
  .result-header {
    padding: 20px;
  }
  .result-header h2 {
    font-size: 17px;
  }
  .history-row {
    gap: 10px;
  }
  .history-row .question {
    font-size: 12px;
  }
  footer {
    flex-direction: column;
    gap: 7px;
  }
  table {
    font-size: 11px;
  }
  td,
  th {
    padding: 7px;
  }
  .panel,
  details {
    padding: 16px;
  }
  .form-options > span {
    max-width: 70%;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
