/* Modern Tribe CodeX layout */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

html {
  background-color: #e8e8e8;
}

body {
  font-family: 'Geist', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 18px;
  line-height: 1.6;
  color: #302f2f;
  background-color: #e8e8e8;
  margin: 0;
  padding: 0;
}

/* Design settings (per-user) */
body.mw-tech-font,
body.mw-tech-font .mw-brand-title {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
}

body.mw-dark {
  background-color: #192A1C;
  color: #ffffff;
}

body.mw-dark a {
  color: #ffffff;
}

body.mw-dark .mw-root,
html.mw-dark,
body.mw-dark .mw-header,
body.mw-dark #content.keys-page {
  background-color: #192A1C;
}

/* Make the whole app consistently dark (most surfaces were hardcoded to #e8e8e8) */
body.mw-dark main,
body.mw-dark #content,
body.mw-dark #bodyContent,
body.mw-dark .mw-body,
body.mw-dark .mw-body-content,
body.mw-dark .mw-content-ltr,
body.mw-dark .page-section,
body.mw-dark footer,
body.mw-dark #footer,
body.mw-dark #footer-places {
  background-color: #192A1C;
  color: #ffffff;
}

body.mw-dark .mw-nav a,
body.mw-dark .mw-brand,
body.mw-dark .mw-brand-title,
body.mw-dark .mw-link-ghost,
body.mw-dark .mw-dropdown-menu a {
  color: #ffffff;
}

body.mw-dark .mw-dropdown-menu a:hover {
  background: rgba(255, 255, 255, 0.08);
}

body.mw-dark .mw-badge,
body.mw-dark .mw-toggle {
  border-color: rgba(255, 255, 255, 0.20);
  background: rgba(255, 255, 255, 0.06);
}

body.mw-dark .mw-nav a:hover {
  border-color: rgba(255, 255, 255, 0.25);
}

body.mw-dark .mw-header {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

body.mw-dark .mw-nav a:hover,
body.mw-dark .mw-dropdown[open] .mw-dropdown-trigger,
body.mw-dark .mw-dropdown-trigger:hover {
  border-color: rgba(255, 255, 255, 0.25);
}

body.mw-dark .mw-admin-card,
body.mw-dark .mw-relationships-panel,
body.mw-dark .mw-graph {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
}

/* Admin dropdown must be readable (not transparent) */
body.mw-dark .mw-dropdown-menu {
  background-color: #192A1C;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

body.mw-dark input,
body.mw-dark textarea,
body.mw-dark select {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.22);
}

body.mw-dark input[type='search'] {
  color: #ffffff;
  background: rgba(0, 0, 0, 0.28);
  border-color: rgba(255, 255, 255, 0.22);
}

body.mw-dark input::placeholder,
body.mw-dark textarea::placeholder {
  color: rgba(255, 255, 255, 0.70);
}

body.mw-dark input:focus,
body.mw-dark textarea:focus,
body.mw-dark select:focus {
  border-color: rgba(255, 255, 255, 0.65);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18);
}

/* Buttons in Dark Mode */
body.mw-dark .mw-button-primary {
  background-color: #000000;
  color: #ffffff;
}

body.mw-dark .mw-button-secondary {
  background-color: #192A1C;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

body.mw-dark .mw-button-danger {
  background-color: #D37364;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

/* Search/keys readability in dark mode */
body.mw-dark .mw-search-result-data {
  color: rgba(255, 255, 255, 0.86);
}

body.mw-dark .mw-search-result-keywords {
  color: rgba(255, 255, 255, 0.78);
}

/* References editor table readability in dark mode */
body.mw-dark .mw-references-table {
  background-color: rgba(255, 255, 255, 0.06);
}

body.mw-dark .mw-references-table th,
body.mw-dark .mw-references-table td {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.92);
}

body.mw-dark .mw-references-table th {
  background-color: rgba(255, 255, 255, 0.08);
}

/* Make "Remove" reference button red (same intent as delete) in dark mode */
body.mw-dark .mw-ref-remove {
  background-color: #D37364;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

body.mw-dark .mw-ref-remove:hover {
  box-shadow: 0 8px 22px rgba(211, 115, 100, 0.28);
}

body.mw-dark .mw-button:hover {
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}

/* Admin tables (analytics, etc.) */
.mw-admin-table-wrap {
  overflow: auto;
  border-radius: 14px;
}

.mw-admin-table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.86rem;
  line-height: 1.35;
  background: #e8e8e8;
  border: 1px solid rgba(48, 47, 47, 0.14);
  border-radius: 14px;
  overflow: hidden;
}

.mw-admin-table th,
.mw-admin-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(48, 47, 47, 0.10);
  vertical-align: middle;
}

