:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.85);
  --bg-card-hover: rgba(31, 41, 55, 0.9);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-active: rgba(99, 102, 241, 0.4);
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: #374151;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #4b5563;
}

/* Header & Nav */
header {
  background: rgba(11, 15, 25, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  font-weight: 700;
  font-size: 1.25rem;
  cursor: pointer;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.brand-title {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

.brand-badge {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
  font-weight: 500;
}

nav {
  display: flex;
  gap: 0.5rem;
}

.nav-link {
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  color: #fff;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

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

/* Buttons */
.btn {
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn-primary {
  background: var(--accent-gradient);
  /* Fill the transparent border without tiling the opposite gradient edge. */
  background-origin: border-box;
  background-repeat: no-repeat;
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border-color: var(--border-color);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-success {
  background: #059669;
  color: #fff;
}
.btn-success:hover {
  background: #047857;
}

.btn-danger {
  background: #dc2626;
  color: #fff;
}
.btn-danger:hover {
  background: #b91c1c;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
}

/* Layout Container */
main {
  flex: 1;
  padding: 1.5rem;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

.page-view {
  display: none;
}
.page-view.active {
  display: block;
}

/* Hero & Catalog Toolbar */
.catalog-hero {
  margin-bottom: 2rem;
  text-align: center;
  padding: 2.5rem 1rem 1.5rem;
}

.catalog-hero h1 {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.6rem;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.catalog-hero p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 680px;
  margin: 0 auto 1.5rem;
  line-height: 1.5;
}

.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  background: var(--bg-secondary);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
}

.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.cat-pill {
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.cat-pill:hover, .cat-pill.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.search-input-wrap {
  position: relative;
  min-width: 260px;
}
.search-input-wrap input {
  width: 100%;
  padding: 0.5rem 0.9rem 0.5rem 2.2rem;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.88rem;
  outline: none;
}
.search-input-wrap input:focus {
  border-color: var(--accent);
}
.search-input-wrap svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  fill: var(--text-muted);
}

/* Prompt Cards Grid */
.prompts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

.prompt-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  backdrop-filter: blur(8px);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}
.prompt-card:hover {
  border-color: var(--border-active);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

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

.prompt-category-tag {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.25);
  font-weight: 500;
}

.prompt-model-count {
  font-size: 0.78rem;
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 600;
}

.prompt-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.35;
  color: var(--text-primary);
}

.prompt-card p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.prompt-card-prompt-preview {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: #94a3b8;
  font-family: monospace;
  white-space: pre-wrap;
  max-height: 72px;
  overflow: hidden;
  position: relative;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.prompt-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Prompt Detail View */
.prompt-detail-header {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}
.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}

.prompt-full-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-top: 1rem;
  font-family: monospace;
  font-size: 0.86rem;
  color: #cbd5e1;
  white-space: pre-wrap;
  max-height: 200px;
  overflow-y: auto;
  line-height: 1.5;
}

.selection-bar {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 1.5rem;
}

.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}
.result-card:hover {
  border-color: var(--border-active);
}

.result-card-header {
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.model-tag {
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.harness-tag {
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.result-preview-frame {
  height: 240px;
  width: 100%;
  position: relative;
  background: #000;
}
.result-preview-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: none;
}

.result-overlay-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 14px;
  font: inherit;
  cursor: pointer;
  background: linear-gradient(transparent 45%, rgba(0, 0, 0, 0.7));
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: background 0.2s ease;
}
.result-overlay-cover:hover {
  background: linear-gradient(rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.75));
}
.result-overlay-cover:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; }
.result-preview-label { border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 999px; padding: 8px 14px; background: rgba(12, 18, 30, 0.85); color: #f8fafc; font-size: .82rem; line-height: 1.4; }

.result-card-meta {
  padding: 0.85rem 1rem;
  font-size: 0.84rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.result-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.benchmark-image-input { margin: 18px 0; padding: 16px; border: 1px solid var(--border-color); border-radius: 12px; background: var(--bg-secondary); }
.benchmark-image-input > div { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.benchmark-image-input span, .benchmark-image-input p { color: var(--text-muted); font-size: .85rem; }
.benchmark-image-input img { display: block; max-height: 420px; max-width: 100%; height: auto; margin: 16px auto; object-fit: contain; background: white; }
.maze-benchmark-fields { padding: 12px; border: 1px solid var(--border-color); border-radius: 8px; min-width: 0; }
.maze-benchmark-fields .form-grid { margin-top: 12px; }
.maze-submission-preview iframe { width: 100%; height: 480px; border: 1px solid var(--border-color); border-radius: 8px; }
.benchmark-extension-fields { padding:16px; border:1px solid var(--border-color); border-radius:8px; min-width:0; }
.extension-config-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr)); gap:12px; }
.benchmark-submission-preview iframe { width:100%; height:480px; border:1px solid var(--border-color); border-radius:8px; }
.benchmark-image-input a { color:var(--text-primary); }

.result-card-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.15);
}

