.change-request-widget {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.change-request-widget__btn {
  position: relative;
}

.change-request-widget__btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
}

.change-request-widget__count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.change-request-modal .modal-card {
  width: min(720px, 96vw);
}

.change-request-modal__close {
  margin-left: auto;
}

.change-request-modal__context {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(241, 245, 249, 0.75);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.35;
  color: #334155;
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.change-request-modal__context span {
  word-break: break-word;
}

.change-request-modal__status {
  min-height: 18px;
  margin-top: 8px;
}

.change-request-modal__edit {
  margin-top: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(248, 250, 252, 0.9);
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 6px;
}

.change-request-modal__edit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #334155;
}

.change-request-modal__edit-actions {
  display: flex;
  justify-content: flex-end;
}

.change-request-modal__history {
  margin-top: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(248, 250, 252, 0.9);
  border-radius: 10px;
  padding: 10px;
}

.change-request-modal__history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.change-request-modal__history-status {
  min-height: 16px;
  margin-top: 6px;
}

.change-request-modal__history-list {
  margin-top: 6px;
  max-height: 230px;
  overflow: auto;
  display: grid;
  gap: 6px;
  padding-right: 2px;
}

.change-request-history-item {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  display: grid;
  gap: 4px;
}

.change-request-history-item.is-active {
  border-color: rgba(37, 99, 235, 0.75);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}

.change-request-history-item__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #334155;
}

.change-request-history-item__title {
  font-size: 12px;
  color: #0f172a;
  font-weight: 600;
}

.change-request-history-item__message {
  font-size: 12px;
  color: #334155;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.change-request-history-item__meta {
  font-size: 11px;
  color: #475569;
}

.change-request-history-item__summary {
  font-size: 11px;
  color: #0f766e;
}

.change-request-history-item__actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.change-request-history-item__status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 11px;
  line-height: 1.4;
  border: 1px solid transparent;
}

.change-request-history-item__status.is-open {
  color: #854d0e;
  background: #fef3c7;
  border-color: #fde68a;
}

.change-request-history-item__status.is-done {
  color: #065f46;
  background: #dcfce7;
  border-color: #bbf7d0;
}

.change-request-history-item__status.is-progress {
  color: #1d4ed8;
  background: #dbeafe;
  border-color: #bfdbfe;
}

.change-request-history-item__status.is-pending {
  color: #854d0e;
  background: #fef3c7;
  border-color: #fde68a;
}

.change-request-history-item__status.is-approved {
  color: #065f46;
  background: #dcfce7;
  border-color: #bbf7d0;
}

.change-request-history-item__status.is-rejected {
  color: #b91c1c;
  background: #fee2e2;
  border-color: #fecaca;
}

.change-request-modal__prefill-controls {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.change-request-modal__prefill-label {
  font-size: 12px;
  color: #475569;
}

.change-request-modal__prefill-controls .btn {
  min-height: 30px;
  padding: 0.2rem 0.55rem;
  font-size: 12px;
}

[data-theme="dark"] .change-request-modal__context,
.dark .change-request-modal__context {
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(30, 41, 59, 0.72);
  color: #e2e8f0;
}

[data-theme="dark"] .change-request-modal__edit,
[data-theme="dark"] .change-request-modal__history,
.dark .change-request-modal__edit,
.dark .change-request-modal__history {
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(30, 41, 59, 0.72);
}

[data-theme="dark"] .change-request-history-item,
.dark .change-request-history-item {
  border-color: rgba(148, 163, 184, 0.38);
  background: rgba(15, 23, 42, 0.82);
}

[data-theme="dark"] .change-request-modal__edit-head,
[data-theme="dark"] .change-request-history-item__top,
[data-theme="dark"] .change-request-history-item__message,
[data-theme="dark"] .change-request-history-item__meta,
[data-theme="dark"] .change-request-history-item__title,
.dark .change-request-modal__edit-head,
.dark .change-request-history-item__top,
.dark .change-request-history-item__message,
.dark .change-request-history-item__meta,
.dark .change-request-history-item__title {
  color: #e2e8f0;
}