.mw-admin-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: rgba(48, 47, 47, 0.05);
}

.mw-admin-table tbody tr:nth-child(even) td {
  background: rgba(48, 47, 47, 0.02);
}

.mw-admin-table td[data-col="logins"],
.mw-admin-table td[data-col="created"],
.mw-admin-table td[data-col="edited"],
.mw-admin-table td[data-col="words"],
.mw-admin-table td[data-col="opened"] {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

body.mw-dark .mw-admin-table {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
}

body.mw-dark .mw-admin-table th,
body.mw-dark .mw-admin-table td {
  border-bottom-color: rgba(255, 255, 255, 0.14);
}

body.mw-dark .mw-admin-table th {
  background: rgba(255, 255, 255, 0.08);
}

body.mw-dark .mw-admin-table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.04);
}

body.mw-dark .errorbox,
body.mw-dark .successbox {
  background: rgba(255, 255, 255, 0.06);
}

/* Article cards + article meta readability in dark mode */
body.mw-dark .article-card {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
}

body.mw-dark .article-card,
body.mw-dark .article-card a,
body.mw-dark .article-card-title a {
  color: #ffffff;
}

body.mw-dark .article-card-meta {
  opacity: 1;
  color: rgba(255, 255, 255, 0.82);
}

body.mw-dark .article-card-keys,
body.mw-dark .article-meta-dates {
  color: rgba(255, 255, 255, 0.80);
}

/* Article content tables */
body.mw-dark .mw-parser-output table,
body.mw-dark .mw-parser-output th,
body.mw-dark .mw-parser-output td {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
}

body.mw-dark .mw-parser-output tr:nth-child(even) td {
  background-color: rgba(255, 255, 255, 0.04);
}

/* Header search input needs dark background in dark mode */
body.mw-dark .mw-search-form input[type='search'] {
  background: rgba(0, 0, 0, 0.28);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
}

body.mw-dark .mw-search-form input[type='search']:focus {
  border-color: rgba(255, 255, 255, 0.65);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18);
}

/* Switch UI (account design settings) */
.mw-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(48, 47, 47, 0.10);
}

.mw-switch:last-child {
  border-bottom: none;
}

body.mw-dark .mw-switch {
  border-bottom-color: rgba(255, 255, 255, 0.14);
}

.mw-switch-label {
  font-size: 0.95rem;
}

.mw-switch-control {
  position: relative;
  width: 52px;
  height: 30px;
  flex: 0 0 auto;
}

.mw-switch-control input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.mw-switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(48, 47, 47, 0.18);
  border: 1px solid rgba(48, 47, 47, 0.20);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.mw-switch-thumb {
  position: absolute;
  top: 50%;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  transform: translateY(-50%);
  background: #e8e8e8;
  border: 1px solid rgba(48, 47, 47, 0.18);
  transition: transform 0.15s ease, background 0.15s ease;
}

.mw-switch-control input:checked ~ .mw-switch-track {
  background: rgba(48, 47, 47, 0.55);
  border-color: rgba(48, 47, 47, 0.65);
}

.mw-switch-control input:checked ~ .mw-switch-thumb {
  transform: translate(22px, -50%);
  background: #ffffff;
}

body.mw-dark .mw-switch-track {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.22);
}

body.mw-dark .mw-switch-control input:checked ~ .mw-switch-track {
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(255, 255, 255, 0.80);
}

body.mw-dark .mw-switch-thumb {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(255, 255, 255, 0.25);
}

body.mw-dark .mw-switch-control input:checked ~ .mw-switch-thumb {
  background: #ffffff;
}

/* Account profile polish */
.mw-profile-top {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.75rem 0.15rem 0.25rem 0.15rem;
}

.mw-avatar {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: rgba(48, 47, 47, 0.08);
  border: 1px solid rgba(48, 47, 47, 0.14);
}

body.mw-dark .mw-avatar {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.18);
}

.mw-profile-name {
  font-size: 1.05rem;
  font-weight: 800;
}

.mw-profile-email {
  font-size: 0.92rem;
  opacity: 0.8;
  word-break: break-word;
}

