/* NexyCell product refinement — restrained battery-engineering UI.
   Loaded after page-local styles so every surface shares one interaction language. */
:root {
  --ui-radius-control: 8px;
  --ui-radius-panel: 12px;
  --ui-radius-dialog: 14px;
  --ui-shadow-raised: 0 12px 34px color-mix(in srgb, var(--shadow-color) 58%, transparent);
  --ui-shadow-dialog: 0 28px 80px color-mix(in srgb, var(--shadow-color) 82%, transparent);
  --ui-duration: 140ms;
}

html { text-rendering: optimizeLegibility; }
body { letter-spacing: -.006em; background-image: none; }

.ic,
.ui-glyph .ic {
  display: inline-block;
  width: 1.08em;
  height: 1.08em;
  flex: 0 0 auto;
  vertical-align: -.16em;
}

/* Top navigation icons must not inherit the compact monospace counter size from `.n`.
   Keep the icon footprint fixed so a crowded desktop header cannot make the mark vanish. */
.nav button .ic-slot {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}
.nav button .ic-slot .ic {
  width: 17px;
  height: 17px;
}

.ui-glyph {
  display: inline-grid;
  width: 1.18em;
  height: 1.18em;
  place-items: center;
  flex: 0 0 auto;
  color: currentColor;
}

:where(button, .btn, [role="button"], a) {
  transition-duration: var(--ui-duration);
  transition-property: color, background-color, border-color, box-shadow, opacity;
}

:where(button, .btn):not(:disabled):hover { transform: none; }

:where(.btn, button, input, select, textarea) { border-radius: var(--ui-radius-control); }

:where(.card, .panel, .role-card, .cap-card, .preset-card, .flowstep,
  .admin-rail, .admin-context, .admin-overview-stat, .workspace-truth,
  .workspace-workflow, .workspace-advanced, .private-page .hero,
  .private-page .auth-card, .manual-section) {
  border-radius: var(--ui-radius-panel);
}

/* Flat controls communicate hierarchy more clearly than a gradient on every action. */
:where(.btn.primary, button.primary, .private-page button:not(.quiet):not(.danger):not([data-auth]):not([data-scroll]),
  .workspace-topbar ~ main form > button:not(.quiet)) {
  background-image: none;
  box-shadow: none;
}

:where(.pill, .chip, .badge, .status, .decision, .admin-pill,
  .admin-payment-pill, .admin-commercial-pill, .admin-renewal,
  .workspace-boundary, .workspace-truth-chip, .battery-status,
  .bipc-status, .rdip-status, .enterprise-ai__badge) {
  border-radius: 6px;
}

/* One compact switch: visible state, no simulated glass or inset hardware. */
.ptog::after {
  width: 40px;
  height: 22px;
  flex-basis: 40px;
  border: 1px solid var(--line2);
  background:
    radial-gradient(circle at 8px 50%, var(--txt2) 0 6px, transparent 6.5px),
    var(--field-surface);
  box-shadow: none;
}

.ptog.on::after,
.ptog[aria-checked="true"]::after {
  background:
    radial-gradient(circle at calc(100% - 8px) 50%, #fff 0 6px, transparent 6.5px),
    var(--acc);
}

.theme-toggle,
#theme-btn {
  border-radius: var(--ui-radius-control);
  box-shadow: none;
}

/* Main product: remove generic AI-dashboard effects while retaining data affordances. */
.topbar {
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--line) 82%, transparent);
}

.hero h1 .grad-text {
  background: none;
  color: var(--txt);
  -webkit-text-fill-color: currentColor;
}

.hero::before { display: none; }

.hero-demo,
.role-card,
.hero-copilot,
.cell-section-card,
.tech-network-card,
.ternary-card,
.crystal-card,
.private-page .auth-card,
.private-page .panel,
.private-page .hero,
.admin-overview-stat {
  background-image: none;
  background-color: var(--panel);
}

.cell-section-card::before,
.tech-network-card::before,
.ternary-card::before,
.crystal-card::before { opacity: .34; }

.card {
  background-image: none;
  box-shadow: none;
}

.card:hover,
.role-card:hover,
.preset-card:hover,
.cap-card:hover,
.hero-demo:hover,
.admin-overview-stat:hover,
.admin-overview-stat:focus-visible {
  transform: none;
  box-shadow: none;
}

