@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap");

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: "Poppins", sans-serif;
  color: var(--ink-900);
  background: linear-gradient(180deg, #fbf7f1 0%, #f6f0e7 100%);
}

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

.acopes-os-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 64px 1fr;
}

.os-header {
  height: 64px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  position: sticky;
  top: 0;
  z-index: 25;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 0 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
}

.icon-btn span {
  width: 100%;
  height: 2px;
  border-radius: 4px;
  background: var(--ink-700);
}

.os-logo {
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(140deg, var(--blue), #5a341c);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-text {
  font-weight: 700;
  letter-spacing: 0.04em;
}

kbd {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: 6px;
  font-size: 11px;
  padding: 1px 6px;
  color: var(--ink-500);
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-btn,
.connection-status,
.icon-circle,
.secondary-btn,
.secondary,
.copy-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-700);
  border-radius: 10px;
  height: 36px;
  padding: 0 12px;
  cursor: pointer;
}

#commandPaletteTrigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.header-btn-icon {
  display: none;
  flex-shrink: 0;
}

.ai-credit-indicator {
  min-width: 82px;
  height: 42px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: center;
  column-gap: 8px;
  padding: 4px 10px;
  border: 1px solid var(--ac-warm-border);
  border-radius: 10px;
  background: var(--ac-warm-bg);
  color: var(--ac-warm-text);
}

.ai-credit-indicator span { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.ai-credit-indicator strong { grid-row: 1 / 3; grid-column: 2; align-self: center; font-size: 20px; line-height: 1; }
.ai-credit-indicator small { font-size: 9px; color: var(--ink-500); }
.ai-credit-indicator.loading strong { opacity: .45; }
.connection-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.connection-status.connected {
  color: var(--green);
  border-color: #a6e2c0;
  background: var(--green-soft);
}

.connection-status.not-connected {
  color: #8a5b12;
  border-color: #f3d8ae;
  background: #fff9f1;
}

.connection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.icon-circle {
  width: 36px;
  padding: 0;
}

.profile-pill {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(140deg, #3D210E, #5a341c);
}

.os-main-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 64px);
}

.os-sidebar {
  border-right: 1px solid var(--line);
  background: var(--surface);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-item {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 10px;
  height: 40px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  color: var(--ink-700);
  cursor: pointer;
}

.sidebar-item:hover {
  background: var(--surface-soft);
  border-color: var(--line);
}

.sidebar-item.active {
  background: var(--ac-warm-bg);
  border-color: var(--ac-warm-border);
  color: var(--ac-warm-text);
}

.sidebar-icon {
  width: 18px;
  text-align: center;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) minmax(240px, 300px);
}

.research-rail,
.center-canvas,
.ai-brain {
  padding: 12px;
  overflow-y: auto;
}

.research-rail {
  border-right: none;
  background: linear-gradient(180deg, #fbf7f1 0%, #f6f0e7 100%);
  display: none;
}

body.research-mode .research-rail {
  display: block;
}

body.research-mode .workspace-grid {
  grid-template-columns: 200px minmax(0, 1fr) minmax(240px, 300px);
}

/* B2: the left rail is real only for the actual research flow; every other
   inner page removes it and lets the center column reclaim its width. */
body.no-activity-rail .research-rail {
  display: none;
}

body.no-activity-rail .workspace-grid {
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
}

body.home-mode .workspace-grid {
  grid-template-columns: minmax(0, 1fr) 330px;
}

body.home-mode #approvedFactoryOutputs,
body.home-mode #approvedBoardQuery,
body.home-mode #productOpportunityDashboard:empty {
  display: none;
}

body.research-mode .marketing-section,
body.research-mode .marketing-footer {
  display: none;
}

body.home-mode .center-canvas {
  border-left: 1px solid transparent;
}

body.home-mode .research-rail {
  display: none;
}

.center-canvas {
  background: linear-gradient(180deg, #fdfefe 0%, #fffdf9 100%);
}

.ai-brain {
  border-left: none;
  background: linear-gradient(180deg, var(--ac-surface) 0%, var(--ac-loading-highlight) 100%);
}

.rail-header,
.brain-head,
.workspace-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.workspace-top h1,
.rail-header h2,
.brain-head h2 {
  margin: 0;
  font-size: 17px;
}

.thinking-pill,
.pill {
  border: 1px solid var(--ac-warm-border);
  border-radius: 999px;
  background: var(--ac-warm-bg);
  color: var(--ac-warm-text);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
}

/* Previously unstyled (rendered as bare inline text, no pill shape at
   all) - default state uses the same neutral warm palette as .pill
   above; .safe (a real confirmation/reassurance state - "Draft-only",
   "Seller approval required") is the one place this gets the app's
   real status green (--ac-success/--ac-success-soft), never the brown
   action/accent color, so status and action never visually collide. */
.mini-status-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--ac-warm-border);
  border-radius: 999px;
  background: var(--ac-warm-bg);
  color: var(--ac-warm-text);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  line-height: 1.4;
}

.mini-status-pill.safe {
  border-color: rgba(36, 122, 75, 0.25);
  background: var(--ac-success-soft);
  color: var(--ac-success);
}

.workspace-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.workflow-strip {
  margin: 0 0 12px;
}

.workflow-strip-toggle {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-500);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.workflow-strip-toggle:hover {
  color: var(--ink-700);
}

.workflow-strip-body {
  display: none;
  margin-top: 8px;
}

.workflow-strip.expanded .workflow-strip-body {
  display: block;
}

.workflow-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

body[data-workspace="overview"] .workflow-strip {
  display: none;
}

.workflow-steps li button {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  padding: 8px;
  text-align: left;
  color: var(--ink-700);
  white-space: normal;
  overflow-wrap: anywhere;
}

.workflow-steps li.active button {
  background: var(--ac-warm-bg);
  border-color: var(--ac-warm-border);
  color: var(--ac-warm-text);
}

.workflow-steps li.completed button {
  background: var(--green-soft);
  border-color: #ade5c7;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.home-hero {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(170deg, #ffffff 0%, #fffdf9 100%);
  box-shadow: var(--shadow);
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 24px;
  margin-bottom: 14px;
}

