:root {
  --bg: #fff7f2;
  --ink: #2a211d;
  --muted: #7a6259;
  --line: #ead4c8;
  --panel: #ffffff;
  --accent: #d85a3a;
  --accent-strong: #aa3d27;
  --orange: #f38b55;
  --danger: #b42318;
  --shadow: 0 18px 45px rgba(118, 61, 42, 0.14);
  --sticky-actions-height: 58px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family: "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
label {
  -webkit-tap-highlight-color: transparent;
}

.topbar {
  display: grid;
  gap: 12px;
  padding: 16px clamp(16px, 3vw, 34px) 14px;
  border-bottom: 1px solid #f0c6b7;
  background:
    radial-gradient(circle at 82% 20%, rgba(255, 255, 255, 0.82), transparent 28%),
    linear-gradient(105deg, rgba(255, 251, 247, 0.98) 0%, rgba(255, 226, 212, 0.96) 56%, rgba(244, 143, 111, 0.88) 100%);
  color: var(--ink);
  box-shadow: 0 10px 28px rgba(154, 72, 45, 0.12);
}

.topbar-hero {
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) minmax(380px, 1.15fr);
  gap: clamp(16px, 4vw, 36px);
  align-items: center;
}

.topbar-copy p:not(.kicker) {
  max-width: 680px;
  margin: 8px 0 0;
  color: #6d4a3e;
  font-size: 14px;
  line-height: 1.65;
  font-weight: 700;
}

.draft-notice {
  display: inline-flex;
  align-items: center;
  max-width: 720px;
  margin-top: 12px;
  padding: 9px 11px;
  border: 1px solid rgba(216, 90, 58, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  color: #6a3a2c;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.topbar-visual {
  position: relative;
  min-height: 150px;
  aspect-ratio: 3 / 1;
  overflow: hidden;
  border: 1px solid rgba(170, 61, 39, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 247, 242, 0.04), rgba(255, 247, 242, 0.18)),
    url("generated-assets/customizer-before-after.png") center / cover no-repeat;
  box-shadow: 0 14px 32px rgba(118, 61, 42, 0.18);
}

.topbar-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 68%, rgba(42, 33, 29, 0.12));
  pointer-events: none;
}

.topbar-visual > * {
  display: none;
}

.topbar h1,
.preview-heading h2,
.control-title h2 {
  margin: 0;
}

.topbar h1 {
  font-size: clamp(20px, 4vw, 34px);
  line-height: 1.1;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 10px;
}

.action-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: var(--sticky-actions-height);
  padding: 8px clamp(12px, 3vw, 34px);
  background: rgba(255, 247, 242, 0.97);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid #f0c6b7;
  box-shadow: 0 4px 14px rgba(154, 72, 45, 0.1);
}

.kicker,
.section-label {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.editor-shell {
  display: grid;
  grid-template-columns: 82px 350px minmax(460px, 1fr) 260px;
  height: calc(100vh - 185px);
  min-height: 680px;
  overflow: hidden;
  background: #fff3eb;
}

.tool-rail {
  position: sticky;
  top: var(--sticky-actions-height);
  z-index: 80;
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: calc(100vh - var(--sticky-actions-height));
  overflow-y: auto;
  padding: 14px 8px;
  border-right: 1px solid var(--line);
  background: #fff8f3;
  box-shadow: 8px 0 18px rgba(118, 61, 42, 0.05);
}

.tool-rail button {
  display: grid;
  place-items: center;
  min-height: 64px;
  padding: 8px 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #865244;
  font-size: 12px;
  line-height: 1.25;
}

.tool-rail button.is-active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(216, 90, 58, 0.24);
}

.side-panel,
.order-panel {
  min-width: 0;
  border-right: 1px solid var(--line);
  background: #fffdfa;
}

.side-panel {
  overflow: auto;
  padding: 18px;
}

.order-panel {
  overflow: auto;
}

.panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-head p {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.panel-head h2 {
  margin: 0;
  font-size: 21px;
}

.panel-note {
  margin: -2px 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.strong-note {
  margin-top: 10px;
  padding: 10px 11px;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  background: #fff5ed;
  color: #73351f;
  font-weight: 800;
}

.policy-note {
  padding: 10px 11px;
  border: 1px solid rgba(180, 35, 24, 0.14);
  border-radius: 8px;
  background: #fff8f4;
  color: #703727;
  font-weight: 800;
}

.legal-consent {
  margin-top: 14px;
  padding: 13px;
  border: 1px solid rgba(216, 90, 58, 0.18);
  border-radius: 8px;
  background: #fff8f4;
}

.legal-consent label {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  color: #703727;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.55;
}

.legal-consent input {
  margin-top: 3px;
  accent-color: var(--accent);
}

.legal-inline-links,
.legal-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.legal-inline-links {
  margin: 9px 0 0;
  font-size: 12px;
}

.legal-inline-links a,
.legal-footer-links a {
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
}

.legal-inline-links a:hover,
.legal-footer-links a:hover {
  text-decoration: underline;
}

.panel-view[hidden] {
  display: none;
}

.preview-panel,
.controls-panel {
  min-width: 0;
}

.preview-panel {
  display: grid;
  grid-template-rows: auto auto auto auto auto minmax(0, 1fr);
  align-self: stretch;
  min-height: 0;
  padding: 14px;
  background: #fffaf6;
}

.preview-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.preview-heading h2 {
  font-size: clamp(21px, 3vw, 32px);
}

.estimate-badge {
  min-width: 126px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 22px rgba(23, 32, 51, 0.08);
  text-align: right;
}

.estimate-badge span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.estimate-badge strong {
  display: block;
  margin-top: 2px;
  font-size: 24px;
  line-height: 1;
}

body:not(.show-estimate-ui) .estimate-badge,
body:not(.show-estimate-ui) .next-card > p:first-child,
body:not(.show-estimate-ui) .next-card > #sideTotalPrice {
  display: none;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  max-width: 270px;
  margin-bottom: 12px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff0e8;
}

.segmented button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.segmented button.is-active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(23, 32, 51, 0.12);
}

