:root {
  --bg: #f1f5f9;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --get: #38bdf8;
  --post: #4ade80;
  --put: #fbbf24;
  --patch: #c084fc;
  --delete: #f87171;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { color: var(--ink); background: var(--bg); }
code, pre { font-family: "SF Mono", Menlo, Consolas, monospace; }

#app { height: 100vh; display: flex; flex-direction: column; }

/* --- header (same shape as every other demo) ----------------------------- */
.page-head {
  flex: none;
  background: #fff;
  border-bottom: 3px solid var(--ink);
  padding: 14px 22px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.page-explain { margin: 0; max-width: 900px; font-size: 15px; line-height: 1.5; }
.page-explain em { font-style: normal; font-weight: 600; }
.page-explain code { background: var(--bg); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.page-controls {
  flex: none;
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.back {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  background: #fff;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.back:hover { background: var(--bg); }
.play {
  background: transparent;
  color: #0284c7;
  border: 1px solid #0284c7;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.play.active { background: #0284c7; color: #fff; }

/* --- one column: shelf, then the request bar, then the answer ------------- */
.pane { flex: 1; min-height: 0; padding: 18px 22px; overflow: auto; background: #fff; }

.pane-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.badge {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-app { background: var(--ink); color: #fff; }
.badge-api { background: #38bdf8; color: #04263a; }
.pane-sub { color: var(--muted); font-size: 13px; }
.doing { font-size: 13px; font-weight: 700; }

/* --- the request bar: a button group on a dark strip ---------------------- */
.ask { background: #0f172a; color: #e2e8f0; border-radius: 12px; padding: 14px 16px; margin-bottom: 20px; scroll-margin-top: 18px; }
.ask .pane-sub { color: #94a3b8; }
.requests { display: flex; flex-wrap: wrap; gap: 8px; }
.req {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 8px 12px;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.req:hover:not(:disabled) { border-color: #64748b; }
.req.current { border-color: #38bdf8; background: #172554; }
.req:disabled { cursor: default; }
.http-line { font-size: 14px; color: #e2e8f0; white-space: nowrap; }
.method { font-weight: 700; }
.m-GET { color: var(--get); }
.m-POST { color: var(--post); }
.m-PUT { color: var(--put); }
.m-PATCH { color: var(--patch); }
.m-DELETE { color: var(--delete); }
.says { margin: 12px 0 0; font-size: 14px; color: #cbd5e1; }
.body { display: block; margin-top: 6px; font-size: 13px; color: #fcd34d; }

.reset {
  margin-left: auto;
  background: transparent;
  color: #94a3b8;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}

/* --- the server's shelf -------------------------------------------------- */
.shelf {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  min-height: 64px;
}
.item {
  display: grid;
  gap: 2px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  min-width: 130px;
  transition: box-shadow 0.15s, background 0.15s;
}
.item.glow { background: #e0f2fe; box-shadow: inset 0 0 0 3px #0284c7; }
.item { animation: fade-in 0.3s; }
.item.leaving { animation: fade-in 0.3s reverse forwards; }
@keyframes fade-in { from { opacity: 0; transform: scale(0.9); } }
@media (prefers-reduced-motion: reduce) { .item { animation: none; } }
.item-id { font-size: 12px; color: var(--muted); font-family: "SF Mono", Menlo, Consolas, monospace; }
.item-id::before { content: "#"; }
.item-min { font-size: 13px; color: var(--muted); }
.empty { color: var(--muted); font-size: 14px; }

.block-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 8px;
}
.response { display: grid; gap: 8px; justify-items: start; }
.status { font-weight: 700; font-size: 15px; padding: 3px 10px; border-radius: 6px; }
.s2 { background: #dcfce7; color: #166534; }
.s4 { background: #fee2e2; color: #991b1b; }
.json {
  width: 100%;
  margin: 0;
  background: #0f172a;
  color: #fcd34d;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  overflow: auto;
}

/* --- phone: the whole page scrolls, not a small box inside it ------------ */
@media (max-width: 720px) {
  #app { height: auto; min-height: 100vh; }
  .page-head { flex-direction: column; }
  .page-controls { order: -1; flex-direction: row; justify-content: space-between; align-items: center; width: 100%; margin-left: 0; }
  .pane { overflow: visible; }
  /* Room for the tour to scroll the request bar to the top even when the answer is short. */
  .pane.playing { min-height: 100vh; }
  /* One row of buttons that scrolls sideways, instead of a tall stack. */
  .requests { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px; scroll-padding-left: 16px; }
  .req { flex: none; }
  /* Too narrow for label, hint and Reset on one line; the drop-down already reads "verb + address". */
  .ask .pane-sub { display: none; }
}
.sent { text-transform: none; letter-spacing: 0; color: var(--ink); font-weight: 700; }
