/* Client Correction Request wizard — Display Panel, desktop only */

.client-portal-display-body:has([data-cp-ccr-wizard]) {
  overflow: hidden;
  padding: 0;
}

.client-portal-display-body:has([data-cp-ccr-open-overlay]) {
  position: relative;
}

.cp-ccr-open-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cp-ccr-open-overlay[data-cp-ccr-open-overlay="loading"] {
  background: rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.cp-ccr-open-overlay[data-cp-ccr-open-overlay="notice"],
.cp-ccr-open-overlay[data-cp-ccr-open-overlay="error"] {
  pointer-events: auto;
}

.cp-ccr-open-loading-label {
  margin: 0;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(28, 34, 42, 0.92);
  border: 1px solid rgba(159, 215, 239, 0.28);
  color: #f2f5f8;
  font-size: 13px;
}

[data-cp-request-correction][aria-busy="true"] {
  opacity: 0.72;
}

.cp-ccr-open-overlay .cp-ccr-result-card {
  position: relative;
  padding-right: 44px;
}

.cp-ccr-open-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #f2f5f8;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.cp-ccr-open-close:hover,
.cp-ccr-open-close:focus-visible {
  background: rgba(255, 255, 255, 0.08);
}

.cp-ccr-wizard {
  display: flex;
  height: 100%;
  min-height: 0;
  min-width: 0;
  color: #f2f5f8;
  background: linear-gradient(to bottom, rgba(18, 22, 28, 0.55), rgba(8, 10, 14, 0.72));
  position: relative;
  isolation: isolate;
}

.cp-ccr-rail {
  flex: 0 0 248px;
  min-width: 220px;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 14px 18px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.22);
  min-height: 0;
  overflow: auto;
}

.cp-ccr-rail-kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(126, 227, 164, 0.9);
}

.cp-ccr-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 1;
  background: transparent;
}

.cp-ccr-step-item {
  margin: 0;
}

.cp-ccr-step-btn {
  width: 100%;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  text-align: left;
  margin: 0;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.cp-ccr-step-btn.is-current {
  border-color: #59b7de;
  background: rgba(89, 183, 222, 0.16);
  box-shadow: inset 0 0 0 1px #59b7de;
}

.cp-ccr-step-btn.is-completed {
  border-color: rgba(126, 227, 164, 0.55);
  background: rgba(126, 227, 164, 0.1);
}

.cp-ccr-step-btn.is-available {
  opacity: 1;
}

.cp-ccr-step-btn.is-blocked {
  opacity: 0.55;
  cursor: not-allowed;
}

.cp-ccr-step-btn:hover:not(.is-blocked) {
  border-color: rgba(159, 215, 239, 0.7);
  background: rgba(89, 183, 222, 0.12);
}

.cp-ccr-step-btn.is-blocked:hover {
  border-color: rgba(255, 180, 168, 0.45);
  background: rgba(255, 180, 168, 0.08);
}

.cp-ccr-step-btn:focus-visible {
  outline: 2px solid #9fd7ef;
  outline-offset: 2px;
}

.cp-ccr-step-index {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(89, 183, 222, 0.7);
  background: rgba(47, 131, 177, 0.18);
}

.cp-ccr-step-btn.is-current .cp-ccr-step-index {
  background: linear-gradient(to bottom, #4fb0dc, #2f83b1);
  color: #fff;
}

.cp-ccr-step-btn.is-completed .cp-ccr-step-index {
  background: rgba(126, 227, 164, 0.18);
  border-color: rgba(126, 227, 164, 0.7);
  color: #7ee3a4;
}

.cp-ccr-step-copy {
  display: grid;
  gap: 2px;
}

.cp-ccr-step-copy strong {
  font-size: 13px;
}

.cp-ccr-step-copy span {
  font-size: 11px;
  color: rgba(242, 245, 248, 0.62);
}

.cp-ccr-project-card {
  cursor: default;
  flex: 0 0 auto;
  width: auto;
  max-width: 100%;
  padding-top: 14px;
  padding-bottom: 16px;
  gap: 8px;
}

.cp-ccr-project-card .client-portal-project-card-details {
  display: grid;
  gap: 4px;
}

.cp-ccr-project-card .client-portal-project-card-details p {
  line-height: 1.45;
}

.cp-ccr-project-card footer {
  margin-top: 2px;
}

.cp-ccr-project-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.cp-ccr-no-revision-note {
  margin: 6px 0 0;
  font-size: 10px;
  line-height: 1.35;
  color: #f0c14b;
  font-weight: 700;
}

.cp-ccr-stage {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 16px 18px 14px;
}

.cp-ccr-live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.cp-ccr-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}

.cp-ccr-stage-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cp-ccr-intro h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
}

