/* El área de trabajo ocupa la ventana; solo los paneles tienen desplazamiento. */
html,
body {
  height: 100%;
  overflow: hidden;
}
body {
  height: 100dvh;
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr) 24px;
}
#app {
  min-height: 0;
  overflow: hidden;
}
.cabecera {
  height: 64px;
  padding: 0 22px;
  gap: 16px;
}
.marca {
  font-size: 13px;
  min-width: 210px;
}
.marca-simbolo {
  font-size: 36px;
}
.marca small {
  font-size: 9px;
}
.navegacion {
  gap: 20px;
}
.header-ficha {
  color: #c3cbe7;
  font-size: 13px;
  display: none;
}
.workspace {
  height: 100%;
  min-height: 0;
  grid-template-columns: 216px minmax(0, 1fr) 290px;
}
.sidebar {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.sidebar-bottom {
  display: none;
}
.proyecto {
  padding: 18px;
}
.proyecto h1 {
  font-size: 25px;
  margin: 12px 0 8px;
}
.proyecto p {
  font-size: 12px;
}
.project-meta {
  margin-top: 17px;
  gap: 14px;
}
.project-meta > span {
  font-size: 13px;
}
.sidebar-section {
  padding: 14px 12px;
}
.sidebar h2 {
  font-size: 12px;
  margin-bottom: 8px;
}
.system-row,
.level-row {
  font-size: 12px;
  padding: 8px 7px;
  gap: 7px;
}
.system-row .dot {
  width: 10px;
  height: 10px;
  border: 1px solid #0002;
}
.system-row[aria-pressed="true"] {
  background: #ecedf3;
  color: #232b4f;
}
.system-row[aria-pressed="false"] {
  opacity: 0.48;
}
.level-row .cota {
  font-size: 10px;
}
.proyecto .eyebrow {
  font-size: 9px;
}
.search-label {
  font-size: 12px;
  margin-bottom: 8px;
}
.search input {
  font-size: 12px;
}
.search-results {
  max-height: 220px;
}
.model-area {
  display: grid;
  grid-template-rows: 40px auto minmax(0, 1fr) auto auto auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.model-header {
  height: 40px;
  padding: 8px 14px;
}
.breadcrumbs {
  font-size: 12px;
  gap: 8px;
}
.level-badge {
  font-size: 8px;
}
.work-modes {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  flex-wrap: wrap;
  z-index: 5;
}
.work-modes button {
  font-size: 11px;
  padding: 7px 8px;
  border-radius: 4px;
  color: #565e81;
}
.work-modes button.active,
.work-modes button[aria-pressed="true"] {
  background: #172049;
  color: white;
}
.work-modes select {
  font-size: 11px;
  margin-left: auto;
  border: 1px solid #cbcfdf;
  background: #f6f7fa;
  padding: 5px;
  color: #293258;
  border-radius: 3px;
}
.work-modes #show-plan {
  border: 1px solid #ced1dc;
  color: #00257b;
}
.work-modes #show-plan[aria-pressed="true"] {
  color: white;
}
.viewport {
  min-height: 0;
  flex: none;
  height: 100%;
  background: radial-gradient(ellipse at 55% 38%, #f4f5fa, #dcdfeb);
}
.viewport-top {
  inset: 16px 16px auto;
  gap: 8px;
}
.scene-label > span {
  font-size: 8px;
  color: #4d557b;
}
.scene-label h2 {
  font-size: 19px;
  letter-spacing: -0.5px;
  margin-top: 6px;
  max-width: 290px;
}
.view-controls {
  flex-direction: row;
}
.view-controls button {
  font-size: 9px;
  padding: 7px;
}
.model-hint {
  bottom: 10px;
  font-size: 10px;
  color: #474f75;
}
.compass {
  right: 17px;
  bottom: 35px;
}
#selection-label {
  bottom: 30px;
  font-size: 9px;
}
.toolbar {
  min-height: 0;
  flex-wrap: nowrap;
  padding: 7px 10px;
  gap: 8px;
}
.tool-group {
  gap: 2px;
  flex: 0 1 auto;
  justify-content: flex-start;
}
.tool-group button {
  font-size: 10px;
  padding: 5px 8px;
  gap: 3px;
}
.tool-group button > span {
  font-size: 17px;
  line-height: 18px;
}
.explode-control {
  font-size: 10px;
  gap: 5px;
  margin: 0 0 0 auto;
  width: auto;
  padding: 0;
}
.explode-control input {
  width: 66px;
}
.explode-control output {
  font-size: 10px;
}
.timeline {
  padding: 8px 12px;
  gap: 12px;
  min-height: 44px;
}
.timeline > div:first-child {
  min-width: 135px;
}
.timeline .eyebrow {
  font-size: 7px;
}
.timeline strong {
  font-size: 10px;
  margin-top: 3px;
}
#etapas button {
  font-size: 10px;
  height: 24px;
}
.timeline .icon-btn {
  width: 25px;
  height: 25px;
}
.detail-panel {
  height: 100%;
  min-height: 0;
  max-height: none;
  grid-column: auto;
  padding: 18px;
  overflow: auto;
  overscroll-behavior: contain;
}
.detail-panel .detail-top {
  margin-bottom: 15px;
}
.detail-panel h2 {
  font-size: 24px;
}
.detail-panel .facts {
  margin: 17px 0;
}
.facts > div {
  padding: 11px 8px;
}
.facts b {
  font-size: 12px;
}
.facts small {
  font-size: 8px;
}
.instance-id {
  font-size: 10px;
  margin-bottom: 14px;
}
.system-label {
  font-size: 12px;
}
.tabs {
  gap: 14px;
  margin-top: 20px;
}
.tabs button {
  font-size: 12px;
}
.ficha-content p,
.ficha-content li {
  font-size: 13px;
  line-height: 1.65;
  color: #535a7b;
}
.ficha-content h3 {
  font-size: 13px;
}
.source-card {
  padding: 11px;
}
.source-card b,
.source-card p,
.source-card a {
  font-size: 11px;
  color: #495175;
}
.dimension-note {
  font-size: 11px;
}
.primary-btn,
.secondary-btn {
  font-size: 12px;
}
.micro-link {
  font-size: 12px;
}
.back-detail {
  left: 16px;
  bottom: 42px;
  font-size: 12px;
  padding: 9px 12px;
}
.section-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  background: #e5e8f1;
  border-top: 1px solid #bac0d3;
  color: #00257c;
  min-height: 37px;
}
.section-controls strong {
  font-size: 9px;
  letter-spacing: 0.5px;
}
.section-controls select {
  font-size: 10px;
  border: 1px solid #9fa6bf;
  background: white;
  border-radius: 3px;
  padding: 4px;
}
.section-controls input {
  width: 90px;
  flex: 1;
  max-width: 160px;
  accent-color: #00257c;
}
.section-controls output {
  font:
    10px ui-monospace,
    monospace;
  white-space: nowrap;
}
.section-controls button {
  font-size: 10px;
  text-decoration: underline;
  white-space: nowrap;
}
.room-label {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 4px 7px;
  border-radius: 4px;
  font-size: 10px;
  color: #242b4b;
  background: #fffffff2;
  border: 1px solid #bec2d3;
  box-shadow: 0 2px 8px #18204415;
  white-space: nowrap;
  z-index: 3;
}
.room-label:hover {
  background: #16204b;
  color: #fff;
}
.model-annotation {
  font-size: 10px;
}
/* Revisión 05: rótulos de llaves del tablero y claves de varias líneas en los bancos. */
.model-annotation.rotulo {
  font-size: 9px;
  padding: 1px 4px;
  background: #171f44e6;
  border-color: #171f44;
  color: #fff;
}
.bank-legend {
  position: absolute;
  z-index: 4;
  top: 70px;
  right: 22px;
  max-width: 290px;
  background: #ffffffee;
  border: 1px solid #c7cbdf;
  border-radius: 6px;
  padding: 10px 12px;
  box-shadow: 0 4px 16px #131e4f12;
  font-size: 11px;
  color: #313c6b;
}
.bank-legend summary {
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.3px;
  color: #6c7495;
}
.bank-legend[open] summary {
  margin-bottom: 6px;
}
.bank-legend span {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 6px;
  line-height: 1.4;
  padding: 2px 0;
}
.bank-legend code {
  font:
    700 10px ui-monospace,
    Consolas,
    monospace;
  color: #171f44;
}
.bank-legend small {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  color: #8a4b22;
}
@media (max-width: 680px) {
  .bank-legend {
    top: auto;
    bottom: 96px;
    right: 8px;
    left: 8px;
    max-width: none;
    font-size: 9.5px;
    padding: 7px 9px;
  }
  .bank-legend:not([open]) {
    left: auto;
  }
  .bank-legend span {
    grid-template-columns: 28px 1fr;
    line-height: 1.3;
    padding: 0;
  }
}
.model-annotation.multilinea {
  white-space: pre;
  text-align: left;
  line-height: 1.55;
  padding: 7px 9px;
}
#network-legend {
  position: absolute;
  bottom: 48px;
  left: 14px;
  background: #ffffffed;
  padding: 12px;
  border: 1px solid #c7cbdf;
  border-radius: 5px;
  display: grid;
  gap: 7px;
  font-size: 10px;
  color: #242e5a;
  z-index: 3;
}
#network-legend b {
  font-size: 8px;
  letter-spacing: 1px;
}
#network-legend i {
  display: inline-block;
  width: 16px;
  height: 4px;
  vertical-align: middle;
  margin-right: 7px;
}
#plan-sheet {
  position: absolute;
  inset: 0;
  background: #e8e9f0;
  overflow: auto;
  z-index: 8;
  display: flex;
  justify-content: center;
  padding: 15px;
  align-items: flex-start;
}
#plan-sheet svg {
  height: 100%;
  min-height: 550px;
  max-width: 100%;
  background: white;
  box-shadow: 0 5px 20px #22284422;
}
#plan-sheet [data-room] {
  cursor: pointer;
}
#plan-sheet [data-room]:hover rect {
  stroke: #002b8f;
  stroke-width: 2;
}
.download-plan {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #151e47;
  color: white;
  border-radius: 4px;
  padding: 9px 12px;
  font-size: 11px;
}
.page-view {
  height: 100%;
  overflow: auto;
  min-height: 0;
  padding: 32px 5vw 50px;
}
footer {
  height: 24px;
  min-height: 0;
  font-size: 8px;
  padding: 0 16px;
  flex-wrap: nowrap;
}
.norma-note {
  font-size: 12px;
}
.edicion span {
  font-size: 8px;
}
.edicion b {
  font-size: 10px;
  margin-top: 4px;
}
@media (min-width: 1700px) {
  .workspace {
    grid-template-columns: 240px minmax(0, 1fr) 330px;
  }
  .sidebar-section {
    padding: 17px;
  }
  .system-row,
  .level-row {
    font-size: 13px;
    padding: 9px;
  }
  .detail-panel {
    padding: 24px;
  }
  .work-modes button {
    font-size: 12px;
    padding: 8px 11px;
  }
  .tool-group button {
    font-size: 12px;
    padding: 5px 12px;
  }
  .section-controls strong,
  .section-controls select,
  .section-controls output,
  .section-controls button {
    font-size: 12px;
  }
  .room-label {
    font-size: 12px;
  }
  .ficha-content p,
  .ficha-content li {
    font-size: 14px;
  }
  .scene-label h2 {
    font-size: 23px;
  }
  .viewport-top {
    inset: 22px;
  }
}
@media (max-width: 1150px) {
  .workspace {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  .detail-panel {
    display: none;
    position: fixed;
    top: 64px;
    bottom: 24px;
    right: 0;
    width: 320px;
    height: auto;
    z-index: 20;
    box-shadow: -12px 0 40px #000a6a25;
    border-top: 0;
  }
  .detail-panel.open {
    display: block;
  }
  .header-ficha {
    display: block;
  }
  .toolbar {
    gap: 6px;
  }
  .tool-group button {
    padding-inline: 6px;
  }
  .scene-label h2 {
    font-size: 17px;
  }
  .work-modes button {
    font-size: 10px;
    padding: 6px;
  }
  .section-controls {
    gap: 6px;
  }
}
@media (max-width: 900px) {
  .workspace {
    display: block;
  }
  .sidebar {
    display: none;
    position: fixed;
    top: 64px;
    bottom: 24px;
    left: 0;
    width: 240px;
    z-index: 21;
    box-shadow: 12px 0 40px #000a6a25;
  }
  .sidebar.open {
    display: flex;
  }
  .movil-menu {
    display: grid;
    color: #c1c7e0;
    border-color: #474e6d;
    flex-shrink: 0;
  }
  .cabecera {
    gap: 12px;
    padding: 0 14px;
  }
  .marca {
    min-width: 190px;
  }
  .edicion {
    display: none;
  }
  .model-area {
    min-height: 0;
  }
  .work-modes {
    gap: 5px;
    padding-inline: 12px;
  }
  .work-modes button {
    font-size: 11px;
  }
  .toolbar {
    padding: 7px 14px;
  }
  .tool-group button {
    padding-inline: 12px;
  }
  .ficha-content p,
  .ficha-content li {
    font-size: 14px;
  }
}
@media (max-width: 600px) {
  body {
    grid-template-rows: 56px minmax(0, 1fr) 22px;
  }
  .cabecera {
    height: 56px;
    padding: 0 9px;
    gap: 8px;
  }
  .marca {
    min-width: 0;
    gap: 5px;
    font-size: 10px;
    letter-spacing: 0.7px;
  }
  .marca small {
    font-size: 7px;
    letter-spacing: 1px;
  }
  .marca-simbolo {
    font-size: 28px;
  }
  .navegacion {
    gap: 8px;
    margin-left: auto;
  }
  .navegacion button {
    font-size: 10px;
  }
  .navegacion span {
    display: none;
  }
  .header-ficha {
    font-size: 10px;
    white-space: nowrap;
  }
  .movil-menu {
    width: 24px;
    height: 26px;
    font-size: 12px;
  }
  .sidebar,
  .detail-panel {
    top: 56px;
    bottom: 22px;
  }
  .detail-panel {
    width: min(340px, 92vw);
  }
  .model-header {
    height: 34px;
    padding: 6px 9px;
  }
  .model-area {
    grid-template-rows: 34px auto minmax(0, 1fr) auto auto auto;
  }
  .breadcrumbs {
    font-size: 10px;
  }
  .work-modes {
    gap: 2px;
    padding: 5px 7px;
  }
  .work-modes button {
    font-size: 10px;
    padding: 5px 6px;
  }
  .work-modes select {
    font-size: 10px;
  }
  .viewport-top {
    inset: 12px 10px auto;
  }
  .scene-label h2 {
    font-size: 15px;
    max-width: 175px;
  }
  .scene-label > span {
    font-size: 7px;
  }
  .view-controls button {
    font-size: 8px;
    padding: 6px;
    width: auto;
  }
  .model-hint {
    font-size: 8px;
    gap: 10px;
  }
  .tool-group {
    flex: 1;
    justify-content: space-between;
  }
  .tool-group button {
    min-width: 0;
    padding: 4px;
    font-size: 9px;
  }
  .tool-group button > span {
    font-size: 16px;
  }
  .toolbar {
    padding: 5px 7px;
    flex-wrap: wrap;
    gap: 3px;
  }
  .explode-control {
    padding: 0 3px;
    font-size: 9px;
    gap: 5px;
  }
  .explode-control input {
    width: 55px;
  }
  .timeline {
    padding: 5px 9px;
    gap: 7px;
    min-height: 38px;
  }
  .timeline > div:first-child {
    min-width: 105px;
  }
  .timeline .eyebrow {
    font-size: 6px;
  }
  .timeline strong {
    font-size: 9px;
  }
  #etapas {
    gap: 3px;
  }
  #etapas button {
    font-size: 9px;
  }
  .section-controls {
    padding: 5px 7px;
    gap: 5px;
    flex-wrap: wrap;
  }
  .section-controls strong {
    font-size: 8px;
  }
  .section-controls select,
  .section-controls output,
  .section-controls button {
    font-size: 9px;
  }
  .section-controls input {
    width: 60px;
    min-width: 50px;
  }
  .room-label {
    font-size: 8px;
    padding: 3px 4px;
  }
  .back-detail {
    font-size: 10px;
    bottom: 32px;
  }
  .back-detail kbd {
    display: none;
  }
  .compass {
    display: none;
  }
  .page-view {
    padding: 25px 18px;
  }
  footer {
    height: 22px;
    padding: 0 10px;
    font-size: 7px;
  }
  footer > span:nth-child(2) {
    display: none;
  }
  #library-grid {
    grid-template-columns: 1fr 1fr;
  }
  .library-card {
    padding: 15px;
  }
  .library-card h2 {
    font-size: 16px;
  }
  #plan-sheet {
    padding: 7px;
  }
  .download-plan {
    font-size: 9px;
    padding: 6px;
  }
  .model-annotation {
    font-size: 9px;
  }
}

