:root {
  --background: #ffffff;
  --foreground: #232127;
  --card: #ffffff;
  --muted: #f6f5f7;
  --muted-foreground: #8b8794;
  --accent: #f6f5f7;
  --border: #ecebee;
  --destructive: #b36f52;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.10), 0 2px 4px rgba(0, 0, 0, 0.08);
  --radius: 0.375rem;
  --content-wide: 48rem;
  --content-narrow: 42rem;
  --font-serif: 'Lora', ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
  --font-mono: 'Space Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

html[data-theme='dark'] {
  --background: #141218;
  --foreground: #f4f0f7;
  --card: #1c1921;
  --muted: #211d26;
  --muted-foreground: #b3aabf;
  --accent: #282330;
  --border: #35303c;
  --destructive: #d08b6c;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.28), 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 3px 10px rgba(0, 0, 0, 0.32), 0 2px 4px rgba(0, 0, 0, 0.24);
}

html[data-theme='dark'] .post-detail__content p,
html[data-theme='dark'] .post-detail__quote p,
html[data-theme='dark'] .post-detail__list li {
  color: rgba(244, 240, 247, 0.9);
}

html[data-theme='dark'] .about-copy {
  color: rgba(244, 240, 247, 0.84);
}

html[data-theme='dark'] .about-social__item {
  color: rgba(244, 240, 247, 0.9);
}

html[data-theme='dark'] .about-copy .link-inline,
html[data-theme='dark'] .about-social .link-inline {
  color: rgba(244, 240, 247, 0.96);
}

html[data-theme='dark'] .about-copy .link-inline:hover,
html[data-theme='dark'] .about-social .link-inline:hover {
  color: rgba(244, 240, 247, 0.78);
}

html[data-theme='dark'] .post-detail__related .about-copy {
  color: rgba(244, 240, 247, 0.84);
}

html[data-theme='dark'] .post-detail__related .link-inline {
  color: rgba(244, 240, 247, 0.96);
}

html[data-theme='dark'] .post-detail__related .link-inline:hover {
  color: rgba(244, 240, 247, 0.78);
}

html[data-theme='dark'] .page-shell--home .post-card:hover .post-card__title {
  color: rgba(244, 240, 247, 0.78);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

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

button {
  border: 0;
  background: none;
}

svg {
  display: block;
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

svg circle,
svg rect,
svg path,
svg line,
svg polyline,
svg polygon {
  vector-effect: non-scaling-stroke;
}

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

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  border-bottom: 1px solid var(--border);
}

.site-header__inner,
.site-footer__inner {
  width: min(100%, var(--content-narrow));
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-footer__inner {
  justify-content: center;
}

.site-brand,
.admin-brand,
.hero__title,
.page-title,
.post-detail__title,
.post-card__title,
.admin-section__title,
.auth-title,
.stat-card__value,
.empty-state__title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-optical-sizing: auto;
}

.site-brand {
  font-size: 1.5rem;
  line-height: 2rem;
}

.site-brand:hover,
.admin-brand:hover {
  color: var(--muted-foreground);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--muted-foreground);
}

.site-nav__theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  padding: 0;
  color: inherit;
  cursor: pointer;
  transition: color 0.2s ease;
}

.site-nav__theme-toggle:hover {
  color: var(--foreground);
}

.site-nav__dropdown {
  position: relative;
}

.site-nav__dropdown summary {
  list-style: none;
  cursor: pointer;
}

.site-nav__dropdown summary::-webkit-details-marker {
  display: none;
}

.site-nav__menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  z-index: 10;
  min-width: 12rem;
  display: grid;
  gap: 0.25rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.site-nav__menu a {
  padding: 0.375rem 0.5rem;
  border-radius: var(--radius);
}

.site-nav__menu a:hover {
  background: var(--accent);
}

.site-nav a:hover,
.link-inline:hover,
.back-link:hover,
.app-link:hover,
.auth-toggle:hover,
.admin-nav a:hover {
  color: var(--foreground);
}

.site-main {
  flex: 1;
  width: min(100%, var(--content-wide));
  margin: 0 auto;
  padding: 0 1.5rem;
}

.site-main--narrow {
  width: min(100%, var(--content-narrow));
}

.hero {
  padding: 3rem 0 1.5rem;
}

.hero--compact {
  padding: 1.25rem 0 0.5rem;
}

.page-shell--home .hero--compact {
  padding: 2rem 0 1.35rem;
  margin-bottom: 0.85rem;
  text-align: justify;
  text-justify: inter-word;
}

.page-shell--home .hero--compact.hero--compact-without-title {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  margin-bottom: 0.2rem;
}

.page-shell--home .hero--compact .hero__subtitle {
  margin: 0;
  width: 100%;
  max-width: none;
}

.page-shell--home .hero--compact .hero__title {
  text-align: center;
}

.home-hero-divider {
  width: 2.25rem;
  margin: 0 auto 0.85rem;
  border: 0;
  border-top: 1px solid var(--border);
  opacity: 0.85;
}

.page-shell--home .hero--compact .home-hero-divider:last-child {
  margin: 1.1rem auto 0;
}

.hero__title {
  margin: 0 0 1rem;
  font-size: 2.25rem;
  line-height: 1.1;
}

.hero--compact .hero__title {
  font-size: 1.75rem;
  line-height: 1.15;
  margin-bottom: 0.4rem;
}

.hero__subtitle,
.post-detail__content p {
  margin: 0;
  max-width: 34rem;
  font-size: 0.875rem;
  line-height: 1.625;
  color: var(--muted-foreground);
}

.hero__subtitle a {
  color: inherit;
  text-decoration: underline;
}

