@font-face {
  font-family: "Vazirmatn";
  src: url("/fonts/Vazirmatn-UI-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vazirmatn";
  src: url("/fonts/Vazirmatn-UI-Bold.woff2") format("woff2");
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f2f5f4;
  --panel: #fbfdfc;
  --panel-strong: #f7faf8;
  --panel-2: #e8efec;
  --field-bg: #f8fbf9;
  --media-bg: #e3eae7;
  --text: #14211d;
  --article-text: #21332c;
  --muted: #586b63;
  --muted-strong: #40554c;
  --line: #d1dbd7;
  --line-strong: #aebeb8;
  --accent: #08765d;
  --accent-hover: #065e4a;
  --accent-soft: #dceee8;
  --accent-contrast: #f4fffb;
  --danger: #ad243a;
  --danger-hover: #8c1c2e;
  --danger-button: #ad243a;
  --danger-button-hover: #8c1c2e;
  --danger-contrast: #fff8f8;
  --danger-soft: #f8e6e9;
  --topbar-bg: rgb(242 245 244 / .94);
  --focus-ring: rgb(8 118 93 / .28);
  --shadow-soft: 0 1px 2px rgb(15 38 30 / .06);
  --shadow-lift: 0 16px 38px rgb(15 38 30 / .09);
  --radius-card: 14px;
  --radius-control: 8px;
  --radius-media: 10px;
  --content-width: 1280px;
  --article-width: 840px;
  --page-gutter: clamp(16px, 3vw, 40px);
  --font-ui: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: var(--font-ui);
}

:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b110f;
  --panel: #111a17;
  --panel-strong: #151f1c;
  --panel-2: #1a2722;
  --field-bg: #101815;
  --media-bg: #09100e;
  --text: #edf5f1;
  --article-text: #d9e7e1;
  --muted: #a6b8b1;
  --muted-strong: #c0d0ca;
  --line: #293a34;
  --line-strong: #41564e;
  --accent: #66c7a9;
  --accent-hover: #84d6bc;
  --accent-soft: #173a30;
  --accent-contrast: #08120f;
  --danger: #ef7b8d;
  --danger-hover: #ff9baa;
  --danger-button: #a93147;
  --danger-button-hover: #c64259;
  --danger-contrast: #fff8f8;
  --danger-soft: #3a1b23;
  --topbar-bg: rgb(11 17 15 / .94);
  --focus-ring: rgb(102 199 169 / .32);
  --shadow-soft: 0 1px 2px rgb(0 0 0 / .24);
  --shadow-lift: 0 18px 44px rgb(0 0 0 / .28);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #0b110f;
    --panel: #111a17;
    --panel-strong: #151f1c;
    --panel-2: #1a2722;
    --field-bg: #101815;
    --media-bg: #09100e;
    --text: #edf5f1;
    --article-text: #d9e7e1;
    --muted: #a6b8b1;
    --muted-strong: #c0d0ca;
    --line: #293a34;
    --line-strong: #41564e;
    --accent: #66c7a9;
    --accent-hover: #84d6bc;
    --accent-soft: #173a30;
    --accent-contrast: #08120f;
    --danger: #ef7b8d;
    --danger-hover: #ff9baa;
    --danger-button: #a93147;
    --danger-button-hover: #c64259;
    --danger-contrast: #fff8f8;
    --danger-soft: #3a1b23;
    --topbar-bg: rgb(11 17 15 / .94);
    --focus-ring: rgb(102 199 169 / .32);
    --shadow-soft: 0 1px 2px rgb(0 0 0 / .24);
    --shadow-lift: 0 18px 44px rgb(0 0 0 / .28);
  }
}

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

html {
  min-width: 320px;
  background: var(--bg);
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  scrollbar-gutter: stable;
}

html[lang="ar"],
html[lang="fa"],
html[lang="he"] {
  font-family: "Vazirmatn", var(--font-ui);
}

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  overflow-wrap: break-word;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  min-height: calc(100dvh - 154px);
}

::selection {
  background: var(--accent-soft);
  color: var(--text);
}

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

img,
video {
  display: block;
}

a {
  color: inherit;
  text-underline-offset: .18em;
  text-decoration-thickness: .08em;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a,
input,
textarea,
select,
[contenteditable="true"] {
  -webkit-tap-highlight-color: transparent;
}

:where(a, button, input, textarea, select, [contenteditable="true"]):focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

:where(a, button):active {
  transform: translateY(1px);
}

.skip-link {
  position: fixed;
  inset-block-start: 8px;
  inset-inline-start: 8px;
  z-index: 100;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-control);
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-160%);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

h1,
h2,
h3,
h4,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3,
h4 {
  color: var(--text);
  font-weight: 800;
  letter-spacing: -.025em;
  text-wrap: balance;
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4 {
  letter-spacing: 0;
  line-height: 1.25;
}

time,
code,
pre,
kbd,
samp,
input[type="url"],
input[type="email"] {
  font-variant-numeric: tabular-nums;
}

html[dir="rtl"] :where(code, pre, kbd, samp, input[type="url"], input[type="email"], a[href^="http"]) {
  direction: ltr;
  unicode-bidi: isolate;
}

/* Header */

.topbar {
  position: sticky;
  inset-block-start: 0;
  z-index: 20;
  min-height: 70px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(190px, 300px) auto;
  align-items: center;
  gap: clamp(8px, 1.4vw, 20px);
  padding: 10px var(--page-gutter);
  border-block-end: 1px solid var(--line);
  background: var(--topbar-bg);
  box-shadow: 0 1px 0 rgb(255 255 255 / .04);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
}

.brand,
.navlinks,
.lang-switcher,
.post-langs,
.footer {
  display: flex;
  align-items: center;
}

.brand {
  min-width: max-content;
  gap: 10px;
  color: var(--text);
  font-size: 15px;
  font-weight: 850;
  letter-spacing: -.01em;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--panel);
  color: var(--accent);
  box-shadow: var(--shadow-soft);
  font-family: var(--font-ui);
  font-size: 19px;
  line-height: 1;
}