.movil-menu {
  display: none;
}
@media (max-width: 900px) {
  .movil-menu {
    display: grid;
  }
}

.viewport.mode-instalaciones {
  background: radial-gradient(ellipse at 50% 45%, #283056, #111839);
}
.mode-instalaciones .scene-label h2 {
  color: #f2f3fa;
}
.mode-instalaciones .scene-label > span,
.mode-instalaciones .model-hint,
.mode-instalaciones .compass {
  color: #b9c0dd;
}
.mode-instalaciones #network-legend {
  background: #161e3feb;
  border-color: #4b5378;
  color: white;
}
.mode-instalaciones #selection-label {
  background: #fff;
  color: #1b2657;
}

/* Revisión 04 · capa L5, gas y telecomunicaciones */
.work-modes .mode-l5 {
  color: #a3322a;
}
.work-modes .mode-l5.active {
  background: #8f2a22;
  color: #fff;
}
.pat-marker {
  position: absolute;
  z-index: 4;
  transform: translate(-50%, -50%);
  min-width: 26px;
  height: 26px;
  border-radius: 13px;
  border: 2px solid #fff;
  background: #c0392b;
  color: #fff;
  font:
    700 11px ui-monospace,
    Consolas,
    monospace;
  box-shadow: 0 2px 8px #0005;
  cursor: pointer;
  padding: 0 5px;
}
.pat-marker:hover,
.pat-marker.activo {
  background: #7d1f17;
  transform: translate(-50%, -50%) scale(1.15);
}
#pat-panel {
  position: absolute;
  left: 12px;
  bottom: 44px;
  z-index: 5;
  max-height: 62%;
  overflow: auto;
  width: 250px;
  background: #fffffff2;
  border: 1px solid #e0c6c2;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 11px;
  color: #3a2a28;
}
#pat-panel summary {
  font-weight: 700;
  font-size: 9px;
  letter-spacing: 1px;
  cursor: pointer;
  color: #8f2a22;
}
#pat-panel b {
  display: block;
  margin: 8px 0 3px;
  font-size: 9px;
  letter-spacing: 0.6px;
  color: #6f5a57;
  text-transform: uppercase;
}
#pat-panel button {
  display: flex;
  gap: 6px;
  width: 100%;
  text-align: left;
  padding: 3px 4px;
  border-radius: 3px;
  font-size: 11px;
  color: #3a2a28;
}
#pat-panel button span {
  font:
    700 10px ui-monospace,
    Consolas,
    monospace;
  color: #c0392b;
  min-width: 18px;
}
#pat-panel button:hover,
#pat-panel button.activo {
  background: #f6e7e5;
}
#pat-panel small {
  display: block;
  margin-top: 6px;
  color: #7b6a67;
}
.estado-toggle {
  display: flex;
  gap: 4px;
  margin: 12px 0 4px;
  flex-wrap: wrap;
}
.estado-toggle button {
  flex: 1;
  padding: 7px 8px;
  border: 1px solid #d8c3bf;
  border-radius: 4px;
  font-size: 12px;
  color: #6c4a45;
  background: #fff;
}
.estado-toggle button[aria-pressed="true"] {
  background: #8f2a22;
  color: #fff;
  border-color: #8f2a22;
}
.estado-toggle #fisurometro-btn[aria-pressed="true"] {
  background: #2c3350;
  border-color: #2c3350;
}
.pro-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 3px;
  background: #172049;
  color: #fff;
  font-size: 8px;
  letter-spacing: 0.8px;
  vertical-align: middle;
}
@media (max-width: 600px) {
  #pat-panel {
    width: 200px;
    max-height: 45%;
    font-size: 10px;
    top: 58px;
    bottom: auto;
    left: auto;
    right: 12px;
  }
}
.estado-nota {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: #5b5f70;
}
.tabla-directorio {
  display: grid;
  gap: 6px;
  margin: 6px 0 10px;
}
.tabla-directorio > div {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid #e3e1da;
  border-radius: 5px;
  background: #fbfaf6;
  font-size: 12px;
  line-height: 1.4;
}
.tabla-directorio b {
  font:
    700 12px ui-monospace,
    Consolas,
    monospace;
  color: #172049;
}
.tabla-directorio em {
  display: block;
  font-style: normal;
  font-weight: 600;
  color: #2c3350;
}
.tabla-directorio small {
  display: block;
  color: #6b6f80;
}

