/* Aria admin panel. Dark by default, light when the system prefers it. No external resources (strict CSP). */

/* ================================================================ tokens */

:root {
  color-scheme: dark;
  --bg: #0f0d12;
  --bg-glow: rgba(255, 95, 174, 0.09);
  --topbar-bg: rgba(15, 13, 18, 0.86);
  --surface: #17141b;
  --surface-2: #1f1b24;
  --surface-3: #29242f;
  --border: #322b38;
  --border-strong: #4a4152;
  --switch-off: #3a3341;
  --text: #f4eff6;
  --text-2: #cfc5d4;
  --muted: #a097a8;

  --accent: #ff5fae;
  --accent-hover: #ff80c0;
  --accent-soft: rgba(255, 95, 174, 0.13);
  --accent-line: rgba(255, 95, 174, 0.42);
  --on-accent: #22061a;

  --success: #57d9a0;
  --success-soft: rgba(87, 217, 160, 0.13);
  --success-line: rgba(87, 217, 160, 0.38);
  --warn: #f7c24f;
  --warn-soft: rgba(247, 194, 79, 0.13);
  --warn-line: rgba(247, 194, 79, 0.42);
  --danger: #ff6f7f;
  --danger-soft: rgba(255, 111, 127, 0.13);
  --danger-line: rgba(255, 111, 127, 0.45);
  --on-danger: #2a0508;
  --info: #8fb8ff;
  --info-soft: rgba(143, 184, 255, 0.13);
  --info-line: rgba(143, 184, 255, 0.4);

  --focus: #ffb3d9;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  --radius: 14px;
  --radius-sm: 9px;
  --radius-xs: 6px;
  --topbar-h: 60px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans",
    sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #faf6f9;
    --bg-glow: rgba(200, 24, 122, 0.06);
    --topbar-bg: rgba(250, 246, 249, 0.88);
    --surface: #ffffff;
    --surface-2: #f7f0f5;
    --surface-3: #efe4ec;
    --border: #e7dae3;
    --border-strong: #cbb8c5;
    --switch-off: #d8cad3;
    --text: #22151d;
    --text-2: #4a3a44;
    --muted: #74636d;

    --accent: #c8187a;
    --accent-hover: #ad1068;
    --accent-soft: rgba(200, 24, 122, 0.09);
    --accent-line: rgba(200, 24, 122, 0.36);
    --on-accent: #ffffff;

    --success: #13784a;
    --success-soft: rgba(19, 120, 74, 0.1);
    --success-line: rgba(19, 120, 74, 0.35);
    --warn: #8a5a00;
    --warn-soft: rgba(196, 132, 0, 0.12);
    --warn-line: rgba(196, 132, 0, 0.4);
    --danger: #c01e3a;
    --danger-soft: rgba(192, 30, 58, 0.08);
    --danger-line: rgba(192, 30, 58, 0.38);
    --on-danger: #ffffff;
    --info: #2356c4;
    --info-soft: rgba(35, 86, 196, 0.08);
    --info-line: rgba(35, 86, 196, 0.32);

    --focus: #c8187a;
    --shadow: 0 12px 32px rgba(60, 20, 45, 0.14);
  }
}

/* ================================================================ base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font: 15px/1.5 var(--font);
  color: var(--text);
  background: radial-gradient(1100px 520px at 0% -8%, var(--bg-glow), transparent 65%), var(--bg);
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3 {
  line-height: 1.25;
}

p {
  margin: 0 0 0.75rem;
}

code {
  font-family: var(--mono);
  font-size: 0.85em;
  padding: 0.05rem 0.35rem;
  border-radius: 5px;
  background: var(--surface-2);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

::selection {
  background: var(--accent-soft);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.85rem;
}

.mono {
  font-family: var(--mono);
  font-size: 0.82em;
}

.name-text {
  unicode-bidi: isolate;
  overflow-wrap: anywhere;
}

.link {
  color: var(--accent);
  font-weight: 600;
  text-underline-offset: 3px;
}

.link:hover {
  color: var(--accent-hover);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

.noscript {
  margin: 3rem auto;
  max-width: 30rem;
  text-align: center;
}

.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ================================================================ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 38px;
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
}

.btn:hover {
  background: var(--surface-3);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-sm {
  min-height: 32px;
  padding: 0.3rem 0.7rem;
  font-size: 0.86rem;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--on-danger);
}

.btn-danger:hover {
  filter: brightness(1.07);
  background: var(--danger);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.btn-danger-ghost {
  background: transparent;
  border-color: var(--danger-line);
  color: var(--danger);
}

.btn-danger-ghost:hover {
  background: var(--danger-soft);
}

.btn.is-busy {
  cursor: progress;
}

.btn.is-busy::after {
  content: "";
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--surface-3);
  color: var(--text);
}

.icon-btn--xs {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-xs);
}

.icon-btn--xs .icon {
  width: 14px;
  height: 14px;
}

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-weight: 650;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
  cursor: pointer;
}

.link-btn:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

/* ================================================================ switches */

