:root {
  color-scheme: light dark;
  --paper: #f5f4ee;
  --surface: #fffefa;
  --ink: #152d26;
  --muted: #4f635b;
  --line: #d6ddd2;
  --accent: #184b3c;
  --on-accent: #ffffff;
  --trace: #edf3ed;
  font-family: system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141b18;
    --surface: #1d2621;
    --ink: #eff5eb;
    --muted: #b0c4b8;
    --line: #41544a;
    --accent: #b5dfc9;
    --on-accent: #10271d;
    --trace: #263830;
  }
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}
header {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4rem;
  padding: 0.7rem clamp(1rem, 4vw, 4rem);
  border-bottom: 1px solid var(--line);
}
header button {
  margin-left: auto;
}
.wordmark {
  font-family: Georgia, serif;
  font-size: 1.3rem;
}
.environment,
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 650;
}
main {
  max-width: 84rem;
  padding: clamp(1.2rem, 4vw, 3.5rem);
  margin: auto;
}
h1 {
  font:
    400 clamp(2.5rem, 6vw, 4rem)/1.02 Georgia,
    serif;
  letter-spacing: -0.035em;
  margin: 0 0 0.65rem;
}
h2 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
}
p,
label,
li {
  line-height: 1.5;
}
.eyebrow {
  margin: 0 0 0.6rem;
}
.login {
  max-width: 31rem;
  margin: min(10vh, 5rem) auto 0;
}
form {
  display: grid;
  gap: 0.7rem;
}
.login form {
  margin-top: 1.6rem;
}
label {
  font-size: 0.84rem;
  font-weight: 650;
}
input,
textarea,
select,
button {
  font: inherit;
}
input,
textarea,
select {
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  padding: 0.65rem 0.75rem;
  width: 100%;
  color: var(--ink);
  background: var(--surface);
}
button {
  color: var(--on-accent);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 0.45rem;
  padding: 0.6rem 0.85rem;
  cursor: pointer;
}
button:disabled {
  opacity: 0.48;
  cursor: default;
}
.quiet {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.heading,
.controls {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.heading {
  justify-content: space-between;
}
.status {
  color: var(--muted);
  margin: 0 0 1.2rem;
  font-size: 0.9rem;
}
.columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  padding: clamp(1rem, 2.8vw, 1.6rem);
  background: var(--surface);
  min-width: 0;
}
.hint,
.empty,
time {
  color: var(--muted);
  font-size: 0.82rem;
}
.hint {
  margin: 0 0 0.85rem;
  overflow-wrap: anywhere;
}
.empty {
  padding: 1rem 0;
}
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
.turns li,
.timeline li {
  border-top: 1px solid var(--line);
  padding: 0.75rem 0;
  overflow-wrap: anywhere;
}
.turns li p {
  white-space: pre-wrap;
  margin: 0.35rem 0 0;
}
.turn-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: space-between;
}
.turn-head button,
.source-list button,
.timeline button {
  padding: 0.24rem 0.45rem;
  font-size: 0.78rem;
}
.timeline {
  max-height: 35rem;
  overflow: auto;
}
.timeline li > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.timeline small {
  display: block;
  color: var(--muted);
  margin-top: 0.24rem;
}
.timeline li[data-kind='server'] {
  background: var(--trace);
  padding-inline: 0.55rem;
}
details {
  border-top: 1px solid var(--line);
  margin-top: 1rem;
  padding-top: 0.8rem;
}
summary {
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 650;
  margin-bottom: 0.65rem;
}
.controls select {
  width: auto;
  max-width: 100%;
  flex: 1 1 12rem;
}
.source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.7rem;
}
dialog {
  width: min(42rem, calc(100% - 2rem));
  max-height: 80vh;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--surface);
  color: var(--ink);
  padding: 1.25rem;
}
dialog::backdrop {
  background: #13231c88;
}
#source-dialog {
  width: min(68rem, calc(100% - 2rem));
}
#source-dialog > form {
  float: right;
}
pre {
  overflow: auto;
  background: var(--trace);
  padding: 0.85rem;
  border-radius: 0.4rem;
  font-size: 0.78rem;
  tab-size: 2;
}
@media (max-width: 760px) {
  .columns {
    grid-template-columns: 1fr;
  }
}

#cards-status {
  margin-top: 0.65rem;
}
#card-results pre {
  max-height: 22rem;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 5;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  background: var(--surface);
}
.header-controls {
  margin-left: auto;
}
.app-header button {
  margin-left: 0;
}
.header-controls select {
  flex: 0 1 auto;
  width: auto;
}
.workspace-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.workspace-head h1 {
  margin-bottom: 0.4rem;
}
.jump-links {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}
section[aria-labelledby] > h2,
#conversation-heading {
  scroll-margin-top: 10rem;
}
.card-section {
  border-top: 1px solid var(--line);
  margin-top: 1rem;
  padding-top: 1rem;
}
h3 {
  font-size: 0.95rem;
  margin: 0 0 0.4rem;
}
.workflow-card {
  background: var(--trace);
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  padding: 0.85rem;
  margin: 0.6rem 0;
}
.workflow-card p {
  margin: 0.4rem 0;
  overflow-wrap: anywhere;
}
.workflow-card button {
  font-size: 0.85rem;
}
.workflow-card .controls {
  margin-top: 0.5rem;
}
.inline-label {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  margin: 0.55rem 0;
}
.inline-label input {
  width: auto;
}
.tool-grid,
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.tool-grid {
  margin-top: 1rem;
  align-items: start;
}
.field-grid label {
  display: grid;
  gap: 0.25rem;
}
.answer-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
meter {
  width: 100%;
  margin-top: 0.65rem;
}
.workflow-card pre,
#review-body pre {
  max-height: 14rem;
}
#review-body {
  overflow-wrap: anywhere;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (min-width: 900px) {
  .columns > .panel:last-child {
    position: sticky;
    top: 5.2rem;
  }
}
@media (max-width: 760px) {
  .header-controls {
    margin: 0;
    order: 2;
    flex: 1 0 100%;
  }
  #sign-out {
    margin-left: auto;
  }
  .tool-grid,
  .field-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.header-status {
  flex-basis: 100%;
  margin: 0;
}
section[aria-labelledby] > h2,
#conversation-heading {
  scroll-margin-top: calc(var(--header-height, 7rem) + 1rem);
}
@media (min-width: 900px) {
  .columns > .panel:last-child {
    top: calc(var(--header-height, 7rem) + 0.75rem);
  }
}
@media (max-width: 760px) {
  .header-status {
    order: 3;
  }
}

@media (max-width: 540px) {
  .app-header .environment {
    display: none;
  }
  .app-header {
    gap: 0.4rem 0.65rem;
  }
  .app-header select,
  .app-header button {
    font-size: 0.875rem;
    padding: 0.5rem 0.6rem;
  }
  .app-header .header-controls {
    gap: 0.4rem;
  }
}

#native-import input[type='file'] {
  width: 100%;
}
.native-timeline {
  max-height: 31rem;
  overflow: auto;
}
.native-timeline .native-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.3rem 0.75rem;
}
