:root {
  --paper: #f7f5ef;
  --card: #fffef9;
  --ink: #172019;
  --muted: #6b726c;
  --line: #d8d6cc;
  --green: #1f6a39;
  --green-soft: #e7f1e8;
  --red: #9d332c;
  --amber: #8a671d;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.45; }
.topbar { height: 66px; padding: 0 28px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; background: rgba(247,245,239,.95); }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font: 700 18px Georgia, serif; }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.topbar-right > a { color: var(--ink); font-size: 13px; }
.origin-state { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: #636b64; font-size: 12px; }
.origin-state i { width: 7px; height: 7px; border-radius: 50%; background: #9aa09a; }
.origin-state i.up { background: #1ba63f; }

.page { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 46px 0 70px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 28px; }
.eyebrow, .label { color: var(--green); text-transform: uppercase; letter-spacing: .09em; font: 700 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
h1 { margin: 6px 0 8px; font: 700 clamp(36px,5vw,52px)/1.05 Georgia, serif; letter-spacing: -.025em; }
.page-heading p:last-child { max-width: 690px; color: var(--muted); margin: 0; }
.origin-note { padding: 12px 14px; border: 1px solid var(--line); border-radius: 7px; background: var(--card); color: var(--muted); font-size: 11px; text-align: right; }
.origin-note strong { color: var(--ink); font: 600 11px ui-monospace, monospace; }

.layout { display: grid; grid-template-columns: .9fr 1.1fr; gap: 14px; }
.card { border: 1px solid var(--line); border-radius: 9px; background: var(--card); overflow: hidden; }
.card-head { min-height: 70px; padding: 15px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.card-head h2 { margin: 4px 0 0; font-size: 17px; }
.text-button, .copy, .tab { border: 0; background: transparent; color: #687069; cursor: pointer; }
.text-button:hover, .copy:hover { color: var(--ink); }

.request-card { padding-bottom: 18px; }
.request-card > label, .request-card > select, .request-card > .request-line, .request-card > textarea, .request-card > .send, .request-card > .tip { margin-left: 18px; margin-right: 18px; }
label { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; margin-bottom: 6px; font-size: 12px; font-weight: 700; }
label span { color: var(--muted); font-weight: 400; }
select, input, textarea { width: 100%; color: var(--ink); background: #fbfaf5; border: 1px solid #cfcdc3; border-radius: 6px; font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; outline: none; }
select, input { height: 42px; padding: 0 11px; }
textarea { min-height: 105px; padding: 10px 11px; resize: vertical; }
select:focus, input:focus, textarea:focus { border-color: #71927a; box-shadow: 0 0 0 3px rgba(31,106,57,.08); }
.request-line { display: grid; grid-template-columns: 95px 1fr; gap: 8px; margin-top: 14px; }
.send { width: calc(100% - 36px); height: 44px; margin-top: 16px; border: 1px solid var(--green); border-radius: 6px; background: var(--green); color: white; font-weight: 750; cursor: pointer; }
.send:hover { background: #18592f; }
.tip { color: var(--muted); font-size: 11px; }

.response-status { padding: 7px 9px; border-radius: 6px; color: #6c746d; font: 700 12px ui-monospace, monospace; }
.response-status.good { color: var(--green); background: var(--green-soft); }
.response-status.bad { color: var(--red); background: #f6e9e7; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.metrics div { padding: 12px 16px; border-right: 1px solid var(--line); }
.metrics div:last-child { border-right: 0; }
.metrics span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.metrics strong { font: 600 11px ui-monospace, monospace; overflow-wrap: anywhere; }
.tabs { height: 42px; padding: 0 14px; display: flex; align-items: end; gap: 8px; border-bottom: 1px solid var(--line); }
.tab { height: 100%; padding: 0 8px; border-bottom: 2px solid transparent; font-size: 12px; }
.tab.active { color: var(--ink); border-bottom-color: var(--green); }
.output-wrap { position: relative; }
.output-wrap pre { margin: 0; min-height: 330px; max-height: 430px; padding: 18px; overflow: auto; background: #1d241f; color: #edf1ed; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; }
.copy { position: absolute; top: 9px; right: 9px; color: #d3dad4; border: 1px solid #485149; border-radius: 5px; padding: 5px 8px; background: #272f29; font-size: 10px; }
.notice { margin: 12px; padding: 10px 12px; border: 1px solid #ddcd9a; border-radius: 6px; background: #fff8dd; color: var(--amber); font-size: 11px; }

.history-card { margin-top: 14px; }
.history { min-height: 78px; }
.history-row { display: grid; grid-template-columns: 85px 60px 1fr 65px 70px; gap: 10px; align-items: center; padding: 10px 18px; border-bottom: 1px solid #ebe9e0; font-size: 11px; }
.history-row:last-child { border-bottom: 0; }
.history-row code { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #465049; background: transparent; padding: 0; }
.history-row .good { color: var(--green); }
.history-row .bad { color: var(--red); }
.empty { padding: 18px; color: var(--muted); font-size: 12px; }

footer { width: min(1180px, calc(100% - 40px)); margin: 0 auto; min-height: 80px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .origin-note { text-align: left; }
}
@media (max-width: 600px) {
  .page { width: min(100% - 24px,1180px); }
  .topbar { padding: 0 14px; }
  .origin-state { display: none; }
  .request-line { grid-template-columns: 82px 1fr; }
  .metrics { grid-template-columns: 1fr; }
  .metrics div { border-right: 0; border-bottom: 1px solid var(--line); }
  .history-row { grid-template-columns: 65px 48px 1fr 48px; }
  .history-row span:last-child { display: none; }
  footer { width: min(100% - 24px,1180px); flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; }
}
