/* Engrave Spec V13.1 — clean Control Panel Builder layout */
:root {
  --v131-navy: #071a31;
  --v131-blue: #1768e5;
  --v131-blue-dark: #0c55c5;
  --v131-border: #cbd8e8;
  --v131-muted: #5a6e84;
  --v131-bg: #eef3f8;
  --v131-card: #ffffff;
  --v131-focus: rgba(23, 104, 229, 0.28);
}

body.v13-control-panel-builder,
body.v13-control-panel-builder * {
  box-sizing: border-box;
}

body.v13-control-panel-builder {
  margin: 0;
  background: var(--v131-bg);
  color: var(--v131-navy);
  direction: ltr;
  text-align: left;
}

body.v13-control-panel-builder > header:not(.v13-app-header),
body.v13-control-panel-builder .v1294-site-header,
body.v13-control-panel-builder .v129-help-card,
body.v13-control-panel-builder #v1293-preview-host::before {
  display: none !important;
}

body.v13-control-panel-builder .v13-hidden,
body.v13-control-panel-builder .v13-native-hidden,
body.v13-control-panel-builder .v13-source-field {
  display: none !important;
}

.v13-app-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  border-bottom: 1px solid #dbe4ef;
  box-shadow: 0 3px 14px rgba(12, 35, 63, 0.07);
}

.v13-app-header__row {
  width: min(1480px, calc(100% - 32px));
  min-height: 68px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
}

