:root {
  --ink: #0b132b;
  --muted: #64748b;
  --line: #e2e8f0;
  --paper: #f8fafc;
  --white: #ffffff;
  --navy: #061e47;
  --green: #1f4591;
  --green2: #2b6ad0;
  --mint: #ebf2fc;
  --lime: #68a4f1;
  --sky-btn: #d6e5fa;
  --gold: #a56b1f;
  --red: #a44e42;
  --shadow: 0 10px 30px rgba(6, 30, 71, 0.08);
  --shadow-sm: 0 2px 6px rgba(6, 30, 71, 0.04);
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
}

#app {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button {
  cursor: pointer;
  border: 0;
  background: transparent;
}

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

h1, h2, h3, h4, p {
  margin-top: 0;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
  color: var(--ink);
}

h1 {
  font-size: clamp(18px, 2.5vw, 22px);
  line-height: 1.25;
  margin: 4px 0 6px;
}

h2 {
  font-size: clamp(15px, 2vw, 17px);
  margin: 0 0 6px;
}

h3 {
  font-size: clamp(12px, 1.5vw, 13.5px);
  margin: 0 0 6px;
}

p {
  color: #748079;
  font-size: 11px;
  line-height: 1.55;
}

.eyebrow {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--green);
}

/* Boot loader */
.boot {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.radar-mark {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--green);
  color: white;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 12px;
  flex-shrink: 0;
}

/* Sidebar Backdrop (hidden on desktop, active on mobile) */
.sidebar-backdrop {
  display: none;
}

/* ==========================================================================
   App Layout (Desktop Default: 3-column independent scroll)
   ========================================================================== */
.app-layout {
  height: 100vh;
  max-height: 100vh;
  width: 100vw;
  max-width: 100vw;
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 214px;
  overflow: hidden;
  position: relative;
}

@media (min-width: 1300px) {
  .app-layout {
    grid-template-columns: 204px minmax(0, 1fr) 244px;
  }
}

/* Column 1: Pinned Sidebar */
.sidebar {
  grid-column: 1;
  grid-row: 1;
  height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  border-right: 1px solid var(--line);
  padding: 8px 8px 6px;
  background: #fdfdfb;
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 10;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 4px;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 2px 4px;
  min-width: 0;
}

.brand .radar-mark {
  width: 24px;
  height: 24px;
  font-size: 11px;
  border-radius: 6px;
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 13px;
  letter-spacing: -0.4px;
  font-weight: 800;
  line-height: 1.1;
}

.brand-sub {
  font-size: 7px;
  color: var(--muted);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-top: 1px;
}

button.mobile-close, .mobile-close {
  display: none !important;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #67716d;
}

.mobile-close:hover {
  background: #edf1ed;
  color: var(--ink);
}

.nav-caption {
  font-size: 7.5px;
  color: #a1aaa5;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0 6px 2px;
  font-weight: 700;
  margin-top: 4px;
}

.nav-group {
  display: grid;
  gap: 1px;
}

.nav-link {
  border: 0;
  background: transparent;
  color: #67716d;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 7px;
  border-radius: 6px;
  text-align: left;
  font-size: 10.5px;
  line-height: 1.2;
  transition: background 0.12s, color 0.12s;
  width: 100%;
}

.nav-link:hover {
  background: #f2f5f1;
  color: var(--ink);
}

.nav-link.active {
  background: var(--mint);
  color: var(--green);
  font-weight: 700;
}

.nav-link svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
  flex-shrink: 0;
}

.side-spacer {
  flex: 1;
  min-height: 4px;
}

.sidebar-note {
  margin: 0;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.sidebar-note .tiny-cap {
  font-size: 7px;
  letter-spacing: 0.8px;
  color: var(--green);
  font-weight: 700;
}

.sidebar-note p {
  font-family: var(--font-heading);
  font-size: 8.5px;
  line-height: 1.3;
  margin: 2px 0 0;
  color: #55615b;
}

.user-block {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 2px 0;
  border-top: 1px solid var(--line);
  min-width: 0;
  margin-top: auto;
}

.avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #dbe8fb;
  color: var(--green);
  font-size: 9.5px;
  font-weight: 700;
  flex-shrink: 0;
}

.user-info {
  min-width: 0;
  flex: 1;
}

.user-info strong {
  display: block;
  font-size: 9.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-info small {
  font-size: 8px;
  color: var(--muted);
  display: block;
}

.icon-button {
  border: 0;
  background: transparent;
  color: #85908a;
  padding: 3px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.14s, color 0.14s;
}

.icon-button:hover {
  background: #edf1ed;
  color: var(--ink);
}

/* Column 2: Main Content Area (Independent Scroll) */
.main {
  grid-column: 2;
  grid-row: 1;
  height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  padding: 0 16px 14px;
  min-width: 0;
  position: relative;
}

.main::-webkit-scrollbar {
  width: 4px;
}

.main::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 4px;
}

