:root {
  color-scheme: light;
  --ink: #151b2d;
  --muted: #687084;
  --line: #d8dee9;
  --panel: #ffffff;
  --panel-soft: #f7f9fc;
  --page: #edf2f7;
  --accent: #0f8f8a;
  --accent-strong: #096b68;
  --accent-soft: #dff6f2;
  --warm: #f4b860;
  --warn: #a15c11;
  --shadow: 0 22px 70px rgba(31, 43, 69, 0.14);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(15, 143, 138, 0.2), transparent 34rem),
    linear-gradient(135deg, #f6f8fb 0%, var(--page) 48%, #e7eef8 100%);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

input[type="url"] {
  min-width: 0;
}

input[type="text"],
input[type="email"],
input[type="number"],
textarea {
  min-width: 0;
}

button {
  border: 0;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.dropzone:focus-within {
  outline: 3px solid rgba(15, 143, 138, 0.35);
  outline-offset: 3px;
}

.app-shell {
  width: min(1420px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.workspace {
  display: grid;
  gap: 20px;
}

.intro {
  display: grid;
  gap: 8px;
  max-width: 780px;
}

.eyebrow,
.step-label {
  margin: 0;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4.4vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.2rem;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.intro p:last-child,
.implementation p,
.control-row p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.builder-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.88fr) minmax(290px, 0.82fr) minmax(360px, 1.3fr);
  gap: 16px;
  align-items: stretch;
}

.panel,
.implementation {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(216, 222, 233, 0.95);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel {
  display: grid;
  gap: 18px;
  align-content: start;
  padding: 18px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.status-chip {
  display: inline-flex;
  min-width: max-content;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #eef2f8;
  color: #39445a;
  padding: 7px 10px;
  font-size: 0.82rem;
  font-weight: 800;
}

.status-chip.accent {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.dropzone {
  display: grid;
  min-height: 220px;
  place-items: center;
  align-content: center;
  gap: 10px;
  border: 2px dashed #aab7c9;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(223, 246, 242, 0.5)),
    repeating-linear-gradient(-35deg, transparent 0 16px, rgba(15, 143, 138, 0.05) 16px 32px);
  cursor: pointer;
  padding: 24px;
  text-align: center;
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    background 160ms ease;
}

.dropzone:hover,
.dropzone.is-dragging {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.drop-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 2rem;
  font-weight: 300;
  line-height: 1;
}

.drop-title {
  font-size: 1.05rem;
  font-weight: 800;
}

.drop-copy {
  color: var(--muted);
  line-height: 1.45;
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-height: 82px;
}

.thumb {
  position: relative;
  overflow: hidden;
  margin: 0;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f1f4f8;
}

.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 112px;
  object-fit: cover;
}

.thumb button {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(21, 27, 45, 0.84);
  color: #fff;
  cursor: pointer;
}

.thumb-meta {
  display: grid;
  gap: 6px;
  padding: 8px;
  background: #fff;
}

.thumb-meta label {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.thumb-meta select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 8px;
  font-size: 0.88rem;
  font-weight: 700;
}

.thumb-analysis {
  display: grid;
  gap: 4px;
  border-radius: 6px;
  background: #f7f9fc;
  padding: 8px;
}

.thumb-analysis strong {
  color: var(--accent-strong);
  font-size: 0.82rem;
}

.thumb-analysis strong.is-warn {
  color: var(--warn);
}

.thumb-analysis small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.notice {
  border-left: 4px solid var(--warm);
  background: #fff8ec;
  color: var(--warn);
  padding: 12px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.92rem;
  line-height: 1.45;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  border: 0;
  padding: 4px;
  border-radius: var(--radius);
  background: #eef2f8;
}

.segmented legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.segmented label {
  cursor: pointer;
}

.segmented input {
  position: absolute;
  opacity: 0;
}

.segmented span {
  display: grid;
  min-height: 44px;
  place-items: center;
  border-radius: 6px;
  color: #4a5468;
  font-weight: 800;
}

.segmented input:checked + span {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 9px 24px rgba(31, 43, 69, 0.12);
}

.control-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 16px;
  align-items: center;
}

.control-row label,
.select-row label,
.backend-box label {
  font-weight: 800;
}

.control-row input[type="range"] {
  grid-column: 1 / -1;
  width: 100%;
  accent-color: var(--accent);
}

.control-row output {
  border-radius: 999px;
  background: #eef2f8;
  color: var(--ink);
  padding: 6px 10px;
  font-weight: 800;
}

.select-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.select-row select {
  min-width: 145px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
}

.form-field {
  display: grid;
  gap: 7px;
}

.form-field span {
  font-weight: 800;
}

.form-field input,
.form-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
}

.form-field textarea {
  resize: vertical;
  line-height: 1.45;
}

.form-field.wide {
  grid-column: 1 / -1;
}

.production-box {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
  padding: 12px;
}

.production-head,
.repair-head,
.backend-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.production-head h3,
.repair-head h3,
.backend-head h3 {
  margin: 0;
}

.production-head span,
.repair-head span,
.backend-head span {
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 800;
}

.backend-head span.is-warn {
  background: #fff8ec;
  color: var(--warn);
}

.repair-box {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 12px;
}

.toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 10px;
  cursor: pointer;
}

.toggle-row input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.toggle-row span {
  display: grid;
  gap: 3px;
}

.toggle-row small {
  color: var(--muted);
  line-height: 1.35;
}

.color-swatches {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  border: 0;
  padding: 0;
}

.color-swatches legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  font-weight: 800;
}

.color-swatches label {
  display: grid;
  min-height: 54px;
  place-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
}

.color-swatches input {
  position: absolute;
  opacity: 0;
}

.color-swatches label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.swatch {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(21, 27, 45, 0.16);
}

.swatch.stone {
  background: #c6ccd3;
}

.swatch.bronze {
  background: #a97142;
}

.swatch.mint {
  background: #6bbfb1;
}

.consent-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 12px;
  cursor: pointer;
}

