:root {
  --bg: #0f1116;
  --surface: #12151d;
  --panel: #161a24;
  --text: #eef1f7;
  --muted: #98a2b3;
  --accent: #72c458;
  --accent-strong: #5ea349;
  --accent-weak: rgba(114, 196, 88, 0.18);
  --border: #1e2431;
  --border-subtle: #161923;
  --code-bg: #0c0f15;
  --success: #5ce0a4;
  --warning: #f3b562;
  --danger: #f07178;
  --radius: 12px;
  --content-max: 880px;
}

/* Shared styles (public + staff) */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

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

a:hover {
  color: var(--accent-strong);
  background: rgba(90, 209, 255, 0.08);
  border-radius: 6px;
}

.layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  background: rgba(15, 17, 22, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-weight: 700;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
}

.logo::after {
  content: "";
  display: inline-block;
  width: 25px;
  height: 25px;
  margin-left: 4px;
  background: var(--accent);
  mask-image: url('/wiki/assets/img/book.svg');
  -webkit-mask-image: url('/wiki/assets/img/book.svg');
  mask-size: contain;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-position: center;
}

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

.content-grid {
  width: 100%;
  display: grid;
  gap: 28px;
  padding: 32px 24px 80px;
  max-width: 1400px;
  grid-template-columns: 240px minmax(0, var(--content-max)) 320px;
  margin: 0 auto;
}

@media (max-width: 1100px) {
  .content-grid {
    grid-template-columns: 1fr;
  }
  .toc-left,
  #sidebar {
    position: relative;
    top: auto;
    max-height: none;
  }
}

.hero {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(90, 209, 255, 0.12), rgba(22, 26, 36, 0.7));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 8px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 18px 0 10px;
}

p {
  margin: 0 0 12px;
  color: var(--text);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.card-grid + .card-grid {
  margin-top: 20px;
}

.card-row-2 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.card-full {
  grid-template-columns: 1fr;
}

.card {
  display: flex;
  flex-direction: column;
  height: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  word-break: break-word;
}

.card:hover {
  border-color: var(--accent);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.26);
}

.card-row-3 {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.card-row-4 {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.card-compact {
  padding: 14px;
  min-height: 120px;
  height: auto;
}

.card-mini {
  padding: 12px;
  min-height: 96px;
  font-size: 14px;
  line-height: 1.4;
  height: auto;
}

.inline-card-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-top: 16px;
}

.inline-card-row.row-reverse {
  flex-direction: row-reverse;
}

.inline-card-row .card {
  flex: 0 0 220px;
}

.inline-card-text {
  flex: 1 1 260px;
  margin: 0;
  color: var(--text);
}

.media-card img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: var(--border);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn.primary {
  background: var(--accent);
  color: #051019;
  border-color: transparent;
}

.btn.ghost {
  border: 1px solid var(--border);
  color: var(--text);
  background: transparent;
}

.btn.danger {
  border: 1px solid var(--danger);
  color: var(--danger);
  background: transparent;
}

.btn.danger:hover {
  background: rgba(240, 113, 120, 0.12);
}

.hero-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.callout {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 14px 16px;
  background: var(--panel);
}

.callout.tip {
  border-color: var(--success);
}

.callout.warn {
  border-color: var(--warning);
}

.callout.danger {
  border-color: var(--danger);
}

.callout + .callout {
  margin-top: 14px;
}

code,
pre {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

.code-inline {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
}

td,
th {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin: 12px 0;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--text);
  border: 1px solid var(--border);
}
.badge.success { border-color: var(--success); color: var(--success); }
.badge.warn { border-color: var(--warning); color: var(--warning); }
.badge.danger { border-color: var(--danger); color: var(--danger); }
.badge-row { display: flex; gap: 8px; margin: 8px 0; flex-wrap: wrap; }

.pill {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  background: var(--accent-weak);
  color: var(--text);
}
.pill-row { display: flex; gap: 8px; margin: 8px 0; flex-wrap: wrap; }

.steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0;
}
.step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-weight: 700;
}
.step-body h4 { margin: 0 0 4px; }
.step-body p { margin: 0; }

.tabs {
  display: inline-flex;
  gap: 6px;
  margin: 10px 0;
  border: 1px solid var(--border);
  padding: 4px;
  border-radius: 10px;
}
.tabs .tab {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.tabs .tab.active {
  background: var(--accent-weak);
  color: var(--text);
}

.quote {
  border-left: 3px solid var(--accent);
  padding-left: 12px;
  color: var(--muted);
  margin: 12px 0;
  font-style: italic;
}

.two-column {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin: 12px 0;
}

/* Inline text helpers */
.text-primary { color: var(--accent); }
.text-strong { font-weight: 700; }
.text-italic { font-style: italic; }
.text-underline { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.text-strike { text-decoration: line-through; color: var(--muted); opacity: 0.8; }
.hover-highlight { transition: background 0.15s ease, color 0.15s ease; padding: 2px 6px; border-radius: 6px; }
.hover-highlight:hover { color: var(--accent-strong); background: var(--accent-weak); }
.clickable { cursor: pointer; transition: transform 0.1s ease, background 0.15s ease; padding: 4px 8px; border-radius: 8px; background: var(--panel); border: 1px solid var(--border); display: inline-block; }
.clickable:active { transform: scale(0.97); background: var(--accent-weak); }
.text-magic {
  position: relative;
  background: linear-gradient(90deg, var(--accent), #8ee889, var(--accent));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 3s ease infinite;
}
/* Formatting demo chips */
.format-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px;
  margin: 4px 6px 4px 0;
  background: transparent;
  border: none;
  border-radius: 10px;
}
@keyframes shimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.toc-left {
  position: sticky;
  top: 90px;
  align-self: start;
}
.toc-left ul {
  list-style: none;
  padding-left: 0;
  margin: 10px 0 0;
}
.toc-left li {
  margin: 6px 0;
  position: relative;
  padding-left: 18px;
}
.toc-left li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 10px;
  height: 2px;
  background: var(--accent);
  border-radius: 999px;
}
.toc-left a {
  color: var(--muted);
  text-decoration: none;
}
.toc-left a:hover {
  color: var(--text);
}

#sidebar {
  position: sticky;
  top: 90px;
  max-height: none;
}