/* Sticky Topbar inside Main */
.topbar {
  min-height: 38px;
  max-height: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
  position: sticky;
  top: 0;
  z-index: 25;
  background: var(--paper);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.crumb {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.crumb strong {
  color: #49544f;
  font-weight: 600;
}

.top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

button.mobile-menu, .mobile-menu {
  display: none !important;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1;
}

.main-body {
  width: 100%;
  min-width: 0;
}

/* Column 3: Pinned Right Rail */
.right-rail {
  grid-column: 3;
  grid-row: 1;
  height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  border-left: 1px solid var(--line);
  padding: 8px 10px;
  background: #fdfdfb;
  min-width: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.right-rail::-webkit-scrollbar {
  width: 4px;
}

.right-rail::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 4px;
}

.right-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 2px;
}

.right-head h3 {
  margin: 0;
  font-size: 10.5px;
}

.live-tag {
  font-size: 7.5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #1f4591;
  background: #ebf2fc;
  border-radius: 4px;
  padding: 3px 5px;
  font-weight: 700;
  white-space: nowrap;
}

.rail-section {
  margin-bottom: 14px;
}

.rail-title {
  font-size: 8px;
  letter-spacing: 1px;
  color: #9ba59e;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 6px;
}

.provider-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 0;
  border-bottom: 1px solid #eff0ec;
  font-size: 9.5px;
  color: #58645d;
}

.provider-state {
  font-size: 8.5px;
  display: flex;
  align-items: center;
  gap: 4px;
  color: #9a7c39;
  white-space: nowrap;
}

.provider-state.ready {
  color: #2b6ad0;
}

.provider-state i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

.mini-run {
  padding: 5px 0;
  border-bottom: 1px solid #f1f3ee;
}

.mini-run strong {
  display: block;
  font-size: 10px;
  color: #2b3933;
  margin-bottom: 1px;
}

.mini-run small {
  font-size: 8.5px;
  color: #98a29c;
}

.rail-callout {
  padding: 8px 10px;
  background: #edf4fc;
  border: 1px solid #d4e3f8;
  border-radius: 7px;
}

.rail-callout strong {
  display: block;
  font-size: 9px;
  color: #1f4591;
  margin-bottom: 2px;
}

.rail-callout p {
  font-size: 8.5px;
  color: #5d6f8a;
  margin: 0;
  line-height: 1.4;
}

/* ==========================================================================
   Components & Content Cards
   ========================================================================== */

