@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/inter.woff2) format("woff2"); }
:root {
  --bg: #12141c;
  --bg-elevated: #1a1d29;
  --bg-card: #1e2230;
  --border: #2a2f42;
  --border-light: #363c54;
  --text: #e8e9ed;
  --text-dim: #8891a8;
  --text-faint: #5b6280;
  --accent: #f5a524;
  --accent-dim: #b87e1c;
  --green: #3ecf8e;
  --red: #f0596a;
  --blue: #4d9dff;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  min-height: 100vh;
}
body {
  background:
    radial-gradient(circle at 12% -10%, rgba(245,165,36,0.10), transparent 42%),
    radial-gradient(circle at 88% 0%, rgba(77,157,255,0.08), transparent 38%),
    var(--bg);
  background-attachment: fixed;
}
/* the slight "zoom out" for a denser desktop layout doesn't translate well to phones
   (mobile browsers handle non-standard `zoom` inconsistently, and shrinking further hurts
   readability where it's already tight) -- keep it desktop-only. */
@media (min-width: 900px) {
  body { zoom: 0.9; }
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 6px; }

.hidden { display: none !important; }

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.3px;
}
.topbar .brand .logo {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--accent), #ff7a3d);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #1a1200;
}
.topbar .brand { text-decoration: none; }
.topbar-middle { flex: 1; display: flex; justify-content: center; min-width: 0; overflow-x: auto; padding: 0 12px; }
.topbar .crumbs { color: var(--text-dim); font-size: 13px; display: flex; gap: 6px; align-items: center; }
.topbar .crumbs a { color: var(--text-dim); }
.topbar .crumbs a:hover { color: var(--text); }
.topbar .right { display: flex; align-items: center; gap: 18px; flex-shrink: 0; }
.topbar .username { font-size: 13px; }
/* pseudo + icon are ONE control: it opens the account / alert settings */
.account-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 9px;
  background: transparent; border: 1px solid transparent; border-radius: 9px; cursor: pointer;
  color: var(--text-dim); font-family: inherit; transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.account-btn:hover { background: var(--bg-card); border-color: var(--border-light); color: var(--text); }
.account-btn:focus-visible { outline: 2px solid rgba(245,165,36,0.5); outline-offset: 2px; }
.account-ico { flex-shrink: 0; }

/* ---------- "Vos suggestions" button: a quiet, persistent call-to-attention ---------- */
.roadmap-btn {
  position: relative; display: inline-flex; align-items: center; gap: 9px; padding: 6px 14px 6px 12px;
  background: rgba(77,157,255,0.1); border: 1px solid rgba(77,157,255,0.32); border-radius: 11px; cursor: pointer;
  color: var(--blue); font-family: inherit; transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.roadmap-btn:hover { background: rgba(77,157,255,0.18); border-color: rgba(77,157,255,0.5); transform: translateY(-1px); }
.roadmap-btn:active { transform: translateY(0); }
.roadmap-btn:focus-visible { outline: 2px solid rgba(77,157,255,0.5); outline-offset: 2px; }
.roadmap-btn-ico { flex-shrink: 0; }
.roadmap-btn-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.roadmap-btn-line1 { font-size: 12.5px; font-weight: 700; }
.roadmap-btn-line2 { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--blue); opacity: .75; }
/* a slow, soft sonar ring -- draws the eye without ever looking like an old blinking banner */
.roadmap-btn-ring { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; animation: roadmap-ring 3.2s ease-out infinite; }
@keyframes roadmap-ring { 0% { box-shadow: 0 0 0 0 rgba(77,157,255,0.45); } 70%, 100% { box-shadow: 0 0 0 10px rgba(77,157,255,0); } }
@media (prefers-reduced-motion: reduce) { .roadmap-btn-ring { animation: none; } }
@media (max-width: 760px) { .roadmap-btn-text { display: none; } .roadmap-btn { padding: 8px; } }

/* ---------- section tabs (below topbar) ---------- */
.section-tabs {
  display: flex; gap: 26px; padding: 0 24px;
  background: var(--bg-elevated); border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.section-tabs a {
  color: var(--text-dim); font-size: 13px; font-weight: 600;
  padding: 13px 2px; border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.section-tabs a:hover { color: var(--text); text-decoration: none; }
.section-tabs a.active { color: var(--text); border-bottom-color: var(--accent); }

/* ---------- stats strip ---------- */
.stats-strip { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0 22px; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 20px; min-width: 118px; flex: 1 1 118px;
}
.stat-card .v { font-size: 19px; font-weight: 800; display: flex; align-items: center; flex-wrap: wrap; column-gap: 6px; }
.stat-card .v .unit { font-size: 12px; font-weight: 600; color: var(--text-dim); }
.stat-card .l { font-size: 10.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; font-weight: 700; }
.stat-card.text .v { font-size: 14px; font-weight: 700; word-break: break-word; display: block; }
/* seven cards in one row on the admin overview: tighter padding so each value stays on one line */
#admin-stats-strip .stat-card { padding: 14px 16px; }
/* what the rig is set to mine: sits right under the IP/OS/uptime strip, so it pulls up against it instead of
   adding the strip's own 24px top margin on top; one row of four cards per mining slot */
#rig-mining-strip { margin-top: -8px; }
.mining-row { display: flex; gap: 12px; flex: 1 1 100%; flex-wrap: wrap; }
.mining-row .stat-card { flex: 1 1 150px; }
.mining-paused { font-size: 10.5px; font-weight: 700; color: var(--accent); margin-left: 4px; text-transform: uppercase; letter-spacing: .04em; }
#rig-ip { cursor: pointer; }
#rig-ip:hover { color: var(--accent); }
.stat-card.accent .v { color: var(--accent); }
.stat-card.green .v { color: var(--green); }

/* ---------- layout ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 28px 24px 60px; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.page-header h1 { font-size: 20px; margin: 0; font-weight: 700; }
.page-header .sub { color: var(--text-dim); font-size: 13px; margin-top: 4px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #1a1200; }
.btn.primary:hover { background: #ffb646; color: #1a1200; }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: var(--red); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.small { padding: 6px 10px; font-size: 12px; }

/* ---------- cards / grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: border-color .15s ease;
}
.card:hover { border-color: var(--border-light); }
.card.clickable { cursor: pointer; }
.card .card-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; display:flex; align-items:center; gap:8px; }
.card .card-sub { color: var(--text-dim); font-size: 12px; }

.card-add {
  display: flex; align-items: center; justify-content: center;
  border: 1.5px dashed var(--border-light);
  border-radius: var(--radius);
  min-height: 90px;
  color: var(--text-dim);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}
.card-add:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- farm card (HiveOS style) ---------- */
.farm-card-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; margin-bottom: 12px; }
.farm-card-head .star { color: var(--text-faint); font-size: 14px; }
.farm-mini-row { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 10px; }
.farm-mini { font-size: 15px; font-weight: 800; }
.farm-mini .l { display: block; font-size: 10px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }
.farm-mini.online .num-on { color: var(--green); }
.farm-hash-line {
  display: flex; align-items: center; gap: 8px;
  background: rgba(245,165,36,0.08); border-radius: 8px;
  padding: 8px 12px; margin-top: 4px; font-weight: 800; font-size: 15px; color: var(--accent);
}
.farm-hash-line .unit { font-size: 11px; font-weight: 700; color: var(--accent-dim); }
/* the CPU part of a hashrate (never summed with the GPU one -- different coins/algos): smaller, in the CPU blue */
.hash-cpu { font-size: 0.72em; font-weight: 700; color: var(--blue); white-space: nowrap; }
.farm-card-empty-hash { color: var(--text-faint); font-size: 12px; font-style: italic; margin-top: 4px; }

/* ---------- worker (rig) list ---------- */
.worker-list { display: flex; flex-direction: column; gap: 8px; }
.worker-row {
  display: flex; align-items: center; gap: 18px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 9px;
  padding: 13px 18px; cursor: pointer; flex-wrap: wrap;
  transition: border-color .15s ease, background .15s ease;
}
.worker-row:hover { border-color: var(--border-light); background: var(--bg-elevated); }
.worker-star { color: var(--text-faint); font-size: 14px; flex-shrink: 0; }
.worker-name { min-width: 130px; flex: 1 1 140px; }
.worker-name-main { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.worker-name-sub { color: var(--text-dim); font-size: 11.5px; margin-top: 2px; }
.worker-miner { flex: 2 1 220px; font-size: 13px; color: var(--text-dim); }
.worker-miner b { color: var(--text); font-weight: 700; }
.worker-miner .coin-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg); border: 1px solid var(--border-light); border-radius: 5px;
  padding: 1px 6px; font-size: 10.5px; font-weight: 800; color: var(--accent); margin-right: 6px;
}
.worker-metric { width: 88px; flex-shrink: 0; font-size: 12.5px; color: var(--text-dim); text-align: right; }
.worker-metric b { color: var(--text); font-weight: 700; display: block; font-size: 13px; }
.worker-add-row {
  border: 1.5px dashed var(--border-light); background: transparent;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; color: var(--text-dim); font-weight: 600; font-size: 13px; cursor: pointer; border-radius: 9px;
}
.worker-add-row:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 700px) {
  .worker-row { gap: 10px; }
  .worker-metric { text-align: left; width: auto; }
}

