/* ============================================================
   Modulus CMS — Editorial Lab Design System
   Admin product surface: earned familiarity, full states.
   ============================================================ */

/* ── Tokens ──────────────────────────────────────────────────── */
:root {
  --paper: #fafafa;
  --surface: #ffffff;
  --ink: #0a0a0a;
  --ink-soft: #3f3f46;
  --muted: #71717a;
  --line: #ebebed;
  --line-soft: #f3f3f4;
  --signal: #1d4ed8;
  --signal-soft: #dbeafe;
  --signal-deep: #0c2a8c;

  /* Status — data chips only */
  --ok: #15803d;
  --ok-soft: #e7f6ec;
  --warn: #b45309;
  --warn-soft: #fdf3e3;
  --bad: #b42318;
  --bad-soft: #fdeceb;

  /* Radii */
  --r-sm: 14px;
  --r-md: 20px;
  --r-lg: 32px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-card: 0 1px 0 rgba(0, 0, 0, 0.02), 0 20px 50px -25px rgba(15, 23, 42, 0.18);
  --shadow-card-hover: 0 1px 0 rgba(0, 0, 0, 0.02), 0 40px 80px -25px rgba(15, 23, 42, 0.28);
  --shadow-focus: 0 0 0 3px #dbeafe;

  /* Motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-hover: 0.18s;
  --dur-card: 0.35s;

  /* Typography */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue",
    Helvetica, Arial, sans-serif;

  /* Spacing */
  --space-xs: 8px;
  --space-sm: 14px;
  --space-md: 24px;
  --space-lg: 48px;

  /* Layout */
  --topbar-h: 56px;
}

/* ── Reset ───────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

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

button,
input,
select,
textarea {
  font-family: var(--font);
}

ul,
ol {
  list-style: none;
}

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

/* ── Focus visible ───────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

/* Remove default focus outline, replaced by focus-visible */
:focus:not(:focus-visible) {
  outline: none;
}