/* Welcome Hero Card */
.welcome-card {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  padding: 8px 14px;
  margin: 0 0 8px;
  background: var(--navy);
  color: white;
  min-height: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.welcome-card::after {
  content: '';
  position: absolute;
  right: 15%;
  top: -80px;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  box-shadow: 0 0 0 24px rgba(255, 255, 255, 0.03), 0 0 0 50px rgba(255, 255, 255, 0.02);
  pointer-events: none;
}

.welcome-card > div {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.welcome-card h2 {
  font-size: 13px;
  color: #ffffff;
  margin: 1px 0 2px;
  word-break: break-word;
  line-height: 1.2;
}

.welcome-card p {
  max-width: 480px;
  color: #b4ccf5;
  margin: 0;
  font-size: 9.5px;
  line-height: 1.35;
}

.welcome-card .eyebrow {
  font-size: 7.5px;
  color: #68a4f1;
  letter-spacing: 1px;
}

.welcome-cta {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  white-space: nowrap;
  background: #d6e5fa;
  color: #061e47;
  padding: 5px 11px;
  font-size: 9.5px;
  font-weight: 700;
  border-radius: 6px;
}

.welcome-cta:hover {
  background: #c3dcfa;
}

/* Buttons */
.btn {
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 7px 12px;
  font-size: 10.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background: var(--green);
  color: white;
  box-shadow: 0 2px 6px rgba(31, 69, 145, 0.2);
}

.btn-primary:hover {
  background: var(--green2);
  transform: translateY(-1px);
}

.btn-secondary {
  border-color: #dfe3dd;
  background: #ffffff;
  color: #4c5953;
}

.btn-secondary:hover {
  border-color: #aebbb0;
  background: #f8faf7;
}

.btn-quiet {
  background: transparent;
  color: #69756e;
  padding: 6px;
}

.btn-quiet:hover {
  background: #eef2ed;
}

.btn-small {
  padding: 5px 9px;
  font-size: 9.5px;
}

.btn-danger {
  background: #fff4f2;
  color: var(--red);
  border-color: #f2ddda;
}

/* Status Pills & Badges */
.status-pill {
  border-radius: 16px;
  padding: 3px 7px;
  font-size: 8.5px;
  font-weight: 700;
  display: inline-flex;
  gap: 4px;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-pill::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.pill-moderate, .pill-complete {
  background: #ebf2fc;
  color: #1f4591;
}

.pill-weak, .pill-partial {
  background: #fff6e5;
  color: #9b741d;
}

.pill-insufficient, .pill-unavailable, .pill-failed {
  background: #f3f4f2;
  color: #7a827c;
}

.pill-running, .pill-queued {
  background: #eef4fc;
  color: #5371a0;
}

.pill-customer_verified, .pill-pilot_tested, .pill-paid_validation {
  background: #ebf2fc;
  color: #1f4591;
}

.pill-discovery, .pill-researched {
  background: #f3f4f2;
  color: #78817c;
}

.label-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  padding: 3px 5px;
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
  flex-shrink: 0;
}

.label-observed {
  color: #1f4591;
  background: #ebf2fc;
}

.label-inferred {
  color: #97701f;
  background: #fbf4df;
}

.label-hypothesis {
  color: #7855a0;
  background: #f3eef8;
}

.tag {
  background: #f1f4f0;
  color: #68756c;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 8.5px;
  white-space: nowrap;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.stat-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 9px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  font-size: 8.5px;
  color: #77817d;
  font-weight: 500;
}

.stat-top span:first-child {
  word-break: break-word;
  line-height: 1.2;
}

.stat-icon {
  width: 14px;
  height: 14px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  color: var(--green);
  background: #ebf3fd;
  font-size: 8px;
  flex-shrink: 0;
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 16px;
  line-height: 1;
  margin: 2px 0 1px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.stat-foot {
  font-size: 7.5px;
  color: #9aa39e;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Projects & Listings */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 6px;
}

.section-head h2 {
  font-size: 12.5px;
  margin: 0;
  font-weight: 700;
}

.section-head p {
  margin: 0;
  font-size: 9px;
  color: #77817d;
}

.project-list {
  display: grid;
  gap: 7px;
}

.project-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.14s;
  min-width: 0;
}

.project-card:hover {
  border-color: #68a4f1;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.project-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #ebf3fd;
  color: var(--green);
  display: grid;
  place-items: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

.project-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #26312d;
  margin-bottom: 2px;
  word-break: break-word;
}

.project-desc {
  font-size: 9.5px;
  color: var(--muted);
  word-break: break-word;
}

.project-meta {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  color: #838e87;
  font-size: 8.5px;
  flex-wrap: wrap;
}

.project-meta span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.project-right {
  text-align: right;
  flex-shrink: 0;
}

.project-date {
  display: block;
  font-size: 8.5px;
  color: #909a94;
  margin-bottom: 5px;
  white-space: nowrap;
}

/* Page Heading & Detail Heading */
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.page-heading > div {
  flex: 1 1 240px;
  min-width: 0;
}

.page-heading p {
  margin: 0;
}

.page-heading .btn {
  flex-shrink: 0;
}

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

.detail-heading > div:first-child {
  flex: 1 1 240px;
  min-width: 0;
}

.detail-heading h1 {
  font-size: clamp(17px, 2.3vw, 22px);
  word-break: break-word;
  margin: 3px 0 4px;
}

.detail-heading .card-actions {
  margin-top: 0;
  flex-shrink: 0;
}

.detail-meta {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 9px;
  color: #849087;
  margin-top: 4px;
  flex-wrap: wrap;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  border: 0;
  background: transparent;
  padding: 7px 2px 8px;
  color: #8b958e;
  font-size: 10px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  flex-shrink: 0;
  transition: color 0.14s, border-color 0.14s;
}

.tab:hover {
  color: var(--ink);
}

.tab.active {
  color: var(--green);
  font-weight: 700;
  border-bottom-color: var(--green);
}

/* Research Grid, Panels & Forms */
.research-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 14px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  padding: 14px;
  margin-bottom: 10px;
  min-width: 0;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.panel-title h3 {
  margin: 0;
}

.panel-title small {
  font-size: 8.5px;
  color: var(--muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 9.5px;
  font-weight: 700;
  color: #4b5851;
}

.field label span {
  font-weight: 400;
  color: #a0a8a2;
}

.field input, .field select, .field textarea, .inline-form input, .inline-form select {
  width: 100%;
  max-width: 100%;
  border: 1px solid #e3e7e2;
  background: white;
  border-radius: 6px;
  padding: 7px 9px;
  color: #25312c;
  font-size: 11px;
  outline: 0;
  transition: border-color 0.14s, box-shadow 0.14s;
}

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

.field input:focus, .field select:focus, .field textarea:focus {
  border-color: #2b6ad0;
  box-shadow: 0 0 0 2px rgba(43, 106, 208, 0.15);
}

.field input::placeholder, .field textarea::placeholder {
  color: #aeb7b1;
}

.field-help {
  font-size: 8.5px;
  color: #919b94;
  margin-top: -1px;
  line-height: 1.35;
}

.depth-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 7px;
}

.depth-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.depth-box {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s, box-shadow 0.14s;
  display: block;
}

.depth-choice input:checked + .depth-box {
  border-color: var(--green);
  background: #ebf3fd;
  box-shadow: 0 0 0 2px rgba(31, 69, 145, 0.12);
}

.depth-box strong {
  display: block;
  font-size: 10px;
  margin-bottom: 2px;
}

.depth-box small {
  font-size: 8.5px;
  line-height: 1.35;
  color: var(--muted);
  display: block;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* Summary Grid, Validation Grid & Status Track */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.summary-cell {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  background: #ffffff;
  min-width: 0;
}

.summary-cell small {
  font-size: 8.5px;
  color: #87918a;
  display: block;
  margin-bottom: 4px;
}

.summary-cell strong {
  font-family: var(--font-heading);
  font-size: 15px;
  display: block;
}

.validation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.validation-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  min-width: 0;
}

.validation-card label {
  font-size: 9px;
  color: #87928a;
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

.validation-card input, .validation-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 6px;
  font-size: 10px;
  outline: none;
}

.validation-card textarea {
  min-height: 48px;
  resize: vertical;
}

.status-track-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  margin: 12px 0 16px;
}

.status-track {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 440px;
}

.status-step {
  flex: 1;
  position: relative;
  text-align: center;
  color: #a1aaa4;
  font-size: 8px;
  padding-top: 18px;
  white-space: nowrap;
}

.status-step::before {
  content: '';
  position: absolute;
  top: 0;
  left: calc(50% - 5px);
  width: 10px;
  height: 10px;
  background: #e7ebe6;
  border-radius: 50%;
  z-index: 1;
}

.status-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: #e6eae5;
}

