:root {
  --page: #f7f7f5;
  --paper: #ffffff;
  --ink: #0a0a0a;
  --soft-ink: #5b5b5b;
  --muted: #8a8a8a;
  --line: rgba(10, 10, 10, 0.08);
  --line-strong: rgba(10, 10, 10, 0.16);
  --wash: #f7f7f5;
  --wash-green: #eefaf3;
  --accent: #0a0a0a;
  --accent-soft: #f0f0ee;
  --link: #0099ff;
  --danger: #b42318;
  --success: #047857;
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
}

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

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

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 100;
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--paper);
  color: var(--ink);
  transform: translateY(-140%);
}

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

.site-shell {
  min-height: 100vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 247, 245, 0.82);
  backdrop-filter: blur(12px);
}

.site-header__inner,
.home-hero__inner,
.feed-section,
.reader-top,
.reader-layout,
.cta-band__inner,
.site-footer__inner,
.topbar-inner,
.admin-app,
.admin-grid {
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
}

.site-header__inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  font-size: 15px;
}

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

.primary-nav,
.header-tools,
.hero-actions,
.feed-card__meta,
.article-byline,
.site-footer__inner,
.site-footer nav,
.nav-actions,
.toolbar,
.check-row,
.section-row,
.admin-tabs,
.meta-row {
  display: flex;
  align-items: center;
}

.primary-nav {
  justify-content: center;
  gap: 4px;
  color: var(--soft-ink);
  font-size: 15px;
  font-weight: 500;
}

.primary-nav a {
  border-radius: var(--radius-pill);
  padding: 8px 16px;
}

.primary-nav a:hover {
  color: var(--ink);
}

.site-footer a,
.text-link {
  text-decoration: none;
}

.site-footer a:hover,
.text-link:hover {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.header-tools {
  justify-content: flex-end;
  gap: 10px;
}

.locale-select,
.field select {
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
}

.field select {
  border-radius: var(--radius-sm);
}

.plain-button,
.button,
.btn,
.admin-tabs button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  padding: 9px 18px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.plain-button:hover,
.button:hover,
.btn:hover,
.admin-tabs button:hover {
  border-color: var(--ink);
}

.button:hover {
  transform: translateY(-1px);
}

.plain-button-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--soft-ink);
  padding: 9px 14px;
}

.plain-button-ghost:hover {
  border-color: transparent;
  color: var(--ink);
  background: var(--accent-soft);
}

.button-primary,
.btn-primary {
  border-color: var(--ink);
  background: var(--ink);
  color: #ffffff;
}

.button-primary:hover,
.btn-primary:hover {
  background: #262626;
  border-color: #262626;
}

.button-secondary,
.btn-secondary {
  background: var(--paper);
  color: var(--ink);
}

.btn-danger {
  border-color: var(--danger);
  background: #fff7f6;
  color: var(--danger);
}

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

h1,
h2,
h3 {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ---------- Hero ---------- */
.home-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--wash);
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 120%;
  background:
    radial-gradient(38% 55% at 18% 12%, rgba(249, 115, 21, 0.14), transparent 70%),
    radial-gradient(36% 55% at 82% 8%, rgba(158, 60, 236, 0.14), transparent 70%),
    radial-gradient(46% 60% at 62% 42%, rgba(20, 201, 225, 0.12), transparent 72%),
    radial-gradient(40% 55% at 35% 55%, rgba(249, 115, 21, 0.08), transparent 72%);
  filter: blur(14px);
  pointer-events: none;
}

.home-hero__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  padding: 104px 0 60px;
  text-align: center;
}

.home-hero h1 {
  max-width: 900px;
  margin: 0;
  font-size: 72px;
  font-weight: 600;
  line-height: 1.05;
}

.hero-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(460px, 100%);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  padding: 13px 20px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(6px);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hero-search:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(10, 10, 10, 0.06);
}

.hero-search__icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-search input {
  width: 100%;
  border: 0;
  background: transparent;
  outline: none;
  color: var(--ink);
  font-size: 15px;
}

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

.hero-search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  max-width: 720px;
}

.filter-pill {
  border: 0;
  background: transparent;
  border-radius: var(--radius-pill);
  padding: 9px 18px;
  color: var(--soft-ink);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
}