/* ======================================================== */
/* 4-Split Screen Arena (Like 0905.mp4)                     */
/* ======================================================== */
.arena-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: calc(100vh - 110px);
  min-height: 600px;
}

.arena-controls-bar {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.arena-grid {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 6px;
  background: #050811;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid #1f2937;
  position: relative;
}

/* Layout modes for performance */
.arena-grid.layout-2split {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
}
.arena-grid.layout-2split #quadrant-2,
.arena-grid.layout-2split #quadrant-3 {
  display: none !important;
}

.arena-grid.layout-single {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

/* When 1 quadrant is maximized */
.arena-grid.maximized .arena-quadrant:not(.is-maximized) {
  display: none;
}
.arena-grid.maximized { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.arena-grid.maximized .arena-quadrant.is-maximized {
  grid-column: 1;
  grid-row: 1;
}

.arena-quadrant {
  position: relative;
  background: #000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  min-width: 0;
  min-height: 0;
}
.quadrant-toolbar { flex: none; display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 5px 8px; border-bottom: 1px solid var(--border-color); background: #111827; }
.arena-quadrant.is-empty { display: none; }
@media (min-width: 769px) {
  .arena-grid[data-result-count="1"] { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .arena-grid[data-result-count="2"] { grid-template-rows: minmax(0, 1fr); }
}
.quadrant-viewport { flex: 1; min-width: 0; min-height: 0; position: relative; overflow: hidden; background: #050811; }
.arena-viewport-picker { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: .8rem; min-width: 0; }
.arena-viewport-picker select { padding: 5px 8px; border: 1px solid var(--border-color); border-radius: 6px; background: var(--bg-secondary); color: var(--text-primary); font: inherit; min-width: 0; }

.arena-task-picker { display: flex; align-items: center; gap: .6rem; flex: 1 1 260px; min-width: 0; max-width: 440px; font-size: .82rem; color: var(--text-muted); }
.arena-task-picker > span { flex: none; }
.arena-task-picker select { flex: 1; min-width: 0; width: 100%; padding: .55rem .65rem; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-secondary, #111827); color: var(--text-primary, #e5e7eb); font: inherit; text-overflow: ellipsis; }
.arena-task-picker select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.arena-task-notice { flex: none; margin: 0; }
.arena-task-notice[hidden] { display: none; }
.arena-task-notice p { margin: 0; }
@media (max-width: 600px) { .arena-task-picker { flex-basis: 100%; max-width: 100%; } .arena-task-picker select { font-size: 16px; min-height: 44px; } }

.quadrant-frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
.has-fixed-viewport .quadrant-frame { top: 50%; left: 50%; width: 1280px; height: 720px; transform-origin: center; }

/* Model controls occupy their own row so they cannot cover artifact menus or HUDs. */
.quadrant-pill-badge {
  flex: 1;
  min-width: 0;
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
}
.quadrant-pill-badge .pill-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pill-dot {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  display: inline-block;
}
.dot-green { background: #10b981; }
.dot-orange { background: #f97316; }
.dot-blue { background: #2563eb; }
.dot-purple { background: #8b5cf6; }

.quadrant-actions {
  order: 3;
  flex: none;
  display: flex;
}
.quadrant-actions button { min-width: 32px; min-height: 32px; }

.quadrant-select-dropdown {
  order: 2;
  flex: 0 1 150px;
  min-width: 0;
  max-width: 38%;
  background: #182237;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
}
.quadrant-select-dropdown:focus-visible, .arena-viewport-picker select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.quadrant-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Blind Vote Modal / Bar */
.blind-vote-bar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.modal-backdrop .modal-content .modal-dismiss {
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  padding: 8px;
  border-radius: 10px;
}
.modal-backdrop .modal-content .modal-dismiss:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

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

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
  overscroll-behavior: contain;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
}

/* Form inputs */
.form-group {
  margin-bottom: 1.25rem;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--text-secondary);
}
.form-control {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
}
.form-control:focus {
  border-color: var(--accent);
}
textarea.form-control {
  min-height: 100px;
  resize: vertical;
  font-family: inherit;
}

/* Table styles */
.table-wrap {
  overflow-x: auto;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}
th, td {
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--border-color);
}
th {
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-secondary);
  font-weight: 600;
}
tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 0.8rem 1.2rem;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.88rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: slideIn 0.3s ease;
}
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 768px) {
  .arena-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 1fr);
  }
  .catalog-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ======================================================== */
/* Modern Prompt Inspector & Structured Guide Styles        */
/* ======================================================== */
.prompt-inspector-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1.25rem;
}

.inspector-nav-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
}

.inspector-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}
.inspector-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}
.inspector-tab-btn.active {
  background: rgba(99, 102, 241, 0.18);
  color: #c7d2fe;
  border-color: rgba(99, 102, 241, 0.35);
}

