:root {
  color-scheme: dark;
  --bg-page: #09090B;
  --bg-surface: #101013;
  --bg-elevated: #16161A;
  --bg-inset: #0C0C0F;
  --border-hairline: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);
  --border-strong: rgba(255, 255, 255, 0.28);
  --text-primary: #FAFAFA;
  --text-secondary: #A1A1AA;
  --text-muted: #71717A;
  --accent-emerald: #10B981;
  --accent-danger: #EF4444;
  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Display", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
}

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

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ==================== TOP NAVIGATION ==================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 56px;
  background: rgba(9, 9, 11, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-hairline);
}

.topbar-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 14px;
  cursor: pointer;
}

.brand-mark {
  width: 20px;
  height: 20px;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  display: grid;
  place-items: center;
  background: var(--bg-elevated);
}

.brand-mark span {
  width: 6px;
  height: 6px;
  background: var(--text-primary);
  display: block;
}

.brand-sub {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 12px;
  margin-left: 6px;
  padding-left: 10px;
  border-left: 1px solid var(--border-hairline);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: color 0.15s, background-color 0.15s;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.nav-link.active {
  color: var(--text-primary);
  background: var(--bg-elevated);
  box-shadow: inset 0 0 0 1px var(--border-hairline);
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hairline);
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--border-hover);
  background: var(--bg-elevated);
}

.btn-primary {
  background: var(--text-primary);
  color: var(--bg-page);
  border-color: var(--text-primary);
}

.btn-primary:hover {
  background: #E4E4E7;
  border-color: #E4E4E7;
}

.btn-danger {
  border-color: rgba(239, 68, 68, 0.35);
  color: #FCA5A5;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.6);
}

.btn-sm {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  overflow: hidden;
  height: 32px;
  flex-shrink: 0;
}

.lang-switch button {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s;
}

.lang-switch button.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald);
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55);
  animation: pulseGlow 2.4s ease-out infinite;
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ==================== HERO & METRICS ==================== */
.hero {
  position: relative;
  padding: 56px 0 36px;
  border-bottom: 1px solid var(--border-hairline);
}

.hero::before {
  content: "";
  position: absolute;
  inset: -12px -40px 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse 68% 55% at 50% 0%, rgba(16, 185, 129, 0.085), transparent 72%),
    radial-gradient(ellipse 50% 45% at 85% 15%, rgba(99, 102, 241, 0.06), transparent 70%),
    radial-gradient(rgba(255, 255, 255, 0.065) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 24px 24px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.35) 75%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.35) 75%, transparent 100%);
}

@keyframes heroReveal {
  from {
    opacity: 0;
    transform: translateY(12px);
    filter: blur(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.reveal-1, .reveal-2, .reveal-3, .reveal-4, .reveal-5 {
  opacity: 0;
  animation: heroReveal 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.reveal-1 { animation-delay: 0.02s; }
.reveal-2 { animation-delay: 0.08s; }
.reveal-3 { animation-delay: 0.14s; }
.reveal-4 { animation-delay: 0.20s; }
.reveal-5 { animation-delay: 0.26s; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.hero-title {
  margin: 0 0 14px;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.12;
  max-width: 820px;
  background: linear-gradient(180deg, #FFFFFF 0%, #D4D4D8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-desc {
  margin: 0 0 32px;
  color: var(--text-secondary);
  font-size: 15px;
  max-width: 680px;
  line-height: 1.6;
}

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  overflow: hidden;
}

.metrics-strip-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.playbooks-banner {
  margin-top: 20px;
  padding: 16px 20px;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(22, 22, 26, 0.9), rgba(16, 16, 19, 0.95));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.playbooks-banner-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.playbooks-banner-desc {
  font-size: 12px;
  color: var(--text-secondary);
  max-width: 780px;
}

.metric-cell {
  padding: 18px 22px;
  border-right: 1px solid var(--border-hairline);
}

.metric-cell:last-child {
  border-right: none;
}

.metric-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 4px;
}

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

/* ==================== FILTER TOOLBAR ==================== */
.toolbar {
  padding: 24px 0 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.domain-tabs {
  display: inline-flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
}

.domain-tab {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

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

.domain-tab.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px var(--border-hairline);
}

.search-box {
  position: relative;
  width: 280px;
  max-width: 100%;
}

.search-box input {
  width: 100%;
  height: 34px;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 0 12px 0 32px;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s;
}

.search-box input:focus {
  border-color: var(--border-strong);
}

.search-box svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.direction-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.direction-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 4px;
}

.pill {
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border-hairline);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.pill.active {
  background: var(--text-primary);
  color: var(--bg-page);
  border-color: var(--text-primary);
  font-weight: 500;
}

/* ==================== DATASET GRID ==================== */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding-bottom: 64px;
}

.dataset-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.22s ease, background-color 0.22s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease;
}

.card-reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.38s cubic-bezier(0.22, 1, 0.36, 1), transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.22s ease, background-color 0.22s ease, box-shadow 0.22s ease;
}

.card-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.dataset-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-elevated);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--bg-inset);
  overflow: hidden;
  cursor: pointer;
  border-bottom: 1px solid var(--border-hairline);
}

