h1 {
  margin: 0;
  font-size: clamp(1.6rem, 2vw + 1rem, 2.4rem);
  letter-spacing: -0.02em;
  font-family: "Source Serif 4", serif;
}

.tagline {
  margin: var(--space-1) 0 0;
  color: var(--muted);
}

main {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}

h2 {
  margin: 0 0 var(--space-2);
  font-size: clamp(1.3rem, 1vw + 1rem, 1.7rem);
  letter-spacing: -0.01em;
  font-family: "Source Serif 4", serif;
}

h3 {
  margin: 0;
  font-size: clamp(1.05rem, 0.4vw + 1rem, 1.2rem);
  font-family: "Source Serif 4", serif;
}

p {
  margin: 0 0 var(--space-2);
  font-family: "Source Serif 4", serif;
}

ul {
  padding-left: 1.1rem;
  margin: 0;
  display: grid;
  gap: var(--space-1);
}

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

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

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #312e81;
  font-weight: 600;
  border: 1px solid #e0e7ff;
}

.pill-strong {
  background: #e0f2fe;
  color: #0b5cab;
  border-color: #bae6fd;
}

.pill-light {
  background: #f1f5f9;
  color: var(--text);
  border-color: var(--border);
}

.pill-accent {
  background: #dcfce7;
  color: #0f5132;
  border-color: #bbf7d0;
}

.pill-muted {
  background: #f8fafc;
  color: var(--muted);
  border-color: var(--border);
}

.pill-light {
  background: #f1f5f9;
  color: var(--text);
  border-color: var(--border);
}

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

.content-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  box-shadow: var(--shadow);
  display: grid;
  gap: var(--space-2);
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.page-shell {
  display: grid;
  gap: var(--space-3);
  padding-top: var(--page-padding-block);
  padding-bottom: var(--page-padding-block);
}

.page {
  width: 100%;
  margin: 0;
  padding: 0;
}

.stack {
  display: grid;
  gap: var(--space-2);
}

.stack.stack-lg {
  gap: var(--space-3);
}

.media-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 6px;
  background: var(--border);
  display: block;
}

.media-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: var(--focal-x, 50%) var(--focal-y, 50%);
}

.media-frame--cover,
.media-frame--card {
  aspect-ratio: 16 / 9;
}

.media-frame--thumb {
  aspect-ratio: 1 / 1;
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 4px;
}

.page-container {
  width: 100%;
  max-width: var(--page-max-width, 1024px);
  margin: 0 auto;
  padding-left: var(--page-padding-left);
  padding-right: var(--page-padding-right);
  box-sizing: border-box;
  min-width: 0;
}

.gn {
  width: 100%;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}

.gn__left {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: flex-start;
}

.gn__brand {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.gn__brand:hover,
.gn__brand:focus-visible {
  color: var(--text);
  text-decoration: none;
}

.gn__right {
  display: inline-flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
}

.gn__center,
.gn__right {
  text-align: center;
}

.gn__right {
  justify-self: end;
}

/* Nav tabs (center) */
.nav-tabs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 4px;
  background: transparent;
  text-decoration: none;
  white-space: nowrap;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.0078rem;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  position: relative;
  border: 0;
}

.nav-tab:hover {
  background-color: rgba(0, 0, 0, 0.06);
  color: var(--text);
  text-decoration: none;
}

.nav-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.nav-tab.is-active {
  color: var(--text);
}

.nav-tab.is-active::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 0;
  height: 2px;
  background: var(--text);
  border-radius: 999px;
}

/* Override global nav link styles for header tabs */
.gn__center.nav-tabs .nav-tab {
  background: transparent;
  border: 0;
  padding: 5px 10px;
  border-radius: 4px;
  box-shadow: none;
  transform: none;
  text-decoration: none;
}

.gn__center.nav-tabs .nav-tab:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
  transform: none;
  text-decoration: none;
}

.gn__center.nav-tabs .nav-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  transform: none;
  text-decoration: none;
}

.gn__center.nav-tabs .nav-tab.is-active {
  color: var(--text);
}

.gn__center.nav-tabs .nav-tab.is-active::after {
  /* underline handled by base nav-tab is-active */
}

/* Ensure no underline on default/hover; only active shows underline via ::after */
.nav-tab,
.nav-tab:hover {
  text-decoration: none;
}

/* Right-side nav tabs aligned with center styles */
.gn__right.nav-tabs {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.gn__right.nav-tabs .nav-tab {
  padding: 5px 10px;
  border-radius: 4px;
  background: transparent;
  border: 0;
  text-decoration: none;
  color: var(--text);
  box-shadow: none;
  transform: none;
}

.gn__right.nav-tabs .nav-tab:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
  transform: none;
}

.gn__right.nav-tabs .nav-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  transform: none;
}

.gn__right.nav-tabs .nav-tab.is-active::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 0;
  height: 2px;
  background: var(--text);
  border-radius: 999px;
}

@media (max-width: 820px) {
  .gn__inner {
    grid-template-columns: 1fr auto;
  }

  .gn__center {
    display: none;
  }

  .gn__right {
    justify-content: flex-end;
  }
}

.page-section {
  margin: 16px 0 32px;
}

.page-section-home {
  /* Home-specific adjustments can be added here */
}

.page-section-blog {
  /* Blog-specific adjustments can be added here */
}

.page-section-admin {
  /* Admin-specific adjustments can be added here */
}

.blog-index .blog-hero-title {
  margin: 0;
  font-size: clamp(1.6rem, 1.4vw + 1rem, 2.2rem);
  letter-spacing: -0.01em;
}

.blog-toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--space-2);
}

.tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tabs .tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  border: 0;
  text-decoration: none;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.tabs .tab:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
}

.tabs .tab.is-active::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 0;
  height: 2px;
  background: var(--text);
  border-radius: 999px;
}

.tabs .tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.blog-tabbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.blog-tabbar__left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.blog-tabbar__visible {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.blog-tabbar__overflow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.blog-tabbar__overflow.is-hidden {
  display: none;
}

.blog-overflow-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 180px;
  display: none;
  flex-direction: column;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  z-index: 30;
}

.blog-overflow-menu.is-open {
  display: flex;
}

.blog-overflow-label {
  font-size: 14px;
  color: var(--muted);
}

.blog-tabbar__actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.blog-tabbar__actions.is-hidden {
  display: none;
}

.nav-tab--icon {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.blog-manage-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 60;
}

.blog-manage-modal.is-open {
  display: block;
}

.blog-manage-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.blog-manage-modal__dialog {
  position: relative;
  max-width: 420px;
  margin: 80px auto;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  display: grid;
  gap: 12px;
  z-index: 1;
}

.blog-manage-modal__header h3 {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 600;
}

.blog-manage-modal__body {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.manage-cat-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.blog-manage-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.blog-manage-modal__error {
  color: #b3261e;
  font-size: 14px;
}

/* Category combobox */
.category-combobox {
  position: relative;
  display: grid;
  gap: 6px;
}

.category-combobox__input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #f8fafc;
}

.category-combobox__dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  display: none;
  max-height: 260px;
  overflow: auto;
  z-index: 40;
}

.category-combobox__dropdown.is-open {
  display: block;
  pointer-events: auto;
}

.category-option {
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-option:hover,
.category-option.is-active {
  background: var(--color-hover);
}

.category-option.is-disabled {
  cursor: default;
  color: var(--muted);
  background: transparent;
  pointer-events: none;
}

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

.blog-search input[type="text"] {
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 14px;
}

.post-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 80px minmax(0, 1fr);
  gap: 64px 0;
  align-items: start;
}

@media (max-width: 1024px) {
  .post-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }
}

.post-grid > .post-card-v2 {
  grid-column: auto !important;
  grid-row: auto !important;
  width: 100%;
  max-width: 448px;
  justify-self: center;
  min-width: 0;
}

.post-grid__sep {
  grid-column: 2;
  width: 1px;
  justify-self: center;
  align-self: stretch;
  background: var(--border);
}

@media (max-width: 1024px) {
  .post-grid__sep {
    display: none;
  }
}

.post-card-v2 {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  text-decoration: none;
  color: var(--text);
  outline: none;
}

.post-card-v2:visited,
.post-card-v2:hover {
  color: var(--text);
  text-decoration: none;
}

.post-card-v2:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.post-card-v2__media {
  background: var(--border);
  border-radius: 6px;
}

.post-card-v2__body {
  display: grid;
  gap: 8px;
  padding: 0;
  margin-top: 20px;
  background: transparent;
}

.post-card-v2__body > * {
  margin: 0;
}

.post-card-v2__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted);
}

.post-card-v2__vis {
  text-transform: capitalize;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  height: 20px;
  padding: 0 9px 0 7px;
  border-radius: 10px;
  font-weight: 600;
}

