/* Final responsive layout pass: picker libraries and precise equipment header. */

body .rb-picker-card-shell {
  display: flex !important;
  flex-direction: column;
  min-height: 0;
}

body .rb-picker-card-shell > header,
body .rb-picker-tabs,
body .rb-picker-search,
body .rb-picker-empty-action,
body .rb-picker-card-shell > footer {
  flex: 0 0 auto;
}

body .rb-picker-results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-flow: row;
  grid-auto-rows: auto !important;
  align-content: start;
  align-items: start;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

body .rb-picker-card {
  box-sizing: border-box;
  display: grid !important;
  grid-template-columns: 64px minmax(0, 1fr) 28px;
  grid-template-rows: minmax(64px, auto);
  align-items: start !important;
  align-self: start;
  width: 100%;
  height: auto !important;
  min-height: 112px;
  max-height: none !important;
  padding: 14px;
  overflow: visible;
  line-height: 1.4;
}

body .rb-picker-card > .rb-picker-icon {
  align-self: start;
}

body .rb-picker-card > span:not(.rb-image-well) {
  display: block;
  align-self: start;
  min-width: 0;
  max-width: 100%;
  padding-top: 1px;
}

body .rb-picker-card b,
body .rb-picker-card small,
body .rb-picker-card .rb-picker-jade-meta,
body .rb-picker-card .rb-picker-jade-meta span {
  position: static;
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: none;
  margin-right: 0;
  overflow: visible;
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

body .rb-picker-card b {
  font-size: 15px;
  line-height: 1.35;
}

body .rb-picker-card small {
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.55;
}

body .rb-picker-card > i {
  align-self: start;
  justify-self: center;
  margin-top: 6px;
}

body .rb-picker-card-shell > footer {
  position: static !important;
  inset: auto !important;
}

/* The editor can be embedded in a narrow column even when the viewport is wide. */
body .rb-equipment-settings {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  container-type: inline-size;
}

body .rb-equipment-settings > header {
  box-sizing: border-box;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center !important;
  gap: 16px;
  width: 100%;
  min-width: 0;
}

body .rb-equipment-settings > header > div:first-child {
  display: grid !important;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  width: 100%;
  min-width: 0;
}

body .rb-equipment-settings > header .rb-current-equipment-image {
  grid-column: 1;
  width: 72px;
  height: 72px;
  min-width: 72px;
  max-width: 72px;
}

body .rb-equipment-settings > header > div:first-child > span:last-child {
  grid-column: 2;
  display: block;
  width: 100%;
  min-width: 0;
}

body .rb-equipment-settings > header small,
body .rb-equipment-settings > header h4,
body .rb-equipment-settings > header p {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: none;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
}

body .rb-equipment-settings > header h4 {
  font-size: clamp(17px, 2.3vw, 20px);
  line-height: 1.35;
}

body .rb-equipment-settings > header > div:last-child {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center !important;
  justify-content: flex-end;
  gap: 8px;
  width: auto;
  min-width: 0;
}

body .rb-equipment-settings > header > div:last-child button {
  box-sizing: border-box;
  width: auto;
  min-width: 108px;
  min-height: 44px;
  height: auto !important;
  padding: 9px 15px;
  white-space: nowrap;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
}

@container (max-width: 620px) {
  body .rb-equipment-settings > header {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch !important;
    padding: 14px;
  }

  body .rb-equipment-settings > header > div:first-child {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 12px;
  }

  body .rb-equipment-settings > header .rb-current-equipment-image {
    width: 56px;
    height: 56px;
    min-width: 56px;
    max-width: 56px;
  }

  body .rb-equipment-settings > header > div:last-child {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    justify-content: stretch;
    width: 100%;
  }

  body .rb-equipment-settings > header > div:last-child button {
    width: 100%;
    min-width: 0;
    white-space: normal;
  }
}

@media (max-width: 980px) {
  body .rb-picker-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body .rb-picker-card-shell {
    width: 100%;
    height: 100dvh;
  }

  body .rb-picker-results {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 0 14px 14px;
  }

  body .rb-picker-card {
    grid-template-columns: 58px minmax(0, 1fr) 24px;
    grid-template-rows: minmax(58px, auto);
    min-height: 92px;
    padding: 12px;
  }

  body .rb-picker-icon {
    width: 58px;
    height: 58px;
  }

  body .rb-picker-card-shell > footer {
    padding: 10px 14px max(10px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 390px) {
  body .rb-equipment-settings > header > div:first-child {
    grid-template-columns: 50px minmax(0, 1fr);
    gap: 10px;
  }

  body .rb-equipment-settings > header .rb-current-equipment-image {
    width: 50px;
    height: 50px;
    min-width: 50px;
    max-width: 50px;
  }

  body .rb-picker-card {
    grid-template-columns: 52px minmax(0, 1fr) 22px;
  }
}


/* narrow-live-preview-v8 */
body .rb-mini-preview {
  container-type: inline-size;
}

body .rb-mini-preview .resonance-build-sheet,
body .rb-mini-preview .rb-sheet-pairing,
body .rb-mini-preview .rb-sheet-duo,
body .rb-mini-preview .rb-sheet-duo figure,
body .rb-mini-preview .rb-sheet-duo figcaption {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

@container (max-width: 700px) {
  body .rb-mini-preview .rb-sheet-section {
    padding: 18px 16px;
  }

  body .rb-mini-preview .rb-sheet-duo {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
  }

  body .rb-mini-preview .rb-sheet-duo > i {
    display: none;
  }

  body .rb-mini-preview .rb-sheet-duo figure {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    justify-items: center;
    gap: 8px;
    padding: 10px 7px;
    text-align: center;
  }

  body .rb-mini-preview .rb-sheet-duo .rb-sheet-round-icon {
    width: 58px;
    height: 58px;
    margin: 0 auto;
  }

  body .rb-mini-preview .rb-sheet-duo figcaption {
    display: grid;
    justify-items: center;
    gap: 3px;
    width: 100%;
  }

  body .rb-mini-preview .rb-sheet-duo figcaption small,
  body .rb-mini-preview .rb-sheet-duo figcaption b,
  body .rb-mini-preview .rb-sheet-duo figcaption em {
    position: static;
    display: block;
    width: 100%;
    max-width: 100%;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: break-word;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
  }
}


/* variable-height-picker-rows-v8 */
body .rb-picker-results {
  display: flex !important;
  flex-flow: row wrap;
  align-content: flex-start;
  align-items: stretch;
  gap: 10px;
}

body .rb-picker-card {
  flex: 0 0 calc((100% - 20px) / 3);
  align-self: stretch;
}

@media (max-width: 980px) {
  body .rb-picker-card {
    flex-basis: calc((100% - 10px) / 2);
  }
}

@media (max-width: 760px) {
  body .rb-picker-card {
    flex-basis: 100%;
  }
}


/* mini-preview-single-column-v8 */
body .rb-mini-preview .rb-sheet-duo {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 8px !important;
  align-items: stretch !important;
}

body .rb-mini-preview .rb-sheet-duo > i {
  display: none !important;
}

body .rb-mini-preview .rb-sheet-duo figure {
  display: grid !important;
  grid-template-columns: 58px minmax(0, 1fr) !important;
  align-items: center !important;
  justify-items: stretch !important;
  gap: 12px !important;
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 11px 12px !important;
  text-align: left !important;
}

body .rb-mini-preview .rb-sheet-duo .rb-sheet-round-icon {
  grid-column: 1 !important;
  width: 58px !important;
  height: 58px !important;
  min-width: 58px !important;
  margin: 0 !important;
}

body .rb-mini-preview .rb-sheet-duo figcaption {
  grid-column: 2 !important;
  display: grid !important;
  justify-items: start !important;
  gap: 3px !important;
  width: 100% !important;
  min-width: 0 !important;
  text-align: left !important;
}

body .rb-mini-preview .rb-sheet-duo figcaption small,
body .rb-mini-preview .rb-sheet-duo figcaption b,
body .rb-mini-preview .rb-sheet-duo figcaption em {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
}


/* mini-preview-all-sections-single-column-v8 */
body .rb-mini-preview .rb-sheet-set-plan,
body .rb-mini-preview .rb-sheet-equipment-grid,
body .rb-mini-preview .rb-sheet-flow-grid,
body .rb-mini-preview .rb-sheet-inscription-group > div,
body .rb-mini-preview .rb-sheet-talent-grid,
body .rb-mini-preview .rb-sheet-combat-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 9px !important;
  width: 100% !important;
  min-width: 0 !important;
}

body .rb-mini-preview .rb-sheet-set-plan > article,
body .rb-mini-preview .rb-sheet-flow-grid > article,
body .rb-mini-preview .rb-sheet-inscription-group figure,
body .rb-mini-preview .rb-sheet-talent {
  box-sizing: border-box;
  display: grid !important;
  grid-template-columns: 64px minmax(0, 1fr) !important;
  grid-template-areas: "img cap" "eff eff" !important;
  align-items: start !important;
  gap: 12px !important;
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
}

body .rb-mini-preview .rb-sheet-inscription-image { grid-area: img !important; align-self: start !important; }
body .rb-mini-preview .rb-sheet-inscription-group figcaption { grid-area: cap !important; }
body .rb-mini-preview .rb-sheet-inscription-effect { grid-area: eff !important; margin-top: 4px !important; }

body .rb-mini-preview .rb-sheet-set-plan > article > div,
body .rb-mini-preview .rb-sheet-flow-grid > article > div,
body .rb-mini-preview .rb-sheet-inscription-group figcaption,
body .rb-mini-preview .rb-sheet-talent > div {
  min-width: 0 !important;
  width: 100% !important;
}

body .rb-mini-preview .rb-sheet-set-icon,
body .rb-mini-preview .rb-sheet-flow-image,
body .rb-mini-preview .rb-sheet-talent .rb-talent-dark-icon {
  width: 64px !important;
  height: 64px !important;
  min-width: 64px !important;
}

body .rb-mini-preview .rb-sheet-inscription-image {
  width: 52px !important;
  height: 52px !important;
  min-width: 52px !important;
}

body .rb-mini-preview .rb-sheet-equipment {
  box-sizing: border-box;
  display: grid !important;
  grid-template-columns: 72px minmax(0, 1fr) !important;
  grid-template-rows: auto !important;
  align-items: center !important;
  column-gap: 12px !important;
  width: 100% !important;
  min-width: 0 !important;
  text-align: left !important;
}

body .rb-mini-preview .rb-sheet-equipment-image {
  grid-column: 1 !important;
  grid-row: 1 / span 6 !important;
  width: 72px !important;
  height: 72px !important;
  margin: 0 !important;
}

body .rb-mini-preview .rb-sheet-equipment > span,
body .rb-mini-preview .rb-sheet-equipment > h5,
body .rb-mini-preview .rb-sheet-equipment > p,
body .rb-mini-preview .rb-sheet-equipment > em,
body .rb-mini-preview .rb-sheet-equipment > .rb-sheet-jade {
  grid-column: 2 !important;
  min-width: 0 !important;
}

body .rb-mini-preview .rb-sheet-set-plan h5,
body .rb-mini-preview .rb-sheet-set-plan p,
body .rb-mini-preview .rb-sheet-set-plan span,
body .rb-mini-preview .rb-sheet-flow-grid h5,
body .rb-mini-preview .rb-sheet-flow-grid p,
body .rb-mini-preview .rb-sheet-flow-grid span,
body .rb-mini-preview .rb-sheet-equipment h5,
body .rb-mini-preview .rb-sheet-equipment p,
body .rb-mini-preview .rb-sheet-equipment span,
body .rb-mini-preview .rb-sheet-equipment em,
body .rb-mini-preview .rb-sheet-inscription-group b,
body .rb-mini-preview .rb-sheet-inscription-group span,
body .rb-mini-preview .rb-sheet-talent h5,
body .rb-mini-preview .rb-sheet-talent p,
body .rb-mini-preview .rb-sheet-talent span {
  max-width: 100% !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
}
