:root {
  color-scheme: light;
  --ink: #22303a;
  --muted: #667580;
  --subtle: #87939d;
  --line: #dce4e2;
  --panel: #ffffff;
  --soft: #f5f7f5;
  --field: #f8faf9;
  --teal: #0c6d6b;
  --teal-2: #6fb7a8;
  --blue: #ff2f92;
  --clay: #d88c4a;
  --rose: #b96b60;
  --charcoal: #25323d;
  --green: #526a61;
  --shadow: 0 18px 40px rgba(34, 48, 58, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  color: var(--ink);
  background: #edf2f0;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.app-root {
  min-height: 100vh;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  background: #f7f9f8;
}

.login-visual {
  display: grid;
  place-items: center;
  padding: 56px;
  background: #d8d8d2;
}

.scan-plate {
  width: min(680px, 82vw);
  aspect-ratio: 1.28;
  position: relative;
  border: 1px solid rgba(37, 50, 61, 0.12);
  border-radius: 8px;
  background: #f8faf8;
  background-size: 34px 34px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.scan-grid {
  position: absolute;
  inset: 34px;
  border: 1px solid rgba(12, 109, 107, 0.14);
  border-radius: 8px;
}

.scan-foot {
  position: absolute;
  top: 18%;
  width: 22%;
  height: 64%;
  border-radius: 46% 48% 34% 36% / 18% 18% 50% 50%;
  background: rgba(255, 47, 146, 0.28);
  border: 1px solid rgba(37, 50, 61, 0.16);
  transform: rotate(5deg);
}

.scan-foot-left {
  left: 25%;
}

.scan-foot-right {
  right: 25%;
  transform: rotate(-5deg) scaleX(-1);
}

.login-panel {
  align-self: center;
  width: min(480px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 44px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-panel h1,
.topbar h1,
.dashboard-hero h2,
.panel h2,
.empty-state h2 {
  margin: 0;
  line-height: 1.08;
}

.login-panel h1 {
  font-size: clamp(2rem, 4vw, 4.25rem);
  max-width: 10ch;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 20px;
  background: #17222b;
  color: #f6faf8;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand-lockup {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 48px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #f6faf8;
  color: #17222b;
  font-weight: 800;
}

.brand-lockup span {
  display: block;
  color: #aab7b3;
  font-size: 0.86rem;
}

.nav-list,
.sidebar-footer,
.stack,
.row-list,
.mini-stack,
.control-list,
.recipe-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-list {
  overflow-y: auto;
  padding-right: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 10px;
  color: #dce8e4;
  background: transparent;
  text-align: left;
}

.nav-item span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 700;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-footer {
  margin-top: auto;
}

.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 88px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 18px 28px;
  background: rgba(247, 249, 248, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  font-size: clamp(1.35rem, 2vw, 2rem);
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.content {
  padding: 26px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 0.74rem;
  text-transform: uppercase;
  font-weight: 800;
}

.muted,
.muted-line {
  color: var(--muted);
  line-height: 1.55;
}

.muted-line {
  margin: 0;
  padding: 12px;
}

.subtle {
  color: var(--subtle);
  font-size: 0.82rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(34, 48, 58, 0.05);
  padding: 20px;
  min-width: 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 750;
  white-space: nowrap;
}

.button-icon {
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.78rem;
}

.button.primary {
  background: var(--teal);
  color: #ffffff;
}

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

.button.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.sidebar .button.ghost {
  color: #dce8e4;
  border-color: rgba(255, 255, 255, 0.55);
}

.button.full,
.full {
  width: 100%;
}

.context-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
}

.context-chip span,
.avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e2f0ec;
  color: #0c5654;
  font-size: 0.78rem;
  font-weight: 800;
  flex: none;
}

.context-chip em,
.customer-card em,
.template-card em,
.material-card em,
.select-card em,
.data-row em {
  color: var(--muted);
  font-size: 0.84rem;
  font-style: normal;
}

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

.metric-strip {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
}

.metric strong {
  display: block;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  color: var(--ink);
}

.metric span {
  color: var(--muted);
  font-size: 0.9rem;
}

.dashboard-hero {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  min-height: 200px;
  background: #ffffff;
}

.dashboard-hero h2 {
  max-width: 760px;
  font-size: clamp(1.8rem, 4vw, 4.25rem);
}

.hero-actions,
.export-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.status-band {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.status-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  text-align: left;
}

.status-summary em {
  margin-left: auto;
  font-style: normal;
  color: var(--muted);
}

.status-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--subtle);
  flex: none;
}

.status-dot.draft,
.status-dot.refurb-reprint-requested {
  background: var(--blue);
}

.status-dot.awaiting-approval,
.status-dot.review-required,
.status-dot.approved {
  background: var(--clay);
}

.status-dot.ready-for-export,
.status-dot.exported {
  background: var(--teal-2);
}

.status-dot.in-production {
  background: var(--teal);
}

.status-dot.completed {
  background: var(--green);
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.42fr);
  gap: 18px;
}