.filter-pill:hover {
  background: rgba(10, 10, 10, 0.05);
  color: var(--ink);
}

.filter-pill.is-active {
  background: var(--ink);
  color: #ffffff;
}

/* ---------- Feed ---------- */
.feed-section {
  padding: 52px 0 96px;
}

.loading,
.empty-state,
.noscript-message {
  margin: 8px auto 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  padding: 18px;
  color: var(--muted);
  background: var(--paper);
  text-align: center;
}

.noscript-message {
  width: min(760px, calc(100% - 32px));
}

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

.feed-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feed-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--soft-ink);
  font-size: 14px;
}

.feed-card__image {
  display: block;
  overflow: hidden;
  border-radius: var(--radius-md);
  aspect-ratio: 16 / 9;
  background: var(--wash);
}

.feed-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.09);
  transition: transform 0.4s ease;
}

.feed-card:hover .feed-card__image img {
  transform: scale(1.15);
}

.feed-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 5px 11px;
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

.feed-card h3 {
  margin: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.feed-card h3 a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.feed-card > p {
  margin: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  color: var(--soft-ink);
  font-size: 15px;
  line-height: 1.55;
}

/* Hero language switcher (replaces the removed header control) */
.hero-locale {
  position: absolute;
  top: 20px;
  right: max(24px, calc((100% - 1280px) / 2 + 24px));
  z-index: 2;
}

.hero-locale .locale-select {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(6px);
}

/* Auto-pagination sentinel + spinner */
.feed-sentinel {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 8px;
  margin-top: 40px;
}

.feed-spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid var(--line-strong);
  border-top-color: var(--ink);
  animation: spin 0.7s linear infinite;
}

.feed-spinner[hidden] {
  display: none;
}

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

/* In-article back control */
.reader-top {
  padding: 28px 0 4px;
}

.reader-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  padding: 8px 16px 8px 12px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.reader-back:hover {
  border-color: var(--ink);
  transform: translateX(-2px);
}

.reader-back svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- View Transitions ---------- */
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0.32s;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Shared hero image morph between the feed card and the article. */
  ::view-transition-group(post-hero) {
    animation-duration: 0.42s;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
    /* Keep rounded corners clipped through the whole size morph (no pop). */
    border-radius: var(--radius-md);
    overflow: clip;
  }

  ::view-transition-image-pair(post-hero) {
    border-radius: var(--radius-md);
    overflow: hidden;
  }

  /* Fill the morphing box so the image never letterboxes/squishes mid-morph. */
  ::view-transition-old(post-hero),
  ::view-transition-new(post-hero) {
    height: 100%;
    width: 100%;
    object-fit: cover;
  }
}

/* ---------- Article reader ---------- */
.article-shell {
  background: var(--page);
}

/* Article opens as a fixed layer with its own scroll so the feed's scroll
   position is preserved and the page never jumps when a card is opened. */
[data-article-view]:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--page);
}

.reader-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 720px) 240px;
  gap: 40px;
  align-items: start;
  padding: 48px 0 88px;
}

.reader-toc,
.reader-aside {
  position: sticky;
  top: 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  padding: 18px;
  background: var(--paper);
}