.navlinks {
  min-width: 0;
  justify-content: center;
  gap: 2px;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.navlinks a,
.nav-logout button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  color: inherit;
  text-decoration: none;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.navlinks a:hover,
.nav-logout button:hover {
  border-color: var(--line);
  background: var(--panel);
  color: var(--text);
}

.navlinks a[aria-current="page"] {
  border-color: var(--line);
  background: var(--accent-soft);
  color: var(--accent);
}

.nav-logout {
  margin: 0;
}

.nav-logout button {
  width: auto;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  font: inherit;
}

.top-search {
  width: 100%;
  max-width: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 0;
  justify-self: stretch;
}

.top-search input {
  min-height: 40px;
  padding-inline: 12px;
  border-start-end-radius: 0;
  border-end-end-radius: 0;
  border-inline-end: 0;
  background: var(--field-bg);
}

.top-search button {
  width: 40px;
  min-height: 40px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-start-start-radius: 0;
  border-end-start-radius: 0;
  background: var(--panel);
  color: var(--muted);
}

.top-search button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.top-search svg {
  width: 17px;
  height: 17px;
}

.lang-switcher,
.post-langs {
  gap: 5px;
}

.lang-switcher {
  justify-content: flex-end;
}

.flag-link,
.theme-toggle,
.post-langs a {
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--panel);
  color: var(--muted);
  box-shadow: var(--shadow-soft);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.flag-link {
  position: relative;
  width: 34px;
  height: 34px;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
}

.flag-link:hover,
.theme-toggle:hover,
.post-langs a:hover {
  border-color: var(--line-strong);
  background: var(--panel-strong);
  color: var(--text);
}

.flag-link.active,
.post-langs .active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.flag-link img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.flag-link span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.theme-toggle {
  width: 34px;
  height: 34px;
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  cursor: pointer;
}

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

.sun-icon {
  display: none;
}

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

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

/* Publication masthead */

.hero,
.page-head {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding: clamp(34px, 5vw, 64px) var(--page-gutter) 24px;
}

.hero {
  display: grid;
  justify-items: start;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  line-height: 1.3;
  text-transform: uppercase;
}

html[dir="rtl"] .eyebrow {
  letter-spacing: 0;
  text-transform: none;
}

h1 {
  max-width: 1000px;
  margin: 0;
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1.02;
}

.lede,
.summary,
.page-head p {
  max-width: 720px;
  margin-block: 14px 0;
  color: var(--muted-strong);
  font-size: clamp(17px, 1.7vw, 20px);
  line-height: 1.55;
  text-wrap: pretty;
}

.category-strip {
  width: calc(100% - (2 * var(--page-gutter)));
  max-width: calc(var(--content-width) - (2 * var(--page-gutter)));
  margin: 0 auto 24px;
  padding-block: 9px;
  display: flex;
  gap: 3px;
  overflow-x: auto;
  border-block: 1px solid var(--line);
  scrollbar-width: thin;
}

.category-strip a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: var(--radius-control);
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .16s ease, color .16s ease, transform .16s ease;
}

.category-strip a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.category-strip a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

/* Home lead and news rail */

.news-front {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto clamp(36px, 5vw, 58px);
  padding-inline: var(--page-gutter);
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, .85fr);
  gap: 20px;
  align-items: stretch;
}

.lead-story,
.front-rail,
.featured-card,
.post-card,
.utility-card,
.search-result,
.comment-card,
.comment-form,
.tweet-card,
.quote-card,
.advanced-search,
.admin-card,
.stat-card,
.cms-list,
.cms-editor,
.cms-subpanel,
.application-row {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.lead-story {
  min-width: 0;
  overflow: hidden;
}

.lead-story a {
  height: 100%;
  min-height: 480px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
  color: inherit;
  text-decoration: none;
}

.lead-story.no-media a {
  min-height: 380px;
  grid-template-columns: 1fr;
  background: linear-gradient(145deg, var(--panel-strong), var(--accent-soft));
}

.lead-story.no-media .lead-copy {
  max-width: 800px;
}

.lead-media {
  position: relative;
  min-height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--media-bg);
}

.lead-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .24s ease, opacity .24s ease;
}

.lead-story:hover .lead-media img {
  transform: scale(1.015);
  opacity: .96;
}

.lead-copy {
  min-width: 0;
  padding: clamp(24px, 3vw, 38px);
  display: grid;
  align-content: center;
  gap: 13px;
}

.lead-copy span,
.rail-story span,
.latest-item span,
.search-result span,
.featured-card span,
.post-card span,
.utility-card span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .09em;
  line-height: 1.3;
  text-transform: uppercase;
}

html[dir="rtl"] :where(.lead-copy span, .rail-story span, .latest-item span, .search-result span, .featured-card span, .post-card span, .utility-card span) {
  letter-spacing: 0;
  text-transform: none;
}

