:root {
  --bg-primary: #313338;
  --bg-secondary: #2b2d31;
  --bg-tertiary: #1e1f22;
  --bg-modifier: #35373c;
  --bg-hover: #3f4147;
  --text-normal: #dbdee1;
  --text-muted: #b5bac1;
  --text-link: #00a8fc;
  --text-heading: #ffffff;
  --accent: #5865f2;
  --accent-hover: #4752c4;
  --accent-soft-bg: rgba(88, 101, 242, 0.2);
  --accent-soft-border: rgba(88, 101, 242, 0.45);
  --accent-soft-text: #c9cdfb;
  --border: #3f4147;
  --radius: 8px;
  --radius-lg: 12px;
  --font: "gg sans", "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  --danger: #ed4245;
  --warning: #faa61a;
  --success: #57f287;
  --token-bg: #313338;
  --discord-msg-bg: #313338;
  --discord-msg-text: #dbdee1;
}

html[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f2f3f5;
  --bg-tertiary: #e3e5e8;
  --bg-modifier: #ebedef;
  --bg-hover: #dfe1e5;
  --text-normal: #2e3338;
  --text-muted: #5c5e66;
  --text-link: #006ce7;
  --text-heading: #060607;
  --accent: #5865f2;
  --accent-hover: #4752c4;
  --accent-soft-bg: rgba(88, 101, 242, 0.12);
  --accent-soft-border: rgba(88, 101, 242, 0.35);
  --accent-soft-text: #4752c4;
  --border: #d4d7dc;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --danger: #d83c3e;
  --warning: #c47d0a;
  --success: #1a9c4a;
  --token-bg: #c9ccd1;
  --discord-msg-bg: #ffffff;
  --discord-msg-text: #2e3338;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-tertiary);
  color: var(--text-normal);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), #eb459e, #57f287);
  width: 100%;
  flex-shrink: 0;
}

.wrapper {
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  flex: 1;
}

.wrapper.has-toc,
.wrapper.has-sidebar {
  max-width: 1120px;
}

.layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.layout-sidebar {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.toc,
.discord-panel {
  position: sticky;
  top: 2rem;
  align-self: start;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.toc {
  padding: 1rem 0.85rem;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
}

.discord-panel {
  padding: 1rem;
}

.toc-title,
.discord-panel-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.toc-title {
  padding: 0 0.4rem;
}

.discord-panel-title {
  padding: 0 0.25rem;
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.toc-list li {
  margin: 0;
}

.toc-link {
  display: block;
  padding: 0.4rem 0.6rem;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 6px;
  border-left: 2px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.toc-link:hover {
  background: var(--bg-modifier);
  color: var(--text-heading);
  text-decoration: none;
}

.toc-link.active {
  background: var(--bg-modifier);
  color: var(--text-heading);
  border-left-color: var(--accent);
}

.discord-widget {
  display: flex;
  justify-content: center;
}

.discord-widget iframe {
  width: 100%;
  height: 420px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-modifier);
  display: block;
}

header {
  position: relative;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

header h1 {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

header h1 a {
  color: inherit;
  text-decoration: none;
}

header h1 a:hover {
  color: var(--accent);
}

header > p:first-of-type {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

header .lang {
  font-size: 0.875rem;
  color: var(--text-muted);
}

header .lang a {
  color: var(--text-link);
  text-decoration: none;
  margin-left: 0.25rem;
}

header .lang a:hover {
  text-decoration: underline;
}

.theme-toggle,
.lang-toggle {
  position: absolute;
  top: 1.25rem;
  appearance: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-modifier);
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  z-index: 5;
}

.theme-toggle {
  right: 1.25rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
}

.lang-toggle {
  right: 4.5rem;
  min-width: 36px;
  height: 36px;
  padding: 0 0.5rem;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.theme-toggle:hover,
.lang-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-heading);
  border-color: var(--accent);
}

.theme-toggle:active,
.lang-toggle:active {
  transform: scale(0.94);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  display: none;
}

html:not([data-theme="light"]) .theme-toggle .icon-sun {
  display: inline;
}

html[data-theme="light"] .theme-toggle .icon-moon {
  display: inline;
}

main {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

main h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-heading);
  margin: 1.75rem 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 1.5rem;
}

main h2:first-child {
  margin-top: 0;
}

h2 .anchor,
h3 .anchor {
  color: inherit;
  text-decoration: none;
  display: inline;
}

h2 .anchor:hover,
h3 .anchor:hover {
  color: inherit;
  text-decoration: none;
}

h2 .anchor-icon,
h3 .anchor-icon {
  color: var(--text-muted);
  margin-right: 0.5rem;
  cursor: pointer;
  transition: color 0.15s ease;
}

h2 .anchor-icon:hover,
h3 .anchor-icon:hover {
  color: var(--accent);
}

main p {
  margin-bottom: 0.85rem;
  color: var(--text-normal);
  font-size: 0.95rem;
}

main ul,
main ol {
  margin: 0.5rem 0 1rem 1.25rem;
  color: var(--text-normal);
}

main li {
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

main a {
  color: var(--text-link);
  text-decoration: none;
  transition: color 0.15s ease;
}

main a:hover {
  text-decoration: underline;
  color: var(--accent-hover);
}

.links-list {
  list-style: none;
  margin-left: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.links-list li {
  margin: 0;
}

.links-list a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-modifier);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  color: var(--text-normal);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.links-list a:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  text-decoration: none;
  color: var(--text-heading);
}

.links-list a::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1rem 0 0.5rem;
}

.feature-card {
  background: var(--bg-modifier);
  padding: 1.25rem 1rem;
  border-radius: var(--radius);
  text-align: center;
  border: 1px solid var(--border);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.feature-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.feature-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
}

.feature-card h3 {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  color: var(--text-heading);
}

.feature-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

.floating-invite {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--accent);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(88, 101, 242, 0.4);
  transition: transform 0.2s ease, background 0.2s ease;
  z-index: 100;
}

.floating-invite:hover {
  transform: scale(1.05);
  background: var(--accent-hover);
}

footer {
  max-width: 860px;
  width: 100%;
  margin: 1.5rem auto 0;
  padding: 1.25rem 1.25rem 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

footer p {
  margin-bottom: 0.35rem;
}

footer a {
  color: var(--text-link);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

::selection {
  background: var(--accent);
  color: #fff;
}

.page-category {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  padding: 0.25rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", monospace;
  color: var(--accent-soft-text);
  background: var(--accent-soft-bg);
  border: 1px solid var(--accent-soft-border);
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.page-category:hover {
  background: var(--accent-soft-bg);
  color: var(--text-heading);
  border-color: var(--accent);
  text-decoration: none;
}

.page-category:active {
  transform: translateY(1px);
}

.nav-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.nav-buttons.mt {
  margin-top: 1.25rem;
  margin-bottom: 0;
}

.back-button {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  background: var(--bg-modifier);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.back-button:hover {
  background: var(--bg-hover);
  color: var(--text-heading);
  border-color: var(--accent);
  text-decoration: none;
}

.back-button.mt {
  margin-top: 1.25rem;
}

.breadcrumb {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.variables-search {
  margin: 1rem 0 0.75rem;
}

.variables-search input {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-normal);
  font: inherit;
  font-size: 0.9rem;
  padding: 0.6rem 0.9rem;
  transition: border-color 0.15s ease;
}

.variables-search input:focus {
  outline: none;
  border-color: var(--accent);
}

.variables-search input::placeholder {
  color: var(--text-muted);
}

.variables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  margin: 1rem 0;
}

.variable-card {
  background: var(--bg-modifier);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  transition: border-color 0.15s ease;
}

.variable-card:hover {
  border-color: var(--accent);
}

.variable-card[hidden] {
  display: none;
}

.variable-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.variable-card code {
  display: inline-block;
  background: var(--bg-tertiary);
  color: var(--text-heading);
  padding: 0.2rem 0.45rem;
  border-radius: 5px;
  font-size: 0.9rem;
}

.variable-card p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 0;
}

.variable-card p.variable-example {
  font-size: 0.76rem;
  color: var(--text-muted);
  opacity: 0.8;
  margin-top: 0.45rem;
  font-style: italic;
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", monospace;
  line-height: 1.4;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.copy-button {
  appearance: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: transparent;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  flex-shrink: 0;
}

.copy-button:hover {
  background: var(--bg-hover);
  color: var(--text-heading);
  border-color: var(--accent);
}

.copy-button:active {
  transform: translateY(1px);
}

.copy-button.copied {
  color: var(--success);
  border-color: var(--success);
  background: transparent;
}

.variables-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 1.5rem 1rem;
  background: var(--bg-modifier);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  margin: 1rem 0;
}

.variables-empty[hidden] {
  display: none;
}

.example {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
}

.example pre {
  color: var(--text-normal);
  font: inherit;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.notice {
  background: var(--bg-modifier);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem;
  margin-top: 1rem;
}

.notice p:last-child {
  margin-bottom: 0;
}

.back-link {
  display: inline-block;
  margin-top: 1.25rem;
}

.preview-section {
  margin-top: 1.5rem;
}

.preview-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.preview-controls-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.preview-controls label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-heading);
}

.reset-button {
  appearance: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-modifier);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.reset-button:hover {
  background: var(--bg-hover);
  color: var(--text-heading);
  border-color: var(--accent);
}

.reset-button:active {
  transform: translateY(1px);
}

.preview-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.char-counter {
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color 0.15s ease;
}

.char-counter.warn {
  color: var(--warning);
}

.char-counter.danger {
  color: var(--danger);
}

.editor-wrap {
  position: relative;
}

.editor-highlight {
  position: absolute;
  inset: 0;
  padding: 0.85rem 1rem;
  font-family: var(--font);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-normal);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  pointer-events: none;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s ease;
  z-index: 0;
}

.editor-highlight .var-token {
  background: var(--token-bg);
  color: var(--text-heading);
  border-radius: 3px;
  box-shadow: 0 0 0 2px var(--token-bg);
}

.editor-wrap:focus-within .editor-highlight {
  border-color: var(--accent);
}

.preview-controls .editor-wrap textarea {
  position: relative;
  width: 100%;
  min-height: 110px;
  resize: none;
  overflow: hidden;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: transparent;
  caret-color: var(--text-normal);
  font: inherit;
  font-size: 0.9rem;
  padding: 0.85rem 1rem;
  line-height: 1.5;
  z-index: 1;
}

.preview-controls .editor-wrap textarea:focus {
  outline: none;
}

.preview-controls .editor-wrap textarea::selection {
  background: rgba(88, 101, 242, 0.45);
  color: transparent;
}

.preview-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0;
}

