/* TR TS 017 pilot regulatory module. Isolated classes only. */
.regulatory-source-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  margin: 12px 0 14px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(248, 250, 252, 0.86);
  border-radius: 14px;
}
.regulatory-source-tab {
  border: 0;
  background: transparent;
  color: #475569;
  border-radius: 10px;
  padding: 8px 13px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.regulatory-source-tab span {
  display: inline-flex;
  margin-left: 5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.13);
  color: #92400e;
  font-size: 11px;
  font-weight: 800;
}
.regulatory-source-tab:hover { background: rgba(226, 232, 240, 0.7); color: #0f172a; }
.regulatory-source-tab.active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}
.pp2425-shell.reg-source-tr017 .pp2425-warning-note,
.pp2425-shell.reg-source-tr017 .pp2425-form,
.pp2425-shell.reg-source-tr017 .pp2425-results-card,
.pp2425-shell.reg-source-tr017 .pp2425-detail-card {
  display: none !important;
}
.tr017-panel[hidden] { display: none !important; }
.tr017-panel {
  display: grid;
  gap: 14px;
}
.tr017-card {
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.96);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.06);
}
.tr017-head,
.tr017-results-head,
.tr017-detail-head,
.tr017-item-top,
.tr017-indicator-top,
.tr017-method-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.tr017-head h3,
.tr017-results-head h3,
.tr017-detail-head h3,
.tr017-block-head h4,
.tr017-indicator-top h4 {
  margin: 0;
  color: #0f172a;
}
.tr017-head p,
.tr017-results-head p,
.tr017-detail-head p,
.tr017-block-head span {
  margin: 5px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}
