/* PlaneWise guided SGS report editor ----------------------------------- */

.editor-view {
  --editor-border: #d7e3e6;
  --editor-border-strong: #bfd1d6;
  --editor-ink: #17333f;
  --editor-muted: #6f858e;
  --editor-teal: #0f7f84;
  --editor-teal-soft: #eaf7f7;
  --editor-rail: #f4f8f8;
}

.editor-view .editor-surface {
  width: 100%;
  max-width: 1320px;
  overflow: hidden;
  border-color: var(--editor-border);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(22, 50, 61, 0.06);
}

.editor-view .editor-surface-head {
  min-height: 78px;
  border-bottom: 1px solid var(--editor-border);
  padding: 16px 24px;
}

.editor-view .editor-title-icon {
  width: 42px;
  height: 42px;
  border-color: #bee0e1;
  border-radius: 9px;
  background: var(--editor-teal-soft);
}

.editor-view .editor-title-icon img {
  width: 21px;
  height: 21px;
}

.editor-view .editor-title-block .eyebrow {
  margin-bottom: 2px;
  color: #71858e;
  font-size: 0.66rem;
  letter-spacing: 0.09em;
}

.editor-view .editor-title-block h2 {
  color: var(--editor-ink);
  font-size: clamp(1.1rem, 1.7vw, 1.35rem);
  font-weight: 760;
  letter-spacing: -0.015em;
}

.editor-view .editor-mode-badge {
  border-color: #cde2e3;
  color: #1d6568;
  background: #f4fbfb;
  text-transform: none;
}

.editor-view .report-form {
  display: block;
}

.editor-view .editor-context {
  display: block;
  border-bottom: 1px solid var(--editor-border);
  background: #ffffff;
}

.editor-view .editor-context .editor-summary {
  min-height: 58px;
  border: 0;
  padding: 11px 24px;
  background: #ffffff;
}