.hero-eyebrow {
  margin: 0;
  font-size: 12px;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.home-hero h2 {
  margin: 10px 0 16px;
  font-size: clamp(28px, 4vw, 44px);
  max-width: 760px;
  line-height: 1.08;
}

.hero-copy {
  margin: 0 0 16px;
  max-width: 760px;
  color: var(--ink-700);
  font-size: 15px;
  line-height: 1.5;
}

.hero-prompt-form {
  width: min(820px, 100%);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.hero-cta-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.hero-cta-row .secondary-btn {
  height: 46px;
  border-radius: 12px;
}

.hero-workflow-strip {
  margin-top: 16px;
  width: min(880px, 100%);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 6px;
}

.workflow-step-pill {
  border: 1px solid #dcc7b3;
  border-radius: 999px;
  background: #fffdf9;
  color: #8a4f21;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 8px;
}

.workflow-step-pill.active {
  border-color: var(--ac-warm-border);
  background: var(--ac-warm-bg);
  color: var(--ac-warm-text);
  box-shadow: 0 0 0 1px rgba(122, 75, 22, 0.1);
}

.hero-live-panels {
  margin-top: 14px;
  width: min(880px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.live-signal-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-align: left;
  padding: 10px;
  min-height: 96px;
}

.live-signal-card h2 {
  margin: 6px 0;
  font-size: 16px;
}

.live-signal-card p {
  margin: 0;
  color: var(--ink-600);
  font-size: 12px;
}

.marketing-section {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 12px;
}

.section-headline {
  margin-bottom: 10px;
}

.section-headline h3 {
  margin: 0;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.15;
}

.feature-grid,
.tool-grid,
.story-grid,
.pricing-grid {
  display: grid;
  gap: 9px;
}

.feature-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.feature-grid article,
.story-grid article,
.tool-grid article {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fdfefe;
  padding: 10px;
}

.feature-grid article h4,
.story-grid article h4 {
  margin: 0 0 6px;
  font-size: 15px;
}

.feature-grid article p,
.story-grid article p {
  margin: 0;
  color: var(--ink-600);
  font-size: 12px;
  line-height: 1.5;
}

.tool-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.tool-grid article {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-700);
  background: linear-gradient(160deg, #ffffff 0%, #f7faff 100%);
}

.pipeline-stage-list {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-top: 6px;
}

.pipeline-stage {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fdfefe;
  box-shadow: var(--shadow);
  padding: 18px;
}

.pipeline-stage h4 {
  margin: 0 0 6px;
  font-size: 16px;
}

.pipeline-stage > p {
  margin: 0 0 14px;
  color: var(--ink-500);
  font-size: 13px;
  line-height: 1.5;
  max-width: 640px;
}

.pipeline-shot {
  margin: 0;
}

.pipeline-shot img {
  display: block;
  width: 100%;
  max-width: 640px;
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
}

.pipeline-shot figcaption {
  max-width: 640px;
  margin: 8px auto 0;
  font-size: 12px;
  color: var(--ink-500);
  line-height: 1.5;
}

.studio-section .studio-flow {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.studio-section .studio-flow span {
  border: 1px solid #cfdcf5;
  border-radius: 999px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #1d549e;
  background: #fffdf9;
  padding: 9px;
}

.pricing-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.pricing-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.pricing-card.recommended {
  border-color: #d7b77d;
  background: linear-gradient(170deg, #fffdf9 0%, #fffdf9 100%);
  box-shadow: 0 12px 24px rgba(27, 73, 151, 0.12);
}

.plan-badge {
  margin: 0;
  width: fit-content;
  border: 1px solid #adc5f5;
  border-radius: 999px;
  background: #e9f1ff;
  color: #215db6;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
}

.pricing-card h4 {
  margin: 0;
  font-size: 17px;
}

.price-tag {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  color: #1c4f9f;
}

.price-tag span {
  font-size: 12px;
  color: var(--ink-500);
  margin-left: 4px;
}

.pricing-card p {
  margin: 0;
  color: var(--ink-600);
  font-size: 12px;
  line-height: 1.5;
}

.about-copy {
  margin: 0;
  color: var(--ink-700);
  font-size: 14px;
  line-height: 1.6;
}

.marketing-footer {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.marketing-footer h4 {
  margin: 0 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-500);
}

.marketing-footer a {
  display: block;
  color: var(--ink-700);
  text-decoration: none;
  margin: 0 0 6px;
  font-size: 12px;
}

.marketing-footer a:hover {
  color: #1d5bc0;
}

.hero-prompt-form input {
  height: 54px;
  border-radius: 14px;
  border: 1px solid #cfd9ea;
  padding: 0 14px;
  font-size: 16px;
  background: #fff;
  outline: none;
}

.hero-prompt-form button,
.primary-btn,
button[data-product-action],
button[type="submit"] {
  height: 54px;
  border: none;
  border-radius: 14px;
  padding: 0 18px;
  color: #fff;
  background: linear-gradient(140deg, var(--blue), #5a341c);
  font-weight: 600;
  cursor: pointer;
}

.home-modules {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.module-block,
.live-canvas-shell,
.pipeline-shell,
.production-board,
.launch-checklist-shell,
.ai-note-card,
.card,
.notebook-card,
.v3-modal-card,
.live-activity-panel,
.brain-notes {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.module-block,
.live-canvas-shell,
.pipeline-shell,
.production-board,
.launch-checklist-shell,
.ai-note-card,
.card,
.brain-notes,
.live-activity-panel {
  padding: 12px;
}

.module-head {
  margin-bottom: 8px;
}

.module-head h3 {
  margin: 0;
  font-size: 15px;
}

.module-content,
.quick-action-row,
.template-grid,
.research-canvas-grid,
.live-canvas-grid,
.pipeline-row,
.pipeline-flow,
.module-progress-grid,
.launch-check-grid,
.store-grid,
.draft-list,
.tray-items,
.brain-notes,
.live-task-feed,
.tag-row,
.metric-pill-row,
.button-row,
.factory-output-grid,
.factory-asset-grid,
.factory-video-grid,
.provider-status-grid,
.provider-stage-list,
.opportunity-list,
.product-action-bar,
.v3-waiting-steps,
.verdict-grid,
.executive-card-grid,
.recommendation-grid,
.competitor-card-grid {
  display: grid;
  gap: 8px;
}

.activity-timeline {
  display: grid;
  gap: 7px;
}

.workspace-state-panel {
  margin-top: 8px;
}

.workspace-state-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(160deg, #ffffff 0%, #f6f9ff 100%);
  padding: 10px;
  display: grid;
  gap: 6px;
  position: relative;
  overflow: hidden;
}

.workspace-state-card strong {
  font-size: 12px;
  color: var(--ink-800);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.workspace-state-card p {
  margin: 0;
  color: var(--ink-600);
  font-size: 12px;
}

.workspace-state-card .state-illustration {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: radial-gradient(circle at 35% 35%, #a9c7ff 0%, #5f93f8 55%, #2f66cc 100%);
  box-shadow: 0 8px 18px rgba(47, 102, 204, 0.16);
}

.workspace-state-card.completed .state-illustration {
  background: radial-gradient(circle at 35% 35%, #b0eacb 0%, #3ca86e 55%, #1f8351 100%);
}

.timeline-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 8px;
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 8px;
  animation: fadeInUp 0.25s ease;
}

details.timeline-item {
  padding: 0;
  display: block;
}

.timeline-item summary {
  list-style: none;
  cursor: pointer;
  padding: 8px;
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 8px;
}

.timeline-item summary::-webkit-details-marker {
  display: none;
}

.timeline-item p {
  margin: 0;
  border-top: 1px dashed #d9e2ef;
  color: var(--ink-600);
  font-size: 11px;
  padding: 7px 8px 8px 34px;
}

.timeline-item strong {
  font-size: 12px;
  color: var(--ink-700);
}

.timeline-item small {
  font-size: 11px;
  color: var(--ink-500);
}

.timeline-item em {
  font-style: normal;
  font-size: 11px;
  color: var(--ink-500);
}

.timeline-item .timeline-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #625b53;
  background: #efe3d3;
}

.timeline-item.active {
  border-color: #dcc7b3;
  background: #fffdf9;
}

.timeline-item.active .timeline-icon {
  color: #8a4f21;
  background: #efe3d3;
  animation: pulse 1.4s infinite;
}

.timeline-item.done {
  border-color: #b7e5cc;
  background: #f0fbf5;
}

.timeline-item.done .timeline-icon {
  color: #12824b;
  background: #daf5e7;
}

.brain-stream {
  display: grid;
  gap: 8px;
}

.brain-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.brain-section-list {
  display: grid;
  gap: 8px;
}

.brain-section-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 8px;
  display: grid;
  gap: 4px;
  animation: fadeInUp 0.24s ease;
}

.brain-section-item small {
  font-size: 11px;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.brain-section-item strong {
  font-size: 12px;
  color: var(--ink-700);
}

.brain-live-log {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 8px;
  display: grid;
  gap: 6px;
  max-height: 230px;
  overflow-y: auto;
}

.brain-notes-drawer {
  margin-top: 8px;
}

.brain-notes-drawer summary {
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-500);
  padding: 4px 0;
  list-style: none;
}

.brain-notes-drawer summary::-webkit-details-marker {
  display: none;
}

.brain-notes-drawer summary::before {
  content: "▸ ";
}

.brain-notes-drawer[open] summary::before {
  content: "▾ ";
}

.brain-notes-drawer .brain-live-log {
  margin-top: 6px;
}

.brain-log-item {
  border: 1px solid #e3e9f2;
  border-radius: 8px;
  padding: 7px;
  background: #fbfdff;
  display: grid;
  gap: 4px;
  animation: fadeInUp 0.2s ease;
}

.brain-log-item small {
  color: var(--ink-500);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.brain-log-item strong {
  font-size: 12px;
  color: var(--ink-700);
}

.live-section {
  transition: border-color 0.24s ease, background 0.24s ease, transform 0.24s ease;
}

.live-section.live-ready {
  border-color: #dcc7b3;
  background: #fffdf9;
  transform: translateY(-1px);
}

.live-canvas-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  align-items: start;
}

.live-canvas-flow {
  display: grid;
  gap: 10px;
}

.live-flow-section {
  border: 1px solid rgba(198, 214, 239, 0.5);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #fbf7f1 100%);
  padding: 10px;
  box-shadow: 0 10px 24px rgba(24, 51, 92, 0.08);
  display: grid;
  gap: 8px;
}

#livePinnedStrip {
  position: sticky;
  top: 74px;
  z-index: 3;
}

.section-headline.compact {
  margin: 0;
}

.section-headline.compact h3 {
  margin: 0;
  font-size: 14px;
}

.market-scan-provenance {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e6f4ea;
  color: #1e7a34;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  vertical-align: middle;
}

.market-scan-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 6px 0;
}

.market-scan-metrics span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.market-scan-metrics small {
  color: #66748f;
  font-size: 11px;
}

.market-scan-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.market-scan-tag {
  padding: 2px 8px;
  border-radius: 999px;
  background: #f0f3fa;
  font-size: 11px;
}

.market-scan-error {
  color: #b3261e;
}

.coloring-book-output .factory-pipeline-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.coloring-book-output .factory-pipeline-steps article {
  flex: 1 1 160px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f0f3fa;
  font-size: 12px;
}

.coloring-book-output .factory-pipeline-steps article span {
  text-transform: uppercase;
  font-size: 10px;
  color: #66748f;
}

.coloring-book-output .factory-pipeline-steps article.completed { background: #e8f6ec; }
.coloring-book-output .factory-pipeline-steps article.retry_required { background: #fbe9e7; }
.coloring-book-output .factory-pipeline-steps article.locked,
.coloring-book-output .factory-pipeline-steps article.skipped { background: #f0f0f0; color: #66748f; }

.coloring-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.coloring-page-thumb {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  color: inherit;
}

.coloring-page-thumb img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #e2e6ef;
}

.coloring-page-thumb span,
.coloring-page-thumb small {
  font-size: 10px;
  color: #66748f;
}

.coloring-page-thumb.failed {
  padding: 8px;
  border-radius: 6px;
  background: #fbe9e7;
}

.coloring-page-thumb.failed small {
  color: #b3261e;
}

.factory-trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.factory-trust-row span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f3f7ff;
  color: #355a97;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
}

.factory-generate-form {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

/* B3: quota-cost caption under the research and product-factory inputs -
   so a seller can tell, before submitting, which box spends what. */
.input-quota-note {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ac-text-secondary, #6b6156);
  text-transform: none;
}

.factory-generate-form input {
  flex: 1 1 auto;
  min-width: 0;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
}

.factory-generate-form select {
  flex: 0 0 auto;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 8px;
  background: #fff;
}

/* Physical Product Studio's form has far more fields (photos, material,
   color, installation, shipping, Etsy setup) than the other product
   types' single "type a niche" row, so it deliberately does NOT reuse
   .factory-generate-form's flex-row layout (which was squeezing every
   field into one cramped horizontal strip). Each field gets its own
   full-width row instead. */
.physical-product-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 720px;
}

.physical-product-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ac-text-secondary, #6b6156);
}

.physical-product-form input,
.physical-product-form textarea {
  font: inherit;
  font-weight: 400;
  color: var(--ac-text, #1f1a15);
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  width: 100%;
  box-sizing: border-box;
}

.physical-product-form textarea {
  height: auto;
  min-height: 64px;
  padding: 8px 12px;
  resize: vertical;
}

.physical-product-form input[type="file"] {
  height: auto;
  padding: 8px 0;
  border: none;
}

.physical-photo-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.seo-expert-input-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 20px;
  margin: 12px 0 16px;
  align-items: start;
}

.seo-expert-input-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  display: grid;
  gap: 10px;
}

.seo-expert-input-panel h4 {
  margin: 0;
}

.seo-expert-input-panel textarea,
.seo-expert-input-panel input[type="text"],
.seo-expert-input-panel select {
  width: 100%;
  box-sizing: border-box;
}

.seo-expert-input-panel textarea {
  font: inherit;
  resize: vertical;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

/* Title/tags start short but grow with content (see autoGrowTextarea in
   app.js) - a max-height keeps a runaway paste from pushing the rest of
   the card off-screen; past that, the field's own scrollbar takes over
   while the resize handle above still lets a seller drag it taller. */
.seo-expert-title-field,
.seo-expert-tags-field,
.seo-expert-idea-field {
  max-height: 200px;
  overflow-y: auto;
}

.seo-expert-description-field {
  max-height: 480px;
  overflow-y: auto;
}

.seo-expert-rewrite-compare {
  display: grid;
  gap: 16px;
}

.seo-expert-idea-draft {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.bulk-seo-select-row {
  display: block;
  padding: 6px 0;
}

.store-summary-delta {
  display: block;
  margin-top: 4px;
  font-weight: 700;
}

.store-summary-reassurance {
  margin-top: 12px;
  max-width: 60ch;
}

.physical-review-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.physical-review-gallery img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  object-fit: cover;
}

.physical-photo-chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ac-surface-alt, #f6f0e7);
  border: 1px solid var(--line);
  font-size: 12px;
}

.physical-product-shipping-setup {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.physical-product-shipping-setup legend {
  font-size: 13px;
  font-weight: 700;
  padding: 0 6px;
}

.physical-shipping-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.physical-taxonomy-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}

.taxonomy-result-btn {
  text-align: left;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
}

.taxonomy-result-btn:hover {
  background: var(--ac-surface-alt, #f6f0e7);
}

.product-search-form {
  flex-wrap: wrap;
}

.product-search-form input,
.product-search-form select {
  flex: 1 1 auto;
  min-width: 0;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
}

.product-search-notes {
  display: block;
  width: 100%;
  height: 38px;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
  margin-bottom: 8px;
}

.product-search-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.command-response {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.command-response:empty {
  display: none;
}

.competitor-table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
}

.competitor-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.gallery-section .live-masonry {
  grid-column: span 1;
}

.live-research-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin: 0 0 10px;
}

.live-research-form input {
  height: 46px;
  border: 1px solid #dcc7b3;
  border-radius: 11px;
  padding: 0 12px;
  background: #fff;
}

.live-research-form button {
  height: 46px;
  border: none;
  border-radius: 11px;
  padding: 0 14px;
  background: linear-gradient(140deg, var(--blue), #5a341c);
  color: #fff;
  font-weight: 600;
}

.live-masonry {
  grid-column: span 1;
}

.live-insights-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.market-snapshot-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.live-insights-strip span {
  border: 1px solid #dcc7b3;
  border-radius: 10px;
  background: #fffdf9;
  padding: 7px;
  display: grid;
  gap: 2px;
}

.live-insights-strip strong {
  font-size: 11px;
  color: #234f96;
}

.live-insights-strip small {
  font-size: 10px;
  color: #58759d;
}

.live-visual-masonry {
  column-count: 5;
  column-gap: 16px;
  animation: fadeInUp 0.28s ease;
}

.live-ref-card {
  border: 1px solid #d6e0ef;
  border-radius: 11px;
  background: #fff;
  overflow: hidden;
  display: inline-grid;
  width: 100%;
  margin: 0 0 16px;
  gap: 6px;
  break-inside: avoid;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, opacity 0.22s ease;
  position: relative;
}

.live-ref-card:hover {
  transform: translateY(-4px) scale(1.012);
  border-color: #b7ccf8;
  box-shadow: 0 18px 36px rgba(34, 84, 168, 0.2);
}

.live-ref-card.selected {
  border-color: #6fa2f8;
  box-shadow: 0 0 0 2px rgba(63, 129, 245, 0.2), 0 16px 28px rgba(34, 84, 168, 0.18);
  transform: translateY(-2px);
}

.live-ref-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(14, 34, 68, 0.02);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.live-ref-card:hover::after {
  opacity: 1;
}

.live-ref-card.pinned {
  border-color: #89aef5;
}

.live-ref-card.compared {
  outline: 2px solid #dcc7b3;
  outline-offset: -2px;
}

.live-ref-card.favorited {
  box-shadow: 0 0 0 2px rgba(39, 104, 216, 0.12);
}

.live-ref-media {
  height: var(--media-height, 240px);
  overflow: hidden;
  background: linear-gradient(145deg, #ecf2ff 0%, #dce9ff 100%);
}

.live-ref-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1);
  transition: transform 0.3s ease;
}

.live-ref-card:hover .live-ref-media img {
  transform: scale(1.06);
}

.live-ref-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #25539b;
  font-weight: 700;
  font-size: 20px;
}

.live-ref-meta {
  display: grid;
  gap: 4px;
  padding: 0 8px;
}

.live-badge {
  margin: 0;
  width: fit-content;
  border: 1px solid #d0dbef;
  border-radius: 999px;
  background: #f7faff;
  color: #345a8d;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 600;
}

.live-ref-meta strong {
  font-size: 16px;
  color: var(--ink-700);
  line-height: 1.25;
}

.live-ref-meta small {
  font-size: 11px;
  color: var(--ink-500);
}

.direction-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
  gap: 6px;
}

.kpi-chip {
  border: 1px solid #d6e3f6;
  border-radius: 10px;
  background: #f7fbff;
  padding: 6px;
  display: grid;
  gap: 2px;
  min-width: 0;
}

.kpi-chip small {
  font-size: 9px;
  color: #5a759c;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  overflow-wrap: anywhere;
}

.kpi-chip strong {
  font-size: 13px;
  color: #1f549f;
  overflow-wrap: anywhere;
}

.trend-badge {
  border: 1px solid #c7daf8;
  border-radius: 999px;
  background: #fffdf9;
  color: #2457a1;
  width: fit-content;
  padding: 2px 7px;
}

.live-ref-hover-insights {
  padding: 0 8px;
  display: grid;
  gap: 4px;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease, max-height 0.2s ease;
}

.live-ref-hover-insights small {
  border: 1px solid #dcc7b3;
  border-radius: 8px;
  background: #fffdf9;
  color: #8a4f21;
  font-size: 10px;
  padding: 5px 6px;
}

.live-ref-card:hover .live-ref-hover-insights,
.live-ref-card:focus-within .live-ref-hover-insights {
  opacity: 1;
  max-height: 180px;
  transform: translateY(0);
}

.live-ref-actions {
  padding: 0 8px 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  backdrop-filter: blur(5px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(242, 248, 255, 0.92) 70%);
}

.live-ref-card:hover .live-ref-actions,
.live-ref-card:focus-within .live-ref-actions {
  opacity: 1;
  transform: translateY(0);
}

.live-ref-actions button {
  border: 1px solid #d3dff1;
  border-radius: 8px;
  background: #f7faff;
  color: #2b5fad;
  font-size: 11px;
  font-weight: 600;
  height: 33px;
}

.opportunity-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

.opportunity-card {
  border: 1px solid #d7e2f3;
  border-radius: 10px;
  background: #fff;
  padding: 8px;
  display: grid;
  gap: 5px;
}

.opportunity-card img {
  width: 100%;
  height: 104px;
  object-fit: cover;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--ac-loading-base) 0%, var(--ac-loading-highlight) 50%, var(--ac-loading-base) 100%);
  background-size: 200% 100%;
}

.opportunity-card strong {
  font-size: 14px;
  color: var(--ink-700);
}

.opportunity-card small {
  font-size: 11px;
  color: var(--ink-600);
}

.opportunity-card button {
  border: 1px solid #cad8f2;
  border-radius: 8px;
  height: 30px;
  background: #fffdf9;
  color: #2258ab;
  font-size: 11px;
  font-weight: 600;
}

.opportunity-card button + button {
  margin-top: 2px;
}

.confidence-row {
  display: grid;
  gap: 4px;
}

.confidence-row strong {
  font-size: 26px;
  color: #1f5ec7;
  line-height: 1;
}

.confidence-row small {
  color: var(--ink-600);
  font-size: 11px;
}

.confidence-bar {
  height: 10px;
}

.confidence-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.confidence-steps span {
  border: 1px solid #d4def0;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 11px;
  background: #fff;
  color: #3f5879;
  animation: fadeInUp 0.2s ease;
}

.confidence-reasons {
  display: grid;
  gap: 6px;
}

.confidence-reasons span {
  border: 1px solid #dcc7b3;
  border-radius: 9px;
  background: #fffdf9;
  padding: 6px;
  font-size: 11px;
  color: #8a4f21;
}

.story-state {
  gap: 8px;
}

.story-counter-grid {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.story-counter-grid span {
  border: 1px solid #dcc7b3;
  border-radius: 9px;
  background: #fffdf9;
  color: #8a4f21;
  font-size: 11px;
  padding: 6px;
}

.roadmap-track {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
}

.roadmap-track span {
  border: 1px solid #d6e1f3;
  border-radius: 999px;
  padding: 6px 8px;
  text-align: center;
  font-size: 11px;
  background: #f7fbff;
  color: #5d779a;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.roadmap-track span.active {
  background: #e9f2ff;
  border-color: #a8c7f8;
  color: #1f5ec7;
  transform: translateY(-1px);
}

.roadmap-track span.done {
  background: #eef9f2;
  border-color: #b9e6cc;
  color: #1b7a49;
}

.roadmap-track span.queued {
  opacity: 0.8;
}

.story-counter-grid b {
  color: #1f5ec7;
}

.confidence-reasons strong {
  color: #1f5ec7;
  margin-right: 4px;
}

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

.intel-chip {
  border: 1px solid #d0ddf4;
  border-radius: 12px;
  background: linear-gradient(180deg, #f6faff 0%, #edf4ff 100%);
  color: #2a5ca8;
  font-size: 11px;
  font-weight: 600;
  padding: 8px;
  display: grid;
  gap: 3px;
  text-align: left;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.intel-chip small {
  color: #58749c;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.intel-chip strong {
  color: #1f549f;
  font-size: 12px;
}

.intel-chip:hover {
  transform: translateY(-2px);
  border-color: #adc8f9;
  box-shadow: 0 10px 20px rgba(31, 94, 199, 0.14);
}

.intel-chip.active {
  border-color: #9fc0f9;
  background: #e8f1ff;
  color: #164eab;
}

.keyword-bubble-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.keyword-bubble {
  border: 1px solid #d2ddf2;
  border-radius: 999px;
  background: #f7fbff;
  color: #2e5f9f;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 10px;
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
}

.keyword-bubble em {
  font-style: normal;
  font-weight: 500;
  color: #5f7698;
  font-size: 10px;
}

.keyword-bubble.high {
  background: #e9f3ff;
  border-color: #bdd4fb;
}

.keyword-bubble.mid {
  background: #eef8ff;
}

.keyword-bubble.low {
  background: #fffdf9;
}

.dna-visual-grid,
.concept-card-grid {
  display: grid;
  gap: 7px;
}

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

.dna-visual-grid span {
  border: 1px solid #c9d8f5;
  border-radius: 9px;
  background: #fffdf9;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: #275aa8;
  padding: 8px;
}

.concept-card-grid article {
  border: 1px solid #d8e2f3;
  border-radius: 10px;
  background: #fff;
  padding: 8px;
  display: grid;
  gap: 4px;
}

.concept-card-grid button {
  height: 30px;
  border: 1px solid #cad8f2;
  border-radius: 8px;
  background: #fffdf9;
  color: #2258ab;
  font-size: 11px;
  font-weight: 600;
}

.seo-card-grid,
.asset-progress-grid,
.compare-grid {
  display: grid;
  gap: 8px;
}

.seo-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.seo-card-grid article,
.asset-progress-grid article {
  border: 1px solid #d7e1f2;
  border-radius: 10px;
  padding: 8px;
  background: #fff;
  display: grid;
  gap: 6px;
}

.seo-card-grid small,
.asset-progress-grid small {
  color: var(--ink-500);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.seo-card-grid strong {
  font-size: 12px;
  color: var(--ink-700);
}

.seo-card-grid p {
  margin: 0;
  color: var(--ink-600);
  font-size: 11px;
}

.asset-progress-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

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

.compare-card {
  border: 1px solid #d3dff1;
  border-radius: 10px;
  background: #fff;
  padding: 8px;
  display: grid;
  gap: 5px;
}

.compare-card.winner {
  border-color: #9fc1fa;
  box-shadow: 0 8px 18px rgba(33, 90, 176, 0.16);
}

.compare-card img {
  width: 100%;
  height: 84px;
  object-fit: cover;
  border-radius: 8px;
}

.compare-card small {
  color: var(--ink-600);
  font-size: 10px;
}

.compare-winner {
  margin: 0;
  color: var(--ink-700);
  font-size: 12px;
}

.compare-floating-tray {
  position: fixed;
  left: 96px;
  right: 344px;
  bottom: 14px;
  z-index: 45;
  border: 1px solid #ccd9ef;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 40px rgba(14, 36, 69, 0.22);
  backdrop-filter: blur(6px);
  transform: translateY(120%);
  transition: transform 0.25s ease;
}

.compare-floating-tray.open {
  transform: translateY(0);
}

.compare-floating-tray h3 {
  margin: 0 0 8px;
}

.compare-tray-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pinned-strip-inner {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 1fr);
  gap: 8px;
  overflow-x: auto;
}

.pinned-chip {
  border: 1px solid #cfdcf1;
  border-radius: 10px;
  background: #fdfefe;
  padding: 6px;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 8px;
  align-items: center;
}

.pinned-chip img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
}

.pinned-chip strong {
  font-size: 11px;
  color: var(--ink-700);
}

.pinned-chip small {
  font-size: 10px;
  color: var(--ink-500);
}

.pinned-actions {
  grid-column: span 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.pinned-actions button {
  border: 1px solid #d4dff1;
  border-radius: 7px;
  background: #f6faff;
  color: #2d5ea6;
  font-size: 10px;
  height: 26px;
}

.empty-live-note {
  border: 1px dashed #cfdae9;
  border-radius: 10px;
  background: #fbf7f1;
  color: var(--ink-600);
  font-size: 12px;
  padding: 10px;
}

.live-reference-drawer {
  position: fixed;
  top: 72px;
  right: 344px;
  width: min(520px, 92vw);
  bottom: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 34px rgba(18, 36, 68, 0.2);
  transform: translateX(110%);
  transition: transform 0.24s ease;
  z-index: 40;
  display: grid;
  grid-template-rows: auto 1fr;
}

.live-reference-drawer.open {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 10px;
}

.drawer-head h3 {
  margin: 0;
  font-size: 14px;
}

.drawer-close-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #dcc7b3;
  border-radius: 8px;
  background: #fffdf9;
  color: #8a4f21;
  font-weight: 700;
}

.drawer-body {
  padding: 10px;
  overflow: auto;
  display: grid;
  gap: 8px;
}

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

.drawer-actions button {
  border: 1px solid #dcc7b3;
  border-radius: 8px;
  background: #f7faff;
  color: #25539b;
  height: 32px;
  font-size: 11px;
  font-weight: 600;
}

.analyst-report {
  gap: 10px;
}

.analyst-image {
  width: 100%;
  height: 164px;
  object-fit: cover;
  border-radius: 10px;
}

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

.drawer-image {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: 10px;
}

.drawer-inline-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.drawer-inline-gallery article {
  border: 1px solid #d7e1f2;
  border-radius: 9px;
  padding: 6px;
  background: #fbfdff;
  display: grid;
  gap: 5px;
}

.drawer-inline-gallery img {
  width: 100%;
  height: 82px;
  object-fit: cover;
  border-radius: 7px;
}

.drawer-inline-gallery span {
  width: 100%;
  height: 82px;
  border-radius: 7px;
  background: linear-gradient(90deg, var(--ac-loading-base) 0%, var(--ac-loading-highlight) 50%, var(--ac-loading-base) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

.drawer-inline-gallery strong {
  font-size: 11px;
  color: var(--ink-700);
}

.drawer-body p {
  margin: 0;
  font-size: 12px;
  color: var(--ink-600);
  line-height: 1.45;
}

.timeline-compact {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 8px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.timeline-status-icon {
  margin-right: 6px;
}

.timeline-row-data {
  display: grid;
  gap: 2px;
}

.research-rail.timeline-collapsed #liveResearchState {
  display: none;
}

.research-rail .activity-timeline {
  max-width: 200px;
}

.timeline-compact strong {
  font-size: 12px;
  color: var(--ink-700);
}

.timeline-compact small {
  color: var(--ink-500);
  font-size: 11px;
}

.timeline-detailed.collapsed {
  display: none;
}

.timeline-detailed.expanded {
  display: grid;
  gap: 7px;
}

.concept-card-grid small {
  color: var(--ink-500);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.concept-card-grid strong {
  font-size: 12px;
}

.concept-card-grid p {
  margin: 0;
  color: var(--ink-600);
  font-size: 11px;
  line-height: 1.45;
}

.launch-progress-card {
  display: grid;
  gap: 6px;
}

.launch-progress-card small {
  color: var(--ink-500);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.launch-progress-card strong {
  font-size: 15px;
  color: #1f5fc8;
}

.launch-progress-card.done {
  border-color: #b7e5cc;
  background: #f0fbf5;
}

.launch-progress-card.working {
  border-color: #c9dafd;
  background: #f3f8ff;
}

.launch-progress-card.queued {
  border-color: #d9e2ef;
}

.mini-grid {
  display: grid;
  gap: 6px;
}

.mini-grid span {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  padding: 7px;
  font-size: 11px;
  color: var(--ink-700);
}

.palette-chip-row {
  display: flex;
  gap: 6px;
}

.palette-chip-row i {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 1px solid #d7dfe9;
}

.quick-action-row {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.quick-action-row button {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink-700);
  height: 42px;
  border-radius: 11px;
}

.visual-market-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.market-opportunity-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  display: grid;
  gap: 0;
}

.market-opportunity-card.pinned {
  border-color: #98baf6;
  box-shadow: 0 8px 20px rgba(37, 90, 178, 0.12);
}

.market-opportunity-card.compared {
  outline: 2px solid #c9dcff;
  outline-offset: -2px;
}

.market-card-image {
  background: #f6f0e7;
  min-height: 180px;
  position: relative;
  display: grid;
  place-items: center;
}

.market-card-image img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.market-card-image small {
  position: absolute;
  top: 8px;
  left: 8px;
  border: 1px solid #d8e2f0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  padding: 2px 7px;
  font-size: 10px;
}

.market-card-body {
  padding: 10px;
  display: grid;
  gap: 8px;
}

.reference-action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.reference-action-row button {
  border: 1px solid #dcc7b3;
  border-radius: 8px;
  height: 34px;
  background: #fffdf9;
  color: #8a4f21;
  font-size: 11px;
  font-weight: 600;
}

.reference-lightbox-card {
  padding: 14px;
}

.reference-lightbox-body {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.reference-lightbox-body img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid #d5deeb;
  background: #f6f0e7;
}

.reference-lightbox-meta {
  display: grid;
  gap: 8px;
}

.reference-lightbox-meta h3 {
  margin: 0;
}

.template-grid,
.research-canvas-grid,
.live-canvas-grid,
.module-progress-grid,
.launch-check-grid,
.store-grid,
.draft-list,
.pipeline-row,
.pipeline-flow,
.factory-output-grid,
.factory-asset-grid,
.factory-video-grid,
.provider-status-grid,
.provider-stage-list,
.opportunity-list,
.product-action-bar,
.verdict-grid,
.executive-card-grid,
.recommendation-grid,
.competitor-card-grid {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.template-grid article,
.launch-check-grid article,
.module-progress-grid article,
.store-grid .acp-card,
.pipeline-row span,
.pipeline-flow span {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  padding: 10px;
  font-size: 12px;
}

.module-progress-grid article[data-nav] {
  cursor: pointer;
  border-color: var(--ac-border-strong, var(--line));
  box-shadow: 0 2px 6px rgba(17, 31, 54, .04);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, transform .15s ease;
}

.module-progress-grid article[data-nav] h4 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.module-progress-grid article[data-nav] .module-card-arrow {
  color: var(--ac-primary, #3D210E);
  font-weight: 700;
  transition: transform .15s ease;
}

.module-progress-grid article[data-nav]:hover,
.module-progress-grid article[data-nav]:focus-visible {
  border-color: var(--ac-warm-border, #d7b77d);
  background: var(--ac-warm-bg, #f2e1c2);
  box-shadow: 0 6px 16px rgba(61, 33, 14, .14);
  transform: translateY(-1px);
  outline: 0;
}

.module-progress-grid article[data-nav]:hover .module-card-arrow,
.module-progress-grid article[data-nav]:focus-visible .module-card-arrow {
  transform: translateX(2px);
}

.module-progress-grid article.disabled {
  opacity: .6;
  cursor: not-allowed;
}

.module-progress-grid article .coming-soon-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--ac-border, #ded4c8);
  background: var(--ac-bg-subtle, #fbf7f1);
  color: var(--ac-text-secondary, #625b53);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.store-grid .acp-card {
  display: grid;
  gap: 4px;
}

.acp-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-500);
  text-transform: uppercase;
}

.ai-note-card {
  color: var(--ink-700);
  font-size: 13px;
}

.live-task-feed article {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.live-task-feed article span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(61, 33, 14, 0.08);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.live-task-feed article p {
  margin: 0;
  font-size: 12px;
  color: var(--ink-700);
}

.skeleton-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  padding: 10px;
}

.skeleton-card h3 {
  margin: 0 0 8px;
  color: var(--ac-loading-title);
  font-size: 12px;
}

.skeleton-card span,
.skeleton-lines span {
  display: block;
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ac-loading-base) 0%, var(--ac-loading-highlight) 50%, var(--ac-loading-base) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

.skeleton-card span + span,
.skeleton-lines span + span {
  margin-top: 6px;
}

.skeleton-lines span:nth-child(2) {
  width: 84%;
}

.skeleton-lines span:nth-child(3) {
  width: 72%;
}

.tray-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tray-header p {
  margin: 0;
}

.meta,
.label,
.description {
  color: var(--ink-500);
  font-size: 12px;
}

.progress-bar {
  margin: 10px 0;
  width: 100%;
  height: 8px;
  background: #eaf0fa;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), #5a341c);
}

.tag {
  border: 1px solid #dcc7b3;
  background: var(--blue-soft);
  color: #8a4f21;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
}

.tagflow-panel {
  display: grid;
  gap: 8px;
}

.tag-research-panel {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.tag-research-btn {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
}

.tag-research-hint {
  font-size: 11px;
  color: var(--ink-500);
}

.tag-research-success {
  color: var(--green);
}

.tagflow-summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.tagflow-stat {
  display: grid;
  gap: 2px;
  font-size: 12px;
  min-width: 0;
}

.tagflow-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-500);
}

.tagflow-tag-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.tagflow-tag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.tagflow-volume-unknown {
  font-size: 11px;
  font-style: italic;
  color: var(--ink-500);
}

.tagflow-warnings {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  flex-basis: 100%;
  display: grid;
  gap: 2px;
  font-size: 11px;
  color: #ac2f49;
}

.copy-block {
  border: 1px dashed #c8d6eb;
  background: #fbf7f1;
  border-radius: 10px;
  padding: 8px;
  white-space: pre-wrap;
  font-size: 12px;
}

.compact-list {
  margin: 0;
  padding-left: 16px;
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--ink-700);
}

/* Backgrounds were very pale tints (#eaf6ee/#fff8ed/#fff1f4 at full
   opacity but low saturation) - real colors, just washed out next to
   several in a row. Stronger rgba tints (same hues) + bigger/bolder/
   mono text reads as a real status label at a glance, matching the
   equivalent draft-detail-status pills' treatment above. */
.decision-badge,
.pill.good,
.pill.safe {
  border: 1px solid rgba(36, 122, 75, 0.35);
  background: rgba(36, 122, 75, 0.16);
  color: #156d43;
  border-radius: 999px;
  padding: 6px 10px;
  font-family: var(--ac-font-mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.pill.warn,
.score-mid,
.decision-test {
  border-color: rgba(161, 92, 0, 0.35);
  background: rgba(161, 92, 0, 0.16);
  color: #9d6214;
}

.pill.bad,
.score-low,
.decision-skip {
  border-color: rgba(180, 35, 24, 0.35);
  background: rgba(180, 35, 24, 0.14);
  color: #ac2f49;
}

.score-good,
.decision-produce {
  border-color: rgba(36, 122, 75, 0.35);
  background: rgba(36, 122, 75, 0.16);
  color: #156d43;
}

.bar {
  height: 7px;
  border-radius: 999px;
  background: #e6edf9;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), #5a341c);
}

.message,
.message-toast {
  position: fixed;
  right: 16px;
  bottom: 14px;
  z-index: 60;
  max-width: 360px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 10px;
  font-size: 12px;
}

.message.error {
  border-color: #efb7c5;
  background: #fff1f4;
  color: #a12842;
}

.message.success {
  border-color: #afe5c6;
  background: #effff5;
  color: #176c41;
}

.v3-modal {
  position: fixed;
  inset: 0;
  background: rgba(9, 15, 26, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
  z-index: 120;
}

.v3-modal.open {
  display: flex;
}
.onboarding-modal {
  background: radial-gradient(circle at 50% 10%, rgba(67, 125, 255, 0.2), transparent 36%), rgba(9, 15, 26, 0.62);
}

.v3-modal .onboarding-card {
  width: min(680px, 100%);
  padding: clamp(24px, 4vw, 40px);
  border-color: #dcc7b3;
  background: linear-gradient(150deg, #ffffff 0%, #fffdf9 100%);
}

.onboarding-eyebrow { margin: 0 0 8px; color: var(--blue); font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.onboarding-card > h2 { max-width: 570px; margin: 0; font-size: clamp(26px, 4vw, 38px); line-height: 1.08; }
.onboarding-intro { max-width: 590px; margin: 14px 0 24px; color: var(--ink-500); line-height: 1.55; }
.onboarding-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 0; padding: 0; list-style: none; }
.onboarding-steps li { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, 0.8); }
.onboarding-steps li.current { border-color: #d8c4ad; box-shadow: 0 8px 22px rgba(61, 33, 14, 0.1); }
.onboarding-step-number { width: 28px; height: 28px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-size: 12px; font-weight: 700; }
.onboarding-steps strong, .onboarding-steps small { display: block; }
.onboarding-steps strong { margin-bottom: 5px; font-size: 13px; }
.onboarding-steps small { color: var(--ink-500); font-size: 11px; line-height: 1.4; }
.onboarding-safety { display: flex; gap: 8px; margin-top: 16px; padding: 11px 13px; border-radius: 11px; background: var(--green-soft); color: #156d43; font-size: 12px; }
.onboarding-actions { margin-top: 18px; }

@media (max-width: 720px) {
  .onboarding-steps { grid-template-columns: 1fr 1fr; }
  .onboarding-step-number { margin-bottom: 10px; }
  .onboarding-safety { display: grid; }
}

@media (max-width: 440px) {
  .v3-modal .onboarding-card { padding: 22px 18px; }
  .onboarding-steps { grid-template-columns: 1fr; }
  .onboarding-steps li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; }
  .onboarding-step-number { margin: 0; }
  .onboarding-actions { display: grid; }
}

.v3-modal-card {
  width: min(640px, 100%);
  max-height: 84vh;
  overflow-y: auto;
  padding: 16px;
}

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

.plan-limit-upgrade-line {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid var(--ac-border, var(--line));
  border-radius: var(--ac-radius-card-sm, 10px);
  background: var(--ac-warm-bg, var(--primary-soft));
  color: var(--ac-warm-text, var(--primary));
}

.plan-limit-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.modal-close {
  float: right;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  cursor: pointer;
}

.form {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.form label {
  font-size: 12px;
  color: var(--ink-700);
  display: grid;
  gap: 6px;
}

.form input,
.form textarea,
.form select {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
}

.legal-links a {
  color: #265dbf;
}

.compatibility-shell {
  display: none;
}

body.nav-collapsed .os-main-grid {
  grid-template-columns: 78px 1fr;
}

body.nav-collapsed .sidebar-label,
body.nav-collapsed .logo-text {
  display: none;
}

body.nav-collapsed .sidebar-item {
  justify-content: center;
  padding: 0;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(61, 33, 14, 0.4); }
  70% { box-shadow: 0 0 0 7px rgba(61, 33, 14, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 33, 14, 0); }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Sprint 12 - Premium Visual System (visual only) */
body {
  font-family: "Poppins", sans-serif;
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--ink-700);
  background:
    radial-gradient(1100px 450px at 15% -12%, rgba(61, 33, 14, 0.08), transparent 65%),
    radial-gradient(900px 420px at 92% 2%, rgba(16, 185, 129, 0.04), transparent 60%),
    linear-gradient(180deg, #fbf7f1 0%, #f6f0e7 100%);
}

.os-header,
.os-sidebar,
.workspace-grid,
.research-rail,
.center-canvas,
.ai-brain {
  border-color: var(--line);
}

.os-header {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(16px) saturate(1.15);
}

.workspace-top h1,
.home-hero h2 {
  font-size: var(--fs-hero);
  letter-spacing: -0.02em;
  line-height: 1.08;
  color: var(--ink-900);
}

.section-headline h3,
.live-canvas-head h2,
.brain-head h2,
.rail-header h2,
.mission-start-head h2,
.section-head h2 {
  font-size: var(--fs-section);
  letter-spacing: -0.01em;
  color: var(--ink-900);
}

p,
small,
label,
.meta,
.description,
li,
.brain-log-item strong,
.brain-section-item strong {
  font-size: var(--fs-body);
}

.hero-copy,
.about-copy,
.live-signal-card p,
.feature-grid article p,
.story-grid article p,
.drawer-body p {
  color: var(--ink-600);
}

.module-block,
.live-canvas-shell,
.pipeline-shell,
.production-board,
.launch-checklist-shell,
.ai-note-card,
.card,
.notebook-card,
.v3-modal-card,
.live-activity-panel,
.brain-notes,
.marketing-section,
.marketing-footer,
.home-hero,
.live-flow-section,
.workspace-state-card,
.timeline-compact,
.timeline-item,
.live-ref-card,
.opportunity-card,
.compare-floating-tray,
.live-reference-drawer,
.pinned-chip,
.compare-card,
.live-signal-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}

.home-hero,
.marketing-section,
.marketing-footer,
.live-canvas-shell,
.live-flow-section,
.brain-notes,
.live-activity-panel,
.workspace-state-card,
.timeline-compact,
.timeline-item,
.live-signal-card,
.compare-floating-tray,
.live-reference-drawer,
.v3-modal-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(251, 253, 255, 0.95) 100%);
}

.module-block,
.live-canvas-shell,
.pipeline-shell,
.production-board,
.launch-checklist-shell,
.ai-note-card,
.card,
.brain-notes,
.live-activity-panel {
  padding: var(--space-4);
}

.live-canvas-flow,
.story-counter-grid,
.brain-stream,
.brain-section-list,
.brain-live-log,
.activity-timeline,
.module-content,
.template-grid,
.research-canvas-grid,
.live-canvas-grid,
.pipeline-row,
.pipeline-flow,
.module-progress-grid,
.launch-check-grid,
.store-grid,
.draft-list,
.tray-items,
.tag-row,
.metric-pill-row,
.button-row,
.factory-output-grid,
.factory-asset-grid,
.factory-video-grid,
.provider-status-grid,
.provider-stage-list,
.opportunity-list,
.product-action-bar,
.verdict-grid,
.executive-card-grid,
.recommendation-grid,
.competitor-card-grid {
  gap: var(--space-3);
}

.hero-prompt-form,
.live-research-form {
  gap: var(--space-2);
}

.floating-input {
  position: relative;
  display: grid;
  align-items: end;
  min-height: 58px;
}

.floating-input > input {
  width: 100%;
  height: 58px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px 16px 10px;
  background: rgba(255, 255, 255, 0.95);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 4px 12px rgba(15, 23, 42, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.floating-input > span {
  position: absolute;
  left: 16px;
  top: 19px;
  font-size: 13px;
  color: var(--ink-500);
  pointer-events: none;
  transition: transform 0.2s ease, color 0.2s ease, font-size 0.2s ease;
}

.floating-input:focus-within > input,
.floating-input > input:not(:placeholder-shown) {
  border-color: rgba(61, 33, 14, 0.45);
  box-shadow: 0 0 0 4px rgba(61, 33, 14, 0.1), 0 10px 26px rgba(15, 23, 42, 0.09);
}

.floating-input:focus-within > span,
.floating-input > input:not(:placeholder-shown) + span {
  transform: translateY(-9px);
  font-size: 11px;
  color: #8a4f21;
}

button,
.header-btn,
.connection-status,
.icon-circle,
.secondary-btn,
.secondary,
.copy-btn,
.primary-btn,
button[data-product-action],
button[type="submit"] {
  border-radius: 14px;
  border: 1px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.secondary-btn,
.secondary,
.copy-btn,
.header-btn,
.icon-circle,
.connection-status {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.94);
}

.hero-prompt-form button,
.live-research-form button,
.primary-btn,
button[data-product-action],
button[type="submit"] {
  background: linear-gradient(140deg, #3D210E 0%, #5a341c 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(61, 33, 14, 0.25);
}

button:hover,
.secondary-btn:hover,
.secondary:hover,
.copy-btn:hover,
.header-btn:hover,
.connection-status:hover,
.icon-circle:hover,
.hero-prompt-form button:hover,
.live-research-form button:hover,
.primary-btn:hover,
button[data-product-action]:hover,
button[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

button.is-pressed,
button:active {
  transform: translateY(1px) scale(0.995);
}

button:disabled,
button[aria-busy="true"],
button.is-loading {
  opacity: 0.72;
  cursor: wait;
}

button.is-loading::after,
button[aria-busy="true"]::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 8px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}

.live-visual-masonry {
  column-gap: 20px;
}

.live-ref-card {
  border-radius: 20px;
  overflow: clip;
  margin: 0 0 20px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.09);
}

.live-ref-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(61, 33, 14, 0.36), rgba(16, 185, 129, 0.2));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.live-ref-card:hover,
.live-ref-card:focus-within {
  transform: translateY(-3px) scale(1.005);
  box-shadow: var(--shadow-hover);
}

.live-ref-card:hover::before,
.live-ref-card:focus-within::before,
.live-ref-card.selected::before {
  opacity: 1;
}

.live-ref-card.selected {
  box-shadow: 0 0 0 3px rgba(61, 33, 14, 0.14), 0 26px 44px rgba(15, 23, 42, 0.18);
}

.live-ref-media {
  height: var(--media-height, 260px);
}

.live-ref-meta {
  padding: 0 14px 10px;
  gap: 10px;
}

.live-ref-meta strong {
  font-size: var(--fs-section);
  line-height: 1.2;
  color: var(--ink-900);
}

.direction-kpi-row {
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
  gap: 8px;
}

.kpi-chip {
  border-radius: 12px;
  border: 1px solid rgba(61, 33, 14, 0.18);
  background: linear-gradient(180deg, #fffdf9 0%, #fffdf9 100%);
  padding: 9px 10px;
}

.kpi-chip small {
  font-size: 10px;
  color: #5a6f93;
}

.kpi-chip strong {
  font-size: 14px;
  color: #214f9c;
}

.live-ref-actions {
  padding: 0 14px 14px;
  opacity: 1;
  transform: none;
  background: transparent;
}

.live-ref-actions button {
  height: 36px;
  border-radius: 11px;
}

.activity-timeline .eyebrow,
.brain-stream .eyebrow {
  color: var(--ink-500);
}

.timeline-compact {
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff 0%, #fbf7f1 100%);
}

.timeline-compact strong {
  color: var(--ink-900);
}

.timeline-item {
  border-radius: 14px;
  padding: 10px;
}

.timeline-item.active {
  border-color: var(--ac-warm-border);
  background: var(--ac-warm-bg);
}

.timeline-item.done {
  border-color: rgba(31, 143, 87, 0.24);
  background: linear-gradient(180deg, #f4fbf7 0%, #edf8f2 100%);
}

.timeline-item .timeline-icon {
  width: 20px;
  height: 20px;
}

.analyst-canvas {
  gap: 14px;
}

.analyst-hero {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(160deg, #ffffff 0%, #f7faff 100%);
  padding: 10px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.analyst-image {
  border-radius: 14px;
  height: 192px;
}

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

.analyst-kpis .brain-section-item {
  border-radius: 12px;
  padding: 10px;
  background: linear-gradient(180deg, #fff 0%, #fffdf9 100%);
}

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

.analyst-chart-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  background: linear-gradient(180deg, #fff 0%, #fbf7f1 100%);
  display: grid;
  gap: 8px;
}

.analyst-chart-card small {
  font-size: 11px;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.analyst-mini-bars {
  height: 64px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  align-items: end;
}

.analyst-mini-bars span {
  height: var(--h, 40%);
  border-radius: 8px;
  background: linear-gradient(180deg, #8a4f21 0%, #3D210E 100%);
  animation: fadeInUp 0.35s ease;
}

.analyst-timeline-mini {
  display: grid;
  gap: 6px;
}

.analyst-timeline-mini span {
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 4px 9px;
  font-size: 11px;
  width: fit-content;
  background: #fff;
  color: var(--ink-600);
}

.analyst-timeline-mini span.done {
  border-color: rgba(31, 143, 87, 0.28);
  background: #eef9f3;
  color: #1f8f57;
}

.analyst-timeline-mini span.active {
  border-color: var(--ac-warm-border);
  background: var(--ac-warm-bg);
  color: var(--ac-warm-text);
}

.brain-live-log {
  border-radius: 14px;
  padding: 10px;
  background: linear-gradient(180deg, #fff 0%, #fffdf9 100%);
  max-height: 340px;
}

.brain-log-item {
  border-radius: 12px;
  padding: 9px;
  background: #fff;
}

.live-reference-drawer {
  border-radius: 20px;
  box-shadow: 0 30px 56px rgba(15, 23, 42, 0.2);
  backdrop-filter: blur(6px);
}

.compare-floating-tray {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
}

.skeleton-card {
  border-radius: 16px;
  background: linear-gradient(180deg, var(--ac-surface) 0%, var(--ac-loading-highlight) 100%);
}

.skeleton-card span,
.skeleton-lines span,
.drawer-inline-gallery span,
.opportunity-card img {
  background: linear-gradient(110deg, var(--ac-loading-base) 18%, var(--ac-loading-highlight) 50%, var(--ac-loading-base) 82%);
  background-size: 220% 100%;
  animation: shimmer 1.5s linear infinite;
}

.pill,
.thinking-pill,
.tag,
.decision-badge,
.pill.good,
.pill.safe {
  border-radius: 999px;
}

.pill,
.thinking-pill {
  border-color: var(--ac-warm-border);
  background: var(--ac-warm-bg);
  color: var(--ac-warm-text);
}

.connection-status.connected,
.score-good,
.decision-produce {
  border-color: rgba(36, 122, 75, 0.35);
  background: rgba(36, 122, 75, 0.16);
  color: #1b7f4e;
}

.roadmap-track span {
  border-radius: 999px;
  padding: 7px 9px;
}

.roadmap-track span.active {
  box-shadow: 0 0 0 3px rgba(61, 33, 14, 0.14);
}

.roadmap-track span.done {
  box-shadow: inset 0 0 0 1px rgba(31, 143, 87, 0.2);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Sprint 14 - Workspace isolation architecture */
.workspace-page-shell {
  display: grid;
  gap: 16px;
}

.workspace-page-head {
  display: grid;
  gap: 6px;
}

.workspace-page-head h2 {
  margin: 0;
}

.page-status-summary {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ac-text, var(--ink-900));
}

#homeStatusSummary {
  margin: 0 0 14px;
}

.workspace-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.workspace-section-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #fff 0%, #fffdf9 100%);
  box-shadow: var(--shadow);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.workspace-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.workspace-section-head h3 {
  margin: 0;
  font-size: 16px;
  color: var(--ink-900);
}

.workspace-section-body {
  display: grid;
  gap: 8px;
}

.mission-start-head {
  margin-bottom: 8px;
}

.mission-start-head h2 {
  margin: 0;
}

.mission-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.mission-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #fff 0%, #fffdf9 100%);
  box-shadow: var(--shadow);
  padding: 14px;
  display: grid;
  gap: 6px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: box-shadow 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.mission-card:hover,
.mission-card:focus-visible {
  border-color: var(--blue);
  box-shadow: var(--shadow-hover, var(--shadow));
  transform: translateY(-1px);
}

.mission-card-icon {
  font-size: 18px;
  color: var(--blue);
}

.mission-card-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-900);
}

.mission-card-desc {
  font-size: 12px;
  color: var(--ink-500);
  line-height: 1.4;
}

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

.workspace-chip-grid span,
.workspace-mini-timeline span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f3f7ff;
  color: #355a97;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 8px;
  text-align: center;
}

.workspace-mini-timeline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.workspace-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(20, 83, 45, 0.14);
  border-radius: 999px;
  background: #eef8f0;
  color: #14532d;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 6px 8px;
  white-space: nowrap;
}

.workspace-status-chip.active {
  border-color: var(--ac-warm-border);
  background: var(--ac-warm-bg);
  color: var(--ac-warm-text);
}

.workspace-progress {
  overflow: hidden;
  height: 7px;
  min-width: 92px;
  border-radius: 999px;
  background: var(--ac-loading-base);
}

.workspace-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3D210E 0%, #16a34a 100%);
}

.workspace-production-list {
  display: grid;
  gap: 8px;
}

.workspace-production-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  padding: 10px;
}

.workspace-production-row > div:first-child {
  display: grid;
  gap: 5px;
  min-width: 0;
  flex: 1 1 140px;
}

.workspace-production-row > div:not(:first-child) {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.workspace-production-row strong {
  color: var(--ink-900);
  font-size: 13px;
  line-height: 1.25;
}

.workspace-production-row small {
  color: var(--ink-600);
  font-size: 11px;
  line-height: 1.35;
}

.workspace-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.workspace-metric-tile {
  display: grid;
  gap: 5px;
  min-height: 86px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.workspace-metric-tile small {
  color: var(--ink-500);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.workspace-metric-tile strong {
  color: var(--ink-900);
  font-size: 18px;
  line-height: 1.1;
}

.workspace-metric-tile span {
  color: var(--ink-600);
  font-size: 12px;
  line-height: 1.35;
}

.workspace-approval-gate {
  border-left: 3px solid #16a34a;
  background: #f4fbf6;
  border-radius: 8px;
  padding: 12px;
}

.workspace-approval-gate strong {
  color: #14532d;
  font-size: 14px;
}

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

.workspace-lane {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #fff 0%, #fbf7f1 100%);
  box-shadow: var(--shadow);
  padding: 10px;
  display: grid;
  gap: 8px;
  min-height: 180px;
}

.workspace-lane h3 {
  margin: 0;
  font-size: 14px;
}

.workspace-lane-body {
  display: grid;
  gap: 8px;
  align-content: start;
}

.production-lane-card {
  border: 1px solid rgba(61, 33, 14, 0.16);
  border-radius: 14px;
  background: #fffdf9;
  padding: 8px;
  display: grid;
  gap: 4px;
}

.production-lane-card strong {
  font-size: 13px;
  color: var(--ink-900);
}

.production-lane-card small {
  color: var(--ink-600);
  font-size: 11px;
}

.workspace-empty-state {
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fffdf9 0%, #fffdf9 100%);
  color: var(--ink-500);
  font-size: 12px;
  padding: 10px;
}

.workspace-empty-state-cta {
  display: grid;
  gap: 8px;
  justify-items: start;
  padding: 14px;
}

.section-head.compact {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.section-head.compact > div {
  min-width: 0;
}

.workspace-placeholder-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

body[data-workspace="live-research"] #liveResearchState,
body[data-workspace="inspiration-board"] #liveResearchState,
body[data-workspace="design-dna"] #liveResearchState,
body[data-workspace="creative-brief"] #liveResearchState,
body[data-workspace="concept-studio"] #liveResearchState {
  display: grid;
}

body[data-workspace="overview"] #liveResearchState,
body[data-workspace="product-factory"] #liveResearchState,
body[data-workspace="mockup-studio"] #liveResearchState,
body[data-workspace="video-studio"] #liveResearchState,
body[data-workspace="launch-center"] #liveResearchState,
body[data-workspace="draft-queue"] #liveResearchState,
body[data-workspace="store-intelligence"] #liveResearchState,
body[data-workspace="automation"] #liveResearchState,
body[data-workspace="settings"] #liveResearchState,
body[data-workspace="seo-studio"] #liveResearchState {
  display: none;
}

/* ============================================================
   Sprint 15 — shadcn/ui visual pass (Path B: CSS-only, no React,
   no Tailwind, no build step, no app.js changes).
   Scope: workspace home (#view-overview) and Research view
   (#view-live-research + its #liveReferenceDrawer "AI Analyst"
   rail). Every rule is anchored to those containers so the other
   13 in-app views are unaffected. This slice: workspace home.
   Tokens/shapes extracted from shadcn's default "new-york" theme
   and acopes-shadcn-prototype/{app/globals.css, tailwind.config.ts,
   components/ui/*.tsx}: large soft-shadow card radius, pill
   buttons/badges, muted-foreground secondary text, tight heading
   tracking. Colors stay on ACOPES's existing ink/warm palette
   rather than the prototype's orange/pink brand — this slice
   restyles shape/depth/rhythm, not brand color.
   See docs/shadcn-feasibility.md.
   ============================================================ */
/* ---- Typography rhythm ---- */
#view-overview .hero-eyebrow {
  font-size: var(--ac-font-eyebrow);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ac-text-muted);
}

#view-overview .home-hero h2 {
  font-weight: 650;
  letter-spacing: -0.02em;
}

#view-overview .hero-copy,
#view-overview .live-signal-card p {
  color: var(--ac-text-muted);
}

/* ---- Home hero card ---- */
#view-overview .home-hero {
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-hero);
  background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
  box-shadow: var(--ac-shadow-card);
  padding: var(--ac-space-10) var(--ac-space-7);
}

#view-overview .live-signal-card {
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-panel);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--ac-shadow-card);
  padding: var(--ac-space-4);
}

#view-overview .workflow-step-pill {
  border-radius: var(--ac-radius-pill);
  border: 1px solid var(--ac-border);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink-700);
  font-weight: 600;
}

#view-overview .workflow-step-pill.active {
  border-color: var(--ac-warm-border);
  background: var(--ac-warm-bg);
  color: var(--ac-warm-text);
}

/* ---- Home dashboard cards (market opportunity board) ---- */
#view-overview .market-opportunity-card {
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-panel);
  background: #fff;
  box-shadow: var(--ac-shadow-card);
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

