/* Reusable kit: toolbars, search, pills, stat tiles, cards, section titles, meters, the JSON box, dots. */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.toolbar .grow { flex: 1; }
.toolbar .input, .toolbar select { width: auto; min-width: 150px; }
.search { position: relative; flex: 1 1 240px; min-width: 0; max-width: 380px; }
.search svg { position: absolute; left: 11px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); stroke: var(--faint); fill: none; stroke-width: 1.8; pointer-events: none; }
.search .input { width: 100%; padding-left: 34px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 14px; background: transparent; color: var(--sub); font: 600 12.5px var(--sans); cursor: pointer; white-space: nowrap; transition: background .15s, color .15s, border-color .15s, transform .12s; }
.pill:hover { color: var(--text); border-color: var(--line-3); background: rgba(255, 236, 214, .03); }
.pill:active { transform: scale(.97); }
.pill.on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.pill .n { font-size: 11px; font-weight: 600; color: var(--faint); font-variant-numeric: tabular-nums; }
.pill.on .n { color: rgba(28, 14, 3, .7); }
.pill:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { position: relative; min-width: 0; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--lift); }
.tile .k { font: 500 11px/1.3 var(--display); text-transform: uppercase; letter-spacing: .13em; color: var(--faint); display: flex; align-items: center; gap: 6px; }
.tile .k svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.tile .v { margin-top: 6px; font: 500 26px/1.15 var(--display); letter-spacing: .005em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .d { margin-top: 3px; font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.money .v { color: var(--green); }
.tile.accent { border-color: rgba(232, 112, 26, .3); background: linear-gradient(180deg, rgba(232, 112, 26, .09), rgba(232, 112, 26, 0) 70%), var(--panel); }
.tile.accent .v { color: var(--accent-hi); }
.tile.bad .v { color: var(--red); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.card { display: flex; flex-direction: column; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--lift); overflow: hidden; color: inherit; text-align: left; font: inherit; transition: border-color .15s, background .15s, transform .15s; }
.card.click, a.card, button.card { cursor: pointer; }
.card.click:hover, a.card:hover, button.card:hover { border-color: var(--line-3); background: #181412; }
.card.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 13px 14px 0; min-width: 0; }
.card-head b { font: 600 14px/1.3 var(--sans); }
.card-body { padding: 10px 14px 14px; color: var(--sub); font-size: 12.5px; display: grid; gap: 4px; flex: 1; }
.card-foot { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--faint); }

.section-title { display: flex; align-items: center; gap: 10px; margin: 24px 0 10px; font: 500 12px/1.3 var(--display); text-transform: uppercase; letter-spacing: .14em; color: var(--sub); }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.section-title .n { color: var(--faint); letter-spacing: .04em; }

.meter { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width .4s var(--ease); }
.meter.green i { background: var(--green); } .meter.red i { background: var(--red); } .meter.amber i { background: var(--amber); }

.json-wrap { display: flex; flex-direction: column; min-width: 0; background: var(--field); border: 1px solid var(--line-2); border-radius: var(--radius-lg); overflow: hidden; }
.json-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232, 112, 26, .15); }
.json-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 7px 10px; border-bottom: 1px solid var(--line); background: var(--panel-2); font-size: 12px; color: var(--faint); }
.json-bar .grow { flex: 1; }
.json-area { display: block; width: 100%; min-height: 420px; height: 60vh; margin: 0; padding: 14px 16px; border: 0; border-radius: 0; background: transparent; color: #D8D0C4; font: 12px/1.65 var(--mono); white-space: pre; tab-size: 2; resize: vertical; }
.json-area:focus { outline: none; box-shadow: none; }
.json-status { display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-top: 1px solid var(--line); font: 12px var(--mono); color: var(--faint); }
.json-status.ok { color: var(--green); } .json-status.err { color: var(--red); }

.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.on { background: var(--green); } .dot.bad { background: var(--red); } .dot.warn { background: var(--amber); } .dot.blue { background: var(--accent); }

@media (max-width: 640px) {
  .toolbar .input, .toolbar select, .search { flex: 1 1 100%; max-width: none; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tile .v { font-size: 21px; }
}
