:root {
  --black: #0b0b0d;
  --dark: #151519;
  --red: #d71920;
  --red-dark: #a80f15;
  --white: #ffffff;
  --off-white: #f6f6f7;
  --gray: #6f7278;
  --border: #e4e4e7;
  --panel: #ffffff;
  --shadow: 0 18px 45px rgba(11, 11, 13, 0.12);
}

body.dark-mode {
  --black: #f7f7f8;
  --dark: #050506;
  --white: #111114;
  --off-white: #18181d;
  --gray: #b5b5bd;
  --border: #2c2c33;
  --panel: #15151a;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.34);
}

body.dark-mode .site-header {
  background: #09090b;
  border-bottom-color: transparent;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
}

body.dark-mode .logo span,
body.dark-mode .nav-links,
body.dark-mode .theme-toggle,
body.dark-mode .login-button,
body.dark-mode .menu-toggle {
  color: #ffffff;
}

body.dark-mode .menu-toggle span {
  background: #ffffff;
}

body.dark-mode .theme-toggle,
body.dark-mode .login-button,
body.dark-mode .menu-toggle {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

body.dark-mode .theme-toggle:hover,
body.dark-mode .login-button:hover {
  color: #ffffff;
  background: var(--red);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  overflow-y: auto;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  font-family: "Inter", Arial, sans-serif;
  color: var(--black);
  background: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
  overflow-x: clip;
  overflow-y: visible;
  animation: pageEnter 0.42s ease both;
}

body.home-dynamic-background {
  position: relative;
  background:
    radial-gradient(circle at 78% 18%, rgba(11, 11, 13, 0.065), transparent 28%),
    #f5f6f8;
}

body.home-dynamic-background::before,
body.home-dynamic-background::after {
  content: "";
  position: fixed;
  z-index: 0;
  pointer-events: none;
}

body.home-dynamic-background::before {
  inset: 0;
  background:
    linear-gradient(rgba(11, 11, 13, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 11, 13, 0.18) 1px, transparent 1px);
  background-size: 112px 112px;
  background-position: 0 0;
  opacity: 0.82;
  animation: pageBackgroundScan 16s linear infinite alternate;
}

body.home-dynamic-background::after {
  inset: 0;
  background:
    radial-gradient(circle at 18% 26%, rgba(11, 11, 13, 0.055) 0 10%, transparent 28%),
    radial-gradient(circle at 52% 82%, rgba(11, 11, 13, 0.045) 0 9%, transparent 28%);
  mix-blend-mode: multiply;
  opacity: 0.56;
  animation: pageBackgroundFloat 18s ease-in-out infinite alternate;
}

body.home-dynamic-background .site-header,
body.home-dynamic-background main,
body.home-dynamic-background .footer {
  position: relative;
  z-index: 1;
}

body.home-dynamic-background .footer {
  z-index: 2;
  background: #111114;
  box-shadow: 0 -18px 42px rgba(11, 11, 13, 0.16);
}

body.home-dynamic-background .site-header {
  z-index: 20;
}

body.home-dynamic-background .home-showcase,
body.home-dynamic-background .calculator-feature,
body.home-dynamic-background .home-blog-strip,
body.home-dynamic-background .split-section,
body.home-dynamic-background .posts-section,
body.home-dynamic-background .calculators-section,
body.home-dynamic-background .calculator-detail-section {
  background: transparent;
}

body.home-dynamic-background .home-blog-strip {
  color: var(--black);
}

body.home-dynamic-background .home-blog-strip::before {
  content: none;
  display: none;
  animation: none;
}

body.home-dynamic-background .home-blog-strip .section-heading p:not(.eyebrow) {
  color: var(--gray);
}

body.home-dynamic-background .home-showcase,
body.home-dynamic-background .calculator-feature {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.home-dynamic-background .home-hero::before {
  content: none;
}

body.dark-mode.home-dynamic-background {
  background:
    radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.045), transparent 28%),
    #0f0f13;
}

body.dark-mode.home-dynamic-background::before {
  background:
    linear-gradient(rgba(255, 255, 255, 0.145) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.145) 1px, transparent 1px);
  background-size: 112px 112px;
  background-position: 0 0;
  opacity: 0.86;
  animation: pageBackgroundScan 16s linear infinite alternate;
}

body.dark-mode.home-dynamic-background::after {
  background:
    radial-gradient(circle at 18% 26%, rgba(255, 255, 255, 0.045) 0 10%, transparent 28%),
    radial-gradient(circle at 52% 82%, rgba(255, 255, 255, 0.035) 0 9%, transparent 28%);
  mix-blend-mode: normal;
  opacity: 0.56;
}

body.dark-mode.home-dynamic-background .home-showcase,
body.dark-mode.home-dynamic-background .calculator-feature,
body.dark-mode.home-dynamic-background .home-blog-strip,
body.dark-mode.home-dynamic-background .split-section,
body.dark-mode.home-dynamic-background .posts-section,
body.dark-mode.home-dynamic-background .calculators-section,
body.dark-mode.home-dynamic-background .calculator-detail-section {
  background: transparent;
}

body.dark-mode.home-dynamic-background .home-blog-strip {
  color: var(--black);
}

@keyframes pageBackgroundScan {
  from {
    background-position: 0 0;
  }

  to {
    background-position: 112px 56px;
  }
}

@keyframes pageBackgroundFloat {
  from {
    transform: translate3d(-1.5%, -1%, 0) scale(1);
  }

  to {
    transform: translate3d(1.5%, 1%, 0) scale(1.04);
  }
}

main {
  flex: 1 0 auto;
}

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

button,
input,
select,
textarea {
  font: inherit;
  max-width: 100%;
}

img,
video {
  max-width: 100%;
  height: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #09090b;
  border-bottom: 0;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--red);
  box-shadow: 0 1px 0 rgba(168, 15, 21, 0.9);
  pointer-events: none;
}

body.dark-mode .site-header::after {
  height: 3px;
  background: var(--red);
  box-shadow: 0 1px 0 rgba(168, 15, 21, 0.9);
}

.navbar {
  width: min(1480px, calc(100% - 16px));
  min-height: 74px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(8px, 1.1vw, 16px);
}

.logo {
  display: inline-flex;
  align-items: center;
  color: #ffffff;
  font-size: 1.35rem;
  font-weight: 800;
  white-space: nowrap;
  transform-origin: left center;
  transition:
    transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1),
    text-shadow 0.32s ease;
}

.logo:hover,
.logo:focus-visible {
  text-shadow: 0 10px 24px rgba(215, 25, 32, 0.34);
  transform: scale(1.12);
}

.logo span {
  color: #ffffff;
}

.logo strong {
  color: var(--red);
  transition: color 0.32s ease;
}

.logo:hover strong,
.logo:focus-visible strong {
  color: #ff5a60;
}

.nav-links {
  flex: 1 1 auto;
  justify-content: flex-end;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: clamp(8px, 1vw, 16px);
  padding: 0;
  margin: 0;
  color: #ffffff;
  list-style: none;
  font-size: 0.84rem;
  font-weight: 700;
  transition: transform 0.34s cubic-bezier(0.2, 0.8, 0.2, 1), gap 0.34s ease;
}

.navbar.has-open-search .nav-links,
.navbar:has(.site-search.is-open) .nav-links,
.navbar:has(.site-search:focus-within) .nav-links {
  gap: clamp(5px, 0.62vw, 10px);
  transform: translateX(-18px);
}

.nav-links li {
  white-space: nowrap;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px clamp(7px, 0.72vw, 10px);
  border-bottom: 2px solid transparent;
  border-radius: 8px;
  white-space: nowrap;
  transition:
    color 0.22s ease,
    background 0.22s ease,
    border-color 0.22s ease,
    transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.nav-links a:hover {
  color: #ff5a60;
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--red);
  transform: translateY(-1px) scale(1.055);
}

.nav-dropdown {
  position: relative;
}

.nav-submenu {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  z-index: 30;
  display: grid;
  min-width: 180px;
  padding: 8px;
  background: #111114;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.26);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.98);
  transform-origin: top left;
  transition:
    opacity 0.2s ease,
    transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1),
    visibility 0.2s ease;
  visibility: hidden;
}

.nav-submenu::before {
  content: "";
  position: absolute;
  right: 0;
  bottom: 100%;
  left: 0;
  height: 12px;
}

.nav-dropdown:hover .nav-submenu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  visibility: visible;
}

.nav-submenu a {
  padding: 10px 12px;
  border: 0;
  border-radius: 6px;
  white-space: nowrap;
}

.nav-submenu a:hover {
  color: #ffffff;
  background: var(--red);
}

body.dark-mode .nav-submenu {
  background: #111114;
  border-color: rgba(255, 255, 255, 0.16);
}

body.dark-mode .toc-link {
  color: #ff8b8f;
}

body.dark-mode .toc-link-child {
  color: #ff9da1;
}

body.dark-mode .toc-link-child.level-4,
body.dark-mode .toc-link-child.level-5,
body.dark-mode .toc-link-child.level-6 {
  color: #ffb3b6;
}

body.dark-mode .toc-toggle {
  color: #ff8b8f;
}

.header-actions {
  position: relative;
  z-index: 40;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
}

.navbar.has-open-search .header-actions,
.navbar:has(.site-search.is-open) .header-actions,
.navbar:has(.site-search:focus-within) .header-actions {
  min-width: min(560px, 38vw);
}

