/*
 * Shared by the member page (index.html) and the operator console (admin.html).
 *
 * Light is the default. Dark is opt-in via `data-theme="dark"` on <html>, set
 * before first paint by the inline script in each page so there is no flash of
 * the wrong theme on load.
 */

:root {
  --bg: #faf8f5;
  --panel: #ffffff;
  --sunk: #f4f0ea;
  --line: #e4ddd3;
  --text: #211c17;
  --muted: #756c62;
  --gold: #8a5d0f;
  --gold-bg: #fdf4e2;
  --good: #1c6f4a;
  --good-bg: #eaf5ef;
  --bad: #b3372a;
  --bad-bg: #fdeeec;
  --warn: #96690a;
  --shadow: 0 1px 2px rgba(33, 28, 23, .06), 0 1px 8px rgba(33, 28, 23, .04);
}

:root[data-theme="dark"] {
  --bg: #12100e;
  --panel: #1c1917;
  --sunk: #14110f;
  --line: #2f2a26;
  --text: #ede9e4;
  --muted: #a29a91;
  --gold: #d9a441;
  --gold-bg: #241a0b;
  --good: #4caf7d;
  --good-bg: #10201a;
  --bad: #e05c4a;
  --bad-bg: #2b1714;
  --warn: #e0a63f;
  --shadow: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* -- chrome ---------------------------------------------------------------- */

header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 10;
}
header h1 { font-size: 16px; margin: 0; font-weight: 650; letter-spacing: .2px; }
header .spacer { flex: 1; }
header a { color: var(--muted); text-decoration: none; font-size: 14px; }
header a:hover { color: var(--text); }

main { padding: 24px; max-width: 1080px; margin: 0 auto; }

section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
section h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .9px;
  color: var(--muted);
  margin: 0 0 14px;
  font-weight: 650;
}
section h3 { font-size: 15px; margin: 20px 0 6px; font-weight: 650; }
section h3:first-of-type { margin-top: 0; }
section p { margin: 0 0 12px; }
section p:last-child { margin-bottom: 0; }

/* -- controls -------------------------------------------------------------- */

button {
  background: var(--gold);
  color: #fff;
  border: 0;
  border-radius: 7px;
  padding: 8px 15px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
:root[data-theme="dark"] button { color: #241c0e; }
button:hover { filter: brightness(1.08); }
button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}
button.ghost:hover { color: var(--text); filter: none; background: var(--sunk); }
button.danger { background: transparent; color: var(--bad); border: 1px solid var(--line); }
button:disabled { opacity: .5; cursor: default; filter: none; }
button.icon { padding: 7px 10px; font-size: 15px; line-height: 1; }

input[type="email"], input[type="search"], select {
  background: var(--sunk);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
}
input:focus, select:focus { outline: 2px solid var(--gold); outline-offset: -1px; }
input[type="email"] { min-width: 280px; }
input[type="search"] { min-width: 240px; flex: 1; }

/* -- tables and cards ------------------------------------------------------ */

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
  font-weight: 650;
  padding: 6px 10px 6px 0;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--panel);
}
td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px; }
.card { background: var(--sunk); border: 1px solid var(--line); border-radius: 9px; padding: 14px; }
.card .label { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.card .value { font-size: 22px; font-weight: 650; margin-top: 5px; font-variant-numeric: tabular-nums; }
.card .sub { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* -- bits ------------------------------------------------------------------ */

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; flex: none; }
.good { color: var(--good); } .bad { color: var(--bad); }
.warn { color: var(--warn); } .gold { color: var(--gold); }
.dot.good { background: var(--good); } .dot.bad { background: var(--bad); } .dot.warn { background: var(--warn); }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.small { font-size: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hidden { display: none !important; }
.scroll { max-height: 420px; overflow-y: auto; }

.pill {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 650;
  padding: 2px 7px;
  border-radius: 20px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.pill.ai { color: var(--gold); background: var(--gold-bg); border-color: transparent; }
.pill.own { color: var(--good); background: var(--good-bg); border-color: transparent; }
.pill.off { color: var(--bad); background: var(--bad-bg); border-color: transparent; }

.err {
  background: var(--bad-bg);
  border: 1px solid var(--bad);
  color: var(--bad);
  border-radius: 8px;
  padding: 10px 13px;
  margin-bottom: 16px;
  font-size: 14px;
}

.note {
  background: var(--sunk);
  border-left: 3px solid var(--gold);
  border-radius: 0 7px 7px 0;
  padding: 12px 14px;
  font-size: 14px;
  margin: 0 0 14px;
}

/* -- sign-in gate ---------------------------------------------------------- */

.gate { max-width: 430px; margin: 12vh auto; text-align: center; padding: 0 24px; }
.gate h1 { font-size: 26px; margin: 0 0 6px; }
.gate .tag { color: var(--muted); margin: 0 0 26px; }
.gate p { color: var(--muted); }

/* -- page-specific --------------------------------------------------------- */

.desc { color: var(--muted); font-size: 13px; max-width: 440px; }

.build {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.build:first-child { padding-top: 0; }
.build:last-child { border-bottom: 0; padding-bottom: 0; }
.build .grow { flex: 1; min-width: 220px; }
.fingerprint { word-break: break-all; }

.steps { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; }
.steps li { margin-bottom: 5px; }

.loc {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.loc:first-child { padding-top: 0; }
.loc:last-child { border-bottom: 0; padding-bottom: 0; }
.loc .grow { flex: 1; min-width: 240px; }
.loc .taps { text-align: right; min-width: 90px; font-variant-numeric: tabular-nums; }

@media (max-width: 620px) {
  main { padding: 16px; }
  section { padding: 16px; }
  header { padding: 12px 16px; gap: 8px; }
  header .hideNarrow { display: none; }
  .desc { max-width: none; }
}