.two-column.wide-left {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
}

.profile-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.profile-summary {
  grid-column: 1 / -1;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar.large {
  width: 58px;
  height: 58px;
  font-size: 1rem;
}

.detail-grid,
.summary-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 0;
}

dt {
  color: var(--subtle);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

dd {
  margin: 4px 0 0;
  line-height: 1.45;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  padding: 9px 10px;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

.search {
  max-width: 260px;
}

.customer-grid,
.template-grid,
.material-grid,
.prescription-grid,
.sample-scan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.customer-grid.compact {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.customer-card,
.template-card,
.material-card,
.select-card,
.sample-scan,
.check-card,
.production-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 14px;
  text-align: left;
}

.customer-card p {
  color: var(--muted);
  min-height: 48px;
  line-height: 1.45;
}

.card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.select-card,
.template-card,
.material-card,
.sample-scan {
  display: grid;
  gap: 8px;
}

.select-card.active,
.template-card.active,
.material-card.active,
.sample-scan.active,
.zone-button.active,
.segmented button.active {
  border-color: var(--teal);
  box-shadow: inset 0 0 0 1px var(--teal);
  background: #f0f8f5;
}

.data-row {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) minmax(80px, 0.8fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 10px 12px;
  text-align: left;
}

.data-row span:last-child {
  color: var(--muted);
  font-size: 0.85rem;
}

.file-chip {
  min-width: 32px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #eef4f1;
  font-size: 0.75rem;
  font-weight: 800;
}

.workflow {
  display: grid;
  gap: 18px;
}

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

.workflow-steps button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-weight: 800;
}

.workflow-steps span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #eef4f1;
  color: var(--ink);
  flex: none;
}

.workflow-steps button.active {
  color: var(--ink);
  border-color: var(--teal);
}

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

.upload-grid .button {
  align-self: end;
}

.viewer-screen {
  display: grid;
  gap: 18px;
}

.viewer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: stretch;
}

.viewer-frame {
  position: relative;
  min-height: 560px;
  height: calc(100vh - 260px);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #f8faf8;
  box-shadow: var(--shadow);
}

.viewer-frame canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.toolbar-panel {
  padding: 12px;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(64px, max-content);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.segmented button {
  min-height: 36px;
  border: 0;
  border-right: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  padding: 7px 10px;
  font-weight: 800;
  text-transform: capitalize;
}

.segmented button:last-child {
  border-right: 0;
}

.toggle {
  display: flex;
  align-items: center;
  grid-template-columns: auto 1fr;
  gap: 8px;
  min-height: 36px;
  padding: 0 8px;
  color: var(--ink);
}

.toggle input {
  width: 18px;
  min-height: 18px;
}

.template-card {
  min-height: 230px;
}

.template-visual {
  height: 88px;
  border-radius: 8px;
  background: var(--accent);
  border: 1px solid rgba(37, 50, 61, 0.1);
}

.template-card span:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.template-card b {
  border-radius: 7px;
  background: #eef4f1;
  padding: 4px 7px;
  color: var(--green);
  font-size: 0.74rem;
}

.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
  align-items: start;
}

.editor-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.editor-panel {
  display: grid;
  gap: 12px;
  position: sticky;
  top: 108px;
}

.editor-viewer {
  height: calc(100vh - 262px);
  min-height: 590px;
}

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

.zone-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
}