.cp-ccr-intro p {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(242, 245, 248, 0.78);
  max-width: 72ch;
}

.cp-ccr-revision-ref {
  display: inline;
  font-weight: 800;
  color: #9fd7ef;
  text-decoration: underline;
  text-underline-offset: 2px;
  pointer-events: none;
}

.cp-ccr-toolbar {
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
  align-items: center;
}

.cp-ccr-search,
.cp-ccr-filter {
  display: flex;
}

.cp-ccr-search {
  flex: 1 1 auto;
}

.cp-ccr-search input,
.cp-ccr-filter-trigger,
.cp-ccr-detail-card textarea {
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.28);
  color: #f2f5f8;
  font: inherit;
  padding: 8px 10px;
}

.cp-ccr-filter {
  position: relative;
  z-index: 6;
  flex: 0 0 auto;
  min-width: 210px;
}

.cp-ccr-filter-trigger {
  min-width: 210px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  cursor: pointer;
}

.cp-ccr-filter-trigger::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #9fd7ef;
  flex: 0 0 auto;
}

.cp-ccr-filter-trigger[aria-expanded="true"] {
  border-color: #59b7de;
  box-shadow: 0 0 0 1px #59b7de;
}

.cp-ccr-filter-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 6;
  margin: 0;
  padding: 6px;
  list-style: none;
  display: grid;
  gap: 2px;
  border-radius: 10px;
  border: 1px solid rgba(89, 183, 222, 0.45);
  background: #14171a;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  max-height: min(360px, 50vh);
  overflow-y: auto;
  overflow-x: hidden;
}

.cp-ccr-filter-menu[hidden] {
  display: none;
}

.cp-ccr-filter-option {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  color: #f2f5f8;
  cursor: pointer;
  font-size: 13px;
}

.cp-ccr-filter-option.is-active,
.cp-ccr-filter-option:hover {
  background: rgba(89, 183, 222, 0.16);
}

.cp-ccr-filter-option.is-selected {
  border: 1px solid #59b7de;
  background: rgba(89, 183, 222, 0.2);
}

.cp-ccr-search input:focus-visible,
.cp-ccr-filter-trigger:focus-visible,
.cp-ccr-detail-card textarea:focus-visible,
.cp-ccr-reason-input:focus-visible,
.cp-ccr-wizard button:focus-visible {
  outline: 2px solid #9fd7ef;
  outline-offset: 2px;
}

.cp-ccr-selected-count {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: rgba(242, 245, 248, 0.72);
  position: relative;
  z-index: 0;
}

.cp-ccr-step-error {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 180, 168, 0.55);
  background: rgba(255, 180, 168, 0.12);
  color: #ffb4a8;
  font-size: 12px;
  font-weight: 700;
}

.cp-ccr-reasons,
.cp-ccr-details,
.cp-ccr-review {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  overscroll-behavior: contain;
}

.cp-ccr-category + .cp-ccr-category,
.cp-ccr-detail-group + .cp-ccr-detail-group {
  margin-top: 16px;
}

.cp-ccr-category h3,
.cp-ccr-detail-group h3,
.cp-ccr-preview h3 {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9fd7ef;
}

.cp-ccr-category-count {
  font-weight: 700;
  color: rgba(242, 245, 248, 0.55);
}

.cp-ccr-reason-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 8px;
}

.cp-ccr-reason {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 72px;
  margin: 0;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.cp-ccr-reason.is-selected {
  border-color: #59b7de;
  box-shadow: inset 0 0 0 1px #59b7de;
  background: rgba(89, 183, 222, 0.12);
}

.cp-ccr-reason-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.cp-ccr-reason-mark {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(0, 0, 0, 0.25);
}

.cp-ccr-reason.is-selected .cp-ccr-reason-mark {
  background: #4fb0dc;
  border-color: #9fd7ef;
  box-shadow: inset 0 0 0 3px rgba(10, 18, 24, 0.85);
}

.cp-ccr-reason-body {
  display: grid;
  grid-template-columns: 20px 1fr 16px;
  gap: 6px;
  align-items: start;
  min-width: 0;
  flex: 1;
}

.cp-ccr-reason-icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid currentColor;
  opacity: 0.85;
  position: relative;
}

.cp-ccr-reason-icon::before,
.cp-ccr-reason-icon::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid currentColor;
}

.cp-ccr-reason-icon[data-cp-ccr-icon="dimensions"]::before {
  inset: 6px 3px;
  border-top: 0;
  border-bottom: 0;
}