.mw-kv {
  margin-top: 0.65rem;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0.65rem;
  align-items: start;
  font-size: 0.95rem;
}

.mw-kv-k {
  opacity: 0.75;
}

.mw-muted {
  opacity: 0.75;
  font-size: 0.92em;
}

a {
  color: #302f2f;
  text-decoration: none;
}

a:hover {
  opacity: 0.8;
}

.mw-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #e8e8e8;
}

/* Header and navigation */
.mw-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #e8e8e8;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.mw-header-inner {
  max-width: 1024px;
  width: 100%;
  margin: 0 auto;
  padding: 0.6rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.mw-brand {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.mw-brand-title {
  font-family: 'Geist', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
}

.mw-brand-x {
  font-weight: 900;
}

.mw-brand-subtitle {
  font-size: 0.75rem;
  opacity: 0.7;
}

.mw-nav {
  display: flex;
  gap: 0.8rem;
  margin-left: auto;
}

.mw-nav a {
  font-size: 0.9rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.mw-nav a:hover {
  border-color: rgba(48, 47, 47, 0.2);
}

.mw-dropdown {
  position: relative;
}

.mw-dropdown > summary {
  list-style: none;
}

.mw-dropdown > summary::-webkit-details-marker {
  display: none;
}

.mw-dropdown-trigger {
  font-size: 0.9rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
}

.mw-dropdown[open] .mw-dropdown-trigger,
.mw-dropdown-trigger:hover {
  border-color: rgba(48, 47, 47, 0.2);
}

.mw-dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  background: #e8e8e8;
  border: 1px solid rgba(48, 47, 47, 0.14);
  border-radius: 14px;
  padding: 0.4rem;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.10);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.mw-dropdown-menu a {
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
}

.mw-dropdown-menu a:hover {
  background: rgba(48, 47, 47, 0.06);
}

.mw-relationships-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin: 0.75rem 0 0.9rem 0;
}

.mw-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(48, 47, 47, 0.14);
  background: rgba(48, 47, 47, 0.03);
  cursor: pointer;
  user-select: none;
}

.mw-toggle input {
  margin: 0;
}

.mw-rel-search {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.mw-rel-search input[type='search'] {
  width: 240px;
}

.mw-relationships-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: start;
}

.mw-relationships-panel {
  background: rgba(48, 47, 47, 0.02);
  border: 1px solid rgba(48, 47, 47, 0.10);
  border-radius: 16px;
  padding: 0.9rem 1.1rem;
}

.mw-graph {
  width: 100%;
  background: rgba(48, 47, 47, 0.03);
  border: 1px solid rgba(48, 47, 47, 0.10);
  border-radius: 16px;
  overflow: hidden;
}

.mw-rel-leaders {
  margin: 0.6rem 0 0 1.1rem;
  padding: 0;
}

.mw-rel-leaders li {
  margin-bottom: 0.65rem;
}

.mw-rel-leader-row {
  list-style: none;
  margin-left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(48, 47, 47, 0.08);
}

.mw-rel-leader-row:last-child {
  border-bottom: none;
}

.mw-rel-leader-main a {
  font-weight: 700;
  text-decoration: none;
}

.mw-rel-meta {
  font-size: 0.85rem;
  opacity: 0.75;
}

.mw-rel-importance {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.mw-rel-importance label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
}

.mw-rel-importance select {
  width: auto;
  min-width: 190px;
}

@media (max-width: 1050px) {
  .mw-rel-search input[type='search'] {
    width: 100%;
    min-width: 220px;
  }

  .mw-rel-leader-row {
    flex-direction: column;
    align-items: stretch;
  }
}

.mw-user-area {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.5rem;
  font-size: 0.85rem;
}

.mw-user-label strong {
  font-weight: 600;
}

.mw-nav-toggle {
  display: none;
  border: none;
  background: transparent;
  font-size: 1.4rem;
  color: #302f2f;
  line-height: 1;
  cursor: pointer;
  margin-left: auto;
}

body.mw-dark .mw-nav-toggle {
  color: #ffffff;
}

.mw-nav-toggle:focus {
  outline: none;
}

.mw-nav-toggle:focus-visible {
  outline: 2px solid rgba(48, 47, 47, 0.55);
  outline-offset: 3px;
  border-radius: 10px;
}

body.mw-dark .mw-nav-toggle:focus-visible {
  outline-color: rgba(255, 255, 255, 0.55);
}

