/* ─────────────────────────────────────────────
   Design Tokens
───────────────────────────────────────────── */
:root {
  /* Palette */
  --bg:              #F8F6FF;
  --surface:         #FFFFFF;
  --surface-soft:    #F2EEFF;
  --surface-purple:  #EAE0FF;
  --surface-mid:     #DDD6FE;

  /* Text */
  --ink:             #18112E;
  --ink-2:           #3D2E5A;
  --muted:           #72688A;
  --muted-light:     #A99BBD;

  /* Brand */
  --accent:          #6D28D9;
  --accent-hover:    #5B21B6;
  --accent-2:        #8B5CF6;
  --accent-3:        #C4B5F4;
  --accent-subtle:   #EDE9FE;

  /* Lavender spectrum */
  --lavender-100:    #F5F3FF;
  --lavender-200:    #EDE9FE;
  --lavender-300:    #DDD6FE;
  --lavender-400:    #C4B5F4;
  --lavender-500:    #A78BFA;

  /* Status */
  --gold:            #CA8A04;
  --gold-bg:         #FEFCE8;
  --danger:          #B91C1C;
  --danger-bg:       #FEF2F2;
  --success:         #047857;
  --success-bg:      #ECFDF5;

  /* Lines & Shadows */
  --line:            #E8E0F5;
  --line-soft:       #F0EBF9;
  --shadow-xs:       0 1px 3px rgba(109, 40, 217, 0.06);
  --shadow-sm:       0 4px 12px rgba(109, 40, 217, 0.08), 0 1px 3px rgba(109, 40, 217, 0.04);
  --shadow-md:       0 8px 24px rgba(109, 40, 217, 0.10), 0 2px 8px rgba(109, 40, 217, 0.06);
  --shadow-lg:       0 20px 48px rgba(109, 40, 217, 0.14), 0 4px 16px rgba(109, 40, 217, 0.07);

  /* Shape */
  --radius-sm:       6px;
  --radius:          10px;
  --radius-md:       14px;
  --radius-lg:       20px;
  --radius-pill:     999px;

  /* Layout */
  --container:       min(1180px, calc(100vw - clamp(24px, 4vw, 48px)));

  /* Typography */
  --font-sans:       'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-display:    'Plus Jakarta Sans', 'Inter', ui-sans-serif, system-ui, sans-serif;

  font-family: var(--font-sans);
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

/* ─────────────────────────────────────────────
   Reset & Base
───────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 0.9375rem;
  line-height: 1.6;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font: inherit;
}

img, canvas, svg, video {
  max-width: 100%;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.hidden {
  display: none !important;
}

/* ─────────────────────────────────────────────
   Topbar / Navigation
───────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(10px, 1.5vw, 24px);
  min-height: 68px;
  padding: 10px max(20px, calc((100vw - 1180px) / 2));
  background: rgba(255, 255, 255, 0.90);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 170px;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.brand:hover {
  opacity: 0.82;
}

.brand img,
.site-footer img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(109, 40, 217, 0.22));
}

.brand strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.main-nav a {
  position: relative;
  padding: 7px 11px;
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0;
  transition: color 0.15s ease, background 0.15s ease;
}

.main-nav a:hover {
  background: var(--surface-soft);
  color: var(--accent);
}

.main-nav a.active {
  background: var(--accent-subtle);
  color: var(--accent);
  font-weight: 700;
}

.auth-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 210px;
}

.user-chip {
  max-width: 148px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 4px 10px;
  background: var(--lavender-200);
  border-radius: var(--radius-pill);
  border: 1px solid var(--lavender-300);
}

/* ─────────────────────────────────────────────
   Buttons
───────────────────────────────────────────── */
.button,
.file-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 16px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.button:hover,
.file-label:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(109, 40, 217, 0.35);
}

.button.primary:hover {
  box-shadow: 0 6px 20px rgba(109, 40, 217, 0.45);
  filter: brightness(1.06);
}

.button.secondary {
  background: var(--ink);
  color: #fff;
  border-color: transparent;
}

.button.secondary:hover {
  background: var(--ink-2);
}

.button.ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink-2);
}

.button.ghost:hover {
  border-color: var(--lavender-400);
  background: var(--lavender-100);
  color: var(--accent);
}

.button.danger {
  background: var(--danger);
  color: #fff;
  border-color: transparent;
}

.button.danger:hover {
  filter: brightness(1.08);
}

.button:disabled,
.file-label:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
  box-shadow: none;
  filter: none;
}

.icon-button,
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.icon-button:hover,
.nav-toggle:hover {
  border-color: var(--lavender-400);
  background: var(--lavender-100);
}

.nav-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  margin: 3.5px auto;
  border-radius: 2px;
  background: var(--accent);
  transition: opacity 0.15s;
}

/* ─────────────────────────────────────────────
   Page Root & Layout Shells
───────────────────────────────────────────── */
.page-root {
  min-height: calc(100vh - 200px);
}

.section,
.hero,
.workspace {
  width: var(--container);
  margin: 0 auto;
}

/* ─────────────────────────────────────────────
   Home – Hero
───────────────────────────────────────────── */
/* ── Home hero — full-width row layout ── */
.home-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 100%;
  max-width: 100%;
  padding: 0;
  margin: 0;
}