.preview-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.preview-tools button {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 13px;
}

.preview-tools span {
  min-width: 54px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.stage-shell {
  display: grid;
  place-items: center;
  /* ヘッダーやバナーの高さを引いて、商品全体が必ず画面内に収まる高さにする（全画面にしなくても全体が見える）。 */
  min-height: min(540px, calc(100vh - 300px));
  padding: clamp(6px, 1.4vw, 12px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffe9dc;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.stage-shell:fullscreen {
  width: 100vw;
  height: 100vh;
  padding: 8px;
  border: 0;
  border-radius: 0;
  background: #ffe9dc;
}

.stage-shell:fullscreen .garment-stage {
  width: min(96vw, calc(75vh - 12px), 1180px);
  max-height: none;
}

.preview-panel:fullscreen {
  width: 100vw;
  height: 100vh;
  padding: 10px;
  background: #fffaf6;
  overflow: hidden;
}

.preview-panel:fullscreen .stage-shell {
  min-height: calc(100vh - 170px);
}

.preview-panel:fullscreen .garment-stage {
  width: min(96vw, calc(75vh - 136px), 1180px);
  max-height: none;
}

body.has-expanded-preview {
  overflow: hidden;
}

.preview-panel.is-expanded {
  position: fixed;
  inset: 0;
  z-index: 30;
  width: 100vw;
  height: 100vh;
  padding: 10px;
  background: #fffaf6;
  overflow: hidden;
}

.preview-panel.is-expanded .stage-shell {
  min-height: calc(100vh - 170px);
}

.preview-panel.is-expanded .garment-stage {
  width: min(96vw, calc(75vh - 136px), 1180px);
  max-height: none;
}

.garment-stage {
  position: relative;
  width: auto;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  contain: layout paint;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.65) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.65) 1px, transparent 1px),
    #fff6ef;
  background-size: 36px 36px;
  touch-action: none;
  transform: scale(var(--preview-zoom, 1));
  transform-origin: center;
  transition: transform 140ms ease;
}

.garment-svg-layer,
.zone-overlay,
.layer-canvas {
  position: absolute;
  inset: 0;
}

.snap-guide {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  background: rgba(22, 163, 74, 0.78);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.78), 0 0 14px rgba(22, 163, 74, 0.45);
}

.snap-guide-x {
  top: 4%;
  bottom: 4%;
  width: 2px;
  transform: translateX(-50%);
}

.snap-guide-y {
  left: 4%;
  right: 4%;
  height: 2px;
  transform: translateY(-50%);
}

.garment-svg-layer svg {
  display: block;
  width: 100%;
  height: 100%;
  /* 拡大しない。viewBoxが枠と同じ縦横比なので商品全体がぴったり収まり、一切見切れない。 */
  transform: none;
  transform-origin: center;
}

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

.embroidery-zone {
  position: absolute;
  box-sizing: border-box;
  border: 2px dashed rgba(22, 163, 74, 0.95);
  background: rgba(22, 163, 74, 0.12);
  border-radius: 6px;
  pointer-events: none;
  z-index: 2;
}

.embroidery-zone-label {
  position: absolute;
  top: -11px;
  left: 6px;
  padding: 1px 7px;
  background: #16a34a;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.6;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(22, 101, 52, 0.3);
}

.stage-note {
  justify-self: center;
  width: min(100%, 720px);
  margin: 3px 0 5px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(78, 45, 33, 0.9);
  color: #fff;
  font-size: 12.5px;
  line-height: 1.4;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 6px 16px rgba(42, 33, 29, 0.16);
}

.placement-size-guide {
  justify-self: center;
  width: min(100%, 720px);
  margin: -2px 0 6px;
  padding: 6px 12px;
  border: 1px solid #f0d1c4;
  border-radius: 8px;
  background: #fff8f3;
  color: #7c3f21;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.45;
  text-align: center;
}

.placement-size-guide:empty {
  display: none;
}

.placement-size-guide strong {
  font-weight: 900;
}

