:root {
  --charcoal: #1c1b1d;
  --bone: #f7f1f6;
  --mist: #e5e1e3;
  --pulse: #FA2D48;
  --ink: #131214;
  --paper: #ffffff;
  --shadow: 0 30px 60px -20px rgba(0,0,0,.45), 0 8px 24px -8px rgba(0,0,0,.25);
  --radius: 4px;
  --sidebar-w: 360px;
  --sans: "Inter", "Helvetica Neue", system-ui, sans-serif;
  --display: "Inter", "Helvetica Neue", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--sans);
  color: var(--bone);
  background: var(--charcoal);
  font-size: 14px;
  line-height: 1.5;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--ink);
  border-right: 1px solid #2a2a2c;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.sidebar__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid #2a2a2c;
}
.sidebar__logo { height: 22px; width: auto; }
.sidebar__title {
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--mist);
  opacity: .7;
}

.sidebar__section {
  padding: 18px 24px;
  border-bottom: 1px solid #2a2a2c;
}
.sidebar__section:last-of-type { flex: 1; overflow-y: auto; border-bottom: none; }

.field-label {
  display: block;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--mist);
  opacity: .75;
  margin-bottom: 6px;
}
.field-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--mist);
  opacity: .55;
  line-height: 1.45;
}

.select, .input, .textarea {
  width: 100%;
  background: #232225;
  color: var(--bone);
  border: 1px solid #34333a;
  border-radius: var(--radius);
  font: inherit;
  padding: 10px 12px;
  outline: none;
  transition: border-color .15s ease;
}
.select:focus, .input:focus, .textarea:focus { border-color: var(--pulse); }
.textarea { resize: vertical; min-height: 70px; line-height: 1.45; }

.field {
  margin-bottom: 14px;
}
.field:last-child { margin-bottom: 0; }

.field--row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sidebar__foot {
  padding: 16px 24px;
  border-top: 1px solid #2a2a2c;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
}