.home-hero-top {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(20px, 2.5vw, 36px) clamp(16px, 4vw, 48px) clamp(24px, 3vw, 40px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.home-hero-top h1 {
  margin: 0;
  max-width: none;
  font-size: clamp(2rem, 4.5vw, 4.2rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.035em;
  color: var(--ink);
  white-space: nowrap;
}

.home-hero-top h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.home-hero-media {
  width: 100%;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.home-hero-media img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(70vh, 780px);
  object-fit: cover;
  object-position: center 30%;
}

.home-hero-bottom {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(28px, 3.5vw, 52px) clamp(16px, 4vw, 48px) clamp(36px, 5vw, 72px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.home-hero-bottom > p {
  max-width: 660px;
  margin: 0;
  color: var(--ink-2);
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  line-height: 1.8;
}

.home-hero-bottom .hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* ─────────────────────────────────────────────
   Home – Sections
───────────────────────────────────────────── */
.home-panel {
  display: grid;
  gap: 24px;
}

.home-section-head {
  display: grid;
  grid-template-columns: minmax(240px, 0.75fr) minmax(300px, 1fr);
  gap: clamp(20px, 4vw, 56px);
  align-items: end;
}

.home-section-head h2,
.home-two-column h2,
.home-info h2 {
  margin: 0;
  font-size: clamp(1.45rem, 2.5vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.025em;
}

.home-section-head p,
.home-two-column p {
  margin: 0;
  color: var(--muted);
  line-height: 1.72;
}

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

.home-feature {
  display: grid;
  gap: 10px;
  min-height: 110px;
  padding: 18px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease;
}

.home-feature:hover,
.home-feature.active {
  border-color: var(--lavender-400);
  background: var(--lavender-100);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.home-feature.active {
  border-color: var(--accent-3);
  background: linear-gradient(145deg, var(--lavender-100), var(--surface));
}

.home-feature span {
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.home-feature strong {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}

.home-feature-detail {
  padding: clamp(20px, 3vw, 32px);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--accent);
  background: linear-gradient(135deg, var(--lavender-100) 0%, var(--surface) 65%);
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-left-color: var(--accent);
}

.home-feature-detail h3 {
  margin: 0 0 12px;
  font-size: clamp(1.15rem, 1.8vw, 1.55rem);
  font-weight: 700;
  color: var(--ink);
}

.home-feature-detail p {
  max-width: 820px;
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.72;
}

.principle-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.principle-tags span,
.home-principles span {
  border: 1.5px solid var(--lavender-300);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.83rem;
  font-weight: 600;
}

.principle-tags span {
  padding: 7px 14px;
}

/* ─────────────────────────────────────────────
   Home – Band
───────────────────────────────────────────── */
.home-band {
  margin: 20px 0;
  padding: clamp(40px, 6vw, 68px) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(160deg, var(--lavender-100) 0%, var(--surface) 55%, var(--lavender-100) 100%);
}

.home-two-column {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(280px, 1.15fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: start;
}

.home-two-column div:first-child {
  display: grid;
  gap: 18px;
}

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

.home-principles span {
  padding: 14px 16px;
  min-height: 66px;
  display: grid;
  align-items: center;
  border-radius: var(--radius);
  font-weight: 600;
  transition: all 0.18s ease;
}

.home-principles span:hover {
  border-color: var(--accent-3);
  background: var(--lavender-100);
  transform: translateY(-1px);
}

/* ─────────────────────────────────────────────
   Home – Info Blocks
───────────────────────────────────────────── */
.home-info {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.home-info-stacked {
  grid-template-columns: 1fr;
  max-width: 900px;
}

.home-info-block {
  padding-top: 22px;
  border-top: 2px solid var(--lavender-300);
}

.home-info-block h2 {
  margin: 0 0 10px;
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  font-weight: 700;
}

.home-info-block ul {
  margin: 16px 0 0;
  padding-left: 20px;
  color: var(--ink-2);
  line-height: 1.72;
}

.home-info-block li {
  margin-bottom: 5px;
}

/* ─────────────────────────────────────────────
   Home – Title Row
───────────────────────────────────────────── */
.home-title {
  display: flex;
  align-items: center;
  gap: 16px;
}

.home-title img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

/* ─────────────────────────────────────────────
   Hero (inner pages)
───────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: start;
  padding: 38px 0 28px;
}

.hero h1 {
  margin: 0;
  max-width: 960px;
  font-size: clamp(2rem, 4vw, 3.6rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.hero p {
  max-width: 640px;
  margin: 0 0 28px;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  line-height: 1.78;
}

.hero-media {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  isolation: isolate;
}

.hero-media::after {
  display: none;
}

.hero-media img {
  width: 100%;
  height: auto;
  max-height: min(72vh, 760px);
  min-height: 0;
  object-fit: contain;
  object-position: center;
  display: block;
}

.hero-actions,
.toolbar,
.inline-actions,
.tab-list,
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* ─────────────────────────────────────────────
   Sections
───────────────────────────────────────────── */
.section {
  padding: 52px 0;
}

.intro-section {
  padding-top: 32px;
}

.band {
  margin: 20px 0;
  padding: 68px 0;
  background: linear-gradient(155deg, var(--lavender-100) 0%, var(--surface) 60%);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section h2,
.workspace h1 {
  margin: 0 0 14px;
  font-size: clamp(1.5rem, 2.6vw, 2.4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.section > p,
.workspace > p,
.split p,
.impact-section p,
.content-flow p,
.contact-flow p {
  max-width: 740px;
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.72;
}

/* ─────────────────────────────────────────────
   Content / Contact Flows
───────────────────────────────────────────── */
.content-flow {
  max-width: 900px;
}

.content-flow h2,
.content-flow h3,
.contact-flow h2 {
  margin: 32px 0 10px;
  color: var(--ink);
}

.content-flow h2:first-child,
.contact-flow h2:first-child {
  margin-top: 0;
}

.content-flow ul {
  margin: 0 0 22px;
  padding-left: 22px;
  color: var(--ink-2);
  line-height: 1.78;
}

.content-flow li + li {
  margin-top: 5px;
}

/* ─────────────────────────────────────────────
   Contact Page
───────────────────────────────────────────── */
.contact-page {
  max-width: 1180px;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.1fr);
  gap: clamp(24px, 4vw, 52px);
  align-items: start;
  margin-top: 0;
}

.contact-cards {
  display: grid;
  gap: 14px;
}

.contact-card,
.contact-form {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.contact-card {
  padding: 20px;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.contact-card:hover {
  border-color: var(--lavender-400);
  box-shadow: var(--shadow-md);
}

.contact-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.contact-card h2 {
  margin: 0 0 8px;
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  font-weight: 700;
  line-height: 1.3;
}

.contact-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.contact-card a,
.contact-flow a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--lavender-300);
  text-underline-offset: 2px;
}

.contact-card a:hover,
.contact-flow a:hover {
  text-decoration-color: var(--accent);
}

.contact-form {
  display: grid;
  gap: 16px;
  padding: clamp(20px, 3vw, 30px);
}

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

.contact-form .button {
  justify-self: start;
  min-width: 140px;
}

.contact-form-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.83rem;
}

.closing-line {
  margin-top: 28px;
  color: var(--ink);
  font-weight: 600;
}

/* ─────────────────────────────────────────────
   Split & Impact
───────────────────────────────────────────── */
.split,
.impact-section {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(340px, 1.05fr);
  gap: clamp(28px, 4vw, 60px);
  align-items: start;
}

/* ─────────────────────────────────────────────
   Lists: Quiet / Principle / Workflow
───────────────────────────────────────────── */
.quiet-list,
.principle-list,
.workflow-strip {
  display: grid;
  gap: 8px;
}

.quiet-list div,
.principle-list div,
.workflow-strip div {
  border-top: 1px solid var(--line);
  padding: 16px 0;
}

.quiet-list span,
.principle-list span,
.workflow-strip span,
.metric span,
.mini-card span,
.field label,
.label {
  display: block;
  margin-bottom: 6px;
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.quiet-list strong,
.principle-list strong,
.workflow-strip strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}

.principle-list div {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: start;
  gap: 12px;
}

.principle-list span {
  width: 10px;
  height: 10px;
  margin: 4px 0 0 5px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

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

.workflow-strip p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ─────────────────────────────────────────────
   Grid Systems
───────────────────────────────────────────── */
.principles,
.metrics,
.contact-grid,
.dashboard-grid,
.stat-grid,
.card-grid {
  display: grid;
  gap: 14px;
}

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

.dashboard-grid {
  grid-template-columns: 1fr;
  align-items: start;
  gap: 20px;
  min-width: 0;
}

.contact-grid,
.card-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-grid > *,
.card-grid > *,
.stat-grid > * {
  min-width: 0;
}

/* ─────────────────────────────────────────────
   Cards, Panels, Metrics
───────────────────────────────────────────── */
.panel,
.mini-card,
.metric,
.auth-panel,
.viz-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel {
  padding: 20px;
  min-width: 0;
  overflow: hidden;
}

.mini-card,
.metric,
.viz-card {
  padding: 18px;
}

.metric {
  min-height: 128px;
  align-content: end;
  background: linear-gradient(160deg, var(--surface) 0%, var(--lavender-100) 100%);
  transition: box-shadow 0.18s, transform 0.18s;
}

.metric:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.metric strong {
  display: block;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3vw, 2.7rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}

/* ─────────────────────────────────────────────
   Workspace
───────────────────────────────────────────── */
.workspace {
  padding: clamp(30px, 4.5vw, 46px) 0 clamp(46px, 6vw, 62px);
}

/* ─────────────────────────────────────────────
   Auth Gate Panel
───────────────────────────────────────────── */
.auth-panel {
  max-width: 620px;
  margin: 80px auto;
  padding: 48px 40px;
  text-align: center;
  border-radius: var(--radius-lg);
}

.auth-panel img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(109, 40, 217, 0.25));
  margin-bottom: 4px;
}

.auth-panel h1 {
  font-size: 1.75rem;
  margin: 16px 0 10px;
}

.auth-panel p {
  color: var(--muted);
  margin: 0 0 28px;
  line-height: 1.7;
}

/* ─────────────────────────────────────────────
   Form Fields
───────────────────────────────────────────── */
.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field label {
  margin-bottom: 0;
  color: var(--ink-2);
  font-size: 0.8rem;
  font-weight: 650;
  text-transform: none;
  letter-spacing: 0;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--muted-light);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.12);
}

.field textarea {
  min-height: 100px;
  resize: vertical;
}

.field input.input-error,
.field select.input-error,
.field textarea.input-error {
  border-color: var(--error, #ef4444);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.field-error-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--error, #ef4444);
  font-weight: 500;
}

/* ─────────────────────────────────────────────
   Dropdown Browser & Column Picker
───────────────────────────────────────────── */
.dropdown-browser {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  align-items: end;
  min-width: 0;
}

.column-picker {
  display: grid;
  gap: 10px;
  min-width: min(100%, 260px);
}

.column-select {
  width: 100%;
  max-width: 100%;
  margin-bottom: 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.column-select summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 48px;
  padding: 12px 16px;
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.column-select summary::-webkit-details-marker {
  display: none;
}

.column-select summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1.5px solid var(--lavender-300);
  border-radius: var(--radius-pill);
  background: var(--lavender-100);
  color: var(--accent);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.column-select[open] summary::after {
  content: "−";
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.column-select summary strong {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
}

.column-select-body {
  display: grid;
  gap: 12px;
  padding: 0 16px 16px;
  border-top: 1px solid var(--line);
}

.column-select-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.8rem;
}

.empty-selection {
  color: var(--muted-light);
  font-size: 0.85rem;
  padding: 6px 4px;
}

.selected-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 44px;
  padding: 8px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.selected-column {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid var(--lavender-300);
  border-radius: var(--radius-pill);
  background: var(--lavender-100);
  color: var(--ink-2);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.selected-column:hover {
  background: var(--lavender-200);
  border-color: var(--accent-3);
}

.selected-column span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-column strong {
  color: var(--accent);
  font-size: 0.82rem;
  line-height: 1;
}

/* ── Chip column picker (replaces checkbox picker) ── */
.col-picker {
  display: grid;
  gap: 8px;
}

.col-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.col-picker-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-2);
}

.col-picker-actions {
  display: flex;
  gap: 4px;
}

.col-picker-actions .button {
  min-height: 26px;
  padding: 3px 9px;
  font-size: 0.72rem;
}

.col-picker-search {
  width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 0.84rem;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.col-picker-search:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.10);
}

.col-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 180px;
  overflow-y: auto;
  padding: 6px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.col-chip {
  padding: 4px 10px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
  white-space: nowrap;
  line-height: 1.4;
}

.col-chip:hover {
  background: var(--lavender-100);
  border-color: var(--lavender-400);
  color: var(--ink);
}

.col-chip--on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.col-chip--on:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: #fff;
}

.col-picker-count {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: right;
}

/* ─────────────────────────────────────────────
   File Upload / Dropzone
───────────────────────────────────────────── */
.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.dropzone {
  display: grid;
  gap: 14px;
  place-items: center;
  min-height: 200px;
  padding: 32px;
  border: 2px dashed var(--lavender-400);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface) 0%, var(--lavender-100) 100%);
  text-align: center;
  transition: border-color 0.18s, background 0.18s;
}

.dropzone:hover {
  border-color: var(--accent-2);
  background: var(--lavender-100);
}

/* ─────────────────────────────────────────────
   Breadcrumb & Browser
───────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 14px;
}

.breadcrumb button,
.folder-row,
.file-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.18s ease;
}

.breadcrumb button {
  padding: 7px 12px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
}

.breadcrumb button:hover {
  background: var(--lavender-100);
  border-color: var(--lavender-400);
}

.browser-list {
  display: grid;
  gap: 6px;
  max-height: 520px;
  overflow: auto;
}

.folder-row,
.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  text-align: left;
}

.folder-row:hover,
.file-row:hover {
  border-color: var(--lavender-400);
  background: var(--lavender-100);
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}

.file-row.active {
  border-color: var(--accent-2);
  background: var(--lavender-100);
  box-shadow: var(--shadow-sm);
}

/* ─────────────────────────────────────────────
   Tables
───────────────────────────────────────────── */
.table-shell {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.table-fullscreen {
  position: fixed;
  inset: 16px;
  z-index: 80;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 16px;
  overflow: hidden;
}

.table-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.83rem;
}

.table-toolbar .inline-actions {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(4, auto);
  justify-content: end;
  min-width: 0;
}

.table-toolbar .button {
  min-height: 32px;
  padding: 6px 12px;
  font-size: 0.76rem;
}

.table-search {
  width: 100%;
  min-height: 34px;
  padding: 7px 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-pill);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  font-size: 0.83rem;
}

.table-search:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.10);
}

.text-preview {
  width: 100%;
  max-height: 520px;
  overflow: auto;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--lavender-100);
  color: var(--ink);
  font-size: 0.84rem;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.65;
}

