/* ─────────────────────────────────────────────────────────────────
   Econometrics Explorers — unified shell stylesheet.
   Two directions share these tokens; each scopes its own layout.
   ───────────────────────────────────────────────────────────────── */

:root {
  --bg-warm: #F4F3EF;
  --bg-paper: #FBFAF6;
  --card: #FFFFFF;
  --card-hover: #FAFAF8;
  --ink: #1C1917;
  --ink-soft: #44403C;
  --muted: #78716C;
  --dim: #A8A29E;
  --line: rgba(0,0,0,0.07);
  --line-strong: rgba(0,0,0,0.13);

  /* EBS suite navy palette */
  --ebs-navy: #1a2744;
  --ebs-navy-2: #243556;
  --ebs-blue: #378add;
  --ebs-orange: #ef9f27;
  --ebs-rust: #d85a30;
  --ebs-violet: #7f77dd;

  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'DM Mono', 'SF Mono', ui-monospace, monospace;
  --font-serif: 'Newsreader', Georgia, serif;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg-warm);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; }

/* ─────────────────────────────────────────────────────────────────
   STUDIO (Direction A): warm light, sidebar, editorial.
   Scope all rules under .studio.
   ───────────────────────────────────────────────────────────────── */
.studio {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
  background: var(--bg-warm);
}

/* — Sidebar — */
.studio .sidebar {
  border-right: 1px solid var(--line);
  background: var(--bg-paper);
  padding: 28px 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky; top: 0;
  height: 100vh;
  overflow-y: auto;
}
.studio .logo {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; margin-bottom: 22px;
}
.studio .logo-text { display: flex; flex-direction: column; }
.studio .logo-title { font-weight: 700; font-size: 14px; line-height: 1.15; letter-spacing: -0.2px; }
.studio .logo-sub { font-family: var(--font-mono); font-size: 9.5px; color: var(--muted); letter-spacing: 0.06em; margin-top: 4px; }

.studio .search {
  position: relative;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 10px;
}
.studio .search-ico { color: var(--dim); flex-shrink: 0; }
.studio .search input {
  border: 0; background: transparent; outline: none; flex: 1;
  padding: 10px 0; font: inherit; font-size: 13px;
}
.studio .search input::placeholder { color: var(--dim); }
.studio .search-clear { color: var(--muted); font-size: 18px; line-height: 1; padding: 4px 6px; }

.studio .nav-label {
  font-family: var(--font-mono);
  font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--dim); margin: 8px 4px 6px;
}
.studio .nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px; width: 100%; text-align: left;
  font-size: 13px; font-weight: 500;
  color: var(--ink-soft);
  transition: background .15s, color .15s;
}
.studio .nav-item:hover { background: rgba(0,0,0,0.035); color: var(--ink); }
.studio .nav-item.active {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 0 var(--line);
}
.studio .nav-item.active .ni-name { font-weight: 600; }
.studio .ni-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.studio .ni-name { flex: 1; }
.studio .ni-count {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--dim); padding-left: 6px;
}

.studio .tag-cloud { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 4px 0; }
.studio .tag-chip {
  font-family: var(--font-mono); font-size: 10px;
  padding: 4px 8px; border-radius: 4px;
  background: rgba(0,0,0,0.04); color: var(--muted);
  transition: background .15s, color .15s;
}
.studio .tag-chip:hover { background: rgba(0,0,0,0.07); color: var(--ink); }
.studio .tag-chip.active { background: var(--ink); color: #fff; }

.studio .side-foot {
  margin-top: auto; padding-top: 22px;
  font-size: 10.5px; color: var(--dim); line-height: 1.5;
}
.studio .sf-italic { font-family: var(--font-serif); font-style: italic; margin-top: 6px; }

/* — Main column — */
.studio .main {
  padding: 48px 56px 80px;
  max-width: 1280px;
}
.studio .main-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 40px;
}
.studio .mh-title {
  font-size: 44px; font-weight: 600; letter-spacing: -1.2px;
  line-height: 1.05; margin: 0 0 10px; max-width: 720px;
  text-wrap: pretty;
}
.studio .mh-sub {
  font-family: var(--font-serif); font-style: italic;
  font-size: 16px; color: var(--muted); max-width: 560px;
  margin: 0; line-height: 1.5;
}
.studio .mh-right { display: flex; gap: 28px; flex-shrink: 0; }
.studio .mh-stat { display: flex; flex-direction: column; align-items: flex-end; }
.studio .ms-num { font-size: 32px; font-weight: 600; letter-spacing: -0.5px; line-height: 1; }
.studio .ms-lbl { font-family: var(--font-mono); font-size: 10px; color: var(--dim); letter-spacing: 0.06em; margin-top: 4px; }