/* Mobile-only quick actions (How to / Settings / Logout) */
.mw-mobile-user-links {
  display: none;
}

.mw-mobile-user-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(48, 47, 47, 0.12);
  background: rgba(48, 47, 47, 0.02);
  font-size: 0.95rem;
  color: inherit;
  cursor: pointer;
}

.mw-mobile-user-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.mw-mobile-logout-form {
  margin: 0;
}

.mw-mobile-logout-form button {
  appearance: none;
}

/* Content container */
#content {
  max-width: 1024px;
  width: 100%;
  margin: 1.5rem auto 1rem auto;
  padding: 1.5rem 1.8rem 2rem 1.8rem;
  background-color: #e8e8e8;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.05);
}

/* Article detail page uses background of site instead of white card */
#content.article-page {
  max-width: 1024px;
  width: 100%;
  background-color: #e8e8e8;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.05);
  border-radius: 18px;
  padding-left: 1.8rem;
  padding-right: 1.8rem;
  margin-top: 2.2rem;
}

#content.article-list-page {
  max-width: 1024px;
  width: 100%;
  background-color: transparent;
  box-shadow: none;
  border-radius: 0;
  padding-left: 1.2rem;
  padding-right: 1.2rem;
}

#content.relationships-page {
  max-width: 1440px;
}

.firstHeading {
  font-size: 2.1rem;
  margin: 0 0 0.75rem 0;
  border-bottom: 1px solid rgba(48, 47, 47, 0.12);
  padding-bottom: 0.5rem;
}

#bodyContent {
  margin-top: 0.75rem;
}

.mw-body,
.mw-body-content,
.mw-content-ltr {
  background-color: #e8e8e8;
}

.mw-body,
.mw-body-content,
.mw-content-ltr,
.mw-search-results,
.article-card,
.mw-parser-output {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.page-section {
  margin-bottom: 1.5rem;
}

.article-view .mw-parser-output {
  font-size: 0.97rem;
}

/* Footer */
#footer {
  max-width: 1024px;
  margin: 0 auto 1rem auto;
  padding: 0 1.8rem;
  font-size: 0.8em;
  color: rgba(48, 47, 47, 0.6);
}

#footer-places {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Forms and inputs */
.mw-login-form {
  max-width: 800px;
}

.mw-editform {
  max-width: 100%;
}

.mw-label {
  display: block;
  margin-bottom: 0.5em;
}

.mw-input-long {
  width: 100%;
  box-sizing: border-box;
}

.mw-search-form {
  display: flex;
  align-items: center;
  margin-left: 0.5rem;
}

.mw-search-form input[type='search'] {
  width: 180px;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(48, 47, 47, 0.16);
  font-family: inherit;
  font-size: 0.85rem;
  background: #e8e8e8;
}

.mw-search-form input[type='search']:focus {
  outline: none;
  border-color: #302f2f;
  box-shadow: 0 0 0 2px rgba(48, 47, 47, 0.12);
}

input[type='text'],
input[type='email'],
input[type='password'],
textarea,
select {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(48, 47, 47, 0.18);
  font-family: inherit;
  font-size: 0.9rem;
  color: #302f2f;
  background: #e8e8e8;
  box-sizing: border-box;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #302f2f;
  box-shadow: 0 0 0 2px rgba(48, 47, 47, 0.15);
}

input:disabled,
textarea:disabled,
select:disabled {
  background: #e8e8e8;
  opacity: 0.8;
}

