:root {
  color-scheme: dark;
  --bg: #101113;
  --bg-2: #141619;
  --surface: #181b1f;
  --surface-2: #20252a;
  --surface-3: #eef1f5;
  --text: #f6f8fa;
  --text-dark: #111318;
  --muted: #b9c1ca;
  --line: rgba(255,255,255,0.13);
  --line-strong: rgba(255,255,255,0.22);
  --on-blue: #ffba17;
  --page-separator: #ffba17;
  --accent: #69d184;
  --accent-strong: #9fe5ad;
  --vote-positive: #69d184;
  --vote-negative: #ef6f6f;
  --action: #2f80ff;
  --action-hover: #4f96ff;
  --ok-bg: rgba(105,209,132,0.16);
  --ok-line: rgba(105,209,132,0.42);
  --err-bg: rgba(255,104,104,0.15);
  --err-line: rgba(255,104,104,0.42);
  --shadow: 0 18px 48px rgba(0,0,0,0.28);
  --max-width: 1100px;
  --switch-off: #17251a;
  --switch-on: #d4a251;
  --switch-thumb: #f6f8fa;
  --secondary-hover-bg: #ffffff;
  --secondary-hover-text: #111318;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #faf9f5;
  --bg-2: #f4f2ed;
  --surface: #d0dfec;
  --surface-2: #bed3e4;
  --surface-3: #3d2817;
  --text: #1a1816;
  --text-dark: #f6f8fa;
  --muted: #6b6360;
  --line: rgba(0,0,0,0.08);
  --line-strong: rgba(0,0,0,0.15);
  --page-separator: #ffba17;
  --accent: #d4a251;
  --accent-strong: #e6b85f;
  --vote-positive: #1f8f4e;
  --vote-negative: #b73535;
  --action: #1d5fa3;
  --action-hover: #2a74c7;
  --ok-bg: rgba(212,162,81,0.12);
  --ok-line: rgba(212,162,81,0.35);
  --err-bg: rgba(220,80,80,0.12);
  --err-line: rgba(220,80,80,0.35);
  --shadow: 0 8px 24px rgba(0,0,0,0.08);
  --switch-off: #e0dcd6;
  --switch-on: #1d5fa3;
  --switch-thumb: #ffffff;
  --secondary-hover-bg: var(--surface-2);
  --secondary-hover-text: var(--text);
}

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

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  body:not(:has([data-theme="light"])) {
    background:
      linear-gradient(180deg, #171a1f 0%, var(--bg) 34%, #0c0d0f 100%);
  }
}

:root[data-theme="light"] body {
  background: #2a6da8;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
}

a:hover,
a:focus-visible {
  color: #ffffff;
  text-decoration: underline;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.9rem;
  font-size: clamp(2.25rem, 7vw, 4.6rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0.9rem;
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  line-height: 1.12;
  letter-spacing: 0;
  color: #ffba17;
}

h3 {
  margin-bottom: 0.45rem;
  font-size: 1.2rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.top {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
  padding: 0.5rem max(1rem, calc((100vw - var(--max-width)) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(16,17,19,0.86);
  backdrop-filter: blur(16px);
}

:root[data-theme="light"] .top {
  background: var(--surface);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

.brand img {
  height: 4rem;
  width: auto;
  filter: brightness(0) invert(1);
}

:root[data-theme="light"] .brand img {
  filter: none;
}

.brand:hover,
.brand:focus-visible {
  color: #ffffff;
  text-decoration: none;
  opacity: 0.85;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  min-height: 2.5rem;
  padding: 0;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  transform: none;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
  border-color: var(--page-separator);
  background: var(--surface);
  color: var(--text);
  transform: none;
}

.nav-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
}

nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.9rem;
}

nav a,
.inline button {
  color: var(--muted);
  font-size: 0.95rem;
}

nav a:hover,
nav a:focus-visible,
.inline button:hover,
.inline button:focus-visible {
  color: var(--text);
}

.theme-control {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  padding-left: 0.9rem;
  border-left: 1px solid var(--line);
}

.theme-label {
  color: var(--muted);
  font-size: 0.85rem;
}

.theme-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.theme-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.theme-switch-track {
  display: flex;
  align-items: center;
  width: 62px;
  height: 31px;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--switch-off);
  transition: background-color .16s ease, border-color .16s ease;
}

.theme-switch-thumb {
  width: 23px;
  height: 23px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--switch-thumb);
  transition: transform .16s ease, border-color .16s ease;
}

.theme-switch input:checked + .theme-switch-track {
  border-color: var(--accent);
  background: var(--switch-on);
}

.theme-switch input:checked + .theme-switch-track .theme-switch-thumb {
  transform: translateX(31px);
  border-color: var(--accent);
}

.theme-switch input:focus-visible + .theme-switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.wrap {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
  padding: 2rem 0 4rem;
  color: var(--on-blue);
}

.wrap > .muted,
.author-profile-header .muted,
.author-profile-header .eyebrow,
.section-heading > a,
.wrap > p > a {
  color: var(--on-blue);
}

:root[data-theme="light"] .card,
:root[data-theme="light"] .article,
:root[data-theme="light"] .note,
:root[data-theme="light"] .preview,
:root[data-theme="light"] .hero,
:root[data-theme="light"] .article-container,
:root[data-theme="light"] .article-filter,
:root[data-theme="light"] .review-row,
:root[data-theme="light"] .empty-state,
:root[data-theme="light"] .flash {
  color: var(--text);
}

:root[data-theme="light"] :is(.card:not(.article-card), .article, .note, .preview, .hero, .article-container, .article-filter, .review-row, .empty-state, .flash) .muted {
  color: var(--text);
}

:root[data-theme="light"] :is(.card:not(.article-card), .article, .note, .preview, .hero, .article-container, .article-filter, .review-row, .empty-state, .flash) a:not(.button):not(.topic-chip):not(.author-card) {
  color: #E1921B;
}

:root[data-theme="light"] :is(.card:not(.article-card), .article, .note, .preview, .hero, .article-container, .article-filter, .review-row, .empty-state, .flash) a:not(.button):not(.topic-chip):not(.author-card):hover,
:root[data-theme="light"] :is(.card:not(.article-card), .article, .note, .preview, .hero, .article-container, .article-filter, .review-row, .empty-state, .flash) a:not(.button):not(.topic-chip):not(.author-card):focus-visible {
  color: #E1921B;
  text-decoration: underline;
}

.hero {
  margin: 0 0 2rem;
  padding: clamp(2rem, 6vw, 4.5rem) clamp(1.2rem, 4vw, 2.4rem);
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.08), rgba(105,209,132,0.08)),
    var(--surface);
  box-shadow: var(--shadow);
}