.site-search {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 54px;
  transition: width 0.34s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.site-search.is-open,
.site-search:focus-within {
  width: 54px;
}

.site-search-field {
  position: absolute;
  right: 58px;
  width: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(16px) scaleX(0.92);
  transform-origin: right center;
  transition:
    width 0.34s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.22s ease,
    transform 0.34s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.site-search.is-open .site-search-field,
.site-search:focus-within .site-search-field {
  width: min(270px, 22vw);
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) scaleX(1);
}

.site-search input {
  width: 100%;
  min-height: 40px;
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.site-search input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.site-search-toggle {
  position: relative;
  z-index: 2;
  width: 52px;
  min-height: 46px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-size: 1.34rem;
  font-weight: 800;
  line-height: 1;
  transition:
    background 0.22s ease,
    color 0.22s ease,
    border-color 0.22s ease,
    transform 0.22s ease,
    box-shadow 0.22s ease;
}

.site-search-toggle:hover,
.site-search-toggle:focus-visible,
.site-search.is-open .site-search-toggle {
  background: var(--red);
  box-shadow: 0 12px 24px rgba(215, 25, 32, 0.24);
  transform: translateY(-1px) scale(1.045);
}

.site-search.is-open .site-search-toggle {
  animation: searchButtonSpin 0.38s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes searchButtonSpin {
  0% {
    transform: rotate(0deg) scale(0.98);
  }

  70% {
    transform: rotate(340deg) scale(1.08);
  }

  100% {
    transform: rotate(360deg) scale(1.04);
  }
}

.search-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: auto;
  right: 0;
  width: min(320px, 76vw);
  z-index: 80;
  display: none;
  gap: 6px;
  padding: 8px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.2);
}

.search-suggestions.is-open {
  display: grid;
}

.search-suggestions a,
.search-suggestions p {
  margin: 0;
  padding: 10px;
  color: #111114;
  border-radius: 6px;
  text-decoration: none;
}

.search-suggestions a {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 10px;
  align-items: center;
}

.search-suggestions a:hover {
  background: #fff1f2;
}

.search-suggestions img,
.search-suggestion-placeholder {
  display: block;
  width: 46px;
  height: 46px;
  object-fit: cover;
  background: #f1f1f3;
  border: 1px solid #e4e4e7;
  border-radius: 6px;
}

.search-suggestions strong,
.search-suggestions small,
.search-suggestions em {
  display: block;
}

.search-suggestions small {
  margin-bottom: 2px;
  color: var(--red);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.search-suggestions strong {
  font-size: 0.9rem;
  line-height: 1.25;
}

.search-suggestions em,
.search-suggestions p {
  color: #626671;
  font-size: 0.78rem;
  font-style: normal;
  line-height: 1.35;
}

body.dark-mode .site-search input {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.38);
}

body.dark-mode .site-search input::placeholder {
  color: rgba(255, 255, 255, 0.68);
}

body.dark-mode .search-suggestions {
  background: #18181b;
  border-color: #3f3f46;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.45);
}

body.dark-mode .search-suggestions a,
body.dark-mode .search-suggestions p {
  color: #f4f4f5;
}

body.dark-mode .search-suggestions a:hover {
  background: rgba(215, 25, 32, 0.22);
}

body.dark-mode .search-suggestions em,
body.dark-mode .search-suggestions p {
  color: #c9cbd1;
}

body.dark-mode .search-suggestions img,
body.dark-mode .search-suggestion-placeholder {
  background: #27272a;
  border-color: #3f3f46;
}

.theme-toggle,
.login-button,
.menu-toggle {
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  cursor: pointer;
  transition:
    background 0.22s ease,
    color 0.22s ease,
    border-color 0.22s ease,
    transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.22s ease;
}

.theme-toggle {
  width: 42px;
  height: 42px;
  font-size: 1.2rem;
  font-weight: 800;
}

.theme-toggle.is-spinning {
  animation: themeSymbolSpin 0.52s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes themeSymbolSpin {
  0% {
    transform: rotate(0deg) scale(0.96);
  }

  55% {
    transform: rotate(250deg) scale(1.12);
  }

  100% {
    transform: rotate(360deg) scale(1);
  }
}

.login-button {
  min-height: 42px;
  padding: 9px 14px;
  font-weight: 800;
}

.theme-toggle:hover,
.login-button:hover {
  background: var(--red);
  box-shadow: 0 12px 24px rgba(215, 25, 32, 0.24);
  transform: translateY(-1px) scale(1.045);
}

.profile-menu {
  position: relative;
}

.profile-trigger {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.86rem;
  font-weight: 800;
  white-space: nowrap;
  transition:
    background 0.22s ease,
    border-color 0.22s ease,
    transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.22s ease;
}

.profile-trigger:hover {
  box-shadow: 0 12px 24px rgba(215, 25, 32, 0.18);
  transform: translateY(-1px) scale(1.04);
}

.profile-trigger img {
  width: 30px;
  height: 30px;
  object-fit: cover;
  border-radius: 999px;
  border: 2px solid var(--red);
}

.profile-submenu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 35;
  display: none;
  min-width: 150px;
  padding: 8px;
  background: #111114;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.26);
}

.profile-submenu::before {
  content: "";
  position: absolute;
  right: 0;
  bottom: 100%;
  left: 0;
  height: 12px;
}

.profile-menu:hover .profile-submenu,
.profile-menu:focus-within .profile-submenu {
  display: grid;
}

.profile-submenu a,
.profile-submenu button {
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  white-space: nowrap;
}

.profile-submenu a:hover,
.profile-submenu button:hover {
  background: var(--red);
}

body.dark-mode .profile-trigger {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .profile-submenu {
  background: #111114;
  border-color: rgba(255, 255, 255, 0.16);
}

body.dark-mode .profile-submenu a,
body.dark-mode .profile-submenu button {
  color: #ffffff;
}

body.dark-mode .profile-submenu a:hover,
body.dark-mode .profile-submenu button:hover {
  color: #ffffff;
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  background: #ffffff;
}

.section {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 64px 0;
}

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(8px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease,
    filter 0.7s ease;
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.reveal-on-scroll.reveal-soft {
  transform: translateY(16px);
}

.reveal-on-scroll.reveal-hero {
  transform: translateY(18px) scale(0.985);
}

.reveal-on-scroll.reveal-hero.is-visible {
  transform: translateY(0) scale(1);
}

.section.wide-editor {
  width: calc(100% - 48px);
  max-width: none;
}

.hero {
  position: relative;
  min-height: 640px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  align-items: center;
  gap: 48px;
  overflow: hidden;
}

.hero-content h1,
.page-hero h1 {
  max-width: 840px;
  margin: 14px 0 20px;
  font-size: clamp(2.45rem, 6vw, 5rem);
  line-height: 1;
  letter-spacing: 0;
}

.typewriter-title {
  min-height: 3em;
}

.typewriter-title::after {
  content: "";
  display: inline-block;
  width: 0.08em;
  height: 0.82em;
  margin-left: 0.08em;
  background: var(--red);
  vertical-align: -0.06em;
  animation: typewriterCaret 0.9s steps(1) infinite;
}

@keyframes typewriterCaret {
  50% {
    opacity: 0;
  }
}

body:has(#editor-form) .page-hero {
  padding-top: clamp(18px, 3vw, 34px);
  padding-bottom: clamp(24px, 4vw, 38px);
}

body:has(#editor-form) .page-hero h1 {
  max-width: 760px;
  margin: 8px 0 12px;
  font-size: clamp(1.9rem, 3.2vw, 3.2rem);
  line-height: 1.05;
}

body:has(#editor-form) .page-hero p:not(.eyebrow) {
  max-width: 620px;
  font-size: 1rem;
}

.hero-text,
.page-hero p:not(.eyebrow) {
  max-width: 690px;
  margin: 0;
  color: var(--gray);
  font-size: 1.1rem;
}

.eyebrow {
  margin: 0;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-actions,
.article-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
  overflow: visible;
}

.btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 20px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 12px 26px rgba(11, 11, 13, 0.1);
  transition:
    transform 0.42s cubic-bezier(0.2, 0.8, 0.2, 1),
    background 0.32s ease,
    color 0.32s ease,
    border-color 0.32s ease,
    box-shadow 0.32s ease;
  will-change: transform;
}

.btn-click-effect {
  position: absolute;
  z-index: 0;
  width: 18px;
  height: 18px;
  left: var(--click-x, 50%);
  top: var(--click-y, 50%);
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.82) 0 8%, rgba(255, 255, 255, 0.34) 30%, rgba(215, 25, 32, 0.16) 54%, transparent 72%);
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0);
  animation: buttonClickRipple 0.62s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.btn.is-clicking,
button.is-clicking,
.toolbar-menu-trigger.is-clicking,
.toolbar-style-button.is-clicking,
.category-card.is-clicking,
.calc-category.is-clicking {
  animation: buttonPressPop 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 1px;
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 58%);
  opacity: 0.75;
  pointer-events: none;
}

.btn::after {
  content: none;
}

.btn > * {
  position: relative;
  z-index: 1;
}

.btn:hover {
  box-shadow: 0 18px 36px rgba(11, 11, 13, 0.15);
  transform: translateY(-2px) scale(1.035);
}

.btn:active {
  transform: translateY(0) scale(1.01);
}

.btn:focus-visible {
  outline: 3px solid rgba(215, 25, 32, 0.32);
  outline-offset: 4px;
}

button,
.btn,
.category-card,
.calc-category,
.toolbar-menu-trigger,
.toolbar-style-button,
.toc-link,
.toc-toggle {
  -webkit-tap-highlight-color: transparent;
}

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  color: #ffffff;
  background:
    radial-gradient(circle at 24% 24%, rgba(215, 25, 32, 0.34), transparent 30%),
    linear-gradient(135deg, rgba(9, 9, 11, 0.94), rgba(20, 20, 24, 0.96));
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 0.26s ease,
    transform 0.26s ease;
}

.page-loader.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.page-loader-inner {
  display: grid;
  justify-items: center;
  gap: 16px;
}

.page-loader-mark {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 0 42px rgba(215, 25, 32, 0.28);
}

.page-loader-mark::before,
.page-loader-mark::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: inherit;
  border: 3px solid transparent;
  border-top-color: #ffffff;
  border-right-color: var(--red);
  animation: pageLoaderSpin 0.82s linear infinite;
}

.page-loader-mark::after {
  inset: 20px;
  border-width: 2px;
  border-top-color: rgba(255, 255, 255, 0.4);
  border-right-color: #ff5a60;
  animation-duration: 1.2s;
  animation-direction: reverse;
}

.page-loader-text {
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

@keyframes buttonClickRipple {
  0% {
    opacity: 0.9;
    transform: translate(-50%, -50%) scale(0);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(18);
  }
}

@keyframes buttonPressPop {
  0% {
    transform: scale(1);
  }

  42% {
    transform: scale(0.965);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes pageLoaderSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cursor-trail-dot {
  display: none;
  position: fixed;
  z-index: 15;
  width: var(--trail-size, 20px);
  height: var(--trail-size, 20px);
  left: 0;
  top: 0;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.58) 0 18%, rgba(215, 25, 32, 0.28) 22%, rgba(215, 25, 32, 0) 72%);
  box-shadow: 0 0 22px rgba(215, 25, 32, 0.28);
  opacity: 0.72;
  pointer-events: none;
  transform: translate3d(var(--trail-x, 0), var(--trail-y, 0), 0) translate(-50%, -50%) scale(1);
  animation: cursorTrailFade 0.85s ease-out forwards;
  mix-blend-mode: screen;
}

body.dark-mode .cursor-trail-dot {
  border-color: rgba(255, 255, 255, 0.22);
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.72) 0 15%, rgba(255, 74, 80, 0.34) 24%, rgba(255, 74, 80, 0) 74%);
  box-shadow: 0 0 28px rgba(255, 74, 80, 0.34);
}

@keyframes cursorTrailFade {
  to {
    opacity: 0;
    transform: translate3d(var(--trail-x, 0), var(--trail-y, 0), 0) translate(-50%, -50%) scale(0.28);
  }
}

.btn-primary {
  z-index: 0;
  color: #ffffff;
  background: linear-gradient(135deg, #f0444a 0%, var(--red) 48%, var(--red-dark) 100%);
  box-shadow: 0 14px 30px rgba(215, 25, 32, 0.24);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.24);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #ff5a60 0%, var(--red) 42%, #8e0d12 100%);
  box-shadow: 0 20px 38px rgba(215, 25, 32, 0.32);
}

.btn-secondary {
  z-index: 0;
  color: #111114;
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(11, 11, 13, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.btn-secondary:hover {
  color: #09090b;
  border-color: rgba(215, 25, 32, 0.34);
  background: rgba(255, 255, 255, 0.92);
}

.hero-media {
  position: relative;
}

.hero-media img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.home-hero {
  isolation: isolate;
  min-height: 620px;
  padding-top: clamp(56px, 7vh, 92px);
  padding-bottom: clamp(48px, 6vh, 78px);
}

.home-hero::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: clamp(18px, 3vw, 34px) 0 auto;
  height: 42%;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.05) 46%, rgba(215, 25, 32, 0.035)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0));
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(11, 11, 13, 0.08);
  pointer-events: none;
  opacity: 0.58;
  animation: homeGlassDrift 12s ease-in-out infinite alternate;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.fitness-word-stream {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: none;
  align-content: space-evenly;
  gap: 18px;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.09;
  overflow: visible;
  mask-image: linear-gradient(90deg, transparent 0%, #000 12%, #000 88%, transparent 100%);
}

.fitness-word-stream::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, var(--white) 0%, transparent 20%, transparent 80%, var(--white) 100%),
    radial-gradient(circle at 34% 43%, var(--white) 0 17%, transparent 37%),
    radial-gradient(circle at 66% 47%, var(--white) 0 13%, transparent 33%);
}

.fitness-word-stream div {
  width: max-content;
  color: rgba(11, 11, 13, 0.88);
  font-size: clamp(1.05rem, 2.4vw, 2.45rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-shadow: 0 10px 28px rgba(215, 25, 32, 0.14);
  animation: fitnessWordsLeft 18s linear infinite alternate;
}

.fitness-word-stream div:nth-child(2) {
  color: rgba(11, 11, 13, 0.78);
  animation: fitnessWordsRight 20s linear infinite alternate;
}

.home-hero > :not(.fitness-word-stream) {
  position: relative;
  z-index: 2;
}

.home-hero .hero-content {
  animation: homeContentFloat 7s ease-in-out infinite;
}

.home-hero .hero-actions .btn-primary {
  position: relative;
}

.home-hero-media img {
  animation: homeImageFloat 8s ease-in-out infinite;
}

@keyframes fitnessWordsLeft {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-35%);
  }
}

@keyframes fitnessWordsRight {
  from {
    transform: translateX(-45%);
  }

  to {
    transform: translateX(0);
  }
}

@keyframes homeGlassDrift {
  from {
    transform: translate3d(-1.5%, 0, 0);
  }

  to {
    transform: translate3d(1.5%, 10px, 0);
  }
}

@keyframes homeContentFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes homeImageFloat {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-12px) scale(1.015);
  }
}

