/* ==========================================================================
   Linear × Stripe × Superhuman Studio Design System — X Post Review Studio
   Supports Light Alabaster Studio & Dark Obsidian Studio via light-dark()
   ========================================================================== */

[v-cloak] {
  display: none !important;
}

:root {
  color-scheme: light dark;

  --bg-app: light-dark(#f4f6f9, #090d16);
  --bg-surface: light-dark(#ffffff, #111726);
  --bg-card: light-dark(#ffffff, #111726);
  --bg-subtle: light-dark(#f1f5f9, #161f33);
  --bg-muted: light-dark(#e2e8f0, #1e293b);
  --bg-canvas-dots: light-dark(rgba(15, 23, 42, 0.075), rgba(148, 163, 184, 0.09));

  --border-light: light-dark(#e2e8f0, #1e293b);
  --border-medium: light-dark(#cbd5e1, #283548);
  --border-color: light-dark(#cbd5e1, #283548);
  --border-dark: light-dark(#94a3b8, #475569);

  --text-main: light-dark(#0f172a, #f8fafc);
  --text-muted: light-dark(#475569, #94a3b8);
  --text-subtle: light-dark(#64748b, #8193b2);

  --accent-main: light-dark(#4f46e5, #818cf8);
  --accent: light-dark(#4f46e5, #818cf8);
  --accent-hover: light-dark(#4338ca, #6366f1);
  --accent-light: light-dark(#eef2ff, rgba(99, 102, 241, 0.16));

  /* Decision & Status Semantic Tokens */
  --approved-color: light-dark(#047857, #34d399);
  --approved-solid: #059669;
  --approved-bg: light-dark(#ecfdf5, rgba(16, 185, 129, 0.14));
  --approved-border: light-dark(#a7f3d0, rgba(52, 211, 153, 0.32));

  --changes-color: light-dark(#b45309, #fbbf24);
  --changes-solid: #d97706;
  --changes-bg: light-dark(#fffbeb, rgba(245, 158, 11, 0.14));
  --changes-border: light-dark(#fde68a, rgba(251, 191, 36, 0.32));

  --rejected-color: light-dark(#be123c, #fb7185);
  --rejected-solid: #e11d48;
  --rejected-bg: light-dark(#fff1f2, rgba(244, 63, 94, 0.14));
  --rejected-border: light-dark(#fecdd3, rgba(251, 113, 133, 0.32));

  --pending-color: light-dark(#334155, #cbd5e1);
  --pending-bg: light-dark(#f1f5f9, rgba(148, 163, 184, 0.14));
  --pending-border: light-dark(#cbd5e1, rgba(148, 163, 184, 0.28));

  --published-color: light-dark(#0369a1, #38bdf8);
  --published-bg: light-dark(#f0f9ff, rgba(56, 189, 248, 0.14));
  --published-border: light-dark(#bae6fd, rgba(56, 189, 248, 0.32));

  /* Shadows & Radii */
  --shadow-sm: light-dark(0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(0, 0, 0, 0.35));
  --shadow-card: light-dark(
    0 1px 3px rgba(15, 23, 42, 0.04), 0 8px 24px -6px rgba(15, 23, 42, 0.06),
    0 2px 6px rgba(0, 0, 0, 0.4), 0 12px 28px -8px rgba(0, 0, 0, 0.55)
  );
  --shadow-elevated: light-dark(
    0 4px 12px rgba(15, 23, 42, 0.06), 0 20px 40px -12px rgba(15, 23, 42, 0.12),
    0 8px 24px rgba(0, 0, 0, 0.5), 0 24px 48px -12px rgba(0, 0, 0, 0.7)
  );

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 14px;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  &:has(> head > meta[name="color-scheme"][content="dark"]) {
    color-scheme: dark;
  }
  &:has(> head > meta[name="color-scheme"][content="light"]) {
    color-scheme: light;
  }
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 13.5px;
  letter-spacing: -0.011em;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --------------------------------------------------------------------------
   App Layout
   -------------------------------------------------------------------------- */
.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Global Studio Header
   -------------------------------------------------------------------------- */
.app-header {
  min-height: 54px;
  height: auto;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 16px;
  flex-shrink: 0;
  z-index: 20;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-emblem {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0f172a 0%, #312e81 100%);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.brand-text-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.header-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.account-handle {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--accent-main);
  background-color: var(--accent-light);
  padding: 1px 6px;
  border-radius: 999px;
}

.brand-progress-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-progress-track {
  width: 68px;
  height: 4px;
  border-radius: 999px;
  background-color: var(--bg-muted);
  overflow: hidden;
}

.brand-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4f46e5, #10b981);
  transition: width 0.35s ease;
}

.brand-progress-label {
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-subtle);
}

.header-stats {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 3px;
  padding: 3px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 9px;
  overflow-x: auto;
  scrollbar-width: none;
}

.header-stats::-webkit-scrollbar {
  display: none;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  background-color: transparent;
  border-radius: 6px;
  color: var(--text-muted);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

@media (max-width: 1460px) {
  .stat-drafts-pill,
  .stat-rejected-pill {
    display: none;
  }
}

.stat-pill:hover {
  background-color: var(--bg-surface);
  color: var(--text-main);
}

.stat-pill.stat-pill-active {
  background-color: var(--bg-surface);
  border-color: var(--border-medium);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.stat-pill strong {
  color: var(--text-main);
  font-weight: 700;
}

.stat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-published { background-color: #0ea5e9; }
.dot-pending { background-color: #64748b; }
.dot-changes { background-color: #f59e0b; }
.dot-approved { background-color: #10b981; }

.stat-divider {
  width: 1px;
  height: 14px;
  background-color: var(--border-medium);
  margin: 0 2px;
}

.stat-pending strong { color: var(--pending-color); }
.stat-changes strong { color: var(--changes-color); }
.stat-approved strong { color: var(--approved-color); }
.stat-rejected strong { color: var(--rejected-color); }
.stat-reqs strong { color: var(--changes-color); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-command-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-command-trigger:hover {
  border-color: var(--accent-main);
  color: var(--text-main);
  background-color: var(--bg-surface);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.cmd-trigger-kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  color: var(--text-main);
}

.btn-icon-only {
  padding: 5px 8px !important;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot-online {
  background-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.24);
}

/* --------------------------------------------------------------------------
   Main Workspace
   -------------------------------------------------------------------------- */
.app-main {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* --------------------------------------------------------------------------
   Left Panel: Queue & Filters (Studio Sidebar Rail)
   -------------------------------------------------------------------------- */
.queue-panel {
  width: 382px;
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100%;
}

.queue-views {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 8px 10px;
  gap: 4px;
  background-color: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
}

.view-tab {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  background: transparent;
  border: 1px solid transparent;
  padding: 4px 5px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  transition: all 0.15s ease;
}

.view-tab:hover {
  background-color: var(--bg-muted);
  color: var(--text-main);
}

.view-tab.active {
  background-color: var(--bg-surface);
  border-color: var(--border-medium);
  color: var(--accent-main);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.view-tab-count {
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text-subtle);
  font-weight: 600;
}

.view-tab.active .view-tab-count {
  color: var(--accent-main);
}

.queue-search {
  padding: 8px 12px 4px;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-subtle);
  pointer-events: none;
}

.search-input-wrap input {
  width: 100%;
  padding: 6px 30px 6px 32px;
  font-size: 13px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  background-color: var(--bg-app);
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input-wrap input:focus {
  border-color: var(--accent-main);
  background-color: var(--bg-surface);
  box-shadow: 0 0 0 3px rgba(44, 68, 94, 0.12);
}

.search-shortcut-kbd {
  position: absolute;
  right: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid var(--border-medium);
  background-color: var(--bg-surface);
  color: var(--text-subtle);
  pointer-events: none;
}

.search-clear-btn {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  font-size: 16px;
  color: var(--text-subtle);
  cursor: pointer;
}

.queue-filters {
  padding: 4px 12px 8px;
  border-bottom: 1px solid var(--border-light);
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 4px;
}

.primary-filters {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.secondary-filters {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-top: 6px;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.filter-field label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-subtle);
}

.filter-field select {
  font-size: 11.5px;
  padding: 4px 6px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface);
  color: var(--text-main);
  outline: none;
  width: 100%;
}

.filter-field select:focus {
  border-color: var(--accent-main);
}

.more-filters-disclosure {
  margin-top: 6px;
}

.more-filters-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--accent-main);
  cursor: pointer;
  user-select: none;
  padding: 2px 0;
}

.filter-active-badge {
  display: inline-block;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 999px;
  background-color: var(--accent-light);
  color: var(--accent-main);
  border: 1px solid var(--border-medium);
}

.active-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  font-size: 11px;
  border-radius: var(--radius-sm);
  background-color: var(--accent-light);
  border: 1px solid var(--border-medium);
  color: var(--accent-main);
  cursor: pointer;
}

.filter-chip:hover {
  background-color: var(--bg-muted);
}

.filter-chip-lbl {
  color: var(--text-muted);
}

.filter-chip-close {
  font-weight: 700;
  margin-left: 2px;
}

.filter-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.queue-list-container {
  flex: 1;
  overflow-y: auto;
  padding: 2px 0;
}

.queue-skeleton-list {
  display: flex;
  flex-direction: column;
}

.skeleton-card {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-line {
  height: 10px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--bg-muted) 50%, var(--bg-subtle) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.4s ease-in-out infinite;
}

.skeleton-top { width: 42%; height: 12px; }
.skeleton-body-1 { width: 92%; }
.skeleton-body-2 { width: 74%; }
.skeleton-meta { width: 35%; height: 9px; }

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.queue-loading, .queue-empty {
  padding: 30px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* Post Queue Card */
.queue-card {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-light);
  padding: 10px 14px;
  cursor: pointer;
  transition: background-color 0.12s;
  font-family: inherit;
  font-size: inherit;
}

.queue-card:hover {
  background-color: var(--bg-app);
}

.queue-card.active {
  background-color: var(--accent-light);
  border-left: 3px solid var(--accent-main);
  padding-left: 11px;
}

.queue-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.queue-card-id-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.queue-card-id {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

.queue-card-badges {
  display: flex;
  align-items: center;
  gap: 4px;
}

.queue-card-excerpt {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.queue-card-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-subtle);
}

.queue-card-bottom span {
  display: inline-block;
}

/* Queue Pagination */
.queue-pagination {
  padding: 8px 14px;
  border-top: 1px solid var(--border-light);
  background-color: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.page-info {
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Right Panel: Detail & Review Workspace
   -------------------------------------------------------------------------- */
.detail-panel {
  flex: 1;
  background-color: var(--bg-app);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.mobile-nav-bar {
  display: none;
  padding: 8px 16px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
}

.detail-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 40px;
  margin-bottom: 16px;
  opacity: 0.6;
}

.detail-empty-state h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.detail-empty-state p {
  max-width: 480px;
  line-height: 1.5;
  font-size: 13.5px;
}

.detail-content {
  padding: 20px 24px 48px;
  max-width: 1460px;
  margin: 0 auto;
  width: 100%;
}

/* 3-Pane Studio Spatial Workbench Grid (Center X Stage + Right Live Inspector) */
.studio-workbench-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 375px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 1180px) {
  .studio-workbench-grid {
    grid-template-columns: 1fr;
  }
}

.studio-stage-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.studio-inspector-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  position: sticky;
  top: 16px;
}

/* Detail Top Header */
.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 12px 16px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
  gap: 10px 14px;
}

.detail-title-group {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.detail-id {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.detail-nav-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  flex-shrink: 0;
  gap: 6px;
}

/* Circular SVG Character Ring Gauge (X Native Composer Bar) */
.char-ring-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 6px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 999px;
}

.char-ring-svg {
  transform: rotate(-90deg);
  flex-shrink: 0;
}

.char-ring-track {
  stroke: var(--border-medium);
}

.char-ring-progress {
  stroke: var(--accent-main);
  transition: stroke-dashoffset 0.25s ease, stroke 0.2s ease;
}

.char-ring-pill.near-limit .char-ring-progress {
  stroke: #f59e0b;
}

.char-ring-pill.over-limit .char-ring-progress {
  stroke: #e11d48;
}

.char-count-info {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-main);
}

.char-limit-denom {
  color: var(--text-subtle);
  font-weight: 400;
}

.nav-btn-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

/* Right Inspector Property Matrix Card */
.inspector-property-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.inspector-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background-color: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
}

.inspector-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.inspector-section-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 4px;
  background-color: var(--accent-light);
  color: var(--accent-main);
}

.detail-meta-ribbon {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  padding: 12px 14px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  font-size: 12px;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  color: var(--text-muted);
  min-width: 0;
}

.meta-label {
  color: var(--text-subtle);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.meta-item strong {
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Studio Dotted Canvas & Authentic X Post Frame */
.studio-post-canvas {
  padding: 20px;
  border-radius: var(--radius-lg);
  background-color: var(--bg-subtle);
  background-image: radial-gradient(var(--bg-canvas-dots) 1px, transparent 1px);
  background-size: 16px 16px;
  border: 1px solid var(--border-light);
  margin-bottom: 14px;
}

.reading-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: 0;
  overflow: hidden;
}

.reading-card-author-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border-light);
  background-color: var(--bg-surface);
}

.author-identity {
  display: flex;
  align-items: center;
  gap: 11px;
}

.author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5 0%, #0f172a 100%);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
}

.author-names-stack {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.author-name-line {
  display: flex;
  align-items: center;
  gap: 5px;
}

.author-display-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.015em;
}

.verified-badge-svg {
  flex-shrink: 0;
}

.author-handle {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-subtle);
}

.reading-quick-signals {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.signal-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--border-light);
  background-color: var(--bg-subtle);
  color: var(--text-muted);
}

.signal-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
}

.signal-pill.signal-good {
  background-color: var(--approved-bg);
  border-color: var(--approved-border);
  color: var(--approved-color);
}

.signal-pill.signal-warn {
  background-color: var(--changes-bg);
  border-color: var(--changes-border);
  color: var(--changes-color);
}

.signal-pill.signal-bad {
  background-color: var(--rejected-bg);
  border-color: var(--rejected-border);
  color: var(--rejected-color);
}

.reading-card-inner {
  padding: 26px 28px 22px;
}

.reading-body {
  font-family: var(--font-sans);
  font-size: 18.5px;
  line-height: 1.66;
  letter-spacing: -0.016em;
  color: var(--text-main);
  white-space: pre-wrap;
  word-break: break-word;
  max-width: 62ch;
}

.x-preview-engagement-bar {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 10px 28px;
  border-top: 1px solid var(--border-light);
  color: var(--text-subtle);
  font-size: 11.5px;
  font-weight: 500;
  user-select: none;
}

.x-eng-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  opacity: 0.78;
}

.x-eng-brand {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
}

.reading-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background-color: var(--accent-light);
  border-top: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-main);
}

.reading-footer-icon {
  color: var(--accent-main);
  display: inline-flex;
  flex-shrink: 0;
}

/* Studio Decision Dock */
.review-action-section {
  margin-bottom: 16px;
}

.action-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 18px 22px;
}

.action-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.action-card-title {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

.action-card-version {
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 2px 7px;
  border-radius: 999px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-subtle);
}

.action-btn-row {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.action-btn-row .btn {
  padding: 5px 9px;
  font-size: 11.5px;
}

.action-drawer {
  background-color: var(--bg-app);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.drawer-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.required-star {
  color: var(--rejected-color);
}

.form-hint {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: normal;
  margin-top: 2px;
}

.form-textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 13.5px;
  font-family: var(--font-sans);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface);
  color: var(--text-main);
  outline: none;
  resize: vertical;
}

.form-textarea:focus {
  border-color: var(--accent-main);
}

.form-btn-row {
  display: flex;
  gap: 8px;
}

/* Open Improvement Requests */
.open-requests-container {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}

.open-requests-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.open-requests-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.open-requests-sub {
  font-size: 11px;
  color: var(--changes-color);
  font-weight: 500;
}

.requests-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.request-card {
  background-color: var(--changes-bg);
  border: 1px solid var(--changes-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.request-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  margin-bottom: 6px;
}

.request-id {
  font-family: var(--font-mono);
  color: var(--changes-color);
  font-weight: 600;
}

.request-instruction {
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.45;
  margin-bottom: 8px;
  white-space: pre-wrap;
}

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

.resolve-drawer {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--changes-border);
}

/* Add Note Section */
.add-note-container {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}

.note-disclosure-summary {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.note-form-body {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.note-form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* --------------------------------------------------------------------------
   Detail Tabs Section (Studio Right Inspector)
   -------------------------------------------------------------------------- */
.detail-tabs-section {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 14px 16px;
}

.tabs-header {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  background-color: var(--bg-subtle);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  border-bottom: none;
}

.tab-btn {
  background: none;
  border: 1px solid transparent;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  justify-content: center;
  transition: all 0.15s;
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  background-color: var(--bg-surface);
  border-color: var(--border-light);
  color: var(--accent-main);
  box-shadow: var(--shadow-sm);
}

.editorial-card {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 12px;
}

.card-subtitle {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-subtle);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-pair {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border-light);
}

.stat-pair:last-child {
  border-bottom: none;
}

.stat-pair .lbl {
  color: var(--text-muted);
}

.score-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}

.score-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.score-box-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  width: 100%;
}

.score-num {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.score-lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.score-meter-track {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background-color: var(--bg-muted);
  overflow: hidden;
}

.score-meter-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.score-meter-fill.meter-good { background-color: #10b981; }
.score-meter-fill.meter-warn { background-color: #f59e0b; }
.score-meter-fill.meter-bad { background-color: #e11d48; }

.score-explainer {
  font-size: 10.5px;
  color: var(--text-subtle);
  line-height: 1.4;
}

.dimensions-card {
  margin-bottom: 16px;
}

.dimensions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.dimensions-table th {
  text-align: left;
  background-color: var(--bg-subtle);
  padding: 6px 10px;
  font-size: 11px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-medium);
}

.dimensions-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-light);
}

.editorial-notes-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.note-block-lbl {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-subtle);
  margin-bottom: 2px;
}

.note-block-text {
  font-size: 12.5px;
  color: var(--text-main);
  line-height: 1.45;
  background-color: var(--bg-app);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.source-code {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  background-color: var(--bg-app);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  color: var(--accent-main);
}

/* History & Revisions */
.revisions-container, .timeline-container, .comments-container {
  margin-bottom: 20px;
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline-entry {
  background-color: var(--bg-app);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
}

.timeline-entry-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.timeline-type {
  font-weight: 600;
  color: var(--accent-main);
}

.timeline-time {
  font-size: 11px;
  color: var(--text-subtle);
}

.timeline-body {
  color: var(--text-muted);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comment-bubble {
  background-color: var(--bg-app);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 11px;
  color: var(--text-subtle);
  font-weight: 600;
}

.comment-text {
  color: var(--text-main);
  white-space: pre-wrap;
  font-size: 12.5px;
}

.diff-box {
  background-color: var(--bg-app);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 12px;
  margin-top: 6px;
}

.diff-header {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-subtle);
  margin-bottom: 4px;
}

.diff-text {
  white-space: pre-wrap;
  font-family: var(--font-sans);
  color: var(--text-main);
}

/* Relationships */
.tab-disclaimer {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-style: italic;
}

.relationship-card {
  background-color: var(--bg-app);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rel-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rel-target {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent-main);
  text-decoration: underline;
  cursor: pointer;
}

.rel-reason {
  font-size: 12px;
  color: var(--text-muted);
}

.rel-badges {
  display: flex;
  gap: 6px;
}

/* --------------------------------------------------------------------------
   Badges & Tags
   -------------------------------------------------------------------------- */
.badge {
  display: inline-block;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-transform: capitalize;
}

.badge-decision.decision-pending { background-color: var(--pending-bg); color: var(--pending-color); border: 1px solid var(--pending-border); }
.badge-decision.decision-approved { background-color: var(--approved-bg); color: var(--approved-color); border: 1px solid var(--approved-border); }
.badge-decision.decision-changes_requested { background-color: var(--changes-bg); color: var(--changes-color); border: 1px solid var(--changes-border); }
.badge-decision.decision-rejected { background-color: var(--rejected-bg); color: var(--rejected-color); border: 1px solid var(--rejected-border); }

.badge-freshness.fresh-true { background-color: var(--bg-subtle); color: var(--text-muted); }
.badge-freshness.fresh-false { background-color: var(--changes-bg); color: var(--changes-color); border: 1px solid var(--changes-border); }

.badge-checklist.pass-1 { background-color: var(--approved-bg); color: var(--approved-color); }
.badge-checklist.pass-0 { background-color: var(--bg-subtle); color: var(--text-subtle); }

.badge-status.status-draft { background-color: var(--bg-subtle); color: var(--text-muted); }
.badge-status.status-posted { background-color: var(--published-bg); color: var(--published-color); border: 1px solid var(--published-border); }

.tag {
  display: inline-block;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.tag-pack {
  background-color: var(--bg-muted);
  color: var(--text-muted);
}

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 9px;
  background-color: var(--changes-color);
  color: #fff;
}

.queue-req-pill {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  background-color: var(--changes-bg);
  color: var(--changes-color);
  border: 1px solid var(--changes-border);
}

/* --------------------------------------------------------------------------
   Buttons & Links
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-xs {
  padding: 2px 6px;
  font-size: 11px;
}

.btn-primary {
  background: linear-gradient(180deg, #4f46e5 0%, #4338ca 100%);
  color: #ffffff;
  border-color: #3730a3;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(15, 23, 42, 0.12);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #4338ca 0%, #3730a3 100%);
}

.btn-secondary {
  background-color: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border-light);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover:not(:disabled) {
  background-color: var(--bg-subtle);
  border-color: var(--border-medium);
}

.btn-approve {
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
  border-color: #047857;
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 1px 2px rgba(5, 150, 105, 0.2);
}
.btn-approve:hover:not(:disabled) {
  background: linear-gradient(180deg, #059669 0%, #047857 100%);
}

.btn-changes {
  background: linear-gradient(180deg, #d97706 0%, #b45309 100%);
  border-color: #92400e;
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(180, 83, 9, 0.2);
}
.btn-changes:hover:not(:disabled) {
  background: linear-gradient(180deg, #b45309 0%, #92400e 100%);
}

.btn-reject {
  background: linear-gradient(180deg, #e11d48 0%, #be123c 100%);
  border-color: #9f1239;
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(190, 18, 60, 0.2);
}
.btn-reject:hover:not(:disabled) {
  background: linear-gradient(180deg, #be123c 0%, #9f1239 100%);
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent-main);
  cursor: pointer;
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Alerts & Notifications
   -------------------------------------------------------------------------- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 16px;
}

.alert-warning {
  background-color: var(--changes-bg);
  border: 1px solid var(--changes-border);
  color: var(--changes-color);
}

.alert-danger {
  background-color: var(--rejected-bg);
  border: 1px solid var(--rejected-border);
  color: var(--rejected-color);
}

.alert-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.blocker-list {
  padding-left: 20px;
  margin-top: 4px;
}

.toast-container {
  position: fixed;
  top: 60px;
  right: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background-color: var(--text-main);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(-8px);
  transition: all 0.25s ease;
}

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

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

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

/* --------------------------------------------------------------------------
   Mobile Responsiveness
   -------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .app-header {
    height: auto;
    padding: 10px 14px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

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

  .queue-panel {
    width: 100%;
  }

  .detail-panel {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    background-color: var(--bg-app);
  }

  .detail-panel.mobile-active {
    display: flex;
  }

  .mobile-nav-bar {
    display: block;
  }

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

/* --------------------------------------------------------------------------
   Character Limit Meter
   -------------------------------------------------------------------------- */
.char-meter-container {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  min-width: 90px;
}

.char-meter-track {
  width: 100%;
  height: 4px;
  background-color: var(--bg-muted);
  border-radius: 2px;
  overflow: hidden;
}

.char-meter-bar {
  height: 100%;
  width: 0%;
  background-color: var(--accent-main);
  border-radius: 2px;
  transition: width 0.2s ease, background-color 0.2s ease;
}

.char-meter-bar.warn,
.char-meter-bar.near-limit {
  background-color: var(--changes-color);
}

.char-meter-bar.over,
.char-meter-bar.over-limit {
  background-color: var(--rejected-color);
}

/* --------------------------------------------------------------------------
   Keyboard Pill & Shortcuts Badges
   -------------------------------------------------------------------------- */
.header-kbd {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  background-color: var(--bg-muted);
  border: 1px solid var(--border-medium);
  border-radius: 3px;
  padding: 1px 5px;
  line-height: 1;
  color: var(--text-main);
  margin-right: 2px;
}

.key-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-medium);
  border-bottom-width: 2px;
  border-radius: var(--radius-sm);
  padding: 2px 7px;
  color: var(--text-main);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* --------------------------------------------------------------------------
   Tactile Copy State
   -------------------------------------------------------------------------- */
.btn-copy-label {
  display: inline;
}

.btn.copied {
  background-color: var(--approved-bg) !important;
  color: var(--approved-color) !important;
  border-color: var(--approved-border) !important;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* --------------------------------------------------------------------------
   Modal Dialogs
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.modal-dialog {
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-medium);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.15);
  width: 90%;
  max-width: 520px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalPop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  background-color: var(--bg-subtle);
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: var(--text-subtle);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.modal-close-btn:hover {
  color: var(--text-main);
  background-color: var(--bg-muted);
}

.modal-body {
  padding: 20px;
}

/* Shortcuts Table */
.shortcuts-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}

.shortcuts-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}

.shortcuts-table td:first-child {
  width: 140px;
}

.shortcuts-note {
  font-size: 12px;
  color: var(--text-subtle);
  font-style: italic;
  margin-top: 8px;
}

/* Export Modal Specifics */
.export-intro {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.4;
}

.export-options {
  margin-bottom: 16px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.export-preview-stats {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 12px;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Resolved Improvement Requests in History
   -------------------------------------------------------------------------- */
.resolved-requests-container {
  margin-bottom: 24px;
}

.resolved-request-card {
  background-color: var(--approved-bg);
  border: 1px solid var(--approved-border);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 10px;
}

.resolved-request-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.resolved-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--approved-color);
  background-color: #fff;
  border: 1px solid var(--approved-border);
  border-radius: var(--radius-sm);
  padding: 1px 6px;
}

.resolved-note {
  font-size: 12px;
  color: var(--approved-color);
  background: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  margin-top: 8px;
  border-left: 3px solid var(--approved-color);
}

/* --------------------------------------------------------------------------
   Confusing Action Button & Badges (F1 — Harmonized with Decision Bar)
   -------------------------------------------------------------------------- */
.btn-confusing {
  background-color: var(--changes-bg);
  color: var(--changes-color);
  border: 1px solid var(--changes-border);
  font-weight: 600;
}

.btn-confusing:hover:not(:disabled) {
  background-color: #fde68a;
  border-color: #d97706;
  color: #78350f;
}

.confusing-default-instruction {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 10px;
}

.instruction-lead {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.instruction-quote {
  font-size: 12.5px;
  color: var(--text-main);
  line-height: 1.45;
  margin: 4px 0 0;
  font-style: italic;
}

/* --------------------------------------------------------------------------
   Extended Editorial Context Ribbon (R8 — Attached Flush Under Meta Ribbon)
   -------------------------------------------------------------------------- */
.detail-context-ribbon {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 7px 14px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  margin-bottom: 16px;
  font-size: 12px;
}

.meta-tag {
  display: inline-block;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-medium);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-main);
}

/* --------------------------------------------------------------------------
   Manual Publish Drawer & Steps (F2)
   -------------------------------------------------------------------------- */
.btn-publish-trigger {
  background-color: var(--approved-bg);
  color: var(--approved-color);
  border: 1px solid var(--approved-border);
  font-weight: 600;
}

.btn-publish-trigger:hover {
  background-color: #bbf7d0;
}

.publish-drawer-header {
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 8px;
}

.publish-drawer-header h4 {
  margin: 0 0 4px;
  font-size: 15px;
  color: var(--text-main);
}

.publish-step-card {
  display: flex;
  gap: 12px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 12px;
}

.step-num {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  background-color: var(--accent-main);
  color: #fff;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  align-self: flex-start;
  line-height: 1.4;
}

.step-content {
  flex: 1;
}

.step-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.step-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 0 0 10px;
}

.step-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.publish-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

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

.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-subtle);
}

.form-input {
  width: 100%;
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface);
  color: var(--text-main);
}

.form-field-hint {
  font-size: 11px;
  color: var(--text-subtle);
}

.timing-mini-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  color: #166534;
  margin-top: 10px;
}

.timing-mini-title {
  font-weight: 700;
}

.timing-mini-note {
  font-size: 11px;
  color: #15803d;
  font-style: italic;
}

.pub-record-card {
  background-color: var(--approved-bg);
  border: 1px solid var(--approved-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 10px;
}

.link-live-post {
  color: var(--accent-main);
  text-decoration: underline;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Random 10 Screen (F3) & Sourced IST Guidance Panel (F4)
   -------------------------------------------------------------------------- */
.random-view {
  padding: 24px 32px 60px;
  max-width: 1080px;
  margin: 0 auto;
  width: 100%;
  overflow-y: auto;
  height: 100%;
}

.random-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-medium);
  margin-bottom: 16px;
}

.random-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 4px;
}

.random-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.random-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.random-filter-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-subtle);
}

.form-select-sm {
  padding: 5px 8px;
  font-size: 12px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface);
  color: var(--text-main);
}

.timing-guidance-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.timing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.timing-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-main);
}

.timing-heading {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.timing-badge {
  font-size: 11px;
  font-weight: 600;
  background-color: var(--bg-muted);
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 3px;
}

.timing-date {
  font-size: 11px;
  color: var(--text-subtle);
}

.timing-slots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.timing-slot-box {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timing-slot-box.primary {
  border-color: #86efac;
  background-color: #f0fdf4;
}

.timing-slot-box.comparison {
  border-color: #bae6fd;
  background-color: #f0f9ff;
}

.timing-slot-box.us-east {
  border-color: #e9d5ff;
  background-color: #faf5ff;
}

.slot-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.slot-time {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.slot-next {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-main);
}

.slot-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  margin: 4px 0 0;
  line-height: 1.35;
}

.timing-research-disclosure {
  font-size: 12px;
  margin-top: 8px;
}

.timing-research-summary {
  cursor: pointer;
  color: var(--accent-main);
  font-weight: 600;
}

.timing-research-body {
  padding-top: 8px;
  color: var(--text-main);
  line-height: 1.5;
}

.timing-sources-list {
  padding-left: 18px;
  margin: 6px 0;
}

.timing-sources-list li {
  margin-bottom: 4px;
}

.timing-sources-list a {
  color: var(--accent-main);
  text-decoration: underline;
}

.random-pool-info {
  margin-bottom: 12px;
  font-size: 12.5px;
  color: var(--text-subtle);
}

.random-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.random-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.random-card.random-card-approved {
  border-left: 4px solid var(--approved-color);
  background-color: #f7fdf9;
}

.random-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.random-card-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.random-card-body {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--bg-app);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  margin-bottom: 12px;
  white-space: pre-wrap;
}

.random-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
}

.btn-pick-post {
  background-color: var(--accent-main);
  color: #fff;
  font-weight: 600;
}

.btn-pick-post:hover {
  background-color: var(--accent-hover);
}

/* --------------------------------------------------------------------------
   Mobile Responsiveness Corrections (R9)
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .detail-content {
    padding: 12px 14px 40px !important;
  }

  .detail-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .detail-title-group {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 6px !important;
  }

  .detail-nav-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .char-meter-container {
    min-width: 70px !important;
  }

  .timing-slots-grid {
    grid-template-columns: 1fr !important;
  }

  .publish-form-grid {
    grid-template-columns: 1fr !important;
  }

  .random-view {
    padding: 12px 14px 40px !important;
  }
}


/* Desktop author editor: preserve whitespace and render only supported marks. */
.post-editor-panel {
  background: var(--bg-card);
  border: 1px solid var(--accent-main);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 14px rgba(44, 68, 94, 0.08);
  padding: 22px 26px;
  margin: 0 0 20px;
}
.post-editor-panel[hidden], #editor-conflict[hidden] { display: none; }
.editor-header-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.editor-mode-badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background-color: var(--accent-light);
  color: var(--accent-main);
  border: 1px solid var(--border-medium);
  white-space: nowrap;
}
.post-editor-panel h3 { margin: 0 0 4px; font-size: 15px; }
.post-editor-panel p { line-height: 1.5; margin: 4px 0 8px; font-size: 12.5px; color: var(--text-muted); }
.editor-toolbar { display: flex; align-items: center; gap: 8px; margin: 12px 0 10px; }
#editor-count { margin-left: auto; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-muted); }
.post-rich-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 4;
  font: inherit;
  font-size: 17px;
  line-height: 1.68;
}
#post-editor {
  min-height: 180px;
  padding: 16px 18px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
#post-editor:focus {
  outline: none;
  border-color: var(--accent-main);
  box-shadow: 0 0 0 3px rgba(44, 68, 94, 0.14);
}
#post-editor[contenteditable="false"] { opacity: .7; }
.editor-preview-wrap { margin: 12px 0; font-size: 12.5px; color: var(--text-muted); }
#editor-preview { padding: 12px 14px; background: var(--bg-app); border-radius: var(--radius-sm); margin-top: 6px; }
.editor-save-note { font-size: 12px; color: var(--text-muted); margin-bottom: 12px !important; }

/* Inline Shortcut KBD Pills, Tab Counters & Word-Level Diffs */
.btn-kbd {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  padding: 1px 4px;
  margin-left: 3px;
  border-radius: 3px;
  background-color: rgba(24, 24, 22, 0.07);
  border: 1px solid rgba(24, 24, 22, 0.14);
  color: inherit;
  opacity: 0.85;
}

.btn-kbd-light {
  background-color: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.32);
  color: #ffffff;
}

.drawer-shortcut-hint {
  margin-left: auto;
  align-self: center;
  font-size: 11.5px;
  color: var(--text-subtle);
}

.drawer-shortcut-hint kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  color: var(--text-main);
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tab-pill {
  display: inline-block;
  padding: 1px 6px;
  font-size: 10.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  border-radius: 999px;
  background-color: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}

.tab-btn.active .tab-pill {
  background-color: var(--accent-light);
  color: var(--accent-main);
  border-color: var(--border-medium);
}

.diff-inline-block {
  font-size: 13.5px;
  line-height: 1.6;
  padding: 10px 12px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
  margin-bottom: 8px;
}

.diff-token-del {
  background-color: var(--rejected-bg);
  color: var(--rejected-color);
  text-decoration: line-through;
  padding: 0 2px;
  border-radius: 2px;
}

.diff-token-ins {
  background-color: var(--approved-bg);
  color: var(--approved-color);
  text-decoration: none;
  font-weight: 500;
  padding: 0 2px;
  border-radius: 2px;
}

.diff-split-disclosure summary {
  font-size: 11.5px;
  color: var(--accent-main);
  cursor: pointer;
  user-select: none;
}

.diff-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.diff-side-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 4px;
}

.diff-before {
  color: var(--rejected-color);
}

.diff-after {
  color: var(--approved-color);
}

.export-snapshot-note {
  font-size: 11px;
  color: var(--text-subtle);
}

.inline-time-row {
  display: flex;
  gap: 6px;
}

.publish-confirm-check {
  margin-top: 10px;
}

.publish-concerns-sub {
  margin: 4px 0 8px;
  font-size: 12px;
}

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

/* Forced Colors Mode Accessibility Support */
@media (forced-colors: active) {
  .queue-card.active,
  .view-tab.active,
  .stat-pill.stat-pill-active,
  #post-editor:focus {
    outline: 2px solid Highlight;
  }
}

/* --------------------------------------------------------------------------
   Tactile Button & Card Microinteractions
   -------------------------------------------------------------------------- */
.btn {
  transition: transform 0.12s cubic-bezier(0.2, 0, 0, 1), background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease !important;
}

.btn:active:not(:disabled) {
  transform: scale(0.96) !important;
}

.queue-card {
  transition: transform 0.12s ease, border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease !important;
}

.queue-card:active {
  transform: scale(0.985) !important;
}

.queue-card.active {
  box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.08), inset 3px 0 0 var(--accent-main) !important;
}