.post-card-v2__vis--public {
  color: #2a533c;
  background: rgba(0, 96, 38, 0.156);
}

.post-card-v2__vis--private {
  color: #494846;
  background: #1c13011c;
}

.post-card-v2__vis--password {
  color: #6a4222;
  background: rgba(196, 88, 0, 0.2);
}

.post-editor-form input[type="text"],
.post-editor-form input[type="email"],
.post-editor-form input[type="url"],
.post-editor-form input[type="number"],
.post-editor-form .category-combobox__input {
  border: none;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.post-card-v2__meta-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
}

.post-card-v2__meta-left span {
  display: inline-flex;
  align-items: center;
}

.post-card-v2__meta-cat {
  font-weight: 600;
  color: var(--text);
}

.post-card-v2__meta-author {
  font-weight: 600;
  color: var(--text);
}

.post-card-v2__title {
  font-size: 21px;
  line-height: 1.33;
  letter-spacing: -0.012em;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  margin: 0;
}

.post-card-v2__excerpt {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.post-card-v2__arrow {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.post-card-v2:hover .post-card-v2__arrow,
.post-card-v2:focus-visible .post-card-v2__arrow {
  opacity: 1;
  transform: translateX(0);
}

@media (max-width: 768px) {
  .blog-toolbar {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  .blog-search {
    width: 100%;
    flex-wrap: wrap;
  }

  .blog-search input[type="text"] {
    flex: 1 1 auto;
    width: 100%;
  }
}

.post-editor-page {
  min-height: 100vh;
  background-color: transparent;
  padding: 16px 0 32px;
}

.post-editor-content {
  width: 100%;
}

.post-cover {
  width: 100%;
  height: 260px;
  border-radius: 6px;
  overflow: hidden;
  background: transparent;
  display: none;
  position: relative;
}

.post-cover.is-visible {
  display: block;
}

.post-cover__controls {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.post-cover:hover .post-cover__controls,
.post-cover:focus-within .post-cover__controls {
  opacity: 1;
}

.post-cover__btn {
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.04);
  color: #111;
  border: none;
  cursor: pointer;
}

.post-cover__btn:hover,
.post-cover__btn:focus-visible {
  background: rgba(0, 0, 0, 0.08);
  outline: none;
}

.cover-picker-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  display: none;
  z-index: 60;
}

.cover-picker-backdrop.is-open {
  display: block;
}

.cover-picker {
  position: fixed;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, 90vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 40px -24px rgba(15, 23, 42, 0.35);
  padding: 16px;
  display: none;
  flex-direction: column;
  gap: 12px;
  z-index: 70;
}

.cover-picker.is-open {
  display: flex;
}

.cover-picker__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.cover-picker__header h3 {
  margin: 0;
  font-family: inherit;
  font-weight: 600;
}

.cover-picker__close {
  background: transparent;
  border: 0;
  font-size: 20px;
  cursor: pointer;
}

.cover-picker__tabs {
  display: inline-flex;
  gap: 8px;
}

.cover-picker__tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 4px;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--text);
  text-decoration: none;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.cover-picker__tab.is-active {
  color: var(--text);
}

.cover-picker__tab.is-active::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 0;
  height: 2px;
  background: var(--text);
  border-radius: 999px;
}

.cover-picker__tab:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
}

.cover-picker__tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cover-picker__panel {
  display: none;
  gap: 8px;
  flex-direction: column;
}

.cover-picker__panel.is-active {
  display: flex;
}

.cover-picker__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  grid-auto-rows: 64px;
}

.cover-picker__grid .cover-picker__thumb {
  width: 100%;
}

@media (max-width: 1024px) {
  .cover-picker__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .cover-picker__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.cover-picker__thumb {
  display: block;
  padding: 0;
  border: 0;
  cursor: pointer;
  border-radius: 6px;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
  transition: background 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
  height: 64px;
  width: 100%;
}

.cover-picker__thumb.media-frame--thumb {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 4px;
  height: 64px;
  width: 100%;
}

.cover-picker__thumb.media-frame {
  background: transparent;
  box-shadow: none;
}

.cover-picker__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 60%;
  border-radius: 0;
}

.cover-picker__thumb:hover {
  background: var(--color-hover);
}

.cover-picker__thumb:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cover-picker__thumb.is-active,
.cover-picker__thumb:focus-visible {
  box-shadow: 0 0 0 2px var(--accent);
  border-color: var(--accent);
}

.cover-picker__field {
  display: grid;
  gap: 6px;
}

.cover-picker__error {
  color: #b3261e;
  font-size: 14px;
}

.editor-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding-inline: 0;
  margin: 0;
  width: 100%;
  border-bottom: none;
  background: transparent;
  overflow: visible;
  cursor: default;
  user-select: none;
  gap: 12px;
  position: relative;
}

.topbar__left,
.topbar__right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.topbar__right {
  gap: 6px;
}

.autosave-mount {
  margin-top: 16px;
  margin-bottom: 8px;
}

.autosave-status {
  font-size: 14px;
  margin-top: 6px;
  color: #46a171;
}

.editor-divider {
  width: 60px;
  height: 1px;
  background: var(--border);
  margin: 12px 0;
}

.editor-format-toolbar {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  padding: 6px 0;
  margin: 0 0 12px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.editor-format-toolbar__group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 34px;
  padding: 0 6px;
  border-right: 1px solid var(--border);
}

.editor-format-toolbar__group:first-child {
  padding-left: 0;
}

.editor-format-toolbar__group:last-child {
  border-right: 0;
  padding-right: 0;
}

.editor-format-toolbar__btn,
.editor-format-toolbar__select {
  height: 32px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.editor-format-toolbar__btn {
  min-width: 30px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
}

.editor-format-toolbar__select {
  min-width: 116px;
  padding: 0 22px 0 8px;
  cursor: pointer;
}

.editor-format-toolbar__select--compact {
  min-width: 84px;
}

.editor-format-toolbar__btn:hover,
.editor-format-toolbar__btn:focus-visible,
.editor-format-toolbar__select:hover,
.editor-format-toolbar__select:focus-visible {
  background: var(--color-hover);
  outline: none;
}

.editor-format-toolbar__btn.is-active {
  background: rgba(10, 132, 255, 0.14);
  color: #075985;
}

.editor-format-toolbar__btn:disabled,
.editor-format-toolbar__select:disabled {
  cursor: default;
  opacity: 0.46;
}

.align-icon {
  width: 15px;
  display: grid;
  gap: 2px;
}

.align-icon::before,
.align-icon::after,
.align-icon {
  color: currentColor;
}

.align-icon::before,
.align-icon::after {
  content: "";
  display: block;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.align-icon {
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  padding: 2px 0;
}

.align-icon--left::before,
.align-icon--left::after {
  width: 70%;
}

.align-icon--center::before,
.align-icon--center::after {
  width: 70%;
  justify-self: center;
}

.align-icon--right::before,
.align-icon--right::after {
  width: 70%;
  justify-self: end;
}

.topbar__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: auto;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-regular);
  line-height: 1.2;
  letter-spacing: 0.0078rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--text);
  text-decoration: none;
  min-width: 0;
}

.topbar__btn:hover,
.topbar__btn:focus-visible {
  background: var(--color-hover);
}

.topbar__btn:active {
  background: rgba(0, 0, 0, 0.1);
}

.topbar__btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px rgba(10, 132, 255, 0.35);
}

.topbar__title-btn {
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__title-btn--editable {
  justify-content: flex-start;
}

.topbar__privacy {
  position: relative;
}

.topbar__privacy-btn {
  gap: 4px;
  flex-shrink: 0;
}

.topbar__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 14px;
  flex-shrink: 0;
  opacity: 0.75;
}

.topbar__chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  opacity: 0.65;
}

.topbar__right {
  margin-left: auto;
  gap: 6px;
}

.topbar__lang-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 8px;
  background: transparent;
}

.topbar__lang-btn {
  padding: 0 8px;
}

.topbar__lang-btn.is-active {
  background: rgba(0, 0, 0, 0.06);
}

.topbar__menu-wrap {
  position: relative;
}

.topbar__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: auto;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 0;
  background: transparent;
  cursor: pointer;
  user-select: none;
  min-width: 0;
  transition: background 20ms ease-in;
}

.topbar__icon-btn:hover,
.topbar__icon-btn:focus-visible {
  background: var(--color-hover);
  outline: none;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px rgba(10, 132, 255, 0.35);
}

.topbar__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 160px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 30px -18px rgba(15, 23, 42, 0.28);
  display: none;
  flex-direction: column;
  gap: 6px;
  z-index: 30;
}

.topbar__menu.is-open {
  display: flex;
}

.topbar__menu-item {
  display: flex;
  align-items: center;
  height: 32px;
  padding: 0 10px;
  border: 0;
  box-shadow: none;
  background: transparent;
  text-align: left;
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}

