/* Originals Studio. Layout: a sticky stage with the artboard, a settings panel beside it (below it on a phone). */
:root {
  --ink: #22272A;
  --paper: #F4F2EC;
  --surface: #FBFAF6;
  --stage: #E6E3DA;
  --line: #D5D1C6;
  --muted: #575E62;
  --brass: #A97F2C;
  --brass-ink: #7D5C17;
  --focus: #1F5F8B;
  --sans: 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --top: 56px;
}
* { box-sizing: border-box; }
.app { font-size: 15px; line-height: 1.45; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:where(.app) button, :where(.app) input, :where(.app) select, :where(.app) textarea, dialog button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: minmax(0, 1fr) 420px; align-items: start; }
.stage { position: sticky; top: 0; height: 100vh; height: 100dvh; background: var(--stage); display: flex; flex-direction: column; min-width: 0; }
.board-wrap { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 28px 28px 8px; }
.stage-tools { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 16px 16px; min-height: 84px; }
.map-tools { display: flex; gap: 6px; }
.map-tools button { min-width: 44px; height: 40px; padding: 0 14px; border: 1px solid var(--line); background: var(--surface); border-radius: 3px; cursor: pointer; font-size: 15px; }
.map-tools button:hover { border-color: var(--ink); }
.hint { margin: 0; font-size: 12.5px; color: var(--muted); text-align: center; }
.panel { background: var(--paper); border-left: 1px solid var(--line); min-width: 0; padding-bottom: 40px; }