/* ── Utility ─────────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

/* ── Top bar ─────────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  background: rgba(250, 250, 250, 0.88);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 0 var(--space-md);
  z-index: 100;
}

.topbar-logo {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 0;
  flex-shrink: 0;
}

.topbar-logo .logo-1 {
  color: var(--signal);
}

.topbar-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.topbar-nav-link {
  font-size: 13.5px;
  font-weight: 450;
  color: var(--ink-soft);
  padding: 6px 10px;
  border-radius: var(--r-pill);
  transition: color var(--dur-hover) var(--ease), background var(--dur-hover) var(--ease);
}

.topbar-nav-link:hover {
  color: var(--ink);
  background: var(--line-soft);
}

.topbar-nav-link.active {
  color: var(--ink);
  font-weight: 500;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-left: var(--space-sm);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--r-pill);
  background: var(--line-soft);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0;
  cursor: default;
  user-select: none;
}

.topbar-signout {
  font-size: 13px;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--r-pill);
  transition: color var(--dur-hover) var(--ease), background var(--dur-hover) var(--ease);
}

.topbar-signout:hover {
  color: var(--ink);
  background: var(--line-soft);
}

/* ── Page scaffold ───────────────────────────────────────────── */
.page {
  padding-top: calc(var(--topbar-h) + var(--space-lg));
  padding-bottom: var(--space-lg);
  min-height: 100vh;
}

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.container--wide {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* ── Page header ─────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.page-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.page-count {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
}

.page-header-actions {
  margin-left: auto;
  display: flex;
  gap: var(--space-xs);
}

/* ── Buttons ─────────────────────────────────────────────────── */
.ds-btn-primary {
  background: var(--ink);
  color: var(--surface);
  padding: 9px 18px;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  letter-spacing: -0.01em;
  transition: background var(--dur-hover) var(--ease), transform var(--dur-hover) var(--ease);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ds-btn-primary:hover {
  background: #1f2937;
}

.ds-btn-primary:active {
  transform: translateY(1px) scale(0.98);
}

.ds-btn-primary:focus-visible {
  box-shadow: var(--shadow-focus);
  outline: none;
}

.ds-btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.ds-btn-primary.ds-btn-danger {
  background: var(--bad);
}

.ds-btn-primary.ds-btn-danger:hover {
  background: #9b1c1c;
}

/* Demo send = Signal Blue rectangle */
.ds-demo-send {
  background: var(--signal);
  color: var(--surface);
  border: none;
  border-radius: 10px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  font-family: var(--font);
  transition: background var(--dur-hover) var(--ease), transform var(--dur-hover) var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.ds-demo-send:hover {
  background: #1a44c0;
}

.ds-demo-send:active {
  transform: translateY(1px);
}

.ds-demo-send:focus-visible {
  box-shadow: var(--shadow-focus);
  outline: none;
}

.ds-demo-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* Mini = quiet bordered */
.ds-mini {
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 7px 14px;
  font-size: 12.5px;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: var(--font);
  transition: border-color var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease),
    background var(--dur-hover) var(--ease);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ds-mini:hover {
  color: var(--ink);
  background: var(--line-soft);
  border-color: #d4d4d4;
}

.ds-mini:focus-visible {
  box-shadow: var(--shadow-focus);
  outline: none;
}

.ds-mini:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Inputs ──────────────────────────────────────────────────── */
.ds-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13.5px;
  color: var(--ink);
  outline: none;
  font-family: var(--font);
  transition: border-color var(--dur-hover) var(--ease), box-shadow var(--dur-hover) var(--ease);
}

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

.ds-input:focus {
  border-color: var(--signal);
  box-shadow: var(--shadow-focus);
}

.ds-input:disabled {
  background: var(--line-soft);
  color: var(--muted);
  cursor: not-allowed;
}

.ds-input--error {
  border-color: var(--bad);
}

.ds-input--warn {
  border-color: var(--warn);
}

/* Textarea variant */
.ds-textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

/* Select variant */
.ds-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

/* Borderless title input */
.ds-input--borderless {
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding-left: 0;
  padding-right: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.025em;
  box-shadow: none;
}

.ds-input--borderless:focus {
  border-bottom-color: var(--signal);
  box-shadow: none;
}

/* ── State chips ─────────────────────────────────────────────── */
.state-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.chip--draft {
  background: #f4f4f5;
  color: var(--ink-soft);
}

.chip--review {
  background: var(--warn-soft);
  color: var(--warn);
}

.chip--queued {
  background: var(--signal-soft);
  color: var(--signal);
}

.chip--scheduled {
  background: #eff6ff;
  color: var(--signal);
}

.chip--published {
  background: var(--ok-soft);
  color: var(--ok);
}

.chip--error {
  background: var(--bad-soft);
  color: var(--bad);
}

/* Tag chip (category label) */
.tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-soft);
  background: #f4f4f5;
  white-space: nowrap;
}

/* ── Segmented filter tabs ───────────────────────────────────── */
.seg-tabs {
  display: flex;
  gap: 2px;
  background: var(--line-soft);
  border-radius: var(--r-pill);
  padding: 3px;
  width: fit-content;
  overflow-x: auto;
  scrollbar-width: none;
}

.seg-tabs::-webkit-scrollbar {
  display: none;
}

.seg-tab {
  background: none;
  border: none;
  border-radius: var(--r-pill);
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font);
  white-space: nowrap;
  transition: background var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease);
  display: flex;
  align-items: center;
  gap: 5px;
}

.seg-tab:hover:not(.active) {
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.6);
}

.seg-tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.seg-tab:focus-visible {
  box-shadow: var(--shadow-focus);
  outline: none;
}

.seg-count {
  font-size: 10.5px;
  font-weight: 600;
  color: inherit;
  opacity: 0.7;
}

/* ── Search ──────────────────────────────────────────────────── */
.search-bar {
  position: relative;
  width: 260px;
}

.search-bar svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  width: 14px;
  height: 14px;
}

.search-bar input {
  padding-left: 32px;
  height: 36px;
  font-size: 13px;
  border-radius: var(--r-pill);
}

.search-bar input:focus {
  border-color: var(--signal);
  box-shadow: var(--shadow-focus);
}

/* ── Table ───────────────────────────────────────────────────── */
.posts-table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface);
}

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

