:root {
  color-scheme: light;
  --ink: #17202c;
  --muted: #66758f;
  --soft: #eef3f8;
  --surface: #ffffff;
  --surface-strong: #f7fafc;
  --line: #d5e0ee;
  --line-strong: #b9c8dc;
  --nav: #f8fbfd;
  --nav-ink: #243044;
  --viewer: #273343;
  --teal: #087e7a;
  --teal-soft: #daf0ec;
  --blue: #2f5fb8;
  --blue-soft: #dfe9ff;
  --green: #2e8052;
  --green-soft: #deefe5;
  --amber: #bd7118;
  --amber-soft: #f6e5c0;
  --red: #c7433f;
  --red-soft: #f8dfdd;
  --violet: #7259b7;
  --violet-soft: #eee7fb;
  --shadow: 0 14px 40px rgba(28, 42, 64, 0.08);
  --radius: 8px;
  --rail-width: 236px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--soft);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(8, 126, 122, 0.25);
  outline-offset: 2px;
}

.research-banner {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 7px 24px;
  color: #243044;
  background: #fff3d8;
  border-bottom: 1px solid #e7c572;
  font-size: 13px;
}

.research-banner strong {
  color: #7c4e00;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  min-height: calc(100svh - 34px);
}

.app-shell[data-active-view="mobile"] .stage-nav {
  display: none;
}

.nav-rail {
  position: sticky;
  top: 34px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: calc(100svh - 34px);
  padding: 20px 16px;
  background: var(--nav);
  border-right: 1px solid var(--line);
}

.brand-lockup {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 8px;
  color: var(--nav-ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  color: var(--teal);
  font-size: 16px;
  font-weight: 850;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.brand-logo {
  width: min(100%, 178px);
  height: auto;
  max-height: 58px;
  flex: 0 0 auto;
  object-fit: contain;
}

.brand-copy {
  display: grid;
  min-width: 0;
}

.brand-copy strong {
  font-size: 15px;
}

.brand-copy small {
  color: var(--muted);
  font-size: 12px;
}

.step-pocket,
.stage-menu,
.stage-nav,
.mobile-role-list {
  display: grid;
  gap: 8px;
}

.step-pocket {
  padding: 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.step-pocket span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.step-pocket strong {
  margin-top: 4px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.15;
}

.step-pocket small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.stage-menu summary,
.rail-reset {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 780;
  list-style: none;
}

.stage-menu summary::-webkit-details-marker {
  display: none;
}

.stage-menu[open] summary {
  color: var(--teal);
  border-color: rgba(8, 126, 122, 0.28);
  background: var(--teal-soft);
}

.mode-button,
.stage-link,
.role-chip,
.solid-action,
.ghost-action,
.case-card,
.role-card,
.phone-tab,
.decision-button,
.inline-action,
.accordion-button,
.mobile-action,
.rail-reset {
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.mode-button,
.stage-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 10px 11px;
  color: var(--muted);
  text-align: left;
  background: transparent;
}

.mode-button.is-active,
.stage-link.is-active,
.stage-link:hover,
.mode-button:hover {
  color: var(--teal);
  background: var(--teal-soft);
  border-color: rgba(8, 126, 122, 0.28);
}

.stage-link.is-done:not(.is-active) {
  color: var(--green);
  border-color: rgba(46, 128, 82, 0.25);
  background: rgba(222, 239, 229, 0.55);
}

.button-icon,
.stage-link span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  color: inherit;
  font-size: 11px;
  font-weight: 850;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 6px;
}

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

.main-surface {
  min-width: 0;
}

.app-view {
  display: none;
  padding: 24px;
}

.app-view.is-active {
  display: block;
}

.surface-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.surface-header h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.05;
}

.surface-header p {
  max-width: 900px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
}

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

.status-pill {
  display: inline-grid;
  place-items: center;
  min-height: 28px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 760;
}

.status-pill-blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.status-pill-amber {
  color: var(--amber);
  background: var(--amber-soft);
}

.solid-action,
.ghost-action,
.inline-action,
.decision-button,
.mobile-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 780;
  text-decoration: none;
}

.solid-action,
.decision-button.accept,
.mobile-action.primary {
  color: #ffffff;
  background: var(--teal);
  border-color: var(--teal);
}

.ghost-action,
.inline-action,
.decision-button.secondary,
.mobile-action.secondary {
  color: var(--ink);
  background: #ffffff;
}