.topbar__menu-item:hover,
.topbar__menu-item:focus-visible {
  background: var(--color-hover);
  outline: none;
}

.topbar__menu-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.editor-topbar button {
  user-select: none;
}
.post-editor-card {
  background-color: #ffffff;
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: var(--space-4);
  display: grid;
  gap: var(--space-3);
  width: 100%;
}

.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.editor-header__back {
  align-self: flex-start;
}

.post-editor-header {
  margin-bottom: 16px;
}

.post-editor-form {
  gap: var(--space-3);
}

.post-editor-title input {
  font-size: 32px;
  line-height: 1.2;
  font-weight: 600;
}

.post-title-input,
.post-editor-header .editor-title {
  width: 100%;
  font-size: 36px;
  line-height: 1.2;
  font-weight: 500;
  border: none;
  outline: none;
  padding: 0;
  margin: 0 0 8px 0;
  background-color: transparent;
  color: #222;
  box-shadow: none;
}

.post-title-input:focus,
.post-editor-header .editor-title:focus {
  border-bottom: 1px solid #ccc;
}

.post-editor-body {
  margin-top: 16px;
}

.editor-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 300;
}

.selection-toolbar {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px -18px rgba(15, 23, 42, 0.35);
  pointer-events: auto;
  transform: translate(-50%, -10px);
  z-index: 301;
}

.selection-toolbar.hidden {
  display: none;
}

.selection-toolbar button,
.selection-toolbar select {
  background: none;
  border: none;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text);
  font: inherit;
}

.selection-toolbar button:hover,
.selection-toolbar button:focus-visible,
.selection-toolbar select:hover,
.selection-toolbar select:focus-visible {
  background: var(--color-hover);
  outline: none;
}

.selection-toolbar button.is-active {
  background: rgba(10, 132, 255, 0.16);
  color: var(--text);
}

.selection-toolbar button {
  min-width: 28px;
}

.selection-link-popover {
  position: absolute;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px;
  padding: 8px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 12px 28px -18px rgba(15, 23, 42, 0.35);
  pointer-events: auto;
  z-index: 302;
}

.selection-link-popover.hidden {
  display: none;
}

