/* Iluminação · Lote 16 — estilos.
   Secções: variáveis e base · cabeçalho · vista da planta e ferramentas · folha de detalhe ·
   painéis laterais · seletor de tipo · diálogo de impressão · ecrã largo · desenho das plantas ·
   layout de impressão (pré-visualização e papel). */

/* ---------- variáveis e base ---------- */
:root {
  --bg: #f3f1ec;
  --panel: #fff;
  --fg: #1d1b17;
  --muted: #6b665c;
  --line: #dcd7cd;
  --accent: #b86a08;
  --cmd: #2f5d8a;
  --sel: #e0353f;
  --board: #fff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171613;
    --panel: #232120;
    --fg: #ece8e0;
    --muted: #a39d91;
    --line: #3a362f;
    --accent: #e8a040;
    --cmd: #7fb0e0;
    --sel: #ff6b72;
    --board: #f7f5f0;
  }
}
/* (tema escuro definido acima por prefers-color-scheme) */
html,
body {
  height: 100%;
  margin: 0;
}
body {
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, Roboto, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.4;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
* {
  box-sizing: border-box;
}
/* ---------- cabeçalho ---------- */
.app {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  padding-top: env(safe-area-inset-top, 0px);
}
header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px max(12px, env(safe-area-inset-right, 0px)) 8px max(12px, env(safe-area-inset-left, 0px));
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
header h1 {
  font-size: 16px;
  margin: 0;
  font-weight: 600;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 120px;
}
header h1 small {
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
  display: block;
}
.badge {
  font-size: 11.5px;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}
.sync {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}
.sync[data-state="off"] {
  color: var(--sel);
}
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  padding: 3px;
  border-radius: 10px;
  flex: 1;
  min-width: 0;
}
.tabs button {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 9px 6px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  min-width: 0;
  white-space: nowrap;
}
.tabs button[aria-selected="true"] {
  background: var(--panel);
  color: var(--fg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
.btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--fg);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}
.btn[aria-pressed="true"] {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}
.btn.danger {
  color: var(--sel);
  border-color: var(--sel);
}
.btn.sq {
  width: 40px;
  height: 36px;
  padding: 0;
}
.btn:disabled {
  opacity: 0.45;
}
/* ---------- vista da planta e ferramentas ---------- */
.main {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}
.board {
  position: relative;
  min-width: 0;
  min-height: 0;
  background: var(--board);
}
svg.view {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  display: block;
}
.zoom {
  position: absolute;
  right: max(10px, env(safe-area-inset-right, 0px));
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.zoom button {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid #cfcac0;
  background: #fff;
  color: #1d1b17;
  font-size: 20px;
}
.tools {
  position: absolute;
  left: max(10px, env(safe-area-inset-left, 0px));
  bottom: 14px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  max-width: calc(100% - 70px);
}
.tools button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid #cfcac0;
  background: #fff;
  color: #1d1b17;
  font-size: 14px;
  font-weight: 500;
}
.tools button[hidden] {
  display: none;
}
.tools button svg {
  width: 20px;
  height: 20px;
}
.tools button[aria-pressed="true"] {
  background: #1d1b17;
  color: #fff;
  border-color: #1d1b17;
}
#t-add[aria-pressed="true"] {
  background: var(--sel);
  border-color: var(--sel);
}
#t-clear {
  color: #c2185b;
  border-color: #c2185b;
}
@media (max-width: 520px) {
  .tools button span {
    display: none;
  }
  .tools button {
    padding: 0 11px;
  }
  #t-clear::before {
    content: "✕ medidas";
  }
  #t-add[aria-pressed="true"]::after {
    content: "terminar";
  }
  #t-mob[aria-pressed="true"]::after,
  #t-wall[aria-pressed="true"]::after {
    content: "terminar";
  }
}
.scale {
  position: absolute;
  right: max(10px, env(safe-area-inset-right, 0px));
  top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #1d1b17;
  background: rgba(255, 255, 255, 0.85);
  padding: 3px 8px;
  border-radius: 6px;
  pointer-events: none;
}
.scale .bar {
  width: 70px;
  border-bottom: 3px solid #1d1b17;
  border-left: 2px solid #1d1b17;
  border-right: 2px solid #1d1b17;
  box-sizing: border-box;
  height: 8px;
}
.handle {
  fill: rgba(255, 255, 255, 0.6);
  stroke: #e0353f;
  stroke-width: 40;
  cursor: move;
}
.handle.ms {
  stroke: #c2185b;
}
.handle.rs {
  fill: #fff;
  cursor: nwse-resize;
}
/* mobiliário paramétrico (dados/mobiliario.json), camada #mob por baixo dos símbolos */
.mob {
  cursor: pointer;
}
.mobdim {
  pointer-events: none;
}
.mobdim text {
  font-family: Helvetica, Arial, sans-serif;
}
.sheet .code.wall {
  background: #444;
}
.sheet .code.ms {
  background: #c2185b;
}
.sheet .code.mob {
  background: #8a5a2b;
}
.sheet .ref input {
  width: 62%;
  font: inherit;
  padding: 2px 6px;
}
.fld4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.dst {
  display: grid;
  gap: 2px;
  font-size: 11px;
  color: var(--muted);
}
.dst input {
  padding: 6px 4px;
  text-align: center;
}
#t-mob[aria-pressed="true"] {
  background: #8a5a2b;
  border-color: #8a5a2b;
}
.hint {
  position: absolute;
  left: max(10px, env(safe-area-inset-left, 0px));
  top: 10px;
  background: rgba(255, 255, 255, 0.9);
  color: #3a3630;
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 12.5px;
  pointer-events: none;
  max-width: 72%;
}
/* ---------- folha de detalhe (ponto, sanca, linha) ---------- */
.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--panel);
  border-top: 1px solid var(--line);
  border-radius: 14px 14px 0 0;
  padding: 12px max(14px, env(safe-area-inset-right, 0px)) max(14px, env(safe-area-inset-bottom, 0px))
    max(14px, env(safe-area-inset-left, 0px));
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.12);
  transform: translateY(110%);
  max-height: 62%;
  overflow: auto;
  visibility: hidden;
  transition:
    transform 0.2s,
    visibility 0s 0.2s;
}
.sheet.open {
  transform: none;
  visibility: visible;
  transition:
    transform 0.2s,
    visibility 0s;
}
.sheet .ref {
  font-family: ui-monospace, "Roboto Mono", monospace;
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 6px;
}
.sheet .code {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-family: ui-monospace, "Roboto Mono", monospace;
  font-size: 13px;
  color: #fff;
  background: var(--accent);
  vertical-align: middle;
  margin-left: 6px;
}
.sheet .code.C {
  background: var(--cmd);
}
.sheet .code.ln {
  background: #1f7a6d;
}
.sheet .code.novo {
  background: var(--sel);
}
.sheet dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  margin: 8px 0 0;
  font-size: 14px;
}
.sheet dt {
  color: var(--muted);
}
.sheet dd {
  margin: 0;
}
.sheet .x {
  position: absolute;
  right: 12px;
  top: 8px;
  border: 0;
  background: transparent;
  font-size: 22px;
  color: var(--muted);
  padding: 4px 8px;
}
.sheet input,
.sheet select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 9px;
  font: inherit;
  background: var(--panel);
  color: var(--fg);
}
.fld {
  display: grid;
  gap: 3px;
  margin: 6px 0;
}
.fld label {
  font-size: 12px;
  color: var(--muted);
}
.fld2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.desc {
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0 6px;
}
.moveRow {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0;
  flex-wrap: wrap;
}
.moveRow .lbl {
  font-size: 12.5px;
  color: var(--muted);
}
.row2 {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.sw {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.sw button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--line);
  padding: 0;
  background: linear-gradient(135deg, var(--accent) 50%, var(--cmd) 50%);
}
.sw button[aria-pressed="true"] {
  border-color: var(--fg);
  box-shadow:
    0 0 0 2px var(--panel),
    0 0 0 4px var(--fg);
}
.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}
.tag {
  display: inline-block;
  font-size: 11px;
  color: #fff;
  background: var(--sel);
  border-radius: 999px;
  padding: 1px 7px;
  vertical-align: middle;
}
/* ---------- painéis: lista, legenda, notas ---------- */
.panel {
  position: absolute;
  inset: 0;
  background: var(--panel);
  overflow: auto;
  padding: 12px max(14px, env(safe-area-inset-right, 0px)) max(24px, env(safe-area-inset-bottom, 0px))
    max(14px, env(safe-area-inset-left, 0px));
  display: none;
}
.panel.open {
  display: block;
}
.panel h2 {
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 14px 0 6px;
}
.panel h3 {
  font-size: 15px;
  margin: 14px 0 4px;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 6px 0;
}
.lg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.lg svg {
  width: 40px;
  height: 40px;
  flex: none;
}
.lg span {
  color: var(--muted);
  font-size: 13px;
}
.panel table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.panel td {
  padding: 7px 6px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.panel td.r {
  font-family: ui-monospace, "Roboto Mono", monospace;
  white-space: nowrap;
  width: 46px;
}
.panel td.c {
  font-family: ui-monospace, "Roboto Mono", monospace;
  white-space: nowrap;
  width: 52px;
  color: var(--muted);
}
.panel tr.room td {
  background: var(--bg);
  font-weight: 600;
  padding: 9px 6px 5px;
}
.panel tr[data-id],
.panel tr[data-line] {
  cursor: pointer;
}
.note p {
  margin: 0 0 10px;
}
.panel .sum {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin: 6px 0 10px;
}
.panel .sum div {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
}
.panel .sum b {
  font-size: 20px;
  display: block;
}
.panel .sum span {
  color: var(--muted);
  font-size: 12.5px;
}
/* ecrã de carregamento e erro de arranque */
.boot {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 24px;
  background: var(--board);
  color: #3a3630;
  font-size: 14px;
  line-height: 1.5;
  z-index: 3;
}
.boot[hidden] {
  display: none;
}
.boot small {
  color: #6b665c;
}
.boot code {
  font-family: ui-monospace, "Roboto Mono", monospace;
}
/* ---------- seletor de tipo (Adicionar) ---------- */
.picker {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--panel);
  border-top: 1px solid var(--line);
  border-radius: 14px 14px 0 0;
  padding: 10px max(14px, env(safe-area-inset-right, 0px)) max(14px, env(safe-area-inset-bottom, 0px))
    max(14px, env(safe-area-inset-left, 0px));
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.12);
  max-height: 70%;
  overflow: auto;
  display: none;
}
.picker.open {
  display: block;
}
.picker h3 {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 10px 0 6px;
}
.picker .x {
  position: absolute;
  right: 12px;
  top: 6px;
  border: 0;
  background: transparent;
  font-size: 22px;
  color: var(--muted);
  padding: 4px 8px;
}
.pk {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.pk button {
  display: grid;
  grid-template-columns: 36px 1fr;
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: var(--panel);
  color: var(--fg);
  font: inherit;
  min-height: 56px;
}
.pk button svg {
  width: 36px;
  height: 36px;
  grid-row: 1/3;
}
.pk button b {
  font-family: ui-monospace, "Roboto Mono", monospace;
  font-size: 13px;
}
.pk button span {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.2;
}
/* ---------- diálogo de impressão ---------- */
.dlg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.dlg.open {
  display: flex;
}
.dlg .box {
  background: var(--panel);
  border-radius: 14px;
  padding: 16px;
  width: min(420px, 100%);
  position: relative;
}
.dlg h2 {
  font-size: 17px;
  margin: 0 0 10px;
}
.dlg .x {
  position: absolute;
  right: 8px;
  top: 6px;
  border: 0;
  background: transparent;
  font-size: 22px;
  color: var(--muted);
  padding: 4px 8px;
}
.dlg label.ck {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 8px 0;
  font-size: 14px;
}
.dlg select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 9px;
  font: inherit;
  background: var(--panel);
  color: var(--fg);
}
/* ---------- ecrã largo: painel lateral fixo ---------- */
@media (min-width: 700px) {
  .main {
    grid-template-columns: 1fr auto;
  }
  .side {
    width: 360px;
    border-left: 1px solid var(--line);
    background: var(--panel);
    overflow: auto;
    position: relative;
  }
  .side:not(:has(.panel.open)) {
    display: none;
  }
  .panel {
    position: static;
    display: block;
    padding: 12px 14px 24px;
  }
  .panel:not(.open) {
    display: none;
  }
  .sheet,
  .picker {
    left: auto;
    right: max(14px, env(safe-area-inset-right, 0px));
    width: 400px;
    border-radius: 14px;
    bottom: 14px;
    max-height: 70%;
    border: 1px solid var(--line);
  }
}