.cp-ccr-reason-icon[data-cp-ccr-icon="racking"]::before {
  inset: 3px;
  background: repeating-linear-gradient(to right, currentColor 0 1px, transparent 1px 4px);
  border: 0;
}

.cp-ccr-reason-icon[data-cp-ccr-icon="other"]::before {
  inset: auto 3px 7px;
  height: 3px;
  border: 0;
  background: radial-gradient(currentColor 1.2px, transparent 1.3px) 0 0 / 5px 4px repeat-x;
}

.cp-ccr-reason-label {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.cp-ccr-reason-info {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid rgba(159, 215, 239, 0.7);
  color: #9fd7ef;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cp-ccr-tooltip-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}

.cp-ccr-tooltip-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 5;
}

.cp-ccr-tooltip-layer[hidden] {
  display: none;
}

.cp-ccr-floating-tooltip {
  position: absolute;
  max-width: min(280px, calc(100% - 24px));
  padding: 8px 10px;
  border-radius: 8px;
  background: #11161c;
  border: 1px solid rgba(159, 215, 239, 0.45);
  color: #f2f5f8;
  font-size: 11px;
  line-height: 1.4;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  z-index: 5;
}

.cp-ccr-empty {
  padding: 28px 12px;
  text-align: center;
  color: rgba(242, 245, 248, 0.7);
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 10px;
}

.cp-ccr-detail-card {
  margin-bottom: 10px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
}

.cp-ccr-detail-card.is-invalid {
  border-color: #ffb4a8;
  box-shadow: inset 0 0 0 1px rgba(255, 180, 168, 0.55);
}

.cp-ccr-detail-head {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.cp-ccr-detail-head h4 {
  margin: 0;
  font-size: 14px;
}

.cp-ccr-detail-head p {
  margin: 2px 0 0;
  font-size: 11px;
  color: rgba(242, 245, 248, 0.62);
}

.cp-ccr-comment-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
}

.cp-ccr-comment-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  font-size: 11px;
  color: rgba(242, 245, 248, 0.62);
}

.cp-ccr-field-error {
  margin: 0;
  color: #ffb4a8;
  font-weight: 700;
}

.cp-ccr-preview {
  max-width: 720px;
  padding: 6px 2px 18px;
}

.cp-ccr-preview h2 {
  margin: 0 0 12px;
  font-size: 22px;
}

.cp-ccr-preview-meta {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
}

.cp-ccr-preview-meta div {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px;
  font-size: 13px;
}

.cp-ccr-preview-meta dt {
  color: rgba(242, 245, 248, 0.6);
  font-weight: 700;
}

.cp-ccr-preview-reasons {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.cp-ccr-preview-reasons li {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cp-ccr-preview-reasons span {
  display: block;
  font-size: 11px;
  color: #9fd7ef;
  margin: 2px 0 6px;
}

.cp-ccr-preview-reasons p {
  margin: 0;
  font-size: 13px;
}

.cp-ccr-preview-note {
  margin: 12px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: #f0c14b;
}

.cp-ccr-actions {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  margin-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cp-ccr-actions-end {
  display: flex;
  gap: 8px;
}

.cp-ccr-btn-secondary {
  border-color: rgba(255, 255, 255, 0.28) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: #f2f5f8 !important;
}

.cp-ccr-prototype-notice,
.cp-ccr-result-notice {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  z-index: 8;
}

.cp-ccr-prototype-card,
.cp-ccr-result-card {
  width: min(420px, calc(100% - 32px));
  padding: 20px;
  border-radius: 12px;
  background: #1c222a;
  border: 1px solid rgba(159, 215, 239, 0.35);
  display: grid;
  gap: 14px;
}

.cp-ccr-prototype-card h2,
.cp-ccr-result-card h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
}

.cp-ccr-result-card p {
  margin: 0;
  color: #d5dde4;
  line-height: 1.45;
}

.cp-ccr-submit-error {
  display: grid;
  gap: 10px;
  margin: 0 16px 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(232, 176, 112, 0.45);
  background: rgba(42, 32, 18, 0.92);
}

.cp-ccr-submit-error p {
  margin: 0;
  color: #f4e6d4;
}

@media (max-height: 800px) {
  .cp-ccr-intro h2 {
    font-size: 18px;
  }
  .cp-ccr-reason {
    min-height: 64px;
    padding: 8px;
  }
  .cp-ccr-rail,
  .cp-ccr-stage {
    padding-top: 12px;
    padding-bottom: 10px;
  }
}

@media (min-width: 1800px) {
  .cp-ccr-rail {
    flex-basis: 280px;
  }
  .cp-ccr-reason-grid {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  }
}
