:root {
  --acc: #c2185b; --acc2: #8e1141; --bg: #f4f1ee; --kaart: #fff; --tekst: #1f1d1d; --zacht: #6b6564; --lijn: #e3dedb;
  font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif; color: var(--tekst);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { min-height: 100vh; }

.top { padding: 18px 20px 4px; max-width: 1400px; margin: 0 auto; }
.top h1 { margin: 0; font-size: 26px; letter-spacing: -.02em; color: var(--acc); }
.top p { margin: 4px 0 0; color: var(--zacht); font-size: 14px; max-width: 70ch; }

.app { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; padding: 14px 20px 40px; max-width: 1400px; margin: 0 auto; align-items: start; }

.voorbeeld { position: sticky; top: 10px; }
.doek { background: #dcd6d1; border-radius: 12px; padding: 14px; display: flex; justify-content: center; align-items: center; height: calc(100vh - 190px); min-height: 320px; }
#canvas { max-width: 100%; max-height: 100%; background: #fff; box-shadow: 0 6px 24px rgba(0,0,0,.25); cursor: pointer; display: block; }
.info { font-size: 12.5px; color: var(--zacht); margin: 8px 2px 0; }
.status { font-size: 13px; min-height: 18px; margin: 6px 2px 0; color: var(--acc2); }
.acties { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.knop { font: inherit; font-size: 14px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--lijn); background: var(--kaart); color: var(--tekst); cursor: pointer; }
.knop:hover { border-color: var(--acc); }
.knop.primair { background: var(--acc); border-color: var(--acc); color: #fff; font-weight: 600; }
.knop.primair:hover { background: var(--acc2); }
.knop:disabled { opacity: .45; cursor: not-allowed; }

.bediening details { background: var(--kaart); border: 1px solid var(--lijn); border-radius: 12px; margin-bottom: 10px; }
.bediening summary { cursor: pointer; padding: 13px 16px; font-weight: 600; font-size: 15px; list-style: none; }
.bediening summary::-webkit-details-marker { display: none; }
.bediening summary::after { content: "▾"; float: right; color: var(--zacht); }
.bediening details:not([open]) summary::after { content: "▸"; }
.paneel { padding: 2px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.paneel > div[data-modus] { display: flex; flex-direction: column; gap: 10px; }
[hidden] { display: none !important; }

.rij { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; }
.rij.blok { flex-direction: column; align-items: stretch; gap: 6px; }
.rij input[type=range] { flex: 1; max-width: 190px; accent-color: var(--acc); }
.rij output { color: var(--zacht); min-width: 3.5ch; text-align: right; font-variant-numeric: tabular-nums; margin-left: auto; }
.rij:has(output) { display: grid; grid-template-columns: auto auto 1fr; }
.rij:has(output) input { grid-column: 3; justify-self: end; width: 100%; max-width: 190px; }
select, textarea, input[type=color] { font: inherit; font-size: 14px; border: 1px solid var(--lijn); border-radius: 8px; padding: 7px 9px; background: #fff; color: var(--tekst); }
textarea { resize: vertical; width: 100%; }
input[type=color] { padding: 2px; width: 40px; height: 34px; }

.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--lijn); border-radius: 10px; overflow: hidden; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 9px 6px; font-size: 14px; background: #fff; }
.seg input:checked + span { background: var(--acc); color: #fff; font-weight: 600; }

.symbolen { display: flex; gap: 6px; flex-wrap: wrap; }
.symbolen button { width: 40px; height: 36px; font-size: 18px; border: 1px solid var(--lijn); background: #fff; border-radius: 8px; cursor: pointer; }
.symbolen button:hover { border-color: var(--acc); color: var(--acc); }

.kleuren { display: flex; align-items: center; gap: 6px; }
.kl { width: 26px; height: 26px; border-radius: 50%; border: 1px solid #bbb; cursor: pointer; padding: 0; }

.hint { margin: 0; font-size: 12.5px; color: var(--zacht); line-height: 1.4; }

.drop { display: flex; flex-direction: column; gap: 3px; border: 2px dashed #cbbfb9; border-radius: 12px; padding: 18px 12px; text-align: center; cursor: pointer; background: #fcfaf9; }
.drop span { font-size: 13px; color: var(--zacht); }
.drop:hover, .drop.over { border-color: var(--acc); background: #fdf1f5; }

.voortgang { position: relative; height: 22px; background: #eee; border-radius: 8px; overflow: hidden; }
.voortgang #balk { height: 100%; width: 0; background: #f2a1bd; transition: width .15s; }
.voortgang span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; }

.fotoKop { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--zacht); }
.link { font: inherit; font-size: 13px; background: none; border: 0; color: var(--acc); cursor: pointer; padding: 0; text-decoration: underline; }
.fotoRaster { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 5px; max-height: 240px; overflow-y: auto; }
.fotoRaster div { position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: #eee; }
.fotoRaster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fotoRaster button { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 13px; line-height: 1; cursor: pointer; padding: 0; opacity: 0; }
.fotoRaster div:hover button, .fotoRaster button:focus { opacity: 1; }
@media (hover: none) { .fotoRaster button { opacity: .85; } }

#printBox { display: none; }

.rij.vink { justify-content: flex-start; gap: 8px; }
.rij.vink input { width: 17px; height: 17px; accent-color: var(--acc); }
.inline { display: flex; gap: 6px; align-items: center; }
.inline input[type=text] { flex: 1; min-width: 0; font: inherit; font-size: 14px; border: 1px solid var(--lijn); border-radius: 8px; padding: 8px 9px; }
.inline input[type=number] { width: 64px; font: inherit; font-size: 14px; border: 1px solid var(--lijn); border-radius: 8px; padding: 7px 8px; }
.paneel hr { border: 0; border-top: 1px solid var(--lijn); width: 100%; margin: 4px 0; }
label.knop { display: inline-block; }
.ontwerpLijst { display: flex; flex-direction: column; gap: 4px; }
.ontwerpRij { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.ontwerpRij label { flex: 1; display: flex; align-items: center; gap: 7px; cursor: pointer; min-width: 0; }
.ontwerpRij label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ontwerpRij input { accent-color: var(--acc); }

.fotoRaster div.vast { outline: 3px solid #f5b400; outline-offset: -3px; }
.fotoRaster div.skip img { filter: grayscale(1); opacity: .35; }
.fotoRaster button { width: 22px; height: 22px; font-size: 12px; opacity: 0; }
.fotoRaster .kPin { left: 2px; right: auto; }
.fotoRaster .kSkip { top: auto; bottom: 2px; left: 2px; right: auto; }
.fotoRaster .kCrop { top: auto; bottom: 2px; }
.fotoRaster button.aan { opacity: 1; background: #f5b400; color: #000; }
.fotoRaster .kSkip.aan { background: #c0392b; color: #fff; }

dialog#uitsnede { border: 0; border-radius: 14px; padding: 16px; max-width: min(92vw, 640px); box-shadow: 0 10px 50px rgba(0,0,0,.4); }
dialog#uitsnede::backdrop { background: rgba(0,0,0,.55); }
dialog#uitsnede h3 { margin: 0 0 4px; }
.uitsnedeDoek { position: relative; display: inline-block; line-height: 0; margin: 8px 0 12px; touch-action: none; cursor: crosshair; user-select: none; overflow: hidden; border-radius: 6px; }
.uitsnedeDoek img { max-width: min(84vw, 600px); max-height: 56vh; display: block; }
#uitsnedeKader { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0,0,0,.5); pointer-events: none; }
#uitsnedePunt { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: #f5b400; border: 2px solid #fff; pointer-events: none; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; padding: 10px 12px 40px; }
  .voorbeeld { position: static; }
  .doek { height: auto; min-height: 0; aspect-ratio: auto; padding: 10px; }
  #canvas { max-height: 70vh; }
  .top { padding: 14px 14px 0; }
}

@media print {
  html, body { background: #fff !important; }
  body > *:not(#printBox) { display: none !important; }
  #printBox { display: block !important; }
  #printBox img { display: block; width: 100%; height: auto; }
  @page { margin: 0; }
}

@media (hover: none), (pointer: coarse), (max-width: 900px) { .fotoRaster button { opacity: .85; } .fotoRaster button.aan { opacity: 1; } }