.upload-file-list {
  display: grid;
  gap: 10px;
}

.upload-file-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 0.9fr) minmax(180px, 1fr);
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.check-row {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 600;
}

.muted-row {
  opacity: 0.6;
}

.success-text {
  color: var(--success);
}

.error-text {
  color: var(--danger);
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  max-height: 560px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.table-fullscreen .table-wrap {
  max-height: calc(100vh - 130px);
}

table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

th,
td {
  padding: 10px 13px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

td {
  color: var(--ink-2);
}

.compact-table th,
.compact-table td {
  font-size: 0.78rem;
  padding: 7px 10px;
}

.table-wrap th:first-child,
.table-wrap td:first-child {
  background: var(--surface);
  border-right: 1px solid var(--line);
  left: 0;
  position: sticky;
  z-index: 1;
}

.table-wrap th:first-child {
  background: var(--lavender-100);
  z-index: 3;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--lavender-100);
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.column-filter-row th {
  top: 34px;
  padding: 6px;
  background: var(--surface);
}

.column-filter-row select {
  width: 100%;
  min-width: 120px;
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  text-transform: none;
  background: var(--surface);
  color: var(--ink);
}

/* ─────────────────────────────────────────────
   Tabs
───────────────────────────────────────────── */
.tabs {
  display: grid;
  gap: 18px;
  min-width: 0;
}

#fileWorkspace,
#tabPanel,
#vizControls,
#chartShell {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.tab-list {
  border-bottom: 1.5px solid var(--line);
  gap: 2px;
}

.tab-button {
  padding: 10px 14px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  margin-bottom: -1.5px;
}

.tab-button:hover {
  color: var(--accent);
  background: var(--lavender-100);
}

.tab-button.active {
  border-bottom-color: var(--accent);
  color: var(--accent);
  background: var(--lavender-100);
}

/* ─────────────────────────────────────────────
   Charts
───────────────────────────────────────────── */
.chart-shell {
  min-height: 420px;
}

.chart-shell canvas {
  width: 100% !important;
  max-height: 540px;
}

/* ─────────────────────────────────────────────
   Gallery & Visualization Cards
───────────────────────────────────────────── */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.gallery.list {
  grid-template-columns: 1fr;
}

.viz-card {
  transition: box-shadow 0.2s, transform 0.2s;
}

.viz-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.viz-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--lavender-100);
}

