/* The printable flat sheet: one A4 page, the same drawing and schedule as the site.
   Screen shows the page on a desk; print drops everything around it. */

@page { size: A4 portrait; margin: 12mm; }

:root {
  --ink: #141b23;
  --soft: #34434f;
  --faint: #6c8492;
  --line: #d2dce2;
  --red: #141b23;
  --plan-ground: #fff;
  --plan-line: #141b23;
  --plan-dim: rgba(26, 35, 48, .55);
  --mono: Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #eceff4;
  color: var(--ink);
  font: 400 10pt/1.45 Inter, system-ui, -apple-system, sans-serif;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

h1, h2 { margin: 0; font-weight: 800; letter-spacing: -.02em; }

.bar { position: sticky; top: 0; z-index: 2; display: flex; gap: 10px; justify-content: center; padding: 12px; background: #fff; border-bottom: 1px solid var(--line); }
.bar__print, .bar__back {
  display: inline-flex; align-items: center; height: 40px; padding: 0 20px;
  border: 1px solid transparent; border-radius: 10px;
  font: 600 14px Inter, system-ui, sans-serif; text-decoration: none; cursor: pointer;
}
.bar__print { background: var(--red); color: #fff; }
.bar__back { border-color: var(--line); color: var(--ink); background: #fff; }

.sheet {
  display: flex;
  flex-direction: column;
  width: 186mm;
  min-height: 273mm;
  margin: 10mm auto;
  padding: 10mm;
  background: #fff;
  box-shadow: 0 18px 50px -28px rgba(15, 21, 32, .55);
}

.sheet__head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 4mm; border-bottom: 1px solid var(--line); }
.sheet__logo { width: 40mm; height: 11.7mm; }
.sheet__code { font: 500 8pt/1 var(--mono); letter-spacing: .14em; color: var(--faint); }

.sheet__lead { display: flex; align-items: flex-end; justify-content: space-between; gap: 8mm; margin-top: 6mm; }
.sheet__lead h1 { font-size: 26pt; line-height: 1; }
.sheet__place { margin: 2mm 0 0; color: var(--soft); font-weight: 600; }
.sheet__price { margin: 0; padding: 2mm 4mm; border: 1px solid var(--line); border-radius: 8px; font-weight: 700; white-space: nowrap; }

.sheet__facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4mm; margin: 6mm 0 0; padding: 4mm 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sheet__facts dt { font-size: 7.5pt; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.sheet__facts dd { margin: 1mm 0 0; font-size: 13pt; font-weight: 800; }

.sheet__body { display: grid; grid-template-columns: 1.3fr 1fr; gap: 6mm 8mm; margin-top: 6mm; }
.sheet__plan { margin: 0; display: flex; align-items: flex-start; justify-content: center; }
/* the floor drawing goes under the plan, in the same column */
.sheet__keyplan { grid-column: 1; margin: 0; }
.sheet__keyplan figcaption { margin-bottom: 2mm; font-size: 7.5pt; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.sheet__keyplan img { display: block; width: 100%; height: auto; max-height: 45mm; object-fit: contain; object-position: left; }
.sheet__spec { grid-column: 2; grid-row: 1 / span 2; }
.sheet__plan > svg, .sheet__plan > img { display: block; width: 100%; height: auto; max-height: 120mm; }
/* the 3D render, cropped to the plan and cut to the flat's outline (see plan_render_crop) */
.plan-crop { position: relative; display: block; overflow: hidden; aspect-ratio: var(--ratio); }
.plan-crop img { position: absolute; max-width: none; height: auto; }
.sheet__plan .plan-crop { width: min(100%, calc(120mm * var(--ratio))); }
/* with the floor drawing underneath, both shrink a little so the sheet stays one A4 page */
.sheet__body:has(.sheet__keyplan) .sheet__plan > svg, .sheet__body:has(.sheet__keyplan) .sheet__plan > img { max-height: 100mm; }
.sheet__body:has(.sheet__keyplan) .sheet__plan .plan-crop { width: min(100%, calc(100mm * var(--ratio))); }
.sheet__body:has(.sheet__keyplan) .sheet__keyplan img { max-height: 38mm; }
.sheet__nodrawing { color: var(--faint); }

.sheet__spec-head { display: flex; justify-content: space-between; padding-bottom: 2mm; border-bottom: 1px solid var(--ink); font-size: 8pt; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.sheet__rows { list-style: none; margin: 0; padding: 0; }
.sheet__rows li { display: flex; align-items: baseline; gap: 2mm; padding: 2.2mm 0; border-bottom: 1px solid var(--line); }
.sheet__no { font: 600 8pt var(--mono); color: var(--room); }
.sheet__name { font-size: 8.5pt; font-weight: 700; letter-spacing: .02em; }
.sheet__dots { flex: 1; border-bottom: 1px dotted var(--line); transform: translateY(-1px); }
.sheet__m2 { font: 600 9.5pt var(--mono); }
.sheet__sum, .sheet__total { display: flex; justify-content: space-between; align-items: baseline; padding: 2.5mm 0; }
.sheet__sum { color: var(--faint); font-size: 8.5pt; }
.sheet__total { border-top: 2px solid var(--ink); font-weight: 700; }
.sheet__total strong { font: 800 13pt var(--mono); }
.sheet__note { margin: 3mm 0 0; font-size: 7.5pt; line-height: 1.4; color: var(--faint); }

.sheet__standards { margin-top: auto; padding-top: 6mm; }
.sheet__standards h2 { font-size: 10pt; }
.sheet__standards ul { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2mm 6mm; list-style: none; margin: 3mm 0 0; padding: 0; }
.sheet__standards li { position: relative; padding-left: 5mm; font-size: 8.5pt; line-height: 1.35; }
.sheet__standards li::before {
  content: ""; position: absolute; left: 0; top: 1.1mm; width: 2.6mm; height: 1.4mm;
  border: 0 solid var(--red); border-width: 0 0 1.2px 1.2px; transform: rotate(-45deg);
}

.sheet__foot { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4mm; margin-top: 6mm; padding-top: 4mm; border-top: 1px solid var(--line); font-size: 8pt; }
.sheet__foot div { display: grid; gap: .8mm; }
.sheet__foot strong { font-size: 9pt; }
.sheet__foot span { color: var(--soft); }
.sheet__foot-url { text-align: right; }
.sheet__foot-url strong { font: 500 7.5pt var(--mono); word-break: break-all; }

/* the drawing, on paper */
.nacrt__svg { overflow: visible; }
.hatch-ground { fill: var(--plan-ground); }
.hatch-line { fill: var(--plan-line); fill-opacity: .5; }
.plan-walls { stroke: var(--plan-line); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.plan-cut { fill: var(--plan-ground); }
.plan-room__floor { fill: var(--plan-ground); }
.plan-room__edge { fill: var(--room); fill-opacity: .16; stroke: var(--room); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.plan-window { fill: var(--plan-ground); stroke: var(--plan-line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.plan-window__pane, .plan-door__leaf { stroke: var(--plan-line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.plan-door__swing { fill: none; stroke: var(--plan-line); stroke-width: 1; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.plan-tag circle { fill: var(--plan-ground); stroke: var(--room); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.plan-tag text { fill: var(--room); font-family: var(--mono); font-weight: 600; text-anchor: middle; }
.plan-cursor, .plan-select { display: none; }

@media print {
  body { background: #fff; }
  .bar { display: none; }
  .sheet { width: auto; min-height: 0; margin: 0; padding: 0; box-shadow: none; }
}