.italic-muted {
  color: var(--muted-foreground);
  font-style: italic;
}

.stack-lg {
  margin-top: 1rem;
}

.stack-xl {
  margin-top: 2rem;
}

.home-pagination {
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
}

.page-shell--home .site-footer {
  margin-top: 1.75rem;
}

.tags-tile {
  padding: 1.5rem;
}

.tags-tile--filters {
  display: grid;
  gap: 0.9rem;
  padding: 1.1rem 1.25rem;
}

.tags-tile--results {
  padding: 1rem 1.25rem;
}

.tags-tile__search {
  margin-top: 0.25rem;
}

.tags-tile--filters .admin-search-field {
  max-width: 40rem;
}

.tags-tile__title,
.app-links__label,
.post-card__meta,
.detail-meta,
.stat-card__label {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--muted-foreground);
}

.tags-tile__title,
.app-links__label,
.post-card__meta time,
.detail-meta time,
.stat-card__label {
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tags-tile__title {
  margin-bottom: 0.75rem;
}

.tags-tile--results .tags-tile__title {
  margin-bottom: 0.25rem;
}

.results-summary__meta {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.2rem;
  color: var(--muted-foreground);
}

.home-empty {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5rem;
  color: var(--muted-foreground);
}

.home-faq {
  padding: 1rem 1.25rem;
}

.home-faq__list {
  display: grid;
  gap: 0.5rem;
}

.home-faq__item {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.625rem 0.75rem;
}

.home-faq__question {
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1.35;
  font-weight: 500;
}

.home-faq__answer {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--muted-foreground);
}

.home-faq--page {
  padding: 0;
}

.home-faq--page .home-faq__list {
  gap: 0.875rem;
}

.home-faq--page .home-faq__item {
  border: 0;
  border-radius: 0;
  padding: 0;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.detail-tags {
  margin-top: 0.5rem;
}

.detail-tags--end {
  margin-top: 1rem;
}

.post-detail__tags-signature {
  margin-top: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.post-detail__tags-signature .detail-tags--end {
  margin-top: 0;
  flex: 1;
  min-width: 0;
}

.detail-tags .tag {
  font-size: 0.75rem;
  line-height: 1rem;
  font-style: italic;
}

.app-links__items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tag {
  text-decoration: none;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--muted-foreground);
}

.tag--active,
.tag:hover {
  color: var(--foreground);
}

.tag--static {
  pointer-events: none;
}

.masonry {
  column-count: 1;
  column-gap: 1rem;
  padding-bottom: 4rem;
}

.featured-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.featured-grid--with-hero {
  margin-top: 1rem;
}

.post-card--featured {
  border-width: 1px;
}

.masonry__item {
  break-inside: avoid;
  margin-bottom: 1rem;
}

.post-card {
  display: block;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  transition: box-shadow 0.2s ease;
}

.post-card:hover {
  box-shadow: var(--shadow-md);
}

.post-card__image-link,
.post-card__body-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.post-card__image-wrap {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.post-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.post-card__image--solo {
  min-height: 100%;
}

.post-card--image-only .post-card__image {
  aspect-ratio: 4 / 5;
}

.post-card:hover .post-card__image {
  transform: scale(1.02);
}

.page-shell--home .post-card__image-wrap {
  aspect-ratio: auto;
  overflow: visible;
}

.page-shell--home .post-card__image,
.page-shell--home .post-card--image-only .post-card__image {
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
}

.page-shell--home .post-card:hover .post-card__image {
  transform: none;
}

.post-card__content,
.post-card--text {
  padding: 1.25rem;
}

.post-card__meta,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.post-card__title {
  margin: 0.25rem 0 0;
  font-size: 1.25rem;
  line-height: 1.25;
  color: var(--foreground);
  transition: color 0.2s ease;
}

.post-card:hover .post-card__title {
  color: rgba(35, 33, 39, 0.7);
}

.post-card__tags {
  margin: 0.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.page-shell--home .post-card__tags {
  color: rgba(139, 135, 148, 0.9);
  margin-top: 0.65rem;
}

.post-card__tag-link {
  display: inline-flex;
  align-items: center;
  min-height: 1.6rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--accent);
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--muted-foreground);
  text-decoration: none;
  font-style: normal;
}

.post-card__tag-link:hover {
  color: var(--foreground);
  border-color: var(--foreground);
}

.post-card__excerpt {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  line-height: 1.625;
  color: var(--muted-foreground);
}

.post-card--block {
  background: rgba(255, 255, 255, 0.74);
}

.post-card--block-banner {
  overflow: hidden;
}

.post-card--block-ad {
  padding: 1rem;
}

.post-card__ad-label {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--muted-foreground);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.post-card__ad-slot {
  min-height: 6rem;
}

.post-card__footer {
  margin-top: 0.5rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.post-card__footer .post-card__tags {
  margin-top: 0;
}

.post-card__author {
  margin-left: auto;
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--muted-foreground);
  text-decoration: none;
  white-space: nowrap;
}

.post-card__author:hover {
  color: var(--foreground);
}

.app-links {
  padding: 1.5rem 0;
}

.app-links__label {
  margin-bottom: 1rem;
}

.app-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--muted-foreground);
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

.site-footer__inner {
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--muted-foreground);
}

.site-footer__center {
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  text-align: center;
}

.page-block,
.post-detail {
  padding: 4rem 0;
}

.page-title,
.post-detail__title {
  margin: 0;
  font-size: 1.875rem;
  line-height: 2.25rem;
}

.page-title--mb {
  margin-bottom: 1.5rem;
}