/* ---------- artboard ---------- */
#artboard { position: relative; flex: 0 0 auto; background: #f5f4ef; box-shadow: 0 18px 40px rgba(34, 39, 42, 0.18), 0 2px 6px rgba(34, 39, 42, 0.10); overflow: hidden; outline: none; }
#frame { position: absolute; overflow: hidden; }
#map, #photo-empty, #map-status { position: absolute; inset: 0; }
#photo { position: absolute; max-width: none; cursor: grab; touch-action: none; }
#photo:active { cursor: grabbing; }
#photo-empty { display: flex; align-items: center; justify-content: center; text-align: center; padding: 8%; color: var(--muted); border: 1px dashed #A9A59A; background: rgba(255, 255, 255, 0.35); font-size: 13px; }
#photo-empty p { margin: 0; }
#map-status { display: flex; align-items: center; justify-content: center; text-align: center; padding: 8%; font-size: 12.5px; color: var(--muted); pointer-events: none; }
#map .maplibregl-canvas { outline: none; }
.layer { position: absolute; transform: translate(-50%, -50%); cursor: move; touch-action: none; user-select: none; -webkit-user-select: none; }
.layer.text { white-space: pre; line-height: 1.15; }
.layer img { display: block; width: 100%; height: auto; pointer-events: none; -webkit-user-drag: none; }
.guide { position: absolute; background: #D2472E; pointer-events: none; z-index: 8; }
.guide.gv { top: 0; bottom: 0; width: 1px; left: 50%; }
.guide.gh { left: 0; right: 0; height: 1px; top: 50%; }
#selbox { position: absolute; border: 1px solid var(--focus); pointer-events: none; z-index: 9; }
#selbox .handle { position: absolute; right: -9px; bottom: -9px; width: 18px; height: 18px; background: #fff; border: 2px solid var(--focus); border-radius: 50%; pointer-events: auto; cursor: nwse-resize; touch-action: none; }
#selbox .handle::after { content: ''; position: absolute; inset: -13px; }

/* ---------- panel sections ---------- */
.sec { border-bottom: 1px solid var(--line); }
.sec > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 16px 20px; cursor: pointer; font-weight: 600; font-size: 15px; min-height: 52px; }
.sec > summary::-webkit-details-marker { display: none; }
.sec > summary::after { content: ''; margin-left: 8px; width: 8px; height: 8px; border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); transform: rotate(45deg) translateY(-3px); transition: transform 0.15s; flex: 0 0 auto; }
.sec[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.sec .n { font: 500 11px/1 var(--mono); color: var(--muted); width: 14px; }
.sec summary em { margin-left: auto; font-style: normal; font-weight: 400; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.sec-body { padding: 0 20px 20px; display: flex; flex-direction: column; gap: 14px; }
#map-settings, #photo-settings, #logo-controls, #credit-controls, #credit-removed, .search { display: flex; flex-direction: column; gap: 14px; }
.search { gap: 0; }
:where(.app) label, .lbl, legend { font-size: 12.5px; color: var(--muted); display: block; margin-bottom: 5px; padding: 0; }
:where(.app) input[type="text"], :where(.app) input[type="search"], :where(.app) input[type="number"], :where(.app) select, :where(.app) textarea { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 3px; padding: 9px 10px; min-height: 42px; }
:where(.app) textarea { resize: vertical; min-height: 44px; line-height: 1.35; }
:where(.app) input:hover, :where(.app) select:hover, :where(.app) textarea:hover { border-color: #A9A59A; }
.row { display: block; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.note { margin: 0; font-size: 12.5px; color: var(--muted); }

.choice { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.choice button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; min-height: 68px; padding: 8px 4px; border: 1px solid var(--line); background: var(--surface); border-radius: 3px; cursor: pointer; font-size: 12.5px; text-align: center; }
.choice button svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.5; }
.choice button[aria-pressed="true"], .seg button[aria-pressed="true"], .palettes button[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.seg button { min-height: 44px; border: 1px solid var(--line); background: var(--surface); border-radius: 3px; cursor: pointer; font-weight: 500; }
.seg.small { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.seg.small button { min-height: 42px; border-radius: 0; margin-left: -1px; font-size: 13px; }
.seg.small button:first-child { margin-left: 0; border-radius: 3px 0 0 3px; }
.seg.small button:last-child { border-radius: 0 3px 3px 0; }
.seg.small button[aria-pressed="true"] { background: var(--ink); color: var(--paper); box-shadow: none; position: relative; }

.search-row { display: flex; gap: 8px; }
.search-row input { flex: 1 1 auto; min-width: 0; }
.search-row button, .ghost, .file-btn span, .primary { min-height: 42px; padding: 0 14px; border-radius: 3px; cursor: pointer; border: 1px solid var(--ink); background: transparent; font-weight: 500; }
.search-row button { background: var(--ink); color: var(--paper); }
.ghost { border-color: var(--line); background: var(--surface); align-self: flex-start; }
.ghost:hover { border-color: var(--ink); }
.results { list-style: none; margin: 8px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 3px; background: var(--surface); max-height: 240px; overflow: auto; }
.results li + li { border-top: 1px solid var(--line); }
.results button { display: block; width: 100%; text-align: left; padding: 10px 12px; min-height: 44px; background: none; border: 0; cursor: pointer; }
.results button:hover { background: var(--paper); }
.results small { display: block; color: var(--muted); }

.slider { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; align-items: center; }
.slider label { grid-column: 1 / -1; }
.slider output { font: 500 12px/1 var(--mono); color: var(--muted); min-width: 46px; text-align: right; font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; height: 28px; margin: 0; accent-color: var(--ink); background: transparent; }
.checks { border: 0; margin: 0; padding: 0; min-width: 0; }
.checks > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; }
.check { display: flex; align-items: center; gap: 9px; min-height: 36px; margin: 0; font-size: 14px; color: var(--ink); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); flex: 0 0 auto; }

.file-btn { margin: 0; cursor: pointer; display: block; }
.file-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-btn span { display: flex; align-items: center; justify-content: center; color: var(--ink); font-size: 15px; border-style: dashed; }
.file-btn:hover span { background: var(--surface); }
.file-btn input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatches button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(34, 39, 42, 0.35); cursor: pointer; padding: 0; }
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }
.palettes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.palettes button { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding: 10px; min-height: 62px; border: 1px solid var(--line); background: var(--surface); border-radius: 3px; cursor: pointer; font-size: 12.5px; }
.palettes .dots { display: flex; }
.palettes .dots i { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(34, 39, 42, 0.25); margin-right: -5px; }
.colour-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 44px; align-items: center; gap: 10px; min-height: 44px; margin: 0; color: var(--ink); font-size: 14px; }
.colour-row code { font: 400 12px/1 var(--mono); color: var(--muted); }
input[type="color"] { width: 44px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 3px; background: none; cursor: pointer; }