/* Revisión 06: tarjeta de la etapa de obra. */
.stage-card {
  position: absolute;
  z-index: 5;
  top: 96px;
  left: 22px;
  width: 350px;
  max-height: calc(100% - 170px);
  overflow: auto;
  background: #fffffff2;
  border: 1px solid #c7cbdf;
  border-radius: 8px;
  box-shadow: 0 8px 28px #131e4f1c;
  padding: 14px 16px 12px;
  color: #262e4f;
  font-size: 12px;
  line-height: 1.55;
}
.stage-card .stage-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9px;
  letter-spacing: 1.4px;
  font-weight: 700;
  color: var(--teal);
}
.stage-card .stage-x {
  font-size: 18px;
  line-height: 1;
  color: #7d84a1;
  padding: 0 4px;
}
.stage-card h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin: 6px 0 6px;
  color: #171f44;
}
.stage-card h4 {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #6c7495;
  margin: 12px 0 4px;
}
.stage-card p {
  margin: 0;
}
.stage-card ul {
  margin: 0;
  padding-left: 16px;
}
.stage-card li {
  margin: 2px 0;
}
.stage-card .stage-error {
  border-left: 3px solid #c0392b;
  padding-left: 9px;
  color: #6b2a22;
}
.stage-card .stage-norma {
  list-style: none;
  padding: 0;
}
.stage-card .stage-norma li {
  background: #f3f4f9;
  border-left: 2px solid #bdc2d9;
  padding: 5px 8px;
  margin: 4px 0;
  font-size: 11px;
}
.stage-card .stage-norma b {
  color: #171f44;
  display: block;
  font-size: 10px;
}
.stage-card .stage-hint {
  margin-top: 10px;
  width: 100%;
  border: 1px dashed #b8420e;
  color: #b8420e;
  border-radius: 5px;
  padding: 7px;
  font-size: 11px;
}
.stage-card .stage-nav {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
}
.stage-card .stage-nav button {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 8px;
  font-size: 11px;
  background: #fff;
}
.stage-card .stage-nav button:not(:disabled):hover {
  border-color: var(--teal);
  color: var(--teal);
}
#etapas button {
  min-width: 0;
}
@media (max-width: 680px) {
  .stage-card {
    top: auto;
    bottom: 64px;
    left: 8px;
    right: 8px;
    width: auto;
    max-height: 46%;
    padding: 11px 12px;
    font-size: 13px;
  }
}