#view-overview .market-opportunity-card:hover {
  box-shadow: var(--ac-shadow-card-hover);
  transform: translateY(-2px);
}

#view-overview .market-card-body {
  padding: var(--ac-space-4);
}

#view-overview .market-card-image small {
  border-radius: var(--ac-radius-pill);
  border: 1px solid var(--ac-border);
  background: rgba(255, 255, 255, 0.92);
  font-weight: 600;
}

#view-overview .reference-action-row button {
  border-radius: var(--ac-radius-pill);
  border: 1px solid var(--ac-border);
  background: #fff;
  color: var(--ink-700);
  font-weight: 600;
  box-shadow: none;
}

#view-overview .reference-action-row button[aria-pressed="true"] {
  border-color: var(--ac-warm-border);
  background: var(--ac-warm-bg);
  color: var(--ac-warm-text);
}

/* ---- Inputs: factory search ---- */
#view-overview .floating-input > input {
  border-radius: var(--ac-radius-control);
  border: 1px solid var(--ac-border);
  background: #fff;
}

#view-overview .floating-input:focus-within > input {
  border-color: rgba(61, 33, 14, 0.5);
  box-shadow: 0 0 0 3px rgba(61, 33, 14, 0.15);
}

/* ---- Buttons: primary / secondary / ghost hierarchy ---- */
#view-overview button {
  border-radius: var(--ac-radius-pill);
  font-weight: 600;
}

/* primary: Run Live Scan / Continue Creating */
#view-overview .hero-prompt-form button {
  border: 1px solid transparent;
  box-shadow: var(--ac-shadow-glow);
}

#view-overview button:hover {
  transform: translateY(-1px);
}

/* ============================================================
   Sprint 15 continued — shadcn/ui visual pass, Research view slice.
   Scope: #view-live-research + #liveReferenceDrawer ("AI Analyst"
   rail) only. Reuses the unified ACOPES design tokens defined below.
   ============================================================ */

/* ---- Typography rhythm ---- */
#view-live-research .live-canvas-head p,
#view-live-research .live-ref-meta small,
#liveReferenceDrawer .drawer-body p {
  color: var(--ac-text-muted);
}