.about-copy {
  display: grid;
  gap: 1rem;
  font-size: 0.9375rem;
  line-height: 1.8;
  color: rgba(35, 33, 39, 0.8);
}

.about-copy--author {
  display: block;
}

.about-copy--author::after {
  content: "";
  display: block;
  clear: both;
}

.about-copy p {
  margin: 0;
}

.author-avatar-wrap {
  margin-bottom: 1rem;
}

.author-avatar-wrap--float {
  float: left;
  margin: 0 1rem 0.5rem 0;
}

.author-avatar {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.author-avatar--sm {
  width: 1.5rem;
  height: 1.5rem;
}

.author-list-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.link-inline {
  color: inherit;
}

.about-contact-block {
  margin-top: 1.5rem;
}

.about-contact-block .post-detail__heading {
  margin-bottom: 0.75rem;
}

.about-social {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 1rem;
}

.about-social__item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 1.5rem;
  padding: 0;
  color: rgba(35, 33, 39, 0.82);
  background: transparent;
}

.about-social__item--disabled {
  color: var(--muted-foreground);
}

.about-social__item .icon {
  width: 1.125rem;
  height: 1.125rem;
  flex: 0 0 auto;
}

.about-social .link-inline,
.about-social .link-inline:hover {
  color: inherit;
}

.back-link {
  display: inline-block;
  font-size: 0.75rem;
  line-height: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.post-detail__title {
  margin-top: 1rem;
  line-height: 1.2;
  margin-bottom: 2rem;
}

.post-detail__image-wrap {
  margin-bottom: 2rem;
  border-radius: var(--radius);
  overflow: hidden;
}

.post-detail__image {
  display: block;
  width: 100%;
  height: auto;
}

.post-detail__content {
  margin-top: 0;
}

.post-detail__content p {
  margin-top: 0;
  margin-bottom: 1.5rem;
  max-width: none;
  font-size: 0.9375rem;
  line-height: 1.8;
  color: rgba(35, 33, 39, 0.82);
}

.post-detail__heading {
  margin: 2rem 0 1rem;
  font-size: 1.25rem;
  line-height: 1.5;
  font-weight: 400;
}

.post-detail__figure {
  margin: 0 0 1.5rem;
  width: 100%;
}

.post-detail__embed {
  margin: 0 0 1.5rem;
  width: 100%;
}

.post-detail__embed-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  aspect-ratio: 16 / 9;
}

.post-detail__embed-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.post-detail__inline-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.post-detail__caption {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--muted-foreground);
  font-style: italic;
}

.post-detail__quote {
  margin: 0 0 1.5rem;
  padding: 0;
}

.post-detail__quote p {
  margin: 0;
  color: rgba(35, 33, 39, 0.84);
  font-size: 1.05rem;
  line-height: 1.85;
  font-style: italic;
}

.post-detail__quote-mark {
  font-size: 1.25em;
  line-height: 0;
}

.post-detail__list {
  margin: 0 0 1.5rem;
  padding-left: 1.25rem;
}

.post-detail__list li {
  margin-bottom: 0.35rem;
  font-size: 0.9375rem;
  line-height: 1.8;
  color: rgba(35, 33, 39, 0.82);
}

.detail-meta--post {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 2rem 0 1rem;
}

.detail-meta__primary {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
}

.detail-meta__reading-time {
  margin-left: auto;
  white-space: nowrap;
}