.lead-copy h2 {
  margin: 0;
  font-size: clamp(30px, 3.4vw, 46px);
  line-height: 1.04;
}

.lead-copy p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 17px;
  line-height: 1.55;
  text-wrap: pretty;
}

.lead-copy time,
.rail-story time,
.latest-item time,
.search-result time,
.post-card time {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.front-rail {
  min-width: 0;
  padding: 18px;
  display: grid;
  align-content: start;
  overflow: clip;
}

.front-rail-head {
  padding-block-end: 13px;
  border-block-end: 1px solid var(--line);
  color: var(--text);
  font-size: 17px;
  font-weight: 850;
}

.rail-story {
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.rail-story + .rail-story {
  border-block-start: 1px solid var(--line);
}

.rail-story a {
  min-width: 0;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 13px;
  align-items: center;
  padding-block: 15px;
  color: inherit;
  text-decoration: none;
}

.rail-story img {
  width: 104px;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-media);
  background: var(--media-bg);
}

.rail-story:not(:has(img)) a {
  grid-template-columns: 1fr;
}

.rail-story h3 {
  margin: 4px 0 8px;
  font-size: 16px;
  line-height: 1.25;
}

.rail-story a:hover h3,
.latest-item a:hover h2,
.search-result a:hover h2,
.post-card a:hover h2,
.featured-card a:hover h2 {
  color: var(--accent);
}

/* Section labels and archives */

.section-kicker {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--page-gutter) 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  color: var(--muted);
}

.section-kicker span,
.section-kicker h2 {
  margin: 0;
  color: var(--text);
  font-size: 19px;
  font-weight: 850;
  letter-spacing: -.02em;
}

.section-kicker a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--panel);
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.section-kicker a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.latest-kicker {
  margin-top: 4px;
}

.latest-list {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--page-gutter) 64px;
  display: grid;
}

.latest-item {
  min-width: 0;
  border-block-start: 1px solid var(--line);
  background: transparent;
  content-visibility: auto;
  contain-intrinsic-block-size: auto 176px;
}

.latest-item:last-child {
  border-block-end: 1px solid var(--line);
}

.latest-item a {
  min-height: 176px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: clamp(18px, 3vw, 34px);
  align-items: center;
  padding-block: 22px;
  color: inherit;
  text-decoration: none;
}

.latest-item h2,
.search-result h2 {
  margin: 7px 0;
  font-size: clamp(21px, 2.2vw, 28px);
  line-height: 1.16;
  transition: color .16s ease;
}

.latest-item p,
.search-result p {
  max-width: 72ch;
  margin: 0 0 9px;
  color: var(--muted-strong);
  line-height: 1.5;
}

.latest-item img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  align-self: center;
  border-radius: var(--radius-media);
  background: var(--media-bg);
  object-fit: cover;
}

.latest-item:not(:has(img)) a {
  grid-template-columns: 1fr;
}

/* Category and legacy featured grids */

.post-grid {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--page-gutter) 64px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

.post-card {
  min-width: 0;
  grid-column: span 5;
  overflow: hidden;
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.post-card:nth-child(4n + 1),
.post-card:nth-child(4n + 4) {
  grid-column: span 7;
}

.post-card:hover,
.featured-card:hover,
.utility-card:hover,
.search-result:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
}

.post-card a {
  height: 100%;
  display: block;
  padding: 16px;
  color: inherit;
  text-decoration: none;
}

.post-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  margin-block-end: 15px;
  border-radius: var(--radius-media);
  background: var(--media-bg);
  object-fit: cover;
}

.post-card h2 {
  margin: 9px 0;
  font-size: clamp(21px, 2.2vw, 28px);
  line-height: 1.16;
  transition: color .16s ease;
}

.post-card p,
.post-card time,
.empty {
  color: var(--muted);
}

.post-card p {
  margin: 0 0 10px;
  line-height: 1.5;
}

.featured-section {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto 36px;
}

.featured-grid {
  padding-inline: var(--page-gutter);
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, .8fr);
  gap: 18px;
}

.featured-card {
  min-width: 0;
  overflow: hidden;
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.featured-card:first-child {
  grid-row: span 2;
}

.featured-card a {
  height: 100%;
  min-height: 300px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, .85fr);
  color: inherit;
  text-decoration: none;
}

.featured-card:not(:first-child) a {
  min-height: 150px;
  grid-template-columns: 140px minmax(0, 1fr);
}

.featured-card img {
  width: 100%;
  height: 100%;
  background: var(--media-bg);
  object-fit: cover;
}

.featured-card div {
  min-width: 0;
  padding: 20px;
  display: grid;
  align-content: center;
  gap: 8px;
}

.featured-card h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.08;
  transition: color .16s ease;
}

.featured-card:not(:first-child) h2 {
  font-size: 19px;
}

.featured-card p {
  margin: 0;
  color: var(--muted);
}

/* Article reading surface */

.article {
  width: 100%;
  max-width: calc(var(--article-width) + (2 * var(--page-gutter)));
  margin-inline: auto;
  padding: clamp(38px, 6vw, 76px) var(--page-gutter) 54px;
  text-align: start;
}

.article h1 {
  max-width: 100%;
  margin-inline: 0 auto;
  font-size: clamp(34px, 4.7vw, 58px);
  line-height: 1.08;
  text-align: start;
}

html[dir="rtl"] .article h1 {
  font-size: clamp(32px, 4.2vw, 52px);
  line-height: 1.22;
}