.posts-table th {
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.posts-table th:last-child {
  text-align: right;
}

.posts-table td {
  padding: 12px 16px;
  font-size: 13.5px;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

.posts-table tr:last-child td {
  border-bottom: none;
}

.posts-table tbody tr {
  transition: background var(--dur-hover) var(--ease);
}

.posts-table tbody tr:hover {
  background: var(--paper);
}

.posts-table tbody tr.row--review {
  background: #fffdf5;
}

.posts-table tbody tr.row--review:hover {
  background: #fffbeb;
}

/* Post title cell */
.cell-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cell-title-text {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cell-slug {
  font-size: 11.5px;
  color: var(--muted);
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, "Cascadia Code", monospace;
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Kebab actions */
.kebab-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--dur-hover) var(--ease), background var(--dur-hover) var(--ease);
  position: relative;
}

.kebab-btn:hover {
  color: var(--ink);
  background: var(--line-soft);
}

.kebab-btn:focus-visible {
  box-shadow: var(--shadow-focus);
  outline: none;
}

/* Dropdown menu */
.kebab-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-card);
  min-width: 140px;
  z-index: 50;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity var(--dur-hover) var(--ease), transform var(--dur-hover) var(--ease);
}

.kebab-menu.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.kebab-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 9px 14px;
  font-size: 13px;
  font-family: var(--font);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease);
}

.kebab-menu-item:hover {
  background: var(--paper);
  color: var(--ink);
}

.kebab-menu-item.danger {
  color: var(--bad);
}

.kebab-menu-item.danger:hover {
  background: var(--bad-soft);
}

.kebab-menu-item:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: -2px;
}

.kebab-cell {
  text-align: right;
  position: relative;
}

/* ── Skeleton / loading ──────────────────────────────────────── */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.skeleton {
  background: var(--line-soft);
  border-radius: 6px;
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}

.skeleton-row td {
  padding: 14px 16px;
}

.skeleton-line {
  height: 13px;
  background: var(--line-soft);
  border-radius: 6px;
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}

.skeleton-line--short {
  width: 60%;
}

.skeleton-line--med {
  width: 40%;
}

.skeleton-line--tiny {
  width: 80px;
}

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px var(--space-md);
  text-align: center;
  gap: 12px;
}

.empty-state svg {
  width: 40px;
  height: 40px;
  color: var(--line);
}

.empty-state-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
}

.empty-state-body {
  font-size: 13px;
  color: var(--muted);
  max-width: 300px;
}

/* ── Error state ─────────────────────────────────────────────── */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px var(--space-md);
  text-align: center;
  gap: 10px;
}

.error-state-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--bad);
}

.error-state-body {
  font-size: 13px;
  color: var(--muted);
}

/* ── Toast ───────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  background: var(--ink);
  color: var(--surface);
  padding: 11px 16px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 450;
  max-width: 340px;
  box-shadow: var(--shadow-card);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  pointer-events: none;
}

.toast--visible {
  opacity: 1;
  transform: translateY(0);
}

.toast--success {
  background: var(--ok);
}

.toast--error {
  background: var(--bad);
}

/* ── Confirm modal ───────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9990;
  opacity: 0;
  transition: opacity 0.2s var(--ease);
  padding: var(--space-md);
}

.modal-overlay--visible {
  opacity: 1;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--space-md);
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-card);
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.modal-message {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin-bottom: var(--space-md);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ── Form field group ────────────────────────────────────────── */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.field-hint {
  font-size: 11.5px;
  color: var(--muted);
}

.field-counter {
  font-size: 11.5px;
  color: var(--muted);
  text-align: right;
}

.field-counter.warn {
  color: var(--warn);
}

.field-counter.bad {
  color: var(--bad);
}

.field-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Sign-in page ────────────────────────────────────────────── */
.signin-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  padding: var(--space-md);
}

.signin-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-card);
}

.signin-logo {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.035em;
  margin-bottom: 24px;
}

.signin-logo .logo-1 {
  color: var(--signal);
}

.signin-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 6px;
}

.signin-sub {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin-bottom: 28px;
  line-height: 1.5;
}

.signin-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.signin-success {
  text-align: center;
  padding: 20px 0;
}

.signin-success-icon {
  width: 44px;
  height: 44px;
  background: var(--ok-soft);
  border-radius: var(--r-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--ok);
}