.studio .active-filter {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px; background: rgba(0,0,0,0.04);
  border-radius: 6px; font-size: 12px; color: var(--muted);
  margin-bottom: 24px;
}
.studio .active-filter code { font-family: var(--font-mono); color: var(--ink); }
.studio .active-filter button { color: var(--muted); padding: 0 4px; font-size: 16px; line-height: 1; }

.studio .coll-block { margin-bottom: 56px; }
.studio .coll-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px; padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.studio .coll-mark { width: 16px; height: 16px; border-radius: 4px; }
.studio .coll-name { font-size: 20px; font-weight: 600; letter-spacing: -0.4px; flex: 1; }
.studio .coll-tag { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; }

.studio .sec-block { margin-bottom: 32px; }
.studio .sec-label {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--dim); margin-bottom: 12px;
}
.studio .card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

/* Card */
.studio .card {
  display: block; text-align: left; width: 100%;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color .2s, box-shadow .2s, transform .15s;
}
.studio .card:hover {
  border-color: var(--accent, var(--line-strong));
  box-shadow: 0 6px 24px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  transform: translateY(-1px);
}
.studio .card-preview {
  height: 96px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--accent) 7%, white), white);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.studio .cp-stripes {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(135deg, transparent 0, transparent 14px, var(--accent-soft) 14px, var(--accent-soft) 15px);
  opacity: 0.5;
  pointer-events: none;
}
.studio .card-body { padding: 14px 16px 16px; }
.studio .card-title {
  font-size: 14px; font-weight: 600; letter-spacing: -0.1px;
  line-height: 1.3; margin: 0 0 4px;
}
.studio .card-desc {
  font-size: 12px; color: var(--muted); line-height: 1.45;
  margin: 0;
}
.studio .card-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.studio .card-tag {
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 500;
  padding: 2px 6px; border-radius: 3px;
  background: var(--accent-soft); color: var(--accent);
}

.studio .empty {
  text-align: center; padding: 80px 20px; color: var(--muted);
}
.studio .empty-mark { font-size: 64px; color: var(--dim); margin-bottom: 12px; }
.studio .empty-title { font-size: 18px; font-weight: 500; margin-bottom: 4px; color: var(--ink-soft); }

/* Touch / large screen tweaks for Studio */
@media (pointer: coarse) {
  .studio .card-title { font-size: 16px; }
  .studio .card-desc { font-size: 13px; }
  .studio .nav-item { padding: 12px 12px; font-size: 14px; }
}
@media (max-width: 900px) {
  .studio { grid-template-columns: 1fr; }
  .studio .sidebar { position: static; height: auto; }
  .studio .main { padding: 28px 22px 60px; }
  .studio .mh-title { font-size: 30px; }
  .studio .main-head { flex-direction: column; align-items: flex-start; gap: 18px; }
}

/* ─────────────────────────────────────────────────────────────────
   ATLAS (Direction B): dark navy, big tiles, EBS-suite branded.
   Scope all rules under .atlas.
   ───────────────────────────────────────────────────────────────── */
