/* Garlic popup: Axiom's palette for the surfaces, so it feels like part of the site, and Garlic's clove white
   for the brand and the controls. Red always means a vamp, green always means the original. */
:root {
  --bg: #101114;          /* Axiom page background */
  --panel: #1a1c23;       /* backgroundSecondary (chips, cards) */
  --raised: #22242d;      /* backgroundTertiary (tooltips) */
  --line: #2a2d38;        /* borderSubtle */
  --text: #fcfcfc;
  --text-2: #d8d9e1;      /* textSecondary */
  --muted: #9094a6;       /* textTertiary */
  --red: #f25461;         /* primaryRed */
  --green: #12af80;       /* primaryGreen */
  --clove: #f4ecdc;       /* Garlic brand: wordmark, switches, slider */
  --husk: #cdb892;        /* Garlic secondary */
}
* { box-sizing: border-box; }
body {
  margin: 0;
  width: 360px;
  max-height: 600px;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.4 'Geist Variable', Geist, Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}
.top { display: flex; align-items: center; gap: 9px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: radial-gradient(160px 70px at 26px 50%, rgba(255, 226, 168, 0.09), transparent 70%); }
h1 { margin: 0; display: flex; align-items: center; font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
h1 .wm { display: block; height: 22px; width: auto; margin-top: 1px; }
.top .logo { display: block; flex: none; border-radius: 6px; }
h2 { margin: 0 0 8px; font-size: 12px; font-weight: 500; color: var(--muted); }
.pill {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: rgba(144, 148, 166, 0.12);
}
.pill.live { color: var(--green); background: rgba(18, 175, 128, 0.12); }
.pill.off { color: var(--red); background: rgba(242, 84, 97, 0.12); }

section { padding: 12px 14px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.stats div { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.stats b { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stats div:first-child b { color: var(--red); }
.stats span { font-size: 11px; color: var(--muted); }

.card { margin: 0 14px 10px; padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; gap: 6px; }
.card h2 { margin: 0 0 2px; }
h3 { margin: 6px 0 0; font-size: 12px; font-weight: 500; color: var(--muted); }

/* Segmented control (radio group) */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 2px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: flex; align-items: center; justify-content: center; height: 28px; border-radius: 6px; font-size: 12px; font-weight: 500; color: var(--muted); cursor: pointer; transition: background 120ms ease, color 120ms ease; }
.seg span:hover { color: var(--text-2); }
.seg input:checked + span { background: var(--raised); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.seg input:focus-visible + span { outline: 1px solid var(--clove); outline-offset: 1px; }

/* Switch */
.switch { position: relative; display: inline-flex; flex: none; width: 30px; height: 18px; cursor: pointer; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 9999px; background: #2a2d38; transition: background 120ms ease; pointer-events: none; }
.switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 9999px; background: var(--text-2); transition: transform 120ms ease; }
.switch input:checked + span { background: var(--clove); }
.switch input:checked + span::after { transform: translateX(12px); background: var(--bg); }
.switch input:focus-visible + span { outline: 1px solid var(--clove); outline-offset: 2px; }
.top .switch { margin-left: 4px; }
.row-toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 26px; color: var(--text-2); cursor: pointer; }

/* Badge preview: same pill as Axiom's chips */
.preview { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 4px; padding: 10px; border-radius: 6px; background: var(--bg); border: 1px dashed var(--line); min-height: 46px; }
.pchip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 5px; border-radius: 9999px; background: var(--panel); border: 1px solid rgba(42, 45, 56, 0.6); }
.pchip svg { display: block; flex: none; }
.pchip b, .pchip i { font-size: 12px; line-height: 16px; font-weight: 500; font-style: normal; white-space: nowrap; }
.pchip i { color: var(--muted); }
.pchip.vamp { color: var(--red); }
.pchip.og { color: var(--green); }
.preview[data-style='compact'] .pchip i { display: none; }
.preview[data-style='icon'] .pchip b,
.preview[data-style='icon'] .pchip i { display: none; }
.preview[data-style='icon'] .pchip { width: 24px; padding: 0; justify-content: center; }
.pchip[hidden] { display: none; }
.row { display: flex; justify-content: space-between; align-items: baseline; }
.row label { font-weight: 500; }
output { font-size: 12px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
input[type='range'] { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; margin: 2px 0; background: transparent; cursor: pointer; }
input[type='range']::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 9999px;
  background: linear-gradient(to right, var(--clove) var(--fill, 31%), #2a2d38 var(--fill, 31%));
}
input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border: 0;
  border-radius: 9999px;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(244, 236, 220, 0.22);
}
input[type='range']:focus-visible { outline: none; }
input[type='range']:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px rgba(244, 236, 220, 0.6); }
.hint { margin: 0; font-size: 11.5px; color: var(--muted); }
.server { margin: -2px 14px 10px; padding-left: 2px; display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); }
.server .dot { width: 7px; height: 7px; border-radius: 99px; background: var(--muted); flex: none; }
.server[data-state='live'] .dot { background: var(--green); box-shadow: 0 0 0 3px rgba(18, 175, 128, 0.15); }
.server[data-state='live'] { color: var(--text-2); }
.server[data-state='connecting'] .dot { background: var(--husk); }
.server[data-state='offline'] .dot { background: var(--red); }
.warn { margin: 8px 0 0; padding: 8px 10px; border-radius: 8px; font-size: 11.5px; line-height: 1.45; color: var(--text-2); background: rgba(205, 184, 146, .08); border: 1px solid rgba(205, 184, 146, .25); }
.warn b { color: var(--husk); font-weight: 600; }
.warn[hidden] { display: none; }

#clusters { display: flex; flex-direction: column; gap: 6px; }
.cl { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.cl-head { display: flex; align-items: baseline; gap: 6px; }
.cl-head b { font-size: 13px; font-weight: 600; }
.cl-head .nm { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.cl-head .ct { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--red); font-variant-numeric: tabular-nums; }
.tk { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.tk .tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 500;
}
.tk .tag.og { color: var(--green); background: rgba(18, 175, 128, 0.12); }
.tk .tag.v { color: var(--red); background: rgba(242, 84, 97, 0.12); }
.tk .d { color: var(--muted); margin-left: auto; font-variant-numeric: tabular-nums; }
.tk button { border: 0; background: none; color: var(--text-2); font: inherit; font-family: ui-monospace, 'JetBrains Mono', monospace; font-size: 11.5px; padding: 0; cursor: pointer; }
.tk button:hover { color: var(--clove); }

footer { display: flex; flex-direction: column; gap: 6px; padding: 10px 14px 12px; border-top: 1px solid var(--line); }
#clear { align-self: flex-start; height: 28px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--red); cursor: pointer; font: inherit; font-size: 12px; }
#clear:hover { border-color: rgba(242, 84, 97, 0.5); }