.status-step.active {
  color: var(--green);
  font-weight: 700;
}

.status-step.active::before, .status-step.complete::before {
  background: #1f4591;
}

.status-step.complete::after, .status-step.active:not(:last-child)::after {
  background: #68a4f1;
}

/* Evidence Rows, Clusters & Cards */
.evidence-row {
  border-bottom: 1px solid #edf0eb;
  padding: 10px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.evidence-row:last-child {
  border: 0;
}

.evidence-title {
  font-size: 10.5px;
  font-weight: 700;
  color: #334039;
  margin-bottom: 3px;
  word-break: break-word;
}

.evidence-quote {
  font-size: 9.5px;
  line-height: 1.5;
  color: #748078;
  margin: 0 0 5px;
  word-break: break-word;
}

.evidence-source {
  font-size: 8.5px;
  color: #9aa39c;
  display: flex;
  gap: 6px 10px;
  flex-wrap: wrap;
}

.evidence-source a {
  color: var(--green);
  text-decoration: none;
}

.evidence-source a:hover {
  text-decoration: underline;
}

.cluster-card {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px;
  background: #ffffff;
  margin-bottom: 8px;
  min-width: 0;
}

.cluster-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.cluster-top > div:first-child {
  flex: 1 1 180px;
  min-width: 0;
}

.cluster-card h3 {
  margin-bottom: 4px;
  word-break: break-word;
}

.cluster-card p {
  font-size: 9.5px;
  margin: 0 0 8px;
  word-break: break-word;
}

.cluster-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  margin: 6px 0;
  border-radius: 8px;
  border: 1px solid #edf0ec;
}

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

.data-table th {
  text-align: left;
  padding: 8px 10px;
  color: #929b95;
  background: #fafbf8;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.data-table td {
  padding: 8px 10px;
  border-top: 1px solid #eef0ec;
  color: #536059;
  vertical-align: top;
}

.data-table a {
  color: var(--green);
  text-decoration: none;
}

.data-table a:hover {
  text-decoration: underline;
}

.upload-area {
  border: 1px dashed #cbdcf7;
  border-radius: 7px;
  padding: 10px;
  background: #fafcff;
}

.upload-area input[type=file] {
  font-size: 9.5px;
  border: 0;
  padding: 0;
  background: transparent;
}

.query-list {
  display: grid;
  gap: 6px;
}

.query-item {
  background: #f8f9f6;
  border: 1px solid #eef0eb;
  border-radius: 6px;
  padding: 8px;
  font-size: 9px;
  color: #5b6860;
  line-height: 1.45;
  word-break: break-word;
}

.query-item small {
  display: block;
  color: #9ca59f;
  margin-top: 3px;
}

.query-count {
  border-radius: 4px;
  background: #f2f5ef;
  padding: 4px 6px;
  font-size: 8.5px;
  color: #718076;
  white-space: nowrap;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 12px 0;
}

.form-note {
  padding: 8px 10px;
  border-radius: 6px;
  background: #f8f7ef;
  color: #877143;
  font-size: 8.5px;
  line-height: 1.45;
}

.empty-state {
  padding: 10px 14px;
  text-align: center;
  border: 1px dashed #cbdcf7;
  border-radius: 8px;
  background: #ffffff;
}

.empty-state .empty-icon {
  margin: 0 auto 3px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  background: #ebf3fd;
  border-radius: 6px;
  color: var(--green);
  font-size: 11px;
}

.empty-state h3 {
  font-size: 11px;
  margin-bottom: 2px;
  font-weight: 700;
}

.empty-state p {
  font-size: 9.5px;
  max-width: 380px;
  margin: 0 auto 6px;
  line-height: 1.35;
  color: #748079;
}

.empty-state .btn-primary {
  padding: 5px 12px;
  font-size: 9.5px;
  border-radius: 6px;
}

.progress-panel {
  margin: 12px 0;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
}