.tr017-eyebrow,
.tr017-item-meta,
.tr017-indicator-rule {
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.tr017-db-status {
  flex: 0 0 auto;
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #475569;
  background: #f8fafc;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.tr017-db-status.ok { color: #166534; background: #f0fdf4; border-color: rgba(22, 163, 74, 0.22); }
.tr017-db-status.bad { color: #991b1b; background: #fef2f2; border-color: rgba(220, 38, 38, 0.2); }
.tr017-warning-note,
.tr017-detail-warnings {
  margin-top: 14px;
  border: 1px solid rgba(245, 158, 11, 0.22);
  background: #fffbeb;
  color: #92400e;
  border-radius: 14px;
  padding: 11px 13px;
  font-size: 13px;
  line-height: 1.45;
}
.tr017-detail-warnings { display: grid; gap: 6px; margin: 12px 0; }
.tr017-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 12px;
  margin-top: 14px;
  align-items: end;
}
.tr017-field {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}
.tr017-field input,
.tr017-question input,
.tr017-question select,
.tr017-material-filter {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  background: #fff;
  color: #0f172a;
}
.tr017-field input:focus,
.tr017-question input:focus,
.tr017-question select:focus,
.tr017-material-filter:focus {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}
.tr017-search-btn,
.tr017-item-open,
.tr017-resolve-btn,
.tr017-apply-btn,
.tr017-mini-btn {
  border: 0;
  border-radius: 12px;
  background: #2563eb;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18);
}
.tr017-item-open,
.tr017-mini-btn {
  background: #f8fafc;
  color: #1e293b;
  border: 1px solid rgba(148, 163, 184, 0.32);
  box-shadow: none;
}
.tr017-search-btn:hover,
.tr017-resolve-btn:hover,
.tr017-apply-btn:hover { background: #1d4ed8; }
.tr017-item-open:hover,
.tr017-mini-btn:hover { background: #eef2ff; }
.tr017-results {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.tr017-item {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: #fff;
  border-radius: 16px;
  padding: 14px;
}
.tr017-item h4 { margin: 0; color: #0f172a; font-size: 15px; line-height: 1.35; }
.tr017-item-grid,
.tr017-detail-grid,
.tr017-indicator-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.tr017-detail-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tr017-indicator-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tr017-item-grid > div,
.tr017-detail-grid > div,
.tr017-indicator-meta > div {
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  padding: 9px 10px;
  min-width: 0;
}
.tr017-item-grid span,
.tr017-detail-grid span,
.tr017-indicator-meta span {
  display: block;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 3px;
}
.tr017-item-grid strong,
.tr017-detail-grid strong,
.tr017-indicator-meta strong {
  display: block;
  color: #0f172a;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.tr017-item-note {
  margin-top: 10px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}
.tr017-empty {
  border: 1px dashed rgba(148, 163, 184, 0.5);
  border-radius: 16px;
  padding: 18px;
  color: #64748b;
  background: #f8fafc;
  text-align: center;
}
.tr017-empty.compact { padding: 10px; font-size: 13px; }
.tr017-questions-block,
.tr017-resolved-output { margin-top: 16px; }
.tr017-block-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 10px;
}
.tr017-questions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.tr017-question {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: #fff;
  border-radius: 14px;
  padding: 11px;
  min-width: 0;
}
.tr017-question-label { color: #1e293b; font-size: 13px; font-weight: 800; line-height: 1.35; }
.tr017-question-why { color: #64748b; font-size: 12px; line-height: 1.4; }
.tr017-material-question { grid-column: 1 / -1; }
.tr017-material-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  max-height: 190px;
  overflow: auto;
  padding-right: 4px;
}
.tr017-material-option {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: #f8fafc;
  border-radius: 10px;
  padding: 7px 8px;
  font-size: 12px;
  color: #334155;
  line-height: 1.25;
}
.tr017-env-box,
.tr017-apply-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  margin-top: 12px;
  padding: 11px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 13px;
  color: #334155;
}
.tr017-env-box .tr017-question-label { width: 100%; }
.tr017-method-toolbar { margin: 14px 0 10px; align-items: center; }
.tr017-indicators { display: grid; gap: 10px; }
.tr017-indicator-card {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 16px;
  padding: 13px;
  background: #fff;
}
.tr017-confidence {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 11px;
  font-weight: 800;
}
.tr017-methods-list { display: grid; gap: 6px; margin-top: 10px; }
.tr017-method-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 13px;
  color: #1e293b;
}
.tr017-method-row span { display: grid; gap: 2px; min-width: 0; }
.tr017-method-row em { color: #64748b; font-style: normal; font-size: 12px; }
.tr017-more-methods { color: #64748b; font-size: 12px; padding-left: 4px; }
.tr017-apply-row { display: flex; justify-content: flex-end; margin-top: 12px; }
.tr017-pagination { margin-top: 12px; }
@media (max-width: 920px) {
  .tr017-form,
  .tr017-questions-grid,
  .tr017-item-grid,
  .tr017-detail-grid,
  .tr017-indicator-meta,
  .tr017-material-options { grid-template-columns: 1fr; }
  .tr017-head,
  .tr017-detail-head,
  .tr017-item-top,
  .tr017-method-toolbar { flex-direction: column; align-items: stretch; }
  .tr017-db-status { white-space: normal; }
}

/* === TR TS 017 pilot v2 UX cleanup: compact materials + sticky actions === */
.tr017-pagination {
  position: sticky;
  bottom: 12px;
  z-index: 12;
  margin-top: 16px;
}
.tr017-pagination-panel {
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(10px);
}
.tr017-material-question {
  grid-column: 1 / -1;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}
.tr017-material-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.tr017-material-all-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.tr017-material-picker {
  position: relative;
  z-index: 3;
}

/* === TR TS 017 pilot v4: hide empty quick material suggestions === */
.tr017-material-suggestions[hidden] {
  display: none !important;
}

.tr017-material-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  display: grid;
  gap: 4px;
  max-height: 260px;
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.14);
}
.tr017-material-suggestion {
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 9px 10px;
  text-align: left;
  color: #1e293b;
  font-size: 13px;
  line-height: 1.35;
  cursor: pointer;
}
.tr017-material-suggestion:hover {
  background: #eef2ff;
  color: #1d4ed8;
}
.tr017-material-suggestion.empty {
  cursor: default;
  color: #64748b;
}
.tr017-selected-materials-wrap {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}
.tr017-selected-label {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.tr017-selected-materials {
  min-height: 38px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  padding: 8px;
  border: 1px dashed rgba(148, 163, 184, 0.36);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
}
.tr017-selected-empty {
  color: #64748b;
  font-size: 13px;
  line-height: 1.35;
}
.tr017-material-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  border: 1px solid rgba(37, 99, 235, 0.20);
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 6px 9px 6px 11px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.tr017-material-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tr017-material-chip b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  font-size: 12px;
  line-height: 1;
}
.tr017-material-modal[hidden] { display: none !important; }
.tr017-material-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.tr017-material-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(5px);
}
.tr017-material-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(860px, calc(100vw - 48px));
  max-height: min(760px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto auto minmax(220px, 1fr) auto;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22);
}
.tr017-material-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.tr017-material-modal-head h4 {
  margin: 0;
  color: #0f172a;
  font-size: 17px;
}
.tr017-material-modal-head p {
  margin: 5px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.4;
}
.tr017-material-modal-close {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  background: #fff;
  color: #64748b;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.tr017-material-modal-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 8px;
  align-content: start;
  overflow: auto;
  padding: 2px 4px 2px 0;
}
.tr017-material-modal-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  background: #f8fafc;
  padding: 9px 10px 9px 12px;
  color: #1e293b;
  font-size: 13px;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.tr017-material-modal-option:hover {
  background: #f1f5f9;
  border-color: rgba(37, 99, 235, 0.22);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}
.tr017-material-modal-option.active {
  background: #eff6ff;
  border-color: rgba(37, 99, 235, 0.35);
  color: #1d4ed8;
}
.tr017-material-modal-option-text {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}
.tr017-material-modal-option-mark {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 13px;
  font-weight: 900;
}
.tr017-material-modal-option.active .tr017-material-modal-option-mark {
  background: #2563eb;
  color: #fff;
}
.tr017-material-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 4px;
}
.tr017-material-modal-count {
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}
.tr017-sticky-actionbar {
  position: sticky;
  bottom: 12px;
  z-index: 14;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(10px);
}
.tr017-actionbar-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
}
.tr017-actionbar-summary span {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 6px 9px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.20);
}
.tr017-actionbar-summary strong { color: #2563eb; }
.tr017-actionbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.tr017-actionbar-actions .tr017-apply-btn:disabled {
  opacity: .52;
  cursor: not-allowed;
  box-shadow: none;
}
@media (max-width: 920px) {
  .tr017-sticky-actionbar,
  .tr017-material-head,
  .tr017-material-modal-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .tr017-actionbar-actions { justify-content: stretch; }
  .tr017-actionbar-actions > button { flex: 1 1 auto; }
  .tr017-material-modal { padding: 12px; }
  .tr017-material-modal-dialog { width: calc(100vw - 24px); max-height: calc(100vh - 24px); }
  .tr017-material-modal-list { grid-template-columns: 1fr; }
}