.placement-size-guide span {
  display: inline-block;
  margin-left: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.base-thread-box {
  margin: 2px 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf6;
}

.base-thread-grid {
  margin-top: 8px;
}

.base-thread-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.base-thread-note {
  margin: 6px 0 0;
  color: #b45309;
  font-size: 12px;
  font-weight: 800;
}

.base-thread-note:empty {
  display: none;
}

.design-layer {
  position: absolute;
  display: inline-grid;
  place-items: center;
  box-sizing: border-box;
  min-width: 10px;
  min-height: 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: grab;
  line-height: 1.08;
  text-align: center;
  touch-action: none;
  user-select: none;
  transform-origin: center;
  filter: drop-shadow(0 2px 2px rgba(17, 24, 39, 0.24));
}

.design-layer:active {
  cursor: grabbing;
}

.design-layer.is-active {
  border-color: var(--accent);
  outline: 3px solid rgba(216, 90, 58, 0.18);
  background: rgba(255, 255, 255, 0.22);
}

.layer-controls {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.layer-delete-button {
  position: absolute;
  right: -34px;
  top: -34px;
  z-index: 6;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  box-shadow: 0 3px 12px rgba(42, 33, 29, 0.32);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  pointer-events: auto;
  touch-action: manipulation;
}

.layer-delete-button::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
}

.layer-rotate-line {
  position: absolute;
  left: 50%;
  top: -30px;
  width: 2px;
  height: 28px;
  background: rgba(216, 90, 58, 0.8);
  transform: translateX(-50%);
}

.layer-handle {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(42, 33, 29, 0.28);
  pointer-events: auto;
  touch-action: none;
}

.layer-handle::after {
  content: "";
  position: absolute;
  top: -12px;
  left: -12px;
  right: -12px;
  bottom: -12px;
  background: transparent;
  pointer-events: auto;
  touch-action: none;
}

.layer-handle-nw {
  left: 0;
  top: 0;
  cursor: nwse-resize;
  transform: translate(-50%, -50%);
}

.layer-handle-ne {
  right: 0;
  top: 0;
  cursor: nesw-resize;
  transform: translate(50%, -50%);
}

.layer-handle-se {
  right: 0;
  bottom: 0;
  cursor: nwse-resize;
  transform: translate(50%, 50%);
}

.layer-handle-sw {
  left: 0;
  bottom: 0;
  cursor: nesw-resize;
  transform: translate(-50%, 50%);
}

.layer-handle-n,
.layer-handle-s,
.layer-handle-e,
.layer-handle-w {
  width: 22px;
  height: 14px;
  border-radius: 7px;
  background: #fff;
  border: 2px solid var(--accent);
}

.layer-handle-n {
  left: 50%;
  top: 0;
  cursor: ns-resize;
  transform: translate(-50%, -50%);
}

.layer-handle-s {
  left: 50%;
  bottom: 0;
  cursor: ns-resize;
  transform: translate(-50%, 50%);
}

.layer-handle-e {
  right: 0;
  top: 50%;
  width: 14px;
  height: 22px;
  cursor: ew-resize;
  transform: translate(50%, -50%);
}

.layer-handle-w {
  left: 0;
  top: 50%;
  width: 14px;
  height: 22px;
  cursor: ew-resize;
  transform: translate(-50%, -50%);
}

.layer-handle-rotate {
  left: 50%;
  top: -42px;
  background: #f6a21a;
  cursor: grab;
  transform: translate(-50%, -50%);
}

.layer-handle-rotate:active {
  cursor: grabbing;
}

.text-layer {
  display: inline-grid;
  place-items: center;
  padding: 0;
  box-sizing: border-box;
  font-weight: 800;
  white-space: pre;
  -webkit-text-stroke: 0.3px rgba(17, 24, 39, 0.22);
}

.layer-text-content {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
  height: 100%;
  padding: 0;
  box-sizing: border-box;
  line-height: 1.08;
  text-align: center;
}

.text-layer:not(.is-vertical-text) .layer-text-content > br {
  flex-basis: 100%;
  height: 0;
}

.text-layer.is-vertical-text {
  display: inline-grid;
  place-items: center;
  max-height: none;
  max-width: none;
  white-space: normal;
  overflow: visible;
}

.text-layer.is-vertical-text .layer-text-content {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  line-height: 1.05;
}

.text-layer.is-vertical-text .layer-text-content > span {
  display: block;
}

.text-layer.is-vertical-text .layer-text-content > br {
  display: none;
}

.image-layer {
  width: 88px;
  height: 88px;
  padding: 5px;
  background: rgba(255, 255, 255, 0.42);
}

.image-layer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.motif-layer {
  width: 84px;
  height: 54px;
  border: 2px dashed currentColor;
  background: rgba(255, 255, 255, 0.28);
  color: var(--orange);
  font-weight: 900;
  font-size: 13px;
}

.quick-tools,
.submit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.quick-text-box,
.upload-box {
  display: grid;
  gap: 9px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid #f0d1c4;
  border-radius: 8px;
  background: #fff8f3;
}

.upload-accordion {
  margin: 8px 0 10px;
}

.upload-accordion summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  width: fit-content;
  padding: 7px 11px;
  border: 1px solid #f0c6b7;
  border-radius: 999px;
  background: #fff7f1;
  color: var(--accent-strong);
  cursor: pointer;
  font-weight: 900;
  font-size: 13px;
  list-style: none;
}