.switch {
  display: inline-flex;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  cursor: pointer;
}

.switch:focus-visible {
  outline-offset: 3px;
}

.switch-track {
  position: relative;
  display: block;
  width: 46px;
  height: 26px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--switch-off);
  transition: background-color 0.18s, border-color 0.18s;
}

.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s;
}

.switch[aria-checked="true"] .switch-track {
  background: var(--accent);
  border-color: var(--accent);
}

.switch[aria-checked="true"] .switch-thumb {
  transform: translateX(20px);
}

.switch--danger[aria-checked="true"] .switch-track {
  background: var(--danger);
  border-color: var(--danger);
}

.switch--lg .switch-track {
  width: 62px;
  height: 34px;
}

.switch--lg .switch-thumb {
  width: 28px;
  height: 28px;
}

.switch--lg[aria-checked="true"] .switch-thumb {
  transform: translateX(28px);
}

.switch:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.switch.is-busy {
  opacity: 0.65;
  cursor: progress;
}

.switch-input {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex-shrink: 0;
  width: 46px;
  height: 26px;
  margin: 0;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--switch-off);
  cursor: pointer;
  transition: background-color 0.18s, border-color 0.18s;
}

.switch-input::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s;
}

.switch-input:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.switch-input:checked::before {
  transform: translateX(20px);
}

.switch-input:focus-visible {
  outline-offset: 3px;
}

.switch-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
}

.switch-list .switch-row + .switch-row {
  border-top: 1px solid var(--border);
}

.switch-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.switch-label {
  font-weight: 650;
  cursor: pointer;
}

.switch-desc {
  color: var(--muted);
  font-size: 0.87rem;
}

.switch-row.is-disabled .switch-label {
  cursor: not-allowed;
}

/* ================================================================ chips, tags, badges */

.chips {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.08rem 0.5rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.55;
  white-space: nowrap;
}

.chip--success {
  background: var(--success-soft);
  color: var(--success);
}

.chip--danger,
.chip--alert-age,
.chip--alert-safeword,
.chip--alert-lock {
  background: var(--danger-soft);
  border-color: var(--danger-line);
  color: var(--danger);
}

.chip--warn,
.chip--alert-checkin {
  background: var(--warn-soft);
  color: var(--warn);
}

.chip--info,
.chip--alert-report {
  background: var(--info-soft);
  color: var(--info);
}

.chip--accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.chip--alert-release {
  background: var(--success-soft);
  color: var(--success);
}

.chip--muted,
.chip--alert-config,
.chip--alert-other {
  background: var(--surface-3);
  color: var(--muted);
}

.tag {
  display: inline-block;
  max-width: 100%;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-xs);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.tag--more {
  border-color: var(--border);
  background: var(--surface-3);
  color: var(--muted);
}