/* status dot */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot.online { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot.offline { background: var(--red); }

.stat-row { display: flex; gap: 18px; margin-top: 10px; flex-wrap: wrap; }
.stat-mini { font-size: 12px; color: var(--text-dim); }
.stat-mini b { color: var(--text); font-size: 13px; }

/* ---------- table ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
th { color: var(--text-dim); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: none; }

/* ---------- forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-light);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 7px;
  font-size: 14px;
  font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
}
.field .hint { color: var(--text-faint); font-size: 11px; margin-top: 4px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.oc-detected-hint {
  background: var(--bg-hover, rgba(255,255,255,0.04)); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; margin: 10px 0; color: var(--text-dim); font-size: 12px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.oc-detected-hint .oc-use-detected { margin-left: auto; }

.oc-preset-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px;
  padding: 10px 12px; background: var(--bg-hover, rgba(255,255,255,0.04)); border: 1px solid var(--border); border-radius: 8px;
}
.oc-preset-row .oc-preset-select {
  flex: 1 1 200px; min-width: 160px; background: var(--bg); color: var(--text); border: 1px solid var(--border-light);
  border-radius: 7px; padding: 7px 10px; font-size: 12.5px; font-family: inherit;
}
.oc-preset-row .btn.danger.ghost { background: transparent; border-color: rgba(240,89,106,0.35); color: var(--red); }
.oc-preset-row .btn.danger.ghost:hover { background: rgba(240,89,106,0.1); }

/* ---------- overclock sliders (MSI Afterburner-style) ---------- */
.oc-slider-field { margin-bottom: 18px; }
.oc-slider-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.oc-slider-head label { font-size: 12px; color: var(--text-dim); font-weight: 600; margin: 0; }
.oc-slider-val { font-size: 14px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.oc-slider-val .unit { font-size: 11px; font-weight: 600; color: var(--text-faint); margin-left: 2px; }
.oc-slider-field.is-neutral .oc-slider-val { color: var(--text-faint); }
.oc-slider-row { display: flex; align-items: center; gap: 10px; }
.oc-slider-row input[type="range"] {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 6px; border-radius: 3px; background: var(--border-light);
  outline: none; cursor: pointer;
}
.oc-slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); border: 2px solid #12141c; cursor: pointer;
  box-shadow: 0 0 0 1px rgba(245,165,36,0.4);
}
.oc-slider-row input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%; border: 2px solid #12141c;
  background: var(--accent); cursor: pointer; box-shadow: 0 0 0 1px rgba(245,165,36,0.4);
}
.oc-slider-row input[type="range"]:disabled { opacity: 0.35; cursor: not-allowed; }
.oc-slider-reset {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 6px; display: flex; align-items: center;
  justify-content: center; background: transparent; border: 1px solid var(--border-light);
  color: var(--text-faint); cursor: pointer; font-size: 13px; transition: all .12s ease;
}
.oc-slider-reset:hover { color: var(--text); border-color: var(--accent); }
.oc-advanced-toggle { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.oc-advanced-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.oc-advanced-row input[type="number"] {
  width: 90px; flex-shrink: 0; background: var(--bg); border: 1px solid var(--border-light);
  color: var(--text); padding: 6px 8px; border-radius: 6px; font-size: 13px; font-family: inherit;
}
.oc-advanced-row input[type="number"]:disabled { opacity: 0.4; }
.oc-advanced-hint { color: var(--text-faint); font-size: 11px; }
.oc-slider-warn { margin-top: 6px; font-size: 11px; color: var(--accent); }
.oc-status { margin: 4px 0 10px; font-size: 12px; min-height: 0; }
.oc-status-ok { color: var(--green); }
.oc-status-err { color: var(--red); }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
}
.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%; max-width: 480px;
  padding: 24px;
  box-shadow: var(--shadow);
  max-height: 90vh; overflow-y: auto;
}
.modal h2 { margin: 0 0 18px; font-size: 17px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ---------- boot loading (plain bg, avoids a login-screen flash while /api/auth/me is in flight) ---------- */
.boot-loading { min-height: 100vh; background: var(--bg); }

/* ---------- login ---------- */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 20%, rgba(245,165,36,0.05), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(77,157,255,0.04), transparent 45%),
    var(--bg);
}
/* a faint dot grid gives the empty background some texture instead of a flat void */
.login-screen::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(circle at 50% 40%, black, transparent 75%);
}
.login-orb { position: absolute; border-radius: 50%; filter: blur(70px); pointer-events: none; opacity: .8; animation: orb-drift 14s ease-in-out infinite; }
.login-orb-1 { width: 460px; height: 460px; top: -180px; left: -140px; background: radial-gradient(circle, rgba(245,165,36,0.24), transparent 70%); }
.login-orb-2 { width: 500px; height: 500px; bottom: -220px; right: -160px; background: radial-gradient(circle, rgba(77,157,255,0.17), transparent 70%); animation-delay: -7s; animation-direction: reverse; }
@keyframes orb-drift { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(22px, -18px) scale(1.06); } }

.login-box {
  width: 100%; max-width: 400px;
  background: linear-gradient(180deg, rgba(32,36,51,0.92), rgba(24,27,38,0.94));
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 44px 38px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.03) inset, 0 1px 0 rgba(255,255,255,0.05) inset;
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 1;
  animation: login-in .4s cubic-bezier(.16,.9,.3,1);
}
/* a thin glowing seam along the top edge -- the one detail that most reads as "designed" rather than "default card" */
.login-box::before {
  content: ""; position: absolute; top: 0; left: 14%; right: 14%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245,165,36,0.9), transparent);
}
@keyframes login-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