.upload-accordion summary::-webkit-details-marker {
  display: none;
}

.upload-accordion summary::after {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #f1d8cd;
  color: #7c3f21;
  font-size: 13px;
  line-height: 1;
}

.upload-accordion[open] summary {
  margin-bottom: 8px;
  border-color: rgba(216, 90, 58, 0.35);
  background: #fff0e8;
}

.upload-accordion[open] summary::after {
  content: "-";
}

.upload-accordion .upload-box {
  margin-bottom: 0;
}

.quick-text-box .field-label,
.upload-box .field-label {
  margin: 0;
}

.quick-add-note {
  margin: 0;
  font-weight: 800;
}

.size-sample-accordion {
  margin: 4px 0 8px;
  border: 1px solid #f0c6b7;
  border-radius: 8px;
  background: #fffdfb;
  overflow: hidden;
}

.size-sample-accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  padding: 10px 12px;
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  list-style: none;
}

.size-sample-accordion summary::-webkit-details-marker {
  display: none;
}

.size-sample-accordion summary::after {
  content: "+";
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f1d8cd;
  color: #7c3f21;
  line-height: 1;
}

.size-sample-accordion[open] summary::after {
  content: "-";
}

.size-sample-grid {
  display: grid;
  gap: 8px;
  padding: 0 10px 10px;
}

.size-sample-card {
  display: grid;
  grid-template-columns: 98px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 9px;
  border: 1px solid #f3d8cd;
  border-radius: 8px;
  background: #fff8f3;
}

.size-sample-card h3 {
  margin: 0 0 4px;
  color: #3a261f;
  font-size: 13px;
  line-height: 1.35;
}

.size-sample-card p,
.sample-note {
  margin: 0;
  color: #7a4a3d;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.sample-note {
  padding: 0 11px 11px;
}

.sample-figure {
  position: relative;
  min-height: 82px;
  border: 1px solid #efd3c5;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(244, 143, 111, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(244, 143, 111, 0.08) 1px, transparent 1px),
    #fff;
  background-size: 16px 16px;
}

.sample-figure::before {
  content: "";
  position: absolute;
  inset: 10px 22px 8px;
  border: 3px solid #263241;
  border-radius: 8px 8px 16px 16px;
  background: #fffdfb;
}

.sample-shirt::before {
  clip-path: polygon(34% 0, 66% 0, 82% 18%, 96% 34%, 82% 46%, 72% 36%, 77% 100%, 23% 100%, 28% 36%, 18% 46%, 4% 34%, 18% 18%);
}

.sample-cap::before {
  inset: 18px 13px 28px;
  border-radius: 48px 48px 14px 14px;
}

.sample-cap::after {
  content: "";
  position: absolute;
  left: 23px;
  right: 23px;
  bottom: 12px;
  height: 22px;
  border: 3px solid #263241;
  border-top: 0;
  border-radius: 0 0 44px 44px;
  background: #fffdfb;
}

.sample-frame::before {
  inset: 8px 18px;
  clip-path: none;
  border-color: #8b5a3f;
  border-width: 5px;
  border-radius: 5px;
}

.sample-mark {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  min-width: 42px;
  min-height: 20px;
  padding: 2px 4px;
  border: 1px dashed #d85a3a;
  border-radius: 5px;
  background: rgba(255, 240, 232, 0.9);
  color: #9d3a25;
  font-size: 9px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
}

.sample-chest {
  top: 27px;
  left: 30px;
}

.sample-back {
  right: 16px;
  bottom: 16px;
  min-width: 54px;
  min-height: 24px;
}

.sample-cap-front {
  top: 33px;
  left: 20px;
  right: 20px;
  min-height: 24px;
}

.sample-cap-side {
  right: 5px;
  bottom: 8px;
  min-width: 48px;
}

.sample-a5 {
  left: 22px;
  top: 24px;
  min-height: 36px;
}

.sample-a4 {
  right: 14px;
  top: 15px;
  min-height: 54px;
}

.input-attention {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(216, 90, 58, 0.2);
}

.upload-button-strong {
  width: 100%;
}