.atlas {
  background: linear-gradient(180deg, var(--ebs-navy) 0%, #131e36 100%);
  color: #fff;
  min-height: 100vh;
}

.atlas-bar {
  display: flex; align-items: center; gap: 18px;
  padding: 18px 32px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  position: sticky; top: 0; z-index: 5;
  background: rgba(26,39,68,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.atlas-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; flex-shrink: 0; }
.atlas-logo-text { display: flex; flex-direction: column; }
.all-name { font-weight: 700; font-size: 14px; letter-spacing: -0.2px; }
.all-sub { font-family: var(--font-mono); font-size: 9.5px; color: rgba(255,255,255,0.5); letter-spacing: 0.08em; margin-top: 3px; }

.atlas-search {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; padding: 0 12px;
  flex: 0 1 320px; color: rgba(255,255,255,0.55);
}
.atlas-search input {
  border: 0; background: transparent; outline: none;
  color: #fff; font: inherit; font-size: 13px;
  padding: 9px 0; flex: 1;
}
.atlas-search input::placeholder { color: rgba(255,255,255,0.4); }
.atlas-search button { color: rgba(255,255,255,0.6); font-size: 18px; }

.atlas-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.atab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 500;
  color: rgba(255,255,255,0.6);
  transition: background .15s, color .15s;
}
.atab:hover { color: #fff; background: rgba(255,255,255,0.05); }
.atab.active { color: #fff; background: rgba(255,255,255,0.1); }
.atab-dot { width: 7px; height: 7px; border-radius: 50%; }

/* Atlas home hero */
.atlas-home { padding: 64px 56px 80px; max-width: 1480px; margin: 0 auto; }
.hero { max-width: 920px; margin-bottom: 56px; }
.hero-eyebrow {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em;
  color: var(--ebs-orange); margin-bottom: 18px;
}
.hero-title {
  font-size: 64px; font-weight: 600; line-height: 1.0; letter-spacing: -2px;
  margin: 0 0 20px;
  text-wrap: pretty;
}
.hero-em {
  font-family: var(--font-serif); font-style: italic; font-weight: 400;
  color: var(--ebs-orange);
}
.hero-sub {
  font-size: 18px; line-height: 1.55; max-width: 680px;
  color: rgba(255,255,255,0.7); margin: 0;
}

.dom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
  margin-bottom: 64px;
}
.dom-tile {
  text-align: left; display: flex; flex-direction: column;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform .2s, border-color .2s, background .2s;
  position: relative;
}
.dom-tile::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 60% at 50% 0%, color-mix(in oklab, var(--accent) 25%, transparent), transparent 60%);
  pointer-events: none;
  opacity: 0.35;
  transition: opacity .25s;
}
.dom-tile:hover { transform: translateY(-2px); border-color: var(--accent); }
.dom-tile:hover::after { opacity: 0.7; }
.dt-bezel {
  background: linear-gradient(135deg, var(--ebs-navy-2), #1a2744);
  height: 200px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.dt-bezel::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(60% 80% at 50% 50%, color-mix(in oklab, var(--accent) 22%, transparent), transparent 60%);
}
.dt-bezel svg { position: relative; z-index: 1; }
.dt-meta { padding: 22px 24px 24px; position: relative; z-index: 1; }
.dt-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.dt-name { font-size: 22px; font-weight: 600; letter-spacing: -0.6px; }
.dt-code { font-family: var(--font-mono); font-size: 10.5px; color: rgba(255,255,255,0.4); letter-spacing: 0.1em; }
.dt-tag { font-family: var(--font-serif); font-style: italic; color: rgba(255,255,255,0.65); font-size: 14px; margin-bottom: 18px; }
.dt-foot { display: flex; align-items: baseline; gap: 8px; }
.dt-count { font-size: 28px; font-weight: 600; color: var(--accent); letter-spacing: -0.5px; }
.dt-lbl { font-size: 12px; color: rgba(255,255,255,0.55); }
.dt-arrow { margin-left: auto; font-size: 22px; color: rgba(255,255,255,0.5); transition: transform .2s, color .2s; }
.dom-tile:hover .dt-arrow { color: var(--accent); transform: translateX(4px); }

.featured { margin-top: 24px; }
.ft-label {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: rgba(255,255,255,0.4);
  margin-bottom: 14px;
}
.ft-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.ft-card {
  padding: 24px 22px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  transition: border-color .2s, background .2s;
}
.ft-card:hover { background: rgba(255,255,255,0.05); border-color: var(--accent); }
.ft-title {
  font-family: var(--font-serif); font-size: 22px; font-style: italic;
  color: #fff; line-height: 1.2; margin-bottom: 8px;
  text-wrap: pretty;
}
.ft-count { font-family: var(--font-mono); font-size: 11px; color: rgba(255,255,255,0.5); margin-bottom: 16px; }
.ft-line { height: 2px; background: rgba(255,255,255,0.08); border-radius: 1px; overflow: hidden; }
.ft-line span { display: block; height: 100%; width: 30%; }

/* Collection view */
.coll-view { padding: 56px 56px 80px; max-width: 1480px; margin: 0 auto; }
.cv-hero {
  display: flex; align-items: center; gap: 36px;
  padding-bottom: 36px; margin-bottom: 32px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.cv-glyph {
  width: 200px; height: 200px;
  background: linear-gradient(135deg, var(--ebs-navy-2), #131e36);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 22px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  position: relative;
}
.cv-glyph::before {
  content: ""; position: absolute; inset: 0; border-radius: 22px;
  background: radial-gradient(60% 70% at 50% 50%, color-mix(in oklab, var(--accent) 22%, transparent), transparent 60%);
}
.cv-glyph svg { position: relative; z-index: 1; }
.cv-eyebrow {
  font-family: var(--font-mono); font-size: 11.5px;
  color: var(--accent); letter-spacing: 0.12em;
  margin-bottom: 8px;
}
.cv-title { font-size: 56px; font-weight: 600; letter-spacing: -1.5px; line-height: 1; margin: 0 0 12px; }
.cv-sub { font-family: var(--font-serif); font-style: italic; font-size: 18px; color: rgba(255,255,255,0.6); margin: 0; }

.cv-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 36px; }
.cv-tag {
  font-family: var(--font-mono); font-size: 11px;
  padding: 6px 12px; border-radius: 6px;
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.65);
  border: 1px solid rgba(255,255,255,0.06);
}
.cv-tag:hover { color: #fff; background: rgba(255,255,255,0.08); }
.cv-tag.active { background: var(--accent); color: var(--ebs-navy); border-color: transparent; }

.cv-sec { margin-bottom: 44px; }
.cv-sec-label { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.cv-sec-num { font-family: var(--font-mono); font-size: 11px; color: var(--accent); letter-spacing: 0.08em; }
.cv-sec-name { font-size: 22px; font-weight: 500; letter-spacing: -0.4px; }
.cv-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 14px;
}
.cv-card {
  display: grid; grid-template-columns: 80px 1fr 32px;
  gap: 18px; align-items: center;
  padding: 20px 22px; text-align: left;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  transition: background .15s, border-color .15s, transform .15s;
}
.cv-card:hover {
  background: rgba(255,255,255,0.06);
  border-color: var(--accent);
  transform: translateX(2px);
}
.cv-card-preview {
  width: 80px; height: 80px; border-radius: 10px;
  background: var(--ebs-navy-2);
  display: flex; align-items: center; justify-content: center;
}
.cv-card-title { font-size: 16px; font-weight: 600; letter-spacing: -0.2px; margin-bottom: 4px; }
.cv-card-desc { font-size: 13px; color: rgba(255,255,255,0.6); line-height: 1.4; margin-bottom: 8px; }
.cv-card-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.cv-card-tags span {
  font-family: var(--font-mono); font-size: 9.5px;
  padding: 2px 6px; border-radius: 3px;
  background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.6);
}
.cv-card-cta { color: var(--accent); }

/* Search results inside Atlas */
.search-results { padding: 48px 56px 80px; max-width: 1480px; margin: 0 auto; }
.sr-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 28px; }
.sr-title { font-size: 22px; font-weight: 500; letter-spacing: -0.3px; }
.sr-q { font-family: var(--font-serif); font-style: italic; color: var(--ebs-orange); }
.sr-clear {
  font-family: var(--font-mono); font-size: 11px; color: rgba(255,255,255,0.6);
  padding: 6px 12px; border: 1px solid rgba(255,255,255,0.1); border-radius: 6px;
}
.sr-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.sr-card {
  padding: 18px 20px; text-align: left;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  transition: border-color .15s, background .15s;
}
.sr-card:hover { border-color: var(--accent); background: rgba(255,255,255,0.07); }
.sr-coll { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; margin-bottom: 8px; }
.sr-title-card { font-size: 15px; font-weight: 600; letter-spacing: -0.2px; margin-bottom: 4px; }
.sr-desc { font-size: 12.5px; color: rgba(255,255,255,0.6); line-height: 1.4; margin-bottom: 10px; }
.sr-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.sr-tags span {
  font-family: var(--font-mono); font-size: 9.5px;
  padding: 2px 6px; border-radius: 3px;
  background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.55);
}