/* Post body copy highlight pulse */
.detail-post-body {
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.copied-highlight-pulse {
  animation: copyGreenPulse 1.2s cubic-bezier(0.2, 0, 0, 1) forwards;
}

@keyframes copyGreenPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
    border-color: #22c55e;
  }
  30% {
    box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.22);
    border-color: #22c55e;
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

/* Header stat pill celebration pulse */
.stat-pulse-celebrate {
  animation: statGlowPulse 1.1s cubic-bezier(0.2, 0, 0, 1) forwards;
}

@keyframes statGlowPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  }
  35% {
    transform: scale(1.1);
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
    background-color: #dcfce7 !important;
    color: #15803d !important;
  }
  100% {
    transform: scale(1);
  }
}

/* Dice roll micro-animation */
.dice-spinning {
  display: inline-block;
  animation: diceWobble 0.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes diceWobble {
  0% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-35deg) scale(1.2); }
  50% { transform: rotate(180deg) scale(1.25); }
  75% { transform: rotate(325deg) scale(1.15); }
  100% { transform: rotate(360deg) scale(1); }
}

/* Action drawer slide & fade */
.action-drawer {
  animation: drawerSlideDown 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes drawerSlideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Sound toggle button */
#btn-toggle-sound {
  padding: 5px 8px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   Full-Screen Lottie-Style Celebration Overlay & Canvas
   -------------------------------------------------------------------------- */
.celebration-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 10001;
}