@keyframes buttonLightSweep {
  0%,
  52% {
    transform: translateX(0) skewX(-18deg);
  }

  78%,
  100% {
    transform: translateX(430%) skewX(-18deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.home-dynamic-background::before,
  body.home-dynamic-background::after,
  .cursor-trail-dot {
    animation: none;
  }

  .cursor-trail-dot {
    display: none;
  }

  .fitness-word-stream div {
    animation: none;
  }

  .home-hero::before,
  .home-hero .hero-content,
  .home-hero-media img,
  .home-visual-card,
  .home-visual-card img,
  .calculator-feature-grid div,
  .home-blog-strip::before {
    animation: none;
  }

  .reveal-on-scroll {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }

  .typewriter-title::after {
    animation: none;
  }

  .btn-click-effect,
  .page-loader-mark::before,
  .page-loader-mark::after {
    animation: none;
  }

  .page-loader {
    transition: none;
  }

  body {
    animation: none;
  }
}

.home-hero-media img {
  aspect-ratio: 5 / 6;
}

.calculator-feature-grid div {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 12px 28px rgba(11, 11, 13, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.calculator-feature-grid strong {
  display: block;
  color: var(--red);
  font-size: 1.35rem;
  line-height: 1;
}

.calculator-feature-grid span {
  display: block;
  color: var(--gray);
  font-weight: 700;
}

.home-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: -14px;
  padding: 14px;
  overflow: visible;
}

.home-showcase {
  background:
    linear-gradient(180deg, rgba(251, 251, 252, 0.86), rgba(255, 255, 255, 0.74)),
    #fbfbfc;
  overflow: visible;
}

.home-visual-card {
  display: grid;
  grid-template-rows: 220px 1fr;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow);
  transition: transform 0.24s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  animation: cardBreath 8s ease-in-out infinite;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.home-visual-card:hover {
  border-color: var(--red);
  box-shadow: 0 24px 54px rgba(215, 25, 32, 0.18);
  animation: none;
  transform: translateY(-8px) scale(1.045);
}

.home-visual-card:hover img {
  animation-play-state: paused;
  transform: scale(1.1);
}

.home-visual-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  animation: imageSlowPan 12s ease-in-out infinite alternate;
}

.home-visual-card:nth-child(2) {
  animation-delay: -2.4s;
}

.home-visual-card:nth-child(2) img {
  animation-delay: -4s;
}

.home-visual-card:nth-child(3) {
  animation-delay: -4.8s;
}

.home-visual-card:nth-child(3) img {
  animation-delay: -8s;
}

.home-visual-card div {
  padding: 22px;
}

.home-visual-card span {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.home-visual-card h3 {
  margin: 0 0 10px;
  font-size: 1.22rem;
  line-height: 1.25;
}

.home-visual-card p {
  margin: 0;
  color: var(--gray);
}

.calculator-feature {
  width: 100%;
  max-width: none;
  display: grid;
  grid-template-columns: minmax(16px, 1fr) minmax(0, 500px) minmax(320px, 590px) minmax(16px, 1fr);
  align-items: center;
  gap: 34px;
  background:
    linear-gradient(180deg, rgba(251, 251, 252, 0.9), rgba(255, 255, 255, 0.78)),
    #fbfbfc;
  overflow: visible;
}

.calculator-feature-text {
  grid-column: 2;
}

.calculator-feature-grid {
  grid-column: 3;
}

.calculator-feature-text h2 {
  margin: 8px 0 14px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.08;
}

.calculator-feature-text p:not(.eyebrow) {
  max-width: 640px;
  margin: 0;
  color: var(--gray);
}

.calculator-feature-text .btn {
  margin-top: 26px;
}

.calculator-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: -14px;
  padding: 14px;
  overflow: visible;
}

.calculator-feature-grid div {
  position: relative;
  overflow: hidden;
  animation: calculatorTileLift 7.5s ease-in-out infinite;
}

.calculator-feature-grid div::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(215, 25, 32, 0.08) 42%, transparent 68%);
  transform: translateX(-115%);
  animation: tileSignalSweep 5.5s ease-in-out infinite;
  pointer-events: none;
}

.calculator-feature-grid div:nth-child(2) {
  animation-delay: -1.1s;
}

.calculator-feature-grid div:nth-child(3) {
  animation-delay: -2.2s;
}

.calculator-feature-grid div:nth-child(4) {
  animation-delay: -3.3s;
}

.home-feature-posts {
  grid-column: 2 / 4;
  width: 100%;
  margin-top: 28px;
}

.home-feature-posts .section-heading {
  margin-bottom: 24px;
}

.home-post-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-blog-strip {
  position: relative;
  width: 100%;
  max-width: none;
  display: grid;
  grid-template-columns: minmax(16px, 1fr) minmax(0, 730px) minmax(240px, 330px) minmax(16px, 1fr);
  align-items: flex-end;
  gap: 28px;
  padding-top: 88px;
  padding-bottom: 88px;
  margin-bottom: 0;
  background:
    linear-gradient(135deg, #070708 0%, #111114 48%, #1b1b20 100%);
  color: #ffffff;
  overflow: hidden;
}

body.home-dynamic-background main {
  padding-bottom: 0;
}

.home-blog-strip::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.08) 28%, transparent 48%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 120px);
  animation: blogStripScan 10s linear infinite;
  pointer-events: none;
}

body.home-dynamic-background .home-blog-strip::before {
  content: none;
  display: none;
  animation: none;
}

.home-blog-strip > * {
  position: relative;
  z-index: 1;
}

.home-blog-strip .section-heading {
  grid-column: 2;
}

.home-blog-actions {
  grid-column: 3;
}

.home-blog-strip .section-heading {
  margin-bottom: 0;
}

.home-blog-strip .section-heading p:not(.eyebrow) {
  color: #dedee2;
}

body.home-dynamic-background .home-blog-strip {
  background: transparent;
  color: var(--black);
}

body.home-dynamic-background .home-blog-strip .section-heading p:not(.eyebrow) {
  color: var(--gray);
}

.home-blog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

body.dark-mode .home-visual-card,
body.dark-mode .calculator-feature-grid div {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(32, 32, 39, 0.72);
}

body.dark-mode .home-showcase,
body.dark-mode .calculator-feature {
  background:
    linear-gradient(180deg, rgba(17, 17, 20, 0.92), rgba(24, 24, 29, 0.78)),
    #111114;
}

body.dark-mode.home-dynamic-background .home-showcase,
body.dark-mode.home-dynamic-background .calculator-feature,
body.dark-mode.home-dynamic-background .home-blog-strip {
  background: transparent;
}

body.dark-mode .home-hero::before {
  border-color: rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012) 48%, rgba(215, 25, 32, 0.06)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.024), rgba(255, 255, 255, 0));
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.24);
  opacity: 0.42;
}

body.dark-mode .btn-primary,
body.dark-mode .btn-primary:hover {
  color: #ffffff;
}

body.dark-mode .btn-secondary {
  color: #111114;
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
}

body.dark-mode .btn-secondary:hover {
  color: #09090b;
  background: #ffffff;
  border-color: rgba(215, 25, 32, 0.45);
}

@keyframes cardBreath {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

@keyframes imageSlowPan {
  from {
    transform: scale(1.04) translateX(-2%);
  }

  to {
    transform: scale(1.08) translateX(2%);
  }
}

@keyframes calculatorTileLift {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-7px);
  }
}

@keyframes tileSignalSweep {
  0%,
  42% {
    transform: translateX(-115%);
  }

  72%,
  100% {
    transform: translateX(115%);
  }
}

@keyframes blogStripScan {
  from {
    transform: translateX(-14%);
  }

  to {
    transform: translateX(14%);
  }
}

body.dark-mode .fitness-word-stream {
  opacity: 0.09;
}

body.dark-mode .fitness-word-stream div,
body.dark-mode .fitness-word-stream div:nth-child(2) {
  color: rgba(255, 255, 255, 0.88);
}

body.dark-mode .fitness-word-stream::after {
  background:
    linear-gradient(90deg, var(--white) 0%, transparent 20%, transparent 80%, var(--white) 100%),
    radial-gradient(circle at 34% 43%, var(--white) 0 17%, transparent 37%),
    radial-gradient(circle at 66% 47%, var(--white) 0 13%, transparent 33%);
}

body.dark-mode .article-page,
body.dark-mode .article-body,
body.dark-mode .article-body p,
body.dark-mode .article-body li,
body.dark-mode .article-body td,
body.dark-mode .article-body th,
body.dark-mode .editor-references,
body.dark-mode .editor-inline-references .references h2,
body.dark-mode .references h2,
body.dark-mode .references li {
  color: #f4f4f5;
}

body.dark-mode .references,
body.dark-mode .article-body,
body.dark-mode .article-body h1,
body.dark-mode .article-body h2,
body.dark-mode .article-page h1 {
  border-color: #5b5d66;
}

body.dark-mode .article-body table,
body.dark-mode .wiki-media {
  background: #18181d;
}

body.dark-mode .article-body th {
  background: #22232a;
}

body.dark-mode .article-body figcaption,
body.dark-mode .wiki-media figcaption,
body.dark-mode .wiki-media figcaption small {
  color: #d8d8de;
}

body.dark-mode .wiki-media figcaption {
  background: rgba(24, 24, 29, 0.88);
  border-color: #5b5d66;
}

body.dark-mode .wiki-canvas .wiki-media figcaption:empty::before {
  color: #a7a7b0;
}

.hero-panel {
  position: absolute;
  left: -26px;
  right: 26px;
  bottom: 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 16px;
  color: #ffffff;
  background: rgba(11, 11, 13, 0.92);
  border-radius: 8px;
  backdrop-filter: blur(12px);
}

.hero-panel div {
  padding-right: 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.16);
}

.hero-panel div:last-child {
  padding-right: 0;
  border-right: 0;
}

.hero-panel strong {
  display: block;
  color: var(--red);
  font-size: 1.45rem;
  line-height: 1;
}

.hero-panel span {
  display: block;
  margin-top: 6px;
  color: #dedee2;
  font-size: 0.82rem;
  font-weight: 600;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 34px;
}

.section-heading h2 {
  margin: 8px 0 10px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.08;
}

.section-heading p:not(.eyebrow) {
  margin: 0;
  color: var(--gray);
}

.split-section,
.posts-section,
.calculators-section {
  width: 100%;
  max-width: none;
  background: var(--off-white);
}

body.home-dynamic-background .split-section,
body.home-dynamic-background .posts-section,
body.home-dynamic-background .calculators-section {
  background: transparent;
}

.split-section > *,
.posts-section > *,
.calculators-section > * {
  width: min(1120px, calc(100% - 32px));
  margin-left: auto;
  margin-right: auto;
}

.feature-grid,
.category-grid,
.blog-grid,
.calculator-grid,
.muscle-grid,
.calculator-category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  overflow: visible;
}

.category-grid,
.calculator-category-grid {
  margin: -12px;
  padding: 12px;
}

.muscle-card {
  display: grid;
  gap: 8px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--black);
  background: var(--panel);
}

.muscle-card strong {
  color: var(--red);
}

.muscle-card span {
  color: var(--gray);
}

.social-layout {
  display: block;
}

.social-tabs {
  display: flex;
  gap: 10px;
  padding-bottom: 0;
}

.social-tabs .btn {
  white-space: nowrap;
}

.social-panel {
  display: none;
}

.social-panel.is-active {
  display: block;
}

.social-layout .social-panel.is-active {
  max-width: 920px;
  margin: 0 auto;
}

.social-layout {
  gap: 18px;
}

.social-panel {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(11, 11, 13, 0.06);
}

.friend-row {
  display: grid;
  grid-template-columns: 52px 1fr auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.friend-row img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 999px;
}

.friend-row span {
  display: block;
  color: var(--gray);
  font-size: 0.9rem;
}

.request-lists {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.request-lists h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.request-status {
  justify-self: end;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--gray);
  background: var(--off-white);
  font-weight: 800;
}

.message {
  max-width: min(680px, 78%);
  margin: 10px 0;
  padding: 12px;
  border-radius: 8px 8px 8px 2px;
  background: var(--off-white);
}

.message.mine {
  margin-left: auto;
  color: #ffffff;
  background: var(--red);
  border-radius: 8px 8px 2px 8px;
}

.message span {
  color: var(--gray);
  font-size: 0.78rem;
}

.message.mine span {
  color: rgba(255, 255, 255, 0.72);
}

.message p {
  margin: 4px 0 0;
}

.messages-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  min-height: 560px;
}

.message-people {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
}

.message-person {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--black);
  background: var(--off-white);
  cursor: pointer;
  text-align: left;
  min-width: 0;
}

.message-person.is-active,
.message-person:hover {
  border-color: var(--red);
  box-shadow: 0 8px 20px rgba(215, 25, 32, 0.12);
}

.message-person img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 999px;
  grid-row: span 2;
}

.message-person span {
  min-width: 0;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-person small {
  color: var(--gray);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-conversation {
  min-width: 0;
  display: grid;
  grid-template-rows: minmax(340px, 1fr) auto auto;
  gap: 10px;
}

#message-thread {
  min-height: 340px;
  max-height: 540px;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
}

.chat-head {
  position: sticky;
  top: -14px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -14px -14px 14px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.chat-head img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 999px;
}

.chat-head h3 {
  margin: 0;
  font-size: 1rem;
}

.chat-head span {
  color: var(--gray);
  font-size: 0.82rem;
}

#message-input {
  resize: vertical;
}