.viz-card h3,
.panel h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}

.viz-card p,
.panel p,
.mini-card p {
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.88rem;
}

.viz-meta {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 0.83rem;
}

.viz-meta span {
  display: grid;
  gap: 2px;
}

.viz-meta strong {
  color: var(--accent-2);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ─────────────────────────────────────────────
   Notices
───────────────────────────────────────────── */
.notice {
  padding: 12px 16px;
  border: 1px solid var(--lavender-300);
  border-radius: var(--radius);
  background: var(--lavender-100);
  color: var(--ink-2);
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.6;
}

.notice.success {
  border-color: #A7F3D0;
  background: var(--success-bg);
  color: var(--success);
}

.notice.error {
  border-color: #FECACA;
  background: var(--danger-bg);
  color: var(--danger);
}

/* ─────────────────────────────────────────────
   Toast Notifications
───────────────────────────────────────────── */
.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 36px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  color: var(--ink);
  font-size: 0.87rem;
  font-weight: 500;
  line-height: 1.5;
  animation: toast-in 0.24s ease forwards;
}

.toast::before {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 999px;
  content: "";
  background: var(--muted);
}

.toast.success::before {
  background: var(--success);
}

.toast.error {
  border-color: #FECACA;
  background: var(--danger-bg);
  color: var(--danger);
}

.toast.error::before {
  background: var(--danger);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* ─────────────────────────────────────────────
   Footer
───────────────────────────────────────────── */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px max(20px, calc((100vw - 1180px) / 2));
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}

.site-footer div {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-2);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
}

.site-footer img {
  width: 32px;
  height: 32px;
}

.site-footer p {
  max-width: 560px;
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.55;
}

/* ─────────────────────────────────────────────
   Scroll Reveal Animation
───────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ─────────────────────────────────────────────
   Reduced Motion
───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ─────────────────────────────────────────────
   Responsive — ≤ 1080px
───────────────────────────────────────────── */
@media (max-width: 1080px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .nav-toggle {
    display: inline-grid;
    place-items: center;
    grid-column: 1;
    grid-row: 1;
  }

  .brand {
    grid-column: 2;
    grid-row: 1;
    justify-self: start;
  }

  .main-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    display: none;
    justify-content: flex-start;
    max-height: calc(100vh - 120px);
    overflow: auto;
    padding: 8px 0 4px;
  }

  .main-nav.open {
    display: flex;
    flex-wrap: wrap;
  }

  .auth-actions {
    display: none;
    grid-column: 1 / -1;
    grid-row: 3;
    width: 100%;
    justify-content: flex-start;
    min-width: auto;
    padding: 4px 0 10px;
  }

  .main-nav.open + .auth-actions {
    display: flex;
  }

  .hero,
  .home-hero,
  .dashboard-grid,
  .split,
  .impact-section,
  .home-section-head,
  .home-two-column,
  .contact-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-media img {
    max-height: none;
  }

  .metrics,
  .stat-grid,
  .contact-grid,
  .card-grid,
  .gallery,
  .workflow-strip,
  .home-feature-grid,
  .home-info {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-layout,
  .home-two-column,
  .home-section-head {
    gap: 24px;
  }
}

