.h4pe {
  --ink: #173b35;
  --green: #235c4e;
  --paper: #fbfaf5;
  --line: #d3ded7;
  --muted: #526961;
  box-sizing: border-box;
  max-width: 1320px;
  margin: 24px auto;
  padding: 32px;
  color: var(--ink);
  background: var(--paper);
  font-family: "Trebuchet MS", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
.h4pe * {
  box-sizing: border-box;
}
.h4pe header {
  padding: 0 0 24px;
  border-bottom: 1px solid var(--line);
}
.h4pe h1,
.h4pe .h4pe-title {
  font-family: Georgia, serif;
  font-weight: normal;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.15;
  margin: 8px 0 16px;
  color: var(--ink);
}
.h4pe h2 {
  font-size: 20px;
  margin: 28px 0 14px;
  color: var(--ink);
}
.h4pe-brand {
  font-size: 14px;
  letter-spacing: 0.04em;
}
.h4pe p {
  margin: 10px 0;
}
.h4pe-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr);
  gap: 40px;
}
.h4pe-preview {
  align-self: start;
  position: sticky;
  top: 24px;
  padding: 24px;
  background: radial-gradient(
    ellipse at 50% 40%,
    #fff 0,
    #edf3ee 65%,
    #e3ece7 100%
  );
  border: 1px solid var(--line);
  border-radius: 4px;
}
.h4pe-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.h4pe-preview-head span {
  font-size: 14px;
  color: var(--muted);
}
#h4pe-canvas {
  width: 100%;
  min-height: 300px;
  overflow: hidden;
}
.h4pe label {
  display: block;
  margin: 14px 0 6px;
  font-weight: bold;
}
.h4pe input:not([type="range"]),
.h4pe select,
.h4pe textarea {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  background: white;
  border: 1px solid #91a79b;
  border-radius: 4px;
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
}
.h4pe input[type="range"] {
  width: 100%;
  min-height: 44px;
  accent-color: var(--green);
  margin: 0;
}
.h4pe button,
.h4pe summary {
  font: inherit;
  cursor: pointer;
  min-height: 44px;
}
.h4pe button {
  background: white;
  border: 1px solid #809b8d;
  border-radius: 4px;
  color: var(--ink);
  padding: 10px 14px;
  line-height: 1.4;
  white-space: normal;
}
.h4pe button:hover {
  background: #e7eee8;
}
.h4pe button:hover,
.h4pe button:focus-visible {
  color: var(--ink);
}
.h4pe button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.h4pe button.h4pe-primary {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
.h4pe :focus-visible {
  outline: 3px solid #bb660a;
  outline-offset: 3px;
}
.h4pe details {
  border-top: 1px solid var(--line);
  padding: 12px 0;
  margin-top: 16px;
}
.h4pe summary {
  font-weight: bold;
  padding: 8px 0;
}
.h4pe-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.h4pe-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.h4pe-note {
  font-size: 13px;
  color: var(--muted);
}
.h4pe-upload {
  background: #e8efe8;
  border: 1px dashed #638b75;
  padding: 12px;
  border-radius: 4px;
}
.h4pe-upload input {
  margin-top: 8px;
}
.h4pe-total {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
  margin-top: 24px;
}
.h4pe-total strong {
  font-size: 24px;
}
.h4pe-notice {
  padding: 14px;
  background: #f6edda;
  color: #634711;
  border-left: 3px solid #b48734;
  font-size: 14px;
}
.h4pe #h4pe-status {
  min-height: 46px;
  padding: 12px 0;
}
.h4pe .h4pe-error {
  color: #9c2626;
  font-weight: bold;
}
.h4pe #saved-designs {
  display: grid;
  gap: 8px;
}
.h4pe-admin {
  margin: 24px 24px 24px 0;
}
.h4pe-admin-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 32px;
}
.h4pe-template-list {
  display: grid;
  align-content: start;
  gap: 8px;
}
.h4pe fieldset {
  border: 1px solid var(--line);
  padding: 20px;
  margin: 20px 0;
}
.h4pe legend {
  font-weight: bold;
  padding: 0 8px;
}
.h4pe table {
  width: 100%;
  border-collapse: collapse;
}
.h4pe th,
.h4pe td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 12px 8px;
  overflow-wrap: anywhere;
}
.h4pe a {
  color: #235c4e;
}
.h4pe input[type="checkbox"] {
  width: 24px;
  min-height: 24px;
  vertical-align: middle;
}
.h4pe [aria-busy="true"] {
  opacity: 0.8;
}
@media (max-width: 900px) {
  .h4pe {
    padding: 24px;
  }
  .h4pe-layout {
    gap: 24px;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr);
  }
  .h4pe-preview {
    padding: 14px;
  }
  .h4pe-admin-grid {
    grid-template-columns: 1fr;
  }
  .h4pe-template-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 650px) {
  .h4pe {
    margin: 0;
    padding: 18px 14px;
  }
  .h4pe-layout {
    grid-template-columns: 1fr;
  }
  .h4pe-preview {
    position: static;
  }
  .h4pe-preview-head {
    font-size: 14px;
  }
  .h4pe-admin {
    margin: 0;
  }
  .h4pe-pair {
    gap: 8px;
  }
  .h4pe fieldset {
    padding: 12px;
  }
  .h4pe table {
    font-size: 13px;
  }
  .h4pe th,
  .h4pe td {
    padding: 8px 3px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .h4pe * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.h4pe-layout > *,
.h4pe-pair > *,
.h4pe-admin-grid > * {
  min-width: 0;
}
.h4pe {
  container-type: inline-size;
}
.h4pe input[type="file"] {
  padding: 8px 4px;
  font-size: 13px;
}
@container (max-width:650px) {
  .h4pe-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .h4pe-preview {
    position: static;
  }
  .h4pe-preview-head {
    font-size: 14px;
  }
}
@media (max-width: 650px) {
  .h4pe-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}
.h4pe-proof-dialog {
  max-width: min(850px, calc(100vw - 24px));
  max-height: 90vh;
  overflow: auto;
  border: 1px solid #819b8a;
  border-radius: 6px;
  color: #173b35;
  background: #fbfaf5;
  padding: 24px;
}
.h4pe-proof-dialog::backdrop {
  background: rgba(15, 38, 31, 0.65);
}
.h4pe-proof-dialog figure {
  margin: 20px 0;
}
.h4pe-proof-dialog img {
  display: block;
  max-width: 100%;
  max-height: 55vh;
  object-fit: contain;
  margin: 12px auto;
  border: 1px solid #d3ded7;
}
.h4pe-proof-dialog button {
  min-height: 44px;
}
.h4pe-cart {
  border-top: 2px solid #809b8d;
  margin-top: 40px;
  padding-top: 20px;
}
.h4pe-cart-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid #d3ded7;
}
.h4pe-cart #checkout-form {
  max-width: 700px;
}
.h4pe-cart #check-payment,
.h4pe-cart #place-order {
  margin-top: 20px;
}
@media (max-width: 650px) {
  .h4pe-cart-line {
    display: block;
  }
  .h4pe-cart .h4pe-pair {
    display: block;
  }
}
.h4pe-product-reference {
  margin: 20px 0 0;
}
.h4pe-product-reference img {
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
}
.h4pe-product-reference figcaption {
  font-size: 13px;
}
@font-face {
  font-family: "H4PE Serif";
  src: url("../assets/fonts/serif.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "H4PE Sans";
  src: url("../assets/fonts/sans.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "H4PE Mono";
  src: url("../assets/fonts/mono.ttf") format("truetype");
  font-display: swap;
}
.h4pe.alignwide {
  width: 100%;
  max-width: 1320px;
  margin-left: auto;
  margin-right: auto;
}

.h4pe #product-3d {
  width: 100%;
  height: 340px;
  background: radial-gradient(ellipse at 50% 40%, #f7fcfc, #ccd9d8);
  border: 1px solid #9eb6b0;
  border-radius: 12px;
  overflow: hidden;
  touch-action: none;
}
.h4pe #product-3d:focus-visible {
  outline: 3px solid #173b35;
  outline-offset: 3px;
}
.h4pe #layers [aria-pressed="true"] {
  background: #173b35;
  color: #fff;
}
.h4pe #layers {
  margin: 12px 0;
}