.empty-state {
  margin: 12px 0;
  padding: 14px;
  color: var(--gray);
  background: var(--off-white);
  border: 1px dashed var(--border);
  border-radius: 8px;
}

.calculator-category-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.feature-card,
.info-card,
.post-card,
.calculator-card,
.wiki-note,
.profile-preview,
.profile-form,
.editor-form {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--black);
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(11, 11, 13, 0.06);
}

.feature-card,
.info-card,
.post-card,
.calculator-card,
.calculator-link-card,
.calc-category,
.wiki-note,
.profile-preview,
.profile-form,
.editor-form,
.social-panel,
.calculator-info-block,
.result {
  overflow-wrap: anywhere;
}

.feature-card,
.category-card,
.post-card {
  padding: 24px;
}

.feature-card span,
.card-number,
.post-card span {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--red);
  font-size: 0.82rem;
  font-weight: 800;
}

.feature-card h3,
.info-card h3,
.post-card h3,
.calculator-card h3 {
  margin: 0 0 10px;
  font-size: 1.18rem;
  line-height: 1.25;
}

.feature-card p,
.info-card p,
.post-card p {
  margin: 0;
  color: var(--gray);
}

.category-card {
  min-height: 220px;
  text-align: left;
  cursor: pointer;
}

.feature-card:hover,
.category-card:hover,
.category-card.is-active,
.post-card:hover {
  border-color: var(--red);
  box-shadow: 0 16px 36px rgba(215, 25, 32, 0.15);
  transform: translateY(-3px);
}

.post-card {
  display: block;
}

.post-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin: -4px 0 18px;
  border-radius: 8px;
}

.post-cover-placeholder,
.link-result-placeholder {
  display: grid;
  place-items: center;
  color: var(--red);
  background:
    linear-gradient(135deg, rgba(215, 25, 32, 0.08), rgba(11, 11, 13, 0.04)),
    var(--off-white);
  border: 1px dashed var(--border);
  font-weight: 900;
}

.post-cover-placeholder span {
  margin: 0;
  color: var(--red);
  font-size: 0.9rem;
}

.post-card.is-hidden,
.calculator-card.is-hidden,
.calculator-link-card.is-hidden {
  display: none;
}

.my-posts-grid {
  display: grid;
  gap: 16px;
}

.my-post-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  color: var(--black);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(11, 11, 13, 0.06);
}

.my-post-card h3 {
  margin: 6px 0 8px;
  font-size: 1.3rem;
}

.my-post-card p {
  margin: 0;
  color: var(--gray);
}

.my-post-card small {
  display: block;
  margin-top: 10px;
  color: var(--gray);
  font-weight: 700;
}

.my-post-status {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--red);
  font-size: 0.78rem;
  font-weight: 800;
}

.my-post-status.draft {
  background: #5b5f6a;
}

.my-post-status.pending {
  background: #a16207;
}

.my-post-status.approved {
  background: #15803d;
}

.calculator-category-grid {
  margin-top: -28px;
}

.calc-category {
  min-width: 0;
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--black);
  background: var(--panel);
  cursor: pointer;
  text-align: left;
}

.calc-category span {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
}

.calc-category small {
  color: var(--gray);
  font-weight: 700;
}

.calc-category:hover,
.calc-category.is-active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--red), #111114);
  border-color: var(--red);
}

.calc-category:hover small,
.calc-category.is-active small {
  color: #f5d4d4;
}

.calculator-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.calculator-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--red);
}

.time-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 10px;
}

.calculator-directory {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  transition:
    opacity 0.24s ease,
    transform 0.24s ease;
}

.calculator-directory.is-switching {
  opacity: 0.86;
  transform: translateY(6px);
}

.calculator-link-card {
  position: relative;
  min-width: 0;
  min-height: 178px;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 22px;
  color: var(--black);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.calculator-card-cover {
  width: calc(100% + 44px);
  height: 138px;
  object-fit: cover;
  margin: -22px -22px 8px;
  border-radius: 8px 8px 0 0;
  filter: saturate(1.05);
}

.calculator-link-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: var(--red);
}

.calculator-link-card:hover {
  transform: translateY(-3px);
  border-color: var(--red);
  box-shadow: var(--shadow);
}

.calculator-link-card.calc-card-enter,
.calculator-card.calc-card-enter {
  animation: calculatorCardEnter 0.48s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: var(--calc-enter-delay, 0ms);
}