.selection-link-popover input {
  min-width: 220px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.selection-link-popover button {
  border: none;
  background: var(--color-hover);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.selection-link-popover.hidden {
  display: none;
}

.selection-table-popover {
  position: absolute;
  display: grid;
  grid-template-columns: repeat(2, minmax(86px, 1fr));
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 12px 28px -18px rgba(15, 23, 42, 0.35);
  pointer-events: auto;
  z-index: 302;
}

.selection-table-popover.hidden {
  display: none;
}

.selection-table-popover label {
  display: grid;
  gap: 4px;
  color: #475569;
  font-size: 13px;
}

.selection-table-popover input {
  width: 100%;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.selection-table-popover button {
  border: none;
  background: var(--color-hover);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 3px;
  border: 0;
  background: #f8fafc;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-transform: capitalize;
}

.status-pill--published {
  background: rgba(10, 132, 255, 0.12);
  color: #0a84ff;
}

.status-pill--draft {
  background: #f4f4f5;
  color: #52525b;
}

.selection-debug {
  position: absolute;
  border: 1px dashed rgba(10, 132, 255, 0.8);
  background: rgba(10, 132, 255, 0.06);
  pointer-events: none;
  z-index: 299;
}

.post-body-textarea,
.post-editor-body textarea {
  width: 100%;
  min-height: 320px;
  border: none;
  border-radius: 6px;
  resize: vertical;
  font-size: 18px;
  line-height: 1.6;
  padding: 0;
  outline: none;
  background: transparent;
  color: #222;
  box-shadow: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 120ms ease;
}

.mce-content-body a,
.post-view-body a,
.post-view-body a:visited,
.post-view-v2 .post-references__content a,
.post-view-v2 .post-references__content a:visited {
  color: #0a84ff;
  text-decoration: underline;
}

.post-view-body a:hover,
.post-view-body a:focus-visible,
.post-view-v2 .post-references__content a:hover,
.post-view-v2 .post-references__content a:focus-visible {
  color: #0066cc;
  text-decoration-thickness: 2px;
}

/* Block hover gutter */
.block-gutter {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
  z-index: 303;
}

.block-gutter__btn {
  pointer-events: auto;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 6px 18px -12px rgba(15, 23, 42, 0.28);
  cursor: pointer;
}

.block-gutter__btn:hover,
.block-gutter__btn:focus-visible {
  background: var(--color-hover);
  outline: none;
}

.block-insert-menu {
  position: absolute;
  min-width: 180px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 12px 32px -18px rgba(15, 23, 42, 0.35);
  display: grid;
  gap: 6px;
  pointer-events: auto;
  z-index: 304;
}

.block-insert-menu.hidden {
  display: none;
}

.block-insert-menu button {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.block-insert-menu button:hover,
.block-insert-menu button:focus-visible {
  background: var(--color-hover);
  outline: none;
}

/* TinyMCE floating/context toolbars (table tools) */
.tox-pop {
  background: transparent !important;
  border: none !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  padding: 0 !important;
  z-index: 302 !important;
  transform: translateY(-6px) !important;
}

.tox-pop .tox-toolbar,
.tox-pop .tox-toolbar__primary {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  gap: 6px !important;
}

.tox-pop .tox-tbtn {
  height: 28px !important;
  min-width: 28px !important;
  border-radius: 6px !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 4px 6px !important;
  color: var(--text) !important;
}

.tox-pop .tox-tbtn:hover,
.tox-pop .tox-tbtn:focus-visible {
  background: var(--color-hover) !important;
  outline: none !important;
}

/* TinyMCE floating toolbars (e.g., table quick tools) */
/* TinyMCE floating toolbars (quickbars) disabled; styles removed */
/* TinyMCE chrome – make it borderless/transparent */
.tox,
.tox .tox-editor-container,
.tox .tox-editor-header,
.tox .tox-toolbar,
.tox .tox-toolbar__primary,
.tox .tox-toolbar__group,
.tox .tox-editor-container > *,
.tox .tox-sidebar-wrap,
.tox .tox-anchorbar,
.tox .tox-statusbar {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
}

.tox .tox-statusbar {
  display: none !important;
}

.tox .tox-toolbar-overlord {
  justify-content: flex-start;
  padding: 0 !important;
  margin: 0 !important;
  width: 100%;
}

.tox .tox-toolbar__primary {
  gap: 10px;
  padding: 0 !important;
  margin: 0 !important;
}

.tox .tox-toolbar__group {
  padding: 0 !important;
  margin: 0 !important;
  gap: 8px;
}

.tox .tox-edit-area__iframe {
  border: none !important;
  background: transparent;
}

.post-lang-section {
  margin-top: 0;
}

.post-lang-section-en {
  margin-top: 0;
}

.post-lang-section-zh {
  margin-top: 0;
}

.post-lang-label {
  font-size: 13.5px;
  font-weight: 500;
  color: #777;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.post-shared-notes-editor,
.post-references-editor {
  margin-top: 28px;
  border-top: 1px solid #eee;
  padding-top: 18px;
}

.post-view-page {
  min-height: 100vh;
  background-color: #f7f7f7;
  padding: 16px 0;
}

.post-view-page--protected {
  padding: 12px 0 16px;
  min-height: auto;
}

.post-view-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 16px 24px;
  box-sizing: border-box;
  background-color: transparent;
  border-radius: 0;
  box-shadow: none;
}

.post-view-container.content-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  height: auto;
  min-height: auto;
  padding: 12px 16px 24px;
}

/* Ensure post view articles never inherit grid sizing from content-block elsewhere */
.post-view-page .content-block {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  height: auto !important;
  min-height: 0 !important;
}

.post-view-container--protected {
  padding: 12px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.post-view-title,
.post-view-container h1,
.post-view-container h2 {
  font-size: 36px;
  line-height: 1.2;
  font-weight: 600;
  margin: 0 0 8px;
}

.post-view-meta,
.post-view-container .post-detail__meta {
  font-size: 14.5px;
  color: #777;
  margin-bottom: 8px;
}

.post-view-body,
.post-view-container .post-body {
  font-size: 18.5px;
  line-height: 1.7;
  color: #222;
  margin-top: 6px;
}
.post-view-container .post-body {
  gap: var(--space-1);
}

.post-view-body,
.post-view-container .post-body,
.post-view-v2 .post-view-body {
  font-weight: 400;
  letter-spacing: -0.01em;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.post-trix-editor {
  min-height: 320px;
  font-size: 18px;
  line-height: 1.6;
  color: #222;
  border: none;
  padding: 8px 0;
  background-color: transparent;
}

.post-trix-editor:focus {
  outline: none;
  box-shadow: none;
}

.post-trix-editor h1,
.post-trix-editor h2,
.post-trix-editor h3 {
  font-weight: 600;
  margin: 1.2em 0 0.6em;
}

.post-trix-editor p {
  margin: 0 0 1em;
}

.post-trix-editor ul,
.post-trix-editor ol {
  margin: 0 0 1em 1.5em;
  padding-left: 1.5em;
}

.post-trix-editor li {
  margin: 0.25em 0;
}

.post-trix-editor img,
.post-trix-editor iframe {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 16px 0;
}

.post-view-lang-section {
  margin-top: 10px;
  border-top: 1px solid #eee;
  padding-top: 10px;
}

.post-view-lang-section-en {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}

.post-view-lang-section-zh {
  margin-top: 16px;
}

.post-view-container .post-detail__header,
.post-view-container .post-detail__header > *,
.post-view-container .post-body {
  display: block;
  gap: 0;
}

.post-view-lang-label {
  font-size: 13.5px;
  font-weight: 500;
  color: #777;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.post-view-body-en,
.post-view-body-zh {
  font-size: 18.5px;
  line-height: 1.7;
  color: #222;
}

.post-view-body p,
.post-view-container .post-body p {
  margin: 0 0 1em;
}

.post-view-body img,
.post-view-container .post-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 16px auto;
}

.post-view-body .align-left,
.mce-content-body .align-left {
  text-align: left;
}

.post-view-body .align-center,
.mce-content-body .align-center {
  text-align: center;
}

.post-view-body .align-right,
.mce-content-body .align-right {
  text-align: right;
}

.post-view-body .text-accent,
.mce-content-body .text-accent {
  color: #0f766e;
}

.post-view-body .text-muted,
.mce-content-body .text-muted {
  color: #64748b;
}

.post-view-body .text-danger,
.mce-content-body .text-danger {
  color: #b42318;
}

.post-view-body .mark-yellow,
.mce-content-body .mark-yellow {
  background: #fef3c7;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.post-view-body .mark-blue,
.mce-content-body .mark-blue {
  background: #dbeafe;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.post-view-body .mark-green,
.mce-content-body .mark-green {
  background: #dcfce7;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.post-view-body .task-list,
.mce-content-body .task-list {
  list-style: none;
  padding-left: 0;
}

.post-view-body .task-list li,
.mce-content-body .task-list li {
  position: relative;
  padding-left: 1.55em;
}

.post-view-body .task-list li::before,
.mce-content-body .task-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.8em;
  height: 0.8em;
  border: 1.5px solid #94a3b8;
  border-radius: 3px;
  background: #fff;
}

.post-view-body table,
.mce-content-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.96em;
}

.post-view-body th,
.post-view-body td,
.mce-content-body th,
.mce-content-body td {
  border: 1px solid #cbd5e1;
  padding: 10px 12px;
  vertical-align: top;
  min-width: 56px;
}

.post-view-body th,
.mce-content-body th {
  background: #f8fafc;
  font-weight: 600;
}

.post-view-body mjx-container[jax="CHTML"][display="true"] {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 0;
  text-align: left;
  -webkit-overflow-scrolling: touch;
}

.post-view-body mjx-container[jax="CHTML"][display="true"] > mjx-math {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.post-view-body mjx-container[jax="CHTML"][display="true"] * {
  max-width: none;
}

.post-view-body .math-display-source,
.post-references__content .math-display-source {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 0;
  text-align: left;
  -webkit-overflow-scrolling: touch;
}

.post-view-body mjx-container[jax="CHTML"]:not([display="true"]) {
  font-size: 0.98em;
}

.post-view-body p > code.code-diagram {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: pre;
  word-break: normal;
  overflow-wrap: normal;
  padding: 8px 0;
  font-size: 0.9em;
  line-height: 1.55;
  -webkit-overflow-scrolling: touch;
}

.post-view-container.content-block {
  display: block;
  gap: 0;
}

.post-view-container .post-detail__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  height: auto;
  min-height: auto;
  padding: 0;
  margin: 0 0 8px;
}

.post-view-container .post-detail__header > * {
  margin: 0;
  padding: 0;
}

/* Hide stray empty paragraphs from legacy content */
.post-body p:empty {
  display: none;
  margin: 0;
}
.post-body p > br:only-child {
  display: none;
}
.post-body p:has(> br:only-child) {
  display: none;
  margin: 0;
}

@media (max-width: 768px) {
  body {
    padding: var(--space-3) clamp(14px, 5vw, 20px);
    overflow-x: hidden;
  }

  .post-editor-page {
    padding: 20px 0;
    width: 100%;
    max-width: calc(100vw - 30px);
    overflow-x: clip;
  }

  .editor-topbar {
    height: auto;
    flex-wrap: wrap;
  }

  .topbar__left,
  .topbar__right {
    flex-wrap: wrap;
    max-width: 100%;
  }

  .topbar__right {
    margin-left: 0;
  }

  .editor-format-toolbar {
    position: sticky;
    top: 0;
    overflow-x: auto;
    overflow-y: hidden;
    contain: paint;
    flex-wrap: nowrap;
    padding-bottom: 8px;
    margin-left: 0;
    margin-right: 0;
  }

  .editor-format-toolbar__group {
    flex: 0 0 auto;
  }

  .post-editor-container {
    max-width: 100%;
    padding: 0 12px;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  }

  .post-view-container {
    max-width: 100%;
    padding-left: 12px;
    padding-right: 12px;
  }

  .page-shell {
    max-width: 100%;
    padding: var(--page-padding-block) var(--page-padding-inline);
  }

  .post-view-title,
  .post-view-container h1,
  .post-view-container h2 {
    font-size: 32px;
  }

  .post-view-lang-section {
    margin-top: 16px;
    padding-top: 12px;
  }

  .post-lang-section {
    margin-top: 12px;
    padding-top: 12px;
  }

  .post-trix-editor {
    font-size: 17px;
    line-height: 1.6;
  }

  .content-block {
    padding: var(--space-3);
  }
}

.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
  gap: var(--space-2);
}

.post-list li {
  padding: var(--space-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
  display: grid;
  gap: var(--space-1);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.post-list li:hover,
.post-list li:focus-within {
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: 0 8px 18px -14px rgba(15, 23, 42, 0.35);
}

.post-list__meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.post-card {
  padding: var(--space-3);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #f8fafc;
  display: grid;
  gap: var(--space-1);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.post-card:hover,
.post-card:focus-within {
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: 0 8px 18px -14px rgba(15, 23, 42, 0.35);
}

.post-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.post-card__meta-left {
  display: grid;
  gap: 4px;
}

.post-card__title {
  font-size: clamp(1.05rem, 0.6vw + 1rem, 1.3rem);
  font-weight: 700;
  color: var(--text);
}

.post-card__author small {
  color: var(--muted);
}

.post-card__meta-right {
  display: grid;
  justify-items: end;
  gap: 4px;
  text-align: right;
}

.post-detail__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin: 0 0 4px;
}

.post-view-heading {
  margin: 0 0 4px;
}

.post-detail__meta {
  display: grid;
  gap: 6px;
  justify-items: end;
  text-align: right;
}

.lang-switch {
  display: inline-flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-2);
}

.lang-switch .button.active {
  background: #0f172a;
  border-color: #0f172a;
}

.lang-toggle {
  display: inline-flex;
  gap: 8px;
}

.button-small {
  padding: 6px 10px;
  font-size: 0.95rem;
}

.button-small {
  background: #f1f5f9;
  border-color: #d9e1ec;
  color: #0f172a;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.button-small.active {
  background: #e2e8f0;
  border-color: #b7c2d4;
  color: #0f172a;
}

.lang-toggle-single {
  border-radius: 999px;
}

body.article-page .gn {
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.post-view-v2-page {
  display: flex;
  justify-content: center;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 24px 0 40px;
  background: transparent;
}

.post-view-v2 {
  display: block;
  width: 100%;
  min-width: 0;
  --post-max-width: 1024px;
  max-width: min(var(--page-max-width, 1024px), 100%);
  margin: 0 auto;
  padding-left: var(--page-padding-left);
  padding-right: var(--page-padding-right);
  box-sizing: border-box;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.post-view-v2 .post-header {
  max-width: var(--post-max-width);
  margin: 0 auto 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.post-view-v2 .post-hero-cover {
  max-width: var(--post-max-width);
  margin: 0 auto 24px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--border);
}

.post-view-v2 .post-hero-cover.post-hero-cover--inline {
  height: 260px;
  aspect-ratio: auto;
}

.post-view-v2 .post-hero-cover img {
  display: block;
  width: 100%;
  height: 260px;
  object-fit: cover;
}

.post-view-v2 .post-hero-cover.post-hero-cover--inline img {
  height: 100%;
}

.post-view-v2 .post-header__meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.post-view-v2 .post-title {
  margin: 0;
  font-size: clamp(2rem, 2.4vw + 1rem, 2.8rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  font-weight: 700;
}

.post-view-v2 .post-header__meta {
  color: #64748b;
  font-size: 0.95rem;
}

.post-view-v2 .post-header__meta time {
  font-style: normal;
}

.post-view-v2 .post-header__author {
  font-size: 1rem;
  color: #1f2937;
  font-weight: 500;
}

.post-footer-meta {
  max-width: var(--post-max-width);
  margin: 32px auto 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 14px;
}

.post-footer__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.post-footer__action-copy {
  min-width: 0;
}

.post-footer__actions h2 {
  margin: 0;
  color: #0f172a;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.35;
  letter-spacing: 0;
}

.post-footer__action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.post-footer__meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #475569;
  font-size: 0.95rem;
}

.post-footer__action {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.25;
  text-decoration: none;
}

.post-footer__action:hover,
.post-footer__action:focus-visible {
  background: var(--color-hover);
  outline: none;
}

.post-footer__copy-status {
  color: #0f5132;
  font-size: 0.9rem;
}

.post-view-v2 .lang-toggle {
  display: inline-flex;
  gap: 8px;
}

@media (max-width: 720px) {
  .post-view-v2 .post-header__meta-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .post-view-v2 .post-header__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    width: auto;
  }
}

.post-view-v2 .lang-toggle__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 4px;
  border: 0;
  color: #0f172a;
  background: transparent;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.post-view-v2 .lang-toggle__link:hover,
.post-view-v2 .lang-toggle__link:focus-visible {
  background: var(--color-hover);
  color: #0f172a;
}

.post-view-v2 .lang-toggle__link.active {
  color: #0f172a;
  position: relative;
}

.post-view-v2 .lang-toggle__link.active::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 0;
  height: 2px;
  background: #0f172a;
  border-radius: 999px;
}

.post-view-v2 .post-content {
  display: block;
  min-width: 0;
  max-width: 100%;
}

.post-view-v2 .post-view-body {
  font-size: 18px;
  line-height: 1.7;
  letter-spacing: 0;
  color: #111827;
  max-width: var(--post-max-width);
  margin: 0 auto;
  padding: 0 0 24px;
  overflow-wrap: break-word;
  word-break: break-word;
  min-width: 0;
  max-width: 100%;
}

.post-view-v2 .post-view-body p {
  margin: 0 0 1em;
}

.post-view-v2 .post-view-body * {
  box-sizing: border-box;
  max-width: 100%;
}

.post-view-v2 .post-view-body p,
.post-view-v2 .post-view-body li,
.post-view-v2 .post-view-body a,
.post-view-v2 .post-references__content a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.post-view-v2 .post-view-body ul,
.post-view-v2 .post-view-body ol {
  margin: 0 0 1em;
  padding-left: 1.25em;
}

.post-view-v2 .post-view-body blockquote {
  margin: 1em 0;
  padding-left: 1em;
  border-left: 3px solid var(--border);
}

.post-view-v2 .post-view-body hr {
  width: 100%;
  max-width: 100%;
  margin: 24px 0;
}

.post-view-v2 .post-view-body h2,
.post-view-v2 .post-view-body h3,
.post-view-v2 .post-view-body h4 {
  margin: 1.2em 0 0.6em;
  line-height: 1.3;
}

.post-view-v2 .post-view-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 16px auto;
}

.post-view-v2 .post-view-body pre {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

.post-view-v2 .post-view-body table {
  max-width: 100%;
}

.post-view-v2 .post-view-body pre,
.post-view-v2 .post-view-body code:not(.code-diagram) {
  white-space: pre-wrap;
}

.post-view-v2 .post-view-body iframe,
.post-view-v2 .post-view-body video {
  max-width: 100%;
}

.post-view-v2 .post-view-body [style*="width"] {
  max-width: 100% !important;
}

.post-view-v2 .post-view-body .embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 16px 0;
}

.post-view-v2 .post-view-body .embed--google-sheet {
  aspect-ratio: auto;
  height: min(80vh, 900px);
}

.post-view-v2 .post-view-body .embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.post-view-v2 .post-view-body .embed--google-sheet iframe {
  position: static;
  width: 100%;
  height: 100%;
}

.post-view-v2 .post-translator-notes,
.post-view-v2 .post-references {
  margin: 32px 0 24px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  max-width: 100%;
  overflow-x: clip;
}

.post-view-v2 .post-translator-notes + .post-references {
  margin-top: -24px;
  border-top: 0;
}

.post-view-v2 .post-translator-notes__summary,
.post-view-v2 .post-references__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  cursor: pointer;
  color: #0f172a;
  font-weight: 700;
}

.post-view-v2 .post-translator-notes__summary::-webkit-details-marker,
.post-view-v2 .post-references__summary::-webkit-details-marker {
  display: none;
}

.post-view-v2 .post-translator-notes__summary::after,
.post-view-v2 .post-references__summary::after {
  content: "+";
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: 1px solid var(--border);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  font-size: 1rem;
  line-height: 1;
}

.post-view-v2 .post-translator-notes[open] .post-translator-notes__summary::after,
.post-view-v2 .post-references[open] .post-references__summary::after {
  content: "-";
}

.post-view-v2 .post-translator-notes__summary:focus-visible,
.post-view-v2 .post-references__summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.post-view-v2 .post-translator-notes__count,
.post-view-v2 .post-references__count {
  color: #64748b;
  font-size: 0.95rem;
  font-weight: 500;
  margin-left: auto;
}

.post-view-v2 .post-translator-notes__list,
.post-view-v2 .post-translator-notes__content,
.post-view-v2 .post-references__list,
.post-view-v2 .post-references__content {
  padding: 0 0 16px;
}

.post-view-v2 .post-translator-notes__content {
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.post-translator-note-ref,
.post-reference-ref {
  font-size: 0.68em;
  line-height: 0;
  vertical-align: super;
}

.post-translator-note-ref a,
.post-translator-note-ref__marker,
.post-reference-ref a,
.post-reference-ref__marker {
  border-radius: 4px;
  color: #2563eb;
  font-weight: 700;
  padding: 0 2px;
  scroll-margin-top: 96px;
  text-decoration: none;
}

.post-translator-note-ref a:hover,
.post-translator-note-ref a:focus-visible,
.post-reference-ref a:hover,
.post-reference-ref a:focus-visible {
  background: rgba(37, 99, 235, 0.1);
  outline: none;
  text-decoration: underline;
}

.post-translator-note-ref__marker,
.post-reference-ref__marker {
  cursor: default;
}

.post-translator-notes__list,
.post-references__list {
  box-sizing: border-box;
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding-left: 1.6rem;
  padding-right: 0;
}

.post-translator-notes__item,
.post-references__item {
  margin: 0 0 8px;
  max-width: 100%;
  overflow-wrap: anywhere;
  scroll-margin-top: 96px;
  word-break: break-word;
}

.post-translator-notes__item:last-child,
.post-references__item:last-child {
  margin-bottom: 0;
}

.post-translator-notes__label,
.post-references__label {
  color: #0f172a;
  font-weight: 700;
}

.post-translator-notes__backref,
.post-references__backref {
  color: #2563eb;
  font-size: 0.85em;
  font-weight: 700;
  margin-left: 4px;
  text-decoration: none;
}

.post-translator-notes__backref:hover,
.post-translator-notes__backref:focus-visible,
.post-references__backref:hover,
.post-references__backref:focus-visible {
  text-decoration: underline;
}

.back-to-top {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 45;
  width: 52px;
  height: 52px;
  --scroll-progress: 0;
  --scroll-progress-angle: 0deg;
  --scroll-progress-color: rgba(15, 23, 42, 0.42);
  --scroll-track-color: rgba(148, 163, 184, 0.18);
  --scroll-icon-color: rgba(15, 23, 42, 0.58);
  --scroll-ring-inset: 5px;
  --scroll-ring-width: 3px;
  border: 0;
  border-radius: 999px;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  background-color: transparent;
  color: var(--scroll-icon-color);
  box-shadow: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 1.2rem;
  line-height: 1;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  padding: 0;
  transform: translateY(8px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease,
    color 0.12s ease,
    box-shadow 0.12s ease,
    background 0.12s ease;
}

.back-to-top::before {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.back-to-top::before {
  inset: var(--scroll-ring-inset);
  background: conic-gradient(
    from -90deg,
    var(--scroll-progress-color) var(--scroll-progress-angle),
    var(--scroll-track-color) 0
  );
  -webkit-mask: radial-gradient(
    farthest-side,
    transparent calc(100% - var(--scroll-ring-width)),
    #000 0
  );
  mask: radial-gradient(
    farthest-side,
    transparent calc(100% - var(--scroll-ring-width)),
    #000 0
  );
}

.back-to-top__icon {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  border-top: 2px solid var(--scroll-icon-color);
  border-left: 2px solid var(--scroll-icon-color);
  opacity: 0.9;
  transform: translateY(2px) rotate(45deg);
  transition: opacity 0.12s ease, color 0.12s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top.is-visible:hover,
.back-to-top.is-visible:focus-visible,
.back-to-top.is-visible:active {
  --scroll-progress-color: rgba(15, 23, 42, 0.72);
  --scroll-track-color: rgba(148, 163, 184, 0.28);
  --scroll-icon-color: rgba(15, 23, 42, 0.84);
  color: #0f172a;
  opacity: 1;
  outline: none;
  box-shadow: none;
}

.back-to-top.is-visible:hover .back-to-top__icon,
.back-to-top.is-visible:focus-visible .back-to-top__icon,
.back-to-top.is-visible:active .back-to-top__icon {
  opacity: 1;
}

.back-to-top.is-visible:hover::before,
.back-to-top.is-visible:focus-visible::before,
.back-to-top.is-visible:active::before {
  --scroll-progress-color: rgba(15, 23, 42, 0.72);
  --scroll-track-color: rgba(148, 163, 184, 0.28);
}

.back-to-top.is-visible:focus-visible {
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.2), 0 10px 24px rgba(15, 23, 42, 0.14);
}

@media (max-width: 768px) {
  body.article-page {
    padding-left: 0;
    padding-right: 0;
  }

  body.article-page > main > .page-shell.page-container {
    max-width: none;
    padding-top: 0;
    padding-left: 0;
    padding-right: 0;
  }

  .post-view-v2-page {
    padding: 20px 0 28px;
  }

  .post-view-v2 {
    padding-left: max(18px, env(safe-area-inset-left));
    padding-right: max(18px, env(safe-area-inset-right));
    border-radius: 0;
  }

  .post-view-v2 .post-header {
    gap: 12px;
    margin-bottom: 18px;
  }

  .post-view-v2 .post-header__meta-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .post-view-v2 .post-header__actions {
    width: 100%;
    justify-content: flex-start;
  }

  .post-view-v2 .lang-toggle {
    width: auto;
    justify-content: flex-start;
    gap: 10px;
  }

  .post-view-v2 .post-hero-cover.post-hero-cover--inline,
  .post-view-v2 .post-hero-cover img {
    height: clamp(170px, 52vw, 220px);
  }

  .post-view-v2 .post-view-body {
    font-size: 17px;
    line-height: 1.68;
  }

  .post-view-v2 .post-view-body .embed--google-sheet {
    height: min(65vh, 520px);
  }

  .post-footer-meta {
    align-items: stretch;
  }

  .post-footer__actions {
    display: grid;
    gap: 10px;
  }

  .post-footer__action-row {
    justify-content: flex-start;
  }

  .back-to-top {
    right: max(12px, calc(env(safe-area-inset-right) + 12px));
    bottom: max(12px, calc(env(safe-area-inset-bottom) + 12px));
    width: 56px;
    height: 56px;
    --scroll-progress-color: rgba(15, 23, 42, 0.38);
    --scroll-track-color: rgba(148, 163, 184, 0.16);
    --scroll-icon-color: rgba(15, 23, 42, 0.56);
    --scroll-ring-inset: 6px;
    --scroll-ring-width: 3px;
    box-shadow: none;
  }

  .back-to-top__icon {
    width: 15px;
    height: 15px;
  }

  .back-to-top.is-visible:hover,
  .back-to-top.is-visible:focus-visible,
  .back-to-top.is-visible:active {
    --scroll-progress-color: rgba(15, 23, 42, 0.64);
    --scroll-track-color: rgba(148, 163, 184, 0.24);
    --scroll-icon-color: rgba(15, 23, 42, 0.78);
  }
}

@media (max-width: 430px) {
  .post-view-v2 {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  .post-view-v2 .post-title {
    font-size: 28px;
    line-height: 1.18;
    letter-spacing: 0;
    overflow-wrap: break-word;
  }
}

@media (max-width: 360px) {
  .post-view-v2 .post-title {
    font-size: 26px;
  }

  .post-view-v2 .post-view-body {
    font-size: 16.5px;
  }
}
.password-row {
  display: grid;
  gap: var(--space-1);
  align-items: center;
}

.toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--muted);
}

.password-status {
  font-size: 0.95rem;
}

.visibility-row {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.visibility-select-wrap {
  min-width: 220px;
  flex: 0 0 auto;
}

.password-inline-field {
  flex: 1 1 320px;
  margin: 0;
  display: flex;
  align-items: flex-end;
}

.password-label {
  width: 100%;
  display: grid;
  gap: 6px;
}

.compact-label {
  display: grid;
  gap: 6px;
}

.compact-select {
  max-width: 200px;
}

.password-field {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.password-field input {
  padding-right: 48px;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--muted);
}

.toggle-password svg {
  display: block;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  z-index: 20;
}

.modal.is-open {
  display: grid;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
}

.modal__content {
  position: relative;
  background: #fff;
  border-radius: var(--radius);
  padding: var(--space-3);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: grid;
  gap: var(--space-2);
  width: min(640px, 90vw);
  z-index: 1;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.avatar-preview img {
  max-width: 100%;
  border-radius: 14px;
  width: 100%;
  height: 300px;
  object-fit: cover;
}

.avatar-controls {
  display: grid;
  gap: var(--space-2);
}

.avatar-editor {
  display: grid;
  gap: var(--space-2);
}

.avatar-preview-card {
  display: grid;
  gap: 8px;
}

.avatar-preview-frame,
.avatar-frame {
  position: relative;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border);
  background: #f1f5f9;
  display: grid;
  place-items: center;
  cursor: grab;
  flex: 0 0 auto;
}

.avatar-preview-frame.is-dragging,
.avatar-frame.is-dragging {
  cursor: grabbing;
}

.avatar-preview-frame img,
.avatar-image {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  transform-origin: center center;
  width: 100%;
  height: 100%;
  border-radius: 0;
  object-fit: cover;
  user-select: none;
  pointer-events: none;
  will-change: transform;
}

.avatar-preview-frame.is-dragging img,
.avatar-frame.is-dragging .avatar-image {
  transition: none;
}

.avatar-preview-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 0 12px;
  color: var(--muted);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.82);
}

.profile__avatar-frame {
  width: 440px;
  height: 440px;
  border-radius: 0;
}

.profile__avatar-frame .avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}
.preview-block {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3);
  display: grid;
  gap: var(--space-2);
}

.diff-block {
  margin-top: var(--space-3);
  display: grid;
  gap: var(--space-2);
}

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

.diff-cell {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-2);
  align-items: stretch;
}

.inline-form input {
  height: 100%;
}

.button-fullheight {
  height: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.post-body pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: var(--space-2);
  border-radius: 12px;
  overflow-x: auto;
  font-size: 0.95rem;
}

.post-body code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 6px;
}

.protected-block {
  padding: 0;
  gap: var(--space-1);
  margin: 0 0 8px;
}

.protected-message {
  margin: 0 0 6px;
}

.password-protect-form {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.password-protect-form label {
  flex: 1 1 240px;
  margin: 0;
}

.password-protect-input {
  height: 42px;
  border-radius: 10px;
  padding: 10px 12px;
}

.password-protect-button {
  height: 42px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.95rem;
}

.password-protect-button:focus-visible {
  outline: 3px solid rgba(10, 132, 255, 0.35);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .password-protect-form {
    flex-direction: column;
    align-items: stretch;
  }

  .password-protect-button {
    width: 100%;
    justify-content: center;
  }
}

.stack {
  display: grid;
  gap: var(--space-2);
}

.protected-block.stack {
  gap: var(--space-1);
}

.profile {
  display: grid;
  gap: 3rem;
}

.profile,
.profile h1,
.profile h2,
.profile h3,
.profile p {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.profile p {
  line-height: 1.7;
  font-size: 18px;
  margin: 0;
}

.profile-about-form textarea {
  min-height: auto;
  height: auto;
  overflow-y: hidden;
}

.profile .about-bio,
.profile .about-think,
.profile .about-focus {
  white-space: pre-line;
}

.profile .stack {
  gap: 8px;
}

.profile h3 {
  font-size: clamp(22px, 1vw + 20px, 26px);
  line-height: 1.3;
}

.profile .profile__header .muted {
  margin-bottom: 0;
  color: #0f172a;
}

.profile .now-card p {
  margin-bottom: 0;
}

.profile .pill.pill-accent {
  background: #1c13011c;
  border-color: transparent;
  color: #494846;
  border-radius: 4px;
  font-weight: 600;
}

.profile-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 4px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.social-link__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.social-link__icon svg {
  width: 32px;
  height: 32px;
  display: block;
}

.social-link__icon img {
  width: 32px;
  height: 32px;
  display: block;
  border-radius: 6px;
}

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

.social-link__url {
  color: #0a84ff;
  text-decoration: none;
  word-break: break-all;
}

.social-link__url:hover,
.social-link__url:focus-visible {
  text-decoration: underline;
}

.chip-input__wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f8fafc;
}

.chip-input__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.chip-input__entry {
  border: 0;
  background: transparent;
  min-width: 180px;
  padding: 6px 4px;
  font: inherit;
  outline: none;
}

.filters-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 10px;
  align-items: center;
  margin: 12px 0;
}

.filters-row--posts {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  position: relative;
  overflow: visible;
  z-index: 5;
}

.filters-row input,
.filters-row select {
  width: 100%;
  height: auto;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font: inherit;
  line-height: 1.2;
  box-sizing: border-box;
  max-width: 100%;
}

.filters-select-wrap {
  position: relative;
  overflow: visible;
  width: 100%;
}

.filter-dropdown {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font: inherit;
  line-height: 1.2;
}

.filter-dropdown::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--muted);
  margin-left: 8px;
}