.hero-demo {
  border-color: var(--line);
  background-color: var(--panel2);
}

.hero-demo-head .hd-dot,
.viz-mode-badge::before,
.admin-state-dot { animation: none; box-shadow: none; }

.hero-demo-hint { animation: none; }

.role-card { background-color: transparent; }
.role-card:hover { background-color: var(--panel2); }

.hero-copilot {
  border-left: 3px solid var(--acc);
  background-color: var(--panel2);
}

.hero-copilot .copilot-row input,
.copilot-row input { animation: none; }

.hero-copilot .copilot-row input:focus,
.copilot-row input:focus {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 18%, transparent);
}

.ai-fab {
  border: 1px solid var(--line2);
  background: var(--panel);
  color: var(--txt);
  box-shadow: var(--ui-shadow-raised);
}

.ai-fab:hover { border-color: var(--acc); filter: none; }
.ai-panel { box-shadow: var(--ui-shadow-dialog); }

.flowstep,
.cap-card,
.preset-card { background-image: none; }

.flowstep:hover,
.cap-card:hover,
.preset-card:hover { background-color: var(--panel2); }

.position-proof b,
.layer-no,
.hero-eyebrow,
.kicker,
.eyebrow,
.workspace-section-kicker,
.admin-context-label,
.admin-nav-group {
  letter-spacing: .09em;
}

#view-overview > .hero { padding-block: clamp(28px, 5vw, 64px); }
#view-overview > :where(.role-start, .home-disclosure, #about, #plans, .cta-band) { max-width: 1240px; margin-inline: auto; }
.home-disclosure { box-shadow: none; }
.home-disclosure-summary { min-height: 76px; }
.home-disclosure-mark { font-family: inherit; font-style: normal; }

body:has(#view-overview.active) .topbar .right > :is(
  #undo-btn,
  #redo-btn,
  .top-actions,
  #gallery-btn,
  #csv-btn,
  #compare-btn,
  #share-btn,
  #pro-btn,
  #status-pill
) { display: none; }

body:has(#view-overview.active) :is(.pro-launcher, #ai-fab) { display: none; }
body:has(#view-overview.active) .topbar .right > :is(#command-palette-open, #job-center-toggle) { display: none; }

/* Product architecture stays primary on every public view. Workspace and the commercial
   contact action are visually separated at the right edge instead of competing with it. */
.topbar-workspace-link {
  min-height: 36px;
  border: 1px solid var(--line2);
  background: color-mix(in srgb, var(--panel) 78%, transparent);
}
.topbar-workspace-link:hover { border-color: color-mix(in srgb, var(--acc) 48%, var(--line2)); }
.topbar-contact-cta {
  min-height: 36px;
  padding: 7px 13px;
  border: 1px solid var(--acc);
  border-radius: 9px;
  background: var(--acc);
  color: #04120e;
  font-size: 12.5px;
  font-weight: 750;
  white-space: nowrap;
}
.topbar-contact-cta:hover { filter: brightness(1.06); }
.topbar-contact-cta:focus-visible,
.topbar-workspace-link:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

@media (max-width: 760px) {
  .topbar-workspace-link,
  .topbar-contact-cta { min-width: 44px; min-height: 44px; justify-content: center; }
}
button.role-card { width: 100%; appearance: none; }

.pilot-gates input[type="checkbox"] {
  position: relative;
  width: 44px;
  height: 44px;
  margin: -12px -8px -12px -12px;
  appearance: none;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.pilot-gates input[type="checkbox"]::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 12px;
  width: 18px;
  height: 18px;
  border: 1px solid var(--line2);
  border-radius: 4px;
  background: var(--field-surface);
}

.pilot-gates input[type="checkbox"]:checked::before {
  border-color: var(--acc);
  background: var(--acc);
}

.pilot-gates input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 17px;
  top: 16px;
  width: 7px;
  height: 4px;
  border: solid color-mix(in srgb, #000 78%, var(--acc));
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg);
}

.pilot-gates input[type="checkbox"]:focus-visible {
  outline-offset: -9px;
}

/* Data visualizations remain the visual emphasis, not their surrounding chrome. */
.cell-exploded-svg,
.cell-section-svg,
.process-sankey-svg,
.tech-network-svg { filter: none; }

.viz-detail {
  background: var(--panel2);
  border-color: var(--line);
  border-left-color: var(--acc);
}

.viz-tool { background: var(--panel2); }

/* Workspace: keep the three-pane workflow, increase legibility and lower chip noise. */
.workspace-truth { gap: 7px; min-height: 44px; padding: 7px 10px; }
.workspace-truth-chip { padding: 5px 8px; background: transparent; border: 1px solid var(--line); }
.workspace-truth-chip small { font-size: 10px; }
.workspace-truth-chip b { font-size: 11px; }

.workspace-workflow > button strong { font-size: 12px; }
.workspace-workflow > button small {
  max-width: 180px;
  overflow: visible;
  font-size: 11px;
  text-overflow: clip;
  white-space: normal;
}

.workspace-next b { font-size: 10px; }
.workspace-next small { font-size: 11px; }
.workspace-editor label > span,
.workspace-empty > small,
.workspace-onboarding p { font-size: 12px; }
.workspace-onboarding li b { font-size: 11px; }
.workspace-onboarding li small { font-size: 10px; }
.workspace-inspector-tabs button { font-size: 11px; }
.workspace-inspector .ev-row,
.workspace-inspector .link-row,
.workspace-inspector .monitor-row { font-size: 12px; }

.workspace-refinement-fold { margin-top: 14px; }
.workspace-refinement-fold > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--ui-radius-panel);
  background: var(--panel);
  color: var(--txt);
  cursor: pointer;
  list-style: none;
}
.workspace-refinement-fold > summary::-webkit-details-marker { display: none; }
.workspace-refinement-fold > summary::after { content: "+"; color: var(--acc); font-size: 18px; }
.workspace-refinement-fold[open] > summary::after { content: "−"; }
.workspace-refinement-fold > .panel { margin-top: 8px; }

