/* Editor */
body.is-editor { background: #E9E7DF; }
.ed { display: grid; grid-template-columns: 330px 1fr 290px; height: calc(100vh - 64px); min-height: 560px; }
.ed-side, .ed-buy { background: var(--paper); overflow-y: auto; }
.ed-side { border-right: 1px solid var(--line); padding: 18px 18px 40px; }
.ed-buy { border-left: 1px solid var(--line); padding: 18px; }
.ed-title h1 { font-size: 22px; margin: 0 0 2px; }
.ed-title p { font-size: 13px; margin: 0 0 12px; }
.small { font-size: 13px; }
.sec { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; margin-bottom: 10px; }
.sec > summary { cursor: pointer; list-style: none; font-weight: 600; padding: 12px 0; display: flex; justify-content: space-between; }
.sec > summary::after { content: "▾"; color: var(--muted); transition: transform .15s; }
.sec:not([open]) > summary::after { transform: rotate(-90deg); }
.sec > summary::-webkit-details-marker { display: none; }
.sec[open] { padding-bottom: 12px; }
.sec.props { padding: 12px 14px; border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy); }
.props-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.props-head h2 { font-size: 16px; margin: 0; }
.field { margin-bottom: 10px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: none; }
.ed input[type=number], .ed input[type=text], .ed select, .ed textarea { padding: 7px 9px; font-size: 14px; }
.unit { position: relative; }
.unit input { padding-right: 34px !important; }
.unit span { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--muted); pointer-events: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; font-size: 14px; margin: 4px 0 10px; color: var(--ink); }
.hint-i { display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; background: #E4E2D9; font-size: 10px; cursor: help; }
input[type=range] { width: 100%; accent-color: var(--navy); margin: 0 0 10px; }

.swatches { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sw { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font: 500 13px/1.2 "Inter", sans-serif; text-align: left; }
.sw .chip { flex: none; width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; font: 700 13px "Inter Display", sans-serif; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.sw[aria-checked=true] { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }

.els { list-style: none; margin: 0 0 10px; padding: 0; }
.els li { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 7px; cursor: pointer; font-size: 14px; }
.els li:hover { background: #F2F1EC; }
.els li.on { background: var(--navy); color: #fff; }
.els li .ic { width: 22px; height: 22px; border-radius: 5px; background: #ECEAE2; color: var(--navy); display: grid; place-items: center; font: 600 11px var(--mono); flex: none; }
.els li.on .ic { background: var(--lime); }
.els li .lb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.els li.locked .lb::after { content: " · fix"; color: var(--muted); }
.add { display: flex; gap: 6px; flex-wrap: wrap; }

.seg { display: flex; border: 1px solid #CFCCC1; border-radius: 8px; overflow: hidden; }
.seg button { flex: 1; border: 0; background: #fff; padding: 6px 0; cursor: pointer; font-size: 15px; }
.seg button + button { border-left: 1px solid #CFCCC1; }
.seg button.on { background: var(--navy); color: var(--lime); }
.icon { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 16px; line-height: 1; }
.icon:hover { background: #F2F1EC; }
.icon.danger { color: var(--red); }
.icon[disabled] { opacity: .35; cursor: default; }
.tools { display: flex; gap: 6px; }

/* Vorschau */
.ed-canvas { display: flex; flex-direction: column; min-width: 0; }
.toolbar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: #F7F6F1; border-bottom: 1px solid var(--line); }
.toolbar .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.toolbar .spacer { flex: 1; }
.toolbar .check { margin: 0 0 0 4px; }
.chipbtn { height: 32px; padding: 0 10px; border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer; font-size: 12px; }
.stage { flex: 1; overflow: auto; display: grid; place-items: center; padding: 40px; position: relative;
  background-color: #E4E1D7; background-image: radial-gradient(#D2CEC1 1px, transparent 1px); background-size: 16px 16px; }
.paper { position: relative; }
.canvas svg { display: block; overflow: visible; filter: drop-shadow(0 10px 22px rgba(0,8,25,.28)); touch-action: none; user-select: none; }
.canvas .hit { fill: transparent; cursor: move; }
.canvas .hit:hover { fill: rgba(148,252,22,.10); }
.canvas .guide { stroke: #94FC16; stroke-width: .15; stroke-dasharray: .6 .4; }
.canvas.grid svg { background-image:
   linear-gradient(rgba(0,8,25,.07) 1px, transparent 1px),
   linear-gradient(90deg, rgba(0,8,25,.07) 1px, transparent 1px);
  background-size: var(--g) var(--g); background-position: var(--go) var(--go); }
.loading { position: absolute; right: -8px; top: -26px; font-size: 12px; color: var(--muted); }
.scalebar { padding: 8px 14px; background: #F7F6F1; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 8px; color: var(--muted); }
.scalebar span { display: inline-block; height: 6px; border: 1px solid var(--navy); border-top: 0; }

/* Kaufen */
.pricebox { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 12px; }
.pricebox h3 { margin: 0 0 10px; font-size: 15px; }
.bigprice { font: 700 30px/1.1 "Inter Display", sans-serif; margin: 2px 0 8px; }
.bigprice small { font: 400 14px "Inter", sans-serif; color: var(--muted); }
.breakdown { list-style: none; margin: 0 0 12px; padding: 0; font-size: 12.5px; color: var(--muted); }
.breakdown li { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.qty-ctl { display: flex; }
.qty-ctl button { width: 38px; border: 1px solid #CFCCC1; background: #fff; font-size: 18px; cursor: pointer; }
.qty-ctl button:first-child { border-radius: 8px 0 0 8px; }
.qty-ctl button:last-child { border-radius: 0 8px 8px 0; }
.qty-ctl input { border-radius: 0 !important; text-align: center; border-left: 0 !important; border-right: 0 !important; }
.totline { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0 4px; border-top: 1px solid var(--line); margin-top: 6px; }
.totline b { font: 700 18px "Inter Display", sans-serif; }
.wide { width: 100%; margin-top: 10px; }
.warnings { list-style: none; padding: 0; margin: 12px 0 0; }
.warnings li { font-size: 13px; padding: 8px 10px; border-radius: 7px; background: #FFF2D6; color: #6B4300; margin-bottom: 6px; }

@media (max-width: 1100px) {
  .ed { grid-template-columns: 300px 1fr; height: auto; }
  .ed-buy { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .ed-canvas { min-height: 70vh; }
}
@media (max-width: 760px) {
  .ed { grid-template-columns: 1fr; }
  .ed-canvas { order: -1; min-height: 46vh; position: sticky; top: 64px; z-index: 5; }
  .stage { padding: 20px; }
  .ed-side { border-right: 0; }
  .ed-buy { grid-template-columns: 1fr; }
}
#dims { white-space: nowrap; }
@media (max-width: 760px) { .toolbar { overflow-x: auto; } .toolbar .check { display: none; } }