.filter-dropdown__menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  padding: 8px;
  border: 0;
  border-radius: 8px;
  background: var(--color-surface);
  box-shadow: 0 12px 30px -18px rgba(15, 23, 42, 0.28);
  display: none;
  z-index: 10;
}

.filter-dropdown__menu.is-open {
  display: grid;
  gap: 6px;
}

.filter-dropdown__menu button {
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
  font: inherit;
  color: var(--text);
  transition: background-color 0.12s ease, color 0.12s ease;
}

.filter-dropdown__menu button:hover,
.filter-dropdown__menu button:focus-visible {
  background: var(--color-hover) !important;
  border: 0 !important;
  outline: none;
  color: var(--text);
}
@media (max-width: 720px) {
  .filters-row {
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 10px 0 16px;
  }

  .filters-row--posts {
    padding: 0;
  }
}

.chip-input__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  line-height: 1;
  padding: 0 10px;
  border-radius: 4px;
  border: none;
  box-shadow: none;
  background: #1c13011c;
  color: #494846;
  font-weight: 600;
}

.chip-input__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none !important;
  background: transparent !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  box-shadow: none !important;
  color: #494846;
  cursor: pointer;
  padding: 0 !important;
  margin: 0;
  width: 8px;
  height: 8px;
  min-width: 8px;
  min-height: 8px;
  font: inherit;
  font-size: 12px;
  line-height: 1;
  border-radius: 0;
  flex-shrink: 0;
  vertical-align: middle;
}