.editor-view .editor-summary > div:first-child > span {
  color: #748892;
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.editor-view .editor-summary > div:first-child > strong {
  margin-top: 3px;
  color: var(--editor-ink);
  font-size: 0.88rem;
  font-weight: 760;
}

.editor-view .editor-summary-meta span:not(.risk-badge) {
  min-height: 28px;
  border-color: #d8e4e6;
  color: #536b75;
  background: #f8fbfb;
  font-size: 0.69rem;
  font-weight: 730;
}

.editor-workspace {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  min-height: 520px;
}

.editor-step-rail {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border-right: 1px solid var(--editor-border);
  padding: 20px 14px 16px;
  background: var(--editor-rail);
}

.editor-view .editor-progress {
  display: grid;
  gap: 8px;
  border: 0;
  padding: 0 10px 17px;
}

.editor-progress-kicker {
  color: #6e848d !important;
  font-size: 0.62rem !important;
  font-weight: 780 !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.editor-view .editor-progress-copy {
  justify-content: flex-start;
  gap: 9px;
}

.editor-view .editor-progress-copy strong {
  flex: 0 0 auto;
  color: var(--editor-ink);
  font-size: 0.94rem;
  font-weight: 760;
}

.editor-view .editor-progress-copy span {
  color: #7a8f97;
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: none;
}

.editor-view .editor-progress-track {
  height: 5px;
  background: #d7e4e6;
}

.editor-view .editor-progress-bar {
  background: linear-gradient(90deg, #169397, #43b2b4);
}

.editor-view .editor-tabs {
  position: relative;
  top: auto;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  overflow: visible;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.editor-view .editor-tabs::before {
  position: absolute;
  z-index: -1;
  top: 31px;
  bottom: 31px;
  left: 24px;
  width: 1px;
  background: #cbdadd;
  content: "";
}

.editor-view .editor-tab {
  position: relative;
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 61px;
  flex: none;
  gap: 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 10px;
  color: #48616c;
  background: transparent;
  box-shadow: none;
  text-align: left;
}

.editor-view .editor-tab:hover {
  transform: none;
  border-color: #d5e4e6;
  background: rgba(255, 255, 255, 0.76);
}

.editor-view .editor-tab:focus-visible {
  outline: 3px solid rgba(15, 127, 132, 0.2);
  outline-offset: 1px;
}

.editor-view .editor-tab-index {
  position: relative;
  z-index: 1;
  width: 31px;
  height: 31px;
  border-color: #bfd0d4;
  color: #57707a;
  background: #ffffff;
  font-size: 0.7rem;
}

.editor-view .editor-tab-copy {
  gap: 3px;
}

.editor-view .editor-tab-copy strong {
  color: #38515d;
  font-size: 0.78rem;
  font-weight: 740;
}

.editor-view .editor-tab-copy small {
  color: #7c9098;
  font-size: 0.63rem;
  font-weight: 620;
  line-height: 1.3;
  white-space: normal;
}

.editor-view .editor-tab.is-active {
  border-color: transparent;
  color: var(--editor-ink);
  background: #e7f5f5;
  box-shadow: none;
}

.editor-view .editor-tab.is-active .editor-tab-index {
  border-color: var(--editor-teal);
  color: #ffffff;
  background: var(--editor-teal);
}

.editor-view .editor-tab.is-active .editor-tab-copy strong {
  color: #0f6f73;
}

.editor-view .editor-tab.is-complete .editor-tab-index {
  border-color: #9bd1d2;
  color: transparent;
  background: #e9f8f7;
}

.editor-view .editor-tab.is-complete .editor-tab-index::after {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--editor-teal);
  content: "✓";
  font-size: 0.8rem;
  font-weight: 850;
}

.editor-rail-help {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  margin: auto 10px 0;
  border: 1px solid #d4e1e4;
  border-radius: 8px;
  padding: 11px;
  color: #607681;
  background: rgba(255, 255, 255, 0.86);
}

.editor-rail-help > span {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  color: #0b7a80;
  background: #e7f6f6;
  font-size: 0.68rem;
  font-weight: 850;
}

.editor-rail-help p {
  margin: 0;
  font-size: 0.66rem;
  line-height: 1.45;
}

.editor-panel-stage {
  min-width: 0;
  background: #ffffff;
}

.editor-view .report-form .editor-panel {
  grid-template-columns: 1fr;
  align-content: start;
  gap: 19px;
  min-height: 520px;
  border: 0;
  padding: 25px 36px 34px;
  background: #ffffff;
}

.editor-view .report-form .editor-panel:focus-within {
  box-shadow: none;
}

.editor-view .editor-panel-intro {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
}

.editor-view .editor-panel-intro > div {
  min-width: 0;
}

.editor-view .editor-panel-intro p {
  margin: 0 0 7px;
  color: var(--editor-teal);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.editor-view .editor-panel-intro h3 {
  margin: 0;
  color: var(--editor-ink);
  font-size: clamp(1.28rem, 2vw, 1.62rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.editor-view .editor-panel-intro div > span {
  display: block;
  margin-top: 5px;
  color: #5c747e;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.45;
}

.editor-view .editor-panel-intro > small {
  flex: 0 0 auto;
  padding-top: 30px;
  color: #96613d;
  font-size: 0.66rem;
  white-space: nowrap;
}

.editor-guidance {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  border: 1px solid #c4e4e4;
  border-radius: 8px;
  padding: 11px 13px;
  color: #496871;
  background: #edf8f8;
}

.editor-guidance > span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid #76c4c6;
  border-radius: 50%;
  color: #087b80;
  font-size: 0.7rem;
  font-weight: 850;
}

.editor-guidance p {
  min-width: 0;
  margin: 0;
  font-size: 0.7rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.editor-guidance strong {
  display: block;
  color: #234f59;
  font-size: 0.72rem;
}

.editor-view .form-grid {
  gap: 18px 16px;
}

.editor-view .risk-grid {
  gap: 16px;
}

.editor-view .report-form label {
  align-content: start;
  gap: 7px;
}

.editor-view .report-form label > span:first-child {
  color: #3d5661;
  font-size: 0.7rem;
  font-weight: 690;
}

.editor-view .report-form label:has(> input[required]) > span:first-child::after,
.editor-view .report-form label:has(> select[required]) > span:first-child::after,
.editor-view .report-form label:has(> textarea[required]) > span:first-child::after {
  color: #b86055;
  content: " *";
}

.editor-view .report-form label > small {
  color: #7b9098;
  font-size: 0.63rem;
  font-weight: 520;
  line-height: 1.4;
}

.editor-view .report-form input,
.editor-view .report-form select,
.editor-view .report-form textarea {
  border-color: var(--editor-border-strong);
  border-radius: 8px;
  color: #294550;
  background: #ffffff;
  box-shadow: none;
}

.editor-view .report-form input,
.editor-view .report-form select {
  min-height: 46px;
  padding-inline: 13px;
}

.editor-view .report-form textarea {
  min-height: 108px;
  padding: 12px 13px;
  line-height: 1.5;
}

.editor-view .report-form textarea[name="summary"] {
  min-height: 148px;
}

.editor-view .report-form input:hover,
.editor-view .report-form select:hover,
.editor-view .report-form textarea:hover {
  border-color: #92adb4;
}

.editor-view .report-form input:focus,
.editor-view .report-form select:focus,
.editor-view .report-form textarea:focus {
  border-color: var(--editor-teal);
  box-shadow: 0 0 0 3px rgba(15, 127, 132, 0.14);
}

.editor-view .attachment-tools input[type="file"] {
  min-height: 46px;
  border-style: dashed;
  background: #f8fbfb;
}

.editor-view .form-status {
  margin: 18px 36px;
}

.editor-view .form-actions {
  position: sticky;
  bottom: 0;
  z-index: 4;
  min-height: 70px;
  gap: 9px;
  margin: 0;
  border-top: 1px solid var(--editor-border);
  padding: 12px 24px;
  background: rgba(251, 253, 253, 0.97);
  box-shadow: 0 -5px 18px rgba(20, 48, 59, 0.035);
  backdrop-filter: blur(12px);
}

.editor-view .form-actions .danger-button {
  margin-right: auto;
}

.editor-view .editor-step-actions {
  margin-left: auto;
}

.editor-view .editor-save-actions {
  margin-left: 0;
}

.editor-view .form-actions button {
  min-height: 38px;
}

.editor-view #editorNextButton {
  border-color: #99c7c9;
  color: #0b7175;
  background: #f3fbfb;
}

@media (max-width: 1120px) {
  .editor-workspace {
    grid-template-columns: 238px minmax(0, 1fr);
  }

  .editor-view .report-form .editor-panel {
    padding-inline: 26px;
  }
}

@media (max-width: 900px) {
  .editor-view .editor-surface-head {
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }

  .editor-workspace {
    grid-template-columns: 1fr;
  }

  .editor-step-rail {
    display: grid;
    grid-template-columns: minmax(220px, 0.55fr) minmax(0, 1fr);
    gap: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--editor-border);
    padding: 15px 18px;
  }

  .editor-view .editor-progress {
    align-content: center;
    padding: 0;
  }

  .editor-view .editor-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .editor-view .editor-tabs::before,
  .editor-rail-help {
    display: none;
  }

  .editor-view .editor-tab {
    width: auto;
    min-width: 132px;
    min-height: 52px;
    flex: 0 0 auto;
  }

  .editor-view .editor-tab-copy small {
    display: none;
  }

  .editor-view .report-form .editor-panel {
    min-height: 430px;
  }
}

@media (max-width: 700px) {
  .editor-view .editor-surface-head {
    min-height: 68px;
    align-items: center;
    flex-direction: row;
    padding: 13px 15px;
  }

  .editor-view .editor-context .editor-summary {
    grid-template-columns: 1fr;
    padding: 11px 15px;
  }

  .editor-view .editor-summary-meta {
    justify-content: flex-start;
  }

  .editor-step-rail {
    grid-template-columns: 1fr;
    padding: 13px 12px 9px;
  }

  .editor-view .editor-tabs {
    margin-inline: -2px;
  }

  .editor-view .report-form .editor-panel {
    gap: 16px;
    min-height: 0;
    padding: 20px 15px 26px;
  }

  .editor-view .editor-panel-intro {
    display: block;
  }

  .editor-view .editor-panel-intro > small {
    display: block;
    padding-top: 8px;
  }

  .editor-view .form-grid,
  .editor-view .risk-grid,
  .editor-view .attachment-tools {
    grid-template-columns: 1fr;
  }

  .editor-view .form-actions {
    flex-wrap: wrap;
    padding: 11px 13px;
  }

  .editor-view .form-actions .danger-button:not([hidden]) {
    width: 100%;
  }

  .editor-view .editor-step-actions,
  .editor-view .editor-save-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
  }

  .editor-view .editor-save-actions {
    order: -1;
  }

  .editor-view .form-actions button {
    width: 100%;
  }
}

@media (max-width: 440px) {
  .editor-view .editor-mode-badge {
    display: none;
  }

  .editor-view .editor-title-icon {
    display: grid;
    width: 38px;
    height: 38px;
  }

  .editor-view .editor-tab {
    min-width: 116px;
  }

  .editor-view .editor-progress-copy {
    justify-content: space-between;
  }

  .editor-view .editor-panel-intro h3 {
    font-size: 1.24rem;
  }

  .editor-guidance {
    align-items: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .editor-view .editor-progress-bar,
  .editor-view .editor-tab,
  .editor-view .report-form input,
  .editor-view .report-form select,
  .editor-view .report-form textarea {
    transition: none;
  }
}