@keyframes calculatorCardEnter {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
    filter: blur(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.calculator-link-card span {
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.calculator-link-card strong {
  font-size: 1.1rem;
  line-height: 1.25;
}

.calculator-link-card p {
  margin: 0;
  color: var(--gray);
  font-size: 0.95rem;
}

.calculator-detail-section {
  background: var(--off-white);
}

.calculator-detail-layout {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.calculator-detail-form {
  background: var(--panel);
}

.calculator-info-panel {
  display: grid;
  gap: 16px;
}

.calculator-info-block {
  padding: 22px;
  color: var(--black);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.calculator-info-block h2 {
  margin: 0 0 14px;
  font-size: 1.3rem;
}

.calculator-info-block h3 {
  margin: 14px 0 6px;
  color: var(--red);
  font-size: 1rem;
}

.calculator-info-block p {
  margin: 0;
  color: var(--gray);
}

.calculator-source-list {
  margin: 0;
  padding-left: 20px;
}

.calculator-source-list li {
  margin-bottom: 8px;
}

.calculator-source-list a {
  color: var(--red);
  font-weight: 800;
}

label {
  color: var(--black);
  font-size: 0.9rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--black);
  background: var(--white);
  border: 1px solid #d7d7dc;
  border-radius: 8px;
  outline: none;
}

textarea {
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.hidden-file-input {
  display: none;
}

.wiki-canvas {
  position: relative;
  min-height: clamp(560px, 62vh, 880px);
  max-width: 100%;
  overflow-x: hidden;
  padding: clamp(20px, 3vw, 34px);
  color: #111114;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.18rem;
  line-height: 1.78;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.wiki-canvas p,
.wiki-canvas li,
.wiki-canvas td,
.wiki-canvas th,
.wiki-canvas figcaption {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.editor-references {
  padding: 20px 26px;
  color: #111114;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.editor-references:empty {
  display: none;
}

.editor-inline-references {
  margin-top: 32px;
  padding-top: 18px;
}

.editor-inline-references .references {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.editor-inline-references .references h2 {
  color: #111114;
}

.wiki-canvas .editor-inline-references,
.wiki-canvas .editor-inline-references .references,
.wiki-canvas .editor-inline-references .references h2,
.wiki-canvas .editor-inline-references .references li,
.wiki-canvas .editor-inline-references .references li::marker {
  color: #111114;
}

.wiki-canvas .editor-inline-references .references h2 {
  border-bottom-color: #a2a9b1;
}

body.dark-mode .wiki-canvas .editor-inline-references,
body.dark-mode .wiki-canvas .editor-inline-references .references,
body.dark-mode .wiki-canvas .editor-inline-references .references h2,
body.dark-mode .wiki-canvas .editor-inline-references .references li,
body.dark-mode .wiki-canvas .editor-inline-references .references li::marker {
  color: #111114;
}

.citation-marker {
  display: inline;
  width: 0;
  height: 0;
  overflow: hidden;
}

.wiki-canvas:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(215, 25, 32, 0.12);
}

.wiki-canvas h1,
.wiki-canvas h2,
.wiki-canvas h3,
.wiki-canvas h4,
.wiki-canvas h5,
.wiki-canvas h6 {
  margin: 24px 0 10px;
  line-height: 1.15;
}

.wiki-canvas h1 {
  font-size: 2.3rem;
}

.wiki-canvas h2 {
  font-size: 1.9rem;
}

.wiki-canvas hr,
.article-body hr {
  margin: 28px 0;
  border: 0;
  border-top: 1px solid #a2a9b1;
}

.wiki-canvas h3 {
  font-size: 1.55rem;
}

.wiki-canvas h4 {
  font-size: 1.25rem;
}

.wiki-canvas h5 {
  font-size: 1.08rem;
}

.wiki-canvas h6 {
  font-size: 0.98rem;
  text-transform: uppercase;
}

.wiki-canvas a,
.article-body a {
  color: #d71920;
  text-decoration: none;
}

.wiki-canvas a:hover,
.article-body a:hover {
  text-decoration: underline;
}

.wiki-canvas blockquote {
  margin: 18px 0;
  padding: 14px 18px;
  color: #54595d;
  background: #f8f9fa;
  border-left: 4px solid var(--red);
  border-radius: 8px;
}

.wiki-canvas code,
.article-body code {
  padding: 2px 5px;
  color: #111114;
  background: #eaecf0;
  border-radius: 4px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92em;
}

.wiki-canvas pre {
  overflow-x: auto;
  padding: 14px;
  color: #ffffff;
  background: #111114;
  border-radius: 8px;
}

.wiki-canvas pre code,
.article-body pre code {
  padding: 0;
  color: inherit;
  background: transparent;
  border-radius: 0;
}

.wiki-canvas img {
  max-width: 100%;
  border-radius: 8px;
}

.wiki-canvas figure,
.article-body figure {
  margin: 20px 0;
}

.wiki-media {
  width: min(320px, 100%);
  min-width: 120px;
  max-width: min(100%, 900px);
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 8px;
}

.wiki-media.align-center {
  margin-left: auto;
  margin-right: auto;
}

.wiki-media.align-left {
  float: left;
  max-width: min(42%, 320px);
  margin: 4px 18px 14px 0;
}

.wiki-media.align-right {
  float: right;
  max-width: min(42%, 320px);
  margin: 4px 0 14px 18px;
}

.wiki-media.align-wide {
  width: 100%;
  max-width: 100%;
}

.wiki-canvas .wiki-media.align-free,
.article-body .wiki-media.align-free {
  position: absolute;
  left: 24px;
  top: 140px;
  float: none;
  max-width: min(100%, 900px);
  margin: 0;
  z-index: 3;
  cursor: move;
}

.wiki-canvas .wiki-media.align-free img {
  cursor: move;
}

.wiki-media img,
.wiki-canvas .wiki-media img,
.article-body .wiki-media img {
  width: 100%;
  max-width: 100%;
  margin: 0;
  border: 0;
  border-radius: var(--media-radius, 8px);
  box-sizing: border-box;
  cursor: zoom-in;
}

.wiki-media.has-border img {
  border: var(--media-border-width, 2px) solid #111111;
}

.wiki-canvas .wiki-media {
  position: relative;
  cursor: pointer;
  overflow: visible;
  resize: none;
  box-sizing: border-box;
  max-width: 100%;
}

.wiki-canvas .wiki-media[draggable="true"] img {
  cursor: grab;
}

.wiki-canvas .wiki-media.is-dragging {
  opacity: 0.45;
}

.wiki-canvas .wiki-media.is-selected {
  resize: none;
}

.wiki-canvas .wiki-media.align-wide.is-selected {
  resize: none;
}

.wiki-canvas .wiki-table.is-selected,
.wiki-canvas .wiki-template-block.is-selected,
.wiki-canvas .wiki-comment-block.is-selected,
.wiki-canvas .wiki-map-block.is-selected,
.wiki-canvas .wiki-symbol-line.is-selected,
.wiki-canvas hr.is-selected {
  outline: 3px solid rgba(215, 25, 32, 0.42);
  box-shadow: 0 0 0 5px rgba(215, 25, 32, 0.12);
}

.wiki-canvas .wiki-table,
.wiki-canvas .wiki-template-block,
.wiki-canvas .wiki-comment-block,
.wiki-canvas .wiki-map-block,
.wiki-canvas .wiki-symbol-line,
.wiki-canvas hr {
  cursor: pointer;
}

.wiki-canvas figcaption,
.article-body figcaption {
  color: var(--gray);
  font-size: 0.9rem;
  text-align: center;
}

.wiki-media figcaption {
  min-height: 36px;
  margin-top: 10px;
  padding: 8px 10px;
  color: var(--gray);
  background: rgba(255, 255, 255, 0.78);
  border: 1px dashed var(--border);
  border-radius: 8px;
  font-size: 0.86rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.wiki-canvas .wiki-media figcaption {
  cursor: text;
}

.wiki-canvas .wiki-media figcaption:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
  font-style: italic;
}

.wiki-media figcaption:focus {
  outline: 2px solid rgba(215, 25, 32, 0.26);
  outline-offset: 2px;
  border-color: rgba(215, 25, 32, 0.36);
}

.wiki-media figcaption small {
  display: block;
  margin-top: 4px;
  color: var(--gray);
}

.wiki-template-block,
.wiki-comment-block,
.wiki-formula,
.wiki-map-block,
.wiki-chart-block,
.wiki-music-block {
  margin: 18px 0;
  padding: 14px 16px;
  background: #f8f9fa;
  border: 1px solid #a2a9b1;
  border-left: 4px solid var(--red);
  border-radius: 8px;
}

.wiki-comment-block {
  border-left-color: #6f7278;
}

.wiki-formula {
  text-align: center;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
}

.wiki-map-block {
  min-height: 150px;
  display: grid;
  align-content: center;
  text-align: center;
  background:
    linear-gradient(90deg, rgba(162, 169, 177, 0.22) 1px, transparent 1px),
    linear-gradient(rgba(162, 169, 177, 0.22) 1px, transparent 1px),
    #f8f9fa;
  background-size: 28px 28px;
}

.wiki-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.wiki-gallery-item {
  margin: 0;
  padding: 8px;
  background: #f8f9fa;
  border: 1px solid #a2a9b1;
}

.wiki-gallery-placeholder {
  display: grid;
  min-height: 96px;
  place-items: center;
  color: #6f7278;
  background: #eaecf0;
  font-weight: 800;
}

.wiki-chart-bars {
  display: grid;
  gap: 8px;
}

.wiki-chart-bars div {
  min-height: 28px;
  padding: 4px 8px;
  color: #ffffff;
  background: var(--red);
  font-weight: 800;
}

.wiki-chart-bars div:nth-child(2) {
  width: 72%;
  background: #4f5bd5;
}

.wiki-chart-bars div:nth-child(3) {
  width: 48%;
  background: #0f766e;
}

body.dark-mode .article-body .wiki-template-block,
body.dark-mode .article-body .wiki-comment-block,
body.dark-mode .article-body .wiki-formula,
body.dark-mode .article-body .wiki-map-block,
body.dark-mode .article-body .wiki-chart-block,
body.dark-mode .article-body .wiki-music-block,
body.dark-mode .article-body .wiki-gallery-item {
  color: #f4f4f5;
  background: #18181d;
  border-color: #5b5d66;
}

body.dark-mode .article-body code {
  color: #f4f4f5;
  background: #22232a;
}

body.dark-mode .article-body .wiki-gallery-placeholder {
  color: #d8d8de;
  background: #22232a;
}

.wiki-canvas table {
  width: 100%;
  margin: 20px 0;
  border-collapse: collapse;
}

.wiki-table {
  overflow-x: auto;
  padding: 0;
}

.wiki-table caption {
  padding: 8px;
  color: var(--black);
  background: var(--off-white);
  border: 1px solid #a2a9b1;
  border-bottom: 0;
  font-weight: 800;
  text-align: center;
}

.wiki-canvas th,
.wiki-canvas td {
  padding: 10px;
  border: 1px solid #a2a9b1;
  text-align: left;
}

.wiki-canvas th {
  background: #eaecf0;
}

.wiki-canvas sup,
.article-body sup {
  font-family: "Inter", Arial, sans-serif;
  font-size: 0.75em;
}

.wiki-canvas sup.citation,
.wiki-canvas sup.citation a {
  pointer-events: none;
  user-select: none;
}

.term-link {
  position: relative;
  color: var(--red);
  font-weight: 700;
}

.download-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--red);
  font-weight: 800;
  text-decoration: none;
}

.download-link::before {
  content: "PDF";
  padding: 1px 5px;
  color: #ffffff;
  background: var(--red);
  border-radius: 4px;
  font-size: 0.68em;
  line-height: 1.4;
}

.download-link:hover {
  text-decoration: underline;
}

.term-link:hover .link-popover {
  display: block;
}

.link-popover {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  z-index: 12;
  display: none;
  width: min(330px, 80vw);
  padding: 0;
  color: #202124;
  background: #ffffff;
  border: 1px solid #c8ccd1;
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.link-popover img {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  margin: 0;
  border-radius: 0;
}

.link-popover .link-popover-text {
  display: block;
  padding: 12px;
  color: #202124;
  font-size: 0.92rem;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(215, 25, 32, 0.12);
}

.result {
  min-height: 52px;
  margin: 8px 0 0;
  padding: 12px;
  color: var(--black);
  background: rgba(215, 25, 32, 0.1);
  border-left: 4px solid var(--red);
  border-radius: 8px;
  font-weight: 700;
}

.result-rich {
  overflow-x: auto;
}

.calc-result-table {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
  font-size: 0.9rem;
  font-weight: 600;
}

.calc-result-table th,
.calc-result-table td {
  padding: 8px;
  border: 1px solid rgba(215, 25, 32, 0.22);
  text-align: left;
  vertical-align: top;
}

.calc-result-table th {
  color: var(--black);
  background: rgba(215, 25, 32, 0.08);
}

.calc-note {
  margin: 2px 0 0;
  color: var(--gray);
  font-size: 0.88rem;
  line-height: 1.45;
}

.calculator-evidence {
  margin-top: 24px;
  padding: 22px;
  color: var(--black);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.calculator-evidence h3 {
  margin: 0 0 8px;
}

.calculator-evidence p {
  margin: 0 0 12px;
  color: var(--gray);
}

.calculator-evidence ul {
  margin: 0;
  padding-left: 20px;
}

.calculator-evidence a {
  color: var(--red);
  font-weight: 800;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.64);
}

.auth-modal.is-open {
  display: flex;
}

.auth-box {
  position: relative;
  width: min(430px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 26px;
  color: var(--black);
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.close-modal {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: var(--red);
  cursor: pointer;
  font-size: 1.4rem;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 24px 0 20px;
}

.auth-tab {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--black);
  background: var(--off-white);
  cursor: pointer;
  font-weight: 800;
}

.auth-tab.is-active {
  color: #ffffff;
  background: var(--red);
  border-color: var(--red);
}

.auth-form {
  display: none;
  gap: 10px;
}

.auth-form.is-active {
  display: grid;
}

.auth-form h2 {
  margin: 0 0 8px;
  font-size: 1.55rem;
}

.auth-verification-step {
  display: none;
  gap: 10px;
}

.auth-verification-step.is-visible {
  display: grid;
}

.auth-message,
.form-note {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--red);
  font-weight: 800;
}

.auth-help {
  margin: -2px 0 4px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.45;
}

.consent-line {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  font-weight: 700;
}

.consent-line input {
  width: auto;
  min-height: auto;
  margin-top: 5px;
}

.consent-line a {
  color: var(--red);
}

.inline-login {
  padding: 0;
  border: 0;
  color: var(--red);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.article-reading-layout {
  --article-width: 980px;
  --article-text-size: 1.12rem;
  --article-summary-size: 1.22rem;
  --article-title-size: clamp(2.1rem, 4.8vw, 3.25rem);
  --article-h1-size: 2.24rem;
  --article-h2-size: 1.82rem;
  --article-h3-size: 1.32rem;
  --article-h4-size: 1.12rem;
  --article-h5-size: 1.04rem;
  --article-h6-size: 0.96rem;
  --article-caption-size: 0.96rem;
  --article-reference-heading-size: 1.78rem;
  --article-font: "Inter", Arial, sans-serif;
  --article-heading-font: Georgia, "Times New Roman", serif;
  display: grid;
  grid-template-columns: 220px minmax(0, var(--article-width)) 190px;
  gap: 36px;
  align-items: start;
  justify-content: center;
  width: min(1540px, calc(100% - 32px));
  margin: 0 auto;
}

body[data-article-width="wide"] .article-reading-layout {
  width: calc(100% - 40px);
  max-width: none;
  grid-template-columns: 260px minmax(0, 1fr) 220px;
  gap: 42px;
}

body[data-article-text="small"] .article-reading-layout {
  --article-text-size: 1.06rem;
  --article-summary-size: 1.16rem;
  --article-title-size: clamp(2.08rem, 4.45vw, 3.08rem);
  --article-h1-size: 2.08rem;
  --article-h2-size: 1.68rem;
  --article-h3-size: 1.24rem;
  --article-h4-size: 1.08rem;
  --article-h5-size: 1rem;
  --article-h6-size: 0.94rem;
  --article-caption-size: 0.92rem;
  --article-reference-heading-size: 1.64rem;
}

body[data-article-text="large"] .article-reading-layout {
  --article-text-size: 1.46rem;
  --article-summary-size: 1.58rem;
  --article-title-size: clamp(2.82rem, 6.25vw, 4.5rem);
  --article-h1-size: 3.04rem;
  --article-h2-size: 2.42rem;
  --article-h3-size: 1.78rem;
  --article-h4-size: 1.46rem;
  --article-h5-size: 1.32rem;
  --article-h6-size: 1.18rem;
  --article-caption-size: 1.14rem;
  --article-reference-heading-size: 2.28rem;
}

body[data-article-font="wiki"] .article-reading-layout {
  --article-font: sans-serif;
  --article-heading-font: Georgia, "Times New Roman", serif;
}

body[data-article-font="modern"] .article-reading-layout {
  --article-font: "Inter", Arial, sans-serif;
  --article-heading-font: "Inter", Arial, sans-serif;
}

body[data-article-font="serif"] .article-reading-layout {
  --article-font: Georgia, "Times New Roman", serif;
  --article-heading-font: Georgia, "Times New Roman", serif;
}

@media (max-width: 1320px) {
  .article-reading-layout {
    grid-template-columns: 170px minmax(0, 1fr) 160px;
    gap: 22px;
  }

  body[data-article-width="wide"] .article-reading-layout {
    width: calc(100% - 24px);
    grid-template-columns: 180px minmax(0, 1fr) 170px;
    gap: 24px;
  }
}

.article-page {
  width: 100%;
  min-width: 0;
  max-width: none;
  font-family: var(--article-font);
}

.article-page h1 {
  margin: 10px 0 12px;
  font-family: var(--article-heading-font);
  font-size: var(--article-title-size, clamp(2.1rem, 4.8vw, 3.25rem));
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.05;
}

.article-summary {
  color: var(--gray);
  font-family: var(--article-font);
  font-size: var(--article-summary-size, 1.15rem);
}

.article-author {
  font-family: var(--article-font);
}

.article-meta {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 14px;
  margin: 22px 0 30px;
  font-family: var(--article-font);
}

.article-author-card,
.article-contributors {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(215, 25, 32, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(247, 248, 250, 0.9)),
    var(--panel);
  color: var(--black);
  box-shadow: 0 14px 34px rgba(11, 11, 13, 0.08);
}

.article-author-card::before,
.article-contributors::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--red), rgba(215, 25, 32, 0.18));
}

.article-author-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 14px 18px 14px 20px;
}

.article-meta-label {
  color: var(--red);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.article-person {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 9px;
}

.article-person-avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 2px solid rgba(227, 24, 31, 0.45);
  border-radius: 999px;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 10px 22px rgba(215, 25, 32, 0.14);
}

.article-person-text {
  display: grid;
  min-width: 0;
  gap: 1px;
  line-height: 1.2;
}

.article-person-text strong {
  overflow-wrap: anywhere;
  font-size: 0.98rem;
}

.article-person-id {
  color: var(--red);
  font-size: 0.9rem;
  font-weight: 800;
}

.article-person-id:hover {
  text-decoration: underline;
}

.article-person-id.muted {
  color: var(--gray);
  font-weight: 700;
}

.article-contributors {
  min-width: min(320px, 100%);
  max-width: 460px;
}

.article-contributors summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 78px;
  padding: 14px 18px 14px 20px;
  cursor: pointer;
  font-weight: 900;
  list-style: none;
}

.article-contributors summary::-webkit-details-marker {
  display: none;
}

.article-contributors summary::before {
  content: "\25B8";
  color: var(--red);
  font-size: 0.82rem;
}

.article-contributors[open] summary::before {
  content: "\25BE";
}

.article-contributors summary span {
  min-width: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(227, 24, 31, 0.12);
  color: var(--red);
  text-align: center;
  font-size: 0.82rem;
}

.article-contributors ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0 18px 18px 20px;
  list-style: none;
  transform-origin: top;
}

.article-contributors[open] ul {
  animation: contributorsOpen 0.34s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.article-contributors li {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(11, 11, 13, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.article-contributor-note,
.article-contributor-empty {
  color: var(--gray);
  font-size: 0.86rem;
}

@keyframes contributorsOpen {
  from {
    opacity: 0;
    transform: translateY(-8px) scaleY(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scaleY(1);
  }
}

.article-toc {
  position: sticky;
  top: 92px;
  align-self: start;
  padding: 16px;
  color: var(--black);
  border: 1px solid rgba(215, 25, 32, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 248, 250, 0.9)),
    var(--panel);
  box-shadow: 0 14px 34px rgba(11, 11, 13, 0.08);
  font-size: 0.95rem;
}

.toc-heading {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(11, 11, 13, 0.1);
}

.toc-heading strong {
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.article-toc nav {
  display: grid;
  gap: 2px;
  margin-top: 12px;
}

.toc-group {
  display: grid;
  gap: 2px;
  opacity: 0;
  transform: translateX(-8px);
  animation: tocItemReveal 0.46s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--toc-index, 0) * 45ms);
}

.toc-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
}

.toc-toggle,
.toc-toggle-spacer {
  width: 22px;
  height: 30px;
}

.toc-toggle {
  padding: 0;
  border: 0;
  color: var(--red);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
  line-height: 1.4;
  transition:
    color 0.2s ease,
    transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.toc-toggle:hover {
  transform: scale(1.18);
}

.toc-link {
  display: block;
  min-width: 0;
  padding: 6px 8px;
  color: #9f1218;
  border-radius: 6px;
  line-height: 1.35;
  transition:
    background 0.22s ease,
    color 0.22s ease,
    transform 0.24s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.22s ease;
}

.toc-link:hover {
  background: rgba(215, 25, 32, 0.08);
  box-shadow: inset 3px 0 0 var(--red);
  text-decoration: none;
  transform: translateX(3px);
}

.toc-top-link {
  color: var(--black);
  font-weight: 800;
}

.toc-children {
  display: none;
  margin-left: 22px;
  padding-left: 12px;
  border-left: 1px solid rgba(215, 25, 32, 0.18);
  opacity: 0;
  transform: translateY(-4px);
}

.toc-children.is-open {
  display: grid;
  animation: tocChildrenOpen 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes tocItemReveal {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes tocChildrenOpen {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toc-link-child {
  color: #c91a21;
  font-size: 0.86rem;
}

.toc-link-child.level-4,
.toc-link-child.level-5,
.toc-link-child.level-6 {
  padding-left: 14px;
  font-size: 0.8rem;
  color: #d9484e;
}

.toc-link-child.level-5,
.toc-link-child.level-6 {
  padding-left: 22px;
  font-size: 0.76rem;
}

.article-toc.is-empty {
  opacity: 0.78;
}

.article-appearance {
  position: sticky;
  top: 92px;
  align-self: start;
  padding: 16px;
  color: var(--black);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 248, 250, 0.9)),
    var(--panel);
  border: 1px solid rgba(215, 25, 32, 0.14);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(11, 11, 13, 0.08);
  font-size: 0.95rem;
}

.article-appearance .article-toolbar {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
}

.article-appearance .article-toolbar .btn {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  font-size: 0.86rem;
}

.appearance-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(11, 11, 13, 0.1);
}

.appearance-heading strong {
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.article-appearance fieldset {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0 0 16px;
  border: 0;
  border-bottom: 1px solid rgba(11, 11, 13, 0.1);
}

.article-appearance legend {
  margin-bottom: 10px;
  color: var(--gray);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.article-appearance label {
  display: block;
  cursor: pointer;
}

.article-appearance input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.article-appearance label span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 9px 11px;
  border: 1px solid rgba(11, 11, 13, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--black);
  font-weight: 800;
  line-height: 1.2;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.article-appearance label span::after {
  content: "";
  width: 9px;
  height: 9px;
  border: 2px solid rgba(11, 11, 13, 0.22);
  border-radius: 999px;
}

.article-appearance input:checked + span {
  color: #ffffff;
  background: linear-gradient(135deg, #f0444a, var(--red));
  border-color: rgba(215, 25, 32, 0.7);
  box-shadow: 0 10px 22px rgba(215, 25, 32, 0.22);
  transform: translateY(-1px);
}

.article-appearance input:checked + span::after {
  border-color: #ffffff;
  background: #ffffff;
  box-shadow: inset 0 0 0 2px var(--red);
}

body.dark-mode .article-author-card,
body.dark-mode .article-contributors,
body.dark-mode .article-toc,
body.dark-mode .article-appearance {
  border-color: rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(26, 26, 32, 0.96), rgba(18, 18, 23, 0.92)),
    var(--panel);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
}

body.dark-mode .article-contributors li,
body.dark-mode .article-appearance label span {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.045);
}

body.dark-mode .toc-heading,
body.dark-mode .appearance-heading,
body.dark-mode .article-appearance fieldset {
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .toc-link:hover {
  background: rgba(215, 25, 32, 0.18);
}

.article-body {
  position: relative;
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
  min-width: 0;
  font-size: var(--article-text-size, 1.05rem);
  line-height: 1.7;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.article-body p {
  margin: 0 0 18px;
  font-size: inherit;
  line-height: 1.72;
  overflow-wrap: anywhere;
}

.article-body li,
.article-body td,
.article-body th,
.references li {
  font-size: var(--article-text-size, 1.05rem);
  line-height: 1.68;
}

.article-body :where(span, a, strong, em, u, s, mark, small, code, pre, blockquote, figcaption, caption, label, dt, dd) {
  font-size: inherit;
}

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6 {
  margin: 30px 0 12px;
  font-family: var(--article-heading-font);
  font-weight: 500;
  line-height: 1.15;
}

.article-body h1 {
  font-size: var(--article-h1-size, 2.15rem);
}

.article-body h2 {
  font-size: var(--article-h2-size, 1.72rem);
}

.article-body h3 {
  font-family: var(--article-font);
  font-size: var(--article-h3-size, 1.24rem);
  font-weight: 700;
}

.article-body h4 {
  font-family: var(--article-font);
  font-size: var(--article-h4-size, 1.05rem);
  font-weight: 800;
}

.article-body h5 {
  font-family: var(--article-font);
  font-size: var(--article-h5-size, 0.98rem);
  font-weight: 800;
}

.article-body h6 {
  font-family: var(--article-font);
  font-size: var(--article-h6-size, 0.9rem);
  font-weight: 800;
  text-transform: uppercase;
}

.article-body blockquote {
  margin: 18px 0;
  padding: 14px 18px;
  color: var(--gray);
  background: var(--off-white);
  border-left: 4px solid var(--red);
  border-radius: 8px;
}

.article-body pre {
  overflow-x: auto;
  padding: 14px;
  color: #ffffff;
  background: #111114;
  border-radius: 8px;
}

.article-body img {
  display: block;
  max-width: 100%;
  margin: 18px auto;
  border-radius: 8px;
}

.article-body img.is-zoomable {
  cursor: zoom-in;
}

.article-body table {
  width: 100%;
  margin: 20px 0;
  border-collapse: collapse;
  background: var(--panel);
}

.article-body figure figcaption,
.article-body .wiki-media figcaption,
.article-body table caption {
  font-size: var(--article-caption-size, 0.9rem);
  line-height: 1.55;
}

.article-body figure figcaption small,
.article-body .wiki-media figcaption small {
  font-size: 0.86em;
}

.article-body .reference-file-badge {
  font-size: 0.72em;
}

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

.article-body th {
  background: var(--off-white);
}

.article-body::after {
  content: "";
  display: block;
  clear: both;
}

.article-tags {
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  font-family: var(--article-font);
}

.article-tags[hidden] {
  display: none;
}

.article-tags h2 {
  margin: 0 0 14px;
  color: var(--black);
  font-family: var(--article-heading-font);
  font-size: 1.18rem;
  font-weight: 600;
}

.article-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.article-tag {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 11px;
  color: var(--red);
  background: rgba(215, 25, 32, 0.08);
  border: 1px solid rgba(215, 25, 32, 0.18);
  border-radius: 8px;
  font-size: 0.94rem;
  font-weight: 800;
}

.article-body sup a {
  color: var(--red);
  font-weight: 800;
}

.article-body sup,
.article-body sub {
  font-size: 0.72em;
}

.references {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.references h2 {
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #a2a9b1;
  color: #111114;
  font-size: var(--article-reference-heading-size, 1.7rem);
}

body.dark-mode .references h2 {
  border-bottom-color: #5b5d66;
}

body.dark-mode .wiki-canvas .editor-inline-references .references h2 {
  color: #111114;
  border-bottom-color: #a2a9b1;
}

.editor-references .references {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.editor-references .references a,
.editor-references .references .reference-back {
  color: var(--red);
  font-weight: 800;
}

.reference-file-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.reference-file-badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 2px 6px;
  color: #ffffff;
  background: var(--red);
  border-radius: 4px;
  font-family: "Inter", Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
}

.references ol {
  margin: 0;
  padding-left: 22px;
  columns: 2;
  column-gap: 38px;
}

.references li {
  break-inside: avoid;
  margin-bottom: 10px;
  color: #111114;
}

.editor-layout,
.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 22px;
  align-items: start;
}

.wide-editor {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: clamp(16px, 2vw, 28px);
}

.wide-editor .editor-form {
  min-width: 0;
}

.wide-editor .wiki-note {
  position: sticky;
  top: 92px;
}

.editor-form,
.profile-form,
.wiki-note,
.profile-preview {
  padding: 24px;
}

.wide-editor .editor-form {
  padding: clamp(18px, 2.3vw, 30px);
}

.editor-form,
.profile-form {
  display: grid;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}

.editor-meta-row {
  display: grid;
  grid-template-columns: minmax(260px, 420px) 1fr;
  gap: 14px;
}

.tag-editor {
  display: grid;
  gap: 8px;
  min-height: 44px;
  padding: 8px;
  background: var(--white);
  border: 1px solid #d7d7dc;
  border-radius: 8px;
}

.tag-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 10px;
  color: var(--red);
  background: rgba(215, 25, 32, 0.08);
  border: 1px solid rgba(215, 25, 32, 0.2);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.tag-chip:hover {
  background: rgba(215, 25, 32, 0.13);
}

.tag-editor input {
  min-height: 34px;
  padding: 4px 2px;
  border: 0;
  background: transparent;
}

.tag-editor input:focus {
  outline: none;
}

.tag-editor.is-locked {
  opacity: 0.68;
  pointer-events: none;
}

.custom-category-input {
  display: none;
  margin-top: 10px;
}

.custom-category-input.is-visible {
  display: block;
  animation: editorControlReveal 0.26s ease both;
}

.wiki-toolbar {
  position: sticky;
  top: 74px;
  z-index: 8;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(247, 248, 250, 0.9)),
    var(--panel);
  border: 1px solid rgba(215, 25, 32, 0.14);
  border-radius: 8px;
  box-shadow: 0 16px 34px rgba(11, 11, 13, 0.1);
  animation: editorControlReveal 0.34s ease both;
}

.toolbar-menu-group {
  position: relative;
}

.toolbar-menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.toolbar-format-trigger {
  min-width: 122px;
  font-weight: 900;
}

.toolbar-icon-trigger {
  min-width: 58px;
}

.toolbar-menu {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  z-index: 40;
  display: none;
  min-width: 304px;
  max-height: min(560px, 72vh);
  overflow: auto;
  padding: 6px;
  color: var(--black);
  background: var(--panel);
  border: 1px solid rgba(215, 25, 32, 0.14);
  border-radius: 8px;
  box-shadow: var(--shadow);
  animation: editorDropdownOpen 0.2s ease both;
}

.toolbar-menu.is-open {
  display: grid;
  gap: 2px;
}

.toolbar-format-menu {
  min-width: 170px;
}

.toolbar-insert-menu {
  min-width: 286px;
}

.toolbar-menu .toolbar-menu-item {
  width: 100%;
  min-height: 40px;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 10px;
  border: 0;
  color: var(--black);
  background: transparent;
  border-radius: 6px;
  font-weight: 600;
  text-align: left;
}

.toolbar-menu .toolbar-menu-item:hover,
.toolbar-menu .toolbar-menu-item:focus {
  color: var(--black);
  background: var(--off-white);
}

.toolbar-menu-item span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.toolbar-menu-item kbd {
  color: var(--gray);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
}

.toolbar-page-title span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  font-weight: 500;
}

.toolbar-separator {
  width: 1px;
  height: 30px;
  background: rgba(215, 25, 32, 0.18);
}

.wiki-toolbar select {
  width: 170px;
}

.wiki-toolbar button {
  min-width: 42px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid rgba(11, 11, 13, 0.1);
  border-radius: 8px;
  color: var(--black);
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(11, 11, 13, 0.06);
  transition:
    transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.22s ease,
    color 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease;
}

.wiki-toolbar .toolbar-style-button {
  min-width: 44px;
  width: auto;
  height: 42px;
  padding: 8px 6px;
}

.wiki-toolbar .toolbar-style-button sup,
.wiki-toolbar .toolbar-style-button sub {
  font-size: 0.68em;
  line-height: 0;
}

.wiki-toolbar button:hover {
  color: #ffffff;
  background: var(--red);
  border-color: var(--red);
  box-shadow: 0 12px 24px rgba(215, 25, 32, 0.2);
  transform: translateY(-2px);
}

@keyframes editorControlReveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes editorDropdownOpen {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

body.dark-mode .toolbar-menu {
  color: var(--black);
  background: #18181d;
}

body.dark-mode .wiki-toolbar {
  border-color: rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(135deg, rgba(28, 28, 34, 0.96), rgba(20, 20, 25, 0.92)),
    var(--panel);
}

body.dark-mode .wiki-toolbar button {
  color: var(--black);
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.08);
}

body.dark-mode .toolbar-menu .toolbar-menu-item {
  color: var(--black);
}

body.dark-mode .toolbar-menu .toolbar-menu-item:hover,
body.dark-mode .toolbar-menu .toolbar-menu-item:focus {
  background: #22232a;
}

.reference-panel {
  display: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.link-panel,
.media-panel,
.table-panel {
  display: none;
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.link-panel.is-open,
.media-panel.is-open,
.table-panel.is-open,
.reference-panel.is-open {
  display: block;
}

.reference-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.reference-header h3 {
  margin: 0;
}

.reference-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  color: var(--black);
  background: var(--off-white);
  cursor: pointer;
  font-size: 1.5rem;
}

.reference-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--off-white);
}

.reference-tabs button {
  min-height: 42px;
  border: 0;
  color: var(--black);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.reference-tabs button.is-active {
  background: var(--panel);
}

.reference-panel p {
  margin: 12px 14px;
  color: var(--gray);
}

.media-grid,
.table-builder-grid {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.media-size-control {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 110px;
  gap: 10px;
  align-items: center;
}

.media-size-control input[type="range"] {
  padding: 0;
}

.media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.media-actions .btn,
.table-builder-grid .btn {
  width: fit-content;
}

.media-viewer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px 72px;
  background: rgba(0, 0, 0, 0.92);
}

.media-viewer.is-open {
  display: flex;
}

.media-viewer figure {
  max-width: min(1120px, 100%);
  max-height: 92vh;
  margin: 0;
  color: #ffffff;
  text-align: center;
}

.media-viewer img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  background: #ffffff;
}

.media-viewer figcaption {
  margin-top: 12px;
  color: #f4f4f5;
}

.media-viewer-close,
.media-viewer-nav,
.media-viewer-actions a {
  border: 0;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  font-weight: 800;
}

.media-viewer-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  font-size: 2rem;
}

.media-viewer-nav {
  position: absolute;
  top: 50%;
  width: 48px;
  height: 64px;
  transform: translateY(-50%);
  font-size: 2.6rem;
}

.media-viewer-nav.previous {
  left: 16px;
}

.media-viewer-nav.next {
  right: 16px;
}

.media-viewer-actions {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  color: #ffffff;
}

.media-viewer-actions a {
  padding: 8px 12px;
  border-radius: 8px;
}

.link-tab-content {
  display: none;
  padding: 14px;
}

.link-tab-content.is-active {
  display: grid;
  gap: 10px;
}

.link-results {
  display: grid;
  gap: 10px;
  max-height: 340px;
  overflow: auto;
}

.link-result {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--off-white);
}

.link-result img {
  width: 72px;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
}

.link-result-placeholder {
  width: 72px;
  height: 52px;
  border-radius: 6px;
}

.link-result strong {
  display: block;
  margin-bottom: 4px;
}

.link-result p {
  margin: 0;
  color: var(--gray);
  font-size: 0.9rem;
}

.cover-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.reference-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto auto;
  gap: 10px;
  padding: 0 14px 14px;
}