#view-live-research .section-headline.compact h3,
#view-live-research .live-canvas-head h2,
#liveReferenceDrawer .drawer-head h3 {
  font-weight: 650;
  letter-spacing: -0.01em;
}

/* ---- Research canvas shell ---- */
#view-live-research .live-canvas-shell {
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-hero);
  box-shadow: var(--ac-shadow-card);
  padding: var(--ac-space-7);
}

#view-live-research .live-flow-section {
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-panel);
  box-shadow: var(--ac-shadow-card);
  padding: var(--ac-space-4);
}

#view-live-research .section-headline.compact {
  margin-bottom: var(--ac-space-3);
}

/* ---- Live Market Scan panel (real data; honest "--" fields kept) ---- */
#view-live-research .market-scan-provenance {
  border-radius: var(--ac-radius-pill);
  border: 1px solid rgba(31, 143, 87, 0.28);
  background: var(--green-soft);
  color: var(--green);
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 10px;
}

#view-live-research .market-scan-metrics strong {
  font-size: 15px;
  font-weight: 650;
  color: var(--ink-900);
}

#view-live-research .market-scan-tag {
  border-radius: var(--ac-radius-pill);
  border: 1px solid var(--ac-border);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink-700);
  font-weight: 600;
  padding: 3px 10px;
}

#view-live-research .market-scan-error {
  display: inline-block;
  border-radius: var(--ac-radius-panel);
  border: 1px solid rgba(179, 38, 30, 0.24);
  background: #fdf2f1;
  color: #b3261e;
  padding: var(--ac-space-3) var(--ac-space-4);
}

/* ---- Product Direction cards ---- */
#view-live-research .live-ref-card {
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-panel);
  box-shadow: var(--ac-shadow-card);
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

#view-live-research .live-ref-card:hover,
#view-live-research .live-ref-card:focus-within {
  box-shadow: var(--ac-shadow-card-hover);
}

#view-live-research .live-badge {
  border-radius: var(--ac-radius-pill);
  border: 1px solid var(--ac-border);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink-700);
  font-weight: 600;
}

#view-live-research .kpi-chip {
  border-radius: 14px;
  border: 1px solid var(--ac-border);
  background: rgba(247, 250, 255, 0.8);
}

#view-live-research .kpi-chip small {
  color: var(--ac-text-muted);
}

#view-live-research .opportunity-card {
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-panel);
  box-shadow: var(--ac-shadow-card);
}

#view-live-research .opportunity-card small {
  color: var(--ac-text-muted);
}

/* ---- AI Analyst rail (live reference drawer) ---- */
#liveReferenceDrawer {
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-hero);
}

#liveReferenceDrawer .drawer-close-btn {
  border-radius: var(--ac-radius-pill);
}

/* ---- Inputs: research query search ---- */
#view-live-research .floating-input > input {
  border-radius: var(--ac-radius-control);
  border: 1px solid var(--ac-border);
  background: #fff;
}

#view-live-research .floating-input:focus-within > input {
  border-color: rgba(61, 33, 14, 0.5);
  box-shadow: 0 0 0 3px rgba(61, 33, 14, 0.15);
}

/* ---- Buttons: primary / secondary / ghost hierarchy ---- */
#view-live-research button,
#liveReferenceDrawer button {
  border-radius: var(--ac-radius-pill);
  font-weight: 600;
}

/* primary: Start Research / Generate Product */
#view-live-research .live-research-form button,
#view-live-research .live-ref-actions button[data-live-ref-action="generate-coloring-book"] {
  border: 1px solid transparent;
  box-shadow: var(--ac-shadow-glow);
}

/* secondary: Analyze / View Blueprint / drawer actions */
#view-live-research .live-ref-actions button:not([data-live-ref-action="generate-coloring-book"]),
#liveReferenceDrawer .drawer-actions button {
  background: #fff;
  color: var(--ink-700);
  border: 1px solid var(--ac-border);
  box-shadow: none;
}

#view-live-research .live-ref-actions button:not([data-live-ref-action="generate-coloring-book"]):hover,
#liveReferenceDrawer .drawer-actions button:hover {
  background: var(--surface-soft);
}

#view-live-research button:hover,
#liveReferenceDrawer button:hover {
  transform: translateY(-1px);
}

/* ============================================================
   Sprint 16 — Optimsy-inspired bold visual revision (rev2).
   Design language referenced from optimsy.com (dark premium theme,
   elevated glass cards, gradient accent) and the optimsy-inspired-saas/
   prototype in this repo — copy, layout, and brand colors are ours,
   never theirs.

   The landing-page dark theme this comment used to describe (Part A)
   moved out to public/landing.css as part of the 2026 Hallmark redesign;
   public/landing.html no longer links this stylesheet at all, so the
   `.landing-page`-scoped rules that lived here were deleted as dead code.

   Part B — OS home + Research (#view-overview, #view-live-research):
   push Sprint 15's card system further. Missing ingredient was page/card
   contrast: cards were near-white on a near-white page. Fix: soft gray
   page background behind the same white elevated cards, stronger
   shadows, filled chip badges, more breathing room.
   ============================================================ */

/* ---- Part B: OS home + Research — page/card contrast bump ---- */
/* NOTE: intentionally not using .center-canvas:has(> #view-x.active) here.
   body.home-mode is toggled 1:1 with #view-overview (it is the only view id
   not in app.js's researchViews set), so it's an exact, dependency-free match.
   #view-live-research has no equivalent body-level class (research-mode
   covers 13 other views too), so its background is applied directly to the
   view element instead of the .center-canvas ancestor. */
body.home-mode .center-canvas {
  background: linear-gradient(180deg, #f8f9fb 0%, #eef1f6 100%);
}

#view-live-research.active {
  background: linear-gradient(180deg, #f8f9fb 0%, #eef1f6 100%);
  border-radius: var(--ac-radius-panel);
  min-height: calc(100vh - 88px);
}

#view-overview .research-canvas-grid,
#view-overview #approvedFactoryOutputs {
  margin-top: var(--ac-space-4);
}

#view-overview .market-scan-tag,
#view-live-research .market-scan-tag,
#view-live-research .live-badge,
#view-live-research .kpi-chip {
  background: var(--surface-soft);
  border-color: rgba(16, 24, 40, 0.16);
}

#view-overview .workflow-step-pill {
  border-color: rgba(16, 24, 40, 0.16);
  background: var(--surface-soft);
}

/* Research discovery masonry board */
#view-live-research.active {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
  gap: 18px;
  overflow: visible;
}

#view-live-research .live-canvas-shell,
#view-live-research .live-canvas-flow,
#view-live-research .gallery-section,
#view-live-research #liveVisualReferences {
  min-width: 0;
  container-type: inline-size;
  container-name: product-directions;
}

#view-live-research .live-visual-masonry {
  column-count: 2;
  column-gap: 16px;
  width: 100%;
}

#view-live-research .live-ref-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 16px;
  break-inside: avoid;
  page-break-inside: avoid;
  overflow: hidden;
  border: 1px solid #dcc7b3;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(17, 31, 54, 0.07);
  cursor: pointer;
  transform: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

#view-live-research .live-ref-card:hover,
#view-live-research .live-ref-card:focus-within {
  transform: translateY(-3px);
  border-color: #dcc7b3;
  box-shadow: 0 16px 32px rgba(17, 49, 100, 0.14);
}

#view-live-research .live-ref-card:focus-visible {
  outline: 3px solid rgba(61, 33, 14, .3);
  outline-offset: 3px;
}

#view-live-research .live-ref-card.selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(61, 33, 14, .18), 0 16px 32px rgba(17, 49, 100, .14);
}

#view-live-research .live-ref-media {
  position: relative;
  height: auto;
  min-height: 112px;
  overflow: hidden;
  background: #f1f4f8;
}

#view-live-research .live-ref-media img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  transform: none;
}

#view-live-research .live-ref-card:hover .live-ref-media img { transform: none; }

#view-live-research .live-ref-placeholder {
  min-height: 150px;
  height: auto;
  padding: 24px 14px;
  color: var(--ac-text-muted);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  background: linear-gradient(145deg, var(--ac-loading-highlight), var(--ac-loading-base));
}

#view-live-research .live-ref-meta {
  display: grid;
  gap: 9px;
  padding: 14px;
}

#view-live-research .live-ref-title {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  color: var(--ink-900);
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: normal;
  word-break: normal;
}

#view-live-research .direction-signal-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--line);
}

#view-live-research .direction-signal-row span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
#view-live-research .direction-signal-row small { color: var(--ink-500); font-size: 9px; text-transform: uppercase; letter-spacing: .05em; }
#view-live-research .direction-signal-row strong { color: var(--ink-700); font-size: 12px; text-align: right; word-break: normal; overflow-wrap: normal; }
#view-live-research .direction-source { display: block; padding-top: 2px; color: var(--ink-500); font-size: 10px; word-break: normal; overflow-wrap: normal; }
#view-live-research .live-badge { max-width: 100%; white-space: nowrap; }

#view-live-research .live-ref-actions {
  position: absolute;
  inset: auto 9px 9px;
  z-index: 2;
  display: flex;
  gap: 6px;
  padding: 0;
  opacity: 0;
  transform: translateY(5px);
  background: transparent;
  transition: opacity .18s ease, transform .18s ease;
}

#view-live-research .live-ref-card:hover .live-ref-actions,
#view-live-research .live-ref-card:focus-within .live-ref-actions {
  opacity: 1;
  transform: none;
}

#view-live-research .live-ref-actions button,
#view-live-research .live-ref-actions a {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 999px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 5px 16px rgba(17,31,54,.16);
  color: #214f9c;
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
  backdrop-filter: blur(8px);
}

#liveReferenceDrawer {
  position: sticky;
  top: 76px;
  right: auto;
  bottom: auto;
  width: 100%;
  max-height: calc(100vh - 92px);
  transform: none;
  overflow: auto;
  z-index: 5;
  box-shadow: 0 10px 30px rgba(17,31,54,.08);
}

#liveReferenceDrawer .drawer-close-btn { display: none; }
#liveReferenceDrawer .drawer-body { padding: 14px; }
#liveReferenceDrawer .drawer-image { width: 100%; height: auto; max-height: 230px; object-fit: contain; border-radius: 12px; background: #f1e9de; }
#liveReferenceDrawer .drawer-body h4 { margin: 13px 0; line-height: 1.35; }
#liveReferenceDrawer .analyst-empty-state { padding: 22px 4px; }
#liveReferenceDrawer .analyst-empty-state h4 { margin: 0 0 8px; }
#liveReferenceDrawer .analyst-empty-state p { margin: 0; color: var(--ink-500); font-size: 13px; line-height: 1.55; }
#liveReferenceDrawer .analyst-signal-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
#liveReferenceDrawer .analyst-signal-list p { display: grid; gap: 4px; margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
#liveReferenceDrawer .analyst-signal-list strong { color: var(--ink-500); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
#liveReferenceDrawer .analyst-signal-list span { color: var(--ink-700); font-size: 12px; overflow-wrap: anywhere; }
#liveReferenceDrawer .analyst-listing-link { display: inline-flex; margin-top: 13px; color: var(--blue); font-size: 12px; font-weight: 700; }
#liveReferenceDrawer .drawer-actions { margin-top: 14px; }
#liveReferenceDrawer .drawer-actions button { width: 100%; min-height: 40px; border: 0; background: var(--blue); color: #fff; }

@container product-directions (min-width: 760px) {
  #view-live-research .live-visual-masonry { column-count: 3; }
}

@container product-directions (max-width: 435px) {
  #view-live-research .live-visual-masonry { column-count: 1; }
}