.text-layout-group {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.text-layout-group button {
  min-height: 34px;
  padding: 6px 7px;
  border: 1px solid #efc8b7;
  border-radius: 8px;
  background: #fff;
  color: #6d4a3e;
  font-size: 12px;
  font-weight: 900;
}

.text-layout-group button.is-active {
  border-color: var(--accent);
  background: #fff0e8;
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 2px rgba(216, 90, 58, 0.14);
}

.text-layout-group .primary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.upload-button-strong {
  min-height: 50px;
  border-color: rgba(216, 90, 58, 0.36);
  background: #fff;
  color: var(--accent-strong);
}

.upload-box .panel-note {
  margin: 0;
}

.upload-status {
  display: none;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.upload-status.is-visible {
  display: block;
}

.upload-status.is-error {
  border: 1px solid rgba(180, 35, 24, 0.24);
  background: #fff0ed;
  color: #7f1d1d;
}

.upload-status.is-success {
  border: 1px solid rgba(5, 150, 105, 0.24);
  background: #ecfdf5;
  color: #065f46;
}

button,
.upload-button,
.primary-button,
.secondary-link,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
}

button:hover,
.upload-button:hover,
.primary-button:hover,
.secondary-link:hover,
.ghost-button:hover {
  border-color: #9aa8ba;
}

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

.primary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

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

.ghost-button {
  border-color: rgba(170, 61, 39, 0.26);
  background: rgba(255, 255, 255, 0.58);
  color: #7b3426;
}

.guide-link {
  min-height: 40px;
  padding: 9px 14px;
  border-color: rgba(13, 148, 136, 0.42);
  background: #e6fffa;
  color: #0f766e;
  font-weight: 900;
  font-size: 14px;
  box-shadow: 0 8px 18px rgba(13, 148, 136, 0.12);
}

.guide-link:hover {
  border-color: #0f766e;
  background: #ccfbf1;
  color: #0b5f59;
}

.danger-button {
  border-color: rgba(180, 35, 24, 0.35);
  color: var(--danger);
}

.text-button {
  min-height: auto;
  padding: 6px 9px;
  color: var(--accent);
  font-size: 12px;
}

.upload-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.controls-panel {
  display: grid;
  gap: 14px;
}

.control-section {
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--panel);
}

.control-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.control-title span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e6fbf7;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 900;
}

.control-title h2 {
  font-size: 17px;
}

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

.side-panel .option-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.product-option {
  display: grid;
  align-content: center;
  gap: 3px;
  min-height: 54px;
  padding: 8px 6px;
  text-align: center;
}

.product-option strong {
  font-size: 13px;
  line-height: 1.25;
}

.product-option.is-active,
.size-row button.is-active,
.swatch-button.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(216, 90, 58, 0.16);
}

.product-option small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.25;
}

.swatch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 12px;
}

.swatch-button {
  display: grid;
  grid-template-columns: 22px auto;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}

.swatch-dot {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(17, 24, 39, 0.24);
  border-radius: 50%;
}

.size-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.field-label,
.field-label-row {
  display: block;
  margin: 12px 0 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

textarea {
  padding: 10px;
  resize: vertical;
}

select {
  min-height: 42px;
  padding: 0 10px;
}

.char-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.char-chip {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.34);
}

.char-chip.is-active {
  outline: 3px solid rgba(242, 107, 33, 0.32);
  border-color: var(--orange);
}

.thread-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.thread-button {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 7px;
  font-size: 12px;
  text-align: left;
}

.thread-dot {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(17, 24, 39, 0.25);
  border-radius: 50%;
}

.thread-button.is-active {
  border-color: #2a211d;
  box-shadow: 0 0 0 2px #2a211d inset;
  font-weight: 800;
}

.thread-button.is-active .thread-dot {
  border-color: #2a211d;
  box-shadow: 0 0 0 2px #fff inset;
}

.dimension-input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff8f4;
}

.dimension-input-grid[hidden] {
  display: none;
}

.dimension-input-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dimension-input-grid input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 9px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

.dimension-input-grid button {
  grid-column: 1 / -1;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: #f1d8cd;
  color: #7c3f21;
  font-weight: 900;
}

.layer-action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin: 8px 0 10px;
}

.layer-reset-editor {
  min-height: 40px;
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
  font-size: 13px;
  font-weight: 900;
}

.layer-delete-editor {
  min-height: 40px;
  background: #fff7f5;
  font-size: 13px;
  font-weight: 900;
}

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

.price-breakdown {
  display: grid;
  gap: 7px;
}

.price-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #edf1f6;
}

.price-line span:last-child {
  font-weight: 800;
}

.warning-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.warning {
  padding: 9px 10px;
  border-left: 4px solid var(--orange);
  border-radius: 6px;
  background: #fff5ed;
  color: #7a3512;
  font-size: 13px;
  line-height: 1.45;
}