:root[data-theme="light"] .hero {
  background:
    linear-gradient(135deg, rgba(29,95,163,0.06), rgba(212,162,81,0.08)),
    var(--surface);
}

.hero p {
  max-width: 64ch;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

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

.portal-rail {
  display: none;
}

.portal-promo {
  display: flex;
  min-height: 19rem;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid var(--page-separator);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.portal-promo:hover,
.portal-promo:focus-visible {
  color: var(--text);
  text-decoration: none;
  transform: translateY(-2px);
}

.portal-promo:focus-visible {
  outline: 2px solid var(--page-separator);
  outline-offset: 3px;
}

.portal-promo-visual {
  display: block;
  min-height: 10rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2) var(--portal-promo-image) center / cover no-repeat;
}

.portal-promo-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.85rem;
}

.portal-promo-title {
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1.1;
}

.portal-promo-description {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.35;
}

.portal-promo-url {
  margin-top: auto;
  color: #E1921B;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.portal-promo:hover .portal-promo-title,
.portal-promo:focus-visible .portal-promo-title {
  color: #E1921B;
}

.home-section {
  margin: 0 0 3rem;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--page-separator);
}

.section-heading h2 {
  margin: 0;
}

.section-title-with-action {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.author-title-with-action {
  align-items: flex-start;
}

.author-title-with-action .rss-link {
  flex: 0 0 auto;
  margin-top: 0.2rem;
}

.rss-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--page-separator);
  color: var(--heading);
  text-decoration: none;
}

.rss-link:hover,
.rss-link:focus-visible {
  background: var(--surface);
  color: var(--accent);
}

.rss-link svg {
  width: 1.1rem;
  height: 1.1rem;
  stroke-width: 2.4;
}

.section-heading > a {
  flex: 0 0 auto;
  font-weight: 700;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.article-grid .article-card {
  margin: 0;
}

.empty-state {
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface);
}

.author-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.author-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 0.8rem;
  align-items: center;
  min-height: 76px;
  padding: 0.8rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.author-card:hover,
.author-card:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

.author-card strong,
.author-card small {
  display: block;
  overflow-wrap: anywhere;
}

.author-card small {
  margin-top: 0.15rem;
  color: var(--muted);
}

.author-monogram {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
  color: var(--accent-strong);
  font-size: 1.15rem;
  font-weight: 800;
  text-transform: uppercase;
}

.author-profile-header {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--page-separator);
}

.author-profile-header h1,
.author-profile-header p {
  margin-bottom: 0.35rem;
}

.author-monogram-large {
  width: 96px;
  height: 96px;
  font-size: 2rem;
}

.eyebrow {
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.card,
.article,
.note,
.preview {
  border: 1px solid var(--line);
  background: rgba(24,27,31,0.94);
  box-shadow: var(--shadow);
}

:root[data-theme="light"] .card,
:root[data-theme="light"] .article,
:root[data-theme="light"] .note,
:root[data-theme="light"] .preview {
  background: var(--surface);
}

.card {
  display: block;
  margin: 1rem 0;
  padding: 1.1rem;
  color: var(--text);
}

.article-card {
  overflow: hidden;
  background: rgba(16,17,19,0.86) !important;
  border: 1px solid var(--line);
}

.article-card h3 {
  margin: 0.9rem 0 0.45rem;
  color: #cbb420;
}

.article-card h2 a,
.article-card h3 a {
  color: var(--text);
}

.article-card h2 a:hover,
.article-card h2 a:focus-visible,
.article-card h3 a:hover,
.article-card h3 a:focus-visible {
  color: #ffba17;
}

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

.article-card h2,
.article-card h3 {
  font-size: 1.2rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.article-card h2 {
  margin: 0.9rem 0 0.45rem;
}

.article-byline a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
}

.vote-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  margin-top: 0.8rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

.vote-positive,
.vote-negative {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-weight: 800;
}

.vote-positive svg,
.vote-negative svg,
.vote-button svg {
  width: 1rem;
  height: 1rem;
  flex: 0 0 1rem;
  stroke-width: 2.25;
}

.vote-positive {
  color: var(--vote-positive);
}

.vote-negative {
  color: var(--vote-negative);
}

.vote-score {
  margin-left: auto;
  color: var(--text);
}

:root[data-theme="light"] .article-card {
  background: var(--surface) !important;
}

:root[data-theme="light"] .article-card .article-byline a {
  color: #E1921B;
}

.article-card-cover,
.article-cover,
.cover-preview {
  margin: 0;
  border: 1px solid var(--line);
  background: #0c0d0f;
  overflow: hidden;
}

:root[data-theme="light"] .article-card-cover,
:root[data-theme="light"] .article-cover,
:root[data-theme="light"] .cover-preview {
  background: #f0ede8;
}

.article-card-cover {
  margin: -1.1rem -1.1rem 1rem;
  border-width: 0 0 1px;
  aspect-ratio: 16 / 7;
}

.article-cover-full {
  margin-bottom: 1.5rem;
  aspect-ratio: 16 / 6;
}

.article-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.75rem 0 1.35rem;
}

.article-action {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.article-action svg {
  width: 1rem;
  height: 1rem;
}

.article-card-cover img,
.article-cover img,
.cover-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-field {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
}

.cover-field h2 {
  margin: 0;
  font-size: 1.15rem;
}

.cover-field label {
  margin: 0;
}

.cover-preview {
  width: min(100%, 420px);
  aspect-ratio: 16 / 7;
  justify-self: start;
}

a.card:hover,
a.card:focus-visible,
article.card:hover,
article.card:focus-within {
  border-color: var(--line-strong);
  background: var(--surface-2);
  text-decoration: none;
}

.narrow {
  max-width: 520px;
}

[hidden] {
  display: none !important;
}

.auth-shell {
  width: min(100%, 760px);
}

.auth-shell > h1 {
  margin-bottom: 1.25rem;
}

.auth-panel {
  overflow: hidden;
  margin-top: 0;
  padding-top: 0;
}

.auth-panel.narrow {
  width: min(100%, 520px);
}

.auth-panel fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.auth-panel .storage-note {
  margin: 0.85rem 0 0.7rem;
  color: var(--text);
}

:root[data-theme="light"] .auth-panel .storage-note {
  color: #1a1816;
}

.auth-panel .storage-note a {
  color: #E1921B;
  font-weight: 500;
}

.auth-panel .storage-note a:hover,
.auth-panel .storage-note a:focus-visible {
  color: #E1921B;
  text-decoration: underline;
}

.password-rules {
  display: grid;
  gap: 0.18rem;
  max-height: 12rem;
  margin: -0.45rem 0 0.85rem;
  padding-left: 0;
  overflow: hidden;
  list-style: none;
  font-size: 0.92rem;
  line-height: 1.45;
  opacity: 1;
  transform: translateY(0);
  transition: max-height 160ms ease, margin 160ms ease, opacity 140ms ease, transform 160ms ease;
}

.password-rules.is-collapsed {
  max-height: 0;
  margin-top: 0;
  margin-bottom: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-0.35rem);
}