.signin-success-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.signin-success-body {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}

.signin-error {
  font-size: 12.5px;
  color: var(--bad);
  padding: 8px 12px;
  background: var(--bad-soft);
  border-radius: 8px;
}

/* ── Posts page toolbar ──────────────────────────────────────── */
.posts-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

/* ── Editor layout ───────────────────────────────────────────── */
.editor-page {
  padding-top: var(--topbar-h);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Editor toolbar */
.editor-toolbar {
  position: sticky;
  top: var(--topbar-h);
  background: rgba(250, 250, 250, 0.92);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 var(--space-md);
  height: 48px;
  z-index: 90;
  flex-shrink: 0;
}

.editor-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.editor-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  min-width: 0;
}

.breadcrumb-sep {
  color: var(--line);
}

.breadcrumb-current {
  color: var(--ink-soft);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.autosave-status {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.autosave-status.saving {
  color: var(--signal);
}

.autosave-status.unsaved {
  color: var(--warn);
}

/* Editor body */
.editor-body {
  display: grid;
  grid-template-columns: 1fr 420px;
  flex: 1;
  min-height: 0;
}

@media (max-width: 1023px) {
  .editor-body {
    grid-template-columns: 1fr;
  }

  .editor-right-col {
    display: none;
  }
}

.editor-left-col {
  border-right: 1px solid var(--line);
  overflow-y: auto;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.editor-right-col {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  overflow: hidden;
}

/* ── Review banner ───────────────────────────────────────────── */
.review-banner {
  background: var(--warn-soft);
  border-bottom: 1px solid #f6d860;
  padding: 10px var(--space-md);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--warn);
  flex-shrink: 0;
}

.review-banner-text {
  flex: 1;
  font-weight: 500;
}

/* ── Markdown toolbar ────────────────────────────────────────── */
.md-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
}

.md-btn {
  background: none;
  border: none;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: var(--font);
  transition: background var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease);
  white-space: nowrap;
  min-width: 28px;
  text-align: center;
}

.md-btn:hover {
  background: var(--line-soft);
  color: var(--ink);
}

.md-btn:focus-visible {
  box-shadow: var(--shadow-focus);
  outline: none;
}

.md-sep {
  width: 1px;
  background: var(--line);
  margin: 4px 2px;
  align-self: stretch;
}

.md-textarea {
  border-radius: 0 0 10px 10px;
  min-height: 320px;
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, "Cascadia Code", monospace;
  font-size: 13px;
  line-height: 1.65;
  resize: vertical;
}

/* ── FAQ repeater ────────────────────────────────────────────── */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.faq-item-num {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.faq-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  transition: color var(--dur-hover) var(--ease), background var(--dur-hover) var(--ease);
}

.faq-remove:hover {
  color: var(--bad);
  background: var(--bad-soft);
}

/* ── Preview pane ────────────────────────────────────────────── */
.preview-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  flex-shrink: 0;
}

.preview-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.preview-viewport-toggle {
  display: flex;
  gap: 2px;
}

.viewport-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 4px 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: color var(--dur-hover) var(--ease), background var(--dur-hover) var(--ease);
}

.viewport-btn:hover {
  color: var(--ink);
  background: var(--line-soft);
}

.viewport-btn.active {
  color: var(--signal);
  background: var(--signal-soft);
}

.viewport-btn:focus-visible {
  box-shadow: var(--shadow-focus);
  outline: none;
}

.preview-frame-wrap {
  flex: 1;
  overflow: auto;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: var(--paper);
}

.preview-frame {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  width: 100%;
  max-width: 680px;
  min-height: 400px;
  overflow: hidden;
  transform-origin: top center;
  transition: transform 0.35s var(--ease), width 0.35s var(--ease);
}

.preview-frame.mobile {
  max-width: 375px;
}

.preview-content {
  padding: 28px 32px;
  font-family: var(--font);
  color: var(--ink);
  line-height: 1.7;
  font-size: 15px;
}

.preview-content h1 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 10px;
}

.preview-content h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 24px 0 8px;
}

.preview-content h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 20px 0 6px;
}

.preview-content p {
  margin-bottom: 14px;
  color: var(--ink-soft);
}