.rank-note {
  padding: 11px 12px;
  border: 1px solid rgba(216, 90, 58, 0.24);
  border-radius: 8px;
  background: #fffaf6;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.dimension-readout {
  display: grid;
  gap: 5px;
  margin-top: 14px;
  padding: 10px 11px;
  border: 1px solid #f0c6b7;
  border-radius: 8px;
  background: #fffaf6;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}

.dimension-readout strong {
  font-size: 14px;
}

.layer-warning-box {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.layer-warning-box:empty {
  display: none;
}

.layer-warning {
  padding: 9px 10px;
  border-left: 4px solid var(--danger);
  border-radius: 6px;
  background: #fff0ed;
  color: #7f1d1d;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 800;
}

.request-box,
.order-checklist,
.order-options,
.customer-form {
  display: grid;
  gap: 9px;
  margin-top: 12px;
  padding: 11px;
  border: 1px solid #f0c6b7;
  border-radius: 8px;
  background: #fffaf6;
}

.order-options {
  gap: 12px;
  border-color: rgba(216, 90, 58, 0.18);
  border-radius: 12px;
  background: #fff8f3;
}

.request-box select,
.request-box textarea,
.quantity-control input,
.team-row input,
.customer-form input,
.customer-form select,
.customer-form textarea {
  width: 100%;
}

.order-checklist h3,
.order-options h3,
.customer-form h3 {
  margin: 0;
  font-size: 15px;
}

.quantity-control,
.team-row label {
  display: grid;
  gap: 5px;
}

.quantity-control span,
.team-row label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.quantity-control input {
  max-width: 180px;
}

.team-order-box {
  border: 1px solid rgba(124, 63, 33, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  padding: 10px;
}

.team-order-box summary {
  cursor: pointer;
  font-weight: 900;
  color: var(--accent-strong);
}

.team-rows {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.team-row {
  display: grid;
  grid-template-columns: minmax(110px, 1.2fr) minmax(72px, 0.7fr) minmax(74px, 0.7fr) minmax(62px, 0.55fr) auto;
  gap: 8px;
  align-items: end;
  padding: 9px;
  border: 1px solid rgba(216, 90, 58, 0.14);
  border-radius: 10px;
  background: #fff;
}

.team-order-actions,
.design-cart-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.team-order-actions {
  margin-top: 10px;
}

.small-action-button {
  min-height: 36px;
  padding: 8px 12px;
}

.team-total-label {
  font-weight: 900;
  color: var(--accent-strong);
}

.design-cart-box,
.design-cart-list,
.design-cart-item {
  display: grid;
  gap: 8px;
}

.design-cart-button {
  justify-self: start;
}

.design-cart-empty,
.design-cart-item {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
}

.design-cart-empty {
  color: var(--muted);
  font-size: 13px;
}

.design-cart-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-weight: 900;
}

.design-cart-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.customer-form label {
  display: grid;
  gap: 5px;
}

.customer-form label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.field-help {
  margin: -2px 0 4px;
  color: #7c5d4c;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.55;
}

.customer-form input,
.customer-form select,
.customer-form textarea,
.quantity-control input,
.team-row input {
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid #efd0c2;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.submit-message {
  display: none;
  margin-top: 12px;
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
}

.submit-message.is-visible {
  display: block;
}

.submit-message.is-error {
  border: 1px solid rgba(180, 35, 24, 0.24);
  background: #fff0ed;
  color: #7f1d1d;
}

.submit-message.is-success {
  border: 1px solid rgba(5, 150, 105, 0.24);
  background: #ecfdf5;
  color: #065f46;
}

.draft-modal[hidden] {
  display: none;
}

.draft-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(42, 33, 29, 0.46);
}

.draft-modal-card {
  width: min(520px, 100%);
  padding: 24px;
  border: 1px solid rgba(216, 90, 58, 0.22);
  border-radius: 8px;
  background: #fffdfa;
  box-shadow: 0 24px 70px rgba(42, 33, 29, 0.25);
}

.draft-modal-card h2 {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.35;
}

.draft-modal-card p:not(.kicker) {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.draft-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.customizer-footer {
  display: grid;
  gap: 12px;
  justify-items: center;
  padding: 18px clamp(16px, 3vw, 34px) 24px;
  border-top: 1px solid var(--line);
  background: #fff8f3;
}

.footer-home-link a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid rgba(170, 61, 39, 0.24);
  border-radius: 8px;
  background: #fff;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.footer-home-link a:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.legal-footer-links {
  justify-content: center;
  font-size: 13px;
}

.submit-request-button {
  flex-basis: 100%;
  min-height: 52px;
  font-size: 15px;
}

.check-list-text {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
}

.check-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.check-row-confirm {
  margin-top: 4px;
  padding: 10px;
  border: 1px solid #f0c6b7;
  border-radius: 8px;
  background: #fff1e8;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.check-row input {
  margin-top: 2px;
  accent-color: var(--accent);
}

.empty-editor,
.fine-print {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.editor-heading {
  margin-bottom: 10px;
  padding: 10px 11px;
  border: 1px solid #f0d1c4;
  border-radius: 8px;
  background: #fff8f3;
}

.editor-heading strong {
  display: block;
  color: #7c3f21;
  font-size: 14px;
  font-weight: 900;
}

.editor-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.summary-box {
  min-height: 170px;
  background: #f8fafc;
  font-family: "Consolas", "Yu Gothic", monospace;
  font-size: 13px;
  line-height: 1.55;
}

.order-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
  border-right: 0;
  border-left: 1px solid var(--line);
}

.next-card,
.mini-help {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.next-card {
  display: grid;
  gap: 12px;
}

.next-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.next-card strong {
  font-size: 28px;
  line-height: 1;
}

.finish-image-card {
  display: grid;
  gap: 10px;
  margin-top: 2px;
  padding-top: 12px;
  border-top: 1px solid #edf1f6;
}

.finish-image-card[hidden] {
  display: none;
}

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

.finish-image-head p {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}

.finish-image-head span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff0e8;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
}

.finish-image-card img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff7f2;
}

.finish-image-card .secondary-link {
  width: 100%;
}

.mini-help h2 {
  margin: 0 0 10px;
  font-size: 16px;
}

.mini-help ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 19px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.site-landing {
  background: #fff7f2;
}

.landing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(16px, 5vw, 56px);
  border-bottom: 1px solid #f0c6b7;
  background:
    linear-gradient(105deg, rgba(255, 251, 247, 0.98) 0%, rgba(255, 226, 212, 0.96) 55%, rgba(244, 142, 111, 0.88) 100%);
  color: var(--ink);
  box-shadow: 0 10px 28px rgba(154, 72, 45, 0.1);
}

