﻿:root {
  --bg: #181a1f;
  --bg-2: #1f2229;
  --bg-3: #262a33;
  --line: #343944;
  --line-2: #3f4552;
  --ink: #edf1f6;
  --muted: #a8b0bd;
  --accent: #5f7dff;
  --accent-2: #4a65d1;
  --ok: #3ba55d;
  --warn: #faa81a;
  --danger: #da373c;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Noto Sans", "Segoe UI", Tahoma, sans-serif;
  color: var(--ink);
  background: var(--bg);
  position: relative;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 120px 120px, 48px 48px;
  opacity: 0.35;
}

body::after {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(95, 125, 255, 0.08) 0,
      rgba(95, 125, 255, 0.08) 2px,
      transparent 2px,
      transparent 22px
    );
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.24), transparent 55%);
}

.backdrop {
  display: none;
}

.shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

h1,
h2,
h3 {
  margin: 0;
}

.hero {
  margin: 0;
  padding: 12px 18px;
  border-bottom: 1px solid #404756;
  background: #303744;
  display: grid;
  gap: 4px;
}

.eyebrow {
  margin: 0 0 8px;
  font-family: "JetBrains Mono", Consolas, monospace;
  color: #93a5ff;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 12px;
}

.hero h1 {
  font-size: clamp(21px, 3vw, 30px);
  line-height: 1.12;
}

.lede {
  margin: 2px 0 0;
  max-width: none;
  color: #c4ccd8;
  font-size: 13px;
}

.layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  min-height: calc(100vh - 130px);
}

.panel,
.subpanel {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow: none;
}

.panel {
  padding: 14px;
}

.auth-panel {
  margin: 0;
  border: 0;
  border-bottom: 1px solid #38404f;
  border-radius: 0;
  background: #2a313d;
  padding: 10px 18px;
}

.guild-list-panel {
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: #252c37;
  min-height: calc(100vh - 130px);
}

.details-panel {
  border: 0;
  border-radius: 0;
  background: #202631;
}

.auth-row,
.inline-form,
.panel-head,
.subpanel-head,
.toggle-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.panel-head,
.subpanel-head {
  justify-content: space-between;
  margin-bottom: 10px;
}

.auth-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.auth-row {
  justify-content: space-between;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  background: var(--bg-3);
  color: var(--ink);
  padding: 9px 10px;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(95, 125, 255, 0.45);
}

button,
.button-link {
  border: 1px solid var(--accent-2);
  border-radius: 2px;
  background: #546fdf;
  color: #fff;
  padding: 9px 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

button:hover,
.button-link:hover {
  background: #637df3;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.danger-button {
  background: #bf3036;
  border-color: #aa2a2f;
}

.danger-button:hover {
  background: var(--danger);
}

.guild-list,
.stack-list {
  display: grid;
  gap: 8px;
}

.custom-term-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.custom-term-item .danger-button {
  min-width: 34px;
  padding: 6px 8px;
  line-height: 1;
}

#customTermsForm {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  width: 100%;
}

#customTermInput {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

#addCustomTermButton {
  flex: 0 0 auto;
  min-width: 42px;
  padding: 9px 10px;
}

.guild-list {
  max-height: calc(100vh - 210px);
  overflow: auto;
  padding-right: 2px;
}

.guild-card,
.stack-item,
.meta-item {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 10px;
  background: #2a313e;
}

.guild-card {
  text-align: left;
  color: var(--ink);
}

.guild-card:hover {
  border-color: #69758a;
  background: #333c4b;
}

.guild-card.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(95, 125, 255, 0.65);
}

.guild-card.bot-present {
  border-left: 4px solid #5f7dff;
}

.guild-card.bot-missing {
  border-left: 4px solid #7d8593;
}

.guild-card p,
.stack-item p,
.meta-item p,
.hint {
  margin: 6px 0 0;
  color: var(--muted);
}

.guard-level-hint {
  font-size: 12px;
  line-height: 1.35;
}

#botPresencePanel {
  display: grid;
  gap: 8px;
}

#inviteBotButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
  margin-top: 2px;
}

#inviteBotButton.hidden {
  display: none;
}

.settings-form,
.subpanel {
  margin-top: 12px;
}

.subpanel {
  background: #242b36;
}

.settings-form {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 12px;
  background: #1d212a;
  display: grid;
  gap: 12px;
}

.settings-group {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #202530;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.settings-group-title {
  font-size: 14px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.module-nav {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
}

.module-tab {
  background: #232833;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  color: var(--muted);
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
}

.module-tab:last-child {
  border-right: 0;
}

.module-tab:hover {
  background: #2a3040;
  color: var(--ink);
}

.module-tab.active {
  background: #334064;
  color: #fff;
}

.module-tab[data-owner-only="true"] {
  margin-left: auto;
  border-left: 1px solid var(--line);
}

.module-panel {
  display: grid;
  gap: 12px;
  background: #212833;
  border: 1px solid var(--line);
  padding: 12px;
}

.module-placeholder {
  padding: 14px;
}

.module-placeholder h3 {
  margin-bottom: 8px;
}

.owner-inline-field {
  min-width: 220px;
}

.grid.two-up,
.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.grid.two-up {
  align-items: start;
}

.grid.two-up > label {
  align-content: start;
}

#moduleShell {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  color: var(--muted);
}

.toggle-row {
  border: 1px dashed var(--line-2);
  border-radius: 2px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.01);
}

.toggle-row label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-row input {
  width: auto;
}

.status-pill {
  padding: 5px 9px;
  border-radius: 2px;
  border: 1px solid var(--line);
  background: #232833;
  color: var(--muted);
  font-size: 12px;
}

.status-pill.ok {
  border-color: rgba(59, 165, 93, 0.55);
  color: var(--ok);
}

.status-pill.busy {
  border-color: rgba(250, 168, 26, 0.55);
  color: var(--warn);
}

.status-pill.offline {
  border-color: rgba(218, 55, 60, 0.7);
  color: #ffb0b4;
}

.hamburger-btn {
  background: #252b37;
  border-color: var(--line);
  color: var(--ink);
  padding: 8px 11px;
  border-radius: 2px;
  font-size: 17px;
  line-height: 1;
}

.hamburger-btn:hover {
  background: #30394b;
}

.hamburger-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 7, 10, 0.7);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 62px 16px 16px;
}

.hamburger-overlay.hidden {
  display: none;
}

.hamburger-popup {
  background: #1f2430;
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow: none;
  padding: 14px;
  min-width: 320px;
  max-width: 500px;
}

.hamburger-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.hamburger-popup-head h3 {
  font-size: 14px;
}

.hamburger-close {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 2px;
  line-height: 1;
}

.hamburger-close:hover {
  color: var(--ink);
  background: #2a3040;
}

.hidden {
  display: none;
}

.empty-state {
  color: var(--muted);
}

.code {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
}

@media (max-width: 980px) {
  .hero,
  .auth-panel {
    padding-left: 12px;
    padding-right: 12px;
  }

  .layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .guild-list-panel {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .guild-list {
    max-height: 260px;
  }

  .grid.two-up,
  .meta-grid {
    grid-template-columns: 1fr;
  }

  .module-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .module-tab,
  .module-tab[data-owner-only="true"] {
    margin-left: 0;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }
}