.post-detail__signature {
  margin-top: 1rem;
  display: flex;
  justify-content: flex-end;
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.post-detail__tags-signature .post-detail__signature {
  margin-top: 0;
  margin-left: auto;
}

.post-detail__related {
  margin-top: 1rem;
}

.post-detail__share {
  margin-top: 1.25rem;
}

.post-detail__share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.post-detail__share-button {
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-width: auto;
  padding: 0;
}

.post-detail__share-button .icon {
  width: 1rem;
  height: 1rem;
}

.post-detail__share-feedback {
  min-height: 1.25rem;
  margin: 0.35rem 0 0;
}

@media print {
  .site-header,
  .site-footer,
  .back-link,
  .post-detail__share,
  .post-detail__related {
    display: none !important;
  }

  .page-shell,
  .site-main,
  .site-main--narrow {
    max-width: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .post-detail {
    margin: 0 !important;
    padding: 0 !important;
  }

  .detail-meta--post {
    margin-top: 0 !important;
  }

  .post-detail__tags-signature {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .post-detail__image-wrap,
  .post-detail__figure,
  .post-detail__embed,
  .post-detail__quote,
  .post-detail__list {
    page-break-inside: avoid;
    break-inside: avoid;
  }
}

.empty-state {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--background);
}

.empty-state__panel {
  text-align: center;
}

.empty-state__title {
  margin: 0 0 1rem;
  font-family: var(--font-sans);
  font-size: 2.25rem;
  line-height: 2.5rem;
  font-weight: 700;
}

.empty-state__copy {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  line-height: 1.75rem;
  color: var(--muted-foreground);
}

.empty-state__link {
  color: var(--foreground);
  text-decoration: underline;
}

.empty-state__link:hover {
  opacity: 0.9;
}

.icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
}

.icon--sm {
  width: 1rem;
  height: 1rem;
}

.icon--md {
  width: 1.25rem;
  height: 1.25rem;
}

.icon--xl {
  width: 3rem;
  height: 3rem;
}

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

.icon--ghost {
  color: rgba(139, 135, 148, 0.4);
}

.icon--faded {
  color: rgba(139, 135, 148, 0.3);
}

.admin-shell {
  min-height: 100vh;
  display: flex;
  background: var(--background);
}

.admin-sidebar {
  width: 14rem;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.admin-sidebar__header {
  padding: 1.5rem;
}

.admin-brand {
  display: inline-block;
  font-size: 1.25rem;
  line-height: 1.75rem;
}

.admin-subtitle,
.admin-copy,
.auth-subtitle,
.auth-toggle,
.admin-sidebar__email,
.admin-list-item__meta {
  color: var(--muted-foreground);
}

.admin-subtitle,
.auth-subtitle,
.admin-copy {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.admin-subtitle {
  margin: 0.25rem 0 0;
}

.admin-nav {
  flex: 1;
  padding: 0 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.admin-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--muted-foreground);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.admin-nav a.is-active {
  background: var(--accent);
  color: var(--foreground);
  font-weight: 500;
}

.admin-nav__divider {
  width: calc(100% - 1.5rem);
  margin: 0.5rem 0.75rem;
  border: 0;
  border-top: 1px solid var(--border);
}

.admin-sidebar__footer {
  padding: 0.75rem;
  border-top: 1px solid var(--border);
}

.admin-sidebar__email {
  margin: 0 0 0.5rem;
  padding: 0 0.75rem;
  font-size: 0.75rem;
  line-height: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-main {
  flex: 1;
  overflow: auto;
}

.admin-main__inner {
  width: min(100%, 56rem);
  margin: 0 auto;
  padding: 2rem;
}

.admin-section__title {
  margin: 0;
  font-size: 1.5rem;
  line-height: 2rem;
}

.admin-section__title--mb,
.toolbar--mb,
.filter-row--mb,
.settings-tabs--mb {
  margin-bottom: 1.5rem;
}

.admin-copy--mb,
.stats-grid--mb {
  margin-bottom: 2rem;
}

.admin-list-filters {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.admin-list-filters .filter-row {
  margin-bottom: 0;
}

.toolbar,
.filter-row,
.form-actions,
.stat-card__head,
.admin-list-item__title--row,
.admin-list-item__content--row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toolbar,
.form-actions {
  justify-content: space-between;
}

.filter-row {
  flex-wrap: wrap;
}

.admin-search-field {
  position: relative;
  flex: 1;
  min-width: min(100%, 18rem);
}

.admin-search-field .input {
  padding-left: 2.25rem;
}

.admin-search-field .input[type="search"]::-webkit-search-cancel-button,
.admin-search-field .input[type="search"]::-webkit-search-decoration,
.admin-search-field .input[type="search"]::-webkit-search-results-button,
.admin-search-field .input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.admin-search-field .input[type="search"]::-ms-clear,
.admin-search-field .input[type="search"]::-ms-reveal {
  display: none;
  width: 0;
  height: 0;
}

.admin-search-field__icon {
  position: absolute;
  left: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 1.125rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted-foreground);
  text-decoration: none;
  cursor: pointer;
}

.admin-search-field__icon:hover {
  color: var(--foreground);
}

.admin-search-field__icon:focus-visible {
  outline: 2px solid rgba(139, 135, 148, 0.3);
  outline-offset: 2px;
  border-radius: 999px;
}

.button,
.button-outline,
.button-ghost,
.tab-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.25rem;
  padding: 0 0.75rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.button {
  background: var(--foreground);
  color: #ffffff;
}

.button:hover {
  background: #2e2b33;
}

.button-outline,
.tab-button {
  background: #ffffff;
  color: var(--foreground);
  border-color: var(--border);
}

.button-outline:hover,
.tab-button:hover,
.button-ghost:hover {
  background: var(--accent);
}

.button-outline--danger {
  color: var(--destructive);
  border-color: rgba(179, 111, 82, 0.45);
}

.button-outline--danger:hover {
  background: rgba(179, 111, 82, 0.08);
  border-color: rgba(179, 111, 82, 0.65);
}

.button-outline.post-detail__share-button {
  border-color: transparent;
  background: transparent;
}

.button-outline.post-detail__share-button:hover,
.button-outline.post-detail__share-button:focus-visible {
  background: transparent;
  border-color: transparent;
}

.button-ghost {
  color: var(--muted-foreground);
}

.button-ghost--full,
.button--full {
  width: 100%;
}

.button-ghost--full {
  justify-content: flex-start;
}

.tab-button.is-active {
  background: var(--accent);
}

.admin-list {
  display: grid;
  gap: 0.5rem;
}

.admin-trash-bulk {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-trash-select-all {
  margin: 0;
}

.admin-trash-bulk__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.admin-list-item,
.admin-card,
.stat-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

.admin-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
}

.admin-user-card-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--accent);
  flex: 0 0 auto;
}

.admin-user-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.admin-list-item--hidden {
  background: rgba(179, 111, 82, 0.05);
  border-color: rgba(179, 111, 82, 0.2);
}

.admin-list-item--featured-hero {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.34);
}

.admin-list-item--featured-slot {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.22);
}

.admin-card {
  padding: 1.5rem;
}

.admin-form-panel {
  padding: 1.5rem;
}

.admin-card--stack {
  display: flex;
  flex-direction: column;
}

.admin-card--mb {
  margin-bottom: 1.5rem;
}

.admin-card--stack > .admin-form-title + .admin-health-list {
  margin-top: 0.75rem;
}

.admin-card--narrow {
  max-width: 32rem;
}

.admin-list-item__content--grow {
  flex: 1;
  min-width: 0;
}

.admin-list-item__content--row {
  gap: 0.75rem;
}

.admin-list-item__name {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: var(--foreground);
}

.admin-list-item__name--plain {
  margin: 0;
}

.admin-list-item__meta {
  margin: 0.125rem 0 0;
  font-size: 0.75rem;
  line-height: 1rem;
}

.admin-health-list {
  gap: 0;
}

