/* Rørarbeidsflaten deler typografi og farger med undervisningsverktøylinjen. */
#tegneplan-root #tp-edu-pipes {
  padding: 8px 10px;
  border-top: 1px solid #dce6e0;
  background: #f8fbf9;
  color: #29463b;
  font: 12px/1.35 system-ui, sans-serif;
}
#tegneplan-root #tp-edu-pipes[hidden],
#tegneplan-root #tp-edu-pipes [hidden] { display: none !important; }
#tegneplan-root #tp-edu-pipes .tp-ep-grid,
#tegneplan-root #tp-edu-pipes .tp-ep-buttons {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 6px 8px;
}
#tegneplan-root #tp-edu-pipes .tp-ep-buttons { margin-top: 7px; }
#tegneplan-root #tp-edu-pipes label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  color: #38564b;
  font-size: 11px;
  font-weight: 600;
}
#tegneplan-root #tp-edu-pipes .tp-ep-grid > label { flex: 0 1 125px; }
#tegneplan-root #tp-edu-pipes .tp-ep-grid > label:has(> :is(#tp-ep-z, #tp-ep-slope)) { flex-basis: 78px; }
#tegneplan-root #tp-edu-pipes .tp-ep-grid > label:has(> #tp-ep-dim) { flex-basis: 110px; }
#tegneplan-root #tp-edu-pipes .tp-ep-grid > label:has(> #tp-ep-deck-select) { flex-basis: 155px; }
#tegneplan-root #tp-edu-pipes .tp-ep-grid > :is(
  #tp-ep-deck-depth-row, #tp-ep-deck-snap-row, #tp-ep-riser-purpose-row, #tp-ep-riser-fitting-row
) { flex-basis: 195px; }
#tegneplan-root #tp-edu-pipes :is(input, select) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 32px;
  padding: 4px 7px;
  border: 1px solid #c8d8cf;
  border-radius: 6px;
  background: #fff;
  color: #16392d;
  font: 500 12px/1.25 system-ui, sans-serif;
}
#tegneplan-root #tp-edu-pipes button {
  box-sizing: border-box;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid #cadcd1;
  border-radius: 6px;
  background: #fff;
  color: #124e3a;
  font: 600 12px/1.2 system-ui, sans-serif;
  cursor: pointer;
}
#tegneplan-root #tp-edu-pipes button:hover {
  border-color: #7dad94;
  background: #edf5f0;
}
#tegneplan-root #tp-edu-pipes :is(button, input, select, summary):focus-visible {
  outline: 2px solid #16805a;
  outline-offset: 1px;
}
#tegneplan-root #tp-edu-pipes button:is(.tp-ep-primary, .tp-ep-selected, [data-pipe-task][aria-pressed="true"]) {
  border-color: #087e54 !important;
  background: #087e54 !important;
  color: #fff !important;
}
#tegneplan-root #tp-edu-pipes button:is(.tp-ep-primary, .tp-ep-selected, [data-pipe-task][aria-pressed="true"]):hover {
  background: #086544 !important;
}
#tegneplan-root #tp-edu-pipes .tp-ep-taskbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-bottom: 8px;
}
#tegneplan-root #tp-edu-pipes .tp-ep-task-buttons {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 3px;
  box-sizing: border-box;
  max-width: 100%;
  padding: 3px;
  border: 1px solid #cfdfd6;
  border-radius: 8px;
  background: #edf4ef;
}
#tegneplan-root #tp-edu-pipes [data-pipe-task] {
  min-height: 34px;
  padding: 5px 14px;
  border-color: transparent;
  background: transparent;
  font-weight: 650;
}
#tegneplan-root #tp-edu-pipes .tp-ep-options { margin-top: 7px; }
#tegneplan-root #tp-edu-pipes .tp-ep-options > summary {
  width: fit-content;
  padding: 4px 7px;
  border-radius: 4px;
  color: #234e3e;
  font-weight: 650;
  cursor: pointer;
}
#tegneplan-root #tp-edu-pipes .tp-ep-options > summary:hover { background: #edf5f0; }
#tegneplan-root #tp-edu-pipes .tp-ep-options-content {
  margin-top: 5px;
  padding: 7px 0 2px;
  border-top: 1px solid #dce6e0;
}
#tegneplan-root #tp-edu-pipes .tp-ep-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 5px;
  color: #466658;
  font-size: 11px;
}
#tegneplan-root #tp-edu-pipes #tp-ep-kind-note:empty { display: none; }
#tegneplan-root #tp-ep-message { color: #126446; font-weight: 600; }
@media (max-width: 600px) {
  #tegneplan-root #tp-edu-pipes .tp-ep-grid > label { flex: 1 1 125px; }
  #tegneplan-root #tp-edu-pipes .tp-ep-task-buttons { flex: 1 1 auto; }
  #tegneplan-root #tp-edu-pipes [data-pipe-task] { flex: 1 1 auto; padding-inline: 8px; }
}
@media (pointer: coarse) {
  #tegneplan-root #tp-edu-pipes :is(button, select, input[type="number"]) { min-height: 38px; }
}

