/* AustinSS Blogs Design System */
:root {
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-light: #eff6ff;
  --color-bg: #ffffff;
  --color-surface: #f8fafc;
  --color-surface-hover: #f1f5f9;
  --color-border: #e2e8f0;
  --color-text: #0f172a;
  --color-text-muted: #64748b;
  --color-text-inverse: #ffffff;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --max-width: 1200px;
  --content-width: 800px;
  --header-height: 70px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --transition: all 0.2s ease-in-out;
}

[data-theme="dark"] {
  --color-bg: #0b0f19;
  --color-surface: #111827;
  --color-surface-hover: #1f2937;
  --color-border: #1f2937;
  --color-text: #f8fafc;
  --color-text-muted: #94a3b8;
  --color-primary-light: #1e3a8a;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: var(--transition);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(8px);
}

.header-container {
  max-width: var(--max-width);
  height: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
}

.brand-badge {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-item a {
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: 0.95rem;
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle-btn {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.theme-toggle-btn:hover {
  background: var(--color-surface-hover);
}

.main-content {
  flex: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  padding: 2.5rem 1.5rem;
  margin-top: auto;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
  font-size: 0.875rem;
}

.footer-draft-prompt {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px dashed var(--color-border);
  width: 100%;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.footer-draft-text {
  margin: 0;
}

.footer-draft-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-draft-link {
  color: var(--color-text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  transition: var(--transition);
}

.footer-draft-link:hover {
  color: var(--color-primary);
}

.footer-draft-primary {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
}

.footer-draft-primary:hover {
  text-decoration: underline;
}

.footer-draft-sep {
  color: var(--color-border);
  font-size: 0.75rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.5rem;
  list-style: none;
  padding: 0;
}

.footer-links a {
  color: var(--color-text-muted);
}

.footer-links a:hover {
  color: var(--color-primary);
}

.error-card {
  max-width: 600px;
  margin: 4rem auto;
  text-align: center;
  padding: 3rem 2rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.error-code {
  font-size: 5rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: 1rem;
}

.error-title {
  font-size: 1.75rem;
  margin-bottom: 1rem;
  color: var(--color-text);
}

.error-desc {
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

.btn-primary {
  display: inline-block;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  color: var(--color-text-inverse);
}

/* Hero Section & Search */
.hero-section {
  text-align: center;
  padding: 3rem 1rem 2.5rem;
  background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-bg) 100%);
  border-radius: var(--radius-lg);
  margin-bottom: 3rem;
  border: 1px solid var(--color-border);
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--color-text-muted);
  max-width: 680px;
  margin: 0 auto 2rem;
}

.search-form {
  max-width: 640px;
  margin: 0 auto 1.5rem;
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.5rem 0.35rem 1rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.search-input-wrapper:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.search-icon {
  margin-right: 0.75rem;
  font-size: 1.1rem;
  opacity: 0.6;
}

.search-input {
  flex: 1;
  min-width: 0; /* let the field shrink so the button stays inside narrow screens */
  border: none;
  background: transparent;
  color: var(--color-text);
  font-size: 1rem;
  outline: none;
  font-family: inherit;
}

.btn-search {
  flex-shrink: 0;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border: none;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-search:hover {
  background: var(--color-primary-hover);
}

/* Category Filter Pills */
.category-pills {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pills-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
}

.category-pill {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  transition: var(--transition);
}

.category-pill:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* Posts Grid & Cards */
.posts-section {
  margin-bottom: 4rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 1rem;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
}

.posts-count {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
}

.post-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}

.card-cover-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 1px solid var(--color-border);
}

.card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.badge-category {
  display: inline-block;
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
}

.card-reading-time {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.card-title {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

.card-title a {
  color: var(--color-text);
}

.card-title a:hover {
  color: var(--color-primary);
}

.card-excerpt {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
  flex: 1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

.tag-pill {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}

.tag-pill:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.85rem;
}

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

.author-avatar-placeholder {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
}

.card-date {
  color: var(--color-text-muted);
}

/* Pagination */
.pagination-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 3.5rem;
}

.btn-pagination {
  padding: 0.5rem 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-weight: 600;
  font-size: 0.9rem;
}

.btn-pagination:hover:not(.disabled) {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-color: var(--color-primary);
}

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

.pagination-status {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  background: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
  max-width: 600px;
  margin: 2rem auto;
}

.empty-state h3 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--color-text-muted);
}

/* Article Detail Layout */
.article-container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 1rem 0 4rem;
}

.article-breadcrumbs {
  display: flex;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
}

.article-title {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.article-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 2rem;
}

.meta-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.author-details {
  display: flex;
  flex-direction: column;
}

.author-role {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.meta-stats {
  display: flex;
  gap: 1.25rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.article-cover-img {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 2.5rem;
  border: 1px solid var(--color-border);
}

/* Audio Player Card & Controls */
.audio-player-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.player-branding {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.player-badge {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--color-primary);
}

.player-voice-tag {
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}

.player-reading-est {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-audio-play {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition);
  flex-shrink: 0;
}

.btn-audio-play:hover {
  background: var(--color-primary-hover);
  transform: scale(1.05);
}

.btn-audio-control {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.btn-audio-control:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-audio-speed {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  min-width: 48px;
  text-align: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.btn-audio-speed:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.player-progress-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.time-label {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--color-text-muted);
  min-width: 32px;
}

.audio-seek-slider {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--color-border);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.audio-seek-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.audio-seek-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Fallback & Client-Side Speech Box ("Listen to Article") */
.player-fallback-box {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.fallback-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.fallback-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.fallback-text {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.speech-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  background: var(--color-bg);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.speech-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-text-muted);
}

.speech-status-indicator.playing .speech-status-dot {
  background: var(--color-success);
  box-shadow: 0 0 6px var(--color-success);
  animation: pulse-dot 1.5s infinite;
}

.speech-status-indicator.paused .speech-status-dot {
  background: var(--color-warning);
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.speech-reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.speech-controls-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.btn-speech-action {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  transition: var(--transition);
}

.btn-speech-action:hover:not(:disabled) {
  background: var(--color-surface-hover);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-speech-action.play {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-color: var(--color-primary);
}

.btn-speech-action.play:hover:not(:disabled) {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  color: var(--color-text-inverse);
}

.btn-speech-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.speech-voice-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.speech-voice-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.speech-voice-select {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
  font-size: 0.78rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  max-width: 220px;
  outline: none;
  transition: var(--transition);
}

.speech-voice-select:hover {
  border-color: var(--color-primary);
}

.speech-voice-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-soft, rgba(0, 113, 227, 0.2));
}

.speech-speed-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.speech-speed-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.speed-pill-group {
  display: inline-flex;
  align-items: center;
  background: var(--color-surface);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  height: 32px;
  box-sizing: border-box;
}

.btn-speed-pill {
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-speed-pill:hover {
  color: var(--color-text);
}

.btn-speed-pill.active {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

.speech-volume-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
  min-width: 0;
  height: 32px;
  box-sizing: border-box;
  padding-left: 0.75rem;
  border-left: 1px solid var(--color-border);
}

.speech-volume-icon {
  font-size: 0.95rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  color: var(--color-text-muted);
}

.speech-volume-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.speech-volume-slider {
  appearance: none;
  -webkit-appearance: none;
  width: 140px;
  flex: 0 1 140px; /* may shrink on narrow screens */
  min-width: 60px;
  height: 6px;
  background: rgba(120, 120, 128, 0.24);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
  transition: background 0.2s;
  vertical-align: middle;
}

[data-theme="dark"] .speech-volume-slider {
  background: rgba(255, 255, 255, 0.2);
}

.speech-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  border: 2.5px solid var(--color-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.speech-volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.speech-volume-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  border: 2.5px solid var(--color-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.speech-volume-slider::-moz-range-progress {
  background: var(--color-primary);
  border-radius: 999px;
  height: 6px;
}

.speech-volume-display {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  min-width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Speech Reader Active Sentence Highlighting */
::highlight(speech-active-sentence) {
  background-color: rgba(0, 113, 227, 0.25);
  color: inherit;
}

[data-theme="dark"] ::highlight(speech-active-sentence) {
  background-color: rgba(41, 151, 255, 0.38);
  color: inherit;
}

mark.speech-active-sentence {
  background-color: rgba(0, 113, 227, 0.25);
  color: inherit;
  border-radius: 3px;
  padding: 1px 3px;
}

[data-theme="dark"] mark.speech-active-sentence {
  background-color: rgba(41, 151, 255, 0.38);
}

.speech-reading-block {
  position: relative;
  transition: background-color 0.25s ease;
}

.speech-reading-block::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 4px;
  bottom: 4px;
  width: 3.5px;
  border-radius: 2px;
  background: var(--color-primary);
}

.btn-sm {
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
}

/* Prose Typography */
.prose {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--color-text);
}

.prose h1, .prose h2, .prose h3, .prose h4 {
  color: var(--color-text);
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.prose h2 { font-size: 1.85rem; border-bottom: 1px solid var(--color-border); padding-bottom: 0.5rem; }
.prose h3 { font-size: 1.45rem; }
.prose p { margin-bottom: 1.5rem; }
.prose ul, .prose ol { margin: 0 0 1.5rem 1.5rem; }
.prose li { margin-bottom: 0.5rem; }
.prose blockquote {
  border-left: 4px solid var(--color-primary);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--color-surface);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--color-text-muted);
  font-style: italic;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.95rem;
}

.prose th, .prose td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  text-align: left;
}

.prose th {
  background: var(--color-surface);
  font-weight: 700;
}

.prose pre {
  background: #1e293b;
  color: #f8fafc;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 1.75rem 0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.5;
}

.prose code {
  overflow-wrap: anywhere; /* long inline identifiers must not widen the page on phones */
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--color-surface);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.prose pre code {
  background: transparent;
  padding: 0;
  border: none;
  color: inherit;
}

/* Pygments Token Highlighting */
.prose pre .k { color: #f472b6; font-weight: 600; } /* keyword */
.prose pre .nf { color: #60a5fa; font-weight: 600; } /* function */
.prose pre .s, .prose pre .s2 { color: #34d399; } /* string */
.prose pre .mi { color: #fbbf24; } /* number */
.prose pre .o { color: #94a3b8; } /* operator */
.prose pre .c1 { color: #64748b; font-style: italic; } /* comment */
.prose pre .nb { color: #38bdf8; } /* built-in */

/* Article Footer, Share & Author */
.article-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.article-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.tags-label {
  font-weight: 600;
  font-size: 0.9rem;
}

.share-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  background: var(--color-surface);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  margin-bottom: 2.5rem;
  border: 1px solid var(--color-border);
}

.share-label {
  font-weight: 600;
  font-size: 0.95rem;
}

.share-buttons {
  display: flex;
  gap: 0.75rem;
}

.btn-share {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-share:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.author-box {
  display: flex;
  gap: 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2.5rem;
}

.author-avatar-large {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.author-bio h4 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.author-bio p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.back-nav {
  text-align: center;
}

.btn-back {
  font-weight: 600;
  font-size: 1rem;
}

/* Archive & Search Headers */
.archive-header, .search-header {
  text-align: center;
  padding: 2rem 1rem;
  margin-bottom: 2.5rem;
}

.archive-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.archive-subtitle, .search-summary {
  font-size: 1.1rem;
  color: var(--color-text-muted);
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .hero-title {
    font-size: 2.1rem;
  }

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

  .article-title {
    font-size: 2rem;
  }
}

/* Authentication & Login UI */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4rem 1.5rem;
  min-height: 70vh;
}

.auth-card {
  max-width: 480px;
  width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-badge {
  display: inline-block;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.auth-title {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

.alert {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

[data-theme="dark"] .alert-error {
  background: #450a0a;
  border-color: #7f1d1d;
  color: #fca5a5;
}

.sso-buttons-group {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 100%;
}

.btn-sso {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  width: 100%;
  padding: 0.8rem 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--color-text);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-sso:hover {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.btn-sso svg {
  flex-shrink: 0;
}

.sso-disabled-note {
  text-align: center;
  padding: 0.75rem;
  background: var(--color-bg);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.auth-divider {
  position: relative;
  text-align: center;
  margin: 2rem 0;
  border-bottom: 1px solid var(--color-border);
}

.auth-divider span {
  position: relative;
  top: 10px;
  background: var(--color-surface);
  padding: 0 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}

.dev-hint {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
  text-align: center;
}

.persona-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn-persona {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0.85rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
  width: 100%;
}

.btn-persona:hover {
  border-color: var(--color-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.persona-role {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.35rem;
}

.btn-persona-admin .persona-role {
  background: #fef3c7;
  color: #92400e;
}

.btn-persona-editor .persona-role {
  background: #ede9fe;
  color: #5b21b6;
}

.btn-persona-author .persona-role {
  background: #e0f2fe;
  color: #0369a1;
}

[data-theme="dark"] .btn-persona-admin .persona-role {
  background: #78350f;
  color: #fef3c7;
}

[data-theme="dark"] .btn-persona-editor .persona-role {
  background: #4c1d95;
  color: #ede9fe;
}

[data-theme="dark"] .btn-persona-author .persona-role {
  background: #075985;
  color: #e0f2fe;
}

.persona-email {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text);
}

.persona-desc {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* Development Login Section */
.dev-login-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.dev-login-badge-bar {
  display: flex;
  justify-content: center;
  margin-bottom: 0.25rem;
}

.badge-dev-only {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

[data-theme="dark"] .badge-dev-only {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
}

.dev-role-cards {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
}

.dev-role-form {
  margin: 0;
  width: 100%;
}

.btn-dev-role {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.btn-dev-role:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-dev-admin:hover {
  border-color: #d97706;
  background: rgba(245, 158, 11, 0.06);
}

.btn-dev-editor:hover {
  border-color: #7c3aed;
  background: rgba(124, 58, 237, 0.06);
}

.btn-dev-author:hover {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.06);
}

.dev-role-btn-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text);
}

.btn-dev-admin .dev-role-btn-title {
  color: #b45309;
}

[data-theme="dark"] .btn-dev-admin .dev-role-btn-title {
  color: #fbbf24;
}

.btn-dev-editor .dev-role-btn-title {
  color: #6d28d9;
}

[data-theme="dark"] .btn-dev-editor .dev-role-btn-title {
  color: #a78bfa;
}

.btn-dev-author .dev-role-btn-title {
  color: #1d4ed8;
}

[data-theme="dark"] .btn-dev-author .dev-role-btn-title {
  color: #60a5fa;
}

.dev-role-btn-email {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.auth-footer {
  margin-top: 2rem;
  border-top: 1px solid var(--color-border);
  padding-top: 1.5rem;
  text-align: center;
}

.security-notice {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.back-link {
  font-size: 0.9rem;
  font-weight: 600;
}

/* User Profile Navbar elements */
.nav-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-badge-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text);
}

.user-avatar-sm {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.btn-nav-signin {
  padding: 0.35rem 0.85rem;
  background: var(--color-primary);
  color: var(--color-text-inverse) !important;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition);
}

.btn-nav-signin:hover {
  background: var(--color-primary-hover);
}

.btn-nav-logout {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.35rem;
  font-weight: 500;
  transition: var(--transition);
}

.btn-nav-logout:hover {
  color: var(--color-error);
}

/* Author Dashboard & Post Operations */
.dashboard-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  width: 100%;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.dashboard-role-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  background: var(--color-primary-light);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}

.dashboard-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
}

.dashboard-subtitle {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

.btn-new-post {
  padding: 0.65rem 1.25rem;
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-text);
  line-height: 1.1;
}

.stat-published { color: var(--color-success); }
.stat-drafts { color: var(--color-warning); }
.stat-archived { color: var(--color-error); }

.tabs-bar {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.tab-link {
  padding: 0.6rem 1.25rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
}

.tab-link:hover {
  color: var(--color-primary);
}

.tab-link.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.table-container {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.dashboard-table th {
  padding: 0.85rem 1.25rem;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
}

.dashboard-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.col-title {
  max-width: 320px;
}

.post-edit-link {
  font-weight: 700;
  color: var(--color-text);
  font-size: 0.95rem;
}

.post-edit-link:hover {
  color: var(--color-primary);
}

.post-slug-hint {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 0.2rem;
}

.author-cell {
  font-weight: 500;
}

.col-date {
  color: var(--color-text-muted);
  white-space: nowrap;
  font-size: 0.85rem;
}

.col-actions {
  text-align: right;
  white-space: nowrap;
}

.action-buttons {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
}

.btn-action {
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}

.btn-action:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-action-publish {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-action-delete {
  color: var(--color-error);
}

.btn-action-delete:hover {
  background: #fef2f2;
  border-color: var(--color-error);
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-published {
  background: #dcfce7;
  color: #15803d;
}

.badge-draft {
  background: #fef3c7;
  color: #b45309;
}

.badge-archived {
  background: #fee2e2;
  color: #b91c1c;
}

[data-theme="dark"] .badge-published { background: #14532d; color: #bbf7d0; }
[data-theme="dark"] .badge-draft { background: #78350f; color: #fde68a; }
[data-theme="dark"] .badge-archived { background: #7f1d1d; color: #fecaca; }

.empty-dashboard {
  text-align: center;
  padding: 4rem 1.5rem;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* Reviewer Feedback Panel on Dashboard & Editor */
.feedback-badge-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-warning, #f59e0b);
  background: rgba(245, 158, 11, 0.12);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm, 4px);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.feedback-badge-dot {
  font-size: 0.65rem;
  color: var(--color-warning, #f59e0b);
}

.feedback-subrow td.feedback-subrow-cell {
  padding: 0 1.25rem 1.25rem 1.25rem;
  border-top: none;
  background: transparent;
}

.reviewer-feedback-panel {
  background: var(--color-surface, #111827);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-left: 4px solid var(--color-warning, #f59e0b);
  border-radius: var(--radius-md, 8px);
  padding: 1.15rem 1.4rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  transition: var(--transition);
}

[data-theme="dark"] .reviewer-feedback-panel {
  background: #111827;
  border-color: rgba(245, 158, 11, 0.35);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.feedback-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-bottom: 0.65rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(245, 158, 11, 0.2);
}

.feedback-panel-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.feedback-panel-title h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text, #f8fafc);
  letter-spacing: -0.01em;
}

.feedback-panel-icon {
  font-size: 1.1rem;
}

.feedback-reviewer-tag {
  display: inline-block;
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-warning, #f59e0b);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.feedback-timestamp {
  font-size: 0.8rem;
  color: var(--color-text-muted, #94a3b8);
}

.feedback-panel-body {
  font-size: 0.925rem;
  line-height: 1.7;
  color: var(--color-text, #e2e8f0);
  word-break: break-word;
  padding: 0.25rem 0 0.5rem 0;
}

.feedback-panel-body p {
  margin: 0 0 0.75rem 0;
}

.feedback-panel-body p:last-child {
  margin-bottom: 0;
}

.feedback-panel-body ol,
.feedback-panel-body ul {
  margin: 0.5rem 0 0.85rem 1.4rem;
  padding: 0;
}

.feedback-panel-body li {
  margin-bottom: 0.45rem;
}

.feedback-panel-body strong {
  color: var(--color-warning, #f59e0b);
}

.feedback-panel-body a {
  color: var(--color-primary, #3b82f6);
  text-decoration: underline;
  font-weight: 600;
}

.feedback-panel-body a:hover {
  color: var(--color-warning, #f59e0b);
}

.feedback-panel-footer {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  display: flex;
  justify-content: flex-end;
}

.btn-revise-action {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--color-warning, #f59e0b);
  color: #0b0f19;
  border: none;
  border-radius: var(--radius-sm, 4px);
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-revise-action:hover {
  background: #d97706;
  color: #ffffff;
  transform: translateY(-1px);
}

/* Editor Feedback Banner */
.editor-feedback-banner {
  background: var(--color-surface, #111827);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-left: 4px solid var(--color-warning, #f59e0b);
  border-radius: var(--radius-md, 8px);
  padding: 1.15rem 1.4rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.feedback-banner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-bottom: 0.65rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(245, 158, 11, 0.2);
}

.feedback-banner-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text, #f8fafc);
}

.feedback-banner-time {
  font-size: 0.8rem;
  color: var(--color-text-muted, #94a3b8);
}

.feedback-banner-body {
  font-size: 0.925rem;
  line-height: 1.7;
  color: var(--color-text, #e2e8f0);
  word-break: break-word;
}

.feedback-banner-body p {
  margin: 0 0 0.75rem 0;
}

.feedback-banner-body p:last-child {
  margin-bottom: 0;
}

.feedback-banner-body ol,
.feedback-banner-body ul {
  margin: 0.5rem 0 0.85rem 1.4rem;
  padding: 0;
}

.feedback-banner-body li {
  margin-bottom: 0.45rem;
}

.feedback-banner-body strong {
  color: var(--color-warning, #f59e0b);
}

.feedback-banner-body a {
  color: var(--color-primary, #3b82f6);
  text-decoration: underline;
  font-weight: 600;
}

.feedback-banner-body a:hover {
  color: var(--color-warning, #f59e0b);
}

/* Editor Interface */
.editor-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
}

.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.btn-back-dashboard {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-muted);
  display: inline-block;
  margin-bottom: 0.35rem;
}

.editor-title {
  font-size: 1.75rem;
  font-weight: 800;
}

.editor-header-actions {
  display: flex;
  gap: 0.75rem;
}

.editor-layout {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 2rem;
}

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

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--color-text);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  background: var(--color-bg);
  color: var(--color-text);
  transition: var(--transition);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-input-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.form-textarea-code {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.6;
  resize: vertical;
}

.field-hint {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 0.35rem;
  display: block;
}

.editor-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 0.4rem 0.85rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: var(--transition);
}

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

.tab-btn.active {
  background: var(--color-surface);
  color: var(--color-primary);
}

.editor-toolbar {
  margin-left: auto;
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.tool-btn {
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.tool-btn:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-primary);
}

.preview-pane {
  min-height: 480px;
  padding: 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow-y: auto;
}

.sidebar-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.sidebar-title {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.75rem;
}

.sidebar-info-box {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.85rem;
}

.info-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

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

.info-val {
  font-weight: 600;
}

/* Draft Preview Mode Banner */
.preview-mode-banner {
  background: #fffbeb;
  border: 1px solid #fef3c7;
  border-left: 5px solid #f59e0b;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

[data-theme="dark"] .preview-mode-banner {
  background: #451a03;
  border-color: #78350f;
  border-left-color: #f59e0b;
  color: #fef3c7;
}

.preview-mode-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.preview-badge {
  background: #f59e0b;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
}

.preview-mode-actions {
  display: flex;
  gap: 0.75rem;
}

.btn-preview-action {
  padding: 0.4rem 0.85rem;
  background: #f59e0b;
  color: #ffffff !important;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  transition: var(--transition);
}

.btn-preview-action:hover {
  background: #d97706;
}

.btn-preview-action.secondary {
  background: var(--color-bg);
  color: var(--color-text) !important;
  border: 1px solid var(--color-border);
}

.btn-preview-action.secondary:hover {
  border-color: var(--color-primary);
}

/* ==========================================================================
   Editorial Workflow & Review Queue
   ========================================================================== */
.stat-in-review {
  color: #3b82f6;
}

.stat-changes {
  color: #ef4444;
}

.badge-in-review {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.badge-changes-requested {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.btn-action-submit-review {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.btn-action-submit-review:hover {
  background: #2563eb;
  color: #ffffff;
}

.btn-action-review {
  background: #fef3c7;
  color: #d97706;
  border: 1px solid #fde68a;
  font-weight: 600;
}

.btn-action-review:hover {
  background: #d97706;
  color: #ffffff;
}

.review-page-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 2rem 4rem;
}

.review-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.review-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2.5rem;
  align-items: start;
}

@media (max-width: 1024px) {
  .review-layout {
    grid-template-columns: 1fr;
  }
}

.review-main-content {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 2.5rem;
}

.review-sidebar {
  position: sticky;
  top: 1.5rem;
}

.decision-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.decision-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.decision-subtitle {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

.decision-section {
  margin-bottom: 1.25rem;
}

.decision-section h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.decision-hint {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 0.85rem;
  line-height: 1.4;
}

.decision-divider {
  border: 0;
  height: 1px;
  background: var(--color-border);
  margin: 1.5rem 0;
}

.btn-approve {
  width: 100%;
  padding: 0.75rem;
  font-weight: 700;
  font-size: 0.95rem;
  justify-content: center;
  background: #10b981;
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.btn-approve:hover {
  background: #059669;
}

.btn-reject {
  width: 100%;
  padding: 0.75rem;
  font-weight: 700;
  font-size: 0.95rem;
  justify-content: center;
  background: #ef4444;
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.btn-reject:hover {
  background: #dc2626;
}

/* Topics & Taxonomy Page */
.topics-categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.topic-category-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.topic-category-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.topic-cat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.topic-cat-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

.topic-cat-title a {
  color: var(--color-text);
  text-decoration: none;
}

.topic-cat-title a:hover {
  color: var(--color-primary);
}

.topic-cat-desc {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  flex: 1;
}

.topic-cat-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.topic-cat-link:hover {
  text-decoration: underline;
}

.taxonomy-groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.taxonomy-group-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.taxonomy-group-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.5rem;
}

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

.tech-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.15s ease-in-out;
}

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

/* Category-Themed Chip & Pill Accents */
.tech-chip--cloud-platforms {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}
.tech-chip--cloud-platforms:hover {
  background: #dcfce7;
  border-color: #86efac;
  color: #14532d;
  box-shadow: 0 2px 6px rgba(22, 101, 52, 0.15);
}

.tech-chip--languages-frameworks {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}
.tech-chip--languages-frameworks:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e3a8a;
  box-shadow: 0 2px 6px rgba(30, 64, 175, 0.15);
}

.tech-chip--ai-platforms-tools {
  background: #faf5ff;
  border-color: #e9d5ff;
  color: #6b21a8;
}
.tech-chip--ai-platforms-tools:hover {
  background: #f3e8ff;
  border-color: #d8b4fe;
  color: #581c87;
  box-shadow: 0 2px 6px rgba(107, 33, 168, 0.15);
}

.tech-chip--devops-iac {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}
.tech-chip--devops-iac:hover {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #78350f;
  box-shadow: 0 2px 6px rgba(146, 64, 14, 0.15);
}

.tech-chip--security-networking {
  background: #fdf2f8;
  border-color: #fbcfe8;
  color: #9d174d;
}
.tech-chip--security-networking:hover {
  background: #fce7f3;
  border-color: #f472b6;
  color: #831843;
  box-shadow: 0 2px 6px rgba(157, 23, 77, 0.15);
}

/* Dark Mode Harmonization */
[data-theme="dark"] .tech-chip--cloud-platforms {
  background: rgba(22, 101, 52, 0.2);
  border-color: rgba(34, 197, 94, 0.35);
  color: #86efac;
}
[data-theme="dark"] .tech-chip--cloud-platforms:hover {
  background: rgba(22, 101, 52, 0.35);
  border-color: #4ade80;
  color: #bbf7d0;
}

[data-theme="dark"] .tech-chip--languages-frameworks {
  background: rgba(30, 64, 175, 0.2);
  border-color: rgba(59, 130, 246, 0.35);
  color: #93c5fd;
}
[data-theme="dark"] .tech-chip--languages-frameworks:hover {
  background: rgba(30, 64, 175, 0.35);
  border-color: #60a5fa;
  color: #bfdbfe;
}

[data-theme="dark"] .tech-chip--ai-platforms-tools {
  background: rgba(107, 33, 168, 0.2);
  border-color: rgba(168, 85, 247, 0.35);
  color: #d8b4fe;
}
[data-theme="dark"] .tech-chip--ai-platforms-tools:hover {
  background: rgba(107, 33, 168, 0.35);
  border-color: #c084fc;
  color: #e9d5ff;
}

[data-theme="dark"] .tech-chip--devops-iac {
  background: rgba(146, 64, 14, 0.2);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fde68a;
}
[data-theme="dark"] .tech-chip--devops-iac:hover {
  background: rgba(146, 64, 14, 0.35);
  border-color: #fbbf24;
  color: #fef3c7;
}

[data-theme="dark"] .tech-chip--security-networking {
  background: rgba(157, 23, 77, 0.2);
  border-color: rgba(236, 72, 153, 0.35);
  color: #fbcfe8;
}
[data-theme="dark"] .tech-chip--security-networking:hover {
  background: rgba(157, 23, 77, 0.35);
  border-color: #f472b6;
  color: #fce7f3;
}

.all-tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.tag-pill-large {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 9999px;
  font-size: 0.9rem;
  color: var(--color-text);
  text-decoration: none;
  transition: var(--transition);
}

.tag-pill-large:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.tag-badge {
  display: inline-block;
  background: var(--color-bg);
  border-radius: 9999px;
  padding: 0.1rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

/* Legal Documents Layout */
.legal-container {
  display: flex;
  gap: 3rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
  align-items: flex-start;
}

.legal-sidebar {
  flex: 0 0 280px;
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.legal-toc {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.legal-toc h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.5rem;
}

.legal-toc ol {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.legal-toc a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  line-height: 1.4;
  display: block;
  transition: var(--transition);
}

.legal-toc a:hover {
  color: var(--color-primary);
  transform: translateX(2px);
}

.legal-content {
  flex: 1;
  min-width: 0;
  max-width: 820px;
}

.legal-header {
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 1.5rem;
}

.legal-header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--color-text);
  margin: 0.75rem 0 0.5rem;
  letter-spacing: -0.02em;
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.legal-body {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--color-text);
}

.legal-section {
  margin-bottom: 3rem;
  scroll-margin-top: 100px;
}

.legal-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.4rem;
}

.legal-section p {
  margin-bottom: 1rem;
}

.legal-section ul,
.legal-section ol {
  margin: 1rem 0 1.5rem 1.75rem;
}

.legal-section li {
  margin-bottom: 0.5rem;
}

.legal-contact-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-top: 1rem;
}

.legal-contact-card p {
  margin-bottom: 0.5rem;
}

.legal-contact-card p:last-child {
  margin-bottom: 0;
}

.callout {
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  border-left: 4px solid var(--color-primary);
  background: var(--color-surface);
}

.callout-warning {
  border-left-color: var(--color-warning);
  background: rgba(245, 158, 11, 0.08);
}

.callout-info {
  border-left-color: var(--color-primary);
  background: rgba(37, 99, 235, 0.08);
}

.callout-success {
  border-left-color: var(--color-success);
  background: rgba(16, 185, 129, 0.08);
}

@media (max-width: 900px) {
  .legal-container {
    flex-direction: column;
    padding: 2rem 1rem 4rem;
  }
  .legal-sidebar {
    position: static;
    flex: auto;
    width: 100%;
    margin-bottom: 2rem;
  }
}

/* Accessible Modal Component */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: modalFadeIn 0.15s ease-out;
}

.modal-dialog {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.2), 0 8px 10px -6px rgb(0 0 0 / 0.2);
  width: 100%;
  max-width: 620px;
  padding: 1.75rem;
  position: relative;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 1rem;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

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

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

/* 8-State Editorial Workflow Status Badges */
.badge-submitted {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}
.badge-approved {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}
.badge-scheduled {
  background: #f3e8ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
}
[data-theme="dark"] .badge-submitted { background: #0c4a6e; color: #bae6fd; }
[data-theme="dark"] .badge-approved { background: #14532d; color: #bbf7d0; }
[data-theme="dark"] .badge-scheduled { background: #581c87; color: #e9d5ff; }

/* Related Articles Component */
.related-posts-section {
  margin: 3rem 0 2.5rem 0;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.related-posts-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--color-text);
}

.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.related-post-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

.related-post-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.related-post-card h4 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.4;
  color: var(--color-text);
}

.related-post-meta {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  display: flex;
  justify-content: space-between;
  margin-top: 0.75rem;
}

/* Author Profile & Directory Styles */
.author-profile-hero {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin-bottom: 3rem;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.author-profile-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  font-size: 2.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.author-profile-info h1 {
  font-size: 1.85rem;
  margin-bottom: 0.25rem;
}

.author-profile-title {
  color: var(--color-primary);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.author-profile-bio {
  color: var(--color-text-muted);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  max-width: 650px;
}

.author-expertise-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.authors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.author-directory-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
}

.author-directory-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.author-card-header {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  margin-bottom: 1rem;
}

.author-stats-badge {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-weight: 500;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px dashed var(--color-border);
}

/* ==========================================================================
   Writer CTA Banner & /write Landing Page
   ========================================================================== */

/* Contributor Banner on Index Page */
.writer-cta-banner {
  margin-top: 3.5rem;
  padding: 1.75rem 2rem;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(124, 58, 237, 0.08) 100%);
  border: 1px solid rgba(37, 99, 235, 0.25);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .writer-cta-banner {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.2) 0%, rgba(88, 28, 135, 0.2) 100%);
  border-color: rgba(96, 165, 250, 0.25);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.writer-cta-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex: 1;
}

.writer-cta-icon-wrapper {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.writer-cta-icon {
  width: 1.6rem;
  height: 1.6rem;
}

.writer-cta-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 0.35rem 0;
}

.writer-cta-subtitle {
  font-size: 0.92rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.5;
}

.writer-cta-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
}

.btn-writer-guidelines {
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
  transition: var(--transition);
}

.btn-writer-guidelines:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-writer-start {
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--color-primary);
  color: #ffffff !important;
  text-decoration: none;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn-writer-start:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .writer-cta-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem;
  }
  .writer-cta-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

/* ---------------------------------------------------------------------------
   Review feedback page (/admin/posts/{id}/feedback) and dashboard callout
   --------------------------------------------------------------------------- */
.fb-callout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.6rem 0.9rem;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-left: 4px solid var(--color-warning, #f59e0b);
  border-radius: var(--radius-sm, 6px);
  background: rgba(245, 158, 11, 0.07);
  font-size: 0.88rem;
}
.fb-callout-link { color: var(--color-primary); font-weight: 600; text-decoration: none; white-space: nowrap; }
.fb-callout-link:hover { text-decoration: underline; }

.fb-page { max-width: 1240px; margin: 0 auto; padding: 1.25rem 1rem 3rem; color: var(--color-text); }
.fb-back { display: inline-block; margin-bottom: 0.75rem; color: var(--color-primary); font-weight: 600; text-decoration: none; }
.fb-muted { color: var(--color-text-muted); font-size: 0.85rem; }

.fb-header { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; align-items: flex-start; margin-bottom: 1rem; }
.fb-title-row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.fb-title { margin: 0; font-size: 1.75rem; font-weight: 800; overflow-wrap: anywhere; }
.fb-chips { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem 0.85rem; margin-top: 0.6rem; }
.fb-chip { padding: 0.2rem 0.7rem; border: 1px solid var(--color-border); border-radius: 999px; background: var(--color-surface); font-size: 0.8rem; }
.fb-chip-text { font-size: 0.85rem; color: var(--color-text-muted); }
.fb-header-status { text-align: right; max-width: 320px; }
.fb-header-status p { margin: 0.4rem 0 0; font-size: 0.85rem; color: var(--color-text-muted); }

.fb-status-badge { display: inline-block; padding: 0.3rem 0.9rem; border-radius: 6px; font-weight: 700; font-size: 0.9rem; background: rgba(127,127,127,0.18); }
.fb-status-changes_requested { background: #fecaca; color: #991b1b; }
.fb-status-published { background: #bbf7d0; color: #166534; }
.fb-status-scheduled { background: #e9d5ff; color: #6b21a8; }
.fb-status-in_review, .fb-status-submitted { background: #bfdbfe; color: #1e40af; }
.fb-status-approved { background: #a7f3d0; color: #065f46; }

.fb-steps-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 0.5rem; border: 1px solid var(--color-border); border-radius: var(--radius-md, 8px); background: var(--color-surface); }
.fb-steps { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(100px, 1fr)); gap: 0; margin: 0; padding: 0.75rem 0.5rem; min-width: 520px; }
.fb-steps-note { margin: 0 0 1.25rem; font-size: 0.8rem; color: var(--color-text-muted); }
.fb-step { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.15rem; font-size: 0.82rem; }
.fb-step::before { content: ""; position: absolute; top: 0.95rem; left: -50%; width: 100%; height: 2px; background: var(--color-border); z-index: 0; }
.fb-step:first-child::before { display: none; }
.fb-step-done::before { background: #22c55e; }
.fb-step-current::before { background: linear-gradient(90deg, #22c55e, #3b82f6); }
.fb-step-dot { position: relative; z-index: 1; width: 1.9rem; height: 1.9rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; background: #64748b; color: #fff; }
.fb-step-done .fb-step-dot { background: #22c55e; }
.fb-step-current .fb-step-dot { background: #3b82f6; box-shadow: 0 0 0 4px rgba(59,130,246,0.25); }
.fb-step-failed .fb-step-dot { background: #ef4444; }
.fb-step-label { font-weight: 700; }
.fb-step-done .fb-step-label { color: #22c55e; }
.fb-step-current .fb-step-label { color: #60a5fa; }
.fb-step-sub { color: var(--color-text-muted); font-size: 0.78rem; }
.fb-step-current .fb-step-sub { color: #60a5fa; }
.fb-step-failed .fb-step-sub { color: #ef4444; }

.fb-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.25rem; align-items: start; }
.fb-main, .fb-side { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }

.fb-card { padding: 1.1rem 1.25rem; border: 1px solid var(--color-border); border-radius: var(--radius-md, 8px); background: var(--color-surface); }
.fb-card-head { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.9rem; }
.fb-card-head-split { justify-content: space-between; align-items: flex-start; }
.fb-card-title { margin: 0; font-size: 1.1rem; font-weight: 700; }
.fb-spark { font-size: 1.6rem; }

.fb-banner { display: flex; gap: 0.8rem; align-items: center; padding: 0.85rem 1rem; border-radius: var(--radius-md, 8px); margin-bottom: 0.9rem; }
.fb-banner-bad { background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.5); }
.fb-banner-warn { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.45); }
.fb-banner-icon { flex: 0 0 auto; width: 2rem; height: 2rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #ef4444; color: #fff; font-weight: 800; }

.fb-tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.fb-tab { cursor: pointer; padding: 0.4rem 0.85rem; border: 1px solid var(--color-border); border-radius: 6px; background: transparent; color: var(--color-text); font: inherit; font-size: 0.85rem; }
.fb-tab.is-active { border-color: #3b82f6; color: #3b82f6; background: rgba(59,130,246,0.1); }
.fb-count { display: inline-block; min-width: 1.4rem; padding: 0 0.4rem; border-radius: 999px; background: #3b82f6; color: #fff; font-size: 0.75rem; font-weight: 700; text-align: center; }
.fb-count-bad { background: #ef4444; }
.fb-count-warn { background: #f59e0b; color: #1f1300; }

.fb-findings { display: flex; flex-direction: column; gap: 0.7rem; }
.fb-finding { border: 1px solid var(--color-border); border-radius: var(--radius-md, 8px); background: rgba(127,127,127,0.05); }
.fb-finding-summary { list-style: none; cursor: pointer; display: flex; gap: 0.9rem; align-items: flex-start; padding: 0.9rem 1rem; }
.fb-finding-summary::-webkit-details-marker { display: none; }
.fb-finding-icon { flex: 0 0 auto; width: 2rem; height: 2rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; }
.fb-finding-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.fb-finding-head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.fb-finding-title { font-weight: 700; }
.fb-finding-desc { color: var(--color-text-muted); font-size: 0.9rem; overflow-wrap: anywhere; }
.fb-chevron { color: var(--color-text-muted); transition: transform 0.15s; }
.fb-finding[open] .fb-chevron { transform: rotate(180deg); }
.fb-finding-body { padding: 0 1rem 0.9rem 4rem; font-size: 0.88rem; }
.fb-finding-body ul { margin: 0.3rem 0 0; padding-left: 1.1rem; color: var(--color-text-muted); }

.fb-pill { display: inline-block; padding: 0.1rem 0.6rem; border-radius: 999px; font-size: 0.72rem; font-weight: 600; border: 1px solid currentColor; }
.fb-finding-icon.fb-sev-blocking { background: #ef4444; }
.fb-finding-icon.fb-sev-improvement, .fb-finding-icon.fb-sev-suggestion { background: #f59e0b; color: #1f1300; }
.fb-pill.fb-sev-blocking { color: #dc2626; background: rgba(239,68,68,0.1); }
.fb-pill.fb-sev-improvement, .fb-pill.fb-sev-suggestion { color: #b45309; background: rgba(245,158,11,0.12); }
.fb-pill.fb-sev-ok { color: #15803d; background: rgba(34,197,94,0.12); }
[data-theme="dark"] .fb-pill.fb-sev-blocking { color: #f87171; }
[data-theme="dark"] .fb-pill.fb-sev-improvement, [data-theme="dark"] .fb-pill.fb-sev-suggestion { color: #fbbf24; }
[data-theme="dark"] .fb-pill.fb-sev-ok { color: #4ade80; }

.fb-disclaimer { margin: 0.9rem 0 0; font-size: 0.8rem; color: var(--color-text-muted); }
.fb-empty, .fb-notes { padding: 0.5rem 0; color: var(--color-text-muted); }

.fb-history { list-style: none; margin: 0.75rem 0 0; padding: 0 0 0 0.9rem; border-left: 2px solid var(--color-border); display: flex; flex-direction: column; gap: 0.75rem; }
.fb-history-item { display: flex; flex-direction: column; gap: 0.1rem; font-size: 0.88rem; }
.fb-history-label { font-weight: 700; }
.fb-history-summary { overflow-wrap: anywhere; }

.fb-checks { list-style: none; margin: 0 0 0.6rem; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.fb-check { display: grid; grid-template-columns: 1.6rem 1fr auto; align-items: center; gap: 0.25rem 0.6rem; font-size: 0.9rem; }
.fb-check-icon { width: 1.4rem; height: 1.4rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 0.8rem; font-weight: 800; }
.fb-ok { background: #22c55e; }
.fb-bad { background: #ef4444; }
.fb-ok-text { color: #16a34a; }
.fb-bad-text { color: #dc2626; }
[data-theme="dark"] .fb-ok-text { color: #4ade80; }
[data-theme="dark"] .fb-bad-text { color: #f87171; }
.fb-progress { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: rgba(127,127,127,0.25); overflow: hidden; }
.fb-progress-bar { display: block; height: 100%; }
.fb-details summary { cursor: pointer; color: var(--color-primary); font-size: 0.85rem; margin-top: 0.4rem; }
.fb-detail-list { margin: 0.5rem 0 0; padding-left: 1.1rem; font-size: 0.82rem; color: var(--color-text-muted); }

.fb-summary { display: grid; grid-template-columns: auto 1fr; gap: 0.5rem 1rem; margin: 0.7rem 0 0; font-size: 0.9rem; }
.fb-summary dt { color: var(--color-text-muted); }
.fb-summary dd { margin: 0; }

.fb-actions { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.7rem; }
.fb-actions-note { margin: 0; }
.fb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; padding: 0.6rem 1rem; border-radius: 6px; border: 1px solid var(--color-border); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; color: var(--color-text); background: transparent; }
.fb-btn-primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.fb-btn-outline:hover, .fb-btn-ghost:hover { background: rgba(127,127,127,0.12); }
.fb-btn-ghost { padding: 0.35rem 0.8rem; background: var(--color-surface); }

.fb-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; margin-top: 0.6rem; font-size: 0.85rem; }
.fb-links a { color: var(--color-primary); text-decoration: none; }
.fb-links a:hover { text-decoration: underline; }

@media (max-width: 960px) {
  .fb-grid { grid-template-columns: 1fr; }
  .fb-header-status { text-align: left; }
}
@media (max-width: 640px) {
  .fb-steps { padding: 0.6rem 0.25rem; }
  .fb-step-sub { font-size: 0.7rem; }
  .fb-finding-body { padding-left: 1rem; }
  .fb-title { font-size: 1.4rem; }
}

.fb-focus-highlight {
  outline: 3px solid #f59e0b;
  outline-offset: 2px;
  border-radius: 6px;
}

/* Tracker: optional/skipped steps and tighter dots for seven states */
.fb-step-dot { width: 1.7rem; height: 1.7rem; font-size: 0.85rem; }
.fb-step::before { top: 0.85rem; }
.fb-step-skipped .fb-step-dot { background: transparent; border: 2px dashed #64748b; color: #94a3b8; }
.fb-step-skipped .fb-step-label, .fb-step-skipped .fb-step-sub { color: var(--color-text-muted); }
.fb-step-label { font-size: 0.8rem; }

/* AI review: not-started info line and result header */
.fb-info { display: flex; gap: 0.8rem; align-items: flex-start; padding: 0.8rem 1rem; border: 1px dashed var(--color-border); border-radius: var(--radius-md, 8px); background: rgba(127,127,127,0.05); }
.fb-info-icon { font-size: 1.15rem; }
.fb-result { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem 1.25rem; flex-wrap: wrap; padding: 0.7rem 0.9rem; margin-bottom: 0.9rem; border-radius: var(--radius-md, 8px); border: 1px solid var(--color-border); }
.fb-result-bad { border-color: rgba(239,68,68,0.5); background: rgba(239,68,68,0.08); }
.fb-result-ok { border-color: rgba(34,197,94,0.5); background: rgba(34,197,94,0.08); }
.fb-result-warn { border-color: rgba(245,158,11,0.5); background: rgba(245,158,11,0.08); }
.fb-result-info { background: rgba(59,130,246,0.08); border-color: rgba(59,130,246,0.4); }
.fb-result-main { display: flex; flex-direction: column; gap: 0.1rem; }
.fb-result-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-muted); }
.fb-scores { list-style: none; display: flex; gap: 0.5rem 1.1rem; flex-wrap: wrap; margin: 0; padding: 0; font-size: 0.85rem; }
.fb-group { font-size: 0.72rem; color: var(--color-text-muted); border: 1px solid var(--color-border); border-radius: 999px; padding: 0.05rem 0.5rem; }

/* Validation panel: roomy rows, wrapped text, no clipping or inner scrolling */
.fb-validation { padding: 1.15rem 1.25rem 1.25rem; }
.fb-val-sub { margin: 0 0 0.9rem; }
.fb-checks { gap: 0.2rem; }
.fb-check { grid-template-columns: 1.6rem minmax(0, 1fr) auto; align-items: start; padding: 0.55rem 0; border-top: 1px solid var(--color-border); }
.fb-check:first-child { border-top: 0; }
.fb-check-icon { margin-top: 0.1rem; }
.fb-check-main { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.fb-check-label { font-weight: 600; }
.fb-check.is-failed .fb-check-label { font-weight: 700; }
.fb-check-detail { font-size: 0.8rem; color: var(--color-text-muted); overflow-wrap: anywhere; line-height: 1.4; }
.fb-check-status { font-size: 0.75rem; white-space: nowrap; }
.fb-bad-pill { padding: 0.1rem 0.6rem; border-radius: 999px; font-weight: 600; color: #dc2626; background: rgba(239,68,68,0.12); }
[data-theme="dark"] .fb-bad-pill { color: #f87171; }
.fb-progress { grid-column: 2 / -1; margin-top: 0.15rem; }
.fb-fix-link { grid-column: 2 / -1; justify-self: start; font-size: 0.8rem; font-weight: 600; color: var(--color-primary); text-decoration: none; }
.fb-fix-link:hover { text-decoration: underline; }
.fb-warn { background: #f59e0b; color: #1f1300; }
.fb-subhead { margin: 0.9rem 0 0.2rem; font-size: 0.85rem; font-weight: 700; }
.fb-advice .fb-check { border-top: 1px dashed var(--color-border); }
.fb-val-actions { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--color-border); }
.fb-center { text-align: center; margin: 0; }
.fb-btn-light { background: #f3f4f6; border-color: #f3f4f6; color: #111827; border-radius: 999px; }
.fb-btn-light:hover { background: #e5e7eb; }
.fb-btn-disabled { border-radius: 999px; opacity: 0.55; cursor: not-allowed; }
.fb-val-actions .fb-btn-primary { border-radius: 999px; }

/* Review history: collapsible */
.fb-collapse > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; }
.fb-collapse > summary::-webkit-details-marker { display: none; }
.fb-collapse > summary::after { content: "⌄"; color: var(--color-text-muted); transition: transform 0.15s; }
.fb-collapse[open] > summary::after { transform: rotate(180deg); }
.fb-rev { margin-left: 0.4rem; padding: 0.05rem 0.5rem; border-radius: 999px; border: 1px solid var(--color-border); font-size: 0.7rem; font-weight: 600; color: var(--color-text-muted); }

/* Article Validation as the primary (larger) section in the main column */
.fb-validation-lg { padding: 1.6rem 1.75rem 1.75rem; }
.fb-validation-lg .fb-card-title { font-size: 1.4rem; }
.fb-validation-lg .fb-val-sub { font-size: 0.95rem; margin-bottom: 1.1rem; }
.fb-validation-lg .fb-check { grid-template-columns: 2rem minmax(0, 1fr) auto; padding: 0.9rem 0; gap: 0.3rem 0.9rem; }
.fb-validation-lg .fb-check-icon { width: 1.7rem; height: 1.7rem; font-size: 0.95rem; }
.fb-validation-lg .fb-check-label { font-size: 1.05rem; }
.fb-validation-lg .fb-check-detail { font-size: 0.92rem; }
.fb-validation-lg .fb-check-status { font-size: 0.82rem; }
.fb-validation-lg .fb-progress { height: 8px; }
.fb-validation-lg .fb-fix-link { font-size: 0.88rem; }
.fb-validation-lg .fb-subhead { font-size: 0.95rem; margin-top: 1.25rem; }
.fb-validation-lg .fb-val-actions { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; }
.fb-validation-lg .fb-val-actions .fb-btn { flex: 1 1 220px; padding: 0.8rem 1.25rem; font-size: 1rem; }
.fb-validation-lg .fb-val-actions .fb-center { flex: 1 1 100%; }
@media (max-width: 640px) {
  .fb-validation-lg { padding: 1.1rem; }
}

.fb-next-step { margin: 0.6rem 0 0; font-size: 0.92rem; display: flex; flex-direction: column; gap: 0.1rem; }

/* Dashboard metrics: all nine tiles on a single line on desktop, compact tiles */
.stats-grid-row {
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 0.6rem;
}
.stats-grid-row .stat-card { padding: 0.85rem 0.75rem; gap: 0.2rem; min-width: 0; }
.stats-grid-row .stat-label {
  font-size: clamp(0.68rem, 0.85vw, 0.8rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stats-grid-row .stat-value { font-size: 1.6rem; }
@media (max-width: 1100px) {
  .stats-grid-row { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .stats-grid-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Dashboard: toolbar, sortable headers, next-step column, pager */
.dash-toolbar { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin: 0 0 1rem; }
.dash-search { flex: 1 1 260px; min-width: 0; padding: 0.55rem 0.8rem; border: 1px solid var(--color-border); border-radius: var(--radius-sm, 6px); background: var(--color-surface); color: var(--color-text); font: inherit; }
.dash-toolbar select { padding: 0.5rem 0.6rem; border: 1px solid var(--color-border); border-radius: var(--radius-sm, 6px); background: var(--color-surface); color: var(--color-text); font: inherit; }
.dash-sort { display: inline-flex; align-items: center; gap: 0.4rem; }
.dash-search-btn { padding: 0.5rem 1rem; }
.dash-clear { color: var(--color-primary); font-weight: 600; text-decoration: none; }
.dash-th-link { color: inherit; text-decoration: none; }
.dash-th-link:hover { text-decoration: underline; }
.dash-next { font-size: 0.85rem; font-weight: 600; }
.dash-next-bad { color: #dc2626; }
.dash-next-warn { color: #b45309; }
.dash-next-info { color: var(--color-primary); }
.dash-next-ok { color: #15803d; }
.dash-next-muted { color: var(--color-text-muted); font-weight: 500; }
[data-theme="dark"] .dash-next-bad { color: #f87171; }
[data-theme="dark"] .dash-next-warn { color: #fbbf24; }
[data-theme="dark"] .dash-next-ok { color: #4ade80; }
.dash-pager { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.75rem; padding: 0.9rem 0.25rem 0; }
.dash-pager-links { display: inline-flex; align-items: center; gap: 0.75rem; }
.dash-pager a.btn-secondary, .dash-pager .btn-secondary { text-decoration: none; padding: 0.4rem 0.9rem; font-size: 0.85rem; }
.dash-pager-off { opacity: 0.5; cursor: not-allowed; }

/* Metric tiles are the status filter */
.stat-link { text-decoration: none; color: inherit; cursor: pointer; transition: border-color 0.15s, transform 0.15s, background 0.15s; }
.stat-link:hover { border-color: var(--color-primary); transform: translateY(-1px); }
.stat-link:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.stat-link.is-active { border-color: var(--color-primary); background: rgba(37, 99, 235, 0.1); box-shadow: inset 0 -3px 0 var(--color-primary); }

/* Modals: never taller than the viewport. The body scrolls and the footer buttons stay visible,
   so Cancel/Submit are reachable on short laptop screens (previously clipped below the fold). */
.modal-backdrop { overflow-y: auto; padding: 1rem; }
.modal-dialog {
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.modal-dialog .modal-footer {
  position: sticky;
  bottom: -1.75rem;           /* sits on the dialog's bottom padding edge */
  margin: 0 -1.75rem -1.75rem;
  padding: 0.9rem 1.75rem !important;
  background: var(--color-bg);
  z-index: 1;
}
@media (max-height: 720px) {
  .modal-dialog { padding: 1.1rem 1.25rem; }
  .modal-dialog .modal-footer { bottom: -1.1rem; margin: 0 -1.25rem -1.1rem; padding: 0.75rem 1.25rem !important; }
}

/* Visually hidden but still available to screen readers and search engines */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Like / Share / Save row */
.engage { margin: 2rem 0 2.5rem; }
.engage-prompt { margin: 0 0 0.75rem; color: var(--color-text-muted); font-size: 0.95rem; }
.engage-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.engage-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 1.1rem; border-radius: 999px;
  border: 1px solid var(--color-border); background: transparent; color: var(--color-text);
  font: inherit; font-weight: 600; cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.engage-btn:hover { border-color: var(--color-primary); }
.engage-btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.engage-btn:disabled { opacity: 0.6; cursor: wait; }
.engage-btn.is-active { border-color: var(--color-primary); color: var(--color-primary); background: rgba(37, 99, 235, 0.1); }
.engage-btn.is-active .engage-icon { fill: currentColor; fill-opacity: 0.2; }
.engage-count:empty { display: none; }
.engage-share { position: relative; }
.engage-menu {
  position: absolute; z-index: 20; top: calc(100% + 0.4rem); left: 0; min-width: 12rem;
  display: flex; flex-direction: column; padding: 0.35rem;
  background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius-md, 8px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}
.engage-menu[hidden] { display: none; }
.engage-menu-item {
  text-align: left; padding: 0.55rem 0.75rem; border: 0; border-radius: var(--radius-sm, 6px);
  background: transparent; color: var(--color-text); font: inherit; text-decoration: none; cursor: pointer;
}
.engage-menu-item:hover, .engage-menu-item:focus-visible { background: rgba(127, 127, 127, 0.15); outline: none; }
.engage-status { min-height: 1.25rem; margin: 0.5rem 0 0; font-size: 0.85rem; color: var(--color-text-muted); }

/* Saved page */
.saved-list-wrap { max-width: 760px; margin: 0 auto; padding: 0 1rem 3rem; }
.saved-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.saved-item { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.8rem 1rem; border: 1px solid var(--color-border); border-radius: var(--radius-md, 8px); background: var(--color-surface); }
.saved-item a { color: var(--color-text); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.saved-item a:hover { color: var(--color-primary); }
.saved-empty { color: var(--color-text-muted); }

/* Editor: inline field errors and the gated Submit button */
.field-error { display: block; margin-top: 0.35rem; font-size: 0.82rem; font-weight: 600; color: #dc2626; }
[data-theme="dark"] .field-error { color: #f87171; }
.field-error[hidden] { display: none; }
.form-select[aria-invalid="true"] { border-color: #ef4444; }
#submit-review-btn.is-disabled, #submit-review-btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }

/* Submission quota */
.quota-card { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 0.75rem 1rem; margin: 0 0 1rem; border: 1px solid var(--color-border); border-radius: var(--radius-md, 8px); background: var(--color-surface); }
.quota-card.is-reached { border-color: rgba(245, 158, 11, 0.6); background: rgba(245, 158, 11, 0.08); }
.quota-main { display: flex; flex-direction: column; gap: 0.15rem; }
.quota-sub { font-size: 0.82rem; color: var(--color-text-muted); }
.quota-meter { flex: 0 0 160px; height: 8px; border-radius: 999px; background: rgba(127, 127, 127, 0.25); overflow: hidden; }
.quota-meter span { display: block; height: 100%; background: var(--color-primary); }
.quota-card.is-reached .quota-meter span { background: #f59e0b; }
.quota-alert { margin: 0 0 1rem; }

/* Sign-in / registration: text switch link and terms note */
.auth-switch { margin: 1.25rem 0 0; text-align: center; font-size: 0.95rem; color: var(--color-text-muted); }
.auth-switch a { color: var(--color-primary); font-weight: 600; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }
.auth-terms { margin: 0.75rem 0 0; text-align: center; font-size: 0.8rem; color: var(--color-text-muted); }
.auth-terms a { color: inherit; text-decoration: underline; }

/* Provider not configured in a non-production environment: visible but inert */
.btn-sso.is-unconfigured { opacity: 0.55; cursor: not-allowed; position: relative; }
.sso-unconfigured-note { margin-left: 0.5rem; padding: 0.05rem 0.5rem; border: 1px solid currentColor; border-radius: 999px; font-size: 0.7rem; font-weight: 600; }

/* Check Content results (editor) */
.editor-check-results { margin: 1rem 0; padding: 0.9rem 1.1rem; border: 1px solid var(--color-border); border-radius: var(--radius-md, 10px); background: var(--color-surface); font-size: 0.9rem; }
.editor-check-head { font-weight: 700; margin: 0 0 0.5rem; }
.editor-check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; }
.editor-check-list li.is-ok { color: var(--color-text-muted); }
.editor-check-list li.is-failed { color: var(--color-error, #b42318); }
.editor-check-version { margin: 0.6rem 0 0; font-size: 0.78rem; color: var(--color-text-muted); }

/* Contact page at phone width: the 300px Turnstile widget must fit a 360px screen (Story 6.4) */
@media (max-width: 480px) {
  .contact-container { padding-left: 0 !important; padding-right: 0 !important; }
  .contact-card { padding: 0.75rem !important; min-width: 0; }
  .contact-turnstile { margin-left: -0.75rem; margin-right: -0.75rem; display: flex; justify-content: center; }
}

/* Feedback page: follow-up of the previous AI review on a resubmission (Story 5.14) */
.fb-followup { border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 0.85rem 1rem; margin: 0.75rem 0 1rem; background: var(--color-surface); }
.fb-followup-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.fb-followup-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.fb-followup-item { display: flex; align-items: flex-start; gap: 0.6rem; font-size: 0.9rem; }
.fb-followup-item .fb-check-main { flex: 1; min-width: 0; }
.fb-followup-item.is-resolved .fb-check-label { font-weight: 500; color: var(--color-text-muted); }