.admin-health-list__item {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0.5rem 0;
  gap: 0.75rem;
}

.admin-health-list__item + .admin-health-list__item {
  border-top: 1px solid var(--border);
}

.admin-health-stat-label {
  margin-bottom: 0.375rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.25rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  background: var(--accent);
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--muted-foreground);
}

.status-chip {
  font-weight: 500;
}

.status-chip--draft {
  background: var(--accent);
  color: var(--muted-foreground);
}

.status-chip--pending_review {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.status-chip--approved_hidden {
  background: rgba(100, 116, 139, 0.16);
  color: #334155;
}

.status-chip--published {
  background: rgba(22, 163, 74, 0.14);
  color: #166534;
}

.status-chip--rejected {
  background: rgba(179, 111, 82, 0.16);
  color: var(--destructive);
}

.badge--hidden {
  padding: 0;
  background: transparent;
  color: var(--destructive);
}

.badge--unsaved {
  background: rgba(200, 130, 35, 0.14);
  color: #8a5a1f;
}

.badge--missing-alt {
  background: var(--destructive);
  color: #ffffff;
  border: 1px solid var(--destructive);
  font-weight: 600;
}

.badge--rejected {
  background: rgba(179, 111, 82, 0.16);
  color: var(--destructive);
}

.seo-checklist {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  background: rgba(241, 245, 249, 0.35);
}

.seo-checklist__title {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--muted-foreground);
}

.seo-checklist__score {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--foreground);
}

.seo-checklist__score--error {
  color: var(--destructive);
}

.seo-checklist__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.375rem;
}

.seo-checklist__item {
  display: grid;
  grid-template-columns: minmax(6rem, auto) auto minmax(6rem, auto) 1fr;
  gap: 0.5rem;
  align-items: center;
}

.seo-checklist__label {
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--foreground);
}

.seo-checklist__detail,
.seo-checklist__message {
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--muted-foreground);
}

.seo-checklist__message--multiline {
  white-space: pre-line;
}

@media (max-width: 820px) {
  .seo-checklist__item {
    grid-template-columns: 1fr;
    gap: 0.25rem;
    align-items: start;
  }
}

.action-group {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius);
  color: var(--muted-foreground);
  cursor: pointer;
}

.action-button:hover {
  background: var(--accent);
  color: var(--foreground);
}

.admin-list-item--hidden .action-button:hover,
.admin-list-item--featured-hero .action-button:hover,
.admin-list-item--featured-slot .action-button:hover {
  background: transparent;
}

.admin-form-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 400;
}

.admin-empty {
  margin: 0;
  padding: 2rem 0;
  text-align: center;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--muted-foreground);
}

.admin-empty--list {
  grid-column: 1 / -1;
  padding: 1rem 1.25rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.02);
}

.admin-pagination {
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

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

.stat-card {
  padding: 1.25rem;
}

.stat-card__head {
  margin-bottom: 0.75rem;
  gap: 0.75rem;
}

.stat-card__value {
  margin: 0;
  font-size: 1.5rem;
  line-height: 2rem;
}

.chart-placeholder {
  padding: 2rem;
  text-align: center;
}

.chart-placeholder .icon--xl {
  margin: 0 auto 1rem;
}

.chart-placeholder .admin-copy {
  margin: 0;
}

.analytics-list {
  margin-top: 0.75rem;
}

.analytics-range-switch {
  margin-top: 0.5rem;
}

.analytics-metrics-note {
  gap: 0.35rem;
}

.analytics-metrics-note .admin-copy {
  margin: 0;
}

.analytics-line-chart {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: var(--muted-foreground);
  position: relative;
}

.analytics-line-chart svg {
  display: block;
  width: 100%;
  height: 15rem;
}

.analytics-line-chart__grid {
  stroke: rgba(15, 23, 42, 0.12);
  stroke-width: 1;
}

.analytics-line-chart__axis-label {
  fill: inherit;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.75rem;
  stroke: none;
}

.analytics-line-chart__area {
  fill: rgba(15, 23, 42, 0.08);
}

.analytics-line-chart__line {
  fill: none;
  stroke: var(--foreground);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.analytics-line-chart__dot {
  fill: var(--foreground);
  stroke: #ffffff;
  stroke-width: 1.2;
  cursor: pointer;
}

.analytics-line-chart__dot:hover,
.analytics-line-chart__dot.is-active,
.analytics-line-chart__dot:focus-visible {
  fill: #111827;
}

.analytics-line-chart__dot:focus-visible {
  outline: none;
}

.analytics-line-chart__tooltip {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  transform: translate(-50%, calc(-100% - 10px));
  border-radius: 0.45rem;
  background: rgba(15, 23, 42, 0.94);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.25);
  padding: 0.24rem 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  line-height: 1.1rem;
  white-space: nowrap;
  pointer-events: none;
}

.analytics-line-chart__tooltip::after {
  content: "";
  position: absolute;
  left: calc(50% + var(--analytics-tooltip-arrow-offset, 0px));
  top: 100%;
  width: 8px;
  height: 8px;
  background: rgba(15, 23, 42, 0.94);
  transform: translate(-50%, -50%) rotate(45deg);
}

.analytics-line-chart__tooltip[hidden] {
  display: none;
}

.analytics-line-chart__footer {
  display: flex;
  justify-content: space-between;
  color: var(--muted-foreground);
  font-size: 0.75rem;
  line-height: 1rem;
  font-family: var(--font-sans);
  font-weight: 400;
}

.analytics-users .admin-copy {
  margin: 0.4rem 0 0;
}

.analytics-users {
  margin-top: 1rem;
}

.analytics-dashboard-recommendations {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.35rem;
}

.analytics-dashboard-recommendations .admin-copy {
  margin: 0;
}

.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.rich-text-editor {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
}

.rich-text-editor__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  padding: 0.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--background);
}