.celebration-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out;
}

.celebration-overlay.active {
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
}

.celebration-overlay.exiting {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-in;
}

.celebration-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.celebration-card {
  position: relative;
  z-index: 1;
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-medium, #e2e8f0);
  border-radius: 20px;
  padding: 32px 36px 26px;
  text-align: center;
  max-width: 440px;
  width: 88%;
  box-shadow:
    0 24px 48px -12px rgba(15, 23, 42, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.7) inset;
  transform: scale(0.8) translateY(24px);
  transition: transform 0.38s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: default;
}

.celebration-overlay.active .celebration-card {
  transform: scale(1) translateY(0);
}

.celebration-overlay.exiting .celebration-card {
  transform: scale(0.92) translateY(12px);
  transition: transform 0.18s ease-in;
}

/* Badge Wrap & Vector Animations */
.celebration-badge-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 16px;
  position: relative;
  height: 90px;
}

.vector-check-container {
  position: relative;
  width: 86px;
  height: 86px;
}

.vector-check-svg {
  width: 86px;
  height: 86px;
  filter: drop-shadow(0 4px 14px rgba(34, 197, 94, 0.4));
}

.vector-circle {
  stroke: #22c55e;
  stroke-dasharray: 270;
  stroke-dashoffset: 270;
  animation: drawCircle 0.45s ease-out 0.05s forwards;
}