.landing-header h1 {
  margin: 0;
  font-size: clamp(22px, 4vw, 38px);
  line-height: 1.15;
}

.landing-main {
  display: grid;
  gap: clamp(22px, 4vw, 42px);
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(22px, 5vw, 54px) 0 96px;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: clamp(24px, 5vw, 54px);
  min-height: 360px;
  align-items: center;
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid #f0c6b7;
  border-radius: 8px;
  background:
    linear-gradient(105deg, rgba(255, 250, 246, 0.98) 0%, rgba(255, 230, 215, 0.92) 48%, rgba(244, 137, 102, 0.64) 100%),
    linear-gradient(135deg, #fffdf9 0%, #ffe2d3 55%, #f5a183 100%);
  color: var(--ink);
  overflow: hidden;
  box-shadow: 0 18px 42px rgba(171, 77, 46, 0.15);
}

.landing-hero > div {
  max-width: 660px;
}

.landing-preview-card {
  justify-self: end;
  width: min(100%, 340px);
  padding: 18px;
  border: 1px solid rgba(170, 61, 39, 0.18);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.82);
  box-shadow: 0 18px 36px rgba(118, 61, 42, 0.14);
}

.mini-garment {
  position: relative;
  width: min(100%, 240px);
  aspect-ratio: 3 / 4;
  margin: 0 auto;
  border: 2px solid rgba(42, 33, 29, 0.16);
  border-radius: 24px 24px 12px 12px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.42), transparent 30%, rgba(255, 255, 255, 0.28) 58%, transparent),
    #fff;
  box-shadow: inset 0 -18px 32px rgba(42, 33, 29, 0.08);
}

.mini-garment::before,
.mini-garment::after {
  content: "";
  position: absolute;
  top: 20%;
  width: 35%;
  height: 25%;
  border: 2px solid rgba(42, 33, 29, 0.14);
  background: inherit;
}

.mini-garment::before {
  left: -25%;
  border-radius: 18px 0 20px 22px;
  transform: rotate(12deg);
}

.mini-garment::after {
  right: -25%;
  border-radius: 0 18px 22px 20px;
  transform: rotate(-12deg);
}

.mini-garment-hoodie {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.24), transparent 36%, rgba(255, 255, 255, 0.22) 62%, transparent),
    #e9a47b;
}

.mini-garment-hoodie::before,
.mini-garment-hoodie::after {
  top: 18%;
  height: 31%;
}

.mini-stitch,
.mini-pet-mark {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  color: var(--accent);
  font-weight: 900;
  line-height: 1;
}

.mini-stitch-chest {
  left: 16%;
  top: 29%;
  font-size: 18px;
}

.mini-stitch-back {
  left: 23%;
  top: 48%;
  padding: 8px 10px;
  border: 2px dashed #f38b55;
  border-radius: 8px;
  color: #2f5d46;
  font-size: 13px;
}

.mini-stitch-small {
  right: 24%;
  top: 33%;
  color: #d6a017;
  font-size: 28px;
}

.mini-pet-mark {
  left: 50%;
  top: 36%;
  width: 82px;
  height: 82px;
  border: 3px dashed #7b3426;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.46);
  color: #7b3426;
  transform: translateX(-50%);
}

.mini-stitch-name {
  left: 50%;
  top: 63%;
  color: #fff;
  font-size: 21px;
  text-shadow: 0 2px 8px rgba(42, 33, 29, 0.28);
  transform: translateX(-50%);
}

.mini-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #f0d1c4;
}

.mini-price span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.mini-price strong {
  color: var(--accent);
  font-size: 24px;
}

.landing-hero h2 {
  margin: 0;
  font-size: clamp(28px, 5vw, 52px);
  line-height: 1.08;
}

.landing-hero p:not(.section-label) {
  max-width: 640px;
  margin: 16px 0 0;
  color: #6d4a3e;
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.75;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.landing-actions .primary-button,
.landing-actions .secondary-link {
  min-width: 168px;
}

.customizer-gateway,
.lp-customizer-insert {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
  gap: clamp(18px, 4vw, 34px);
  align-items: center;
  padding: clamp(22px, 4vw, 36px);
  border: 1px solid #f0d1c4;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 240, 229, 0.92));
  box-shadow: 0 14px 34px rgba(154, 72, 45, 0.09);
}

.customizer-gateway h2,
.lp-customizer-insert h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.18;
}