.param-control {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.param-control span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.param-control em {
  color: var(--teal);
  font-style: normal;
  white-space: nowrap;
}

.param-control input[type="range"] {
  padding: 0;
  accent-color: var(--teal);
}

.param-control .number {
  max-width: 120px;
  margin-left: auto;
}

.check-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
}

.check-card input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
  accent-color: var(--teal);
}

.check-card span {
  display: grid;
  gap: 5px;
}

.check-card em {
  color: var(--muted);
  font-style: normal;
  line-height: 1.4;
}

.recipe-list div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.recipe-list span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.material-card span {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 1px solid rgba(37, 50, 61, 0.12);
}

.estimate-grid {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.export-panel {
  min-width: 0;
}

.recipe-preview {
  max-height: 540px;
  overflow: auto;
  margin: 18px 0 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #17222b;
  color: #e6f0ec;
  font-size: 0.82rem;
  line-height: 1.55;
}

.summary-card {
  display: grid;
  gap: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 7px;
  padding: 5px 9px;
  background: #eef4f1;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 800;
}

.production-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(260px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.status-column {
  min-height: calc(100vh - 170px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9f8;
}

.status-column-head {
  min-height: 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.status-column-head span {
  min-width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #ffffff;
  color: var(--muted);
  font-weight: 800;
}

.status-column-body {
  display: grid;
  gap: 10px;
  padding: 10px;
}

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

.production-card span {
  color: var(--muted);
}

.empty-state {
  min-height: 52vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  text-align: center;
}

.empty-state p {
  max-width: 520px;
  color: var(--muted);
}

@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .dashboard-grid,
  .profile-layout,
  .two-column,
  .two-column.wide-left,
  .viewer-layout,
  .editor-layout {
    grid-template-columns: 1fr;
  }

  .editor-panel {
    position: static;
  }

  .viewer-frame,
  .editor-viewer {
    height: 620px;
  }

  .status-band,
  .workflow-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .login-screen,
  .shell {
    grid-template-columns: 1fr;
  }

  .login-visual {
    min-height: 330px;
    padding: 24px;
  }

  .login-panel {
    margin: 24px auto;
    padding: 24px;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions,
  .hero-actions,
  .export-actions {
    width: 100%;
  }

  .topbar-actions .button,
  .hero-actions .button,
  .export-actions .button {
    flex: 1;
  }

  .content {
    padding: 16px;
  }

  .metric-strip,
  .status-band,
  .workflow-steps,
  .upload-grid,
  .detail-grid,
  .summary-list {
    grid-template-columns: 1fr;
  }

  .dashboard-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .data-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .data-row em,
  .data-row span:last-child {
    grid-column: 2;
  }

  .viewer-frame,
  .editor-viewer {
    min-height: 440px;
    height: 58vh;
  }

  .segmented {
    width: 100%;
    grid-auto-columns: 1fr;
  }

  .toolbar .button,
  .toolbar .toggle {
    flex: 1;
  }
}

/* BOUNCE retail studio restyle */
:root {
  --ink: #111111;
  --muted: #5f5f59;
  --subtle: #8a8a84;
  --line: rgba(17, 17, 17, 0.12);
  --panel: rgba(255, 255, 255, 0.88);
  --soft: #f7f7f4;
  --field: rgba(247, 247, 244, 0.9);
  --teal: #ff2f92;
  --teal-2: #b6ff00;
  --blue: #ff2f92;
  --clay: #ff6a00;
  --rose: #ff2f92;
  --charcoal: #111111;
  --green: #2a2a2a;
  --pink: #ff2f92;
  --acid: #b6ff00;
  --orange: #ff6a00;
  --cyan: #ff2f92;
  --violet: #8b5cff;
  --concrete-light: #d8d8d2;
  --concrete-mid: #9b9b95;
  --shadow: 0 22px 55px rgba(17, 17, 17, 0.12);
  --gloss: rgba(255, 255, 255, 0.92);
}

body {
  color: var(--ink);
  background: #f2f0ea;
}

body::before {
  content: none;
}

.brand-logo {
  display: block;
  width: 150px;
  height: auto;
  object-fit: contain;
}

.login-logo {
  width: min(320px, 74vw);
  margin-bottom: 28px;
}

.export-logo {
  width: 180px;
  margin-bottom: 16px;
}

.production-logo {
  width: 170px;
}

.login-screen {
  min-height: 100vh;
  grid-template-columns: minmax(0, 1.05fr) minmax(440px, 0.95fr);
  padding: clamp(20px, 4vw, 56px);
  background: #111111;
}

.login-visual {
  min-height: calc(100vh - clamp(20px, 4vw, 56px) * 2);
  display: block;
  padding: 0;
  overflow: hidden;
  background: #111111;
  border-radius: 8px 0 0 8px;
}

.login-hero-image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 720px;
  object-fit: cover;
  object-position: center center;
}

.login-copy {
  display: grid;
  place-items: center;
  padding: clamp(34px, 5vw, 92px);
  background: #f7f7f4;
  border-radius: 0 8px 8px 0;
}

.login-panel,
.panel,
.metric,
.status-summary,
.customer-card,
.template-card,
.material-card,
.select-card,
.sample-scan,
.check-card,
.production-card,
.data-row,
.toolbar-panel,
.status-column,
.context-chip {
  background: var(--gloss);
  border: 1px solid rgba(17, 17, 17, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 20px 55px rgba(17, 17, 17, 0.08);
}

.login-panel {
  border-radius: 8px;
  align-self: auto;
  width: auto;
  max-width: 480px;
  margin: 0;
  padding: clamp(30px, 3.2vw, 44px);
  position: relative;
  justify-self: stretch;
}

.login-panel::after,
.panel::after {
  content: none;
}

.panel,
.login-panel {
  position: relative;
}

.shell {
  background: transparent;
}

.sidebar {
  color: var(--ink);
  background: #ffffff;
  border-right: 1px solid rgba(17, 17, 17, 0.12);
  box-shadow: 18px 0 45px rgba(17, 17, 17, 0.08);
}

.sidebar::after {
  content: "";
  height: 92px;
  border-radius: 8px;
  background: #d8d8d2;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  order: 2;
}

.brand-lockup {
  min-height: 68px;
  align-items: flex-start;
}

.brand-lockup span {
  color: #111111;
  font-weight: 800;
  letter-spacing: 0;
}

.nav-list {
  gap: 8px;
}

.nav-item {
  color: #111111;
  border: 1px solid transparent;
  background: transparent;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.nav-item span {
  background: #111111;
  color: #ffffff;
}

.nav-item:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 30px rgba(17, 17, 17, 0.08);
}

.nav-item.active {
  color: #111111;
  background: #ffffff;
  border-color: #111111;
  box-shadow: 0 12px 35px rgba(255, 47, 146, 0.16);
}

.nav-item.active span {
  background: var(--acid);
  color: #111111;
}

.sidebar .button.ghost {
  color: #111111;
  border-color: rgba(17, 17, 17, 0.42);
  background: rgba(255, 255, 255, 0.6);
}

.topbar {
  background: rgba(255, 255, 255, 0.76);
  border-bottom: 1px solid rgba(17, 17, 17, 0.1);
  box-shadow: 0 10px 35px rgba(17, 17, 17, 0.06);
}

.topbar h1,
.login-panel h1,
.dashboard-hero h2,
.panel h2,
.empty-state h2 {
  color: #111111;
  font-weight: 850;
}

.login-panel h1 {
  font-size: clamp(3.1rem, 4.4vw, 4.9rem);
  max-width: 10ch;
}

.login-panel .muted {
  max-width: 40ch;
}

.eyebrow {
  color: #111111;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 8px;
  border-radius: 8px;
  background: var(--pink);
}

.muted,
.muted-line,
.context-chip em,
.customer-card em,
.template-card em,
.material-card em,
.select-card em,
.data-row em {
  color: var(--muted);
}

.button {
  border-radius: 8px;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover,
.template-card:hover,
.material-card:hover,
.customer-card:hover,
.select-card:hover,
.sample-scan:hover,
.data-row:hover,
.production-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 48px rgba(17, 17, 17, 0.12);
}

.button.primary {
  color: #ffffff;
  background: #111111;
  border-color: #111111;
  box-shadow: 0 12px 30px rgba(255, 47, 146, 0.22);
}

.button.primary .button-icon {
  background: var(--pink);
  color: #ffffff;
}

.button.primary:hover {
  box-shadow: 0 16px 42px rgba(255, 47, 146, 0.32);
}

.button.secondary {
  color: #111111;
  background: #ffffff;
  border-color: rgba(17, 17, 17, 0.24);
}

.button.secondary .button-icon {
  background: var(--acid);
  color: #111111;
}

.button.ghost {
  color: #111111;
  border-color: rgba(17, 17, 17, 0.22);
  background: rgba(255, 255, 255, 0.42);
}

input,
select,
textarea {
  border-color: rgba(17, 17, 17, 0.16);
  background: rgba(255, 255, 255, 0.76);
  color: #111111;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(255, 47, 146, 0.38);
  border-color: var(--pink);
}

.avatar,
.context-chip span {
  background: var(--acid);
  color: #111111;
}

.dashboard-hero {
  min-height: 250px;
  background: #ffffff;
  overflow: hidden;
}

.dashboard-hero > * {
  position: relative;
  z-index: 1;
}

.dashboard-hero::before {
  content: "";
  position: absolute;
  right: 22px;
  bottom: 20px;
  width: min(360px, 42%);
  height: 42px;
  border-radius: 8px;
  background: var(--cyan);
  opacity: 0.2;
  z-index: 0;
}

.metric {
  min-height: 112px;
}

.metric strong {
  color: #111111;
}

.metric span {
  color: #5f5f59;
  font-weight: 700;
}

.status-pill,
.template-card b,
.file-chip {
  border-radius: 8px;
  color: #111111;
  background: var(--acid);
}

.status-dot.draft,
.status-dot.refurb-reprint-requested {
  background: var(--cyan);
}

.status-dot.awaiting-approval,
.status-dot.review-required,
.status-dot.approved {
  background: var(--orange);
}

.status-dot.ready-for-export,
.status-dot.exported {
  background: var(--pink);
}

.status-dot.in-production {
  background: var(--acid);
}

.status-dot.completed {
  background: #111111;
}

.workflow-steps button {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(17, 17, 17, 0.12);
  color: #111111;
}

.workflow-steps button.active {
  border-color: #111111;
  box-shadow: 0 12px 28px rgba(255, 47, 146, 0.16);
}

.workflow-steps span {
  background: var(--acid);
  color: #111111;
}

.toolbar-panel {
  backdrop-filter: blur(18px);
}

.segmented {
  border-color: rgba(17, 17, 17, 0.18);
  background: #ffffff;
}

.segmented button {
  background: #ffffff;
  color: #111111;
}

.segmented button.active,
.select-card.active,
.template-card.active,
.material-card.active,
.sample-scan.active,
.zone-button.active {
  border-color: #111111;
  background: rgba(182, 255, 0, 0.22);
  box-shadow:
    inset 0 0 0 1px #111111,
    0 12px 34px rgba(255, 47, 146, 0.16);
}

.viewer-frame {
  min-height: 640px;
  background: #f2f0ea;
  border-color: rgba(17, 17, 17, 0.12);
  box-shadow: 0 26px 70px rgba(17, 17, 17, 0.14);
}

.viewer-watermark {
  position: absolute;
  right: 24px;
  top: 22px;
  width: min(220px, 24%);
  opacity: 0.055;
  pointer-events: none;
  z-index: 1;
}

.viewer-frame canvas {
  position: relative;
  z-index: 2;
}

.template-visual {
  background: var(--accent);
}

.material-card span {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.48),
    0 10px 24px rgba(17, 17, 17, 0.12);
}

.param-control {
  background: rgba(255, 255, 255, 0.78);
}

.param-control em {
  color: var(--pink);
}

.param-control input[type="range"] {
  accent-color: var(--pink);
}

.check-card:has(input:checked) {
  border-color: #111111;
  background: rgba(182, 255, 0, 0.22);
  box-shadow: 0 18px 40px rgba(255, 47, 146, 0.14);
}

.check-card input {
  accent-color: var(--pink);
}

.recipe-preview {
  background: #111111;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.18);
}

.production-brand-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.production-brand-strip span {
  color: #111111;
  font-weight: 800;
  text-align: right;
}

.status-column {
  background: #ffffff;
}

@media (max-width: 780px) {
  .brand-logo {
    width: 132px;
  }

  .login-screen {
    padding: 0;
    background: #f7f7f4;
  }

  .login-visual {
    min-height: 42vh;
    border-radius: 0;
  }

  .login-hero-image {
    height: 42vh;
    min-height: 330px;
  }

  .login-copy {
    padding: 24px;
    border-radius: 0;
  }

  .login-panel {
    width: min(520px, 100%);
    margin: 0 auto;
  }

  .login-panel h1 {
    font-size: clamp(2.55rem, 14vw, 4rem);
  }

  .sidebar::after {
    display: none;
  }

  .production-brand-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .production-brand-strip span {
    text-align: left;
  }
}

/* Responsive optimisation layer */
img,
canvas,
svg {
  max-width: 100%;
}

.data-row strong,
.data-row em,
.data-row span:last-child,
.context-chip strong,
.context-chip em {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
  .viewer-frame,
  .editor-viewer {
    min-height: 520px;
    height: min(68vh, 620px);
  }

  .editor-panel {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    align-items: start;
  }

  .production-board {
    grid-template-columns: repeat(4, minmax(250px, 1fr));
  }
}

@media (max-width: 980px) {
  .login-screen {
    grid-template-columns: 1fr;
    padding: 0;
    background: #f7f7f4;
  }

  .login-visual {
    min-height: 44vh;
    border-radius: 0;
  }

  .login-hero-image {
    height: 44vh;
    min-height: 390px;
  }

  .login-copy {
    padding: clamp(24px, 6vw, 48px);
    border-radius: 0;
  }

  .login-panel {
    width: min(560px, 100%);
    max-width: none;
    margin: 0 auto;
  }

  .login-panel h1 {
    max-width: 11ch;
  }
}

@media (max-width: 780px) {
  html,
  body {
    overflow-x: hidden;
  }

  .shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: auto;
    gap: 10px;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid rgba(17, 17, 17, 0.12);
  }

  .brand-lockup {
    min-height: 0;
    align-items: center;
  }

  .brand-lockup .brand-logo {
    width: 124px;
  }

  .nav-list {
    display: flex;
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 0 0 4px;
    scrollbar-width: none;
  }

  .nav-list::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    flex: 0 0 auto;
    width: auto;
    min-height: 38px;
    padding: 7px 10px;
    white-space: nowrap;
  }

  .nav-item span {
    width: 24px;
    height: 24px;
  }

  .sidebar-footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 0;
  }

  .sidebar-footer .button {
    width: 100%;
    min-width: 0;
    white-space: normal;
  }

  .workspace {
    display: block;
  }

  .topbar {
    padding: 14px 16px;
    min-height: 0;
  }

  .topbar h1 {
    font-size: clamp(1.55rem, 7vw, 2.25rem);
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    justify-content: stretch;
  }

  .context-chip {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: flex-start;
  }

  .topbar-actions .button,
  .hero-actions .button,
  .export-actions .button {
    width: 100%;
    min-width: 0;
    white-space: normal;
  }

  .content {
    padding: 14px;
  }

  .panel {
    padding: 16px;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .section-heading .button,
  .section-heading .search,
  .section-heading .status-pill {
    width: 100%;
    max-width: none;
  }

  .dashboard-grid,
  .profile-layout,
  .two-column,
  .two-column.wide-left,
  .viewer-layout,
  .editor-layout {
    grid-template-columns: 1fr;
  }

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

  .metric {
    min-height: 92px;
    padding: 14px;
  }

  .status-band {
    grid-template-columns: 1fr;
  }

  .dashboard-hero {
    min-height: 0;
    padding: 18px;
  }

  .dashboard-hero h2 {
    font-size: clamp(2rem, 10vw, 3.35rem);
  }

  .workflow-steps {
    display: flex;
    grid-template-columns: none;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .workflow-steps::-webkit-scrollbar {
    display: none;
  }

  .workflow-steps button {
    flex: 0 0 min(190px, 72vw);
    padding: 8px 10px;
    scroll-snap-align: start;
  }

  .upload-grid,
  .detail-grid,
  .summary-list {
    grid-template-columns: 1fr;
  }

  .customer-grid,
  .customer-grid.compact,
  .template-grid,
  .material-grid,
  .prescription-grid,
  .sample-scan-grid {
    grid-template-columns: 1fr;
  }

  .data-row {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
  }

  .data-row em,
  .data-row span:last-child {
    grid-column: 2;
  }

  .toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .segmented {
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    width: 100%;
  }

  .segmented button {
    min-width: 0;
    padding-inline: 6px;
  }

  .toolbar .button,
  .toolbar .toggle {
    width: 100%;
  }

  .viewer-frame,
  .editor-viewer {
    min-height: 360px;
    height: min(62vh, 520px);
  }

  .viewer-watermark {
    width: min(150px, 38%);
    right: 14px;
    top: 14px;
  }

  .editor-panel {
    display: grid;
    grid-template-columns: 1fr;
    position: static;
  }

  .zone-grid {
    grid-template-columns: 1fr;
  }

  .param-control span {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .param-control .number {
    max-width: none;
    margin-left: 0;
  }

  .export-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .recipe-preview {
    max-height: 380px;
    font-size: 0.76rem;
  }

  .production-board {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .status-column {
    min-height: auto;
  }
}

@media (max-width: 520px) {
  .login-visual {
    min-height: 38vh;
  }

  .login-hero-image {
    height: 38vh;
    min-height: 300px;
    object-position: center top;
  }

  .login-copy {
    padding: 18px;
  }

  .login-panel {
    padding: 22px;
  }

  .login-logo {
    width: min(240px, 78vw);
    margin-bottom: 18px;
  }

  .login-panel h1 {
    font-size: clamp(2.35rem, 12vw, 3.25rem);
  }

  .metric-strip {
    grid-template-columns: 1fr 1fr;
  }

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

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .viewer-frame,
  .editor-viewer {
    min-height: 330px;
    height: 56vh;
  }

  .production-brand-strip {
    padding: 14px;
  }
}

@media (max-width: 360px) {
  .topbar-actions {
    grid-template-columns: 1fr;
  }
}

@media (hover: none) {
  .button:hover,
  .template-card:hover,
  .material-card:hover,
  .customer-card:hover,
  .select-card:hover,
  .sample-scan:hover,
  .data-row:hover,
  .production-card:hover {
    transform: none;
  }
}

/* Black stage and no-blue accent pass */
:root {
  --soft: #111111;
  --blue: #ff2f92;
  --cyan: #ff2f92;
}

body,
.app-root,
.shell,
.workspace,
.content,
.login-screen,
.login-copy {
  background: #111111;
}

.topbar {
  background: #111111;
  border-bottom-color: rgba(255, 255, 255, 0.14);
  box-shadow: none;
}

.topbar h1,
.topbar .eyebrow {
  color: #ffffff;
}

.topbar .eyebrow::before {
  background: var(--pink);
}

.topbar-actions .button.primary {
  background: var(--pink);
  border-color: var(--pink);
  color: #ffffff;
  box-shadow: 0 14px 36px rgba(255, 47, 146, 0.34);
}

.topbar-actions .button.primary .button-icon {
  background: #111111;
  color: #ffffff;
}

.dashboard-hero::before {
  content: none;
  display: none;
}

.sidebar::after {
  content: none;
  display: none;
}

.brand-lockup {
  min-height: 88px;
  align-items: center;
}

.brand-lockup .sidebar-logo {
  width: min(220px, 100%);
}

.sidebar-footer {
  gap: 10px;
  padding-top: 10px;
}

.viewer-frame {
  background: #111111;
  border-color: rgba(255, 255, 255, 0.14);
}

.status-dot.draft,
.status-dot.refurb-reprint-requested {
  background: #111111;
}

@media (max-width: 780px) {
  .brand-lockup {
    min-height: 44px;
  }

  .brand-lockup .sidebar-logo {
    width: min(210px, 68vw);
  }
}

/* Login large-breakpoint refinement */
@media (min-width: 981px) {
  .login-screen {
    width: min(1960px, calc(100vw - 88px));
    min-height: min(1080px, calc(100vh - 88px));
    margin: 44px auto;
    padding: 0;
    grid-template-columns: minmax(0, 1.12fr) minmax(620px, 0.88fr);
    align-items: stretch;
    background: #111111;
    overflow: hidden;
  }

  .login-visual {
    min-height: 0;
    border-radius: 8px 0 0 8px;
  }

  .login-hero-image {
    height: 100%;
    min-height: 0;
    object-position: center center;
  }

  .login-copy {
    min-height: 100%;
    padding: clamp(48px, 4.4vw, 88px);
    background: #111111;
    border-radius: 0 8px 8px 0;
    justify-items: center;
  }

  .login-panel {
    width: min(620px, 100%);
    max-width: 620px;
    justify-self: center;
    padding: clamp(42px, 3.5vw, 62px);
  }

  .login-logo {
    width: min(360px, 100%);
    margin-bottom: 26px;
  }

  .login-panel h1 {
    max-width: 11ch;
    font-size: clamp(3.45rem, 3.45vw, 5.35rem);
  }
}

@media (min-width: 1600px) {
  .login-screen {
    grid-template-columns: minmax(0, 1.1fr) minmax(680px, 0.9fr);
  }

  .login-panel {
    width: min(660px, 100%);
    max-width: 660px;
  }
}

/* Full-bleed login hero */
.login-screen {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  width: 100%;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  overflow: hidden;
  background: #111111;
}

.login-visual {
  position: absolute;
  inset: 0;
  display: block;
  min-height: 100%;
  padding: 0;
  overflow: hidden;
  border-radius: 0;
  background: #111111;
  z-index: -2;
}

.login-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 17, 0.2);
  z-index: 1;
}

.login-hero-image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  object-fit: cover;
  object-position: center center;
}

.login-copy {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: clamp(24px, 5vw, 88px) clamp(22px, 7vw, 132px);
  background: transparent;
  border-radius: 0;
}

.login-panel {
  width: min(560px, 100%);
  max-width: 560px;
  margin: 0;
  justify-self: auto;
  padding: clamp(30px, 3.25vw, 52px);
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(255, 255, 255, 0.68);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 28px 76px rgba(0, 0, 0, 0.34);
}

.login-logo {
  width: min(330px, 100%);
  margin-bottom: 24px;
}

.login-panel h1 {
  max-width: 10.5ch;
  font-size: clamp(3rem, 3.55vw, 4.95rem);
}

@media (min-width: 1500px) {
  .login-panel {
    width: min(600px, 100%);
    max-width: 600px;
  }

  .login-panel h1 {
    font-size: clamp(3.5rem, 3.35vw, 5.4rem);
  }
}

@media (min-width: 981px) and (max-height: 820px) {
  .login-copy {
    padding: 28px clamp(42px, 7vw, 90px);
  }

  .login-panel {
    width: min(500px, 100%);
    max-width: 500px;
    padding: 30px 38px;
  }

  .login-logo {
    width: min(260px, 100%);
    margin-bottom: 16px;
  }

  .login-panel h1 {
    max-width: 12ch;
    font-size: clamp(2.8rem, 3.1vw, 3.75rem);
    line-height: 1.02;
  }

  .login-panel .muted {
    line-height: 1.42;
  }

  .login-panel .stack {
    gap: 8px;
  }

  .login-panel input,
  .login-panel select {
    min-height: 36px;
    padding-block: 7px;
  }

  .login-panel .button {
    min-height: 40px;
  }
}

@media (max-width: 980px) {
  .login-screen {
    min-height: 100vh;
  }

  .login-hero-image {
    object-position: center center;
  }

  .login-copy {
    align-items: flex-end;
    justify-content: center;
    padding: 24px;
  }

  .login-panel {
    width: min(560px, 100%);
  }
}

@media (max-width: 520px) {
  .login-hero-image {
    object-position: 46% center;
  }

  .login-visual::after {
    background: rgba(17, 17, 17, 0.34);
  }

  .login-copy {
    padding: 16px;
  }

  .login-panel {
    padding: 22px;
  }

  .login-logo {
    width: min(240px, 78vw);
    margin-bottom: 18px;
  }

  .login-panel h1 {
    font-size: clamp(2.3rem, 11.5vw, 3.2rem);
  }
}
