/* NexyCell selective design refresh.
   This layer intentionally loads last: it refines presentation without changing
   feature markup, IDs, data hooks, or the shared locale/accessibility contracts. */
:root {
  --nc-marketing-max: 1240px;
  --nc-workbench-max: 1360px;
  --nc-refresh-radius: 14px;
  --nc-refresh-radius-sm: 10px;
  --nc-refresh-border: color-mix(in srgb, var(--txt) 12%, transparent);
}

html { scroll-padding-top: 76px; }

/* The public landing page presents the product. Workbench-only utilities remain
   available as soon as a technical view is active. */
body:has(#view-overview.active) :is(
  #command-palette-open,
  #job-center-toggle,
  #undo-btn,
  #redo-btn,
  .top-actions,
  #status-pill
) { display: none; }

/* The brand already returns to the landing page, so omit its duplicate Home item
   there. The complete technical navigation returns in every workbench view. */
body:has(#view-overview.active) #nav > button[data-view="overview"] { display: none; }

@media (min-width: 1181px) {
  body > .topbar {
    min-height: 64px;
    height: 64px;
    padding-inline: clamp(18px, 2.2vw, 34px);
    border-bottom-color: var(--nc-refresh-border);
    backdrop-filter: blur(18px) saturate(1.12);
  }

  body > .topbar .nav { gap: 3px; }
  body > .topbar .nav > button,
  body > .topbar .nav > .nav-dd > .nav-dd-btn,
  body > .topbar .nav > .nav-link {
    min-height: 38px;
    padding-inline: 10px;
    border-radius: 9px;
    font-weight: 650;
  }
}

/* Marketing pages use a comfortable reading measure while engineering views keep
   the wider workspace required by dense controls and charts. */
#view-overview > :is(
  .hero,
  .role-start,
  .home-disclosure,
  #plans,
  #plans-grid,
  .cta-band,
  #about,
  #about-capabilities
) {
  width: min(100%, var(--nc-marketing-max));
  margin-inline: auto;
}

#view-overview .hero {
  grid-template-columns: minmax(0, 1.02fr) minmax(460px, .98fr);
  align-items: center;
  gap: clamp(38px, 5vw, 70px);
  padding-block: clamp(46px, 5vw, 74px) clamp(44px, 4vw, 64px);
  margin-bottom: 0;
}

#view-overview .hero > div:first-child { max-width: 650px; }
#view-overview .hero-eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding-inline: 10px;
  margin-bottom: 0;
  border: 1px solid var(--nc-refresh-border);
  border-radius: 999px;
  font-family: var(--nc-font-sans);
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: .1em;
}

#view-overview .hero h1 {
  margin: 18px 0 20px;
  font-size: clamp(42px, 4.2vw, 62px);
  line-height: 1.04;
  letter-spacing: -.05em;
  text-wrap: balance;
}

#view-overview .hero > div:first-child > p {
  max-width: 610px;
  font-size: clamp(16px, 1.25vw, 19px);
  line-height: 1.68;
}

#view-overview .hero .cta {
  align-items: center;
  gap: 10px;
  margin-top: 28px;
}

#view-overview .hero .cta .btn {
  min-height: 46px;
  padding-inline: 17px;
  border-radius: var(--nc-refresh-radius-sm);
  font-weight: 700;
}

#view-overview .position-proof {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  max-width: none;
  margin-top: 26px;
  padding-top: 17px;
  border-top: 1px solid var(--nc-refresh-border);
}

#view-overview .position-proof > span {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  padding-inline-end: 15px;
}

#view-overview .home-lineage {
  padding: 22px;
  border-color: var(--nc-refresh-border);
  border-radius: 18px;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--panel2) 86%, transparent),
    color-mix(in srgb, var(--panel) 92%, transparent));
  box-shadow: 0 16px 44px rgba(0, 0, 0, .12);
}

#view-overview .home-lineage-head { margin-bottom: 17px; }
#view-overview .home-lineage-head h2 {
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -.025em;
}

#view-overview .home-lineage-path { gap: 5px; }
#view-overview .home-lineage-step {
  min-height: 52px;
  padding: 9px 10px;
  border-radius: 9px;
}

