/* Civimetra Premium Interior · capa visual no destructiva */
:root {
  --civi-premium-navy: #0b263d;
  --civi-premium-navy-2: #123f63;
  --civi-premium-blue: #2f78b7;
  --civi-premium-mint: #39bda2;
  --civi-premium-mint-dark: #16806f;
  --civi-premium-ink: #112a40;
  --civi-premium-muted: #687d8d;
  --civi-premium-line: #d9e3e8;
  --civi-premium-surface: #f2f6f8;
  --civi-premium-card: #ffffff;
  --civi-premium-radius: 14px;
  --civi-premium-shadow: 0 10px 28px rgba(16, 44, 67, .07);
}

.builder-shell,
.portfolio,
.start-screen {
  color: var(--civi-premium-ink);
  background:
    radial-gradient(circle at 88% 5%, rgba(57, 189, 162, .08), transparent 24rem),
    linear-gradient(180deg, #f8fafb 0%, var(--civi-premium-surface) 100%) !important;
}

/* Navegación de la obra */
.builder-sidebar {
  width: 264px !important;
  padding: 18px 14px 16px !important;
  border-right: 0 !important;
  background:
    radial-gradient(circle at 12% 0, rgba(57, 189, 162, .12), transparent 15rem),
    linear-gradient(180deg, #0b2942 0%, #081e31 100%) !important;
  box-shadow: 8px 0 28px rgba(7, 28, 46, .12) !important;
}

.builder-sidebar > .builder-brand {
  display: flex !important;
  justify-content: flex-start !important;
  min-height: 56px !important;
  padding: 2px 8px 15px !important;
}

.builder-sidebar .builder-brand b {
  display: block !important;
  color: #fff !important;
  font-size: 24px !important;
}

.builder-sidebar .builder-brand b .brand-metra {
  color: #55d1b6 !important;
}

.builder-sidebar .builder-brand b > span:last-child {
  color: #4ba6ed !important;
}

.builder-sidebar .civimetra-c-mark {
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .18));
}

.builder-sidebar .civimetra-c-mark svg path {
  fill: #fff !important;
}

.builder-sidebar .civimetra-c-mark svg stop {
  stop-color: #fff !important;
}

.builder-sidebar .project-card {
  min-height: 72px;
  margin: 5px 0 15px !important;
  padding: 10px !important;
  border: 1px solid rgba(255, 255, 255, .14) !important;
  border-radius: 13px !important;
  background: rgba(255, 255, 255, .075) !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, .05), 0 10px 24px rgba(0, 0, 0, .12) !important;
  backdrop-filter: blur(8px);
}

.builder-sidebar .project-card > span {
  width: 46px !important;
  height: 46px !important;
  flex: 0 0 46px !important;
  border: 1px solid rgba(255, 255, 255, .17) !important;
  border-radius: 10px !important;
  background-color: rgba(255, 255, 255, .12) !important;
}

.builder-sidebar .project-card > div > b {
  color: #f7fbfe !important;
  font-size: 13px !important;
  line-height: 1.25;
}

.builder-sidebar .project-card > div > small {
  color: #a9c2d0 !important;
  font-size: 9px !important;
  line-height: 1.35;
}

.builder-sidebar .project-card > div,
.builder-sidebar .project-card > button,
.builder-sidebar .sidebar-help > div {
  display: block !important;
}

.builder-sidebar .project-card .project-switcher > summary {
  width: 31px !important;
  min-width: 31px !important;
  height: 31px !important;
  border-color: rgba(255, 255, 255, .16) !important;
  background: rgba(255, 255, 255, .1) !important;
  color: #d5ebe6 !important;
  box-shadow: none !important;
}

.builder-sidebar .project-card .project-switcher > summary > b {
  color: #d5ebe6 !important;
}

.builder-nav {
  gap: 2px !important;
}

.builder-nav > p {
  display: block !important;
  margin: 15px 10px 5px !important;
  color: #7894a7 !important;
  font-size: 9px !important;
  letter-spacing: .16em !important;
}

.builder-nav > button {
  display: grid !important;
  min-height: 42px;
  margin: 0 !important;
  padding: 8px 10px !important;
  border: 1px solid transparent !important;
  border-radius: 9px !important;
  color: #bdcdd8 !important;
  transform: none !important;
}

.builder-nav > button > span {
  color: #86a8b7 !important;
}

.builder-nav > button > b {
  display: block !important;
  color: inherit !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}

.builder-nav > button > em {
  display: inline-flex !important;
  background: rgba(255, 255, 255, .08) !important;
  color: #a8c1cd !important;
}

.builder-nav > button:hover {
  border-color: rgba(255, 255, 255, .07) !important;
  background: rgba(255, 255, 255, .055) !important;
  color: #fff !important;
}

.builder-nav > button.active {
  border-color: rgba(77, 202, 177, .12) !important;
  background: linear-gradient(90deg, rgba(53, 186, 160, .22), rgba(53, 186, 160, .10)) !important;
  color: #fff !important;
  box-shadow: inset 3px 0 #4ed0b4 !important;
}

.builder-nav > button.active > span {
  color: #66dbc3 !important;
}

.builder-nav > button.active > em {
  background: rgba(74, 210, 181, .16) !important;
  color: #bff7eb !important;
}

.builder-sidebar .sidebar-help {
  margin-top: auto;
  border-color: rgba(255, 255, 255, .1) !important;
  background: rgba(255, 255, 255, .05) !important;
}

.builder-sidebar .sidebar-help > span {
  background: rgba(75, 207, 178, .14) !important;
  color: #68d9c1 !important;
}