/* ---------- desenho das plantas (plantas/pisoN.svg) ---------- */
.plan .wall {
  stroke: #161616;
  stroke-width: 30;
  fill: none;
  stroke-linejoin: round;
}
.plan .wallfill {
  fill: #c9c6bf;
  stroke: none;
}
/* paredes paramétricas (dados/paredes.json): contorno por baixo, preenchimento por cima */
.plan .pwalls .pwo {
  fill: none;
  stroke: #161616;
  stroke-width: 50;
  stroke-linejoin: miter;
  pointer-events: none;
}
.plan .pwalls .pw {
  fill: #c9c6bf;
  stroke: none;
  cursor: pointer;
}
.plan .pwalls .pw.sel {
  fill: #e6c9cb;
}
.plan .door {
  stroke: #3a3a3a;
  stroke-width: 14;
  fill: none;
}
.plan .stair {
  stroke: #6a6a6a;
  stroke-width: 12;
  fill: none;
}
.plan .rail {
  stroke: #6a6a6a;
  stroke-width: 12;
  fill: none;
}
.plan .furn {
  stroke: #c3c0b9;
  stroke-width: 8;
  fill: none;
}
.plan .floor {
  stroke: #cfccc5;
  stroke-width: 10;
  fill: none;
}
.plan .misc {
  stroke: #9a9a9a;
  stroke-width: 10;
  fill: none;
}
.plan .slab {
  fill: #eeece7;
  stroke: none;
}
.plan .water {
  fill: #d9eaf7;
  stroke: none;
}
.plan text {
  font-family: Helvetica, Arial, sans-serif;
}
.plan .lbl {
  fill: #2a2a2a;
}
.plan .lblarea {
  fill: #7a7a7a;
}
.plan .stairno {
  fill: #9a9a9a;
}