.decision-button.warn,
.mobile-action.warn {
  color: #ffffff;
  background: var(--amber);
  border-color: var(--amber);
}

.decision-button.danger,
.mobile-action.danger {
  color: var(--red);
  background: #ffffff;
  border-color: var(--red);
}

.top-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.top-strip article {
  min-height: 76px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.top-strip span,
.metric-label,
.row-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 740;
}

.top-strip strong {
  display: block;
  margin-top: 5px;
  font-size: 25px;
}

.role-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.role-chip {
  min-height: 36px;
  padding: 0 12px;
  color: var(--muted);
  background: #ffffff;
}

.role-chip.is-active,
.role-chip:hover {
  color: var(--teal);
  border-color: rgba(8, 126, 122, 0.35);
  background: var(--teal-soft);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) minmax(250px, 320px);
  gap: 16px;
  align-items: start;
}

.case-panel,
.stage-panel,
.context-panel,
.mobile-brief,
.phone-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.case-panel,
.context-panel {
  padding: 18px;
}

.panel-heading h2,
.stage-heading h2,
.mobile-brief h2 {
  margin: 0;
  font-size: 22px;
}

.panel-heading p,
.stage-heading p,
.mobile-brief p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.case-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.case-card {
  display: grid;
  gap: 10px;
  width: 100%;
  min-height: 112px;
  padding: 14px;
  color: var(--ink);
  text-align: left;
  background: #ffffff;
}

.case-card.is-active,
.case-card:hover {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.case-card-top,
.case-meta-line,
.package-row,
.qa-row,
.manifest-row,
.timeline-row,
.phone-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.case-card strong {
  font-size: 16px;
}

.case-card-top strong {
  white-space: nowrap;
}

.case-card small {
  color: var(--muted);
  font-size: 12px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 780;
  white-space: nowrap;
}

.chip-ready,
.chip-pass {
  color: var(--green);
  background: var(--green-soft);
}

.chip-warning,
.chip-draft {
  color: var(--amber);
  background: var(--amber-soft);
}

.chip-blocked,
.chip-fail {
  color: var(--red);
  background: var(--red-soft);
}

.chip-review,
.chip-candidate {
  color: var(--blue);
  background: var(--blue-soft);
}

.chip-package {
  color: var(--violet);
  background: var(--violet-soft);
}

.stage-panel {
  overflow: hidden;
  max-width: 1120px;
}

.stage-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 16px;
  border-bottom: 1px solid var(--line);
}

.stage-kicker {
  margin: 0 0 5px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 820;
}

.case-id-chip {
  align-self: flex-start;
  padding: 7px 10px;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 820;
  white-space: nowrap;
}

.stage-content {
  padding: 22px;
}

.single-screen-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(260px, 0.92fr);
  gap: 16px;
}

.stage-split {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(230px, 0.8fr);
  gap: 16px;
}