.atlas .empty { text-align: center; padding: 80px 20px; color: rgba(255,255,255,0.5); }
.atlas .empty-mark { font-size: 64px; color: rgba(255,255,255,0.25); margin-bottom: 12px; }
.atlas .empty-title { font-size: 18px; }

/* Touch/large screen tweaks */
@media (pointer: coarse), (min-width: 1600px) {
  .hero-title { font-size: 72px; }
  .dt-name { font-size: 24px; }
  .cv-card { padding: 22px 24px; }
}
@media (max-width: 900px) {
  .atlas-bar { flex-wrap: wrap; padding: 14px 18px; }
  .atlas-search { flex-basis: 100%; order: 3; }
  .atlas-tabs { order: 4; flex-basis: 100%; margin-left: 0; }
  .atlas-home, .coll-view, .search-results { padding: 32px 22px 60px; }
  .hero-title { font-size: 38px; letter-spacing: -1px; }
  .cv-hero { flex-direction: column; align-items: flex-start; gap: 20px; }
  .cv-glyph { width: 120px; height: 120px; }
  .cv-glyph svg { width: 90px !important; height: 90px !important; }
  .cv-title { font-size: 36px; }
}

/* ─────────────────────────────────────────────────────────────────
   APP VIEWER (shared by both directions) — full-bleed iframe overlay.
   ───────────────────────────────────────────────────────────────── */
