:root {
  --ink: #191919;
  --ink-2: #252525;
  --ink-3: #333333;
  --paper: #f5f5f1;
  --paper-2: #e8e8e2;
  --white: #ffffff;
  --orange: #f28a3a;
  --orange-strong: #f4a000;
  --orange-soft: rgba(242, 138, 58, 0.14);
  --danger: #e1493e;
  --success: #3f9b66;
  --muted: #787873;
  --line: #d9d9d3;
  --radius: 18px;
  --shadow: 0 18px 48px rgba(17, 17, 17, 0.11);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 0%, rgba(242, 138, 58, 0.09), transparent 30rem),
    var(--paper);
}

body.embedded {
  min-height: 0;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(242, 138, 58, 0.46);
  outline-offset: 2px;
}

.app-header {
  min-height: 72px;
  padding: 12px clamp(18px, 3vw, 46px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--white);
  background: var(--ink);
  border-bottom: 3px solid var(--orange);
}

.brand {
  min-width: 0;
  display: block;
  flex: 0 1 370px;
  color: inherit;
  text-decoration: none;
  line-height: 1;
}

.brand-logo {
  width: min(100%, 360px);
  height: auto;
  display: block;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
}

.prototype-badge {
  padding: 7px 10px;
  color: var(--ink);
  background: var(--orange);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.11em;
}

.privacy-note {
  color: #bbbbba;
}

.app-shell {
  width: min(1760px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 2.4vw, 34px);
}