.plan.off {
  display: none;
}
.plan.nofurn .furn {
  display: none;
}
.item.sel use {
  color: var(--sel) !important;
}
.sanca-g.sel line:last-of-type {
  stroke: #e0353f !important;
}
/* ---------- layout de impressão (pré-visualização no ecrã e papel) ---------- */
#print {
  display: none;
  background: #8a867e;
  color: #1d1b17;
  font-family: Inter, Roboto, "Segoe UI", system-ui, sans-serif;
  font-size: 9.5pt;
  line-height: 1.35;
  --pw: 180mm;
  --ph: 200mm;
  --pad: 8mm;
}
body.preview {
  overflow: auto;
}
body.preview .app {
  display: none;
}
body.preview #print {
  display: block;
  padding: 12px 0 40px;
}
body.preview #pvbar {
  display: flex;
}
#pvbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 8px max(12px, env(safe-area-inset-right, 0px)) 8px max(12px, env(safe-area-inset-left, 0px));
  gap: 8px;
  align-items: center;
}
#print .pg,
#print .flow {
  width: var(--pw);
  background: #fff;
  margin: 0 auto 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  position: relative;
}
#print .pg {
  height: var(--ph);
  padding: var(--pad) var(--pad) calc(var(--pad) - 1mm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#print .flow {
  min-height: var(--ph);
  padding: calc(var(--pad) + 1mm) var(--pad);
}
#print .cover .eyebrow {
  font-size: 8.5pt;
  color: #6b665c;
}
#print .cover h1 {
  font-size: 26pt;
  line-height: 1.1;
  margin: 10mm 0 6mm;
  font-weight: 600;
  letter-spacing: -0.01em;
}
#print .cover .lead {
  font-size: 10.5pt;
  max-width: 150mm;
  margin: 0 0 8mm;
}
#print .tot {
  border-collapse: collapse;
  width: 100%;
  font-size: 9.5pt;
  margin-bottom: 8mm;
  font-variant-numeric: tabular-nums;
}
#print .tot th {
  text-align: left;
  font-weight: 500;
  color: #6b665c;
  border-bottom: 1px solid #b9b3a6;
  padding: 2mm 1.5mm;
}
#print .tot td {
  padding: 2.2mm 1.5mm;
  border-bottom: 1px solid #dcd7cd;
}
#print .tot tr.sum td {
  font-weight: 600;
  border-bottom: 0;
}
#print .tot td:nth-child(n + 2),
#print .tot th:nth-child(n + 2) {
  text-align: right;
}
#print .how h2 {
  font-size: 9pt;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b665c;
  margin: 0 0 2mm;
}
#print .how p {
  margin: 0 0 3mm;
  max-width: 160mm;
}
#print .small {
  font-size: 8.5pt;
  color: #6b665c;
}
#print .mono {
  font-family: ui-monospace, Menlo, monospace;
}
#print .planpg header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 10pt;
  border-bottom: 1px solid #b9b3a6;
  padding-bottom: 2mm;
  margin-bottom: 2mm;
}
#print .planpg header .r {
  font-size: 8.5pt;
  color: #6b665c;
}
#print .planbox {
  flex: 1;
  min-height: 0;
  position: relative;
}
#print .planbox svg.pp {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#print .planpg footer {
  border-top: 1px solid #dcd7cd;
  padding-top: 1.5mm;
  margin-top: 2mm;
  font-size: 7.5pt;
  color: #3a3630;
  display: flex;
  justify-content: space-between;
  gap: 4mm;
  align-items: flex-start;
}
#print .strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1mm 3.5mm;
}
#print .lgs {
  display: inline-flex;
  align-items: center;
  gap: 1mm;
  white-space: nowrap;
}
#print .lgs svg {
  width: 5mm;
  height: 5mm;
}
#print .lgs b {
  font-family: ui-monospace, Menlo, monospace;
  font-weight: 600;
  color: #1d1b17;
}
#print .pn {
  color: #6b665c;
  white-space: nowrap;
  font-size: 7.5pt;
}
#print .cover .pn {
  position: absolute;
  bottom: 7mm;
  right: 8mm;
}
#print table.list {
  width: 100%;
  border-collapse: collapse;
  font-size: 9pt;
}
#print table.list th {
  text-align: left;
  font-weight: 500;
  color: #6b665c;
  border-bottom: 1px solid #b9b3a6;
  padding: 1.5mm 1.5mm;
}
#print table.list th.th-title {
  font-size: 11pt;
  color: #1d1b17;
  border-bottom: 0;
  padding: 0 0 3mm;
}
#print table.list td {
  padding: 1.6mm 1.5mm;
  border-bottom: 1px solid #e4e0d8;
  vertical-align: top;
}
#print table.list td.r {
  font-family: ui-monospace, Menlo, monospace;
  white-space: nowrap;
  width: 12mm;
}
#print table.list td.c {
  font-family: ui-monospace, Menlo, monospace;
  white-space: nowrap;
  width: 13mm;
  color: #6b665c;
}
#print table.list td.n {
  color: #3a3630;
  width: 46mm;
}
#print table.list tr.room td {
  background: #f3f1ec;
  font-weight: 600;
  padding: 2.2mm 1.5mm 1.4mm;
}
#print h2.sec {
  font-size: 14pt;
  margin: 0 0 4mm;
  font-weight: 600;
}
#print h3 {
  font-size: 10.5pt;
  margin: 4mm 0 1mm;
  font-weight: 600;
}
#print .flow p {
  margin: 0 0 2mm;
  max-width: 160mm;
}
#print .lgwrap {
  column-count: 2;
  column-gap: 6mm;
}
#print .lg {
  display: flex;
  gap: 3mm;
  align-items: flex-start;
  break-inside: avoid;
  padding: 2mm 0;
  border-bottom: 1px solid #e4e0d8;
  font-size: 9pt;
}
#print .lg svg {
  width: 9mm;
  height: 9mm;
  flex: none;
}
#print .lg span {
  color: #6b665c;
  font-size: 8.5pt;
}
#print .lg b {
  font-family: ui-monospace, Menlo, monospace;
}
#print .tag {
  font-size: 7.5pt;
  padding: 0 5px;
}
@media print {
  html,
  body {
    height: auto;
    overflow: visible;
    background: #fff;
  }
  .app,
  #pvbar,
  .dlg {
    display: none !important;
  }
  #print,
  body.preview #print {
    display: block;
    background: #fff;
    padding: 0;
  }
  #print .pg,
  #print .flow {
    margin: 0;
    box-shadow: none;
    break-after: page;
    break-before: page;
  }
  #print .pg.cover {
    break-before: auto;
  }
  #print .flow {
    min-height: 0;
    padding: calc(var(--pad) + 1mm) var(--pad);
  }
  #print table.list tr {
    break-inside: avoid;
  }
  #print thead {
    display: table-header-group;
  }
  #print .pg {
    height: calc(var(--ph) - 1mm);
  }
}