.stage-card,
.evidence-card,
.warning-card,
.binder-card,
.release-gate,
.mobile-card {
  padding: 18px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stage-card h3,
.evidence-card h3,
.warning-card h3,
.binder-card h3,
.release-gate h3,
.mobile-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.stage-card p,
.evidence-card p,
.warning-card p,
.binder-card p,
.release-gate p,
.mobile-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.command-table,
.evidence-list,
.qa-list,
.package-list,
.manifest-table,
.notification-list,
.mobile-list {
  display: grid;
  gap: 10px;
}

.command-row,
.evidence-row,
.qa-row,
.package-row,
.manifest-row,
.notification-row,
.mobile-list-row {
  min-height: 58px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.command-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
}

.command-row.is-selected {
  border-color: rgba(8, 126, 122, 0.45);
  box-shadow: inset 3px 0 0 var(--teal);
}

.command-row strong,
.evidence-row strong,
.qa-row strong,
.package-row strong,
.manifest-row strong,
.mobile-list-row strong {
  display: block;
  font-size: 14px;
}

.command-row small,
.evidence-row small,
.qa-row small,
.package-row small,
.manifest-row small,
.mobile-list-row small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.implant-viewport {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  background: var(--viewer);
  border-radius: var(--radius);
}

.implant-viewport::before,
.implant-viewport::after {
  content: "";
  position: absolute;
  border: 2px solid rgba(200, 220, 238, 0.75);
  border-radius: 50%;
}

.implant-viewport::before {
  width: 230px;
  height: 230px;
  left: calc(50% - 115px);
  top: 56px;
}

.implant-viewport::after {
  width: 138px;
  height: 138px;
  left: calc(50% - 69px);
  top: 102px;
  opacity: 0.8;
}

.viewport-lines span {
  position: absolute;
  left: 56px;
  right: 56px;
  height: 1px;
  background: rgba(208, 224, 237, 0.12);
}

.viewport-lines span:nth-child(1) {
  top: 72px;
}

.viewport-lines span:nth-child(2) {
  top: 128px;
}

.viewport-lines span:nth-child(3) {
  top: 184px;
}

.viewport-lines span:nth-child(4) {
  top: 240px;
}

.implant-patch {
  position: absolute;
  left: calc(50% + 48px);
  top: 142px;
  width: 86px;
  height: 64px;
  border: 4px solid #e7ac37;
  border-radius: 48% 52% 44% 56%;
  background: #d7f5ed;
  box-shadow: inset 0 0 0 2px var(--teal);
}

.implant-patch span {
  position: absolute;
  width: 7px;
  height: 7px;
  background: #334151;
  border-radius: 50%;
}

.implant-patch span:nth-child(1) {
  left: 22px;
  top: 16px;
}

.implant-patch span:nth-child(2) {
  right: 20px;
  top: 31px;
}

.implant-patch span:nth-child(3) {
  left: 38px;
  bottom: 12px;
}

.viewport-chip {
  position: absolute;
  top: 20px;
  min-height: 28px;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.viewport-chip.left {
  left: 22px;
}

.viewport-chip.right {
  left: 142px;
}

.decision-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, auto);
  gap: 16px;
  align-items: center;
  margin-top: 16px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.decision-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.decision-bar span strong,
.decision-bar span small {
  display: block;
}

.decision-bar span small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.4;
}

.progress-stack {
  display: grid;
  gap: 18px;
}

.progress-row {
  display: grid;
  gap: 8px;
}

.progress-row header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  font-weight: 780;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  background: #edf2f6;
  border-radius: 999px;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.progress-track .green {
  background: var(--green);
}

.progress-track .blue {
  background: var(--blue);
}

.progress-track .amber {
  background: var(--amber);
}

.progress-track .violet {
  background: var(--violet);
}

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

.parameter-grid div {
  min-height: 74px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.parameter-grid span,
.field-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.parameter-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.35;
}

.panel-note {
  margin-top: 4px !important;
}

.field-label {
  margin-bottom: 8px;
}

.run-log {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding: 12px;
  color: #314055;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
}

.queue-toggle {
  margin-top: 14px;
}

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

.trace-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.trace-row strong,
.trace-row small {
  display: block;
}

.trace-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.context-panel {
  position: sticky;
  top: 58px;
}

.context-stack {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-row {
  align-items: flex-start;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--teal);
}

.timeline-copy {
  flex: 1;
  min-width: 0;
}

.timeline-copy strong {
  display: block;
  font-size: 13px;
}

.timeline-copy small {
  color: var(--muted);
}

.accordion-list {
  display: grid;
  gap: 10px;
}

.accordion-item {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.accordion-button {
  display: flex;
  justify-content: space-between;
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  color: var(--ink);
  background: #ffffff;
  border: 0;
  border-radius: 0;
  font-weight: 800;
}

.accordion-panel {
  display: none;
  padding: 14px;
  color: var(--muted);
  background: var(--surface-strong);
  border-top: 1px solid var(--line);
}

.accordion-item.is-open .accordion-panel {
  display: block;
}

.mobile-layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(320px, 430px);
  gap: 28px;
  align-items: start;
  min-width: 0;
}

.mobile-layout > * {
  min-width: 0;
}

.mobile-brief {
  padding: 22px;
}

.role-card {
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 78px;
  padding: 14px;
  color: var(--ink);
  text-align: left;
  background: #ffffff;
}

.role-card span {
  color: var(--muted);
  font-size: 13px;
}

.role-card.is-active,
.role-card:hover {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.phone-shell {
  width: 100%;
  max-width: 430px;
  min-height: 760px;
  min-width: 0;
  justify-self: center;
  padding: 16px;
  border-radius: 30px;
}

.phone-status {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 28px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 800;
}

.phone-status span:last-child {
  text-align: right;
  color: var(--teal);
}

.phone-camera {
  width: 28px;
  height: 9px;
  background: #101827;
  border-radius: 999px;
}

.phone-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 10px;
  min-width: 0;
  scrollbar-width: none;
}

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