.product-bar {
  margin-bottom: 20px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.eyebrow,
.step-label {
  margin: 0 0 6px;
  color: var(--orange);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

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

h1 {
  max-width: 820px;
  margin-bottom: 0;
  font-size: clamp(22px, 2.2vw, 34px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

h2 {
  margin-bottom: 5px;
  font-size: 20px;
  line-height: 1.18;
  letter-spacing: -0.02em;
}

h3 {
  margin-bottom: 12px;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.product-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  flex: 0 0 auto;
}

.product-field {
  min-width: 420px;
}

.segmented-field {
  min-width: 172px;
  margin: 0;
  padding: 0;
  border: 0;
}

.finish-field {
  min-width: 210px;
}

.segmented-field legend {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.segmented {
  min-height: 46px;
  padding: 4px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 5px 18px rgba(17, 17, 17, 0.06);
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  min-height: 36px;
  padding: 0 13px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #5d5d59;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.segmented input:checked + span {
  color: var(--white);
  background: var(--ink);
}

.segmented input:focus-visible + span {
  outline: 3px solid rgba(242, 138, 58, 0.46);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(245px, 292px) minmax(520px, 1fr) minmax(320px, 360px);
  gap: 18px;
  align-items: start;
}

.panel {
  overflow: hidden;
  background: var(--white);
  border: 1px solid rgba(25, 25, 25, 0.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.tool-panel,
.detail-panel {
  position: sticky;
  top: 18px;
  padding: 20px;
}

.panel-heading p:not(.step-label) {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

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

.tool-button {
  width: 100%;
  min-height: 62px;
  padding: 9px 9px 9px 12px;
  display: grid;
  grid-template-columns: 38px 1fr 30px;
  align-items: center;
  gap: 10px;
  text-align: left;
  color: var(--ink);
  background: #fafaf7;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: transform 130ms ease, border-color 130ms ease, background 130ms ease;
}

.tool-button:hover {
  transform: translateY(-1px);
  background: var(--white);
  border-color: var(--orange);
}

.tool-button:active {
  transform: translateY(0);
}

.tool-button strong,
.tool-button small {
  display: block;
}

.tool-button strong {
  font-size: 14px;
}

.tool-button small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.add-symbol {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--orange);
  border-radius: 8px;
  font-size: 19px;
  font-weight: 700;
}

.file-icon {
  width: 38px;
  height: 31px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--orange-soft);
  border: 2px solid var(--orange);
  border-radius: 5px;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.05em;
}

.custom-upload-button {
  border-style: dashed;
}

.tool-icon {
  position: relative;
  width: 38px;
  height: 30px;
  display: inline-block;
}

.round-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  border: 3px solid var(--ink);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.round-icon.size-small::after {
  width: 10px;
  height: 10px;
}

.round-icon.size-large::after {
  width: 15px;
  height: 15px;
}

.variable-round-icon::after,
.slot-icon::after,
.rounded-rect-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  border: 3px solid var(--ink);
  transform: translate(-50%, -50%);
}

.variable-round-icon::after {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.slot-icon::after {
  width: 30px;
  height: 12px;
  border-radius: 999px;
}

.rounded-rect-icon::after {
  width: 29px;
  height: 20px;
  border-radius: 6px;
}

.airline-icon {
  background:
    radial-gradient(circle, transparent 0 5px, var(--ink) 5.5px 7.5px, transparent 8px) 0 50% / 19px 19px repeat-x;
}

.airline-icon::after {
  content: "";
  position: absolute;
  top: 12px;
  left: 7px;
  height: 6px;
  background: var(--ink);
}

.airline-icon.dots-2 {
  width: 34px;
}

.airline-icon.dots-2::after {
  width: 19px;
}

.airline-icon.dots-3,
.airline-icon.dots-4 {
  width: 38px;
  background-size: 15px 18px;
}

.airline-icon.dots-3::after,
.airline-icon.dots-4::after {
  left: 6px;
  width: 28px;
}

.rules-card {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.rules-toggle {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink);
  background: transparent;
  border: 0;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.rules-toggle[aria-expanded="true"] span:last-child {
  transform: rotate(180deg);
}

.rules-content {
  padding: 0 13px 13px;
}

.rules-content dl {
  margin: 0;
  display: grid;
  gap: 5px;
}

.rules-content dl div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

.rules-content dt {
  color: var(--muted);
}

.rules-content dd {
  margin: 0;
  font-weight: 800;
}

.rules-content p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

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

.editor-toolbar {
  min-height: 78px;
  padding: 17px 20px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.editor-toolbar h2 {
  margin-bottom: 0;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.grid-button {
  min-width: 106px;
  white-space: nowrap;
}

.grid-overlay {
  pointer-events: none;
}

.grid-pattern-line {
  stroke: var(--orange);
  stroke-opacity: 0.34;
}

.fine-grid {
  opacity: 0.72;
}

.centre-grid line {
  stroke: var(--orange);
  stroke-width: 1.8;
  stroke-dasharray: 10 7;
  opacity: 0.95;
  vector-effect: non-scaling-stroke;
}

.icon-button,
.text-button {
  min-height: 46px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.icon-button {
  min-width: 46px;
  font-size: 20px;
}

.text-button {
  padding: 0 13px;
}

.icon-button:hover,
.text-button:hover {
  border-color: var(--ink);
}

.editor-stage {
  position: relative;
  min-height: 480px;
  padding: 14px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(rgba(255,255,255,0.62), rgba(255,255,255,0.62)),
    repeating-linear-gradient(0deg, transparent 0 24px, rgba(25,25,25,0.035) 24px 25px),
    repeating-linear-gradient(90deg, transparent 0 24px, rgba(25,25,25,0.035) 24px 25px),
    #e4e4df;
  cursor: grab;
}

.editor-stage:active {
  cursor: grabbing;
}

.runtime-notice {
  position: absolute;
  top: 15px;
  right: 15px;
  left: 15px;
  z-index: 5;
  padding: 12px 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px 14px;
  color: #7b3227;
  background: rgba(255, 239, 232, 0.96);
  border: 1px solid #e9aa9d;
  border-radius: 9px;
  box-shadow: 0 8px 22px rgba(25, 25, 25, 0.1);
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
}

.runtime-notice[hidden] {
  display: none;
}

.runtime-notice strong {
  white-space: nowrap;
}

#plate-svg {
  width: 100%;
  height: auto;
  max-height: min(63vh, 690px);
  display: block;
  overflow: visible;
  touch-action: none;
  user-select: none;
}

.plate-shape {
  stroke: #5b5b57;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  transition: fill 180ms ease;
}

.plate-shape.finish-blank {
  fill: #c9cbc9;
}

.plate-shape.finish-black {
  fill: #202020;
  stroke: #090909;
}

.usable-zone {
  fill: none;
  stroke: var(--orange);
  stroke-width: 2;
  stroke-dasharray: 7 7;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.fixed-cutout-shape {
  fill: #f3f3ef;
  stroke: rgba(25, 25, 25, 0.58);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.zone-label rect {
  fill: var(--orange);
}

.zone-label text {
  fill: var(--ink);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.cutout {
  cursor: grab;
}

.cutout:active {
  cursor: grabbing;
}

.cutout .cut-shape {
  fill: #f3f3ef;
  stroke: rgba(25, 25, 25, 0.45);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.cutout.selected .cut-shape {
  stroke: var(--orange);
  stroke-width: 3;
}

.cutout.snapped:not(.invalid) .cut-shape {
  stroke: var(--orange-strong);
  stroke-width: 4;
}

.cutout.invalid .cut-shape {
  fill: #fce9e6;
  stroke: var(--danger);
  stroke-width: 3;
}

.cutout .hit-area {
  fill: transparent;
  stroke: transparent;
  stroke-width: 34;
  vector-effect: non-scaling-stroke;
  pointer-events: all;
}

.cutout-label {
  fill: var(--ink);
  paint-order: stroke;
  stroke: rgba(255,255,255,0.8);
  stroke-width: 4;
  stroke-linejoin: round;
  font-size: 12px;
  font-weight: 900;
  pointer-events: none;
}

.invalid-marker circle {
  fill: var(--danger);
  stroke: var(--white);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.invalid-marker text {
  fill: var(--white);
  font-size: 13px;
  font-weight: 900;
  text-anchor: middle;
  dominant-baseline: central;
}

.stage-hint {
  position: absolute;
  left: 18px;
  bottom: 15px;
  padding: 8px 11px;
  color: #5e5e59;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(25,25,25,0.09);
  border-radius: 8px;
  backdrop-filter: blur(5px);
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}

.mobile-hint {
  display: none;
}

.validation-banner {
  min-height: 54px;
  padding: 13px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  font-weight: 700;
}

.validation-banner::before {
  width: 24px;
  height: 24px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--white);
  font-size: 13px;
  font-weight: 900;
}

.validation-banner.valid {
  color: #256a43;
  background: #edf8f1;
}

.validation-banner.valid::before {
  content: "✓";
  background: var(--success);
}

.validation-banner.invalid {
  color: #9f3029;
  background: #fff0ed;
}

.validation-banner.invalid::before {
  content: "!";
  background: var(--danger);
}

.validation-banner.loading {
  color: #5e5e59;
  background: #f5f5f1;
}

.validation-banner.loading::before {
  content: "…";
  color: var(--ink);
  background: var(--orange);
}

.detail-panel {
  min-height: 620px;
}

.selection-card {
  margin: 14px 0 18px;
  padding: 14px;
  background: #f6f6f2;
  border: 1px solid var(--line);
  border-radius: 11px;
}

@media (min-width: 851px) {
  .detail-panel #selection-card {
    min-height: 230px;
  }
}

.mobile-selection-card {
  display: none;
}

.empty-selection {
  min-height: 105px;
  display: grid;
  align-content: center;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.selection-title {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.selection-title strong {
  font-size: 14px;
}

.valid-chip,
.invalid-chip {
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.valid-chip {
  color: #256a43;
  background: #dff2e7;
}

.invalid-chip {
  color: #9f3029;
  background: #ffe0dc;
}

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

.input-grid label {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.dimension-heading {
  margin: 12px 0 0;
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.dimension-grid {
  margin-top: 7px;
}

.dimension-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.field-label {
  display: block;
  white-space: nowrap;
}

.number-wrap {
  min-height: 42px;
  margin-top: 4px;
  padding: 0 9px;
  display: grid;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.number-wrap input {
  width: 100%;
  min-width: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  appearance: textfield;
}

.number-wrap input::-webkit-inner-spin-button,
.number-wrap input::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.selection-error {
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.selection-note {
  margin: 0 0 11px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.grouped-actions > p {
  margin: 13px 0 6px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.selection-actions {
  margin-top: 11px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.selection-actions.three-columns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mini-button {
  min-height: 40px;
  padding: 8px 6px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  cursor: pointer;
}

.mini-button.danger:hover {
  color: var(--danger);
  border-color: var(--danger);
}

.mini-button:disabled {
  color: #a7a7a1;
  background: #efefe9;
  border-color: #e1e1da;
  cursor: not-allowed;
}

.array-card {
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.array-card summary {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.array-card > p {
  margin: 8px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

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

.array-input-grid label {
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
  text-transform: uppercase;
}

.array-input-grid label > span {
  min-height: 25px;
  display: flex;
  align-items: end;
}

.array-input-grid input {
  width: 100%;
  min-height: 40px;
  margin-top: 4px;
  padding: 0 9px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 14px;
  font-weight: 800;
}

.array-create-button {
  width: 100%;
  margin-top: 8px;
  color: var(--white);
  background: var(--ink);
}

.parts-section {
  margin-bottom: 18px;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title-row h3 {
  margin: 0;
}

.parts-heading-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.selection-mode-button,
.multi-select-actions button {
  min-height: 31px;
  padding: 5px 8px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.selection-mode-button.active {
  color: var(--white);
  background: var(--ink);
  border-color: var(--ink);
}

.multi-select-actions {
  margin-top: 8px;
  display: flex;
  gap: 6px;
}

.multi-select-actions[hidden] {
  display: none;
}

.multi-select-actions button:disabled {
  color: #aaa;
  cursor: not-allowed;
}

.count-badge {
  min-width: 25px;
  height: 25px;
  padding: 0 7px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--ink);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.parts-list {
  max-height: 162px;
  margin-top: 9px;
  display: grid;
  gap: 5px;
  overflow: auto;
}

.part-row {
  width: 100%;
  min-height: 39px;
  padding: 0 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 13px;
  cursor: pointer;
}

.part-row:hover,
.part-row.selected {
  background: #f5f5f1;
  border-color: var(--line);
}

.part-row.invalid {
  color: var(--danger);
}

.part-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  text-align: left;
}

.part-select-indicator {
  width: 14px;
  flex: 0 0 14px;
  color: var(--orange-dark);
  font-weight: 900;
  text-align: center;
}

.part-status {
  font-weight: 900;
}

.parts-empty {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.order-summary {
  padding: 14px;
  color: var(--white);
  background: var(--ink);
  border-radius: 11px;
}

.order-summary h3 {
  color: var(--orange);
}

.order-summary dl {
  margin: 0;
  display: grid;
  gap: 7px;
}

.order-summary dl div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 11px;
  line-height: 1.35;
}

.order-summary dt {
  color: #a8a8a5;
}

.order-summary dd {
  margin: 0;
  text-align: right;
  font-weight: 800;
}

.order-summary .summary-price-row {
  margin-top: 5px;
  padding-top: 10px;
  align-items: baseline;
  border-top: 1px solid rgba(255,255,255,0.16);
}

.order-summary .summary-price-row dt {
  color: var(--white);
  font-weight: 800;
}

.order-summary .summary-price-row dd {
  color: var(--orange);
  font-size: 15px;
  white-space: nowrap;
}

.price-note {
  margin: 10px 0 0;
  color: #a8a8a5;
  font-size: 10px;
  line-height: 1.45;
}

.price-note.price-review {
  color: #ffd0a3;
  font-weight: 700;
}

.safety-notice {
  margin-top: 12px;
  padding: 13px;
  color: #312b26;
  background: #fff3e6;
  border: 1px solid #f2bf8f;
  border-left: 4px solid var(--orange);
  border-radius: 9px;
}

.safety-notice h3 {
  margin: 0 0 7px;
  font-size: 13px;
  line-height: 1.3;
}

.safety-notice p,
.withdrawal-note,
.commerce-status {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
}

.safety-notice details {
  margin-top: 9px;
}

.safety-notice summary {
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.safety-notice details p {
  margin-top: 8px;
}

.commerce-actions {
  margin-top: 12px;
}

.consent-check {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  margin-top: 9px;
  padding: 11px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
  cursor: pointer;
}

.consent-check input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--orange);
}

.withdrawal-note {
  margin: 10px 2px 0;
  color: var(--muted);
}

.commerce-status {
  min-height: 16px;
  margin: 8px 2px 0;
  color: var(--muted);
  text-align: center;
}

.commerce-status.error {
  color: #9f2e23;
  font-weight: 750;
}

body.embedded .demo-only {
  display: none;
}

.primary-button,
.secondary-button {
  width: 100%;
  min-height: 50px;
  margin-top: 12px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.primary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink);
  background: var(--orange);
  border: 1px solid var(--orange);
}

.primary-button:hover:not(:disabled) {
  background: var(--orange-strong);
  border-color: var(--orange-strong);
}

.primary-button:disabled {
  color: #8e8e89;
  background: #d8d8d2;
  border-color: #d8d8d2;
  cursor: not-allowed;
}

.secondary-button {
  margin-top: 7px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
}

.secondary-button:hover {
  color: var(--white);
  background: var(--ink);
}

.export-note {
  margin: 8px 2px 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  text-align: center;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 44px));
  padding: 13px 16px;
  color: var(--white);
  background: var(--ink);
  border-left: 4px solid var(--orange);
  border-radius: 8px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.24);
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .product-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .product-options {
    width: 100%;
    justify-content: flex-start;
  }

  .product-field {
    flex: 2 1 420px;
  }

  .workspace {
    grid-template-columns: 230px minmax(460px, 1fr);
  }

  .detail-panel {
    position: static;
    grid-column: 1 / -1;
    min-height: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .detail-panel > .panel-heading {
    grid-column: 1 / -1;
  }

  .selection-card {
    margin: 0;
  }

  .parts-section {
    margin: 0;
  }

  .order-summary,
  .safety-notice,
  .commerce-actions,
  .detail-panel .export-note {
    grid-column: 1 / -1;
  }

  .detail-panel .primary-button,
  .detail-panel .secondary-button {
    margin-top: 0;
  }
}

@media (max-width: 850px) {
  .app-header,
  .product-bar {
    align-items: flex-start;
  }

  .privacy-note {
    display: none;
  }

  .product-bar {
    flex-direction: column;
  }

  .product-options {
    width: 100%;
  }

  .segmented-field {
    min-width: 0;
    flex: 1;
  }

  .product-field {
    flex: 2 1 100%;
  }

  .workspace {
    display: flex;
    flex-direction: column;
  }

  .tool-panel,
  .editor-panel,
  .detail-panel {
    width: 100%;
    position: static;
  }

  .tool-list {
    margin-inline: -20px;
    padding: 2px 20px 10px;
    display: flex;
    gap: 9px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline mandatory;
    scrollbar-width: thin;
  }

  .tool-button {
    min-width: 205px;
    scroll-snap-align: start;
  }

  .rules-card {
    margin-top: 6px;
  }

  .detail-panel {
    display: block;
  }

  .detail-panel #selection-card {
    display: none;
  }

  .mobile-selection-card {
    display: block;
    margin: 0;
    border-width: 1px 0 0;
    border-radius: 0;
    background: #fafaf7;
  }

  .detail-panel > * + * {
    margin-top: 14px;
  }

  .detail-panel .primary-button,
  .detail-panel .secondary-button,
  .detail-panel .export-note {
    margin-top: 8px;
  }

  .editor-stage {
    min-height: 390px;
  }

  .toolbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .icon-button,
  .text-button,
  .mini-button {
    min-height: 48px;
  }

  .icon-button {
    min-width: 48px;
  }

  .desktop-hint {
    display: none;
  }

  .mobile-hint {
    display: inline;
  }
}

@media (max-width: 560px) {
  .app-header {
    min-height: 62px;
    align-items: center;
    gap: 10px;
  }

  .brand {
    flex-basis: 220px;
  }

  .brand-logo {
    width: min(55vw, 220px);
  }

  .prototype-badge {
    padding: 6px 8px;
    font-size: 9px;
  }

  .app-shell {
    padding: 14px;
  }

  .product-options {
    flex-direction: column;
  }

  .product-field {
    width: 100%;
  }

  .product-segmented span {
    min-height: 44px;
    padding-inline: 7px;
    white-space: normal;
    text-align: center;
  }

  .tool-list {
    margin-inline: -17px;
    padding-inline: 17px;
  }

  .editor-toolbar {
    padding: 14px;
    align-items: center;
  }

  .toolbar-actions {
    max-width: 158px;
    display: grid;
    grid-template-columns: repeat(3, 48px);
    gap: 5px;
  }

  .text-button {
    grid-column: 1 / -1;
    min-height: 42px;
  }

  .editor-stage {
    min-height: 340px;
    padding: 5px;
  }

  .runtime-notice {
    top: 9px;
    right: 9px;
    left: 9px;
    display: block;
    padding: 10px 12px;
    font-size: 12px;
  }

  .runtime-notice strong,
  .runtime-notice span {
    display: block;
  }

  .runtime-notice strong {
    margin-bottom: 2px;
    white-space: normal;
  }

  .input-grid {
    gap: 6px;
  }

  .number-wrap {
    min-height: 48px;
  }

  .stage-hint {
    right: 10px;
    bottom: 8px;
    left: 10px;
    text-align: center;
  }

  .tool-panel,
  .detail-panel {
    padding: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
