/* Fluid.dll's look: the same palette and measurements as its ui.h and status_window.cpp. */
:root {
  --bg: #0b0c10;
  --text: #eceef2;
  --soft: #c9cdd5;
  --muted: #9ba1ac;
  --faint: #626772;
  --accent: #3b82f6;
  --accent-hi: #60a5fa;
  --indigo: #4f46e5;
  --good: #3dd68c;
  --warn: #f5a524;
  --beta: #4dbdff;
  --basic: #f472b6;
  --premium: #f5c542;
  --discord: #5865f2;
  --header: 52px;
  --sidebar: 220px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 14px/1.45 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, sans-serif;
}
/* The window's backdrop: soft blue and indigo light. Painted once: it never moves. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(42vw 42vw at 78% 12%, rgba(59, 130, 246, .20), transparent 70%),
    radial-gradient(46vw 46vw at 22% 92%, rgba(79, 70, 229, .18), transparent 70%),
    linear-gradient(135deg, #101119, #0c0d12 50%, #08090c);
}
a { color: inherit; text-decoration: none; }
small { font-size: 12px; }
[hidden] { display: none !important; }

.glass {
  background: rgba(255, 255, 255, .035);
  border: 1px solid rgba(255, 255, 255, .065);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07);
}

button {
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 10px;
  padding: 7px 14px;
  cursor: pointer;
  transition: background .14s, border-color .14s;
}
button:hover { background: rgba(255, 255, 255, .085); border-color: rgba(255, 255, 255, .14); }
button:disabled { opacity: .4; cursor: default; background: rgba(255, 255, 255, .045); }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }

/* ---- the layout: a strip across the top, the sidebar, the page */
body.app {
  display: grid;
  grid-template: var(--header) minmax(0, 1fr) / var(--sidebar) minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
}
.strip {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 22px;
  background: rgba(0, 0, 0, .30);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.strip-logo { position: relative; display: block; }
.strip-logo::before {
  content: '';
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, .16), transparent 70%);
}
.strip-logo img { position: relative; display: block; height: 30px; }
.tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--accent-hi);
  background: rgba(59, 130, 246, .13);
  border-radius: 6px;
  padding: 2px 7px;
}

/* ---- the sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 22px 14px 12px;
  background: rgba(0, 0, 0, .30);
  border-right: 1px solid rgba(255, 255, 255, .06);
}
#nav { position: relative; flex: 1; min-height: 0; overflow-y: auto; }
.nav-label {
  padding: 0 6px;
  height: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--faint);
}
#nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 36px;
  margin-bottom: 2px;
  padding: 0 10px 0 18px;
  border-radius: 10px;
  font-weight: 600;
  color: var(--muted);
  transition: color .14s, background .14s;
}
#nav a:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
/* The selection: a blue-tinted pill with a glowing bar. */
#nav a.on {
  color: var(--text);
  background: rgba(59, 130, 246, .12);
  border: 1px solid rgba(59, 130, 246, .22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07);
}
#nav a.on::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 2px;
  background: var(--accent-hi);
  box-shadow: 0 0 8px 2px rgba(59, 130, 246, .45);
}
#nav a svg {
  flex: none;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#nav a.on svg { color: var(--accent-hi); }
