/* =========================================================================
   Hostaka Wiki — OpenClaw-inspired shell
   Loaded after theme.css / shared.css / the page CSS so it owns the shell.
   ========================================================================= */

/* ---------- OpenClaw tokens (dark is the default) ---------- */
:root,
html {
  --brand: #ff5c4d;
  --brand-2: #ff7a6b;
  --brand-soft: rgba(255, 92, 77, 0.1);
  --brand-border: rgba(255, 92, 77, 0.28);
  --primary: var(--brand);
  --primary-h: var(--brand-2);
  --primary-light: var(--brand-soft);
  --primary-border: var(--brand-border);
  --accent: var(--brand);

  --bg: #0a0a0b;
  --sidebar-bg: #0d0d0f;
  --panel: #121214;
  --panel-2: #17171a;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --muted-2: #71717a;
  --topbar-bg: rgba(10, 10, 11, 0.86);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #f87171;
  --page-glow: rgba(255, 92, 77, 0.12);

  /* Wiki design-system aliases */
  --card: var(--panel);
  --border: var(--line);
  --modal-bg: var(--panel);
  --input-bg: var(--panel-2);
  --post-bg: var(--panel);
  --surface-elevated: var(--panel-2);
  --avatar-gradient: linear-gradient(145deg, #ff5c4d, #ff7a6b);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 999px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);

  --font-family: "Inter", "Noto Sans Arabic", "Ubuntu", sans-serif;
  --font: var(--font-family);
  --topbar-h: 64px;
  --sidebar-w: 248px;
}

html[data-theme="light"] {
  --brand: #e5483f;
  --brand-2: #ff7a6b;
  --brand-soft: rgba(229, 72, 63, 0.08);
  --brand-border: rgba(229, 72, 63, 0.24);
  --primary-h: #c93a32;

  --bg: #f7f7f8;
  --sidebar-bg: #fbfbfc;
  --panel: #ffffff;
  --panel-2: #f4f4f5;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.14);
  --text: #18181b;
  --muted: #52525b;
  --muted-2: #71717a;
  --topbar-bg: rgba(247, 247, 248, 0.86);
  --success: #16a34a;
  --danger: #dc2626;
  --page-glow: rgba(229, 72, 63, 0.06);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
  --avatar-gradient: linear-gradient(145deg, #e5483f, #ff7a6b);
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(1000px 600px at 82% -12%, var(--page-glow), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  display: block;
  flex: none;
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--topbar-h);
  padding: 0 24px;
  background: var(--topbar-bg);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  width: var(--sidebar-w);
  flex: none;
  color: var(--text);
  text-decoration: none;
}

.brand img {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: block;
}

.brand-name {
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-tag {
  color: var(--muted-2);
  font-size: 0.76rem;
  font-weight: 500;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 420px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--muted-2);
}

.search-box .icon {
  width: 16px;
  height: 16px;
}

.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.84rem;
}

.search-box input::placeholder {
  color: var(--muted-2);
}

.search-box kbd {
  flex: none;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel-2);
  color: var(--muted-2);
  font-family: inherit;
  font-size: 0.66rem;
  line-height: 1.3;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: none;
  margin-inline-start: auto;
}

.topbar-nav a,
.topbar-nav .nav-link {
  border: 0;
  padding: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.topbar-nav a:hover,
.topbar-nav .nav-link:hover,
.topbar-nav a.active,
.topbar-nav .nav-link.active {
  color: var(--text);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  transition:
    color var(--transition-fast, 0.15s ease),
    border-color var(--transition-fast, 0.15s ease),
    background var(--transition-fast, 0.15s ease);
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--panel-2);
}

.icon-btn .icon {
  width: 17px;
  height: 17px;
}

.lang-btn {
  width: auto;
  padding: 0 10px;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
}

.lang-btn .icon {
  width: 15px;
  height: 15px;
}

.theme-icon-moon {
  display: none;
}

html[data-theme="dark"] .theme-icon-sun {
  display: none;
}

html[data-theme="dark"] .theme-icon-moon {
  display: block;
}

.sidebar-toggle {
  display: none;
}