.preview-content ul,
.preview-content ol {
  padding-left: 20px;
  margin-bottom: 14px;
  list-style: revert;
  color: var(--ink-soft);
}

.preview-content li {
  margin-bottom: 4px;
}

.preview-content blockquote {
  border-left: 1px solid var(--line);
  padding-left: 14px;
  margin: 14px 0;
  color: var(--muted);
  font-style: italic;
}

.preview-content hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 20px 0;
}

.preview-content a {
  color: var(--signal);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.preview-content strong {
  font-weight: 600;
  color: var(--ink);
}

.preview-content code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  background: var(--line-soft);
  padding: 2px 5px;
  border-radius: 4px;
}

.preview-meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.preview-excerpt {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-soft);
  font-style: italic;
}

/* ── Validation panel ────────────────────────────────────────── */
.validation-panel {
  flex-shrink: 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 14px;
  overflow-y: auto;
  max-height: 260px;
}

.validation-header {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.validation-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.validation-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  padding: 6px 8px;
  border-radius: 8px;
}

.validation-item.blocking {
  color: var(--bad);
  background: var(--bad-soft);
}

.validation-item.warning {
  color: var(--warn);
  background: var(--warn-soft);
}

.validation-item.ok {
  color: var(--ok);
  background: var(--ok-soft);
}

.validation-item-icon {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  margin-top: 1px;
}

.validation-item-text {
  flex: 1;
}

.validation-go {
  font-size: 11.5px;
  font-weight: 500;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font);
  opacity: 0.8;
}

.validation-go:hover {
  opacity: 1;
}

.validation-ok-all {
  font-size: 12.5px;
  color: var(--ok);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: var(--ok-soft);
  border-radius: 8px;
}

/* ── Editor section headers ──────────────────────────────────── */
.editor-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.editor-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}

/* ── Inline tag / chips for filter counts ────────────────────── */
.needs-review-tag {
  display: inline-flex;
  align-items: center;
  background: var(--warn-soft);
  color: var(--warn);
  border-radius: var(--r-pill);
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  margin-left: 4px;
}

/* ── Responsive — mobile cards ───────────────────────────────── */
@media (max-width: 767px) {
  .posts-table-wrap {
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .posts-table,
  .posts-table thead,
  .posts-table tbody,
  .posts-table th,
  .posts-table td,
  .posts-table tr {
    display: block;
  }

  .posts-table thead {
    display: none;
  }

  .posts-table tbody tr {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    margin-bottom: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .posts-table tbody tr.row--review {
    background: #fffdf5;
    border-color: #f6d860;
  }

  .posts-table td {
    padding: 0;
    border: none;
  }

  .posts-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 3px;
  }

  .kebab-cell {
    text-align: left;
  }

  .seg-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .posts-toolbar {
    gap: 8px;
  }

  .search-bar {
    width: 100%;
  }

  .page-header {
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .topbar-label {
    display: none;
  }

  .topbar-nav-link {
    font-size: 12.5px;
    padding: 6px 8px;
  }

  .container,
  .container--wide {
    padding: 0 16px;
  }

  .page {
    padding-top: calc(var(--topbar-h) + 28px);
  }

  .signin-card {
    padding: 28px 20px;
  }
}

/* ── SEO section ─────────────────────────────────────────────── */
.seo-section {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Divider ─────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--line-soft);
}

/* ── Keyword chips input ─────────────────────────────────────── */
.keyword-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-height: 38px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
  cursor: text;
  transition: border-color var(--dur-hover) var(--ease), box-shadow var(--dur-hover) var(--ease);
}

.keyword-wrap:focus-within {
  border-color: var(--signal);
  box-shadow: var(--shadow-focus);
}

.keyword-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--signal-soft);
  color: var(--signal);
  border-radius: var(--r-pill);
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 500;
}

.keyword-chip-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--signal);
  display: flex;
  align-items: center;
  padding: 0;
  opacity: 0.7;
  transition: opacity var(--dur-hover) var(--ease);
}

.keyword-chip-remove:hover {
  opacity: 1;
}

.keyword-input {
  border: none;
  outline: none;
  font-size: 13px;
  font-family: var(--font);
  color: var(--ink);
  background: transparent;
  min-width: 80px;
  flex: 1;
}

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