/* pulsedmc.net/external - external servers dashboard (panel sign-in). */
:root {
  --bg: #08090d; --bg-2: #0f1117; --card: #141720; --card-2: #1a1e29; --hover: #20242f;
  --line: rgba(255,255,255,.07); --line-2: rgba(255,255,255,.13);
  --text: #f3f5f9; --text-2: #a8b0c0; --muted: #6f7889;
  --acc: #f5c518; --acc-2: #d9a900; --acc-soft: rgba(245,197,24,.12); --acc-line: rgba(245,197,24,.3);
  --ok: #34d399; --ok-soft: rgba(52,211,153,.12);
  --bad: #f87171; --bad-soft: rgba(248,113,113,.12);
  --warn: #fbbf24; --idle: #8b93a3;
  --r: 14px; --r-sm: 9px;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body.xh {
  min-height: 100vh; background: var(--bg); color: var(--text);
  font: 14.5px/1.5 'Inter', system-ui, -apple-system, sans-serif;
  background-image:
    radial-gradient(900px 420px at 85% -10%, rgba(245,197,24,.07), transparent 60%),
    radial-gradient(700px 380px at -10% 110%, rgba(96,165,250,.05), transparent 60%);
  background-attachment: fixed;
}
[hidden] { display: none !important; }
a { color: var(--acc); }
button { font: inherit; }
code { font-family: var(--mono); font-size: 12.5px; background: var(--card-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px; color: var(--text); }

/* ── top bar ─────────────────────────────── */
.xh-bar {
  position: relative; z-index: 2; height: 56px;
  display: flex; align-items: center; gap: 14px; padding: 0 22px;
  background: rgba(8,9,13,.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.xh-logo img { height: 30px; display: block; }
.xh-bar-title {
  font: 700 12px/1 'Inter', sans-serif; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.xh-bar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.xh-barlink {
  background: none; border: 0; color: var(--text-2); text-decoration: none; cursor: pointer;
  padding: 7px 11px; border-radius: 8px; font-size: 13.5px; font-weight: 600;
}
.xh-barlink:hover { background: var(--hover); color: var(--text); }
.xh-credits {
  font-size: 12.5px; font-weight: 700; color: var(--acc); background: var(--acc-soft);
  border: 1px solid var(--acc-line); padding: 4px 10px; border-radius: 999px; margin-right: 4px;
}
.xh-who { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border: 1px solid var(--line); border-radius: 999px; font-weight: 600; font-size: 13.5px; }
.xh-avatar {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--acc), #f59e0b); color: #1a1406; font-weight: 800; font-size: 12.5px; text-transform: uppercase;
}

/* ── buttons / inputs ────────────────────── */
.xh-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--acc); color: #17130a; border: 1px solid transparent; border-radius: var(--r-sm);
  padding: 9px 15px; font-weight: 700; font-size: 13.5px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, transform .1s, border-color .15s;
}
.xh-btn:hover { background: #ffd43b; }
.xh-btn:active { transform: translateY(1px); }
.xh-btn:disabled { opacity: .5; cursor: not-allowed; }
.xh-btn.ghost { background: var(--card-2); color: var(--text); border-color: var(--line-2); }
.xh-btn.ghost:hover { background: var(--hover); }
.xh-btn.danger { background: var(--bad); color: #1d0909; }
.xh-btn.danger:hover { background: #fb8f8f; }
.xh-btn.ghost.danger { background: transparent; color: var(--bad); border-color: rgba(248,113,113,.35); }
.xh-btn.ghost.danger:hover { background: var(--bad-soft); }
.xh-btn-lg { padding: 13px 22px; font-size: 15px; border-radius: 11px; }
.xh-btn-wide { width: 100%; }
.xh-btn svg { flex: none; }

.xh-form { display: flex; gap: 10px; flex-wrap: wrap; }
.xh-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.xh-field > span { font-size: 12px; font-weight: 600; color: var(--text-2); }
.xh-field.grow { flex: 1 1 220px; }
.xh-field.port { flex: 0 0 110px; }
.xh-in {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  color: var(--text); padding: 10px 12px; font: inherit; outline: none; transition: border-color .15s, box-shadow .15s;
}
.xh-in:focus { border-color: var(--acc-line); box-shadow: 0 0 0 3px var(--acc-soft); }
.xh-btnrow { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

/* ── signed-out gate ─────────────────────── */
.xh-gate { min-height: 70vh; display: grid; place-items: center; padding: 30px 18px; }
.xh-gate-card {
  width: 100%; max-width: 460px; text-align: center; padding: 38px 34px 30px;
  background: linear-gradient(180deg, var(--card-2), var(--card)); border: 1px solid var(--line-2);
  border-radius: 20px; box-shadow: 0 30px 80px -40px rgba(0,0,0,.9);
}
.xh-gate-mark {
  width: 62px; height: 62px; margin: 0 auto 18px; border-radius: 16px; display: grid; place-items: center;
  color: var(--acc); background: var(--acc-soft); border: 1px solid var(--acc-line);
}
.xh-gate h1 { font: 800 28px/1.15 'Archivo', sans-serif; margin: 0 0 10px; }
.xh-gate p { color: var(--text-2); margin: 0 0 22px; }
.xh-gate .xh-gate-small { font-size: 13px; color: var(--muted); margin: 18px 0 0; }
.xh-gate-err { background: var(--bad-soft); border: 1px solid rgba(248,113,113,.3); color: #fecaca !important; border-radius: 10px; padding: 10px 12px; font-size: 13.5px; }

/* ── app layout ──────────────────────────── */
.xh-app { display: grid; grid-template-columns: 280px 1fr; min-height: 75vh; }
.xh-side {
  padding: 20px 14px; display: flex; flex-direction: column; gap: 12px;
  position: sticky; top: 90px; align-self: start; max-height: calc(100vh - 90px); overflow-y: auto;
}
.xh-side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px; font: 700 11.5px/1 'Inter', sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.xh-count { background: var(--card-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 8px; letter-spacing: 0; color: var(--text-2); }
.xh-list { display: flex; flex-direction: column; gap: 4px; }
.xh-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 11px; cursor: pointer;
  color: var(--text); text-decoration: none; border: 1px solid transparent; transition: background .12s, border-color .12s;
}
.xh-item:hover { background: var(--hover); }
.xh-item.is-on { background: var(--acc-soft); border-color: var(--acc-line); }
.xh-item-meta { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.xh-item-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xh-item-addr { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xh-side-empty { color: var(--muted); font-size: 13px; padding: 6px; margin: 0; }

.xh-ico {
  flex: none; width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center;
  background: var(--card-2); border: 1px solid var(--line); color: var(--text-2); overflow: hidden;
}
.xh-ico img { width: 24px; height: 24px; image-rendering: pixelated; }
.xh-ico.big { width: 64px; height: 64px; border-radius: 15px; }
.xh-ico.big img { width: 42px; height: 42px; }

.xh-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--idle); }
.xh-dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.xh-dot.off, .xh-dot.bad { background: var(--bad); }
.xh-dot.warn { background: var(--warn); }

.xh-main { padding: 30px 34px 80px; min-width: 0; border-left: 1px solid var(--line); }
.xh-wrap { max-width: 960px; margin: 0 auto; }

/* ── server header ───────────────────────── */
.xh-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 22px; }
.xh-head-title { flex: 1; min-width: 220px; }
.xh-head h1 { font: 800 28px/1.15 'Archivo', sans-serif; margin: 0 0 8px; overflow-wrap: anywhere; }
.xh-head-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.xh-head-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.xh-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; background: var(--card-2); border: 1px solid var(--line-2); color: var(--text-2);
}
.xh-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--idle); }
.xh-pill.ok { color: var(--ok); border-color: rgba(52,211,153,.3); background: var(--ok-soft); } .xh-pill.ok i { background: var(--ok); }
.xh-pill.off, .xh-pill.bad { color: var(--bad); border-color: rgba(248,113,113,.3); background: var(--bad-soft); } .xh-pill.off i, .xh-pill.bad i { background: var(--bad); }
.xh-pill.warn { color: var(--warn); border-color: rgba(251,191,36,.3); background: rgba(251,191,36,.1); } .xh-pill.warn i { background: var(--warn); }
.xh-addr {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 8px; cursor: pointer;
  font: 500 13px var(--mono); color: var(--text); background: var(--bg-2); border: 1px solid var(--line-2);
}
.xh-addr:hover { border-color: var(--acc-line); }
.xh-addr.big { font-size: 14.5px; padding: 10px 13px; width: 100%; justify-content: space-between; }
.xh-addr.copied { border-color: var(--ok); color: var(--ok); }

.xh-alert { border-radius: 12px; padding: 12px 15px; margin-bottom: 18px; font-size: 14px; }
.xh-alert.bad { background: var(--bad-soft); border: 1px solid rgba(248,113,113,.3); color: #fecaca; }
.xh-alert.warn { background: rgba(251,191,36,.08); border: 1px solid rgba(251,191,36,.3); color: #fde68a; }

/* ── stat tiles ──────────────────────────── */
.xh-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.xh-tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 15px 16px; min-width: 0; }
.xh-label { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.xh-val { display: block; font: 700 20px/1.2 'Archivo', sans-serif; overflow-wrap: anywhere; }
.xh-val.mono { font: 500 14px/1.4 var(--mono); word-break: break-all; }
.xh-sub { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.xh-motd {
  background: #0b0c10; border: 1px solid var(--line); border-radius: 12px; padding: 12px 15px; margin: 0 0 22px;
  font: 500 13px/1.5 var(--mono); color: #d7dbe3; white-space: pre-wrap;
}

/* ── tabs + cards ────────────────────────── */
.xh-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.xh-tab {
  background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  padding: 11px 16px; font-weight: 700; font-size: 14px; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.xh-tab:hover { color: var(--text-2); }
.xh-tab.is-on { color: var(--text); border-bottom-color: var(--acc); }
.xh-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.xh-grid .full { grid-column: 1 / -1; }
.xh-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; }
.xh-card h3 { font: 700 17px/1.3 'Archivo', sans-serif; margin: 0 0 6px; }
.xh-note { color: var(--text-2); font-size: 13.5px; margin: 0 0 14px; }
.xh-card.danger { border-color: rgba(248,113,113,.25); }
.xh-cats { display: flex; flex-wrap: wrap; gap: 7px; }
.xh-cat {
  background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text-2); border-radius: 999px;
  padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; text-transform: capitalize;
}
.xh-cat:hover:not(:disabled) { border-color: var(--acc-line); color: var(--text); }
.xh-cat.is-on { background: var(--acc-soft); border-color: var(--acc); color: var(--acc); }
.xh-cat:disabled { opacity: .4; cursor: not-allowed; }
.xh-codebox { position: relative; background: #0b0c10; border: 1px solid var(--line); border-radius: 11px; }
.xh-codebox pre { margin: 0; padding: 14px 16px; padding-right: 90px; overflow-x: auto; font: 500 12.5px/1.65 var(--mono); color: #d7dbe3; }
.xh-codebox .xh-btn { position: absolute; top: 9px; right: 9px; padding: 6px 10px; font-size: 12.5px; }
.xh-steps { counter-reset: s; display: flex; flex-direction: column; gap: 16px; }
.xh-step { position: relative; padding-left: 46px; }
.xh-step::before {
  counter-increment: s; content: counter(s); position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--acc-soft); border: 1px solid var(--acc-line); color: var(--acc); font-weight: 800; font-size: 13px;
}
.xh-joins { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.xh-dom { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 11px 0; border-top: 1px solid var(--line); }
.xh-dom:first-child { border-top: 0; }
.xh-dom-name { font: 500 13.5px var(--mono); flex: 1; min-width: 160px; overflow-wrap: anywhere; }
.xh-dom-act { display: flex; gap: 6px; }
.xh-dom-act .xh-btn { padding: 6px 11px; font-size: 12.5px; }
.xh-domlist { margin-bottom: 14px; }

/* ── connect view ────────────────────────── */
.xh-connect { max-width: 640px; margin: 0 auto; }
.xh-connect h1 { font: 800 28px/1.15 'Archivo', sans-serif; margin: 6px 0 8px; }
.xh-connect > p { color: var(--text-2); margin: 0 0 22px; }
.xh-how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.xh-how div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-size: 13px; color: var(--text-2); }
.xh-how b { display: block; color: var(--text); font-size: 13.5px; margin-bottom: 3px; }

/* ── loading + toast ─────────────────────── */
.xh-loading { position: fixed; inset: 0; display: grid; place-items: center; z-index: 5; pointer-events: none; }
.xh-loading span { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--acc); animation: xh-spin .8s linear infinite; }
@keyframes xh-spin { to { transform: rotate(360deg); } }
.xh-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 50;
  background: var(--card-2); border: 1px solid var(--line-2); border-radius: 11px; padding: 11px 16px; font-weight: 600; font-size: 14px;
  box-shadow: 0 18px 40px -16px rgba(0,0,0,.8); transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px);
}
.xh-toast.show { opacity: 1; transform: translate(-50%, 0); }
.xh-toast.ok { border-color: rgba(52,211,153,.4); }
.xh-toast.bad { border-color: rgba(248,113,113,.45); color: #fecaca; }

.xh-fade { animation: xh-in .25s ease both; }
@keyframes xh-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .xh-fade { animation: none; } }

/* ── narrow screens ──────────────────────── */
@media (max-width: 900px) {
  .xh-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .xh-grid, .xh-joins, .xh-how { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .xh-bar { padding: 0 14px; gap: 10px; }
  .xh-barlink[href], .xh-credits { display: none; }
  .xh-who span:last-child { display: none; }
  .xh-who { padding: 3px; }
  .xh-app { grid-template-columns: 1fr; }
  .xh-side { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--line); padding: 14px; }
  .xh-list { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 2px; }
  .xh-item { flex: none; max-width: 220px; border-color: var(--line); }
  .xh-main { padding: 22px 16px 70px; border-left: 0; }
  .xh-head h1 { font-size: 23px; }
}