.progress-steps {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.progress-step {
  display: flex;
  gap: 8px;
  align-items: center;
  color: #89928c;
  font-size: 9.5px;
}

.progress-dot {
  width: 16px;
  height: 16px;
  border: 1px solid #dce3dd;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 8.5px;
  flex-shrink: 0;
}

.progress-step.done {
  color: var(--green);
}

.progress-step.done .progress-dot {
  background: #ebf2fd;
  border-color: #68a4f1;
  color: #1f4591;
}

.progress-step.active {
  color: #1f4591;
  font-weight: 700;
}

.progress-step.active .progress-dot {
  border: 2px solid #2b6ad0;
}

/* Toast & Modals */
.toast {
  position: fixed;
  z-index: 500;
  bottom: 20px;
  left: 50%;
  transform: translate(-50%, 15px);
  opacity: 0;
  pointer-events: none;
  background: #061e47;
  color: white;
  border-radius: 7px;
  padding: 8px 14px;
  font-size: 10.5px;
  box-shadow: 0 8px 24px rgba(6, 30, 71, 0.22);
  transition: transform 0.2s ease, opacity 0.2s ease;
  max-width: calc(100vw - 32px);
  text-align: center;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 25, 21, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  z-index: 200;
  padding: 14px;
  overflow-y: auto;
}

.modal {
  background: #ffffff;
  width: min(540px, 100%);
  max-height: calc(100vh - 28px);
  overflow-y: auto;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 16px 60px rgba(16, 33, 24, 0.22);
  margin: auto;
}

.modal.modal-wide {
  width: min(640px, 100%);
}

/* Phase 3: Onboarding & Business Setup Styles */
.onboarding-cockpit {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid #c7d9f7;
  background: linear-gradient(180deg, #ffffff, #f4f8fe);
  border-radius: 10px;
}

.onboarding-steps-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.onboarding-step-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 70px;
}

.onboarding-step-card:hover {
  transform: translateY(-1px);
  border-color: var(--green);
  box-shadow: 0 4px 12px rgba(31, 69, 145, 0.08);
}

.onboarding-step-card.completed {
  border-color: #bee3c6;
  background: #fcfefc;
}

.onboarding-step-card.completed .step-check {
  background: #258548;
  color: #ffffff;
}

.onboarding-step-card .step-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  background: #e2e8f0;
  color: #64748b;
  flex-shrink: 0;
}

.journey-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 10px 0 16px;
}

.journey-card {
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
}

.journey-card:hover {
  border-color: var(--green2);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(43, 106, 208, 0.1);
}

.journey-card.selected {
  border-color: var(--green);
  background: #f4f8fe;
  box-shadow: 0 0 0 1px var(--green);
}

.journey-card h4 {
  margin: 4px 0 4px;
  font-size: 13px;
  color: var(--ink);
}

.journey-card p {
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.45;
  margin: 0 0 8px;
}

.journey-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wizard-steps-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.wizard-step-node {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 500;
}

.wizard-step-node.active {
  color: var(--green);
  font-weight: 700;
}

.wizard-step-node .node-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  background: #e2e8f0;
  color: var(--muted);
}

.wizard-step-node.active .node-circle {
  background: var(--green);
  color: #ffffff;
}

.wizard-step-node.completed .node-circle {
  background: #258548;
  color: #ffffff;
}

@media (max-width: 900px) {
  .onboarding-steps-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 580px) {
  .journey-choice-grid {
    grid-template-columns: 1fr;
  }
  .onboarding-steps-grid {
    grid-template-columns: 1fr;
  }
}

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

.modal-head h2 {
  font-size: 16px;
  margin: 2px 0 0;
  word-break: break-word;
}

.modal-head p {
  font-size: 9.5px;
  margin: 0;
}

.modal-close {
  width: 26px;
  height: 26px;
  background: #f3f5f2;
  border: 0;
  border-radius: 6px;
  color: #66726a;
  display: grid;
  place-items: center;
  font-size: 15px;
  line-height: 1;
  flex-shrink: 0;
  cursor: pointer;
}

.modal-close:hover {
  background: #e6eae4;
  color: var(--ink);
}

.modal .panel {
  padding: 0;
  border: 0;
}

/* Auth Page */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr minmax(320px, 400px);
  background: #ffffff;
}

.auth-aside {
  padding: 36px 4vw;
  background: var(--navy);
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.auth-aside::after {
  content: '';
  position: absolute;
  left: 46%;
  top: 23%;
  width: 440px;
  height: 440px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  box-shadow: 0 0 0 40px rgba(255, 255, 255, 0.03), 0 0 0 85px rgba(255, 255, 255, 0.02);
  pointer-events: none;
}

.auth-tag {
  color: #68a4f1;
}

.auth-aside h1 {
  position: relative;
  z-index: 1;
  font-size: clamp(24px, 3.2vw, 36px);
  max-width: 460px;
  margin-top: clamp(30px, 10vh, 120px);
  margin-bottom: 10px;
  line-height: 1.15;
  color: #ffffff;
}

.auth-aside p {
  position: relative;
  z-index: 1;
  color: #b4ccf5;
  max-width: 380px;
  font-size: 12.5px;
  line-height: 1.55;
}

.auth-bottom {
  font-size: 9.5px;
  color: #8da0ba;
}

.auth-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
}