.countdown {
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.countdown.is-soon {
  color: var(--warn);
}

/* Effects that end by being finished (lines): how far along they are, then the deadline. */
.effect-progress {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  white-space: nowrap;
}

.effect-progress .progress-text {
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.channel-ref {
  color: var(--text-2);
  unicode-bidi: isolate;
  overflow-wrap: anywhere;
}

/* ================================================================ avatars */

.avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  line-height: 1;
}

.avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar--sm {
  width: 26px;
  height: 26px;
  font-size: 0.75rem;
}

.avatar--lg {
  width: 56px;
  height: 56px;
  font-size: 1.35rem;
}

.hue-0 { background: #b8326f; }
.hue-1 { background: #6d3fc0; }
.hue-2 { background: #2f67ad; }
.hue-3 { background: #1c7a64; }
.hue-4 { background: #9c4f17; }
.hue-5 { background: #8b3fa8; }
.hue-6 { background: #b33a2e; }
.hue-7 { background: #48599a; }

/* ================================================================ forms */

.input,
select,
.search input,
.password-field input {
  width: 100%;
  min-height: 40px;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background-color: var(--surface-2);
  color: var(--text);
  font: inherit;
}

.input:focus,
select:focus,
.search input:focus,
.password-field input:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
  border-color: var(--accent);
}

.input::placeholder,
.search input::placeholder {
  color: var(--muted);
}

.input--number {
  width: 7.5rem;
  font-variant-numeric: tabular-nums;
}

select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 2.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%239b8fa3' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 12px 8px;
  cursor: pointer;
}

[aria-invalid="true"] {
  border-color: var(--danger) !important;
}

.checkbox {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.range {
  width: 100%;
  margin: 0.35rem 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.range:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* A slider with a number box beside it; the number box is the field's real control. */
.range-pair {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.range-pair .range {
  flex: 1 1 auto;
  min-width: 0;
}

.range-pair .input--number {
  flex: 0 0 auto;
  width: 5.5rem;
}

.range-value {
  min-width: 3.2rem;
  color: var(--accent);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.field-label {
  padding: 0;
  font-size: 0.92rem;
  font-weight: 650;
}

.field-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.field-suffix {
  color: var(--muted);
  font-size: 0.9rem;
}

.field-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.field-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.86rem;
  font-weight: 650;
}

.field--inline {
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
}

.field--inline select {
  width: auto;
  min-width: 15rem;
  max-width: 100%;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 1.1rem 1.5rem;
}

.form-message {
  margin: 0;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--danger-line);
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 600;
}

.form-message--info {
  border-color: var(--info-line);
  background: var(--info-soft);
  color: var(--info);
}

.radio-cards {
  display: grid;
  gap: 0.6rem;
}

.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.radio-card:hover {
  border-color: var(--border-strong);
}

.radio-card:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.radio-card input {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 0.15rem 0 0;
  accent-color: var(--accent);
}

.radio-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.radio-label {
  font-weight: 650;
}

.radio-hint {
  color: var(--muted);
  font-size: 0.87rem;
}

/* ================================================================ boot & login */

.boot {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.boot .brand-mark {
  animation: pulse 1.4s ease-in-out infinite;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ff86c5, #e0368a 55%, #a3136b);
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
  box-shadow: 0 4px 14px rgba(255, 79, 163, 0.32);
}

.brand-mark--lg {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  font-size: 1.5rem;
}

.login {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 1.5rem;
  background: radial-gradient(760px 480px at 50% -10%, var(--accent-soft), transparent 70%);
}

.login-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: min(400px, 100%);
  padding: 1.75rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.login-title {
  margin: 0;
  font-size: 1.7rem;
  line-height: 1;
  letter-spacing: -0.02em;
}

.login-sub {
  margin: 0.25rem 0 0;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.login-lede {
  margin: 0.4rem 0 0.5rem;
  color: var(--text-2);
}

.password-field {
  position: relative;
  display: flex;
}

.password-field input {
  padding-right: 2.9rem;
}

.password-field .icon-btn {
  position: absolute;
  top: 50%;
  right: 0.25rem;
  transform: translateY(-50%);
}

.password-field .icon-btn[aria-pressed="true"] {
  color: var(--accent);
}

.login-card .btn-primary {
  margin-top: 0.4rem;
  min-height: 42px;
}

.login-foot {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

/* ================================================================ shell */

.shell {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--topbar-h);
  padding: 0.55rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--topbar-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand-sub {
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.guild-picker {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  padding-left: 1rem;
  border-left: 1px solid var(--border);
}

.guild-icon {
  display: inline-flex;
}

.guild-picker select {
  width: auto;
  max-width: 280px;
  min-height: 36px;
  font-weight: 600;
}

.guild-single {
  max-width: 320px;
  overflow: hidden;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
  unicode-bidi: isolate;
}

.topbar-end {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 0.82rem;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px var(--success-soft);
}

.status-pill.is-off {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-pill.is-off .status-dot {
  box-shadow: 0 0 0 3px var(--danger-soft);
}

.sidenav {
  position: sticky;
  top: var(--topbar-h);
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  height: calc(100vh - var(--topbar-h));
  padding: 1rem 0.75rem;
  overflow-y: auto;
  border-right: 1px solid var(--border);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.58rem 0.8rem;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-weight: 620;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}

.nav-link:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-link[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.content {
  min-width: 0;
  padding: 1.5rem clamp(1rem, 3vw, 2.25rem) 4rem;
  outline: none;
}

.view,
.no-guild {
  max-width: 1180px;
  margin: 0 auto;
}

.view-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.view-head h1 {
  margin: 0;
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
  letter-spacing: -0.02em;
}

.view-lede {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.view-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.8rem;
}

/* ================================================================ cards & states */

.card {
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.8rem;
}

.card-title {
  margin: 0;
  padding: 0;
  font-size: 1.02rem;
  font-weight: 750;
}

.card-lede {
  margin: -0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.empty {
  padding: 1.6rem 1rem;
  color: var(--muted);
  text-align: center;
}

.empty-title {
  margin: 0;
  color: var(--text-2);
  font-weight: 700;
}

.empty-text {
  max-width: 46ch;
  margin: 0.3rem auto 0;
  font-size: 0.9rem;
}

.empty .btn {
  margin-top: 0.8rem;
}

.empty--error .empty-title {
  color: var(--danger);
}

.loading {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.5rem 0;
}

.skeleton {
  height: 18px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2));
  background-size: 200% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}

.skeleton--0 { width: 92%; }
.skeleton--1 { width: 74%; }
.skeleton--2 { width: 56%; }

.callout {
  display: flex;
  gap: 0.7rem;
  margin-bottom: 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--info-line);
  border-radius: var(--radius);
  background: var(--info-soft);
}

.callout-mark {
  color: var(--info);
}

.callout--warn {
  border-color: var(--warn-line);
  background: var(--warn-soft);
}

.callout--warn .callout-mark {
  color: var(--warn);
}

.callout--danger {
  border-color: var(--danger-line);
  background: var(--danger-soft);
}

.callout--danger .callout-mark {
  color: var(--danger);
}

.callout-title {
  margin: 0;
  font-weight: 700;
}

.callout-text {
  margin: 0.15rem 0 0;
  color: var(--text-2);
  font-size: 0.9rem;
}

.savebar {
  position: sticky;
  bottom: 1rem;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-top: 1rem;
  padding: 0.65rem 0.8rem 0.65rem 1.1rem;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  background: var(--surface-3);
  box-shadow: var(--shadow);
  animation: rise 0.18s ease-out;
}

.savebar-text {
  margin: 0;
  font-weight: 650;
}

.savebar-actions {
  display: flex;
  gap: 0.5rem;
}

/* ================================================================ tables */

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.data-table th {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  padding: 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: var(--surface-2);
}

.cell-action {
  text-align: right;
}

.table-card {
  padding: 0.35rem 0.8rem;
}

.activity-table td {
  vertical-align: top;
}

.cell-time {
  white-space: nowrap;
}

.cell-time time,
.cell-abs {
  display: block;
}

.cell-time time {
  font-weight: 650;
}

.what {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.what-action {
  color: var(--text-2);
  font-size: 0.88rem;
}

.cell-detail {
  max-width: 560px;
  color: var(--text-2);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.row-alert td:first-child {
  box-shadow: inset 3px 0 0 var(--border-strong);
}

.row-alert--age {
  background: var(--danger-soft);
}

.row-alert--age td:first-child,
.row-alert--safeword td:first-child,
.row-alert--lock td:first-child {
  box-shadow: inset 3px 0 0 var(--danger);
}

.row-alert--checkin td:first-child {
  box-shadow: inset 3px 0 0 var(--warn);
}

.row-alert--report td:first-child {
  box-shadow: inset 3px 0 0 var(--info);
}

.row-alert--release td:first-child {
  box-shadow: inset 3px 0 0 var(--success);
}

.load-more {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

/* ================================================================ overview */

.play-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

.play-card.is-on {
  border-color: var(--accent-line);
  background: linear-gradient(120deg, var(--accent-soft), transparent 58%), var(--surface);
}

.play-card.is-off {
  border-color: var(--danger-line);
  background: linear-gradient(120deg, var(--danger-soft), transparent 58%), var(--surface);
}

.play-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
}

.play-title {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
}

.play-card.is-off .play-title {
  color: var(--danger);
}

.play-desc {
  max-width: 62ch;
  margin: 0.2rem 0 0.6rem;
  color: var(--text-2);
}

.play-switch {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.6rem;
}

.play-switch-label {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.play-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.play-footer p {
  margin: 0;
}

.play-counts {
  display: grid;
  gap: 0.15rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.stat:hover {
  border-color: var(--accent-line);
  background: var(--surface-2);
}

.stat-value {
  font-size: 1.65rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.stat-label {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.stat--warn {
  border-color: var(--warn-line);
  background: linear-gradient(var(--warn-soft), var(--warn-soft)), var(--surface);
}

.stat--warn .stat-value {
  color: var(--warn);
}

.stat--danger {
  border-color: var(--danger-line);
  background: linear-gradient(var(--danger-soft), var(--danger-soft)), var(--surface);
}

.stat--danger .stat-value {
  color: var(--danger);
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  grid-template-areas: "effects alerts";
  align-items: start;
  gap: 1rem;
}

.feed-card {
  grid-area: alerts;
}

.effects-card {
  grid-area: effects;
}

.feed {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.alert {
  display: flex;
  gap: 0.65rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid transparent;
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.alert-mark {
  flex-shrink: 0;
  width: 1.4rem;
  font-size: 1.05rem;
  line-height: 1.45;
  text-align: center;
}

.alert-body {
  flex: 1;
  min-width: 0;
}

.alert-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.alert-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.alert-time {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.alert-text {
  margin: 0.15rem 0 0;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
  unicode-bidi: plaintext;
}

.alert--age {
  border-color: var(--danger-line);
  border-left: 4px solid var(--danger);
  background: var(--danger-soft);
}

.alert--age .alert-label,
.alert--safeword .alert-label,
.alert--lock .alert-label {
  color: var(--danger);
}

.alert--age .alert-text {
  font-weight: 650;
}

.alert--safeword,
.alert--lock {
  border-left-color: var(--danger);
}

.alert--checkin {
  border-left-color: var(--warn);
  background: var(--warn-soft);
}

.alert--checkin .alert-label {
  color: var(--warn);
}

.alert--report {
  border-left-color: var(--info);
}

.alert--report .alert-label {
  color: var(--info);
}

.alert--release {
  border-left-color: var(--success);
}

/* A decree hits the whole room at once, so it stands out from the ordinary apply/release chatter. */
.alert--decree {
  border-left-color: var(--accent);
  background: var(--accent-soft);
}

.alert--decree .alert-label {
  color: var(--accent);
}

.effects-table .tag {
  white-space: normal;
}

/* ================================================================ members */

.search {
  position: relative;
  flex: 1 1 280px;
  max-width: 420px;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 0.7rem;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.search input {
  padding-left: 2.3rem;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.filter-chip {
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: 0.87rem;
  font-weight: 620;
  cursor: pointer;
  white-space: nowrap;
}

.filter-chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.filter-chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.results-summary {
  min-height: 1.3em;
  margin: 0 0 0.6rem;
}

.member-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.member-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, auto) auto;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.member-row:hover {
  border-color: var(--accent-line);
  background: var(--surface-2);
}

.member-row.is-locked {
  border-left: 4px solid var(--danger);
}

.member-main {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.member-name {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 0;
}

.member-name .name-text {
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-username {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.85rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  unicode-bidi: isolate;
}

.member-effects {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.3rem;
  max-width: 360px;
}

/* Favour and title under a member's name; the sort control sits at the end of the toolbar. */
.member-progress {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.member-sort {
  margin-left: auto;
}

.member-sort select {
  min-width: 8rem;
}

.row-chevron {
  color: var(--muted);
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

/* ================================================================ member drawer */

dialog {
  color: var(--text);
}

.drawer {
  width: min(560px, 100vw);
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.drawer::backdrop {
  background: rgba(8, 4, 10, 0.55);
}

.drawer[open] {
  animation: slide-in 0.22s ease-out;
}

.drawer-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.drawer-header {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.drawer-heading {
  flex: 1;
  min-width: 0;
}

.drawer-title {
  margin: 0;
  font-size: 1.2rem;
  overflow-wrap: anywhere;
}

.drawer-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem;
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.drawer-close {
  align-self: flex-start;
  margin-left: auto;
}

.drawer-body {
  flex: 1;
  padding: 0.3rem 1.2rem 2rem;
  overflow-y: auto;
}

.drawer-section {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.drawer-section:last-child {
  border-bottom: 0;
}

.drawer-explain {
  margin: 0.6rem 0 0.2rem;
  color: var(--text-2);
}

.section-title {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.section-head .section-title {
  margin: 0;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.drawer-section .form-message {
  margin-top: 0.5rem;
}

.effect-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.effect-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.effect-item-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  min-width: 0;
}

.effect-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.facts {
  display: grid;
  gap: 0.55rem;
  margin: 0.4rem 0 0;
}

.facts div {
  display: grid;
  grid-template-columns: 10rem minmax(0, 1fr);
  align-items: baseline;
  gap: 0.75rem;
}

.facts dt {
  color: var(--muted);
  font-size: 0.9rem;
}

.facts dd {
  margin: 0;
  font-weight: 600;
}

/* Favour and title edit in the member drawer: a short row of controls with the Save button at the end. */
.progress-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  margin-top: 0.8rem;
}

.progress-form .field {
  flex: 0 1 auto;
}

.progress-form .input--number {
  width: 7rem;
}

.progress-form select {
  min-width: 11rem;
}

.progress-form .btn {
  margin-bottom: 1px;
}

.notes {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.notes li {
  padding: 0.45rem 0.7rem;
  border-left: 3px solid var(--accent-line);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  background: var(--surface-2);
  overflow-wrap: anywhere;
  unicode-bidi: plaintext;
}

.mini-log {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mini-log-item {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  column-gap: 0.75rem;
  padding: 0.45rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
}

.mini-log-item:first-child {
  border-top: 0;
}

.mini-log-time {
  grid-row: span 2;
  color: var(--muted);
}

.mini-log-detail {
  grid-column: 2;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* ================================================================ confirm dialog & toasts */

.confirm {
  width: min(460px, calc(100vw - 2rem));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.confirm::backdrop {
  background: rgba(8, 4, 10, 0.6);
}

.confirm[open] {
  animation: pop 0.16s ease-out;
}

.confirm-inner {
  padding: 1.3rem 1.4rem 1.1rem;
}

.confirm-title {
  margin: 0 0 0.6rem;
  font-size: 1.15rem;
  overflow-wrap: anywhere;
}

.confirm-body p {
  margin: 0 0 0.6rem;
  color: var(--text-2);
  overflow-wrap: anywhere;
}

.confirm-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.1rem;
}

.toasts {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(380px, calc(100vw - 2rem));
  pointer-events: none;
}

body.has-savebar .toasts {
  bottom: 5.5rem;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.65rem 0.55rem 0.65rem 0.8rem;
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--info);
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  box-shadow: var(--shadow);
  pointer-events: auto;
  animation: rise 0.2s ease-out;
  transition: opacity 0.18s, transform 0.18s;
}

.toast-mark {
  display: inline-flex;
  margin-top: 0.1rem;
  color: var(--info);
}

.toast--success {
  border-left-color: var(--success);
}

.toast--success .toast-mark {
  color: var(--success);
}

.toast--error {
  border-left-color: var(--danger);
}

.toast--error .toast-mark {
  color: var(--danger);
}

.toast--warn {
  border-left-color: var(--warn);
}

.toast--warn .toast-mark {
  color: var(--warn);
}

.toast-text {
  flex: 1;
  margin: 0.05rem 0 0;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.toast-close {
  width: 28px;
  height: 28px;
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(6px);
}

/* ================================================================ no guild */

.no-guild {
  max-width: 720px;
  padding-top: 1rem;
}

.no-guild-title {
  margin: 0;
  font-size: 1.6rem;
}

.guild-cards {
  display: grid;
  gap: 0.6rem;
  margin: 1.2rem 0 0;
  padding: 0;
  list-style: none;
}

.guild-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.guild-card:hover {
  border-color: var(--accent-line);
  background: var(--surface-2);
}

.guild-card-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.guild-card-name {
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* ================================================================ channels */

.channels-intro p {
  max-width: 78ch;
  margin: 0.45rem 0 0;
  color: var(--text-2);
}

.channels-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.channels-intro .channels-summary-text {
  margin: 0;
  color: var(--text);
  font-weight: 620;
}

.summary-warn {
  color: var(--warn);
}

.channel-group {
  margin-top: 1.4rem;
}

.group-title {
  margin: 0 0 0.6rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.channel-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr));
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.channel-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.channel-card.is-open {
  border-color: var(--success-line);
}

.channel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.channel-glyph {
  width: 1.2rem;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.channel-name {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
  unicode-bidi: isolate;
}

.channel-play {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem;
  margin: 0;
  color: var(--text-2);
  font-size: 0.9rem;
}

.channel-foot {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
}

.channel-note .input {
  min-height: 36px;
  padding: 0.4rem 0.6rem;
}

.perms summary {
  font-size: 0.87rem;
  font-weight: 620;
  cursor: pointer;
}

.perm-summary--bad {
  color: var(--danger);
}

.perm-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.55rem 0 0;
  padding: 0;
  list-style: none;
}

.perm {
  display: flex;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.perm-mark {
  flex-shrink: 0;
}

.perm-text {
  display: flex;
  flex-direction: column;
}

.perm-name {
  font-weight: 650;
}

.perm-why {
  color: var(--muted);
}

.perm--missing .perm-name {
  color: var(--danger);
}

.perm--unused {
  opacity: 0.7;
}

/* ================================================================ effects */

.effects-note {
  margin: 0 0 0.9rem;
}

.mech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(310px, 100%), 1fr));
  gap: 0.9rem;
}

.mech-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.mech-card.is-heavy {
  border-color: var(--warn-line);
}

.mech-card.is-off .mech-summary,
.mech-card.is-off .mech-facts,
.mech-card.is-off .variants,
.mech-card.is-off .mech-perms {
  opacity: 0.62;
}

.mech-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.mech-titles {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.mech-name {
  margin: 0;
  font-size: 1.08rem;
}

.mech-kind {
  padding: 0.05rem 0.4rem;
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.74rem;
}

.mech-summary {
  margin: 0;
  color: var(--text-2);
  font-size: 0.92rem;
}

.mech-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.9rem;
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
  list-style: none;
}

.variants summary {
  font-size: 0.85rem;
  cursor: pointer;
}

.variant-list {
  display: grid;
  gap: 0.35rem;
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
}

.variant-list div {
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr);
  gap: 0.5rem;
}

.variant-list dt {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
}

.variant-list dd {
  margin: 0;
  color: var(--muted);
}

.mech-perms {
  margin: 0;
  font-size: 0.85rem;
}

.mech-wearing {
  margin: 0;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
}

.mech-card.is-dirty {
  border-color: var(--accent-line);
}

/* A setting that rides on an effect card (the weekly pick on name tag). */
.mech-extra {
  border-top: 1px solid var(--border);
}

.mech-extra .switch-row {
  padding: 0.55rem 0 0.2rem;
}

.mech-card.is-off .mech-extra .switch-desc {
  opacity: 0.85;
}

#effects-error {
  margin-bottom: 1rem;
}

.mech-settings {
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
}

.mech-settings > summary {
  font-size: 0.87rem;
  font-weight: 650;
  cursor: pointer;
}

.mech-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(132px, 100%), 1fr));
  gap: 0.75rem 0.9rem;
  margin-top: 0.7rem;
}

.field--compact {
  gap: 0.25rem;
}

.field--compact .field-label-row {
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.4rem;
}

.field--compact .field-label {
  font-size: 0.82rem;
}

.field--compact .field-hint,
.field--compact .field-error {
  font-size: 0.78rem;
}

.input--compact {
  min-height: 36px;
  padding: 0.4rem 0.55rem;
  font-variant-numeric: tabular-nums;
}

.btn.field-reset {
  min-height: 0;
  padding: 0.1rem 0.45rem;
  font-size: 0.75rem;
}

/* ================================================================ settings */

#settings-body {
  display: grid;
  gap: 1rem;
  max-width: 880px;
}

#settings-error {
  max-width: 880px;
  margin-bottom: 1rem;
}

.settings-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

fieldset.settings-card {
  min-width: 0;
  margin: 0;
}

/* A named group of fields inside a settings card (the openers under Chatter). */
.settings-group {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}

.settings-subtitle {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 750;
}

.settings-group-lede {
  margin: -0.4rem 0 0;
}

.settings-form .savebar {
  max-width: 880px;
}

/* ================================================================ responsive */

@media (max-width: 1020px) {
  .overview-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "alerts" "effects";
  }
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .topbar {
    position: static;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 0.6rem 0.9rem;
  }

  .guild-picker {
    order: 3;
    flex: 1 1 100%;
    padding-left: 0;
    border-left: 0;
  }

  .guild-picker select {
    flex: 1;
    max-width: none;
  }

  .sidenav {
    position: sticky;
    top: 0;
    z-index: 25;
    flex-direction: row;
    height: auto;
    padding: 0.4rem 0.6rem;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    background: var(--topbar-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    scrollbar-width: none;
  }

  .nav-link {
    flex-shrink: 0;
    padding: 0.45rem 0.7rem;
    white-space: nowrap;
  }

  .nav-link[aria-current="page"] {
    box-shadow: inset 0 -2px 0 var(--accent);
  }

  .content {
    padding-top: 1rem;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .data-table thead {
    display: none;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table tr {
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border);
  }

  .data-table tbody tr:last-child {
    border-bottom: 0;
  }

  .data-table td {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    max-width: none;
    padding: 0.2rem 0.3rem;
    border: 0;
  }

  .data-table td[data-label]::before {
    content: attr(data-label);
    flex: 0 0 5.2rem;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .data-table .cell-action {
    justify-content: flex-end;
  }

  .cell-time time,
  .cell-abs {
    display: inline;
  }

  .cell-abs {
    display: none;
  }

  .row-alert td:first-child {
    box-shadow: none;
  }

  .row-alert {
    box-shadow: inset 3px 0 0 var(--border-strong);
  }

  .row-alert--age,
  .row-alert--safeword,
  .row-alert--lock {
    box-shadow: inset 3px 0 0 var(--danger);
  }

  .member-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .member-effects {
    grid-column: 2 / 3;
    grid-row: 2;
    justify-content: flex-start;
    max-width: none;
  }

  .member-effects:empty {
    display: none;
  }

  .row-chevron {
    grid-column: 3;
    grid-row: 1;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 14.5px;
  }

  .brand-sub {
    display: none;
  }

  .logout-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .status-pill {
    padding: 0.25rem 0.55rem;
  }

  .play-main {
    flex-direction: column;
  }

  .stat-value {
    font-size: 1.4rem;
  }

  .drawer {
    width: 100vw;
    border-left: 0;
  }

  .facts div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.1rem;
  }

  .field--inline {
    flex-wrap: wrap;
  }

  .field--inline select {
    min-width: 0;
    width: 100%;
  }

  .savebar {
    bottom: 0.5rem;
  }

  .toasts {
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
  }

  .effect-item {
    flex-wrap: wrap;
  }
}

/* ================================================================ motion */

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.92); opacity: 0.7; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes pop {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: none; }
}

@keyframes slide-in {
  from { opacity: 0; transform: translateX(28px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