.h4pe [hidden] {
  display: none !important;
}
.h4pe-preview-first {
  display: block;
}
.h4pe:not(.h4pe-admin) > header {
  padding-bottom: 12px;
}
.h4pe:not(.h4pe-admin) > header .h4pe-title,
.h4pe:not(.h4pe-admin) > header h1 {
  font-size: clamp(28px, 3vw, 36px);
  margin: 4px 0 8px;
}
.h4pe:not(.h4pe-admin) > header p {
  margin: 4px 0;
}
.h4pe:not(.h4pe-admin) #h4pe-status {
  min-height: 38px;
  padding: 8px 0;
  margin: 4px 0;
  font-size: 14px;
}
.h4pe-preview-first > .h4pe-preview {
  position: relative;
  top: auto;
  padding: 20px;
  border-radius: 14px;
  background: linear-gradient(145deg, #edf2ed, #f9faf5 65%, #e0e9e1);
}
.h4pe-preview-first .h4pe-preview-head {
  align-items: center;
  margin-bottom: 14px;
}
.h4pe-preview-head #dimensions {
  display: block;
  margin-top: 3px;
}
.h4pe-preview-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid #bccdc3;
  border-radius: 10px;
  background: #fff;
}
.h4pe-preview-tabs button {
  border: 0;
  background: transparent;
  border-radius: 7px;
}
.h4pe .h4pe-preview-tabs button[aria-selected="true"] {
  color: #fff;
  background: var(--ink);
}
.h4pe-preview-first #product-3d {
  height: clamp(280px, 40vw, 420px);
  border-radius: 10px;
}
.h4pe-preview-first #h4pe-canvas {
  max-height: 420px;
  min-height: 280px;
  border-radius: 10px;
  background: radial-gradient(ellipse, #fff, #e5ece5);
}
.h4pe-preview-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.h4pe-preview-caption .h4pe-note {
  max-width: 76ch;
}
.h4pe-preview-caption > button {
  flex: 0 0 auto;
}
.h4pe .h4pe-history,
.h4pe .h4pe-compact-actions {
  margin-top: 8px;
  gap: 6px;
}
.h4pe-history {
  flex: 0 0 auto;
}
.h4pe-product-bar {
  display: grid;
  grid-template-columns: 1.3fr 1fr 0.8fr;
  gap: 16px;
  margin-top: 18px;
}
.h4pe-control-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
  margin-top: 16px;
}
.h4pe-control-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.h4pe-card-heading,
.h4pe-dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.h4pe-card-heading h2,
.h4pe-dialog-heading h2 {
  margin: 0;
}
.h4pe-card-heading button {
  font-size: 13px;
  padding: 8px 10px;
  max-width: 48%;
}
.h4pe-control-card details {
  margin: 0;
  padding: 0;
  border: 0;
}
.h4pe-control-card > details > summary {
  padding: 0;
}
.h4pe-control-card details[open] > summary {
  margin-bottom: 14px;
}
.h4pe-model-card {
  grid-column: 1 / -1;
}
.h4pe-range-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 20px;
}
.h4pe-model-card .h4pe-range-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.h4pe-control-cards .h4pe-upload {
  margin-top: 10px;
}
.h4pe-control-card .h4pe-upload input {
  border: 0;
  background: transparent;
}
.h4pe-saved-panel {
  margin-top: 16px;
}
.h4pe-commerce-note {
  max-width: 90ch;
}
.h4pe-save-bar {
  position: sticky;
  bottom: 8px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 20px;
  padding: 14px 20px;
  margin-top: 20px;
  border: 1px solid #a3b9a8;
  border-radius: 12px;
  background: rgba(251, 250, 245, 0.97);
  box-shadow: 0 6px 28px rgba(23, 59, 53, 0.16);
}
.h4pe-save-bar .h4pe-total {
  align-items: baseline;
  justify-content: start;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
}
.h4pe-save-bar .h4pe-total span,
.h4pe-save-bar #save-state {
  font-size: 13px;
}
.h4pe-save-bar #save-state {
  margin: 0;
}
.h4pe-save-bar > .h4pe-actions {
  margin: 0;
}
.h4pe-save-bar #editor-feedback {
  width: 100%;
  margin: 4px 0 0;
  font-size: 12px;
}
.h4pe-save-bar #editor-feedback:empty {
  display: none;
}
.h4pe-control-dialog {
  width: min(660px, calc(100vw - 28px));
  max-width: calc(100vw - 28px);
  max-height: min(90vh, 900px);
  overflow: auto;
  overscroll-behavior: contain;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid #9fb5a7;
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 20px 70px rgba(16, 38, 32, 0.3);
}
.h4pe-control-dialog::backdrop {
  background: rgba(14, 31, 27, 0.4);
}
.h4pe-dialog-heading {
  position: sticky;
  top: -22px;
  z-index: 2;
  padding: 12px 0;
  background: var(--paper);
}
.h4pe-dialog-heading > button {
  flex: 0 0 auto;
}
.h4pe-proof-dialog .h4pe-proof-model {
  width: 100%;
  height: clamp(260px, 42vw, 420px);
  overflow: hidden;
  border-radius: 10px;
  background: #172a2b;
  touch-action: none;
}
.h4pe-proof-actions {
  position: sticky;
  bottom: -24px;
  padding: 12px 0;
  background: #fbfaf5;
}
.h4pe-product-reference-panel figure {
  margin: 8px 0;
}
.h4pe-product-bar > *,
.h4pe-range-grid > * {
  min-width: 0;
}
@container (max-width: 800px) {
  .h4pe-control-cards {
    grid-template-columns: 1fr;
  }
  .h4pe-preview-caption {
    flex-wrap: wrap;
    gap: 4px;
  }
  .h4pe-model-card .h4pe-range-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@container (max-width: 500px) {
  .h4pe-product-bar {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .h4pe-preview-first > .h4pe-preview,
  .h4pe-control-card {
    padding: 12px;
  }
  .h4pe-preview-tabs {
    width: 100%;
  }
  .h4pe-preview-tabs button {
    flex: 1;
  }
  .h4pe-save-bar {
    bottom: 0;
    gap: 8px;
    padding: 10px;
    margin-left: -4px;
    margin-right: -4px;
  }
  .h4pe-save-details {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 10px;
    width: 100%;
  }
  .h4pe-save-details > .h4pe-note {
    display: none;
  }
  .h4pe-save-bar .h4pe-total span {
    font-size: 11px;
  }
  .h4pe-save-bar .h4pe-total strong {
    font-size: 20px;
  }
  .h4pe-save-bar > .h4pe-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .h4pe-save-bar > .h4pe-actions button {
    padding: 8px;
    font-size: 14px;
  }
  .h4pe-save-bar #add-cart {
    grid-column: 1 / -1;
  }
  .h4pe-save-bar #editor-feedback {
    display: none;
  }
  .h4pe-control-dialog {
    padding: 16px;
  }
  .h4pe-dialog-heading {
    top: -16px;
  }
}

