/* Studio preview — overlay only. ?preview=studio
   Dashboard: cards, current paper.
   Dossier: person chrome + place-nav of what this record contains. */

body.preview-studio .studio-preview-bar {
  background: #1C1917;
  color: #F8F7F6;
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 8px 24px;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
}
body.preview-studio .studio-preview-bar a { color: #E8C39A; text-decoration: none; }
body.preview-studio .studio-preview-bar a:hover { text-decoration: underline; }

body.preview-studio .logo-tagline { display: none; }
body.preview-studio a.nav-link[href="/invite"],
body.preview-studio a.nav-link[href="/demo"],
body.preview-studio a.nav-link[href="/pricing"],
body.preview-studio a.nav-link[href="/faq"] { display: none; }
body.preview-studio .nav-right > .lang-menu:first-of-type { display: none; }

body.preview-studio .sg-container > h1,
body.preview-studio .sg-profile-card h3 {
  font-family: Newsreader, Georgia, serif;
  font-weight: 500;
  letter-spacing: -0.03em;
}
body.preview-studio .sg-container > h1 {
  font-size: 3rem !important;
  font-weight: 500 !important;
}
body.preview-studio .sg-profile-card {
  padding: 22px;
  min-height: 168px;
  border-left-color: transparent;
}
body.preview-studio .sg-profile-card.border-sparse,
body.preview-studio .sg-profile-card.border-moderate,
body.preview-studio .sg-profile-card.border-rich {
  border-left-color: transparent;
}
body.preview-studio .sg-profile-card h3 { font-size: 1.55rem; margin-bottom: 6px; line-height: 1.2; }
body.preview-studio .profile-photo {
  width: 96px;
  height: 96px;
  border-radius: 8px;
  margin: 0;
}
body.preview-studio .card-add { min-height: 168px !important; }

body.preview-studio .data-row.child { padding-left: 64px; }
body.preview-studio .data-row.child.detail-prose { display: block; padding-right: 24px; }
body.preview-studio .section-children { display: none; }
body.preview-studio .section-children.show { display: block; }
body.preview-studio .data-row-children { display: none; }
body.preview-studio .data-row-children.show { display: block; }

/* Dossier shell */
body.preview-studio:has(.ds-app) {
  overflow: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
}
body.preview-studio:has(.ds-app) .nav { display: none; }

.ds-app {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.ds-top {
  height: 72px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.ds-logo { text-decoration: none; font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; padding-right: 20px; border-right: 1px solid var(--border); }
.ds-person {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.ds-person-name { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.ds-person-meta { font-size: 13px; color: var(--text-muted); margin-top: 1px; }
.ds-avatar {
  width: 48px;
  height: 48px;
  border-radius: 0;
  object-fit: cover;
  flex-shrink: 0;
}
.ds-avatar-fallback {
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.ds-top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.ds-icon { color: var(--text-muted); text-decoration: none; padding: 4px 6px; font-size: 1.1rem; }
.ds-icon:hover { color: var(--accent); }

.ds-body { flex: 1; min-height: 0; display: flex; }
.ds-side {
  width: 220px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 8px 0 24px;
  background: #E4E0DA;
  border-right: 1px solid #D4CFC8;
}
.ds-nav-label {
  font-size: 10px;
  font-weight: 700;
  color: #8A847C;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 18px 16px 6px;
}
.ds-nav-label:first-child { padding-top: 8px; }
.ds-nav-item {
  display: block;
  position: relative;
  padding: 8px 16px 8px 20px;
  font-size: 14px;
  font-weight: 500;
  color: #1C1917;
  text-decoration: none;
}
.ds-nav-item:hover { background: rgba(255,255,255,0.55); }
.ds-nav-item.active {
  color: #1C1917;
  font-weight: 600;
  background: var(--bg-card);
}
.ds-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
}

.ds-main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 24px 32px 48px;
}
.ds-main > .data-card { display: none; margin-bottom: 0; }
.ds-main > .data-card.ds-active { display: block; background: transparent; border: none; border-radius: 0; }
.ds-main > .data-card.ds-active .data-card-indicator { display: none; }
.ds-main > .data-card.ds-active .data-card-header { padding: 0 0 16px; align-items: flex-end; }
.ds-main > .data-card.ds-active .section-heading {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
  text-transform: none;
}
.ds-main > .data-card.ds-active .data-table {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0;
}
.ds-main > #section-genetics.ds-active .data-table {
  background: transparent;
  border: none;
}
.ds-main > #section-photos.ds-active .photo-grid {
  background: transparent;
}
.ds-main > .data-card.ds-active .filter-chart {
  background: var(--bg-card);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}
.ds-main > .data-card.ds-active .data-table > .data-row.hidden-row { display: flex !important; }
.ds-main > .data-card.ds-active .data-table > .show-more { display: none !important; }
.ds-main > #section-checkin { display: none !important; }
.ds-main .data-row.child {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  padding-top: 7px;
  padding-bottom: 7px;
}
.ds-main .lab-result {
  display: grid;
  grid-template-columns: 1fr auto 18px;
  gap: 12px;
  align-items: baseline;
}
.ds-main .lab-result .lab-val { font-variant-numeric: tabular-nums; font-weight: 500; color: var(--text); font-size: 13px; }
.ds-main .lab-result .lab-flag { font-size: 11px; font-weight: 700; color: var(--accent); letter-spacing: 0.04em; }

.ds-main .btn,
.ds-main .search-input,
.ds-main .data-card,
.ds-top .btn { border-radius: 0; }

/* Genetics tiles + table */
.gx-stats { display: flex; gap: 24px; align-items: center; margin-bottom: 16px; }
.gx-stat { display: flex; flex-direction: column; gap: 2px; }
.gx-stat b { font-size: 22px; font-weight: 700; line-height: 1; }
.gx-stat span { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.gx-stat-div { width: 1px; height: 32px; background: var(--border); }
.gx-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.gx-tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  font-family: inherit;
  color: inherit;
}
.gx-tile:hover { border-color: #D1C5BA; }
.gx-tile.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.gx-tile .n { font-size: 13px; font-weight: 600; }
.gx-tile .c { font-size: 20px; font-weight: 700; line-height: 1.1; }
.gx-tile.large .c { color: var(--accent); }
.gx-tile .h { font-size: 11px; color: var(--text-subtle, #A8A29E); }
.gx-table { background: var(--bg-card); border: 1px solid var(--border); overflow: hidden; }
.gx-table-hd { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--border); background: #FAFAF9; }
.gx-table-hd .t { font-size: 14px; font-weight: 700; }
.gx-table-hd .s { font-size: 12px; color: var(--text-muted); font-weight: 400; }
.gx-vt { width: 100%; border-collapse: collapse; }
.gx-vt th {
  text-align: left; font-size: 11px; font-weight: 600; color: var(--text-subtle, #A8A29E);
  text-transform: uppercase; letter-spacing: 0.5px; padding: 10px 20px;
  border-bottom: 1px solid var(--border); background: #FAFAF9;
}
.gx-vt td { padding: 11px 20px; border-bottom: 1px solid #F0EDEA; vertical-align: middle; }
.gx-vt tr:last-child td { border-bottom: none; }
.gx-vt tr:hover td { background: #FAFAF9; }
.gx-gene { font-weight: 600; font-size: 13px; }
.gx-rsid { font-size: 11px; color: var(--text-subtle, #A8A29E); margin-top: 1px; }
.gx-geno { font-size: 13px; font-weight: 600; background: #F4F1EE; padding: 2px 8px; display: inline-block; }
.gx-sig { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.gx-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.gx-dot.m { background: var(--accent); }
.gx-dot.p { background: #15803D; }
.gx-dot.l { background: var(--text-subtle, #A8A29E); }
.gx-dot.c { background: #D4D0CB; }
.gx-sig .m { color: var(--accent); }
.gx-sig .p { color: #15803D; }
.gx-ft { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-top: 1px solid var(--border); background: #FAFAF9; font-size: 12px; color: var(--text-muted); }
.gx-ft a, .gx-more { color: var(--accent); font-weight: 600; text-decoration: none; cursor: pointer; }
.ds-main .data-row.date-group {
  background: transparent;
  padding: 14px 20px 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.ds-main > .error, .ds-main > .success { margin-bottom: 16px; }

body.preview-studio:has(.ds-app) .studio-preview-bar { z-index: 2; }

@media (max-width: 768px) {
  .ds-side { width: 160px; }
  .ds-main { padding: 16px; }
  .ds-person-meta { display: none; }
}