.reference-row .btn {
  width: fit-content;
  white-space: nowrap;
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.editor-preview {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.admin-section {
  padding-top: 0;
}

.admin-submissions {
  display: grid;
  gap: 18px;
}

.writer-admin-section {
  padding-top: 0;
}

.writer-permission-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 10px;
}

.writer-permission-list {
  display: grid;
  gap: 12px;
}

.writer-permission-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  color: var(--black);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(11, 11, 13, 0.06);
}

.writer-permission-card strong,
.writer-permission-card span {
  display: block;
}

.writer-permission-card span {
  margin-top: 4px;
  color: var(--gray);
  font-size: 0.9rem;
  font-weight: 700;
}

.admin-review-card {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.admin-review-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.admin-review-head h2 {
  margin: 8px 0 6px;
  font-size: 1.35rem;
  line-height: 1.25;
}

.admin-review-head p {
  margin: 0;
  color: var(--gray);
}

.admin-badge {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--red);
  font-size: 0.78rem;
  font-weight: 800;
}

.admin-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.admin-diff,
.admin-preview {
  margin-top: 18px;
}

.admin-diff h3,
.admin-preview h3 {
  margin: 0 0 12px;
}

.diff-row {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--off-white);
}

.diff-row + .diff-row {
  margin-top: 12px;
}