.login-box .logo-big {
  width: 60px; height: 60px; border-radius: 17px;
  background: linear-gradient(135deg, var(--accent), #ff7a3d);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 25px; color: #1a1200;
  margin: 0 auto 22px;
  box-shadow: 0 10px 28px rgba(245,165,36,0.4), 0 0 0 6px rgba(245,165,36,0.08);
  animation: logo-pulse 3.2s ease-in-out infinite;
}
@keyframes logo-pulse { 0%, 100% { box-shadow: 0 10px 28px rgba(245,165,36,0.4), 0 0 0 6px rgba(245,165,36,0.08); } 50% { box-shadow: 0 10px 32px rgba(245,165,36,0.5), 0 0 0 10px rgba(245,165,36,0.05); } }
.login-box h1 { text-align: center; font-size: 22px; margin: 0 0 6px; letter-spacing: -0.3px; font-weight: 800; }
.login-box .sub { text-align: center; color: var(--text-dim); font-size: 13px; margin-bottom: 32px; }

.login-box .field label { letter-spacing: .04em; font-size: 11.5px; text-transform: uppercase; color: var(--text-faint); }
.login-box .field input {
  background: rgba(0,0,0,0.22);
  border: 1px solid var(--border-light);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
  padding: 12px 14px;
  font-size: 14.5px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.login-box .field input:hover { border-color: #454c68; }
.login-box .field input:focus {
  outline: none; border-color: var(--accent); background: rgba(0,0,0,0.3);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.3), 0 0 0 3px rgba(245,165,36,0.15);
}

.otp-inputs { display: flex; gap: 8px; justify-content: center; margin-bottom: 6px; }
.otp-inputs input {
  width: 44px; height: 54px; text-align: center; font-size: 22px; font-weight: 700;
  background: rgba(0,0,0,0.22); border: 1px solid var(--border-light); border-radius: 10px; color: var(--text);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
  transition: border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.otp-inputs input:focus { outline: none; border-color: var(--accent); transform: translateY(-1px); box-shadow: inset 0 1px 3px rgba(0,0,0,0.3), 0 0 0 3px rgba(245,165,36,0.18); }
.error-msg { color: var(--red); font-size: 13px; margin: 10px 0; text-align: center; }
.info-msg { color: var(--text-dim); font-size: 12px; margin: 10px 0; text-align: center; }
.success-msg { color: var(--green); font-size: 13px; margin: 10px 0; text-align: center; font-weight: 600; }

.login-box .btn.primary {
  background: linear-gradient(135deg, #ffbb52, var(--accent) 55%, #f2941a);
  border: none;
  font-size: 14px;
  padding: 12px 16px;
  box-shadow: 0 8px 22px rgba(245,165,36,0.3);
}
.login-box .btn.primary:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(245,165,36,0.42); filter: brightness(1.05); }
.login-box .btn.primary:active { transform: translateY(0); box-shadow: 0 4px 14px rgba(245,165,36,0.3); }
.login-box .btn { justify-content: center; text-align: center; transition: all .15s ease, transform .1s ease; }

/* ---------- gauges (rig detail) ---------- */
.gauge-wrap { margin-bottom: 16px; }
.gauge-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.gauge-label b { color: var(--text); font-size: 14px; }
.gauge-bar { height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; }
.gauge-fill { height: 100%; border-radius: 4px; transition: width .4s ease; }
.gauge-fill.ok { background: var(--green); }
.gauge-fill.warn { background: var(--accent); }
.gauge-fill.crit { background: var(--red); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700;
  background: rgba(255,255,255,0.06); color: var(--text-dim);
}
.badge.online { background: rgba(62,207,142,0.15); color: var(--green); }
.badge.offline { background: rgba(240,89,106,0.15); color: var(--red); }

.copy-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--border-light); border-radius: 8px;
  padding: 10px 12px; font-family: "SF Mono", Consolas, monospace; font-size: 12.5px;
  color: var(--accent); overflow-x: auto; white-space: nowrap;
}
.copy-box code { flex: 1; overflow-x: auto; }

.section { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.section h3 { margin: 0 0 16px; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab { padding: 10px 16px; color: var(--text-dim); cursor: pointer; font-size: 13px; font-weight: 600; border-bottom: 2px solid transparent; }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab:hover { color: var(--text); }
.tab-panel.hidden { display: none; }

/* ---------- gpu summary row (rig detail, HiveOS-style) ---------- */
.gpu-row-card {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 16px; margin-bottom: 8px;
}
.row-icon { flex-shrink: 0; display: block; }
.row-icon-fan { animation: row-fan-spin 2.2s linear infinite; }
@keyframes row-fan-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .row-icon-fan { animation: none; } }
.gpu-row-name { flex: 1 1 180px; min-width: 160px; }
.gpu-row-title { font-weight: 700; font-size: 13.5px; }
.gpu-row-model { font-weight: 700; font-size: 13.5px; color: var(--accent); }
.gpu-row-sub { color: var(--text-dim); font-size: 11px; margin-top: 2px; }
.gpu-row-sub span { color: var(--text); }
.gpu-row-gauge { width: 110px; flex-shrink: 0; }
.gpu-row-glabel { font-size: 9px; color: var(--text-faint); letter-spacing: .06em; margin-bottom: 3px; font-weight: 700; }
.gauge-bar.mini { height: 5px; margin-bottom: 3px; }
.gpu-row-gval { font-size: 12px; font-weight: 700; }
.gpu-row-hash { text-align: right; margin-left: auto; flex-shrink: 0; }
.gpu-row-hash > div:first-child { font-size: 24px; font-weight: 800; color: var(--accent); line-height: 1.2; }
.gpu-row-index { display: inline-flex; align-items: center; justify-content: center; width: auto; height: 18px; padding: 0 6px; border-radius: 5px; background: var(--bg); border: 1px solid var(--border-light); font-size: 10px; font-weight: 800; color: var(--text-dim); margin-right: 6px; }
.gpu-row-bus { font-size: 10px; color: var(--text-faint); font-family: "SF Mono", Consolas, monospace; margin-top: 1px; }
#rig-gpu-rows { display: flex; flex-direction: column; gap: 6px; }
/* the CPU card is a sibling of #rig-gpu-rows (not one of its flex children), so it never got that 6px
   gap and sat flush against the last GPU card -- only visible once a rig actually shows >=1 GPU row AND
   the CPU row at the same time, which is why this went unnoticed until a real 2-GPU + CPU rig hit it. */
#rig-cpu-row:not(.hidden) { margin-top: 6px; }
.gpu-row-gear { width: 32px; height: 32px; font-size: 14px; flex-shrink: 0; }
.gpu-row-hash-total { text-align: center; margin: 2px 2px 14px; font-size: 13px; color: var(--text-dim); }
.gpu-row-hash-total b { color: var(--accent); font-size: 16px; }

.banner-warn {
  background: rgba(245,165,36,0.1); border: 1px solid rgba(245,165,36,0.35);
  color: var(--accent); border-radius: var(--radius); padding: 14px 18px;
  margin-bottom: 16px; font-size: 13px;
}
.banner-warn.banner-error { background: rgba(240,89,106,0.1); border-color: rgba(240,89,106,0.35); color: var(--red); }
.banner-warn.banner-error code { color: var(--text-dim); }

/* ---------- install progress ---------- */
.install-progress-bar { height: 10px; border-radius: 5px; background: var(--border); overflow: hidden; }
.install-progress-fill {
  height: 100%; border-radius: 5px;
  background: linear-gradient(90deg, var(--accent), #ff7a3d);
  transition: width .6s ease;
}
.install-progress-label { margin-top: 8px; font-size: 12.5px; color: var(--text-dim); }
.install-progress-label b { color: var(--accent); font-size: 13.5px; }

/* ---------- toggle switch (on/off, green/red) ---------- */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; margin-bottom: 14px;
}
.toggle-row-label { font-size: 13.5px; color: var(--text); font-weight: 600; }
.toggle-row-status { font-size: 11px; font-weight: 500; margin-left: 8px; opacity: 0; transition: opacity .15s; }
.toggle-row-status.ok { color: var(--green); opacity: 1; }
.toggle-row-status.err { color: var(--red); opacity: 1; }
.toggle-row-hint { font-size: 11.5px; color: var(--text-faint); margin-top: 3px; font-weight: 400; }
.toggle-switch { position: relative; display: inline-flex; align-items: center; width: 48px; height: 26px; flex: none; cursor: pointer; }
.toggle-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.toggle-switch .track {
  position: absolute; inset: 0; border-radius: 999px; background: var(--red);
  transition: background .15s ease;
}
.toggle-switch input:checked + .track { background: var(--green); }
.toggle-switch .thumb {
  position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; transition: transform .15s ease; pointer-events: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.toggle-switch input:checked ~ .thumb { transform: translateX(22px); }
.banner-warn b { display: block; margin-bottom: 4px; font-size: 13.5px; }
.banner-warn code {
  display: block; margin-top: 8px; background: var(--bg); border: 1px solid var(--border-light);
  border-radius: 6px; padding: 8px 10px; font-family: "SF Mono", Consolas, monospace;
  font-size: 11.5px; color: var(--text-dim); overflow-x: auto; white-space: pre-wrap; word-break: break-all;
}

.oc-gpu-block { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; }
.oc-gpu-block h4 { margin: 0 0 14px; font-size: 13px; color: var(--text-dim); display: flex; align-items: center; gap: 8px; }
.oc-gpu-block h4 b { color: var(--text); font-size: 13.5px; }

/* ---------- mini sparklines (gpu row) ---------- */
.spark-row { display: flex; align-items: center; gap: 8px; }
.mini-spark { width: 48px; height: 20px; display: block; flex-shrink: 0; }

/* ---------- shares ---------- */
/* text-align (not flex+gap) matches .gpu-row-hash-total right above it -- the three stats are separated
   by an explicit middot (see app.js) instead of bare gap, so the row anchors visually the same way the
   hashrate/power line above it does, instead of looking like a loosely related row of three items */
.shares-line { text-align: center; margin: 2px 2px 18px; font-size: 13px; color: var(--text-dim); }
.shares-line .ok { color: var(--green); font-weight: 700; }
.shares-line .bad { color: var(--red); font-weight: 700; }
.shares-line .pct-ok { color: var(--green); font-weight: 700; }
.shares-line .pct-warn { color: var(--accent); font-weight: 700; }
.shares-line .pct-bad { color: var(--red); font-weight: 700; }
.shares-line .pct-critical { color: var(--red); font-weight: 700; animation: pct-blink 1s step-start infinite; }
@keyframes pct-blink { 50% { opacity: 0.25; } }

/* ---------- rig activity log ---------- */
.activity-log {
  display: flex; gap: 8px 10px; flex-wrap: wrap; align-items: flex-start; align-content: flex-start;
  margin: 0 0 22px; max-height: 66px; overflow: hidden;
}
.log-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 7px;
  padding: 6px 10px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.log-pill.log-pending { color: var(--blue); border-color: rgba(77,157,255,0.35); }
.log-pill.log-success { color: var(--green); border-color: rgba(62,207,142,0.3); }
.log-pill.log-error { color: var(--red); border-color: rgba(240,89,106,0.3); }
.log-pill.log-info { color: var(--text-dim); }
.log-pill .log-time { color: var(--text-faint); font-weight: 400; }
.log-pill .log-dismiss { background: none; border: none; color: inherit; cursor: pointer; font-size: 13px; opacity: .6; padding: 0; line-height: 1; }
.log-pill .log-dismiss:hover { opacity: 1; }
.log-clear-all {
  background: transparent; border: 1px solid var(--border-light); border-radius: 7px;
  width: 30px; height: 30px; color: var(--text-dim); cursor: pointer; flex-shrink: 0;
}
.log-clear-all:hover { color: var(--red); border-color: var(--red); }

/* ---------- sysinfo ---------- */
.sysinfo-strip { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.sysinfo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 40px; }
.sysinfo-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.sysinfo-row .l { color: var(--text-dim); }
.sysinfo-row .v { color: var(--text); font-weight: 600; text-align: right; }

/* ---------- crypto price card ---------- */
.price-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; margin-top: 24px;
}
.price-head-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.price-name { display: flex; align-items: center; gap: 10px; }
.price-name .coin-icon { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; }
.price-name .coin-fullname { font-weight: 700; font-size: 16px; }
.price-name .coin-symbol { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; font-weight: 700; }
.price-range-card { text-align: center; }
.price-range-card .v { font-size: 22px; justify-content: center; }
.price-range-card .l { font-size: 11px; }
.price-main { text-align: right; }
.price-main .price-val { font-size: 26px; font-weight: 800; line-height: 1.2; transition: color .2s ease; }
.price-main .badge.price-change { margin-top: 6px; transition: color .2s ease, background .2s ease; }
.price-card .flash-up { color: var(--green) !important; }
.price-card .flash-down { color: var(--red) !important; }
.price-card canvas { width: 100%; height: 200px; display: block; }

@media (max-width: 480px) {
  .price-head-row { flex-direction: column; }
  .price-main { text-align: left; }
}

@media (max-width: 640px) {
  .sysinfo-grid { grid-template-columns: 1fr; }
}

/* ---------- rig toolbar (HiveOS-style icon bar) ---------- */
.rig-toolbar {
  display: flex; align-items: center; gap: 10px;
}
.rig-toolbar-group { display: flex; align-items: center; gap: 4px; }
.rig-toolbar-sep { width: 1px; height: 22px; background: var(--border-light); }
.icon-btn {
  width: 42px; height: 40px; border-radius: 7px;
  background: transparent; border: 1px solid transparent; color: var(--text-dim);
  display: flex; align-items: center; justify-content: center; font-size: 16px; cursor: pointer;
  transition: all .12s ease;
}
.icon-btn:hover { background: var(--bg-card); color: var(--text); border-color: var(--border-light); }
.icon-btn.labeled { width: auto; padding: 0 12px; gap: 7px; font-size: 13px; font-weight: 600; }
.icon-btn.labeled .icon-btn-emoji { font-size: 15px; }
.icon-btn.active { color: var(--accent); background: rgba(245,165,36,0.12); }
.icon-btn.danger:hover { color: var(--red); border-color: var(--red); }
.icon-btn-dropdown { position: relative; }
.dropdown-menu {
  /* position: fixed (not absolute) + JS-computed top/left (see positionDropdown() in app.js) --
     this deliberately escapes any ancestor's overflow clipping (e.g. .topbar-middle's
     overflow-x:auto, which per spec also computes overflow-y to auto and would otherwise
     clip/scroll-trap an absolutely positioned dropdown instead of floating it over the page). */
  position: fixed; z-index: 1000;
  background: var(--bg-elevated); border: 1px solid var(--border-light); border-radius: 8px;
  box-shadow: var(--shadow); min-width: 200px; max-width: calc(100vw - 16px); padding: 6px;
}
.dropdown-menu a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--text); font-size: 13px; }
.dropdown-menu a:hover { background: var(--bg-card); text-decoration: none; }
.refresh-select {
  background: var(--bg); border: 1px solid var(--border-light); color: var(--text);
  border-radius: 7px; padding: 7px 8px; font-size: 12.5px; height: 34px;
}
.shell-output {
  background: var(--bg); border: 1px solid var(--border-light); border-radius: 8px;
  padding: 10px 12px; font-family: "SF Mono", Consolas, monospace; font-size: 12px;
  white-space: pre-wrap; word-break: break-all; max-height: 260px; overflow-y: auto; margin-top: 12px;
  color: var(--text-dim);
}