/* ─────────────────────────────────────────────
   Responsive — ≤ 760px
───────────────────────────────────────────── */
@media (max-width: 760px) {
  .topbar {
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    padding: 8px 14px;
  }

  .auth-actions {
    grid-column: 1 / -1;
    grid-row: 3;
    width: 100%;
    justify-content: stretch;
  }

  .main-nav {
    grid-row: 2;
  }

  .main-nav.open {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .main-nav a {
    display: grid;
    min-height: 44px;
    align-items: center;
    padding: 10px 13px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.92);
  }

  .auth-actions .button {
    flex: 1;
  }

  .main-nav.open + .auth-actions {
    display: flex;
  }

  .home-hero,
  .hero {
    gap: 20px;
  }

  .home-hero-media img {
    max-height: 70vh;
  }

  .home-feature-detail {
    padding: 20px;
  }

  .panel {
    padding: 16px;
  }

  .contact-form-grid,
  .upload-file-row {
    grid-template-columns: 1fr;
  }

  .table-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .table-toolbar .inline-actions {
    grid-template-columns: minmax(0, 1fr) repeat(2, minmax(88px, auto));
    justify-content: stretch;
  }

  .table-toolbar .button {
    width: 100%;
  }

  .table-search {
    grid-column: 1 / -1;
  }

  .tab-list {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .tab-button {
    flex: 0 0 auto;
    min-height: 44px;
  }
}

/* ─────────────────────────────────────────────
   Responsive — ≤ 640px
───────────────────────────────────────────── */
@media (max-width: 640px) {
  :root {
    --container: min(100vw - 22px, 1180px);
  }

  .brand {
    min-width: 0;
  }

  .brand small,
  .user-chip {
    display: none;
  }

  .main-nav {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 28px;
  }

  .home-hero {
    padding-top: 28px;
  }

  .hero h1 {
    font-size: clamp(1.85rem, 10vw, 2.85rem);
  }

  .home-hero-top h1 {
    font-size: clamp(1.1rem, 6.5vw, 1.9rem);
    white-space: nowrap;
  }

  .section > p,
  .workspace > p,
  .split p,
  .impact-section p,
  .content-flow p,
  .contact-flow p {
    font-size: 0.9rem;
    line-height: 1.68;
  }

  .hero-media img {
    max-height: none;
  }

  .metrics,
  .stat-grid,
  .contact-grid,
  .card-grid,
  .gallery,
  .workflow-strip,
  .home-feature-grid,
  .home-info,
  .home-principles,
  .contact-form-grid {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .filters,
  .table-toolbar .inline-actions {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .filters {
    align-items: stretch;
  }

  .toolbar > *,
  .filters > *,
  .button,
  .file-label {
    width: 100%;
  }

  .col-picker-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .table-fullscreen {
    inset: 8px;
    padding: 10px;
  }

  .table-fullscreen .table-wrap {
    max-height: calc(100vh - 175px);
  }

  .site-footer {
    display: grid;
    gap: 14px;
  }

  .site-footer div {
    align-items: flex-start;
  }
}

/* ─────────────────────────────────────────────
   Responsive — ≤ 420px
───────────────────────────────────────────── */
@media (max-width: 420px) {
  .brand img,
  .site-footer img {
    width: 32px;
    height: 32px;
  }

  .brand strong {
    font-size: 0.86rem;
  }

  .button,
  .file-label {
    min-height: 40px;
    padding-inline: 14px;
    font-size: 0.8rem;
  }

  .home-feature,
  .contact-card,
  .mini-card,
  .metric,
  .viz-card {
    padding: 14px;
  }

  th,
  td {
    padding: 8px 10px;
    font-size: 0.76rem;
  }
}

/* ─────────────────────────────────────────────
   Landscape short screens
───────────────────────────────────────────── */
@media (max-height: 520px) and (orientation: landscape) {
  .topbar {
    position: static;
  }

  .home-hero {
    padding-top: 22px;
  }

  .home-hero-media img,
  .hero-media img {
    max-height: none;
  }
}

/* ─────────────────────────────────────────────
   Color scheme declaration
───────────────────────────────────────────── */
:root {
  color-scheme: light;
}

/* ─────────────────────────────────────────────
   Focus visible — override browser default
───────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
  outline: none;
}

/* ─────────────────────────────────────────────
   Page route transition
───────────────────────────────────────────── */
.page-root {
  transition: opacity 0.15s ease;
}
.page-root.page-transitioning {
  opacity: 0;
}

/* ─────────────────────────────────────────────
   User avatar in topbar
───────────────────────────────────────────── */
.user-avatar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 2px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  flex-shrink: 0;
  transition: box-shadow 0.15s ease, outline 0.15s ease;
  outline: 2px solid transparent;
  outline-offset: 2px;
}

.user-avatar-btn:hover {
  outline-color: var(--accent);
}

.user-avatar-btn.active {
  outline-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.user-avatar-btn img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  object-fit: cover;
  border: 2px solid var(--lavender-300);
  display: block;
}

/* ─────────────────────────────────────────────
   Overlay (logout confirm / inactivity warning)
───────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(24, 17, 46, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: overlay-in 0.2s ease forwards;
}

@keyframes overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.overlay.hidden {
  display: none !important;
}

.overlay-card {
  display: grid;
  gap: 14px;
  justify-items: center;
  text-align: center;
  max-width: 380px;
  width: calc(100vw - 40px);
  padding: 36px 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: card-in 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes card-in {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

.overlay-card h2 {
  margin: 0;
  font-size: 1.35rem;
}

.overlay-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.overlay-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ─────────────────────────────────────────────
   Stat result badges
───────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.4;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #A7F3D0;
}

.badge-warning {
  background: var(--gold-bg);
  color: var(--gold);
  border: 1px solid #FDE68A;
}

.badge-info {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}

.badge-neutral {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
}

.badge-muted {
  background: var(--surface-2);
  color: var(--muted-light);
  border: 1px solid var(--border);
}

/* ─────────────────────────────────────────────
   Small buttons
───────────────────────────────────────────── */
.btn-sm {
  padding: 4px 10px !important;
  font-size: 0.78rem !important;
  min-height: unset !important;
}

.btn-danger {
  color: var(--error) !important;
  border-color: var(--error) !important;
}
.btn-danger:hover {
  background: #FFF1F2 !important;
}

/* ─────────────────────────────────────────────
   Schedule table
───────────────────────────────────────────── */
.schedule-table .col-actions {
  width: 130px;
  white-space: nowrap;
}

.schedule-table .col-actions .btn-sm + .btn-sm {
  margin-left: 4px;
}

.table-scroll-wrap {
  overflow-x: auto;
}

.sched-form-panel {
  border: 2px solid var(--accent-3);
  margin-bottom: 20px;
}

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

@media (max-width: 640px) {
  .field-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ─────────────────────────────────────────────
   Upload progress bar
───────────────────────────────────────────── */
.upload-progress-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(0, 2fr) 48px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 0.84rem;
  margin-top: 8px;
}

.upload-progress-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
  font-weight: 500;
}

.upload-progress-bar-wrap {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--lavender-200);
  overflow: hidden;
}

.upload-progress-bar {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.3s ease;
}

.upload-progress-pct {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-align: right;
}

/* ─────────────────────────────────────────────
   Dropzone drag-active state
───────────────────────────────────────────── */
.dropzone-active {
  border-color: var(--accent) !important;
  background: var(--lavender-200) !important;
  box-shadow: 0 0 0 4px rgba(109, 40, 217, 0.12);
}

/* ─────────────────────────────────────────────
   File breadcrumb
───────────────────────────────────────────── */
.file-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-bottom: 14px;
  font-size: 0.8rem;
}

.file-breadcrumb-part {
  color: var(--muted);
}

.file-breadcrumb-sep {
  color: var(--muted-light);
  font-size: 0.9rem;
}

.file-breadcrumb-current {
  color: var(--accent);
  font-weight: 600;
}

/* ─────────────────────────────────────────────
   Mobile — reverse sidebar order
───────────────────────────────────────────── */
@media (max-width: 1080px) {
  .dashboard-grid {
    display: flex;
    flex-direction: column;
  }
  .dashboard-grid > aside {
    order: 2;
  }
  .dashboard-grid > *:not(aside) {
    order: 1;
  }
}