#view-overview .home-lineage-public-detail,
#view-overview .home-lineage-impact { border-radius: 11px; }
#view-overview .hero-demo { margin-top: 12px; border-radius: 12px; }

#view-overview .role-start { margin-block: 30px 14px; }
#view-overview .role-start .section-head h2 {
  max-width: 820px;
  font-size: clamp(27px, 2.5vw, 36px);
  letter-spacing: -.035em;
}

#view-overview .role-grid {
  align-items: stretch;
  gap: 12px;
}

#view-overview .role-card {
  min-width: 0;
  min-height: 100%;
  padding: 0;
  overflow: hidden;
  border-color: var(--nc-refresh-border);
  border-radius: var(--nc-refresh-radius);
  background: var(--panel);
  box-shadow: none;
  isolation: isolate;
  transform: translateY(0);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

#view-overview .role-card-media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  flex: none;
  overflow: hidden;
  border-bottom: 1px solid var(--nc-refresh-border);
  background: #0d1b2f;
  font-size: inherit;
}

#view-overview .role-card-media img,
#view-overview .plan-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
  transform: scale(1);
  transition: transform .32s cubic-bezier(.2, .7, .2, 1), filter .32s ease;
}

#view-overview .role-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 17px 18px 18px;
  font-size: inherit;
}

#view-overview .role-card-heading {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-width: 0;
  font-size: inherit;
}

#view-overview .role-card-icon {
  width: 30px;
  height: 30px;
  border: 1px solid color-mix(in srgb, var(--acc) 32%, var(--nc-refresh-border));
  border-radius: 9px;
  background: color-mix(in srgb, var(--acc) 8%, var(--panel2));
}

#view-overview .role-card b {
  font-size: 15px;
  line-height: 1.35;
}

#view-overview .role-card small {
  min-height: 0;
  color: var(--txt2);
  line-height: 1.55;
}

#view-overview .role-card em {
  display: flex;
  align-items: center;
  min-height: 28px;
  margin-top: auto;
}

#view-overview .role-card:hover,
#view-overview .role-card:focus-visible {
  border-color: color-mix(in srgb, var(--acc) 66%, var(--nc-refresh-border));
  box-shadow: 0 14px 28px rgba(4, 13, 28, .14);
  transform: translateY(-3px);
}

#view-overview .role-card:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 3px;
}

#view-overview .role-card:is(:hover, :focus-visible) .role-card-media img,
#view-overview .plan-card:is(:hover, :focus-within) .plan-card-media img {
  filter: saturate(1.06) brightness(1.03);
  transform: scale(1.015);
}

#view-overview .home-disclosure {
  margin-top: 14px;
  border-color: var(--nc-refresh-border);
  border-radius: var(--nc-refresh-radius);
}

#view-overview .home-disclosure-summary {
  min-height: 76px;
  padding: 17px 20px;
}

#view-overview .cap-grid,
#view-overview .how-row { gap: 12px; }
#view-overview .cap-card,
#view-overview .how-step,
#view-overview .plan-card { border-radius: var(--nc-refresh-radius); }

#view-overview #plans-grid { align-items: stretch; }

#view-overview .plan-card {
  min-width: 0;
  padding: 0;
  overflow: hidden;
  text-align: start;
  align-items: stretch;
  background: var(--panel);
  transform: translateY(0);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

#view-overview .plan-card:hover,
#view-overview .plan-card:focus-within {
  border-color: color-mix(in srgb, var(--acc) 58%, var(--nc-refresh-border));
  box-shadow: 0 16px 34px rgba(4, 13, 28, .14);
  transform: translateY(-3px);
}

#view-overview .plan-card-media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  flex: none;
  overflow: hidden;
  border-bottom: 1px solid var(--nc-refresh-border);
  background: #0d1b2f;
}

#view-overview .plan-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 11px;
  min-width: 0;
  padding: 18px;
}

#view-overview .plan-card-heading {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

#view-overview .plan-card .plan-ic {
  width: 34px;
  height: 34px;
  margin: 0;
  border: 1px solid color-mix(in srgb, var(--acc) 32%, var(--nc-refresh-border));
  border-radius: 10px;
  background: color-mix(in srgb, var(--acc) 8%, var(--panel2));
}