.password-rule {
  display: grid;
  grid-template-columns: 1.15rem minmax(0, 1fr);
  align-items: baseline;
  gap: 0.35rem;
  font-weight: 600;
}

.password-rule::before {
  font-weight: 800;
  text-align: center;
}

.password-rule.is-unmet {
  color: #b3261e;
}

.password-rule.is-unmet::before {
  content: "✕";
}

.password-rule.is-met {
  color: #16833a;
}

.password-rule.is-met::before {
  content: "✓";
}


.phone-field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.phone-field-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  font-weight: 700;
}

.phone-input-row {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 0.5rem;
  align-items: stretch;
}

.phone-input-row select,
.phone-input-row input {
  width: 100%;
  min-width: 0;
}

.phone-input-row select {
  font-variant-numeric: tabular-nums;
}

.phone-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

:root[data-theme="light"] .phone-help {
  color: #1a1816;
}

.birth-date-field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.birth-date-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  font-weight: 700;
}

.birth-date-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.birth-date-display {
  cursor: pointer;
}

.birth-date-panel {
  display: grid;
  gap: 0.7rem;
  max-height: 38rem;
  margin-top: 0.1rem;
  padding: 0.75rem;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  box-shadow: var(--shadow);
  opacity: 1;
  transform: translateY(0);
  transition: max-height 180ms ease, margin 180ms ease, padding 180ms ease, border-width 180ms ease, opacity 150ms ease, transform 180ms ease;
}

.birth-date-panel.is-collapsed {
  max-height: 0;
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-0.35rem);
}

.birth-date-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
}

.birth-date-card,
.birth-date-day-nav button,
.birth-date-year-controls button,
.birth-date-actions button,
.birth-date-day,
.birth-date-month,
.birth-date-year {
  min-height: 2.25rem;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
}

.birth-date-card {
  min-width: 0;
  padding: 0.45rem 0.35rem;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  overflow-wrap: anywhere;
}

.birth-date-card:hover,
.birth-date-card:focus-visible,
.birth-date-day-nav button:hover,
.birth-date-year-controls button:hover,
.birth-date-actions button:hover,
.birth-date-day:not(:disabled):hover,
.birth-date-month:not(:disabled):hover,
.birth-date-year:not(:disabled):hover {
  border-color: var(--accent);
  background: var(--action);
  color: var(--text-dark);
}

.birth-date-card.is-active {
  border-color: var(--accent);
  background: #174e7b;
  color: var(--on-blue);
  box-shadow: inset 0 -3px 0 var(--accent);
}

.birth-date-view[hidden] {
  display: none !important;
}

.birth-date-calendar,
.birth-date-month-view,
.birth-date-year-view {
  display: grid;
  gap: 0.55rem;
}

.birth-date-day-nav,
.birth-date-year-controls {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr) 2.5rem;
  gap: 0.35rem;
  align-items: center;
}

.birth-date-day-nav strong,
.birth-date-year-controls strong {
  display: inline-grid;
  place-items: center;
  min-height: 2.25rem;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
}

.birth-date-weekdays,
.birth-date-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.25rem;
}

.birth-date-weekday {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-align: center;
}

.birth-date-day {
  display: inline-grid;
  place-items: center;
  min-width: 0;
  height: 2.35rem;
  padding: 0;
  font-weight: 700;
}

.birth-date-day.is-muted {
  color: var(--muted);
  opacity: 0.65;
}

.birth-date-day:disabled,
.birth-date-month:disabled,
.birth-date-year:disabled,
.birth-date-year-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.birth-date-day.is-selected,
.birth-date-month.is-selected,
.birth-date-year.is-selected {
  border-color: var(--accent-strong);
  background: var(--accent);
  color: var(--text-dark);
}

.birth-date-years,
.birth-date-months {
  display: grid;
  gap: 0.3rem;
}

