.ccm-banner[hidden],
.ccm-modal[hidden] {
  display: none !important;
}

.ccm-banner {
  position: fixed;
  inset: auto 1rem 1rem 1rem;
  z-index: 1000;
}

.ccm-banner__inner {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  justify-content: space-between;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  border: 1px solid #d0d7de;
  border-radius: 0.875rem;
  background: #ffffff;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18);
}

.ccm-banner__content {
  flex: 1 1 auto;
}

.ccm-banner__title,
.ccm-modal__title {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  line-height: 1.3;
}

.ccm-banner__body,
.ccm-modal__intro,
.ccm-category__description,
.ccm-note {
  color: #425466;
}

.ccm-banner__body p,
.ccm-modal__intro,
.ccm-category__description {
  margin: 0;
}

.ccm-banner__actions,
.ccm-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.ccm-modal__actions {
  justify-content: flex-end;
}

.ccm-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.7rem 1rem;
  border: 1px solid #bfd1e5;
  border-radius: 999px;
  background: #ffffff;
  color: #16324f;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}

.ccm-button:hover,
.ccm-button:focus-visible {
  border-color: #7ba6d1;
  outline: none;
}

.ccm-button--primary {
  border-color: #16324f;
  background: #16324f;
  color: #ffffff;
}

.ccm-button--secondary {
  border-color: #98b3cd;
  background: #eef5fb;
}

.ccm-button--ghost {
  border-color: transparent;
  background: transparent;
}

.ccm-modal {
  position: fixed;
  inset: 0;
  z-index: 1001;
}

.ccm-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
}

.ccm-modal__panel {
  position: relative;
  width: min(100% - 2rem, 48rem);
  margin: 5vh auto;
  padding: 1.5rem;
  border-radius: 1rem;
  background: #ffffff;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22);
}

.ccm-modal__header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.ccm-modal__body {
  display: grid;
  gap: 0.9rem;
}

.ccm-category {
  padding: 1rem;
  border: 1px solid #d0d7de;
  border-radius: 0.875rem;
  background: #f8fbfd;
}

.ccm-category--locked {
  background: #f4f7f9;
}

.ccm-category__main {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
}

.ccm-category__meta {
  flex: 1 1 auto;
}

.ccm-category__label {
  display: inline-block;
  margin-bottom: 0.35rem;
  font-weight: 700;
  color: #16324f;
}

.ccm-category__control {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  min-width: 7rem;
}

.ccm-category__input {
  width: 1.2rem;
  height: 1.2rem;
}

.ccm-category__lock {
  font-size: 0.85rem;
  color: #4e6a85;
}

.ccm-policy-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
  font-size: 0.95rem;
}

.ccm-policy-links__separator {
  color: #8093a7;
}

.ccm-link {
  color: #0e5ea8;
  text-decoration: underline;
}

.ccm-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.5rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.ccm-status-pill--ok {
  background: #d9f6e5;
  color: #0f5b36;
}

.ccm-status-pill--warning {
  background: #fff2d8;
  color: #8a5b00;
}

.ccm-status-pill--error {
  background: #ffe2e0;
  color: #8b1f1f;
}

.ccm-status-pill--info {
  background: #e6f0fb;
  color: #124c83;
}

.ccm-diagnostics-table .ccm-status-pill {
  min-width: 5rem;
}

.ccm-note {
  padding: 0.85rem 1rem;
  border-left: 4px solid #98b3cd;
  background: #f3f7fb;
}

.ccm-diagnostics-panel {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 999;
  width: auto;
  max-height: calc(100vh - 2rem);
  padding: 0.9rem 1rem;
  border: 1px solid #bfd1e5;
  border-radius: 0.875rem;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(12px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.ccm-diagnostics-panel__title {
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #16324f;
}

.ccm-diagnostics-panel__row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0;
  font-size: 0.88rem;
}

.ccm-diagnostics-panel__label {
  color: #425466;
}

.ccm-diagnostics-panel__value {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  text-align: right;
}

.ccm-diagnostics-panel__text {
  color: #16324f;
  text-transform: lowercase;
}

.ccm-diagnostics-panel__details {
  margin-top: 0.85rem;
  border-top: 1px solid #d9e5f1;
  padding-top: 0.75rem;
}

.ccm-diagnostics-panel__summary {
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  color: #16324f;
}

.ccm-diagnostics-panel__note {
  margin: 0.6rem 0 0.75rem;
  color: #425466;
  font-size: 0.8rem;
  line-height: 1.45;
}

.ccm-diagnostics-panel__truncation {
  margin: 0 0 0.75rem;
  color: #8a5b00;
  font-size: 0.78rem;
  line-height: 1.4;
}

.ccm-diagnostics-panel__table-wrap {
  max-height: min(26rem, 45vh);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.ccm-diagnostics-panel__table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.76rem;
}

.ccm-diagnostics-panel__table th,
.ccm-diagnostics-panel__table td {
  padding: 0.45rem 0.4rem;
  border-top: 1px solid #e1e9f2;
  text-align: left;
  vertical-align: top;
}

.ccm-diagnostics-panel__table th {
  color: #425466;
  font-weight: 700;
}

.ccm-diagnostics-panel__table td {
  color: #16324f;
  word-break: break-word;
}

.ccm-diagnostics-panel__table .ccm-status-pill {
  min-width: 0;
}

@media (max-width: 720px) {
  .ccm-banner__inner,
  .ccm-modal__header,
  .ccm-category__main,
  .ccm-diagnostics-panel__row {
    flex-direction: column;
    align-items: stretch;
  }

  .ccm-banner__actions,
  .ccm-modal__actions {
    width: 100%;
  }

  .ccm-button {
    width: 100%;
  }

  .ccm-category__control {
    align-items: flex-start;
  }
}