.customizer-gateway p:not(.section-label),
.lp-customizer-insert p:not(.section-label) {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.gateway-actions,
.insert-actions,
.card-links {
  display: grid;
  gap: 10px;
}

.gateway-button {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid rgba(170, 61, 39, 0.22);
  border-radius: 8px;
  background: #fffdfb;
  color: var(--ink);
  text-decoration: none;
}

.gateway-button span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.gateway-button strong {
  font-size: 18px;
}

.insert-actions {
  grid-template-columns: 1fr;
}

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

.landing-card {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 210px;
  padding: 20px;
  border: 1px solid #f0d1c4;
  border-radius: 8px;
  background: #fffdfb;
  box-shadow: 0 14px 30px rgba(154, 72, 45, 0.08);
}

.landing-card h2,
.landing-card p {
  margin: 0;
}

.landing-card h2 {
  font-size: 21px;
}

.landing-card p {
  color: var(--muted);
  line-height: 1.65;
}

.landing-card strong {
  align-self: end;
  color: var(--accent);
  font-size: 19px;
}

.landing-card a {
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
}

.card-links {
  align-self: end;
}

.landing-sticky-cta {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 20;
  display: flex;
  gap: 10px;
  width: min(520px, calc(100% - 24px));
  padding: 9px;
  border: 1px solid rgba(170, 61, 39, 0.2);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.94);
  box-shadow: 0 16px 34px rgba(118, 61, 42, 0.18);
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
}

.landing-sticky-cta a {
  flex: 1 1 0;
}

@media (max-width: 980px) {
  .editor-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .topbar-hero {
    grid-template-columns: 1fr;
  }

  .topbar-visual {
    width: min(100%, 640px);
  }

  .tool-rail {
    position: sticky;
    top: var(--sticky-actions-height);
    z-index: 90;
    display: grid;
    grid-template-columns: repeat(6, minmax(74px, 1fr));
    overflow-x: auto;
    overflow-y: hidden;
    max-height: none;
    padding: 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 18px rgba(118, 61, 42, 0.1);
  }

  .tool-rail button {
    min-height: 46px;
  }

  .side-panel {
    order: 2;
    border-right: 0;
    border-top: 1px solid var(--line);
  }

  .preview-panel {
    order: 3;
    padding: 14px;
  }

  .order-panel {
    order: 4;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

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

  .landing-card {
    min-height: auto;
  }

  .landing-hero,
  .customizer-gateway,
  .lp-customizer-insert {
    grid-template-columns: 1fr;
  }

  .landing-preview-card {
    justify-self: center;
  }
}

@media (max-width: 640px) {
  .team-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .team-row .danger-button {
    grid-column: 1 / -1;
  }

  .landing-header {
    align-items: start;
    flex-direction: column;
  }

  .topbar h1 {
    font-size: 22px;
  }

  .topbar {
    padding: 14px 12px;
  }

  .topbar-visual {
    min-height: 128px;
  }

  .stage-note {
    padding: 8px 9px;
    font-size: 12px;
    line-height: 1.45;
  }

  .text-layout-group {
    gap: 5px;
  }

  .text-layout-group button {
    min-height: 34px;
    padding-inline: 5px;
    font-size: 11px;
  }

  .ghost-button {
    min-width: 72px;
    padding-inline: 10px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: start;
  }

  .side-panel .option-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .preview-heading {
    align-items: stretch;
  }

  .estimate-badge {
    min-width: 108px;
    padding: 9px 10px;
  }

  .estimate-badge strong {
    font-size: 21px;
  }

  .stage-shell {
    margin-inline: -6px;
  }

  .quick-tools,
  .submit-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

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

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

  .preview-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .preview-tools span {
    grid-column: 1 / -1;
    order: -1;
    width: 100%;
  }

  .size-row {
    grid-template-columns: repeat(5, minmax(42px, 1fr));
  }

  .landing-main {
    width: min(100% - 24px, 1120px);
  }

  .landing-hero {
    min-height: 430px;
    padding: 22px;
  }

  .landing-preview-card {
    width: min(100%, 280px);
    padding: 14px;
  }

  .mini-garment {
    width: min(100%, 188px);
  }

  .customizer-gateway,
  .lp-customizer-insert {
    padding: 18px;
  }

  .landing-actions,
  .landing-actions .primary-button,
  .landing-actions .secondary-link {
    width: 100%;
  }

  .landing-sticky-cta {
    bottom: 8px;
  }

  .landing-sticky-cta a {
    min-height: 44px;
    padding-inline: 8px;
    font-size: 14px;
  }
}

/* ===== 実物イメージ（AI実写プレビュー） ===== */
.realistic-button {
  background: linear-gradient(135deg, var(--accent) 0%, var(--orange) 100%);
  position: relative;
}

.realistic-button:disabled {
  opacity: 0.72;
  cursor: progress;
}

.realistic-image-card {
  border-top: 1px dashed var(--line);
}

.realistic-image-card img {
  width: 100%;
  display: block;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.realistic-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 4px;
  font-size: 0.86rem;
  color: var(--muted);
}

.realistic-loading[hidden] {
  display: none;
}

.realistic-spinner {
  width: 18px;
  height: 18px;
  flex: none;
  border: 3px solid rgba(216, 90, 58, 0.22);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: hc12-spin 0.9s linear infinite;
}

@keyframes hc12-spin {
  to {
    transform: rotate(360deg);
  }
}
