.historical-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.historical-eyebrow {
  display: block;
  margin-bottom: .3rem;
  color: #8b1d2c;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.historical-admin-badge,
.historical-step-status {
  flex: 0 0 auto;
  padding: .45rem .7rem;
  border: 1px solid rgba(139, 29, 44, .2);
  border-radius: 999px;
  background: rgba(139, 29, 44, .07);
  color: #751724;
  font-size: .78rem;
  font-weight: 800;
}

.historical-selector-card,
.historical-settings-card,
.historical-empty-state {
  margin-top: 1rem;
  border: 1px solid #e6e8ec;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(25, 31, 40, .06);
}

.historical-selector-card,
.historical-settings-card { padding: 1.25rem; }

.historical-card-heading,
.historical-scope-heading,
.historical-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.historical-card-heading h2,
.historical-scope-heading h2 { margin: 0; font-size: 1.15rem; }
.historical-card-heading p { margin: .3rem 0 0; color: #667085; }

.historical-selector-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .9rem;
  margin-top: 1.15rem;
}

.historical-field label {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .45rem;
  color: #344054;
  font-size: .85rem;
  font-weight: 800;
}

.historical-field label span {
  display: inline-grid;
  width: 1.45rem;
  height: 1.45rem;
  place-items: center;
  border-radius: 50%;
  background: #eef0f3;
  color: #667085;
  font-size: .72rem;
}

.historical-field.is-complete label span { background: #8b1d2c; color: #fff; }

.historical-field select {
  width: 100%;
  min-height: 46px;
  padding: 0 2.5rem 0 .8rem;
  border: 1px solid #d7dae0;
  border-radius: 10px;
  background-color: #fff;
  color: #1d2939;
  font: inherit;
}

.historical-field select:focus {
  border-color: #8b1d2c;
  box-shadow: 0 0 0 3px rgba(139, 29, 44, .12);
  outline: none;
}

.historical-field select:disabled { background: #f5f6f7; color: #98a2b3; cursor: not-allowed; }

.historical-scope-heading { padding-bottom: 1rem; border-bottom: 1px solid #eaecf0; }
.historical-scope-counts { display: flex; gap: .5rem; }
.historical-scope-counts span { padding: .48rem .7rem; border-radius: 9px; background: #f3f4f6; color: #475467; font-size: .8rem; }

.historical-bulk-notice {
  display: flex;
  gap: .75rem;
  margin: 1rem 0;
  padding: .85rem;
  border: 1px solid #f4d28a;
  border-radius: 11px;
  background: #fffaeb;
  color: #7a4f01;
}

.historical-bulk-notice p { margin: .15rem 0 0; color: #7a4f01; font-size: .86rem; }
.historical-bulk-icon { display: grid; flex: 0 0 1.55rem; height: 1.55rem; place-items: center; border-radius: 50%; background: #fdb022; color: #fff; font-weight: 900; }
.historical-settings-form { margin-top: 1rem; }

.historical-toggle-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .9rem;
  padding: 1rem .15rem;
  border-bottom: 1px solid #eef0f2;
  cursor: pointer;
}

.historical-toggle-row input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.historical-toggle-control { position: relative; width: 2.75rem; height: 1.55rem; border-radius: 999px; background: #c9ced6; transition: .2s ease; }
.historical-toggle-control::after { content: ""; position: absolute; top: 3px; left: 3px; width: 1.18rem; height: 1.18rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: .2s ease; }
.historical-toggle-row input:checked + .historical-toggle-control { background: #228b54; }
.historical-toggle-row input:checked + .historical-toggle-control::after { transform: translateX(1.2rem); }
.historical-toggle-row input:focus-visible + .historical-toggle-control { outline: 3px solid rgba(139, 29, 44, .22); outline-offset: 2px; }
.historical-toggle-copy { display: grid; gap: .2rem; }
.historical-toggle-copy strong { color: #1d2939; }
.historical-toggle-copy small { color: #667085; line-height: 1.35; }
.historical-state { min-width: 4.1rem; padding: .35rem .55rem; border-radius: 999px; background: #f2f4f7; color: #667085; text-align: center; font-size: .75rem; font-weight: 800; }
.historical-toggle-row:has(input:checked) .historical-state { background: #e9f7ef; color: #187345; }

.historical-form-footer { margin-top: 1.1rem; }
.historical-form-footer p { margin: 0; color: #667085; font-size: .84rem; }
.historical-save-button { padding: .72rem 1rem; border: 0; border-radius: 10px; background: #8b1d2c; color: #fff; font: inherit; font-weight: 800; cursor: pointer; box-shadow: 0 5px 14px rgba(139, 29, 44, .2); }
.historical-save-button:hover { background: #741624; transform: translateY(-1px); }
.historical-empty-state { padding: 2rem; text-align: center; color: #475467; }
.historical-empty-state p { margin: .35rem 0 0; color: #667085; }

@media (max-width: 760px) {
  .historical-selector-grid { grid-template-columns: 1fr; }
  .historical-page-header, .historical-card-heading, .historical-scope-heading, .historical-form-footer { align-items: flex-start; flex-direction: column; }
  .historical-scope-counts { flex-wrap: wrap; }
  .historical-toggle-row { grid-template-columns: auto 1fr; }
  .historical-state { grid-column: 2; justify-self: start; }
  .historical-save-button { width: 100%; }
}