/* ---------- Topbar extras (wiki) ---------- */
.page-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.back-link {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  color: var(--muted);
  text-decoration: none;
  transition:
    color var(--transition-fast, 0.15s ease),
    border-color var(--transition-fast, 0.15s ease),
    background var(--transition-fast, 0.15s ease);
}

.back-link:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--panel-2);
}

.back-link .icon {
  width: 17px;
  height: 17px;
}

html[dir="rtl"] .back-link .icon {
  transform: scaleX(-1);
}

.page-title {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

body.page-wiki-topic #topbarTitle {
  direction: ltr;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--brand-border);
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background var(--transition-fast, 0.15s ease),
    border-color var(--transition-fast, 0.15s ease),
    transform var(--transition-fast, 0.15s ease);
}

.btn-primary:hover {
  background: var(--brand-2);
  border-color: var(--brand-2);
  transform: translateY(-1px);
}

.btn-primary .icon {
  width: 15px;
  height: 15px;
}

/* ---------- Language menu ---------- */
.lang-selector {
  position: relative;
  display: flex;
  align-items: center;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  z-index: 60;
  min-width: 140px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top;
  transition:
    opacity 0.16s ease,
    transform 0.16s ease,
    visibility 0.16s;
}

.lang-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.lang-menu button {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  text-align: start;
  cursor: pointer;
}

.lang-menu button:hover {
  color: var(--text);
  background: var(--panel-2);
}

/* ---------- Account area ---------- */
#authArea {
  display: flex;
  align-items: center;
}

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

.acc-avatar,
.acc-avatar-fallback {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  border-radius: 50%;
  background: var(--avatar-gradient);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  object-fit: cover;
}

.acc-name {
  max-width: 120px;
  overflow: hidden;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ---------- App body / sidebar ---------- */
.app-body {
  display: flex;
  align-items: flex-start;
  min-height: calc(100vh - var(--topbar-h));
}

.sidebar {
  position: sticky;
  top: var(--topbar-h);
  width: var(--sidebar-w);
  flex: none;
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 20px 12px;
  border-inline-end: 1px solid var(--line);
  background: var(--sidebar-bg);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-group {
  margin: 16px 10px 6px;
  color: var(--muted-2);
  font-size: 0.72rem;
  font-weight: 600;
}

.sidebar-group:first-child {
  margin-top: 0;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}

.sidebar-item:hover {
  color: var(--text);
  background: rgba(127, 127, 127, 0.08);
}

.sidebar-item.active {
  color: var(--text);
  background: rgba(127, 127, 127, 0.1);
  border-color: var(--line);
}

.sidebar-item.active .sidebar-icon {
  color: var(--brand);
}

.sidebar-icon {
  width: 18px;
  height: 18px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-2);
}

.sidebar-icon .icon {
  width: 17px;
  height: 17px;
}

.sidebar-badge {
  margin-inline-start: auto;
  padding: 1px 6px;
  border: 1px solid var(--brand-border);
  border-radius: 999px;
  color: var(--brand);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  padding: 12px 10px 0;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 0.74rem;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1);
}

.sidebar-overlay {
  display: none;
}

/* ---------- Content ---------- */
.content {
  flex: 1;
  min-width: 0;
  max-width: 980px;
  margin: 0 auto;
  padding: 36px 40px 80px;
}

/* ---------- Wiki page wrappers ---------- */
body.page-wiki-browse .wiki-wrap,
body.page-wiki-post .wiki-wrap,
body.page-wiki-topic .wiki-wrap,
body.page-wiki-new .new-wrap {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 0 40px;
}

body.page-wiki-browse .wiki-wrap,
body.page-wiki-post .wiki-wrap {
  max-width: 760px;
}

body.page-wiki-topic .wiki-wrap {
  max-width: 820px;
}

body.page-wiki-new .new-wrap {
  max-width: 720px;
}

