/* Lamba Atölyesi: configurator + internal admin. 8px grid, one accent, light tool chrome. */

:root {
  --bg: #F3F3F1;
  --surface: #FFFFFF;
  --sunken: #F2F2EF;
  --line: #E5E4DF;
  --line-2: #D6D5CF;
  --ink: #17181A;
  --ink-2: #45484D;
  --ink-3: #63676E;
  --ink-4: #A4A7AC;

  --accent: #17694F;
  --accent-hover: #11553F;
  --accent-tint: #E8F2ED;
  --accent-line: #B7D5C7;

  --warn: #9A5B05;
  --warn-tint: #FBF0DF;
  --bad: #B23A2C;
  --bad-tint: #FBEAE7;

  --stage: #E7E7E3;

  --r-sm: 6px;
  --r: 8px;
  --r-lg: 12px;
  --ring: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
  --shadow-1: 0 1px 2px rgba(23, 24, 26, .06), 0 0 0 1px rgba(23, 24, 26, .05);
  --shadow-pop: 0 6px 20px rgba(23, 24, 26, .08), 0 1px 3px rgba(23, 24, 26, .06), 0 0 0 1px rgba(23, 24, 26, .05);

  --font: "Instrument Sans", "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Bodoni Moda", Didot, serif;
  --left: 288px;
  --right: 352px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 400 13px/1.45 var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: none; box-shadow: var(--ring); }
.num { font-variant-numeric: tabular-nums; }
.sprite { position: absolute; }

.ic {
  width: 16px; height: 16px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.ic-sm { width: 12px; height: 12px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 32px; padding: 0 12px;
  border: 1px solid transparent; border-radius: var(--r);
  font-weight: 500; white-space: nowrap;
  transition: background-color .12s, border-color .12s, color .12s;
}
.btn-sm { height: 32px; padding: 0 10px; gap: 6px; }
.btn-lg { height: 40px; width: 100%; font-size: 14px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn-secondary:hover { background: var(--sunken); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--sunken); color: var(--ink); }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--ink-2);
  transition: background-color .12s, color .12s;
}
.icon-btn:hover:not(:disabled) { background: var(--sunken); color: var(--ink); }
.icon-btn:disabled { color: var(--ink-4); }
.icon-btn[aria-pressed="true"] { background: var(--accent-tint); color: var(--accent); }

.link-btn {
  border: 0; padding: 0; background: none;
  color: var(--accent); font-weight: 500; font-size: 12px;
}
.link-btn:hover { text-decoration: underline; text-underline-offset: 2px; }

/* tooltips */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  padding: 4px 8px; border-radius: var(--r-sm);
  background: var(--ink); color: #fff; font-size: 12px; font-weight: 500; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .12s;
  z-index: 20;
}
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; transition-delay: .35s; }

/* ---------- app frame ---------- */
.app {
  display: grid;
  grid-template-rows: 48px minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
}

.appbar {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 0 8px 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  z-index: 5;
}
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 20px; height: 20px; fill: var(--ink); }
.brand-word { font-size: 16px; font-weight: 600; letter-spacing: -.02em; }
.appbar-sep { width: 1px; height: 20px; background: var(--line-2); }
.appbar-title { color: var(--ink-2); font-weight: 500; }
.brand-logo { display: block; height: 40px; width: 133px; max-width: none; margin: -6px 0 -6px -30px; }
.appbar-cart { position: relative; }
.cart-n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #fff; color: var(--accent, #17694F); font-size: 11px; line-height: 18px; text-align: center; font-weight: 600; }
.appbar-link { white-space: nowrap; }

.doc {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; align-items: baseline; gap: 8px;
}
.doc-name { font-weight: 600; }
.doc-seed { color: var(--ink-3); font-size: 12px; }

.appbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.btn-group { display: flex; gap: 2px; padding-right: 8px; margin-right: 0; border-right: 1px solid var(--line); }
.lang { gap: 4px; }

.workspace {
  display: grid;
  grid-template-columns: var(--left) minmax(0, 1fr) var(--right);
  min-height: 0;
}

.panel { display: flex; flex-direction: column; min-height: 0; background: var(--surface); }
.shapes { border-right: 1px solid var(--line); }
.inspector { border-left: 1px solid var(--line); }

.panel-head, .print-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
}
.panel-head { padding: 16px 16px 12px; }
.panel-title { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.panel-meta { color: var(--ink-3); font-size: 12px; }

/* ---------- left: gallery ---------- */
.search {
  position: relative; margin: 0 16px;
  display: flex; align-items: center;
}
.search .ic { position: absolute; left: 10px; color: var(--ink-3); pointer-events: none; }
.search input {
  width: 100%; height: 32px; padding: 0 10px 0 32px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--sunken);
  transition: border-color .12s, background-color .12s;
}
.search input::placeholder { color: var(--ink-4); }
.search input:hover { border-color: var(--line-2); }
.search input:focus { outline: none; background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }

.gallery { flex: 1; min-height: 0; overflow: auto; padding: 12px 16px 24px; margin-top: 12px; border-top: 1px solid var(--line); }
.g-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

.card {
  display: flex; flex-direction: column; align-items: stretch; gap: 0;
  padding: 4px 4px 8px; text-align: left;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface);
  transition: border-color .12s, box-shadow .12s;
}
.card:hover { border-color: var(--line-2); box-shadow: var(--shadow-1); }
.card-thumb {
  position: relative; display: block;
  aspect-ratio: 4 / 3; border-radius: var(--r);
  background: var(--sunken); color: #2A2C30;
  margin-bottom: 8px;
}
.card-thumb svg { display: block; width: 100%; height: 100%; }
.t-body { fill: #FCFCFA; }
.t-shadow { fill: rgba(23, 24, 26, .07); }
.t-line { fill: none; stroke: currentColor; stroke-width: 1; opacity: .55; stroke-linecap: round; stroke-linejoin: round; }
.t-edge { fill: none; stroke: currentColor; stroke-width: 1.25; stroke-linejoin: round; stroke-linecap: round; }
.t-hole { fill: currentColor; fill-opacity: .14; }
.t-facet { fill: currentColor; stroke: none; }
.card-name { padding: 0 6px; font-weight: 500; font-size: 13px; line-height: 18px; }
.card-note { padding: 0 6px; color: var(--ink-3); font-size: 12px; line-height: 16px; }
.card-check {
  position: absolute; top: 6px; right: 6px;
  display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); color: #fff;
  opacity: 0; transform: scale(.8); transition: opacity .12s, transform .12s;
}
.card-check .ic { width: 12px; height: 12px; stroke-width: 2.2; }
.card.is-selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.card.is-selected .card-thumb { background: var(--accent-tint); color: var(--accent-hover); }
.card.is-selected .card-check { opacity: 1; transform: none; }
.empty { color: var(--ink-3); padding: 24px 0; text-align: center; }

