/* shared with tides.cx, dashboard.tides.cx and music.tides.cx.
   --accent is overwritten per guild at runtime, so use it for brand
   surfaces only and keep structure on the neutral tokens. */
:root {
  color-scheme: dark;

  --d0: #05080e;
  --d1: #070a10;
  --d2: #0a0f18;
  --d3: #0d1220;
  --d4: #111826;

  --surface-1: rgba(255,255,255,.026);
  --surface-2: rgba(255,255,255,.045);
  --surface-3: rgba(255,255,255,.07);

  --line-1: rgba(255,255,255,.06);
  --line-2: rgba(255,255,255,.1);
  --line-3: #1a2a3e;

  --text:   #e4edf7;
  --text-2: rgba(228,237,247,.62);
  --text-3: rgba(228,237,247,.38);

  --accent:    #00faff;
  --accent-2:  #bcfbff;
  --accent-dim: rgba(0,250,255,.1);

  --green: #23a559;
  --red:   #ed4245;
  --amber: #faa61a;
  --blurple: #5865f2;

  --green-dim: rgba(35,165,89,.14);
  --red-dim:   rgba(237,66,69,.14);
  --amber-dim: rgba(250,166,26,.14);

  --r-sm: 6px;
  --r:    10px;
  --r-md: 14px;
  --r-full: 999px;

  --topbar-h: 60px;

  --ease: cubic-bezier(.16,1,.3,1);
  --fast: .16s ease;
  --norm: .28s var(--ease);

  --shadow-1: 0 2px 12px rgba(0,0,0,.35);
  --shadow-2: 0 12px 40px rgba(0,0,0,.5);
  --shadow-pop: 0 24px 70px rgba(0,0,0,.65);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--d1);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 4px; }

svg.ico {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}
svg.ico-fill { fill: currentColor; stroke: none; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.08);
  border-radius: 99px; border: 3px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.16); background-clip: content-box; }

/* ── shared chrome ── */

.topbar {
  position: sticky; top: 0; z-index: 60;
  height: var(--topbar-h);
  background: rgba(5,8,14,.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-1);
}
.topbar-inner {
  height: 100%;
  display: flex; align-items: center; gap: 14px;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  margin-right: auto;
  font-weight: 700; font-size: 15px; letter-spacing: -.01em; color: #fff;
}
.brand img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.brand small {
  font-weight: 500; font-size: 13px; color: var(--text-3);
  border-left: 1px solid var(--line-2); padding-left: 10px;
}

/* ── buttons ── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 34px; padding: 0 14px;
  border: 1px solid transparent; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: background var(--fast), border-color var(--fast), color var(--fast), opacity var(--fast);
}
.btn-primary { background: var(--accent); color: #04121a; }
.btn-primary:hover { filter: brightness(1.12); }
.btn-ghost { background: var(--surface-1); border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line-3); }
.btn-quiet { color: var(--text-2); }
.btn-quiet:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--red-dim); border-color: rgba(237,66,69,.3); color: #ff9ea0; }
.btn-danger:hover { background: rgba(237,66,69,.22); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn-lg { height: 40px; padding: 0 18px; font-size: 14px; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  color: var(--text-2);
  transition: background var(--fast), color var(--fast);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* ── panels ── */

.panel {
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  border-radius: var(--r);
}
.panel-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-1);
}
.panel-head h2 {
  font-size: 14px; font-weight: 600; letter-spacing: -.01em; color: #fff;
  margin-right: auto;
}
.panel-head .sub { font-size: 12px; color: var(--text-3); font-weight: 500; }
.panel-body { padding: 18px; }

/* ── pills ── */

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px;
  border-radius: var(--r-full);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
  color: var(--text-2);
  text-transform: none;
}
.pill svg { width: 12px; height: 12px; }
.pill--good { background: var(--green-dim); border-color: rgba(35,165,89,.3); color: #6ee7a0; }
.pill--bad  { background: var(--red-dim);   border-color: rgba(237,66,69,.3);  color: #ff9ea0; }
.pill--warn { background: var(--amber-dim); border-color: rgba(250,166,26,.3); color: #ffd08a; }
.pill--live { background: var(--accent-dim); border-color: rgba(0,250,255,.3); color: var(--accent-2); }

/* ── form controls ── */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field-note { font-size: 12px; color: var(--text-3); }

input[type="text"], input[type="url"], input[type="number"], textarea, select {
  width: 100%;
  padding: 9px 12px;
  background: var(--d0);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  font-size: 13px;
  transition: border-color var(--fast);
}
input[type="text"]:focus, input[type="url"]:focus, input[type="number"]:focus,
textarea:focus, select:focus {
  outline: none; border-color: var(--accent);
}
/* js sets the height from scrollHeight, css caps it, so no drag handle */
textarea {
  resize: none;
  overflow-y: auto;
  min-height: 78px;
  max-height: 280px;
  line-height: 1.6;
}
::placeholder { color: var(--text-3); }

/* ── checkbox ── */

input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 17px; height: 17px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--d0);
  border: 1.5px solid var(--line-2); border-radius: 5px;
  cursor: pointer;
  transition: background var(--fast), border-color var(--fast), transform .1s ease;
}
input[type="checkbox"]::after {
  content: '';
  width: 9px; height: 5px;
  margin-top: -2px;
  border-left: 2px solid #04121a;
  border-bottom: 2px solid #04121a;
  border-radius: 1px;
  opacity: 0;
  transform: rotate(-45deg) scale(.3);
  transition: transform .22s var(--ease), opacity .12s ease;
}
input[type="checkbox"]:hover { border-color: var(--line-3); }
input[type="checkbox"]:active { transform: scale(.88); }
input[type="checkbox"]:checked {
  background: var(--accent); border-color: var(--accent);
  animation: checkPop .24s var(--ease);
}
input[type="checkbox"]:checked::after { opacity: 1; transform: rotate(-45deg) scale(1); }

@keyframes checkPop {
  0%   { transform: scale(.8); }
  55%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  input[type="checkbox"], input[type="checkbox"]::after { transition: none; animation: none; }
}

.toggle-row {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; color: var(--text-2); cursor: pointer;
}
.toggle-row input { margin-top: 2px; }
.toggle-row--card {
  padding: 12px 14px; margin-bottom: 16px;
  background: var(--surface-1);
  border: 1px solid var(--line-1); border-radius: var(--r-sm);
}

.empty-state {
  padding: 22px 18px;
  text-align: center;
  font-size: 13px; color: var(--text-3);
}

/* ── toast ── */

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 200;
  max-width: min(92vw, 460px);
  padding: 11px 16px;
  background: var(--d4);
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  box-shadow: var(--shadow-pop);
  font-size: 13px;
}
.toast.hidden { display: none; }

.hidden { display: none !important; }