@media (max-width: 800px) {
  .gpu-row-card { justify-content: flex-start; }
  .gpu-row-hash { margin-left: 0; text-align: left; }
}

canvas.chart { width: 100%; height: 160px; display: block; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-dim); }
.empty-state .big { font-size: 40px; margin-bottom: 12px; }

/* ---------- admin panel ---------- */
.section-tabs a.admin-link { color: var(--accent); margin-left: auto; }
.admin-subtabs { margin-bottom: 18px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px; width: fit-content; }
.mono, .admin-panel table td.mono, .admin-panel table td .mono { font-family: "SF Mono", Consolas, monospace; font-size: 12px; color: var(--text-dim); }
.admin-badge { display: inline-block; padding: 2px 8px; border-radius: 5px; font-size: 11px; font-weight: 700; background: rgba(245,165,36,0.15); color: var(--accent); }
.admin-link-btn { color: var(--accent); cursor: pointer; font-weight: 600; }
.admin-link-btn:hover { text-decoration: underline; }
.admin-rig-dim td { color: var(--text-faint); }
.admin-rig-dim .admin-link-btn { color: var(--text-dim); }
.admin-rigs-sep td { text-align: center; padding: 8px; font-size: 11.5px; color: var(--text-faint); background: var(--bg-elevated); border-top: 1px solid var(--border); }

.smtp-panel { max-width: 560px; margin: 0 auto; }
.smtp-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.smtp-panel .hint { margin-bottom: 18px; }
.smtp-panel-actions { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.smtp-test-block {
  margin-top: 26px; padding: 18px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
}
.smtp-test-block h4 { margin: 0 0 14px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); }
.smtp-test-block .field { margin-bottom: 12px; }
.admin-user-head {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 16px;
}
.admin-user-head h3 { margin: 0 0 4px; font-size: 16px; }
.admin-farm-block { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; }
.admin-farm-block h4 { margin: 0 0 10px; font-size: 13.5px; color: var(--text-dim); }
.admin-farm-block h4 b { color: var(--text); }

@media (max-width: 640px) {
  .row2 { grid-template-columns: 1fr; }
  .container { padding: 20px 14px 40px; }
  .grid { grid-template-columns: 1fr; }
}

/* ---------- table horizontal scroll on narrow screens ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll table { min-width: 480px; }

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  .topbar { padding: 10px 12px; gap: 8px; }
  .topbar .brand .logo { width: 24px; height: 24px; font-size: 13px; }
  .topbar .brand .brand-text { display: none; }
  .topbar .right { gap: 8px; }
  .topbar .username { display: none; }
  .topbar-middle { padding: 0 4px; }

  .section-tabs { gap: 16px; padding: 0 12px; }

  .rig-toolbar { gap: 4px; }
  .rig-toolbar-group { gap: 2px; }
  .icon-btn { width: 34px; height: 32px; font-size: 14px; }
  .icon-btn.labeled { width: 34px; padding: 0; }
  .icon-btn.labeled .icon-btn-text { display: none; }
  .refresh-select { height: 32px; padding: 5px 4px; font-size: 11.5px; }
  .dropdown-menu { min-width: 170px; }

  .page-header h1 { font-size: 17px; }

  /* 4 gauges side by side never fits a phone screen -- wrap them into a 2x2 grid instead */
  .gpu-row-card { gap: 12px; }
  .gpu-row-gauge { width: calc(50% - 6px); }
  .gpu-row-hash { margin-left: 0; text-align: left; width: 100%; }

  .stat-card { min-width: 0; flex: 1 1 calc(50% - 12px); padding: 12px 14px; }

  .worker-metric { width: auto; flex: 1 1 70px; }

  .login-box { padding: 28px 20px; }
  .otp-inputs { gap: 6px; }
  .otp-inputs input { width: 100%; max-width: 42px; height: 48px; font-size: 19px; }
}

@media (max-width: 400px) {
  .login-screen { padding: 12px; }
  .otp-inputs input { max-width: 36px; height: 44px; font-size: 17px; }
}

/* ---------- "new version available" bar (tab left open across a deployment) ---------- */
#update-banner {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 2000;
  background: var(--bg-elevated); border: 1px solid var(--accent); color: var(--text);
  padding: 10px 14px; border-radius: 10px; font-size: 13px; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5); max-width: calc(100vw - 32px);
}
.oc-advanced-row { flex-wrap: wrap; }
.oc-advanced-unit { color: var(--text-dim); font-size: 12px; }
.oc-live { color: var(--green); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.oc-toggle-advanced { border-color: var(--accent) !important; color: var(--accent) !important; }

#mf-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 12px);
  background: var(--bg-card); color: var(--text);
  border: 1px solid var(--accent); border-radius: 10px;
  padding: 10px 18px; font-size: 13px; box-shadow: 0 8px 28px rgba(0, 0, 0, .45);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 3000;
  max-width: calc(100vw - 32px);
}
#mf-toast.show { opacity: 1; transform: translate(-50%, 0); }

.oc-select-field { margin: 0 0 14px; }
.oc-select-field select { width: 100%; }
.oc-select-field .hint { margin-top: 6px; font-size: 11px; color: var(--text-faint); }

/* ---------- version chip next to the logo ---------- */
.brand-version {
  align-self: center; margin-left: 8px; padding: 2px 8px; border-radius: 10px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .02em; font-variant-numeric: tabular-nums;
  color: var(--text-faint); background: rgba(255,255,255,0.06); border: 1px solid var(--border);
}
@media (max-width: 700px) { .brand-version { display: none; } }

/* ---------- suggestion bubble (bottom right) ---------- */
.fb-widget { position: fixed; right: 22px; bottom: 22px; z-index: 90; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }

.fb-bubble {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 0;
  height: 56px; min-width: 56px; padding: 0; border: none; border-radius: 28px; cursor: pointer;
  color: #1a1200; background: linear-gradient(135deg, #ffbb52, var(--accent) 55%, #ff7a3d);
  box-shadow: 0 10px 28px rgba(245,165,36,0.42), 0 2px 6px rgba(0,0,0,0.35);
  animation: fb-float 3.8s ease-in-out infinite;
  transition: box-shadow .2s ease, padding .25s ease, gap .25s ease;
}
.fb-bubble:hover { box-shadow: 0 14px 34px rgba(245,165,36,0.55), 0 2px 6px rgba(0,0,0,0.35); padding: 0 20px 0 16px; gap: 9px; }
.fb-bubble:active { transform: scale(.95); }
.fb-bubble:focus-visible { outline: 3px solid rgba(245,165,36,0.5); outline-offset: 3px; }
@keyframes fb-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* expanding ring: draws the eye without being a permanent blinking light */
.fb-bubble-ring { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; animation: fb-ring 3s ease-out infinite; }
@keyframes fb-ring { 0% { box-shadow: 0 0 0 0 rgba(245,165,36,0.5); } 70%, 100% { box-shadow: 0 0 0 18px rgba(245,165,36,0); } }

.fb-ico { flex-shrink: 0; transition: transform .3s cubic-bezier(.16,1,.3,1), opacity .2s ease; }
.fb-ico-x { position: absolute; opacity: 0; transform: rotate(-90deg) scale(.6); }
.fb-bubble-label { max-width: 0; overflow: hidden; white-space: nowrap; opacity: 0; font-size: 13.5px; font-weight: 700; transition: max-width .25s ease, opacity .2s ease; }
.fb-bubble:hover .fb-bubble-label { max-width: 110px; opacity: 1; }

.fb-widget.open .fb-bubble { animation: none; }
.fb-widget.open .fb-bubble-ring { animation: none; }
.fb-widget.open .fb-ico-chat { opacity: 0; transform: rotate(90deg) scale(.6); }
.fb-widget.open .fb-ico-x { opacity: 1; transform: none; }
.fb-widget.open .fb-bubble:hover { padding: 0; gap: 0; }
.fb-widget.open .fb-bubble-label { display: none; }