.rich-text-editor__button {
  min-width: 2rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: 0.75rem;
  line-height: 1rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
}

.rich-text-editor__button:hover {
  background: rgba(17, 24, 39, 0.05);
}

.rich-text-editor__editable {
  min-height: 6rem;
  padding: 0.75rem;
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--foreground);
  outline: none;
  white-space: pre-wrap;
  word-break: break-word;
}

.rich-text-editor__editable--lg {
  min-height: 12rem;
}

.rich-text-editor__editable:focus {
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.25);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-form-compact .form-field + .form-field,
.admin-form-compact .form-field + .form-actions {
  margin-top: 0.75rem;
}

.form-fieldset-reset {
  margin: 0;
  padding: 0;
  border: 0;
  min-inline-size: 0;
}

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

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

.form-divider {
  width: 1.25rem;
  margin: 1.25rem auto;
  border: 0;
  border-top: 1px solid var(--border);
}

.article-form-media-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.article-form-media-grid__preview {
  grid-row: span 2;
}

.article-form-layout-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
}

.article-form-layout-grid__taxonomy {
  grid-column: 1 / span 2;
  grid-row: 1;
  display: grid;
  gap: 1rem;
  align-content: start;
}

.article-form-layout-grid__taxonomy .article-form-layout-grid__category,
.article-form-layout-grid__taxonomy .article-form-layout-grid__tags {
  grid-column: 1 / -1;
  grid-row: auto;
}

.article-form-layout-grid__preview {
  grid-column: 3 / span 2;
  grid-row: 1;
}

.article-form-layout-grid__divider {
  grid-column: 1 / -1;
  grid-row: 2;
}

.article-form-layout-grid__scheduled {
  grid-column: 1 / span 2;
  grid-row: 3;
}

.article-form-layout-grid__date {
  grid-column: 3 / span 1;
  grid-row: 3;
}

.article-form-layout-grid__author {
  grid-column: 4 / span 1;
  grid-row: 3;
}

.article-form-layout-grid__related {
  grid-column: 1 / span 2;
  grid-row: 4;
}

.article-form-layout-grid__featured {
  grid-column: 3 / span 2;
  grid-row: 4;
}

.article-form-meta-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.article-form-meta-grid__date,
.article-form-meta-grid__published,
.article-form-meta-grid__author,
.article-form-meta-grid__hero,
.article-form-meta-grid__slot {
  grid-column: span 1;
}

.article-form-meta-grid__featured {
  grid-column: span 2;
}

.article-form-meta-grid__author {
  grid-column: span 1;
}

.article-form-meta-grid__error {
  grid-column: 1 / -1;
}

.article-form-meta-grid__published .checkbox-row,
.article-form-meta-grid__hero .checkbox-row {
  min-height: 2.5rem;
  margin: 0;
  align-items: center;
  padding-left: 0.35rem;
}

.article-form-meta-grid__published .checkbox-row input[type="checkbox"],
.article-form-meta-grid__hero .checkbox-row input[type="checkbox"] {
  margin: 0;
}

.article-selected-media-grid {
  display: grid;
  gap: 0.75rem;
  align-items: start;
}

.form-field--tight {
  gap: 0.5rem;
}

.form-label {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: var(--foreground);
}

.char-counter {
  font-size: 0.75rem;
  line-height: 1.1rem;
  color: var(--muted-foreground);
}

.char-counter--over {
  color: var(--destructive);
}

.input-counter-wrap {
  position: relative;
  display: block;
}

.input-counter-wrap .input {
  padding-right: 4.4rem;
}

.input-counter-wrap .char-counter {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  min-width: 3.25rem;
  text-align: right;
  pointer-events: none;
}

.input-inline-action-wrap {
  position: relative;
  display: block;
}

.input-inline-action-wrap .input {
  padding-right: 3rem;
}

.input-inline-action-wrap__button {
  position: absolute;
  right: 0.375rem;
  top: 50%;
  transform: translateY(-50%);
}

.input-inline-action-wrap__button.is-active {
  color: var(--foreground);
  background: var(--accent);
}

.admin-advanced-toggle {
  margin: 0;
  padding-top: 0.5rem;
  display: block;
}

.admin-advanced-toggle__summary {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  padding: 0;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: var(--foreground);
  width: 25%;
  margin-left: auto;
  justify-content: flex-end;
  text-align: right;
}

.admin-advanced-toggle__summary:hover {
  color: var(--foreground);
}

.admin-advanced-toggle__summary::-webkit-details-marker {
  display: none;
}

.admin-advanced-toggle__summary::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-0.08rem);
  transform-origin: center;
  transition: transform 160ms ease;
}

.admin-advanced-toggle[open] .admin-advanced-toggle__summary::after {
  transform: rotate(225deg) translateY(-0.02rem);
}

.admin-advanced-toggle__content {
  display: block;
  width: 100%;
  padding-top: 0.85rem;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 2.5rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 0.125rem);
  background: var(--background);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--foreground);
}

.input--readonly {
  display: flex;
  align-items: center;
}

.input--readonly,
.input[readonly],
.input:disabled,
.select:disabled,
.textarea[readonly],
.textarea:disabled {
  background: var(--muted);
  color: var(--muted-foreground);
  -webkit-text-fill-color: var(--muted-foreground);
}

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

.select {
  padding-right: 2.4rem;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1.5 1.5L6 6L10.5 1.5' stroke='%238B8794' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 0.75rem 0.5rem;
}