.viewer {
  position: fixed; inset: 0; z-index: 1000;
  background: #fff;
  display: flex; flex-direction: column;
  animation: viewer-in 0.18s ease-out;
}
@keyframes viewer-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.viewer-bar {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 18px;
  background: var(--bg-paper);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink);
}
.vb-close {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 10px; border-radius: 8px;
  background: rgba(0,0,0,0.04);
  font-size: 12.5px; font-weight: 500;
  color: var(--ink-soft);
  transition: background .15s;
}
.vb-close:hover { background: rgba(0,0,0,0.08); color: var(--ink); }
.vb-meta { display: flex; align-items: baseline; gap: 8px; flex: 1; min-width: 0; overflow: hidden; }
.vb-coll { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; flex-shrink: 0; }
.vb-dot { color: var(--dim); }
.vb-section { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.vb-title { font-weight: 600; font-size: 13.5px; letter-spacing: -0.15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vb-newtab {
  font-family: var(--font-mono); font-size: 11px;
  padding: 6px 10px; border-radius: 6px;
  background: rgba(0,0,0,0.04); color: var(--accent, var(--ink));
  text-decoration: none;
  transition: background .15s;
  flex-shrink: 0;
}
.vb-newtab:hover { background: rgba(0,0,0,0.08); }
.vb-thread { font-family: var(--font-sans); }
.vb-thread .vb-coll { font-family: var(--font-sans); font-size: 13px; font-weight: 600; letter-spacing: -0.1px; }
.vb-thread-nav { display: inline-flex; gap: 4px; flex-shrink: 0; }
.vb-step {
  width: 30px; height: 30px; border-radius: 6px;
  background: rgba(0,0,0,0.04); color: var(--ink-soft);
  font-family: var(--font-mono); font-size: 16px; line-height: 1;
  border: 1px solid transparent;
  transition: background .15s, color .15s;
}
.vb-step:hover:not(:disabled) { background: rgba(0,0,0,0.08); color: var(--accent); }
.vb-step:disabled { opacity: 0.3; cursor: default; }
.viewer-frame {
  flex: 1; width: 100%; height: 100%; border: 0; background: #fff;
}
@media (max-width: 700px) {
  .vb-section, .vb-dot:nth-of-type(2) { display: none; }
  .vb-close span { display: none; }
}

/* ─────────────────────────────────────────────────────────────────
   Bookmarks, threads, custom tracks, track builder.
   Layered onto the Atlas (.atlas) dark-navy theme.
   ───────────────────────────────────────────────────────────────── */

/* "Saved" tab in the atlas-bar. */
.atlas-tabs .atab-saved { margin-left: 6px; }
.atlas-tabs .atab .atab-star { color: var(--ebs-orange); margin-right: 2px; }
.atlas-tabs .atab .atab-num {
  font-family: var(--font-mono); font-size: 10px;
  padding: 1px 6px; border-radius: 8px;
  background: rgba(239, 159, 39, 0.15); color: var(--ebs-orange);
  margin-left: 4px;
}
.atlas-tabs .atab.active .atab-num { background: rgba(255,255,255,0.18); color: #fff; }

/* Bookmark star (overlaid on cards). */
.bm-star {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: color .15s, background .15s, border-color .15s, transform .15s;
}
.bm-star:hover { color: var(--ebs-orange); background: rgba(239, 159, 39, 0.1); border-color: rgba(239, 159, 39, 0.3); }
.bm-star.on { color: var(--ebs-orange); background: rgba(239, 159, 39, 0.15); border-color: rgba(239, 159, 39, 0.4); }
.bm-star.on:hover { transform: scale(1.05); }

/* Card + star wrapper. The wrap fills the grid cell; the card inside must
   also fill the wrap, otherwise the absolutely-positioned star sits in the
   gutter outside the visible card. */
.cv-card-wrap, .sr-card-wrap { position: relative; display: block; width: 100%; }
.cv-card-wrap .cv-card, .sr-card-wrap .sr-card { display: grid; width: 100%; }
.sr-card-wrap .sr-card { display: block; }
.cv-card-bm, .sr-card-bm {
  position: absolute; top: 12px; right: 12px; z-index: 2;
}
/* Push card content right of the star so it doesn't collide with the chevron. */
.cv-card-wrap .cv-card { padding-right: 64px; }
.sr-card-wrap .sr-card { padding-right: 52px; }

/* Featured-thread head row. */
.featured + .featured { margin-top: 56px; }
.ft-head { display: flex; align-items: baseline; gap: 18px; margin-bottom: 14px; flex-wrap: wrap; }
.ft-head .ft-label { margin-bottom: 0; }
.ft-sub {
  font-size: 13px; color: rgba(255, 255, 255, 0.55);
  font-family: var(--font-serif); font-style: italic;
}

/* Thread / custom-track card. */
.ft-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 22px 22px 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .15s;
  position: relative;
  min-height: 156px;
}
.ft-card:hover {
  background: rgba(255,255,255,0.06);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.ft-card .ft-tag-custom {
  position: absolute; top: 12px; right: 14px;
  font-family: var(--font-mono); font-size: 9.5px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); padding: 2px 6px;
  border: 1px solid rgba(255,255,255,0.1); border-radius: 4px;
  background: rgba(255,255,255,0.04);
}
.ft-blurb {
  font-size: 12.5px; color: rgba(255,255,255,0.62);
  line-height: 1.5; margin: 4px 0 8px;
  text-wrap: pretty;
}
.ft-foot {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-top: auto; padding-top: 8px;
}
.ft-cta { font-family: var(--font-mono); font-size: 11px; color: var(--accent); }
.ft-card .ft-line { margin-top: 10px; }

/* "+ New track" card variant. */
.ft-new {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  background: rgba(255,255,255,0.02);
  border: 1px dashed rgba(255,255,255,0.16);
  color: rgba(255,255,255,0.55);
  cursor: pointer;
}
.ft-new:hover {
  background: rgba(239, 159, 39, 0.06);
  border-color: var(--ebs-orange);
  color: #fff;
}
.ft-new .ft-new-plus {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; line-height: 1; margin-bottom: 12px; color: var(--ebs-orange);
}
.ft-new:hover .ft-new-plus { background: rgba(239, 159, 39, 0.18); border-color: var(--ebs-orange); }
.ft-new .ft-new-text { font-size: 16px; font-weight: 600; }
.ft-new .ft-new-sub { font-size: 12px; color: rgba(255,255,255,0.45); margin-top: 4px; max-width: 200px; }

/* Custom track edit/delete actions (Saved view). */
.ft-card-wrap { position: relative; }
.ft-actions {
  position: absolute; top: 10px; right: 10px;
  display: flex; gap: 4px; z-index: 2;
}
.ft-act {
  font-family: var(--font-mono); font-size: 10px;
  padding: 4px 8px; border-radius: 5px;
  background: rgba(0,0,0,0.25); color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.1);
}
.ft-act:hover { background: rgba(0,0,0,0.45); color: #fff; }
.ft-act.ft-del:hover { background: rgba(216,90,48,0.6); border-color: var(--ebs-rust); }

/* ──── Track builder modal ──── */
.tb-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(10, 16, 32, 0.78);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: tb-fade .15s ease-out;
}
@keyframes tb-fade { from { opacity: 0 } to { opacity: 1 } }
.tb-modal {
  width: 100%; max-width: 940px; max-height: 92vh;
  background: linear-gradient(180deg, #1a2744 0%, #131e36 100%);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  display: flex; flex-direction: column;
  color: #f4f3ef;
  box-shadow: 0 30px 80px rgba(0,0,0,0.55);
  overflow: hidden;
}
.tb-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid rgba(255,255,255,0.07);
}
.tb-title { font-size: 18px; font-weight: 600; letter-spacing: -0.2px; }
.tb-x {
  width: 32px; height: 32px; border-radius: 8px;
  font-size: 22px; line-height: 1; color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.05);
}
.tb-x:hover { background: rgba(255,255,255,0.12); color: #fff; }

.tb-body {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0; flex: 1; overflow: hidden;
}
.tb-col {
  padding: 20px 24px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
}
.tb-col + .tb-col { border-left: 1px solid rgba(255,255,255,0.07); }

.tb-label {
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-top: 6px;
}
.tb-input {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 9px 12px;
  font: inherit; font-size: 13px;
  color: #fff;
}
.tb-input::placeholder { color: rgba(255,255,255,0.4); }
.tb-input:focus { outline: none; border-color: var(--ebs-orange); }

.tb-swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.tb-swatch {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
}
.tb-swatch.on { border-color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,0.12); }