.fb-hint {
  position: relative; background: var(--bg-elevated); color: var(--text); border: 1px solid var(--border-light);
  padding: 9px 14px; border-radius: 12px; font-size: 13px; font-weight: 600; box-shadow: var(--shadow);
  animation: fb-hint-in .4s cubic-bezier(.16,1,.3,1);
}
.fb-hint::after { content: ""; position: absolute; right: 22px; bottom: -6px; width: 10px; height: 10px; background: var(--bg-elevated); border-right: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light); transform: rotate(45deg); }
@keyframes fb-hint-in { from { opacity: 0; transform: translateY(8px) scale(.95); } to { opacity: 1; transform: none; } }

/* the suggestion window opens in the middle of the screen, over a dimmed backdrop; its size is fixed by the viewport, never by its content */
.fb-overlay {
  position: fixed; inset: 0; z-index: 100; padding: 16px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6, 8, 14, 0.62); backdrop-filter: blur(3px);
}
.fb-panel {
  width: min(640px, 100%); max-height: min(92vh, 760px); overflow-y: auto; padding: 24px;
  background: var(--bg-elevated); border: 1px solid var(--border-light); border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 1px 0 rgba(255,255,255,0.05) inset;
  transform-origin: center; animation: fb-pop .3s cubic-bezier(.16,1,.3,1);
}
@keyframes fb-pop { from { opacity: 0; transform: translateY(12px) scale(.92); } to { opacity: 1; transform: none; } }
.fb-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.fb-panel-title { font-size: 16px; font-weight: 800; letter-spacing: -.2px; }
.fb-panel-sub { color: var(--text-dim); font-size: 12.5px; margin-top: 3px; line-height: 1.4; }
.fb-close {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0; padding: 8px 14px; margin-left: auto;
  background: rgba(240,89,106,0.08); border: 1px solid rgba(240,89,106,0.4); border-radius: 9px; cursor: pointer;
  color: var(--red); font-family: inherit; font-size: 12.5px; font-weight: 700; transition: all .15s ease;
}
.fb-close:hover { background: var(--red); border-color: var(--red); color: #fff; }
.fb-close:active { transform: scale(.96); }
.fb-close:focus-visible { outline: 2px solid rgba(240,89,106,0.5); outline-offset: 2px; }

.fb-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; margin-bottom: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 11px; }
.fb-kind {
  display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 6px;
  background: transparent; border: 1px solid transparent; border-radius: 8px; cursor: pointer;
  color: var(--text-dim); font-size: 12.5px; font-weight: 700; font-family: inherit; transition: all .15s ease;
}
.fb-kind:hover { color: var(--text); }
.fb-kind.active { background: rgba(245,165,36,0.14); border-color: rgba(245,165,36,0.35); color: var(--accent); }
.fb-kind.active[data-kind="urgent"] { background: rgba(240,89,106,0.14); border-color: rgba(240,89,106,0.4); color: var(--red); }

#fb-text {
  display: block; width: 100%; resize: vertical; height: clamp(180px, 34vh, 340px); min-height: 140px; max-height: 55vh; padding: 12px 14px;
  background: var(--bg); border: 1px solid var(--border-light); border-radius: 10px;
  color: var(--text); font-family: inherit; font-size: 14px; line-height: 1.45;
  transition: border-color .15s ease, box-shadow .15s ease;
}
#fb-text:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(245,165,36,0.15); }
.fb-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 22px; margin: 6px 2px 10px; }
.fb-count { font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.fb-count.near-limit { color: var(--accent); }
.fb-error { font-size: 12px; color: var(--red); text-align: right; }
.fb-send { width: 100%; justify-content: center; padding: 11px 16px; font-size: 14px; }

.fb-done { text-align: center; padding: 26px 8px 18px; }
.fb-done-check {
  width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 800; color: #062b1a; background: var(--green); box-shadow: 0 8px 24px rgba(62,207,142,0.35);
  animation: fb-check .5s cubic-bezier(.34,1.56,.64,1);
}
@keyframes fb-check { from { transform: scale(0); } to { transform: scale(1); } }
.fb-done-title { font-size: 18px; font-weight: 800; }
.fb-done-sub { color: var(--text-dim); font-size: 13px; margin-top: 4px; }

@media (max-width: 600px) {
  .fb-panel { padding: 18px; }
  .fb-widget { right: 14px; bottom: 14px; }
  .fb-bubble:hover { padding: 0; gap: 0; }
  .fb-bubble:hover .fb-bubble-label { max-width: 0; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .fb-bubble, .fb-bubble-ring, .fb-panel, .fb-hint, .fb-done-check { animation: none; }
}

/* ---------- remote console ---------- */
.term-overlay {
  position: fixed; inset: 0; z-index: 110; padding: 16px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6, 8, 14, 0.7); backdrop-filter: blur(3px);
}
.term-box {
  display: flex; flex-direction: column; width: min(1040px, 100%); height: min(88vh, 720px);
  background: var(--bg-elevated); border: 1px solid var(--border-light); border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.65); overflow: hidden; animation: fb-pop .3s cubic-bezier(.16,1,.3,1);
}
.term-box.compact { height: auto; max-height: min(92vh, 640px); width: min(520px, 100%); }
.term-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.term-title { font-size: 15px; font-weight: 800; letter-spacing: -.1px; }
.term-title small { font-weight: 600; color: var(--text-dim); margin-left: 8px; }
.term-status { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--text-dim); }
.term-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); }
.term-dot.live { background: var(--green); box-shadow: 0 0 8px var(--green); }
.term-dot.wait { background: var(--accent); animation: term-blink 1s ease-in-out infinite; }
.term-dot.dead { background: var(--red); }
@keyframes term-blink { 50% { opacity: .3; } }
.term-body { padding: 22px 24px 24px; overflow-y: auto; }
.term-body p { margin: 0 0 12px; font-size: 13.5px; line-height: 1.55; color: var(--text-dim); }
.term-body p b { color: var(--text); }
.term-warn { padding: 10px 13px; border-radius: 10px; background: rgba(245,165,36,0.1); border: 1px solid rgba(245,165,36,0.3); color: var(--text); font-size: 12.5px; line-height: 1.5; margin-bottom: 14px; }
.term-msg { min-height: 20px; margin: 10px 0 0; font-size: 13px; text-align: center; }
.term-msg.err { color: var(--red); }
.term-msg.ok { color: var(--green); }
.term-actions { display: flex; gap: 10px; margin-top: 14px; }
.term-actions .btn { flex: 1; justify-content: center; padding: 11px 14px; font-size: 14px; }
.term-count { text-align: center; font-size: 12px; color: var(--text-faint); margin: 8px 0 0; font-variant-numeric: tabular-nums; }
.term-screen { flex: 1; min-height: 0; padding: 10px 8px 6px 12px; background: #0b0d14; }
.term-screen .xterm { height: 100%; }
.term-screen .xterm-viewport { background-color: #0b0d14 !important; }
.term-foot { display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-faint); flex-shrink: 0; }
.term-ctx-menu {
  position: fixed; z-index: 10000; background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: 8px; padding: 4px; box-shadow: 0 8px 24px rgba(0,0,0,0.45); min-width: 150px;
}
.term-ctx-menu button {
  display: block; width: 100%; text-align: left; padding: 7px 12px; background: none; border: none;
  color: var(--text); font-size: 13px; border-radius: 5px; cursor: pointer;
}
.term-ctx-menu button:hover:not(:disabled) { background: rgba(255,255,255,0.08); }
.term-ctx-menu button:disabled { color: var(--text-faint); cursor: default; }
@media (max-width: 600px) {
  .term-overlay { padding: 0; }
  .term-box { height: 100%; max-height: none; width: 100%; border-radius: 0; }
  .term-box.compact { height: auto; max-height: 100%; }
}

/* ---------- admin: suggestions inbox ---------- */
.tab-count { margin-left: 6px; padding: 1px 7px; border-radius: 10px; font-size: 10.5px; font-weight: 800; color: #fff; background: var(--red); }
.sugg-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.sugg-filter {
  padding: 6px 14px; border-radius: 20px; cursor: pointer; font-size: 12.5px; font-weight: 700; font-family: inherit;
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text-dim); transition: all .15s ease;
}
.sugg-filter:hover { border-color: var(--border-light); color: var(--text); }
.sugg-filter.active { background: rgba(245,165,36,0.14); border-color: rgba(245,165,36,0.4); color: var(--accent); }
.sugg-card { background: var(--bg-card); border: 1px solid var(--border); border-left: 3px solid var(--border-light); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 10px; }
.sugg-card.is-new { border-left-color: var(--accent); }
.sugg-card.is-urgent { border-left-color: var(--red); }
.sugg-card.is-done { opacity: .62; }
.sugg-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; font-size: 12.5px; color: var(--text-dim); }
.sugg-head .who { color: var(--text); font-weight: 700; }
.sugg-head .when { margin-left: auto; color: var(--text-faint); }
.sugg-kind { padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 800; background: rgba(77,157,255,0.15); color: var(--blue); }
.sugg-kind.urgent { background: rgba(240,89,106,0.15); color: var(--red); }
.sugg-msg { white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.5; }
.sugg-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sugg-page { font-size: 11.5px; color: var(--text-faint); margin-right: auto; }
.sugg-empty { text-align: center; color: var(--text-faint); padding: 40px 0; }