/* Timeline Stepper for Sequence */
.timeline-stepper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.timeline-step-item {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  position: relative;
  border-left: 3px solid var(--accent);
}
.timeline-step-time {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}
.timeline-step-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}
.timeline-step-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Feature checklist grid */
.prompt-req-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.prompt-req-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1.1rem;
}
.prompt-req-card-title {
  font-size: 0.92rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  color: #e2e8f0;
}
.prompt-req-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.prompt-req-card li {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}
.prompt-req-card li::before {
  content: "•";
  color: var(--accent);
  font-weight: bold;
}

/* ======================================================== */
/* User Authentication & Header Profile Styles              */
/* ======================================================== */
.user-profile-widget {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.user-profile-widget:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.15);
}
.user-avatar-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.user-nickname-text {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-role-badge {
  font-size: 0.68rem;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
}
.role-admin {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.role-user {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ======================================================== */
/* 5-Dimension Rating System Styles (Feature 3)             */
/* ======================================================== */
.rating-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.rating-pill:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.4);
  transform: translateY(-1px);
}

.rating-dimension-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border-color);
  font-size: 0.78rem;
}
.rating-dim-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-secondary);
}
.rating-dim-bar-wrap {
  width: 70px;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-left: 0.5rem;
  margin-right: 0.5rem;
}
.rating-dim-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}

/* Rating Modal Sliders */
.rate-slider-item {
  margin-bottom: 1.1rem;
}
.rate-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}
.rate-slider-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.rate-slider-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}
.rate-slider-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fbbf24;
  min-width: 32px;
  text-align: right;
}
.rate-slider-input {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #374151;
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.rate-slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.6);
  transition: all 0.15s ease;
}
.rate-slider-input::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: #818cf8;
}

.rate-overall-card {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.rate-overall-score {
  font-size: 2rem;
  font-weight: 800;
  color: #fbbf24;
  letter-spacing: -0.02em;
}

/* ======================================================== */
/* Benchmark Reports & Blog Styles                          */
/* ======================================================== */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.25s ease;
}
.post-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.post-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0.6rem 0 0.45rem 0;
  color: var(--text-primary);
}
.post-card p {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.8rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
  margin-top: 0.5rem;
}

/* Post Reader */
.post-detail-container {
  max-width: 860px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 2.25rem;
}
.post-detail-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.25rem;
  margin-bottom: 1.75rem;
}
.post-author-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
}

/* Linked Benchmark Card */
.linked-benchmark-card {
  max-width: 860px;
  margin: 0 auto 1.25rem auto;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.1) 100%);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius);
  padding: 1.1rem 1.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.linked-benchmark-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #a5b4fc;
  letter-spacing: 0.05em;
}