.phone-tab {
  min-height: 34px;
  padding: 0 10px;
  color: var(--muted);
  background: #ffffff;
  white-space: nowrap;
}

.phone-tab.is-active,
.phone-tab:hover {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: rgba(47, 95, 184, 0.28);
}

.phone-content {
  display: grid;
  gap: 14px;
  padding-top: 4px;
  min-width: 0;
}

.phone-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.phone-title-row h2 {
  margin: 0;
  font-size: 25px;
  line-height: 1.1;
}

.mobile-viewport {
  min-height: 162px;
}

.mobile-viewport.implant-viewport::before {
  width: 122px;
  height: 122px;
  left: calc(50% - 61px);
  top: 25px;
}

.mobile-viewport.implant-viewport::after {
  width: 78px;
  height: 78px;
  left: calc(50% - 39px);
  top: 48px;
}

.mobile-viewport .implant-patch {
  left: calc(50% + 22px);
  top: 64px;
  width: 53px;
  height: 40px;
  border-width: 3px;
}

.mobile-viewport .implant-patch span {
  width: 4px;
  height: 4px;
}

.mobile-viewport .viewport-chip {
  top: 14px;
  min-height: 24px;
  padding: 5px 10px;
}

.mobile-viewport .viewport-chip.right {
  left: 122px;
}

.mobile-decision {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mobile-decision .mobile-action {
  width: 100%;
}

.comment-box {
  width: 100%;
  min-height: 102px;
  resize: vertical;
  padding: 12px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.safe-ack {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: #fff7e8;
  border: 1px solid #efc77c;
  border-radius: var(--radius);
  color: #6d4b10;
  font-size: 13px;
  line-height: 1.35;
}

.safe-ack input {
  margin-top: 2px;
}

.toast {
  min-height: 34px;
  padding: 9px 11px;
  color: var(--green);
  background: var(--green-soft);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 760;
}

.hidden {
  display: none !important;
}

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

  .nav-rail {
    position: relative;
    top: 0;
    height: auto;
  }

  .stage-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .workspace-grid {
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  }

  .context-panel {
    position: static;
    grid-column: 1 / -1;
  }
}

@media (max-width: 1500px) {
  .stage-split {
    grid-template-columns: 1fr;
  }

  .single-screen-grid {
    grid-template-columns: 1fr;
  }

  .decision-bar {
    grid-template-columns: 1fr;
  }

  .decision-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 900px) {
  .surface-header,
  .decision-bar,
  .stage-split,
  .single-screen-grid {
    grid-template-columns: 1fr;
  }

  .surface-header {
    flex-direction: column;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .top-strip,
  .workspace-grid,
  .mobile-layout {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .phone-shell {
    margin: 0 auto;
  }
}

@media (max-width: 760px) {
  .research-banner {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
    padding: 8px 14px;
  }

  .app-view {
    padding: 14px;
  }

  .nav-rail {
    padding: 14px;
  }

  .app-shell[data-active-view="mobile"] .mode-switch {
    grid-template-columns: 1fr 1fr;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  .stage-nav {
    grid-template-columns: 1fr;
  }

  .surface-header h1 {
    font-size: 30px;
  }

  .top-strip {
    gap: 8px;
  }

  .stage-heading,
  .case-card-top,
  .command-row,
  .package-row,
  .qa-row,
  .manifest-row,
  .trace-row {
    align-items: flex-start;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

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

  .stage-heading {
    display: grid;
  }

  .decision-actions,
  .mobile-decision {
    display: grid;
    grid-template-columns: 1fr;
  }

  .implant-viewport {
    min-height: 280px;
  }

  .implant-viewport::before {
    width: 174px;
    height: 174px;
    left: calc(50% - 87px);
    top: 48px;
  }

  .implant-viewport::after {
    width: 106px;
    height: 106px;
    left: calc(50% - 53px);
    top: 82px;
  }

  .implant-patch {
    left: calc(50% + 30px);
    top: 121px;
    width: 68px;
    height: 50px;
  }

  .phone-shell {
    min-height: 690px;
    border-radius: 22px;
  }
}