/* ---------- miners page ---------- */
.miner-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; margin-bottom: 16px; }
.chip-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-filter {
  padding: 6px 14px; border-radius: 20px; cursor: pointer; font-size: 12.5px; font-weight: 700; font-family: inherit;
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text-dim); transition: all .15s ease;
}
.chip-filter:hover { border-color: var(--border-light); color: var(--text); }
.chip-filter.active { background: rgba(245,165,36,0.14); border-color: rgba(245,165,36,0.4); color: var(--accent); }
.ver-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; font-size: 11.5px; color: var(--text-faint); }
.ver-legend-title { font-weight: 700; color: var(--text-dim); }
.ver-key { display: inline-flex; align-items: center; white-space: nowrap; }
.ver-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.ver-dot.fresh { background: var(--green); } .ver-dot.recent { background: var(--blue); }
.ver-dot.aging { background: var(--accent); } .ver-dot.old { background: var(--red); }

/* one line per miner: fixed columns, so every row lines up with the header */
.miner-list { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.miner-list-head, .miner-row-main {
  display: grid; align-items: center; column-gap: 14px; padding: 0 18px;
  grid-template-columns: minmax(120px, 1.1fr) minmax(150px, 1.15fr) minmax(150px, 1.3fr) minmax(170px, 1.4fr) 84px 76px 22px;
}
.miner-list-head { padding-top: 11px; padding-bottom: 11px; background: var(--bg-elevated); border-bottom: 1px solid var(--border); font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); }
.miner-row { border-bottom: 1px solid var(--border); }
.miner-row:last-child { border-bottom: none; }
.miner-row-main { min-height: 58px; padding-top: 8px; padding-bottom: 8px; cursor: pointer; transition: background .12s ease; }
.miner-row-main:hover { background: rgba(255,255,255,0.03); }
.miner-row-main:focus-visible { outline: 2px solid rgba(245,165,36,0.5); outline-offset: -2px; }
.miner-row.open .miner-row-main { background: rgba(255,255,255,0.03); }
.c-name { font-size: 15px; font-weight: 800; letter-spacing: -.1px; }
.c-version { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 9px; }
.c-cards, .c-compat { display: flex; flex-wrap: wrap; gap: 5px; }
.c-fee, .c-rigs { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.c-fee .good { color: var(--green); }
.c-fee .dim, .c-rigs .dim { color: var(--text-faint); font-weight: 600; }
.rigs-count { display: inline-flex; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 800; color: var(--accent); background: rgba(245,165,36,0.12); border: 1px solid rgba(245,165,36,0.3); white-space: nowrap; cursor: default; }
.rig-state { display: inline-block; margin-left: 4px; padding: 1px 8px; border-radius: 10px; font-size: 10.5px; font-weight: 800; }
.rig-state.on { color: var(--green); background: rgba(62,207,142,0.12); }
.rig-state.off { color: var(--red); background: rgba(240,89,106,0.12); }
.rig-state.paused { color: var(--accent); background: rgba(245,165,36,0.12); }
.c-chev { color: var(--text-faint); font-size: 17px; line-height: 1; text-align: center; transition: transform .15s ease; }
.miner-row.open .c-chev { transform: rotate(180deg); color: var(--accent); }

.miner-row-detail { display: none; padding: 4px 18px 16px; background: rgba(0,0,0,0.12); }
.miner-row.open .miner-row-detail { display: block; }
.miner-row-detail p { margin: 8px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--text-dim); max-width: 860px; }
.miner-row-detail p b { color: var(--text); }
.md-summary { margin-top: 10px; font-size: 14px; font-weight: 600; color: var(--text); }
.md-actions { display: flex; gap: 8px; margin-top: 12px; }
.md-actions a.btn { text-decoration: none; }

.ver-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 20px;
  font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums; border: 1px solid transparent; white-space: nowrap;
}
.ver-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ver-fresh  { color: var(--green);  background: rgba(62,207,142,0.13); border-color: rgba(62,207,142,0.35); }
.ver-recent { color: var(--blue);   background: rgba(77,157,255,0.13); border-color: rgba(77,157,255,0.35); }
.ver-aging  { color: var(--accent); background: rgba(245,165,36,0.13); border-color: rgba(245,165,36,0.35); }
.ver-old    { color: var(--red);    background: rgba(240,89,106,0.13); border-color: rgba(240,89,106,0.35); }
.ver-unknown { color: var(--text-faint); background: rgba(255,255,255,0.05); border-color: var(--border); font-weight: 600; }
.ver-unknown::before { display: none; }
.ver-loading { color: transparent; background: linear-gradient(90deg, var(--bg-elevated), var(--border), var(--bg-elevated)); background-size: 200% 100%; animation: ver-shimmer 1.2s linear infinite; }
.ver-loading::before { display: none; }
@keyframes ver-shimmer { to { background-position: -200% 0; } }
.ver-date { font-size: 12px; color: var(--text-dim); font-weight: 600; white-space: nowrap; }

