/* 50-clone.css — Clone room units, shelves, domes
   Part of the ordered set linked from index.html. The parts concatenate to the
   original stylesheet byte for byte; link order IS the cascade order, so never
   reorder the <link> tags and never move a rule between files. */

#cloneRoomSection {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 18px;
  margin-bottom: 16px;
}

.cr-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.cr-title {
  font-size: 22px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.cr-subtitle {
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.cr-stats-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.cr-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  padding: 4px 10px;
  border: 1px solid var(--line);
  color: var(--muted);
}

.cr-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cr-badge.rooting, .cr-dot.rooting { color: var(--warn);   }
.cr-dot.rooting  { background: var(--warn); }
.cr-badge.rooted, .cr-dot.rooted   { color: var(--accent); }
.cr-dot.rooted   { background: var(--accent); }
.cr-badge.failed, .cr-dot.failed   { color: var(--bad);    }
.cr-dot.failed   { background: var(--bad); }
.cr-dot.empty    { background: #3a3a3a; }

/* Units side by side */
.cr-units {
  margin-bottom: 16px;
}

@media (max-width: 1180px) {
  .cr-units { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .cr-units { grid-template-columns: 1fr; }
}

.cr-unit {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.01);
  padding: 10px;
  flex-direction: column;
}

.cr-unit-label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

/* Shelf level */
.cr-level {
  flex-direction: column;
}

.cr-level-label {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cr-domes {
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

/* Individual dome card */
.cr-dome {
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: outline 0.1s, transform 0.1s;
  position: relative;
}

.cr-dome:hover {
  outline: 1px solid rgba(255,255,255,0.3);
  z-index: 1;
}

.cr-dome.sel {
  outline: 2px solid #fff;
  z-index: 2;
}

.cr-dome.empty {
  background: transparent !important;
}

.cr-dome.failed {
  opacity: 0.5;
}

.cr-dome.moved_to_veg,
.cr-dome.moved_to_mother {
  opacity: 0.35;
}

/* Destination badge: dome is headed for the Mother room */
.cr-dome-purpose {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 15px;
  height: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.5);
}

.cr-dome-num {
  font-size: 9px;
  font-weight: 700;
  color: rgba(255,255,255,0.4);
  position: absolute;
  top: 3px;
  left: 5px;
}

.cr-dome-strain {
  line-height: 1.2;
  max-width: 100%;
}

.cr-dome-count {
  color: rgba(0,0,0,0.7);
  line-height: 1;
}

.cr-dome-status {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 4px;
  border-radius: 2px;
}

/* Inside the dome tile the status is part of the map and keeps the size the
   tile was drawn for; the shared badge rule (80-redesign.css) is 14px. */
.cr-dome .cr-dome-status { font-size: 11px; }
.cr-dome-status.cutting      { background: rgba(0,0,0,0.2); color: rgba(255,255,255,0.8); }
.cr-dome-status.rooting      { background: rgba(228,180,93,0.4); color: #e4b45d; }
.cr-dome-status.rooted       { background: rgba(143,195,106,0.4); color: #8fc36a; }
.cr-dome-status.failed       { background: rgba(232,111,95,0.3); color: #e86f5f; }
.cr-dome-status.moved_to_veg { background: rgba(255,255,255,0.1); color: var(--muted); }
.cr-dome-status.moved_to_mother { background: rgba(255,255,255,0.1); color: var(--muted); }

.cr-dome-empty-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}

/* Detail panel */
.cr-detail {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 18px;
  min-height: 80px;
}

.cr-detail-hint {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

.cr-detail-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.cr-status-chip {
  display: inline-block;
  padding: 3px 8px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cr-status-chip.cutting      { background: rgba(255,255,255,0.08); color: var(--muted); }
.cr-status-chip.rooting      { background: rgba(228,180,93,0.15); color: var(--warn); }
.cr-status-chip.rooted       { background: rgba(143,195,106,0.15); color: var(--accent); }
.cr-status-chip.failed       { background: rgba(232,111,95,0.15); color: var(--bad); }
.cr-status-chip.moved_to_veg { background: rgba(255,255,255,0.05); color: var(--muted); }
.cr-status-chip.moved_to_mother { background: rgba(255,255,255,0.05); color: var(--muted); }

/* Destination toggle in the dome detail panel */
.cr-purpose-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 12px;
}

.cr-purpose-label {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.cr-purpose-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.cr-purpose-btn.active {
  background: var(--seg-active);
  color: var(--text);
  border-color: var(--line-strong);
}

.cr-purpose-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Domes / Mortality tabs at the top of the room */
.cr-room-tabs {
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin:14px 0 8px;
  padding:6px;
  border:1px solid var(--line);
  border-radius:16px;
  background:var(--panel);
  margin-bottom: 14px;
}

.cr-room-tab {
  display:inline-flex;
  flex:1 1 auto;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-height:52px;
  padding:8px 14px;
  border:0;
  border-radius:12px;
  background:transparent;
  color:var(--muted);
  cursor:pointer;
  font-size:1.02rem;
  font-weight:800;
  white-space:nowrap;
}

.cr-room-tab.active {
  background:rgba(52,212,106,.16);
  color:var(--text);
}

/* Mortality tab */
.cr-mortality-empty {
  color: var(--muted);
  font-size: 14px;
  margin-top: 8px;
}

.cr-mortality-wrap {
  overflow-x: auto;
}

.cr-mortality-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 8px;
}

.cr-mortality-table th {
  text-align: left;
  color: var(--muted);
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cr-mortality-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.cr-mortality-rate {
  font-weight: 700;
}

.cr-mortality-rate.high {
  color: var(--bad);
}


/* Mixed-strain shared dome */
.cr-dome-shared-divider {
  width: 80%;
  height: 1px;
  background: rgba(0,0,0,0.25);
  margin: 3px auto 2px;
}
.cr-dome-shared-strain {
  border-radius: 3px;
  padding: 1px 4px;
  margin-top: 1px;
  opacity: 0.92;
}
/* Detail panel: which batch in a shared dome the actions apply to */
.cr-tenant-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 10px;
}
.cr-tenant-btn {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,0.18);
  border-left: 6px solid var(--tenant, #666);
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-weight: 600;
  cursor: pointer;
}
.cr-tenant-btn.active {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.45);
  border-left-color: var(--tenant, #666);
}