.article .summary {
  max-width: 760px;
  margin-inline: 0 auto;
  text-align: start;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-block-end: 14px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .05em;
  text-align: start;
  text-transform: uppercase;
}

.article-meta a {
  color: inherit;
  text-decoration: none;
}

.article-meta a:hover {
  color: var(--text);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-block-end: 18px;
  color: var(--muted);
  font-size: 13px;
}

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

.breadcrumbs a:hover {
  color: var(--accent);
}

html[dir="rtl"] .article-meta {
  letter-spacing: 0;
  text-transform: none;
}

.article .post-langs,
.article .share-buttons {
  justify-content: flex-start;
}

.post-hero {
  width: 100%;
  max-height: min(720px, 72dvh);
  margin: 28px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--media-bg);
  object-fit: contain;
}

.article-body {
  color: var(--article-text);
  font-size: clamp(18px, 1.7vw, 20px);
  line-height: 1.78;
  text-align: start;
  text-wrap: pretty;
}

.article-body p {
  margin: 0 0 1.25em;
}

.article-body h2,
.article-body h3,
.article-body h4 {
  margin: 1.8em 0 .65em;
  line-height: 1.22;
  text-align: start;
}

.article-body h2 {
  font-size: clamp(26px, 3vw, 36px);
}

.article-body h3 {
  font-size: clamp(22px, 2.4vw, 29px);
}

.article-body ul,
.article-body ol {
  margin: 0 0 1.35em;
  padding-inline-start: 1.4em;
  text-align: start;
}

.article-body li + li {
  margin-block-start: .5em;
}

.article-body a {
  color: var(--accent);
  font-weight: 650;
}

.article-body a:hover {
  color: var(--accent-hover);
}

.article-body blockquote {
  margin: 1.6em 0;
  padding: 18px 20px;
  border: 0;
  border-inline-start: 4px solid var(--accent);
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 1.05em;
  font-weight: 650;
  line-height: 1.65;
  text-align: start;
}

html[dir="rtl"] .article-body blockquote {
  border-radius: var(--radius-card) 0 0 var(--radius-card);
}

.article-body blockquote + p {
  margin-block-start: 1.4em;
}

.article-body blockquote br {
  display: block;
  content: "";
  margin-block-start: 8px;
}

.article-body pre {
  max-width: 100%;
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--panel-2);
  font-family: var(--font-mono);
  font-size: .82em;
  line-height: 1.55;
  text-align: start;
}

.article-body code {
  font-family: var(--font-mono);
  font-size: .88em;
}

.article-body table {
  width: 100%;
  max-width: 100%;
  margin: 1.5em 0;
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: .86em;
  text-align: start;
  white-space: nowrap;
}

.article-body th,
.article-body td {
  padding: 10px 12px;
  border-block-end: 1px solid var(--line);
  text-align: start;
  vertical-align: top;
}

.article-body th {
  color: var(--text);
  font-weight: 800;
}

.article-body hr {
  margin: 2.2em 0;
  border: 0;
  border-block-start: 1px solid var(--line);
}

.article-body figure {
  margin: 1.5em 0;
}

.article-body figcaption {
  margin-block-start: 8px;
  color: var(--muted);
  font-size: .78em;
  line-height: 1.5;
}

.power-loop-embed {
  margin: 30px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--panel);
}

.power-loop-embed iframe {
  width: 100%;
  min-height: min(760px, 86dvh);
  display: block;
  border: 0;
}

.source-link,
.tweet-source {
  color: var(--muted);
}

.muted {
  color: var(--muted);
}

.source-link a {
  color: var(--accent);
  font-weight: 700;
}

.share-buttons,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 8px;
  padding: 0;
}

.share-buttons a,
.tag-list li {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--panel);
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.tag-list li {
  list-style: none;
  min-height: 34px;
  background: var(--panel-2);
}

.share-button {
  gap: 8px;
}

.share-button svg,
.quote-x svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.share-buttons a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.post-langs {
  flex-wrap: wrap;
  margin-block-start: 18px;
}

.post-langs a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 6px 9px;
}

/* Article comments */

.comments {
  width: 100%;
  max-width: calc(var(--article-width) + (2 * var(--page-gutter)));
  margin: 0 auto 72px;
  padding-inline: var(--page-gutter);
}

.comments-head {
  margin-block-end: 16px;
  padding-block-start: 28px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  border-block-start: 1px solid var(--line);
}

.comments-head h2 {
  margin: 3px 0 0;
  font-size: clamp(27px, 3.4vw, 38px);
  line-height: 1.1;
}

.comments-head > span {
  min-width: 40px;
  min-height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--panel);
  color: var(--muted);
  font-weight: 850;
}

.comment-list,
.comment-thread,
.comment-children {
  display: grid;
}

.comment-list {
  gap: 12px;
  margin-block-end: 18px;
}

.comment-thread,
.comment-children {
  gap: 10px;
}

.comment-children {
  margin-inline-start: 22px;
  padding-inline-start: 14px;
  border-inline-start: 2px solid var(--line);
}

.comment-card {
  padding: 16px;
}

.comment-card header {
  margin-block-end: 9px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.comment-card time {
  color: var(--muted);
  font-size: 13px;
}

.comment-card p {
  margin: 0 0 10px;
  color: var(--article-text);
}

.comment-card p:last-child {
  margin-block-end: 0;
}

.comment-actions,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.comment-actions {
  margin-block-start: 12px;
}

.comment-actions button,
.comment-reply-context button {
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: var(--field-bg);
  color: var(--muted-strong);
}

.comment-actions button:hover,
.comment-reply-context button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.comment-form {
  padding: clamp(16px, 3vw, 24px);
  display: grid;
  gap: 12px;
}

.comment-form h3,
.comment-form > p {
  margin: 0;
}

.comment-form > p {
  color: var(--muted);
}

.comment-reply-context,
.comment-identity {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--panel-2);
}