.input--list {
  padding-right: 2.4rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1.5 1.5L6 6L10.5 1.5' stroke='%238B8794' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 0.75rem 0.5rem;
}

.textarea {
  min-height: 12rem;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: 2px solid rgba(139, 135, 148, 0.3);
  outline-offset: 1px;
}

.input--error,
.select--error,
.textarea--error {
  border-color: var(--destructive);
}

.input--error:focus,
.select--error:focus,
.textarea--error:focus {
  outline: 2px solid rgba(179, 111, 82, 0.32);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.admin-stack-sm {
  margin-top: 1rem;
}

.article-list-build-meta {
  margin-bottom: 0.75rem;
}

.workflow-status-line {
  margin-bottom: 0.75rem;
}

.form-actions--top {
  margin-top: 1rem;
  justify-content: flex-start;
}

.form-actions--start {
  justify-content: flex-start;
}

.form-actions__left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-actions__right {
  margin-left: auto;
}

.form-save-state {
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--muted-foreground);
}

.form-save-state--dirty {
  color: var(--destructive);
}

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
}

.auth-panel {
  width: 100%;
  max-width: 24rem;
}

.auth-title {
  margin: 0 0 0.5rem;
  font-size: 1.875rem;
  line-height: 2.25rem;
}

.auth-subtitle {
  margin: 0 0 2rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-toggle {
  margin-top: 1rem;
  width: 100%;
  padding: 0;
  text-align: center;
  font-size: 0.875rem;
  line-height: 1.25rem;
  cursor: pointer;
}

.admin-error {
  margin: 0;
  display: block;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--destructive);
}

.flash-message .admin-copy,
.flash-message .admin-error {
  margin: 0;
}

.flash-message--success {
  border-color: rgba(35, 33, 39, 0.12);
  background: rgba(246, 245, 247, 0.6);
}

.flash-message--error {
  border-color: rgba(179, 111, 82, 0.22);
}

.form-error-summary {
  margin-bottom: 1rem;
}

.inline-form {
  margin: 0;
}

.action-group .inline-form {
  display: inline;
}

.muted {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.625;
  color: var(--muted-foreground);
}

.tag-editor {
  display: grid;
  gap: 0.75rem;
}

.tag-editor__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-editor__controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tag-editor__controls .input {
  flex: 1;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 2rem;
  padding: 0.25rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--accent);
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--foreground);
}

.tag-chip--unused:not(.category-chip--active) {
  border-color: rgba(179, 111, 82, 0.35);
  background: rgba(179, 111, 82, 0.08);
}

.tag-chip__label {
  white-space: nowrap;
}

.category-chip__link {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.category-chip__link:hover {
  color: var(--foreground);
}

.category-chip--active {
  border-color: var(--foreground);
  background: var(--foreground);
  color: #ffffff;
}

.category-chip--active .category-chip__link,
.category-chip--active .category-chip__link:hover {
  color: #ffffff;
}

.category-chip--active .tag-chip__remove {
  color: rgba(255, 255, 255, 0.8);
}

.category-chip--active .tag-chip__remove:hover {
  color: #ffffff;
}

.tag-chip__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  color: var(--muted-foreground);
  cursor: pointer;
}

.tag-chip__remove:hover {
  color: var(--foreground);
}

.form-field--full {
  grid-column: 1 / -1;
}

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

.media-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.875rem;
}

.media-card__preview {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 0.85rem;
  background: rgba(15, 23, 42, 0.06);
}

.media-card__preview-trigger {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.media-card__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-card__badges {
  position: absolute;
  top: 0.45rem;
  left: 0.45rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  z-index: 2;
  pointer-events: none;
}

.media-edit-preview {
  overflow: hidden;
  border-radius: 0.85rem;
  background: rgba(15, 23, 42, 0.06);
  margin-bottom: 1rem;
}

.media-edit-preview img {
  display: block;
  width: 100%;
  height: auto;
}

.media-card__body {
  display: grid;
  gap: 0.4rem;
}

.media-card .admin-list-item__name {
  font-size: 0.9375rem;
  line-height: 1.35rem;
}

.media-card .admin-list-item__meta {
  font-size: 0.8125rem;
  line-height: 1.2rem;
}

.media-card__actions {
  justify-content: flex-start;
}

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

.media-picker-toolbar {
  margin-bottom: 0.75rem;
}

.media-picker-toolbar--search {
  margin-bottom: 1rem;
}

.media-picker__option {
  display: block;
}

.media-picker__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.media-picker__card {
  display: grid;
  gap: 0.65rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  background: var(--card);
  cursor: pointer;
  min-height: 100%;
  align-content: start;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.media-picker__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.media-picker__card--empty {
  align-items: center;
  justify-items: center;
  min-height: 8.5rem;
}

.media-picker__preview {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 0.65rem;
  background: rgba(15, 23, 42, 0.06);
}

.media-picker__preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.media-picker__title {
  font-size: 0.875rem;
  line-height: 1.35;
  color: var(--foreground);
}

.media-picker__usage {
  justify-self: start;
}

.media-picker__status {
  display: none;
}

.media-picker__input:checked + .media-picker__card {
  border-color: var(--foreground);
  background: rgba(15, 23, 42, 0.04);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.16);
}

.media-picker__input:checked + .media-picker__card .media-picker__status {
  display: inline-flex;
}

.article-media-preview {
  margin-bottom: 1rem;
  padding: 0;
}

.article-media-preview__trigger {
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0.85rem;
  overflow: hidden;
  background: transparent;
  cursor: zoom-in;
}

.article-media-preview__trigger:disabled {
  cursor: default;
}

.article-media-preview__trigger img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.media-lightbox {
  position: relative;
  width: fit-content;
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}

.media-lightbox::backdrop {
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(2px);
}

.media-lightbox img {
  display: block;
  max-width: min(96vw, 1200px);
  max-height: 92vh;
  width: auto;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 0.85rem;
}

.media-lightbox__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 1;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
  color: #ffffff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.article-media-panel {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--card);
}