#tegneplan-root.tp-edu-upstand-active #tp-svg{cursor:crosshair!important}

#tegneplan-root.tp-edu-continue-active #tp-svg{cursor:crosshair!important}

/* v1.9.269 – mer presise tilkoblinger; aktivt forleng-verktøy */
#tegneplan-root.tp-edu-extend-active #tp-svg{cursor:crosshair!important}

/* v1.9.270: Oppstikk først, uten å overstyre andre menyer. */
#tegneplan-root #tp-ep-clearance{margin-top:7px;font-size:11px;color:#3b6656}
#tegneplan-root #tp-ep-clearance.tp-ep-warning{color:#9f5a1a;font-weight:700}
#tegneplan-root.tp-edu-first-upstand-active #tp-svg{cursor:crosshair!important}

/* v1.9.272: Mens rør trekkes ut fra oppstikk skal ingen gammel 2D-redigeringsboks skjule arbeidsfeltet. */
#tegneplan-root.tp-edu-pipe-from-riser .tp-floating-object-toolbar{display:none!important}

/* v1.9.274 – bevisst rørtilkobling og liten vinkeltekst */
#tp-quick-angle-info,.tp-float-pipe-angle{font-size:11px;line-height:1.35;color:#315348;margin:4px 0 5px;}
#tp-quick-wall-slide{font-size:11px;width:100%;margin:4px 0 6px;padding:6px;}

/* v1.9.275 – Lengetinnskriving skal ALDRI dekke rørtegningen.
   Vis den som en smal verktøyrad ovenfor tegneflaten. */
#tegneplan-root.tp-edu-length-docked #tp-edu-pipes #tp-quick-length,
#tegneplan-root.tp-edu-length-docked #tp-edu-pipes #tp-quick-length.is-open {
  position:static !important; inset:auto !important; left:auto !important; top:auto !important;
  display:flex !important; flex-flow:row wrap !important; align-items:center !important;
  gap:8px !important; width:100% !important; max-width:none !important;
  margin:7px 0 3px !important; padding:7px 10px !important; box-sizing:border-box !important;
  border:1px solid #aacdbb !important; border-radius:7px !important; box-shadow:none !important;
  background:#f5faf7 !important; z-index:auto !important;
}
#tegneplan-root.tp-edu-length-docked #tp-edu-pipes #tp-quick-length:not(.is-open){display:none !important;}
#tegneplan-root.tp-edu-length-docked #tp-quick-length .tp-quick-help,
#tegneplan-root.tp-edu-length-docked #tp-quick-length .tp-quick-label{display:none !important;}
#tegneplan-root.tp-edu-length-docked #tp-quick-length .tp-quick-title{font-size:12px !important; font-weight:650 !important; white-space:nowrap !important;}
#tegneplan-root.tp-edu-length-docked #tp-quick-length .tp-quick-row{display:grid !important;grid-template-columns:minmax(95px,145px) 80px !important;gap:5px !important;}
#tegneplan-root.tp-edu-length-docked #tp-quick-length .tp-quick-row input,
#tegneplan-root.tp-edu-length-docked #tp-quick-length .tp-quick-row select{min-height:32px !important;height:32px !important;padding:5px 7px !important;font-size:12px !important;font-weight:500 !important;border-radius:5px !important;}
#tegneplan-root.tp-edu-length-docked #tp-quick-length .tp-quick-angle-info{font-size:11px !important;margin:0 !important;max-width:260px !important;}
#tegneplan-root.tp-edu-length-docked #tp-quick-length .tp-quick-actions{display:flex !important;gap:5px !important;margin:0 !important;}
#tegneplan-root.tp-edu-length-docked #tp-quick-length .tp-quick-actions .tp-btn{min-height:32px !important;padding:4px 12px !important;font-size:12px !important;}