/* ─────────────────────────────────────────────
   Print styles
───────────────────────────────────────────── */
@media print {
  .topbar,
  .site-footer,
  .toast-stack,
  .overlay,
  .hero-actions,
  .toolbar,
  .inline-actions,
  .tab-list,
  .button,
  .file-label,
  .breadcrumb,
  .auth-actions,
  .nav-toggle {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  .page-root {
    min-height: 0;
  }

  .table-wrap {
    max-height: none;
    overflow: visible;
    border: 1px solid #ccc;
  }

  table {
    width: 100%;
    font-size: 9pt;
    border-collapse: collapse;
  }

  th, td {
    border: 1px solid #ccc;
    padding: 5px 7px;
    white-space: normal;
  }

  th {
    background: #f0f0f0 !important;
    color: #000 !important;
  }

  .panel,
  .metric,
  .mini-card,
  .viz-card {
    border: 1px solid #ccc;
    box-shadow: none;
    page-break-inside: avoid;
  }

  .chart-shell canvas {
    max-height: none;
    page-break-inside: avoid;
  }
}

/* ─────────────────────────────────────────────
   Page Header (reusable inner-page header)
───────────────────────────────────────────── */
.page-header {
  padding-bottom: 28px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.page-header h1 {
  margin: 0 0 8px;
}

.page-header > p {
  margin: 0;
  max-width: 720px;
  color: var(--muted);
  line-height: 1.72;
}

/* ─────────────────────────────────────────────
   Sidebar Panels
───────────────────────────────────────────── */
.sidebar-panel {
  padding: 0;
  overflow: hidden;
}

.sidebar-section {
  padding: 18px 20px;
}

.sidebar-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--accent-2);
}

.sidebar-section-head svg {
  flex-shrink: 0;
}

.sidebar-section-head h3 {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-hint {
  margin: 0 0 12px;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.6;
}

.sidebar-divider {
  height: 1px;
  background: var(--line);
}

.sidebar-or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.sidebar-or::before,
.sidebar-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ─────────────────────────────────────────────
   Dashboard grid — two columns on desktop
───────────────────────────────────────────── */
@media (min-width: 1081px) {
  .dashboard-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
  }
}

/* ─────────────────────────────────────────────
   Workspace empty state
───────────────────────────────────────────── */
.workspace-empty {
  display: grid;
  place-items: center;
  gap: 12px;
  min-height: 300px;
  text-align: center;
  padding: 48px 24px;
}

.workspace-empty h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink-2);
}

.workspace-empty p {
  margin: 0;
  max-width: 340px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.65;
}

/* ─────────────────────────────────────────────
   Upload Steps Indicator
───────────────────────────────────────────── */
.upload-steps {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.upload-step {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  padding: 13px 18px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  transition: background 0.18s;
}

.upload-step.active {
  background: var(--lavender-100);
  color: var(--ink);
}

.upload-step-num {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: background 0.18s, color 0.18s;
}

.upload-step.active .upload-step-num {
  background: var(--accent);
  color: #fff;
}

.upload-step-sep {
  width: 1px;
  height: 38px;
  background: var(--line);
  flex-shrink: 0;
}

/* ─────────────────────────────────────────────
   Visualization tab bar
───────────────────────────────────────────── */
.viz-tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  width: fit-content;
  box-shadow: var(--shadow-xs);
}

.viz-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius);
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.viz-tab-btn:hover {
  color: var(--ink);
  background: var(--lavender-100);
}

.viz-tab-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(109,40,217,0.25);
}

.viz-panel-content {
  min-height: 300px;
}

/* ─────────────────────────────────────────────
   Home — eyebrow label
───────────────────────────────────────────── */
.home-eyebrow {
  display: block;
  margin: 0 0 10px;
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Home hero — override to two-column on desktop */
@media (min-width: 900px) {
  .home-hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    padding: clamp(52px, 7vw, 88px) 0 clamp(40px, 5vw, 60px);
  }
}

/* ─────────────────────────────────────────────
   Home — Stats band
───────────────────────────────────────────── */
.home-stats-band {
  background: var(--accent);
}

.home-stats-inner {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 0;
}

.home-stat {
  display: grid;
  gap: 6px;
  padding: clamp(22px, 3vw, 36px) clamp(18px, 2.5vw, 30px);
  border-right: 1px solid rgba(255,255,255,0.15);
}

.home-stat:last-child {
  border-right: none;
}

.home-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 2.8vw, 2.5rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1;
}

.home-stat span {
  color: rgba(255,255,255,0.72);
  font-size: 0.8rem;
  line-height: 1.5;
}

/* ─────────────────────────────────────────────
   Home — About grid
───────────────────────────────────────────── */
.home-about-grid {
  display: grid;
  gap: clamp(28px, 4vw, 60px);
  align-items: start;
}

@media (min-width: 900px) {
  .home-about-grid {
    grid-template-columns: minmax(240px, 0.8fr) minmax(280px, 1.2fr);
  }
}

.home-about-text {
  display: grid;
  gap: 16px;
}

.home-about-text h2 {
  margin: 0;
  font-size: clamp(1.45rem, 2.4vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.home-about-text > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.72;
}

.home-about-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.home-about-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}

.home-about-card:hover {
  border-color: var(--lavender-400);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.home-about-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--lavender-100);
  color: var(--accent);
  margin-bottom: 12px;
}

.home-about-card h3 {
  margin: 0 0 6px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
}

.home-about-card > p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ─────────────────────────────────────────────
   Home — Principles grid
───────────────────────────────────────────── */
.home-principles-header {
  margin-bottom: 32px;
}

@media (min-width: 900px) {
  .home-principles-header {
    display: grid;
    grid-template-columns: minmax(220px, 0.65fr) minmax(280px, 1fr);
    gap: clamp(24px, 4vw, 60px);
    align-items: end;
  }
}

.home-principles-header h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
}

.home-principles-header > p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.72;
}

@media (min-width: 900px) {
  .home-principles-header > p {
    margin: 0;
  }
}

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

@media (min-width: 900px) {
  .home-principles-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.home-principle-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}

.home-principle-card:hover {
  border-color: var(--lavender-400);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.home-principle-num {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-2);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.home-principle-card h3 {
  margin: 0 0 7px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
}

.home-principle-card > p {
  margin: 0;
  font-size: 0.81rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ─────────────────────────────────────────────
   Home — CTA block
───────────────────────────────────────────── */
.home-cta-block {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
  padding: clamp(36px, 5vw, 64px);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, var(--lavender-100) 0%, var(--surface) 100%);
  border: 1px solid var(--lavender-300);
  box-shadow: var(--shadow-sm);
}

.home-cta-block h2 {
  margin: 0 0 12px;
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.025em;
}

.home-cta-block > p {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.72;
}

/* ─────────────────────────────────────────────
   Contact — hero header
───────────────────────────────────────────── */
.contact-hero {
  padding: clamp(32px, 5vw, 56px) 0 clamp(24px, 3.5vw, 40px);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(160deg, var(--lavender-100) 0%, var(--surface) 65%);
}

.contact-hero h1 {
  margin: 6px 0 10px;
  font-size: clamp(1.75rem, 3vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.contact-hero > .section > p {
  margin: 0;
  max-width: 540px;
  color: var(--muted);
  line-height: 1.72;
}

/* Contact layout — no top margin, hero provides spacing */
.contact-hero + .workspace .contact-layout {
  margin-top: 0;
}

/* ─────────────────────────────────────────────
   Contact — sidebar info cards
───────────────────────────────────────────── */
.contact-sidebar {
  display: grid;
  gap: 12px;
  align-content: start;
}

.contact-info-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.18s, box-shadow 0.18s;
}

.contact-info-card:hover {
  border-color: var(--lavender-400);
  box-shadow: var(--shadow-sm);
}

.contact-info-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: var(--radius);
  background: var(--lavender-100);
  color: var(--accent);
}

.contact-info-label {
  display: block;
  margin-bottom: 3px;
  color: var(--accent-2);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.contact-info-value {
  color: var(--ink);
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.5;
  font-style: normal;
}

a.contact-info-value {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--lavender-300);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.15s;
}

a.contact-info-value:hover {
  text-decoration-color: var(--accent);
}

.contact-social-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.contact-social-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 13px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.74rem;
  font-weight: 600;
  text-align: center;
  transition: all 0.18s ease;
}