.comment-reply-context {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.comment-reply-context[hidden] {
  display: none;
}

.comment-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* Pagination */

.pagination {
  width: 100%;
  max-width: var(--content-width);
  margin: -28px auto 72px;
  padding-inline: var(--page-gutter);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.page-link,
.page-ellipsis {
  min-width: 40px;
  min-height: 40px;
  padding: 8px 11px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--panel);
  color: var(--muted-strong);
  font-weight: 700;
  text-decoration: none;
}

.page-link:hover:not(.disabled),
.page-link.active {
  border-color: var(--accent);
  color: var(--accent);
}

.page-link.active {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.page-link.disabled,
.page-ellipsis {
  background: var(--panel-strong);
  color: var(--muted);
  cursor: default;
}

/* Source and media evidence */

.media-gallery,
.inline-media {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.media-gallery {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.media-gallery img,
.media-gallery video,
.inline-media img,
.inline-media video {
  width: 100%;
  max-height: 620px;
  border: 1px solid var(--line);
  border-radius: var(--radius-media);
  background: var(--media-bg);
  object-fit: contain;
}

.inline-media {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.inline-media img,
.inline-media video {
  max-height: 420px;
}

.tweet-source {
  width: 100%;
  max-width: calc(var(--article-width) + (2 * var(--page-gutter)));
  margin: 0 auto 72px;
  padding-inline: var(--page-gutter);
  display: grid;
  gap: 14px;
}

.tweet-source h2 {
  margin: 0 0 4px;
  color: var(--text);
}

.tweet-card {
  padding: 16px;
}

.tweet-embed-card,
.embedded-tweet {
  min-width: 0;
  overflow: hidden;
}

.tweet-card header,
.quote-card header {
  margin-block-end: 10px;
  display: grid;
  gap: 2px;
}

.tweet-card header a,
.quote-card header a {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.tweet-text {
  color: var(--article-text);
}

.tweet-text p {
  margin: 0 0 12px;
}

.source-badge {
  width: fit-content;
  margin: 0 0 10px;
  padding: 5px 8px;
  display: inline-flex;
  border: 1px solid var(--accent);
  border-radius: var(--radius-control);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 750;
}

.quote-card {
  margin-block-start: 14px;
  padding: 16px;
  border-inline-start: 4px solid var(--accent);
  background: var(--panel-strong);
}

.twitter-embed-card .twitter-tweet {
  margin: 0 !important;
}

.quote-label {
  margin-block-end: 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

html[dir="rtl"] .quote-label {
  letter-spacing: 0;
  text-transform: none;
}

.quote-header {
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}

.quote-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--media-bg);
  color: var(--accent);
  font-weight: 800;
}

.quote-author {
  display: grid;
  gap: 1px;
}

.quote-author span,
.quote-permalink {
  color: var(--muted);
  font-size: 13px;
}

.quote-x {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  color: var(--muted);
  text-decoration: none;
}

.quote-x:hover,
.quote-permalink:hover {
  color: var(--accent);
}

.quote-card blockquote {
  margin: 0;
}

.quote-permalink {
  margin-block-start: 8px;
  display: inline-flex;
  text-decoration: none;
}

/* Utility, search and authentication pages */

.form-panel {
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
  padding: clamp(38px, 6vw, 76px) var(--page-gutter);
}

.form-panel > h1 {
  font-size: clamp(34px, 4.5vw, 52px);
}

.form-panel > p {
  color: var(--muted-strong);
}

.cf-turnstile {
  max-width: 100%;
  overflow: hidden;
}

.utility-head {
  padding-block-end: 18px;
}

.utility-article {
  padding-block-start: 0;
}

.utility-grid {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto 80px;
  padding-inline: var(--page-gutter);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.utility-card {
  min-height: 220px;
  display: grid;
  align-content: end;
  gap: 10px;
  padding: 24px;
  color: inherit;
  text-decoration: none;
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.utility-card-featured {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.utility-card strong {
  font-size: 25px;
  line-height: 1.12;
}

.utility-card p {
  margin: 0;
  color: var(--muted-strong);
}

.download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-block-start: 20px;
}

.button-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-control);
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
}

.button-link:hover {
  background: var(--accent-hover);
}

.button-link.secondary {
  background: transparent;
  color: var(--accent);
}

.related-stories {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto 54px;
  padding-inline: var(--page-gutter);
}

.related-stories .section-kicker {
  margin-block-start: 0;
}

.search-head {
  padding-block-end: 18px;
}

.search-shell {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto 72px;
  padding-inline: var(--page-gutter);
}

.advanced-search {
  width: 100%;
  max-width: none;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) repeat(3, minmax(150px, 1fr));
  gap: 14px;
  align-items: end;
}

.advanced-search .search-wide {
  grid-column: span 2;
}

.search-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.search-actions a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--panel);
  color: var(--muted-strong);
  font-weight: 700;
  text-decoration: none;
}

.search-actions a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.search-summary {
  margin: 22px 0 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  color: var(--muted);
}

.search-summary strong {
  color: var(--text);
}

.search-results {
  display: grid;
  gap: 12px;
}

.search-result {
  min-width: 0;
  overflow: hidden;
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.search-result a {
  min-height: 164px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 20px;
  padding: 16px;
  color: inherit;
  text-decoration: none;
}

.search-result img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  align-self: center;
  border-radius: var(--radius-media);
  background: var(--media-bg);
  object-fit: cover;
}

.search-result:not(:has(img)) a {
  grid-template-columns: 1fr;
}

/* Forms */

form {
  max-width: 640px;
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 700;
}

label small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

input,
textarea,
select,
.visual-editor {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--field-bg);
  color: var(--text);
}

input,
textarea,
select {
  min-height: 44px;
  padding: 10px 12px;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}

input:hover,
textarea:hover,
select:hover,
.visual-editor:hover {
  border-color: var(--muted);
}

input:focus,
textarea:focus,
select:focus,
.visual-editor:focus {
  border-color: var(--accent);
}

textarea {
  min-height: 160px;
  resize: vertical;
}

input[type="checkbox"],
input[type="radio"] {
  min-height: 0;
  accent-color: var(--accent);
}

button {
  min-height: 42px;
  padding: 10px 15px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-control);
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: var(--shadow-soft);
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease;
}

button:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

button:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  opacity: .55;
  cursor: not-allowed;
}

[aria-busy="true"] {
  cursor: progress;
}

button.theme-toggle {
  min-height: 34px;
  padding: 0;
  border-color: var(--line);
  background: var(--panel);
  color: var(--muted);
}

button.theme-toggle:hover {
  border-color: var(--line-strong);
  background: var(--panel-strong);
  color: var(--text);
}

.error {
  color: var(--danger);
  font-weight: 700;
}

.empty {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-card);
  background: var(--panel-strong);
  text-align: center;
}

/* Admin shell */

.admin {
  width: 100%;
  max-width: 1600px;
  margin-inline: auto;
  padding: clamp(18px, 2.5vw, 32px);
}

.admin h1 {
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1;
}

.admin form {
  max-width: none;
}

.admin-head {
  margin-block-end: 18px;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  border-block: 1px solid var(--line);
}

.admin-head .eyebrow {
  margin-block-end: 6px;
}

.admin-head p {
  margin: 7px 0 0;
  color: var(--muted);
}

.admin-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}

.admin-head-actions form {
  display: block;
}

.admin-head-actions form button {
  border-color: var(--line-strong);
  background: var(--panel);
  color: var(--muted-strong);
}

.admin-head-actions form button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.admin-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.admin-sidebar {
  position: sticky;
  inset-block-start: 88px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.admin-sidebar-title {
  padding: 8px 10px 11px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.admin-tabs {
  margin: 0;
  display: grid;
  gap: 4px;
}

.admin-tabs button {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 8px 10px;
  border-color: transparent;
  background: transparent;
  color: var(--muted-strong);
  box-shadow: none;
  text-align: start;
}

.admin-tabs button:hover {
  border-color: var(--line);
  background: var(--panel-strong);
  color: var(--text);
}

.admin-tabs button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

html[dir="rtl"] .admin-tabs button.active {
  box-shadow: inset -3px 0 0 var(--accent);
}

#admin-app,
.admin-panel {
  min-width: 0;
}

.admin-status {
  margin-block-end: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--panel);
  color: var(--muted-strong);
  box-shadow: var(--shadow-soft);
}

.admin-status.error {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.admin-panel[hidden] {
  display: none;
}

.live-pill {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--panel-2);
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 800;
}

.live-pill::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  content: "";
}