#nav a span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* ---- the profile at the sidebar's foot, its panel opening above on hover */
.account { position: relative; flex: none; padding-top: 10px; outline-offset: 4px; }
.me {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 10px;
  border-radius: 12px;
  transition: background .14s;
}
.account:hover .me, .account:focus-within .me { background: rgba(255, 255, 255, .07); }
.me img { flex: none; width: 30px; height: 30px; border-radius: 50%; background: #1b1d26; }
#myName {
  min-width: 0;
  font-weight: 600;
  color: var(--soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account:hover #myName, .account:focus-within #myName { color: var(--text); }
.badge { flex: none; width: 15px; height: 15px; display: block; }
.badge svg { display: block; width: 100%; height: 100%; }
.menu {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  bottom: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  margin-bottom: -26px;
  background: #12141b;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 12px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .14s, transform .14s, visibility .14s;
}
.account .nav-label { transition: opacity .14s; }
.account:hover .nav-label, .account:focus-within .nav-label { opacity: 0; }
/* (So the mouse can cross the gap between the card and the panel.) */
.menu::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 12px; }
.account:hover .menu, .account:focus-within .menu { opacity: 1; visibility: visible; transform: none; }
.menu small { display: block; font-weight: 600; letter-spacing: .03em; color: var(--muted); }
.menu strong { display: block; font-weight: 600; text-transform: capitalize; }
.menu button { width: 100%; }

/* ---- the page */
main { min-width: 0; overflow-y: auto; padding: 12px 24px 40px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .14) transparent; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 50px;
  padding: 0 14px 0 20px;
  margin-bottom: 20px;
  border-radius: 16px;
  background: rgba(0, 0, 0, .22);
}
.topbar h1 { margin: 0; font-size: 19px; font-weight: 600; }
.live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 26px;
  padding: 0 11px 0 10px;
  border-radius: 13px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--warn);
  background: rgba(245, 165, 36, .13);
}
.live i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* The section label: a glowing dot, spaced capitals, and a line fading out. */
.section {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  margin: 0 0 12px;
  padding-left: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--soft);
}
.section::before {
  content: '';
  flex: none;
  width: 5px;
  height: 5px;
  margin-right: 2px;
  border-radius: 50%;
  background: var(--accent-hi);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .22), 0 0 0 6px rgba(59, 130, 246, .10);
}
.section::after {
  content: '';
  flex: 1;
  min-width: 20px;
  height: 1px;
  background: linear-gradient(90deg, rgba(59, 130, 246, .55), rgba(255, 255, 255, .08) 35%, transparent);
}
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat {
  display: block;
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  border-radius: 16px;
  transition: background .14s, border-color .14s;
}
.stat:hover { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .12); }
.stat.on, .stat.on:hover { background: rgba(59, 130, 246, .12); border-color: rgba(59, 130, 246, .45); }
.stat b { display: block; font-size: 26px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13px; }
.stat.good b { color: var(--good); }
.stat.warn b { color: var(--warn); }
.stat.live-stat b { color: var(--accent-hi); }

.empty { padding: 26px 20px; text-align: center; color: var(--muted); border-radius: 14px; }

.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-bottom: 12px; }
.tools .section { margin: 0; min-width: 180px; }
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 300px;
  min-width: 200px;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  transition: border-color .14s;
}
.search:focus-within { border-color: rgba(96, 165, 250, .7); }
.search svg { flex: none; width: 15px; height: 15px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; }
.search input { flex: 1; min-width: 0; font: inherit; color: var(--text); background: none; border: 0; outline: 0; }
.search input::placeholder { color: var(--faint); }

.card { border-radius: 16px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th {
  padding: 0;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  white-space: nowrap;
}
th button, th span {
  display: block;
  width: 100%;
  padding: 11px 14px;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 0;
}
th button:hover { color: var(--text); background: rgba(255, 255, 255, .03); }
th button.on { color: var(--accent-hi); }
td { padding: 10px 14px; border-bottom: 1px solid rgba(255, 255, 255, .045); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .14s; }
tbody tr:hover { background: rgba(255, 255, 255, .03); }
tr.flash { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: rgba(59, 130, 246, .26); } }

