/* Multi-scheme composition layer for the community resonance builder. */
.rb-scheme-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  margin: 0 0 14px;
}

.rb-scheme-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  min-width: 0;
}

.rb-scheme-tabs > button {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 9px 12px;
  border: 1px solid rgba(30, 102, 116, .18);
  border-radius: 12px;
  background: rgba(247, 252, 251, .86);
  color: #345d68;
  text-align: left;
  transition: border-color .18s ease, background-color .18s ease, transform .18s ease;
}

.rb-scheme-tabs > button:active,
.rb-add-scheme:active,
.rb-scheme-editor button:active {
  transform: translateY(1px);
}

.rb-scheme-tabs > button span {
  min-width: 42px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(57, 117, 129, .1);
  color: #42717b;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.rb-scheme-tabs > button b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.rb-scheme-tabs > button.active {
  border-color: #176d70;
  background: #e4f2ef;
  color: #124f55;
}

.rb-scheme-tabs > button.is-primary span,
.rb-scheme-tabs > button.active span {
  background: #176d70;
  color: #f7fffd;
}

.rb-add-scheme {
  min-height: 54px;
  padding: 0 16px;
  border: 1px solid #176d70;
  border-radius: 12px;
  background: #176d70;
  color: #f8fffd;
  font-weight: 700;
  white-space: nowrap;
}

.rb-scheme-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
  padding: 14px;
  border-left: 3px solid #176d70;
  background: rgba(229, 242, 239, .58);
}

.rb-scheme-editor label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.rb-scheme-editor label span {
  color: #55737a;
  font-size: 12px;
  font-weight: 700;
}

.rb-scheme-editor input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(30, 102, 116, .22);
  border-radius: 9px;
  background: rgba(255, 255, 255, .9);
  color: #163e49;
  font: inherit;
}

.rb-scheme-editor > div {
  display: flex;
  gap: 8px;
}

.rb-scheme-editor button {
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid rgba(30, 102, 116, .24);
  border-radius: 9px;
  background: rgba(255, 255, 255, .86);
  color: #315f69;
  white-space: nowrap;
}

.rb-scheme-editor button.active {
  border-color: #176d70;
  background: #176d70;
  color: #f8fffd;
}

.rb-scheme-editor button:disabled {
  opacity: .42;
  cursor: not-allowed;
}

.rb-precise-equipment {
  display: block;
}

.rb-precise-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0 10px;
}

.rb-precise-title div {
  display: grid;
  gap: 3px;
}

.rb-precise-title b {
  color: #173e4c;
  font-size: 18px;
}

.rb-precise-title small {
  color: #66848b;
}

.rb-slot-strip button span em {
  display: block;
  margin-top: 3px;
  color: #8b6a2b;
  font-size: 11px;
  font-style: normal;
}

.rb-slot-strip button.is-complete span em {
  color: #176d70;
}

.rb-equipment-settings > header > div:last-child {
  display: flex;
  gap: 8px;
  align-items: center;
}

.rb-selected-flow.is-required {
  border-left: 3px solid #b98631;
}

.rb-selected-flow.is-required:has(strong:not(:only-child)) {
  border-left-color: #176d70;
}

.rb-duo-board {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid rgba(30, 102, 116, .16);
  border-radius: 14px;
  background: rgba(240, 248, 247, .7);
}

.rb-duo-board > header h4,
.rb-duo-board > header p {
  margin: 0;
}

.rb-duo-board > header small {
  color: #176d70;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
}

.rb-duo-board > header p {
  margin-top: 5px;
  color: #69868c;
}

.rb-duo-members {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  margin-top: 14px;
}

.rb-duo-members > article,
.rb-single-summon > article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .86);
}

.rb-duo-members article > div,
.rb-single-summon article > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.rb-duo-members article small,
.rb-single-summon article small {
  color: #66848b;
  font-size: 11px;
}

