:root {
  color-scheme: dark;
  --bg: #10121b;
  --panel: #1b1d2a;
  --panel-raised: #191b27;
  --panel-soft: #171925;
  --line: #343445;
  --line-strong: #454554;
  --text: #f3f0e9;
  --muted: #aeadbf;
  --accent: #c5b2ff;
  --accent-soft: #d0bdff;
  --good: #acddc4;
  --danger: #ffc6cc;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 28px; }
body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 82% 0%, #8c67c40d, transparent 40rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}
a { color: var(--accent-soft); text-underline-offset: 4px; }
button, input, textarea, select { font: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 4px; }

.site-header {
  max-width: 1280px;
  min-height: 96px;
  margin: 0 auto;
  padding: 18px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  border-bottom: 1px solid #30303c;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font-size: 18px;
  font-weight: 730;
  letter-spacing: -.6px;
  white-space: nowrap;
}
.brand img { width: 48px; height: 48px; display: block; object-fit: contain; }
.brand-copy { display: grid; line-height: 1.3; }
.brand-light { font-weight: 450; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 450; letter-spacing: .15px; }
.back-link { color: #bebdca; font-size: 13px; text-decoration: none; }
.site-header nav, .actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.site-header nav { gap: 25px; font-size: 13px; }
.site-header nav a {
  color: #bebdca;
  text-decoration: none;
}
.site-header nav a:hover, footer a:hover { color: var(--accent-soft); }

main { max-width: 1280px; margin: 0 auto; padding: 0 40px 42px; }
.hero { max-width: 850px; padding: 58px 0 26px; }
.eyebrow {
  display: inline-block;
  margin: 0 0 16px;
  color: #c2b8df;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.85px;
}
.eyebrow::before { content: "✦"; margin-right: 9px; color: var(--accent); font-size: 14px; }
h1, h2, h3, h4 { color: var(--text); }
h1 {
  margin: 0 0 20px;
  font-size: clamp(38px, 5vw, 58px);
  font-weight: 640;
  line-height: 1.12;
  letter-spacing: -2.2px;
}
h1 em, h2 em {
  color: var(--accent-soft);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: -1.6px;
}
h2 { margin: 0 0 16px; font-size: 26px; font-weight: 600; letter-spacing: -.8px; line-height: 1.25; }
h3 { margin: 22px 0 12px; font-size: 19px; font-weight: 620; letter-spacing: -.35px; line-height: 1.3; }
h4 { margin: 0 0 12px; font-size: 15px; }
p { max-width: 78ch; color: var(--muted); }
.hero p { max-width: 680px; font-size: 16px; line-height: 1.8; }

button, .button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--panel-raised);
  color: var(--text);
  cursor: pointer;
  font-weight: 620;
  line-height: 1.4;
  text-decoration: none;
  transition: background .18s, border-color .18s, transform .18s;
}
button:hover, .button:hover { transform: translateY(-1px); background: #292a38; border-color: #625b76; }
button.primary, .primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #191322;
}
button.primary:hover, .primary:hover { background: #dbceff; border-color: #dbceff; }
button:disabled, select:disabled { opacity: .5; cursor: not-allowed; transform: none; }
button.danger, .danger { border-color: #925367; color: var(--danger); }
button.danger:hover, .danger:hover { background: #38202a; }
.actions { gap: 10px; }

.panel {
  margin: 24px 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel);
  scroll-margin-top: 22px;
}
.section-title, .panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
#login-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 42px; }
#login-panel > div { align-self: center; }
#login-panel h2 { font-size: 28px; }
#login-form { padding-left: 30px; border-left: 1px solid var(--line); }
#login-form h3 { margin-top: 0; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid #4c445e;
  border-radius: 999px;
  color: #d3c5ef;
  font-size: 12px;
  line-height: 1.4;
}
.badge.active { border-color: #396c54; color: var(--good); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 16px;
}
.card {
  overflow-wrap: anywhere;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #171925;
}
.card h3 { margin-top: 0; }
.card .body, .message-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.muted, .card .muted { color: var(--muted); font-size: 13px; }

label { display: block; margin: 12px 0; color: #e2deeb; font-size: 13px; font-weight: 620; }
input, textarea, select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  border: 1px solid #454554;
  border-radius: 7px;
  background: #10121b;
  color: var(--text);
}
input::placeholder, textarea::placeholder { color: #858394; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); outline: 2px solid #c5b2ff30; }
textarea { min-height: 110px; resize: vertical; }
input[type="checkbox"] { display: inline-block; width: auto; margin-right: 9px; }
label.check { display: flex; align-items: center; }
.inline-form { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; }
.inline-form label { flex: 1; min-width: 130px; }
.inline-form button { margin-bottom: 12px; }
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  align-items: end;
  gap: 12px;
  margin-bottom: 24px;
}
.filter-grid button { margin-bottom: 12px; }

details { margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--line); }
summary { color: #e8e1f2; cursor: pointer; font-weight: 640; }
details > :not(summary) { margin-top: 14px; }
.tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #10121beF;
  backdrop-filter: blur(12px);
}
.tabs a { padding: 8px 11px; border-radius: 6px; color: #bebdca; text-decoration: none; font-size: 13px; }
.tabs a:hover { background: #292536; color: var(--accent-soft); }
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.empty { padding: 20px; border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--muted); }
.notification { margin: 18px 0; padding: 4px 20px; border-left: 3px solid var(--accent); }
.notification.read { border-left-color: var(--line); opacity: .7; }
.notification-list-scroll {
  max-height: min(68vh, 34rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 2px 12px 2px 0;
}
.notification-list-scroll:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; }
.message { margin: 12px 0; padding: 16px 20px; border-radius: 10px; background: #171925; }
.message.admin { border: 1px solid #514866; }
#status {
  position: sticky;
  top: 12px;
  z-index: 4;
  max-width: none;
  padding: 12px 18px;
  border: 1px solid #4a4258;
  border-radius: 8px;
  background: #201d2b;
  color: #e7def6;
}
#status:empty { display: none; }
#status.error { border-color: #714151; background: #46212d; color: var(--danger); }
.empty-cells { empty-cells: hide; }

dialog {
  width: min(580px, calc(100% - 32px));
  padding: 28px;
  border: 1px solid #514866;
  border-radius: 15px;
  background: var(--panel);
  color: var(--text);
}
dialog::backdrop { background: #000b; }

.site-footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 40px 38px;
  border-top: 1px solid #30303c;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.site-footer .brand { justify-content: center; }
.site-footer .brand img { width: 36px; height: 36px; }
.site-footer p { margin: 6px auto 15px; font-size: 13px; }
.site-footer nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 18px; margin: 0 0 18px; }
.site-footer nav a { color: #bebdca; text-decoration: none; }
.site-footer small { display: block; margin-top: 8px; font-size: 11px; }

/* Discord server settings dashboard */
.label { color: #c2b8df; font-size: 11px; font-weight: 700; letter-spacing: 1.7px; }
.status { min-height: 1.6em; }
.error { color: var(--danger); }
.success { color: var(--good); }
.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 14px;
  padding: 0;
  list-style: none;
}
.server-card, .settings-card {
  overflow-wrap: anywhere;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #171925;
}
.server-card strong { display: block; margin-bottom: 5px; }
.server-card button { margin-top: 18px; }
.module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 12px; }
.settings-card { margin-bottom: 14px; }
.settings-card p { margin: 6px 0; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 8px 24px; }
.editor { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.editor label { display: block; font-weight: 650; }
.admin-area { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--line); }
.admin-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-output form { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.admin-output label { display: block; width: 100%; font-weight: 600; }
.admin-output input, .admin-output textarea, .admin-output select {
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin: 8px 0;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--bg);
  color: var(--text);
}
.admin-output textarea { min-height: 130px; }
.admin-output select[multiple] { min-height: 150px; }
.admin-output .danger { border-color: #925367; color: var(--danger); }

@media (max-width: 760px) {
  .site-header { min-height: auto; padding: 16px 20px; align-items: flex-start; flex-direction: column; gap: 14px; }
  .site-header nav { width: 100%; gap: 10px 18px; }
  main { padding: 0 20px 28px; }
  .hero { padding: 38px 0 18px; }
  #login-panel { grid-template-columns: 1fr; gap: 20px; }
  #login-form { padding: 20px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .panel { padding: 20px; }
  .tabs { position: static; }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer { padding: 26px 20px 32px; }
}
@media (max-width: 460px) {
  .brand { font-size: 16px; }
  .brand img { width: 42px; height: 42px; }
  .site-header nav { font-size: 12px; }
  .filter-grid { grid-template-columns: 1fr; }
}

/* Shared Guild Assistant polish */
:root {
  --accent: #c5b2ff;
  --accent-soft: #ded2ff;
  --good: #a9ddc2;
  --danger: #ffc6cc;
}
body {
  background:
    radial-gradient(ellipse at 86% -8%, #9c7bef16, transparent 38rem),
    radial-gradient(ellipse at 5% 32%, #7284c20b, transparent 32rem),
    var(--bg);
}
.site-header {
  border-bottom-color: #ffffff12;
}
.site-header nav a,
.back-link,
.tabs a,
.site-footer nav a {
  transition: color .16s ease, background-color .16s ease;
}
.panel {
  box-shadow: 0 14px 38px #00000012;
}
.server-card,
.settings-card,
.card {
  border-color: #ffffff16;
  background: linear-gradient(145deg, #1b1d2a, #171925 78%);
}
.server-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.server-card strong {
  font-size: 16px;
  line-height: 1.4;
}
.server-card .badge {
  margin-top: auto;
}
button,
.button,
summary,
input,
textarea,
select {
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}
button:active,
.button:active {
  transform: translateY(1px);
}
button:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: .58;
}
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  border-color: var(--accent-soft);
}
summary {
  padding: 2px 0;
}
summary:hover {
  color: var(--accent-soft);
}
.status {
  overflow-wrap: anywhere;
}
.admin-area {
  padding: 20px;
  border: 1px solid #ffffff18;
  border-radius: 12px;
  background: #11131c88;
}
.admin-area > h3 {
  margin-top: 0;
}
.admin-output article {
  border-color: #ffffff18;
}
.admin-output form > button {
  min-height: 44px;
}
.tabs {
  scrollbar-width: thin;
  scrollbar-color: #615777 transparent;
}
.notification-list-scroll {
  scrollbar-width: thin;
  scrollbar-color: #615777 transparent;
}
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 20;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: #171322;
  transform: translateY(-160%);
}
.skip-link:focus {
  transform: translateY(0);
}
@media (max-width: 760px) {
  .tabs {
    position: sticky;
    top: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }
  .tabs a {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .section-title {
    align-items: flex-start;
  }
  .inline-form {
    align-items: stretch;
  }
  .inline-form button {
    width: 100%;
  }
  .server-card {
    min-height: 132px;
  }
  .admin-area {
    padding: 16px;
  }
}
@media (max-width: 460px) {
  button,
  .button {
    min-height: 44px;
  }
  .panel {
    border-radius: 12px;
  }
  .site-header nav {
    align-items: center;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