.chip-input__remove:focus {
  outline: none;
}

.profile__header {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: start;
  text-align: left;
  gap: var(--space-3);
}

.profile__header .profile__avatar-frame {
  order: 2;
}

.profile__header > .stack {
  order: 1;
}

.profile__avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.profile__title {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
}

.profile__title h2 {
  margin: 0;
}

.location-text {
  color: #0f172a;
  font-weight: 600;
}

@media (max-width: 720px) {
  .profile {
    gap: 2rem;
  }

  .profile .stack {
    gap: 10px;
  }

  .profile__avatar-frame {
    width: min(280px, 80vw);
    height: min(280px, 80vw);
  }

  .profile__header {
    justify-items: start;
    text-align: left;
  }

  .profile__title {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .profile .profile-socials {
    justify-content: flex-start;
  }
}

.profile-page {
  max-width: 920px;
  margin: 0 auto;
  gap: 30px;
}

.profile-hero {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: end;
  gap: clamp(24px, 4vw, 44px);
}

.profile-page .profile__avatar-frame {
  width: 100%;
  max-width: 180px;
  aspect-ratio: 1;
  height: auto;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #f1f5f9;
}

.profile-hero__body {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.profile-hero h1 {
  margin: 0;
  color: #475569;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

.profile-identity h2 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(2.4rem, 5vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.profile-tagline {
  max-width: 620px;
  color: #334155;
  font-size: clamp(1.05rem, 1vw + 0.9rem, 1.35rem);
  line-height: 1.5;
}

.profile-contact-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  color: #475569;
  font-size: 0.98rem;
}

.profile-contact-row > * {
  display: inline-flex;
  align-items: center;
}

.profile-contact-row > * + *::before {
  content: "";
  width: 4px;
  height: 4px;
  margin-right: 14px;
  border-radius: 999px;
  background: #cbd5e1;
}

.profile-contact-row a {
  color: #0f172a;
  text-decoration: none;
  font-weight: 600;
}

.profile-contact-row a:hover,
.profile-contact-row a:focus-visible {
  text-decoration: underline;
  outline: none;
}

.profile-section {
  max-width: 760px;
  display: grid;
  gap: 14px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.profile-section h2 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(1.25rem, 1vw + 1rem, 1.7rem);
  line-height: 1.25;
  letter-spacing: 0;
}

.profile-copy {
  display: grid;
  gap: 14px;
}

.profile-copy p,
.profile-focus-list {
  color: #1f2937;
  font-size: 18px;
  line-height: 1.7;
}

.profile-focus-list {
  margin: 0;
  padding-left: 1.1rem;
}

.profile-focus-list li + li {
  margin-top: 8px;
}

.profile-quote {
  margin: 0;
  display: grid;
  gap: 10px;
  color: #1f2937;
}

.profile-quote p {
  font-size: 18px;
  line-height: 1.7;
}

.profile-quote cite {
  color: #64748b;
  font-style: normal;
  font-size: 0.98rem;
}

.profile-quote cite::before {
  content: "- ";
}

.profile-chip-row {
  gap: 8px;
}

@media (max-width: 720px) {
  body.profile-page-body .page-shell {
    padding-top: 28px;
  }

  body.profile-page-body .page-section {
    margin-top: 0;
  }

  .profile-page {
    gap: 26px;
  }

  .profile-hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 16px;
  }

  .profile-page .profile__avatar-frame {
    width: clamp(156px, 48vw, 192px);
    max-width: 192px;
  }

  .profile-hero__body {
    justify-items: center;
    gap: 14px;
  }

  .profile-identity h2 {
    font-size: clamp(2.1rem, 14vw, 3.4rem);
  }

  .profile-contact-row {
    justify-content: center;
    align-items: center;
  }

  .profile-contact-row > * + *::before {
    display: none;
  }
}

form.stack {
  gap: var(--space-2);
}

label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  color: var(--text);
}

label .compact-label {
  font-size: 13.5px;
  font-weight: 500;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

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

input,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #f8fafc;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.16);
}

select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #f8fafc;
}