.rb-duo-members article strong,
.rb-single-summon article strong {
  overflow: hidden;
  color: #173e4c;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rb-duo-members article label {
  margin-top: 4px;
  color: #52747c;
  font-size: 12px;
}

.rb-duo-members article > button,
.rb-single-summon article > button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(30, 102, 116, .2);
  border-radius: 9px;
  background: #eef7f5;
  color: #176d70;
  white-space: nowrap;
}

.rb-duo-plus {
  align-self: center;
  color: #769298;
  font-size: 22px;
}

.rb-single-summon {
  margin-top: 10px;
}

.rb-sheet-scheme-list,
.rb-sheet-pairing-list {
  display: grid;
  gap: 18px;
}

.rb-sheet-scheme,
.rb-sheet-pairing {
  overflow: hidden;
  padding: 18px;
  border: 1px solid rgba(42, 100, 115, .17);
  border-radius: 14px;
  background: rgba(255, 255, 255, .7);
}

.rb-sheet-scheme.is-primary,
.rb-sheet-pairing.is-primary {
  border-color: rgba(23, 109, 112, .44);
  box-shadow: inset 3px 0 #176d70;
}

.rb-sheet-scheme > header,
.rb-sheet-pairing > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.rb-sheet-scheme > header span,
.rb-sheet-pairing > header span {
  color: #176d70;
  font-size: 12px;
  font-weight: 800;
}

.rb-sheet-scheme > header h5,
.rb-sheet-pairing > header h5 {
  margin: 0;
  color: #173e4c;
  font-size: 20px;
}

.rb-sheet-scheme .rb-set-total > p {
  display: none;
}

.rb-sheet-duo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.rb-sheet-duo figure {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  margin: 0;
  padding: 10px;
  background: rgba(230, 242, 245, .62);
}

.rb-sheet-duo figcaption {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.rb-sheet-duo figcaption small,
.rb-sheet-duo figcaption em {
  color: #66848b;
  font-size: 11px;
  font-style: normal;
}

.rb-sheet-duo figcaption b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rb-sheet-duo > i {
  color: #769298;
  font-style: normal;
}

.rb-sheet-equipment.is-generic .rb-sheet-equipment-image {
  opacity: .64;
}

.rb-sheet-equipment em.is-missing {
  color: #a35a45;
}

@media (max-width: 760px) {
  .rb-scheme-bar,
  .rb-scheme-editor {
    grid-template-columns: minmax(0, 1fr);
  }

  .rb-scheme-tabs {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
  }

  .rb-scheme-tabs > button {
    flex: 0 0 min(78vw, 260px);
    scroll-snap-align: start;
  }

  .rb-add-scheme {
    width: 100%;
    min-height: 46px;
  }

  .rb-scheme-editor > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .rb-scheme-editor button {
    min-width: 0;
    padding-inline: 8px;
  }

  .rb-duo-members {
    grid-template-columns: minmax(0, 1fr);
  }

  .rb-duo-plus {
    line-height: 1;
    text-align: center;
  }

  .rb-duo-members > article,
  .rb-single-summon > article {
    grid-template-columns: 48px minmax(0, 1fr) auto;
  }

  .rb-equipment-settings > header,
  .rb-equipment-settings > header > div:last-child {
    align-items: stretch;
  }

  .rb-equipment-settings > header > div:last-child {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .rb-sheet-scheme,
  .rb-sheet-pairing {
    padding: 13px;
    border-radius: 12px;
  }

  .rb-sheet-scheme > header,
  .rb-sheet-pairing > header {
    display: grid;
    justify-content: start;
  }

  .rb-sheet-duo {
    grid-template-columns: minmax(0, 1fr);
  }

  .rb-sheet-duo > i {
    text-align: center;
  }

  .rb-sheet-duo figure {
    grid-template-columns: 52px minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .rb-scheme-tabs > button,
  .rb-add-scheme,
  .rb-scheme-editor button {
    transition: none;
  }
}