#view-overview .plan-card h4 {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
}

#view-overview .plan-card .sub {
  margin: 0;
  color: var(--txt2);
  line-height: 1.6;
}

#view-overview .plan-card .plan-cta {
  min-height: 44px;
  margin-top: auto;
}

#view-overview .plan-card .plan-cta:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 3px;
}

#view-overview .plan-card .plan-badge {
  position: absolute;
  z-index: 2;
  inset-block-start: 12px;
  inset-inline-start: 12px;
  margin: 0;
  box-shadow: 0 5px 16px rgba(4, 13, 28, .28);
}

/* Report-like hierarchy for technical workspaces. Sizes stay compact enough for
   engineering density and never drop below the shared 11.5px legibility floor. */
#main .task-view > .section-head { margin-bottom: 18px; }
#main .task-view > .section-head h2 {
  font-size: clamp(28px, 2.5vw, 34px);
  letter-spacing: -.035em;
}

#main > .stepper {
  max-width: var(--nc-workbench-max);
  margin: 12px auto 18px;
  padding: 6px;
  border: 1px solid var(--nc-refresh-border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel2) 82%, transparent);
  gap: 3px;
}

#main > .stepper .step {
  min-height: 38px;
  padding: 7px 10px;
  border-radius: 8px;
}

#main .view:not(#view-overview) .card {
  border-color: var(--nc-refresh-border);
  border-radius: var(--nc-refresh-radius);
  background: color-mix(in srgb, var(--panel) 90%, transparent);
  box-shadow: none;
}

#main .view:not(#view-overview) .card > h4,
#main .view:not(#view-overview) .card header h4 {
  font-size: 14.5px;
  letter-spacing: -.015em;
}

#main .task-view .copilot {
  border-color: color-mix(in srgb, var(--acc) 24%, var(--nc-refresh-border));
  border-radius: 13px;
  box-shadow: none;
}

#main .task-view :is(.ctrl > label, .bar .lab) {
  gap: 12px;
  align-items: baseline;
  font-size: 12.5px;
  line-height: 1.45;
  font-weight: 650;
}

#main .task-view .ctrl .val {
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

#main .task-view .seg { gap: 2px; padding: 3px; border-radius: 9px; }
#main .task-view .seg > button { min-height: 34px; border-radius: 7px; }
#main .task-view :is(.btn, select, input[type="text"], input[type="search"], input[type="number"], textarea) {
  border-radius: 9px;
}

@media (min-width: 1280px) {
  #view-materials .view-task-configure > .grid.cols-2b {
    grid-template-columns: minmax(0, 1.48fr) minmax(420px, 1fr);
    gap: 14px;
  }

  #view-materials .material-cathode-workspace {
    grid-template-columns: minmax(300px, .92fr) minmax(320px, 1.08fr);
    gap: 16px;
  }

  #view-materials .material-cathode-results {
    padding-inline-start: 16px;
    border-inline-start: 1px solid var(--nc-refresh-border);
  }
}

@media (min-width: 961px) {
  #process-card .proc-grid {
    grid-template-columns: minmax(360px, .82fr) minmax(0, 1.18fr);
    gap: 18px;
  }

  #process-card .proc-out {
    padding-inline-start: 18px;
    border-inline-start: 1px solid var(--nc-refresh-border);
  }

  #view-cell :is(.task-input-grid, .task-result-grid),
  #view-performance .view-task-configure > .grid.cols-2b { gap: 14px; }

  #view-optimize .opt-decision-grid {
    grid-template-columns: minmax(340px, .72fr) minmax(0, 1.28fr);
    gap: 14px;
  }

  #view-optimize .opt-best-card {
    border-inline-start: 3px solid color-mix(in srgb, var(--acc) 70%, transparent);
  }

  #view-manufacturing .mfg-workflow-nav {
    position: sticky;
    top: 72px;
    z-index: 8;
    padding: 8px;
    border: 1px solid var(--nc-refresh-border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--panel) 94%, transparent);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
    backdrop-filter: blur(14px);
  }
}