/* ---------- center: viewport ---------- */
.viewport { position: relative; min-width: 0; min-height: 0; background: var(--stage); overflow: hidden; }
#stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.viewport > :not(canvas) { position: absolute; z-index: 1; }

.vp-info { top: 16px; left: 16px; pointer-events: none; }
.vp-title { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.vp-dims { margin-top: 2px; color: var(--ink-3); font-size: 12px; }

.vp-toolbar {
  top: 12px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 2px; padding: 4px;
  border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-pop);
}
.tb-sep { width: 1px; height: 20px; margin: 0 4px; background: var(--line); }

.vp-status { top: 16px; right: 16px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500;
  background: var(--surface); box-shadow: var(--shadow-1);
}
.pill .ic { width: 14px; height: 14px; stroke-width: 2; }
.pill.is-ok .ic { color: var(--accent); }
.pill.is-warn { background: var(--warn-tint); color: var(--warn); max-width: 360px; }
.spin {
  width: 12px; height: 12px; border-radius: 50%;
  border: 1.6px solid var(--line-2); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.progress { top: 0; left: 0; right: 0; height: 2px; opacity: 0; transition: opacity .3s; pointer-events: none; }
.progress.is-on { opacity: 1; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

.vp-bottom { bottom: 16px; left: 50%; transform: translateX(-50%); }
.btn-float {
  height: 40px; padding: 0 8px 0 14px; border-radius: 999px;
  background: var(--surface); box-shadow: var(--shadow-pop); font-size: 14px;
}
.btn-float:focus-visible { box-shadow: var(--shadow-pop), var(--ring); }
.btn-float:hover { background: #FAFAF8; }
.btn-float:active { transform: translateY(1px); }
kbd {
  display: inline-grid; place-items: center; height: 22px; padding: 0 6px;
  border: 1px solid var(--line); border-radius: 5px; background: var(--sunken);
  font: 500 11px/1 var(--font); color: var(--ink-3);
}
.vp-hint { bottom: 16px; left: 16px; margin: 0; color: var(--ink-3); font-size: 12px; pointer-events: none; }

.toast {
  bottom: 72px; left: 50%; transform: translate(-50%, 8px);
  max-width: min(480px, calc(100% - 32px));
  padding: 8px 12px; border-radius: var(--r);
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: opacity .16s, transform .16s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* light-on mode: only the stage darkens, the tool chrome stays light */
body.is-lit .viewport { --stage: #1F1E1C; }
body.is-lit .vp-title { color: #F4F2EE; }
body.is-lit .vp-dims, body.is-lit .vp-hint { color: #9D9A94; }

/* ---------- right: inspector ---------- */
.params { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tabs { display: flex; gap: 4px; padding: 0 12px; border-bottom: 1px solid var(--line); flex: none; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  position: relative; height: 44px; padding: 0 8px;
  border: 0; background: none; color: var(--ink-3); font-weight: 500;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); }
.tabs button[aria-selected="true"]::after {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px;
  border-radius: 2px; background: var(--accent);
}
.tab-body { flex: 1; min-height: 0; overflow: auto; padding: 0 16px 16px; }

.sec { margin: 16px 0 4px; font-size: 12px; font-weight: 600; color: var(--ink); }
.sec:first-child { margin-top: 12px; }

.field {
  display: grid; grid-template-columns: 96px minmax(0, 1fr) 72px; align-items: center; gap: 8px;
  min-height: 36px;
}
.field .span2 { grid-column: 2 / -1; }
.f-label { color: var(--ink-2); font-size: 12.5px; }
.field.is-off .f-label { color: var(--ink-4); }
.f-hint { margin: -6px 0 4px 104px; color: var(--ink-4); font-size: 11.5px; }
.f-note { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 4px 0 0 104px; color: var(--ink-3); font-size: 12px; }
.f-note strong { color: var(--ink); font-weight: 500; }
.f-note.is-warn { color: var(--warn); }
.f-note.is-warn .ic { width: 14px; height: 14px; }
.f-lede { margin: 0 0 8px; color: var(--ink-3); font-size: 12.5px; }
.field.is-changed .f-label { color: var(--ink); font-weight: 500; }
.field > .btn-sm { justify-self: start; height: 28px; }

/* range */
input[type="range"] {
  --p: 50%;
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 20px; margin: 0; background: transparent;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--accent) var(--p), var(--line-2) var(--p));
}
input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line-2); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; margin-top: -5px; border-radius: 50%;
  background: #fff; border: 1px solid #BDBCB5; box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
  transition: transform .1s;
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 1px solid #BDBCB5; box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
}
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.15); border-color: var(--accent); }
input[type="range"]:focus-visible { box-shadow: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: var(--ring); }
input[type="range"]:disabled::-webkit-slider-runnable-track { background: var(--line); }
input[type="range"]:disabled::-webkit-slider-thumb { background: var(--sunken); border-color: var(--line-2); box-shadow: none; }

/* number box */
.numbox {
  display: flex; align-items: center; height: 28px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--sunken);
  transition: border-color .12s, background-color .12s;
}
.numbox:hover { border-color: var(--line-2); }
.numbox:focus-within { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.numbox input {
  width: 100%; min-width: 0; padding: 0; border: 0; background: none; outline: none;
  text-align: right; font-variant-numeric: tabular-nums; font-size: 12.5px;
}
.numbox input:focus-visible { box-shadow: none; }
.numbox .unit { padding-left: 4px; color: var(--ink-3); font-size: 11.5px; }
.field.is-off .numbox { opacity: .55; }

/* segmented */
.seg {
  display: flex; gap: 2px; padding: 2px;
  border-radius: var(--r); background: var(--sunken); box-shadow: inset 0 0 0 1px var(--line);
}
.seg button {
  flex: 1; min-width: 0; height: 26px; padding: 0 6px;
  border: 0; border-radius: var(--r-sm); background: transparent;
  color: var(--ink-2); font-size: 12.5px; font-weight: 500; white-space: nowrap;
}
.seg button:hover:not(:disabled) { color: var(--ink); }
.seg button[aria-checked="true"], .seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.seg button:disabled { color: var(--ink-4); }

/* toggle */
.field-toggle { cursor: pointer; }
.switch {
  grid-column: 3; justify-self: end;
  -webkit-appearance: none; appearance: none;
  position: relative; width: 32px; height: 18px; margin: 0; border-radius: 999px;
  background: var(--line-2); cursor: pointer; transition: background-color .15s;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .15s;
}
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(14px); }