.card-media img,
.card-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.dataset-card:hover .card-media img {
  transform: scale(1.035);
}

.card-media-hover-video {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.dataset-card:hover .card-media-hover-video.ready {
  opacity: 1;
}

.media-corner-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(9, 9, 11, 0.82);
  border: 1px solid var(--border-hairline);
  padding: 2px 7px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.media-play-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(9, 9, 11, 0.82);
  border: 1px solid var(--border-hover);
  padding: 3px 8px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

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

.card-subcat {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
}

.card-scale {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 500;
}

.card-title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
}

.card-title:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.card-spec-line {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.card-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-sample-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==================== DETAIL VIEW ==================== */
.detail-view {
  padding: 28px 0 72px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 22px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

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

.detail-header {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 28px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border-hairline);
  margin-bottom: 32px;
}

.detail-title {
  margin: 8px 0 12px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.detail-desc {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.65;
  margin: 0 0 18px;
}

.detail-directions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.spec-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.spec-panel-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-hairline);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-hairline);
  font-size: 13px;
}

.spec-row:last-child {
  border-bottom: none;
}

.spec-k {
  color: var(--text-muted);
}

.spec-v {
  font-family: var(--font-mono);
  color: var(--text-primary);
  text-align: right;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 18px;
}

.section-heading h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.samples-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.sample-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.22s ease, background-color 0.22s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease;
}

.sample-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-elevated);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.sample-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--bg-inset);
  overflow: hidden;
  border-bottom: 1px solid var(--border-hairline);
}

.sample-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.sample-card:hover .sample-thumb img {
  transform: scale(1.035);
}

.sample-info {
  padding: 12px 14px;
}

.sample-title {
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 4px;
}