.contact-social-link:hover {
  border-color: var(--lavender-400);
  background: var(--lavender-100);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-xs);
}

.contact-response-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.79rem;
  text-align: center;
}

.contact-form-title {
  margin: 0 0 4px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
}

/* ─────────────────────────────────────────────
   Responsive — stats band, home sections
───────────────────────────────────────────── */
@media (max-width: 1080px) {
  .home-stats-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-stat {
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.15);
  }

  .home-stat:nth-child(odd) {
    border-right: 1px solid rgba(255,255,255,0.15);
  }

  .home-stat:nth-last-child(-n+2) {
    border-bottom: none;
  }
}

@media (max-width: 760px) {
  .home-about-cards {
    grid-template-columns: 1fr;
  }

  .home-principles-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .upload-steps {
    flex-wrap: wrap;
  }

  .upload-step-sep {
    display: none;
  }

  .upload-step {
    flex: 0 0 calc(50% - 4px);
  }

  .viz-tab-bar {
    width: 100%;
  }

  .contact-social-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .home-stats-inner {
    grid-template-columns: 1fr;
  }

  .home-stat {
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.15);
  }

  .home-stat:last-child {
    border-bottom: none;
  }

  .home-principles-grid {
    grid-template-columns: 1fr;
  }

  .upload-step {
    flex: 1;
  }
}

/* ─────────────────────────────────────────────
   Saved viz toolbar
───────────────────────────────────────────── */
.saved-viz-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: end;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

/* ─────────────────────────────────────────────
   Page Nav Bar (top navigation with single toggle)
───────────────────────────────────────────── */
.page-nav-bar {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  overflow: hidden;
}

.page-nav-bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  background: var(--lavender-100);
  border-bottom: 1px solid var(--line);
}

.page-nav-bar.collapsed .page-nav-bar-header {
  border-bottom: none;
}

.page-nav-bar-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-2);
}

.page-nav-bar-toggle {
  color: var(--muted);
  border-radius: var(--radius-sm);
  padding: 4px;
  transition: background 0.15s;
}

.page-nav-bar-toggle:hover {
  background: var(--lavender-200);
  color: var(--ink);
}

.page-nav-bar-toggle .page-nav-chevron {
  transition: transform 0.2s ease;
  display: block;
}

.page-nav-bar.collapsed .page-nav-bar-toggle .page-nav-chevron {
  transform: rotate(180deg);
}

.page-nav-sections {
  display: flex;
  flex-direction: column;
}

.page-nav-bar.collapsed .page-nav-sections {
  display: none;
}

.page-nav-section {
  border-bottom: 1px solid var(--line);
}

.page-nav-section:last-child {
  border-bottom: none;
}

.page-nav-section-title {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background 0.15s;
}

.page-nav-section-title::-webkit-details-marker {
  display: none;
}

.page-nav-section-title:hover {
  background: var(--lavender-100);
}

.page-nav-section[open] > .page-nav-section-title {
  background: var(--lavender-100);
  border-bottom: 1px solid var(--line);
}

.page-nav-section-title > svg:first-child {
  color: var(--accent-2);
  flex-shrink: 0;
}

.page-nav-section-title > span {
  flex: 1;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink);
}

.page-nav-section-chevron {
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 0.2s ease;
  margin-left: auto;
}

.page-nav-section[open] .page-nav-section-chevron {
  transform: rotate(180deg);
}

.page-nav-section-body {
  padding: 12px 16px 14px;
}

.page-nav-section-body .sidebar-hint {
  margin-bottom: 10px;
}

/* ─────────────────────────────────────────────
   Viz Controls Bar (horizontal row above chart)
───────────────────────────────────────────── */
.viz-controls-bar {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 16px;
}

/* Grouped controls sections */
.viz-control-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 10px;
}

.viz-control-group:last-child {
  margin-bottom: 0;
}

.viz-control-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 10px 14px;
  background: var(--lavender-100);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background 0.15s;
}

.viz-control-group-head::-webkit-details-marker {
  display: none;
}

.viz-control-group:not([open]) .viz-control-group-head {
  border-bottom: none;
}

.viz-control-group-head:hover {
  background: var(--lavender-200);
}

.viz-control-group-title {
  display: flex;
  align-items: center;
  gap: 7px;
}

.viz-control-group-title svg {
  color: var(--accent-2);
  flex-shrink: 0;
}

.viz-control-group-title strong {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.viz-group-chevron {
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.viz-control-group[open] .viz-group-chevron {
  transform: rotate(180deg);
}

.viz-control-group-body {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.viz-generate-row {
  margin-top: 14px;
}

.viz-generate-row .button {
  width: 100%;
}

/* Chart panel */
.viz-chart-panel {
  display: grid;
  gap: 16px;
}

.viz-save-section {
  padding: 16px;
  border: 1px solid var(--lavender-300);
  border-radius: var(--radius-md);
  background: var(--lavender-100);
}

.viz-save-section h4 {
  margin: 0 0 12px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-2);
}

.viz-save-fields {
  display: grid;
  gap: 10px;
}

/* ─────────────────────────────────────────────
   Visualization Gallery / Grid / List
───────────────────────────────────────────── */
.viz-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 14px;
}

.viz-gallery.gallery-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.viz-gallery.gallery-list {
  grid-template-columns: 1fr;
  gap: 8px;
}

/* Restructured viz card */
.viz-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}