.v13-brand {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.v13-brand__engrave,
.v13-brand__spec {
  font: 800 25px/1.1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.v13-brand__engrave { color: #08182b; }
.v13-brand__spec { color: var(--v131-blue); }

.v13-app-title { min-width: 0; }
.v13-app-title strong { display: block; font-size: 16px; }
.v13-app-title span { display: block; margin-top: 2px; color: var(--v131-muted); font-size: 12.5px; }

.v13-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.v13-header-actions a,
.v13-header-actions button {
  min-height: 40px;
  padding: 9px 13px;
  border-radius: 10px;
  font: 750 14px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-decoration: none;
  cursor: pointer;
}

.v13-header-actions a {
  color: var(--v131-navy);
  border: 1px solid var(--v131-border);
  background: #fff;
}

.v13-header-actions button {
  color: #fff;
  border: 1px solid var(--v131-blue);
  background: var(--v131-blue);
}

.v13-menu {
  display: none;
  position: absolute;
  right: 16px;
  top: 61px;
  width: 230px;
  padding: 8px;
  border: 1px solid var(--v131-border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 44px rgba(10, 31, 59, 0.18);
}

.v13-menu.is-open { display: grid; }
.v13-menu a { display: block; padding: 11px 12px; border-radius: 9px; color: var(--v131-navy); font-weight: 700; text-decoration: none; }
.v13-menu a:hover { background: #f0f5fc; }

.v13-progress {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}

.v13-progress__inner {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 9px 0;
}

.v13-step-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #50647a;
  font: 800 14px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: pointer;
}

.v13-step-tab span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 50%;
  background: #e8eef6;
  color: #38526d;
  font-size: 12px;
}

.v13-step-tab.is-current {
  border-color: #b8d1f6;
  background: #edf5ff;
  color: var(--v131-blue-dark);
}

.v13-step-tab.is-current span { background: var(--v131-blue); color: #fff; }
.v13-step-tab.is-complete span { background: #198754; color: #fff; }

body.v13-control-panel-builder main {
  display: block !important;
  width: min(1480px, calc(100% - 32px));
  max-width: none !important;
  margin: 0 auto !important;
  padding: 20px 0 104px;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  direction: ltr !important;
  text-align: left !important;
}

body.v13-control-panel-builder main form {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  float: none !important;
  transform: none !important;
  direction: ltr !important;
  text-align: left !important;
}

.v13-builder-intro {
  width: 100%;
  margin: 0 0 16px;
  padding: 0;
}

.v13-builder-intro h1 {
  margin: 0 0 6px;
  font-size: clamp(27px, 2.4vw, 36px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.v13-builder-intro p {
  max-width: 850px;
  margin: 0;
  color: var(--v131-muted);
  font-size: 15px;
  line-height: 1.5;
}

.v13-builder-grid {
  display: grid !important;
  grid-template-columns: minmax(440px, 490px) minmax(0, 1fr) !important;
  gap: 24px !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  align-items: start !important;
  justify-items: stretch !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  direction: ltr !important;
}

.v13-controls-column,
.v13-preview-column {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  align-self: start !important;
  justify-self: stretch !important;
  direction: ltr !important;
  text-align: left !important;
}

.v13-preview-column {
  position: sticky;
  top: 122px;
}

.v13-step-card {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 22px !important;
  border: 1px solid #d8e2ee !important;
  border-radius: 18px !important;
  background: #fff !important;
  box-shadow: 0 9px 28px rgba(12, 35, 63, 0.07) !important;
  direction: ltr !important;
  text-align: left !important;
}

.v13-step-card > * {
  max-width: 100%;
}

.v13-step-card h2,
.v13-step-card h3,
.v13-step-card h4,
.v13-step-card legend,
.v13-step-card label,
.v13-step-card p {
  direction: ltr;
  text-align: left;
}

.v13-step-card h2 {
  margin: 0 0 6px;
  font-size: 22px;
  line-height: 1.2;
}

.v13-step-card h3 { margin: 20px 0 8px; }
.v13-step-card > p:first-of-type { margin-top: 0; color: var(--v131-muted); }

.v13-step-card [data-field],
.v13-step-card .field,
.v13-step-card .form-field,
.v13-step-card .form-group,
.v13-step-card .input-group,
.v13-step-card .control,
.v13-step-card .control-row,
.v13-step-card .option-group {
  max-width: 100%;
  min-width: 0;
}

.v13-step-card fieldset {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 20px 0 0;
  padding: 0;
  border: 0;
  grid-column: 1 / -1;
}

.v13-step-card legend {
  width: 100%;
  margin: 0 0 7px;
  padding: 0;
  color: var(--v131-navy);
  font-size: 14px;
  font-weight: 850;
}

.v13-help {
  margin: 5px 0 11px;
  color: var(--v131-muted);
  font-size: 13px;
  line-height: 1.45;
}

.v13-help a { color: var(--v131-blue-dark); font-weight: 750; }

.v13-step-card label {
  color: #18324e;
  font-weight: 750;
}

.v13-step-card input[type="text"],
.v13-step-card input[type="number"],
.v13-step-card input[type="email"],
.v13-step-card textarea,
.v13-step-card select {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 44px;
  margin: 5px 0 0;
  padding: 10px 12px;
  border: 1.5px solid #bfcddd;
  border-radius: 10px;
  background: #fff;
  color: #10233d;
  font: 600 15px/1.25 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  direction: ltr !important;
  text-align: left !important;
  appearance: auto;
  -webkit-appearance: auto;
}

.v13-step-card select {
  padding-right: 34px;
}

.v13-step-card input:focus,
.v13-step-card textarea:focus,
.v13-step-card select:focus {
  outline: 3px solid var(--v131-focus);
  outline-offset: 1px;
  border-color: var(--v131-blue);
}

.v13-choice-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  min-width: 0;
}

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

.v13-choice {
  position: relative;
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 11px;
  width: 100%;
  min-width: 0;
  min-height: 72px;
  padding: 11px 12px;
  overflow: visible;
  border: 1.5px solid var(--v131-border);
  border-radius: 12px;
  background: #fff;
  color: var(--v131-navy);
  text-align: left !important;
  white-space: normal;
  cursor: pointer;
}

.v13-choice:hover {
  border-color: #78a6ec;
  background: #f8fbff;
}

.v13-choice:has(input:checked),
.v13-choice.is-selected {
  border-color: var(--v131-blue);
  background: #eef5ff;
  box-shadow: 0 0 0 3px rgba(23, 104, 229, 0.11);
}

.v13-choice > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.v13-choice input { flex: 0 0 auto; }
.v13-choice strong { display: block; font-size: 13.5px; line-height: 1.25; }
.v13-choice small { display: block; margin-top: 3px; color: var(--v131-muted); font-size: 12px; line-height: 1.35; }
.v13-choice svg { width: 32px; height: 32px; flex: 0 0 32px; }

.v13-two-colour {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid #9eacbd;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--face) 0 50%, var(--engrave) 50% 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45);
}

.v13-feature-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  margin-top: 20px;
}

.v13-feature-pair > fieldset {
  margin: 0;
}

.v13-size-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: end;
}

.v13-size-row__times {
  padding-bottom: 13px;
  color: #607188;
  font-weight: 900;
}

.v13-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0 16px;
}

.v13-toolbar button,
.v13-preview-tools button {
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid #bfcddd;
  border-radius: 9px;
  background: #fff;
  color: #17324e;
  font-weight: 800;
  cursor: pointer;
}

.v13-toolbar button:hover,
.v13-preview-tools button:hover {
  border-color: var(--v131-blue);
  color: var(--v131-blue-dark);
}

.v13-toolbar button:disabled { opacity: 0.45; cursor: not-allowed; }

.v13-cutout-labels {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.v13-cutout-label {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}

.v13-cutout-label__number {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  background: #eaf2fd;
  color: var(--v131-blue-dark);
  font-size: 13px;
  font-weight: 900;
}

.v13-preview-card {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: none;
  height: auto !important;
  min-height: 0 !important;
  margin: 0;
  overflow: hidden;
  border: 1px solid #d7e1ed;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(10, 31, 59, 0.1);
}

.v13-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 15px;
  border-bottom: 1px solid #e4eaf2;
}

.v13-preview-head strong { font-size: 15px; }
.v13-preview-tools { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.v13-preview-stage {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 500px;
  padding: 18px;
  overflow: auto;
  background-color: #eef3f8;
  background-image: linear-gradient(#dfe7f0 1px, transparent 1px), linear-gradient(90deg, #dfe7f0 1px, transparent 1px);
  background-size: 20px 20px;
}

.v13-preview-stage.no-grid { background-image: none; }

.v13-preview-stage > :first-child {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
}

.v13-preview-stage svg,
.v13-preview-stage canvas {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  transform-origin: center;
  touch-action: none;
}

.v13-preview-note {
  padding: 11px 15px;
  border-top: 1px solid #e4eaf2;
  color: var(--v131-muted);
  font-size: 12.5px;
  line-height: 1.4;
}

.v13-selected-object {
  filter: drop-shadow(0 0 3px rgba(23, 104, 229, 0.75));
  outline: 2px solid var(--v131-blue);
}

.v13-review { display: grid; gap: 12px; }
.v13-review-card { padding: 15px; border: 1px solid #d4deea; border-radius: 14px; background: #f9fbfd; }
.v13-review-row { display: flex; justify-content: space-between; gap: 20px; padding: 7px 0; border-bottom: 1px solid #e5ebf2; }
.v13-review-row:last-child { border-bottom: 0; }
.v13-price { color: var(--v131-navy); font-size: 28px; font-weight: 900; }
.v13-checklist label { display: flex; gap: 9px; align-items: flex-start; margin: 9px 0; font-weight: 650; }

.v13-bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 950;
  border-top: 1px solid #d7e1ed;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -8px 24px rgba(10, 31, 59, 0.08);
  backdrop-filter: blur(10px);
}

.v13-bottom-bar__inner {
  width: min(1480px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: center;
}

.v13-bottom-bar__summary { text-align: center; }
.v13-bottom-bar__summary strong { display: block; }
.v13-bottom-bar__summary span { color: var(--v131-muted); font-size: 13px; }

.v13-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 17px;
  border-radius: 10px;
  font: 850 15px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-decoration: none;
  cursor: pointer;
}

.v13-button--secondary { justify-self: start; border: 1px solid #bfcddd; background: #fff; color: var(--v131-navy); }
.v13-button--primary { justify-self: end; border: 1px solid var(--v131-blue); background: var(--v131-blue); color: #fff; }
.v13-button--primary:hover { background: var(--v131-blue-dark); }

.v13-status { min-height: 22px; margin-top: 9px; color: #36536f; font-weight: 700; }
.v13-status.is-error { color: #a51d2d; }
.v13-status.is-success { color: #187143; }

.v13-step-card button:focus-visible,
.v13-app-header button:focus-visible,
.v13-app-header a:focus-visible,
.v13-step-tab:focus-visible,
.v13-button:focus-visible {
  outline: 3px solid var(--v131-focus);
  outline-offset: 2px;
}

@media (max-width: 1180px) {
  .v13-builder-grid {
    grid-template-columns: minmax(390px, 440px) minmax(0, 1fr) !important;
  }

  .v13-choice-grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .v13-builder-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .v13-preview-column {
    position: relative;
    top: auto;
    grid-row: 1;
  }

  .v13-preview-stage { min-height: 360px; }
  .v13-app-header__row { grid-template-columns: auto 1fr auto; }
  .v13-app-title span { display: none; }
}

@media (max-width: 700px) {
  .v13-app-header__row,
  body.v13-control-panel-builder main,
  .v13-progress__inner,
  .v13-bottom-bar__inner {
    width: calc(100% - 20px);
  }

  .v13-app-title { display: none; }
  .v13-brand__engrave,
  .v13-brand__spec { font-size: 21px; }
  .v13-progress__inner { gap: 4px; }
  .v13-step-tab { padding: 4px; font-size: 0; }
  .v13-step-tab span { font-size: 12px; }
  .v13-step-card { padding: 17px !important; border-radius: 15px !important; }
  .v13-choice-grid,
  .v13-choice-grid--3,
  .v13-feature-pair { grid-template-columns: minmax(0, 1fr); }
  .v13-preview-stage { min-height: 280px; padding: 12px; }
  .v13-bottom-bar__inner { grid-template-columns: auto 1fr auto; }
  .v13-bottom-bar__summary span { display: none; }
  .v13-button { padding: 10px 13px; }
  .v13-size-row { grid-template-columns: minmax(0, 1fr); }
  .v13-size-row__times { display: none; }
}

@media print {
  body.v13-control-panel-builder { background: #fff; }
  .v13-app-header,
  .v13-progress,
  .v13-controls-column,
  .v13-preview-head,
  .v13-preview-note,
  .v13-bottom-bar { display: none !important; }
  .v13-builder-grid { display: block !important; }
  .v13-preview-card { border: 0; box-shadow: none; }
  .v13-preview-stage { min-height: 0; padding: 0; overflow: visible; background: none; }
  .v13-preview-stage svg { width: var(--print-width-mm) !important; height: var(--print-height-mm) !important; max-width: none !important; }
}
