/* Layout corrections for equipment fields and library pickers. */
.rb-picker-card-shell {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

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

.rb-picker-results {
  flex: 1 1 auto;
  min-height: 0;
  grid-auto-rows: max-content;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.rb-picker-card {
  box-sizing: border-box;
  height: auto !important;
  min-height: 104px;
  align-self: stretch;
  align-items: start;
  align-content: start;
  padding: 14px;
}

.rb-picker-card > span,
.rb-picker-card b,
.rb-picker-card small {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
}

.rb-picker-card small {
  line-height: 1.6;
}

.rb-picker-card.is-flow .rb-picker-icon,
.rb-picker-card.is-combo .rb-picker-icon {
  box-sizing: border-box;
  padding: 7px;
  background: #173f49;
  object-fit: contain;
}

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

@media (max-width: 760px) {
  .rb-equipment-settings > header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 14px;
    padding: 14px;
  }

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

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

  .rb-equipment-settings > header h4,
  .rb-equipment-settings > header p,
  .rb-equipment-settings > header small {
    max-width: 100%;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
  }

  .rb-equipment-settings > header h4 {
    font-size: 18px;
    line-height: 1.35;
  }

  .rb-equipment-settings > header > div:last-child {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    min-width: 0;
  }

  .rb-equipment-settings > header > div:last-child button {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 8px 10px;
    white-space: normal;
  }

  .rb-picker-card-shell {
    width: 100%;
    height: 100dvh;
  }

  .rb-picker-results {
    grid-auto-rows: max-content;
    gap: 10px;
    padding: 0 14px 14px;
  }

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

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

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

  .rb-picker-search {
    gap: 8px;
    margin-inline: 12px;
    padding-inline: 12px;
  }

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

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

/* partner-build-and-flow-preview-v8 */
.rb-selected-flow { grid-template-columns: 58px minmax(0,1fr) auto auto; }
.rb-selected-flow-image, .rb-sheet-flow-image { padding: 7px; background: #173f49; object-fit: contain; }
.rb-sheet-concrete > h5, .rb-sheet-flow-section > h5 { margin: 18px 0 10px; color: #173f49; font-size: 15px; }
.rb-sheet-flow-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.rb-sheet-flow-grid > article { display: grid; grid-template-columns: 64px minmax(0,1fr); gap: 12px; align-items: start; padding: 12px; border: 1px solid rgba(38,106,101,.2); background: rgba(236,247,244,.68); }
.rb-sheet-flow-grid h5 { margin: 3px 0 5px; font-size: 15px; color: #173f49; }
.rb-sheet-flow-grid span { color: #29716c; font-size: 12px; font-weight: 700; }
.rb-sheet-flow-grid p { margin: 0; color: #58747a; font-size: 13px; line-height: 1.65; }
.rb-partner-build-callout, .rb-partner-edit-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 14px 0 0; padding: 14px 16px; border-left: 3px solid #b48739; background: #f8f1df; }
.rb-partner-build-callout div, .rb-partner-edit-banner div { display: grid; gap: 3px; min-width: 0; }
.rb-partner-build-callout small, .rb-partner-edit-banner small { color: #9a6d27; font-weight: 700; }
.rb-partner-build-callout span, .rb-partner-edit-banner span { color: #60767a; font-size: 13px; }
.rb-partner-build-callout button, .rb-partner-edit-banner button { flex: 0 0 auto; min-height: 42px; padding: 8px 16px; border: 0; background: #176e69; color: #fff; font-weight: 700; cursor: pointer; }
.rb-partner-edit-banner { margin: 0 0 18px; border-left-color: #176e69; background: #eaf6f2; }
.rb-sheet-partner-build { margin-top: 18px; padding: 16px; border: 1px solid rgba(180,135,57,.34); background: rgba(253,249,238,.82); }
.rb-sheet-partner-build > header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.rb-sheet-partner-build > header h5 { margin: 3px 0 0; color: #173f49; font-size: 18px; }
.rb-sheet-partner-build > header span { color: #a7742c; font-size: 12px; font-weight: 700; }
.rb-sheet-partner-section { margin-top: 14px; }
.rb-sheet-partner-section > h6 { margin: 0 0 8px; color: #176e69; font-size: 13px; letter-spacing: .08em; }
@media (max-width: 760px) {
  .rb-selected-flow { grid-template-columns: 52px minmax(0,1fr); }
  .rb-selected-flow > button { width: 100%; }
  .rb-sheet-flow-grid { grid-template-columns: minmax(0,1fr); }
  .rb-partner-build-callout, .rb-partner-edit-banner { align-items: stretch; flex-direction: column; }
  .rb-partner-build-callout button, .rb-partner-edit-banner button { width: 100%; }
  .rb-sheet-partner-build { padding: 12px; }
  /* 发布阅读页移动端护栏：攻略 sheet 绝不引发整页左右滑动 */
  .reader-body .resonance-build-sheet,
  .post-body .resonance-build-sheet,
  .resonance-build-sheet { max-width: 100%; overflow-x: clip; }
  .resonance-build-sheet img,
  .resonance-build-sheet .rb-sheet-flow-image,
  .resonance-build-sheet .rb-sheet-round-icon { max-width: 100%; height: auto; }
  .resonance-build-sheet p,
  .resonance-build-sheet span,
  .resonance-build-sheet small,
  .resonance-build-sheet em { overflow-wrap: anywhere; word-break: break-word; }
  .rb-sheet-partner-build > header { flex-wrap: wrap; }
  .rb-sheet-duo > i { overflow-wrap: anywhere; }
}
@media (max-width: 520px) {
  /* 极窄屏：英雄区转单列，杜绝右侧 38% 列挤压导致的横向溢出 */
  .rb-sheet-hero { grid-template-columns: minmax(0, 1fr) !important; min-height: 0 !important; }
  .rb-sheet-hero > img { width: auto; height: 160px; max-width: 80%; object-fit: contain; border-radius: 12px; align-self: end; justify-self: center; }
  .rb-sheet-hero-copy { padding: 16px 14px; }
  .rb-sheet-inscription-group > div { grid-template-columns: minmax(0, 1fr); }
}


.rb-topic-block{margin:18px 0 4px;padding:16px;border:1px solid var(--rb-line);border-radius:16px;background:rgba(255,255,255,.7)}.rb-topic-head{display:flex;flex-direction:column;gap:3px;margin-bottom:12px}.rb-topic-head>span{color:var(--rb-deep);font-size:.86rem;font-weight:900}.rb-topic-head>small{color:var(--rb-muted);font-size:.72rem;line-height:1.5}.rb-topic-chips{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px}.rb-topic-chip{display:inline-flex;align-items:center;gap:5px;padding:5px 9px 5px 11px;border-radius:999px;background:var(--rb-deep);color:#fff;font-size:.74rem;font-weight:700}.rb-topic-chip button{width:18px;height:18px;border:0;border-radius:50%;background:rgba(255,255,255,.22);color:#fff;font-size:.7rem;line-height:1;cursor:pointer}.rb-topic-add{display:grid;grid-template-columns:1fr 1fr auto;gap:8px;align-items:center}.rb-topic-add select,.rb-topic-add input{border:1px solid var(--rb-line);border-radius:11px;background:#fff;color:var(--rb-ink);padding:0 11px;min-height:42px;font:inherit}.rb-topic-add button{border:0;border-radius:11px;background:var(--rb-teal);color:#fff;font-weight:800;min-height:42px;padding:0 16px}.rb-scheme-context-hint{margin:0 0 18px;padding:10px 13px;border-radius:11px;background:#eaf6f3;color:var(--rb-deep);font-size:.74rem;line-height:1.5}.rb-combo-from{display:inline-block;margin-top:3px;padding:2px 7px;border-radius:999px;background:#eef3f8;color:#3a5a78;font-style:normal;font-size:.6rem;font-weight:700}.rb-sheet-inscription-by-pair{margin-bottom:20px;padding:14px;border:1px solid rgba(31,143,135,.16);border-radius:14px;background:rgba(255,255,255,.6)}.rb-sheet-inscription-by-pair>header{display:flex;align-items:baseline;gap:9px;margin-bottom:11px}.rb-sheet-inscription-by-pair>header span{padding:3px 8px;border-radius:999px;background:#e2f3ef;color:var(--rb-deep);font-size:.64rem;font-weight:900}.rb-sheet-inscription-by-pair>header h5{margin:0;font-size:.82rem}
.rb-sheet-inscription-effect{display:block;margin-top:4px;color:var(--rb-deep);font-size:.66rem;font-weight:700;line-height:1.45;text-align:left}
.rb-inscription-effect{display:block;margin-top:2px;color:var(--rb-deep);font-size:.6rem;font-weight:700;line-height:1.4;text-align:left}