@media (max-width: 1120px) {
  #view-overview .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 30px;
    padding-top: 48px;
  }

  #view-overview .hero > div:first-child,
  #view-overview .flowmap { max-width: 780px; }
}

@media (max-width: 960px) {
  html { scroll-padding-top: 116px; }
  #main > .stepper { overflow-x: auto; justify-content: flex-start; }
  #process-card .proc-out,
  #view-materials .material-cathode-results {
    padding-inline-start: 0;
    padding-top: 16px;
    border-inline-start: 0;
    border-top: 1px solid var(--nc-refresh-border);
  }
}

@media (max-width: 760px) {
  #view-overview .hero {
    padding-block: 28px 36px;
  }

  #view-overview .hero h1 {
    font-size: clamp(32px, 9.8vw, 44px);
  }

  #view-overview .position-proof { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  #view-overview .home-lineage { padding: 16px; }
  #view-overview .role-grid { grid-template-columns: minmax(0, 1fr); }
  #view-overview .role-card-body,
  #view-overview .plan-card-body { padding: 16px; }
  #main > .stepper { border-radius: 10px; }
  #main .task-view > .section-head h2 { font-size: clamp(22px, 6vw, 26px); }
  #main .view:not(#view-overview) .card > h4,
  #main .view:not(#view-overview) .card header h4 { font-size: 15px; }
  #main .task-view :is(.ctrl > label, .bar .lab),
  #main .task-view .ctrl .val { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  #view-overview :is(.role-card, .plan-card, .role-card-media img, .plan-card-media img) {
    transition: none;
  }
}
.installed-role-cockpit { margin:12px 18px; padding:12px 14px; border:1px solid var(--line); border-radius:12px; background:var(--panel); display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.installed-role-cockpit > div:first-child { display:flex; flex-direction:column; }
.installed-role-cockpit small { color:var(--txt3); }
.installed-role-actions { display:flex; gap:6px; flex-wrap:wrap; }
.installed-role-actions button,.installed-role-cockpit select { min-height:38px; padding:7px 9px; border:1px solid var(--line2); border-radius:8px; background:var(--panel2); color:var(--txt); }
.installed-role-state { padding:5px 8px; border-radius:20px; background:rgba(52,226,196,.12); color:var(--acc); font-size:11.5px; }
.installed-role-dashboard { display:grid; grid-template-columns:repeat(4,minmax(100px,1fr)); flex:1 1 420px; gap:6px; min-width:280px; }
.installed-role-dashboard > span { padding:7px 9px; border:1px solid var(--line); border-radius:8px; background:var(--panel2); }
.installed-role-dashboard small,.installed-role-dashboard b { display:block; overflow-wrap:anywhere; }
.installed-role-dashboard small { color:var(--txt3); font-size:11.5px; }
.installed-role-dashboard b { margin-top:3px; color:var(--acc); font:700 12px/1.2 var(--mono); }
.installed-role-continue { min-height:38px; padding:7px 10px; border:1px solid var(--acc); border-radius:8px; background:color-mix(in srgb,var(--acc) 12%,var(--panel2)); color:var(--acc); font-weight:750; cursor:pointer; }
@media (max-width:700px) { .installed-role-dashboard { grid-template-columns:repeat(2,minmax(0,1fr)); flex-basis:100%; } .installed-role-continue { grid-column:1/-1; } }
/* Product coherence layer: shared report context and direct engineering values. */
.product-context { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:0; margin:0 0 12px; border:1px solid var(--line); border-radius:10px; overflow:hidden; background:color-mix(in srgb,var(--panel2) 68%,transparent); }
.product-context > span { position:relative; min-width:0; min-height:48px; padding:9px 11px; border-inline-start:1px solid var(--line); }
.product-context > span:first-child { border-inline-start:0; }
.product-context small,.product-context b,.product-verdict small,.product-verdict b { display:block; overflow-wrap:anywhere; }
.product-context small,.product-verdict small { color:var(--txt3); font-size:11.5px; font-weight:700; letter-spacing:.03em; }
.product-context b { margin-top:4px; color:var(--txt); font-size:12px; }
.product-verdict { margin:0 0 14px; padding:11px 13px; border:1px solid color-mix(in srgb,var(--acc) 28%,var(--line)); border-radius:10px; background:color-mix(in srgb,var(--acc) 5%,var(--panel)); }
.product-verdict-kicker { color:var(--acc); font:700 11.5px/1 var(--mono); letter-spacing:.08em; }
.product-verdict-grid { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:12px; margin-top:9px; }
.product-verdict b { margin-top:4px; color:var(--txt); font-size:12px; line-height:1.35; }
.product-verdict-constraint { display:grid; grid-template-columns:minmax(110px,.7fr) minmax(0,5.3fr); gap:12px; margin:10px 0 0; padding-top:9px; border-top:1px solid var(--line); }
.product-verdict-constraint small,.product-verdict-constraint b { margin:0; }
.product-verdict[data-level="bad"] { border-color:var(--bad); } .product-verdict[data-level="warn"] { border-color:var(--warn); }
.direct-value { width:82px; min-height:28px; margin-inline-start:8px; padding:4px 7px; border:1px solid var(--line2); border-radius:6px; background:var(--panel2); color:var(--acc); font:700 12px/1 var(--mono); text-align:end; }
.ctrl[data-direct-value="true"] > label > .val { display:none; }
.direct-unit { margin-inline-start:4px; color:var(--txt3); font:700 11.5px/1 var(--mono); white-space:nowrap; }
.product-diff-trigger { position:absolute; inset:0; display:flex; align-items:flex-end; min-width:44px; min-height:44px; padding:9px 11px; border:0; background:transparent; color:var(--acc); font:700 12px/1 var(--mono); text-align:start; text-decoration:underline; cursor:pointer; }
.product-context > span:nth-child(3) > small { position:relative; z-index:1; pointer-events:none; }
.product-diff-drawer { position:fixed; inset-block:72px 18px; inset-inline-end:18px; z-index:1200; width:min(460px,calc(100vw - 36px)); padding:16px; overflow:auto; border:1px solid var(--line2); border-radius:14px; background:var(--panel); color:var(--txt); box-shadow:0 24px 80px rgba(0,0,0,.52); }
.product-diff-drawer[hidden] { display:none; }
.product-diff-head { display:flex; align-items:center; gap:10px; border-bottom:1px solid var(--line); padding-bottom:10px; }
.product-diff-head h3 { margin:0 auto 0 0; font-size:16px; }
.product-diff-close { min-width:44px; min-height:44px; border:1px solid var(--line2); border-radius:8px; background:var(--panel2); color:var(--txt); font-size:20px; cursor:pointer; }
.product-diff-meta { color:var(--txt2); font-size:12px; }
.product-diff-list { display:grid; gap:7px; }
.product-diff-group { display:grid; gap:7px; }
.product-diff-group h4 { margin:8px 0 0; padding-bottom:6px; border-bottom:1px solid var(--line); color:var(--txt); font-size:13px; }
.product-diff-row { display:grid; gap:3px; padding:9px; border:1px solid var(--line); border-radius:8px; background:var(--panel2); font:12px/1.45 var(--mono); overflow-wrap:anywhere; }
.product-diff-row b { color:var(--acc); }
.product-diff-row span { color:var(--txt2); }
.product-diff-actions { margin-top:12px; }
@media (max-width:900px) { .product-verdict-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width:700px) { .product-context { grid-template-columns:repeat(2,minmax(0,1fr)); } .product-context > span:nth-child(3) { border-inline-start:0; border-block-start:1px solid var(--line); } .product-context > span:nth-child(4) { border-block-start:1px solid var(--line); } .product-verdict-grid,.product-verdict-constraint { grid-template-columns:1fr; gap:8px; } .direct-value { width:72px; } .product-diff-drawer { inset: auto 10px 10px; width:auto; max-height:calc(100vh - 100px); } }

/* Two mobile navigation levels: product switching in the header and workflow steps
   inside the active view. The former bottom card navigator duplicated that workflow. */
@media (max-width:760px) {
  .mobile-nav, .mobile-sheet { display:none; }
  body { padding-bottom:0; }
  .wrap { padding-bottom:36px; }
  .topbar .nav button, .topbar .nav > .nav-link { min-height:44px; }
  .mobile-workflow-tabs { top:108px; }
}