/* Revisión 06: fichas con objetivo, proceso de obra, controles y conexiones. */
.objetivo {
  background: #eef0f7;
  border-left: 3px solid var(--teal);
  border-radius: 4px;
  padding: 9px 12px;
  margin: 4px 0 6px;
}
.objetivo span {
  font-size: 9px;
  letter-spacing: 1.2px;
  font-weight: 700;
  color: var(--teal);
}
.objetivo p {
  margin: 4px 0 0 !important;
  color: #1f294a !important;
  font-size: 12.5px !important;
  line-height: 1.5 !important;
}
.ficha-content ol.pasos {
  padding-left: 0;
  list-style: none;
  counter-reset: paso;
}
.ficha-content ol.pasos li {
  counter-increment: paso;
  position: relative;
  padding-left: 30px;
  margin-bottom: 9px;
}
.ficha-content ol.pasos li::before {
  content: counter(paso);
  position: absolute;
  left: 0;
  top: 1px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #171f44;
  color: #fff;
  font:
    700 10px/20px ui-monospace,
    Consolas,
    monospace;
  text-align: center;
}
.ficha-content ul.checks {
  list-style: none;
  padding-left: 0;
}
.ficha-content ul.checks li {
  position: relative;
  padding-left: 24px;
}
.ficha-content ul.checks li::before {
  content: "✓";
  position: absolute;
  left: 2px;
  top: 0;
  color: var(--teal);
  font-weight: 700;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 10px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 4px 10px;
  font-size: 11px;
  background: #fff;
  color: #2b3357;
  max-width: 100%;
  text-align: left;
}
.chip i {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  flex-shrink: 0;
}
.chip:hover {
  border-color: var(--teal);
  color: var(--teal);
}
.chip-mas {
  font-size: 11px;
  color: #7d84a1;
  align-self: center;
}
.tabs {
  gap: 14px;
}
.tabs button {
  white-space: nowrap;
}