/* Markdown Reader Typography */
.post-markdown-body {
  color: #e2e8f0;
  font-size: 0.96rem;
  line-height: 1.75;
}
.post-markdown-body h1,
.post-markdown-body h2,
.post-markdown-body h3 {
  color: #fff;
  font-weight: 700;
  margin-top: 1.75rem;
  margin-bottom: 0.8rem;
  line-height: 1.35;
}
.post-markdown-body h1 {
  font-size: 1.55rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.4rem;
}
.post-markdown-body h2 {
  font-size: 1.3rem;
  border-left: 3px solid var(--accent);
  padding-left: 0.6rem;
}
.post-markdown-body h3 {
  font-size: 1.1rem;
}
.post-markdown-body p {
  margin-bottom: 1rem;
}
.post-markdown-body ul,
.post-markdown-body ol {
  margin-left: 1.4rem;
  margin-bottom: 1.1rem;
}
.post-markdown-body li {
  margin-bottom: 0.35rem;
}
.post-markdown-body code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.88em;
  color: #93c5fd;
}
.post-markdown-body pre {
  background: #050811;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
  overflow-x: auto;
  margin: 1.25rem 0;
}
.post-markdown-body pre code {
  background: transparent;
  padding: 0;
  color: #e2e8f0;
  font-size: 0.84rem;
  line-height: 1.5;
}
.post-markdown-body blockquote {
  border-left: 3px solid #6366f1;
  background: rgba(99, 102, 241, 0.08);
  padding: 0.75rem 1.1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.25rem 0;
  color: #cbd5e1;
}
.post-markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
}
.post-markdown-body th,
.post-markdown-body td {
  padding: 0.65rem 1rem;
  border: 1px solid var(--border-color);
  font-size: 0.88rem;
}
.post-markdown-body th {
  background: rgba(255, 255, 255, 0.05);
  font-weight: 600;
}

/* Interactive Sandbox Embedded Widget */
.sandbox-embed-box {
  margin: 1.75rem 0;
  border: 1px solid var(--border-active);
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.sandbox-embed-bar {
  background: rgba(17, 24, 39, 0.95);
  padding: 0.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
}
.sandbox-embed-frame {
  width: 100%;
  height: 380px;
  border: none;
  display: block;
}

/* ======================================================== */
/* Third-Party OAuth & Social Login Styles                  */
/* ======================================================== */
.oauth-section {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}
.auth-github-section { padding: 0 2rem 1.5rem; text-align: center; }
.auth-github-section p { font-size: .82rem; color: var(--text-muted); margin: 0 0 .75rem; }
.auth-github-section a { display: flex; justify-content: center; gap: .65rem; width: 100%; text-decoration: none; }
.auth-github-section[hidden] { display: none; }

.oauth-divider {
  text-align: center;
  position: relative;
  margin-bottom: 0.85rem;
}
.oauth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border-color);
  z-index: 1;
}
.oauth-divider span {
  position: relative;
  z-index: 2;
  background: var(--bg-card);
  padding: 0 0.6rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.oauth-buttons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
  gap: 0.6rem;
}

.btn-oauth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.btn-oauth-github {
  background: #1f2328;
  color: #f0f6fc;
  border: 1px solid #30363d;
}
.btn-oauth-github:hover {
  background: #2b313a;
  border-color: #8b949e;
  transform: translateY(-1px);
}

.btn-oauth-qq {
  background: rgba(14, 165, 233, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.3);
}
.btn-oauth-qq:hover {
  background: rgba(14, 165, 233, 0.22);
  border-color: #38bdf8;
  transform: translateY(-1px);
}

.btn-oauth-wechat {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.btn-oauth-wechat:hover {
  background: rgba(34, 197, 94, 0.22);
  border-color: #4ade80;
  transform: translateY(-1px);
}



/* Submission and review workflows */
.submission-list { display: grid; gap: 1rem; margin: 1.5rem 0; }
.submission-card { padding: 1.25rem; border: 1px solid var(--border-color); border-radius: 12px; background: var(--bg-secondary); }
.submission-card p { color: var(--text-secondary); margin: .7rem 0; overflow-wrap: anywhere; }
.submission-card .btn { margin-right: .5rem; }
.submission-preview { width: 100%; height: 420px; border: 0; margin-top: 1rem; }
.review-history { margin: 1rem 0; padding: 1rem; border: 1px solid var(--border-color); border-radius: 10px; }
.review-history summary { cursor: pointer; }
.review-history p { padding: .5rem 0; color: var(--text-secondary); overflow-wrap: anywhere; font-size: .85rem; }
#blind-vote-bar { flex-wrap: wrap; }
.managed-content-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid var(--border-color); }
.managed-content-row span { overflow-wrap: anywhere; }
[hidden] { display: none !important; }