textarea {
  resize: vertical;
}

.excerpt-textarea {
  border: none;
  background: transparent;
  padding: 6px 0;
  resize: none;
  border-radius: 0;
  min-height: 48px;
  line-height: 1.5;
  width: 100%;
}

button:not(.c-button):not(.action-menu__item):not(.c-menu__item):not(.topbar__menu-item):not(.icon-button):not(.topbar__btn):not(.topbar__icon-btn):not(.cover-picker__tab):not(.cover-picker__thumb):not(.nav-tab):not(.editor-format-toolbar__btn):not(.back-to-top) {
  font: inherit;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

button:not(.c-button):not(.action-menu__item):not(.c-menu__item):not(.topbar__menu-item):not(.icon-button):not(.topbar__btn):not(.topbar__icon-btn):not(.cover-picker__tab):not(.cover-picker__thumb):not(.nav-tab):not(.editor-format-toolbar__btn):not(.back-to-top):hover,
button:not(.c-button):not(.action-menu__item):not(.c-menu__item):not(.topbar__menu-item):not(.icon-button):not(.topbar__btn):not(.topbar__icon-btn):not(.cover-picker__tab):not(.cover-picker__thumb):not(.nav-tab):not(.editor-format-toolbar__btn):not(.back-to-top):focus-visible {
  background: var(--color-hover);
  border-color: var(--border);
  outline: none;
}

#panel-posts .filter-dropdown__menu button {
  border: 0 !important;
  background: none !important;
  padding: 8px 10px;
  box-shadow: none;
}

.error {
  color: #b3261e;
  font-weight: 700;
}

.success {
  color: #0f8a0f;
  font-weight: 700;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-2) var(--space-3);
}

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

.form-layout {
  gap: var(--space-3);
}

.form-grid.two-col {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.form-card {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f8fafc;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.tall {
  min-height: 80px;
}

.taller {
  min-height: 140px;
}

label.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-2);
}

.actions {
  display: flex;
  justify-content: flex-start;
  gap: var(--space-2);
}

.optional-field {
  transition: opacity 0.15s ease;
}

.hidden-field {
  opacity: 0;
  pointer-events: none;
  display: none !important;
}

table {
  border-collapse: collapse;
  width: 100%;
}

.table {
  display: grid;
  gap: 8px;
  font-size: 14px;
  line-height: 1.4;
  margin-top: 12px;
}

