:root {
  --ink: #15201e;
  --muted: #66716d;
  --paper: #f5f3ed;
  --panel: #fffefa;
  --line: #d9ddd5;
  --accent: #1e6654;
  --warm: #dd7049;
  --pale: #e8f1ed;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font:
    15px/1.5 Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    sans-serif;
}
main {
  max-width: 1400px;
  margin: auto;
  padding: 44px 28px 70px;
}
header {
  max-width: 760px;
  margin-bottom: 30px;
}
.eyebrow,
.section-title span {
  font:
    700 11px/1.2 ui-monospace,
    monospace;
  letter-spacing: 0.16em;
  color: var(--accent);
}
h1 {
  font:
    500 clamp(38px, 6vw, 72px)/0.98 Georgia,
    serif;
  letter-spacing: -0.04em;
  margin: 10px 0 16px;
}
header p {
  font-size: 18px;
  color: var(--muted);
  max-width: 680px;
}
.grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(440px, 1.1fr);
  gap: 18px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 28px #23332d0d;
}
.composer {
  padding: 22px;
  display: grid;
  gap: 15px;
}
.tabs {
  display: flex;
  gap: 5px;
  background: #ecece7;
  padding: 4px;
  border-radius: 10px;
}
.tab {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 9px;
  border-radius: 7px;
}
.tab.active {
  background: #fff;
  box-shadow: 0 1px 4px #0001;
}
label,
legend {
  font-weight: 650;
  font-size: 13px;
}
label span {
  font-weight: 400;
  color: var(--muted);
}
input,
textarea,
select {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 12px;
  background: #fff;
  font: inherit;
  color: inherit;
}
textarea {
  resize: vertical;
}
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #75a99855;
  border-color: var(--accent);
}
.field-help {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}
#paper-id-field.disabled {
  opacity: 0.55;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}
.models {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.model {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px;
  background: #fff;
  font-weight: 500;
}
.model input {
  width: auto;
  margin: 0;
}
.model small {
  display: block;
  color: var(--muted);
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 13px;
  background: #fff;
  color: var(--ink);
  font-weight: 650;
}
.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  display: flex;
  justify-content: space-between;
  font-size: 15px;
}
.monitor {
  padding: 18px;
  min-height: 590px;
  display: flex;
  flex-direction: column;
}
.monitor-head,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--warm);
  margin-right: 8px;
}
.monitor code {
  font-size: 11px;
  color: var(--muted);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.progress {
  height: 5px;
  background: #e5e7e2;
  border-radius: 4px;
  margin: 14px 0 16px;
  overflow: hidden;
}
.progress div {
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 0.35s;
}
.batch-overview {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #bed7ce;
  border-radius: 11px;
  background: var(--pale);
}
.batch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.batch-head > div {
  display: grid;
}
.batch-head span {
  color: var(--accent);
  font:
    700 9px/1.2 ui-monospace,
    monospace;
  letter-spacing: 0.14em;
}
.batch-head strong {
  font-size: 14px;
}
.batch-head code {
  max-width: 180px;
}
.batch-progress {
  height: 4px;
  margin: 9px 0;
  overflow: hidden;
  border-radius: 4px;
  background: #cfddd7;
}
.batch-progress div {
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 0.35s;
}
.batch-overview label {
  font-size: 11px;
  color: var(--muted);
}
.batch-overview select {
  margin-top: 4px;
  padding: 8px 10px;
  background: #fff;
  font-size: 12px;
}
.timeline {
  flex: 0 0 280px;
  height: 280px;
  min-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
  border-block: 1px solid var(--line);
  padding: 10px 0;
}
.event {
  display: grid;
  grid-template-columns: 74px 96px 1fr;
  gap: 8px;
  padding: 8px 4px;
  border-bottom: 1px solid #eef0ec;
  font-size: 12px;
}
.event time,
.event b {
  font-family: ui-monospace, monospace;
}
.event b {
  color: var(--accent);
}
.muted {
  color: var(--muted);
}
.controls {
  display: flex;
  gap: 7px;
  padding-top: 14px;
  flex-wrap: wrap;
}
.supervisor-chat {
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcf8;
}
.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  background: var(--pale);
}
.chat-head div {
  display: grid;
}
.chat-head span {
  color: var(--accent);
  font:
    700 9px/1.2 ui-monospace,
    monospace;
  letter-spacing: 0.14em;
}
.chat-head strong {
  font:
    500 18px/1.2 Georgia,
    serif;
}
.chat-head small {
  color: var(--muted);
  font-size: 11px;
}
.chat-messages {
  min-height: 190px;
  max-height: 320px;
  overflow-y: auto;
  padding: 13px;
}
.chat-empty {
  margin: 58px auto;
  max-width: 260px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}
.chat-message {
  display: flex;
  margin-bottom: 10px;
}
.chat-message.user {
  justify-content: flex-end;
}
.chat-bubble {
  max-width: 86%;
  padding: 9px 11px;
  border: 1px solid #d9e5df;
  border-radius: 4px 12px 12px;
  background: var(--pale);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
}
.chat-message.user .chat-bubble {
  border-color: var(--accent);
  border-radius: 12px 4px 12px 12px;
  background: var(--accent);
  color: #fff;
}
.chat-meta {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font:
    10px/1.2 ui-monospace,
    monospace;
}
.chat-message.user .chat-meta {
  color: #cfe3dc;
}
.chat-message.thinking .chat-bubble {
  color: var(--muted);
  font-style: italic;
}
.chat-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.chat-composer textarea {
  min-height: 48px;
  max-height: 140px;
  margin: 0;
  padding: 9px 10px;
}
.chat-composer button {
  align-self: stretch;
  min-width: 72px;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.chat-composer button:disabled {
  cursor: wait;
  opacity: 0.55;
}
.result-panel {
  margin-top: 18px;
  padding: 22px;
}
.section-title h2 {
  margin: 4px 0 0;
  font:
    500 28px/1.1 Georgia,
    serif;
}
.result-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.result-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.result-actions button:last-child {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.result-panel pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #17221f;
  color: #dce9e4;
  padding: 20px;
  border-radius: 11px;
  max-height: 620px;
  overflow: auto;
}
.error {
  color: #a4382d;
  font-size: 13px;
}
@media (max-width: 900px) {
  .grid {
    grid-template-columns: 1fr;
  }
  main {
    padding: 24px 14px;
  }
  .models {
    grid-template-columns: 1fr;
  }
  .event {
    grid-template-columns: 65px 80px 1fr;
  }
  .timeline {
    flex-basis: 240px;
    height: 240px;
    min-height: 240px;
  }
  .chat-head small {
    display: none;
  }
}