/* Store Command Center V1 */
body.home-mode .workspace-grid { grid-template-columns: minmax(0, 1fr); }
body.home-mode .research-rail, body.home-mode .ai-brain, body.research-results-mode .research-rail { display: none; }
body.home-mode .center-canvas, body.research-results-mode .center-canvas { width: 100%; max-width: none; }
.store-command-center { display: grid; gap: 18px; padding: 4px; }
.command-center-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 8px 28px rgba(17,31,54,.07); }
.command-center-header h2 { margin: 4px 0; font-size: clamp(22px, 3vw, 30px); }
.command-shop-name { margin: 0; color: var(--ink-600); font-weight: 650; }
.command-statuses { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; max-width: 460px; }
.command-status { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-600); background: var(--surface-soft); font-size: 11px; font-weight: 700; white-space: nowrap; }
.command-status.connected, .command-status.safe { color: var(--green); border-color: rgba(31,143,87,.25); background: var(--green-soft); }
.store-summary-row { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.store-summary-row article { display: grid; gap: 6px; min-width: 0; padding: 15px 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 5px 18px rgba(17,31,54,.05); }
.store-summary-row span { color: var(--ink-500); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.store-summary-row strong { color: var(--ink-900); font-size: 20px; overflow-wrap: break-word; }
.command-work-section, .today-operating-section { padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.command-action-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.command-action-grid button { display: grid; align-content: start; gap: 7px; min-height: 116px; padding: 16px; text-align: left; border: 1px solid #dcc7b3; border-radius: 16px; background: #fbf7f1; color: var(--ink-900); box-shadow: none; }
.command-action-grid button:hover, .command-action-grid button:focus-visible { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(61,33,14,.12); transform: translateY(-2px); }
.command-action-grid span { font-size: 15px; font-weight: 750; }
.command-action-grid small { color: var(--ink-500); font-size: 12px; line-height: 1.45; }
.today-operating-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.today-operating-list article { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; min-height: 112px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.today-operating-list strong { font-size: 13px; } .today-operating-list p { margin: 5px 0 0; color: var(--ink-500); font-size: 11px; line-height: 1.4; }
.today-operating-list button { align-self: flex-start; min-height: 34px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--blue); color: #fff; font-size: 11px; font-weight: 700; }

/* Compact research operating flow */
body.research-results-mode .workspace-grid { grid-template-columns: minmax(0,1fr); }
body.research-results-mode .ai-brain { display: none; }
body.research-results-mode.research-brain-open:not(.product-detail-open) .workspace-grid { grid-template-columns: minmax(0,1fr) 300px; }
body.research-results-mode.research-brain-open:not(.product-detail-open) .ai-brain { display: block; }
#view-live-research.active { display: block; width: 100%; min-height: 0; }
#view-live-research .live-canvas-shell { width: 100%; }
.idea-hub-tabs { display: inline-flex; align-items: center; gap: 0.15rem; padding: 0.18rem; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.idea-hub-tab { width: auto; min-height: 1.9rem; padding: 0 0.85rem; border: 0; border-radius: 999px; background: transparent; color: #7a4b16; font: 700 0.78rem/1 Inter, system-ui, sans-serif; cursor: pointer; }
.idea-hub-tab.active { background: #3D210E; color: #fffdf9; }
.idea-hub-tab:focus-visible { outline: 2px solid rgba(122, 75, 22, 0.32); outline-offset: 2px; }
#view-live-research .live-canvas-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
#view-live-research .live-canvas-head h2 { margin: 2px 0 0; font-size: 24px; }
#view-live-research .gallery-section { padding: 14px; }
#view-live-research #liveVisualReferences { padding: 0; border: 0; box-shadow: none; background: transparent; }
.results-board-head, .research-results-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.results-board-head h3, .results-board-head p { margin: 0; } .results-board-head p { color: var(--ink-500); font-size: 11px; }
.research-result-grid { display: grid; grid-template-columns: repeat(3,minmax(210px,1fr)); gap: 16px; width: 100%; }
#view-live-research .live-ref-card, .research-results-modal .live-ref-card { display: flex; flex-direction: column; width: 100%; min-width: 0; margin: 0; overflow: hidden; border: 1px solid #dcc7b3; border-radius: 16px; background: #fff; box-shadow: 0 5px 16px rgba(17,31,54,.07); cursor: pointer; }
#view-live-research .live-ref-media, .research-results-modal .live-ref-media { height: 176px; min-height: 176px; background: var(--ac-loading-highlight); overflow: hidden; }
#view-live-research .live-ref-media img, .research-results-modal .live-ref-media img { width: 100%; height: 100%; object-fit: cover; }
#view-live-research .live-ref-placeholder, .research-results-modal .live-ref-placeholder { display: grid; place-items: center; height: 176px; min-height: 176px; padding: 14px; text-align: center; color: var(--ac-text-muted); background: var(--ac-loading-base); }
#view-live-research .live-ref-meta, .research-results-modal .live-ref-meta { display: grid; gap: 9px; flex: 1; padding: 14px; }
#view-live-research .live-ref-title, .research-results-modal .live-ref-title { display: -webkit-box; min-height: 40px; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; font-size: 14px; line-height: 1.4; word-break: normal; overflow-wrap: normal; }
#view-live-research .live-badge, .research-results-modal .live-badge { justify-self: start; max-width: 100%; margin: 0; padding: 4px 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; border-radius: 999px; background: var(--surface-soft); color: var(--ink-500); font-size: 9px; font-weight: 750; }
.direction-metrics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.direction-metrics span { display: grid; gap: 2px; padding: 8px; border-radius: 10px; background: var(--surface-soft); }
.direction-metrics small, .marketplace-signal span { color: var(--ink-500); font-size: 9px; text-transform: uppercase; } .direction-metrics strong { font-size: 12px; }
.marketplace-signal { display: flex; justify-content: space-between; gap: 12px; margin: 0; padding-top: 8px; border-top: 1px solid var(--line); font-size: 11px; }
#view-live-research .live-ref-actions, .research-results-modal .live-ref-actions { position: static; display: flex; gap: 7px; margin-top: auto; padding: 0; opacity: 1; transform: none; }
#view-live-research .live-ref-actions button, #view-live-research .live-ref-actions a, .research-results-modal .live-ref-actions button, .research-results-modal .live-ref-actions a { flex: 1; min-height: 34px; display: inline-flex; align-items: center; justify-content: center; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--blue); box-shadow: none; font-size: 10px; font-weight: 750; text-decoration: none; }
#liveReferenceDrawer { display: none; position: fixed; top: 70px; right: 18px; bottom: 18px; width: min(390px,calc(100vw - 36px)); max-height: none; z-index: 80; overflow: auto; background: #fff; box-shadow: 0 24px 70px rgba(17,31,54,.25); }
#liveReferenceDrawer.open { display: block; } #liveReferenceDrawer .drawer-close-btn { display: inline-flex; }
#liveReferenceDrawer .drawer-actions { display: grid; gap: 8px; } #liveReferenceDrawer .drawer-actions .secondary-btn { border: 1px solid var(--line); background: #fff; color: var(--ink-700); }
.research-results-modal { align-items: stretch; padding: 24px; }
.research-results-card { width: min(1180px,100%); max-width: none; max-height: calc(100vh - 48px); margin: auto; overflow: auto; padding: 24px; }
.research-pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; } .research-pagination span { min-width: 110px; text-align: center; color: var(--ink-500); font-size: 12px; }
/* Authenticated workspace responsive system */
.route-page-title { display: grid; gap: 5px; min-width: 0; }
.route-page-title h1, .route-page-title p { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.route-page-title h1 { margin: 0; }
.route-page-title p { margin: 0; color: var(--ink-500); font-size: 13px; line-height: 1.45; }
body.home-mode .workspace-top { margin-bottom: 12px; }
body.home-mode .workflow-strip { display: none; }
.store-command-center { gap: 14px; }
.command-center-header { min-height: 0; align-items: center; padding: 12px 16px; border-radius: 16px; }
.command-shop-name { color: var(--ink-900); font-size: 16px; }
.command-statuses { margin-left: auto; }
.store-summary-row > button, .store-summary-row > article { appearance: none; display: grid; gap: 6px; min-width: 0; padding: 14px 16px; text-align: left; border: 1px solid var(--line); border-radius: 16px; background: #fff; color: inherit; box-shadow: 0 5px 18px rgba(17,31,54,.05); }
.store-summary-row > button { cursor: pointer; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.store-summary-row > button:hover, .store-summary-row > button:focus-visible { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(61,33,14,.12), 0 10px 24px rgba(17,31,54,.08); transform: translateY(-2px); outline: 0; }
.store-summary-row > button span, .store-summary-row > article span { color: var(--ink-500); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.store-summary-row > button strong, .store-summary-row > article strong { color: var(--ink-900); font-size: 20px; }
.store-summary-row > button small { color: var(--blue); font-size: 10px; font-weight: 750; }
.store-summary-row > article small { color: var(--ink-500); font-size: 10px; font-weight: 700; }
.command-work-section, .today-operating-section { padding: 16px; }
.command-action-grid button { grid-template-columns: auto 1fr; grid-template-rows: auto auto 1fr; column-gap: 10px; min-height: 138px; padding: 16px; border-radius: 17px; }
.command-action-grid button i { grid-row: 1 / 3; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--ac-warm-bg); color: var(--ac-warm-text); font-style: normal; font-size: 14px; }
.command-action-grid button span { align-self: center; font-size: 14px; }
.command-action-grid button small { grid-column: 1 / -1; white-space: normal; overflow-wrap: anywhere; }
.command-action-grid button b { grid-column: 1 / -1; align-self: end; color: var(--blue); font-size: 10px; }
.today-operating-list article { min-height: 104px; }
html[data-page="app"] .os-main-grid, html[data-page="app"] .workspace-grid, html[data-page="app"] .center-canvas, html[data-page="app"] .workspace-page-shell, html[data-page="app"] .workspace-section-card, html[data-page="app"] .workspace-section-body, html[data-page="app"] .view.active, html[data-page="app"] .store-command-center, html[data-page="app"] .live-canvas-shell, html[data-page="app"] .live-canvas-flow, html[data-page="app"] .live-flow-section { min-width: 0; max-width: 100%; }
html[data-page="app"] .workspace-top, html[data-page="app"] .workspace-status-row, html[data-page="app"] .command-center-header, html[data-page="app"] .command-statuses, html[data-page="app"] .workspace-section-head, html[data-page="app"] .results-board-head, html[data-page="app"] .live-canvas-head { min-width: 0; max-width: 100%; }
html[data-page="app"] .workspace-status-row .pill, html[data-page="app"] .command-status, html[data-page="app"] .workspace-section-card, html[data-page="app"] .workspace-section-card * { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }

@media (min-width: 601px) and (max-width: 1024px) {
  html[data-page="app"] .os-main-grid { grid-template-columns: 72px minmax(0, 1fr); }
  html[data-page="app"] .os-sidebar { padding-inline: 8px; }
  html[data-page="app"] .sidebar-item { justify-content: center; padding-inline: 0; }
  html[data-page="app"] .sidebar-label { display: none; }
  html[data-page="app"] .workspace-grid, body.research-mode .workspace-grid, body.home-mode .workspace-grid, body.research-results-mode .workspace-grid, body.research-results-mode.research-brain-open:not(.product-detail-open) .workspace-grid { grid-template-columns: minmax(0, 1fr); }
  html[data-page="app"] .research-rail, html[data-page="app"] .ai-brain { display: none; }
  body.research-results-mode.research-brain-open:not(.product-detail-open) .ai-brain { display: block; }
  html[data-page="app"] .workspace-top, html[data-page="app"] .command-center-header, html[data-page="app"] #view-live-research .live-canvas-head { flex-direction: column; align-items: flex-start; }
  html[data-page="app"] .command-statuses { justify-content: flex-start; margin-left: 0; }
  html[data-page="app"] .workflow-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html[data-page="app"] .store-summary-row, html[data-page="app"] .workspace-metric-grid, html[data-page="app"] .command-action-grid, html[data-page="app"] .workspace-section-grid, html[data-page="app"] .workspace-lane-grid, html[data-page="app"] .research-result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html[data-page="app"] .today-operating-list { grid-template-columns: minmax(0, 1fr); }
  html[data-page="app"] .module-progress-grid, html[data-page="app"] .launch-check-grid, html[data-page="app"] .template-grid, html[data-page="app"] .live-canvas-grid, html[data-page="app"] .pipeline-row, html[data-page="app"] .pipeline-flow, html[data-page="app"] .roadmap-track, html[data-page="app"] .opportunity-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html[data-page="app"] #liveReferenceDrawer { position: relative; inset: auto; width: 100%; margin-top: 16px; }
}

@media (max-width: 600px) {
  html[data-page="app"], html[data-page="app"] body, html[data-page="app"] .acopes-os-shell, html[data-page="app"] .os-main-grid, html[data-page="app"] .workspace-grid, html[data-page="app"] .center-canvas, html[data-page="app"] main { width: 100%; max-width: 100%; min-width: 0; }
  html[data-page="app"] .acopes-os-shell { grid-template-rows: auto 1fr; }
  html[data-page="app"] .os-header { height: auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand actions" "store store" "credits credits" "palette palette"; gap: 8px; padding: 8px 12px; }
  html[data-page="app"] .header-left { grid-area: brand; min-width: 0; }
  html[data-page="app"] .header-actions { grid-area: actions; min-width: 0; margin-left: 0; }
  html[data-page="app"] .connection-status { grid-area: store; width: 100%; min-width: 0; overflow: hidden; }
  html[data-page="app"] #topConnectionText { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html[data-page="app"] .ai-credit-indicator { grid-area: credits; width: 100%; min-width: 0; }
  /* Sole header entry point (B3 - the dead #globalSearchInput was removed,
     not replaced) now fills the full-width row that used to hold it. */
  html[data-page="app"] #commandPaletteTrigger { grid-area: palette; width: 100%; justify-content: center; }
  html[data-page="app"] .header-actions .icon-circle { display: none; }
  html[data-page="app"] .os-main-grid { display: block; min-height: 0; }
  html[data-page="app"] .os-sidebar { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); width: 100%; gap: 3px; padding: 6px; border-right: 0; border-bottom: 1px solid var(--line); overflow: hidden; }
  html[data-page="app"] .sidebar-item { width: 100%; min-width: 0; height: 36px; justify-content: center; padding: 0; }
  html[data-page="app"] .sidebar-label { display: none; }
  html[data-page="app"] .workspace-grid, body.research-mode .workspace-grid, body.home-mode .workspace-grid, body.research-results-mode .workspace-grid, body.research-results-mode.research-brain-open:not(.product-detail-open) .workspace-grid { grid-template-columns: minmax(0, 1fr); }
  html[data-page="app"] .research-rail, html[data-page="app"] .ai-brain { display: none; }
  body.research-results-mode.research-brain-open:not(.product-detail-open) .ai-brain { display: block; }
  html[data-page="app"] .center-canvas { padding: 12px 16px; }
  html[data-page="app"] .workspace-top, html[data-page="app"] .route-page-title, html[data-page="app"] .command-center-header, html[data-page="app"] #view-live-research .live-canvas-head { display: flex; flex-direction: column; align-items: flex-start; width: 100%; }
  html[data-page="app"] .route-page-title h1, html[data-page="app"] #approvedMissionTitle { width: 100%; font-size: 34px; line-height: 1.08; white-space: normal; overflow-wrap: anywhere; }
  html[data-page="app"] .route-page-title p, html[data-page="app"] #approvedMissionSubtitle { width: 100%; font-size: 16px; white-space: normal; overflow-wrap: anywhere; }
  html[data-page="app"] #commitPill { display: none; }
  html[data-page="app"] .workspace-status-row, html[data-page="app"] .command-statuses { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: start; width: 100%; gap: 8px; margin-left: 0; }
  html[data-page="app"] .workspace-status-row .pill, html[data-page="app"] .command-status { width: auto; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  html[data-page="app"] .workflow-steps { grid-template-columns: minmax(0, 1fr); width: 100%; overflow: visible; }
  html[data-page="app"] .workflow-steps:has(li.active) li:not(.active) { display: none; }
  html[data-page="app"] .workflow-steps li, html[data-page="app"] .workflow-steps li button, html[data-page="app"] .workflow-steps li button * { width: 100%; min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  html[data-page="app"] .workflow-steps li button strong, html[data-page="app"] .workflow-steps li button b, html[data-page="app"] .workflow-steps li button em, html[data-page="app"] .workflow-steps li button span { display: inline; width: auto; }
  html[data-page="app"] .store-summary-row, html[data-page="app"] .workspace-metric-grid, html[data-page="app"] .command-action-grid, html[data-page="app"] .today-operating-list, html[data-page="app"] .workspace-section-grid, html[data-page="app"] .workspace-lane-grid, html[data-page="app"] .research-result-grid, html[data-page="app"] .mission-card-grid, html[data-page="app"] .workspace-placeholder-grid, html[data-page="app"] .module-progress-grid, html[data-page="app"] .launch-check-grid, html[data-page="app"] .template-grid, html[data-page="app"] .live-canvas-grid, html[data-page="app"] .pipeline-row, html[data-page="app"] .pipeline-flow, html[data-page="app"] .roadmap-track, html[data-page="app"] .opportunity-card-grid, html[data-page="app"] .reference-action-row, html[data-page="app"] .reference-lightbox-body, html[data-page="app"] .drawer-actions, html[data-page="app"] .compare-grid { grid-template-columns: minmax(0, 1fr); width: 100%; }
  html[data-page="app"] .command-action-grid button { width: 100%; min-height: 104px; padding: 14px; border-radius: 20px; }
  html[data-page="app"] .today-operating-list article, html[data-page="app"] .workspace-section-card, html[data-page="app"] .workspace-lane { width: 100%; min-width: 0; }
  html[data-page="app"] #view-live-research .live-canvas-head h2 { width: 100%; font-size: 28px; line-height: 1.12; white-space: normal; overflow-wrap: anywhere; }
  html[data-page="app"] #view-live-research .live-research-form { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; }
  html[data-page="app"] #view-live-research .live-research-form > * { width: 100%; min-width: 0; }
  html[data-page="app"] #view-live-research .research-brain-toggle { width: 100%; white-space: normal; }
  html[data-page="app"] #view-live-research .live-ref-actions { padding: 0 14px 14px; }
  html[data-page="app"] .research-results-modal { padding: 0; }
  html[data-page="app"] .research-results-card { min-height: 100vh; max-height: 100vh; border-radius: 0; padding: 18px; }
  html[data-page="app"] #liveReferenceDrawer { inset: 0; width: 100%; max-width: 100%; border-radius: 0; }
}

/* ============================================================
   ACOPES DESIGN SYSTEM — Stage 2 Foundation
   Baseline contract: DESIGN.md
   Scope: visual tokens and shared primitives only.
   Shell layout and page composition remain unchanged until Stage 3.
   ============================================================ */

:root {
  color-scheme: light;

  --ac-bg: #f6f0e7;
  --ac-bg-subtle: #fbf7f1;
  --ac-surface: #fffdf9;
  --ac-surface-strong: #ffffff;
  --ac-surface-muted: #f1e9de;

  --ac-text: #26221e;
  --ac-text-secondary: #625b53;
  --ac-text-muted: #81786f;
  /* Was #ded4c8, barely distinguishable from --ac-surface/#fffdf9 -
     cards read as borderless. A real step darker, but still lighter
     than --ac-border-strong (used for hover/focus emphasis in ~9
     places) so that escalation is still visible on hover. */
  --ac-border: #d3c2a9;
  --ac-border-strong: #c9bbaa;

  --ac-primary: #3D210E;
  --ac-primary-hover: #5a341c;
  --ac-primary-active: #2f190b;
  --ac-primary-soft: #efe3d3;
  --ac-on-primary: #ffffff;

  --ac-info: #8a4f21;
  --ac-info-soft: #efe3d3;
  --ac-success: #247a4b;
  --ac-success-soft: #eaf6ee;
  --ac-warning: #a15c00;
  --ac-warning-soft: #fff4dc;
  --ac-warm-bg: #f2e1c2;
  --ac-warm-text: #7a4b16;
  --ac-warm-border: #d7b77d;
  --ac-loading-base: #efe6d8;
  --ac-loading-highlight: #f6f0e7;
  --ac-loading-title: #3d210e;
  --ac-danger: #b42318;
  --ac-danger-soft: #fff0ee;
  --ac-focus: #8a4f21;
  --ac-overlay: rgba(38, 34, 30, 0.45);

  --ac-space-1: 4px;
  --ac-space-2: 8px;
  --ac-space-3: 12px;
  --ac-space-4: 16px;
  --ac-space-5: 20px;
  --ac-space-6: 24px;
  --ac-space-7: 28px;
  --ac-space-8: 32px;
  --ac-space-10: 40px;
  --ac-space-12: 48px;

  --ac-radius-control: 10px;
  --ac-radius-control-wide: 11px;
  --ac-radius-card-sm: 12px;
  --ac-radius-card: 16px;
  --ac-radius-panel: 20px;
  --ac-radius-hero: 24px;
  --ac-radius-pill: 999px;

  /* Was a generic near-black rgba(38,34,30,...) at very low opacity -
     matches this file's own --ac-shadow-glow, which already uses this
     app's real brown (rgba(61,33,14,...)), so cards now match the one
     shadow color the design already committed to elsewhere. */
  --ac-shadow-card: 0 1px 2px rgba(61, 33, 14, 0.06), 0 4px 16px rgba(61, 33, 14, 0.08);
  --ac-shadow-card-hover: 0 3px 8px rgba(61, 33, 14, 0.10), 0 8px 24px rgba(61, 33, 14, 0.14);
  --ac-shadow-modal: 0 24px 70px rgba(38, 34, 30, 0.2);
  --ac-shadow-glow: 0 10px 28px rgba(61, 33, 14, 0.24);
  --ac-font-eyebrow: 12px;
  --ac-font-display: "Poppins", sans-serif;
  /* Same real stack as tokens.css's --font-mono - that file is never
     loaded on the authenticated app pages (index.html only loads this
     stylesheet), so --font-mono itself resolves to nothing here; this
     is the same value, named for this file's own --ac-* convention. */
  --ac-font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

  --fs-hero: clamp(30px, 3.4vw, 40px);
  --fs-section: clamp(19px, 2vw, 22px);
  --fs-body: 14px;
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 22px;
  --space-5: 30px;

  /* Compatibility aliases for the current workspace. */
  --ink-900: var(--ac-text);
  --ink-700: var(--ac-text-secondary);
  --ink-600: var(--ac-text-secondary);
  --ink-500: var(--ac-text-muted);
  --line: var(--ac-border);
  --surface: var(--ac-surface);
  --surface-soft: var(--ac-bg-subtle);
  --surface-muted: var(--ac-surface-muted);
  --blue: var(--ac-primary);
  --blue-soft: var(--ac-primary-soft);
  --green: var(--ac-success);
  --green-soft: var(--ac-success-soft);
  --shadow: var(--ac-shadow-card);
  --shadow-hover: var(--ac-shadow-card-hover);
  --radius-sm: var(--ac-radius-control);
  --radius-md: var(--ac-radius-card-sm);
  --radius-lg: var(--ac-radius-card);
}

html[data-page="app"] body {
  font-family: "Poppins", sans-serif;
  color: var(--ac-text);
  background: var(--ac-bg);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html[data-page="app"] .acopes-os-shell,
html[data-page="app"] .center-canvas,
html[data-page="app"] body.home-mode .center-canvas,
html[data-page="app"] #view-live-research.active {
  background: var(--ac-bg);
}

html[data-page="app"] h1,
html[data-page="app"] h2,
html[data-page="app"] h3,
html[data-page="app"] h4 {
  color: var(--ac-text);
  letter-spacing: -0.018em;
}

html[data-page="app"] .route-page-title h1 {
  font-family: var(--ac-font-display);
  font-size: clamp(28px, 3vw, 32px);
  font-weight: 700;
  line-height: 1.15;
}

html[data-page="app"] :is(.live-canvas-head, .workspace-page-head) > h2 {
  font-family: var(--ac-font-display);
}

html[data-page="app"] .route-page-title p,
html[data-page="app"] .meta {
  color: var(--ac-text-muted);
}

html[data-page="app"] .skeleton-card h3,
html[data-page="app"] .ai-brain .brain-head h2 {
  color: var(--ac-loading-title);
}

html[data-page="app"] .os-header {
  border-color: var(--ac-border);
  background: rgba(255, 253, 249, 0.94);
  box-shadow: 0 1px 0 rgba(98, 91, 83, 0.04);
}

html[data-page="app"] .os-sidebar {
  border-color: var(--ac-border);
  background: var(--ac-surface);
}

html[data-page="app"] .logo-mark {
  background: var(--ac-primary);
  box-shadow: 0 5px 14px rgba(61, 33, 14, 0.2);
}

html[data-page="app"] .profile-pill {
  background: var(--ac-text);
}

html[data-page="app"] input,
html[data-page="app"] textarea,
html[data-page="app"] select {
  border-color: var(--ac-border);
  background: var(--ac-surface-strong);
  color: var(--ac-text);
}

html[data-page="app"] .floating-input:focus-within,
html[data-page="app"] input:focus,
html[data-page="app"] textarea:focus,
html[data-page="app"] select:focus {
  border-color: var(--ac-focus);
  box-shadow: 0 0 0 3px rgba(138, 79, 33, 0.18);
  outline: none;
}

html[data-page="app"] input::placeholder,
html[data-page="app"] textarea::placeholder {
  color: var(--ac-text-muted);
  opacity: 0.82;
}

html[data-page="app"] kbd {
  border-color: var(--ac-border);
  background: var(--ac-surface-muted);
  color: var(--ac-text-muted);
}

html[data-page="app"] .sidebar-item {
  color: var(--ac-text-secondary);
}

html[data-page="app"] .sidebar-item:hover {
  border-color: var(--ac-border);
  background: var(--ac-primary-soft);
  color: var(--ac-primary-hover);
}

html[data-page="app"] .sidebar-item.active {
  border-color: var(--ac-warm-border);
  background: var(--ac-warm-bg);
  color: var(--ac-warm-text);
  box-shadow: inset 3px 0 0 var(--ac-primary);
}

html[data-page="app"] .header-btn,
html[data-page="app"] .icon-btn,
html[data-page="app"] .icon-circle,
html[data-page="app"] .secondary-btn,
html[data-page="app"] .secondary,
html[data-page="app"] .copy-btn,
html[data-page="app"] .modal-actions .secondary-btn {
  border-color: var(--ac-border);
  background: var(--ac-surface);
  color: var(--ac-text-secondary);
}

html[data-page="app"] .header-btn:hover,
html[data-page="app"] .icon-btn:hover,
html[data-page="app"] .icon-circle:hover,
html[data-page="app"] .secondary-btn:hover,
html[data-page="app"] .secondary:hover,
html[data-page="app"] .copy-btn:hover {
  border-color: var(--ac-border-strong);
  background: var(--ac-bg-subtle);
  color: var(--ac-text);
}

html[data-page="app"] .primary-btn,
html[data-page="app"] button[type="submit"],
html[data-page="app"] .today-operating-list button,
html[data-page="app"] #liveReferenceDrawer .drawer-actions button {
  border-color: var(--ac-primary);
  background: var(--ac-primary);
  color: var(--ac-on-primary);
  box-shadow: 0 5px 14px rgba(61, 33, 14, 0.16);
}

html[data-page="app"] .primary-btn:hover,
html[data-page="app"] button[type="submit"]:hover,
html[data-page="app"] .today-operating-list button:hover,
html[data-page="app"] #liveReferenceDrawer .drawer-actions button:hover {
  border-color: var(--ac-primary-hover);
  background: var(--ac-primary-hover);
  color: var(--ac-on-primary);
}

html[data-page="app"] .primary-btn:active,
html[data-page="app"] button[type="submit"]:active {
  border-color: var(--ac-primary-active);
  background: var(--ac-primary-active);
}

html[data-page="app"] button:disabled,
html[data-page="app"] input:disabled,
html[data-page="app"] textarea:disabled,
html[data-page="app"] select:disabled {
  cursor: not-allowed;
  opacity: 0.56;
  box-shadow: none;
}

html[data-page="app"] :where(
  button,
  a,
  input,
  textarea,
  select,
  [tabindex]:not([tabindex="-1"])
):focus-visible {
  outline: 3px solid rgba(138, 79, 33, 0.42);
  outline-offset: 2px;
}

html[data-page="app"] :where(
  .card,
  .module-block,
  .live-canvas-shell,
  .pipeline-shell,
  .production-board,
  .launch-checklist-shell,
  .ai-note-card,
  .brain-notes,
  .live-activity-panel,
  .workspace-section-card,
  .workspace-lane,
  .command-center-header,
  .command-work-section,
  .today-operating-section,
  .store-summary-row article,
  .store-summary-row button,
  .today-operating-list article,
  .live-flow-section,
  .v3-modal-card
) {
  border-color: var(--ac-border);
  background: var(--ac-surface);
  box-shadow: var(--ac-shadow-card);
}

html[data-page="app"] .command-action-grid button {
  border-color: var(--ac-border);
  background: var(--ac-bg-subtle);
  color: var(--ac-text);
  box-shadow: none;
}

html[data-page="app"] .command-action-grid button i {
  background: var(--ac-warm-bg);
  color: var(--ac-warm-text);
}

html[data-page="app"] .command-action-grid button b,
html[data-page="app"] .analyst-listing-link {
  color: var(--ac-primary);
}

html[data-page="app"] .command-action-grid button:hover,
html[data-page="app"] .command-action-grid button:focus-visible {
  border-color: var(--ac-primary);
  background: var(--ac-surface-strong);
  box-shadow: 0 0 0 3px rgba(61, 33, 14, 0.12), var(--ac-shadow-card-hover);
}

html[data-page="app"] .pill,
html[data-page="app"] .command-status,
html[data-page="app"] .live-badge,
html[data-page="app"] .kpi-chip,
html[data-page="app"] .market-scan-tag {
  border-color: var(--ac-border);
  background: var(--ac-bg-subtle);
  color: var(--ac-text-secondary);
}

html[data-page="app"] .thinking-pill,
html[data-page="app"] #view-overview .workflow-step-pill.active {
  border-color: var(--ac-warm-border);
  background: var(--ac-warm-bg);
  color: var(--ac-warm-text);
}

html[data-page="app"] .workflow-steps li.active button {
  border-color: var(--ac-primary);
  background: var(--ac-primary);
  color: var(--ac-bg);
  box-shadow: 0 10px 24px rgba(61, 33, 14, 0.18);
}

html[data-page="app"] .workflow-steps li.active button :is(em, span, small, b) {
  color: inherit;
}

html[data-page="app"] .connection-status.connected,
html[data-page="app"] .command-status.connected,
html[data-page="app"] .command-status.safe {
  border-color: #b9d7c5;
  background: var(--ac-success-soft);
  color: var(--ac-success);
}

html[data-page="app"] .connection-status.not-connected {
  border-color: #eed3a2;
  background: var(--ac-warning-soft);
  color: var(--ac-warning);
}

html[data-page="app"] .ai-credit-indicator {
  border-color: var(--ac-warm-border);
  background: var(--ac-warm-bg);
  color: var(--ac-warm-text);
}

html[data-page="app"] .progress-bar,
html[data-page="app"] .bar {
  background: var(--ac-surface-muted);
}

html[data-page="app"] .progress-bar span,
html[data-page="app"] .bar span {
  background: var(--ac-primary);
}

html[data-page="app"] .message.success {
  border-color: #b9d7c5;
  background: var(--ac-success-soft);
  color: var(--ac-success);
}

html[data-page="app"] .message.error {
  border-color: #efb7b1;
  background: var(--ac-danger-soft);
  color: var(--ac-danger);
}

html[data-page="app"] .v3-modal {
  background: var(--ac-overlay);
}

html[data-page="app"] .v3-modal-card {
  border-radius: var(--ac-radius-panel);
  box-shadow: var(--ac-shadow-modal);
}

html[data-page="app"] .live-ref-card,
html[data-page="app"] .research-results-modal .live-ref-card {
  border-color: var(--ac-border);
  background: var(--ac-surface);
  box-shadow: var(--ac-shadow-card);
}

html[data-page="app"] .live-ref-card:hover,
html[data-page="app"] .live-ref-card:focus-within {
  border-color: #9fb8ca;
  box-shadow: var(--ac-shadow-card-hover);
}

html[data-page="app"] .live-ref-card.selected {
  border-color: var(--ac-primary);
  box-shadow: 0 0 0 3px rgba(61, 33, 14, 0.16), var(--ac-shadow-card-hover);
}
html[data-page="app"] #view-live-research .live-ref-card,
html[data-page="app"] .research-results-modal .live-ref-card {
  border-color: var(--ac-border);
  background: var(--ac-surface);
  color: var(--ac-text);
  box-shadow: var(--ac-shadow-card);
}

html[data-page="app"] #view-live-research .live-ref-card:hover,
html[data-page="app"] #view-live-research .live-ref-card:focus-within,
html[data-page="app"] .research-results-modal .live-ref-card:hover,
html[data-page="app"] .research-results-modal .live-ref-card:focus-within {
  border-color: var(--ac-border-strong);
  box-shadow: var(--ac-shadow-card-hover);
}

html[data-page="app"] #view-live-research .live-ref-title,
html[data-page="app"] .research-results-modal .live-ref-title,
html[data-page="app"] #view-live-research .direction-metrics strong,
html[data-page="app"] .research-results-modal .direction-metrics strong,
html[data-page="app"] #view-live-research .marketplace-signal strong,
html[data-page="app"] .research-results-modal .marketplace-signal strong {
  color: var(--ac-text);
}

html[data-page="app"] #view-live-research .live-badge,
html[data-page="app"] .research-results-modal .live-badge {
  border-color: var(--ac-border);
  background: var(--ac-surface-muted);
  color: var(--ac-text-muted);
}

html[data-page="app"] #view-live-research .direction-metrics span,
html[data-page="app"] .research-results-modal .direction-metrics span {
  border-color: var(--ac-border);
  background: var(--ac-surface-muted);
  color: var(--ac-text-muted);
}

html[data-page="app"] #view-live-research .direction-metrics small,
html[data-page="app"] .research-results-modal .direction-metrics small,
html[data-page="app"] #view-live-research .marketplace-signal span,
html[data-page="app"] .research-results-modal .marketplace-signal span {
  color: var(--ac-text-muted);
}

html[data-page="app"] #view-live-research .marketplace-signal,
html[data-page="app"] .research-results-modal .marketplace-signal {
  border-top-color: var(--ac-border);
  color: var(--ac-text-muted);
}

html[data-page="app"] #view-live-research .live-ref-actions button,
html[data-page="app"] .research-results-modal .live-ref-actions button {
  border-color: var(--ac-primary);
  background: var(--ac-primary);
  color: var(--ac-on-primary);
}

html[data-page="app"] #view-live-research .live-ref-actions a,
html[data-page="app"] .research-results-modal .live-ref-actions a {
  border-color: var(--ac-border);
  background: var(--ac-surface);
  color: var(--ac-primary-hover);
}

html[data-page="app"] a {
  color: var(--ac-primary-hover);
  text-underline-offset: 3px;
}

html[data-page="app"] ::selection {
  background: #d9e4ec;
  color: var(--ac-text);
}

@media (prefers-reduced-motion: reduce) {
  html[data-page="app"] *,
  html[data-page="app"] *::before,
  html[data-page="app"] *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   ACOPES DESIGN SYSTEM — Stage 3 Shell
   Header, desktop navigation, collapsed rail, and mobile nav.
   ============================================================ */

html[data-page="app"] .acopes-os-shell {
  grid-template-rows: 64px minmax(0, 1fr);
}

html[data-page="app"] .os-header {
  height: 64px;
  padding: 0 20px;
  gap: 16px;
}

html[data-page="app"] .header-left {
  width: 212px;
  min-width: 212px;
}

html[data-page="app"] .os-logo {
  min-width: 0;
}

html[data-page="app"] .logo-mark {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 11px;
}

html[data-page="app"] .logo-text {
  color: var(--ac-text);
  font-family: var(--ac-font-display);
  letter-spacing: 0.02em;
}

html[data-page="app"] .header-actions {
  flex: 0 0 auto;
}

html[data-page="app"] .header-btn,
html[data-page="app"] .connection-status,
html[data-page="app"] .icon-circle,
html[data-page="app"] .profile-pill {
  min-height: 38px;
}

html[data-page="app"] #commitPill {
  display: none !important;
}

html[data-page="app"] .os-main-grid {
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: calc(100vh - 64px);
  transition: grid-template-columns 180ms ease;
}

html[data-page="app"] .os-sidebar {
  position: sticky;
  top: 64px;
  align-self: start;
  width: 232px;
  height: calc(100vh - 64px);
  padding: 16px 12px;
  gap: 6px;
  overflow-y: auto;
  transition: width 180ms ease, padding 180ms ease;
}

html[data-page="app"] .sidebar-item {
  width: 100%;
  min-height: 44px;
  height: 44px;
  padding: 0 12px;
  gap: 12px;
  border-radius: 12px;
  font-weight: 600;
  text-align: left;
}

html[data-page="app"] .sidebar-icon {
  display: grid;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  place-items: center;
}

html[data-page="app"] .sidebar-icon svg {
  display: block;
  width: 20px;
  height: 20px;
}

html[data-page="app"] .sidebar-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-page="app"] .sidebar-quick-start {
  margin: 2px 0 6px;
  border: 1px solid var(--ac-border);
  border-radius: 12px;
  background: var(--ac-surface-muted);
}

html[data-page="app"] .sidebar-quick-start-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--ac-text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: .78rem;
  font-weight: 700;
}

html[data-page="app"] .sidebar-quick-start-toggle:focus-visible,
html[data-page="app"] .sidebar-quick-start-actions button:focus-visible { outline: 2px solid var(--ac-primary); outline-offset: -2px; }

html[data-page="app"] .sidebar-quick-start-chevron { width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform 160ms ease; }
html[data-page="app"] .sidebar-quick-start-toggle[aria-expanded="true"] .sidebar-quick-start-chevron { transform: rotate(225deg) translate(-2px, -2px); }
html[data-page="app"] .sidebar-quick-start-actions { display: grid; gap: 2px; padding: 0 6px 7px; }
html[data-page="app"] .sidebar-quick-start-actions[hidden] { display: none; }
html[data-page="app"] .sidebar-quick-start-actions button { display: flex; align-items: center; gap: 9px; min-height: 32px; padding: 0 7px; border: 0; border-radius: 8px; background: transparent; color: var(--ac-text-secondary); cursor: pointer; font: inherit; font-size: .76rem; text-align: left; }
html[data-page="app"] .sidebar-quick-start-actions button:hover { background: var(--ac-primary-soft); color: var(--ac-primary-hover); }
html[data-page="app"] .sidebar-quick-start-actions i { width: 16px; color: var(--ac-primary); font-style: normal; text-align: center; }

html[data-page="app"] .mobile-more-trigger {
  display: none;
}

html[data-page="app"] body.nav-collapsed .os-main-grid {
  grid-template-columns: 72px minmax(0, 1fr);
}

html[data-page="app"] body.nav-collapsed .os-sidebar {
  width: 72px;
  padding-inline: 10px;
}

html[data-page="app"] body.nav-collapsed .sidebar-item {
  justify-content: center;
  padding-inline: 0;
}

html[data-page="app"] body.nav-collapsed .sidebar-label {
  display: none;
}

html[data-page="app"] body.nav-collapsed .sidebar-quick-start { display: none; }

html[data-page="app"] body.nav-collapsed .header-left {
  width: auto;
  min-width: 54px;
}

html[data-page="app"] body.nav-collapsed .os-logo {
  display: none;
}

html[data-page="app"] .mobile-more-modal {
  display: none;
}

html[data-page="app"] .mobile-more-card {
  width: min(460px, calc(100vw - 32px));
}

html[data-page="app"] .mobile-more-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

html[data-page="app"] .mobile-more-head h2 {
  margin: 0;
}

html[data-page="app"] .mobile-more-grid {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

html[data-page="app"] .mobile-more-grid button {
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 64px;
  padding: 12px 14px;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-card-sm);
  background: var(--ac-bg-subtle);
  color: var(--ac-text);
  text-align: left;
}

html[data-page="app"] .mobile-more-grid button:hover,
html[data-page="app"] .mobile-more-grid button:focus-visible {
  border-color: var(--ac-primary);
  background: var(--ac-primary-soft);
}

html[data-page="app"] .mobile-more-grid button span {
  color: var(--ac-text-muted);
  font-size: 12px;
  font-weight: 400;
}

html[data-page="app"] .mobile-more-quick-start { display: none; }

@media (max-width: 600px) {
  html[data-page="app"] .mobile-more-quick-start { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--ac-border); border-radius: 12px; background: var(--ac-surface-muted); }
  html[data-page="app"] .mobile-more-quick-start > strong { font-size: 12px; color: var(--ac-text-secondary); }
  html[data-page="app"] .mobile-more-quick-start > div { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
  html[data-page="app"] .mobile-more-quick-start button { display: block; min-height: 34px; padding: 6px 7px; border: 1px solid var(--ac-border); border-radius: 8px; background: var(--ac-surface); color: var(--ac-text-secondary); font: inherit; font-size: 11px; text-align: left; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  html[data-page="app"] .os-header {
    padding-inline: 14px;
  }

  html[data-page="app"] .header-left {
    width: auto;
    min-width: 188px;
  }

  html[data-page="app"] .header-btn-label {
    display: none;
  }

  html[data-page="app"] #commandPaletteTrigger {
    width: 38px;
    padding: 0;
    justify-content: center;
  }

  html[data-page="app"] #commandPaletteTrigger .header-btn-icon {
    display: inline-flex;
  }

  html[data-page="app"] .os-main-grid,
  html[data-page="app"] body.nav-collapsed .os-main-grid {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  html[data-page="app"] .os-sidebar,
  html[data-page="app"] body.nav-collapsed .os-sidebar {
    width: 72px;
    padding-inline: 10px;
  }

  html[data-page="app"] .sidebar-item,
  html[data-page="app"] body.nav-collapsed .sidebar-item {
    justify-content: center;
    padding-inline: 0;
  }

  html[data-page="app"] .sidebar-label {
    display: none;
  }
}

@media (max-width: 767px) {
  html[data-page="app"] body {
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
  }

  html[data-page="app"] .acopes-os-shell {
    display: block;
    min-height: 100vh;
  }

  html[data-page="app"] .os-header {
    position: sticky;
    top: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand actions"
      "store credits"
      "palette palette";
    width: 100%;
    height: auto;
    min-height: 64px;
    padding: 10px 16px 12px;
    gap: 8px 10px;
  }

  html[data-page="app"] .header-left {
    grid-area: brand;
    width: auto;
    min-width: 0;
  }

  html[data-page="app"] .icon-btn {
    display: none;
  }

  html[data-page="app"] .logo-text {
    font-size: 14px;
  }

  html[data-page="app"] .header-actions {
    display: contents;
  }

  html[data-page="app"] .header-actions .icon-circle {
    display: none;
  }

  html[data-page="app"] .profile-pill {
    grid-area: actions;
    width: 38px;
    min-width: 38px;
    justify-self: end;
  }

  html[data-page="app"] .connection-status {
    grid-area: store;
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
    overflow: hidden;
  }

  html[data-page="app"] #topConnectionText {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html[data-page="app"] .ai-credit-indicator {
    grid-area: credits;
    width: auto;
    min-width: 104px;
    justify-self: end;
  }

  html[data-page="app"] #commandPaletteTrigger {
    grid-area: palette;
    width: 100%;
    max-width: none;
    height: 42px;
    justify-content: center;
  }

  html[data-page="app"] .os-main-grid,
  html[data-page="app"] body.nav-collapsed .os-main-grid {
    display: block;
    min-height: 0;
  }

  html[data-page="app"] .os-sidebar,
  html[data-page="app"] body.nav-collapsed .os-sidebar {
    position: fixed;
    inset: auto 0 0;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: 100%;
    height: calc(64px + env(safe-area-inset-bottom));
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    gap: 2px;
    overflow: visible;
    border: 0;
    border-top: 1px solid var(--ac-border);
    background: rgba(255, 253, 249, 0.97);
    box-shadow: 0 -8px 24px rgba(38, 34, 30, 0.08);
    backdrop-filter: blur(14px);
  }

  html[data-page="app"] .os-sidebar .sidebar-item {
    display: none;
  }

  html[data-page="app"] .os-sidebar .sidebar-quick-start { display: none; }

  html[data-page="app"] .os-sidebar .sidebar-item:nth-child(1),
  html[data-page="app"] .os-sidebar .sidebar-item:nth-child(2),
  html[data-page="app"] .os-sidebar .sidebar-item:nth-child(4),
  html[data-page="app"] .os-sidebar .sidebar-item:nth-child(6),
  html[data-page="app"] .os-sidebar .mobile-more-trigger {
    display: flex;
  }

  html[data-page="app"] .os-sidebar .sidebar-item,
  html[data-page="app"] body.nav-collapsed .os-sidebar .sidebar-item {
    flex-direction: column;
    justify-content: center;
    width: 100%;
    min-width: 0;
    height: 52px;
    min-height: 52px;
    padding: 4px 2px;
    gap: 2px;
    border: 0;
    border-radius: 10px;
    box-shadow: none;
  }

  html[data-page="app"] .os-sidebar .sidebar-item.active {
    background: var(--ac-warm-bg);
    color: var(--ac-warm-text);
    box-shadow: none;
  }

  html[data-page="app"] .os-sidebar .sidebar-icon {
    flex-basis: 21px;
    width: 21px;
    height: 21px;
  }

  html[data-page="app"] .os-sidebar .sidebar-icon svg {
    width: 19px;
    height: 19px;
  }

  html[data-page="app"] .os-sidebar .sidebar-label,
  html[data-page="app"] body.nav-collapsed .os-sidebar .sidebar-label {
    display: block;
    width: 100%;
    overflow: hidden;
    font-size: 9px;
    line-height: 1.15;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html[data-page="app"] .mobile-more-modal {
    display: none;
  }

  html[data-page="app"] .mobile-more-modal.open {
    display: flex;
  }

  html[data-page="app"] .mobile-more-card {
    position: absolute;
    inset: auto 12px calc(76px + env(safe-area-inset-bottom));
    width: auto;
    max-height: min(70vh, 560px);
    margin: 0;
    overflow-y: auto;
    padding: 20px;
    border-radius: var(--ac-radius-panel);
  }
}

/* ACOPES Stage 3 mobile legacy override guard.
   Removes the previous eight-column mobile rail behavior. */
@media (max-width: 600px) {
  html[data-page="app"] .os-sidebar,
  html[data-page="app"] body.nav-collapsed .os-sidebar {
    position: fixed !important;
    inset: auto 0 0 !important;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    grid-auto-flow: row !important;
    width: 100% !important;
    max-width: 100% !important;
    height: calc(64px + env(safe-area-inset-bottom)) !important;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)) !important;
    gap: 2px !important;
    overflow: visible !important;
  }

  html[data-page="app"] .os-sidebar .sidebar-item {
    display: none !important;
  }

  html[data-page="app"] .os-sidebar .sidebar-item:nth-child(1),
  html[data-page="app"] .os-sidebar .sidebar-item:nth-child(2),
  html[data-page="app"] .os-sidebar .sidebar-item:nth-child(4),
  html[data-page="app"] .os-sidebar .sidebar-item:nth-child(6),
  html[data-page="app"] .os-sidebar .mobile-more-trigger {
    display: flex !important;
  }

  html[data-page="app"] .os-sidebar .sidebar-item,
  html[data-page="app"] body.nav-collapsed .os-sidebar .sidebar-item {
    width: 100% !important;
    max-width: 100% !important;
    height: 52px !important;
    min-height: 52px !important;
    padding: 4px 2px !important;
  }

  html[data-page="app"] .os-sidebar .sidebar-label,
  html[data-page="app"] body.nav-collapsed .os-sidebar .sidebar-label {
    display: block !important;
    width: 100% !important;
  }
}

/* ============================================================
   ACOPES DESIGN SYSTEM — Stage 4 Core Workspaces
   Home, Research, Product Factory, and Draft Queue.
   ============================================================ */

html[data-page="app"] .center-canvas {
  width: 100%;
  padding: 24px;
}

html[data-page="app"] .center-canvas > .workspace-top,
html[data-page="app"] .center-canvas > .workflow-strip,
html[data-page="app"] .center-canvas > .view {
  width: min(100%, 1440px);
  margin-inline: auto;
}

html[data-page="app"] .workspace-top {
  align-items: flex-start;
  margin-bottom: 20px;
}

html[data-page="app"] .workspace-status-row {
  gap: 8px;
}

/* Home / Store Command Center */

html[data-page="app"] .store-command-center {
  gap: 20px;
  padding: 0;
}

html[data-page="app"] .command-center-header {
  align-items: center;
  padding: 18px 20px;
  border-radius: var(--ac-radius-card);
  box-shadow: none;
}

html[data-page="app"] .command-shop-name {
  color: var(--ac-text);
  font-size: 16px;
  font-weight: 700;
}

html[data-page="app"] .store-summary-row {
  gap: 14px;
}

html[data-page="app"] .store-summary-row article,
html[data-page="app"] .store-summary-row button {
  min-height: 128px;
  padding: 18px;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-card);
  background: var(--ac-surface);
  color: var(--ac-text);
  text-align: left;
  box-shadow: var(--ac-shadow-card);
}

html[data-page="app"] .store-summary-row button {
  cursor: pointer;
}

html[data-page="app"] .store-summary-row button:hover,
html[data-page="app"] .store-summary-row button:focus-visible {
  border-color: #9fb8ca;
  box-shadow: var(--ac-shadow-card-hover);
  transform: translateY(-2px);
}

html[data-page="app"] .store-summary-row span {
  color: var(--ac-text-muted);
  font-size: 11px;
}

html[data-page="app"] .store-summary-row strong {
  color: var(--ac-text);
  font-size: 28px;
  line-height: 1.1;
}

html[data-page="app"] .store-summary-row small {
  color: var(--ac-primary-hover);
  font-weight: 650;
}

html[data-page="app"] .command-work-section,
html[data-page="app"] .today-operating-section {
  padding: 20px;
  border-radius: var(--ac-radius-card);
  box-shadow: none;
}

html[data-page="app"] .section-headline h3 {
  font-size: 18px;
}

html[data-page="app"] .command-action-grid {
  gap: 14px;
}

html[data-page="app"] .command-action-grid button {
  min-height: 156px;
  padding: 18px;
  border-radius: var(--ac-radius-card);
}

html[data-page="app"] .command-action-grid button i {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

html[data-page="app"] .command-action-grid button span {
  font-size: 16px;
}

html[data-page="app"] .command-action-grid button b {
  align-self: end;
  margin-top: 6px;
}

html[data-page="app"] .today-operating-list {
  gap: 12px;
}

html[data-page="app"] .today-operating-list article {
  min-height: 138px;
  padding: 16px;
  border-radius: var(--ac-radius-card-sm);
  background: var(--ac-bg-subtle);
}

html[data-page="app"] .today-operating-list article:first-child {
  border-color: #9fb8ca;
  background: var(--ac-primary-soft);
}

html[data-page="app"] .today-operating-list strong {
  color: var(--ac-text);
  font-size: 14px;
}

html[data-page="app"] .today-operating-list p {
  color: var(--ac-text-secondary);
  font-size: 12px;
}

/* Research */

html[data-page="app"] #view-live-research.active {
  display: block;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

html[data-page="app"] #view-live-research .live-canvas-shell {
  display: grid;
  gap: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

html[data-page="app"] #view-live-research .live-canvas-head {
  padding: 20px;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-card);
  background: var(--ac-surface);
}

html[data-page="app"] #view-live-research .live-canvas-head h2 {
  color: var(--ac-text);
  font-size: 24px;
}

html[data-page="app"] #view-live-research .live-canvas-head > p {
  color: var(--ac-text-secondary);
}