.tb-section-head {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px;
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}
.tb-pill {
  font-family: var(--font-mono); font-size: 10px;
  padding: 1px 6px; border-radius: 8px;
  background: rgba(239, 159, 39, 0.15); color: var(--ebs-orange);
}
.tb-empty {
  font-family: var(--font-serif); font-style: italic;
  font-size: 13px; color: rgba(255,255,255,0.45);
  padding: 18px 0;
}

.tb-picked { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.tb-pick {
  display: grid; grid-template-columns: 22px 10px 1fr auto auto auto;
  align-items: center; gap: 8px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
}
.tb-i { font-family: var(--font-mono); font-size: 11px; color: rgba(255,255,255,0.55); text-align: center; }
.tb-pdot { width: 8px; height: 8px; border-radius: 50%; }
.tb-pname { font-size: 13px; font-weight: 500; }
.tb-pname .tb-psub { font-size: 11px; color: rgba(255,255,255,0.5); font-weight: 400; margin-top: 2px; }
.tb-mv, .tb-rm {
  width: 26px; height: 26px; border-radius: 5px;
  background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.7);
  font-size: 13px; line-height: 1;
}
.tb-mv:hover, .tb-rm:hover { background: rgba(255,255,255,0.12); color: #fff; }
.tb-rm:hover { background: rgba(216,90,48,0.4); }
.tb-mv:disabled { opacity: 0.25; cursor: default; }

.tb-results {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 100%;
}
.tb-res {
  display: grid; grid-template-columns: 10px 1fr auto;
  align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 7px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  text-align: left;
  cursor: pointer;
}
.tb-res:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.12); }
.tb-res.on { background: rgba(239, 159, 39, 0.1); border-color: rgba(239, 159, 39, 0.35); }
.tb-add {
  font-family: var(--font-mono); font-size: 13px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.7);
  display: inline-flex; align-items: center; justify-content: center;
}
.tb-res.on .tb-add { background: var(--ebs-orange); color: var(--ebs-navy); }

