/* ═══════════════════════════════════════════════════════════════════════
   SOQUPOOL — Foundry console
   The daily miner instrument. Extends foundry.css tokens. A control room:
   fixed instrument rail on the left, dense readout surface on the right.
   Same metal encoding (LTC silver · DOGE brass · SOQ violet), copper = live.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── console shell ────────────────────────────────────────────────────── */
.console {
  display: grid;
  grid-template-columns: 264px 1fr;
  min-height: 100vh;
}

/* left instrument rail */
.rail {
  position: sticky; top: 0; align-self: start;
  height: 100vh; overflow-y: auto;
  border-right: 1px solid var(--seam);
  background: linear-gradient(180deg, var(--iron-900), var(--iron-950));
  display: flex; flex-direction: column;
}
.rail-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 20px 22px; border-bottom: 1px solid var(--seam);
  font-size: 15px;
}
.rail-brand svg { width: 20px; height: 20px; }

.rail-ident { padding: 22px; border-bottom: 1px solid var(--seam); }
.rail-ident .who { color: var(--text-hi); font-weight: 600; font-size: 16px; }
.rail-ident .tier {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 8px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--soq);
  border: 1px solid color-mix(in srgb, var(--soq) 40%, transparent);
  padding: 4px 9px;
}
.rail-ident .since { display: block; margin-top: 12px; }

.rail-nav { padding: 12px 0; flex: 1; }
.rail-nav button {
  display: flex; align-items: center; gap: 13px; width: 100%;
  padding: 12px 22px; background: none; border: 0; cursor: pointer;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-lo);
  border-left: 2px solid transparent;
}
.rail-nav button:hover { color: var(--text-mid); background: var(--iron-850); }
.rail-nav button.on {
  color: var(--text-hi); border-left-color: var(--copper);
  background: var(--iron-850);
}
.rail-nav button .ico { width: 15px; height: 15px; flex: none; opacity: .8; }
.rail-nav button .badge {
  margin-left: auto; font-size: 10px; color: var(--copper);
  border: 1px solid var(--copper-dim); padding: 1px 6px;
}

.rail-foot { padding: 18px 22px; border-top: 1px solid var(--seam); }
.rail-foot a { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--text-lo); padding: 4px 0; letter-spacing: .06em; }
.rail-foot a:hover { color: var(--text-hi); }

/* ── main surface ─────────────────────────────────────────────────────── */
.surface { padding: 0; min-width: 0; }
.surface-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 18px 32px; border-bottom: 1px solid var(--seam);
  background: color-mix(in srgb, var(--iron-950) 90%, transparent);
  backdrop-filter: blur(10px);
}
.surface-top h1 {
  font-variation-settings: "wdth" 116; font-weight: 700; text-transform: uppercase;
  font-size: 20px; color: var(--text-hi); letter-spacing: .01em;
}
.surface-top .pool-pulse {
  display: flex; gap: 24px; align-items: center;
  font-family: var(--font-mono); font-size: 11px;
}
.surface-top .pool-pulse .k { color: var(--text-lo); letter-spacing: .1em; text-transform: uppercase; }
.surface-top .pool-pulse .v { color: var(--text-hi); margin-left: 7px; }

.pane { padding: 28px 32px 64px; display: none; }
.pane.on { display: block; }

.pane-head { display: flex; align-items: baseline; gap: 14px; margin: 4px 0 22px; }
.pane-head .tick { width: 22px; height: 1px; background: var(--seam-hi); transform: translateY(-4px); }
.pane-head h2 {
  font-variation-settings: "wdth" 114; font-weight: 700; text-transform: uppercase;
  font-size: 16px; color: var(--text-mid); letter-spacing: .05em;
}

/* ── instrument readout row ───────────────────────────────────────────── */
.readouts { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--seam); }
.gauge {
  padding: 22px 24px; border-right: 1px solid var(--seam);
  display: flex; flex-direction: column; gap: 6px; min-width: 0;
}
.gauge:last-child { border-right: 0; }
.gauge .g-label { }
.gauge .g-value { font-family: var(--font-mono); font-weight: 600; color: var(--text-hi); font-size: clamp(20px, 2.2vw, 30px); letter-spacing: -.01em; }
.gauge .g-value .u { font-size: 13px; color: var(--text-lo); font-weight: 400; margin-left: 5px; }
.gauge .g-sub { font-family: var(--font-mono); font-size: 11px; color: var(--text-lo); }
.gauge.g-live .g-value { color: var(--copper-hot); }

/* payout ring gauge */
.payout-gauge { display: flex; align-items: center; gap: 16px; }
.payout-gauge .ring { flex: none; }
.payout-gauge .pg-txt .g-value { font-size: 22px; }

/* ── panel primitive ─────────────────────────────────────────────────── */
.panel { border: 1px solid var(--seam); margin-top: 24px; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 20px; border-bottom: 1px solid var(--seam); background: var(--iron-900);
}
.panel-head .p-title { font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-mid); }
.panel-head .p-tools { display: flex; gap: 6px; }
.seg { display: flex; border: 1px solid var(--seam); }
.seg button {
  background: none; border: 0; cursor: pointer; padding: 5px 11px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em;
  color: var(--text-lo); border-right: 1px solid var(--seam);
}
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--iron-800); color: var(--copper-hot); }
.panel-body { padding: 20px; }

/* ── chart canvas frame ───────────────────────────────────────────────── */
.chart-wrap { position: relative; }
.chart-wrap svg { display: block; width: 100%; height: auto; }