/* Admin: record navigation turns the long commercial drawer into task-sized sections. */
.admin-record-nav {
  position: sticky;
  top: -20px;
  z-index: 3;
  display: flex;
  gap: 4px;
  margin: -6px 0 16px;
  padding: 8px 0;
  overflow-x: auto;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.admin-record-nav button {
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--txt2);
  white-space: nowrap;
}

.admin-record-nav button:hover,
.admin-record-nav button[aria-current="true"] {
  border-color: var(--line2);
  background: var(--panel2);
  color: var(--txt);
}

.admin-record-section { scroll-margin-top: 66px; }
.admin-modal { box-shadow: var(--ui-shadow-dialog); }
.admin-overview-stat { background-color: var(--panel); }
.admin-overview-stat span,
.admin-section-heading p,
.admin-queue-copy small,
.admin-customer-facts small { font-size: 11px; }
.admin-context-chip,
.admin-fit-pill { font-size: 11px; }

/* Private Server: an operational workspace, not a cyber-security landing page. */
.private-page { background-image: none; }
.private-page .topbar { backdrop-filter: blur(12px); }
.private-page button:not(.quiet):not(.danger):not([data-auth]):not([data-scroll]) {
  background: var(--acc);
  color: color-mix(in srgb, #000 84%, var(--acc));
}
.private-page [hidden] { display: none !important; }
.private-page .auth-card,
.private-page .panel,
.private-page .hero { box-shadow: none; }
.private-page .workflow {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  backdrop-filter: blur(12px);
}
.private-page .workflow button {
  min-height: 48px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--txt2);
}
.private-page .workflow button:hover,
.private-page .workflow button[aria-current="true"] {
  border-color: var(--line);
  background: var(--panel2);
  color: var(--txt);
}
.private-page .kicker { font-size: 12px; }
.private-page .status,
.private-page .count { border-radius: 6px; }

/* Manual: use the product tokens while preserving a document-first reading surface. */
.manual-page .manual-section { box-shadow: none; }
.manual-page .hero { background-image: none; border-left: 3px solid var(--acc); }
.manual-page .role { border-radius: var(--ui-radius-control); }
.manual-page .cards article { border-radius: var(--ui-radius-control); }
.manual-page .callout { border-radius: 6px; }

@media (max-width: 900px) {
  .admin-record-nav { top: -16px; }
  .private-page .workflow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  #view-overview > .hero { padding-block: 24px; }
  .role-grid { grid-template-columns: 1fr; }
  .role-card small { min-height: 0; }
  .workspace-workflow > button small { max-width: 150px; }
  .admin-record-nav { margin-inline: -2px; }
}

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