/* ——— Mapping Groups ——— */
.map-group {
  margin-top: 36px;
  background: white;
  border: 1px solid var(--chalk);
  border-radius: 6px;
  overflow: hidden;
  max-width: 900px;
}

.map-group-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: #faf9f7;
  border-bottom: 1px solid var(--chalk);
}

.map-current-label {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--dust);
}

.map-current-label em {
  font-weight: 400;
  color: var(--sand);
}

.map-arrow {
  font-size: 0.9rem;
  color: var(--sand);
}

.map-proposed-label {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
}

.map-tag {
  font-family: var(--mono);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 2px;
  background: var(--chalk);
  color: var(--dust);
  margin-left: 4px;
  vertical-align: middle;
}

.map-tag-new {
  background: var(--ember);
  color: white;
}


/* ——— Mapping Table ——— */
.map-table {
  display: flex;
  flex-direction: column;
}

.map-row {
  display: grid;
  grid-template-columns: 1fr 80px 1fr;
  gap: 0;
  border-bottom: 1px solid #f5f3f0;
  font-size: 0.78rem;
  line-height: 1.5;
}

.map-row:last-child {
  border-bottom: none;
}

.map-header-row {
  background: #faf9f7;
  font-family: var(--mono);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sand);
}

.map-cell-current,
.map-cell-proposed {
  padding: 10px 20px;
  color: var(--ink);
}

.map-cell-current {
  border-right: 1px solid #f5f3f0;
}

.map-cell-current em {
  color: var(--sand);
  font-size: 0.75rem;
}

.map-cell-action {
  padding: 10px 8px;
  font-family: var(--mono);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  border-right: 1px solid #f5f3f0;
}

.map-cell-action.keep { color: #5cb85c; }
.map-cell-action.move { color: #0D9488; }
.map-cell-action.add { color: var(--ember); }
.map-cell-action.remove { color: #c44; }
.map-cell-action.rename { color: #8B6914; }


/* ——— Hierarchy Tree ——— */
.hierarchy-tree {
  margin-top: 24px;
  max-width: 560px;
}

.h-section {
  font-family: var(--mono);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sand);
  padding: 16px 0 4px 0;
  margin-top: 8px;
}

.h-item {
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 6px 0 2px 12px;
  color: var(--ink);
}

.h-item.h-top {
  font-size: 0.95rem;
  font-weight: 700;
  padding-left: 0;
}

.h-item.h-bot {
  color: var(--dust);
  font-weight: 500;
}

.h-item.h-dim {
  color: var(--sand);
  font-weight: 400;
}

.h-item.h-new,
.h-sub.h-new {
  color: var(--ember);
}

.h-sub {
  font-family: var(--sans);
  font-size: 0.78rem;
  padding: 3px 0 3px 36px;
  color: var(--dust);
  position: relative;
}

.h-sub::before {
  content: "└ ";
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--chalk);
  position: absolute;
  left: 20px;
}

.h-note {
  font-family: var(--mono);
  font-size: 0.55rem;
  color: var(--sand);
  margin-left: 6px;
}


/* ——— Mobile ——— */
@media (max-width: 640px) {
  .map-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .map-cell-current {
    border-right: none;
    border-bottom: 1px solid #f5f3f0;
  }

  .map-cell-action {
    border-right: none;
    border-bottom: 1px solid #f5f3f0;
    text-align: left;
    padding-left: 20px;
  }

  .map-header-row {
    display: none;
  }
}
