:root {
  color-scheme: light;
  --bg: #eef2f5;
  --surface: #ffffff;
  --surface-soft: #f6f8fa;
  --surface-tint: #eef7f4;
  --ink: #17212b;
  --ink-soft: #33414d;
  --muted: #667684;
  --line: #d8e0e6;
  --line-strong: #c2ccd4;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --blue: #2563eb;
  --amber: #b45309;
  --red: #b42318;
  --green-bg: #dff4ed;
  --blue-bg: #e3edff;
  --amber-bg: #fff2d6;
  --red-bg: #fde5e2;
  --shadow: 0 18px 48px rgba(24, 39, 51, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #f8fafb 0, rgba(248, 250, 251, 0) 280px),
    var(--bg);
  color: var(--ink);
}

h1,
h2,
h3,
p,
ol,
ul {
  margin: 0;
}

h1 {
  font-size: 25px;
  font-weight: 780;
  line-height: 1.16;
  overflow-wrap: break-word;
}

h2 {
  font-size: 18px;
  font-weight: 760;
  line-height: 1.24;
  overflow-wrap: break-word;
}

h3 {
  font-size: 15px;
  font-weight: 760;
  line-height: 1.32;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 78px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.brand-lockup > div {
  min-width: 0;
}

.brand-mark {
  display: inline-grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: #102a43;
  color: #ffffff;
  font-size: 14px;
  font-weight: 820;
}

.eyebrow {
  margin-bottom: 5px;
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 790;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

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

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 720;
  padding: 7px 10px;
  text-decoration: none;
}

.nav-link:hover {
  border-color: var(--line);
  background: #f3f6f8;
}

.nav-link.active {
  border-color: #b7dcd4;
  background: var(--surface-tint);
  color: var(--teal-dark);
}

.page {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.summary-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.summary-band h2 {
  max-width: 760px;
  color: var(--ink);
}

.summary-band > div {
  min-width: 0;
}

.summary-rail {
  display: grid;
  grid-template-columns: repeat(4, minmax(72px, 1fr));
  gap: 8px;
  min-width: min(420px, 100%);
}

.summary-rail span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid #c9d6de;
  border-radius: 7px;
  background: #f8fafb;
  color: #33414d;
  font-size: 13px;
  font-weight: 740;
}

.authoring-grid,
.runtime-grid {
  display: grid;
  grid-template-columns: minmax(330px, 430px) minmax(420px, 1fr) minmax(330px, 440px);
  gap: 16px;
  align-items: start;
}

.product-authoring-grid {
  grid-template-columns: minmax(270px, 330px) minmax(340px, 430px) minmax(520px, 1fr);
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.capture-panel,
.review-panel,
.artifact-panel,
.sku-panel,
.job-panel,
.technician-panel,
.audit-panel {
  padding: 18px;
}

.product-authoring-grid .artifact-panel {
  grid-column: 1 / -1;
  position: static;
}

.artifact-panel,
.audit-panel {
  position: sticky;
  top: 16px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.stack {
  display: grid;
  gap: 13px;
}

.identity-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.identity-card label:last-child {
  grid-column: 1 / -1;
}

.identity-card.compact {
  grid-template-columns: 1fr;
}

label,
.field-block {
  display: grid;
  gap: 7px;
  color: #35424d;
  font-size: 12px;
  font-weight: 720;
}

.field-block > span {
  color: #35424d;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd5dc;
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  padding: 11px 12px;
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease,
    background 120ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.22);
  outline: 0;
}

textarea {
  line-height: 1.46;
  min-height: 112px;
  resize: vertical;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  padding: 0;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  color: #35424d;
  font-size: 14px;
  font-weight: 680;
}

button {
  border: 0;
  border-radius: 7px;
  background: var(--teal);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 780;
  min-height: 42px;
  padding: 10px 14px;
  white-space: normal;
}

button:hover {
  background: var(--teal-dark);
}

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

button.secondary {
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--ink-soft);
}

button.secondary:hover {
  background: #f3f6f8;
}

button.warning {
  background: var(--amber);
}

button.warning:hover {
  background: #92400e;
}

.capture-helper,
.artifact-note {
  display: grid;
  gap: 5px;
  margin-bottom: 2px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.workspace-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0;
}

.workspace-summary div {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  padding: 12px;
}

.workspace-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.workspace-summary strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

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

.upload-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.upload-head div {
  display: grid;
  gap: 3px;
}

.upload-head strong {
  color: var(--ink);
  font-size: 14px;
}

.upload-head span {
  color: var(--muted);
  font-size: 12px;
}

.upload-head select {
  max-width: 170px;
}

.compact-field textarea {
  min-height: 72px;
}

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

.asset-card,
.asset-empty {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 9px;
}

.asset-empty {
  min-height: 92px;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

.asset-card img,
.asset-card video {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  background: #e8eef1;
  object-fit: cover;
}

.asset-card audio {
  width: 100%;
}

.asset-card strong,
.asset-card span {
  overflow-wrap: anywhere;
}

.asset-card strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
}

.asset-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.asset-badge {
  display: grid;
  min-height: 96px;
  place-items: center;
  border-radius: 6px;
  background: var(--blue-bg);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

.workflow-editor {
  display: grid;
  gap: 12px;
  padding: 0;
  list-style: none;
}

.editor-step {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid #94a3b8;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.editor-step.medium {
  border-left-color: var(--teal);
}

.editor-step.high {
  border-left-color: var(--amber);
}

.step-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.step-order {
  display: inline-grid;
  width: 38px;
  height: 30px;
  place-items: center;
  border-radius: 7px;
  background: #e8eef1;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 820;
}

.tiny-button {
  min-height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink-soft);
  font-size: 12px;
  padding: 5px 9px;
}

.tiny-button:hover {
  background: #f3f6f8;
}

.tiny-button.danger {
  border-color: #efc4bd;
  color: var(--red);
}

.step-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.capture-helper strong,
.artifact-note strong {
  color: var(--ink);
  font-size: 13px;
}

.capture-helper p,
.artifact-note p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.empty {
  display: grid;
  gap: 8px;
  min-height: 320px;
  place-items: center;
  align-content: center;
  border: 1px dashed #b7c4ce;
  border-radius: 8px;
  background: #fafcfd;
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

.empty strong {
  color: var(--ink);
  font-size: 17px;
}

.empty span {
  max-width: 420px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

.doc-card,
.technician-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.doc-icon,
.step-number {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: var(--blue-bg);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 820;
}

.step-number {
  background: var(--surface-tint);
  color: var(--teal-dark);
}

.step-copy {
  display: grid;
  gap: 8px;
}

.step-copy p,
.doc-card p {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.5;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.metric-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 13px 14px;
  border-right: 1px solid var(--line);
}

.metric-card:last-child {
  border-right: 0;
}

.metric-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.metric-card strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.review-section,
.audit-section {
  padding: 15px 0;
  border-top: 1px solid var(--line);
}

.review-section:first-of-type,
.audit-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.review-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.step-list,
.note-list,
.evidence-card ul {
  display: grid;
  gap: 8px;
  padding: 0;
  list-style: none;
}

.step-list li,
.note-list li,
.evidence-card li {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.45;
  padding: 10px 11px;
}

.step-list li strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 14px;
}

.step-list li span,
.note-list li span {
  color: var(--muted);
}

.json-box {
  max-height: 690px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101820;
  color: #d9e7ef;
  font-size: 12px;
  line-height: 1.5;
  margin: 14px 0 0;
  padding: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

.session-box {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  word-break: break-word;
}

.session-box strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 14px;
}

.status,
.risk {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 28px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 780;
  padding: 5px 10px;
  white-space: nowrap;
}

.status.neutral,
.risk.low {
  background: #e8eef1;
  color: #34424c;
}

.status.active,
.status.pass,
.risk.medium {
  background: var(--green-bg);
  color: #0f5132;
}

.status.escalated,
.status.retake,
.risk.high {
  background: var(--amber-bg);
  color: #7a4100;
}

.status.completed {
  background: var(--blue-bg);
  color: #1d4ed8;
}

.status.blocked {
  background: var(--red-bg);
  color: var(--red);
}

.evidence-grid {
  display: grid;
  grid-template-columns: 1fr 112px;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.evidence-card {
  display: grid;
  gap: 9px;
}

.step-form {
  padding-top: 2px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.decision {
  margin-top: 16px;
  border-radius: 8px;
  padding: 13px 14px;
  font-size: 14px;
  line-height: 1.45;
}

.decision.pass {
  background: var(--green-bg);
  color: #0f5132;
}

.decision.retake {
  background: var(--amber-bg);
  color: #7a4100;
}

.decision.escalate,
.decision.blocked {
  background: var(--red-bg);
  color: var(--red);
}

.action-status {
  margin-top: 14px;
  border-radius: 8px;
  padding: 12px 13px;
  font-size: 13px;
  font-weight: 720;
  line-height: 1.4;
}

.action-status.pass,
.action-status.completed {
  background: var(--green-bg);
  color: #0f5132;
}

.action-status.retake {
  background: var(--amber-bg);
  color: #7a4100;
}

.action-status.blocked {
  background: var(--red-bg);
  color: var(--red);
}

.audit-section h3 {
  margin-bottom: 10px;
  color: var(--ink);
}

@media (max-width: 1180px) {
  .authoring-grid,
  .runtime-grid {
    grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
  }

  .artifact-panel,
  .audit-panel {
    grid-column: 1 / -1;
    position: static;
  }
}

@media (max-width: 820px) {
  .app-header,
  .summary-band {
    align-items: flex-start;
    flex-direction: column;
  }

  .page {
    padding: 12px;
  }

  .authoring-grid,
  .runtime-grid,
  .identity-card,
  .review-split,
  .metric-row,
  .evidence-grid {
    grid-template-columns: 1fr;
  }

  .summary-rail {
    grid-template-columns: repeat(2, 1fr);
    min-width: 0;
    width: 100%;
  }

  .topnav {
    justify-content: flex-start;
  }

  .metric-card {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metric-card:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 520px) {
  .app-header {
    padding: 14px 12px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  h1 {
    font-size: 21px;
  }

  h2 {
    font-size: 17px;
  }

  .topnav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .nav-link {
    justify-content: center;
  }

  .capture-panel,
  .review-panel,
  .artifact-panel,
  .sku-panel,
  .job-panel,
  .technician-panel,
  .audit-panel,
  .summary-band {
    padding: 14px;
  }

  .panel-head {
    align-items: stretch;
  }

  .panel-head button,
  .button-row button {
    width: 100%;
  }

  .doc-card,
  .technician-card {
    grid-template-columns: 1fr;
  }

  .session-box {
    flex-direction: column;
  }
}