.diff-row strong {
  display: block;
  margin-bottom: 10px;
}

.diff-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.diff-columns div {
  min-width: 0;
  padding: 12px;
  border-radius: 8px;
  background: var(--panel);
}

.diff-columns span {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.diff-columns p {
  max-height: 220px;
  margin: 0;
  overflow: auto;
  color: var(--gray);
  white-space: pre-wrap;
}

.diff-visual {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.diff-visual p {
  margin: 0;
  color: var(--black);
  line-height: 1.8;
}

.diff-visual mark {
  display: inline;
  padding: 2px 5px;
  border-radius: 4px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.diff-same {
  color: var(--gray);
  background: transparent;
}

.diff-added {
  color: #14532d;
  background: rgba(34, 197, 94, 0.18);
}

.diff-removed {
  color: #7f1d1d;
  background: rgba(239, 68, 68, 0.18);
  text-decoration: line-through;
}

.diff-row:has(.diff-added):has(.diff-removed) {
  border-color: rgba(234, 88, 12, 0.42);
  box-shadow: inset 4px 0 0 rgba(234, 88, 12, 0.65);
}

.admin-preview {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.wiki-note h2,
.profile-preview h2 {
  margin: 0 0 10px;
}

.wiki-note p,
.profile-preview p {
  color: var(--gray);
}

.profile-preview {
  text-align: center;
}

.profile-preview img {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border: 4px solid var(--red);
  border-radius: 999px;
}

.profile-photo-picker {
  display: grid;
  gap: 8px;
}

.profile-photo-button {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 14px;
  border: 1px solid rgba(215, 25, 32, 0.22);
  border-radius: 8px;
  color: var(--black);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(247, 248, 250, 0.82)),
    var(--panel);
  box-shadow: 0 14px 30px rgba(11, 11, 13, 0.08);
  cursor: pointer;
  transition:
    transform 0.24s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    background 0.22s ease;
}

.profile-photo-button:hover {
  border-color: var(--red);
  box-shadow: 0 18px 36px rgba(215, 25, 32, 0.16);
  transform: translateY(-2px);
}

.profile-photo-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, #f0444a, var(--red));
  box-shadow: 0 10px 20px rgba(215, 25, 32, 0.24);
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1;
}

.profile-photo-button strong,
.profile-photo-button small {
  display: block;
}

.profile-photo-button strong {
  font-size: 0.98rem;
  line-height: 1.2;
}

.profile-photo-button small {
  margin-top: 3px;
  color: var(--gray);
  font-weight: 800;
}

body.dark-mode .profile-photo-button {
  border-color: rgba(215, 25, 32, 0.24);
  background:
    linear-gradient(135deg, rgba(28, 28, 34, 0.94), rgba(20, 20, 25, 0.88)),
    var(--panel);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2);
}

.footer {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px max(16px, calc((100% - 1120px) / 2)) max(24px, env(safe-area-inset-bottom));
  color: #ffffff;
  background: var(--dark);
  overflow: visible;
  width: 100%;
  min-height: 132px;
}

.footer.reveal-on-scroll {
  opacity: 1;
  transform: none;
  filter: none;
}

.footer p {
  margin: 0;
}

.footer a {
  color: #ffb7b7;
  font-weight: 800;
}

.footer-legal {
  flex: 0 1 100%;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.78rem;
}

.footer-legal a {
  color: rgba(255, 255, 255, 0.72);
  font-weight: 700;
}

.footer-legal a:hover {
  color: #ffffff;
}

.legal-page {
  max-width: 880px;
  color: var(--black);
}

.legal-page h1 {
  margin: 12px 0 22px;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1;
}

.legal-page h2 {
  margin: 30px 0 10px;
  font-size: 1.35rem;
}

.legal-page p,
.legal-page li {
  color: var(--gray);
}

.legal-page ul {
  padding-left: 20px;
}

.legal-note {
  margin-top: 34px;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--panel);
  font-size: 0.92rem;
}

.content-consent-panel {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--off-white);
}

.legal-modal-box h2 {
  margin-top: 16px;
}

.admin-legal-meta {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--off-white);
}

.admin-legal-meta p {
  margin: 0;
  color: var(--gray);
}

.admin-editor-note {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(234, 88, 12, 0.34);
  border-radius: 8px;
  background: rgba(234, 88, 12, 0.08);
}

.admin-editor-note strong {
  color: #c2410c;
}

.admin-editor-note p {
  margin: 6px 0 0;
  color: var(--black);
}

.admin-badge.secondary {
  margin-left: 6px;
  background: #5b5f6a;
}

@media (max-width: 1180px) {
  .section.wide-editor {
    width: min(100% - 28px, 960px);
  }

  .calculator-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wide-editor {
    grid-template-columns: 1fr;
  }

  .wide-editor .wiki-note {
    position: static;
  }
}

