.rb-heading { gap: 20px; }
.rb-heading-actions, .rb-tabs, .rb-confirm-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.rb-heading-actions { align-self: center; justify-content: flex-end; }
.rb-tabs { margin: 0 0 20px; }
.rb-cards { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.rb-card { min-width: 0; padding: 22px; margin: 0; }
.rb-card header { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.rb-card header > div { min-width: 0; }
.rb-card header small { display: block; margin: 0 0 8px; overflow-wrap: anywhere; line-height: 1.6; }
.rb-card h2 { overflow-wrap: anywhere; line-height: 1.6; }
.rb-status { flex-shrink: 0; border-radius: 5px; padding: 6px 8px; color: #698376; background: #edf6f0; font-size: 10px; line-height: 1.5; }
.rb-status.due { color: #a87936; background: #fff5e6; }
.rb-status.paused, .rb-status.ended { color: #8490a4; background: #f0f3f8; }
.rb-description { margin: 15px 0 0; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.rb-facts { display: flex; flex-direction: column; gap: 9px; padding: 20px 0; font-size: 12px; line-height: 1.6; }
.rb-facts > span > strong { font-size: 21px; color: #243551; }
.rb-facts .rb-mode { align-self: start; padding: 5px 8px; border-radius: 5px; font-size: 11px; font-weight: 700; color: #657e99; background: #edf3fa; }
.rb-facts .rb-mode.issue { color: #617a64; background: #eef6ef; }
.rb-mode-notice { padding: 15px; border: 1px solid #dfe8f2; border-radius: 7px; background: #f7faff; font-size: 12px; line-height: 1.7; }
.rb-mode-notice.issue { border-color: #e9dcba; background: #fffbf1; color: #8c773f; }
.rb-mode-notice p { margin: 6px 0 0; font-size: 11px; color: inherit; line-height: 1.8; }
.rb-plan-error { display: flex; flex-direction: column; gap: 6px; margin-bottom: 17px; padding: 13px; border: 1px solid #f0d9d1; border-radius: 7px; background: #fff8f5; color: #a06459; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.rb-plan-error p { margin: 0; font-size: 11px; color: inherit; white-space: pre-wrap; }
.rb-plan-error small { color: inherit; }
.rb-archive-notice { margin: 0 0 20px; padding: 16px 18px; border: 1px solid #e9dfc4; border-radius: 8px; background: #fffaf0; color: #8c773f; font-size: 12px; line-height: 1.7; }
.rb-archive-notice p { margin: 7px 0 0; color: inherit; font-size: 11px; }
.rb-card footer { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid #edf0f7; padding-top: 17px; }
.rb-empty, .rb-loading { padding: 35px 22px; text-align: center; font-size: 12px; line-height: 1.7; }
.rb-empty h3 { margin: 0 0 9px; }
.rb-empty p { margin-bottom: 18px; }
.rb-footnote { margin: 22px 0 0; font-size: 11px; line-height: 1.8; }
.rb-error, .rb-notice { border: 1px solid #d7e5ed; background: #f3f9fa; padding: 16px 18px; border-radius: 8px; margin-bottom: 20px; font-size: 12px; line-height: 1.7; }
.rb-error { border-color: #eedbd7; background: #fff8f6; color: #a5625b; }
.rb-notice > div { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.rb-history { margin: 0 0 20px; }
.rb-history .panel-header { gap: 12px; flex-wrap: wrap; }
.rb-history-list > div { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 17px 22px; border-top: 1px solid #edf0f7; min-width: 0; }
.rb-history-list > div > span { display: flex; flex-direction: column; gap: 6px; min-width: 0; overflow-wrap: anywhere; font-size: 12px; line-height: 1.6; }
.rb-history-list > div > span:last-child { text-align: right; flex-shrink: 0; max-width: 48%; }
.rb-sources { margin: 3px 0; border: 1px solid #e3e9f2; border-radius: 7px; padding: 15px; min-width: 0; }
.rb-sources legend { padding: 0 7px; font-size: 12px; font-weight: 700; }
.rb-contract-choice { display: flex; gap: 11px; padding: 10px 0; cursor: pointer; align-items: start; }
.rb-contract-choice input { flex: 0 0 17px; width: 17px; height: 17px; margin: 2px 0 0; accent-color: #3e5fe5; }
.rb-contract-choice span { display: flex; flex-direction: column; gap: 5px; min-width: 0; overflow-wrap: anywhere; font-size: 12px; line-height: 1.6; }
.rb-sources .form-hint { margin: 10px 0 0; }
[data-rb-form] { min-width: 0; }
[data-rb-form] .form-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
[data-rb-form] .field, [data-rb-form] .form-grid > * { min-width: 0; }
[data-rb-form] input, [data-rb-form] select, [data-rb-form] textarea { max-width: 100%; min-width: 0; }
[data-rb-form] .modal-footer { flex-wrap: wrap; }
[data-rb-form] [hidden], [data-rb-generation] [hidden] { display: none !important; }
[data-rb-generation] .rb-generation-sources { margin: 0 0 18px; padding-left: 20px; color: #73839b; font-size: 12px; line-height: 1.9; overflow-wrap: anywhere; }
[data-rb-form] .form-error:empty, [data-rb-generation] .form-error:empty { display: none; }
.rb-confirm-actions { margin-top: 22px; justify-content: flex-end; }
@media (max-width: 1200px) { .rb-cards { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 900px) { .rb-tabs .btn, .rb-card .btn, .rb-heading-actions .btn, .rb-confirm-actions .btn, [data-rb-form] .btn { min-height: 44px; white-space: normal; } }
@media (max-width: 600px) {
  .rb-heading { flex-direction: column; align-items: stretch; }
  .rb-heading-actions { justify-content: start; align-self: stretch; }
  .rb-heading-actions .btn { flex: 1; }
  .rb-tabs { gap: 6px; }
  .rb-tabs .btn { padding-left: 10px; padding-right: 10px; font-size: 11px; }
  .rb-card { padding: 18px 16px; }
  .rb-card header { flex-direction: column; }
  .rb-card footer .btn { flex: 1; }
  .rb-history-list > div { align-items: start; padding: 16px; flex-direction: column; gap: 10px; }
  .rb-history-list > div > span:last-child { max-width: 100%; text-align: left; }
  [data-rb-form] .form-grid { grid-template-columns: minmax(0,1fr); }
  [data-rb-form] input:not([type=checkbox]), [data-rb-form] select, [data-rb-form] textarea { min-height: 44px; font-size: 16px; }
  [data-rb-form] .modal-footer { justify-content: stretch; }
  [data-rb-form] .modal-footer .btn { flex: 1; }
  .rb-confirm-actions { flex-direction: column; }
  .rb-confirm-actions .btn { justify-content: center; }
  .rb-contract-choice { min-height: 44px; }
}