/* Customer studio tokens are owner-configurable; the WordPress admin keeps its own skin. */
.h4pe-studio {
  --ink: var(--h4pe-ink, #f7f8f8);
  --green: var(--h4pe-accent, #d59f22);
  --paper: var(--h4pe-background, #0b0f12);
  --line: var(--h4pe-line, #3d4950);
  --muted: var(--h4pe-muted, #b4c0c7);
  background: var(--paper);
  color: var(--ink);
  padding: clamp(12px, 2vw, 24px);
  border: 1px solid var(--line);
  border-radius: var(--h4pe-radius, 10px);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.55;
  margin-block: 16px;
}
.h4pe-studio p,
.h4pe-studio label,
.h4pe-studio legend {
  color: var(--ink);
}
.h4pe-studio .h4pe-note,
.h4pe-studio #h4pe-status,
.h4pe-studio .h4pe-preview-head span,
.h4pe-studio #save-state {
  color: var(--muted);
}
.h4pe-studio h2,
.h4pe-studio .h4pe-title {
  color: var(--ink);
  font-family: inherit;
  font-weight: 650;
  letter-spacing: -0.025em;
}
.h4pe-studio .h4pe-card-heading h2 {
  font-size: 17px;
}
.h4pe-studio .h4pe-dialog-heading h2 {
  font-size: 20px;
}
.h4pe-studio #h4pe-workspace {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.h4pe-studio #h4pe-status {
  padding: 0 0 12px;
  margin: 0;
  min-height: 28px;
}
.h4pe-studio .h4pe-product-bar {
  margin: 0;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--line);
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(100px, 0.65fr);
  gap: 14px;
}
.h4pe-studio label {
  font-size: 13px;
  font-weight: 600;
  margin: 10px 0 6px;
}
.h4pe-studio .h4pe-product-bar label {
  margin-top: 0;
}
.h4pe-studio input:not([type="range"]),
.h4pe-studio select,
.h4pe-studio textarea {
  color: var(--ink);
  background: var(--h4pe-surface);
  border-color: var(--line);
  border-radius: calc(var(--h4pe-radius) * 0.6);
  font: inherit;
  min-height: 44px;
  box-shadow: none;
}
.h4pe-studio textarea {
  resize: vertical;
}
.h4pe-studio input::placeholder,
.h4pe-studio textarea::placeholder {
  color: var(--muted);
  opacity: 0.85;
}
.h4pe-studio button {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: calc(var(--h4pe-radius) * 0.6);
  background: var(--h4pe-surface);
  color: var(--ink);
  box-shadow: none;
}
.h4pe-studio button:hover {
  border-color: var(--green);
  background: var(--h4pe-surface);
}
.h4pe-studio button.h4pe-primary,
.h4pe-studio .h4pe-tools button[aria-pressed="true"],
.h4pe-studio #layers button[aria-pressed="true"],
.h4pe-studio .h4pe-preview-tabs button[aria-selected="true"] {
  color: var(--h4pe-accent-text);
  background: var(--green);
  border-color: var(--green);
}
.h4pe-studio :focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
}
.h4pe-studio a {
  color: var(--green);
}
.h4pe-studio .h4pe-error {
  color: #ff9b8e;
}
.h4pe-studio .h4pe-preview-first {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(260px, 1fr);
  align-items: start;
  gap: 20px;
}
.h4pe-studio .h4pe-preview-first > .h4pe-preview {
  padding: 0;
  border: 0;
  background: transparent;
  min-width: 0;
}
.h4pe-studio .h4pe-preview-head {
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.h4pe-studio #preview-title {
  font-size: 17px;
}
.h4pe-studio #dimensions {
  font-size: 12px;
}
.h4pe-studio .h4pe-preview-tabs {
  border: 0;
  background: var(--h4pe-surface);
  padding: 3px;
  border-radius: var(--h4pe-radius);
}
.h4pe-studio .h4pe-preview-tabs button {
  font-size: 12px;
  min-height: 38px;
  padding: 8px 10px;
  border: 0;
}
.h4pe-studio .h4pe-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}
.h4pe-studio .h4pe-tools button {
  flex: 1 0 auto;
  padding-inline: 9px;
}
.h4pe-studio #product-3d {
  height: clamp(330px, 41vw, 510px);
  border-radius: var(--h4pe-radius);
  border: 1px solid var(--line);
  background: var(--h4pe-canvas);
}
.h4pe-studio #h4pe-canvas {
  min-height: 330px;
  max-height: 510px;
  background: var(--h4pe-surface);
  border: 1px solid var(--line);
  border-radius: var(--h4pe-radius);
}
.h4pe-studio .h4pe-preview-caption {
  align-items: center;
  gap: 10px;
}
.h4pe-studio #three-help {
  font-size: 12px;
  line-height: 1.6;
  margin-block: 12px;
}
.h4pe-studio #reset-3d {
  font-size: 12px;
}
.h4pe-studio .h4pe-history {
  margin: 0;
}
.h4pe-studio .h4pe-history button {
  font-size: 12px;
  padding: 8px 10px;
}
.h4pe-studio .h4pe-process-details {
  border: 0;
  margin: 0;
  padding: 0;
  flex: 1;
}
.h4pe-studio .h4pe-process-details summary {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.h4pe-studio .h4pe-process-details p {
  font-size: 12px;
}
.h4pe-studio .h4pe-controls {
  background: var(--h4pe-surface);
  border: 1px solid var(--line);
  border-radius: var(--h4pe-radius);
  padding: 18px;
  max-height: 690px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.h4pe-studio .h4pe-control-cards {
  display: block;
  margin: 0;
}
.h4pe-studio .h4pe-control-card {
  background: transparent;
  padding: 0;
  border: 0;
  border-radius: 0;
  margin: 0 0 20px;
}
.h4pe-studio .h4pe-control-card + .h4pe-control-card {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.h4pe-studio .h4pe-card-heading {
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.h4pe-studio .h4pe-card-heading button {
  font-size: 11px;
  padding: 8px;
  min-height: 38px;
  max-width: none;
}
.h4pe-studio #layers {
  gap: 6px;
  margin-block: 12px;
}
.h4pe-studio #layers button {
  font-size: 12px;
  min-height: 40px;
}
.h4pe-studio .h4pe-upload {
  background: transparent;
  border: 1px dashed var(--line);
  padding: 10px;
  border-radius: var(--h4pe-radius);
}
.h4pe-studio .h4pe-upload input {
  font-size: 11px;
  padding: 4px 0;
  background: transparent;
  color: var(--muted);
}
.h4pe-studio input::file-selector-button {
  background: var(--h4pe-surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px;
  margin-right: 8px;
}
.h4pe-studio .h4pe-control-card .h4pe-note {
  font-size: 11px;
}
.h4pe-studio .h4pe-compact-actions button {
  font-size: 12px;
}
.h4pe-studio .h4pe-model-card .h4pe-range-grid {
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}
.h4pe-studio details {
  margin-top: 12px;
  padding: 8px 0;
}
.h4pe-studio summary {
  font-size: 13px;
}
.h4pe-studio .h4pe-save-bar {
  position: static;
  margin: 0;
  border-color: var(--line);
  border-radius: var(--h4pe-radius);
  background: var(--h4pe-surface);
  box-shadow: none;
  padding: 16px 20px;
  gap: 8px 20px;
  z-index: auto;
}
.h4pe-studio .h4pe-save-bar .h4pe-total strong {
  font-size: 25px;
  letter-spacing: -0.04em;
}
.h4pe-studio .h4pe-save-bar > .h4pe-actions {
  gap: 8px;
}
.h4pe-studio .h4pe-save-bar > .h4pe-actions button {
  font-size: 14px;
  padding: 12px 20px;
}
.h4pe-studio[data-actions-position="top"] .h4pe-save-bar {
  order: -1;
}
.h4pe-studio[data-layout="below"] .h4pe-preview-first {
  grid-template-columns: 1fr;
}
.h4pe-studio[data-layout="below"] .h4pe-controls {
  max-height: none;
}
.h4pe-studio[data-layout="below"] .h4pe-control-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.h4pe-studio[data-layout="below"] .h4pe-control-card + .h4pe-control-card {
  border: 0;
  padding-top: 0;
}
.h4pe-studio .h4pe-control-dialog,
.h4pe-studio .h4pe-proof-dialog {
  color: var(--ink);
  background: var(--paper);
  border-color: var(--line);
  border-radius: var(--h4pe-radius);
  font-family: inherit;
  box-shadow: 0 24px 100px #0009;
}
.h4pe-studio .h4pe-control-dialog::backdrop,
.h4pe-studio .h4pe-proof-dialog::backdrop {
  background: #0009;
}
.h4pe-studio .h4pe-proof-actions {
  background: var(--paper);
}
.h4pe-studio .h4pe-proof-dialog img {
  border-color: var(--line);
}
.h4pe-studio .h4pe-inspector-toggle {
  display: none;
}
.h4pe-studio .h4pe-support-customer {
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
  margin-top: 16px;
}
.h4pe-studio .h4pe-support-customer p {
  color: var(--muted);
  font-size: 12px;
}
.h4pe-studio .h4pe-support-customer a {
  color: var(--green);
}
.h4pe-studio .h4pe-notice {
  color: var(--ink);
  background: var(--h4pe-surface);
  border-color: var(--green);
}
@container (max-width: 850px) {
  .h4pe-studio .h4pe-preview-first {
    grid-template-columns: 1fr;
  }
  .h4pe-studio .h4pe-layout > .h4pe-controls {
    display: none;
  }
  .h4pe-studio .h4pe-inspector-toggle {
    display: block;
    width: 100%;
    margin: 0 0 12px;
    border-color: var(--green);
  }
  .h4pe-studio .h4pe-inspector-dialog .h4pe-controls {
    display: block;
    max-height: none;
    border: 0;
    padding: 0;
    background: transparent;
  }
  .h4pe-studio .h4pe-inspector-dialog .h4pe-control-cards {
    display: block;
  }
  .h4pe-studio .h4pe-inspector-dialog {
    width: min(540px, calc(100vw - 24px));
    max-height: 88svh;
  }
}
@container (max-width: 500px) {
  .h4pe-studio .h4pe-product-bar {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .h4pe-studio .h4pe-product-bar > :first-child {
    grid-column: 1 / -1;
  }
  .h4pe-studio .h4pe-preview-head {
    flex-wrap: nowrap;
  }
  .h4pe-studio .h4pe-preview-tabs {
    width: auto;
    flex: 0 0 auto;
    max-width: 52%;
  }
  .h4pe-studio #preview-title {
    font-size: 14px;
  }
  .h4pe-studio .h4pe-tools {
    gap: 4px;
  }
  .h4pe-studio .h4pe-tools button {
    font-size: 11px;
    padding: 8px;
  }
  .h4pe-studio #product-3d {
    height: 330px;
  }
  .h4pe-studio .h4pe-preview-caption {
    flex-wrap: wrap;
  }
  .h4pe-studio .h4pe-history {
    gap: 6px;
  }
  .h4pe-studio .h4pe-save-bar {
    padding: 12px;
    margin: 0;
  }
  .h4pe-studio .h4pe-save-bar > .h4pe-actions {
    display: flex;
    flex-wrap: wrap;
  }
  .h4pe-studio .h4pe-save-bar > .h4pe-actions button {
    flex: 1 0 auto;
    padding: 12px;
    font-size: 13px;
  }
  .h4pe-studio .h4pe-save-bar #editor-feedback {
    display: block;
  }
}
