/* gatehand UI — family look: dense, card-based, one badge system,
   light + dark themes (queuehand/dockhand pattern). */
:root, [data-theme="dark"] {
  --bg: #10131a; --panel: #171b24; --panel2: #1e242f; --line: #2a3140;
  --text: #e6e9ef; --muted: #8b94a5; --accent: #5b9dff;
  --ok: #3fb96f; --warn: #e0a32e; --bad: #e5534b;
}
[data-theme="light"] {
  --bg: #f4f5f7; --panel: #ffffff; --panel2: #eef0f3; --line: #d8dce2;
  --text: #1c2128; --muted: #5c6672; --accent: #0969da;
  --ok: #1a7f37; --warn: #9a6700; --bad: #cf222e;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 -apple-system, "Segoe UI", Roboto, sans-serif; }
header { display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--panel);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; }
.brand { font-weight: 700; font-size: 17px; }
.brand .ver { color: var(--muted); font-weight: 400; font-size: 12px; }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav button { background: transparent; border: 1px solid transparent;
  color: var(--muted); padding: 6px 10px; border-radius: 8px;
  cursor: pointer; font-size: 13px; }
nav button.active { color: var(--text); background: var(--panel2);
  border-color: var(--line); }
.head-right { margin-left: auto; display: flex; gap: 8px;
  align-items: center; }
button { background: var(--panel2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 12px; cursor: pointer; font-size: 13px; }
button:hover { border-color: var(--accent); }
button.danger { border-color: var(--bad); color: var(--bad); }
input, select, textarea { background: var(--panel2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 8px; font-size: 13px; }
label { display: block; margin: 8px 0; }
label input, label select, label textarea { display: block; width: 100%; margin-top: 4px; }
main { padding: 16px; max-width: 1100px; margin: 0 auto; }
.card { background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px; margin: 10px 0; }
.grid { display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.row-between { display: flex; justify-content: space-between;
  align-items: center; gap: 10px; flex-wrap: wrap; }
.row-card { display: flex; justify-content: space-between; gap: 12px;
  align-items: flex-start; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 11px; border: 1px solid var(--c, var(--line));
  color: var(--c, var(--muted)); }
.pill { padding: 2px 10px; border-radius: 999px; font-size: 12px;
  background: var(--panel2); border: 1px solid var(--line); }
.pill.ok { color: var(--ok); } .pill.degraded { color: var(--warn); }
.pill.down { color: var(--bad); }
.muted { color: var(--muted); font-size: 12.5px; }
.error { color: var(--bad); font-size: 12.5px; }
.banner { background: var(--bad); color: #fff; border-radius: 10px;
  padding: 10px 14px; margin-bottom: 12px; font-weight: 600; }
#gh-update-banner { background: var(--warn); color: #10131a;
  padding: 10px 14px; display: flex; gap: 10px; flex-wrap: wrap;
  align-items: center; justify-content: space-between;
  font-weight: 600; position: sticky; top: 0; z-index: 30; }
#gh-update-banner .gh-update-btns { display: flex; gap: 6px; }
.hidden { display: none !important; }
.scopes { word-break: break-all; }
code.secret { display: block; word-break: break-all;
  background: var(--panel2); padding: 10px; border-radius: 8px;
  margin: 8px 0; }
.scope-picker { display: grid; gap: 2px; max-height: 220px;
  overflow: auto; margin: 8px 0; }
.scope-picker label { display: flex; gap: 6px; margin: 0;
  font-size: 12.5px; align-items: center; }
.scope-picker input { width: auto; }
.switch-row { display: flex; justify-content: space-between;
  align-items: center; }
.switch-row input { width: auto; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  padding: 16px; z-index: 50; }
.modal-box { background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 18px; max-width: 520px; width: 100%;
  max-height: 86vh; overflow: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 14px; }
h2 { font-size: 16px; margin: 18px 0 6px; }
h3 { font-size: 14px; margin: 6px 0; }
#auth-view { max-width: 420px; margin: 40px auto; }
#tabs-overflow { display: none; }
#toast { position: fixed; bottom: 18px; left: 50%;
  transform: translateX(-50%); background: var(--panel2);
  border: 1px solid var(--accent); color: var(--text);
  padding: 8px 18px; border-radius: 999px; z-index: 60;
  font-size: 13px; box-shadow: 0 4px 18px rgba(0,0,0,.35);
  max-width: 92vw; text-align: center; }
/* Mints view (D-I-18): nav pending-count badge, policy
   consumer chips, and the weightier deploy class badge.
   Cards and rows reuse the shared patterns above; on mobile
   the shared row-card rule stacks them unchanged. */
.nav-badge { margin-left: 2px; --c: var(--warn); }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.consumer-chip { display: inline-flex; align-items: center; gap: 4px; }
.chip-remove { border: none; background: transparent; color: inherit;
  padding: 0 2px; font-size: 13px; line-height: 1; }
.chip-remove:hover { border: none; color: var(--bad); }
.badge.mint-deploy { --c: var(--bad); font-weight: 700;
  border-width: 2px; }
/* v2.0.0: passkey sign-in, notifications, recovery codes —
   reuses the shared card/badge/button patterns above. */
#passkey-login-btn { margin: 10px 0; width: 100%; }
.deliveries { margin: 6px 0 0; padding-left: 18px; }
.deliveries li { font-size: 12.5px; color: var(--muted); }
code.secret.pre { white-space: pre-wrap; }
/* Search view (v2.1.0): grouped results reuse the shared
   card/badge patterns; only the group heading and result
   link colour are new. Intent grant cards are plain .card. */
.result-group { font-size: 14px; margin: 16px 0 4px; }
#search-results a { color: var(--accent); }
.preset-row { display: flex; gap: 6px; flex-wrap: wrap;
  margin: 10px 0 2px; }
.preset-row button { font-size: 12px; padding: 4px 10px; }
.copy-btn { font-size: 12px; padding: 4px 12px; margin-bottom: 6px; }
/* Bulk-ratify confirm rows (v2.3.0): one bordered row per item
   in the full-list confirm, label text wraps under the include
   checkbox, deny-value fields stack beneath it. */
.bulk-row { border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; margin: 8px 0; }
.bulk-row .switch-row { align-items: flex-start; }
.bulk-row label { display: block; margin-top: 6px; }
@media (max-width: 640px) {
  main { padding: 10px; }
  .row-card { flex-direction: column; }
  header { gap: 8px; }
  /* Top bar: the tab strip collapses behind an overflow button;
     desktop composition above this query is unchanged. */
  #tabs-overflow { display: inline-block; }
  #tabs { display: none; }
  #tabs.open { display: flex; flex-direction: column;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--panel); border-bottom: 1px solid var(--line);
    padding: 8px; gap: 2px; z-index: 40; }
  #tabs.open button { text-align: left; padding: 10px; }
  .head-right { gap: 6px; }
  #health-pill { font-size: 11px; padding: 2px 8px; }
}