/* Revisión 06: rutas guiadas con autoevaluación. */
.work-modes .mode-ruta {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
  font-weight: 600;
}
.work-modes .mode-ruta:hover {
  background: #00206c;
  color: #fff;
}
.rutas-section .rutas-sub {
  font-size: 10px;
  color: var(--muted);
}
.ruta-item {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  padding: 7px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  margin: 2px 0;
  line-height: 1.3;
}
.ruta-item:hover,
.ruta-item.activa {
  border-color: #bfc7e0;
  background: #eef0f7;
}
.ruta-item i {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
}
.ruta-item b {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}
.ruta-item small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}
.route-card {
  width: 370px;
  border-color: #9faacf;
  box-shadow: 0 10px 32px #001b5a26;
}
.route-card .ruta-lista {
  margin-top: 10px;
}
.route-card .ruta-nombre {
  margin: 8px 0 0 !important;
  font-size: 10px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #6c7495;
}
.route-card h3 {
  margin-top: 2px;
}
.ruta-progreso {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}
.ruta-progreso i {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: #dde0ec;
}
.ruta-progreso i.hecho {
  background: #7f8fc4;
}
.ruta-progreso i.actual {
  background: var(--teal);
}
.ruta-observa {
  margin-top: 10px;
  background: #fff8e6;
  border-left: 3px solid #e0a800;
  border-radius: 4px;
  padding: 7px 10px;
  color: #5b4a17;
}
.ruta-observa b {
  display: block;
  font-size: 9px;
  letter-spacing: 1.2px;
  color: #a37a00;
  margin-bottom: 2px;
}
.route-card .stage-nav .primario {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
  font-weight: 600;
}
.route-card .stage-nav button.primario:not(:disabled):hover {
  background: #00206c;
  color: #fff;
}
.route-card .ruta-ficha {
  border-color: var(--teal);
  color: var(--teal);
}
.ruta-pregunta {
  font-size: 15px !important;
  line-height: 1.35;
}
.ruta-opciones {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}
.ruta-opciones button {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  font-size: 12px;
  line-height: 1.4;
}
.ruta-opciones button:not(:disabled):hover {
  border-color: var(--teal);
  background: #f3f5fa;
}
.ruta-opciones button span {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e8eaf2;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  color: #505776;
}
.ruta-opciones button:disabled {
  opacity: 1;
  cursor: default;
}
.ruta-opciones button.ok {
  border-color: #2f9e6e;
  background: #eaf7f0;
}
.ruta-opciones button.ok span {
  background: #2f9e6e;
  color: #fff;
}
.ruta-opciones button.mal {
  border-color: #c0392b;
  background: #fbeeec;
}
.ruta-opciones button.mal span {
  background: #c0392b;
  color: #fff;
}
.ruta-opciones button.apagada {
  opacity: 0.55;
}
.ruta-feedback {
  margin-top: 10px;
  border-radius: 5px;
  padding: 8px 10px;
  font-size: 12px;
}
.ruta-feedback.ok {
  background: #eaf7f0;
  color: #1d5a3f;
}
.ruta-feedback.mal {
  background: #fbeeec;
  color: #6b2a22;
}
.ruta-ayuda {
  margin-top: 8px !important;
  font-size: 11px;
  color: var(--muted);
}
.ruta-resultado {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 4px;
}
.ruta-resultado b {
  font-size: 34px;
  font-weight: 700;
  color: var(--teal);
  letter-spacing: -1px;
}
.ruta-resultado span {
  font-size: 13px;
  color: var(--ink);
}
.ruta-repaso li {
  margin: 5px 0;
}
.ruta-repaso .text-btn {
  font-size: 11px;
  color: var(--teal);
  padding: 0;
}
@media (max-width: 680px) {
  .route-card {
    top: auto;
    bottom: 64px;
    left: 8px;
    right: 8px;
    width: auto;
    max-height: 52%;
    padding: 11px 12px;
    font-size: 13px;
  }
}
.route-card .stage-nav {
  position: sticky;
  bottom: -12px;
  margin: 12px -16px -12px;
  padding: 10px 16px 12px;
  background: linear-gradient(#ffffffe6, #fff 30%);
}
@media (max-width: 680px) {
  .route-card .stage-nav {
    margin: 10px -12px -11px;
    padding: 8px 12px 11px;
  }
}

/* Revisión 06: publicación web (Aprende en 3D). */
.edicion a {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  text-decoration: none;
}
.edicion a:hover {
  color: var(--mint);
}
#edicion-etiqueta {
  color: var(--mint);
}
footer a {
  color: #a7aecb;
  text-decoration: none;
  font-size: 10px;
}
footer a:hover {
  color: #fff;
}
footer .pie-acciones {
  display: flex;
  gap: 16px;
}
.bienvenida h2 {
  margin: 6px 0 4px;
}
.bienvenida-opciones {
  display: grid;
  gap: 8px;
  margin: 18px 0 10px;
}
.bienvenida-opciones button {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 16px;
  background: #fff;
}
.bienvenida-opciones button:hover {
  border-color: var(--teal);
  background: #f3f5fa;
}
.bienvenida-opciones button:first-child {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
.bienvenida-opciones button:first-child:hover {
  background: #00206c;
}
.bienvenida-opciones b {
  display: block;
  font-size: 15px;
  font-weight: 600;
}
.bienvenida-opciones small {
  display: block;
  font-size: 12px;
  margin-top: 3px;
  opacity: 0.8;
}
#modal-content .bienvenida-nota {
  font-size: 12px;
  color: #b8420e;
  margin: 6px 0 0;
}
@media (max-width: 680px) {
  footer .pie-centro {
    display: none;
  }
  footer .pie-acciones {
    gap: 12px;
  }
}
.pill-beta {
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--teal);
  background: #e4e8f4;
  border-radius: 12px;
  padding: 4px 10px;
}