/* ---------- camadas (olhinho): classes h-<id> no svg.view (ecrã) e em cada svg.pp (PDF) ---------- */
.h-lum .item.cat-L,
.h-com .item.cat-C,
.h-sanca .sanca-g,
.h-refs .ref,
.h-mob .mobg,
.h-lines .ln,
.h-meas .ms,
.h-pwalls .plan .pwalls,
.h-walls .plan .wall,
.h-walls .plan .wallfill,
.h-walls .plan .slab,
.h-doors .plan .door,
.h-doors .plan .stair,
.h-doors .plan .rail,
.h-furn .plan .furn,
.h-floor .plan .floor,
.h-floor .plan .misc,
.h-water .plan .water,
.h-texts .plan .texts,
.h-texts .plan text {
  display: none;
}
.zoom button[aria-pressed="true"] {
  background: #e9e5dc;
  color: #8a867e;
}
.lyr {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--fg);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.lyr .eye {
  width: 42px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--fg);
}
.lyr .eye svg {
  width: 22px;
  height: 22px;
}
.lyr .eye .closed,
.lyr[aria-pressed="false"] .eye .open {
  display: none;
}
.lyr[aria-pressed="false"] .eye .closed {
  display: block;
}
.lyr[aria-pressed="false"] .eye {
  color: var(--muted);
  border-style: dashed;
}
.lyr .sw {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex: none;
  border: 1px solid rgba(0, 0, 0, 0.15);
}
.lyr .nm {
  flex: 1;
  min-width: 0;
}
.lyr .nm small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.lyr[aria-pressed="false"] .nm {
  color: var(--muted);
}
.lyr .cnt {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  min-width: 1.5em;
  text-align: right;
}