.auth-form {
  width: min(320px, 100%);
}

.auth-form h2 {
  font-size: 19px;
  margin: 0 0 5px;
}

.auth-form > p {
  font-size: 10.5px;
  margin-bottom: 18px;
}

.auth-form .field {
  margin-bottom: 11px;
}

.auth-switch {
  font-size: 9.5px;
  color: #8c9790;
  margin: 14px 0 0;
  text-align: center;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--green);
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}

.link-button:hover {
  text-decoration: underline;
}

.auth-form .btn {
  width: 100%;
  margin-top: 5px;
}

.auth-error {
  font-size: 10px;
  color: var(--red);
  min-height: 15px;
  margin: 3px 0 6px;
  line-height: 1.35;
}

/* ==========================================================================
   DigitalSellerOS Umbrella Components
   ========================================================================== */

.pipeline-tracker {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 4px;
  -webkit-overflow-scrolling: touch;
}

.pipeline-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  background: #ffffff;
  border: 1px solid #d8e5f8;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  flex-shrink: 0;
}

.pipeline-step:hover {
  transform: translateY(-1px);
  border-color: var(--green);
  box-shadow: 0 3px 8px rgba(31, 69, 145, 0.1);
}

.pipeline-step .step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--green);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.pipeline-step .step-meta strong {
  display: block;
  font-size: 11px;
  color: var(--ink);
  line-height: 1.2;
}

.pipeline-step .step-meta small {
  display: block;
  font-size: 9.5px;
  color: var(--muted);
  margin-top: 1px;
}

.pipeline-arrow {
  color: var(--lime);
  font-weight: 800;
  font-size: 13px;
  user-select: none;
  flex-shrink: 0;
}

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

.product-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.product-card:hover {
  transform: translateY(-1px);
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(6, 30, 71, 0.08);
}

.product-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.product-type-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--mint);
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.product-price {
  font-size: 13px;
  font-weight: 800;
  color: var(--green);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

/* Short Viewports (Laptop screen height <= 720px, e.g. 1024x539 in standard Chrome) */
@media (max-height: 720px) {
  .welcome-card {
    padding: 7px 12px;
    margin-bottom: 8px;
  }
  .welcome-card h2 {
    font-size: 13.5px;
    margin: 2px 0 3px;
  }
  .welcome-card p {
    font-size: 10px;
    margin: 0;
  }
  .pipeline-tracker {
    padding: 3px 2px;
    gap: 6px;
  }
  .pipeline-step {
    padding: 4px 8px;
  }
  .pipeline-step .step-meta strong {
    font-size: 10px;
  }
  .pipeline-step .step-meta small {
    font-size: 8.5px;
  }
  .stats-grid {
    gap: 5px;
    margin-bottom: 8px;
  }
  .stat-card {
    padding: 4px 7px;
  }
  .stat-number {
    font-size: 15px;
    margin: 2px 0 2px;
  }
  .stat-foot {
    font-size: 8px;
  }
  .section-head {
    margin: 6px 0 4px;
  }
  .section-head h2 {
    font-size: 12.5px;
    margin: 0;
  }
  .topbar {
    min-height: 40px;
    max-height: 40px;
    margin-bottom: 6px;
  }
}

/* Very Short Viewports (height <= 580px, e.g. laptop with bookmarks & extensions bar) */
@media (max-height: 580px) {
  .sidebar-note {
    display: none !important;
  }
  .rail-callout {
    display: none !important;
  }
  .topbar {
    min-height: 36px;
    max-height: 36px;
    margin-bottom: 4px;
  }
  .welcome-card {
    padding: 5px 10px;
    margin-bottom: 6px;
  }
  .welcome-card h2 {
    font-size: 12.5px;
    margin: 1px 0;
  }
  .welcome-card p {
    display: none;
  }
  .stat-card {
    padding: 4px 6px;
  }
  .stat-number {
    font-size: 14px;
    margin: 1px 0;
  }
}

/* Medium Screens (840px - 1080px): Compact 3-Column Layout */
@media (max-width: 1080px) and (min-width: 840px) {
  .app-layout {
    grid-template-columns: 168px minmax(0, 1fr) 195px;
  }
  .main {
    padding: 0 10px 16px;
  }
  .stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }
  .welcome-card {
    padding: 6px 10px;
  }
  .stat-card {
    padding: 5px 7px;
  }
}