html[data-page="app"] #view-live-research .live-research-form {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-card);
  background: var(--ac-surface);
  box-shadow: var(--ac-shadow-card);
}

html[data-page="app"] #view-live-research .floating-input {
  min-height: 48px;
  border-radius: var(--ac-radius-control);
  background: var(--ac-surface-strong);
}

html[data-page="app"] #view-live-research .live-research-form button[type="submit"] {
  min-width: 150px;
  min-height: 48px;
  border-radius: var(--ac-radius-control);
}

html[data-page="app"] #view-live-research .live-canvas-flow {
  gap: 18px;
}

html[data-page="app"] #view-live-research .live-flow-section {
  padding: 20px;
  border-radius: var(--ac-radius-card);
  box-shadow: none;
}

html[data-page="app"] #view-live-research .market-scan-provenance {
  border: 1px solid #b9d7c5;
  border-radius: var(--ac-radius-pill);
  background: var(--ac-success-soft);
  color: var(--ac-success);
}

html[data-page="app"] #view-live-research .research-result-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

html[data-page="app"] #view-live-research .live-ref-card,
html[data-page="app"] .research-results-modal .live-ref-card {
  border-radius: var(--ac-radius-card);
}

html[data-page="app"] #view-live-research .live-ref-media,
html[data-page="app"] .research-results-modal .live-ref-media {
  height: 190px;
  min-height: 190px;
  background: var(--ac-surface-muted);
}

html[data-page="app"] #view-live-research .direction-metrics span {
  background: var(--ac-bg-subtle);
}

html[data-page="app"] #view-live-research .live-ref-actions {
  position: static;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: auto;
  opacity: 1;
  transform: none;
}

html[data-page="app"] #view-live-research .live-ref-actions button,
html[data-page="app"] #view-live-research .live-ref-actions a {
  min-height: 36px;
  border-color: var(--ac-border);
  border-radius: var(--ac-radius-control);
  background: var(--ac-surface);
  color: var(--ac-primary-hover);
  box-shadow: none;
}

html[data-page="app"] #view-live-research .live-ref-actions button:first-child {
  border-color: var(--ac-primary);
  background: var(--ac-primary);
  color: var(--ac-on-primary);
}

html[data-page="app"] #researchResultsModal .modal-close {
  position: sticky;
  top: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  float: none;
  margin-left: auto;
  margin-bottom: 10px;
  background: var(--ac-surface);
  box-shadow: var(--ac-shadow-card);
}

html[data-page="app"] .research-results-modal .live-ref-card {
  border-color: var(--ac-border);
  background: var(--ac-surface);
  color: var(--ac-text);
  box-shadow: var(--ac-shadow-card);
}

html[data-page="app"] .research-results-modal .live-ref-card:hover,
html[data-page="app"] .research-results-modal .live-ref-card:focus-within {
  border-color: var(--ac-border-strong);
  box-shadow: var(--ac-shadow-card-hover);
}

html[data-page="app"] .research-results-modal .live-ref-meta {
  background: var(--ac-bg-subtle);
}

html[data-page="app"] .research-results-modal .live-ref-title,
html[data-page="app"] .research-results-modal .direction-metrics strong,
html[data-page="app"] .research-results-modal .marketplace-signal strong {
  color: var(--ac-text);
}

html[data-page="app"] .research-results-modal .live-badge,
html[data-page="app"] .research-results-modal .direction-metrics span {
  border-color: var(--ac-border);
  background: var(--ac-surface-muted);
  color: var(--ac-text-muted);
}

html[data-page="app"] .research-results-modal .direction-metrics small,
html[data-page="app"] .research-results-modal .marketplace-signal,
html[data-page="app"] .research-results-modal .marketplace-signal span {
  color: var(--ac-text-muted);
}

html[data-page="app"] .research-results-modal .marketplace-signal {
  border-top-color: var(--ac-border);
}

html[data-page="app"] .research-results-modal .live-ref-actions button,
html[data-page="app"] .research-results-modal .live-ref-actions a {
  min-height: 36px;
  border-color: var(--ac-border);
  border-radius: var(--ac-radius-control);
  background: var(--ac-surface);
  color: var(--ac-primary-hover);
  box-shadow: none;
}

html[data-page="app"] .research-results-modal .live-ref-actions button:first-child {
  border-color: var(--ac-primary);
  background: var(--ac-primary);
  color: var(--ac-on-primary);
}

html[data-page="app"] #liveReferenceDrawer {
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-card);
  background: var(--ac-surface);
}

html[data-page="app"] #liveReferenceDrawer .drawer-actions {
  display: grid;
  gap: 8px;
}

/* Product Factory */

html[data-page="app"] #view-product-factory .production-board {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

html[data-page="app"] .product-factory-workspace {
  display: grid;
  gap: 18px;
}

html[data-page="app"] .factory-workspace-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-card);
  background: var(--ac-surface);
}

html[data-page="app"] .factory-workspace-head h3 {
  margin: 4px 0 0;
  font-size: 22px;
}

html[data-page="app"] .factory-trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