.tb-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 24px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.tb-btn {
  font-size: 13px; padding: 9px 16px; border-radius: 8px;
  background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.1);
}
.tb-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
.tb-primary {
  background: var(--ebs-orange); color: var(--ebs-navy); border-color: var(--ebs-orange);
  font-weight: 600;
}
.tb-primary:hover:not(:disabled) { background: #f4b75a; }
.tb-primary:disabled { opacity: 0.4; cursor: default; }

@media (max-width: 800px) {
  .tb-body { grid-template-columns: 1fr; max-height: 70vh; }
  .tb-col + .tb-col { border-left: 0; border-top: 1px solid rgba(255,255,255,0.07); }
}

/* ─────────────────────────────────────────────────────────────────
   Floating feedback widget — overlays the AppViewer (z-index 1000)
   and the TrackBuilder modal (z-index 2000).
   ───────────────────────────────────────────────────────────────── */
.fb-widget { position: fixed; bottom: 24px; right: 24px; z-index: 3000; }

.fb-fab {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--ebs-orange);
  color: var(--ebs-navy);
  border: 0;
  box-shadow: 0 10px 28px rgba(0,0,0,0.35), 0 2px 6px rgba(0,0,0,0.2);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.fb-fab:hover { transform: translateY(-2px) scale(1.04); background: #f4b75a; box-shadow: 0 14px 36px rgba(0,0,0,0.45), 0 3px 8px rgba(0,0,0,0.25); }
.fb-fab:active { transform: translateY(0) scale(0.98); }

.fb-panel {
  width: 360px; max-width: calc(100vw - 32px);
  background: linear-gradient(180deg, #1a2744 0%, #131e36 100%);
  color: #f4f3ef;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5), 0 4px 14px rgba(0,0,0,0.25);
  overflow: hidden;
  display: flex; flex-direction: column;
  animation: fb-pop .18s ease-out;
  font-family: var(--font-sans);
}
@keyframes fb-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.fb-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.fb-title { font-size: 14px; font-weight: 600; letter-spacing: -0.1px; }
.fb-sub {
  font-size: 11.5px; color: rgba(255,255,255,0.55);
  margin-top: 3px; line-height: 1.4;
}
.fb-ctx {
  color: var(--ebs-orange);
  font-family: var(--font-mono); font-size: 10.5px;
}
.fb-x {
  width: 28px; height: 28px; border-radius: 6px;
  font-size: 20px; line-height: 1; color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.04);
  flex-shrink: 0;
}
.fb-x:hover { background: rgba(255,255,255,0.1); color: #fff; }

.fb-text {
  width: 100%;
  margin: 12px 16px 8px;
  width: calc(100% - 32px);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: #fff;
  font: inherit; font-size: 13px; line-height: 1.5;
  padding: 10px 12px;
  resize: vertical;
  min-height: 110px;
}
.fb-text:focus { outline: none; border-color: var(--ebs-orange); background: rgba(255,255,255,0.07); }
.fb-text::placeholder { color: rgba(255,255,255,0.4); }

.fb-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px 14px;
  gap: 10px;
}
.fb-hint {
  font-family: var(--font-mono); font-size: 10px;
  color: rgba(255,255,255,0.4);
}
.fb-submit {
  font-size: 12.5px; font-weight: 600;
  padding: 8px 16px; border-radius: 8px;
  background: var(--ebs-orange); color: var(--ebs-navy);
  border: 1px solid var(--ebs-orange);
}
.fb-submit:hover:not(:disabled) { background: #f4b75a; }
.fb-submit:disabled { opacity: 0.45; cursor: default; }

.fb-done {
  padding: 28px 20px 26px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center;
}
.fb-check {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(34, 197, 94, 0.18); color: #4ade80;
  font-size: 24px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}
.fb-done-title { font-size: 14px; font-weight: 600; }
.fb-done-sub { font-size: 12px; color: rgba(255,255,255,0.55); }

@media (max-width: 480px) {
  .fb-widget { bottom: 16px; right: 16px; }
  .fb-fab { width: 50px; height: 50px; }
  .fb-panel { width: calc(100vw - 32px); }
}

/* ─────────────────────────────────────────────────────────────────
   References card — sits at the bottom of the Atlas home.
   Four bands across (Foundation / Seminal / Modern / Frontier),
   tabbed by collection.
   ───────────────────────────────────────────────────────────────── */
.refs {
  margin-top: 64px;
  padding: 36px 32px 32px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  position: relative;
  overflow: hidden;
}
.refs::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 60% at 50% 0%, color-mix(in oklab, var(--accent) 14%, transparent), transparent 60%);
  pointer-events: none;
  opacity: 0.55;
}
.refs-head {
  position: relative; z-index: 1;
  margin-bottom: 22px;
  max-width: 720px;
}
.refs-eyebrow {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 10px;
  text-transform: uppercase;
}
.refs-title {
  font-size: 36px; font-weight: 600; letter-spacing: -1px;
  color: #fff; margin: 0 0 8px;
}
.refs-sub {
  font-family: var(--font-serif); font-style: italic;
  font-size: 15px; color: rgba(255, 255, 255, 0.65); line-height: 1.55;
  margin: 0;
}

.refs-tabs {
  position: relative; z-index: 1;
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.refs-tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 12.5px; font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  transition: background .15s, color .15s, border-color .15s;
}
.refs-tab:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.refs-tab.active {
  background: var(--accent); color: var(--ebs-navy);
  border-color: var(--accent);
}
.refs-tab.active .refs-tab-dot { background: var(--ebs-navy) !important; }
.refs-tab-dot { width: 7px; height: 7px; border-radius: 50%; }

.refs-grid {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.refs-col {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 16px 16px 12px;
  display: flex; flex-direction: column;
}
.refs-col-head { margin-bottom: 12px; }
.refs-col-label {
  font-size: 12.5px; font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.1px;
  margin-bottom: 3px;
}
.refs-col-note {
  font-family: var(--font-mono); font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.04em;
}
.refs-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column;
  gap: 12px;
}
.refs-item {
  font-size: 12.5px; line-height: 1.5;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 2px solid var(--accent);
  border-radius: 0 6px 6px 0;
}
.refs-item-authors {
  font-weight: 600; color: #fff;
  font-size: 12px;
  margin-bottom: 3px;
}
.refs-item-title {
  font-family: var(--font-serif); font-style: italic;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 4px;
  text-wrap: pretty;
}
.refs-item-venue {
  font-family: var(--font-mono); font-size: 10.5px;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.02em;
}
.refs-item-note {
  font-size: 11px; color: rgba(255, 255, 255, 0.6);
  font-style: italic;
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}
.refs-empty {
  font-family: var(--font-serif); font-style: italic;
  color: rgba(255, 255, 255, 0.35);
  font-size: 13px;
  padding: 6px 0;
}

@media (max-width: 1100px) {
  .refs-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .refs { padding: 28px 18px 22px; }
  .refs-title { font-size: 26px; }
  .refs-grid { grid-template-columns: 1fr; gap: 12px; }
}