/* Account dialog */
#modal-auth { background: rgba(4, 8, 18, .78); backdrop-filter: blur(12px); }
.auth-dialog { position: relative; max-width: 440px; border-radius: 22px; border-color: #2a3144; background: #121826; padding: 32px; overflow-y: auto; max-height: calc(100dvh - 40px); box-shadow: 0 32px 100px #0009, 0 0 0 1px #ffffff03; }
.auth-close { position: absolute; top: 20px; right: 20px; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: #7f899e; cursor: pointer; transition: color .15s, background .15s; }
.auth-close svg { width: 18px; height: 18px; }
.auth-close:hover { background: #ffffff08; color: #e7ebf5; }
.auth-heading { flex-shrink: 0; margin-bottom: 24px; }
.auth-brand { display: flex; align-items: center; gap: 10px; color: #a9b2c5; font-size: 12px; font-weight: 600; letter-spacing: .04em; margin-bottom: 23px; }
.auth-brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid #8572ee40; border-radius: 9px; color: #a897ff; background: #8470e916; }
.auth-brand-mark svg { width: 19px; height: 19px; }
.auth-heading h2 { color: #f3f5fb; font-size: 26px; letter-spacing: -.025em; font-weight: 650; line-height: 1.35; margin-bottom: 8px; }
.auth-heading p { font-size: 13px; line-height: 1.6; color: #929db4; }
.auth-body { flex-shrink: 0; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border: 1px solid #ffffff06; background: #0c111d; border-radius: 11px; margin-bottom: 24px; }
.auth-tab { height: 37px; border: 1px solid transparent; border-radius: 8px; background: transparent; font: inherit; font-size: 13px; font-weight: 500; color: #929db4; cursor: pointer; transition: background .15s, color .15s; }
.auth-tab:hover { color: #e6eaf4; }
.auth-tab.active { background: #252c3f; color: #f3f5fb; border-color: #ffffff08; box-shadow: 0 2px 5px #0003; }
.auth-field { margin-bottom: 19px; }
.auth-field label { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; font-weight: 500; color: #c8cfdf; }
.auth-field label span { font-size: 11px; font-weight: 400; color: #818da5; }
.auth-input-wrap { position: relative; }
.auth-input-icon { position: absolute; top: 15px; left: 14px; width: 18px; height: 18px; color: #7e8aa3; pointer-events: none; }
.auth-input { display: block; width: 100%; height: 48px; padding: 0 14px 0 43px; border: 1px solid #30394e; border-radius: 10px; outline: none; background: #171e2e; color: #edf0fa; font: inherit; font-size: 14px; color-scheme: dark; transition: border-color .15s, box-shadow .15s; }
.auth-input::placeholder { color: #73819b; }
.auth-input:hover { border-color: #47536e; }
.auth-input:focus { border-color: #9a84f3; box-shadow: 0 0 0 3px #8b70ef18; }
.auth-input-wrap:focus-within .auth-input-icon { color: #b09afb; }
.auth-input:-webkit-autofill, .auth-input:-webkit-autofill:hover, .auth-input:-webkit-autofill:focus { -webkit-text-fill-color: #edf0fa; -webkit-box-shadow: 0 0 0 1000px #171e2e inset; caret-color: #edf0fa; }
.auth-password { padding-right: 45px; }
.auth-password::-ms-reveal, .auth-password::-ms-clear { display: none; }
.auth-password-toggle { position: absolute; right: 8px; top: 8px; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 7px; background: transparent; color: #8390aa; cursor: pointer; }
.auth-password-toggle svg { width: 18px; height: 18px; }
.auth-password-toggle:hover { background: #ffffff08; color: #c2b2ff; }
.auth-password-toggle.is-visible::after { content: ''; position: absolute; width: 21px; height: 1.5px; background: currentColor; transform: rotate(45deg); }
.auth-field-hint { margin-top: 7px; font-size: 11px; line-height: 1.5; color: #929db4; }
#leaderboard-summary { margin: 12px 0 8px; padding: 12px 14px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); background: var(--bg-card); color: var(--text-primary); font-size: 14px; font-weight: 500; }
#leaderboard-summary:empty, #leaderboard-access-actions:empty { display: none; }
.leaderboard-row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; min-width: 144px; max-width: 224px; margin-left: auto; }
.leaderboard-row-actions .btn { flex: 0 0 auto; white-space: nowrap; }
#reg-password-feedback { margin: 7px 0 0; font-size: 12px; color: #ff9aa2; }
#reg-password-feedback:empty { display: none; }
.auth-input[aria-invalid="true"] { border-color: #e26c78; }
.auth-submit { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 48px; margin-top: 26px; border: 1px solid #c3b7ff25; border-radius: 10px; background: #8872e9; color: #fff; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: 0 4px 16px #8872e922; transition: background .15s, box-shadow .15s; }
.auth-submit:hover { background: #9782f3; box-shadow: 0 6px 20px #8872e933; }
.auth-submit span { font-size: 19px; font-weight: 400; }
.auth-form-note { text-align: center; margin-top: 13px; font-size: 11px; line-height: 1.7; color: #8e9ab1; }
.auth-bottom-note { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0; margin-top: 26px; padding-top: 18px; border-top: 1px solid #ffffff08; font-size: 11px; line-height: 1.6; color: #8e9ab1; }
.auth-bottom-note button { padding: 4px 0; border: 0; background: none; color: #bdaef8; font: inherit; cursor: pointer; }
.auth-bottom-note button:hover { color: #ded6ff; }
.auth-close:focus-visible, .auth-tab:focus-visible, .auth-password-toggle:focus-visible, .auth-submit:focus-visible, .auth-bottom-note button:focus-visible { outline: 2px solid #b7a5ff; outline-offset: 3px; }
@media (max-width: 480px) {
  .auth-dialog { padding: 26px 22px; border-radius: 18px; max-height: calc(100dvh - 32px); }
  .auth-close { top: 16px; right: 16px; }
  .auth-heading h2 { font-size: 24px; }
  .auth-bottom-note { gap: 8px; }
}

/* Header and account disclosure */
header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 24px; padding: 14px 28px; }
.brand { border: 0; background: none; font-family: inherit; white-space: nowrap; padding: 0; }
.brand-title { background: none; -webkit-text-fill-color: #b7a5ff; color: #b7a5ff; }
header nav { justify-content: center; min-width: 0; gap: 4px; }
.nav-link { background: none; border: 1px solid transparent; font-family: inherit; white-space: nowrap; min-height: 40px; padding: 8px 12px; font-size: 13px; }
header svg, .account-menu svg { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.header-actions { gap: 12px; flex-shrink: 0; }
#header-user-area { position: relative; display: flex; align-items: center; min-width: 0; }
.header-login, .header-upload { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid #ffffff0e; border-radius: 10px; font-family: inherit; font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer; }
.header-login { color: #c8cfdf; background: #ffffff04; }
.header-login:hover { color: #fff; background: #ffffff0c; }
.header-upload { color: #fff; background: #8872e9; border-color: #b6a6ff30; }
.header-upload:hover { background: #9782f3; }
.account-trigger { display: flex; align-items: center; gap: 9px; height: 40px; padding: 4px 9px 4px 4px; background: transparent; border: 1px solid transparent; border-radius: 10px; color: #d5dbea; font: inherit; font-size: 13px; cursor: pointer; }
.account-trigger:hover, .account-trigger[aria-expanded="true"] { background: #ffffff06; border-color: #ffffff0c; }
.account-avatar { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; border-radius: 10px; background: #8872e925; color: #c9bbff; border: 1px solid #a18aef35; font-size: 13px; font-weight: 600; object-fit: cover; }
.account-trigger-name { max-width: 112px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-chevron { width: 14px; color: #7f899e; transition: transform .15s; }
.account-trigger[aria-expanded="true"] .account-chevron { transform: rotate(180deg); }
.account-menu { position: absolute; right: 0; top: calc(100% + 12px); width: 272px; max-width: calc(100vw - 32px); padding: 7px; border: 1px solid #2a3144; border-radius: 14px; background: #121826; box-shadow: 0 18px 60px #0008; z-index: 110; }
.account-menu-profile { padding: 12px 10px 15px; margin-bottom: 5px; border-bottom: 1px solid #ffffff0a; }
.account-menu-name { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.account-role { padding: 2px 6px; background: #8872e918; border-radius: 4px; color: #b9a9f2; font-size: 10px; font-weight: 400; white-space: nowrap; }
.account-menu-profile p { color: #818da5; font-size: 12px; margin-top: 6px; overflow-wrap: anywhere; }
.account-menu-item { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 10px; width: 100%; border: 0; border-radius: 8px; background: none; color: #cbd3e3; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.account-menu-item:hover { background: #ffffff06; color: #fff; }
.account-menu-item svg { color: #8e9ab1; }
.account-item-arrow { margin-left: auto; color: #7f899e; font-size: 19px; }
.account-menu-divider { height: 1px; background: #ffffff0a; margin: 5px 3px; }
.account-logout, .account-logout svg { color: #d49aa5; }
header button:focus-visible, .account-menu button:focus-visible { outline: 2px solid #b7a5ff; outline-offset: 2px; }

/* Allow content grids to shrink with their viewport. */
.prompts-grid, .posts-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.results-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }
.prompt-req-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.page-view, .prompt-card, .result-card, .post-card, .form-group { min-width: 0; }
.prompt-card h3, .model-tag, .post-card h3, .submission-card h3 { overflow-wrap: anywhere; }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.catalog-hero h1 { text-wrap: balance; }
.hero-title-part { display: inline-block; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.table-wrap { max-width: 100%; overscroll-behavior-x: contain; }
.post-markdown-body img, .post-markdown-body video { max-width: 100%; height: auto; }
.post-markdown-body table { display: block; overflow-x: auto; }
.modal-body { min-height: 0; }
body:has(.modal-backdrop.open) { overflow: hidden; }

@media (max-width: 1280px) {
  header { grid-template-columns: minmax(0, 1fr) auto; gap: 12px 20px; padding: 12px 24px 8px; }
  header nav { grid-row: 2; grid-column: 1 / -1; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  header nav::-webkit-scrollbar { display: none; }
  .nav-link { flex-shrink: 0; }
  .header-actions { grid-row: 1; grid-column: 2; }
}

@media (max-width: 768px) {
  header { gap: 10px 12px; padding: 12px 16px 8px; }
  .brand { gap: 8px; font-size: 17px; min-width: 0; }
  .brand-icon { width: 32px; height: 32px; font-size: 17px; box-shadow: none; flex-shrink: 0; }
  .brand-badge { display: none; }
  .brand-title { overflow: hidden; text-overflow: ellipsis; }
  .header-actions { gap: 6px; }
  .header-login, .header-upload { min-height: 40px; padding: 0 10px; font-size: 12px; gap: 6px; }
  .header-register-label, .header-upload-label, .account-trigger-name, .account-chevron { display: none; }
  .account-trigger { width: 40px; padding: 3px; justify-content: center; }
  .account-menu { position: fixed; top: 66px; right: 16px; max-height: calc(100dvh - 82px); overflow-y: auto; }
  header nav { gap: 2px; }
  .nav-link { min-height: 42px; padding: 8px 10px; font-size: 12px; gap: 6px; }
  .nav-link svg { width: 16px; height: 16px; }
  main { padding: 20px 16px; }
  .catalog-hero { padding: 20px 0 8px; margin-bottom: 20px; text-align: left; }
  .catalog-hero h1 { font-size: clamp(24px, 5.5vw, 32px); line-height: 1.4; margin-bottom: 12px; }
  .catalog-hero p { font-size: 14px; line-height: 1.8; margin-bottom: 0; }
  .catalog-toolbar { padding: 12px; gap: 12px; }
  .category-pills { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; max-width: 100%; }
  .cat-pill { white-space: nowrap; flex-shrink: 0; min-height: 38px; }
  .search-input-wrap { min-width: 0; width: 100%; }
  .search-input-wrap input { min-height: 44px; font-size: 16px; }
  .posts-toolbar-actions { flex-wrap: wrap; }
  .posts-toolbar-actions .search-input-wrap { flex: 1 1 100%; }
  .prompts-grid, .results-grid, .posts-grid { gap: 16px; }
  main .btn, .modal-content .btn { min-height: 40px; }
  .prompt-card, .post-card { padding: 18px; }
  .prompt-card-footer, .prompt-card-footer > div { flex-wrap: wrap; gap: 8px; }
  .prompt-detail-header { padding: 16px; }
  .detail-heading-row { flex-direction: column; }
  .detail-heading-row > div { min-width: 0; }
  .detail-heading-row > div:last-child { flex-wrap: wrap; width: 100%; }
  .detail-heading-row .btn { flex: 1; }
  .prompt-inspector-card { padding: 14px; }
  .inspector-nav-tabs { overflow-x: auto; max-width: 100%; }
  .inspector-tab-btn { white-space: nowrap; flex-shrink: 0; min-height: 42px; padding: 8px 10px; font-size: 12px; }
  .timeline-stepper { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .prompt-full-box { overflow-wrap: anywhere; }
  .selection-bar, .section-header, .linked-benchmark-card, .post-author-row, .sandbox-embed-bar { flex-wrap: wrap; gap: 12px; }
  .selection-bar { padding: 14px; font-size: 13px; line-height: 1.7; }
  .selection-bar > div:last-child { width: 100%; justify-content: flex-end; }
  .result-card-header, .result-meta-row, .result-card-footer { flex-wrap: wrap; gap: 10px; }
  .model-tag { flex-wrap: wrap; }
  .result-card-footer > div { flex-wrap: wrap; }
  .post-detail-container { padding: 18px; }
  #post-detail-title { font-size: 24px !important; }
  .post-markdown-body { overflow-wrap: anywhere; }
  .post-markdown-body h1 { font-size: 24px; }
  .post-markdown-body h2 { font-size: 21px; }
  .post-markdown-body pre { max-width: 100%; }
  .sandbox-embed-frame { height: 300px; }
  .arena-container { height: auto; min-height: 0; }
  .arena-controls-bar { padding: 12px; }
  .arena-controls-bar > div { min-width: 0; max-width: 100%; }
  .arena-controls-bar .btn, #blind-vote-bar .btn { min-height: 40px; }
  .arena-grid, .arena-grid.layout-2split, .arena-grid.layout-single { flex: none; grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-rows: clamp(280px, 75vw, 480px); }
  .arena-grid.maximized .arena-quadrant.is-maximized { grid-column: 1; grid-row: 1; }
  .quadrant-pill-badge { font-size: 12px; }
  .quadrant-actions button, .quadrant-select-dropdown { min-height: 40px; }
  .arena-viewport-picker select { min-height: 40px; }
  #blind-vote-bar { gap: 8px; }
  #blind-vote-bar > strong, #blind-vote-result { width: 100%; margin-left: 0 !important; overflow-wrap: anywhere; }
  .table-wrap table { min-width: 820px; }
  th, td { padding: 12px; font-size: 13px; }
  .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .admin-tabs, .submit-tabs { overflow-x: auto; }
  .admin-tabs .btn, .submit-tabs .btn { flex-shrink: 0; white-space: nowrap; min-height: 42px; }
  .managed-content-row { flex-wrap: wrap; }
  .modal-backdrop { padding: 12px; }
  .modal-content { max-height: calc(100dvh - 24px) !important; }
  .modal-header, .modal-body, .modal-footer { padding: 16px; }
  .modal-header { gap: 12px; }
  .modal-header h3 { font-size: 16px; }
  .modal-header > button { flex-shrink: 0; min-width: 40px; min-height: 40px; }
  .modal-footer { flex-wrap: wrap; }
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .form-control, .auth-input { font-size: 16px; }
  .form-control { min-height: 44px; }
  .submission-preview { height: 300px; }
  .toast-container { right: 12px; left: 12px; bottom: 16px; }
  .toast { max-width: 100%; overflow-wrap: anywhere; }
}

@media (hover: none) {
  .result-overlay-cover { opacity: 1; }
  .result-overlay-cover { background: rgba(0, 0, 0, .15); }
}

@media (prefers-reduced-motion: reduce) {
  .nav-link, .account-chevron, .modal-backdrop { transition: none; }
}

.prompt-input-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.prompt-input-actions #raw-prompt-stats { flex: 1 1 240px; }
.prompt-source-link { display: inline-block; color: var(--text-secondary); font-size: .85rem; overflow-wrap: anywhere; margin: .5rem 0; }
#detail-description, #detail-meta, .prompt-inspector-description { overflow-wrap: anywhere; }
.form-group summary { cursor: pointer; color: var(--text-secondary); margin-bottom: 0.5rem; }
.catalog-pagination { display:flex; justify-content:center; margin:24px 0; }