.builder-sidebar .sidebar-help b { color: #e9f3f7 !important; }
.builder-sidebar .sidebar-help small { color: #89a7b8 !important; }

/* Zona de trabajo y cabecera */
.builder-workspace {
  width: calc(100% - 264px) !important;
  min-width: 0 !important;
  margin-left: 264px !important;
  overflow-x: hidden;
  background: transparent !important;
}

.builder-topbar {
  min-height: 72px !important;
  height: 72px !important;
  padding: 0 28px !important;
  border-bottom: 1px solid rgba(210, 222, 229, .9) !important;
  background: rgba(255, 255, 255, .94) !important;
  box-shadow: 0 5px 18px rgba(16, 44, 67, .035) !important;
  backdrop-filter: blur(18px) !important;
}

.builder-topbar b {
  color: var(--civi-premium-ink) !important;
  font-size: 17px !important;
  font-weight: 850 !important;
  line-height: 1.15;
}

.builder-topbar span {
  color: var(--civi-premium-muted) !important;
}

.builder-topbar > div:first-of-type {
  display: block !important;
  min-width: 0;
}

.builder-topbar > div:first-of-type > span {
  margin-top: 5px !important;
  font-size: 10px !important;
  line-height: 1.2;
}

.builder-topbar .plain-button,
.builder-topbar .export-top,
.builder-topbar .main-action {
  min-height: 40px !important;
  border-radius: 9px !important;
  font-size: 12px !important;
}

.builder-topbar .plain-button {
  border: 1px solid var(--civi-premium-line) !important;
  background: #fff !important;
  color: var(--civi-premium-navy) !important;
}

.builder-topbar .main-action,
.builder-topbar .export-top,
.builder-page .main-action,
.portfolio .main-action {
  border-color: #1a8c78 !important;
  background: linear-gradient(135deg, #1b957f, #32b398) !important;
  color: #fff !important;
  box-shadow: 0 7px 16px rgba(25, 143, 120, .17) !important;
}

.builder-page {
  width: min(100%, 1440px);
  padding: 26px 30px 64px !important;
}

.page-title {
  position: relative;
  isolation: isolate;
  min-height: 132px;
  align-items: center !important;
  margin-bottom: 18px !important;
  padding: 22px 24px !important;
  overflow: hidden;
  border: 1px solid var(--civi-premium-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--civi-premium-shadow);
}

.page-title::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 0 58%;
  opacity: .42;
  background-image:
    linear-gradient(rgba(47, 120, 183, .075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 120, 183, .075) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(90deg, transparent, #000 34%);
}

.page-title::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: var(--civi-premium-mint);
}

.page-title > div:first-child {
  position: relative;
  min-width: 0;
  padding-left: 62px;
}

.page-title .civi-page-icon {
  position: absolute;
  top: 50%;
  left: 0;
  display: grid !important;
  width: 46px;
  height: 46px;
  place-items: center;
  margin: 0 !important;
  border-radius: 13px;
  background: linear-gradient(145deg, #198d78, #47c6aa) !important;
  color: #fff !important;
  font-size: 20px !important;
  letter-spacing: 0 !important;
  box-shadow: 0 9px 18px rgba(24, 142, 120, .19);
  transform: translateY(-50%);
}

.page-title > div > span:not(.civi-page-icon) {
  color: var(--civi-premium-mint-dark) !important;
  font-size: 9px !important;
  font-weight: 900 !important;
  letter-spacing: .17em !important;
}

.page-title h1 {
  margin: 6px 0 5px !important;
  color: var(--civi-premium-ink) !important;
  font-size: clamp(25px, 2.3vw, 34px) !important;
  line-height: 1.08;
  letter-spacing: -.045em !important;
}

.page-title p {
  max-width: 750px;
  color: var(--civi-premium-muted) !important;
  font-size: 12px !important;
  line-height: 1.55;
}

.page-title > div:last-child {
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Tarjetas, campos y acciones compartidas */
.builder-page :is(input, select, textarea):not([type="checkbox"]):not([type="radio"]),
.form-modal :is(input, select, textarea):not([type="checkbox"]):not([type="radio"]),
.small-modal :is(input, select, textarea):not([type="checkbox"]):not([type="radio"]) {
  border-color: #d5e0e6 !important;
  background-color: #fff !important;
  color: var(--civi-premium-ink) !important;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.builder-page :is(input, select, textarea):focus,
.form-modal :is(input, select, textarea):focus,
.small-modal :is(input, select, textarea):focus {
  border-color: #70bbaa !important;
  box-shadow: 0 0 0 3px rgba(57, 189, 162, .13) !important;
  outline: 0 !important;
}

.project-fields,
.floor-card,
.room-list-panel,
.room-editor,
.catalog-intro-card,
.catalog-layout-new > aside,
.catalog-layout-new > section,
.templates-hero,
.template-search-panel,
.templates-list,
.template-editor,
.budget-summary > div,
.export-check > div,
.export-choice-grid article,
.settings-card,
.settings-hero {
  border-color: var(--civi-premium-line) !important;
  border-radius: var(--civi-premium-radius) !important;
  background: var(--civi-premium-card) !important;
  box-shadow: var(--civi-premium-shadow) !important;
}

.plain-button,
.main-action,
.export-top {
  border-radius: 9px !important;
}

/* Estructura */
.project-fields {
  padding: 18px !important;
}

.structure-tip {
  border: 1px solid #cde5de !important;
  border-radius: 12px !important;
  background: #f0faf7 !important;
  box-shadow: none !important;
}

.floor-card-grid {
  gap: 12px !important;
}

.floor-card {
  min-height: 106px;
  padding: 16px !important;
  transition: transform .17s ease, border-color .17s ease, box-shadow .17s ease;
}

.floor-card:hover {
  border-color: #a9d5c9 !important;
  box-shadow: 0 14px 30px rgba(16, 72, 79, .10) !important;
  transform: translateY(-2px);
}

.floor-number {
  border: 1px solid #cbe7df;
  background: #e7f6f2 !important;
  color: var(--civi-premium-mint-dark) !important;
}

.add-floor-card {
  border-color: #a9d5ca !important;
  background: rgba(255, 255, 255, .66) !important;
}

/* Estancias */
.rooms-page {
  width: min(100%, 1440px);
  max-width: calc(100vw - 264px);
  min-width: 0;
  box-sizing: border-box;
  margin: 0 auto;
  overflow-x: hidden;
  padding: 22px 24px 48px !important;
}

.civi-room-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}

.civi-room-summary > div {
  position: relative;
  min-height: 76px;
  padding: 13px 14px 12px 50px;
  border: 1px solid var(--civi-premium-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 7px 20px rgba(16, 44, 67, .045);
}

.civi-room-summary i {
  position: absolute;
  top: 14px;
  left: 13px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  background: #e7f5f1;
  color: var(--civi-premium-mint-dark);
  font-size: 13px;
}

.civi-room-summary small,
.civi-room-summary b,
.civi-room-summary span {
  display: block;
}

.civi-room-summary small {
  color: var(--civi-premium-muted);
  font-size: 9px;
  font-weight: 800;
}

.civi-room-summary b {
  margin-top: 3px;
  color: var(--civi-premium-ink);
  font-size: 17px;
}

.civi-room-summary span {
  margin-top: 2px;
  color: #7c8f9d;
  font-size: 8px;
}

.floor-tabs {
  width: 100%;
  max-width: 100%;
  height: 54px !important;
  gap: 5px !important;
  padding: 6px !important;
  border: 1px solid var(--civi-premium-line) !important;
  border-radius: 12px !important;
  background: #fff !important;
  box-shadow: 0 7px 20px rgba(16, 44, 67, .045);
  overflow-x: auto !important;
  overflow-y: hidden !important;
}

.floor-tabs button {
  height: 40px !important;
  padding: 0 14px !important;
  border-radius: 8px !important;
  color: #607687 !important;
}

.floor-tabs button:hover { background: #f3f8f8 !important; }

.floor-tabs button.active {
  background: #e8f6f2 !important;
  color: #117866 !important;
}

.floor-tabs button.active::after { display: none !important; }

.unit-strip {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: auto !important;
  min-height: 54px;
  display: flex !important;
  align-items: center !important;
  gap: 9px !important;
  flex-wrap: wrap !important;
  margin-top: 10px !important;
  padding: 9px 10px !important;
  border: 1px solid var(--civi-premium-line) !important;
  border-radius: 11px !important;
  background: rgba(255, 255, 255, .82) !important;
  overflow: visible !important;
}

.unit-strip > span:first-child {
  color: #6b7f8f;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .11em;
}

.unit-strip .unit-single-note {
  margin-right: auto;
  color: #718594;
}

.room-builder {
  width: 100%;
  max-width: 100%;
  grid-template-columns: 240px minmax(0, 1fr) !important;
  gap: 12px !important;
  margin-top: 12px !important;
  min-width: 0;
}

.room-list-panel,
.room-editor {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.room-list-panel > header,
.room-editor-head {
  border-bottom-color: var(--civi-premium-line) !important;
  background: #fff !important;
}

.room-list-panel > header {
  padding: 14px !important;
}

.room-list-panel > header button {
  background: var(--civi-premium-mint-dark) !important;
  box-shadow: 0 6px 13px rgba(20, 126, 108, .17);
}

.large-room-list {
  padding: 7px !important;
}

.large-room-list > button {
  min-height: 53px;
  padding: 8px !important;
  border: 1px solid transparent !important;
  border-radius: 9px !important;
}

.room-editor {
  background: #f6f8f9 !important;
}

.room-editor-head {
  gap: 12px;
  padding: 18px 20px !important;
}

.room-editor-head > div:first-child {
  min-width: 220px;
  flex: 1 1 320px;
}

.room-editor-head input {
  width: 100%;
  max-width: 100%;
  min-width: 0 !important;
  color: var(--civi-premium-ink) !important;
  font-size: 21px !important;
  letter-spacing: -.025em;
}

.room-editor-actions {
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.room-relocate-control {
  min-width: 0;
  max-width: 100%;
}

.relocate-destination,
.relocate-buttons {
  min-width: 0;
}

.relocate-buttons {
  flex-wrap: wrap;
}

.room-editor-head > div > span {
  border: 1px solid #cae7df;
  background: #e6f5f1 !important;
  color: var(--civi-premium-mint-dark) !important;
}

.room-editor-costs {
  border: 1px solid #dbe5e9 !important;
  border-radius: 10px !important;
  background: #f8fafb !important;
}

.editor-section {
  width: calc(100% - 24px);
  max-width: calc(100% - 24px);
  min-width: 0;
  margin: 12px !important;
  padding: 18px !important;
  border: 1px solid var(--civi-premium-line) !important;
  border-radius: 13px !important;
  background: #fff !important;
  box-shadow: 0 6px 18px rgba(16, 44, 67, .04);
}

.editor-section-title {
  margin-bottom: 15px !important;
}

.editor-section-title > span {
  width: 30px !important;
  height: 30px !important;
  border-radius: 8px !important;
  background: var(--civi-premium-navy) !important;
  color: #fff !important;
  box-shadow: 0 5px 11px rgba(11, 38, 61, .15);
}

.editor-section-title h2 {
  color: var(--civi-premium-ink) !important;
  font-size: 15px !important;
}

.dimension-grid > label,
.dimension-grid > div {
  border-color: #dce5ea !important;
  border-radius: 10px !important;
  background: #f9fbfc !important;
}

.action-card-grid {
  min-width: 0;
  gap: 8px !important;
}

.action-card-grid > button,
.room-template-grid > button {
  min-width: 0 !important;
  border-color: #dce5ea !important;
  border-radius: 10px !important;
  background: #fff !important;
  box-shadow: none !important;
}

.action-card-grid > button > div,
.room-template-panel,
.room-template-grid,
.room-template-grid > button > * {
  min-width: 0;
}

.action-card-grid > button:hover,
.room-template-grid > button:hover {
  border-color: #94cbbc !important;
  background: #f7fbfa !important;
  transform: translateY(-1px);
}

.action-card-grid > button > span {
  background: #e8f5f2 !important;
  color: var(--civi-premium-mint-dark) !important;
}

.room-template-panel {
  border-color: #d8e5e8 !important;
  border-radius: 12px !important;
  background: #f7fafb !important;
}

.compact-works-table {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  contain: inline-size;
  overscroll-behavior-inline: contain;
  border-color: #d8e3e8 !important;
  border-radius: 11px !important;
  box-shadow: none !important;
}

.compact-work-head {
  background: #eff4f6 !important;
  color: #687d8d !important;
}

.compact-work-row:hover { background: #f7fbfa !important; }

.works-section {
  overflow: hidden;
}

/* En ordenador, Estancias ocupa el alto disponible sin empujar la página. */
@media (min-width: 901px) {
  .rooms-page {
    display: flex;
    height: calc(100dvh - 72px);
    max-height: calc(100dvh - 72px);
    flex-direction: column;
    padding-bottom: 18px !important;
    overflow: hidden !important;
  }

  .rooms-page > .floor-tabs,
  .rooms-page > .unit-strip {
    flex: 0 0 auto;
  }

  .rooms-page > .room-builder {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden !important;
  }

  .rooms-page .room-list-panel,
  .rooms-page .room-editor {
    height: 100%;
    min-height: 0 !important;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

/* Menú completo también en pantallas de ordenador con poco alto. */
@media (min-width: 901px) and (max-height: 800px) {
  .builder-sidebar {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
  }

  .builder-sidebar > .builder-brand {
    min-height: 47px !important;
    padding-bottom: 8px !important;
  }

  .builder-sidebar .project-card {
    min-height: 62px;
    margin-bottom: 7px !important;
    padding: 7px 9px !important;
  }

  .builder-sidebar .project-card > span {
    width: 40px !important;
    height: 40px !important;
    flex-basis: 40px !important;
  }

  .builder-sidebar .builder-nav > p {
    margin: 8px 10px 3px !important;
  }

  .builder-sidebar .builder-nav > button {
    min-height: 36px;
    padding-top: 5px !important;
    padding-bottom: 5px !important;
  }

  .builder-sidebar .sidebar-help {
    padding: 8px !important;
  }
}

@media (max-width: 1380px) {
  .room-editor-head {
    align-items: flex-start !important;
    flex-wrap: wrap;
  }

  .room-editor-actions {
    width: 100%;
    justify-content: space-between;
  }

  .room-relocate-control {
    flex: 1 1 540px;
    grid-template-columns: auto minmax(120px, 1fr) auto !important;
  }

  .room-template-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 1160px) {
  .rooms-page {
    padding-inline: 18px !important;
  }

  .room-builder {
    grid-template-columns: 215px minmax(0, 1fr) !important;
  }

  .room-relocate-control {
    grid-template-columns: minmax(150px, 1fr) auto !important;
  }

  .room-relocate-control .relocate-title {
    grid-column: 1 / -1;
    width: max-content;
  }

  .action-card-grid,
  .room-template-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Catálogo, plantillas, presupuesto, exportación y ajustes */
.catalog-intro-card,
.templates-hero,
.settings-hero,
.export-new > header {
  position: relative;
  overflow: hidden;
}

.catalog-intro-card::before,
.templates-hero::before,
.settings-hero::before,
.export-new > header::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--civi-premium-mint);
}

.catalog-search-large,
.template-search {
  border-color: var(--civi-premium-line) !important;
  border-radius: 11px !important;
  background: #fff !important;
  box-shadow: 0 6px 18px rgba(16, 44, 67, .04);
}

.catalog-layout-new > aside button.active,
.template-list-row:hover {
  background: #eaf6f3 !important;
  color: var(--civi-premium-mint-dark) !important;
}

.template-list-row.active {
  border-bottom-color: rgba(255, 255, 255, .08) !important;
  background: linear-gradient(135deg, #0f314b, #15536a) !important;
  color: #fff !important;
  box-shadow: inset 4px 0 var(--civi-premium-mint) !important;
}

.template-list-row.active > span {
  background: rgba(65, 204, 176, .17) !important;
  color: #74e0ca !important;
}

.template-list-row.active b {
  color: #fff !important;
  font-weight: 850 !important;
}

.template-list-row.active small {
  color: #c7dce5 !important;
  font-weight: 650 !important;
}

.template-list-row.active em,
.template-list-row.active em.is-active {
  color: #7fe4cf !important;
}

.template-list-row.active em.is-hidden {
  color: #ffc2ca !important;
}

.catalog-layout-new article:hover {
  background: #f8fbfb !important;
}

.catalog-layout-new article code,
.budget-flat-row code {
  background: #e9f1f5 !important;
  color: var(--civi-premium-navy-2) !important;
}

.templates-split {
  gap: 12px !important;
}

.templates-page {
  height: calc(100dvh - 72px) !important;
  min-width: 0;
  padding: 22px 24px 26px !important;
}

.templates-hero {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 22px !important;
  min-height: 126px;
  margin-bottom: 14px !important;
  padding: 20px 22px !important;
}

.templates-hero > div {
  display: grid;
  align-content: center;
  min-width: 0;
}

.templates-hero span {
  display: block;
  margin: 0 0 6px !important;
  color: var(--civi-premium-mint-dark) !important;
  font-size: 9px !important;
  font-weight: 900 !important;
  letter-spacing: .17em !important;
  line-height: 1.2;
}

.templates-hero h1 {
  margin: 0 0 6px !important;
  color: var(--civi-premium-ink) !important;
  font-size: clamp(25px, 2.3vw, 32px) !important;
  line-height: 1.08;
  letter-spacing: -.04em !important;
}

.templates-hero p {
  max-width: 720px !important;
  margin: 0 !important;
  color: var(--civi-premium-muted) !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
}

.templates-hero > button {
  align-self: center;
  min-height: 42px;
  padding: 0 15px !important;
  border: 1px solid #1a8c78 !important;
  border-radius: 9px !important;
  background: linear-gradient(135deg, #1b957f, #32b398) !important;
  color: #fff !important;
  box-shadow: 0 7px 16px rgba(25, 143, 120, .17);
  font-size: 11px !important;
  font-weight: 850 !important;
  white-space: nowrap;
}

.templates-split {
  min-width: 0 !important;
}

.templates-list,
.template-editor,
.template-search-panel {
  min-width: 0 !important;
}

.template-editor-title,
.settings-card > header,
.catalog-head-new {
  border-bottom-color: var(--civi-premium-line) !important;
  background: #fbfcfd !important;
}

.template-editor-title > span,
.settings-card > header > span {
  background: #e6f5f1 !important;
  color: var(--civi-premium-mint-dark) !important;
}

.budget-summary,
.project-calculation-strip,
.export-check {
  gap: 10px !important;
}

.budget-summary > div,
.project-calculation-card,
.export-check > div {
  min-height: 82px !important;
}

.budget-summary > div.total,
.budget-grand-total {
  border-color: var(--civi-premium-navy) !important;
  background: linear-gradient(135deg, #0e2d47, #174d70) !important;
  color: #fff !important;
  box-shadow: 0 12px 24px rgba(9, 36, 57, .18) !important;
}

.budget-phase {
  overflow: hidden;
  border-color: var(--civi-premium-line) !important;
  border-radius: 12px !important;
  background: #fff;
  box-shadow: 0 7px 20px rgba(16, 44, 67, .05);
}

.budget-phase-line {
  background: var(--civi-premium-navy-2) !important;
}

.budget-flat-row {
  border-bottom-color: #e6ecef !important;
}

.export-choice-grid article {
  transition: transform .17s ease, border-color .17s ease, box-shadow .17s ease;
}

.export-choice-grid article:hover {
  border-color: #a9d3c8 !important;
  box-shadow: 0 15px 30px rgba(16, 72, 79, .09) !important;
  transform: translateY(-2px);
}

.export-choice-grid article.recommended {
  border: 2px solid var(--civi-premium-navy-2) !important;
}

.export-badge,
.export-check > div > span {
  background: #e7f5f1 !important;
  color: var(--civi-premium-mint-dark) !important;
}

.settings-grid {
  gap: 12px !important;
}

.settings-card > header {
  padding: 16px 18px !important;
}

.settings-fields {
  padding: 18px !important;
}

/* Mis mediciones y creación de obra */
.portfolio-top,
.start-header {
  min-height: 74px !important;
  height: 74px !important;
  border-bottom-color: var(--civi-premium-line) !important;
  background: rgba(255, 255, 255, .95) !important;
  box-shadow: 0 5px 18px rgba(16, 44, 67, .04) !important;
}

.portfolio-content {
  max-width: 1260px !important;
  padding-top: 34px !important;
}

.portfolio-overview-card {
  border-color: var(--civi-premium-line) !important;
  border-radius: 17px !important;
  box-shadow: var(--civi-premium-shadow) !important;
}

.portfolio-overview-card::before {
  height: 4px !important;
  background: linear-gradient(90deg, var(--civi-premium-navy-2) 0 72%, var(--civi-premium-mint) 72%) !important;
}

.portfolio-title h1 {
  color: var(--civi-premium-ink) !important;
  letter-spacing: -.045em !important;
}

.portfolio-stats span {
  border-color: var(--civi-premium-line) !important;
  background: #f7fafb !important;
  box-shadow: none !important;
}

.project-list article {
  border-color: var(--civi-premium-line) !important;
  border-radius: 13px !important;
  box-shadow: 0 7px 20px rgba(16, 44, 67, .055) !important;
}

.project-list article:hover {
  border-color: #a9d3c8 !important;
  box-shadow: 0 13px 28px rgba(16, 65, 74, .10) !important;
}

.start-option,
.project-wizard,
.form-modal,
.small-modal,
.work-picker {
  border: 1px solid var(--civi-premium-line) !important;
  border-radius: 17px !important;
  box-shadow: 0 24px 65px rgba(10, 36, 57, .20) !important;
}

.start-option.primary {
  border-color: var(--civi-premium-navy-2) !important;
}

.start-option.primary::before,
.welcome-pill,
.wizard-kicker {
  color: var(--civi-premium-mint-dark) !important;
}

.wizard-progress span.active {
  background: var(--civi-premium-navy-2) !important;
}

.builder-toast {
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 11px !important;
  background: var(--civi-premium-navy) !important;
}

/* Menú lateral móvil: ocupa solo su panel, no la página completa. */
.civi-mobile-nav-toggle,
.civi-mobile-nav-scrim {
  display: none;
}

@media (max-width: 900px) {
  .builder-sidebar {
    display: flex !important;
    position: fixed !important;
    z-index: 110 !important;
    inset: 8px auto 8px 8px !important;
    width: min(82vw, 286px) !important;
    height: calc(100dvh - 16px) !important;
    padding: 14px 12px !important;
    overflow: hidden auto !important;
    border: 1px solid rgba(255, 255, 255, .1) !important;
    border-radius: 17px !important;
    box-shadow: 18px 0 48px rgba(5, 24, 39, .28) !important;
    transform: translateX(calc(-100% - 20px));
    transition: transform .22s ease !important;
  }

  body.civi-mobile-nav-open {
    overflow: hidden;
  }

  body.civi-mobile-nav-open .builder-sidebar {
    transform: translateX(0);
  }

  .builder-sidebar > .builder-brand,
  .builder-sidebar > .project-card,
  .builder-sidebar > .sidebar-help,
  .builder-sidebar .builder-nav > p {
    display: flex !important;
  }

  .builder-sidebar .builder-brand b,
  .builder-sidebar .project-card > div,
  .builder-sidebar .project-card > button,
  .builder-sidebar .sidebar-help > div {
    display: block !important;
  }

  .builder-sidebar .builder-nav {
    display: flex !important;
    width: 100% !important;
    height: auto !important;
    flex: 0 0 auto !important;
    flex-direction: column !important;
    gap: 2px !important;
    overflow: visible !important;
  }

  .builder-sidebar .builder-nav > p {
    margin: 13px 10px 5px !important;
  }

  .builder-sidebar .builder-nav > button {
    display: grid !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 42px !important;
    flex: none !important;
    grid-template-columns: 28px 1fr auto !important;
    grid-template-rows: 1fr !important;
    gap: 8px !important;
    padding: 8px 10px !important;
    text-align: left !important;
  }

  .builder-sidebar .builder-nav > button > span {
    width: 28px !important;
    height: 28px !important;
    font-size: 16px !important;
  }

  .builder-sidebar .builder-nav > button > b {
    display: block !important;
    max-width: none !important;
    color: inherit !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    text-align: left !important;
  }

  .builder-sidebar .builder-nav > button > em {
    display: inline-flex !important;
  }

  .builder-workspace {
    width: 100% !important;
    max-width: 100vw !important;
    margin-left: 0 !important;
    padding-bottom: 0 !important;
  }

  .rooms-page {
    max-width: 100vw;
  }

  .civi-mobile-nav-toggle {
    display: grid;
    order: -1;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    padding: 0;
    border: 1px solid var(--civi-premium-line);
    border-radius: 10px;
    background: #fff;
    color: var(--civi-premium-navy);
    font-size: 19px;
  }

  .civi-mobile-nav-scrim {
    display: block;
    position: fixed;
    z-index: 105;
    inset: 0;
    border: 0;
    background: rgba(5, 24, 39, .48);
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(3px);
    transition: opacity .2s ease;
  }

  body.civi-mobile-nav-open .civi-mobile-nav-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .builder-topbar {
    gap: 10px;
    padding: 0 14px !important;
  }

  .builder-topbar > div:first-of-type {
    min-width: 0;
    flex: 1;
    display: block !important;
  }

  .builder-topbar > div:first-of-type b,
  .builder-topbar > div:first-of-type span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .builder-page {
    padding: 20px 16px 48px !important;
  }

  .page-title {
    min-height: 0;
    align-items: flex-start !important;
    gap: 16px !important;
    padding: 20px !important;
  }

  .page-title > div:last-child {
    width: auto;
  }

  .room-builder {
    grid-template-columns: 200px minmax(0, 1fr) !important;
    overflow: visible !important;
  }

  .room-relocate-control {
    flex-basis: 100%;
    width: 100%;
  }

  .civi-room-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .templates-page {
    height: auto !important;
    min-height: calc(100dvh - 64px);
    overflow: visible !important;
    padding: 18px 16px 40px !important;
  }

  .templates-hero {
    grid-template-columns: minmax(0, 1fr) auto !important;
  }
}

@media (max-width: 680px) {
  .builder-topbar {
    height: 64px !important;
    min-height: 64px !important;
  }

  .builder-topbar > div:last-of-type {
    gap: 5px !important;
  }

  .builder-topbar > div:last-of-type .plain-button:not(.user-menu-button),
  .builder-topbar > div:last-of-type .export-top {
    display: none !important;
  }

  .builder-page {
    padding: 14px 11px 38px !important;
  }

  .rooms-page {
    padding: 14px 10px 36px !important;
  }

  .page-title {
    flex-direction: column !important;
    margin-bottom: 12px !important;
    padding: 17px 15px !important;
    border-radius: 13px;
  }

  .page-title::before { inset: 0 0 0 35%; }

  .page-title > div:first-child {
    padding-left: 0;
  }

  .page-title .civi-page-icon {
    position: static;
    width: 38px;
    height: 38px;
    margin-bottom: 11px !important;
    font-size: 17px !important;
    transform: none;
  }

  .page-title h1 {
    font-size: 25px !important;
  }

  .page-title > div:last-child {
    width: 100%;
    justify-content: flex-start;
  }

  .page-title > div:last-child > * {
    flex: 1;
  }

  .civi-room-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .civi-room-summary > div {
    min-height: 70px;
    padding: 11px 10px 10px 43px;
  }

  .civi-room-summary i {
    top: 12px;
    left: 10px;
  }

  .floor-tabs {
    height: 50px !important;
  }

  .floor-tabs button {
    height: 36px !important;
    padding: 0 11px !important;
    font-size: 11px !important;
  }

  .room-builder {
    display: grid !important;
    grid-template-columns: 1fr !important;
    overflow: visible !important;
  }

  .room-editor,
  .room-list-panel,
  .editor-section,
  .works-section {
    max-width: 100% !important;
  }

  .editor-section {
    width: calc(100% - 16px);
    max-width: calc(100% - 16px) !important;
  }

  .room-relocate-control {
    display: grid !important;
    grid-template-columns: 1fr !important;
    align-items: stretch !important;
  }

  .room-relocate-control .relocate-title {
    grid-column: auto;
  }

  .relocate-destination {
    width: 100%;
  }

  .relocate-buttons {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
  }

  .relocate-button {
    width: 100%;
  }

  .templates-page {
    padding: 12px 10px 34px !important;
  }

  .templates-hero {
    display: flex !important;
    min-height: 0;
    align-items: stretch !important;
    flex-direction: column !important;
    gap: 14px !important;
    padding: 17px 15px !important;
  }

  .templates-hero > button {
    width: 100%;
  }

  .room-list-panel {
    position: static !important;
  }

  .room-editor-head {
    align-items: flex-start !important;
    flex-direction: column !important;
    gap: 12px !important;
  }

  .room-editor-actions {
    width: 100%;
  }

  .editor-section {
    margin: 8px !important;
    padding: 14px !important;
  }

  .action-card-grid,
  .room-template-grid {
    grid-template-columns: 1fr !important;
  }

  .project-fields,
  .settings-fields,
  .floor-card-grid,
  .budget-summary,
  .project-calculation-strip,
  .export-check,
  .export-choice-grid {
    grid-template-columns: 1fr !important;
  }

  .portfolio-content {
    padding: 20px 12px 46px !important;
  }

  .portfolio-overview-card {
    padding: 22px 16px !important;
  }

  .portfolio-title h1 {
    font-size: 29px !important;
  }
}

/* Ajustes v35: lectura interior de Plantillas y limpieza de Presupuesto. */
.templates-page .template-info-card {
  padding: 17px 18px !important;
  border-color: #d5e3df !important;
  background: linear-gradient(145deg, #fbfefd, #f3f9f7) !important;
}

.templates-page .template-info-card h2,
.templates-page .template-section > header b {
  color: #17344a !important;
  font-weight: 850 !important;
}

.templates-page .template-info-card h2 {
  font-size: 17px !important;
}

.templates-page .template-fields {
  gap: 13px !important;
}

.templates-page .template-fields label {
  color: #536b7c !important;
  font-size: 11px !important;
  font-weight: 850 !important;
}

.templates-page .template-fields :is(input, select) {
  min-height: 44px !important;
  border-color: #cfdde3 !important;
  color: #17344a !important;
  font-size: 13px !important;
  font-weight: 750 !important;
}

.templates-page .template-section > header {
  align-items: center !important;
}

.templates-page .template-section > header b {
  font-size: 16px !important;
}

.templates-page .template-section > header small {
  color: #6b7f8e !important;
  font-size: 10.5px !important;
}

.templates-page .template-section > header > span,
.templates-page .template-section > header > em {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 25px !important;
  padding: 0 9px !important;
  border: 1px solid #cce2dc !important;
  border-radius: 999px !important;
  background: #edf7f4 !important;
  color: #176e5f !important;
  font-size: 10px !important;
  font-style: normal !important;
  font-weight: 850 !important;
}

.templates-page .template-selected {
  gap: 8px !important;
}

.templates-page .template-selected article {
  min-height: 52px !important;
  padding: 10px 10px 10px 12px !important;
  border-color: #dbe5e9 !important;
  background: #fff !important;
  box-shadow: 0 3px 10px rgba(16, 44, 67, .035) !important;
}

.templates-page .template-selected article:hover {
  border-color: #bdd9d1 !important;
  background: #f8fcfb !important;
}

.templates-page .template-selected b {
  overflow: visible !important;
  color: #20394d !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  line-height: 1.35 !important;
  text-overflow: clip !important;
  white-space: normal !important;
}

.templates-page .template-selected small {
  margin-top: 4px !important;
  color: #718492 !important;
  font-size: 9.5px !important;
  font-weight: 650 !important;
}

.templates-page .template-catalog article {
  min-height: 55px !important;
  padding: 10px 11px !important;
  border-top-color: #e4ebee !important;
}

.templates-page .template-catalog code {
  display: inline-flex !important;
  align-items: center !important;
  width: fit-content !important;
  min-height: 24px !important;
  padding: 0 6px !important;
  border-radius: 6px !important;
  background: #edf3f5 !important;
  color: #39566c !important;
  font-size: 9.5px !important;
  font-weight: 800 !important;
}

.templates-page .template-catalog b {
  color: #263f53 !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  line-height: 1.35 !important;
}

.templates-page .template-catalog small {
  color: #6e8291 !important;
  font-size: 9.5px !important;
  line-height: 1.35 !important;
}

/* El nombre se lee como texto y solo muestra el campo al editarlo. */
.budget-page .budget-flat-row.partida .budget-description input {
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: text !important;
}

.budget-page .budget-flat-row.partida .budget-description input:hover:not(:focus) {
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}

.budget-page .budget-flat-row.partida .budget-description input:focus {
  border-color: #75b9a9 !important;
  background: #fff !important;
  box-shadow: 0 0 0 3px rgba(57, 189, 162, .13) !important;
}

/* Planta, unidad, estancia y medicion sin bandas grises de fondo. */
.budget-page .budget-flat-row:is(.floor-level, .unit-level, .room-level, .measurement) {
  background: #fff !important;
}

.budget-page .budget-flat-row:is(.floor-level, .unit-level, .room-level, .measurement) code {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.budget-page .budget-flat-row:is(.floor-level, .unit-level, .room-level, .measurement):hover {
  background: #fff !important;
}

@media (max-width: 680px) {
  .templates-page .template-info-card {
    padding: 15px !important;
  }

  .templates-page .template-selected b,
  .templates-page .template-catalog b {
    font-size: 11.5px !important;
  }
}

/* Contenido compacto dentro de cada etiqueta de estancia. */
.civi-rooms-redesigned .civi-room-lane .large-room-list > button {
  grid-template-columns: 28px minmax(0, 1fr) 10px !important;
  gap: 6px !important;
  padding: 3px 7px !important;
  align-items: center !important;
}

.civi-rooms-redesigned .civi-room-lane .large-room-list > button > span {
  width: 28px !important;
  min-width: 28px !important;
  height: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
  font-size: 14px !important;
}

.civi-rooms-redesigned .civi-room-lane .large-room-list > button > div {
  display: grid !important;
  min-width: 0 !important;
  height: 26px !important;
  grid-template-rows: 13px 9px !important;
  align-content: center !important;
  gap: 1px !important;
  overflow: hidden !important;
}

.civi-rooms-redesigned .civi-room-lane .large-room-list > button b {
  margin: 0 !important;
  font-size: 11px !important;
  line-height: 13px !important;
}

.civi-rooms-redesigned .civi-room-lane .large-room-list > button small {
  margin: 0 !important;
  font-size: 8px !important;
  line-height: 9px !important;
}

.civi-rooms-redesigned .civi-room-lane .large-room-list > button em {
  font-size: 10px !important;
  line-height: 1 !important;
}

/* Sistema visual interior v32: superficies con una jerarquia comun. */
.builder-shell {
  --civi-surface-work: #ffffff;
  --civi-surface-support: #f1f8f6;
  --civi-surface-neutral: #f6f8fa;
  --civi-surface-nav: #102c45;
  --civi-surface-nav-2: #174763;
  --civi-line-soft: #dde6ea;
  --civi-line-mint: #c8e1da;
  --civi-shadow-panel: 0 8px 24px rgba(16, 44, 67, .055);
  --civi-shadow-raised: 0 12px 30px rgba(16, 44, 67, .085);
}

/* Blanco: zonas en las que se introduce o edita informacion. */
.builder-page :is(
  .project-fields,
  .floor-card,
  .catalog-layout-new > section,
  .template-editor,
  .budget-phase,
  .settings-card,
  .export-native-card,
  .export-choice-grid article
),
.rooms-page :is(
  .room-editor,
  .civi-room-step,
  .civi-room-step-4,
  .compact-work-row:not(.extra)
) {
  border-color: var(--civi-line-soft) !important;
  background: var(--civi-surface-work) !important;
  box-shadow: var(--civi-shadow-panel) !important;
}

/* Gris muy claro: navegacion y busqueda secundaria. */
.builder-page :is(
  .catalog-layout-new > aside,
  .templates-list,
  .template-search-panel,
  .catalog-toolbar,
  .template-search,
  .budget-flat-head
) {
  border-color: var(--civi-line-soft) !important;
  background: var(--civi-surface-neutral) !important;
}

/* Verde suave: ayuda, resumenes y confirmaciones; nunca campos de trabajo. */
.builder-page :is(
  .structure-tip,
  .settings-linked-base,
  .database-overview > div,
  .export-check > div,
  .template-info-card
),
.rooms-page :is(
  .outdoor-link,
  .room-template-panel
) {
  border-color: var(--civi-line-mint) !important;
  background: linear-gradient(145deg, #f7fcfa, var(--civi-surface-support)) !important;
  box-shadow: none !important;
}

/* Cabeceras de panel: misma linea, fondo y ritmo en toda la obra. */
.builder-page :is(
  .settings-card > header,
  .template-editor-title,
  .templates-list > header,
  .template-search-panel > header,
  .catalog-head-new
),
.rooms-page :is(
  .room-editor-head,
  .editor-section-title
) {
  border-bottom-color: var(--civi-line-soft) !important;
  background: linear-gradient(180deg, #ffffff, #fbfcfd) !important;
}

.settings-card > header > span,
.template-editor-title > div:first-child > span,
.civi-room-step .editor-section-title > span {
  border: 1px solid var(--civi-line-mint) !important;
  background: #e8f5f1 !important;
  color: #176f60 !important;
  box-shadow: none !important;
}

/* Seleccion persistente: marino; foco y confirmacion: menta. */
.catalog-layout-new > aside button.active,
.template-list-row.active,
.floor-tabs button.active,
.unit-strip button.active,
.large-room-list > button.active,
.large-room-list > button[aria-pressed="true"] {
  border-color: #234f68 !important;
  background: linear-gradient(135deg, var(--civi-surface-nav), var(--civi-surface-nav-2)) !important;
  color: #fff !important;
  box-shadow: inset 3px 0 #58cdb4, 0 6px 14px rgba(13, 45, 68, .12) !important;
}

.catalog-layout-new > aside button.active :is(span, small, b),
.floor-tabs button.active :is(span, small, b),
.unit-strip button.active :is(span, small, b),
.large-room-list > button[aria-pressed="true"] :is(span, small, b, em) {
  color: inherit !important;
}

/* Acciones de anadir en catalogos: la misma familia verde del resto. */
.builder-workspace .catalog-layout-new article button:last-child,
.template-catalog article > button,
.room-template-grid > button,
.compact-works-table .add-line {
  border-color: #acd3c8 !important;
  background: #f4faf8 !important;
  color: #146c5c !important;
  box-shadow: none !important;
}

.builder-workspace .catalog-layout-new article button:last-child:hover,
.template-catalog article > button:hover,
.room-template-grid > button:hover,
.compact-works-table .add-line:hover {
  border-color: #83bfaf !important;
  background: #e8f5f1 !important;
  color: #105f51 !important;
}

.builder-nav > button:focus-visible {
  outline: 2px solid #58cdb4 !important;
  outline-offset: 1px !important;
}

/* Los bloques elevados comparten borde, radio y sombra. */
.builder-page :is(
  .page-title,
  .catalog-intro-card,
  .templates-hero,
  .settings-hero,
  .export-new > header
) {
  border-color: var(--civi-line-soft) !important;
  border-radius: 16px !important;
  background: #fff !important;
  box-shadow: var(--civi-shadow-raised) !important;
}

.builder-page :is(
  .catalog-intro-card,
  .templates-hero,
  .settings-hero,
  .export-new > header
)::before {
  background: #5bc7af !important;
}

/* Separacion discreta entre grupos de contenido, sin recargar de color. */
.budget-partida-group + .budget-partida-group,
.template-selected article + article {
  border-top-color: #edf1f3 !important;
}

.budget-flat-row:hover,
.template-selected article:hover,
.catalog-layout-new article:hover {
  background-color: #f8fbfa !important;
}

@media (max-width: 680px) {
  .builder-page :is(
    .page-title,
    .catalog-intro-card,
    .templates-hero,
    .settings-hero,
    .export-new > header
  ) {
    border-radius: 13px !important;
    box-shadow: 0 7px 20px rgba(16, 44, 67, .06) !important;
  }
}

/* Paleta semántica de acciones: sobria, coherente y sin el azul antiguo. */
.builder-shell {
  --civi-action-green: #167563;
  --civi-action-green-2: #218c78;
  --civi-action-green-soft: #eef8f5;
  --civi-action-green-border: #abd3c7;
  --civi-action-green-ink: #126b5b;
  --civi-action-navy: #123f5f;
  --civi-action-navy-soft: #eef4f7;
  --civi-action-navy-border: #c1d1da;
  --civi-action-red-soft: #fff3f4;
  --civi-action-red-border: #e2b9c0;
  --civi-action-red-ink: #a74655;
}

.builder-workspace .main-action:not(.soft),
.builder-topbar .export-top,
.templates-hero > button,
.template-editor-footer .save,
.modal-layer .main-action {
  border-color: #146957 !important;
  background: linear-gradient(135deg, var(--civi-action-green), var(--civi-action-green-2)) !important;
  color: #fff !important;
  box-shadow: 0 6px 15px rgba(19, 112, 94, .16) !important;
}

.builder-workspace .main-action:not(.soft):hover,
.builder-topbar .export-top:hover,
.templates-hero > button:hover,
.template-editor-footer .save:hover,
.modal-layer .main-action:hover {
  border-color: #105d4e !important;
  background: linear-gradient(135deg, #126b5a, #1b806d) !important;
  box-shadow: 0 8px 18px rgba(16, 93, 78, .2) !important;
}

.builder-workspace .main-action.soft {
  border-color: var(--civi-action-green-border) !important;
  background: var(--civi-action-green-soft) !important;
  color: var(--civi-action-green-ink) !important;
  box-shadow: none !important;
}

.builder-workspace .main-action.soft:hover {
  border-color: #8fc5b6 !important;
  background: #e2f3ed !important;
  color: #0f6152 !important;
}

.builder-page .plain-button:not(.danger),
.modal-layer .plain-button {
  border-color: var(--civi-action-navy-border) !important;
  background: #fff !important;
  color: var(--civi-action-navy) !important;
  box-shadow: none !important;
}

.builder-page .plain-button:not(.danger):hover,
.modal-layer .plain-button:hover {
  border-color: #9fb8c6 !important;
  background: var(--civi-action-navy-soft) !important;
  color: #0d344f !important;
}

.templates-page .template-switch.active {
  border-color: var(--civi-action-green-border) !important;
  background: var(--civi-action-green-soft) !important;
  color: var(--civi-action-green-ink) !important;
  box-shadow: inset 0 0 0 1px rgba(18, 107, 91, .04) !important;
}

.templates-page .template-switch.active:hover {
  border-color: #8fc5b6 !important;
  background: #e2f3ed !important;
}

.templates-page .template-catalog article > button {
  border-color: var(--civi-action-green-border) !important;
  background: #f7fbfa !important;
  color: var(--civi-action-green-ink) !important;
  box-shadow: none !important;
}

.templates-page .template-catalog article > button:hover {
  border-color: #8fc5b6 !important;
  background: #e7f5f0 !important;
}

.builder-sidebar .sidebar-help.civi-project-help-slot > .civi-project-help-button {
  border: 1px solid rgba(88, 210, 184, .28) !important;
  background: rgba(88, 210, 184, .12) !important;
  color: #e7fff9 !important;
  box-shadow: none !important;
}

.builder-sidebar .sidebar-help.civi-project-help-slot > .civi-project-help-button:hover {
  border-color: rgba(88, 210, 184, .48) !important;
  background: rgba(88, 210, 184, .2) !important;
}

.builder-sidebar .sidebar-help.civi-project-help-slot > .civi-project-help-button > span {
  background: #58d2b8 !important;
  color: #0b3540 !important;
}

.export-new .export-choice-grid article:nth-child(2) .plain-button.big {
  border-color: var(--civi-action-navy-border) !important;
  background: var(--civi-action-navy-soft) !important;
  color: var(--civi-action-navy) !important;
}

.export-new .export-choice-grid article:nth-child(3) .plain-button.big {
  border-color: var(--civi-action-green-border) !important;
  background: var(--civi-action-green-soft) !important;
  color: var(--civi-action-green-ink) !important;
}

.settings-page .plain-button.danger {
  border-color: var(--civi-action-red-border) !important;
  background: var(--civi-action-red-soft) !important;
  color: var(--civi-action-red-ink) !important;
  box-shadow: none !important;
}

.settings-page .plain-button.danger:hover {
  border-color: #d79ca6 !important;
  background: #ffe8eb !important;
  color: #923847 !important;
}

/* Partidas legibles, importes contenidos y capítulos siempre identificados. */
.civi-rooms-redesigned .civi-room-step-4 .compact-works-table {
  padding-bottom: 6px !important;
  background: #f7fafb !important;
}

.civi-rooms-redesigned .civi-room-step-4 .compact-work-row:not(.extra) {
  margin-top: 6px !important;
  border: 1px solid #dfe8ed !important;
  border-left: 3px solid #c9dce3 !important;
  border-radius: 9px !important;
  background: #fff !important;
  box-shadow: 0 2px 8px rgba(18, 63, 91, .045) !important;
}

.civi-rooms-redesigned .civi-room-step-4 .compact-work-row:not(.extra):hover {
  border-color: #cbdde4 !important;
  border-left-color: #7fb5aa !important;
  background: #fbfefd !important;
  box-shadow: 0 4px 11px rgba(18, 63, 91, .065) !important;
}

.civi-rooms-redesigned .civi-room-step-4 .compact-work-row.extra {
  border-inline: 1px solid #e2e9ed !important;
  background: #fbfcfd !important;
}

.civi-rooms-redesigned .civi-room-step-4 .compact-work-row > strong {
  background: linear-gradient(to bottom, transparent 0 15px, #edf4f6 15px 100%) !important;
  border-radius: 0 0 7px 7px !important;
  box-shadow: none !important;
}

.civi-rooms-redesigned .civi-room-step-4 .phase[class*="phase-"] {
  display: inline-flex !important;
  width: max-content !important;
  min-height: 18px !important;
  align-items: center !important;
  padding: 0 7px !important;
  border: 1px solid #d7e0e6 !important;
  border-radius: 6px !important;
  background: #eef3f6 !important;
  color: #52697a !important;
  font-size: 7px !important;
  line-height: 16px !important;
}

.civi-rooms-redesigned .civi-room-step-4 .phase.phase-00 { background: #fff3dc !important; border-color: #ead4a5 !important; color: #895d17 !important; }
.civi-rooms-redesigned .civi-room-step-4 .phase.phase-01 { background: #e8f5ec !important; border-color: #c6dfce !important; color: #35704a !important; }
.civi-rooms-redesigned .civi-room-step-4 .phase.phase-02 { background: #fff0f1 !important; border-color: #edcdd2 !important; color: #a14a58 !important; }
.civi-rooms-redesigned .civi-room-step-4 :is(.phase.phase-03, .phase.phase-04, .phase.phase-05) { background: #edf4fb !important; border-color: #cddded !important; color: #3e6f99 !important; }
.civi-rooms-redesigned .civi-room-step-4 .phase.phase-06 { background: #f0edff !important; border-color: #d7d0f6 !important; color: #6652a3 !important; }
.civi-rooms-redesigned .civi-room-step-4 :is(.phase.phase-07, .phase.phase-08, .phase.phase-09, .phase.phase-10) { background: #e9f7f4 !important; border-color: #c8e3dc !important; color: #2f7768 !important; }
.civi-rooms-redesigned .civi-room-step-4 :is(.phase.phase-11, .phase.phase-12, .phase.phase-13, .phase.phase-14) { background: #fff1e9 !important; border-color: #ead4c6 !important; color: #8e5f41 !important; }
.civi-rooms-redesigned .civi-room-step-4 :is(.phase.phase-15, .phase.phase-16, .phase.phase-17) { background: #eaf5fb !important; border-color: #c9e0eb !important; color: #39738d !important; }
.civi-rooms-redesigned .civi-room-step-4 .phase.phase-18 { background: #faeef5 !important; border-color: #e8d0df !important; color: #8a5575 !important; }
.civi-rooms-redesigned .civi-room-step-4 .phase.phase-19 { background: #fff3e4 !important; border-color: #ead7ba !important; color: #8d642c !important; }
.civi-rooms-redesigned .civi-room-step-4 :is(.phase.phase-20, .phase.phase-21, .phase.phase-22, .phase.phase-23) { background: #eef4e8 !important; border-color: #d2dfc6 !important; color: #5d7444 !important; }
.civi-rooms-redesigned .civi-room-step-4 .phase.phase-99 { background: #f0f2f4 !important; border-color: #d9dfe4 !important; color: #687684 !important; }

.civi-structure-collapse-toggle {
  min-width: max-content !important;
  min-height: 36px !important;
  height: 36px !important;
  padding: 0 11px !important;
  gap: 6px !important;
  color: #466275 !important;
  font-size: 10px !important;
  white-space: nowrap !important;
}

.civi-structure-collapse-toggle:hover {
  border-color: #b9cdd5 !important;
  background: #f4f8f9 !important;
  color: #174c68 !important;
}

.civi-rooms-redesigned.civi-structure-collapsed > .floor-tabs,
.civi-rooms-redesigned.civi-structure-collapsed > .unit-strip,
.civi-rooms-redesigned.civi-structure-collapsed .civi-room-workspace > .civi-room-lane {
  display: none !important;
}

.civi-rooms-redesigned.civi-structure-collapsed .civi-room-workspace {
  grid-template-rows: minmax(0, 1fr) !important;
  gap: 0 !important;
  margin-top: 10px !important;
}

.civi-rooms-redesigned.civi-structure-collapsed .civi-room-columns {
  grid-row: 1 !important;
}

@media (max-width: 900px) {
  .civi-structure-collapse-toggle {
    width: 36px !important;
    min-width: 36px !important;
    padding: 0 !important;
    font-size: 0 !important;
  }

  .civi-structure-collapse-toggle i {
    font-size: 12px !important;
  }
}

/* Estancias: una sola jerarquía visual de planta → zona → estancia. */
.civi-rooms-organized .floor-tabs {
  gap: 6px !important;
  padding: 6px 8px !important;
}

.civi-floor-nav-label {
  display: grid;
  width: 132px;
  min-width: 132px;
  height: 40px;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-right: 3px;
  padding-right: 10px;
  border-right: 1px solid #dbe5e9;
}

.civi-floor-nav-label > i {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: var(--civi-premium-navy);
  color: #fff;
  font-size: 13px;
}

.civi-floor-nav-label small,
.civi-floor-nav-label b {
  display: block;
  white-space: nowrap;
}

.civi-floor-nav-label small {
  color: #7c8e9a;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .09em;
}

.civi-floor-nav-label b {
  margin-top: 2px;
  color: var(--civi-premium-ink);
  font-size: 11px;
}

.civi-rooms-organized .unit-strip {
  min-height: 48px;
  padding: 7px 9px !important;
  border-left: 4px solid var(--civi-premium-mint) !important;
  background: #f9fbfb !important;
  box-shadow: 0 5px 15px rgba(16, 44, 67, .025);
}

.civi-rooms-organized .room-builder {
  grid-template-columns: 260px minmax(0, 1fr) !important;
  gap: 14px !important;
}

.civi-rooms-organized .room-list-panel,
.civi-rooms-organized .room-editor {
  border-radius: 14px !important;
}

.civi-rooms-organized .room-list-panel > header {
  position: static;
  z-index: 3;
  flex: 0 0 auto;
  min-height: 64px;
  padding: 13px 14px !important;
  background: linear-gradient(135deg, #f7fbfa, #fff) !important;
}

.civi-rooms-organized .room-list-panel > header b {
  color: var(--civi-premium-ink);
  font-size: 14px;
}

.civi-rooms-organized .room-list-panel > header small {
  margin-top: 3px;
  color: #7b8d99;
  font-size: 9px;
}

.civi-rooms-organized .large-room-list {
  max-height: none !important;
  padding: 8px !important;
}

@media (min-width: 901px) {
  .civi-rooms-organized .room-editor-head input {
    font-size: 24px !important;
  }

  .civi-rooms-organized .room-list-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
  }

  .civi-rooms-organized .large-room-list {
    min-height: 0;
    flex: 1 1 auto;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
  }

  .civi-rooms-organized .add-room-bottom {
    flex: 0 0 auto;
  }
}

.civi-rooms-organized .large-room-list > button {
  min-height: 58px;
  margin-bottom: 4px;
  padding: 8px 9px !important;
  border: 1px solid transparent !important;
}

.civi-rooms-organized .room-editor-head {
  position: sticky;
  z-index: 5;
  top: 0;
  display: grid !important;
  min-height: 82px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center !important;
  gap: 18px;
  padding: 14px 16px !important;
  border-bottom: 1px solid #dce6ea !important;
  background: rgba(255, 255, 255, .97) !important;
  box-shadow: 0 5px 14px rgba(18, 49, 72, .035);
  backdrop-filter: blur(12px);
}

.civi-rooms-organized .room-editor-head > div:first-child {
  display: grid !important;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "type name"
    "type meta";
  align-items: center;
  column-gap: 11px;
  row-gap: 2px;
}

.civi-rooms-organized .room-editor-head > div:first-child > span {
  grid-area: type;
  display: grid;
  min-width: 48px;
  min-height: 48px;
  place-items: center;
  padding: 7px !important;
  border: 1px solid #c9e5dd !important;
  border-radius: 11px !important;
  background: #e7f5f1 !important;
  color: #147663 !important;
  font-size: 9px !important;
  text-align: center;
}

.civi-rooms-organized .room-editor-head input {
  grid-area: name;
  height: 28px !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 21px !important;
}

.civi-rooms-organized .room-editor-head p {
  grid-area: meta;
  overflow: hidden;
  margin: 0 !important;
  color: #7a8d99 !important;
  font-size: 9px !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.civi-rooms-organized .room-editor-actions {
  display: flex !important;
  width: auto;
  flex-wrap: nowrap !important;
  align-items: center;
  justify-content: flex-end !important;
  gap: 7px;
}

.civi-rooms-organized .room-editor-costs {
  display: grid !important;
  min-width: 215px;
  min-height: 48px;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 0;
  padding: 5px 7px !important;
  border: 1px solid #dce6ea !important;
  border-radius: 10px !important;
  background: #f7fafb !important;
}

.civi-rooms-organized .room-editor-costs > span {
  display: grid;
  min-width: 0;
  gap: 2px;
  padding: 2px 9px;
  color: #7b8d99 !important;
  font-size: 7px !important;
  font-weight: 900;
  letter-spacing: .06em;
}

.civi-rooms-organized .room-editor-costs > span + span {
  border-left: 1px solid #dce6ea;
}

.civi-rooms-organized .room-editor-costs b {
  overflow: hidden;
  color: var(--civi-premium-ink) !important;
  font-size: 11px !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.civi-rooms-organized .room-editor-costs > i {
  display: none !important;
}

.civi-rooms-organized .room-editor-more {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid #d7e2e7 !important;
  border-radius: 9px !important;
  background: #fff !important;
  color: var(--civi-premium-navy) !important;
  font-size: 19px;
}

.civi-rooms-organized .room-editor-more:hover {
  border-color: #9fcac0 !important;
  background: #f1f9f7 !important;
}

.civi-rooms-organized .editor-section {
  padding: 16px !important;
  border-color: #dce6ea !important;
  box-shadow: 0 4px 13px rgba(16, 44, 67, .035) !important;
}

.civi-rooms-organized .editor-section-title {
  align-items: flex-start !important;
  margin-bottom: 13px !important;
}

.civi-rooms-organized .editor-section-title h2 {
  font-size: 14px !important;
}

.civi-rooms-organized .editor-section-title p {
  max-width: 720px;
  font-size: 9px !important;
  line-height: 1.45;
}

@media (min-width: 901px) and (max-width: 1160px) {
  .civi-rooms-organized .room-builder {
    grid-template-columns: 220px minmax(0, 1fr) !important;
  }

  .civi-floor-nav-label {
    width: 98px;
    min-width: 98px;
  }

  .civi-floor-nav-label small {
    display: none;
  }

  .civi-rooms-organized .room-editor-head {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
  }

  .civi-rooms-organized .room-editor-actions {
    width: 100%;
    justify-content: space-between !important;
  }
}

@media (max-width: 900px) {
  .civi-floor-nav-label {
    display: none;
  }

  .civi-rooms-organized .room-builder {
    grid-template-columns: 200px minmax(0, 1fr) !important;
  }

  .civi-rooms-organized .room-editor-head {
    position: static;
  }
}

@media (max-width: 680px) {
  .civi-rooms-organized .room-builder {
    grid-template-columns: 1fr !important;
  }

  .civi-rooms-organized .room-editor-head {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px;
  }

  .civi-rooms-organized .room-editor-actions,
  .civi-rooms-organized .room-editor-costs {
    width: 100%;
  }

  .civi-rooms-organized .room-editor-costs {
    min-width: 0;
  }

  .civi-rooms-organized .room-editor-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 38px;
  }
}

/* Evita el parpadeo al coincidir los estados activo, hover y ordenable. */
.builder-sidebar .builder-nav > button.active,
.builder-sidebar .builder-nav > button.active:hover,
.builder-sidebar .builder-nav > button.active:focus-visible {
  border-color: rgba(77, 202, 177, .12) !important;
  background: linear-gradient(90deg, rgba(53, 186, 160, .22), rgba(53, 186, 160, .10)) !important;
  color: #fff !important;
  box-shadow: inset 3px 0 #4ed0b4 !important;
  opacity: 1 !important;
  filter: none !important;
  transform: none !important;
  animation: none !important;
  transition: none !important;
}

.builder-sidebar .builder-nav > button.active > span,
.builder-sidebar .builder-nav > button.active:hover > span {
  color: #66dbc3 !important;
}

.builder-sidebar .builder-nav > button.active > b,
.builder-sidebar .builder-nav > button.active:hover > b {
  color: #fff !important;
}

.civi-rooms-organized .large-room-list > button > * {
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .builder-shell *,
  .builder-shell *::before,
  .builder-shell *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

@media print {
  .civi-mobile-nav-toggle,
  .civi-mobile-nav-scrim {
    display: none !important;
  }
}

@media (min-width: 901px) {
  .civi-rooms-organized .room-editor-head input {
    font-size: 24px !important;
  }
}

/*
 * Selección persistente unificada.
 * Toma como referencia la plantilla seleccionada y no afecta a hover,
 * acciones principales, estados de proceso ni navegación lateral.
 */
body :is(
  .catalog-layout-new > aside button.active,
  .kind-grid button.active,
  .floor-type-grid button.active,
  .level-config > button.active,
  .roof-choice button.active,
  .roof-inline button.active,
  .civi-import-tabs button.active,
  .destination-scope button.active,
  .share-work-choice.active,
  .legal-document > footer button.active
) {
  border-color: rgba(65, 204, 176, .42) !important;
  background-color: #0f314b !important;
  background-image: linear-gradient(135deg, #0f314b, #15536a) !important;
  color: #fff !important;
  box-shadow: inset 4px 0 var(--civi-premium-mint), 0 7px 17px rgba(15, 49, 75, .16) !important;
  opacity: 1 !important;
  filter: none !important;
  transform: none !important;
  animation: none !important;
}

body :is(
  .catalog-layout-new > aside button.active,
  .kind-grid button.active,
  .floor-type-grid button.active,
  .level-config > button.active,
  .roof-choice button.active,
  .roof-inline button.active,
  .civi-import-tabs button.active,
  .destination-scope button.active,
  .share-work-choice.active,
  .legal-document > footer button.active
) :is(b, strong) {
  color: #fff !important;
}

body :is(
  .catalog-layout-new > aside button.active,
  .kind-grid button.active,
  .floor-type-grid button.active,
  .level-config > button.active,
  .roof-choice button.active,
  .roof-inline button.active,
  .civi-import-tabs button.active,
  .destination-scope button.active,
  .share-work-choice.active
) :is(small, em, p) {
  color: #c7dce5 !important;
}

body :is(
  .catalog-layout-new > aside button.active,
  .kind-grid button.active,
  .floor-type-grid button.active,
  .level-config > button.active,
  .roof-choice button.active,
  .roof-inline button.active,
  .destination-scope button.active,
  .share-work-choice.active
) > span {
  border-color: rgba(116, 224, 202, .24) !important;
  background: rgba(65, 204, 176, .17) !important;
  color: #74e0ca !important;
}

body .civi-import-tabs button.active::after {
  display: none !important;
}

body .settings-page .database-settings .database-list article.active {
  border-color: rgba(65, 204, 176, .42) !important;
  background-color: #0f314b !important;
  background-image: linear-gradient(135deg, #0f314b, #15536a) !important;
  color: #fff !important;
  box-shadow: inset 4px 0 var(--civi-premium-mint), 0 7px 17px rgba(15, 49, 75, .16) !important;
}

body .settings-page .database-settings .database-list article.active :is(b, strong) {
  color: #fff !important;
}

body .settings-page .database-settings .database-list article.active :is(small, em, p) {
  color: #c7dce5 !important;
}

body .settings-page .database-settings .database-list article.active .database-radio i {
  border: 4px solid #74e0ca !important;
  background: #0f314b !important;
}

body .settings-page .database-settings .database-list article.active .db-format,
body .settings-page .database-settings .database-list article.active .db-status {
  border-color: rgba(116, 224, 202, .24) !important;
  background: rgba(65, 204, 176, .17) !important;
  color: #74e0ca !important;
}

body .settings-page .database-settings .database-list article.active .delete-db {
  background: rgba(255, 194, 202, .12) !important;
  color: #ffc2ca !important;
}

body .product-preview > aside span.active {
  border-color: rgba(65, 204, 176, .42) !important;
  background: linear-gradient(135deg, #0f314b, #15536a) !important;
  color: #fff !important;
  box-shadow: inset 4px 0 var(--civi-premium-mint) !important;
}

/* Estancias 2026: plantas → unidades/zonas → estancias → tres pasos simultáneos. */
.civi-rooms-redesigned .unit-strip > span:first-child {
  display: inline-flex;
  min-width: 138px;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  padding-right: 10px;
  border-right: 1px solid #dbe5e9;
}

.civi-rooms-redesigned .unit-strip > span:first-child::before {
  content: "⌂";
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 8px;
  background: var(--civi-premium-navy);
  color: #fff;
  font-size: 13px;
}

.civi-room-lane-hint {
  display: block;
  margin-top: 5px;
  color: #718794;
  font-size: 7px;
  font-weight: 750;
  line-height: 1.3;
  white-space: nowrap;
}

.civi-room-lane-hint i {
  margin-right: 3px;
  color: var(--civi-premium-mint-dark);
}

.civi-rooms-redesigned .large-room-list > button {
  position: relative;
}

.civi-rooms-redesigned .large-room-list > button > div {
  min-width: 0;
  overflow: hidden;
}

.civi-rooms-redesigned .large-room-list > button > div > :is(b, small) {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.civi-rooms-redesigned .large-room-list > button:not(:last-child)::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 50%;
  right: -23px;
  width: 22px;
  height: 2px;
  background: linear-gradient(90deg, #b9ccd5, var(--civi-premium-mint));
  pointer-events: none;
}

.civi-rooms-redesigned .large-room-list > button:not(:last-child)::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: calc(50% - 3px);
  right: -24px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--civi-premium-mint);
  box-shadow: 0 0 0 3px #fff;
  pointer-events: none;
}

.civi-rooms-redesigned .civi-room-step {
  scrollbar-width: thin;
  scrollbar-color: #b8cbd3 transparent;
}

.civi-rooms-redesigned .civi-room-step-1 { border-top: 3px solid #2f78b7 !important; }
.civi-rooms-redesigned .civi-room-step-2 { border-top: 3px solid var(--civi-premium-mint) !important; }
.civi-rooms-redesigned .civi-room-step-3 { border-top: 3px solid #15536a !important; }

.civi-rooms-redesigned .civi-room-step .editor-section-title {
  position: sticky;
  z-index: 3;
  top: -14px;
  min-height: 54px;
  align-items: flex-start !important;
  margin: -2px -2px 13px !important;
  padding: 2px 2px 10px;
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(10px);
}

.civi-rooms-redesigned .civi-room-step .editor-section-title h2 {
  font-size: 13px !important;
  line-height: 1.25;
}

.civi-rooms-redesigned .civi-room-step .editor-section-title p {
  font-size: 8px !important;
  line-height: 1.4;
}

.civi-rooms-redesigned .civi-room-step-1 .dimension-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.civi-rooms-redesigned .civi-room-step-1 .outdoor-link {
  grid-template-columns: 1fr !important;
}

.civi-rooms-redesigned .civi-room-step-2 .action-card-grid,
.civi-rooms-redesigned .civi-room-step-2 .room-template-grid {
  grid-template-columns: 1fr !important;
}

.civi-rooms-redesigned .civi-room-step-2 .action-card-grid > button {
  min-height: 56px;
  padding: 9px !important;
}

.civi-rooms-redesigned .civi-room-step-2 .room-template-panel {
  margin-top: 12px;
  padding: 11px !important;
}

.civi-rooms-redesigned .civi-room-step-3 .compact-works-table {
  overflow-x: hidden !important;
  overflow-y: visible !important;
  contain: inline-size;
}

.civi-rooms-redesigned .civi-room-step-3 .compact-work-head {
  display: none !important;
}

.civi-rooms-redesigned .civi-room-step-3 .compact-work-row {
  display: grid !important;
  min-width: 0 !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 7px !important;
  padding: 10px !important;
  background: #fff;
}

.civi-rooms-redesigned .civi-room-step-3 .compact-work-info,
.civi-rooms-redesigned .civi-room-step-3 .compact-line-label {
  grid-column: 1 / -1;
  min-width: 0;
  padding: 0 0 6px !important;
}

.civi-rooms-redesigned .civi-room-step-3 .compact-work-row > label {
  display: grid !important;
  min-width: 0;
  gap: 3px;
}

.civi-rooms-redesigned .civi-room-step-3 .compact-work-row > label::before {
  color: #7b8d99;
  font-size: 6px;
  font-weight: 900;
  letter-spacing: .05em;
  text-align: center;
}

.civi-rooms-redesigned .civi-room-step-3 .compact-work-row > label:nth-of-type(1)::before { content: "UDS."; }
.civi-rooms-redesigned .civi-room-step-3 .compact-work-row > label:nth-of-type(2)::before { content: "LARGO"; }
.civi-rooms-redesigned .civi-room-step-3 .compact-work-row > label:nth-of-type(3)::before { content: "ANCHO"; }
.civi-rooms-redesigned .civi-room-step-3 .compact-work-row > label:nth-of-type(4)::before { content: "ALTO"; }
.civi-rooms-redesigned .civi-room-step-3 .compact-work-row > label:nth-of-type(5)::before { content: "TIPO"; }
.civi-rooms-redesigned .civi-room-step-3 .compact-work-row > label:nth-of-type(6)::before { content: "MEDICIÓN"; }
.civi-rooms-redesigned .civi-room-step-3 .compact-work-row > label:nth-of-type(7)::before { content: "PRECIO"; }

.civi-rooms-redesigned .civi-room-step-3 .compact-work-row > label input,
.civi-rooms-redesigned .civi-room-step-3 .compact-work-row > label select {
  min-width: 0;
  height: 32px !important;
  padding-inline: 4px !important;
  font-size: 9px !important;
}

.civi-rooms-redesigned .civi-room-step-3 .compact-work-row > strong {
  grid-column: 1 / 3;
  display: grid;
  min-height: 32px;
  place-items: center;
  border-radius: 7px;
  background: #edf4f6;
  color: var(--civi-premium-navy) !important;
}

.civi-rooms-redesigned .civi-room-step-3 .compact-work-actions {
  grid-column: 3 / -1;
  justify-content: flex-end !important;
}

.civi-rooms-redesigned .civi-room-step-3 .compact-work-actions button {
  width: 28px !important;
  height: 32px !important;
  border: 1px solid #dbe4e9 !important;
  background: #fff !important;
}

@media (min-width: 901px) {
  .civi-rooms-redesigned {
    gap: 0;
    padding: 14px 20px 14px !important;
  }

  .civi-rooms-redesigned > .unit-strip {
    margin-top: 8px !important;
  }

  .civi-rooms-redesigned > .civi-room-workspace {
    display: grid !important;
    flex: 1 1 auto;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: 82px minmax(0, 1fr);
    gap: 8px !important;
    margin-top: 8px !important;
    overflow: hidden !important;
  }

  .civi-rooms-redesigned .civi-room-lane {
    display: grid !important;
    position: static !important;
    top: auto !important;
    align-self: stretch !important;
    width: 100%;
    height: 82px !important;
    min-height: 82px !important;
    grid-template-columns: 154px minmax(0, 1fr) 132px;
    align-items: stretch;
    border-radius: 13px !important;
    overflow: hidden !important;
  }

  .civi-rooms-redesigned .civi-room-lane > header {
    min-height: 0;
    height: 100%;
    padding: 10px 12px !important;
    border-right: 1px solid #dce6ea;
    border-bottom: 0 !important;
  }

  .civi-rooms-redesigned .civi-room-lane > header > button {
    display: none !important;
  }

  .civi-rooms-redesigned .civi-room-lane .large-room-list {
    display: flex !important;
    min-width: 0;
    min-height: 0;
    align-items: center;
    gap: 22px;
    padding: 10px 12px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
  }

  .civi-rooms-redesigned .civi-room-lane .large-room-list > button {
    width: 184px !important;
    min-width: 184px !important;
    max-width: 184px !important;
    min-height: 58px !important;
    flex: 0 0 184px;
    margin: 0 !important;
    scroll-snap-align: start;
  }

  .civi-rooms-redesigned .civi-room-lane .rooms-empty-mini {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 8px 12px;
  }

  .civi-rooms-redesigned .civi-room-lane .rooms-empty-mini > :is(span, b, p) {
    margin: 0;
  }

  .civi-rooms-redesigned .civi-room-lane .rooms-empty-mini p,
  .civi-rooms-redesigned .civi-room-lane .rooms-empty-mini .main-action {
    display: none;
  }

  .civi-rooms-redesigned .civi-room-lane .add-room-bottom {
    width: auto !important;
    height: auto !important;
    min-height: 58px;
    align-self: stretch;
    margin: 10px !important;
    border-color: #9fcdbf !important;
    border-radius: 10px !important;
    background: linear-gradient(135deg, #eef8f5, #fff) !important;
    color: #126f60 !important;
    font-size: 10px !important;
  }

  .civi-rooms-redesigned .civi-room-columns {
    display: grid !important;
    width: 100%;
    height: 100% !important;
    min-height: 0 !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: auto minmax(0, 1fr);
    gap: 8px;
    padding: 0 8px 8px;
    overflow: hidden !important;
    background: #eef3f5 !important;
  }

  .civi-rooms-redesigned .civi-room-columns > .room-editor-head {
    position: static !important;
    grid-column: 1 / -1;
    min-height: 70px;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 12px !important;
    margin: 0 -8px;
    padding: 9px 14px !important;
  }

  .civi-rooms-redesigned .civi-room-columns .room-editor-actions {
    width: auto !important;
    flex-wrap: nowrap !important;
  }

  .civi-rooms-redesigned .civi-room-columns > .civi-room-step {
    width: auto !important;
    max-width: none !important;
    height: 100%;
    min-height: 0;
    margin: 0 !important;
    padding: 14px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
  }
}

@media (min-width: 901px) and (max-width: 1120px) {
  .civi-rooms-redesigned .civi-room-lane {
    grid-template-columns: 132px minmax(0, 1fr) 116px;
  }

  .civi-rooms-redesigned .civi-room-lane .large-room-list > button {
    width: 166px !important;
    min-width: 166px !important;
    max-width: 166px !important;
    flex-basis: 166px;
  }

  .civi-rooms-redesigned .civi-room-step {
    padding: 11px !important;
  }

  .civi-rooms-redesigned .civi-room-step .editor-section-title {
    top: -11px;
  }
}

@media (max-width: 900px) {
  .civi-rooms-redesigned .civi-room-workspace {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  .civi-rooms-redesigned .civi-room-lane {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    overflow: hidden !important;
  }

  .civi-rooms-redesigned .civi-room-lane > header {
    min-height: 60px;
  }

  .civi-rooms-redesigned .civi-room-lane .large-room-list {
    display: flex !important;
    min-width: 0;
    align-items: center;
    gap: 22px;
    padding: 10px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x proximity;
  }

  .civi-rooms-redesigned .civi-room-lane .large-room-list > button {
    width: 188px !important;
    min-width: 188px !important;
    max-width: 188px !important;
    flex: 0 0 188px;
    margin: 0 !important;
    scroll-snap-align: start;
  }

  .civi-rooms-redesigned .civi-room-lane .add-room-bottom {
    width: calc(100% - 20px) !important;
    margin: 0 10px 10px !important;
  }

  .civi-rooms-redesigned .civi-room-columns {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
  }

  .civi-rooms-redesigned .civi-room-columns > .room-editor-head {
    position: static !important;
  }

  .civi-rooms-redesigned .civi-room-columns > .civi-room-step {
    width: calc(100% - 16px) !important;
    max-width: calc(100% - 16px) !important;
    height: auto;
    max-height: none;
    margin: 8px !important;
    overflow: visible !important;
  }

  .civi-rooms-redesigned .civi-room-step .editor-section-title {
    position: static;
  }
}

@media (max-width: 560px) {
  .civi-rooms-redesigned .unit-strip {
    align-items: stretch !important;
  }

  .civi-rooms-redesigned .unit-strip > span:first-child {
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid #dbe5e9;
    padding-bottom: 7px;
  }

  .civi-rooms-redesigned .unit-strip .unit-tab {
    min-width: 142px;
  }

  .civi-rooms-redesigned .civi-room-step-1 .dimension-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .civi-rooms-redesigned .civi-room-step-3 .compact-work-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .civi-rooms-redesigned .civi-room-step-3 .compact-work-row > strong,
  .civi-rooms-redesigned .civi-room-step-3 .compact-work-actions {
    grid-column: 1 / -1;
  }
}

/* Estancias 2026.4: tercera fila estable, vacíos limpios y partidas a ancho completo. */
.civi-rooms-redesigned .civi-room-lane {
  display: grid !important;
  grid-template-columns: var(--civi-structure-label-width) minmax(0, 1fr) var(--civi-structure-create-width) !important;
  gap: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.civi-rooms-redesigned .civi-room-lane > header {
  width: 100% !important;
  min-width: 0 !important;
  height: 52px !important;
  padding: 5px 0 5px 8px !important;
}

.civi-rooms-redesigned .civi-room-lane .large-room-list {
  display: flex !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 52px !important;
  min-height: 52px !important;
  align-items: center !important;
  gap: 20px !important;
  padding: 6px 9px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
}

.civi-rooms-redesigned .civi-room-lane {
  flex-direction: row !important;
  justify-content: flex-start !important;
  align-content: center !important;
  position: static !important;
  top: auto !important;
}

.civi-rooms-redesigned .civi-room-lane > .civi-row-create {
  width: calc(100% - 10px) !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: 0 5px !important;
}

.civi-rooms-redesigned .civi-room-lane .rooms-empty-mini {
  display: flex !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 52px !important;
  min-height: 52px !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 6px 10px !important;
  overflow: hidden !important;
}

.civi-rooms-redesigned .civi-room-lane .rooms-empty-mini > span {
  display: grid !important;
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  place-items: center !important;
  border-radius: 8px !important;
}

.civi-rooms-redesigned .civi-room-lane .rooms-empty-mini > b {
  overflow: hidden;
  font-size: 10px !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.civi-rooms-redesigned .civi-room-columns > .civi-room-step-3 {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  justify-self: stretch !important;
}

.civi-rooms-redesigned .civi-room-step-3 .compact-works-table {
  width: 100% !important;
  max-width: 100% !important;
}

.civi-rooms-redesigned .civi-room-step-3 .compact-work-head,
.civi-rooms-redesigned .civi-room-step-3 .compact-work-row {
  width: max(100%, 562px) !important;
  max-width: none !important;
}

.builder-topbar > div:last-of-type {
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.builder-topbar .civi-share-trigger {
  display: inline-flex !important;
  min-width: max-content;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .civi-rooms-redesigned .civi-room-lane {
    display: grid !important;
    grid-template-columns: var(--civi-structure-label-width) minmax(0, 1fr) var(--civi-structure-create-width) !important;
  }
}

@media (max-width: 680px) {
  .builder-topbar > div:last-of-type .civi-share-trigger {
    display: inline-flex !important;
  }
}

/* Estancias 2026.3: filas compactas desplazables, 3 pestañas y mediciones lineales. */
.civi-rooms-redesigned {
  --civi-structure-row-height: 54px;
  --civi-structure-label-width: 150px;
  --civi-structure-create-width: 132px;
}

.civi-rooms-redesigned > .floor-tabs,
.civi-rooms-redesigned > .unit-strip,
.civi-rooms-redesigned .civi-room-lane {
  height: var(--civi-structure-row-height) !important;
  min-height: var(--civi-structure-row-height) !important;
  max-height: var(--civi-structure-row-height) !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scrollbar-width: thin;
  overscroll-behavior-inline: contain;
}

.civi-rooms-redesigned .civi-structure-row-label {
  width: var(--civi-structure-label-width) !important;
  min-width: var(--civi-structure-label-width) !important;
  height: 42px !important;
  grid-template-columns: 30px minmax(0, 1fr) !important;
  gap: 8px !important;
  padding-left: 2px !important;
}

.civi-rooms-redesigned .civi-structure-row-label > i {
  width: 30px !important;
  height: 30px !important;
  font-size: 13px !important;
}

.civi-rooms-redesigned > .floor-tabs > button,
.civi-rooms-redesigned > .unit-strip > button,
.civi-rooms-redesigned .large-room-list > button,
.civi-rooms-redesigned .civi-row-create {
  height: 40px !important;
  min-height: 40px !important;
  max-height: 40px !important;
  flex-shrink: 0 !important;
}

.civi-rooms-redesigned .civi-row-create {
  width: var(--civi-structure-create-width) !important;
  min-width: var(--civi-structure-create-width) !important;
  max-width: var(--civi-structure-create-width) !important;
  flex: 0 0 var(--civi-structure-create-width) !important;
  margin: 0 0 0 auto !important;
  font-size: 10px !important;
}

.civi-rooms-redesigned .civi-row-create::after {
  content: none !important;
  display: none !important;
}

.civi-rooms-redesigned > .floor-tabs > button:not(.civi-row-create),
.civi-rooms-redesigned > .unit-strip > button:not(.civi-row-create) {
  flex: 0 0 auto !important;
}

.civi-rooms-redesigned .civi-room-workspace {
  grid-template-rows: var(--civi-structure-row-height) minmax(0, 1fr) !important;
}

.civi-rooms-redesigned .civi-room-lane {
  display: flex !important;
  align-items: center !important;
  gap: 7px !important;
  padding: 0 8px !important;
}

.civi-rooms-redesigned .civi-room-lane > header {
  width: var(--civi-structure-label-width) !important;
  min-width: var(--civi-structure-label-width) !important;
  height: 52px !important;
  flex: 0 0 var(--civi-structure-label-width) !important;
  padding: 5px 0 !important;
}

.civi-rooms-redesigned .civi-room-lane > header .civi-room-nav-label {
  width: 100% !important;
  height: 42px !important;
}

.civi-rooms-redesigned .civi-room-lane .large-room-list {
  display: contents !important;
}

.civi-rooms-redesigned .civi-room-lane .large-room-list > button {
  width: 170px !important;
  min-width: 170px !important;
  max-width: 170px !important;
  flex: 0 0 170px !important;
}

.civi-rooms-redesigned .civi-room-lane > .civi-row-create {
  width: var(--civi-structure-create-width) !important;
  min-width: var(--civi-structure-create-width) !important;
  max-width: var(--civi-structure-create-width) !important;
  flex: 0 0 var(--civi-structure-create-width) !important;
  margin: 0 0 0 auto !important;
}

.civi-rooms-redesigned .civi-room-lane > header > button,
.civi-rooms-redesigned .civi-room-lane .rooms-empty-mini .main-action {
  display: none !important;
}

.civi-rooms-redesigned .civi-room-lane .rooms-empty-mini {
  display: flex !important;
  min-width: 220px;
  height: 40px;
  flex: 1 0 220px;
  align-items: center;
  gap: 8px;
  padding: 0 8px !important;
  overflow: hidden;
}

.civi-rooms-redesigned .civi-room-lane .rooms-empty-mini > :is(p, .main-action) {
  display: none !important;
}

.civi-room-work-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.civi-room-work-tab {
  min-height: 42px;
  grid-template-columns: 27px minmax(0, 1fr);
  gap: 6px;
  padding-inline: 6px;
}

.civi-room-work-tab > span {
  width: 27px;
  height: 27px;
}

.civi-room-work-tab > b {
  font-size: 10px;
}

.civi-rooms-redesigned:not(.civi-room-work-mode-templates) .civi-room-step-2 .room-template-panel {
  display: none !important;
}

.civi-rooms-redesigned.civi-room-work-mode-templates .civi-room-step-2 .action-card-grid {
  display: none !important;
}

.civi-rooms-redesigned.civi-room-work-mode-templates .civi-room-step-2 .room-template-panel {
  display: block !important;
  margin-top: 0 !important;
}

.civi-rooms-redesigned .civi-room-step-4 {
  border-top-color: #15536a !important;
}

/* Partida arriba; desde UDS. hasta eliminar, una sola fila completa. */
.civi-rooms-redesigned .civi-room-step-3 .compact-works-table {
  width: 100% !important;
  min-width: 0 !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  contain: inline-size;
}

.civi-rooms-redesigned .civi-room-step-3 .compact-work-head,
.civi-rooms-redesigned .civi-room-step-3 .compact-work-row {
  display: grid !important;
  min-width: 562px !important;
  grid-template-columns: 54px 58px 58px 58px 54px 68px 64px 76px 32px !important;
  gap: 5px !important;
  align-items: center !important;
}

.civi-rooms-redesigned .civi-room-step-3 .compact-work-head {
  padding: 7px 8px !important;
}

.civi-rooms-redesigned .civi-room-step-3 .compact-work-head > span:first-child,
.civi-rooms-redesigned .civi-room-step-3 .compact-work-info,
.civi-rooms-redesigned .civi-room-step-3 .compact-line-label {
  grid-column: 1 / -1 !important;
  min-width: 0 !important;
}

.civi-rooms-redesigned .civi-room-step-3 .compact-work-head > span:first-child {
  padding: 0 2px 5px;
  text-align: left !important;
}

.civi-rooms-redesigned .civi-room-step-3 .compact-work-head > span:nth-child(n+2) {
  text-align: center !important;
}

.civi-rooms-redesigned .civi-room-step-3 .compact-work-row {
  min-height: 0 !important;
  padding: 8px !important;
  background: #fff !important;
}

.civi-rooms-redesigned .civi-room-step-3 .compact-work-row.extra {
  min-height: 0 !important;
  background: #f9fbfc !important;
}

.civi-rooms-redesigned .civi-room-step-3 .compact-work-info,
.civi-rooms-redesigned .civi-room-step-3 .compact-line-label {
  padding: 0 2px 7px !important;
}

.civi-rooms-redesigned .civi-room-step-3 .compact-work-row > label {
  display: block !important;
  min-width: 0 !important;
}

.civi-rooms-redesigned .civi-room-step-3 .compact-work-row > label::before {
  content: none !important;
  display: none !important;
}

.civi-rooms-redesigned .civi-room-step-3 .compact-work-row > label input,
.civi-rooms-redesigned .civi-room-step-3 .compact-work-row > label select {
  width: 100% !important;
  height: 30px !important;
  padding-inline: 3px !important;
  font-size: 9px !important;
}

.civi-rooms-redesigned .civi-room-step-3 .compact-work-row > strong {
  display: grid !important;
  min-height: 30px !important;
  grid-column: auto !important;
  place-items: center;
  border-radius: 7px;
  background: #edf4f6;
  font-size: 10px !important;
}

.civi-rooms-redesigned .civi-room-step-3 .compact-work-actions {
  display: flex !important;
  grid-column: auto !important;
  align-items: center !important;
  justify-content: center !important;
}

.civi-rooms-redesigned .civi-room-step-3 .compact-work-actions button {
  width: 30px !important;
  height: 30px !important;
}

@media (max-width: 900px) {
  .civi-rooms-redesigned {
    --civi-structure-label-width: 132px;
    --civi-structure-create-width: 124px;
  }

  .civi-rooms-redesigned .civi-room-lane {
    display: flex !important;
  }

  .civi-rooms-redesigned .civi-room-lane .large-room-list {
    display: contents !important;
  }

  .civi-rooms-redesigned .civi-room-lane > .civi-row-create {
    width: var(--civi-structure-create-width) !important;
    min-width: var(--civi-structure-create-width) !important;
    max-width: var(--civi-structure-create-width) !important;
    margin: 0 0 0 auto !important;
  }

  .civi-room-work-tabs {
    overflow-x: auto;
  }

  .civi-room-work-tab {
    min-width: 104px;
  }
}

/* Estancias 2026.2: tres filas gemelas y espacio de trabajo en dos columnas. */
.civi-rooms-redesigned {
  --civi-structure-row-height: 64px;
  --civi-structure-label-width: 154px;
  --civi-structure-create-width: 136px;
}

.civi-rooms-redesigned > .floor-tabs,
.civi-rooms-redesigned > .unit-strip,
.civi-rooms-redesigned .civi-room-lane {
  width: 100% !important;
  height: var(--civi-structure-row-height) !important;
  min-height: var(--civi-structure-row-height) !important;
  max-height: var(--civi-structure-row-height) !important;
  border: 1px solid #d9e4e9 !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, .94) !important;
  box-shadow: 0 6px 18px rgba(16, 44, 67, .04) !important;
}

.civi-rooms-redesigned > .floor-tabs,
.civi-rooms-redesigned > .unit-strip {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 7px !important;
  padding: 6px 8px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scrollbar-width: thin;
}

.civi-rooms-redesigned .civi-room-workspace {
  grid-template-rows: var(--civi-structure-row-height) minmax(0, 1fr) !important;
}

.civi-rooms-redesigned .civi-structure-row-label {
  display: grid !important;
  width: var(--civi-structure-label-width) !important;
  min-width: var(--civi-structure-label-width) !important;
  height: 50px !important;
  grid-template-columns: 34px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 9px !important;
  margin: 0 4px 0 0 !important;
  padding: 0 12px 0 3px !important;
  border-right: 1px solid #dbe5e9 !important;
  border-bottom: 0 !important;
  color: var(--civi-premium-ink) !important;
}

.civi-rooms-redesigned .civi-structure-row-label > i {
  display: grid !important;
  width: 34px !important;
  height: 34px !important;
  place-items: center !important;
  border-radius: 9px !important;
  background: var(--civi-premium-navy) !important;
  color: #fff !important;
  font-size: 14px !important;
}

.civi-rooms-redesigned .civi-structure-row-label > div {
  min-width: 0;
  overflow: hidden;
}

.civi-rooms-redesigned .civi-structure-row-label :is(small, b) {
  display: block !important;
  max-width: 100%;
  overflow: hidden;
  color: var(--civi-premium-ink) !important;
  line-height: 1.15 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.civi-rooms-redesigned .civi-structure-row-label small {
  color: #7c8e9a !important;
  font-size: 7px !important;
  font-weight: 900 !important;
  letter-spacing: .09em !important;
}

.civi-rooms-redesigned .civi-structure-row-label b {
  margin-top: 3px !important;
  font-size: 11px !important;
  font-weight: 850 !important;
}

.civi-rooms-redesigned .civi-original-unit-label,
.civi-rooms-redesigned .civi-room-lane > header > div:not(.civi-room-nav-label),
.civi-rooms-redesigned .civi-room-lane > header > button {
  display: none !important;
}

.civi-rooms-redesigned > .floor-tabs > button,
.civi-rooms-redesigned > .unit-strip > button,
.civi-rooms-redesigned .large-room-list > button,
.civi-rooms-redesigned .civi-row-create {
  height: 48px !important;
  min-height: 48px !important;
  max-height: 48px !important;
  border-radius: 9px !important;
  font-size: 11px !important;
}

.civi-rooms-redesigned .civi-row-create {
  display: inline-flex !important;
  width: var(--civi-structure-create-width) !important;
  min-width: var(--civi-structure-create-width) !important;
  max-width: var(--civi-structure-create-width) !important;
  flex: 0 0 var(--civi-structure-create-width) !important;
  align-items: center !important;
  justify-content: center !important;
  align-self: center !important;
  margin: 0 0 0 auto !important;
  padding: 0 10px !important;
  border: 1px solid #9fcdbf !important;
  background: linear-gradient(135deg, #eef8f5, #fff) !important;
  color: #126f60 !important;
  font-size: 0 !important;
  font-weight: 850 !important;
  white-space: nowrap;
}

.civi-rooms-redesigned .civi-row-create::after {
  content: attr(data-civi-create-label);
  font-size: 10px;
}

.civi-rooms-redesigned > .unit-strip {
  border-left: 1px solid #d9e4e9 !important;
}

.civi-rooms-redesigned > .unit-strip .unit-single-note {
  min-width: 190px;
  overflow: hidden;
  font-size: 11px !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.civi-rooms-redesigned .civi-room-workspace {
  grid-template-rows: var(--civi-structure-row-height) minmax(0, 1fr) !important;
}

.civi-rooms-redesigned .civi-room-lane {
  display: grid !important;
  position: static !important;
  top: auto !important;
  grid-template-columns: var(--civi-structure-label-width) minmax(0, 1fr) var(--civi-structure-create-width) !important;
  align-items: center !important;
  overflow: hidden !important;
}

.civi-rooms-redesigned .civi-room-lane > header {
  display: flex !important;
  position: static !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  align-items: center !important;
  margin: 0 !important;
  padding: 6px 0 6px 8px !important;
  border: 0 !important;
  background: transparent !important;
}

.civi-rooms-redesigned .civi-room-lane > header .civi-room-nav-label {
  width: 100% !important;
  min-width: 0 !important;
  height: 50px !important;
}

.civi-rooms-redesigned .civi-room-lane .large-room-list {
  display: flex !important;
  min-width: 0 !important;
  height: 62px !important;
  min-height: 62px !important;
  align-items: center !important;
  gap: 20px !important;
  padding: 7px 10px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
}

.civi-rooms-redesigned .civi-room-lane .large-room-list > button {
  width: 176px !important;
  min-width: 176px !important;
  max-width: 176px !important;
  flex: 0 0 176px !important;
  margin: 0 !important;
}

.civi-rooms-redesigned .civi-room-lane > .civi-row-create {
  width: calc(100% - 12px) !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: 0 6px !important;
}

.civi-room-work-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
  padding: 6px;
  border: 1px solid #d9e4e9;
  border-radius: 12px;
  background: #fff;
}

.civi-room-work-tab {
  display: grid;
  min-width: 0;
  min-height: 42px;
  grid-template-columns: 29px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: #f3f7f8;
  color: #667c8b;
  text-align: left;
  cursor: pointer;
}

.civi-room-work-tab > span {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 8px;
  background: #dfe8eb;
  color: #4e6573;
  font-size: 11px;
  font-weight: 900;
}

.civi-room-work-tab > b {
  overflow: hidden;
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
}

.civi-room-work-tab.active {
  border-color: rgba(65, 204, 176, .42) !important;
  background: linear-gradient(135deg, #0f314b, #15536a) !important;
  color: #fff !important;
  box-shadow: inset 4px 0 var(--civi-premium-mint) !important;
}

.civi-room-work-tab.active > span {
  background: rgba(65, 204, 176, .17);
  color: #74e0ca;
}

.civi-room-tab-hidden {
  display: none !important;
}

.civi-rooms-redesigned .civi-room-step-1 > .editor-section-title,
.civi-rooms-redesigned .civi-room-step-2 > .editor-section-title {
  display: none !important;
}

@media (min-width: 901px) {
  .civi-rooms-redesigned .civi-room-columns {
    grid-template-columns: minmax(340px, .92fr) minmax(0, 1.28fr) !important;
    grid-template-rows: auto 56px minmax(0, 1fr) !important;
  }

  .civi-rooms-redesigned .civi-room-columns > .room-editor-head {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
  }

  .civi-rooms-redesigned .civi-room-work-tabs {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }

  .civi-rooms-redesigned .civi-room-columns > .civi-room-step-1,
  .civi-rooms-redesigned .civi-room-columns > .civi-room-step-2 {
    grid-column: 1 !important;
    grid-row: 3 !important;
    border-top: 0 !important;
  }

  .civi-rooms-redesigned .civi-room-columns > .civi-room-step-3 {
    grid-column: 2 !important;
    grid-row: 2 / 4 !important;
  }
}

@media (max-width: 900px) {
  .civi-rooms-redesigned {
    --civi-structure-label-width: 132px;
    --civi-structure-create-width: 126px;
  }

  .civi-rooms-redesigned .civi-floor-nav-label {
    display: grid !important;
  }

  .civi-rooms-redesigned .civi-room-lane {
    grid-template-columns: var(--civi-structure-label-width) minmax(0, 1fr) var(--civi-structure-create-width) !important;
  }

  .civi-rooms-redesigned .civi-room-lane .large-room-list {
    height: 62px !important;
    min-height: 62px !important;
    padding: 7px 8px !important;
  }

  .civi-rooms-redesigned .civi-room-lane .large-room-list > button {
    width: 172px !important;
    min-width: 172px !important;
    max-width: 172px !important;
    flex-basis: 172px !important;
  }

  .civi-rooms-redesigned .civi-room-lane .add-room-bottom {
    width: calc(100% - 10px) !important;
    min-width: 0 !important;
    margin: 0 5px !important;
  }

  .civi-rooms-redesigned .civi-room-columns {
    display: block !important;
  }

  .civi-rooms-redesigned .civi-room-work-tabs {
    margin: 8px !important;
  }

  .civi-rooms-redesigned .civi-room-columns > .civi-room-step-1,
  .civi-rooms-redesigned .civi-room-columns > .civi-room-step-2,
  .civi-rooms-redesigned .civi-room-columns > .civi-room-step-3 {
    width: calc(100% - 16px) !important;
    max-width: calc(100% - 16px) !important;
    margin: 8px !important;
  }
}

@media (max-width: 560px) {
  .civi-rooms-redesigned > .unit-strip {
    align-items: center !important;
  }

  .civi-rooms-redesigned > .unit-strip > .civi-unit-nav-label {
    width: var(--civi-structure-label-width) !important;
    min-width: var(--civi-structure-label-width) !important;
    padding-bottom: 0 !important;
    border-right: 1px solid #dbe5e9 !important;
    border-bottom: 0 !important;
  }

  .civi-room-work-tab {
    grid-template-columns: 27px minmax(0, 1fr);
    padding-inline: 6px;
  }

  .civi-room-work-tab > b {
    font-size: 10px;
  }
}

/* Ajuste final de precedencia: conserva la altura de Plantas en las tres filas. */
.civi-rooms-redesigned {
  --civi-structure-row-height: 54px;
  --civi-structure-label-width: 150px;
  --civi-structure-create-width: 132px;
}

.civi-rooms-redesigned > .floor-tabs,
.civi-rooms-redesigned > .unit-strip,
.civi-rooms-redesigned .civi-room-lane {
  height: 54px !important;
  min-height: 54px !important;
  max-height: 54px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
}

.civi-rooms-redesigned .civi-structure-row-label {
  height: 42px !important;
  grid-template-columns: 30px minmax(0, 1fr) !important;
}

.civi-rooms-redesigned .civi-structure-row-label > i {
  width: 30px !important;
  height: 30px !important;
}

.civi-rooms-redesigned > .floor-tabs > button,
.civi-rooms-redesigned > .unit-strip > button,
.civi-rooms-redesigned .large-room-list > button,
.civi-rooms-redesigned .civi-row-create {
  height: 40px !important;
  min-height: 40px !important;
  max-height: 40px !important;
}

.civi-rooms-redesigned .civi-row-create {
  width: var(--civi-structure-create-width) !important;
  min-width: var(--civi-structure-create-width) !important;
  max-width: var(--civi-structure-create-width) !important;
  flex: 0 0 var(--civi-structure-create-width) !important;
  font-size: 10px !important;
}

.civi-rooms-redesigned .civi-row-create::after {
  content: none !important;
  display: none !important;
}

.civi-rooms-redesigned .civi-room-workspace {
  grid-template-rows: 54px minmax(0, 1fr) !important;
}

.civi-rooms-redesigned .civi-room-lane {
  display: flex !important;
  align-items: center !important;
  gap: 7px !important;
  padding: 0 8px !important;
}

.civi-rooms-redesigned .civi-room-lane > header {
  width: var(--civi-structure-label-width) !important;
  min-width: var(--civi-structure-label-width) !important;
  height: 52px !important;
  flex: 0 0 var(--civi-structure-label-width) !important;
  padding: 5px 0 !important;
}

.civi-rooms-redesigned .civi-room-lane > header .civi-room-nav-label {
  height: 42px !important;
}

.civi-rooms-redesigned .civi-room-lane .large-room-list {
  display: contents !important;
}

.civi-rooms-redesigned .civi-room-lane .large-room-list > button {
  width: 170px !important;
  min-width: 170px !important;
  max-width: 170px !important;
  flex: 0 0 170px !important;
}

.civi-rooms-redesigned .civi-room-lane > .civi-row-create {
  width: var(--civi-structure-create-width) !important;
  min-width: var(--civi-structure-create-width) !important;
  max-width: var(--civi-structure-create-width) !important;
  margin: 0 0 0 auto !important;
}

.civi-room-work-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

@media (max-width: 900px) {
  .civi-rooms-redesigned {
    --civi-structure-label-width: 132px;
    --civi-structure-create-width: 124px;
  }

  .civi-rooms-redesigned .civi-room-lane {
    display: flex !important;
    grid-template-columns: none !important;
  }

  .civi-rooms-redesigned .civi-room-lane .large-room-list {
    display: contents !important;
  }

  .civi-rooms-redesigned .civi-room-lane > .civi-row-create {
    width: var(--civi-structure-create-width) !important;
    min-width: var(--civi-structure-create-width) !important;
    max-width: var(--civi-structure-create-width) !important;
    margin: 0 0 0 auto !important;
  }

  .civi-room-work-tabs {
    grid-template-columns: repeat(3, minmax(104px, 1fr)) !important;
    overflow-x: auto;
  }
}

@media (max-width: 560px) {
  .civi-rooms-redesigned .civi-room-step-3 .compact-work-row,
  .civi-rooms-redesigned .civi-room-step-3 .compact-work-head {
    min-width: 562px !important;
    grid-template-columns: 54px 58px 58px 58px 54px 68px 64px 76px 32px !important;
  }

  .civi-rooms-redesigned .civi-room-step-3 .compact-work-row > strong,
  .civi-rooms-redesigned .civi-room-step-3 .compact-work-actions {
    grid-column: auto !important;
  }
}

/* Estancias 2026.7: definición única, sin estados heredados ni bloques duplicados. */
.builder-workspace {
  min-height: 100dvh !important;
}

.builder-topbar {
  position: sticky !important;
  top: 0 !important;
  z-index: 1200 !important;
  flex: 0 0 auto !important;
}

/* La cabecera sigue fija al desplazarse, pero nunca tapa los diálogos. */
.modal-layer {
  z-index: 2000 !important;
}

.builder-topbar > div:last-of-type {
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.builder-topbar .civi-native-share-trigger,
.builder-topbar .civi-insight-trigger {
  display: inline-flex !important;
  min-width: max-content;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.civi-rooms-redesigned {
  --civi-structure-row-height: 48px;
  --civi-structure-label-width: 150px;
  --civi-structure-create-width: 132px;
}

.civi-rooms-redesigned > .floor-tabs,
.civi-rooms-redesigned > .unit-strip,
.civi-rooms-redesigned .civi-room-lane {
  display: flex !important;
  width: 100% !important;
  max-width: 100% !important;
  height: var(--civi-structure-row-height) !important;
  min-height: var(--civi-structure-row-height) !important;
  max-height: var(--civi-structure-row-height) !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 7px !important;
  padding: 4px 8px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scrollbar-width: thin;
}

.civi-rooms-redesigned .civi-structure-row-label,
.civi-rooms-redesigned .civi-room-lane > header,
.civi-rooms-redesigned .civi-room-lane > header .civi-room-nav-label {
  width: var(--civi-structure-label-width) !important;
  min-width: var(--civi-structure-label-width) !important;
  max-width: var(--civi-structure-label-width) !important;
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  flex: 0 0 var(--civi-structure-label-width) !important;
}

.civi-rooms-redesigned .civi-structure-row-label {
  grid-template-columns: 28px minmax(0, 1fr) !important;
}

.civi-rooms-redesigned .civi-structure-row-label > i {
  width: 28px !important;
  height: 28px !important;
}

.civi-rooms-redesigned .civi-room-lane > header {
  display: flex !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.civi-rooms-redesigned .civi-room-lane .large-room-list {
  display: contents !important;
}

.civi-rooms-redesigned > .floor-tabs > button,
.civi-rooms-redesigned > .unit-strip > button,
.civi-rooms-redesigned .large-room-list > button,
.civi-rooms-redesigned .civi-row-create {
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  flex: 0 0 auto !important;
}

.civi-rooms-redesigned .large-room-list > button {
  display: grid !important;
  width: 170px !important;
  min-width: 170px !important;
  max-width: 170px !important;
  grid-template-columns: 30px minmax(0, 1fr) 12px !important;
  gap: 8px !important;
  overflow: hidden !important;
  padding: 4px 8px !important;
}

.civi-rooms-redesigned .large-room-list > button > :is(div, span) {
  min-width: 0 !important;
}

.civi-rooms-redesigned .large-room-list > button :is(b, small, em, p) {
  display: block !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.civi-rooms-redesigned .civi-row-create {
  width: var(--civi-structure-create-width) !important;
  min-width: var(--civi-structure-create-width) !important;
  max-width: var(--civi-structure-create-width) !important;
  flex-basis: var(--civi-structure-create-width) !important;
  margin-left: auto !important;
}

.civi-rooms-redesigned .rooms-empty-mini {
  display: flex !important;
  width: auto !important;
  min-width: 190px !important;
  height: 36px !important;
  min-height: 36px !important;
  flex: 1 0 190px !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 0 12px !important;
  overflow: hidden !important;
  white-space: nowrap !important;
}

.civi-rooms-redesigned .rooms-empty-mini > :is(p, .main-action) {
  display: none !important;
}

.civi-rooms-redesigned .rooms-empty-mini > :is(span, b) {
  flex: 0 0 auto !important;
  margin: 0 !important;
}

.civi-rooms-redesigned .civi-room-lane > .civi-row-create {
  width: var(--civi-structure-create-width) !important;
  min-width: var(--civi-structure-create-width) !important;
  max-width: var(--civi-structure-create-width) !important;
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  flex: 0 0 var(--civi-structure-create-width) !important;
  margin: 0 0 0 auto !important;
}

.civi-rooms-redesigned .civi-room-columns.civi-room-is-empty {
  display: grid !important;
  min-height: 0 !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
  place-items: center !important;
  overflow: hidden !important;
}

.civi-rooms-redesigned .civi-room-columns.civi-room-is-empty > .room-empty-main {
  width: min(560px, calc(100% - 40px)) !important;
  max-width: 560px !important;
  min-height: 0 !important;
  grid-column: 1 !important;
  grid-row: 1 !important;
  align-self: center !important;
  justify-self: center !important;
  margin: auto !important;
  padding: clamp(24px, 4vw, 48px) !important;
  text-align: center !important;
}

/* Estados explícitos: el ratón nunca cambia un elemento seleccionado. */
.civi-rooms-redesigned .floor-tabs > button:not(.civi-row-create):not(.active),
.civi-rooms-redesigned .floor-tabs > button:not(.civi-row-create):not(.active):hover,
.civi-rooms-redesigned .unit-strip > button.unit-tab:not(.active),
.civi-rooms-redesigned .unit-strip > button.unit-tab:not(.active):hover,
.civi-rooms-redesigned .large-room-list > button:not(.active),
.civi-rooms-redesigned .large-room-list > button:not(.active):hover {
  border: 1px solid transparent !important;
  background: #fff !important;
  color: #5f7483 !important;
  box-shadow: none !important;
  transform: none !important;
  transition: none !important;
}

.civi-rooms-redesigned .unit-strip > button.unit-tab:not(.active) b,
.civi-rooms-redesigned .unit-strip > button.unit-tab:not(.active):hover b,
.civi-rooms-redesigned .large-room-list > button:not(.active) b,
.civi-rooms-redesigned .large-room-list > button:not(.active):hover b {
  color: #19364f !important;
}

.civi-rooms-redesigned .unit-strip > button.unit-tab:not(.active) :is(small, em, p),
.civi-rooms-redesigned .unit-strip > button.unit-tab:not(.active):hover :is(small, em, p),
.civi-rooms-redesigned .large-room-list > button:not(.active) :is(small, em, p),
.civi-rooms-redesigned .large-room-list > button:not(.active):hover :is(small, em, p) {
  color: #718594 !important;
}

body .rooms-page.civi-rooms-redesigned .floor-tabs > button.active,
body .rooms-page.civi-rooms-redesigned .floor-tabs > button.active:hover,
body .rooms-page.civi-rooms-redesigned .unit-strip > button.unit-tab.active,
body .rooms-page.civi-rooms-redesigned .unit-strip > button.unit-tab.active:hover,
body .rooms-page.civi-rooms-redesigned .large-room-list > button.active,
body .rooms-page.civi-rooms-redesigned .large-room-list > button.active:hover,
body .rooms-page.civi-rooms-redesigned .large-room-list > button.active.room-selected,
body .rooms-page.civi-rooms-redesigned .large-room-list > button.active.room-selected:hover {
  border: 1px solid rgba(65, 204, 176, .42) !important;
  background: linear-gradient(135deg, #0f314b, #15536a) !important;
  color: #fff !important;
  box-shadow: inset 4px 0 var(--civi-premium-mint) !important;
  transform: none !important;
  filter: none !important;
  opacity: 1 !important;
  transition: none !important;
}

body .rooms-page.civi-rooms-redesigned :is(
  .floor-tabs > button.active,
  .floor-tabs > button.active:hover,
  .unit-strip > button.unit-tab.active,
  .unit-strip > button.unit-tab.active:hover,
  .large-room-list > button.active,
  .large-room-list > button.active:hover
) :is(b, strong, i) {
  color: #fff !important;
}

body .rooms-page.civi-rooms-redesigned :is(
  .unit-strip > button.unit-tab.active,
  .unit-strip > button.unit-tab.active:hover,
  .large-room-list > button.active,
  .large-room-list > button.active:hover
) :is(small, em, p) {
  color: #c7dce5 !important;
}

.civi-rooms-redesigned .civi-room-columns > .civi-room-step-4,
.civi-rooms-redesigned .civi-room-step-4 .compact-works-table {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

.civi-rooms-redesigned .civi-room-step-4 .compact-works-table {
  overflow-x: hidden !important;
  overflow-y: visible !important;
}

.civi-rooms-redesigned .civi-room-step-4 .compact-work-head,
.civi-rooms-redesigned .civi-room-step-4 .compact-work-row {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  grid-template-columns:
    minmax(0, .6fr)
    repeat(3, minmax(0, .68fr))
    minmax(0, .66fr)
    minmax(0, .86fr)
    minmax(0, .84fr)
    minmax(0, 1fr)
    minmax(94px, 1.25fr) !important;
  gap: 4px !important;
}

.civi-rooms-redesigned .civi-room-step-4 .compact-work-actions {
  display: grid !important;
  width: 100% !important;
  min-width: 0 !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 2px !important;
}

.civi-rooms-redesigned .civi-room-step-4 .compact-work-actions button {
  width: 100% !important;
  min-width: 0 !important;
  height: 28px !important;
  padding: 0 !important;
}

@media (min-width: 901px) {
  .civi-rooms-redesigned .civi-room-columns {
    min-height: 0 !important;
    overflow: hidden !important;
  }

  .civi-rooms-redesigned .civi-room-columns > .civi-room-step-4 {
    grid-column: 2 !important;
    grid-row: 2 / 4 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    align-self: stretch !important;
    justify-self: stretch !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }
}

@media (max-width: 900px) {
  .civi-rooms-redesigned {
    --civi-structure-label-width: 132px;
    --civi-structure-create-width: 124px;
  }
}

@media (max-width: 680px) {
  .builder-topbar > div:last-of-type .plain-button.civi-native-share-trigger,
  .builder-topbar > div:last-of-type .plain-button.civi-insight-trigger {
    display: inline-flex !important;
  }

  .civi-rooms-redesigned .civi-room-columns.civi-room-is-empty > .room-empty-main {
    width: calc(100% - 20px) !important;
    padding: 26px 18px !important;
  }

  .civi-rooms-redesigned .civi-room-step-4 .compact-work-head {
    display: none !important;
  }

  .civi-rooms-redesigned .civi-room-step-4 .compact-work-row {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .civi-rooms-redesigned .civi-room-step-4 .compact-work-info,
  .civi-rooms-redesigned .civi-room-step-4 .compact-line-label,
  .civi-rooms-redesigned .civi-room-step-4 .compact-work-actions {
    grid-column: 1 / -1 !important;
  }

  .civi-rooms-redesigned .civi-room-step-4 .compact-work-row > label::before,
  .civi-rooms-redesigned .civi-room-step-4 .compact-work-row > strong::before {
    display: block !important;
    margin-bottom: 4px !important;
    color: #718594 !important;
    font-size: 8px !important;
    font-weight: 900 !important;
    letter-spacing: .05em !important;
  }

  .civi-rooms-redesigned .civi-room-step-4 .compact-work-row > label:nth-of-type(1)::before { content: "UDS." !important; }
  .civi-rooms-redesigned .civi-room-step-4 .compact-work-row > label:nth-of-type(2)::before { content: "LARGO" !important; }
  .civi-rooms-redesigned .civi-room-step-4 .compact-work-row > label:nth-of-type(3)::before { content: "ANCHO" !important; }
  .civi-rooms-redesigned .civi-room-step-4 .compact-work-row > label:nth-of-type(4)::before { content: "ALTO" !important; }
  .civi-rooms-redesigned .civi-room-step-4 .compact-work-row > label:nth-of-type(5)::before { content: "TIPO" !important; }
  .civi-rooms-redesigned .civi-room-step-4 .compact-work-row > label:nth-of-type(6)::before { content: "MEDICIÓN" !important; }
  .civi-rooms-redesigned .civi-room-step-4 .compact-work-row > label:nth-of-type(7)::before { content: "PRECIO" !important; }
  .civi-rooms-redesigned .civi-room-step-4 .compact-work-row > strong::before { content: "IMPORTE" !important; }
}

/* Ajuste final de Estancias: filas estructurales y partidas sin desbordamiento. */
.civi-rooms-redesigned .civi-room-lane .large-room-list {
  display: flex !important;
  width: max-content !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 36px !important;
  min-height: 36px !important;
  flex: 0 0 auto !important;
  align-items: center !important;
  gap: 7px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
}

.civi-rooms-redesigned .civi-room-lane .large-room-list > button {
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
}

.civi-rooms-redesigned .civi-room-lane > .civi-row-create {
  margin-left: auto !important;
}

.civi-rooms-redesigned .civi-room-lane .rooms-empty-mini {
  display: none !important;
}

.civi-rooms-redesigned .civi-room-step-4 .compact-work-head {
  display: none !important;
}

.civi-rooms-redesigned .civi-room-step-4 .compact-work-row {
  display: grid !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  grid-template-columns:
    minmax(0, .62fr)
    repeat(3, minmax(0, .7fr))
    minmax(0, .72fr)
    minmax(0, .92fr)
    minmax(0, .88fr)
    minmax(0, 1.08fr)
    minmax(0, 1.2fr) !important;
  gap: 6px !important;
  overflow: hidden !important;
}

.civi-rooms-redesigned .civi-room-step-4 .compact-work-info,
.civi-rooms-redesigned .civi-room-step-4 .compact-line-label {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  min-width: 0 !important;
}

.civi-rooms-redesigned .civi-room-step-4 .compact-work-row > label,
.civi-rooms-redesigned .civi-room-step-4 .compact-work-row > strong,
.civi-rooms-redesigned .civi-room-step-4 .compact-work-actions {
  min-width: 0 !important;
  align-self: end !important;
}

.civi-rooms-redesigned .civi-room-step-4 .compact-work-row > label::before,
.civi-rooms-redesigned .civi-room-step-4 .compact-work-row > strong::before {
  display: block !important;
  min-height: 11px !important;
  margin: 0 0 4px !important;
  color: #718594 !important;
  font-size: 8px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  letter-spacing: .045em !important;
  white-space: nowrap !important;
}

.civi-rooms-redesigned .civi-room-step-4 .compact-work-row > label:nth-of-type(1)::before { content: "UDS." !important; }
.civi-rooms-redesigned .civi-room-step-4 .compact-work-row > label:nth-of-type(2)::before { content: "LARGO" !important; }
.civi-rooms-redesigned .civi-room-step-4 .compact-work-row > label:nth-of-type(3)::before { content: "ANCHO" !important; }
.civi-rooms-redesigned .civi-room-step-4 .compact-work-row > label:nth-of-type(4)::before { content: "ALTO" !important; }
.civi-rooms-redesigned .civi-room-step-4 .compact-work-row > label:nth-of-type(5)::before { content: "TIPO" !important; }
.civi-rooms-redesigned .civi-room-step-4 .compact-work-row > label:nth-of-type(6)::before { content: "MEDICIÓN" !important; }
.civi-rooms-redesigned .civi-room-step-4 .compact-work-row > label:nth-of-type(7)::before { content: "PRECIO" !important; }
.civi-rooms-redesigned .civi-room-step-4 .compact-work-row > strong::before { content: "IMPORTE" !important; }

.civi-rooms-redesigned .civi-room-step-4 .compact-work-row > label input,
.civi-rooms-redesigned .civi-room-step-4 .compact-work-row > label select {
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

.civi-rooms-redesigned .civi-room-step-4 .compact-work-row > strong {
  display: grid !important;
  grid-template-rows: 11px 30px !important;
  align-items: center !important;
  width: 100% !important;
}

.civi-rooms-redesigned .civi-room-step-4 .compact-work-actions {
  display: grid !important;
  width: 100% !important;
  height: 30px !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 2px !important;
}

.civi-rooms-redesigned .civi-room-step-4 .compact-work-actions button {
  width: 100% !important;
  min-width: 0 !important;
  height: 30px !important;
  padding: 0 !important;
}

@media (max-width: 680px) {
  .civi-rooms-redesigned .civi-room-step-4 .compact-work-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    overflow: visible !important;
  }

  .civi-rooms-redesigned .civi-room-step-4 .compact-work-info,
  .civi-rooms-redesigned .civi-room-step-4 .compact-line-label,
  .civi-rooms-redesigned .civi-room-step-4 .compact-work-actions {
    grid-column: 1 / -1 !important;
  }
}

/* Etiquetas de estancia: todo el contenido cabe en los 36 px de la fila. */
.civi-rooms-redesigned .civi-room-lane .large-room-list > button {
  grid-template-columns: 28px minmax(0, 1fr) 10px !important;
  gap: 6px !important;
  padding: 3px 7px !important;
  align-items: center !important;
}

.civi-rooms-redesigned .civi-room-lane .large-room-list > button > span {
  width: 28px !important;
  min-width: 28px !important;
  height: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
  font-size: 14px !important;
}

.civi-rooms-redesigned .civi-room-lane .large-room-list > button > div {
  display: grid !important;
  min-width: 0 !important;
  height: 26px !important;
  grid-template-rows: 13px 9px !important;
  align-content: center !important;
  gap: 1px !important;
  overflow: hidden !important;
}

.civi-rooms-redesigned .civi-room-lane .large-room-list > button b {
  margin: 0 !important;
  font-size: 11px !important;
  line-height: 13px !important;
}

.civi-rooms-redesigned .civi-room-lane .large-room-list > button small {
  margin: 0 !important;
  font-size: 8px !important;
  line-height: 9px !important;
}

.civi-rooms-redesigned .civi-room-lane .large-room-list > button em {
  font-size: 10px !important;
  line-height: 1 !important;
}