.chip { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 7px; font-size: 10.5px; font-weight: 800; letter-spacing: .02em; background: rgba(255,255,255,0.06); color: var(--text-dim); border: 1px solid var(--border); white-space: nowrap; }
.chip-nvidia { color: #8fd66a; background: rgba(118,185,0,0.12); border-color: rgba(118,185,0,0.3); }
.chip-amd    { color: #ff7a7a; background: rgba(237,28,36,0.12); border-color: rgba(237,28,36,0.3); }
.chip-intel  { color: #6fb1ff; background: rgba(0,113,197,0.14); border-color: rgba(0,113,197,0.35); }
.chip-cpu    { color: #c9b8ff; background: rgba(150,120,255,0.12); border-color: rgba(150,120,255,0.3); }
.chip-good { color: var(--green); background: rgba(62,207,142,0.1); border-color: rgba(62,207,142,0.3); }
.chip-bad  { color: var(--red);   background: rgba(240,89,106,0.1); border-color: rgba(240,89,106,0.3); }
.chip-warn { color: var(--accent); background: rgba(245,165,36,0.1); border-color: rgba(245,165,36,0.3); }
.chip-mute { color: var(--text-faint); }

/* narrow screens: the columns collapse into a two-line row (name + version, then the chips) */
@media (max-width: 860px) {
  .miner-list-head { display: none; }
  .miner-row-main { grid-template-columns: 1fr auto 22px; row-gap: 8px; padding-top: 12px; padding-bottom: 12px; }
  .c-name { grid-column: 1; grid-row: 1; }
  .c-version { grid-column: 2; grid-row: 1; justify-content: flex-end; }
  .c-chev { grid-column: 3; grid-row: 1; }
  .c-cards { grid-column: 1 / -1; grid-row: 2; }
  .c-compat { grid-column: 1 / -1; grid-row: 3; }
  .c-fee, .c-rigs { display: none; }
}

/* ---------- flight sheets & wallets: same expandable-list look as the miners page ---------- */
.fs-list-head, .fs-row-main {
  display: grid; align-items: center; column-gap: 14px; padding: 0 18px;
  grid-template-columns: minmax(150px, 1.3fr) 76px minmax(130px, 1.1fr) minmax(160px, 1.5fr) minmax(110px, 1fr) 70px 22px;
}
.wallet-list-head, .wallet-row-main {
  display: grid; align-items: center; column-gap: 14px; padding: 0 18px;
  grid-template-columns: 84px minmax(130px, 1fr) minmax(180px, 2fr) 80px 22px;
}
.fs-list-head, .wallet-list-head {
  padding-top: 11px; padding-bottom: 11px; background: var(--bg-elevated); border-bottom: 1px solid var(--border);
  font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint);
}
.fs-row-main, .wallet-row-main { min-height: 58px; padding-top: 8px; padding-bottom: 8px; cursor: pointer; transition: background .12s ease; }
.fs-row-main:hover, .wallet-row-main:hover { background: rgba(255,255,255,0.03); }
.fs-row-main:focus-visible, .wallet-row-main:focus-visible { outline: 2px solid rgba(245,165,36,0.5); outline-offset: -2px; }
.miner-row.open .fs-row-main, .miner-row.open .wallet-row-main { background: rgba(255,255,255,0.03); }
.c-fs-coin { font-size: 13px; font-weight: 800; color: var(--text-dim); }
.c-fs-pool, .c-w-address { font-family: monospace; font-size: 12.5px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-w-coin { font-size: 14px; font-weight: 800; }
.badge-kind { display: inline-flex; padding: 2px 8px; border-radius: 20px; font-size: 10px; font-weight: 800; margin-left: 7px; vertical-align: middle; }
.badge-kind.gpu { background: rgba(245,165,36,0.16); color: var(--accent); }
.badge-kind.cpu { background: rgba(77,157,255,0.16); color: var(--blue); }

@media (max-width: 860px) {
  .fs-list-head, .wallet-list-head { display: none; }
  .fs-row-main { grid-template-columns: 1fr auto 22px; row-gap: 6px; padding-top: 12px; padding-bottom: 12px; }
  .fs-row-main .c-name { grid-column: 1; grid-row: 1; }
  .fs-row-main .c-fs-coin { grid-column: 2; grid-row: 1; text-align: right; }
  .fs-row-main .c-chev { grid-column: 3; grid-row: 1; }
  .fs-row-main .c-fs-pool { grid-column: 1 / -1; grid-row: 2; }
  .fs-row-main .c-rigs, .fs-row-main .c-fs-wallet { display: none; }
  .wallet-row-main { grid-template-columns: 1fr auto 22px; row-gap: 6px; padding-top: 12px; padding-bottom: 12px; }
  .wallet-row-main .c-w-coin { grid-column: 1; grid-row: 1; }
  .wallet-row-main .c-rigs { grid-column: 2; grid-row: 1; text-align: right; }
  .wallet-row-main .c-chev { grid-column: 3; grid-row: 1; }
  .wallet-row-main .c-w-address { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- admin: sign-up statistics ---------- */
.signup-block { margin-bottom: 22px; }
.signup-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); margin-bottom: 10px; }
.signup-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.signup-card { padding: 16px 18px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; }
.signup-num { font-size: 32px; font-weight: 800; letter-spacing: -.5px; line-height: 1.1; color: var(--accent); font-variant-numeric: tabular-nums; }
.signup-label { margin-top: 4px; font-size: 12.5px; font-weight: 700; color: var(--text); }
.signup-trend { margin-top: 8px; display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 11px; font-weight: 700; background: rgba(255,255,255,0.06); color: var(--text-faint); }
.signup-trend.up { color: var(--green); background: rgba(62,207,142,0.12); }
.signup-trend.down { color: var(--red); background: rgba(240,89,106,0.12); }
.signup-note { margin-top: 10px; font-size: 11.5px; color: var(--text-faint); }

/* ---------- suggestion bubble: reply notification + "Mes messages" ---------- */
.fb-bubble-dot {
  position: absolute; top: 2px; right: 2px; width: 13px; height: 13px; border-radius: 50%;
  background: var(--red); border: 2px solid #1a1200; box-shadow: 0 0 0 2px rgba(240,89,106,0.25);
  animation: fb-dot-pulse 1.6s ease-in-out infinite;
}
@keyframes fb-dot-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }
.fb-hint-reply { border-color: rgba(62,207,142,0.4); color: var(--green); font-weight: 700; }
.fb-hint-reply::after { border-color: rgba(62,207,142,0.4) !important; }

.fb-tabs { display: flex; gap: 6px; padding: 4px; margin-bottom: 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 11px; }
.fb-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 6px;
  background: transparent; border: 1px solid transparent; border-radius: 8px; cursor: pointer;
  color: var(--text-dim); font-size: 12.5px; font-weight: 700; font-family: inherit; transition: all .15s ease;
}
.fb-tab:hover { color: var(--text); }
.fb-tab.active { background: rgba(245,165,36,0.14); border-color: rgba(245,165,36,0.35); color: var(--accent); }
.fb-tab-badge { display: inline-flex; min-width: 16px; height: 16px; padding: 0 4px; align-items: center; justify-content: center; border-radius: 8px; background: var(--red); color: #fff; font-size: 10px; font-weight: 800; }

.fb-mine { max-height: 420px; overflow-y: auto; margin: -4px -2px 4px; padding: 4px 2px; }
.fb-mine-empty { text-align: center; color: var(--text-faint); font-size: 13px; padding: 30px 10px; }
.fb-mine-item { padding: 13px 14px; margin-bottom: 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; }
.fb-mine-item.has-unseen { border-color: rgba(62,207,142,0.4); box-shadow: 0 0 0 1px rgba(62,207,142,0.15); }
.fb-mine-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 11px; }
.fb-mine-kind { padding: 2px 8px; border-radius: 20px; font-weight: 800; background: rgba(77,157,255,0.15); color: var(--blue); }
.fb-mine-kind.urgent { background: rgba(240,89,106,0.15); color: var(--red); }
.fb-mine-when { color: var(--text-faint); margin-left: auto; }
.fb-mine-msg { font-size: 13.5px; line-height: 1.5; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.fb-mine-reply { margin-top: 10px; padding: 10px 12px; background: rgba(62,207,142,0.08); border-left: 3px solid var(--green); border-radius: 8px; }
.fb-mine-reply-head { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; color: var(--green); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .03em; }
.fb-mine-reply-new { padding: 1px 7px; border-radius: 10px; background: var(--green); color: #062b1a; }
.fb-mine-reply-text { font-size: 13.5px; line-height: 1.5; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.fb-mine-pending { margin-top: 8px; font-size: 12px; color: var(--text-faint); font-style: italic; }

/* ---------- admin: reply to a suggestion ---------- */
.sugg-reply-sent { margin-top: 12px; padding: 10px 13px; background: rgba(62,207,142,0.07); border-left: 3px solid var(--green); border-radius: 8px; }
.sugg-reply-sent-head { font-size: 11px; font-weight: 800; color: var(--green); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 5px; }
.sugg-reply-unseen { color: var(--accent); font-weight: 700; text-transform: none; letter-spacing: 0; }
.sugg-reply-sent-text { font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.sugg-reply-box { margin-top: 12px; }
.sugg-reply-input {
  width: 100%; min-height: 90px; resize: vertical; padding: 10px 12px; font-family: inherit; font-size: 13.5px; line-height: 1.5;
  background: var(--bg); border: 1px solid var(--border-light); border-radius: 8px; color: var(--text);
}
.sugg-reply-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(245,165,36,0.15); }
.sugg-reply-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.sugg-reply-msg { font-size: 12px; color: var(--text-faint); }
.sugg-reply-msg.err { color: var(--red); }

/* ---------- public roadmap ---------- */
.roadmap-overlay {
  position: fixed; inset: 0; z-index: 120; padding: 24px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6, 8, 14, 0.68); backdrop-filter: blur(4px);
}
.roadmap-box {
  /* fixed size regardless of how many items there are -- an empty list and a long one open at the same size,
     so the window never visibly grows/shrinks as its content loads (only the list inside scrolls) */
  display: flex; flex-direction: column; width: min(1180px, 94vw); height: 88vh;
  background: var(--bg-elevated); border: 1px solid var(--border-light); border-radius: 18px;
  box-shadow: 0 32px 90px rgba(0,0,0,0.6), 0 1px 0 rgba(255,255,255,0.04) inset;
  overflow: hidden; animation: fb-pop .3s cubic-bezier(.16,1,.3,1);
}
.roadmap-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 22px 26px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.roadmap-title { font-size: 19px; font-weight: 800; letter-spacing: -.2px; }
.roadmap-sub { color: var(--text-dim); font-size: 12.5px; margin-top: 4px; }
.roadmap-list { flex: 1; overflow-y: auto; padding: 18px 26px 26px; display: flex; flex-direction: column; gap: 12px; }
.roadmap-list:has(> .roadmap-empty) { justify-content: center; }
.roadmap-empty { text-align: center; color: var(--text-faint); padding: 50px 10px; font-size: 14px; }

.roadmap-row { padding: 16px 18px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 13px; transition: border-color .15s ease; }
.roadmap-row:hover { border-color: var(--border-light); }
.roadmap-row-top { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 11px; }
.roadmap-row-title { font-size: 14.5px; font-weight: 700; flex: 1 1 220px; }
.roadmap-pct { font-size: 13px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.roadmap-pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 11px; border-radius: 20px;
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap;
  background: rgba(245,165,36,0.14); color: var(--accent); border: 1px solid rgba(245,165,36,0.35);
}
.roadmap-pill.done { background: rgba(62,207,142,0.14); color: var(--green); border-color: rgba(62,207,142,0.35); }

/* distinguishes a feature built from a user suggestion (blue) from an internal bug fix (red/orange) --
   same pill shape as the progress status above, just a second, independent badge */
.roadmap-kind-pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 11px; border-radius: 20px;
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap;
}
.roadmap-kind-pill.feature { background: rgba(77,157,255,0.14); color: var(--blue); border: 1px solid rgba(77,157,255,0.35); }
.roadmap-kind-pill.fix { background: rgba(240,89,106,0.14); color: var(--red); border: 1px solid rgba(240,89,106,0.35); }

.roadmap-bar { height: 8px; border-radius: 5px; background: var(--bg); border: 1px solid var(--border); overflow: hidden; }
.roadmap-bar-fill {
  height: 100%; border-radius: 5px; background: linear-gradient(90deg, #ffbb52, var(--accent) 60%, #ff7a3d);
  box-shadow: 0 0 10px rgba(245,165,36,0.5); transition: width .4s cubic-bezier(.16,1,.3,1);
}
.roadmap-bar-fill.done { background: linear-gradient(90deg, #6fe6ad, var(--green) 60%, #2fae76); box-shadow: 0 0 10px rgba(62,207,142,0.5); }

.roadmap-row-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 11px; }
.roadmap-when { font-size: 11.5px; color: var(--text-faint); }
.roadmap-chat-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 20px; cursor: pointer;
  background: rgba(77,157,255,0.1); border: 1px solid rgba(77,157,255,0.3); color: var(--blue);
  font-size: 12px; font-weight: 700; font-family: inherit; transition: all .15s ease;
}
.roadmap-chat-btn:hover { background: rgba(77,157,255,0.18); transform: translateY(-1px); }

/* ---------- roadmap discussion (nested overlay, on top of the roadmap window) ---------- */
.roadmap-chat-overlay {
  position: fixed; inset: 0; z-index: 130; padding: 20px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4, 5, 9, 0.72); backdrop-filter: blur(3px);
}
.roadmap-chat-box {
  /* same principle as .roadmap-box: a fixed size, so it looks the same whether the thread has 1 message or 50 */
  display: flex; flex-direction: column; width: min(640px, 92vw); height: 78vh;
  background: var(--bg-elevated); border: 1px solid var(--border-light); border-radius: 18px;
  box-shadow: 0 32px 90px rgba(0,0,0,0.65); overflow: hidden; animation: fb-pop .25s cubic-bezier(.16,1,.3,1);
}
.roadmap-live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 6px; vertical-align: 1px; box-shadow: 0 0 6px var(--green); animation: roadmap-live-blink 1.8s ease-in-out infinite; }
@keyframes roadmap-live-blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .roadmap-live-dot { animation: none; } }

/* Twitch-style chat: a dense, flowing stream of one-line messages -- not bordered "comment cards" */
.roadmap-chat-thread {
  flex: 1; overflow-y: auto; padding: 10px 20px; display: flex; flex-direction: column; gap: 1px;
  font-size: 13.5px; line-height: 1.5; scrollbar-gutter: stable;
}
.roadmap-chat-thread:has(> .roadmap-empty) { justify-content: center; }
.roadmap-comment {
  padding: 5px 8px; border-radius: 6px; transition: background .1s ease;
  animation: roadmap-msg-in .2s ease;
}
.roadmap-comment:hover { background: rgba(255,255,255,0.035); }
.roadmap-comment.is-admin { background: rgba(245,165,36,0.06); }
.roadmap-comment.is-admin:hover { background: rgba(245,165,36,0.1); }
@keyframes roadmap-msg-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.roadmap-comment-who { font-weight: 800; }
.roadmap-comment-badge {
  display: inline-flex; align-items: center; padding: 0 6px; margin-right: 5px; border-radius: 4px;
  background: var(--accent); color: #1a1200; font-size: 9.5px; font-weight: 800; letter-spacing: .02em; vertical-align: 1px;
}
.roadmap-comment-msg { color: var(--text); word-break: break-word; }
.roadmap-comment-when {
  display: inline-block; margin-left: 8px; color: var(--text-faint); font-size: 10.5px;
  opacity: 0; transition: opacity .12s ease; vertical-align: 1px;
}
.roadmap-comment:hover .roadmap-comment-when { opacity: 1; }
.roadmap-chat-sep { display: flex; align-items: center; justify-content: center; margin: 4px 0 8px; padding: 0 14px 10px; border-bottom: 1px solid var(--border); color: var(--text-faint); font-size: 11.5px; text-align: center; }

.roadmap-chat-error { margin: 0 20px; padding: 7px 12px; border-radius: 8px; background: rgba(240,89,106,0.1); color: var(--red); font-size: 12px; }
.roadmap-chat-error.hidden { display: none; }

.roadmap-chat-compose {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); flex-shrink: 0;
  background: var(--bg-elevated);
}
.roadmap-chat-compose input#roadmap-chat-input {
  flex: 1; min-width: 0; padding: 10px 14px; font-family: inherit; font-size: 13.5px;
  background: var(--bg); border: 1px solid var(--border-light); border-radius: 22px; color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.roadmap-chat-compose input#roadmap-chat-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(245,165,36,0.15); }
