

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; background: #fff; color: #1a1a1a; font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.45; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.page { max-width: 640px; margin: 0 auto; padding: 16px 16px 48px; }
h1 { font-size: 1.5rem; line-height: 1.25; margin: 0 0 12px; text-align: center; }
h2 { font-size: 1.15rem; line-height: 1.3; margin: 0 0 10px; }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }


.frame { margin: 0 auto 8px; text-align: center; }
.frame img { display: block; max-width: 100%; max-height: 40vh; margin: 0 auto; border-radius: 6px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18); }


.note { margin: 8px auto 12px; max-width: 520px; text-align: center; }
.hint { margin: 10px 0 0; text-align: center; }
.hint:empty { display: none; }
.small { margin: 8px 0 0; color: #444; font-size: 0.95rem; }
.small:empty { display: none; }
.note.error, .hint.error { color: #b00020; font-weight: 600; }



.note.member { margin-top: 0; color: #1b5e20; font-weight: 600; }
.was { margin-left: 8px; color: #555; font-weight: 400; text-decoration: line-through; }
.totals .saving { color: #1b5e20; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }


.step { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid #e0e0e0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.card, .row { display: flex; width: 100%; min-height: 56px; margin: 0; padding: 12px; border: 2px solid #c8c8c8; border-radius: 10px; background: #fff; text-align: left; cursor: pointer; }
.card { flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; }
.card-title { font-weight: 600; overflow-wrap: anywhere; }
.card-from { color: #444; font-size: 0.95rem; }
.row { flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; }
.row-main { font-weight: 600; overflow-wrap: anywhere; }
.row-price { font-weight: 600; white-space: nowrap; }
.row-note { flex-basis: 100%; color: #444; font-size: 0.92rem; }
.row-note:empty { display: none; }
.badge { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; vertical-align: middle; }
.badge.sharp { background: #e3f1e4; color: #1b5e20; }
.badge.good { background: #e8eaf6; color: #283593; }
.card[aria-pressed="true"], .row[aria-pressed="true"], .chip[aria-pressed="true"] { border-color: #1b5e20; background: #f1f8f1; box-shadow: inset 0 0 0 1px #1b5e20; }


.choice-group { margin: 0 0 14px; }
.choice-name { display: block; margin: 0 0 6px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 48px; min-width: 48px; padding: 10px 16px; border: 2px solid #c8c8c8; border-radius: 24px; background: #fff; cursor: pointer; }
select { display: block; width: 100%; min-height: 48px; padding: 10px 12px; font: inherit; font-size: 16px; color: #1a1a1a; background: #fff; border: 2px solid #c8c8c8; border-radius: 10px; }
.qty { display: flex; align-items: center; gap: 12px; margin: 6px 0 16px; }
.qty-label { margin-right: auto; font-weight: 600; }
.qty button { width: 48px; height: 48px; padding: 0; border: 2px solid #c8c8c8; border-radius: 50%; background: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.qty output { min-width: 2ch; text-align: center; font-size: 1.15rem; font-weight: 600; }


.primary { display: block; width: 100%; min-height: 52px; padding: 12px 20px; border: 0; border-radius: 26px; background: #2e7d32; color: #fff; font-size: 1.05rem; font-weight: 600; cursor: pointer; }
.primary:disabled { background: #9e9e9e; cursor: default; }
.secondary { display: block; width: 100%; min-height: 48px; margin: 0 0 12px; padding: 10px 16px; border: 2px solid #1a1a1a; border-radius: 24px; background: #fff; cursor: pointer; }
.remove { min-height: 48px; padding: 8px 14px; border: 2px solid #c8c8c8; border-radius: 24px; background: #fff; font-size: 0.92rem; cursor: pointer; }
button:focus-visible, select:focus-visible { outline: 3px solid #1a1a1a; outline-offset: 2px; }


.lines { list-style: none; margin: 0 0 12px; padding: 0; }
.line { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #e0e0e0; }
.line-text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.line-title { display: block; font-weight: 600; }
.line-detail, .line-each { display: block; color: #444; font-size: 0.92rem; }
.line-end { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.line-total { font-weight: 600; white-space: nowrap; }
.country-row { margin: 0 0 12px; }
.country-row label { display: block; margin: 0 0 6px; font-weight: 600; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 0 0 8px; }
.totals dt { margin: 0; }
.totals dd { margin: 0; text-align: right; font-weight: 600; white-space: nowrap; }
.totals .total { font-size: 1.1rem; font-weight: 700; }
.cart .small { margin: 4px 0 12px; }



.crop { position: sticky; top: 0; z-index: 2; margin: 0 -16px 8px; padding: 8px 16px 10px; background: #fff; text-align: center; box-shadow: 0 8px 8px -10px rgba(0, 0, 0, 0.45); }
.crop-box { position: relative; display: inline-block; max-width: 100%; vertical-align: top; text-align: left; line-height: 0; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.crop-box img { display: block; max-width: 100%; max-height: 34vh; width: auto; height: auto; pointer-events: none; -webkit-user-drag: none; }
.crop-box.can-drag { cursor: grab; }
.crop-box.dragging { cursor: grabbing; }
.crop-box.axis-x { touch-action: pan-y; }
.crop-box.axis-y { touch-action: pan-x; }
.crop-box:focus-visible { outline: 3px solid #1a1a1a; outline-offset: 3px; }
.shade { position: absolute; pointer-events: none; background-color: rgba(18, 18, 18, 0.62); background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.22) 0, rgba(255, 255, 255, 0.22) 1px, transparent 1px, transparent 8px); }
.crop-window { position: absolute; border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45); pointer-events: none; }
.inch { position: absolute; padding: 2px 10px; border-radius: 999px; background: rgba(20, 20, 20, 0.8); color: #fff; font-size: 0.85rem; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.inch-w { top: 6px; left: 50%; transform: translateX(-50%); }
.inch-h { left: 6px; top: 50%; transform: translateY(-50%); }
.crop-head { margin: 8px 0 0; font-size: 1.02rem; font-weight: 700; line-height: 1.3; text-align: left; }
.crop .next { margin: 8px 0 0; min-height: 44px; }
.crop-line { margin: 2px 0 0; color: #444; }
.crop-line.small { margin: 0 0 10px; }
.row-note.trim { color: #7a4b0e; }



.row.opt { display: grid; grid-template-columns: minmax(0, 40%) minmax(0, 1fr); align-items: center; gap: 12px; }
.opt-pic { display: block; width: 100%; height: auto; border-radius: 8px; background: #f1eee8; }
.opt-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.opt-line { color: #444; font-size: 0.92rem; }
.row.opt .row-price { white-space: normal; }


.pics { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 0 0 16px; }
.pic { margin: 0; }
.pic-img { display: block; width: 100%; height: auto; border-radius: 10px; background: #f1eee8; }
.pic-caption { display: block; margin-top: 6px; }
.pic-title { display: block; font-weight: 600; }
.pic-line { display: block; color: #444; font-size: 0.92rem; }
.chip { display: inline-flex; align-items: center; gap: 8px; }
.chip .sw { flex: none; width: 24px; height: 24px; border-radius: 6px; }
.color-key { margin: 0 0 16px; padding: 0 12px 10px; border: 1px solid #e0e0e0; border-radius: 10px; }
.color-key summary { min-height: 44px; line-height: 44px; font-weight: 600; cursor: pointer; }
.color-key summary:focus-visible { outline: 3px solid #1a1a1a; outline-offset: 2px; }
.key-name { margin: 12px 0 6px; font-size: 1rem; }
.key-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 16px; margin: 0; padding: 0; list-style: none; }
.key-row { display: flex; align-items: center; gap: 10px; }
.key-sw { flex: none; width: 44px; height: 44px; }
.key-words { display: flex; flex-direction: column; min-width: 0; }
.key-label { font-weight: 600; }
.key-note { color: #444; font-size: 0.9rem; }
.key-frames { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 12px; }
.key-frame { margin: 0; }
.key-frame-img { display: block; width: 100%; height: auto; border-radius: 8px; }
.key-frame-caption { margin-top: 4px; color: #444; font-size: 0.88rem; }



.card.prod, .off-card.prod { display: grid; grid-template-columns: minmax(0, 40%) minmax(0, 1fr); align-items: center; gap: 12px; }
.card.prod .card-from { color: #1a1a1a; font-size: 1rem; font-weight: 600; }
.opt-text { overflow-wrap: anywhere; }
.opt-when { color: #444; font-size: 0.92rem; }
.row > .opt-line, .row > .opt-when { flex-basis: 100%; color: #444; font-size: 0.92rem; }

.zoom { position: relative; display: block; overflow: hidden; }
.zoom::before { content: ""; display: block; padding-top: 62.5%; }
.zoom img { position: absolute; display: block; max-width: none; }

.off-group { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid #e0e0e0; }
.off-head { margin: 0 0 2px; font-size: 1rem; font-weight: 600; line-height: 1.45; }
.off-hint { margin: 0 0 10px; color: #444; }
.off-card, .off-row { display: flex; flex-direction: column; justify-content: center; gap: 2px; width: 100%; min-height: 56px; margin: 0; padding: 13px; border: 1px solid #e2e2e2; border-radius: 10px; background: #f4f4f4; color: #595959; cursor: default; text-align: left; }
.off-row { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.off-row.opt { display: grid; grid-template-columns: minmax(0, 40%) minmax(0, 1fr); align-items: center; gap: 12px; }
.off-card .card-title, .off-row .row-main { font-weight: 600; color: #595959; overflow-wrap: anywhere; }
.off-card .opt-line, .off-row .opt-line { color: #595959; font-size: 0.92rem; }
.off-row > .opt-line { flex-basis: 100%; }
.off-card .opt-pic, .off-row .opt-pic { filter: grayscale(1); opacity: 0.55; }

.detail { margin: 0 0 14px; }
.choice-meaning { margin: 6px 0 0; color: #444; font-size: 0.92rem; }
.crop-line.when { margin: 0 0 10px; }


.choice-words { margin: -2px 0 8px; color: #444; font-size: 0.92rem; }
.chip-label { overflow-wrap: anywhere; }
.chip-price { font-weight: 600; color: #1b5e20; white-space: nowrap; }
.chip-note { font-size: 0.85rem; color: #595959; }
.chip.off { flex-wrap: wrap; border-style: dashed; border-color: #d0d0d0; background: #f4f4f4; color: #595959; cursor: default; }
span.chip.off { min-height: 48px; padding: 10px 16px; border-width: 2px; border-radius: 24px; }
.chip.off .sw { filter: grayscale(1); opacity: 0.55; }
select option:disabled { color: #757575; }
.choice-optional { font-weight: 400; color: #444; }
.choice-text { display: block; width: 100%; box-sizing: border-box; min-height: 72px; padding: 10px 12px; font: inherit; font-size: 16px; color: #1a1a1a; background: #fff; border: 2px solid #c8c8c8; border-radius: 10px; resize: vertical; }
.choice-text:focus-visible { outline: 3px solid #1a1a1a; outline-offset: 2px; }
.choice-hint { margin: 6px 0 0; color: #444; font-size: 0.85rem; }
.choice-price { margin: 0 0 12px; font-weight: 600; }
.choice-price.error { color: #b00020; }
.cart .off-group { margin-top: 12px; }



svg.opt-pic, svg.pic-img, svg.key-sw, svg.key-frame-img, svg.sw { overflow: hidden; }
svg.key-frame-img { border-radius: 8px; }


.thumb { position: relative; display: block; flex: none; align-self: center; overflow: hidden; border-radius: 4px; background: #eee; }
.thumb img { position: absolute; display: block; max-width: none; }



.cal { margin: 0 0 16px; }
.cal-pages { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin: 8px 0 12px; }
.cal-pages.each { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.cal-slot { min-width: 0; }
.cal-page { position: relative; width: 100%; aspect-ratio: 3300 / 2550; overflow: hidden; border: 1px solid #c8c8c8; border-radius: 4px; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.cal-page img { position: absolute; display: block; max-width: none; pointer-events: none; -webkit-user-drag: none; }
.cal-blur { left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(10px) saturate(1.1); transform: scale(1.15); opacity: 0.9; }
.cal-hole { position: absolute; border-radius: 50%; background: #e2e2e2; box-shadow: inset 0 0 0 1px #c8c8c8; pointer-events: none; }
.cal-spiral { position: absolute; background: repeating-linear-gradient(90deg, #d6d6d6 0, #d6d6d6 3px, #f2f2f2 3px, #f2f2f2 7px); pointer-events: none; }
.cal-page.can-drag { cursor: grab; }
.cal-page.dragging { cursor: grabbing; }
.cal-page.axis-x { touch-action: pan-y; }
.cal-page.axis-y { touch-action: pan-x; }
.cal-page:focus-visible { outline: 3px solid #1a1a1a; outline-offset: 3px; }
.cal-name { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; margin: 6px 0; }
.cal-page-name { font-weight: 600; }
.cal-which { color: #444; font-size: 0.92rem; }
.cal-fits, .cal-tools { margin: 0 0 6px; }
.cal-fits .chip, .cal-tools .chip { min-height: 44px; padding: 8px 14px; }
.cal-tools .chip:disabled { color: #757575; border-color: #e0e0e0; cursor: default; }
.cal-strip { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; }
.cal-thumb { position: relative; width: 56px; height: 56px; padding: 0; overflow: hidden; border: 2px solid #c8c8c8; border-radius: 6px; background: #eee; cursor: pointer; }
.cal-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cal-thumb[aria-pressed="true"] { border-color: #1b5e20; box-shadow: inset 0 0 0 1px #1b5e20; }
.cal-thumb-n { position: absolute; right: 2px; bottom: 2px; min-width: 18px; padding: 0 4px; border-radius: 9px; background: rgba(20, 20, 20, 0.8); color: #fff; font-size: 0.75rem; font-weight: 600; line-height: 18px; text-align: center; }
.cal-warn { margin: 4px 0 0; font-size: 0.92rem; }
.cal-warn.error { color: #b00020; font-weight: 600; }
.cal-add { margin: 4px 0 14px; }


.pay { margin-top: 8px; }
#checkout-mount { min-height: 240px; }
.done { margin: 16px 0 0; text-align: center; }
.done p { margin: 0; font-size: 1.1rem; font-weight: 600; }
.done p.small { font-size: 0.95rem; font-weight: 400; }

@media (min-width: 600px) {
  .page { padding-top: 24px; }
  .frame img { max-height: 50vh; }
  .crop-box img { max-height: 46vh; }
}

@media (max-width: 340px) {
  .row.opt, .card.prod, .off-card.prod, .off-row.opt { grid-template-columns: minmax(0, 1fr); }
}


@media (max-height: 520px) and (min-width: 560px) {
  #step-size.with-crop:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 16px; align-items: start; }
  #step-size.with-crop > h2 { grid-column: 1 / -1; }
  #step-size.with-crop > .crop { grid-column: 1; grid-row: 2 / span 4; align-self: start; margin: 0; padding: 0 0 8px; box-shadow: none; }
  #step-size.with-crop > .crop-line, #step-size.with-crop > #sizes { grid-column: 2; }
  .crop-box img { max-height: 62vh; }
  .crop-head { font-size: 0.95rem; }
}
@media (max-height: 520px) and (max-width: 559.98px) {
  .crop { position: static; box-shadow: none; }
}