.btn {
  font: inherit;
  border: 0;
  cursor: pointer;
  padding: 10px 16px;
  border-radius: var(--radius);
  letter-spacing: .04em;
  transition: transform .1s ease, background .15s ease, opacity .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn--ghost {
  background: transparent;
  color: var(--mist);
  border: 1px solid #34333a;
}
.btn--ghost:hover { color: var(--bone); border-color: #50505a; }
.btn--primary {
  background: var(--pulse);
  color: white;
  font-weight: 600;
}
.btn--primary:hover { background: #e02540; }

/* ---------- Stage / preview ---------- */
.stage {
  background:
    radial-gradient(circle at 20% 10%, #2a2a2d 0%, transparent 40%),
    radial-gradient(circle at 80% 90%, #232123 0%, transparent 50%),
    var(--charcoal);
  height: 100vh;
  overflow: auto;
  padding: 40px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.stage__inner {
  display: flex;
  flex-direction: column;
  gap: 32px;
  align-items: center;
}

/* ---------- Paper ---------- */
.paper {
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
  position: relative;
  font-family: var(--sans);
  transform-origin: top center;
}

/* A4 landscape (297 x 210 mm) trifold */
.paper--trifold {
  width: 297mm;
  height: 210mm;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}

/* A5 portrait (148 x 210 mm) */
.paper--flyer {
  width: 148mm;
  height: 210mm;
}

/* A4 portrait (210 x 297 mm) */
.paper--a4 {
  width: 210mm;
  height: 297mm;
}

/* DL slip (99 x 210 mm) — 1/3 av A4 */
.paper--slip {
  width: 99mm;
  height: 210mm;
}

/* Helper to scale preview down on small screens — keeps print at full size */
@media (max-width: 1200px) {
  .paper { transform: scale(.72); }
}
@media (max-width: 900px) {
  .paper { transform: scale(.55); }
}

/* Generic trifold panel */
.panel {
  padding: 14mm 12mm;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Panel dividers in preview (faint, hidden in print) */
.paper--trifold .panel + .panel {
  border-left: 1px dashed rgba(0,0,0,.08);
}
@media print {
  .paper--trifold .panel + .panel { border-left: 0; }
}

/* ---------- Typography on paper ---------- */
.paper h1, .paper h2, .paper h3 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -.01em;
  margin: 0;
  color: var(--ink);
}
.paper h1 { font-size: 28pt; line-height: 1.05; letter-spacing: -.02em; }
.paper h2 { font-size: 16pt; line-height: 1.15; margin-bottom: 6px; }
.paper h3 {
  font-size: 9pt;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--pulse);
  font-weight: 700;
  margin-bottom: 8px;
}
.paper p { margin: 0 0 8px; font-size: 10pt; }
.paper ul { margin: 0 0 8px; padding-left: 16px; font-size: 10pt; }
.paper li { margin-bottom: 4px; }
.paper hr {
  border: 0;
  height: 1px;
  background: rgba(0,0,0,.08);
  margin: 14px 0;
}

.eyebrow {
  font-size: 9pt;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--pulse);
  font-weight: 600;
}

.muted { color: rgba(0,0,0,.55); }
.small { font-size: 8.5pt; line-height: 1.4; }

.cover-mark {
  position: absolute;
  bottom: 14mm;
  left: 12mm;
  right: 12mm;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 8pt;
  color: rgba(0,0,0,.5);
}
.cover-mark img { height: 16px; }

.spacer { flex: 1; }

/* Cover panel — dark accent */
.panel--cover {
  background: var(--charcoal);
  color: var(--bone);
}
.panel--cover h1 { color: var(--bone); }
.panel--cover h3 { color: var(--pulse); }
.panel--cover p,
.panel--cover li { color: var(--mist); }
.panel--cover hr { background: rgba(255,255,255,.12); }
.panel--cover .cover-mark { color: rgba(255,255,255,.55); }
.panel--cover .cover-mark img { filter: none; }

/* Tables (price lists etc) */
.paper table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9.5pt;
}
.paper th, .paper td {
  text-align: left;
  padding: 5px 0;
  border-bottom: 1px solid rgba(0,0,0,.08);
}
.paper th {
  font-size: 8pt;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: rgba(0,0,0,.6);
  font-weight: 600;
}
.paper td.num, .paper th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Flyer-specific */
.flyer-hero {
  background: var(--charcoal);
  color: var(--bone);
  padding: 16mm 14mm;
  position: relative;
  min-height: 95mm;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.flyer-hero h1 { color: var(--bone); font-size: 32pt; }
.flyer-hero .eyebrow { color: var(--pulse); margin-bottom: 8px; }
.flyer-hero img.logo { position: absolute; top: 14mm; left: 14mm; height: 20px; }
.flyer-body { padding: 14mm; }
.flyer-foot {
  padding: 10mm 14mm 14mm;
  border-top: 1px solid rgba(0,0,0,.08);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 8.5pt;
  color: rgba(0,0,0,.6);
}
.flyer-foot img { height: 18px; }

/* Repeatable item-list (e.g. price rows) */
.rows { list-style: none; padding: 0; margin: 0; }
.rows li {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid rgba(0,0,0,.08);
  font-size: 10pt;
}
.rows li:last-child { border-bottom: 0; }
.rows li .label { color: var(--ink); }
.rows li .value { font-variant-numeric: tabular-nums; color: rgba(0,0,0,.7); }

/* ---------- Slip (DL 99×210mm) ---------- */
.slip-hero {
  background: var(--charcoal);
  color: var(--bone);
  padding: 14mm 10mm;
  min-height: 90mm;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.slip-hero img.logo { position: absolute; top: 12mm; left: 10mm; height: 18px; }
.slip-hero .eyebrow { color: var(--pulse); margin-bottom: 6px; }
.slip-hero h1 { color: var(--bone); font-size: 24pt; line-height: 1.05; }
.slip-body { padding: 12mm 10mm; }
.slip-foot {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 8mm 10mm 10mm;
  border-top: 1px solid rgba(0,0,0,.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 8pt;
  color: rgba(0,0,0,.6);
}
.slip-foot img { height: 14px; }
.paper--slip .slip-body p { font-size: 9.5pt; }
.paper--slip .slip-body ul { font-size: 9.5pt; }
.paper--slip { position: relative; }

/* ---------- Industrial info-lapp (Off-White inspired) ---------- */
.industrial {
  background: #faf7f2;
  color: #000;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 700;
  position: relative;
  overflow: hidden;
}

.industrial .hazard {
  position: absolute;
  left: 0; right: 0;
  height: 9mm;
  background: repeating-linear-gradient(
    -45deg,
    #000 0 3.5mm,
    transparent 3.5mm 7mm
  );
  z-index: 2;
}
.industrial .hazard.top { top: 0; }
.industrial .hazard.bottom { bottom: 0; transform: scaleY(-1); }

.industrial .reg {
  position: absolute;
  width: 6mm; height: 6mm;
  color: #000;
  font-family: ui-monospace, monospace;
  font-size: 14pt;
  line-height: 1;
  display: grid; place-items: center;
  user-select: none;
  z-index: 2;
}
.industrial .reg.tl { top: 12mm; left: 12mm; }
.industrial .reg.tr { top: 12mm; right: 12mm; }
.industrial .reg.bl { bottom: 12mm; left: 12mm; }
.industrial .reg.br { bottom: 12mm; right: 12mm; }

.industrial__inner {
  position: absolute;
  inset: 18mm;
  display: flex;
  flex-direction: column;
}

.industrial__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.industrial__logo { height: 12mm; }
.industrial--sm .industrial__logo { height: 9mm; }

.industrial__eyebrow {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 8pt;
  letter-spacing: .2em;
  text-transform: uppercase;
  font-weight: 900;
  color: #000;
  margin-top: 2mm;
}
.industrial__eyebrow .q {
  color: var(--pulse);
  margin: 0 .15em;
  font-weight: 900;
}

.industrial__title {
  margin: 14mm 0 8mm;
  font-weight: 900;
  font-size: 64pt;
  line-height: .95;
  letter-spacing: -.025em;
  text-transform: uppercase;
  color: #000;
}
.industrial--sm .industrial__title {
  font-size: 36pt;
  margin: 8mm 0 4mm;
}

.industrial__body {
  flex: 1;
  font-weight: 500;
}
.industrial__body p {
  font-size: 12pt;
  line-height: 1.45;
  margin: 0 0 8px;
  color: #000;
  font-weight: 500;
}
.industrial--sm .industrial__body p {
  font-size: 10pt;
}
.industrial__list {
  list-style: none;
  padding: 0;
  margin: 6mm 0 0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.industrial__list li {
  padding: 3mm 0;
  border-bottom: 1px solid #000;
}
.industrial__list li:last-child { border-bottom: 0; }
.industrial--sm .industrial__list { font-size: 8.5pt; }

.industrial__specs {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr 1fr;
  gap: 6mm;
  border-top: 1.5px solid #000;
  padding-top: 4mm;
  margin-top: 6mm;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.industrial--sm .industrial__specs {
  grid-template-columns: 1fr 1fr 1fr;
  font-size: 6.5pt;
}
.industrial__specs .k {
  display: block;
  font-size: 6.5pt;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(0,0,0,.5);
  margin-bottom: 1mm;
  font-weight: 500;
}
.industrial__specs .v {
  font-size: 8.5pt;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.industrial--sm .industrial__specs .v { font-size: 7.5pt; }

/* ---------- Business card sheet (10 per A4) ---------- */
.bcard-sheet {
  padding: 0;
  display: grid;
  grid-template-columns: 85mm 85mm;
  grid-template-rows: repeat(5, 55mm);
  column-gap: 20mm;     /* (A4 width 210 - 2×85) / 2 = 20mm */
  row-gap: 0;
  padding: 11mm 20mm;   /* (A4 height 297 - 5×55) / 2 = 11mm */
  background: white;
  justify-content: center;
}

.bcard {
  width: 85mm;
  height: 55mm;
  background: white;
  color: #131214;
  position: relative;
  overflow: hidden;
  border: 0.3pt solid rgba(0,0,0,.08); /* fine cut guide in preview only */
}

@media print {
  .bcard { border: 0; }
}

.bcard__front {
  padding: 6mm 7mm;
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100%;
}

.bcard__logo {
  height: 9px;
  width: auto;
  display: block;
}

.bcard__person {
  align-self: end;
  margin-top: 4mm;
}
.bcard__name {
  font-family: "Inter", "Helvetica Neue", sans-serif;
  font-size: 12pt;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.1;
  color: #131214;
}
.bcard__role {
  font-size: 7.5pt;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(0,0,0,.55);
  margin-top: 1.5mm;
  font-weight: 500;
}

.bcard__contact {
  font-size: 7pt;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  color: #131214;
  display: grid;
  gap: 0.4mm;
  margin-top: 2mm;
}
.bcard__contact .bcard__addr {
  margin-top: 1mm;
  font-size: 6.3pt;
  color: rgba(0,0,0,.55);
  letter-spacing: .04em;
}

/* Pulse-accent strip along left edge */
.bcard::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2.5mm;
  background: var(--pulse);
}

/* ---------- Add-row helpers in form ---------- */
.repeater__list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.repeater__row {
  display: grid;
  grid-template-columns: 1fr auto 28px;
  gap: 6px;
  align-items: stretch;
}
.repeater__row .input { padding: 8px 10px; }
.repeater__remove {
  background: transparent;
  color: var(--mist);
  border: 1px solid #34333a;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.repeater__remove:hover { color: var(--pulse); border-color: var(--pulse); }
.repeater__add {
  width: 100%;
  background: transparent;
  border: 1px dashed #34333a;
  color: var(--mist);
  padding: 8px;
  border-radius: var(--radius);
  cursor: pointer;
  font: inherit;
}
.repeater__add:hover { border-color: var(--pulse); color: var(--bone); }