.active-link,
.nav-links a.active {
  color: var(--accent);
  font-weight: 600;
}

.breadcrumb {
  color: var(--muted);
  margin-bottom: 12px;
}

.page-footer {
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.page-footer .footer-line {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: center;
}

.page-footer .footer-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.page-footer .footer-meta .bolt {
  color: var(--accent);
}

.page-footer .footer-meta .bolt-icon {
  display: inline-block;
  width: 14px;
  height: 16px;
  background: var(--accent);
  mask-image: url('/wiki/assets/img/bolt.svg');
  -webkit-mask-image: url('/wiki/assets/img/bolt.svg');
  mask-size: contain;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-position: center;
  animation: bolt-pulse 2.4s ease-in-out infinite;
}

@keyframes bolt-pulse {
  0% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.5); opacity: 1; }
  100% { transform: scale(1); opacity: 0.9; }
}

.pager {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.pager-btn {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
}

.pager-btn:hover {
  border-color: var(--accent);
  background: rgba(90, 209, 255, 0.08);
}

.pager-btn .label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pager-btn .title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* Search bar */
.search {
  position: relative;
  min-width: 260px;
}

.search input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.search-suggestions {
  position: absolute;
  top: 110%;
  left: 0;
  right: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14);
  display: none;
  z-index: 20;
}

.search-suggestions .suggestion {
  display: block;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text);
  text-decoration: none;
}

.search-suggestions .suggestion:last-child {
  border-bottom: none;
}

.search-suggestions mark {
  background: var(--accent-weak);
  color: var(--accent-strong);
}

/* Sidebar */
#sidebar {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

.nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--muted);
}

.nav-section {
  margin-bottom: 10px;
}

.nav-section > button {
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 6px;
  cursor: pointer;
}

.nav-links {
  margin: 6px 0 0 10px;
}

.nav-links a {
  display: block;
  padding: 6px 4px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 8px;
}

.nav-links a:hover {
  background: var(--accent-weak);
  color: var(--text);
}

.nav-links a.active {
  background: var(--accent-weak);
  color: var(--text);
}

.nav-group {
  margin-top: 6px;
}

.nav-group-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-group-header a {
  flex: 1;
}

.nav-group-link {
  color: var(--text);
  font-weight: 600;
}

.nav-group-toggle {
  background: none;
  border: 1px solid transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 4px 6px;
  cursor: pointer;
}

.nav-group-toggle:hover {
  border-color: var(--border);
  color: var(--text);
}

.nav-group-links {
  margin: 6px 0 0 12px;
}

.content {
  max-width: var(--content-max);
}

.table-commands th:nth-child(1),
.table-commands td:nth-child(1) {
  width: 30%;
}

.table-perms th:nth-child(1) {
  width: 45%;
}

/* Staff-specific accent (staff-only body class) */
body.staff .site-header {
  border-bottom: 1px solid #3ea76f;
}

body.staff .logo::after {
  content: " STAFF";
  margin-left: 8px;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 8px;
  background: #3ea76f22;
  color: #8ff0b3;
  border: 1px solid #3ea76f55;
}

/* Responsive tweaks */
@media (max-width: 720px) {
  .hero-actions {
    flex-direction: column;
  }
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .search {
    width: 100%;
  }
}

/* Auth layout */
.auth-shell {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

.auth-card {
  width: 100%;
  max-width: 480px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.35);
}

.auth-header h1 {
  margin: 0 0 6px;
}

.auth-header p {
  margin: 0 0 16px;
  color: var(--muted);
}

.auth-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.input,
input[type="text"],
input[type="email"],
input[type="password"],
select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.inline-form,
.btn-row {
  display: inline-block;
  margin-right: 6px;
}

.inline-code {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 8px;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  color: var(--text);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[name="id"] {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.auth-form .remember {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.auth-footer {
  margin-top: 16px;
  text-align: right;
}

.auth-footer a {
  color: var(--accent);
  text-decoration: none;
}

.auth-footer a:hover {
  color: var(--accent-strong);
}

.page-logo{
  display:block;
  max-width: 520px;   /* adjust as you want */
  width: 100%;
  height: auto;
  margin: 0 auto 14px auto; /* space before the H1 */
}
