:root {
  --primary: #2457d6;
  --primary-2: #1d4ed8;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --text: #172033;
  --muted: #6b7280;
  --border: #e5e7eb;
  --brand: #2457d6;
  --brand-2: #0f766e;
  --danger: #dc2626;
  --warning: #f59e0b;
  --shadow: 0 18px 40px rgba(15, 23, 42, .10);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(circle at top left, #eaf0ff 0, transparent 34%), var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
img, video { max-width: 100%; display: block; }

.auth-body {
  display: grid;
  place-items: center;
  padding: 32px 16px;
}
.auth-card {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  overflow: hidden;
  border-radius: 30px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.auth-hero {
  min-height: 620px;
  padding: 46px;
  color: #fff;
  background: linear-gradient(140deg, rgba(16, 24, 40, .8), rgba(36, 87, 214, .78)), url('../images/background1.png') center/cover;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.auth-hero h1 { margin: 0 0 18px; font-size: 42px; line-height: 1.15; letter-spacing: -.04em; }
.auth-hero p { margin: 0; color: rgba(255,255,255,.82); font-size: 17px; line-height: 1.8; }
.auth-panel { padding: 54px 46px; align-self: center; }
.auth-panel h2 { margin: 0 0 8px; font-size: 30px; }
.auth-panel .hint { margin-bottom: 28px; color: var(--muted); }

.form-grid { display: grid; gap: 16px; }
.field { display: grid; gap: 8px; }
.field label { font-size: 14px; color: #374151; font-weight: 650; }
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  padding: 13px 14px;
  outline: none;
  transition: border .2s, box-shadow .2s;
}
.field textarea { min-height: 130px; resize: vertical; line-height: 1.65; }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: rgba(36,87,214,.5);
  box-shadow: 0 0 0 4px rgba(36,87,214,.11);
}

.btn {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  background: #eef2ff;
  color: #243b72;
  font-weight: 700;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(15,23,42,.10); }
.btn.primary { background: var(--brand); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn.danger { background: #fee2e2; color: var(--danger); }
.btn.small { padding: 8px 12px; border-radius: 10px; font-size: 13px; }
.btn.full { width: 100%; }

.message { min-height: 22px; color: var(--danger); font-size: 14px; }
.message.success { color: var(--brand-2); }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(18px);
  border-right: 1px solid var(--border);
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  font-weight: 900;
  font-size: 18px;
}
.logo-mark {
  width: 42px; height: 42px;
  border-radius: 14px;
  display: grid; place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #7c3aed);
  box-shadow: 0 12px 24px rgba(36,87,214,.25);
}
.nav { display: grid; gap: 8px; }
.nav a, .nav button {
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  background: transparent;
  color: #475569;
  font-weight: 700;
}
.nav a.active, .nav a:hover, .nav button:hover { background: #edf2ff; color: var(--brand); }
.sidebar-footer { position: absolute; left: 18px; right: 18px; bottom: 22px; color: var(--muted); font-size: 13px; }
.main { padding: 28px clamp(18px, 3vw, 42px); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.topbar h1 { margin: 0; font-size: clamp(26px, 4vw, 42px); letter-spacing: -.04em; }
.topbar p { margin: 8px 0 0; color: var(--muted); }
.user-pill { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 999px; background: var(--panel); box-shadow: 0 8px 20px rgba(15,23,42,.07); }
.user-pill img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: #e5e7eb; }

.toolbar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  margin-bottom: 22px;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
}
.search-box input { flex: 1; border: 0; outline: 0; padding: 14px 0; background: transparent; }
.segmented { display: flex; flex-wrap: wrap; gap: 8px; }
.segmented button {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 9px 13px;
  color: #475569;
  font-weight: 700;
}
.segmented button.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { padding: 20px; border-radius: var(--radius); background: var(--panel); box-shadow: 0 10px 26px rgba(15,23,42,.06); }
.stat-card span { color: var(--muted); font-size: 14px; }
.stat-card strong { display: block; margin-top: 8px; font-size: 32px; }

.section { margin: 30px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section h2 { margin: 0; font-size: 24px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.card {
  background: var(--panel);
  border: 1px solid rgba(226,232,240,.9);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 14px 30px rgba(15,23,42,.06);
  transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-media { height: 178px; background: #e5e7eb; overflow: hidden; position: relative; }
.card-media img, .card-media video { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 16px; }
.card-body h3 { margin: 0 0 10px; font-size: 17px; line-height: 1.45; }
.card-body p { margin: 0; color: var(--muted); line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tag { display: inline-flex; align-items: center; border-radius: 999px; background: #eff6ff; color: #1d4ed8; padding: 5px 9px; font-size: 12px; font-weight: 800; }

.detail-hero {
  border-radius: 28px;
  min-height: 340px;
  padding: 32px;
  color: #fff;
  background: linear-gradient(120deg, rgba(15,23,42,.8), rgba(15,23,42,.22)), var(--hero-image) center/cover;
  display: flex;
  align-items: end;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.detail-hero h1 { margin: 0 0 10px; font-size: clamp(28px, 4vw, 48px); line-height: 1.15; max-width: 980px; }
.detail-hero p { max-width: 850px; margin: 0; color: rgba(255,255,255,.82); line-height: 1.75; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 22px; padding: 22px; box-shadow: 0 10px 26px rgba(15,23,42,.06); }
.two-col { display: grid; grid-template-columns: 1.25fr .75fr; gap: 18px; align-items: start; }
.timeline { display: grid; gap: 14px; }
.timeline-item { display: grid; grid-template-columns: 44px 1fr; gap: 14px; }
.timeline-no { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #edf2ff; color: var(--brand); font-weight: 900; }
.timeline-content { padding: 14px; border-radius: 16px; border: 1px solid var(--border); background: var(--panel-2); }
.timeline-content h3 { margin: 0 0 8px; font-size: 16px; }
.timeline-content p { margin: 6px 0; color: var(--muted); line-height: 1.65; white-space: pre-line; }
.timeline-content img { margin-top: 10px; border-radius: 12px; width: 100%; max-height: 220px; object-fit: cover; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.media-grid img, .media-grid video { width: 100%; height: 160px; object-fit: cover; border-radius: 16px; background: #e5e7eb; }

.card-detail-grid { display: grid; grid-template-columns: 380px 1fr; gap: 20px; align-items: start; }
.preview-card { position: sticky; top: 24px; }
.preview-card img { width: 100%; border-radius: 18px; background: #e5e7eb; object-fit: cover; }
.preview-card .small-images { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.preview-card .small-images img { height: 150px; }
.flow-list { display: grid; gap: 10px; }
.flow-row { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; }
.flow-row input { padding: 12px; border: 1px solid var(--border); border-radius: 12px; }
.empty { padding: 30px; text-align: center; color: var(--muted); background: #fff; border: 1px dashed #cbd5e1; border-radius: 18px; }
.table-wrap { overflow-x: auto; border-radius: 18px; border: 1px solid var(--border); background: #fff; }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th, td { padding: 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { background: #f8fafc; font-size: 13px; color: #475569; }
td { color: #334155; line-height: 1.55; }
.avatar { width: 54px; height: 54px; object-fit: cover; border-radius: 16px; }

.media-tile {
  position: relative;
  display: block;
  width: 100%;
  min-height: 160px;
  padding: 0;
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  background: #e5e7eb;
  box-shadow: 0 10px 24px rgba(15,23,42,.08);
  cursor: zoom-in;
}
.media-tile img,
.media-tile video {
  width: 100%;
  height: 180px;
  object-fit: cover;
  transition: transform .25s ease, filter .25s ease;
}
.media-tile:hover img,
.media-tile:hover video,
.media-tile:focus-visible img,
.media-tile:focus-visible video {
  transform: scale(1.045);
  filter: brightness(.84);
}
.media-tile:focus-visible {
  outline: 4px solid rgba(36,87,214,.22);
  outline-offset: 3px;
}
.media-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #fff;
  background: rgba(15,23,42,.68);
  backdrop-filter: blur(8px);
  font-size: 12px;
  font-weight: 800;
}
.media-zoom-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -45%);
  opacity: 0;
  padding: 9px 13px;
  border-radius: 999px;
  color: #fff;
  background: rgba(15,23,42,.72);
  font-size: 13px;
  font-weight: 800;
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
  white-space: nowrap;
}
.media-tile:hover .media-zoom-hint,
.media-tile:focus-visible .media-zoom-hint {
  opacity: 1;
  transform: translate(-50%, -50%);
}

body.viewer-open { overflow: hidden; }
.media-viewer[hidden] { display: none !important; }
.media-viewer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 26px;
}
.media-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2,6,23,.78);
  backdrop-filter: blur(10px);
}
.media-viewer-dialog {
  position: relative;
  z-index: 1;
  width: min(1180px, 96vw);
  max-height: 94vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(0,0,0,.36);
}
.media-viewer-header,
.media-viewer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.media-viewer-footer { border-top: 1px solid var(--border); border-bottom: 0; }
.media-viewer-header h2 { margin: 0; font-size: 18px; }
.media-viewer-header p { margin: 4px 0 0; }
.media-viewer-close {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 28px;
  line-height: 1;
}
.media-viewer-close:hover { background: #e2e8f0; }
.media-viewer-body {
  min-height: 260px;
  max-height: calc(94vh - 132px);
  display: grid;
  place-items: center;
  overflow: auto;
  background: #0f172a;
}
.media-viewer-body img,
.media-viewer-body video {
  width: 100%;
  height: 100%;
  max-height: calc(94vh - 132px);
  object-fit: contain;
  background: #0f172a;
}
.media-viewer-body video { min-height: 360px; }
.media-viewer-footer .btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

@media (max-width: 960px) {
  .auth-card, .app-shell, .two-col, .card-detail-grid { grid-template-columns: 1fr; }
  .auth-hero { min-height: 320px; }
  .sidebar { position: static; height: auto; }
  .sidebar-footer { position: static; margin-top: 28px; }
  .toolbar { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .preview-card { position: static; }
}

/* === media viewer v4 patch: detail navigation, visible active text and reliable preview === */
.detail-tabs {
  position: sticky;
  top: 18px;
  z-index: 20;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}
.detail-tab,
.section-title-button {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text) !important;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 10px 16px;
  min-height: 42px;
  line-height: 1.2;
  transition: 0.18s ease;
}
.detail-tab:hover,
.section-title-button:hover {
  transform: translateY(-1px);
  background: #eef4ff;
  border-color: rgba(36, 87, 214, 0.35);
  color: var(--brand) !important;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.12);
}
.detail-tab.active,
.detail-tab[aria-current="true"] {
  transform: translateY(-1px);
  background: var(--brand) !important;
  border-color: var(--brand) !important;
  color: #fff !important;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
}
.section-title-button {
  font-size: 22px;
  padding: 8px 14px;
}
.media-section-head { align-items: center; }
[data-detail-section] { scroll-margin-top: 110px; }
.media-grid-highlight {
  animation: mediaPulse 0.9s ease;
}
@keyframes mediaPulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
  70% { box-shadow: 0 0 0 14px rgba(37, 99, 235, 0); }
  100% { box-shadow: none; }
}
.media-tile {
  appearance: none;
  -webkit-appearance: none;
}
.media-tile,
#mediaGrid img,
#mediaGrid video,
.mold-pictures-container img,
.mold-pictures-container video {
  cursor: zoom-in;
}
#mediaGrid video,
.mold-pictures-container video {
  cursor: pointer;
}
body.viewer-open { overflow: hidden; }
.media-viewer { z-index: 99999; }
@media (max-width: 720px) {
  .detail-tabs { top: 8px; }
  .detail-tab { padding: 8px 12px; }
  .section-title-button { font-size: 18px; }
}

/* === interaction v5: robust tabs, theme intro, blueprint actions, card image preview, persona linkage === */
.detail-tabs {
  position: sticky;
  top: 18px;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 18px;
  padding: 10px;
  border: 1px solid #dbe4f0;
  border-radius: 18px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 18px 40px rgba(15,23,42,.10);
}
.detail-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid #dbe4f0 !important;
  border-radius: 999px;
  background: #ffffff !important;
  color: #10233f !important;
  font-size: 0 !important;
  font-weight: 800 !important;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  opacity: 1 !important;
  filter: none !important;
}
.detail-tab::before {
  content: attr(data-label);
  display: inline-block;
  color: #10233f !important;
  font-size: 15px;
  line-height: 1.2;
}
.detail-tab span { display: none !important; }
.detail-tab:hover {
  transform: translateY(-1px);
  background: #eff6ff !important;
  border-color: #93b4ff !important;
  box-shadow: 0 10px 22px rgba(37,99,235,.12);
}
.detail-tab:hover::before { color: #1d4ed8 !important; }
.detail-tab.active,
.detail-tab[aria-current="true"] {
  background: #eaf1ff !important;
  border-color: #2f67e8 !important;
  box-shadow: inset 0 0 0 1px rgba(47,103,232,.35), 0 12px 24px rgba(37,99,235,.16);
}
.detail-tab.active::before,
.detail-tab[aria-current="true"]::before {
  color: #0b2f80 !important;
}
.section-title-button {
  background: transparent !important;
  border: 0 !important;
  color: #0f172a !important;
  padding: 0 !important;
  border-radius: 0 !important;
  font-size: 24px !important;
  font-weight: 900 !important;
  box-shadow: none !important;
}
.section-title-button:hover { color: #1d4ed8 !important; transform: none !important; }

.theme-intro-list { display: grid; gap: 18px; }
.theme-intro-card {
  display: grid;
  grid-template-columns: minmax(260px, 430px) 1fr;
  gap: 18px;
  align-items: stretch;
}
.theme-image-button {
  position: relative;
  display: block;
  width: 100%;
  min-height: 280px;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  overflow: hidden;
  background: #e5e7eb;
  cursor: zoom-in;
  box-shadow: 0 14px 30px rgba(15,23,42,.08);
}
.theme-image-button img { width: 100%; height: 100%; min-height: 280px; object-fit: cover; transition: transform .22s ease, filter .22s ease; }
.theme-image-button span {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -44%);
  opacity: 0;
  color: #fff;
  background: rgba(15,23,42,.72);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 800;
  transition: opacity .18s ease, transform .18s ease;
}
.theme-image-button:hover img { transform: scale(1.035); filter: brightness(.82); }
.theme-image-button:hover span { opacity: 1; transform: translate(-50%, -50%); }
.theme-text-card {
  min-height: 280px;
  padding: 24px;
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  background: linear-gradient(180deg, #fff, #f8fbff);
  box-shadow: 0 14px 30px rgba(15,23,42,.06);
}
.eyebrow { margin-bottom: 10px; color: #2457d6; font-size: 13px; font-weight: 900; letter-spacing: .08em; }
.theme-text-card h3 { margin: 0 0 12px; font-size: 22px; line-height: 1.35; }
.theme-text-card p { margin: 0; color: #334155; line-height: 1.85; white-space: pre-line; }

.blueprint-content { padding: 18px; }
.blueprint-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.tag-muted { color: #64748b; background: #f1f5f9; }
.blueprint-visuals { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }
.blueprint-media-tile img,
.blueprint-media-tile video { height: 190px; }
.blueprint-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.blueprint-card-button.disabled { opacity: .72; cursor: not-allowed; transform: none; box-shadow: none; }
.blueprint-tip { font-size: 13px; }

.preview-card .small-images { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.preview-media-button {
  position: relative;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  background: #e5e7eb;
  cursor: zoom-in;
}
.preview-media-button img { width: 100%; border-radius: 18px; background: #e5e7eb; object-fit: cover; transition: transform .22s ease, filter .22s ease; }
.preview-main-image img { min-height: 260px; max-height: 520px; }
.preview-media-button span {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -44%);
  opacity: 0;
  color: #fff;
  background: rgba(15,23,42,.74);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.preview-media-button:hover img { transform: scale(1.035); filter: brightness(.82); }
.preview-media-button:hover span { opacity: 1; transform: translate(-50%, -50%); }

.persona-module { display: grid; gap: 18px; }
.persona-explain h2,
.persona-logic-card h3 { margin-top: 0; }
.persona-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 14px 0;
}
.persona-flow span,
.mini-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 11px;
  background: #eef4ff;
  color: #1d4ed8;
  font-weight: 800;
  font-size: 13px;
}
.persona-flow b { color: #94a3b8; }
.persona-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 18px; }
.persona-list-card,
.persona-detail-card { display: grid; gap: 16px; }
.persona-profile { display: grid; grid-template-columns: 88px 1fr; gap: 14px; align-items: center; }
.persona-profile img { width: 88px; height: 88px; object-fit: cover; border-radius: 22px; background: #e5e7eb; }
.persona-profile h3 { margin: 0 0 6px; font-size: 22px; }
.persona-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.persona-block { padding: 14px; border: 1px solid #e2e8f0; border-radius: 16px; background: #f8fafc; }
.persona-block h4 { margin: 0 0 8px; font-size: 15px; }
.persona-block p,
.persona-block li { color: #475569; line-height: 1.7; white-space: pre-line; }
.persona-block ul { margin: 0; padding-left: 18px; }
.persona-linkage { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mini-pill-list,
.mini-link-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.mini-link {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 11px;
  background: #fff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-weight: 800;
  font-size: 13px;
}
.persona-card-footer { display: flex; justify-content: flex-end; }
code { color: #0f766e; background: #ecfdf5; border-radius: 6px; padding: 1px 5px; }

@media (max-width: 960px) {
  .theme-intro-card,
  .persona-columns,
  .persona-linkage { grid-template-columns: 1fr; }
  .theme-image-button,
  .theme-image-button img { min-height: 220px; }
}
@media (max-width: 720px) {
  .detail-tabs { top: 8px; }
  .detail-tab { min-width: auto; padding: 8px 12px; }
  .detail-tab::before { font-size: 14px; }
  .persona-profile { grid-template-columns: 1fr; }
}

/* === interaction v6: delivery cleanup + example creation === */
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.result-summary { margin: 10px 0 0; color: #23304a; font-weight: 700; }
.section-head .muted,
.media-section-head .muted,
.blueprint-tip,
.persona-logic-card { display: none !important; }

/* Button text visibility: use real text, no pseudo-label fallback. */
.detail-tab {
  font-size: 15px !important;
  color: #10233f !important;
  background: #ffffff !important;
  min-width: 96px;
}
.detail-tab::before { content: none !important; display: none !important; }
.detail-tab span { display: inline !important; color: inherit !important; font-size: 15px !important; }
.detail-tab.active,
.detail-tab[aria-current="true"] {
  color: #0b2f80 !important;
  background: #eaf1ff !important;
  border-color: #2f67e8 !important;
}
.detail-tab.active span,
.detail-tab[aria-current="true"] span { color: #0b2f80 !important; }

.persona-meta { margin: 4px 0 0; color: #475569; line-height: 1.65; }
.example-editor-grid { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 20px; align-items: start; }
.example-live-preview { position: sticky; top: 24px; }
.example-live-preview > img { width: 100%; height: 220px; border-radius: 18px; object-fit: cover; background: #e5e7eb; }
.example-live-preview h2 { margin: 14px 0 8px; line-height: 1.35; }
.example-live-preview p { margin: 0; color: #334155; line-height: 1.7; white-space: pre-line; }
.form-section { display: grid; gap: 14px; padding-bottom: 20px; border-bottom: 1px solid #edf2f7; }
.form-section:last-of-type { border-bottom: 0; }
.form-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.compact-head { margin: 0; align-items: center; }
.dynamic-list { display: grid; gap: 14px; }
.dynamic-row { display: grid; gap: 12px; padding: 16px; border: 1px solid #e2e8f0; border-radius: 18px; background: #f8fafc; }
.dynamic-row-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.compact-media-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.compact-media-grid .empty { min-height: 0; padding: 0; border: 0; background: transparent; }
@media (max-width: 1100px) { .example-editor-grid { grid-template-columns: 1fr; } .example-live-preview { position: static; } }
@media (max-width: 720px) { .form-two-col, .topbar { grid-template-columns: 1fr; } .topbar { align-items: flex-start; } }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* === admin v7: roles, audit workflow and admin dashboard === */
.auth-hero > p:last-child:empty { display: none; }
.user-pill span { display: grid; line-height: 1.2; }
.user-pill em { font-style: normal; color: #64748b; font-size: 12px; font-weight: 600; }
.admin-main .subtle { color: #64748b; margin-top: 6px; }
.admin-stats { grid-template-columns: repeat(5, minmax(140px, 1fr)); }
.stat-card.warning { border-color: #facc15; background: linear-gradient(180deg, #fffbeb, #fff); }
.admin-section { margin-top: 24px; }
.admin-list { display: grid; gap: 12px; }
.submission-card {
  display: flex; justify-content: space-between; gap: 14px; align-items: center;
  padding: 16px; border: 1px solid #e2e8f0; border-radius: 18px; background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
}
.submission-card.pending { border-left: 5px solid #2563eb; }
.submission-card.approved { border-left: 5px solid #16a34a; }
.submission-card.rejected { border-left: 5px solid #ef4444; }
.submission-main strong { font-size: 16px; color: #0f172a; }
.submission-main p { margin: 6px 0 8px; color: #64748b; }
.status-pending { background: #dbeafe; color: #1d4ed8; }
.status-approved { background: #dcfce7; color: #15803d; }
.status-rejected { background: #fee2e2; color: #b91c1c; }
.admin-tag { background: #eef2ff; color: #3730a3; }
.table-wrap { overflow-x: auto; border: 1px solid #e2e8f0; border-radius: 18px; background: #fff; }
.data-table { width: 100%; border-collapse: collapse; min-width: 780px; }
.data-table th, .data-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #edf2f7; vertical-align: top; }
.data-table th { color: #475569; background: #f8fafc; font-size: 13px; white-space: nowrap; }
.data-table td { color: #1e293b; font-size: 14px; }
.data-table tr:last-child td { border-bottom: 0; }
.admin-two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.panel-card { border: 1px solid #e2e8f0; border-radius: 18px; background: #fff; padding: 16px; }
.panel-card h3 { margin: 0 0 12px; }
.bar-chart { min-height: 170px; display: flex; align-items: end; gap: 8px; padding: 12px; border-radius: 14px; background: #f8fafc; overflow-x: auto; }
.bar-item { display: grid; align-items: end; justify-items: center; gap: 6px; min-width: 34px; }
.bar-item span { width: 22px; border-radius: 999px 999px 4px 4px; background: linear-gradient(180deg, #3b82f6, #1d4ed8); }
.bar-item em { font-style: normal; font-size: 11px; color: #64748b; writing-mode: vertical-rl; transform: rotate(180deg); }
.pill-list { display: flex; flex-wrap: wrap; gap: 8px; }
.review-dialog { border: 0; border-radius: 24px; padding: 0; width: min(920px, calc(100vw - 32px)); box-shadow: 0 28px 80px rgba(15, 23, 42, .28); }
.review-dialog::backdrop { background: rgba(15, 23, 42, .45); backdrop-filter: blur(4px); }
.review-dialog-inner { display: grid; gap: 16px; padding: 22px; max-height: 86vh; overflow: auto; }
.review-dialog-inner header, .review-dialog-inner footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.review-summary { display: grid; gap: 8px; padding: 14px; border-radius: 16px; background: #f8fafc; }
.review-row { display: grid; grid-template-columns: 90px 1fr; gap: 12px; }
.review-row span { color: #64748b; }
.review-row strong { color: #0f172a; white-space: pre-wrap; }
.payload-preview { max-height: 280px; overflow: auto; background: #0f172a; color: #e2e8f0; border-radius: 16px; padding: 14px; font-size: 12px; line-height: 1.55; }
.message.success { color: #15803d; }
@media (max-width: 1100px) { .admin-stats { grid-template-columns: repeat(2, 1fr); } .admin-two-col { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .submission-card { align-items: flex-start; flex-direction: column; } .admin-stats { grid-template-columns: 1fr; } .review-row { grid-template-columns: 1fr; } }

/* === v8: production auth, audit prompt and maintenance actions === */
.identity-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 6px;
  border-radius: 16px;
  background: #eef4ff;
  border: 1px solid #dbe7ff;
}
.identity-switch label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 12px;
  font-weight: 800;
  color: #25406f;
  cursor: pointer;
}
.identity-switch input { accent-color: var(--brand); }
.identity-switch label:has(input:checked) {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .10);
}
.inline-control { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.inline-control .btn { white-space: nowrap; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; color: #2457d6; font-weight: 750; }
.auth-links a:hover { text-decoration: underline; }
.empty-action {
  display: grid;
  gap: 14px;
  justify-items: center;
  color: #475569;
}
.focus-section {
  border-color: rgba(36, 87, 214, .45) !important;
  box-shadow: 0 0 0 4px rgba(36, 87, 214, .10);
  border-radius: 20px;
  transition: box-shadow .25s, border .25s;
}
.audit-note {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 13px;
  line-height: 1.6;
}
.admin-phone { color: #475569; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
@media (max-width: 640px) {
  .inline-control { grid-template-columns: 1fr; }
  .identity-switch { grid-template-columns: 1fr; }
  .auth-links { flex-direction: column; }
}

/* v9: admin supreme management + message center */
.nav a { position: relative; }
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-left: 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  line-height: 1;
}
.nav-badge[hidden] { display: none !important; }
.admin-three-col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.compact-list {
  display: grid;
  gap: 10px;
  max-height: 540px;
  overflow: auto;
  padding-right: 4px;
}
.compact-item {
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}
.compact-item strong {
  display: block;
  color: #0f172a;
  line-height: 1.35;
  margin-bottom: 4px;
}
.compact-item p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.55;
}
.compact-actions,
.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.table-actions { margin-top: 0; }
.btn.tiny {
  min-height: 28px;
  padding: 5px 9px;
  font-size: 12px;
  border-radius: 9px;
}
.admin-form .field { margin-bottom: 12px; }
.form-grid.two-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.form-grid .full { grid-column: 1 / -1; }
.message-list {
  display: grid;
  gap: 14px;
}
.message-card {
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}
.message-card.unread {
  border-color: #2563eb;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.12);
}
.message-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}
.message-card h3 {
  margin: 0 0 5px;
  color: #0f172a;
}
.message-content {
  white-space: pre-wrap;
  color: #334155;
  line-height: 1.75;
  margin: 0;
}
.message-card footer {
  margin-top: 14px;
}
.danger-text { color: #dc2626; }
@media (max-width: 1200px) {
  .admin-three-col { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .form-grid.two-cols { grid-template-columns: 1fr; }
  .message-card header { flex-direction: column; }
}
