@font-face { font-family: "Inter"; src: url("/static/fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/static/fonts/jetbrains-mono.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }
:root {
  --bg: #0D1117; --panel: #151B23; --border: #262E3A; --text: #E6EDF3; --muted: #9AA7B4;
  --accent: #A78BFA; --call: #8EC5FF; --put: #F5B26B; --ok: #7EE2B0; --warn: #FCD58A;
  --radius: 10px; --tap: 44px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 "Inter", system-ui, sans-serif; }
a { color: var(--accent); }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.ok-t { color: var(--ok); } .warn-t { color: var(--warn); }
.call { color: var(--call); } .put { color: var(--put); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px;
  border-bottom: 1px solid var(--border); background: var(--panel); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; }
.star { color: var(--accent); }
.wordmark { font-weight: 700; letter-spacing: .12em; }
.sub { color: var(--muted); font-size: 13px; padding-left: 10px; border-left: 1px solid var(--border); }
.topright { display: flex; align-items: center; gap: 10px; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; display: flex; flex-direction: column; gap: 16px; }
#main { display: flex; flex-direction: column; gap: 16px; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.panel.narrow { max-width: 440px; width: 100%; margin: 40px auto; }
h1 { font-size: 20px; margin: 0 0 14px; }
h2 { font-size: 16px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.count { font-size: 12px; color: var(--bg); background: var(--warn); border-radius: 99px; padding: 1px 8px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tile { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; min-width: 0; }
.tile-label { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.tile-value { font-size: 18px; overflow-wrap: anywhere; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.dot.on { background: var(--ok); } .dot.off { background: var(--muted); } .dot.bad { background: var(--warn); }

.stack { display: flex; flex-direction: column; gap: 8px; }
label { font-size: 13px; color: var(--muted); }
input, textarea, select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; min-height: var(--tap); width: 100%; }
textarea { resize: vertical; line-height: 1.6; }
input:focus, textarea:focus, select:focus, .btn:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pin { font-size: 24px; letter-spacing: .4em; text-align: center; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
fieldset.choice { border: 1px solid var(--border); border-radius: 8px; display: flex; gap: 16px; padding: 6px 12px 10px; margin: 4px 0; }
legend { color: var(--muted); font-size: 13px; padding: 0 4px; }
.radio { display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); color: var(--text); font-size: 15px; }
.radio input { width: 20px; min-height: 20px; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); min-width: var(--tap);
  padding: 0 16px; border-radius: 8px; border: 1px solid var(--border); background: #1C2430; color: var(--text);
  font: inherit; font-weight: 500; cursor: pointer; list-style: none; user-select: none; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #0D1117; font-weight: 600; }
.btn.ghost { background: transparent; }
.btn.danger { color: #FF9C9C; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
summary.btn::-webkit-details-marker { display: none; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.actions form { margin: 0; }
.actions select { width: auto; }

.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 96px;
  border: 1.5px dashed var(--border); border-radius: var(--radius); text-align: center; padding: 14px; cursor: pointer; color: var(--text); }
.dropzone.over, .dropzone:hover { border-color: var(--accent); background: rgba(167, 139, 250, .06); }
.dropzone.has-file { border-color: var(--ok); }
.dropzone:focus-within { outline: 2px solid var(--accent); }

.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline; }

.msg { margin: 0; padding: 10px 14px; border-radius: 8px; border: 1px solid; }
.msg.ok { color: var(--ok); border-color: rgba(126, 226, 176, .4); background: rgba(126, 226, 176, .07); }
.msg.warn { color: var(--warn); border-color: rgba(252, 213, 138, .4); background: rgba(252, 213, 138, .07); }

.badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.badge.ok { color: var(--ok); border-color: rgba(126, 226, 176, .45); }
.badge.warn { color: var(--warn); border-color: rgba(252, 213, 138, .45); white-space: normal; }
.badge.accent { color: var(--accent); border-color: rgba(167, 139, 250, .45); }

.review, .intake { border-top: 1px solid var(--border); padding: 14px 0; display: flex; flex-direction: column; gap: 10px; }
.review:first-of-type, .intake:first-of-type { border-top: 0; padding-top: 4px; }
.review-head, .intake-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.versions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.version { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: var(--bg); min-width: 0; }
.vlabel { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.vbody { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.tick { font-weight: 600; }
pre.raw { margin: 0; padding: 10px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; max-height: 220px; overflow: auto; }
.edit { margin: 0; }
.edit[open] summary { margin-bottom: 10px; }
.edit-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.edit-grid .wide { grid-column: 1 / -1; }
.intake-body { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.intake-body pre { flex: 1 1 260px; }
.thumb img { display: block; max-width: 180px; max-height: 140px; border-radius: 8px; border: 1px solid var(--border); }
ul.lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
ul.lines li { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: baseline; }
.line-text { display: flex; flex-wrap: wrap; gap: 4px 10px; min-width: 0; overflow-wrap: anywhere; }

.table-wrap { overflow-x: auto; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
tr.dim td { color: var(--muted); }
td form { margin: 0; }

ul.endpoints { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
ul.endpoints li { display: grid; grid-template-columns: 54px minmax(0, 260px) 1fr; gap: 10px; align-items: baseline; overflow-wrap: anywhere; }
.method { font-size: 12px; } .method.get { color: var(--ok); } .method.post { color: var(--accent); }

@media (max-width: 760px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .tiles .tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .versions { grid-template-columns: 1fr; }
  .edit-grid { grid-template-columns: 1fr 1fr; }
  ul.lines li { grid-template-columns: 1fr; gap: 2px; }
  ul.endpoints li { grid-template-columns: 54px 1fr; }
  ul.endpoints li .small { grid-column: 2; }
  .sub { display: none; }
  .topbar { padding: 10px 14px; }
  .wrap { padding: 14px 10px 48px; }
  .panel { padding: 14px; }
}