.birth-date-years {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.birth-date-months {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.birth-date-month,
.birth-date-year {
  padding: 0.35rem;
  font-size: 0.9rem;
  font-weight: 700;
}

.birth-date-actions {
  display: flex;
  justify-content: flex-start;
}

.account-type-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.account-type-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 0.8rem;
  align-items: center;
  min-height: 88px;
  padding: 0.85rem;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  transform: none;
}

.account-type-card > svg {
  width: 42px;
  height: 42px;
  padding: 0.55rem;
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
  color: var(--on-blue);
}

.account-type-card strong,
.account-type-card small {
  display: block;
  overflow-wrap: anywhere;
}

.account-type-card strong {
  line-height: 1.2;
}

.account-type-card small {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.35;
}

.account-type-card:hover,
.account-type-card:focus-visible {
  border-color: var(--accent);
  background: var(--surface-2);
  color: var(--text);
  transform: none;
}

.account-type-card.is-active {
  border-color: var(--accent);
  background: var(--ok-bg);
  box-shadow: inset 0 -3px 0 var(--accent);
}

.account-type-card.is-active > svg {
  border-color: var(--accent);
  color: var(--on-blue);
}

.account-type-card.is-active strong,
.account-type-card.is-active small {
  color: var(--on-blue);
}

:root[data-theme="light"] .account-type-card > svg {
  background: #174e7b;
}

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

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.65rem 0.95rem;
  border: 1px solid rgba(255,255,255,0.12);
  background: var(--action);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  line-height: 1.15;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

button:hover,
button:focus-visible,
.button:hover,
.button:focus-visible {
  border-color: rgba(255,255,255,0.2);
  background: var(--action-hover);
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
}

button[name="action"][value="draft"],
button[name="status"][value="suspended"],
button[name="status"][value="hidden"],
button[name="decision"][value="changes_requested"],
button[name="decision"][value="hidden"] {
  background: var(--surface-3);
  color: var(--text-dark);
}

button[name="status"][value="rejected"],
button[name="status"][value="deleted"],
button[name="decision"][value="rejected"],
.button-danger {
  background: #d54848;
}

.button-danger:hover,
.button-danger:focus-visible {
  background: #b73535;
}

.inline {
  display: inline;
}

.inline button {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  font-weight: 400;
  transform: none;
}

label {
  display: grid;
  gap: 0.45rem;
  margin: 0.8rem 0;
  color: var(--text);
  font-weight: 700;
}

.form-label-caption {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  min-width: 0;
  line-height: 1.25;
}

.form-label-icon {
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 1.05rem;
  color: var(--accent-strong);
  stroke-width: 2;
}

:root[data-theme="light"] .form-label-icon {
  color: #9b6716;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #0f1114;
  color: var(--text);
  padding: 0.7rem 0.8rem;
  font: inherit;
}

:root[data-theme="light"] input,
:root[data-theme="light"] textarea,
:root[data-theme="light"] select {
  background: var(--surface);
}

input[type="checkbox"] {
  width: auto;
  min-width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.agreement-check {
  align-items: flex-start;
  line-height: 1.35;
}

.agreement-check input[type="checkbox"] {
  margin-top: 0.2rem;
}

.rules-list {
  display: grid;
  gap: 0.85rem;
  margin: 1rem 0 0;
  padding-left: 1.35rem;
}

.rules-list li {
  padding-left: 0.25rem;
}

.rules-list h3 {
  margin: 0 0 0.2rem;
  font-size: 1rem;
}

.rules-list p {
  margin: 0;
}

:root[data-theme="light"] :is(.card, .article, .note, .preview, .hero, .article-container, .article-filter, .review-row, .empty-state, .flash) :is(h1, h2, h3, legend, label, .page-lead, .article-filter-selected-label),
:root[data-theme="light"] .opuscula-page :is(.article-filter-toggle, .article-filter-toggle:hover, .article-filter-toggle:focus-visible) {
  color: var(--text);
}

input[type="file"] {
  background: var(--surface);
}

.file-field {
  position: relative;
}

.file-picker-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  opacity: 0;
}

.file-picker {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: stretch;
  min-height: 48px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.file-picker-action {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 0.9rem;
  border-right: 1px solid var(--line-strong);
  background: var(--action);
  color: #ffffff;
  white-space: nowrap;
}

.file-picker-action svg {
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 1.05rem;
}

.file-picker-name {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0.7rem 0.85rem;
  overflow-wrap: anywhere;
  font-weight: 600;
}

.file-field:hover .file-picker-action {
  background: var(--action-hover);
}

.file-field:has(.file-picker-input:focus-visible) .file-picker {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

textarea {
  min-height: 8rem;
  resize: vertical;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible,
.button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.flash {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  background: var(--surface);
}

.flash.ok {
  border-color: var(--ok-line);
  background: var(--ok-bg);
}

.flash.err {
  border-color: var(--err-line);
  background: var(--err-bg);
}

.article {
  padding: clamp(1.2rem, 4vw, 2rem);
}

.article-container {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  padding: 0;
  display: block;
}

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

.article-container .note {
  margin: 0;
  padding: 1rem clamp(1.2rem, 4vw, 2rem);
  border-left: 4px solid var(--accent);
  background: transparent;
  border-top: 1px solid var(--line);
}

.article-container .note:first-child {
  border-top: 0;
}

.article-container .article {
  border-top: 1px solid var(--line);
  margin: 0;
  padding: clamp(1.2rem, 4vw, 2rem);
}

.article-container > h2 {
  margin: 1.5rem 0 1rem;
  padding: 1rem clamp(1.2rem, 4vw, 2rem) 0;
  border-top: 1px solid var(--line);
}

.article-container > .discussion-empty,
.article-container > .discussion-login {
  margin: 0;
  padding: 0 clamp(1.2rem, 4vw, 2rem) 1rem;
}

.article-container > .discussion-empty + .discussion-login {
  padding-top: 0.25rem;
}

.article-container > .comment {
  position: relative;
  margin: 0;
  padding: 1rem clamp(1.2rem, 4vw, 2rem);
  border-top: 0;
  border-left: 0;
}

.article-container > .comment + .comment::before {
  content: "";
  position: absolute;
  top: 0;
  left: clamp(1.2rem, 4vw, 2rem);
  right: clamp(1.2rem, 4vw, 2rem);
  border-top: 1px solid var(--line);
}

.article-container form {
  margin: 0;
  padding: 1rem clamp(1.2rem, 4vw, 2rem);
  border-top: 1px solid var(--line);
}

.article-votes {
  padding: 1.25rem clamp(1.2rem, 4vw, 2rem);
  border-top: 1px solid var(--line);
}

.article-votes h2 {
  margin: 0 0 0.75rem;
  padding: 0;
  border: 0;
}

.article-votes .vote-summary {
  max-width: 520px;
  margin: 0 0 1rem;
}

.article-votes .vote-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.article-container .article-votes form {
  margin: 0;
  padding: 0;
  border: 0;
}

.vote-button {
  gap: 0.42rem;
  min-width: 132px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 800;
}

.vote-button strong {
  color: inherit;
  font-variant-numeric: tabular-nums;
}

.vote-score-inline {
  align-self: center;
  margin-left: 0;
}

.vote-button-placet {
  color: var(--vote-positive);
}

.vote-button-placet.is-active {
  border-color: var(--vote-positive);
  background: var(--vote-positive);
  color: #ffffff;
}

.vote-button-displicet {
  color: var(--vote-negative);
}

.vote-button-displicet.is-active {
  border-color: var(--vote-negative);
  background: var(--vote-negative);
  color: #ffffff;
}

.vote-help {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
}

.article h1 {
  max-width: 14ch;
  margin-bottom: 0.45rem;
  font-size: clamp(2.1rem, 6vw, 4rem);
}

.content {
  color: #eef1f5;
}

:root[data-theme="light"] .content {
  color: #1a1816;
}

.content p,
.content ul,
.content blockquote {
  max-width: 74ch;
}

.content a {
  border-bottom: 1px solid rgba(159,229,173,0.5);
}

:root[data-theme="light"] .content a {
  border-bottom-color: rgba(29,95,163,0.4);
}

.content img,
.content video,
.content .article-video-embed {
  display: block;
  max-width: 100%;
  margin: 1rem 0;
  border: 1px solid var(--line);
}

.content video,
.content .article-video-embed {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #08090a;
}

.content .article-video-embed {
  height: auto;
}

.content pre,
.preview pre,
pre {
  overflow: auto;
  padding: 1rem;
  border: 1px solid var(--line);
  background: #08090a;
  color: #f6f8fa;
}

:root[data-theme="light"] .content pre,
:root[data-theme="light"] .preview pre,
:root[data-theme="light"] pre {
  background: #f5f2ed;
  color: #1a1816;
}

code {
  padding: 0.12rem 0.28rem;
  background: rgba(255,255,255,0.08);
  color: #ffffff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

:root[data-theme="light"] code {
  background: rgba(29,95,163,0.08);
  color: #1d5fa3;
}

pre code {
  padding: 0;
  background: transparent;
}

.article-code-block {
  max-width: 100%;
  margin: 1.35rem 0;
  border: 1px solid var(--line);
  background: #08090a;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

:root[data-theme="light"] .article-code-block {
  background: #f5f2ed;
}

.article-code-head {
  position: sticky;
  top: calc(72px + 0.35rem);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  min-height: 42px;
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid var(--line);
  background: #12161b;
  color: #f6f8fa;
}

:root[data-theme="light"] .article-code-head {
  background: var(--surface-2);
  color: var(--text);
}

.article-code-caption {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  font: 700 0.88rem/1.2 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.article-code-title {
  color: var(--gold);
}

.article-code-language {
  padding-left: 0.55rem;
  border-left: 1px solid var(--line);
  color: var(--muted);
  text-transform: lowercase;
}

.article-code-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 30px;
  padding: 0.32rem 0.55rem;
  border: 1px solid var(--line);
  background: var(--action);
  color: #ffffff;
  font-weight: 800;
  transform: none;
}

.article-code-copy:hover,
.article-code-copy:focus-visible {
  border-color: var(--line-strong);
  background: var(--action-hover);
  transform: none;
}

.article-code-copy svg {
  width: 1em;
  height: 1em;
}

.content .article-code-pre,
.article-code-pre {
  margin: 0;
  padding: 0;
  overflow: auto;
  border: 0;
  background: #08090a;
  color: #f6f8fa;
}

:root[data-theme="light"] .content .article-code-pre,
:root[data-theme="light"] .article-code-pre {
  background: #f5f2ed;
  color: #1a1816;
}

.article-code-content {
  display: block;
  min-width: max-content;
  padding: 0.75rem 0;
  counter-reset: article-code-line;
  font: 0.92rem/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  tab-size: 4;
}

.article-code-line {
  display: grid;
  grid-template-columns: 3.4rem minmax(max-content, 1fr);
  min-height: 1.55em;
  counter-increment: article-code-line;
}

.article-code-line::before {
  padding: 0 0.75rem;
  border-right: 1px solid var(--line);
  color: #8d98a6;
  content: counter(article-code-line);
  text-align: right;
  user-select: none;
}

:root[data-theme="light"] .article-code-line::before {
  color: #6b6360;
}

.article-code-text {
  padding: 0 1rem;
  white-space: pre;
}

.indent-unit {
  display: inline-block;
  border-left: 1px solid rgba(148, 163, 184, 0.32);
}

.article-code-source {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.tok-keyword { color: #c084fc; font-weight: 700; }
.tok-string { color: #86efac; }
.tok-number { color: #fbbf24; }
.tok-comment { color: #9ca3af; font-style: italic; }
.tok-tag { color: #fb7185; }
.tok-attr { color: #93c5fd; }
.tok-var { color: #5eead4; }
.tok-builtin { color: #7dd3fc; }
.tok-operator { color: #d1d5db; }
.tok-punctuation { color: #9ca3af; }

:root[data-theme="light"] .tok-keyword { color: #7c3aed; }
:root[data-theme="light"] .tok-string { color: #047857; }
:root[data-theme="light"] .tok-number { color: #b45309; }
:root[data-theme="light"] .tok-comment { color: #6b7280; }
:root[data-theme="light"] .tok-tag { color: #be123c; }
:root[data-theme="light"] .tok-attr { color: #2563eb; }
:root[data-theme="light"] .tok-var { color: #0f766e; }
:root[data-theme="light"] .tok-builtin { color: #0369a1; }
:root[data-theme="light"] .tok-operator { color: #4b5563; }
:root[data-theme="light"] .tok-punctuation { color: #6b7280; }


blockquote {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border-left: 4px solid var(--accent);
  background: rgba(105,209,132,0.08);
}

:root[data-theme="light"] blockquote {
  background: rgba(212,162,81,0.08);
  border-left-color: var(--accent);
}

.note {
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  border-left: 4px solid var(--accent);
  background: rgba(105,209,132,0.08);
}

:root[data-theme="light"] .note {
  background: rgba(212,162,81,0.08);
  border-left-color: var(--accent);
}

.comment {
  border-top: 1px solid var(--line);
  padding: 1rem 0;
}

.preview {
  max-height: 260px;
  overflow: auto;
  padding: 1rem;
  background: rgba(12,13,15,0.62);
}

:root[data-theme="light"] .preview {
  background: rgba(240,237,232,0.6);
}


.article-edit-preview {
  max-height: none;
  overflow: visible;
}

.review-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.review-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--line);
  background: rgba(24,27,31,0.94);
  box-shadow: var(--shadow);
}

:root[data-theme="light"] .review-row {
  background: var(--surface);
}

.review-row h2 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}

.review-row p {
  margin: 0;
}

.review-row .button {
  white-space: nowrap;
}

.review-detail {
  margin-top: 1rem;
}

.review-detail .content {
  margin-top: 1.5rem;
}

.review-actions {
  margin-top: 1rem;
}

.image-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 1rem 0;
}

.image-row img,
.image-row video {
  width: 120px;
  height: 90px;
  border: 1px solid var(--line);
  object-fit: cover;
  background: #08090a;
}

.image-row code {
  display: block;
  margin-top: 0.45rem;
  padding: 0.55rem;
  white-space: normal;
  overflow-wrap: anywhere;
  background: #0f1114;
}

:root[data-theme="light"] .image-row code {
  background: #f5f2ed;
}


.editor-card {
  display: grid;
  gap: 1rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.markdown-editor {
  margin: 0.8rem 0 0;
  border: 1px solid var(--line-strong);
  background: #0f1114;
}

:root[data-theme="light"] .markdown-editor {
  background: var(--surface);
}

.editor-sticky-head {
  position: sticky;
  top: 5rem;
  z-index: 120;
  background: #0f1114;
  box-shadow: 0 8px 18px rgba(0,0,0,0.12);
}

:root[data-theme="light"] .editor-sticky-head {
  background: var(--surface);
}

.editor-sticky-foot {
  position: sticky;
  bottom: 0;
  z-index: 115;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  padding: 0.55rem 0.75rem;
  border-top: 1px solid var(--line);
  background: #0f1114;
  box-shadow: 0 -8px 18px rgba(0,0,0,0.12);
}

:root[data-theme="light"] .editor-sticky-foot {
  background: var(--surface);
}

.editor-stats-legend {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.editor-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.95rem;
  margin: 0;
}

.editor-stat {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  min-width: 8rem;
}

.editor-stat dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.editor-stat dd {
  display: inline-flex;
  align-items: baseline;
  gap: 0.22rem;
  margin: 0;
  font: 700 0.9rem/1.2 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  color: var(--text);
}

.editor-stat-divider {
  color: var(--muted);
}

.editor-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.6rem 0.65rem;
  border-bottom: 1px solid var(--line);
}

.editor-mode-tab {
  min-height: 38px;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 800;
  transform: none;
}

.editor-mode-tab:hover,
.editor-mode-tab:focus-visible {
  border-color: var(--line-strong);
  background: var(--brand);
  color: var(--text);
  transform: none;
}

.editor-mode-tab.is-active {
  border-color: var(--gold);
  background: var(--brand-dark);
  color: var(--gold);
}

.editor-pane[hidden] {
  display: none;
}

.editor-pane.is-active {
  display: block;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 48px;
  padding: 6px;
  border-bottom: 1px solid var(--line);
}


.editor-tool {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
  transform: none;
}

.editor-tool-wide {
  width: 42px;
  min-width: 42px;
}

.editor-tool:hover,
.editor-tool:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface-2);
  transform: none;
}

.editor-separator {
  width: 1px;
  height: 28px;
  margin: 0 4px;
  background: var(--line);
}

.editor-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.editor-field {
  gap: 0;
  margin: 0;
}

.editor-field span {
  padding: 0.65rem 0.8rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.markdown-editor textarea {
  min-height: 430px;
  padding-bottom: 4.5rem;
  overflow: hidden;
  resize: none;
  border: 0;
  background: #0f1114;
  font: 14px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  tab-size: 4;
}

:root[data-theme="light"] .markdown-editor textarea {
  background: var(--surface);
}

.markdown-editor textarea,
.editor-visual {
  min-height: 430px;
}

.markdown-editor textarea:focus-visible {
  outline-offset: -2px;
}

.editor-visual {
  padding: 0.8rem 0.8rem 4.5rem;
  border: 0;
  background: #0f1114;
  color: var(--text);
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

:root[data-theme="light"] .editor-visual {
  background: var(--surface);
}

.editor-visual:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}

.editor-visual:empty::before {
  color: var(--muted);
  content: attr(data-placeholder);
}

.editor-visual h1,
.editor-visual h2,
.editor-visual h3,
.editor-visual p,
.editor-visual ul,
.editor-visual blockquote,
.editor-visual pre {
  margin-top: 0;
}

.editor-visual h1 { font-size: clamp(2rem, 4vw, 4rem); }
.editor-visual h2 { font-size: clamp(1.55rem, 2.6vw, 2.4rem); }
.editor-visual h3 { font-size: 1.35rem; }

.editor-visual blockquote {
  margin-left: 0;
  padding-left: 1rem;
  border-left: 3px solid var(--gold);
}

.editor-visual pre {
  padding: 0.8rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.18);
  tab-size: 4;
}

.editor-visual code {
  padding: 0.08rem 0.25rem;
  background: rgba(0,0,0,0.18);
}

.editor-visual pre code {
  padding: 0;
  background: transparent;
}

.editor-visual img,
.editor-visual video,
.editor-visual iframe {
  display: block;
  max-width: 100%;
  margin: 0.75rem 0;
  border: 1px solid var(--line);
}

.editor-visual img,
.editor-visual video {
  height: auto;
}

.editor-visual iframe {
  width: min(100%, 760px);
  aspect-ratio: 16 / 9;
}

.markdown-editor.is-uploading .editor-sticky-head,
.markdown-editor.is-uploading .editor-sticky-foot {
  opacity: 0.72;
}


.editor-dialog {
  width: min(460px, calc(100% - 2rem));
  padding: 0;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

:root[data-theme="light"] .editor-dialog {
  background: var(--surface);
  color: var(--text);
}

.editor-dialog::backdrop {
  background: rgba(0,0,0,0.62);
}

.editor-dialog-form {
  display: grid;
  gap: 0.95rem;
  padding: 1rem;
}

.editor-dialog h2 {
  margin: 0;
  font-size: 1.25rem;
}

.editor-dialog label {
  margin: 0;
}

.editor-dialog-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.editor-dialog-cancel {
  background: var(--surface-3);
  color: var(--text-dark);
}

.editor-dialog-actions-split {
  justify-content: flex-start;
}

.editor-dialog-spacer {
  flex: 1 1 auto;
}

.editor-dialog-video {
  width: min(920px, calc(100% - 2rem));
  max-height: min(90vh, 760px);
  overflow: auto;
}

.editor-video-dialog-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.75fr) minmax(0, 1.25fr);
  gap: 1rem;
  align-items: start;
}

.editor-video-preview-panel,
.editor-video-source-panel,
.editor-video-source-box {
  display: grid;
  gap: 0.75rem;
}

.editor-video-preview-panel h3,
.editor-video-source-title {
  margin: 0;
  font-size: 1rem;
}

.editor-video-preview-box {
  display: grid;
  place-items: center;
  min-height: 260px;
  border: 1px solid var(--line-strong);
  background: #08090a;
  color: #eef1f5;
  overflow: hidden;
}

.editor-video-preview-box video,
.editor-video-preview-box iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  background: #08090a;
}

.editor-image-preview-box img {
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
}

.editor-video-preview-placeholder {
  margin: 0;
  padding: 1rem;
  text-align: center;
}

.editor-video-source-title {
  display: grid;
  grid-template-columns: 1.05rem minmax(0, 1fr);
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  cursor: pointer;
}

.editor-video-source-title input {
  justify-self: center;
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
}

.editor-video-source-box .form-label-caption {
  display: grid;
  grid-template-columns: 1.05rem minmax(0, 1fr);
  align-items: center;
  gap: 0.45rem;
}

.editor-video-source-title:has(input:disabled) {
  cursor: not-allowed;
}

.editor-video-source-box {
  padding: 0.75rem;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
}

.editor-video-source-box:has(.editor-video-source-title input:checked) {
  border-color: var(--accent);
}


.editor-video-source-box.is-disabled {
  opacity: 0.55;
}

.editor-video-source-box.is-disabled :is(input:not([name="video_origin"]), .file-picker) {
  pointer-events: none;
}

.editor-video-progress {
  width: calc(100% - 2rem);
  justify-self: stretch;
  align-self: end;
  margin: 1rem;
}

.editor-video-progress-bar {
  height: 0.85rem;
  border: 1px solid var(--line-strong);
  background: rgba(255,255,255,0.14);
}

.editor-video-progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
}

.editor-video-progress p {
  margin: 0.45rem 0 0;
  font-weight: 700;
}

.image-library h2 {
  margin-bottom: 0.6rem;
}

.image-library .image-row {
  grid-template-columns: 120px minmax(0, 1fr) auto;
}

.image-insert {
  justify-self: end;
  white-space: nowrap;
}

.foot {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
  padding: 2rem 0 2.5rem;
  border-top: 1px solid var(--page-separator);
  color: #ffba17;
  text-align: center;
}

.foot a {
  color: #E1921B;
}

.footer-icon-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  vertical-align: middle;
}

.footer-icon-link :is(i, svg) {
  width: 1em;
  height: 1em;
  flex: 0 0 1em;
}

.footer-icon-link svg {
  stroke: currentColor;
  stroke-width: 2.25;
  fill: none;
}

.footer-social-link svg {
  stroke: none;
  fill: currentColor;
}

.foot a:hover,
.foot a:focus-visible {
  color: #E1921B;
  text-decoration: underline;
}

@media (min-width: 1536px) {
  .portal-rail {
    position: fixed;
    top: 7rem;
    z-index: 20;
    display: block;
    width: 11.5rem;
  }

  .portal-rail-left {
    left: max(1rem, calc((100vw - var(--max-width)) / 2 - 13rem));
  }

  .portal-rail-right {
    right: max(1rem, calc((100vw - var(--max-width)) / 2 - 13rem));
  }
}

@media (min-width: 1800px) {
  .portal-rail {
    width: 13rem;
  }

  .portal-rail-left {
    left: max(1rem, calc((100vw - var(--max-width)) / 2 - 14.5rem));
  }

  .portal-rail-right {
    right: max(1rem, calc((100vw - var(--max-width)) / 2 - 14.5rem));
  }
}

@media (max-width: 960px) and (min-width: 721px) {
  .article-grid,
  .author-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .top {
    align-items: center;
    flex-direction: row;
    gap: 0.75rem;
    min-height: auto;
    padding: 0.35rem 0.75rem;
  }

  .brand {
    flex: 0 0 auto;
  }

  .brand img {
    height: 2.6rem;
  }

  .nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 0.45rem 0.75rem 0.75rem;
    border-bottom: 1px solid var(--line);
    background: rgba(16,17,19,0.96);
    box-shadow: var(--shadow);
  }

  :root[data-theme="light"] nav {
    background: var(--surface);
  }

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

  nav a,
  .inline button {
    justify-content: flex-start;
    width: 100%;
    padding: 0.7rem 0.25rem;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    font-size: 0.95rem;
    text-align: left;
    white-space: nowrap;
  }

  .inline {
    display: block;
  }

  .inline button {
    border-top: 0;
    border-right: 0;
    border-left: 0;
    background: transparent;
    font-weight: 700;
    transform: none;
  }

  .theme-control {
    justify-content: flex-start;
    gap: 0.55rem;
    padding: 0.75rem 0.25rem 0;
    border-left: 0;
  }

  .theme-label {
    font-size: 0.85rem;
  }

  .editor-sticky-head {
    top: 3.35rem;
  }

  .article-code-head {
    top: 3.75rem;
  }

  .wrap {
    width: min(calc(100% - 1.5rem), var(--max-width));
    padding-top: 1.2rem;
  }

  .hero {
    padding: 1.5rem 1rem;
  }

  .article-card-cover,
  .article-cover-full,
  .cover-preview {
    aspect-ratio: 16 / 9;
  }

  .article-grid,
  .author-grid,
  .grid,
  .image-row,
  .image-library .image-row,
  .editor-video-dialog-grid {
    grid-template-columns: 1fr;
  }

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

  .author-profile-header {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .author-monogram-large {
    width: 72px;
    height: 72px;
  }

  .image-row img,
  .image-row video {
    width: 100%;
    height: auto;
    max-height: 220px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

.inline button:hover,
.inline button:focus-visible {
  border: 0;
  background: transparent;
  transform: none;
}

button[name="action"][value="draft"]:hover,
button[name="action"][value="draft"]:focus-visible,
button[name="status"][value="suspended"]:hover,
button[name="status"][value="suspended"]:focus-visible,
button[name="status"][value="hidden"]:hover,
button[name="status"][value="hidden"]:focus-visible,
button[name="decision"][value="changes_requested"]:hover,
button[name="decision"][value="changes_requested"]:focus-visible,
button[name="decision"][value="hidden"]:hover,
button[name="decision"][value="hidden"]:focus-visible {
  background: var(--secondary-hover-bg);
  color: var(--secondary-hover-text);
}

button[name="status"][value="rejected"]:hover,
button[name="status"][value="rejected"]:focus-visible,
button[name="status"][value="deleted"]:hover,
button[name="status"][value="deleted"]:focus-visible,
button[name="decision"][value="rejected"]:hover,
button[name="decision"][value="rejected"]:focus-visible {
  background: #e05a5a;
}
@media (max-width: 700px) {
  .review-row {
    grid-template-columns: 1fr;
  }

  .review-row .button {
    width: 100%;
  }
}



.article-filter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 1rem;
  align-items: end;
  margin: 0 0 1.5rem;
  padding: 1rem 1rem 0;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.article-filter-topics {
  display: grid;
  grid-template-rows: 1fr;
  min-width: 0;
  opacity: 1;
  transition: grid-template-rows 0.22s ease, opacity 0.16s ease;
}

.article-filter-topics-inner {
  min-height: 0;
  overflow: hidden;
}

.article-filter-side {
  display: grid;
  gap: 1rem;
  align-self: end;
}

.article-filter-selected,
.article-filter-sort-summary {
  display: none;
  grid-column: 1 / -1;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem 0.75rem;
  min-width: 0;
  margin-top: -0.2rem;
}

.article-filter.is-topics-collapsed .article-filter-selected:not([hidden]),
.article-filter.is-topics-collapsed .article-filter-sort-summary {
  display: flex;
}

.article-filter.is-topics-collapsed .article-filter-side {
  display: none;
}

.article-filter-selected-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  color: var(--text);
  font-weight: 800;
  line-height: 1.25;
}

.article-filter-selected-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-width: 0;
}

.article-filter .form-actions {
  margin: 0;
}

.article-filter-separator {
  position: relative;
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  margin-top: 0.15rem;
  margin-right: -1rem;
  margin-bottom: -11px;
  margin-left: -1rem;
}

.article-filter-separator::before {
  content: "";
  position: absolute;
  inset: calc(50% - 1px) 0 auto;
  height: 2px;
  background: linear-gradient(90deg, rgba(255,186,23,0.18), rgba(255,186,23,0.72) 38%, var(--page-separator) 50%, rgba(255,186,23,0.72) 62%, rgba(255,186,23,0.18));
}

.article-filter-toggle {
  position: relative;
  z-index: 1;
  min-width: 42px;
  min-height: 22px;
  height: 22px;
  padding: 0 0.7rem;
  border-color: var(--page-separator);
  background: var(--surface);
  color: var(--on-blue);
  font: 17px/1 system-ui, sans-serif;
}

.article-filter-toggle:hover,
.article-filter-toggle:focus-visible {
  background: var(--surface-2);
  color: var(--on-blue);
  transform: none;
}

.article-filter.is-topics-collapsed .article-filter-topics {
  grid-template-rows: 0fr;
  opacity: 0;
  pointer-events: none;
}

.sort-field {
  margin: 0;
}

.topic-selector {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.topic-selector legend {
  margin-bottom: 0.55rem;
  color: var(--text);
  font-weight: 800;
}

.topic-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.topic-option {
  display: inline-flex !important;
  align-items: center;
  gap: 0.45rem !important;
  min-height: 38px;
  margin: 0 !important;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
  font-size: 0.9rem;
  cursor: pointer;
}

.topic-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--ok-bg);
}

.topic-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.55rem 0 0.75rem;
}

.topic-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.1;
}

.topic-chip:hover,
.topic-chip:focus-visible {
  border-color: var(--accent);
  color: var(--text);
  text-decoration: none;
}

.button-secondary {
  background: var(--surface-3);
  color: var(--text-dark);
}

.button-secondary:hover,
.button-secondary:focus-visible {
  background: var(--secondary-hover-bg);
  color: var(--secondary-hover-text);
}

.editor-card .topic-selector,
.admin-article-topics .topic-selector {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--line);
}

.topic-request-card {
  margin-top: 1.5rem;
}

.article-topic-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  gap: 1rem;
  align-items: start;
}

.article-topic-workspace .topic-selector,
.article-topic-workspace .topic-request-inline {
  min-width: 0;
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--line);
}

.article-topic-workspace .topic-request-inline h2 {
  margin: 0 0 0.55rem;
  font-size: 1.2rem;
}

.article-topic-workspace .topic-request-inline form {
  display: grid;
  gap: 0.85rem;
}

.article-topic-workspace .topic-request-inline label {
  margin: 0;
}

.article-compose-actions {
  grid-column: 1 / -1;
  margin: 0;
}


.article-compose-panel {
  gap: 1.15rem;
}

.article-compose-form {
  display: grid;
  gap: 1rem;
}

.article-compose-section {
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.article-compose-disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 42px;
  cursor: pointer;
  list-style: none;
  color: var(--text);
  font-weight: 800;
}

.article-compose-disclosure > summary::-webkit-details-marker {
  display: none;
}

.article-compose-disclosure > summary::after {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-strong);
  color: var(--accent);
  font-weight: 900;
}

.article-compose-disclosure[open] > summary::after {
  content: "-";
}

.article-compose-disclosure-body {
  display: grid;
  gap: 0.85rem;
  padding-top: 0.85rem;
}

.article-compose-subsection {
  margin-top: 0.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.article-compose-subsection > summary {
  min-height: 36px;
  font-size: 1rem;
}

.article-compose-panel .topic-selector,
.article-compose-panel .topic-request-inline {
  margin: 0;
  padding: 0;
  border: 0;
}

.article-compose-panel .topic-request-inline h2 {
  margin: 0 0 0.55rem;
  font-size: 1.2rem;
}

.article-compose-panel .topic-request-inline form {
  display: grid;
  gap: 0.85rem;
}

.article-compose-panel .topic-request-inline label {
  margin: 0;
}

.article-compose-actions {
  padding-top: 1rem;
  border-top: 1px solid var(--line-strong);
}

.article-compose-panel .image-library {
  margin: 0;
}

.image-library-rows {
  display: grid;
  gap: 0.75rem;
}

.admin-topic-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.admin-topic-layout .card {
  margin: 0;
}

.topic-admin-list {
  display: grid;
}

.topic-admin-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  border-top: 1px solid var(--line);
}

.topic-admin-main {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
}

.topic-admin-rename {
  display: flex;
  gap: 0.5rem;
  min-width: 0;
  margin: 0;
}

.topic-admin-rename input {
  min-width: 0;
}

.topic-admin-rename button,
.topic-admin-delete button {
  min-height: 36px;
  padding: 0.5rem 0.75rem;
  white-space: nowrap;
}

.topic-admin-delete {
  flex: 0 0 auto;
  margin: 0;
}

.topic-admin-list > div:first-child {
  border-top: 0;
}

.topic-request-row {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  align-items: start;
}

.topic-request-row form,
.topic-request-row label {
  margin: 0;
}

.topic-request-row textarea {
  min-height: 4.5rem;
}

@media (max-width: 720px) {
  .article-filter,
  .article-topic-workspace,
  .admin-topic-layout,
  .topic-request-row {
    grid-template-columns: 1fr;
  }

  .article-filter-topics,
  .article-filter-selected,
  .article-filter-sort-summary,
  .article-filter-side,
  .article-filter-separator {
    grid-column: 1;
  }

  .topic-admin-list > div {
    align-items: stretch;
    flex-direction: column;
  }

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

  .topic-admin-rename {
    flex-wrap: wrap;
  }

  .topic-admin-rename input {
    flex: 1 1 180px;
  }

  .topic-admin-rename button,
  .topic-admin-delete button {
    width: 100%;
  }

  .topic-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topic-option {
    width: 100%;
  }
}

@media (max-width: 440px) {
  .topic-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .file-picker {
    grid-template-columns: 1fr;
  }

  .file-picker-action {
    justify-content: center;
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
  }

  .account-type-switch {
    grid-template-columns: 1fr;
  }

  .account-type-card {
    min-height: 78px;
  }
}

@media print {
  .top,
  .portal-rail,
  .foot,
  .article-actions,
  .article-votes,
  .article-container > h2,
  .article-container > .discussion-empty,
  .article-container > .discussion-login,
  .article-container > .comment,
  .article-container > form {
    display: none !important;
  }

  body,
  :root[data-theme="light"] body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .wrap,
  .article-container,
  .article-container .article {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .article-container a {
    color: #000000 !important;
    text-decoration: underline;
  }
}

@media print {
  .article-code-head { position: static; }
  .article-code-copy { display: none; }
}