.vector-check {
  stroke: #22c55e;
  stroke-dasharray: 70;
  stroke-dashoffset: 70;
  animation: drawCheck 0.32s cubic-bezier(0.65, 0, 0.45, 1) 0.24s forwards;
}

@keyframes drawCircle {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes drawCheck {
  to {
    stroke-dashoffset: 0;
  }
}

/* Vector Sparkles orbiting badge */
.vector-sparkle {
  position: absolute;
  color: #facc15;
  font-size: 14px;
  user-select: none;
  animation: sparkleOrbit 1.8s ease-out infinite;
}

.sparkle-1 { top: 2px; right: 6px; font-size: 16px; color: #22c55e; animation-delay: 0.1s; }
.sparkle-2 { bottom: 6px; left: 4px; font-size: 18px; color: #38bdf8; animation-delay: 0.25s; }
.sparkle-3 { top: 12px; left: 8px; font-size: 13px; color: #f59e0b; animation-delay: 0.4s; }
.sparkle-4 { bottom: 8px; right: 10px; font-size: 12px; color: #a855f7; animation-delay: 0.15s; }

@keyframes sparkleOrbit {
  0% { transform: scale(0) rotate(0deg); opacity: 0; }
  30% { transform: scale(1.3) rotate(30deg); opacity: 1; }
  70% { transform: scale(0.9) rotate(90deg); opacity: 0.9; }
  100% { transform: scale(0) rotate(180deg); opacity: 0; }
}

/* Vector Rocket (Publish Celebration) */
.vector-rocket-container {
  position: relative;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vector-rocket-icon {
  font-size: 46px;
  position: relative;
  z-index: 2;
  animation: rocketPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes rocketPop {
  0% { transform: scale(0.4) rotate(-20deg) translateY(20px); opacity: 0; }
  70% { transform: scale(1.2) rotate(10deg) translateY(-8px); opacity: 1; }
  100% { transform: scale(1) rotate(0deg) translateY(0); opacity: 1; }
}

.vector-ripple {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80px;
  height: 80px;
  margin-top: -40px;
  margin-left: -40px;
  border-radius: 50%;
  border: 2px solid #38bdf8;
  opacity: 0;
  pointer-events: none;
  animation: shockwaveRipple 1.4s ease-out infinite;
}

.vector-ripple.ripple-2 {
  animation-delay: 0.4s;
  border-color: #f59e0b;
}

@keyframes shockwaveRipple {
  0% { transform: scale(0.4); opacity: 0.9; }
  60% { transform: scale(1.6); opacity: 0.3; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Card Content Typography */
.celebration-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.3px;
  color: var(--text-main, #0f172a);
}

.celebration-subtitle {
  font-size: 13.5px;
  margin-bottom: 8px;
  color: var(--text-muted, #64748b);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.celebration-pill {
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  font-weight: 700;
  background: var(--bg-subtle, #f1f5f9);
  border: 1px solid var(--border-medium, #cbd5e1);
  border-radius: 4px;
  padding: 2px 7px;
  color: var(--text-main, #1e293b);
}

.celebration-pack {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-main, #2563eb);
}

.celebration-meta {
  font-size: 12.5px;
  color: var(--text-subtle, #94a3b8);
  margin: 0 0 16px;
  line-height: 1.4;
}

.celebration-action-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}

.celebration-link-btn {
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.celebration-dismiss-hint {
  font-size: 11px;
  color: var(--text-subtle, #94a3b8);
  margin-top: 4px;
  letter-spacing: 0.2px;
}

/* Prefers-reduced-motion overrides */
@media (prefers-reduced-motion: reduce) {
  .celebration-card,
  .vector-circle,
  .vector-check,
  .vector-rocket-icon,
  .vector-ripple,
  .vector-sparkle,
  .dice-spinning,
  .stat-pulse-celebrate,
  .copied-highlight-pulse {
    animation: none !important;
    transition: opacity 0.15s ease !important;
    transform: none !important;
  }
  .celebration-canvas {
    display: none !important;
  }
}

/* --------------------------------------------------------------------------
   Linear / Superhuman Studio Command Palette (⌘K) & Inspector Refinements
   -------------------------------------------------------------------------- */
.detail-context-ribbon {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px 10px !important;
  padding: 10px 14px !important;
  background-color: var(--bg-subtle) !important;
  border: none !important;
  border-radius: 0 !important;
  margin-bottom: 0 !important;
  font-size: 11px !important;
}

.detail-context-ribbon .meta-item {
  flex-direction: row;
  align-items: center;
  gap: 4px;
}

.command-palette-backdrop {
  align-items: flex-start;
  padding-top: 11vh;
  background-color: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.command-palette-dialog {
  width: 92%;
  max-width: 580px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: 14px;
  box-shadow: var(--shadow-elevated);
  overflow: hidden;
  animation: modalPop 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

.command-palette-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
}

.cmd-search-icon {
  color: var(--accent-main);
  flex-shrink: 0;
}

.command-palette-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 14.5px;
  color: var(--text-main);
}

.cmd-esc-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 4px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-subtle);
  cursor: pointer;
}

.command-palette-list {
  max-height: 340px;
  overflow-y: auto;
  padding: 6px;
}

.command-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-main);
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.1s ease;
}

.command-item-active,
.command-item:hover {
  background-color: var(--accent-light);
  color: var(--accent-main);
}

.command-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.command-item-group {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-subtle);
  white-space: nowrap;
}

.command-item-label {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.command-item-kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  flex-shrink: 0;
}

.command-empty {
  padding: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-subtle);
}

.command-palette-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  padding: 8px 14px;
  background-color: var(--bg-subtle);
  border-top: 1px solid var(--border-light);
  font-size: 11px;
  color: var(--text-subtle);
}

.command-palette-footer kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 3px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  color: var(--text-main);
}

/* --------------------------------------------------------------------------
   Zero-Trust Studio Security Gate & Admin Access Control (Neon Auth)
   -------------------------------------------------------------------------- */
.status-dot-pending {
  background-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
}

.auth-role-pill {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 1px 5px;
  border-radius: 4px;
  background-color: var(--primary-soft);
  color: var(--primary-color);
  border: 1px solid var(--primary-border);
}

.auth-pending-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background-color: #f59e0b;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.studio-security-gate {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background-color: var(--bg-app);
  background-image: radial-gradient(var(--canvas-dot) 1px, transparent 1px);
  background-size: 18px 18px;
  overflow-y: auto;
}

.security-gate-card {
  width: 100%;
  max-width: 450px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 28px;
}

.security-gate-card-minimal {
  max-width: 390px;
  padding: 36px 32px;
}

.auth-gate-minimal {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.security-emblem-centered {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.security-gate-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 18px;
}

.security-shield-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 3px 9px;
  border-radius: 999px;
  background-color: var(--primary-soft);
  color: var(--primary-color);
  border: 1px solid var(--primary-border);
}

.security-branch-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-subtle);
}

.security-gate-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}

.security-emblem {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  flex-shrink: 0;
}

.security-gate-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin: 0 0 4px 0;
}

.security-gate-subtitle {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-muted);
  margin: 0;
}

.btn-google-oauth {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: all 0.14s ease;
}

.btn-google-oauth:hover:not(:disabled) {
  background-color: var(--bg-subtle);
  border-color: var(--primary-color);
  box-shadow: var(--shadow-sm);
}

.btn-google-oauth:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.security-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-subtle);
}

