:root {
  color-scheme: light;
  --bg: #f6f7f1;
  --panel: #ffffff;
  --ink: #17201d;
  --muted: #62706a;
  --line: #d9dfd7;
  --green: #1f8a5b;
  --green-dark: #166241;
  --blue: #285fbd;
  --amber: #b46a17;
  --red: #b64b48;
  --shadow: 0 14px 32px rgba(31, 42, 37, 0.08);
}

* {
  box-sizing: border-box;
}

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

button,
input,
textarea {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.mast {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green-dark);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 2.35rem;
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  font-size: 1rem;
  line-height: 1.25;
  letter-spacing: 0;
}

.status-stack,
.button-row,
.row {
  display: flex;
  gap: 10px;
}

.status-stack {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pill {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  border-radius: 999px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}

.pill.ready {
  border-color: rgba(31, 138, 91, 0.28);
  background: #e7f5ed;
  color: var(--green-dark);
}

.pill.warn {
  border-color: rgba(180, 106, 23, 0.3);
  background: #fff2df;
  color: #805019;
}

.pill.bad {
  border-color: rgba(182, 75, 72, 0.3);
  background: #fff0f0;
  color: #8b3230;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 18px;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 18px;
}

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

.panel-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.88rem;
}

.panel-head svg {
  width: 24px;
  height: 24px;
  color: var(--green);
  flex: 0 0 auto;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

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

input:focus,
textarea:focus {
  border-color: rgba(40, 95, 189, 0.75);
  box-shadow: 0 0 0 3px rgba(40, 95, 189, 0.12);
}

.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  line-height: 1;
}

button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

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

.primary:not(:disabled):hover {
  background: var(--green-dark);
}

.secondary {
  border-color: rgba(40, 95, 189, 0.25);
  background: #eaf1ff;
  color: #174b9b;
}

.secondary:not(:disabled):hover {
  background: #dce9ff;
}

.ghost {
  border-color: var(--line);
  background: #fff;
  color: var(--muted);
}

.ghost:not(:disabled):hover {
  background: #f4f6f2;
}

.result-list {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
}

.result-list div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  min-height: 38px;
  align-items: center;
  border-bottom: 1px solid #eef1ec;
  padding-bottom: 10px;
}

.result-list dt {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.86rem;
}

.result-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    monospace;
  font-size: 0.88rem;
}

.log-panel {
  min-height: 300px;
}

pre {
  min-height: 214px;
  max-height: 420px;
  margin: 0;
  overflow: auto;
  border-radius: 8px;
  background: #17201d;
  color: #dceddf;
  padding: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.85rem;
  line-height: 1.5;
}

@media (max-width: 820px) {
  .shell {
    width: min(100% - 22px, 620px);
    padding: 20px 0;
  }

  .mast,
  .status-stack {
    align-items: flex-start;
    justify-content: flex-start;
  }

  .mast {
    flex-direction: column;
  }

  h1 {
    font-size: 1.9rem;
  }

  .grid,
  .two,
  .result-list div {
    grid-template-columns: 1fr;
  }

  .button-row {
    flex-direction: column;
  }

  .button-row button,
  #sendMessage {
    width: 100%;
  }
}