.article-media-panel[hidden] {
  display: none !important;
}

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

.content-block-editor--error {
  padding: 0.75rem;
  border: 1px solid rgba(179, 111, 82, 0.35);
  border-radius: calc(var(--radius) + 0.125rem);
}

.content-block-list {
  display: grid;
  gap: 1rem;
}

.content-block {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
}

.content-block-image-preview {
  margin: 0.25rem 0 0;
  max-width: 13rem;
}

.content-block-image-preview .article-media-preview__trigger img {
  aspect-ratio: 4 / 3;
}

.embed-preview {
  display: grid;
  gap: 0.5rem;
}

.embed-preview__status {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.25rem;
  color: var(--muted-foreground);
}

.embed-preview__status--error {
  color: #b45309;
}

.embed-preview__status--ok {
  color: var(--foreground);
}

.embed-preview__frame {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  background: rgba(15, 23, 42, 0.02);
}

.embed-preview__frame iframe {
  display: block;
  width: 100%;
  min-height: 16rem;
  border: 0;
}

.content-block-picker-dialog {
  width: min(96vw, 1100px);
  max-width: 96vw;
  padding: 0;
  border: 0;
  background: transparent;
}

.content-block-picker-dialog::backdrop {
  background: rgba(15, 23, 42, 0.35);
}

.content-block-picker-dialog__panel {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--card);
}

.content-block-picker-dialog__filters {
  align-items: center;
  gap: 0.5rem;
}

.content-block-picker-dialog__filters .select {
  min-width: 9.5rem;
}

.content-block-picker-option {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.content-block-picker-option__status {
  display: none;
}

.content-block-picker-option.is-selected .content-block-picker-option__status {
  display: inline-flex;
}

.content-block-picker-option.is-selected .media-picker__card {
  border-color: var(--foreground);
  background: rgba(15, 23, 42, 0.04);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.16);
}

.content-block__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.content-block-editor__actions {
  margin-top: 0;
}

.content-block-editor__actions-label {
  font-size: 0.8125rem;
  line-height: 1.2rem;
  color: var(--muted-foreground);
}

.content-block-editor__action-button {
  min-width: 2.25rem;
  padding-left: 0.625rem;
  padding-right: 0.625rem;
}

.content-block-editor__action-icon {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
}

.content-block-editor__action-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.is-hidden {
  display: none !important;
}

.dropzone {
  position: relative;
  display: grid;
  gap: 0.4rem;
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: 0.85rem;
  background: rgba(15, 23, 42, 0.02);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--foreground);
  background: rgba(15, 23, 42, 0.05);
}

.dropzone__input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone__copy {
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--foreground);
}

.dropzone__file {
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--muted-foreground);
}

@media (min-width: 768px) {
  .hero__title {
    font-size: 3rem;
    line-height: 1;
  }

  .page-title,
  .post-detail__title {
    font-size: 2.25rem;
    line-height: 2.5rem;
  }

  .masonry {
    column-count: 2;
  }

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

@media (max-width: 900px) {
  .admin-shell {
    flex-direction: column;
  }

  .admin-sidebar {
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

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

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

  .article-form-layout-grid__taxonomy,
  .article-form-layout-grid__category,
  .article-form-layout-grid__scheduled,
  .article-form-layout-grid__date,
  .article-form-layout-grid__author,
  .article-form-layout-grid__related,
  .article-form-layout-grid__featured,
  .article-form-layout-grid__tags,
  .article-form-layout-grid__preview {
    grid-column: span 1;
    grid-row: auto;
  }

  .article-form-layout-grid__divider {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .admin-advanced-toggle__summary {
    width: 50%;
  }

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

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

@media (max-width: 640px) {
  .site-header__inner,
  .site-footer__inner,
  .site-main,
  .site-main--narrow,
  .admin-main__inner {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .site-header__inner,
  .site-footer__inner,
  .toolbar,
  .admin-list-item,
  .form-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-footer__inner {
    flex-direction: row;
    align-items: center;
    justify-content: center;
  }

  .form-actions__left {
    width: 100%;
  }

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

  .action-group,
  .button--full,
  .button-ghost--full {
    width: 100%;
  }

  .action-button {
    width: 2.25rem;
  }

  .article-form-meta-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .article-form-layout-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .article-form-layout-grid__taxonomy,
  .article-form-layout-grid__category,
  .article-form-layout-grid__scheduled,
  .article-form-layout-grid__date,
  .article-form-layout-grid__author,
  .article-form-layout-grid__related,
  .article-form-layout-grid__featured,
  .article-form-layout-grid__tags,
  .article-form-layout-grid__preview {
    grid-column: span 1;
    grid-row: auto;
  }

  .article-form-layout-grid__divider {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .admin-advanced-toggle__summary {
    width: 100%;
  }

  .article-form-meta-grid__date,
  .article-form-meta-grid__published,
  .article-form-meta-grid__author,
  .article-form-meta-grid__hero,
  .article-form-meta-grid__slot,
  .article-form-meta-grid__featured {
    grid-column: span 1;
  }

  .article-form-media-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .article-form-media-grid__preview {
    grid-column: span 1;
    grid-row: span 1;
  }

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

  .form-grid--2 {
    grid-template-columns: 1fr;
  }

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