.consent-card input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.consent-card span {
  display: grid;
  gap: 4px;
}

.consent-card small {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.quality-box {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 12px;
}

.quality-box h3 {
  margin: 0;
}

.quality-box ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.quality-box li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

.quality-box li::before {
  content: "";
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--warm);
}

.quality-box li.is-ok {
  color: var(--accent-strong);
  font-weight: 700;
}

.quality-box li.is-ok::before {
  background: var(--accent);
}

.analysis-box {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
  padding: 12px;
}

.analysis-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.analysis-head h3 {
  margin: 0;
}

.analysis-head span {
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 800;
}

.analysis-head span.is-warn {
  background: #fff8ec;
  color: var(--warn);
}

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

.analysis-empty,
.analysis-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  padding: 10px;
}

.analysis-empty {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

.analysis-item {
  display: grid;
  gap: 7px;
}

.analysis-item strong {
  overflow-wrap: anywhere;
}

.analysis-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.analysis-meta span {
  border-radius: 999px;
  background: #eef2f8;
  color: #39445a;
  padding: 5px 8px;
  font-size: 0.78rem;
  font-weight: 800;
}

.analysis-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.38;
}

.backend-box {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 12px;
}

.backend-box p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.endpoint-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.endpoint-row input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
}

.endpoint-row button {
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  padding: 0 12px;
  cursor: pointer;
  font-weight: 800;
}

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

.endpoint-row.compact span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.endpoint-row.compact button {
  min-height: 38px;
  background: var(--ink);
}

.primary-action,
.button-row button {
  min-height: 48px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  font-weight: 850;
  transition:
    transform 160ms ease,
    opacity 160ms ease,
    background 160ms ease;
}

.primary-action:hover,
.button-row button:hover {
  transform: translateY(-1px);
}

.primary-action:disabled,
.button-row button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.preview-panel {
  min-height: 100%;
}

.preview-stage {
  display: grid;
  overflow: hidden;
  min-height: 320px;
  place-items: center;
  border: 1px solid #cdd6e4;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(247, 249, 252, 0.92), rgba(227, 235, 246, 0.9)),
    radial-gradient(circle at center, rgba(143, 211, 199, 0.24), transparent 18rem);
}

canvas {
  display: block;
  width: 100%;
  max-width: 720px;
  height: auto;
  aspect-ratio: 9 / 7;
}

.preview-tools {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 10px;
}

.preview-tools label {
  font-weight: 800;
}

.preview-tools input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.preview-tools output {
  min-width: 70px;
  border-radius: 999px;
  background: #eef2f8;
  color: var(--ink);
  padding: 6px 10px;
  text-align: center;
  font-weight: 800;
}

.preview-tools button {
  min-height: 38px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  padding: 0 12px;
  font-weight: 850;
}

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

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.progress-bar {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: #e6ebf2;
}

.progress-bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--warm));
  transition: width 220ms ease;
}

.process-log,
.payload-preview {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
  padding: 12px;
}

.process-log-head,
.payload-head,
.payload-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.process-log-head h3,
.payload-head h3 {
  margin: 0;
}

.process-log-head button,
.payload-actions button {
  min-height: 34px;
  border-radius: 6px;
  background: #eef2f8;
  color: var(--ink);
  cursor: pointer;
  padding: 0 10px;
  font-size: 0.84rem;
  font-weight: 850;
}

.process-log-head button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.log-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.log-item {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  padding: 9px;
}

.log-item.is-empty {
  grid-template-columns: 1fr;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

.log-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--warm);
}

.log-item.is-done .log-dot {
  background: var(--accent);
}

.log-item.is-error .log-dot {
  background: #c4472d;
}

