:root {
  --bg: #f6f7f9; --card: #ffffff; --text: #16181d; --muted: #646b78; --line: #dfe2e8;
  --accent: #2456d6; --accent-text: #ffffff; --danger: #c22f2f; --ok: #177a45; --warn: #a15c00;
  --code: #eef0f4;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111318; --card: #1a1d24; --text: #e8eaee; --muted: #9aa1ae; --line: #2c313b;
    --accent: #6f95ff; --accent-text: #0c1020; --danger: #ff7b7b; --ok: #5fd49a; --warn: #f0b354;
    --code: #232731;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
header { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--card); }
.brand { font-weight: 700; letter-spacing: -0.01em; }
.brand span { color: var(--muted); font-weight: 500; }
#session { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
main { max-width: 980px; margin: 0 auto; padding: 20px 16px 64px; }
h1, h2, h3 { margin: 0 0 8px; line-height: 1.25; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); font-weight: 400; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px; margin-bottom: 20px; }
.narrow { max-width: 440px; margin: 48px auto; }
.reveal { border-color: var(--accent); }
label { display: block; font-size: 13px; color: var(--muted); margin: 8px 0 4px; }
input { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--bg); color: var(--text); font: inherit; min-width: 0; }
input[readonly] { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
button { padding: 8px 14px; border: 1px solid var(--accent); border-radius: 7px; cursor: pointer;
  background: var(--accent); color: var(--accent-text); font: inherit; font-weight: 600; white-space: nowrap; }
button.ghost { background: transparent; color: var(--text); border-color: var(--line); font-weight: 500; }
button.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
button.small { padding: 4px 10px; font-size: 13px; }
button:disabled { opacity: 0.5; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 4px 12px;
  align-items: end; }
.row { display: flex; gap: 8px; align-items: center; }
.end { display: flex; justify-content: flex-end; align-items: end; }
form .end button, #login-form button { margin-top: 12px; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
code { background: var(--code); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }

.customer > summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.customer > summary::-webkit-details-marker { display: none; }
.customer > summary::before { content: "▸"; color: var(--muted); }
.customer[open] > summary::before { content: "▾"; }
.customer .name { font-weight: 700; font-size: 16px; }
.customer .meta { color: var(--muted); font-size: 13px; margin-left: auto; text-align: right; }
.customer .body { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 8px;
  margin: 14px 0 6px; }
.section-head:first-child { margin-top: 0; }
.item { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 0;
  border-top: 1px solid var(--line); }
.item .title { font-weight: 600; }
.item .grow { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
.item .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.item a { color: var(--accent); }
.tag { font-size: 12px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--muted); }
.tag.ok { color: var(--ok); border-color: var(--ok); }
.tag.warn { color: var(--warn); border-color: var(--warn); }
.tag.bad { color: var(--danger); border-color: var(--danger); }
.hints { flex-basis: 100%; margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); padding: 8px 0; }
.inline-form { display: flex; gap: 8px; margin-top: 8px; }
.danger-zone { margin-top: 16px; display: flex; justify-content: flex-end; }

#toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px;
  max-width: calc(100vw - 32px); box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25); }
#toast.error { background: var(--danger); color: #fff; }
dialog { border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text);
  padding: 18px; width: min(560px, calc(100vw - 32px)); }
dialog#logs { width: min(900px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
dialog .row.end { margin-top: 14px; justify-content: flex-end; }
pre { background: var(--code); padding: 12px; border-radius: 8px; max-height: 60vh; overflow: auto;
  white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