/* Nytt rør skal vises tydelig, men uten plakataktig typografi. */
#tegneplan-root.tp-edu-active #tp-preview .tp-live-length-label {
  font-size:10px !important; font-weight:500 !important;
  paint-order:normal !important; text-shadow:none !important;
}

/* v1.9.280: tydelig, ikke-blokkerende hulromskontroll for undervisning. */
#tegneplan-root #tp-ep-deck-review{margin-top:6px;padding:5px 7px;background:#eaf6ef;border-left:3px solid #6aa887}
#tegneplan-root #tp-ep-deck-review.tp-ep-warning{color:#943c1b;border-left-color:#ca532a;background:#fff3e9;font-weight:700}
#tegneplan-root #tp-ep-message.tp-ep-warning{color:#ac401f}

/* v1.9.281: kompakt og valgfri festehjelp – kun for aktivt bjelkelag. */
#tegneplan-root #tp-edu-pipes .tp-ep-snap-inline{display:inline-flex;align-items:center;gap:6px;font-size:11px;color:#075c49;font-weight:600}
#tegneplan-root #tp-edu-pipes #tp-ep-deck-snap{width:16px;height:16px;min-height:16px;max-width:16px;accent-color:#087e54;cursor:pointer;margin:0}

#tegneplan-root #tp-edu-pipes .tp-ep-system-controls {
  display:flex; align-items:center; gap:10px; min-height:29px; padding:0 3px;
}
#tegneplan-root #tp-edu-pipes .tp-ep-system-controls label {
  display:inline-flex; flex-direction:row; flex:none; align-items:center; min-width:0; gap:5px;
  white-space:nowrap; cursor:pointer;
}
#tegneplan-root #tp-edu-pipes .tp-ep-system-controls input {
  width:16px; height:16px; min-height:16px; padding:0; margin:0; accent-color:#087e54; cursor:pointer;
}

#tegneplan-root .tp-pipe-measurements {
  margin: 8px 0;
  padding: 10px;
  border: 1px solid #d0e2d8;
  border-radius: 6px;
  background: #f7fbf8;
  color: #29463b;
  font-size: 12px;
}
#tegneplan-root .tp-pipe-measurements h3 { margin: 0 0 6px; font-size: 14px; }
#tegneplan-root .tp-pipe-measurements dl {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 9px;
  margin: 0 0 6px;
}
#tegneplan-root .tp-pipe-measurements dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
#tegneplan-root .tp-pipe-measurements output { font-weight: 700; }
#tegneplan-root .tp-pipe-measurements fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 6px 8px;
  margin: 8px 0;
  border: 1px solid #cadcd1;
  border-radius: 5px;
}
#tegneplan-root .tp-pipe-measurements legend,
#tegneplan-root .tp-pipe-measurements summary { font-weight: 650; }
#tegneplan-root .tp-pipe-measurements summary { cursor: pointer; }
#tegneplan-root .tp-pipe-measurements p { margin: 4px 0; }
#tegneplan-root .tp-pipe-measurements fieldset p { flex: 1 0 100%; margin: 0; }
#tegneplan-root .tp-pipe-measurements fieldset label { flex: 1 1 75px; min-width: 0; }
#tegneplan-root .tp-pipe-measurements select { width: 100%; margin-top: 3px; }
#tegneplan-root .tp-pipe-measure-end { margin-top: 7px; padding-top: 7px; border-top: 1px solid #d0e2d8; }

#tegneplan-root .tp-pipe-bend-editor {
  margin: 8px 0;
  padding: 8px 10px;
  border: 1px solid #d0e2d8;
  border-radius: 6px;
  color: #29463b;
  font-size: 12px;
}
#tegneplan-root .tp-pipe-bend-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
#tegneplan-root .tp-pipe-bend-controls select { width: auto; min-width: 65px; }
#tegneplan-root .tp-pipe-bend-editor p { margin: 6px 0 0; }
#tegneplan-root .tp-pipe-bend-editor p:first-child { margin-top: 0; }
#tegneplan-root [data-pipe-bend-status]:empty { margin: 0; }