.table-head,
.table-row {
  display: grid;
  grid-template-columns: 2fr 1.1fr 0.9fr 0.9fr 0.9fr 72px;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  line-height: 1.4;
}

.table-head {
  font-weight: 700;
  color: var(--muted);
}

.table-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.table-actions {
  display: flex;
  gap: 0;
  align-items: center;
  justify-content: flex-end;
  font-size: 14px;
  line-height: 1.4;
}

.table-row > div:last-child,
.table-head > div:last-child {
  justify-self: end;
}

@media (max-width: 900px) {
  .table-head,
  .table-row {
    grid-template-columns: 1.6fr 1fr 0.9fr 0.9fr 70px;
  }
  .table-head > div:nth-child(3),
  .table-row > div:nth-child(3) {
    display: none;
  }
}

@media (max-width: 720px) {
  .table-head {
    display: none;
  }

  #panel-posts .table {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  #panel-posts .table-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    align-items: flex-start;
  }

  #panel-posts .table-row > div {
    display: flex;
    align-items: flex-start;
    gap: 8px;
  }

  #panel-posts .table-row > div::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--muted);
    font-size: 13px;
    min-width: 90px;
    align-self: flex-start;
  }

  #panel-posts .table-row .row-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  #panel-posts .table-row .row-title::before {
    display: none;
  }

  #panel-posts .table-row > div[data-label="Status"],
  #panel-posts .table-row > div[data-label="Visibility"] {
    justify-content: flex-start;
  }

  .table-actions--desktop {
    display: none;
  }
}

@media (max-width: 640px) {
  #panel-posts .table-row {
    display: flex;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  #panel-posts .table-row {
    grid-template-columns: 1fr;
  }

  #panel-posts .table-row > div {
    grid-template-columns: minmax(90px, auto) 1fr;
  }
}

@media (min-width: 721px) {
  .action-menu__toggle-btn--mobile {
    display: none;
  }
}

@media (max-width: 720px) {
  .action-menu__toggle-btn--mobile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    margin-left: auto;
  }

  #panel-posts .action-menu__toggle-btn:not(.action-menu__toggle-btn--mobile) {
    display: none;
  }
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.admin-header--stack {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.blog-admin-tabs {
  gap: 10px;
}

.admin-title-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: 12px;
}

.admin-title-actions {
  justify-self: flex-end;
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-inline {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.avatar-inline--row {
  width: 100%;
  align-items: center;
  gap: 16px;
}

.avatar-inline__actions {
  display: grid;
  gap: 8px;
}

.avatar-inline__buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar-inline__preview {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  background: #f1f5f9;
  position: relative;
}

.avatar-inline__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
}

.profile-basics {
  display: grid;
  gap: 24px;
}

.profile-basics input,
.profile-basics textarea {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  font: inherit;
  color: var(--text);
  box-shadow: none;
}

.profile-basics input:focus,
.profile-basics textarea:focus {
  outline: none;
  box-shadow: none;
}

.profile-basics label {
  display: grid;
  gap: 8px;
}

.profile-inline-fields {
  display: grid;
  gap: 24px;
  margin-left: calc(96px + 16px);
}

.profile-inline-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.profile-editor-layout {
  display: grid;
  gap: 28px;
  max-width: 880px;
}

.profile-editor-section {
  display: grid;
  gap: 14px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.profile-editor-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.profile-editor-section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.profile-editor-section h3 {
  margin: 0;
  color: #0f172a;
  font-size: 1rem;
  line-height: 1.3;
}

.admin-field-hint {
  margin: 0;
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.45;
}

.inline-field {
  display: grid;
  gap: 6px;
}

.profile-about-form textarea,
.profile-about-form input[type="text"],
.profile-about-form input[type="url"] {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  font: inherit;
  color: var(--text);
  box-shadow: none;
}

.profile-about-form textarea:focus,
.profile-about-form input[type="text"]:focus,
.profile-about-form input[type="url"]:focus {
  outline: none;
  box-shadow: none;
}

.profile-inline-row--grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.profile-about-form .profile-inline-row--grid {
  gap: 16px;
}

.about-lists {
  margin-top: 12px;
  gap: 12px;
}

.avatar-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 500;
}

.avatar-modal.hidden {
  display: none;
}

.avatar-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(1px);
}

.avatar-modal__dialog {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 60px -24px rgba(15, 23, 42, 0.35);
  padding: 16px;
  width: min(720px, 90vw);
  max-height: 90vh;
  display: grid;
  gap: 12px;
  z-index: 501;
}

.avatar-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.avatar-modal__body {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 12px;
  align-items: start;
}

.avatar-modal__inputs {
  display: grid;
  gap: 10px;
}

.avatar-modal__inputs label {
  display: grid;
  gap: 4px;
}

.avatar-modal__inputs input[type="file"],
.avatar-modal__inputs input[type="url"] {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}

.avatar-modal__error {
  color: #b91c1c;
  font-size: 13px;
}

.avatar-modal__preview {
  display: grid;
  justify-items: center;
}

.avatar-modal .avatar-preview-card {
  justify-items: center;
}

.avatar-modal .avatar-preview-frame {
  width: min(220px, 52vw);
  height: min(220px, 52vw);
  border-radius: 50%;
}

.avatar-zoom-controls {
  width: 100%;
  display: grid;
  gap: 8px;
}

.zoom-control-row {
  display: grid;
  grid-template-columns: auto minmax(140px, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.zoom-control-row button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.zoom-control-row input[type="range"] {
  width: 100%;
}

.avatar-reset-crop {
  justify-self: start;
}

.avatar-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 720px) {
  .profile-inline-row,
  .avatar-modal__body {
    grid-template-columns: 1fr;
  }

  .avatar-inline--row {
    align-items: flex-start;
  }

  .avatar-modal__dialog {
    width: min(92vw, 520px);
    max-height: 88vh;
    overflow: auto;
  }

  .avatar-modal .avatar-preview-frame {
    width: min(220px, 72vw);
    height: min(220px, 72vw);
  }
}

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

.action-menu__list {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 160px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 30px -18px rgba(15, 23, 42, 0.28);
  display: none;
  flex-direction: column;
  gap: 6px;
  z-index: 10;
}

.action-menu.is-open .action-menu__list {
  display: flex;
}

.action-menu__item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: none;
  text-align: left;
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.4;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  background: transparent;
  border: 0;
  padding: 6px;
  border-radius: 8px;
  color: var(--text);
  font-size: 16px;
  line-height: 1;
  width: 24px;
  height: 24px;
}

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

.icon-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.icon-button,
.icon-button * {
  cursor: pointer;
}

.action-menu__item:hover,
.action-menu__item:focus-visible {
  background: var(--color-hover);
  outline: none;
}


.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.article-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}

.article-content img,
.post-view-body img,
.post-body img {
  max-width: 100%;
  height: auto;
  display: block;
}

.article-content .embed,
.post-view-body .embed,
.post-body .embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 16px 0;
}

.article-content .embed--google-sheet,
.post-view-body .embed--google-sheet,
.post-body .embed--google-sheet {
  aspect-ratio: auto;
  height: min(80vh, 900px);
}

.article-content .embed iframe,
.post-view-body .embed iframe,
.post-body .embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.article-content .embed--google-sheet iframe,
.post-view-body .embed--google-sheet iframe,
.post-body .embed--google-sheet iframe {
  position: static;
  width: 100%;
  height: 100%;
}

.embed-placeholder {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  margin: 4px 2px;
  border-radius: 10px;
  border: 1px solid #c7d7ff;
  background: #e5f0ff;
  color: #111827;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
  cursor: pointer;
}

.embed-placeholder:focus,
.embed-placeholder:hover {
  outline: none;
  border-color: #0a84ff;
  background: #d9e8ff;
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.18);
}

.trix-content .embed-placeholder,
.post-body .embed-placeholder {
  display: inline-flex !important;
}

.embed-placeholder:focus-visible {
  outline: 3px solid rgba(10, 132, 255, 0.35);
  outline-offset: 2px;
}

.embed-container {
  margin: var(--space-3) 0;
  padding: var(--space-2);
  border: 1px solid #d4dbe7;
  border-radius: 12px;
  background: #f8fbff;
  display: grid;
  gap: 8px;
}

.embed-container__label {
  font-weight: 700;
  color: #0f172a;
  font-size: 0.95rem;
}

.embed-container iframe {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.checklist {
  padding-left: 1.2rem;
  margin: 0.5rem 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.checklist input[type="checkbox"] {
  margin-top: 2px;
  flex: 0 0 auto;
}

.button-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.actions .button {
  padding: 12px 16px;
}

.search-bar {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  margin-bottom: var(--space-2);
}

.search-bar input[type="text"] {
  flex: 1;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #f8fafc;
}

@media (max-width: 640px) {
  body {
    margin-bottom: var(--space-4);
  }

  header {
    align-items: flex-start;
  }

}