.sample-caption {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sample-foot {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

/* ==================== NATIVE DIALOG INSPECTOR ==================== */
dialog.inspector-dialog {
  width: min(1100px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  color: var(--text-primary);
  overflow: hidden;
  margin: auto;
}

@keyframes dialogIn {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

dialog.inspector-dialog[open] {
  animation: dialogIn 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.inspector-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px;
  margin-top: auto;
}

.inspector-thumb {
  width: 58px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-hairline);
  background: var(--bg-inset);
  cursor: pointer;
  opacity: 0.55;
  padding: 0;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.inspector-thumb:hover {
  opacity: 0.9;
}

.inspector-thumb.active {
  opacity: 1;
  border-color: var(--text-primary);
  box-shadow: 0 0 0 1px var(--text-primary);
}

.inspector-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.kbd-hints {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.kbd-hints kbd {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid var(--border-hover);
  background: var(--bg-inset);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
}

dialog.inspector-dialog::backdrop {
  background: rgba(0, 0, 0, 0.84);
  backdrop-filter: blur(6px);
}

.inspector-layout {
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  min-height: 520px;
  max-height: calc(100vh - 42px);
}

.inspector-stage {
  background: #050507;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: 20px;
  border-right: 1px solid var(--border-hairline);
}

.inspector-stage img,
.inspector-stage video {
  max-width: 100%;
  max-height: 68vh;
  border-radius: var(--radius-sm);
  display: block;
}

.watermark-badge {
  position: absolute;
  bottom: 16px;
  left: 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.45);
  background: rgba(9, 9, 11, 0.65);
  padding: 3px 8px;
  border-radius: 3px;
  pointer-events: none;
}

.speed-bar {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

.inspector-sidebar {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.inspector-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.inspector-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

.inspector-caption {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
  margin: 0 0 18px;
}

.inspector-meta {
  border-top: 1px solid var(--border-hairline);
  margin-bottom: 18px;
}

.inspector-nav {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-hairline);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ==================== INQUIRY DRAWER & MODALS ==================== */
dialog.drawer-dialog {
  width: min(440px, 100vw);
  height: 100vh;
  max-height: 100vh;
  margin: 0 0 0 auto;
  padding: 0;
  border: none;
  border-left: 1px solid var(--border-hover);
  background: var(--bg-surface);
  color: var(--text-primary);
}

dialog.drawer-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.drawer-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 22px;
  overflow-y: auto;
}

.drawer-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0 22px;
}

.drawer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-group label {
  font-size: 12px;
  color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--bg-inset);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text-primary);
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--border-strong);
}

/* ==================== ADMIN CMS ==================== */
.admin-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-hairline);
  margin-bottom: 24px;
}

.admin-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

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

.data-table-wrap {
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  overflow-x: auto;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.data-table th {
  text-align: left;
  padding: 11px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-hairline);
  font-weight: 500;
}

table.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-hairline);
  vertical-align: middle;
}

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

.dropzone {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.dropzone.dragover {
  border-color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.06);
}

.upload-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
}

.passcode-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg-page);
  display: grid;
  place-items: center;
  padding: 20px;
}