.security-divider::before,
.security-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: var(--border-light);
}

.security-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 3px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
}

.security-mode-tab {
  border: none;
  background: transparent;
  padding: 6px 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.security-mode-tab.active {
  background-color: var(--bg-surface);
  color: var(--text-main);
  box-shadow: var(--shadow-xs);
}

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

.security-submit-btn {
  width: 100%;
  justify-content: center;
  padding: 10px 16px;
  font-size: 13.5px;
  margin-top: 4px;
}

.security-footer-note {
  margin: 16px 0 0 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-subtle);
  text-align: center;
}

.security-gate-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.security-gate-icon-amber {
  background-color: var(--changes-bg);
  color: var(--changes-color);
  border: 1px solid var(--changes-border);
}

.security-identity-box {
  margin: 16px 0;
  padding: 12px 14px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.security-identity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
}

.security-identity-label {
  color: var(--text-muted);
  font-weight: 500;
}

.security-gate-note {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0 0 18px 0;
}

.security-gate-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.modal-dialog-wide {
  max-width: 720px;
}

.admin-access-panel {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
  background-color: var(--bg-surface);
}

.admin-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.admin-panel-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 2px 0;
}

.admin-panel-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

.admin-counts-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-invite-form {
  display: grid;
  grid-template-columns: 1.4fr 1fr 110px auto;
  gap: 8px;
  align-items: end;
  padding: 10px 12px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

@media (max-width: 680px) {
  .admin-invite-form {
    grid-template-columns: 1fr;
  }
}

.admin-invite-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.form-input-sm {
  padding: 6px 9px;
  font-size: 12.5px;
}

.admin-users-table-wrap {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}

.admin-users-table th,
.admin-users-table td {
  padding: 8px 10px;
  font-size: 12px;
  vertical-align: middle;
}

.admin-user-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-user-email {
  font-size: 11px;
  color: var(--text-muted);
}

.admin-user-notes {
  font-size: 10.5px;
  color: var(--text-subtle);
}

.admin-locked-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-color);
}

.admin-action-btns {
  display: flex;
  gap: 6px;
}