.reader-toc h2,
.reader-aside h2 {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.reader-toc nav {
  display: grid;
  gap: 2px;
}

.toc-link {
  display: block;
  border-radius: var(--radius-sm);
  padding: 7px 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.toc-link:hover {
  background: var(--accent-soft);
  color: var(--ink);
}

.toc-link-level-3 {
  padding-left: 18px;
  font-size: 13px;
}

.toc-empty {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.reader-header {
  max-width: 720px;
}

.article-category {
  display: inline-flex;
  margin-bottom: 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 5px 11px;
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

.reader-header h1 {
  margin-bottom: 16px;
  font-size: 46px;
  line-height: 1.08;
}

.reader-header > p {
  margin-bottom: 20px;
  color: var(--soft-ink);
  font-size: 19px;
  line-height: 1.55;
}

.article-byline {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: var(--muted);
  font-size: 13px;
}

.reader-figure {
  margin: 28px 0 18px;
  /* Clip here (not on the img) so the shared-element morph names a container
     with a border-radius that matches the feed card — avoids the radius pop. */
  border-radius: var(--radius-md);
  overflow: hidden;
  view-transition-name: post-hero;
}

.reader-figure img {
  display: block;
  width: 100%;
  max-height: 460px;
  object-fit: cover;
  background: var(--wash);
}

.reader-note,
.reader-summary {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  background: var(--paper);
}

.reader-note {
  margin: 16px 0 24px;
}

.reader-note p,
.reader-summary p {
  margin: 0;
  color: var(--soft-ink);
  line-height: 1.65;
}

.reader-note strong {
  color: var(--ink);
}

.reader-summary {
  margin: 24px 0 32px;
  background: var(--wash-green);
  border-color: rgba(4, 120, 87, 0.18);
}

.section-kicker {
  display: inline-flex;
  align-items: center;
  margin-bottom: 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  color: var(--soft-ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.reader-summary .section-kicker {
  border-color: rgba(4, 120, 87, 0.25);
  color: var(--success);
}

.article-body {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.75;
}

.article-body h2,
.article-body h3 {
  margin: 38px 0 14px;
  line-height: 1.22;
}

.article-body h2 {
  border-top: 1px solid var(--line);
  padding-top: 28px;
  font-size: 28px;
}

.article-body h3 {
  font-size: 21px;
}

.article-body p {
  margin-bottom: 20px;
}

.article-body ul {
  margin: 0 0 20px;
  padding-left: 22px;
}

.article-body li {
  margin-bottom: 10px;
}

/* Related topics (entry tags) — visible + crawlable for SEO */
.reader-tags {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.reader-tags__title {
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.reader-tags__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reader-tags__list .tag-pill {
  cursor: default;
}

.reader-aside p {
  color: var(--muted);
  line-height: 1.55;
}

.reader-note-premium {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-top: 30px;
  padding: 28px 24px 30px;
  background: #fff8ec;
  border-color: rgba(217, 119, 6, 0.2);
}

.reader-note-premium .section-kicker {
  margin-bottom: 18px;
}

.reader-note-premium h2 {
  margin-bottom: 12px;
}

.reader-note-premium .button {
  margin-top: 24px;
}

/* ---------- CTA band ---------- */
.cta-band {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--ink);
  color: #ffffff;
}

.cta-band__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 76px 0;
  text-align: center;
}

.cta-band .section-kicker {
  border-color: rgba(255, 255, 255, 0.24);
  color: rgba(255, 255, 255, 0.72);
}

.cta-band h2 {
  max-width: 620px;
  color: #ffffff;
  font-size: 36px;
  line-height: 1.14;
}

.cta-band p {
  max-width: 520px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 16px;
  line-height: 1.55;
}

.cta-band .button-primary {
  margin-top: 8px;
  border-color: #ffffff;
  background: #ffffff;
  color: var(--ink);
}

.cta-band .button-primary:hover {
  background: rgba(255, 255, 255, 0.88);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--wash);
}

.site-footer__inner {
  justify-content: space-between;
  gap: 20px;
  padding: 28px 0;
  color: var(--muted);
  font-size: 14px;
}

.site-footer p {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
}

.site-footer nav {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 16px;
}

/* ---------- Admin (unchanged layout, refreshed tokens) ---------- */
.admin-shell {
  min-height: 100vh;
  background: #f8fafc;
  color: #111827;
}

.admin-topbar {
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.nav-actions {
  justify-content: flex-end;
  gap: 10px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
  padding: 24px 0 56px;
}

.admin-app {
  padding: 20px 0 56px;
}

.admin-app .admin-grid {
  width: 100%;
  padding: 0;
}

.admin-tabs {
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.admin-tabs button.is-active {
  border-color: var(--ink);
  background: var(--accent-soft);
  color: var(--ink);
}

.panel {
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-md);
  background: #ffffff;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e5e7eb;
  padding: 16px;
}

.panel-head h1,
.panel-head h2 {
  margin: 0;
  font-size: 18px;
}

.panel-body {
  padding: 16px;
}

.auth-wrap {
  display: grid;
  min-height: calc(100vh - 68px);
  place-items: center;
  padding: 32px 16px;
}

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

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field label {
  color: #374151;
  font-size: 13px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  background: #ffffff;
  color: #111827;
  outline: none;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.locale-select:focus,
.plain-button:focus,
.button:focus,
.btn:focus,
.admin-tabs button:focus,
.filter-pill:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.field textarea {
  min-height: 126px;
  resize: vertical;
  line-height: 1.55;
}

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

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

.check-row {
  flex-wrap: wrap;
  gap: 16px;
  margin: 8px 0 16px;
}

.check-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #374151;
}

.toolbar {
  flex-wrap: wrap;
  gap: 10px;
}

.post-list {
  display: grid;
  gap: 8px;
}

.post-list button {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-sm);
  padding: 12px;
  background: #ffffff;
  text-align: left;
}

.post-list button.is-active {
  border-color: var(--ink);
  background: var(--accent-soft);
}

.post-list-title {
  display: block;
  margin-bottom: 5px;
  font-weight: 700;
}

.post-list-meta,
.status-line {
  color: #6b7280;
  font-size: 12px;
}

.status-line {
  margin: 0;
}

.notice {
  display: none;
  margin-bottom: 16px;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.notice.is-visible {
  display: block;
}

.notice.error {
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: var(--danger);
}

.notice.success {
  border: 1px solid #bbf7d0;
  background: #ecfdf5;
  color: var(--success);
}

.hidden {
  display: none !important;
}

.field.compact {
  margin-bottom: 10px;
}

.detail-section {
  margin-top: 22px;
  border-top: 1px solid #e5e7eb;
  padding-top: 18px;
}

.section-row {
  justify-content: space-between;
  gap: 12px;
}

.section-row h3 {
  margin: 0;
  font-size: 16px;
}

.comment-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.comment-item,
.detail-card {
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-sm);
  background: #ffffff;
  padding: 14px;
}

.comment-item p,
.detail-card p {
  color: #4b5568;
  line-height: 1.55;
}

.compact-actions .btn {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  padding: 4px 8px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 11px;
}

.badge-active,
.badge-resolved {
  background: #ecfdf5;
  color: #047857;
}

.badge-hidden,
.badge-reviewed {
  background: #fff7ed;
  color: #c2410c;
}

.badge-deleted,
.badge-dismissed {
  background: #fff1f2;
  color: #dc2626;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.meta-grid div {
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-sm);
  padding: 10px;
  background: #f8fafc;
}

.meta-grid span {
  display: block;
  margin-bottom: 4px;
  color: #6b7280;
  font-size: 11px;
}

.meta-grid strong {
  font-size: 13px;
}

.report-body {
  white-space: pre-wrap;
}

.ui-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.post-list-title.with-icon {
  display: flex;
  align-items: center;
  gap: 8px;
}

.post-list-title.with-icon span {
  min-width: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 1120px) {
  .article-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1060px) {
  .reader-layout {
    grid-template-columns: 180px minmax(0, 1fr);
  }

  .reader-aside {
    display: none;
  }
}

@media (max-width: 900px) {
  .site-header__inner {
    grid-template-columns: auto 1fr;
    gap: 12px;
    min-height: 64px;
  }

  .primary-nav {
    display: none;
  }

  .header-cta {
    display: none;
  }

  .home-hero h1 {
    font-size: 52px;
  }

  .home-hero__inner {
    padding: 72px 0 48px;
  }

  .reader-layout,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .reader-toc,
  .reader-aside {
    position: static;
  }

  .reader-toc nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .toc-link,
  .toc-link-level-3 {
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    padding: 8px 12px;
  }
}

@media (max-width: 720px) {
  .site-header__inner,
  .home-hero__inner,
  .feed-section,
  .reader-layout,
  .cta-band__inner,
  .site-footer__inner,
  .topbar-inner,
  .admin-app,
  .admin-grid {
    width: min(100% - 32px, 1280px);
  }

  .article-list {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .home-hero h1 {
    font-size: 38px;
  }

  .home-hero__inner {
    gap: 24px;
    padding: 56px 0 40px;
  }

  .reader-header h1 {
    font-size: 32px;
  }

  .reader-header > p {
    font-size: 17px;
  }

  .article-body {
    font-size: 17px;
  }

  .cta-band h2 {
    font-size: 27px;
  }

  .field-grid,
  .field-grid.two,
  .meta-grid {
    grid-template-columns: 1fr;
  }

  .site-footer__inner,
  .site-footer nav {
    justify-content: flex-start;
  }
}