/* text cards */
.tcard { border: 1px solid var(--line); border-radius: 3px; background: var(--surface); }
.tcard.sel { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.tcard-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.tcard-head strong { font: 500 11px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.tcard-head .check { margin-left: auto; font-size: 13px; }
.tcard-body { padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.tcard.off .tcard-body { display: none; }
.tcard select.font { font-size: 16px; }
.tcard .tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tcard .tools .seg.small { flex: 0 0 180px; }
.tcard .tools .seg.small button { padding: 0 4px; }
.tcard .tog { min-height: 42px; min-width: 44px; padding: 0 10px; border: 1px solid var(--line); background: var(--surface); border-radius: 3px; cursor: pointer; font-size: 13px; }
.tcard .tog[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.cols { display: flex; gap: 8px; align-items: center; min-height: 42px; }
.tcard .cols { margin-left: auto; min-height: 0; }
.cols button { width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(34, 39, 42, 0.35); padding: 0; cursor: pointer; }
.cols button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.cols input[type="color"] { width: 34px; height: 30px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.app .primary, dialog .primary { background: var(--ink); color: var(--paper); min-height: 48px; flex: 1 1 150px; font-weight: 600; }
.app .primary.alt, dialog .primary.alt { background: transparent; color: var(--ink); }
.primary:disabled { opacity: 0.45; cursor: progress; }

.danger { color: #8E2A1D; border-color: #D8B4AC; }
.danger:hover { border-color: #8E2A1D; }
dialog { border: 0; border-radius: 4px; padding: 28px; width: min(540px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(34, 39, 42, 0.35); }
dialog::backdrop { background: rgba(34, 39, 42, 0.55); }
dialog h2 { margin: 0 0 14px; font-size: 21px; line-height: 1.2; text-wrap: balance; }
dialog p { margin: 0 0 12px; font-size: 15px; }
dialog .btn-row { margin-top: 20px; }
#toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); background: var(--ink); color: var(--paper); padding: 11px 16px; border-radius: 3px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 50; max-width: calc(100vw - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- phone and narrow tablet ---------- */
@media (max-width: 900px) {
  .app { display: block; }
  .stage { height: auto; z-index: 20; border-bottom: 1px solid var(--line); }
  .board-wrap { padding: 14px 16px 4px; height: 46vh; height: 46dvh; flex: 0 0 auto; }
  .stage-tools { padding: 6px 16px 10px; min-height: 0; }
  .hint { display: none; }
  .panel { border-left: 0; }
  .sec > summary, .sec-body { padding-left: 16px; padding-right: 16px; }
  :where(.app) input[type="text"], :where(.app) input[type="search"], :where(.app) input[type="number"], :where(.app) select, :where(.app) textarea { font-size: 16px; }
}
@media (max-width: 380px) {
  .choice { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .palettes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- website additions: view switch, product scenes, price, selection ---------- */
.view-seg { flex: 0 0 auto; display: flex; justify-content: center; padding: 14px 16px 0; }
.view-seg .seg { width: min(100%, 320px); grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
.view-seg .seg button { min-height: 40px; border-radius: 0; font-size: 13.5px; background: var(--surface); }
.view-seg .seg button:first-child { border-radius: 3px 0 0 3px; }
.view-seg .seg button:last-child { border-radius: 0 3px 3px 0; margin-left: -1px; }
.view-seg .seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); box-shadow: none; border-color: var(--ink); }
.board-wrap { position: relative; }
#product-view { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: inherit; }
.stage.product-mode #artboard { visibility: hidden; pointer-events: none; }
.stage.product-mode .stage-tools { visibility: hidden; }
.scene { position: relative; flex: 0 0 auto; }
.scene img { display: block; width: 100%; height: auto; }
.scene.wall { display: flex; flex-direction: column; align-items: center; }
.scene.wall .bar { width: 104%; height: 10px; background: #B08A55; }
.scene.wall img { box-shadow: 0 22px 44px rgba(34, 39, 42, 0.22); }
.scene.tee svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 16px 26px rgba(34, 39, 42, 0.16)); }
.scene.tee img { position: absolute; left: 34.33%; top: 23.44%; width: 31.33%; }
.scene.deskmat img { border-radius: 1.8% / 3.6%; box-shadow: 0 16px 32px rgba(34, 39, 42, 0.24); }
.scene.mat img { border-radius: 1.8% / 2.7%; box-shadow: 0 14px 28px rgba(34, 39, 42, 0.2); }
.price-line, .piece-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 0 0; border-top: 1px solid var(--line); }
.price-line span, .piece-line span { color: var(--muted); font-size: 13px; }
.price-line strong, .piece-line strong { font: 500 16px/1.3 var(--mono); white-space: nowrap; }
.piece-line #piece-name { font-weight: 600; font-size: 15px; min-width: 0; }
.app .primary.wide { flex: 0 0 auto; width: 100%; min-height: 54px; border: 1px solid var(--ink); border-radius: 3px; cursor: pointer; font-size: 16px; }
.app .primary:disabled { opacity: 0.45; cursor: not-allowed; }
.sel-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sel-list li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface); }
.sel-thumb { width: 64px; height: 72px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); overflow: hidden; }
.sel-thumb img { max-width: 100%; max-height: 100%; display: block; }
.sel-info { display: flex; flex-direction: column; min-width: 0; font-size: 13px; color: var(--muted); }
.sel-info strong { font-size: 15px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sel-info .mono { font-family: var(--mono); color: var(--ink); }
.sel-qty { display: flex; align-items: center; gap: 2px; }
.sel-qty button, .sel-x { width: 40px; height: 40px; border: 1px solid var(--line); background: var(--paper); border-radius: 3px; cursor: pointer; font-size: 17px; line-height: 1; padding: 0; }
.sel-qty output { min-width: 24px; text-align: center; font: 500 14px/1 var(--mono); }
.sel-x { border-color: transparent; background: transparent; color: var(--muted); }
.sel-x:hover, .sel-qty button:hover { border-color: var(--ink); color: var(--ink); }
.panel .site-foot { border-top: 0; padding: 28px 20px 8px; gap: 10px 20px; }
.panel .site-foot nav { margin-left: 0; }
@media (max-width: 900px) {
  .stage { position: sticky; top: 0; }
  .view-seg { padding-top: 10px; }
  .panel .site-foot { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 420px) {
  .sel-list li { grid-template-columns: 56px minmax(0, 1fr) auto; }
  .sel-x { grid-column: 3; grid-row: 1; justify-self: end; }
  .sel-qty { grid-column: 2 / 4; justify-self: end; }
  .sel-thumb { width: 56px; height: 64px; grid-row: 1 / 3; }
}

/* ---------- checkout ---------- */

/* ---------- extras, services, styles ---------- */
.addons, .svc-row { display: flex; flex-direction: column; gap: 4px; }
.addons .note { margin: -4px 0 4px 27px; }
.svc-row { gap: 8px; }
.svc-row .svc-add { justify-content: flex-start; text-align: left; }
.small-btn { align-self: flex-start; min-height: 36px; font-size: 13px; }
.sel-thumb.svc svg { width: 26px; height: 26px; fill: none; stroke: var(--muted); stroke-width: 1.6; }
.scene.flat img { border-radius: 2px; box-shadow: 0 14px 28px rgba(34, 39, 42, 0.2); }
