/* Online designer (views/public/designer.ejs). Desktop-first; collapses to a stacked layout on phones. */
body.dz { margin: 0; background: #E9ECF2; color: var(--text); overflow: hidden; height: 100vh; height: 100dvh; }
.dz-app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.dz-top { display: flex; align-items: center; gap: 18px; padding: 8px 16px; background: #fff; border-bottom: 1px solid var(--line); flex: none; min-height: 56px; }
.dz-logo img { display: block; height: 34px; width: auto; }
.dz-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.dz-title strong { font-family: var(--font-head); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dz-sizepick { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); font-weight: 600; }
.dz-sizepick select, .dz-actions select { font: inherit; font-size: .85rem; padding: .35rem .5rem; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; }
.dz-sides { display: inline-flex; gap: 4px; background: var(--bg-alt); border-radius: 999px; padding: 3px; margin-left: auto; }
.dz-sides button { border: 0; background: transparent; font: inherit; font-weight: 700; font-size: .82rem; padding: 6px 14px; border-radius: 999px; cursor: pointer; color: var(--muted); }
.dz-sides button.is-active { background: var(--ink); color: #fff; }
.dz-sides button[hidden] { display: none; }
.dz-ghost { border: 1.5px dashed var(--line) !important; color: var(--muted) !important; background: #fff !important; }
.dz-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.dz-icon { width: 34px; height: 34px; border-radius: 8px; border: 1.5px solid var(--line); background: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink); }
.dz-icon:disabled { opacity: .35; cursor: default; }
.dz-status { font-size: .75rem; color: var(--muted); min-width: 60px; text-align: right; }
.dz-body { display: grid; grid-template-columns: 84px 280px 1fr 280px; flex: 1; min-height: 0; }
.dz-tools { background: var(--ink); display: flex; flex-direction: column; padding: 8px 6px; gap: 4px; }
.dz-tools button { border: 0; background: transparent; color: rgba(255,255,255,.7); font: inherit; font-size: .68rem; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 10px; cursor: pointer; }
.dz-tools button:hover { color: #fff; background: rgba(255,255,255,.08); }
.dz-tools button.is-active { color: #fff; background: rgba(255,255,255,.14); }
.dz-panel { background: #fff; border-right: 1px solid var(--line); padding: 18px 16px; overflow: auto; }
.dz-panel h2 { font-size: 1rem; margin: 0 0 12px; }
.dz-panel section[hidden] { display: none; }
.dz-big { display: block; width: 100%; text-align: left; border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 14px; margin-bottom: 8px; cursor: pointer; font-family: var(--font-head); font-weight: 800; font-size: 1.25rem; color: var(--ink); }
.dz-big:hover { border-color: var(--cyan); }
.dz-big-sub { font-size: 1rem; font-weight: 700; }
.dz-big-body { font-family: var(--font-body); font-size: .9rem; font-weight: 400; }
.dz-hint { font-size: .8rem; color: var(--muted); margin: 12px 0 0; line-height: 1.45; }
.dz-upload { display: flex; gap: 12px; align-items: center; border: 1.5px dashed var(--cyan-dark); background: #F0FAFF; border-radius: 10px; padding: 14px; cursor: pointer; margin-bottom: 12px; }
.dz-upload input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dz-upload strong { display: block; color: var(--ink); font-size: .92rem; }
.dz-upload small { color: var(--muted); font-size: .76rem; }
.dz-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dz-gallery button { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 4px; cursor: pointer; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.dz-gallery img { max-width: 100%; max-height: 100%; object-fit: contain; }
.dz-shape-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dz-shape-grid button { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 10px; cursor: pointer; aspect-ratio: 1; }
.dz-shape-grid button:hover { border-color: var(--cyan); }
.dz-shape-grid svg { width: 100%; height: 100%; fill: var(--ink); stroke: var(--ink); stroke-width: 0; }
.dz-shape-grid svg path[stroke-width] { fill: none; stroke-linecap: round; }
.dz-swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 10px; }
.dz-swatches button { aspect-ratio: 1; border-radius: 8px; border: 1px solid rgba(0,0,0,.12); cursor: pointer; }
.dz-swatches button.is-active { outline: 2px solid var(--cyan-dark); outline-offset: 2px; }
.dz-field { display: flex; flex-direction: column; gap: 4px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 10px; }
.dz-field input, .dz-field select { font: inherit; font-size: .9rem; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text); padding: .45rem .6rem; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; }
.dz-field input[type=color] { padding: 2px; height: 36px; width: 100%; }
.dz-field input[type=range] { padding: 0; }
.dz-layouts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dz-layouts button { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 8px; cursor: pointer; text-align: left; font: inherit; font-size: .78rem; font-weight: 600; color: var(--ink); display: flex; flex-direction: column; gap: 6px; }
.dz-layouts button:hover { border-color: var(--cyan); }
.dz-layouts .dz-lay { width: 100%; aspect-ratio: 7 / 4; background: var(--bg-alt); border-radius: 6px; position: relative; overflow: hidden; }
.dz-layouts .dz-lay i { position: absolute; background: #9CA3AF; border-radius: 2px; }
.dz-layers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.dz-layers li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: .82rem; background: #fff; }
.dz-layers li.is-active { border-color: var(--cyan-dark); background: #F0FAFF; }
.dz-layers li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dz-layers li small { color: var(--muted); }
.dz-layers li button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 1rem; line-height: 1; padding: 2px 4px; }
.dz-stage { position: relative; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 30px; background: radial-gradient(#dfe3ea 1px, transparent 1px) 0 0 / 18px 18px, #E9ECF2; }
.dz-canvas-wrap { box-shadow: 0 20px 50px -20px rgba(11,27,58,.45), 0 0 0 1px rgba(0,0,0,.08); background: #fff; line-height: 0; }
.dz-legend { position: absolute; left: 16px; right: 16px; bottom: 10px; display: flex; gap: 16px; flex-wrap: wrap; font-size: .72rem; color: var(--muted); align-items: center; pointer-events: none; }
.dz-legend label { pointer-events: auto; display: inline-flex; align-items: center; gap: 4px; margin-left: auto; cursor: pointer; }
.dz-legend label + label { margin-left: 0; }
.dz-legend label[hidden] { display: none; }
.dz-k { display: inline-block; width: 14px; height: 0; border-top: 2px dashed #E11D48; margin-right: 5px; vertical-align: middle; }
.dz-k-trim { border-top: 2px solid #111827; }
.dz-k-safe { border-top: 2px dashed #059669; }
.dz-props { background: #fff; border-left: 1px solid var(--line); padding: 16px; overflow: auto; }
.dz-props h3 { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 14px 0 8px; }
.dz-props h3:first-child { margin-top: 0; }
.dz-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.dz-row > * { flex: 1; min-width: 0; }
.dz-row .dz-field { margin-bottom: 0; }
.dz-btns { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.dz-btns button { border: 1.5px solid var(--line); background: #fff; border-radius: 8px; min-width: 34px; height: 34px; padding: 0 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font: inherit; font-size: .8rem; font-weight: 700; color: var(--ink); }
.dz-btns button:hover { border-color: var(--cyan); }
.dz-btns button.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }
.dz-btns button.danger { color: #B91C1C; }
.dz-btns button.grow { flex: 1; }
.dz-dpi { font-size: .78rem; padding: 8px 10px; border-radius: 8px; background: #ECFDF5; color: #065F46; margin-bottom: 8px; }
.dz-dpi.warn { background: #FEF3C7; color: #92400E; }
.dz-dpi.bad { background: #FEE2E2; color: #991B1B; }
.dz-empty { font-size: .85rem; color: var(--muted); line-height: 1.5; }
.dz-empty kbd { background: var(--bg-alt); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; font-size: .75rem; }
.dz-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: .88rem; font-weight: 600; z-index: 300; box-shadow: 0 10px 30px -10px rgba(0,0,0,.5); }
.dz-toast[hidden] { display: none; }
.dz-modal { position: fixed; inset: 0; z-index: 250; background: rgba(11,27,58,.55); display: flex; align-items: center; justify-content: center; padding: 20px; }
.dz-modal[hidden] { display: none; }
.dz-modal-card { position: relative; background: #fff; border-radius: var(--radius); padding: 28px; max-width: 520px; width: 100%; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); }
.dz-modal-card h2 { margin: 0; font-size: 1.4rem; }
.dz-modal-close { position: absolute; top: 8px; right: 12px; border: 0; background: none; font-size: 1.8rem; color: var(--muted); cursor: pointer; }
.dz-modal-preview { display: flex; gap: 10px; }
.dz-modal-preview img { max-width: 48%; border: 1px solid var(--line); border-radius: 6px; }
.dz-modal-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.dz-busy { pointer-events: none; opacity: .6; }
@media (max-width: 1100px) { .dz-body { grid-template-columns: 76px 240px 1fr 240px; } }
@media (max-width: 860px) {
  body.dz { overflow: auto; }
  .dz-app { height: auto; min-height: 100vh; }
  .dz-top { flex-wrap: wrap; gap: 10px; }
  .dz-sides, .dz-actions { margin-left: 0; }
  .dz-actions { width: 100%; justify-content: flex-end; }
  .dz-body { display: flex; flex-direction: column; }
  .dz-tools { flex-direction: row; order: 2; overflow-x: auto; }
  .dz-tools button { flex: 1; }
  .dz-panel { order: 3; border-right: 0; border-top: 1px solid var(--line); max-height: 300px; }
  .dz-stage { order: 1; min-height: 50vh; padding: 20px 12px 50px; }
  .dz-props { order: 4; border-left: 0; border-top: 1px solid var(--line); }
  .dz-legend { position: static; margin-top: 10px; }
}