@media (max-width: 980px) {
  .article-reading-layout {
    grid-template-columns: 1fr;
    gap: 18px;
    width: min(100% - 24px, 760px);
  }

  body[data-article-width="wide"] .article-reading-layout {
    width: min(100% - 24px, 760px);
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .article-page.section {
    width: 100%;
    padding: 40px 0;
  }

  .article-contributors {
    min-width: 0;
    max-width: 100%;
  }

  .article-toc {
    position: static;
    padding: 14px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
  }

  .article-appearance {
    position: static;
    display: grid;
    grid-template-columns: 1fr;
    padding: 14px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
  }

  .article-appearance .article-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .article-appearance fieldset {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .article-appearance legend {
    grid-column: 1 / -1;
  }

  .article-appearance label {
    min-width: 0;
  }

  .navbar {
    flex-wrap: wrap;
    padding: 12px 0;
  }

  .menu-toggle {
    display: block;
    order: 2;
  }

  .header-actions {
    margin-left: auto;
    order: 1;
  }

  .site-search {
    width: 54px;
  }

  .site-search.is-open,
  .site-search:focus-within {
    width: 54px;
  }

  .site-search.is-open .site-search-field,
  .site-search:focus-within .site-search-field {
    width: min(238px, 38vw);
  }

  .nav-links {
    order: 3;
    transform: none;
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-top: 10px;
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a {
    display: block;
    padding: 12px 0;
  }

  .nav-submenu {
    position: static;
    display: grid;
    margin: 0 0 8px;
    box-shadow: none;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    visibility: visible;
  }

  .profile-trigger span {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hero,
  .calculator-feature,
  .editor-layout,
  .profile-layout {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .calculator-feature-text,
  .calculator-feature-grid,
  .home-feature-posts,
  .home-blog-strip .section-heading,
  .home-blog-actions {
    grid-column: auto;
    width: min(100% - 32px, 1120px);
    margin-left: auto;
    margin-right: auto;
  }

  .home-card-grid,
  .home-post-grid {
    grid-template-columns: 1fr;
  }

  .home-visual-card {
    grid-template-rows: 240px 1fr;
  }

  .home-blog-strip {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 20px;
    padding-top: 64px;
    padding-bottom: 64px;
  }

  .home-blog-actions {
    justify-content: flex-start;
  }

  .editor-meta-row,
  .reference-row,
  .cover-row,
  .time-input-row,
  .form-row,
  .writer-permission-form,
  .diff-columns,
  .link-result {
    grid-template-columns: 1fr;
  }

  .admin-review-head {
    display: grid;
  }

  .my-post-card {
    display: grid;
  }

  .writer-permission-card {
    display: grid;
  }

  .admin-review-actions {
    justify-content: flex-start;
  }

  .wiki-toolbar {
    position: static;
  }

  .toolbar-menu {
    left: 0;
    right: auto;
    min-width: min(304px, calc(100vw - 48px));
  }

  .references ol {
    columns: 1;
  }

  .hero {
    padding-top: 56px;
  }

  .hero-media img {
    aspect-ratio: 16 / 10;
  }

  .hero-panel {
    position: static;
    margin-top: 14px;
  }

  .feature-grid,
  .category-grid,
  .blog-grid,
  .calculator-grid,
  .calculator-directory,
  .muscle-grid,
  .social-layout,
  .calculator-category-grid {
    grid-template-columns: 1fr;
  }

  .calculator-detail-layout {
    grid-template-columns: 1fr;
  }

  .social-tabs {
    flex-wrap: wrap;
  }

  .social-tabs .btn {
    flex: 1 1 160px;
  }

  .site-search {
    width: 54px;
    order: 4;
  }

  .site-search.is-open,
  .site-search:focus-within {
    width: 54px;
  }

  .site-search.is-open .site-search-field,
  .site-search:focus-within .site-search-field {
    width: min(250px, calc(100vw - 130px));
  }

  .friend-row {
    grid-template-columns: 52px 1fr;
  }

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

  .friend-row .btn {
    width: 100%;
    grid-column: 1 / -1;
  }

  .request-lists {
    grid-template-columns: 1fr;
  }

  .request-status {
    width: 100%;
    grid-column: 1 / -1;
    text-align: center;
  }

  #message-thread {
    max-height: 58vh;
  }
}

@media (max-width: 760px) {
  .home-hero {
    gap: 26px;
    padding-top: 44px;
    padding-bottom: 40px;
  }

  .hero-media img,
  .home-hero-media img {
    aspect-ratio: 16 / 11;
  }

  .page-hero.section {
    padding-top: 48px;
    padding-bottom: 42px;
  }

  .hero-content h1,
  .page-hero h1 {
    font-size: clamp(2rem, 9vw, 2.7rem);
    line-height: 1.06;
  }

  .section-heading h2,
  .calculator-feature-text h2 {
    font-size: clamp(1.65rem, 7vw, 2.25rem);
  }

  .calculator-feature {
    gap: 24px;
    padding-top: 56px;
    padding-bottom: 56px;
  }

  .calculator-category-grid,
  .calculator-feature-grid {
    grid-template-columns: 1fr;
  }

  .feature-card,
  .category-card,
  .post-card,
  .calculator-card,
  .calculator-link-card,
  .calculator-info-block,
  .social-panel,
  .editor-form,
  .profile-form,
  .wiki-note,
  .profile-preview {
    padding: 18px;
  }

  .category-card,
  .calc-category,
  .calculator-link-card {
    min-height: auto;
  }

  .calculator-card-cover {
    width: calc(100% + 36px);
    margin: -18px -18px 8px;
  }

  .reference-tabs button {
    padding: 9px 8px;
    font-size: 0.86rem;
    line-height: 1.2;
  }

  .toolbar-menu {
    position: fixed;
    top: auto;
    right: 14px;
    bottom: 14px;
    left: 14px;
    width: auto;
    min-width: 0;
    max-height: min(70vh, 460px);
  }

  .toolbar-format-menu,
  .toolbar-insert-menu {
    min-width: 0;
  }

  .media-viewer {
    padding: 56px 14px 74px;
  }

  .media-viewer figure {
    max-height: calc(100vh - 130px);
  }

  .media-viewer img {
    max-height: calc(100vh - 190px);
  }

  .media-viewer-nav {
    top: auto;
    bottom: 14px;
    width: 42px;
    height: 42px;
    transform: none;
    font-size: 1.8rem;
  }

  .media-viewer-nav.previous {
    left: 14px;
  }

  .media-viewer-nav.next {
    right: 14px;
  }

  .media-viewer-actions {
    right: 64px;
    bottom: 14px;
    left: 64px;
    justify-content: center;
    flex-wrap: wrap;
  }
}

@media (max-width: 560px) {
  .section {
    width: min(100% - 24px, 1120px);
    padding: 56px 0;
  }

  .navbar {
    width: calc(100% - 24px);
    gap: 12px;
  }

  .header-actions {
    min-width: 0;
    gap: 6px;
  }

  .theme-toggle,
  .menu-toggle {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
  }

  .wiki-canvas {
    font-size: 1rem;
  }

  .wiki-media.align-left,
  .wiki-media.align-right {
    float: none;
    width: min(320px, 100%);
    max-width: 100%;
    margin: 16px auto;
  }

  .wiki-canvas .wiki-media.align-free {
    left: auto !important;
    top: auto !important;
    position: static;
    width: min(320px, 100%) !important;
    max-width: 100%;
    margin: 16px auto;
  }

  .article-body .wiki-media.align-free {
    position: static;
    width: min(320px, 100%) !important;
    max-width: 100%;
    margin: 16px auto;
  }

  .media-size-control {
    grid-template-columns: 1fr;
  }

  .logo {
    font-size: 1.2rem;
  }

  .login-button {
    max-width: 38vw;
    padding: 9px 10px;
    font-size: 0.88rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hero-content h1,
  .page-hero h1 {
    font-size: clamp(1.9rem, 11vw, 2.35rem);
  }

  .hero-text,
  .page-hero p:not(.eyebrow) {
    font-size: 1rem;
  }

  .hero-panel {
    grid-template-columns: 1fr;
  }

  .calculator-feature-grid {
    grid-template-columns: 1fr;
  }

  .home-visual-card {
    grid-template-rows: 190px 1fr;
  }

  .toolbar-menu {
    position: fixed;
    top: auto;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
    min-width: 0;
    max-height: min(70vh, 460px);
  }

  .toolbar-format-menu,
  .toolbar-insert-menu {
    min-width: 0;
  }

  .reference-tabs {
    grid-template-columns: 1fr;
  }

  .article-appearance .article-toolbar,
  .article-appearance fieldset {
    grid-template-columns: 1fr;
  }

  .hero-panel div {
    padding-right: 0;
    padding-bottom: 12px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  }

  .hero-panel div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .hero-actions,
  .article-toolbar,
  .editor-actions,
  .media-actions,
  .footer {
    flex-direction: column;
  }

  .footer-legal {
    flex: 0 0 auto;
    width: 100%;
    flex-direction: column;
    gap: 8px;
  }

  .social-tabs {
    display: grid;
    grid-template-columns: 1fr;
  }

  .message {
    max-width: 92%;
  }

  .message-person {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .message-person img {
    width: 38px;
    height: 38px;
  }

  .btn {
    width: 100%;
  }

  .btn:hover {
    transform: translateY(-1px) scale(1.01);
  }

  .footer {
    align-items: flex-start;
  }
}

@media (max-width: 420px) {
  .section {
    width: min(100% - 20px, 1120px);
    padding: 44px 0;
  }

  .split-section > *,
  .posts-section > *,
  .calculators-section > *,
  .calculator-feature-text,
  .calculator-feature-grid,
  .home-feature-posts,
  .home-blog-strip .section-heading,
  .home-blog-actions {
    width: calc(100% - 20px);
  }

  .navbar {
    width: calc(100% - 18px);
    gap: 8px;
  }

  .logo {
    font-size: 1.08rem;
  }

  .theme-toggle,
  .menu-toggle {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .login-button {
    max-width: 35vw;
    min-height: 38px;
    padding: 8px;
    font-size: 0.78rem;
  }

  .nav-links {
    max-height: calc(100vh - 86px);
    overflow-y: auto;
  }

  .hero-content h1,
  .page-hero h1 {
    font-size: 1.9rem;
  }

  .section-heading h2,
  .calculator-feature-text h2 {
    font-size: 1.55rem;
  }

  .home-visual-card div,
  .calculator-feature-grid div,
  .feature-card,
  .category-card,
  .post-card,
  .calculator-card,
  .calculator-link-card,
  .calculator-info-block,
  .social-panel,
  .editor-form,
  .profile-form,
  .wiki-note,
  .profile-preview,
  .auth-box {
    padding: 16px;
  }

  .wide-editor .editor-form {
    padding: 16px;
  }

  .calculator-card-cover {
    width: calc(100% + 32px);
    margin: -16px -16px 8px;
  }

  .wiki-canvas {
    min-height: 420px;
    padding: 16px;
  }

  .auth-modal {
    padding: 12px;
  }
}

@media print {
  .site-header,
  .footer,
  .no-print {
    display: none !important;
  }

  body {
    color: #000000;
    background: #ffffff;
  }

  .section,
  .article-page {
    width: 100%;
    max-width: none;
    padding: 0;
  }
}

.pdf-exporting .no-print {
  display: none !important;
}

.pdf-export-holder {
  position: fixed;
  left: 0;
  top: 0;
  z-index: -1;
  width: 184mm;
  background: #ffffff;
  opacity: 0;
  pointer-events: none;
}

.pdf-document {
  width: 184mm;
  max-width: none;
  padding: 0;
  color: #111111;
  background: #ffffff;
  font-family: var(--article-font, "Inter", Arial, sans-serif);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pdf-document,
.pdf-document * {
  color: #111111 !important;
}

.pdf-document .eyebrow {
  margin: 0 0 8px;
  color: #111111 !important;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pdf-document h1 {
  margin: 0 0 10px;
  color: #111111;
  font-family: var(--article-heading-font, "Inter", Arial, sans-serif);
  font-size: clamp(22px, 6.8vw, 30px);
  line-height: 1.12;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pdf-document .article-summary {
  margin: 0 0 14px;
  color: #111111 !important;
  font-family: var(--article-font, "Inter", Arial, sans-serif);
  font-size: 11.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pdf-document .article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 22px;
}

.pdf-document .article-author-card,
.pdf-document .article-contributors {
  max-width: 100%;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: none;
}

.pdf-document .article-author-card {
  min-height: 58px;
  padding: 10px 12px;
}

.pdf-document .article-contributors summary {
  min-height: 58px;
  padding: 10px 12px;
}

.pdf-document .article-contributors ul {
  padding: 0 12px 12px;
}

.pdf-document .article-person-avatar {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
}

.pdf-document .article-meta-label,
.pdf-document .article-person-id,
.pdf-document .article-contributor-note,
.pdf-document .article-contributor-empty {
  font-size: 11px;
}

.pdf-document .article-body {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #e4e4e7;
  font-family: var(--article-font, "Inter", Arial, sans-serif);
  font-size: 10.8px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pdf-document .article-body p,
.pdf-document .references li {
  color: #111111;
  font-size: 10.8px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pdf-document .article-body h1,
.pdf-document .article-body h2,
.pdf-document .article-body h3,
.pdf-document .article-body h4,
.pdf-document .article-body h5,
.pdf-document .article-body h6,
.pdf-document .references h2 {
  break-after: avoid;
  page-break-after: avoid;
  color: #111111;
  font-family: var(--article-heading-font, "Inter", Arial, sans-serif);
  line-height: 1.18;
}

.pdf-document .article-body h1 {
  font-size: 21px;
}

.pdf-document .article-body h2,
.pdf-document .references h2 {
  margin-top: 22px;
  padding-bottom: 7px;
  border-bottom: 1px solid #e4e4e7;
  font-size: 17px;
}

.pdf-document .article-body h3 {
  font-size: 14px;
}

.pdf-document .article-body h4 {
  font-size: 12.5px;
}

.pdf-document .article-body h5 {
  font-size: 11.5px;
}

.pdf-document .article-body h6 {
  font-size: 10.8px;
}

.pdf-document figure,
.pdf-document table,
.pdf-document blockquote,
.pdf-document .references li {
  break-inside: avoid;
  page-break-inside: avoid;
}

.pdf-document img {
  max-width: 100%;
  max-height: 96mm;
  object-fit: contain;
}

.pdf-document table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 10.5px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pdf-document th,
.pdf-document td {
  border: 1px solid #e4e4e7;
  padding: 6px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pdf-document blockquote {
  margin: 18px 0;
  padding: 12px 16px;
  border-left: 4px solid #d71920;
  background: #f6f6f7;
}

.pdf-document figure figcaption,
.pdf-document .wiki-media figcaption,
.pdf-document table caption {
  color: #111111 !important;
  font-size: 9.5px;
}

.pdf-document .pdf-image-placeholder {
  margin: 10px 0;
  padding: 8px 10px;
  border: 1px solid #dddddd;
  background: #f6f6f7;
  color: #111111 !important;
  font-size: 9.5px;
}

.pdf-document .references {
  margin-top: 22px;
  padding-top: 12px;
  border-top: 1px solid #e4e4e7;
}

.pdf-document .references ol {
  columns: 1;
  padding-left: 18px;
}