.passcode-card {
  width: min(380px, 100%);
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 120;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hover);
  color: var(--text-primary);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.empty-state {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

dialog.modal-dialog {
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  padding: 24px;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  color: var(--text-primary);
  overflow-y: auto;
  margin: auto;
}

dialog.modal-dialog::backdrop {
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(4px);
}

@media (max-width: 1024px) {
  .catalog-grid,
  .samples-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metrics-strip,
  .metrics-strip-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .detail-header,
  .inspector-layout,
  .upload-layout,
  .direction-two-col {
    grid-template-columns: 1fr;
  }
  .inspector-stage {
    border-right: none;
    border-bottom: 1px solid var(--border-hairline);
  }
}

@media (max-width: 640px) {
  .catalog-grid,
  .samples-grid,
  .metrics-strip,
  .metrics-strip-5,
  .applications-grid,
  .playbook-links-grid {
    grid-template-columns: 1fr;
  }
  .brand-sub {
    display: none;
  }
}

@media (max-width: 820px) {
  .brand-sub {
    display: none;
  }
  .topbar-inner {
    gap: 8px;
  }
  .nav-actions {
    gap: 6px;
  }
  .nav-link {
    padding: 5px 8px;
    font-size: 12px;
  }
}

.playbook-typographic-sub {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}
.domain-tabs {
  flex-wrap: wrap;
}

.playbook-typographic-cover {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  background: radial-gradient(circle at top right, rgba(16, 185, 129, 0.14), rgba(12, 12, 15, 0.96) 68%);
  overflow: hidden;
}

.playbook-typographic-cover.cover-video {
  background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.18), rgba(12, 12, 15, 0.97) 70%);
}
.playbook-typographic-cover.cover-video span { color: #93C5FD; }

.playbook-typographic-cover.cover-world_model {
  background: radial-gradient(circle at top right, rgba(16, 185, 129, 0.18), rgba(12, 12, 15, 0.97) 70%);
}
.playbook-typographic-cover.cover-world_model span { color: #6EE7B7; }

.playbook-typographic-cover.cover-embodied {
  background: radial-gradient(circle at top right, rgba(245, 158, 11, 0.18), rgba(12, 12, 15, 0.97) 70%);
}
.playbook-typographic-cover.cover-embodied span { color: #FCD34D; }

.playbook-typographic-cover.cover-text {
  background: radial-gradient(circle at top right, rgba(148, 163, 184, 0.18), rgba(12, 12, 15, 0.97) 70%);
}
.playbook-typographic-cover.cover-text span { color: #CBD5E1; }

.playbook-typographic-cover.cover-agent {
  background: radial-gradient(circle at top right, rgba(139, 92, 246, 0.2), rgba(12, 12, 15, 0.97) 70%);
}
.playbook-typographic-cover.cover-agent span { color: #C4B5FD; }

.playbook-typographic-cover.cover-audio {
  background: radial-gradient(circle at top right, rgba(6, 182, 212, 0.18), rgba(12, 12, 15, 0.97) 70%);
}
.playbook-typographic-cover.cover-audio span { color: #67E8F9; }

.playbook-typographic-cover.cover-interleaved {
  background: radial-gradient(circle at top right, rgba(236, 72, 153, 0.16), rgba(12, 12, 15, 0.97) 70%);
}
.playbook-typographic-cover.cover-interleaved span { color: #F9A8D4; }

.cover-motif {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 88px;
  height: 88px;
  opacity: 0.28;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.35s ease;
}

.dataset-card:hover .cover-motif {
  opacity: 0.48;
  transform: scale(1.06);
}

@media (min-width: 1025px) {
  .detail-header .spec-panel {
    position: sticky;
    top: 76px;
    align-self: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal-1, .reveal-2, .reveal-3, .reveal-4, .reveal-5,
  .dataset-card.card-reveal,
  dialog.inspector-dialog[open],
  .status-dot {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
}

.playbook-typographic-cover span {
  font-size: 10px;
  color: var(--accent-emerald);
  letter-spacing: 0.06em;
}

.playbook-typographic-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
}

.playbook-card-summary {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.direction-hero {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-hairline);
  margin-bottom: 28px;
}

.direction-alt-title {
  font-size: 15px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.direction-two-col {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
}

.playbook-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 20px 22px;
}

.playbook-panel h2,
.playbook-section h2 {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.playbook-section {
  margin-bottom: 36px;
}

.playbook-prose p {
  margin: 0 0 10px;
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.65;
}

.playbook-prose p:last-child {
  margin-bottom: 0;
}

.applications-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.app-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

.app-card h4 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.app-card p {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.materials-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.material-case-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

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

.material-case-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.material-case-desc {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.code-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6EE7B7;
}

.material-images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.material-img-card {
  position: relative;
  background: var(--bg-inset);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.material-img-card:hover {
  border-color: var(--border-strong);
}

.material-img-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}

.material-img-foot {
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-hairline);
}

.playbook-links-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.playbook-mini-card {
  display: block;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.playbook-mini-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-elevated);
}

.playbook-mini-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.playbook-mini-summary {
  font-size: 12px;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==================== ROUTE TRANSITIONS & REVEALS ==================== */
.route-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  z-index: 200;
  pointer-events: none;
  transform-origin: left center;
  transform: scaleX(0);
  opacity: 0;
  background: linear-gradient(90deg, var(--accent-emerald), #6EE7B7, #FFFFFF);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
}

.route-progress-bar.active {
  opacity: 1;
  transform: scaleX(0.76);
}

.route-progress-bar.done {
  opacity: 0;
  transform: scaleX(1);
  transition: transform 0.16s ease, opacity 0.22s ease 0.12s;
}

#appMain {
  transition: opacity 0.16s cubic-bezier(0.4, 0, 1, 1), transform 0.16s cubic-bezier(0.4, 0, 1, 1);
}

#appMain.view-leaving {
  opacity: 0;
  transform: translateY(-8px) scale(0.994);
  pointer-events: none;
}

@keyframes viewEnter {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.994);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#appMain.view-entering {
  animation: viewEnter 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .route-progress-bar {
    display: none;
  }
  #appMain,
  #appMain.view-leaving,
  #appMain.view-entering {
    transition: none;
    animation: none;
    opacity: 1;
    transform: none;
  }
  .card-reveal,
  .dataset-card.card-reveal {
    opacity: 1;
    transform: none;
    transition: border-color 0.22s ease, background-color 0.22s ease, box-shadow 0.22s ease;
  }
}

/* ==================== CONTENT PROTECTION & PRIVACY SHIELD ==================== */
body.protected-view {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

body.protected-view input,
body.protected-view textarea,
body.protected-view select {
  user-select: text;
  -webkit-user-select: text;
}

body.protected-view img,
body.protected-view video {
  -webkit-user-drag: none;
  user-drag: none;
}

body.protected-view header.topbar,
body.protected-view #appMain,
body.protected-view .inspector-layout {
  transition: filter 0.16s ease;
}

body.protected-view.privacy-blurred header.topbar,
body.protected-view.privacy-blurred #appMain,
body.protected-view.privacy-blurred dialog.inspector-dialog[open] .inspector-layout {
  filter: blur(20px) brightness(0.6);
  transition: none;
}

.page-blur-shield {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(9, 9, 11, 0.56);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}

body.protected-view.privacy-blurred .page-blur-shield {
  opacity: 1;
  pointer-events: auto;
  transition: none;
}

.inspector-blur-shield {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(9, 9, 11, 0.56);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}

body.protected-view.privacy-blurred dialog.inspector-dialog[open] .inspector-blur-shield {
  opacity: 1;
  pointer-events: auto;
  transition: none;
}

.privacy-blur-card {
  max-width: 460px;
  text-align: center;
  padding: 22px 26px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: rgba(16, 16, 20, 0.92);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
}

.privacy-blur-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.14);
  color: #6EE7B7;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.privacy-blur-desc {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.6;
}

body.protected-view .card-media::after,
body.protected-view .sample-thumb::after,
body.protected-view .material-img-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image: var(--media-watermark);
  background-repeat: repeat;
}

body.protected-view .card-media:has(.playbook-typographic-cover)::after {
  display: none;
}

body.protected-view .media-corner-tag,
body.protected-view .media-play-badge {
  z-index: 3;
}

.stage-watermark-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background-repeat: repeat;
}

@media print {
  body.protected-view {
    display: none !important;
  }
}

/* ==================== AUDIO INSPECTOR & ADMIN UPLOADER QUEUE ==================== */
.audio-inspector-stage {
  width: 100%;
  height: 100%;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 32px;
  background: radial-gradient(circle at center, rgba(6, 182, 212, 0.14), rgba(12, 12, 16, 0.96) 72%);
}

.audio-inspector-stage .cover-motif {
  position: static;
  width: 64px;
  height: 64px;
  opacity: 0.75;
  color: #67E8F9;
}

.audio-inspector-stage audio {
  width: min(460px, 92%);
  position: relative;
  z-index: 12;
}

.upload-queue {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  max-height: 320px;
  overflow-y: auto;
}

.upload-queue-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hairline);
  background: var(--bg-surface);
}

.upload-queue-thumb {
  width: 56px;
  height: 40px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-hairline);
  background: var(--bg-inset);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
}

.upload-queue-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.upload-size-warn {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #FCD34D;
  font-size: 11px;
}

.upload-progress-wrap {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hairline);
  background: var(--bg-surface);
}

.upload-progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--bg-inset);
  overflow: hidden;
  margin-top: 6px;
}

.upload-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-emerald), #6EE7B7);
  transition: width 0.12s linear;
}