html[data-page="app"] .factory-trust-row span {
  padding: 6px 9px;
  border: 1px solid #b9d7c5;
  border-radius: var(--ac-radius-pill);
  background: var(--ac-success-soft);
  color: var(--ac-success);
  font-size: 10px;
  font-weight: 700;
}

html[data-page="app"] .factory-pipeline-card {
  padding: 20px;
  border-radius: var(--ac-radius-card);
}

html[data-page="app"] .factory-ready-banner {
  padding: 16px;
  border: 1px solid #b9d7c5;
  border-radius: var(--ac-radius-card-sm);
  background: var(--ac-success-soft);
}

html[data-page="app"] .factory-pipeline-steps {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-block: 18px;
}

html[data-page="app"] .factory-pipeline-steps article {
  min-height: 118px;
  padding: 14px;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-card-sm);
  background: var(--ac-bg-subtle);
}

html[data-page="app"] .factory-pipeline-steps article.complete,
html[data-page="app"] .factory-pipeline-steps article.completed,
html[data-page="app"] .factory-pipeline-steps article.ready {
  border-color: #b9d7c5;
  background: var(--ac-success-soft);
}

html[data-page="app"] .factory-output-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

html[data-page="app"] .factory-output-grid > article {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-card);
  background: var(--ac-surface);
}

html[data-page="app"] .factory-output-grid > article:last-child {
  grid-column: 1 / -1;
  border-color: #9fb8ca;
  background: var(--ac-primary-soft);
}

/* Draft Queue */

html[data-page="app"] .draft-workspace-shell {
  display: grid;
  gap: 18px;
}

html[data-page="app"] .draft-workspace-shell .workspace-page-head {
  padding: 20px;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-card);
  background: var(--ac-surface);
}

html[data-page="app"] .draft-workspace-shell .workspace-page-head h2 {
  margin: 4px 0 6px;
  font-size: 24px;
}

html[data-page="app"] .draft-workspace-shell .workspace-page-head .meta {
  max-width: 720px;
  margin: 0;
}

.growth-advisor-section {
  margin-top: 22px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface, #fff);
}

.growth-advisor-section .section-headline p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.growth-advisor-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.growth-advisor-item {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px 15px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft, #f8fafc);
}

.growth-advisor-marker {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 999px;
  background: var(--accent, #6d5dfc);
}

.growth-advisor-item p,
.growth-advisor-empty {
  margin: 0;
  color: var(--text);
  line-height: 1.5;
}

.growth-advisor-item button {
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent, #5b4de0);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.growth-advisor-item button:hover {
  text-decoration: underline;
}

@media (max-width: 720px) {
  .growth-advisor-section {
    padding: 16px;
  }
}

html[data-page="app"] .draft-queue-head {
  max-width: 760px;
}

html[data-page="app"] .draft-queue-simple-layout {
  display: grid;
  grid-template-columns: minmax(380px, 440px) minmax(300px, 1fr);
  gap: 16px;
  align-items: start;
}

html[data-page="app"] .draft-flow-panel {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-card);
  background: var(--ac-bg-subtle);
  box-shadow: var(--ac-shadow-soft);
}

html[data-page="app"] .draft-flow-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ac-border);
}

html[data-page="app"] .draft-flow-head h3 {
  margin: 0;
  color: var(--ac-text);
  font-size: 18px;
}

html[data-page="app"] .draft-flow-summary {
  /* flex-basis 100% forces this onto its own line once the multi-clause
     B1a breakdown text ("N entries / A missing info · B awaiting decision
     · ...") no longer fits the narrow Task Flow header alongside the
     title - a fixed-width single-line pill clipped it instead of
     wrapping. */
  flex: 1 1 100%;
  border-radius: 10px;
  background: #f6f0e7;
  color: #3D210E;
  font-size: 11px;
  font-weight: 800;
  padding: 6px 9px;
  line-height: 1.5;
  white-space: normal;
}

html[data-page="app"] .draft-queue-history-toggle {
  flex: 0 0 auto;
  margin-left: auto;
  font-size: 11px;
  padding: 6px 10px;
  white-space: nowrap;
}

html[data-page="app"] .draft-workspace-shell .workspace-lane-grid,
html[data-page="app"] .draft-flow-grid {
  grid-template-columns: 1fr;
  gap: 10px;
}

html[data-page="app"] .draft-workspace-shell .workspace-lane {
  min-height: 0;
  max-height: min(58vh, 520px);
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-card);
  background: var(--ac-surface);
  box-shadow: none;
}

html[data-page="app"] .draft-workspace-shell .workspace-lane h3 {
  margin: 0 0 12px;
  font-size: 13px;
}

html[data-page="app"] .draft-workspace-shell .workspace-lane-count {
  font-weight: 400;
  color: var(--ac-text-secondary);
}

html[data-page="app"] .production-lane-card {
  padding: 13px;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-card-sm);
  background: var(--ac-surface);
  box-shadow: var(--ac-shadow-card);
}

html[data-page="app"] .draft-lane-card {
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

html[data-page="app"] .draft-lane-card:hover,
html[data-page="app"] .draft-lane-card:focus-visible,
html[data-page="app"] .draft-lane-card.selected {
  border-color: var(--ac-primary);
  box-shadow: 0 0 0 3px rgba(61, 33, 14, .12), var(--ac-shadow-card);
}

html[data-page="app"] .draft-lane-card:focus-visible {
  outline: none;
}

html[data-page="app"] .draft-flow-card {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-card-sm);
  background: var(--ac-bg-subtle);
}

html[data-page="app"] .draft-flow-card strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 12px;
  line-height: 1.25;
}

html[data-page="app"] .draft-product-type-badge {
  justify-self: start;
  border: 1px solid var(--ac-border);
  background: var(--ac-bg-subtle);
  color: var(--ac-text-secondary);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

html[data-page="app"] .draft-flow-card small {
  font-size: 11px;
}

html[data-page="app"] .draft-flow-card.status-closed {
  opacity: 0.55;
  background: transparent;
}

html[data-page="app"] .draft-flow-card.status-closed:hover,
html[data-page="app"] .draft-flow-card.status-closed:focus-visible,
html[data-page="app"] .draft-flow-card.status-closed.selected {
  opacity: 0.85;
}

html[data-page="app"] .production-lane-card strong,
html[data-page="app"] .draft-flow-card strong {
  color: var(--ac-text);
}

html[data-page="app"] .production-lane-card small,
html[data-page="app"] .draft-flow-card small {
  color: var(--ac-text-secondary);
}

html[data-page="app"] .draft-workspace-shell .workspace-section-card {
  border-radius: var(--ac-radius-card);
}

html[data-page="app"] .draft-queue-detail-region {
  width: 100%;
  min-width: 0;
}

html[data-page="app"] .draft-queue-detail-output {
  display: grid;
  gap: 16px;
}

html[data-page="app"] .draft-queue-detail-output > .card,
html[data-page="app"] .draft-queue-detail-output .draft-detail-panel {
  padding: 18px;
  border-radius: var(--ac-radius-card);
}

html[data-page="app"] .draft-queue-detail-output .draft-detail-panel {
  border: 1px solid var(--ac-border);
  background: var(--ac-surface);
  box-shadow: var(--ac-shadow-card);
}

html[data-page="app"] .draft-queue-detail-output .draft-detail-panel-head {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ac-border);
}

html[data-page="app"] .draft-queue-detail-output .draft-detail-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}

html[data-page="app"] .draft-queue-detail-output .draft-detail-card {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
  max-height: min(50vh, 400px);
  overflow: hidden;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-card-sm);
  background: var(--ac-bg-subtle);
  box-shadow: var(--ac-shadow-card);
}

html[data-page="app"] .draft-queue-detail-output .draft-detail-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--ac-border);
}

html[data-page="app"] .draft-queue-detail-output .draft-detail-card-head h4 {
  margin: 0;
  color: var(--ac-text);
}

html[data-page="app"] .draft-queue-detail-output .draft-detail-card-head span {
  flex: 0 0 auto;
  border-radius: 6px;
  background: #fffdf9;
  color: #3D210E;
  font-family: var(--ac-font-mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 6px 10px;
  text-transform: uppercase;
}

/* Was the pale --ac-success-soft/--ac-warning-soft tints (#eaf6ee /
   #fff4dc) - real colors, but low-saturation enough to read as washed
   out next to 5-6 of these in a row. A stronger tinted background
   (still not the solid --ac-success/--ac-warning fill, which would be
   too loud repeated this often) plus a matching border reads as a real
   status label at a glance, closer to Wiro's technical-tag look. */
html[data-page="app"] .draft-queue-detail-output .draft-detail-status.ready {
  background: rgba(36, 122, 75, 0.16);
  border: 1px solid rgba(36, 122, 75, 0.35);
  color: var(--ac-success);
}

html[data-page="app"] .draft-queue-detail-output .draft-detail-status.missing {
  background: rgba(161, 92, 0, 0.16);
  border: 1px solid rgba(161, 92, 0, 0.35);
  color: var(--ac-warning);
}

html[data-page="app"] .draft-queue-detail-output .draft-detail-toggle {
  appearance: none;
  justify-self: start;
  border: none;
  background: none;
  color: var(--ac-primary);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 14px 0;
  cursor: pointer;
  text-align: left;
}

html[data-page="app"] .draft-queue-detail-output .draft-detail-toggle:hover {
  text-decoration: underline;
}

html[data-page="app"] .draft-queue-detail-output .draft-detail-card-body {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
}

html[data-page="app"] .draft-queue-detail-output .draft-detail-card-body[hidden] {
  display: none;
}

html[data-page="app"] .draft-queue-detail-output .button-row {
  gap: 8px;
}

html[data-page="app"] .draft-queue-detail-output .draft-content-actions {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--ac-border);
}

html[data-page="app"] .draft-queue-detail-output .draft-decision-actions {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ac-border);
}

html[data-page="app"] .draft-queue-detail-output .draft-etsy-status {
  display: grid;
  gap: 8px;
  margin: -4px 0 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ac-border);
}

html[data-page="app"] .draft-queue-detail-output .draft-etsy-status .draft-detail-status {
  justify-self: start;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  padding: 6px 9px;
  text-transform: uppercase;
}

html[data-page="app"] .draft-queue-detail-output .draft-decision-actions .draft-status-btn[data-status="needs_edit"] {
  border-color: var(--ac-primary);
  color: var(--ac-primary);
}

html[data-page="app"] .draft-queue-detail-output .draft-decision-actions .draft-status-btn[data-status="rejected"] {
  justify-self: start;
  min-height: 34px;
  font-size: 12px;
}

html[data-page="app"] .draft-queue-detail-output .draft-status-btn[data-status="approved"] {
  border-color: var(--ac-primary);
  background: var(--ac-primary);
  color: var(--ac-on-primary);
}

html[data-page="app"] .draft-queue-detail-output .draft-status-btn[data-status="rejected"] {
  border-color: #efb7b1;
  background: var(--ac-danger-soft);
  color: var(--ac-danger);
}

html[data-page="app"] .draft-queue-detail-output details {
  border-color: var(--ac-border);
  border-radius: var(--ac-radius-card-sm);
  background: var(--ac-bg-subtle);
}

html[data-page="app"] .draft-queue-detail-output .draft-details {
  margin-top: 12px;
}

html[data-page="app"] .draft-queue-detail-output .draft-details-shell {
  display: grid;
  gap: 10px;
  max-height: 460px;
  overflow: auto;
  padding: 10px;
}

html[data-page="app"] .draft-queue-detail-output .draft-detail-section {
  background: var(--ac-surface);
}

html[data-page="app"] .draft-queue-detail-output .draft-detail-section-body {
  display: grid;
  gap: 10px;
  padding: 10px 12px 12px;
}

html[data-page="app"] .draft-queue-detail-output .draft-detail-scroll {
  max-height: 180px;
  overflow: auto;
  padding-right: 4px;
}

html[data-page="app"] .draft-queue-detail-output .draft-tag-analysis {
  display: grid;
  gap: 4px;
  min-width: 0;
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid var(--ac-border);
}

html[data-page="app"] .draft-queue-detail-output .draft-tag-analysis-title,
html[data-page="app"] .draft-queue-detail-output .draft-tag-analysis-score,
html[data-page="app"] .draft-queue-detail-output .draft-tag-analysis-notice {
  margin: 0;
  overflow-wrap: anywhere;
}

html[data-page="app"] .draft-queue-detail-output .draft-tag-analysis-title {
  color: var(--ac-text);
  font-size: 13px;
  font-weight: 700;
}

html[data-page="app"] .draft-queue-detail-output .draft-tag-analysis-score {
  color: var(--ac-text-muted);
  font-size: 13px;
}

html[data-page="app"] .draft-queue-detail-output .draft-tag-analysis-notice {
  max-width: 100%;
}

html[data-page="app"] .mockup-modal-card {
  max-width: 980px;
}

html[data-page="app"] .mockup-studio-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  gap: 16px;
  margin-top: 16px;
}

html[data-page="app"] .mockup-studio-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-card);
  background: var(--ac-bg-subtle);
}

html[data-page="app"] .mockup-template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

html[data-page="app"] .mockup-template-card {
  position: relative;
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-card-sm);
  background: var(--ac-surface);
  cursor: pointer;
}

html[data-page="app"] .mockup-template-card.selected,
html[data-page="app"] .mockup-template-card:focus-within {
  border-color: var(--ac-primary);
  box-shadow: 0 0 0 3px rgba(61, 33, 14, .12);
}

html[data-page="app"] .mockup-template-card input {
  position: absolute;
  top: 12px;
  right: 12px;
}

html[data-page="app"] .mockup-tier,
html[data-page="app"] .mockup-usage-badge {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #f6f0e7;
  color: #3D210E;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

html[data-page="app"] .mockup-usage-badge--included {
  background: #fffdf9;
  border: 1px solid var(--ac-border);
}

html[data-page="app"] .mockup-brief-label {
  display: grid;
  gap: 8px;
  color: var(--ac-text);
  font-size: 13px;
  font-weight: 700;
}

html[data-page="app"] .mockup-brief-label textarea {
  width: 100%;
  resize: vertical;
  min-height: 110px;
  padding: 12px;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-card-sm);
  background: var(--ac-surface);
  color: var(--ac-text);
}

html[data-page="app"] .mockup-attachments {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

html[data-page="app"] .mockup-attachment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 180px));
  gap: 10px;
}

html[data-page="app"] .draft-queue-detail-output .mockup-attachment-grid {
  max-height: 240px;
  overflow: auto;
  padding-right: 4px;
}

html[data-page="app"] .mockup-attachment-grid figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-card-sm);
  background: var(--ac-bg-subtle);
}

html[data-page="app"] .mockup-attachment-grid img,
html[data-page="app"] .mockup-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

html[data-page="app"] .mockup-placeholder {
  display: grid;
  place-items: center;
  padding: 12px;
  color: var(--ac-text-secondary);
}

html[data-page="app"] .mockup-placeholder.failed {
  background: var(--ac-danger-soft);
  color: var(--ac-danger);
  font-size: 12px;
  text-align: center;
}

html[data-page="app"] .mockup-attachment-grid figcaption {
  padding: 8px 10px;
  color: var(--ac-text-secondary);
  font-size: 12px;
}

@media (max-width: 1100px) {
  html[data-page="app"] .store-summary-row,
  html[data-page="app"] .command-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html[data-page="app"] #view-live-research .research-result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html[data-page="app"] .draft-queue-simple-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  html[data-page="app"] .mockup-studio-layout,
  html[data-page="app"] .mockup-template-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  html[data-page="app"] .center-canvas {
    padding: 16px;
  }

  html[data-page="app"] .store-summary-row,
  html[data-page="app"] .command-action-grid,
  html[data-page="app"] .today-operating-list,
  html[data-page="app"] #view-live-research .research-result-grid,
  html[data-page="app"] .factory-output-grid,
  html[data-page="app"] .draft-workspace-shell .workspace-lane-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  html[data-page="app"] .command-center-header,
  html[data-page="app"] .factory-workspace-head {
    flex-direction: column;
    align-items: stretch;
  }

  html[data-page="app"] .command-statuses {
    justify-content: flex-start;
  }

  html[data-page="app"] .store-summary-row article,
  html[data-page="app"] .store-summary-row button {
    min-height: 110px;
  }

  html[data-page="app"] .command-action-grid button {
    min-height: 132px;
  }

  html[data-page="app"] #view-live-research .live-canvas-head,
  html[data-page="app"] #view-live-research .live-flow-section,
  html[data-page="app"] .factory-workspace-head,
  html[data-page="app"] .draft-workspace-shell .workspace-page-head {
    padding: 16px;
  }

  html[data-page="app"] #view-live-research .live-research-form {
    grid-template-columns: minmax(0, 1fr);
    padding: 12px;
  }

  html[data-page="app"] #view-live-research .live-research-form button[type="submit"] {
    width: 100%;
  }

  html[data-page="app"] .factory-output-grid > article:last-child {
    grid-column: auto;
  }

  html[data-page="app"] .factory-pipeline-card {
    padding: 14px;
  }

  html[data-page="app"] .draft-queue-detail-output > .card {
    padding: 14px;
  }
}

/* ============================================================
   ACOPES DESIGN SYSTEM — Stage 5 Supporting Workspaces
   Creative Studios, Store Intelligence, and Settings.
   ============================================================ */

html[data-page="app"] :where(
  .assets-workspace-shell,
  .store-workspace-shell,
  .settings-workspace-shell
) {
  display: grid;
  gap: 18px;
}

html[data-page="app"] :where(
  .assets-workspace-shell,
  .store-workspace-shell,
  .settings-workspace-shell
) > .workspace-page-head {
  padding: 20px;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-card);
  background: var(--ac-surface);
}

html[data-page="app"] :where(
  .assets-workspace-shell,
  .store-workspace-shell,
  .settings-workspace-shell
) > .workspace-page-head h2 {
  margin: 4px 0 6px;
  font-size: 24px;
}

html[data-page="app"] :where(
  .assets-workspace-shell,
  .store-workspace-shell,
  .settings-workspace-shell
) > .workspace-page-head .meta {
  max-width: 760px;
  margin: 0;
}

html[data-page="app"] .workspace-section-grid {
  gap: 16px;
}

html[data-page="app"] :where(
  .assets-workspace-shell,
  .store-workspace-shell,
  .settings-workspace-shell
) .workspace-section-card {
  padding: 18px;
  border-radius: var(--ac-radius-card);
  box-shadow: none;
}

html[data-page="app"] :where(
  .assets-workspace-shell,
  .store-workspace-shell,
  .settings-workspace-shell
) .workspace-section-head {
  margin-bottom: 14px;
}

html[data-page="app"] :where(
  .assets-workspace-shell,
  .store-workspace-shell,
  .settings-workspace-shell
) .workspace-section-head h3 {
  font-size: 16px;
}

/* Creative Studios */

html[data-page="app"] .assets-workspace-shell .workspace-section-grid {
  grid-template-columns: minmax(0, 1fr);
}

html[data-page="app"] .assets-workspace-shell .workspace-metric-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

html[data-page="app"] .assets-workspace-shell .workspace-metric-grid article {
  min-height: 132px;
  padding: 18px;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-card);
  background: var(--ac-bg-subtle);
}

html[data-page="app"] .assets-workspace-shell .workspace-metric-grid strong {
  color: var(--ac-text);
  font-size: 28px;
}

html[data-page="app"] .assets-workspace-shell .workspace-empty-state {
  min-height: 220px;
  display: grid;
  gap: 12px;
  place-items: center;
  padding: 32px;
  border: 1px dashed var(--ac-border-strong);
  border-radius: var(--ac-radius-card);
  background: var(--ac-bg-subtle);
  color: var(--ac-text-secondary);
  text-align: center;
}

html[data-page="app"] .mockup-gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

html[data-page="app"] .mockup-gallery-toolbar > div {
  display: grid;
  gap: 8px;
}

html[data-page="app"] .mockup-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

/* Trend Hunter saved library */

html[data-page="app"] .trend-library-shell {
  display: grid;
  gap: 16px;
}

html[data-page="app"] .trend-library-head,
html[data-page="app"] .trend-library-panel,
html[data-page="app"] .trend-opportunity-card {
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-card);
  background: var(--ac-surface);
  box-shadow: var(--ac-shadow-card);
}

html[data-page="app"] .trend-library-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
}

html[data-page="app"] .trend-library-actions,
html[data-page="app"] .trend-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

html[data-page="app"] .trend-library-actions a,
html[data-page="app"] .trend-card-actions a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  text-decoration: none;
}

html[data-page="app"] .trend-library-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
}

html[data-page="app"] .trend-import-uploader {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

html[data-page="app"] .trend-file-drop {
  display: grid;
  gap: 8px;
  min-height: 128px;
  padding: 18px;
  border: 1px dashed var(--ac-border-strong);
  border-radius: var(--ac-radius-card);
  background: var(--ac-bg-subtle);
  color: var(--ac-text);
  cursor: pointer;
}

html[data-page="app"] .trend-file-drop:hover,
html[data-page="app"] .trend-file-drop:focus-within {
  border-color: var(--ac-primary);
  box-shadow: 0 0 0 3px rgba(61, 33, 14, 0.12);
}

html[data-page="app"] .trend-file-drop input {
  max-width: 100%;
  color: var(--ac-text-secondary);
}

html[data-page="app"] .trend-file-drop strong {
  color: var(--ac-text);
  font-size: 16px;
}

html[data-page="app"] .trend-file-drop span {
  color: var(--ac-text-secondary);
}

html[data-page="app"] .trend-import-uploader > .meta {
  grid-column: 1 / -1;
}

/* B3: file-upload half folded into the same accordion as the paste-text
   half, instead of the uploader sitting permanently open next to a
   collapsed textarea. */
html[data-page="app"] .trend-import-details > summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ac-text);
  padding: 4px 0 8px;
}

html[data-page="app"] .trend-import-details > .meta {
  margin-bottom: 10px;
}

html[data-page="app"] .trend-paste-details {
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-control);
  background: var(--ac-bg-subtle);
  padding: 10px 12px;
  margin-top: 10px;
}

html[data-page="app"] .trend-paste-details summary {
  cursor: pointer;
  color: var(--ac-text-secondary);
  font-weight: 700;
}

html[data-page="app"] .trend-paste-details textarea {
  margin-top: 10px;
}

html[data-page="app"] .trend-library-panel textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-control);
  background: var(--ac-bg-subtle);
  color: var(--ac-text);
  padding: 12px;
  font: inherit;
}

html[data-page="app"] .trend-frequency-grid,
html[data-page="app"] .trend-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

html[data-page="app"] .trend-frequency-grid span,
html[data-page="app"] .trend-tag-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--ac-warm-border);
  border-radius: 999px;
  background: var(--ac-warm-bg);
  color: var(--ac-warm-text);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
}

html[data-page="app"] .trend-frequency-grid small {
  color: inherit;
  opacity: 0.75;
}