/* ---------- Headings ---------- */
body.page-wiki-browse .page-heading,
body.page-wiki-new .page-heading {
  margin: 0 0 10px;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

body.page-wiki-browse .page-sub {
  max-width: 640px;
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ---------- Browse cards ---------- */
body.page-wiki-browse .ext-card {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  margin-bottom: 10px;
  transition:
    border-color var(--transition-fast, 0.15s ease),
    background var(--transition-fast, 0.15s ease),
    transform var(--transition-fast, 0.15s ease),
    box-shadow var(--transition-fast, 0.15s ease);
}

body.page-wiki-browse .ext-card:hover {
  border-color: var(--brand-border);
  background: var(--panel-2);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

body.page-wiki-browse .ext-name {
  font-size: 0.92rem;
  font-weight: 600;
}

body.page-wiki-browse .ext-meta {
  color: var(--muted-2);
  font-size: 0.78rem;
}

body.page-wiki-browse .ext-arrow {
  color: var(--muted-2);
}

body.page-wiki-browse .ext-card:hover .ext-arrow {
  color: var(--brand);
}

html[dir="rtl"] body.page-wiki-browse .ext-arrow {
  transform: scaleX(-1);
}

/* ---------- Topic cards ---------- */
body.page-wiki-topic .topic-head {
  margin-bottom: 20px;
}

body.page-wiki-topic .topic-name {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

body.page-wiki-topic .topic-count {
  color: var(--muted-2);
}

body.page-wiki-topic .post-card {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  margin-bottom: 12px;
  transition:
    border-color var(--transition-fast, 0.15s ease),
    background var(--transition-fast, 0.15s ease),
    transform var(--transition-fast, 0.15s ease),
    box-shadow var(--transition-fast, 0.15s ease);
}

body.page-wiki-topic .post-card:hover {
  border-color: var(--brand-border);
  background: var(--panel-2);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

body.page-wiki-topic .post-title {
  font-size: 0.98rem;
  font-weight: 600;
}

body.page-wiki-topic .post-preview {
  color: var(--muted);
}

body.page-wiki-topic .post-author-name {
  font-weight: 600;
}

body.page-wiki-topic .btn-write {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--brand-border);
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  font-size: 0.82rem;
}

body.page-wiki-topic .btn-write:hover {
  background: var(--brand-2);
}

/* ---------- Post page ---------- */
body.page-wiki-post .post-box {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  margin-bottom: 22px;
}

body.page-wiki-post .post-author-name {
  font-weight: 600;
}

body.page-wiki-post .post-title {
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.4;
}

body.page-wiki-post .post-body {
  line-height: 1.85;
}

body.page-wiki-post .reply-item {
  border-right: 0;
  border-left: 0;
  border-inline-start: 2px solid var(--line);
  padding-right: 0;
  padding-left: 0;
  padding-inline-start: 14px;
}

body.page-wiki-post .post-date,
body.page-wiki-topic .post-date {
  margin-right: 0;
  margin-left: 0;
  margin-inline-start: auto;
}

body.page-wiki-post .reply-form {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

body.page-wiki-post .post-actions button,
body.page-wiki-post .reply-image-btn {
  min-height: 30px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-2);
  color: var(--muted);
  font-weight: 500;
}

body.page-wiki-post .post-actions button:hover,
body.page-wiki-post .reply-image-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

body.page-wiki-post .reply-submit-btn,
body.page-wiki-post .edit-form-actions .save-btn,
body.page-wiki-new .submit-btn,
body.page-wiki-new .gate-btn,
body.page-wiki-new .success-btn {
  border: 1px solid var(--brand-border);
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
}

body.page-wiki-post .reply-submit-btn:hover,
body.page-wiki-post .edit-form-actions .save-btn:hover,
body.page-wiki-new .submit-btn:hover:not(:disabled),
body.page-wiki-new .gate-btn:hover,
body.page-wiki-new .success-btn:hover {
  background: var(--brand-2);
}

body.page-wiki-post .edit-form-actions .cancel-btn {
  border: 1px solid var(--line) !important;
  border-radius: 9px;
  background: var(--panel-2);
  color: var(--text);
}

body.page-wiki-post .lightbox-close {
  right: auto;
  inset-inline-end: 18px;
}

/* ---------- New-post form ---------- */
body.page-wiki-new .field label {
  font-weight: 600;
}

body.page-wiki-new .field input[type="text"],
body.page-wiki-new .field textarea,
body.page-wiki-post .edit-form textarea,
body.page-wiki-post .edit-form input[type="text"],
body.page-wiki-post .reply-form textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  font-family: var(--font-family);
}

body.page-wiki-new .field input[type="text"]:focus,
body.page-wiki-new .field textarea:focus,
body.page-wiki-post .edit-form textarea:focus,
body.page-wiki-post .edit-form input[type="text"]:focus,
body.page-wiki-post .reply-form textarea:focus {
  outline: none;
  border-color: var(--brand-border);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

body.page-wiki-new .upload-btn {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-2);
  color: var(--text);
  font-weight: 600;
}

body.page-wiki-new .upload-btn:hover {
  border-color: var(--brand-border);
  color: var(--brand);
}

body.page-wiki-new .image-preview {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
}

body.page-wiki-new .submit-btn {
  min-height: 44px;
  padding: 12px 18px;
  font-size: 0.9rem;
}

body.page-wiki-new .gate-box svg,
body.page-wiki-new .success-box svg {
  color: var(--brand);
}

body.page-wiki-new .gate-box-title,
body.page-wiki-new .success-box-title {
  font-weight: 600;
}

body.page-wiki-new .gate-btn,
body.page-wiki-new .success-btn {
  min-height: 40px;
  padding: 0 18px;
  font-size: 0.86rem;
}

/* ---------- Small details ---------- */
body.page-wiki-browse .empty-state-title,
body.page-wiki-topic .empty-state-title {
  font-weight: 600;
}

body.page-wiki-post .admin-badge,
body.page-wiki-topic .admin-badge {
  font-weight: 600;
}

body.page-wiki-browse .toast,
body.page-wiki-new .toast,
body.page-wiki-post .toast,
body.page-wiki-topic .toast {
  font-weight: 600;
}

body.page-wiki-post .breadcrumb a,
body.page-wiki-post .login-hint a {
  color: var(--brand);
}

/* ---------- Safe areas ---------- */
@supports (padding: max(0px)) {
  .topbar {
    padding-top: max(0px, env(safe-area-inset-top));
  }
}

/* ---------- Responsive shell ---------- */
@media (max-width: 1100px) {
  .topbar-nav {
    display: none;
  }
}

@media (max-width: 900px) {
  .topbar {
    height: auto;
    min-height: var(--topbar-h);
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 10px;
  }

  @supports (padding: max(0px)) {
    .topbar {
      padding-top: calc(10px + env(safe-area-inset-top));
    }
  }

  .sidebar-toggle {
    display: inline-flex;
  }

  .brand {
    width: auto;
    flex: 1;
  }

  body.page-wiki-new .brand,
  body.page-wiki-post .brand,
  body.page-wiki-topic .brand {
    flex: none;
  }

  .brand-tag {
    display: none;
  }

  .search-box {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }

  .page-title-wrap {
    flex: 1;
  }

  .topbar-nav {
    display: none;
  }

  .app-body {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 0;
    inset-inline-start: 0;
    z-index: 60;
    width: min(300px, 86vw);
    height: 100vh;
    border-inline-end: 1px solid var(--line);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  html[dir="rtl"] .sidebar {
    transform: translateX(100%);
  }

  .sidebar.open,
  html[dir="rtl"] .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .sidebar-overlay.show {
    opacity: 1;
    pointer-events: auto;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  .content {
    padding: 24px 16px 60px;
  }

  .acc-name {
    display: none;
  }
}

@media (max-width: 560px) {
  body.page-wiki-browse .page-heading,
  body.page-wiki-new .page-heading {
    font-size: 1.8rem;
  }

  .topbar-cta span {
    display: none;
  }

  .topbar-cta {
    width: 36px;
    padding: 0;
  }

  /* The page title + back link matter more than the wordmark on small screens. */
  body.page-wiki-new .brand,
  body.page-wiki-post .brand,
  body.page-wiki-topic .brand {
    display: none;
  }
}

@media (max-width: 380px) {
  .brand-name {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