.mw-edit-buttons {
  margin-top: 1em;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mw-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  border-radius: 999px;
  padding: 0.45rem 1.2rem;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.1;
  min-height: 34px;
  white-space: nowrap;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

.mw-button-primary {
  background-color: #302f2f;
  color: #e8e8e8;
}

.mw-button-secondary {
  background-color: #e8e8e8;
  color: #302f2f;
  border: 1px solid #302f2f;
}

.mw-button-danger {
  background-color: #D37364;
  color: #e8e8e8;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.mw-button-small {
  padding: 0.3rem 0.9rem;
  font-size: 0.8rem;
  min-height: 32px;
}

.mw-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.mw-button-danger:hover {
  box-shadow: 0 8px 22px rgba(211, 115, 100, 0.28);
}

.mw-link-ghost {
  font-size: 0.85rem;
  cursor: pointer;
  opacity: 0.8;
}

.mw-cancel {
  margin-left: 1em;
  font-size: 0.85rem;
  opacity: 0.7;
}

.errorbox {
  border: 1px solid #bb7070;
  background-color: #e8e8e8;
  padding: 0.5em;
  margin-bottom: 0.8em;
}

.successbox {
  border: 1px solid #6aa84f;
  background-color: #e8e8e8;
  padding: 0.5em;
  margin-bottom: 0.8em;
}

.password-strength {
  margin-top: 4px;
  margin-bottom: 12px;
}

.password-strength-bar {
  height: 6px;
  width: 0;
  max-width: 100%;
  background-color: #d9534f;
  border-radius: 999px;
  transition: width 0.2s ease, background-color 0.2s ease;
}

.password-strength-text {
  font-size: 12px;
  color: #6c757d;
  margin-top: 4px;
}

.mw-inline-form {
  display: inline-block;
  margin-left: 4px;
}

.mw-search-results {
  list-style: none;
  padding-left: 0;
  margin: 1rem 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.mw-search-results li {
  margin-bottom: 0;
}

.mw-search-result-data {
  font-size: 0.86em;
  font-style: italic;
  font-weight: 400;
  color: rgba(48, 47, 47, 0.75);
}

.mw-search-result-keywords {
  font-size: 0.85em;
  color: #72777d;
}

.references {
  font-size: 0.9em;
}

.references li {
  margin-bottom: 0.4em;
}

.reference-text {
  color: rgba(48, 47, 47, 0.8);
}

.mw-references-table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.5em 0;
}

.mw-references-table th,
.mw-references-table td {
  border: 1px solid rgba(48, 47, 47, 0.16);
  padding: 0.3em;
}

.key-ref {
  background-color: rgba(48, 47, 47, 0.06);
  padding: 0 0.1em;
  border-radius: 2px;
}

/* Links inside article content */
.mw-parser-output a {
  font-weight: 600;
  text-decoration: underline;
}

/* Images inside article content scale to fit container */
.mw-parser-output img {
  max-width: 100%;
  height: auto;
  display: block;
}

.article-card {
  padding: 0.9rem 1.2rem;
  border-radius: 14px;
  background: #e8e8e8;
  border: 1px solid rgba(48, 47, 47, 0.08);
}

.article-card-title {
  margin: 0 0 0.3rem 0;
  font-size: 1.1rem;
}

.article-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: 0.8rem;
  opacity: 0.8;
  margin-bottom: 0.3rem;
}

.article-card-summary {
  font-size: 0.88rem;
  font-style: italic;
  font-weight: 400;
  opacity: 0.92;
  margin-bottom: 0.2rem;
}

.article-card-keys {
  font-size: 0.8rem;
  color: #55536a;
}

.article-meta {
  font-size: 0.8rem;
  opacity: 0.85;
  margin-bottom: 0.25rem;
}

.article-meta-line {
  margin-bottom: 0.1rem;
}

.article-meta-line-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: baseline;
}

.article-meta-sep {
  opacity: 0.7;
  padding: 0 0.1rem;
}

.article-meta-author,
.article-meta-contributors {
  font-weight: 600;
}

.article-meta-dates {
  color: #55536a;
}

@media (min-width: 900px) {
  .article-meta-line {
    display: inline;
    margin-bottom: 0;
  }
  .article-meta-line + .article-meta-line:before {
    content: " | ";
    opacity: 0.7;
  }
}

.article-card-edit {
  font-size: 0.8rem;
  opacity: 0.8;
}

.article-actions {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.article-delete-form {
  display: inline;
}

.article-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

/* Tables inside article content */
.mw-parser-output table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  background-color: #e8e8e8;
  border-radius: 8px;
  overflow: hidden;
}

.mw-parser-output th,
.mw-parser-output td {
  padding: 0.6rem 0.8rem;
  border: 1px solid rgba(48, 47, 47, 0.16);
}

.mw-parser-output th {
  background-color: #e8e8e8;
  text-align: left;
  font-weight: 600;
}

.mw-parser-output tr:nth-child(even) td {
  background-color: #e8e8e8;
}

/* References table in editor */
.mw-references-table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.75rem 0;
  background-color: #e8e8e8;
  border-radius: 6px;
  overflow: hidden;
}

.mw-references-table th,
.mw-references-table td {
  border: 1px solid rgba(48, 47, 47, 0.16);
  padding: 0.5rem 0.75rem;
}