html[data-page="app"] .trend-opportunity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

html[data-page="app"] .trend-opportunity-card {
  overflow: hidden;
  display: grid;
}

html[data-page="app"] .trend-opportunity-card > img,
html[data-page="app"] .trend-image-placeholder {
  width: 100%;
  height: 170px;
  object-fit: cover;
  background: var(--ac-bg-subtle);
}

html[data-page="app"] .trend-image-placeholder {
  display: grid;
  place-items: center;
  color: var(--ac-text-muted);
}

html[data-page="app"] .trend-opportunity-card > div {
  display: grid;
  gap: 10px;
  padding: 16px;
}

html[data-page="app"] .trend-opportunity-card h3 {
  margin: 0;
  color: var(--ac-text);
  font-size: 16px;
  line-height: 1.25;
}

html[data-page="app"] .trend-library-empty {
  min-height: 220px;
}

@media (max-width: 720px) {
  html[data-page="app"] .trend-import-uploader {
    grid-template-columns: minmax(0, 1fr);
  }
}

html[data-page="app"] .mockup-gallery-card {
  overflow: hidden;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-card);
  background: var(--ac-bg-subtle);
  box-shadow: var(--ac-shadow-card);
}

html[data-page="app"] .mockup-gallery-card figure {
  margin: 0;
  border-bottom: 1px solid var(--ac-border);
  background: var(--ac-surface);
}

html[data-page="app"] .mockup-gallery-card img,
html[data-page="app"] .mockup-gallery-card .mockup-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

html[data-page="app"] .mockup-gallery-card > div {
  display: grid;
  gap: 8px;
  padding: 13px;
}

html[data-page="app"] .mockup-gallery-card h4 {
  margin: 0;
  color: var(--ac-text);
  font-size: 14px;
  line-height: 1.25;
}

html[data-page="app"] .mockup-product-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

html[data-page="app"] .mockup-product-picker button {
  display: grid;
  gap: 6px;
  min-height: 88px;
  padding: 14px;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-card-sm);
  background: var(--ac-bg-subtle);
  color: var(--ac-text);
  text-align: left;
  cursor: pointer;
}

html[data-page="app"] .mockup-product-picker button:hover,
html[data-page="app"] .mockup-product-picker button:focus-visible {
  border-color: var(--ac-primary);
  box-shadow: 0 0 0 3px rgba(61, 33, 14, .12);
  outline: 0;
}

html[data-page="app"] .mockup-product-picker small {
  color: var(--ac-text-secondary);
}

/* Store Intelligence */

html[data-page="app"] .store-workspace-shell .workspace-section-grid {
  grid-template-columns: minmax(0, 1fr);
}

html[data-page="app"] .store-workspace-shell .store-grid,
html[data-page="app"] .store-workspace-shell .workspace-metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

html[data-page="app"] .store-workspace-shell .store-grid > *,
html[data-page="app"] .store-workspace-shell .workspace-metric-grid > * {
  min-height: 116px;
  padding: 16px;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-card-sm);
  background: var(--ac-bg-subtle);
}

html[data-page="app"] #marketActionsReloadBtn {
  min-height: 42px;
  margin-bottom: 14px;
  border-color: var(--ac-primary);
  background: var(--ac-primary);
  color: var(--ac-on-primary);
}

html[data-page="app"] #marketActionsOutput {
  border-color: var(--ac-border);
  border-radius: var(--ac-radius-card-sm);
  background: var(--ac-bg-subtle);
}

html[data-page="app"] .action-list {
  display: grid;
  gap: 10px;
}

html[data-page="app"] .action-list > * {
  padding: 14px;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-card-sm);
  background: var(--ac-surface);
}

/* Settings */

html[data-page="app"] .settings-workspace-shell .workspace-section-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

html[data-page="app"] .settings-workspace-shell .workspace-metric-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

html[data-page="app"] .settings-workspace-shell .workspace-metric-grid > * {
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-card-sm);
  background: var(--ac-bg-subtle);
}

html[data-page="app"] .settings-workspace-shell .workspace-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

html[data-page="app"] .settings-workspace-shell .workspace-chip-grid span {
  padding: 8px 11px;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-pill);
  background: var(--ac-bg-subtle);
  color: var(--ac-text-secondary);
  font-size: 12px;
  font-weight: 600;
}

html[data-page="app"] .billing-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

html[data-page="app"] .billing-plan-card {
  display: grid;
  gap: 14px;
  align-content: space-between;
  min-height: 220px;
  padding: 16px;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-card-sm);
  background: var(--ac-bg-subtle);
  box-shadow: var(--ac-shadow-soft);
}

html[data-page="app"] .billing-plan-card .plan-badge {
  border-color: var(--ac-warm-bg);
  background: var(--ac-warm-bg);
  color: var(--ac-warm-text);
}

html[data-page="app"] .billing-plan-card h4 {
  margin: 10px 0 6px;
  color: var(--ac-text);
  font-family: "Poppins", sans-serif;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
}

html[data-page="app"] .billing-plan-card p,
html[data-page="app"] .billing-plan-card small {
  margin: 0;
  color: var(--ac-text-secondary);
  line-height: 1.5;
}

html[data-page="app"] .billing-plan-card small {
  display: block;
  margin-top: 8px;
}

html[data-page="app"] .billing-plan-generations {
  margin-top: 4px;
  color: var(--ac-warm-text);
  font-size: 1.05rem;
}

html[data-page="app"] .billing-plan-breakdown {
  margin-top: 4px !important;
  color: var(--ac-text-secondary);
  font-size: 0.78rem;
  line-height: 1.45;
  word-break: break-word;
}

html[data-page="app"] .billing-upgrade-btn {
  width: 100%;
}

html[data-page="app"] .billing-plan-current {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-pill);
  color: var(--ac-text-secondary);
  font-size: 0.84rem;
  font-weight: 800;
  text-align: center;
}

html[data-page="app"] .hero-eyebrow,
html[data-page="app"] .eyebrow {
  color: var(--ac-primary-hover);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

/* All Product Directions modal: keep repeated result cards light.
   The main Research grid remains dark via #view-live-research selectors. */
html[data-page="app"] #researchResultsModal #researchResultsGrid .live-ref-card--modal {
  border-color: var(--ac-border);
  background: var(--ac-surface);
  color: var(--ac-text);
  box-shadow: var(--ac-shadow-card);
}

html[data-page="app"] #researchResultsModal #researchResultsGrid .live-ref-card--modal:hover,
html[data-page="app"] #researchResultsModal #researchResultsGrid .live-ref-card--modal:focus-within {
  border-color: var(--ac-border-strong);
  box-shadow: var(--ac-shadow-card-hover);
}

html[data-page="app"] #researchResultsModal #researchResultsGrid .live-ref-card--modal .live-ref-meta {
  background: var(--ac-bg-subtle);
}

html[data-page="app"] #researchResultsModal #researchResultsGrid .live-ref-card--modal .live-ref-title,
html[data-page="app"] #researchResultsModal #researchResultsGrid .live-ref-card--modal .direction-metrics strong,
html[data-page="app"] #researchResultsModal #researchResultsGrid .live-ref-card--modal .marketplace-signal strong {
  color: var(--ac-text);
}

html[data-page="app"] #researchResultsModal #researchResultsGrid .live-ref-card--modal .live-badge,
html[data-page="app"] #researchResultsModal #researchResultsGrid .live-ref-card--modal .direction-metrics span {
  border-color: var(--ac-border);
  background: var(--ac-surface-muted);
  color: var(--ac-text-muted);
}

html[data-page="app"] #researchResultsModal #researchResultsGrid .live-ref-card--modal .direction-metrics small,
html[data-page="app"] #researchResultsModal #researchResultsGrid .live-ref-card--modal .marketplace-signal,
html[data-page="app"] #researchResultsModal #researchResultsGrid .live-ref-card--modal .marketplace-signal span {
  color: var(--ac-text-muted);
}

html[data-page="app"] #researchResultsModal #researchResultsGrid .live-ref-card--modal .marketplace-signal {
  border-top-color: var(--ac-border);
}

html[data-page="app"] #researchResultsModal #researchResultsGrid .live-ref-card--modal .live-ref-actions button,
html[data-page="app"] #researchResultsModal #researchResultsGrid .live-ref-card--modal .live-ref-actions a {
  min-height: 36px;
  border-color: var(--ac-border);
  border-radius: var(--ac-radius-control);
  background: var(--ac-surface);
  color: var(--ac-primary-hover);
  box-shadow: none;
}

html[data-page="app"] #researchResultsModal #researchResultsGrid .live-ref-card--modal .live-ref-actions button:first-child {
  border-color: var(--ac-primary);
  background: var(--ac-primary);
  color: var(--ac-on-primary);
}

html[data-page="app"] .workspace-empty-state {
  border-color: var(--ac-border);
  background: var(--ac-bg-subtle);
  color: var(--ac-text-secondary);
}

@media (max-width: 1023px) {
  html[data-page="app"] .settings-workspace-shell .workspace-section-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 767px) {
  html[data-page="app"] :where(
    .assets-workspace-shell,
    .store-workspace-shell,
    .settings-workspace-shell
  ) > .workspace-page-head,
  html[data-page="app"] :where(
    .assets-workspace-shell,
    .store-workspace-shell,
    .settings-workspace-shell
  ) .workspace-section-card {
    padding: 16px;
  }

  html[data-page="app"] .assets-workspace-shell .workspace-metric-grid,
  html[data-page="app"] .store-workspace-shell .store-grid,
  html[data-page="app"] .store-workspace-shell .workspace-metric-grid,
  html[data-page="app"] .settings-workspace-shell .workspace-metric-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Home card geometry correction */
html[data-page="app"] .store-summary-row article,
html[data-page="app"] .store-summary-row button,
html[data-page="app"] .command-action-grid button,
html[data-page="app"] .today-operating-list article {
  border-radius: 16px !important;
}
.email-verification-notice {
  position: sticky;
  top: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 22px;
  border-bottom: 1px solid rgba(102, 115, 141, 0.24);
  background: #fff8e8;
  color: #172033;
  box-shadow: 0 8px 24px rgba(23, 32, 51, 0.08);
}

.email-verification-notice p {
  margin: 3px 0 0;
  color: #59677d;
}

.email-verification-notice button {
  flex: 0 0 auto;
}

@media (max-width: 680px) {
  .email-verification-notice {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ============================================================
   Basit Mod: simplified entry flow (simplified-flow-plan-v1, UX build
   order step 2). Reuses the design-unification pass's --ac-* tokens
   directly rather than the legacy --ink-900, --blue, --line aliases
   still used by .command-action-grid above (both point at the same
   values - see the alias block near the --ac-* root definitions).
   Button styling is NOT reinvented here - primary-btn, secondary,
   button-row, and .pill are the same real classes the Draft Queue
   detail panel already uses.
   ============================================================ */

.simple-flow-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--ac-space-3);
}

.simple-flow-card {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 116px;
  padding: var(--ac-space-4);
  text-align: left;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-card);
  background: var(--ac-surface);
  color: var(--ac-text);
  box-shadow: var(--ac-shadow-card);
  position: relative;
}

.simple-flow-card:hover,
.simple-flow-card:focus-visible {
  border-color: var(--ac-primary);
  box-shadow: var(--ac-shadow-card-hover);
  transform: translateY(-2px);
}

.simple-flow-card i {
  font-style: normal;
  font-size: 20px;
  color: var(--ac-primary);
}

.simple-flow-card span {
  font-family: var(--ac-font-display);
  font-size: 15px;
  font-weight: 700;
}

.simple-flow-card small {
  color: var(--ac-text-muted);
  font-size: 12px;
  line-height: 1.45;
}

/* The one primary/most-common action ("Generate a product idea") among
   8 otherwise visually-identical cards - solid brown fill instead of
   the neutral outline the other 7 keep, same real primary color already
   used for CTA buttons elsewhere (--ac-primary), not a new color. */
.simple-flow-card.is-primary {
  background: var(--ac-primary);
  border-color: var(--ac-primary);
}

.simple-flow-card.is-primary i,
.simple-flow-card.is-primary span {
  color: var(--ac-on-primary);
}

.simple-flow-card.is-primary small {
  color: rgba(255, 255, 255, 0.78);
}

.simple-flow-card.is-primary:hover,
.simple-flow-card.is-primary:focus-visible {
  background: var(--ac-primary-hover);
  border-color: var(--ac-primary-hover);
}

/* Home keeps the seven real entry points, but separates strategic work from
   production tools without changing any card action or route. */
.simple-flow-grid--recommended {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.simple-flow-grid--recommended .simple-flow-card {
  min-height: 132px;
}

.simple-flow-tools {
  margin-top: var(--ac-space-4);
}

.simple-flow-tools h4 {
  margin: 0 0 var(--ac-space-2);
  color: var(--ac-text-muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.simple-flow-grid--tools .simple-flow-card {
  min-height: 96px;
  padding: var(--ac-space-3);
}

.simple-flow-grid--tools .simple-flow-card i { font-size: 17px; }
.simple-flow-grid--tools .simple-flow-card span { font-size: 14px; }
.simple-flow-grid--tools .simple-flow-card small { font-size: 11px; }

/* Home workflow entry stays visible even while the sidebar Quick Start is
   collapsed. The same seven actions become compact chips here so the next
   task remains the primary focus above this section. */
.today-operating-section--primary {
  border-color: var(--ac-border-strong);
}

.today-operating-section--primary .section-headline {
  margin-bottom: var(--ac-space-3);
}

.today-operating-section--primary .section-headline h3 {
  color: var(--ac-primary);
}

.simple-flow-actions-heading {
  margin-bottom: var(--ac-space-3) !important;
}

.simple-flow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ac-space-2);
}

.simple-flow-action-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--ac-border);
  border-radius: 999px;
  background: var(--ac-surface);
  color: var(--ac-text);
  box-shadow: none;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.simple-flow-action-chip i {
  color: var(--ac-primary);
  font-size: 15px;
  font-style: normal;
}

.simple-flow-action-chip:hover,
.simple-flow-action-chip:focus-visible {
  border-color: var(--ac-primary);
  background: var(--ac-warm-bg);
  box-shadow: 0 0 0 3px rgba(61, 33, 14, .12);
  transform: none;
}

.simple-flow-action-chip.is-primary {
  border-color: var(--ac-primary);
  background: var(--ac-primary);
  color: var(--ac-on-primary);
}

.simple-flow-action-chip.is-primary i { color: var(--ac-on-primary); }

@media (max-width: 600px) {
  .simple-flow-action-chip {
    flex: 1 1 calc(50% - var(--ac-space-2));
    justify-content: center;
    min-width: 0;
    padding-inline: 10px;
    white-space: normal;
  }
}

.command-status.warning {
  color: var(--ac-danger, #b42318);
  border-color: rgba(180, 35, 24, .28);
  background: rgba(180, 35, 24, .08);
}

button.command-status { cursor: pointer; }

#storeHealthDetail { display: flex; align-items: center; gap: 10px; }
.store-health-grade { font-size: 12px; font-weight: 750; }
.store-health-grade-strong { color: var(--ac-success); }
.store-health-grade-improving { color: var(--ac-primary); }
.store-health-grade-needs_attention { color: var(--ac-danger, #b42318); }
.store-health-why { color: var(--ac-text-muted); font-size: 12px; }
.store-health-why summary { cursor: pointer; }
.store-health-why ul { margin: 8px 0 0; padding-left: 18px; }

.simple-flow-card.is-disabled {
  cursor: not-allowed;
  opacity: 0.6;
  background: var(--ac-surface-muted);
}

.simple-flow-card.is-disabled:hover {
  transform: none;
  box-shadow: var(--ac-shadow-card);
  border-color: var(--ac-border);
}

.simple-flow-soon-badge {
  position: absolute;
  top: var(--ac-space-3);
  right: var(--ac-space-3);
}

.simple-flow-back {
  border: none;
  background: none;
  color: var(--ac-text-secondary);
  font-size: 13px;
  padding: 0 0 var(--ac-space-3);
  cursor: pointer;
}

.simple-flow-back:hover {
  color: var(--ac-primary);
}

.simple-flow-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--ac-space-4);
}

.simple-flow-choice-card {
  display: grid;
  gap: var(--ac-space-2);
  padding: var(--ac-space-5);
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-card);
  background: var(--ac-surface);
}

.simple-flow-choice-card > span {
  font-family: var(--ac-font-display);
  font-size: 16px;
  font-weight: 700;
}

.simple-flow-choice-card small {
  color: var(--ac-text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.simple-flow-choice-card input[type="text"] {
  padding: 10px 12px;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-control);
  background: var(--ac-surface-strong);
  color: var(--ac-text);
  font-size: 14px;
}

.simple-flow-radio {
  display: flex;
  align-items: center;
  gap: var(--ac-space-2);
  font-size: 13px;
  color: var(--ac-text);
  cursor: pointer;
}

.simple-flow-empty-state {
  display: grid;
  gap: var(--ac-space-3);
  justify-items: start;
  padding: var(--ac-space-6) 0;
}

.simple-flow-muted {
  color: var(--ac-text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.simple-flow-error {
  color: var(--ac-danger);
  font-size: 13px;
}

.simple-flow-waiting {
  display: grid;
  justify-items: center;
  gap: var(--ac-space-3);
  padding: var(--ac-space-10) 0;
  text-align: center;
}

.simple-flow-waiting-title {
  font-family: var(--ac-font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--ac-text);
}

.simple-flow-spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid var(--ac-primary-soft);
  border-top-color: var(--ac-primary);
  animation: simple-flow-spin 0.8s linear infinite;
}

@keyframes simple-flow-spin {
  to { transform: rotate(360deg); }
}

.simple-flow-results-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--ac-space-3);
}

.simple-flow-result-card {
  display: grid;
  gap: var(--ac-space-2);
  padding: var(--ac-space-4);
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-card);
  background: var(--ac-surface);
  box-shadow: var(--ac-shadow-card);
}

.simple-flow-result-card strong {
  font-family: var(--ac-font-display);
  font-size: 15px;
}

.simple-flow-result-card small {
  color: var(--ac-text-muted);
  font-size: 12px;
}

.simple-flow-potential-pill {
  justify-self: start;
}

.simple-flow-result {
  display: grid;
  gap: var(--ac-space-3);
  max-width: 520px;
}

.simple-flow-result h3 {
  font-family: var(--ac-font-display);
  font-size: 20px;
  margin: 0;
}

.simple-flow-result-image,
.simple-flow-preview-image {
  width: 100%;
  max-width: 320px;
  border-radius: var(--ac-radius-card-sm);
  border: 1px solid var(--ac-border);
}

.simple-flow-result-video {
  width: 100%;
  max-width: 420px;
  border-radius: var(--ac-radius-card-sm);
  background: #000;
}

.simple-flow-not-ready {
  margin: 0;
}

.simple-flow-checklist {
  display: grid;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 420px;
}

.simple-flow-checklist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ac-space-3);
  padding: 8px 12px;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-control);
  background: var(--ac-surface);
  font-size: 13px;
}

.simple-flow-checklist-item.is-ready {
  color: var(--ac-text);
}

.simple-flow-checklist-item.is-ready .simple-flow-checklist-status {
  color: var(--ac-success);
  font-weight: 600;
}

.simple-flow-checklist-item.is-pending .simple-flow-checklist-status {
  color: var(--ac-text-muted);
}

.simple-flow-upload-area {
  display: grid;
  gap: var(--ac-space-3);
  padding: var(--ac-space-5);
  border: 1px dashed var(--ac-border-strong);
  border-radius: var(--ac-radius-card);
  background: var(--ac-surface);
  max-width: 420px;
  margin-bottom: var(--ac-space-4);
}

@media (max-width: 900px) {
  .simple-flow-grid,
  .simple-flow-choice-grid,
  .simple-flow-results-grid {
    grid-template-columns: 1fr;
  }
}

/* B4 (1/2, uppercase locale bug): text-transform: uppercase applies
   Turkish-tailored case conversion whenever the elements language
   resolves to tr (document.documentElement.lang, set by i18n.js) - a
   lowercase i becomes dotted-I. Every class below currently holds
   English micro-copy (kickers, status pills, badges) with no Turkish
   translation yet, so it renders with stray dotted-I characters under
   the TR locale. Scoped strictly to lang=tr - the English-locale
   visual design (uppercase labels) is untouched; this only stops the
   Turkish locale from mis-casing text it was never meant to case-
   transform. Once a string moves under t()/tVars() with a real
   Turkish translation (B4 part 2 / B5), it no longer needs uppercase
   styling per the "dont put new labels in an uppercase class" rule
   (see Uygulama notlari) - delete the matching line here as each one
   gets translated. Generated programmatically from every
   text-transform: uppercase rule in this file to avoid manual-
   transcription gaps. Fully reversible: delete this block. */
html[lang="tr"] .ai-credit-indicator span,
html[lang="tr"] .workflow-strip-toggle,
html[lang="tr"] .hero-eyebrow,
html[lang="tr"] .marketing-footer h4,
html[lang="tr"] .workspace-state-card strong,
html[lang="tr"] .brain-section-item small,
html[lang="tr"] .brain-log-item small,
html[lang="tr"] .market-scan-provenance,
html[lang="tr"] .coloring-book-output .factory-pipeline-steps article span,
html[lang="tr"] .kpi-chip small,
html[lang="tr"] .intel-chip small,
html[lang="tr"] .seo-card-grid small,
html[lang="tr"] .asset-progress-grid small,
html[lang="tr"] .concept-card-grid small,
html[lang="tr"] .launch-progress-card small,
html[lang="tr"] .module-progress-grid article .coming-soon-badge,
html[lang="tr"] .tagflow-stat-label,
html[lang="tr"] .decision-badge,
html[lang="tr"] .pill.good,
html[lang="tr"] .pill.safe,
html[lang="tr"] .onboarding-eyebrow,
html[lang="tr"] .analyst-chart-card small,
html[lang="tr"] .workspace-metric-tile small,
html[lang="tr"] #view-live-research .direction-signal-row small,
html[lang="tr"] #liveReferenceDrawer .analyst-signal-list strong,
html[lang="tr"] .store-summary-row span,
html[lang="tr"] .direction-metrics small,
html[lang="tr"] .marketplace-signal span,
html[lang="tr"] .store-summary-row > button span,
html[lang="tr"] .store-summary-row > article span,
html[lang="tr"][data-page="app"] .draft-product-type-badge,
html[lang="tr"][data-page="app"] .draft-queue-detail-output .draft-detail-card-head span,
html[lang="tr"][data-page="app"] .draft-queue-detail-output .draft-etsy-status .draft-detail-status,
html[lang="tr"][data-page="app"] .mockup-tier,
html[lang="tr"][data-page="app"] .mockup-usage-badge,
html[lang="tr"][data-page="app"] .hero-eyebrow,
html[lang="tr"][data-page="app"] .eyebrow,
html[lang="tr"] .simple-flow-tools h4 {
  text-transform: none;
}