/* ===== Marca CIngeniería (22-sep-2026): colores y logo oficiales =====
   Azul marino #000A6A · azul #003CCB · menta #00FFC3 (tomados del logo de cingenieria.pe).
   Cabecera blanca con el logo oficial, igual que la web. */
:root { --ci-navy: #000a6a; --ci-blue: #003ccb; --ci-mint: #00ffc3; }
.cabecera { background: #fff; color: var(--ci-navy); border-bottom: 1px solid #e1e4f0; box-shadow: 0 2px 10px rgba(0, 10, 106, 0.05); }
.marca { color: var(--ci-navy); gap: 14px; min-width: 0; letter-spacing: 0; }
.marca-logo { display: block; height: 50px; width: auto; flex-shrink: 0; }
.marca-producto { display: block; padding-left: 14px; border-left: 1px solid #d5daea; font-size: 15px; font-weight: 800; letter-spacing: 0.2px; color: var(--ci-navy); white-space: nowrap; line-height: 1.1; }
.marca-producto small { display: block; margin-top: 4px; font-size: 9px; font-weight: 600; letter-spacing: 1.8px; color: var(--ci-blue); }
.navegacion button { color: #4d5580; }
.navegacion button:hover { color: var(--ci-navy); }
.navegacion button.active { color: var(--ci-navy); border-color: var(--ci-blue); font-weight: 700; }
.navegacion span { background: var(--ci-mint); color: var(--ci-navy); border: 0; font-weight: 800; }
#edicion-etiqueta, .edicion span { color: var(--ci-blue); font-weight: 700; }
.edicion a { color: var(--ci-navy); font-weight: 600; }
.edicion a:hover { color: var(--ci-blue); }
.header-ficha { color: var(--ci-blue); font-weight: 600; }
.movil-menu { color: var(--ci-navy); border-color: #cfd4e8; background: #fff; }
footer { background: var(--ci-navy); color: #aab2e0; }
footer a, footer .text-btn { color: #d3d8f5; }
footer a:hover, footer .text-btn:hover { color: var(--ci-mint); }
@media (max-width: 900px) {
  .marca-logo { height: 40px; }
  .marca-producto { font-size: 13px; padding-left: 10px; }
  .marca-producto small { display: none; }
}
@media (max-width: 680px) {
  .marca { gap: 8px; }
  .marca-logo { height: 30px; }
  .marca-producto { display: none; }
  .movil-menu { color: var(--ci-navy); border-color: #cfd4e8; }
}