.viz-card:hover {
  border-color: var(--lavender-400);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.viz-card-preview {
  background: var(--lavender-100);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.viz-card-preview img {
  display: block;
  width: 100%;
  height: 170px;
  object-fit: contain;
  object-position: center;
}

.viz-card-preview-empty {
  display: grid;
  place-items: center;
  height: 80px;
  color: var(--lavender-400);
}

.viz-card-body {
  padding: 12px 14px;
  display: grid;
  gap: 6px;
  align-content: start;
}

.viz-card-body h3 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.viz-card-body > p {
  margin: 0;
  font-size: 0.81rem;
  color: var(--muted);
  line-height: 1.55;
}

.viz-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}

.viz-meta-chip {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 0.73rem;
  color: var(--ink-2);
  white-space: nowrap;
}

.viz-meta-chip svg {
  display: inline-block;
  flex-shrink: 0;
  width: 11px;
  height: 11px;
  min-width: 11px;
  max-width: 11px;
  vertical-align: middle;
}

.viz-meta-chip strong {
  color: var(--accent-2);
  font-weight: 700;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.viz-card-actions {
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.viz-card-actions .button {
  width: 100%;
  justify-content: center;
}

/* ── List view overrides ── */
.gallery-list .viz-card {
  grid-template-rows: 1fr;
  grid-template-columns: 120px 1fr auto;
  align-items: stretch;
  transform: none;
}

.gallery-list .viz-card:hover {
  transform: none;
}

.gallery-list .viz-card-preview {
  border-bottom: none;
  border-right: 1px solid var(--line);
  width: 120px;
  flex-shrink: 0;
}

.gallery-list .viz-card-preview img {
  width: 120px;
  height: 100%;
  min-height: 88px;
  max-height: 110px;
  object-fit: cover;
}

.gallery-list .viz-card-preview-empty {
  height: 100%;
  min-height: 88px;
}

.gallery-list .viz-card-body {
  padding: 11px 14px;
  border-bottom: none;
}

.gallery-list .viz-card-actions {
  display: flex;
  align-items: center;
  padding: 12px;
  border-top: none;
  border-left: 1px solid var(--line);
  background: var(--surface);
  min-width: 130px;
}

.gallery-list .viz-card-actions .button {
  white-space: nowrap;
  width: auto;
}

/* ── Gallery count line ── */
.viz-count-line {
  margin: 0 0 14px;
  font-size: 0.83rem;
  color: var(--muted);
  font-weight: 500;
}

/* ─────────────────────────────────────────────
   Responsive overrides for nav bar
───────────────────────────────────────────── */
@media (max-width: 760px) {
  .page-nav-sections {
    grid-template-columns: 1fr;
  }

  .page-nav-section-title {
    padding: 9px 14px;
  }

  .gallery-list .viz-card {
    grid-template-columns: 80px 1fr;
    grid-template-rows: 1fr auto;
  }

  .gallery-list .viz-card-preview {
    width: 80px;
  }

  .gallery-list .viz-card-preview img {
    width: 80px;
  }

  .gallery-list .viz-card-actions {
    grid-column: 1 / -1;
    border-left: none;
    border-top: 1px solid var(--line);
    min-width: 0;
  }

  .viz-gallery.gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Viz controls: generate row ── */
.viz-generate-row {
  padding-top: 4px;
}

.viz-generate-row .button {
  width: 100%;
  justify-content: center;
}

/* ── Viz save section ── */
.viz-save-heading {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--ink-1);
  margin-bottom: 12px;
}

.viz-save-fields {
  display: grid;
  gap: 10px;
}

/* ── Viz card empty preview ── */
.viz-card-preview-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-soft);
  color: var(--ink-3);
  min-height: 100px;
}

.gallery-list .viz-card-preview-empty {
  min-height: unset;
  height: 100%;
}

/* ── Profile page ── */
.profile-page {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: clamp(24px, 4vw, 48px) 0 60px;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 28px 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.profile-avatar-wrap {
  flex-shrink: 0;
}

.profile-avatar {
  width: 88px;
  height: 88px;
  border-radius: var(--radius-pill);
  object-fit: cover;
  border: 3px solid var(--lavender-300);
  box-shadow: var(--shadow-sm);
  display: block;
}

.profile-avatar-fallback {
  width: 88px;
  height: 88px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid transparent;
  box-shadow: var(--shadow-sm);
}

.profile-identity {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.profile-identity h1 {
  margin: 0;
  font-size: clamp(1.3rem, 3vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-email {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-2);
}

.profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  width: fit-content;
}

.profile-badge.verified {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}

.profile-sections {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-sm);
}

.profile-section h2 {
  margin: 0 0 18px;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-3);
}

.profile-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.profile-detail {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.profile-detail:nth-last-child(-n+2) {
  border-bottom: none;
}

.profile-detail-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}

.profile-detail-value {
  font-size: 0.9rem;
  color: var(--ink);
  word-break: break-all;
}

.profile-uid {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.75rem;
  color: var(--ink-2);
}

.profile-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.profile-link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  text-decoration: none;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  text-align: center;
}

.profile-link-card:hover {
  background: var(--lavender-100);
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
  color: var(--accent);
}

.profile-link-card svg {
  flex-shrink: 0;
  color: var(--ink-2);
  transition: color 0.15s ease;
}

.profile-link-card:hover svg {
  color: var(--accent);
}

.profile-signout-btn {
  border-color: var(--error, #dc2626);
  color: var(--error, #dc2626);
}

.profile-signout-btn:hover {
  background: color-mix(in srgb, var(--error, #dc2626) 8%, transparent);
}

@media (max-width: 640px) {
  .profile-card {
    flex-direction: column;
    text-align: center;
    padding: 24px 20px;
  }

  .profile-identity h1 {
    white-space: normal;
  }

  .profile-badge {
    margin: 4px auto 0;
  }

  .profile-detail-grid {
    grid-template-columns: 1fr;
  }

  .profile-detail:last-child {
    border-bottom: none;
  }

  .profile-detail:nth-last-child(2) {
    border-bottom: 1px solid var(--line);
  }

  .profile-section {
    padding: 20px 16px;
  }
}

/* ── Team Access management (manager-only profile section) ── */
.profile-section-team {
  background: var(--surface);
}

.team-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.team-section-header h2 { margin: 0 0 4px; }
.team-section-header p { margin: 0; color: var(--ink-2); font-size: 0.875rem; }

.team-members-list {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 20px;
}

.team-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.team-member-row:last-child { border-bottom: none; }
.team-member-row:nth-child(even) { background: var(--lavender-50, var(--surface)); }

.team-member-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.team-member-email {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-member-badge {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
}

.team-member-badge.role-manager {
  background: var(--lavender-100);
  color: var(--accent-2);
  border-color: var(--lavender-300);
}

.team-member-badge.role-member {
  background: var(--surface);
  color: var(--ink-2);
}

.team-member-you {
  font-size: 0.78rem;
  color: var(--muted);
  font-style: italic;
  flex-shrink: 0;
}

.button.button-sm {
  padding: 4px 10px;
  font-size: 0.78rem;
  flex-shrink: 0;
}

.team-add-form {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--surface);
}

.team-add-form h3 {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-2);
  margin: 0 0 14px;
}

/* ── Side-by-side compare chart layout ── */
.compare-chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 860px) {
  .compare-chart-grid {
    grid-template-columns: 1fr;
  }
}

.compare-chart-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.compare-chart-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-3);
  margin: 0;
}

/* ── Inline label + input field ── */
.field-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.field-inline input[type="checkbox"] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.field-inline span {
  font-size: 0.84rem;
  color: var(--ink-2);
}