.roadmap-chat-count { font-size: 10.5px; color: var(--text-faint); font-variant-numeric: tabular-nums; flex-shrink: 0; min-width: 26px; text-align: right; }
.roadmap-chat-count.near-limit { color: var(--red); font-weight: 700; }
.roadmap-chat-send-btn {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  border-radius: 50%; border: none; cursor: pointer; color: #1a1200;
  background: linear-gradient(135deg, #ffbb52, var(--accent) 60%, #ff7a3d);
  box-shadow: 0 4px 14px rgba(245,165,36,0.35); transition: transform .12s ease, box-shadow .12s ease;
}
.roadmap-chat-send-btn:hover { transform: scale(1.07); box-shadow: 0 6px 18px rgba(245,165,36,0.45); }
.roadmap-chat-send-btn:active { transform: scale(.96); }
.roadmap-chat-send-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.roadmap-chat-closed { padding: 14px 20px 18px; text-align: center; color: var(--text-faint); font-size: 12.5px; border-top: 1px solid var(--border); }

@media (max-width: 700px) {
  .roadmap-overlay, .roadmap-chat-overlay { padding: 0; }
  .roadmap-box, .roadmap-chat-box { width: 100%; height: 100%; max-height: none; border-radius: 0; }
  .roadmap-row-top { flex-direction: column; align-items: flex-start; }
}

/* ---------- admin: roadmap controls on a suggestion card ---------- */
.sugg-roadmap-live { margin-top: 12px; padding: 12px 14px; background: rgba(245,165,36,0.06); border: 1px solid rgba(245,165,36,0.25); border-radius: 10px; }
.sugg-roadmap-live-head { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.sugg-roadmap-live-title { font-size: 13.5px; font-weight: 700; }
.sugg-roadmap-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 20px; font-size: 10.5px; font-weight: 800; text-transform: uppercase; background: rgba(245,165,36,0.16); color: var(--accent); white-space: nowrap; }
.sugg-roadmap-pill.done { background: rgba(62,207,142,0.16); color: var(--green); }
.sugg-roadmap-bar { height: 7px; border-radius: 4px; background: var(--bg); border: 1px solid var(--border); overflow: hidden; margin-bottom: 10px; }
.sugg-roadmap-bar-fill { height: 100%; background: linear-gradient(90deg, #ffbb52, var(--accent)); transition: width .3s ease; }
.sugg-roadmap-bar-fill.done { background: linear-gradient(90deg, #6fe6ad, var(--green)); }
.sugg-roadmap-live-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sugg-roadmap-slider { flex: 1; min-width: 120px; accent-color: var(--accent); }
.sugg-roadmap-pct { font-size: 12.5px; font-weight: 800; color: var(--accent); min-width: 36px; }
.sugg-roadmap-box { background: rgba(245,165,36,0.04); border: 1px dashed rgba(245,165,36,0.3); border-radius: 10px; padding: 12px 14px; }
.sugg-roadmap-label { display: block; font-size: 11px; font-weight: 700; color: var(--text-dim); margin: 10px 0 5px; text-transform: uppercase; letter-spacing: .03em; }
.sugg-roadmap-label:first-child { margin-top: 0; }
.sugg-roadmap-title-input {
  width: 100%; min-height: 60px; resize: vertical; padding: 9px 11px; font-family: inherit; font-size: 13.5px;
  background: var(--bg); border: 1px solid var(--border-light); border-radius: 8px; color: var(--text);
}
.sugg-roadmap-title-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(245,165,36,0.15); }
.sugg-roadmap-kind-row { display: flex; gap: 16px; margin-bottom: 4px; }
.sugg-roadmap-kind-opt { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; cursor: pointer; }
.sugg-roadmap-kind-opt input { accent-color: var(--accent); }

/* ---------- admin viewing a user's rig: read-only ---------- */
.rig-readonly-banner {
  display: flex; align-items: center; gap: 9px; margin-bottom: 16px; padding: 10px 16px;
  background: rgba(77,157,255,0.1); border: 1px solid rgba(77,157,255,0.3); border-radius: 10px;
  color: var(--blue); font-size: 13px; font-weight: 700;
}
.rig-readonly #btn-mining-menu,
.rig-readonly #btn-reboot-rig,
.rig-readonly #btn-shutdown-rig,
.rig-readonly #btn-console-rig,
.rig-readonly #btn-rig-gear,
.rig-readonly .gpu-row-gear,
.rig-readonly #btn-save-oc,
.rig-readonly #btn-save-flightsheet,
.rig-readonly #btn-edit-flightsheet,
.rig-readonly [data-tab="install"] { display: none !important; }
.rig-readonly #rig-flightsheet-select,
.rig-readonly #rig-display-toggle { pointer-events: none; opacity: .55; }
.admin-rig-row { cursor: pointer; transition: background .12s ease; }
.admin-rig-row:hover { background: rgba(77,157,255,0.06); }

/* ---------- admin: private agent logs ---------- */
.agentlogs-note { color: var(--text-dim); font-size: 12.5px; margin: 4px 0 14px; }
.agentlogs-title { font-size: 13px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--text-dim); margin: 18px 0 8px; }
.agentlogs-title small { text-transform: none; font-weight: 600; letter-spacing: 0; color: var(--text-faint); }
.agentlogs-headline { color: var(--text-dim); max-width: 460px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agentlogs-empty { color: var(--text-faint); padding: 14px 4px; font-size: 13px; }
.agentlogs-err { color: var(--red); }
.agentlogs-warn { color: var(--accent); }
.sev-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--text-faint); vertical-align: middle; }
.sev-dot.sev-1 { background: var(--accent); }
.sev-dot.sev-2 { background: var(--red); box-shadow: 0 0 0 3px rgba(240,89,106,0.18); }
.agentlog-viewer { margin-top: 20px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.agentlog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.agentlog-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.agentlog-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; max-height: 84px; overflow-y: auto; }
.agentlog-chip { background: var(--bg); border: 1px solid var(--border-light); color: var(--text-dim); border-radius: 14px; padding: 3px 10px; font-size: 11.5px; cursor: pointer; font-family: inherit; }
.agentlog-chip:hover { border-color: var(--accent); color: var(--text); }
.agentlog-chip.active { border-color: var(--accent); color: var(--accent); }
.agentlog-pre { background: #0b0d14; border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin: 0; max-height: 560px; overflow: auto; font-family: "SF Mono", "Cascadia Mono", Consolas, monospace; font-size: 12px; line-height: 1.5; color: #cfd3e1; white-space: pre-wrap; word-break: break-word; }

/* ---------- first-run guidance (new accounts, rigs that never connected) ---------- */
.welcome { background: var(--bg-card); border: 1px solid var(--border-light); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 18px 22px; margin: 0 0 18px; }
.welcome h2 { margin: 0 0 6px; font-size: 18px; }
.welcome p { margin: 0 0 8px; color: var(--text-dim); }
.welcome ol, .connect-steps { margin: 8px 0 0 18px; padding: 0; color: var(--text-dim); line-height: 1.7; }
.welcome li, .connect-steps li { margin: 4px 0; }
.welcome b, .connect-steps b { color: var(--text); }
.connect-steps { margin-bottom: 14px; }
.connect-card { border-left: 3px solid var(--accent); }
#view-rig[data-tab-active="install"] .connect-card { display: none; }   /* the Installation tab IS the instructions */