.mw-references-table th {
  background-color: #e8e8e8;
  text-align: left;
  font-weight: 600;
}

.mw-ref-actions {
  width: 1%;
  white-space: nowrap;
}

.mw-import-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.mw-import-item {
  display: flex;
  gap: 0.8rem;
  padding: 0.8rem;
  border-radius: 12px;
  border: 1px solid rgba(48, 47, 47, 0.12);
  background: #e8e8e8;
}

.mw-import-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
  font-weight: 600;
}

.mw-import-main {
  min-width: 0;
  flex: 1;
}

.mw-import-top {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.mw-import-title {
  font-weight: 700;
  margin-top: 0.25rem;
  word-break: break-word;
}

.mw-import-meta {
  margin-top: 0.25rem;
  opacity: 0.8;
  font-size: 0.85rem;
  word-break: break-word;
}

.mw-progress-bar {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(48, 47, 47, 0.14);
  overflow: hidden;
}

.mw-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: rgba(48, 47, 47, 0.6);
  transition: width 120ms linear;
}

.mw-import-progress-stats {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  opacity: 0.85;
  word-break: break-word;
}

@media (max-width: 640px) {
  .mw-import-item {
    flex-direction: column;
  }
  .mw-import-check {
    justify-content: flex-start;
  }
}

#content.keys-page {
  background-color: #e8e8e8;
}

/* Admin / settings cards */
.mw-admin-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0.9rem;
}

.mw-admin-card {
  grid-column: span 12;
  background: #e8e8e8;
  border: 1px solid rgba(48, 47, 47, 0.10);
  border-radius: 16px;
  padding: 0.9rem 1.1rem;
}

.mw-admin-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.mw-admin-card-title {
  margin: 0;
  font-size: 1.05rem;
}

.mw-admin-card-subtitle {
  font-size: 0.9rem;
  opacity: 0.8;
}

.mw-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.mw-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(48, 47, 47, 0.14);
  font-size: 0.78rem;
  background: rgba(48, 47, 47, 0.04);
}

.mw-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.mw-admin-actions label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
}

.mw-admin-actions select,
.mw-admin-actions input[type='checkbox'] {
  width: auto;
}

.mw-admin-buttons {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.mw-user-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.mw-logout-form .mw-button {
  padding-left: 0.9rem;
  padding-right: 0.9rem;
}

@media (max-width: 1050px) {
  #content {
    margin: 1rem auto;
    padding: 1.1rem 1.2rem 1.4rem 1.2rem;
    border-radius: 14px;
  }

  #footer {
    padding: 0 1.2rem;
  }

  .mw-header-inner {
    padding: 0.5rem 0.9rem;
  }

  .mw-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #e8e8e8;
    padding: 0.5rem 0.9rem 0.8rem 0.9rem;
    flex-direction: column;
    gap: 0.3rem;
    border-bottom: 1px solid rgba(40, 37, 57, 0.08);
    display: none;
  }

  body.mw-dark .mw-nav {
    background: #192A1C;
    border-bottom-color: rgba(255, 255, 255, 0.14);
  }

  /* Ensure mobile menu links are readable/consistent in dark mode */
  body.mw-dark .mw-nav a,
  body.mw-dark .mw-nav summary {
    color: #ffffff;
  }

  body.mw-dark .mw-nav a:hover {
    background: rgba(255, 255, 255, 0.06);
  }

  .mw-dropdown-menu {
    position: static;
    min-width: 0;
    box-shadow: none;
    border-radius: 12px;
  }

  .mw-nav.mw-nav-open {
    display: flex;
  }

  .mw-search-form {
    width: 100%;
    margin-left: 0;
  }

  .mw-search-form input[type='search'] {
    width: 100%;
  }

  .mw-nav a.mw-button {
    width: 100%;
  }

  .mw-nav-toggle {
    display: block;
  }

  .mw-user-area {
    display: none;
  }

  .mw-mobile-user-links {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.45rem;
    padding-top: 0.55rem;
    border-top: 1px solid rgba(48, 47, 47, 0.10);
  }

  body.mw-dark .mw-mobile-user-links {
    border-top-color: rgba(255, 255, 255, 0.14);
  }

  body.mw-dark .mw-mobile-user-link {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
  }
}

@media (max-width: 420px) {
  .mw-admin-buttons {
    flex-wrap: nowrap;
  }
}