/* ── per-chain balances (metal cells) ─────────────────────────────────── */
.balances { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--seam); margin-top: 24px; }
.bal { padding: 20px 22px; border-right: 1px solid var(--seam); position: relative; }
.bal:last-child { border-right: 0; }
.bal::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--bal-c); }
.bal .b-chain { display: block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em; color: var(--bal-c); text-transform: uppercase; }
.bal .b-amt { display: block; }
.bal .b-amt { font-family: var(--font-mono); font-weight: 600; color: var(--text-hi); font-size: 24px; margin-top: 10px; letter-spacing: -.01em; }
.bal .b-amt .u { font-size: 12px; color: var(--text-lo); font-weight: 400; margin-left: 5px; }
.bal .b-meta { display: flex; justify-content: space-between; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--seam); font-family: var(--font-mono); font-size: 11px; }
.bal .b-meta span:first-child { color: var(--text-lo); }
.bal .b-meta span:last-child { color: var(--text-mid); }
.b-ltc { --bal-c: var(--ltc); } .b-doge { --bal-c: var(--doge); } .b-soq { --bal-c: var(--soq); }

/* ── data tables ──────────────────────────────────────────────────────── */
.dtable { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 12.5px; }
.dtable th {
  text-align: left; padding: 11px 20px; background: var(--iron-900);
  font-size: 10px; font-weight: 400; letter-spacing: .16em; text-transform: uppercase; color: var(--text-lo);
  border-bottom: 1px solid var(--seam);
}
.dtable td { padding: 13px 20px; border-bottom: 1px solid var(--seam); color: var(--text-mid); white-space: nowrap; }
.dtable tr:last-child td { border-bottom: 0; }
.dtable td.hi { color: var(--text-hi); }
.dtable tr:hover td { background: var(--iron-900); }

/* worker status lamp */
.lamp2 { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.lamp-on { background: var(--ok); box-shadow: 0 0 6px color-mix(in srgb, var(--ok) 60%, transparent); }
.lamp-idle { background: var(--warn); }
.lamp-off { background: var(--down); }
.reject-ok { color: var(--ok); } .reject-warn { color: var(--warn); }

/* worker sparkline cell */
.spark { width: 96px; height: 26px; display: block; }

/* ── settings ─────────────────────────────────────────────────────────── */
.set-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-lo); margin-bottom: 8px; }
.field input, .field select {
  width: 100%; padding: 11px 13px; background: var(--iron-950);
  border: 1px solid var(--seam); color: var(--text-hi);
  font-family: var(--font-mono); font-size: 13px;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--copper); }
.field .hint { margin-top: 7px; font-size: 12px; color: var(--text-lo); font-family: var(--font-display); line-height: 1.5; }
.freeze-note {
  display: flex; gap: 10px; align-items: baseline; margin-top: 14px; padding: 12px 14px;
  border: 1px solid var(--seam); border-left: 2px solid var(--warn); background: var(--iron-900);
  font-size: 12.5px; color: var(--text-mid);
}
.sec-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 0; border-bottom: 1px solid var(--seam);
}
.sec-row:last-child { border-bottom: 0; }
.sec-row .s-name { color: var(--text-hi); font-weight: 600; font-size: 14px; }
.sec-row .s-desc { font-size: 12.5px; color: var(--text-lo); margin-top: 3px; max-width: 44ch; }
.pill { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; padding: 4px 9px; border: 1px solid var(--seam-hi); }
.pill-on { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.pill-off { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }

/* preview ribbon */
.preview-ribbon {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  background: var(--copper); color: #16100a; text-align: center;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; padding: 7px;
}

/* ── responsive ───────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .console { grid-template-columns: 1fr; }
  .rail {
    position: static; height: auto; flex-direction: row; flex-wrap: wrap;
    border-right: 0; border-bottom: 1px solid var(--seam);
  }
  .rail-brand { border-bottom: 0; border-right: 1px solid var(--seam); }
  .rail-ident { display: none; }
  .rail-nav { display: flex; overflow-x: auto; padding: 0; width: 100%; order: 3; border-top: 1px solid var(--seam); }
  .rail-nav button { width: auto; white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; }
  .rail-nav button.on { border-left: 0; border-bottom-color: var(--copper); }
  /* pt1: rail-foot held the ONLY Sign out control and was display:none on
     mobile — a member on a phone could not sign out. Horizontal row instead. */
  .rail-foot {
    display: flex; flex-direction: row; align-items: center; gap: 14px;
    margin-left: auto; padding: 0 14px; border-top: 0; order: 2;
  }
  .rail-foot .theme-toggle { align-self: center !important; margin: 0 !important; }
  .readouts { grid-template-columns: 1fr 1fr; }
  .gauge:nth-child(2) { border-right: 0; }
  .gauge:nth-child(n+3) { border-top: 1px solid var(--seam); }
  .balances { grid-template-columns: 1fr; }
  .bal { border-right: 0; border-bottom: 1px solid var(--seam); }
  .bal:last-child { border-bottom: 0; }
  .set-grid { grid-template-columns: 1fr; }
  /* pt1: the pool-pulse carries the admin gate state (ENFORCING/STANDBY) and
     the member pool stats — keep it visible compact instead of hiding it. */
  .surface-top { flex-wrap: wrap; gap: 8px; }
  .surface-top .pool-pulse { gap: 12px; font-size: 10.5px; flex-wrap: wrap; }
  .pane { padding: 20px 18px 80px; }
}