.live-pill.live {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.live-pill.live::before {
  background: var(--accent);
}

.live-pill.error {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.live-pill.error::before {
  background: var(--danger);
}

/* Admin overview */

.dashboard-layout,
.admin-grid {
  display: grid;
  gap: 16px;
}

.admin-grid section,
.admin-panel > section {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.stat-hero {
  padding: clamp(20px, 3vw, 28px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.stat-hero h2 {
  margin: 0;
  font-size: clamp(27px, 3vw, 38px);
  line-height: 1.08;
}

.stat-hero p {
  margin: 9px 0 0;
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

.stat-card {
  padding: 16px;
  display: grid;
  gap: 7px;
}

.stat-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.stat-card strong {
  font-size: clamp(28px, 3vw, 36px);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.stat-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.dashboard-columns {
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(0, 1.1fr);
  gap: 16px;
}

.admin-card {
  min-width: 0;
  padding: 18px;
}

.section-title {
  margin-block-end: 14px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
}

.section-title h2,
.section-title p {
  margin: 0;
}

.section-title p {
  color: var(--muted);
}

.bar-list,
.activity-list,
.comment-admin-list {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  gap: 7px;
}

.bar-row > div:first-child,
.activity-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.bar-row span,
.activity-row span {
  color: var(--muted);
  font-size: 13px;
}

.bar-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel-2);
}

.bar-track i {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--accent);
}

.activity-row {
  padding-block: 12px;
  border-block-start: 1px solid var(--line);
}

.activity-row:first-child {
  padding-block-start: 0;
  border-block-start: 0;
}

.activity-row strong {
  display: block;
}

.activity-row a,
.comment-admin-row a,
.cms-row-link {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--panel);
  color: var(--muted-strong);
  font-weight: 700;
  text-decoration: none;
}

.activity-row a:hover,
.comment-admin-row a:hover,
.cms-row-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Admin comments and lists */

.comment-admin-row {
  padding: 14px;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--field-bg);
}

.comment-admin-row.pending {
  border-color: var(--accent);
}

.comment-admin-row.reply {
  border-inline-start: 4px solid var(--accent);
}

.comment-admin-row.spam,
.comment-admin-row.deleted,
.comment-admin-row.rejected {
  opacity: .7;
}

.comment-admin-row header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.comment-admin-row strong,
.comment-admin-row small {
  display: block;
}

.comment-admin-row span,
.comment-admin-row small {
  color: var(--muted);
}

.comment-admin-row p {
  margin: 0;
  color: var(--article-text);
  white-space: pre-wrap;
}

.comment-body {
  color: var(--article-text);
}

.comment-admin-reply {
  padding-block-start: 4px;
  display: grid;
  gap: 8px;
}

.comment-admin-reply[hidden] {
  display: none;
}

.admin-row {
  padding-block: 11px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  border-block-start: 1px solid var(--line);
}

.application-row {
  margin-block-end: 12px;
  padding: 14px;
  display: grid;
  gap: 8px;
}

.danger {
  border-color: var(--danger-button);
  background: var(--danger-button);
  color: var(--danger-contrast);
}

.danger:hover {
  border-color: var(--danger-button-hover);
  background: var(--danger-button-hover);
}

/* CMS */

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

.cms-list,
.cms-editor,
.cms-subpanel {
  padding: 17px;
}

.cms-list {
  position: sticky;
  inset-block-start: 88px;
  max-height: calc(100dvh - 120px);
  overflow: auto;
  scrollbar-width: thin;
}

.cms-editor {
  min-height: calc(100dvh - 190px);
  padding: clamp(18px, 2vw, 24px);
}

.cms-list-head,
.editor-actions,
.cms-subpanel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.cms-list-head h2,
.editor-actions h2,
.cms-subpanel-head h3 {
  margin: 0 0 2px;
}

.cms-list-head p,
.editor-actions p,
.cms-subpanel-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.cms-post-row {
  margin-block-start: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.cms-list-row {
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 11px 12px;
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--field-bg);
  color: var(--text);
  box-shadow: none;
  text-align: start;
  white-space: normal;
}

.cms-list-row:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
  transform: translateY(-1px);
}

.cms-list-row[aria-current="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
  box-shadow: inset 3px 0 0 var(--accent);
}

html[dir="rtl"] .cms-list-row[aria-current="true"] {
  box-shadow: inset -3px 0 0 var(--accent);
}

.cms-list-row span,
.cms-list-row small,
.label-text {
  color: var(--muted);
}

.cms-row-link {
  min-height: 42px;
}

.cms-form {
  max-width: none;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
}

.editor-toolbar {
  margin-block-end: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.cms-list .editor-toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.editor-actions > div:last-child {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.editor-toolbar button,
.editor-mode-tabs button {
  min-height: 38px;
  padding: 8px 11px;
  border-color: var(--line);
  background: var(--panel-strong);
  color: var(--muted-strong);
  box-shadow: none;
}

.editor-toolbar button:hover,
.editor-mode-tabs button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.cms-subpanel-head {
  margin-block-end: 12px;
}

.editor-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

#body-editor {
  min-height: 460px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
}

.visual-editor {
  min-height: 520px;
  padding: 18px;
  overflow: auto;
  color: var(--article-text);
  font-size: 18px;
  line-height: 1.65;
  outline: none;
}

.visual-editor:focus {
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.visual-editor h2 {
  font-size: 28px;
  line-height: 1.2;
}

.visual-editor blockquote {
  margin: 12px 0;
  padding: 10px 14px;
  border-inline-start: 4px solid var(--accent);
  background: var(--accent-soft);
}

.editor-mode-tabs {
  display: inline-flex;
  gap: 6px;
}

.editor-mode-tabs button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.md-preview {
  min-height: 460px;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--field-bg);
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.media-item {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--panel-strong);
}

.media-item img,
.media-item video {
  width: 100%;
  max-height: 520px;
  background: var(--media-bg);
  object-fit: contain;
}

.media-item figcaption {
  padding: 10px;
  display: grid;
  gap: 8px;
}

.upload-form {
  margin-block-start: 16px;
}

.upload-hint {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-check input {
  width: auto;
}

.featured-check {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--panel-strong);
}

/* Footer */

.footer {
  min-height: 84px;
  justify-content: space-between;
  gap: 16px;
  padding: 24px var(--page-gutter);
  border-block-start: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.footer p {
  margin: 0;
}

.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

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

/* Responsive layout */

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr) minmax(170px, 230px) auto;
    gap: 8px;
  }

  .navlinks {
    gap: 0;
  }

  .navlinks a,
  .nav-logout button {
    padding-inline: 7px;
  }

  .flag-link {
    width: 31px;
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
  }

  .admin-sidebar-title {
    display: none;
  }

  .admin-tabs {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .admin-tabs button {
    justify-content: center;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .top-search {
    grid-column: 1 / -1;
  }

  .news-front,
  .featured-grid {
    grid-template-columns: 1fr;
  }

  .lead-story a {
    min-height: 0;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  }

  .lead-media {
    min-height: 430px;
  }

  .lead-media img {
    min-height: 0;
  }

  .featured-card:first-child {
    grid-row: auto;
  }

  .featured-card a,
  .featured-card:not(:first-child) a {
    min-height: 210px;
    grid-template-columns: 220px minmax(0, 1fr);
  }

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

  .advanced-search .search-wide {
    grid-column: 1 / -1;
  }

  .dashboard-columns,
  .cms-layout {
    grid-template-columns: 1fr;
  }

  .cms-list {
    position: static;
    max-height: 440px;
  }
}

@media (max-width: 760px) {
  :root {
    --page-gutter: 16px;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px;
    padding: 9px 12px 11px;
  }

  .brand {
    grid-column: 1;
    justify-self: start;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .lang-switcher {
    grid-column: 2;
    justify-self: end;
    max-width: min(58vw, 260px);
    overflow-x: auto;
    padding: 2px;
    scrollbar-width: none;
  }

  .lang-switcher::-webkit-scrollbar {
    display: none;
  }

  .navlinks {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-block-end: 1px;
    scrollbar-width: none;
  }

  .navlinks::-webkit-scrollbar {
    display: none;
  }

  .navlinks a,
  .nav-logout button {
    min-height: 38px;
    flex: 0 0 auto;
    padding-inline: 10px;
    border-color: var(--line);
    background: var(--panel);
  }

  .top-search {
    grid-column: 1 / -1;
  }

  .top-search input,
  .top-search button {
    min-height: 44px;
  }

  .hero,
  .page-head {
    padding-block-start: 34px;
  }

  h1 {
    font-size: clamp(36px, 11vw, 48px);
  }

  .news-front {
    gap: 14px;
  }

  .lead-story a {
    grid-template-columns: 1fr;
  }

  .lead-media,
  .lead-media img {
    min-height: 0;
    aspect-ratio: 16 / 10;
  }

  .lead-copy {
    padding: 22px;
  }

  .lead-copy h2 {
    font-size: 30px;
  }

  .front-rail {
    padding: 15px;
  }

  .rail-story a {
    grid-template-columns: 94px minmax(0, 1fr);
  }

  .rail-story img {
    width: 94px;
  }

  .latest-item a,
  .search-result a {
    grid-template-columns: 1fr;
  }

  .latest-item img,
  .search-result img {
    width: 100%;
    grid-row: 1;
  }

  .post-card,
  .post-card:nth-child(4n + 1),
  .post-card:nth-child(4n + 4) {
    grid-column: 1 / -1;
  }

  .featured-card a,
  .featured-card:not(:first-child) a {
    grid-template-columns: 1fr;
  }

  .featured-card img {
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .utility-grid,
  .advanced-search,
  .comment-fields,
  .field-grid,
  .editor-split,
  .cms-post-row,
  .cms-list .editor-toolbar {
    grid-template-columns: 1fr;
  }

  .advanced-search .search-wide {
    grid-column: auto;
  }

  .search-summary,
  .comments-head,
  .comment-reply-context,
  .comment-card header,
  .comment-admin-row header,
  .admin-head,
  .cms-list-head,
  .editor-actions,
  .section-title {
    align-items: stretch;
    flex-direction: column;
  }

  .comment-children {
    margin-inline-start: 8px;
    padding-inline-start: 10px;
  }

  .admin-row {
    grid-template-columns: 1fr;
  }

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

  .editor-actions > div:last-child {
    justify-content: flex-start;
  }

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

  .stat-hero {
    align-items: stretch;
    flex-direction: column;
  }

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

  .cms-list {
    max-height: none;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .brand > span:last-child {
    font-size: 14px;
  }

  .flag-link,
  .theme-toggle {
    width: 32px;
    height: 32px;
  }

  .flag-link img {
    width: 18px;
    height: 18px;
  }

  .category-strip {
    width: calc(100% - 32px);
  }

  .rail-story a {
    grid-template-columns: 80px minmax(0, 1fr);
  }

  .rail-story img {
    width: 80px;
  }

  .rail-story h3 {
    font-size: 15px;
  }

  .latest-item p,
  .search-result p {
    display: none;
  }

  .article-body {
    font-size: 18px;
    line-height: 1.72;
  }

  .comments-head > span {
    align-self: start;
  }

  .admin {
    padding: 12px;
  }

  .admin-tabs {
    display: flex;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .admin-tabs button {
    width: auto;
    flex: 0 0 auto;
  }

  .activity-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }

  :where(a, button):active,
  .skip-link,
  .lead-story:hover .lead-media img,
  .post-card:hover,
  .featured-card:hover,
  .utility-card:hover,
  .search-result:hover,
  .cms-list-row:hover {
    transform: none;
  }

  .skip-link:not(:focus-visible) {
    transform: translateY(-160%);
  }
}

@media (prefers-reduced-transparency: reduce) {
  .topbar {
    background: var(--bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (forced-colors: active) {
  :where(a, button, input, textarea, select, [contenteditable="true"]):focus-visible {
    outline: 3px solid Highlight;
  }

  .live-pill::before {
    border: 1px solid currentColor;
  }
}

@media print {
  :root {
    --bg: #fff;
    --panel: #fff;
    --text: #111;
    --article-text: #111;
    --muted: #444;
    --muted-strong: #333;
    --line: #bbb;
    --accent: #111;
    --accent-soft: #eee;
  }

  .topbar,
  .footer,
  .share-buttons,
  .post-langs,
  .comments,
  .tweet-source {
    display: none !important;
  }

  body,
  .article {
    background: #fff;
    color: #111;
  }

  .article {
    max-width: none;
    padding: 0;
  }

  .article-body a {
    color: #111;
  }

  .article-body a[href]::after {
    content: " (" attr(href) ")";
    font-size: .8em;
    font-weight: 400;
  }
}