.log-item strong {
  overflow-wrap: anywhere;
  font-size: 0.92rem;
}

.log-item small {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}

.payload-code {
  overflow: auto;
  max-height: 260px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #151b2d;
  color: #eff6ff;
  padding: 12px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  line-height: 1.48;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.result-grid div,
.print-grid div {
  display: grid;
  gap: 4px;
  min-height: 70px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 12px;
}

.result-grid span,
.print-grid span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.result-grid strong,
.print-grid strong {
  overflow-wrap: anywhere;
  font-size: 1.05rem;
}

.printability {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
  padding: 12px;
}

.printability-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.printability-heading h3 {
  margin: 0;
}

.printability-heading span {
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 800;
}

.printability-heading span.is-warn {
  background: #fff8ec;
  color: var(--warn);
}

.print-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.release-box {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
  padding: 12px;
}

.release-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.release-head h3 {
  margin: 0;
}

.release-head span {
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 800;
}

.release-head span.is-warn {
  background: #fff8ec;
  color: var(--warn);
}

.release-head span.is-error {
  background: #fbe9e5;
  color: #a33424;
}

.release-score {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  padding: 10px;
}

.release-score strong {
  min-width: 60px;
  color: var(--ink);
  font-size: 1.55rem;
  line-height: 1;
}

.release-score span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.release-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.release-check {
  display: grid;
  gap: 3px;
  min-height: 64px;
  border: 1px solid var(--line);
  border-left: 4px solid #c4472d;
  border-radius: 6px;
  background: var(--panel-soft);
  padding: 9px 10px;
}

.release-check.is-ok {
  border-left-color: var(--accent);
}

.release-check.is-warn {
  border-left-color: var(--warm);
}

.release-check strong {
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}

.release-check span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.32;
}

.button-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.button-row button:not(:first-child) {
  background: #eef2f8;
  color: var(--ink);
}

.order-panel {
  gap: 16px;
}

.order-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.order-form-grid .select-row {
  align-self: stretch;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  padding: 10px;
}

.order-form-grid .select-row select {
  width: min(210px, 100%);
}

.order-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.order-summary-grid div {
  display: grid;
  gap: 4px;
  min-height: 70px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 12px;
}

.order-summary-grid span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.order-summary-grid strong {
  overflow-wrap: anywhere;
  font-size: 1.05rem;
}

.secondary-action {
  min-height: 38px;
  border-radius: var(--radius);
  background: #eef2f8;
  color: var(--ink);
  cursor: pointer;
  padding: 0 12px;
  font-weight: 850;
}

.secondary-action:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.implementation {
  display: grid;
  grid-template-columns: 0.55fr 1.45fr;
  gap: 18px;
  padding: 18px;
}

.api-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.api-grid article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 14px;
}

.history-panel {
  gap: 14px;
}

.history-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.history-empty,
.history-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 12px;
}

.history-empty {
  color: var(--muted);
  line-height: 1.45;
}

.history-item {
  display: grid;
  gap: 8px;
  align-content: start;
}

.history-item strong {
  overflow-wrap: anywhere;
}

.history-item span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

code {
  border-radius: 5px;
  background: #e9eef6;
  padding: 2px 5px;
  color: #273047;
  font-size: 0.92em;
}

@media (max-width: 1120px) {
  .builder-grid {
    grid-template-columns: 1fr 1fr;
  }

  .preview-panel {
    grid-column: 1 / -1;
  }

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

  .order-form-grid,
  .order-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 760px) {
  .app-shell {
    padding: 14px;
  }

  .builder-grid,
  .api-grid,
  .button-row,
  .result-grid,
  .print-grid,
  .release-checks,
  .order-form-grid,
  .order-summary-grid,
  .history-list,
  .color-swatches {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 15px;
  }

  .panel-heading,
  .select-row,
  .printability-heading,
  .release-head,
  .production-head,
  .repair-head,
  .backend-head,
  .analysis-head,
  .process-log-head,
  .payload-head,
  .preview-tools {
    align-items: flex-start;
    flex-direction: column;
  }

  .payload-actions {
    width: 100%;
  }

  .payload-actions button {
    width: 100%;
  }

  .log-item {
    grid-template-columns: 14px minmax(0, 1fr);
  }

  .log-item small {
    grid-column: 2;
    white-space: normal;
  }

  .preview-tools {
    grid-template-columns: 1fr;
  }

  .release-score {
    grid-template-columns: 1fr;
  }

  .select-row select {
    width: 100%;
  }

  .order-form-grid .select-row select {
    width: 100%;
  }

  .endpoint-row {
    grid-template-columns: 1fr;
  }

  .endpoint-row button {
    min-height: 44px;
  }

  .thumb-grid {
    grid-template-columns: repeat(3, minmax(84px, 1fr));
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .preview-stage {
    min-height: 240px;
  }
}