/* text */
.text {
  height: 28px; padding: 0 8px; min-width: 0;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--sunken); font-size: 12.5px;
}
.text::placeholder { color: var(--ink-4); }
.text:focus { outline: none; background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.text:disabled { opacity: .55; }

/* ---------- personalization ---------- */
.pers-intro { margin: 12px 0 14px; padding: 12px; border-radius: var(--r); background: var(--accent-tint); color: var(--accent-hover); }
.pers-intro strong { display: block; font-size: 13px; }
.pers-intro p { margin: 4px 0 0; font-size: 12px; }
.pers-section { border-top: 1px solid var(--line); }
.pers-section:last-child { border-bottom: 1px solid var(--line); }
.pers-section > summary { display: flex; align-items: center; gap: 8px; min-height: 42px; list-style: none; cursor: pointer; font-weight: 600; }
.pers-section > summary::-webkit-details-marker { display: none; }
.pers-section > summary::before { content: ""; width: 6px; height: 6px; margin-right: 2px; border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3); transform: rotate(-45deg); transition: transform .12s; }
.pers-section[open] > summary::before { transform: rotate(45deg); }
.pers-section > summary span { margin-left: auto; color: var(--ink-3); font-size: 11px; font-weight: 400; }
.pers-section-body { padding: 0 0 14px; }
.pers-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0 12px; }
.pers-toggle > div { display: flex; flex-direction: column; min-width: 0; }
.pers-toggle strong { font-size: 12.5px; font-weight: 500; }
.pers-toggle span { color: var(--ink-3); font-size: 11.5px; }
.pers-toggle .switch { grid-column: auto; flex: none; }
.pers-toggle.compact { margin-top: 8px; padding: 8px; border-radius: var(--r); background: var(--sunken); }
.pers-enabled.is-off { display: none; }
.pers-section.is-disabled > summary { color: var(--ink-4); }
.pers-reason { margin: 0; padding: 0 0 2px; color: var(--ink-3); font-size: 11.5px; line-height: 1.4; }
.pers-field { display: grid; grid-template-columns: 98px minmax(0, 1fr); align-items: center; gap: 6px 8px; min-height: 36px; }
.pers-field > label { color: var(--ink-2); font-size: 12px; }
.pers-field > small { grid-column: 2; color: var(--ink-4); font-size: 11px; line-height: 1.35; }
.pers-field select.text { width: 100%; }
.pers-range { display: grid; grid-template-columns: minmax(0, 1fr) 64px; align-items: center; gap: 8px; }
.pers-range output { color: var(--ink-2); font-size: 11.5px; text-align: right; font-variant-numeric: tabular-nums; }
.pers-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pers-pair .pers-field { display: flex; flex-direction: column; align-items: stretch; gap: 3px; }
.pers-note, .pers-result, .pers-error { margin: 6px 0 0 106px; font-size: 11.5px; }
.pers-note { color: var(--ink-3); }
.pers-result { color: var(--accent); font-weight: 500; }
.pers-error { color: var(--bad); }
.file-btn { position: relative; justify-self: start; overflow: hidden; }
.file-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.pers-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 8px 0 0 106px; }
.pers-actions span { color: var(--warn); font-size: 11.5px; }
.map-placeholder { position: relative; height: 86px; margin: 8px 0 0 106px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r); background: #edf0ea; }
.map-placeholder i { position: absolute; width: 180%; height: 2px; left: -30%; top: 45%; background: #fff; transform: rotate(-16deg); box-shadow: 0 18px 0 #fff, 0 -24px 0 #fff; }
.map-placeholder i:nth-child(2) { transform: rotate(31deg); top: 52%; background: #cfd9d2; }
.map-placeholder i:nth-child(3) { transform: rotate(82deg); top: 32%; background: #dbe1dc; }
.map-placeholder b { position: absolute; left: 52%; top: 45%; width: 10px; height: 10px; border: 3px solid var(--accent); border-radius: 50% 50% 50% 0; background: #fff; transform: rotate(-45deg); }
.unique-number { margin: 6px 0 0 106px; padding: 8px; border: 1px solid var(--accent-line); border-radius: var(--r); background: var(--accent-tint); color: var(--accent-hover); font-weight: 600; text-align: center; }

.certificate-shell { width: min(560px, calc(100vw - 32px)); }
.certificate-card { margin: 20px; padding: 48px; border: 1px solid var(--ink); text-align: center; background: #faf9f4; }
.certificate-kicker { text-transform: uppercase; letter-spacing: .16em; font-size: 10px; }
.certificate-card h2 { margin: 20px 0 8px; font-size: 32px; letter-spacing: -.04em; }
.certificate-card p { max-width: 380px; margin: 0 auto; color: var(--ink-2); }
.certificate-number { display: block; margin-top: 36px; font-size: 20px; letter-spacing: .04em; }
.certificate-seed { display: block; margin-top: 4px; color: var(--ink-3); font-size: 11px; }
.certificate-mark { display: block; margin-top: 40px; font-weight: 600; }

/* swatches */
.swatches { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.sw-name { margin-left: 4px; color: var(--ink-2); font-size: 12px; white-space: nowrap; }
.sw {
  width: 24px; height: 24px; padding: 0; border-radius: 50%;
  border: 0; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}
.sw:hover { transform: scale(1.06); }
.sw[aria-checked="true"] { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12), 0 0 0 2px var(--surface), 0 0 0 3.5px var(--accent); }

/* ---------- order panel ---------- */
.order {
  flex: none; padding: 16px;
  border-top: 1px solid var(--line); background: var(--surface);
}
.order-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.price { display: flex; align-items: baseline; gap: 6px; margin: 6px 0 8px; }
.price-v { font-size: 22px; font-weight: 600; letter-spacing: -.02em; transition: opacity .15s; }
.price-l { color: var(--ink-3); font-size: 12.5px; }
body.is-stale .price-v, body.is-stale #mPrice { opacity: .45; }

.summary { margin-top: 8px; border-top: 1px solid var(--line); }
.summary > summary {
  display: flex; align-items: center; gap: 8px; height: 36px;
  list-style: none; cursor: pointer; font-size: 12.5px; font-weight: 500; color: var(--ink-2);
}
.summary > summary::-webkit-details-marker { display: none; }
.summary > summary::before {
  content: ""; width: 6px; height: 6px; margin: 0 2px;
  border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3);
  transform: rotate(-45deg); transition: transform .12s;
}
.summary[open] > summary::before { transform: rotate(45deg); }
.summary-ref { margin-left: auto; color: var(--ink-3); font-size: 12px; font-weight: 400; }

.dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 16px; margin: 0 0 4px; font-size: 12.5px; }
.dl dt { color: var(--ink-3); }
.dl dd { margin: 0; color: var(--ink); text-align: right; overflow-wrap: anywhere; }

.actions { display: grid; gap: 4px; margin-top: 12px; }
.actions .btn-ghost { justify-self: center; }
.fine { margin: 8px 0 0; color: var(--ink-4); font-size: 11.5px; line-height: 1.4; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary:disabled:hover { background: var(--accent); }

/* ---------- order modal ---------- */
.modal {
  width: min(520px, calc(100% - 32px)); max-height: calc(100dvh - 32px);
  padding: 0; border: 0; border-radius: var(--r-lg);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop);
}
.modal::backdrop { background: rgba(23, 24, 26, .32); }
.modal-card { display: flex; flex-direction: column; max-height: inherit; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 16px 0 20px; }
.modal-title { margin: 4px 0 0; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.modal-sub { margin: 2px 0 0; color: var(--ink-3); font-size: 12.5px; }
.modal-body { padding: 12px 20px 4px; overflow: auto; }
.od-price { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 0; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.od-price strong { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.od-price span { color: var(--ink-3); font-size: 12.5px; }
.modal-body .f-label { display: block; margin: 16px 0 6px; }
.code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.code {
  width: 100%; padding: 8px; resize: none;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--sunken);
  font: 12px/1.45 ui-monospace, "SF Mono", Menlo, monospace; color: var(--ink-2); word-break: break-all;
}
.code:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 20px 20px; }

/* ---------- internal admin ---------- */
.badge { margin-left: auto; padding: 2px 8px; border-radius: 999px; background: var(--warn-tint); color: var(--warn); font-size: 12px; font-weight: 500; }
.admin .appbar { padding-right: 16px; }
.admin-ws { grid-template-columns: 400px minmax(0, 1fr); }
.admin-panel { border-right: 1px solid var(--line); overflow: auto; }
.admin-load { display: grid; gap: 8px; padding: 16px; border-bottom: 1px solid var(--line); }
.admin-error { margin: 0; align-items: flex-start; }
.admin-sec { padding: 16px; border-bottom: 1px solid var(--line); }
.admin-sec .panel-title { margin-bottom: 12px; }
.admin-sec p { margin: 0 0 12px; }
.admin-ref { margin-left: 6px; color: var(--ink-3); font-weight: 500; }
.admin-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; border-bottom: 0; }
.admin-actions .btn { height: 40px; }

/* mobile-only elements */

/* ---------- mid widths ---------- */
@media (max-width: 1280px) {
  :root { --left: 248px; --right: 336px; }
  .appbar-title, .appbar-sep { display: none; }
  .g-grid { gap: 6px; }
}

@media (max-height: 820px) and (min-width: 761px) {
  .fine { display: none; }
  .actions { margin-top: 12px; }
}

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  .appbar { padding: 0 4px 0 12px; gap: 8px; }
  .appbar-title, .appbar-sep, .doc, #share span, .appbar-link, .appbar-cart span:not(.cart-n), .appbar-cart > span { display: none; }
  .appbar-cart { width: 36px; padding: 0; justify-content: center; }
  .appbar-cart:has(#cartCount[hidden]) { background: transparent; border-color: var(--line-2); color: var(--ink); } /* empty cart: outline, green once it holds a lamp */
  .brand-logo { height: 34px; width: 113px; margin-left: -26px; }
  .btn-group { padding-right: 4px; }
  #share { width: 32px; padding: 0; border-color: transparent; }

  .admin-ws { grid-template-rows: 40vh minmax(0, 1fr); grid-template-areas: "vp" "sheet"; }
  .admin-panel { grid-area: sheet; border: 0; }





  .vp-info { top: 12px; left: 12px; }
  .vp-title { font-size: 14px; }
  .vp-toolbar { top: auto; bottom: 20px; left: 12px; transform: none; padding: 2px; }
  .vp-toolbar .icon-btn { width: 30px; height: 30px; }
  .vp-toolbar [data-tip]::after { display: none; }
  .vp-status { top: 12px; right: 12px; }
  .pill { height: 24px; padding: 0 8px; font-size: 11.5px; }
  .vp-bottom { left: auto; right: 12px; bottom: 20px; transform: none; }
  .btn-float { height: 36px; padding: 0 12px; font-size: 13px; }
  .btn-float kbd, .vp-hint { display: none; }
  .toast { bottom: 64px; }

}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

@media print {
  body:has(#certificateDialog[open]) > :not(#certificateDialog) { display: none !important; }
  #certificateDialog[open] { position: static; display: block; width: 100%; max-width: none; margin: 0; border: 0; }
  #certificateDialog::backdrop, .certificate-actions { display: none; }
  .certificate-shell { width: 100%; max-width: none; box-shadow: none; }
  .certificate-card { min-height: 90vh; display: flex; flex-direction: column; justify-content: center; margin: 0; }
}

/* ---------- 3-picker gallery (Ürün tipi / Silüet / Doku) ---------- */
.pk-sec { margin-bottom: 16px; }
.pk-h { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.pk-h b { font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink-2); }
.pk-sub { margin: 10px 0 6px; font-size: 11px; font-weight: 600; color: var(--ink-2); letter-spacing: .02em; }
.pk-sub:first-of-type { margin-top: 0; }
.pk-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pk-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pk-c { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 3px 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface, #fff); color: var(--ink-2); font: inherit; font-size: 11px; line-height: 13px; text-align: center; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.pk-c:hover { border-color: var(--line-2); box-shadow: var(--shadow-1); }
.pk-th { display: block; width: 100%; aspect-ratio: 1; border-radius: 7px; background: var(--canvas, #f1f1ec); color: var(--ink); overflow: hidden; }
.pk-th svg { display: block; width: 100%; height: 100%; }
.pk-types .pk-th { aspect-ratio: 4 / 3; }
.pk-n { color: var(--ink); font-weight: 500; }
.pk-s { color: var(--ink-3); font-size: 11px; line-height: 13px; }
.pk-c.is-selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.pk-c.is-selected .pk-th { color: var(--accent); }
.pk-col .pk-th { padding: 6px; box-sizing: border-box; }
.panel.shapes { min-height: 0; }
#gallery { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
@media (max-width: 760px) {
  .pk-types { grid-template-columns: repeat(4, 1fr); }
  .pk-grid { grid-template-columns: repeat(5, 1fr); }
}

/* Işık düğmesi simge + yazı: lambanın yanınca nasıl göründüğü ilk bakışta fark edilsin */
.vp-toolbar .icon-btn.has-label { width: auto; padding: 0 10px 0 8px; gap: 6px; display: inline-flex; align-items: center; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.has-label .tb-off, .has-label[aria-pressed="true"] .tb-on { display: none; }
.has-label[aria-pressed="true"] .tb-off { display: inline; }

/* Dokunmatik ekran: tüm hedefler en az 44 px */
@media (pointer: coarse) {
  .icon-btn { min-width: 44px; min-height: 44px; }
  .vp-toolbar .icon-btn { width: 44px; height: 44px; }
  .vp-toolbar .icon-btn.has-label { width: auto; }
  .vp-toolbar [data-view="wire"], .vp-toolbar [data-view="section"] { display: none; }
  .btn-sm, .field > .btn-sm { height: 44px; }
  .btn-lg, .mbar .btn { height: 48px; }
  .btn-float { height: 44px; }
  .seg-lg button, .seg button { min-height: 44px; }
  .tabs button { min-height: 44px; padding-left: 10px; padding-right: 10px; }
  .sw { min-width: 44px; min-height: 44px; }
  .swatches { gap: 2px; }
  .numbox input { min-height: 44px; }
}

/* Klavye: galeriden geçmeden ayarlara ve siparişe atlamak için */
.skip { position: absolute; left: 12px; top: -64px; z-index: 100; padding: 10px 14px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 13px; text-decoration: none; }
.skip:focus { top: 8px; }
.skip-2:focus { top: 8px; left: 140px; }
#inspectorPanel:focus, #orderPanel:focus { outline: none; }
@media (pointer: coarse) {
  #share, .appbar-cart { min-width: 44px; width: 44px; }
  .brand { min-height: 44px; padding-right: 8px; }
}
/* recenter pulse */
.viewport.is-pulse #stage { animation: vp-pulse .65s ease-out; }
@keyframes vp-pulse { 0% { filter: none; transform: scale(1); } 35% { filter: brightness(1.08); transform: scale(1.025); } 100% { filter: none; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .viewport.is-pulse #stage { animation: none; } }

/* canvas loading state: stale lamp is dimmed + blurred, spinner on top */
#stage { transition: filter .25s ease, opacity .25s ease; }
.viewport.is-loading #stage { filter: blur(3px) saturate(.6) brightness(.82); opacity: .75; }
.vp-loading { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: none; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px; background: color-mix(in srgb, var(--surface, #fff) 92%, transparent); color: var(--ink); font-size: 13px; font-weight: 600; box-shadow: 0 6px 24px rgba(0,0,0,.18); pointer-events: none; z-index: 5; }
.viewport.is-loading .vp-loading { display: inline-flex; }
@media (prefers-reduced-motion: reduce) { #stage { transition: none; } }

/* ---------- ux2: isim kutusu (her zaman görünür) ---------- */
.nb-label { display: block; margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--ink); }
.nb-row { position: relative; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 10px 0 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.nb-row:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.nb-ic { color: var(--ink-3); }
.nb-input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; font-size: 16px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
.nb-input::placeholder { color: var(--ink-4); letter-spacing: .04em; font-weight: 400; }
.nb-clear { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 50%; background: var(--sunken); color: var(--ink-2); }
.nb-clear[hidden] { display: none; }
.nb-count { color: var(--ink-4); font-size: 11.5px; }
.nb-help { margin: 6px 2px 0; min-height: 16px; color: var(--ink-3); font-size: 12px; }
.nb-help.is-busy { color: var(--ink-2); }
.nb-help.is-ok { color: var(--accent); }
.nb-help.is-warn { color: var(--warn); }
.nb-opts { display: flex; gap: 8px; margin-top: 8px; }
.nb-opts[hidden] { display: none; }
.nb-opts .seg { flex: 1; }
.nb-opts .seg button { height: 26px; }

.nb-input:focus-visible { box-shadow: none; }

/* ---------- ux2: döndürme ---------- */
html:has(.workspace:not(.admin-ws)), html:has(.workspace:not(.admin-ws)) body { overscroll-behavior: none; }
.workspace:not(.admin-ws) .viewport { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.workspace:not(.admin-ws) .viewport button { touch-action: manipulation; }
.workspace:not(.admin-ws) #stage { cursor: grab; }
.workspace:not(.admin-ws) #stage:active { cursor: grabbing; }
.vp-orbit { right: 16px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; gap: 26px; }
.orbit-btn {
  position: relative; display: grid; place-items: center; width: 52px; height: 52px; padding: 0;
  border: 0; border-radius: 50%; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop);
  transition: background-color .15s, color .15s, transform .1s;
}
.orbit-btn:focus-visible { box-shadow: var(--shadow-pop), var(--ring); }
.orbit-btn:hover { background: #FAFAF8; }
.orbit-btn:active { transform: scale(.96); }
.orbit-btn .ic { width: 22px; height: 22px; }
.orbit-btn .orbit-l { position: absolute; top: calc(100% + 4px); left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 600; line-height: 1; color: var(--ink-2); white-space: nowrap; text-shadow: 0 0 6px var(--stage), 0 0 2px var(--stage); }
body.is-lit .orbit-btn .orbit-l { color: #D9D6CF; }
.orbit-main { width: 60px; height: 60px; }
.orbit-main .ic { width: 26px; height: 26px; }
.orbit-main[aria-pressed="true"] { background: var(--accent); color: #fff; }
.orbit-main[aria-pressed="true"]:hover { background: var(--accent-hover); }
.orbit-main[aria-pressed="true"] .ic { animation: tb-spin 6s linear infinite; }
.orbit-btn[data-tip]::after { right: calc(100% + 8px); left: auto; top: 50%; bottom: auto; transform: translateY(-50%); }
@keyframes tb-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .orbit-main[aria-pressed="true"] .ic { animation: none; } }
.vp-hint .hint-t { display: none; }
.vp-hint { transition: opacity .6s; }
.vp-hint.is-gone { opacity: 0; }
@media (pointer: coarse) {
  .vp-hint .hint-d { display: none; }
  .vp-hint .hint-t { display: inline; }
}
@media (max-width: 760px) {
  .vp-orbit { right: 12px; gap: 26px; }
  .orbit-btn { width: 48px; height: 48px; }
  .orbit-main { width: 56px; height: 56px; }
  .vp-hint { display: block; left: 50%; right: auto; bottom: 68px; transform: translateX(-50%); max-width: calc(100% - 24px); padding: 5px 10px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--ink-2); font-size: 11.5px; text-align: center; white-space: nowrap; }
  body.is-lit .vp-hint { color: var(--ink-2); }
  .vp-hint .hint-d { display: none; }
  .vp-hint .hint-t { display: inline; }
}
@media (pointer: coarse) { .orbit-btn[data-tip]::after { display: none; } }

/* ---------- ux2: basılabilirlik ---------- */
.print-card { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--bad-tint); color: #7A261B; box-shadow: var(--shadow-pop), inset 0 0 0 1px rgba(178, 58, 44, .28); }
.pc-title { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: 12.5px; line-height: 1.4; }
.pc-title .ic { width: 16px; height: 16px; margin-top: 1px; color: var(--bad); }
.pc-title b { font-weight: 600; }
.pc-more { display: block; margin-top: 2px; color: #9B4A3F; font-size: 11.5px; }
.pc-snap { align-self: stretch; justify-content: center; gap: 8px; background: var(--bad); color: #fff; }
.pc-snap:hover:not(:disabled) { background: #962F23; }
.pc-snap:disabled { opacity: .8; cursor: progress; }
.pc-snap .spin { border-color: rgba(255, 255, 255, .45); border-top-color: #fff; }
.pill.is-ok { gap: 6px; }
.print-line { margin: 0 0 8px; }
.print-line p { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: 12.5px; line-height: 1.4; }
.print-line .ic { width: 16px; height: 16px; margin-top: 1px; }
.print-line.is-ok p { color: var(--accent); }
.print-line.is-bad p { color: var(--bad); }
.print-line .btn { margin-top: 8px; width: 100%; justify-content: center; background: var(--bad); color: #fff; }
.print-line[hidden] { display: none; }

/* ---------- ux3: adım adım tasarım ---------- */
:root { --right: 440px; }
.workspace:not(.admin-ws) { grid-template-columns: minmax(0, 1fr) var(--right); grid-template-rows: minmax(0, 1fr); }
.workspace:not(.admin-ws) > .viewport { grid-column: 1; grid-row: 1; }
.workspace:not(.admin-ws) > .wiz { grid-column: 2; grid-row: 1; }
.wiz { background: var(--surface); border-left: 1px solid var(--line); min-height: 0; }
.wz-head { padding: 12px 12px 0; border-bottom: 1px solid var(--line); }
.wz-title { margin: 0 4px 10px; font-family: var(--font-display); font-weight: 500; font-size: 26px; line-height: 1.1; letter-spacing: -.01em; color: var(--ink); }
.stepper { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; margin: 0; padding: 0; list-style: none; }
.sp {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%;
  padding: 4px 2px 10px; border: 0; border-radius: 8px 8px 0 0; background: none; color: var(--ink-3);
}
.sp::after { content: ""; position: absolute; left: 4px; right: 4px; bottom: -1px; height: 3px; border-radius: 2px; background: transparent; }
.sp.is-done::after { background: var(--accent-line); }
.sp.is-cur::after { background: var(--accent); }
.sp:hover:not(.is-cur) { background: var(--sunken); }
.sp-no { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink-2); font-size: 12.5px; font-weight: 600; }
.sp-no .ic { width: 14px; height: 14px; stroke-width: 2.4; }
.sp.is-cur .sp-no { background: var(--accent); border-color: var(--accent); color: #fff; }
.sp.is-done .sp-no { background: var(--accent-tint); border-color: var(--accent-line); color: var(--accent); }
.sp-l { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.sp.is-cur .sp-l { color: var(--ink); }
.sp-v { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; line-height: 14px; color: var(--ink-2); }
.wz-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 16px 16px 24px; outline: none; }
.st-head { margin-bottom: 16px; }
.st-kicker { margin: 0 0 2px; font-size: 12px; color: var(--ink-3); }
.st-title { margin: 0 0 6px; font-size: 22px; line-height: 1.2; font-weight: 600; letter-spacing: -.02em; }
.st-lede { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.st-ref { margin: -8px 0 12px; color: var(--ink-3); font-size: 12px; }
.wiz .f-note { margin-left: 0; }
.wiz .sec:first-child { margin-top: 0; }

.acc { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: var(--surface); }
.acc.is-open { border-color: var(--line-2); }
.acc-h { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 48px; padding: 8px 12px 8px 14px; border: 0; border-radius: 12px; background: none; text-align: left; }
.acc-t { font-size: 14px; font-weight: 600; }
.acc-v { margin-left: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 500; color: var(--accent); }
.acc-h .ic { color: var(--ink-3); transition: transform .15s; }
.acc.is-open .acc-h .ic { transform: rotate(180deg); }
.acc-b { padding: 4px 12px 12px; }
.acc-b[hidden] { display: none; }
.acc-b .search { margin: 0 0 10px; }
.acc-b .g-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.acc-b .card-note { display: none; }
.pk-types { grid-template-columns: repeat(4, 1fr); }
.pk-types .pk-s { display: none; }
.pk-grid { grid-template-columns: repeat(4, 1fr); }

.adv { margin-top: 16px; border-top: 1px solid var(--line); }
.adv > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; list-style: none; }
.adv > summary::-webkit-details-marker { display: none; }
.adv > summary::after { content: ""; width: 8px; height: 8px; margin-right: 4px; border-right: 1.6px solid var(--ink-3); border-bottom: 1.6px solid var(--ink-3); transform: rotate(45deg); transition: transform .15s; }
.adv[open] > summary::after { transform: rotate(-135deg); }
.adv-b { padding: 0 0 12px; }
.seg-wide button { height: 40px; font-size: 14px; }

.namebar { padding: 0; }
.nb-label { font-size: 13px; }
.nb-row { height: 52px; }
.nb-input { font-size: 18px; }
.nb-opts { margin-top: 12px; }
.nb-opts .seg button { height: 32px; }

.dl-big { gap: 8px 16px; margin: 0 0 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; }

.wz-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); box-shadow: 0 -6px 16px rgba(23, 24, 26, .04); }
.wz-price { display: flex; align-items: baseline; gap: 8px; }
.wz-price .price-v { font-size: 26px; line-height: 1.1; font-weight: 600; letter-spacing: -.02em; }
.price-delta { min-width: 0; padding: 1px 7px; border-radius: 999px; font-size: 12px; font-weight: 600; opacity: 0; transition: opacity .25s; }
.price-delta.is-on { opacity: 1; }
.price-delta.is-up { background: var(--sunken); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.price-delta.is-down { background: var(--accent-tint); color: var(--accent); }
.price-delta:empty { display: none; }
.price-lead { margin-left: auto; min-width: 0; max-width: 60%; color: var(--ink-3); font-size: 12px; line-height: 1.3; text-align: right; }
.wz-foot .print-line { margin: 8px 0 0; }
.wz-foot .print-line.is-bad { padding: 8px 10px; border-radius: 10px; background: var(--bad-tint); }
.wz-foot .print-line.is-checking p, .wz-foot .print-line.is-busy p { color: var(--ink-3); align-items: center; }
.wz-foot .print-line .btn { margin-top: 8px; }
.pill.is-bad { background: var(--bad); color: #fff; }
.pill.is-bad .ic { color: #fff; }
.wz-nav { display: flex; gap: 8px; margin-top: 12px; }
.wz-nav .btn { height: 44px; font-size: 14px; }
.wz-nav .wz-next, .wz-nav .wz-order { flex: 1; }
.wz-nav [hidden] { display: none; }
.wz-nav .btn:disabled { background: var(--line-2); color: var(--ink-3); }

.vp-flash { top: 64px; left: 50%; transform: translate(-50%, -6px); padding: 6px 12px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 88%, transparent); color: #fff; font-size: 12.5px; font-weight: 500; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; }
.vp-flash.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1100px) { :root { --right: 400px; } }
@media (max-width: 760px) {
  .workspace:not(.admin-ws) { grid-template-columns: minmax(0, 1fr); grid-template-rows: 30vh minmax(0, 1fr); grid-template-areas: none; }
  .workspace:not(.admin-ws) > .viewport { grid-column: 1; grid-row: 1; }
  .workspace:not(.admin-ws) > .wiz { grid-column: 1; grid-row: 2; border-left: 0; border-top: 1px solid var(--line); }
  .wz-head { padding: 6px 4px 0; }
  .sp { padding: 2px 0 8px; }
  .sp-no { width: 24px; height: 24px; }
  .sp-l { font-size: 12px; }
  .sp-v { font-size: 11px; }
  .wz-body { padding: 12px 14px 20px; }
  .st-head { margin-bottom: 12px; }
  .st-title { font-size: 19px; margin-bottom: 4px; }
  .st-lede { font-size: 13.5px; }
  .wz-foot { padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
  .wz-price .price-v { font-size: 22px; }
  .wz-nav { margin-top: 8px; }
  .wz-nav .btn { height: 48px; }
  .wz-foot .print-line p { font-size: 12px; }
  .acc-b .g-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pk-grid { grid-template-columns: repeat(5, 1fr); }
  .vp-flash { top: 46px; }
  .vp-hint { bottom: auto; top: 46px; }
  .vp-orbit { top: 50%; }
}
@media (max-width: 760px) {
  .st-kicker, .price-lead, .pl-more { display: none; }
  .wz-state { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; }
  .wz-foot .print-line { margin: 0; }
  .wz-foot .print-line.is-bad { flex-basis: 100%; margin-top: 4px; }
  .st-title { font-size: 18px; }
}

/* ux3 düzeltmeler */
.workspace:not(.admin-ws) .orbit-main[aria-pressed="true"] { background: var(--surface); color: var(--accent); }
.workspace:not(.admin-ws) .orbit-main[aria-pressed="true"]:hover { background: #FAFAF8; }
body:not([data-step-id="shape"]) .vp-bottom { display: none; }
.wiz .sw-name { flex-basis: 100%; margin: 4px 0 0; }
.wiz .swatches { flex-wrap: wrap; }
.pl-detail { margin: 6px 0 0; font-size: 12px; }
.pl-detail summary { cursor: pointer; color: #7A261B; font-weight: 500; }
.pl-detail p { margin: 4px 0 0; color: #7A261B; }
.wz-body.is-more { -webkit-mask-image: linear-gradient(#000 calc(100% - 22px), transparent); mask-image: linear-gradient(#000 calc(100% - 22px), transparent); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.sp.is-bad .sp-no { background: var(--bad); border-color: var(--bad); color: #fff; }
.sp.is-bad .sp-v, .sp.is-bad .sp-l { color: var(--bad); }
.sp.is-bad::after { background: var(--bad); }
body[data-print="bad"] .wz-order, body[data-print="error"] .wz-order { display: none; }
body[data-print="bad"] .wz-nav .wz-back, body[data-print="error"] .wz-nav .wz-back { flex: 1; }
.seg-wide button small { display: block; margin-top: 1px; font-size: 11px; font-weight: 400; color: var(--ink-3); }
.seg-wide button { height: 48px; line-height: 1.2; }
.nb-opts { flex-direction: column; gap: 10px; }
.nb-opt .f-label { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.nb-opts .seg button { height: 40px; }
@media (max-width: 760px) {
  body[data-step-id="order"] .price-lead { display: inline; }
  body[data-step-id="name"] .vp-toolbar { display: none; }
}
.wiz .pc-snap, .st-problem .pc-snap { background: var(--accent); color: #fff; }
.wiz .pc-snap:hover:not(:disabled) { background: var(--accent-hover); }
.wiz .pc-snap .spin { border-color: rgba(255, 255, 255, .45); border-top-color: #fff; }
.st-problem { margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; background: var(--bad-tint); color: #7A261B; box-shadow: inset 0 0 0 1px rgba(178, 58, 44, .28); }
.st-problem p { margin: 0; font-size: 13.5px; line-height: 1.45; }
.st-problem .st-pd { margin-top: 4px; font-size: 12px; color: #8A3A2F; }
.st-problem .pc-snap { width: 100%; margin-top: 10px; justify-content: center; }
body:has(.st-problem) .wz-foot .print-line .pc-snap { display: none; } /* the banner keeps the only fix button */
/* The banner already says why: the footer keeps only "Basılamaz"; the reason stays for screen readers. */
body:has(.st-problem) .wz-foot .print-line .pl-why { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
body[data-print="bad"] .wz-nav .wz-back, body[data-print="error"] .wz-nav .wz-back { height: 36px; border-color: transparent; background: none; }
/* The fix button stays the only green primary while the design is not printable. */
body[data-print="bad"] #wzNext, body[data-print="error"] #wzNext { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
body[data-print="bad"] #wzNext:hover, body[data-print="error"] #wzNext:hover { background: #FAFAF8; }
.wiz .fine, .wiz .f-hint { color: var(--ink-3); }
body[data-step-id="order"] #oLead { display: none; } /* the order step already shows the delivery time */
@media (max-width: 760px) {
  .vp-bottom { display: none !important; }
}
@media (pointer: coarse) { .pl-detail summary { min-height: 44px; display: inline-flex; align-items: center; } }

/* ---------- ux4: başlangıç biçimleri, tasarım adı, marka etiketi, sürükleme ipucu ---------- */
.fam-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 8px 0 4px; }
.fam-c .pk-th { aspect-ratio: 4 / 3; }
.fam-c .pk-s { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fam-c.is-selected .pk-th { background: var(--accent-tint); }
@media (max-width: 760px) { .fam-c .pk-s { display: none; } }

.titlebar { margin: 0 0 16px; }
.tt-input { font-size: 16px; font-weight: 500; letter-spacing: 0; text-transform: none; }

.vp-mark { right: 16px; bottom: 18px; pointer-events: none; font: 600 13px/1 var(--font); letter-spacing: .04em; color: var(--ink-3); }
body.is-lit .vp-mark { color: #B9B5AD; }
.vp-mark[hidden] { display: none; }
/* Phones: the toolbar fills the bottom-left and reaches the right corner at 360 px, so the label
   sits above it (20 px offset + 48 px touch toolbar + 8 px gap), clear of the orbit on the right. */
@media (max-width: 760px) { .vp-mark { right: auto; left: 14px; bottom: 76px; font-size: 12px; } }
.icon-btn[aria-checked="true"] { background: var(--accent-tint); color: var(--accent); }

.vp-hint { display: inline-flex; align-items: center; gap: 6px; }
.vp-hint .hint-ic { width: 16px; height: 16px; }
@keyframes hint-nudge { 0%, 100% { transform: translateX(-3px); } 50% { transform: translateX(3px); } }
@media (prefers-reduced-motion: no-preference) { .vp-hint:not(.is-gone) .hint-ic { animation: hint-nudge 1.4s ease-in-out 4; } }