/* Tablets (<= 920px) */
@media (max-width: 920px) {
  .auth-page {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
  }
  .auth-aside {
    padding: 24px 20px;
    min-height: auto;
  }
  .auth-aside h1 {
    font-size: clamp(20px, 4.5vw, 28px);
    margin: 14px 0 8px;
  }
  .auth-aside p {
    font-size: 12px;
    max-width: 100%;
  }
  .auth-bottom {
    display: none;
  }
  .auth-form-wrap {
    padding: 28px 16px 36px;
  }
  .research-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* Tablet Portrait (680px - 839px): 2 Columns */
@media (max-width: 839px) and (min-width: 680px) {
  .app-layout {
    grid-template-columns: 180px minmax(0, 1fr);
    overflow-y: auto;
    height: 100vh;
  }
  .sidebar {
    grid-column: 1;
    grid-row: 1 / span 2;
  }
  .main {
    grid-column: 2;
    grid-row: 1;
    height: auto;
    max-height: none;
    overflow-y: visible;
    padding: 0 16px 20px;
  }
  .right-rail {
    grid-column: 2;
    grid-row: 2;
    height: auto;
    max-height: none;
    overflow-y: visible;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 12px 16px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
  }
  .right-head {
    grid-column: 1 / -1;
    margin-bottom: 0;
  }
}

/* Mobile Handsets (<= 679px): 1 Column Drawer Layout */
@media (max-width: 679px) {
  html, body, #app {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }
  .app-layout {
    display: block;
    height: auto;
    max-height: none;
    overflow: visible;
    width: 100%;
    max-width: 100%;
  }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(16, 25, 21, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 80;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .sidebar-backdrop.show {
    opacity: 1;
    pointer-events: auto;
  }
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 250px;
    max-width: 82vw;
    height: 100vh;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.25);
  }
  button.mobile-close, .mobile-close {
    display: inline-flex !important;
  }
  button.mobile-menu, .mobile-menu {
    display: inline-flex !important;
  }
  .main {
    height: auto;
    max-height: none;
    overflow: visible;
    padding: 0 12px 24px;
    width: 100%;
  }
  .topbar {
    min-height: 42px;
    max-height: 42px;
    height: 42px;
    margin-bottom: 8px;
    position: sticky;
    top: 0;
    background: var(--paper);
    z-index: 25;
  }
  .right-rail {
    height: auto;
    max-height: none;
    overflow: visible;
    width: 100%;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 12px 12px 24px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .rail-section {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
  }
}

/* Mobile Phones (<= 640px) */
@media (max-width: 640px) {
  .welcome-card {
    padding: 10px 12px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .welcome-cta {
    width: 100%;
    text-align: center;
  }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }
  .stat-card {
    padding: 6px 8px;
  }
  .stat-number {
    font-size: 15px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .field.full {
    grid-column: auto;
  }
  .depth-options {
    grid-template-columns: 1fr;
  }
  .validation-grid {
    grid-template-columns: 1fr;
  }
  .project-card {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 8px;
    padding: 8px 10px;
  }
  .project-right {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f0f2ee;
    padding-top: 6px;
    margin-top: 2px;
    text-align: left;
  }
  .project-date {
    margin-bottom: 0;
  }
  .detail-heading .card-actions {
    width: 100%;
  }
  .detail-heading .card-actions .btn {
    flex: 1;
  }
  .evidence-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  /* Prevent mobile Chrome and Safari auto-zoom on input focus */
  .field input, .field select, .field textarea,
  .validation-card input, .validation-card textarea,
  .auth-form input {
    font-size: 16px;
  }
}

/* Small Handsets (<= 400px) */
@media (max-width: 400px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .main {
    padding: 0 10px 24px;
  }
  .summary-grid {
    grid-template-columns: 1fr;
  }
  .top-actions .btn {
    padding: 4px 7px;
    font-size: 8.5px;
  }
  .modal-backdrop {
    padding: 8px;
  }
  .modal {
    padding: 12px 10px;
  }
}

/* Phase 5 Product Studio & Offer Studio Styles */
.studio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.studio-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.studio-tab-btn {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.studio-tab-btn:hover {
  background: rgba(43, 106, 208, 0.08);
  color: var(--navy);
}
.studio-tab-btn.active {
  background: var(--navy);
  color: #ffffff;
}
.studio-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  min-height: 520px;
}
@media (max-width: 900px) {
  .studio-editor-grid {
    grid-template-columns: 1fr;
  }
}
.studio-pane {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.studio-pane-header {
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--dark-blue);
}
.studio-textarea {
  flex: 1;
  width: 100%;
  border: none;
  padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  resize: vertical;
  min-height: 480px;
  outline: none;
  color: #1e293b;
  background: #ffffff;
}
.studio-preview {
  flex: 1;
  padding: 16px 20px;
  overflow-y: auto;
  background: #ffffff;
  color: #1e293b;
  line-height: 1.6;
  font-size: 13px;
  min-height: 480px;
}
.studio-preview h1 { font-size: 20px; color: var(--dark-blue); margin: 0 0 12px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.studio-preview h2 { font-size: 16px; color: var(--navy); margin: 20px 0 8px; border-bottom: 1px solid #f1f5f9; padding-bottom: 4px; }
.studio-preview h3 { font-size: 14px; color: #334155; margin: 16px 0 6px; }
.studio-preview p { margin: 0 0 10px; }
.studio-preview ul, .studio-preview ol { margin: 0 0 12px; padding-left: 20px; }
.studio-preview li { margin-bottom: 4px; }
.studio-preview blockquote { border-left: 3px solid var(--royal-blue); margin: 12px 0; padding: 6px 12px; background: #f8fafc; color: #475569; font-style: italic; }
.studio-preview table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 11.5px; }
.studio-preview th, .studio-preview td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.studio-preview th { background: #f8fafc; font-weight: 700; }
.studio-preview hr { border: none; border-top: 1px solid var(--line); margin: 16px 0; }
.studio-preview pre { background: #f1f5f9; padding: 10px; border-radius: 6px; overflow-x: auto; font-size: 11.5px; }

.export-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.export-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.export-card:hover {
  transform: translateY(-2px);
  border-color: var(--royal-blue);
  box-shadow: var(--shadow-sm);
}

.quality-meter {
  background: #f1f5f9;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  margin: 4px 0 10px;
}
.quality-meter-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* Phase 6: Commerce, Storefront & Customer Portal Styles */
.reconciliation-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.recon-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.recon-card small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  font-weight: 600;
}
.recon-card strong {
  font-size: 18px;
  font-family: var(--font-heading);
}

.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-btn {
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.15s ease;
}
.filter-btn:hover {
  background: var(--bg-hover);
  color: var(--navy);
}
.filter-btn.active {
  background: var(--navy);
  color: #ffffff;
  border-color: var(--navy);
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.download-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.download-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  background: #ffffff;
  overflow: hidden;
}
.faq-question {
  padding: 14px 16px;
  font-weight: 600;
  font-size: 12.5px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}
.faq-answer {
  padding: 0 16px 14px 16px;
  font-size: 12px;
  color: #55615b;
  line-height: 1.6;
  border-top: 1px solid #f1f5f9;
}

.bonus-box {
  background: #fbfdff;
  border: 1px dashed #c0d5f3;
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
}

/* Print Styles */
@media print {
  .sidebar, .right-rail, .topbar, .tabs, .card-actions, .btn, .toast, .sidebar-backdrop, .mobile-menu {
    display: none !important;
  }
  .app-layout {
    display: block !important;
  }
  .main {
    padding: 0 !important;
    width: 100% !important;
  }
  .panel, .cluster-card, .stat-card {
    break-inside: avoid;
    box-shadow: none !important;
  }
  .page-heading {
    margin-top: 0;
  }
  body {
    background: #ffffff !important;
  }
  .status-pill, .label-chip, .tag {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

/* DigitalSellerOS Phase 9: SEO, Email, Funnels & Automation Styles */
.seo-preview-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  font-family: Arial, sans-serif;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.seo-preview-url {
  font-size: 12px;
  color: #202124;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.seo-preview-title {
  font-size: 18px;
  color: #1a0dab;
  text-decoration: underline;
  cursor: pointer;
  margin-bottom: 6px;
  line-height: 1.3;
}
.seo-preview-desc {
  font-size: 13px;
  color: #4d5156;
  line-height: 1.5;
}

.char-counter {
  font-size: 11px;
  color: var(--muted);
  float: right;
  margin-top: 2px;
}
.char-counter.valid { color: #10b981; }
.char-counter.warning { color: #f59e0b; }
.char-counter.error { color: #ef4444; }

.funnel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.funnel-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.step-flow-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
}

.automation-rule-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.automation-rule-flow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: .3s;
  border-radius: 22px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(18px); }

/* Public Funnel Landing Page */
.public-funnel-container {
  max-width: 640px;
  margin: 40px auto;
  padding: 24px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  font-family: 'DM Sans', -apple-system, sans-serif;
  color: #1e293b;
}
.public-funnel-hero {
  text-align: center;
  margin-bottom: 24px;
}
.public-funnel-hero h1 {
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
  margin: 12px 0 8px;
}
.public-funnel-hero p {
  font-size: 15px;
  color: #64748b;
  line-height: 1.5;
}
.public-funnel-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 24px;
}

/* DigitalSellerOS Phase 10: CRM, Support & Migration Styles */
.crm-profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 768px) {
  .crm-profile-grid { grid-template-columns: 1fr; }
}
.tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  color: #334155;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid #e2e8f0;
}
.tag-badge.tag-vip {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}
.tag-remove-btn {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0 2px;
  font-size: 13px;
  line-height: 1;
}
.tag-remove-btn:hover {
  color: #ef4444;
}
.note-timeline {
  display: grid;
  gap: 10px;
  max-height: 240px;
  overflow-y: auto;
  margin: 12px 0;
  padding-right: 4px;
}
.note-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #3b82f6;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
  position: relative;
}
.note-item .note-date {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 4px;
  display: block;
}
.note-item .note-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: #cbd5e1;
  cursor: pointer;
  font-size: 12px;
}
.note-item .note-delete-btn:hover {
  color: #ef4444;
}
.migration-box {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}
.csv-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 10px;
}
.csv-preview-table th, .csv-preview-table td {
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  text-align: left;
}
.csv-preview-table th {
  background: #f1f5f9;
  font-weight: 600;
  color: #475569;
}
.disclaimer-banner {
  background: #fffbeb;
  border: 1px solid #fef3c7;
  border-left: 4px solid #f59e0b;
  color: #92400e;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 16px;
}