.discord-command {
  background: var(--accent-soft-bg);
  color: var(--accent-soft-text);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", monospace;
  font-size: 0.88rem;
  font-weight: 500;
}

.discord-message {
  background: var(--discord-msg-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  min-height: 140px;
  height: auto;
  transition: min-height 0.2s ease;
}

.discord-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  user-select: none;
  object-fit: cover;
  background: var(--accent);
}

.discord-body {
  flex: 1;
  min-width: 0;
}

.discord-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}

.discord-username {
  font-weight: 600;
  color: var(--text-heading);
  font-size: 0.95rem;
}

.discord-bot-tag {
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.discord-timestamp {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.discord-content {
  color: var(--discord-msg-text);
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.discord-content strong {
  font-weight: 700;
  color: var(--text-heading);
}

.discord-content em {
  font-style: italic;
}

.discord-content code {
  background: var(--bg-tertiary);
  color: var(--text-heading);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", monospace;
}

.discord-mention {
  background: var(--accent-soft-bg);
  color: var(--accent-soft-text);
  padding: 0.05rem 0.25rem;
  border-radius: 3px;
  font-weight: 500;
}

.var-autocomplete {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 50;
  max-height: 260px;
  overflow-y: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 0;
  padding: 0.4rem;
  list-style: none;
  display: none;
}

.var-autocomplete.open {
  display: block;
  animation: ac-fade 0.12s ease;
}

@keyframes ac-fade {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: translateY(0); }
}

.var-autocomplete-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.25rem 0;
  padding: 0.7rem 0.85rem;
  border-radius: 6px;
  border: 1px solid transparent;
  background: var(--bg-modifier);
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.1s ease;
}

.var-autocomplete-item:last-child {
  margin-bottom: 0;
}

.var-autocomplete-item.active {
  background: var(--accent);
  border-color: var(--accent-hover);
  transform: translateX(2px);
}

.var-autocomplete-item code {
  background: var(--bg-tertiary);
  color: var(--text-heading);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.82rem;
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", monospace;
  font-weight: 600;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.var-autocomplete-item.active code {
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
}

.var-autocomplete-item span {
  flex: 1;
  min-width: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s ease;
}

.var-autocomplete-item.active span {
  color: #fff;
}

.var-autocomplete-item .ac-copy {
  appearance: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: transparent;
  padding: 0.18rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
  margin-left: auto;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.var-autocomplete-item .ac-copy:hover {
  background: var(--bg-hover);
  color: var(--text-heading);
  border-color: var(--accent);
}

.var-autocomplete-item.active .ac-copy {
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.var-autocomplete-item.active .ac-copy:hover {
  background: rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 255, 255, 0.55);
}

.var-autocomplete-item .ac-copy.copied {
  color: var(--success);
  border-color: var(--success);
  background: transparent;
}

.var-autocomplete-empty {
  margin: 0;
  padding: 0.75rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

@media (max-width: 900px) {
  .layout,
  .layout-sidebar {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .toc {
    display: none;
  }

  .discord-panel {
    position: static;
    margin-bottom: 1.5rem;
  }

  .discord-widget iframe {
    height: 380px;
  }
}

@media (max-width: 600px) {
  .wrapper {
    padding: 1.25rem 0.85rem 2rem;
  }

  header,
  main {
    padding: 1.25rem 1rem;
  }

  header h1 {
    font-size: 1.5rem;
  }

  .theme-toggle {
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }

  .lang-toggle {
    top: 1rem;
    right: 3.5rem;
    height: 32px;
    min-width: 32px;
    padding: 0 0.4rem;
    font-size: 0.68rem;
  }

  main h2 {
    font-size: 1.1rem;
  }

  .features-grid {
    grid-template-columns: 1fr 1fr;
  }

  .floating-invite {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    bottom: 1rem;
    right: 1rem;
  }

  .variables-grid {
    grid-template-columns: 1fr;
  }

  .var-autocomplete-item {
    padding: 0.6rem 0.7rem;
    gap: 0.45rem;
  }

  .var-autocomplete-item span {
    display: none;
  }
}
/* Documentation shell — keeps the original article, legal and preview styles. */
.docs-top { position:sticky; top:0; z-index:30; display:flex; align-items:center; gap:24px; border-radius:0; margin:0; padding:12px 28px; background:var(--bg-secondary); border:0; border-bottom:1px solid var(--border); box-shadow:none; }
.docs-brand { display:flex; align-items:center; gap:10px; color:var(--text-heading); font-size:15px; text-decoration:none; white-space:nowrap; }
.docs-brand strong { font-size:18px; } .docs-brand img { object-fit:contain; }
.docs-brand-divider { width:1px; height:22px; background:var(--border); }
.docs-brand > span:last-child { color:var(--text-muted); }
.docs-search { position:relative; display:flex; align-items:center; gap:10px; margin:0 auto; width:min(100%,390px); padding:0 12px; border:1px solid var(--border); border-radius:var(--radius); background:var(--bg-tertiary); color:var(--text-muted); }
.docs-search input { width:100%; min-width:0; padding:10px 0; background:none; border:0; color:var(--text-normal); font:inherit; font-size:14px; outline:none; }
.docs-search:focus-within { outline:2px solid var(--accent); outline-offset:1px; }
.docs-search svg { flex:none; }
.docs-search-results { position:absolute; top:calc(100% + 8px); left:0; right:0; z-index:40; max-height:min(60vh,420px); overflow:auto; background:var(--bg-secondary); border:1px solid var(--border); border-radius:var(--radius-lg); box-shadow:var(--shadow); padding:6px; }
.docs-search-results[hidden], #docs-nav[hidden] { display:none; }
.docs-search-results a { display:flex; flex-direction:column; padding:10px; border-radius:6px; color:var(--text-normal); text-decoration:none; font-size:14px; }
.docs-search-results a:hover, .docs-search-results a:focus { background:var(--bg-hover); }
.docs-search-results small { color:var(--text-muted); } .docs-search-results p { padding:10px; font-size:14px; }
.docs-top-actions { display:flex; align-items:center; gap:14px; white-space:nowrap; }
.docs-top-link { color:var(--text-muted); text-decoration:none; font-size:14px; }
.docs-top-link:hover { color:var(--text-heading); }
.docs-top .theme-toggle, .docs-top .lang-toggle { position:static; width:38px; height:38px; min-width:38px; border-radius:8px; font-size:13px; }
.docs-shell { max-width:1530px; width:100%; display:grid; grid-template-columns:236px minmax(0,1fr); gap:28px; margin:0 auto; padding:30px 28px 54px; flex:1; align-items:start; }
.docs-sidebar { position:sticky; top:94px; min-width:0; max-height:calc(100dvh - 110px); overflow:auto; padding:0 8px 12px 0; }
.docs-nav-label { margin:18px 10px 7px; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.07em; color:var(--text-muted); }
.docs-nav-label:first-child { margin-top:0; }
.docs-nav-link { display:flex; align-items:center; gap:10px; padding:9px 10px; color:var(--text-muted); text-decoration:none; border-radius:7px; font-size:14px; line-height:1.4; border:1px solid transparent; }
.docs-nav-link svg { flex:0 0 18px; width:18px; height:18px; }
.docs-nav-link:hover { color:var(--text-heading); background:var(--bg-modifier); }
.docs-nav-link[aria-current=page] { color:var(--accent-soft-text); background:var(--accent-soft-bg); border-color:var(--accent-soft-border); font-weight:600; }
.docs-menu-button { display:none; }
.docs-content { min-width:0; max-width:1100px; width:100%; margin:0 auto; }
.has-page-toc .docs-content { display:grid; grid-template-columns:minmax(0,1fr) 210px; gap:24px; align-items:start; max-width:1200px; }
.docs-content main { min-width:0; background:transparent; border:0; box-shadow:none; padding:0 0 24px; overflow-wrap:anywhere; }
.docs-content main h2 { margin-top:32px; font-size:21px; }
.docs-content main h2[id], .docs-module { scroll-margin-top:100px; }
.docs-page-heading { padding:0 0 20px; margin-bottom:20px; border-bottom:1px solid var(--border); }
.docs-page-heading h1, .docs-hero h1 { font-size:clamp(28px,3.2vw,42px); line-height:1.2; color:var(--text-heading); letter-spacing:-.035em; margin:0 0 10px; }
.docs-page-heading .meta { margin:10px 0 0; color:var(--text-muted); }
.docs-page-toc { top:94px; border:0; background:transparent; border-left:1px solid var(--border); border-radius:0; box-shadow:none; padding:4px 0 10px 12px; max-height:calc(100dvh - 110px); }
.docs-hero { display:flex; align-items:center; gap:20px; justify-content:space-between; padding:28px; background:var(--bg-secondary); border:1px solid var(--border); border-radius:var(--radius-lg); }
.docs-hero img { flex:none; width:144px; height:144px; object-fit:contain; }
.docs-hero .docs-kicker { color:var(--accent-soft-text); font-size:11px; letter-spacing:.13em; font-weight:700; margin-bottom:12px; }
.docs-hero .docs-intro { color:var(--text-muted); max-width:560px; }
.docs-hero-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:22px; }
.docs-hero-actions a { padding:10px 16px; border-radius:8px; font-size:14px; font-weight:600; text-decoration:none; }
.docs-hero-actions .docs-primary { background:var(--accent); color:#fff; }
.docs-hero-actions .docs-secondary { background:var(--bg-modifier); border:1px solid var(--border); color:var(--text-normal); }
.docs-cards,.docs-module-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.docs-card { position:relative; display:flex; flex-direction:column; align-items:flex-start; gap:9px; padding:20px; border:1px solid var(--border); border-radius:var(--radius-lg); background:var(--bg-secondary); }
.docs-content main .docs-card { color:var(--text-heading); text-decoration:none; }
.docs-content main .docs-card:hover { border-color:var(--accent); background:var(--bg-modifier); }
.docs-card-icon { display:grid; place-items:center; width:40px; height:40px; border-radius:10px; background:var(--accent-soft-bg); border:1px solid var(--accent-soft-border); color:var(--accent-soft-text); }
.docs-card strong { font-size:16px; } .docs-card-desc { color:var(--text-muted); font-size:14px; line-height:1.5; }
.docs-card-arrow { position:absolute; top:24px; right:20px; color:var(--text-muted); }
.docs-module { padding:18px; border:1px solid var(--border); border-radius:var(--radius-lg); background:var(--bg-secondary); }
.docs-content main .docs-module h2 { margin:0 0 9px; border:0; padding:0; font-size:17px; } .docs-module p { margin:0; color:var(--text-muted); }
.docs-legal-links { display:flex; flex-wrap:wrap; gap:12px; }
.docs-content main .docs-legal-links a { display:inline-flex; align-items:center; gap:8px; background:var(--bg-secondary); border:1px solid var(--border); border-radius:8px; padding:10px 14px; color:var(--text-normal); font-size:14px; }
.docs-footer { padding:24px 16px; border-top:1px solid var(--border); background:var(--bg-secondary); text-align:center; }
.docs-footer nav { display:flex; flex-wrap:wrap; justify-content:center; gap:8px 16px; margin:8px 0; }
.docs-footer a { color:var(--text-muted); text-decoration:none; } .docs-footer a:hover { text-decoration:underline; }
.docs-skip { position:fixed; left:16px; top:-100px; background:var(--bg-primary); color:var(--text-heading); padding:10px; z-index:100; } .docs-skip:focus { top:12px; }
.docs-top a:focus-visible,.docs-sidebar a:focus-visible,.docs-card:focus-visible,.docs-menu-button:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
@media(max-width:1160px) { .has-page-toc .docs-content { grid-template-columns:minmax(0,1fr); } .docs-page-toc { display:none; } .docs-top-link { display:none; } }
@media(max-width:780px) { .docs-top { flex-wrap:wrap; gap:10px; padding:10px 16px; } .docs-top-actions { margin-left:auto; gap:8px; } .docs-search { order:3; width:100%; } .docs-shell { grid-template-columns:minmax(0,1fr); padding:18px 16px 36px; gap:18px; } .docs-sidebar { position:static; max-height:none; padding:0; } .docs-menu-button { display:flex; align-items:center; gap:8px; width:100%; padding:10px 12px; border:1px solid var(--border); border-radius:8px; background:var(--bg-secondary); color:var(--text-normal); font:inherit; cursor:pointer; } #docs-nav { padding:12px 0; } .docs-hero { padding:20px; } .docs-hero img { width:92px; height:92px; } .docs-content main h2[id], .docs-module { scroll-margin-top:145px; } }
@media(max-width:480px) { .docs-brand { gap:7px; } .docs-brand > span:last-child { font-size:12px; } .docs-cards,.docs-module-grid { grid-template-columns:minmax(0,1fr); } .docs-hero { align-items:flex-start; } .docs-hero img { display:none; } .docs-hero h1 { font-size:30px; } .docs-card { padding:16px; } }
.docs-footer { width:100%; max-width:none; margin:0; }

/* Module guides */
.docs-guide-nav { position:relative; margin:5px 0 10px; }
.docs-guide-nav > summary {
  display:flex; align-items:center; gap:8px; list-style:none;
  cursor:pointer; padding:9px 10px; color:var(--text-muted);
  font-size:14px; line-height:20px; font-weight:600; border-radius:7px;
}
.docs-guide-nav > summary::-webkit-details-marker { display:none; }
.docs-guide-nav > summary::marker { content:""; }
.docs-guide-nav > summary::before {
  content:""; width:7px; height:7px; flex:0 0 7px;
  border-inline-end:1.5px solid currentColor; border-bottom:1.5px solid currentColor;
  transform:rotate(-45deg); margin-inline:2px 3px;
  transition:transform .15s ease;
}
.docs-guide-nav[open] > summary::before { transform:rotate(45deg); }
.docs-guide-nav > summary:hover { color:var(--text-heading); background:var(--bg-modifier); }
.docs-guide-nav > summary:focus-visible { outline:2px solid var(--accent); outline-offset:-2px; }
.docs-guide-nav[open]::before {
  content:""; position:absolute; inset-block:42px 5px; inset-inline-start:15px;
  width:1px; background:var(--border); border-radius:1px; pointer-events:none;
}
.docs-guide-nav-label { margin:14px 10px 4px 28px; color:var(--text-muted); font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; }
.docs-guide-nav-link { margin-inline-start:24px; padding-inline-start:7px; font-size:13px; }
@media (prefers-reduced-motion:reduce) { .docs-guide-nav > summary::before { transition:none; } }
.docs-guide-nav-link svg { flex-basis:16px; width:16px; height:16px; }
.docs-content main .docs-module-link { display:flex; flex-direction:column; align-items:flex-start; gap:10px; color:var(--text-normal); text-decoration:none; transition:border-color .15s,background .15s; }
.docs-module-link:hover,.docs-module-link:focus-visible { border-color:var(--accent); background:var(--bg-modifier); }
.docs-content main .docs-module-link h3 { margin:0; color:var(--text-heading); font-size:17px; }
.docs-guide-link-label { margin-top:auto; padding-top:7px; color:var(--accent-soft-text); font-size:13px; font-weight:600; }
.docs-guide-breadcrumb { display:flex; flex-wrap:wrap; gap:8px; font-size:13px; color:var(--text-muted); margin-bottom:18px; }
.docs-guide-heading { display:flex; align-items:center; gap:12px; }
.docs-guide-heading svg { flex-shrink:0; width:30px; height:30px; color:var(--accent-soft-text); }
.docs-guide-heading h1 { margin:0; }
.docs-guide-toc,.docs-guide-note { padding:16px 20px; background:var(--bg-secondary); border:1px solid var(--border); border-radius:var(--radius-lg); margin:16px 0; }
.docs-guide-toc ul { margin:8px 0 0; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px 22px; padding-left:20px; }
.docs-guide-toc a { font-size:14px; }
.docs-guide-note p { margin:7px 0 0; color:var(--text-muted); font-size:14px; }
.docs-guide-section p { max-width:85ch; line-height:1.75; }
.docs-guide-actions { display:flex; flex-wrap:wrap; gap:10px; margin:28px 0 0; }
@media(max-width:600px) { .docs-guide-toc ul { grid-template-columns:minmax(0,1fr); } .docs-guide-toc,.docs-guide-note { padding:14px; } }

/* Native Ghosty module and platform icons */
.docs-platform-icon { display:inline-block; width:1em; height:1em; margin-inline-end:.45em; vertical-align:-.1em; flex-shrink:0; }
.docs-guide-section h2 .docs-platform-icon { color:var(--accent-soft-text); }
.docs-guide-toc .docs-platform-icon { width:14px; height:14px; }

/* Subtle, theme-aware documentation scrollbars. */
:root {
  --docs-scroll-thumb: #45484f;
  --docs-scroll-thumb-active: #6c7079;
}
html[data-theme="light"] {
  --docs-scroll-thumb: #b9bec7;
  --docs-scroll-thumb-active: #858c98;
}
.docs-sidebar, .docs-page-toc, .docs-search-results {
  scrollbar-width: thin;
  scrollbar-color: var(--docs-scroll-thumb) transparent;
}
.docs-sidebar:hover, .docs-sidebar:focus-within,
.docs-page-toc:hover, .docs-page-toc:focus-within,
.docs-search-results:hover, .docs-search-results:focus-within {
  scrollbar-color: var(--docs-scroll-thumb-active) transparent;
}
/* Fallback for browsers without the standardized scrollbar properties. */
@supports not (scrollbar-width: thin) {
  :is(.docs-sidebar, .docs-page-toc, .docs-search-results)::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }
  :is(.docs-sidebar, .docs-page-toc, .docs-search-results)::-webkit-scrollbar-track,
  :is(.docs-sidebar, .docs-page-toc, .docs-search-results)::-webkit-scrollbar-corner {
    background: transparent;
  }
  :is(.docs-sidebar, .docs-page-toc, .docs-search-results)::-webkit-scrollbar-thumb {
    background: var(--docs-scroll-thumb);
    border-radius: 999px;
  }
  :is(.docs-sidebar, .docs-page-toc, .docs-search-results)::-webkit-scrollbar-thumb:hover {
    background: var(--docs-scroll-thumb-active);
  }
  :is(.docs-sidebar, .docs-page-toc, .docs-search-results)::-webkit-scrollbar-button {
    display: none;
  }
}
@media (forced-colors: active) {
  .docs-sidebar, .docs-page-toc, .docs-search-results,
  .docs-sidebar:hover, .docs-sidebar:focus-within,
  .docs-page-toc:hover, .docs-page-toc:focus-within,
  .docs-search-results:hover, .docs-search-results:focus-within {
    scrollbar-color: auto;
    scrollbar-width: auto;
  }
}

/* Compact Ghosty platform navigation. Keep links visible at every viewport. */
.docs-top {
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr) auto auto;
  gap: 14px;
  padding: 10px 24px;
}
.docs-top .docs-search { width: 100%; max-width: 390px; min-width: 0; }
.docs-platform-links { display: flex; align-items: center; gap: 6px; }
.docs-top .docs-top-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-modifier);
  color: var(--text-normal);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.docs-top .docs-top-link > svg { width: 17px; height: 17px; flex: none; color: var(--accent-soft-text); }
.docs-top .docs-top-link > .docs-top-arrow { width: 12px; height: 12px; color: var(--text-muted); }
.docs-top .docs-top-link:hover { background: var(--bg-hover); border-color: var(--accent-soft-border); color: var(--text-heading); }
.docs-top-actions { gap: 6px; margin-left: 0; border-left: 1px solid var(--border); padding-left: 12px; }
.docs-top .lang-toggle, .docs-top .theme-toggle { width: 40px; height: 40px; min-width: 40px; }
.docs-top .theme-toggle svg { display: block; width: 19px; height: 19px; }
.docs-top button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 1040px) {
  .docs-top { grid-template-columns: minmax(0,1fr) auto; gap: 8px 16px; padding: 10px 20px; }
  .docs-top .docs-brand { grid-column: 1; grid-row: 1; }
  .docs-top-actions { grid-column: 2; grid-row: 1; justify-self: end; border: 0; padding: 0; }
  .docs-platform-links { grid-column: 2; grid-row: 2; justify-content: end; }
  .docs-top .docs-search { grid-column: 1; grid-row: 2; order: 0; max-width: none; margin: 0; }
  .docs-sidebar { top: 126px; max-height: calc(100dvh - 142px); }
  .docs-content main h2[id], .docs-module { scroll-margin-top: 130px; }
}
@media (max-width: 780px) {
  .docs-top { padding: 10px 14px; }
  .docs-sidebar { position: static; max-height: none; }
}
@media (max-width: 560px) {
  .docs-top { gap: 8px; }
  .docs-top .docs-brand { gap: 7px; min-width: 0; }
  .docs-brand img { width: 32px; height: 32px; flex: none; }
  .docs-brand strong { font-size: 16px; }
  .docs-brand > span:last-child { white-space: normal; overflow-wrap: normal; font-size: 12px; line-height: 1.2; }
  .docs-brand-divider { flex: none; }
  .docs-platform-links { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: 1fr 1fr; }
  .docs-top .docs-top-link { min-width: 0; min-height: 42px; padding: 7px 8px; font-size: 12px; gap: 6px; }
  .docs-top .docs-top-link > .docs-top-arrow { display: none; }
  .docs-top .docs-top-link > span { white-space: normal; }
  .docs-top .docs-search { grid-column: 1 / -1; grid-row: 3; }
  .docs-content main h2[id], .docs-module { scroll-margin-top: 178px; }
}
@media (prefers-reduced-motion: reduce) { .docs-top .docs-top-link { transition: none; } }

/* Slash-command references, shared by Ghosty Dashboard and Docs. */
:root {
  --command-mention-bg: rgba(88, 101, 242, .22);
  --command-mention-text: #a5b3ff;
}
html[data-theme="light"] {
  --command-mention-bg: rgba(88, 101, 242, .14);
  --command-mention-text: #414bb5;
}
/* Important only on the presentation of a recognised command: module-local
   code styles (e.g. Emoji Hub and Moderation) must not override this component. */
html body :is(.ghosty-command-mention, .discord-command):not(pre *, [contenteditable] *, .discord-preview *, .discord-content *) {
  display: inline;
  width: fit-content;
  max-width: 100%;
  min-height: 0;
  box-sizing: border-box;
  padding: 1px 4px !important;
  border: 0 !important;
  border-radius: 3px !important;
  background: var(--command-mention-bg) !important;
  color: var(--command-mention-text) !important;
  box-shadow: none !important;
  font-family: var(--font, inherit) !important;
  font-size: 1em !important;
  font-weight: 500 !important;
  line-height: inherit;
  letter-spacing: normal;
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: baseline;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  user-select: text;
}

/* Discord-style slash command hover: keep the inline layout unchanged. */
html body :is(.ghosty-command-mention, .discord-command):not(pre *, [contenteditable] *, .discord-preview *, .discord-content *) {
  transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}
html body :is(.ghosty-command-mention, .discord-command):not(pre *, [contenteditable] *, .discord-preview *, .discord-content *):hover {
  background: #5865f2 !important;
  color: #fff !important;
  box-shadow: 0 0 8px rgba(88, 101, 242, .25) !important;
}
@media (prefers-reduced-motion: reduce) {
  html body :is(.ghosty-command-mention, .discord-command):not(pre *, [contenteditable] *, .discord-preview *, .discord-content *) { transition: none; }
}