.who { display: flex; align-items: center; gap: 11px; min-width: 0; }
.who > div { min-width: 0; }
.who b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.who small { color: var(--faint); font-variant-numeric: tabular-nums; }
.face { position: relative; flex: none; width: 34px; height: 34px; }
.face img { display: block; width: 100%; height: 100%; border-radius: 50%; background: #1b1d26; }
.face i {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--good);
  border: 2.5px solid #12131a;
  transform: scale(0);
  transition: transform .2s;
}
.face.online i { transform: none; }
small.sub { display: block; color: var(--faint); margin-top: 1px; }
tbody tr { cursor: pointer; }
tbody tr:focus-visible { outline-offset: -2px; }
.idline { display: flex; align-items: center; gap: 5px; }
.copy {
  flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  color: var(--faint);
  background: none;
  border: 0;
  border-radius: 5px;
}
.copy:hover { color: var(--text); background: rgba(255, 255, 255, .09); }
.copy.done { color: var(--good); }
.copy svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---- the popup for one user */
.dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 20px;
  overflow-y: auto;
  color: var(--text);
  background: #12141b;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .14) transparent;
}
.dialog:focus { outline: none; }
.dialog::backdrop { background: rgba(4, 5, 8, .62); }
.d-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.d-head .face { width: 44px; height: 44px; }
.d-title { flex: 1; min-width: 0; }
.d-title b { display: block; font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.d-title small { color: var(--muted); font-variant-numeric: tabular-nums; }
.d-close { flex: none; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; background: none; border: 0; border-radius: 8px; color: var(--muted); }
.d-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.d-close:hover { color: var(--text); }
.d-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 14px;
  padding: 14px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 12px;
}
.d-facts small { display: block; margin-bottom: 2px; color: var(--muted); }
.d-facts span { font-weight: 600; overflow-wrap: anywhere; }
.d-facts .pill { font-size: 12px; }
.dialog .section { margin-top: 18px; }
.d-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chips { display: flex; gap: 6px; }
.chips button { padding: 7px 11px; }
.chips button.on { color: var(--text); background: rgba(59, 130, 246, .18); border-color: rgba(59, 130, 246, .5); }
.d-custom {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, .035);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
}
.d-custom:focus-within { border-color: rgba(96, 165, 250, .7); }
.d-custom input { width: 52px; font: inherit; color: var(--text); text-align: right; background: none; border: 0; outline: 0; }
button.primary { margin-left: auto; color: #fff; background: var(--accent); border-color: transparent; font-weight: 600; white-space: nowrap; }
button.primary:hover { background: #4f90f8; border-color: transparent; }
button.primary:disabled { background: var(--accent); }
.d-note { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.d-action { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; }
.d-action + .d-action { border-top: 1px solid rgba(255, 255, 255, .06); }
.d-action b { display: block; font-weight: 600; }
.d-action small { color: var(--muted); }
.d-action button { flex: none; white-space: nowrap; }
button.danger { color: #f47a7e; border-color: rgba(229, 72, 77, .35); background: rgba(229, 72, 77, .08); }
button.danger:hover { background: rgba(229, 72, 77, .16); border-color: rgba(229, 72, 77, .55); }
button.confirming { color: #fff; background: #d13438; border-color: transparent; font-weight: 600; }
button.confirming:hover { background: #e5484d; border-color: transparent; }
.d-message { margin: 10px 0 0; padding: 8px 12px; color: var(--good); background: rgba(61, 214, 140, .10); border-radius: 9px; }
.d-message.bad { color: var(--warn); background: rgba(245, 165, 36, .10); }
.d-log { list-style: none; margin: 0; padding: 0; }
.d-log li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; padding: 7px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.d-log li:last-child { border-bottom: 0; }
.d-log b { font-weight: 600; }
.d-log small { color: var(--muted); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.good { color: var(--good); background: rgba(61, 214, 140, .13); }
.pill.warn { color: var(--warn); background: rgba(245, 165, 36, .13); }
.pill.live-pill { color: var(--accent-hi); background: rgba(59, 130, 246, .16); }
.pill.idle { color: var(--muted); background: rgba(255, 255, 255, .07); }
.dim { color: var(--faint); }
.plan { font-weight: 600; text-transform: capitalize; }
.plan.beta { color: var(--beta); }
.plan.basic { color: var(--basic); }
.plan.premium { color: var(--premium); }

.pages { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; color: var(--muted); }
.pages div { display: flex; gap: 6px; }

/* ---- the signed-out pages */
.center { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login { width: 100%; max-width: 440px; padding: 34px 34px; text-align: center; border-radius: 18px; }
.login img { display: block; max-width: 72px; max-height: 72px; margin: 0 auto 16px; }
.login h1 { margin: 0 0 6px; font-size: 20px; font-weight: 600; }
.login p { margin: 0 0 22px; color: var(--muted); }
.login p:last-child { margin-bottom: 0; }
.discord {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  height: 44px;
  border-radius: 9px;
  background: var(--discord);
  color: #fff;
  font-weight: 600;
  transition: background .14s;
}
.discord:hover { background: #6d78f4; }
.mark { width: 20px; height: 20px; fill: currentColor; }

/* ---- small screens: the sidebar becomes a strip of tabs */
@media (max-width: 860px) {
  body.app { display: block; height: auto; overflow: visible; }
  .strip { height: var(--header); }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 4;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(9, 10, 14, .94);
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
  }
  #nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
  .nav-label { display: none; }
  #nav a { flex: none; height: 34px; margin: 0; padding: 0 10px; gap: 7px; }
  #nav a svg { display: none; }
  #nav a.on { background: rgba(59, 130, 246, .16); }
  .account { padding: 0; }
  .me { width: 42px; height: 42px; padding: 5px; }
  #myName, .me .badge { display: none; }
  .menu { left: auto; right: 0; width: 210px; bottom: auto; top: 100%; margin: 8px 0 0; }
  .menu::after { top: -10px; height: 10px; }
  main { overflow: visible; padding: 12px 14px 32px; }
  .search { flex: 1 1 100%; }
  table, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  tbody tr { padding: 12px 14px; border-bottom: 1px solid rgba(255, 255, 255, .06); }
  tbody tr:last-child { border-bottom: 0; }
  td { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 4px 0; border: 0; text-align: right; }
  td::before { content: attr(data-label); flex: none; color: var(--faint); text-align: left; }
  td.first { display: block; padding-bottom: 8px; text-align: left; }
  td.first::before { content: none; }
  small.sub { display: inline; margin: 0 0 0 6px; }
  .d-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  button.primary { margin-left: 0; flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
