/* Feature-gap workbenches: additive styles for survey, report, GIS and experiments. */
.feature-gap-page {
  --fg-line: var(--line, var(--ref-border, #e4e8ee));
  --fg-panel: var(--panel, var(--ref-surface, #fff));
  --fg-text: var(--text, var(--ref-text, #172033));
  --fg-muted: var(--muted, var(--ref-muted, #667085));
  --fg-accent: var(--primary, var(--ref-primary, #df672b));
  width: 100%;
  min-width: 0;
}

.feature-gap-nav {
  margin: 8px 3px 13px;
  padding-top: 8px;
  border-top: 1px solid var(--ref-border, #e4e8ee);
}

.feature-gap-nav .nav-section-label {
  padding-top: 8px;
}

.feature-gap-nav-link {
  width: 100%;
  min-height: 39px;
  margin: 2px 0;
  padding: 0 11px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #687481;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  text-align: left;
}

.feature-gap-nav-link:hover {
  border-color: transparent;
  background: var(--ref-surface-hover, #f1f4f7);
  color: var(--ref-text, #172033);
}

.feature-gap-nav-link.active {
  border-color: rgba(223, 103, 43, .13);
  background: var(--ref-primary-soft, #fff1e8);
  color: var(--ref-primary, #df672b);
  font-weight: 750;
}

.feature-gap-nav-link .nav-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}

.fg-page-head {
  align-items: flex-start;
}

.fg-head-meta {
  min-width: 104px;
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 6px;
}

.fg-head-meta small {
  color: var(--fg-muted);
  font-size: 11px;
  white-space: nowrap;
}

.fg-tabs {
  width: 100%;
  min-width: 0;
  padding: 4px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  border: 1px solid var(--fg-line);
  border-radius: 9px;
  background: var(--fg-panel);
}

.fg-tab {
  min-width: 0;
  min-height: 40px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--fg-muted);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.fg-tab:hover {
  color: var(--fg-text);
  background: var(--ref-surface-hover, #f1f4f7);
}

.fg-tab.active {
  border-color: rgba(223, 103, 43, .16);
  color: var(--fg-accent);
  background: var(--ref-primary-soft, #fff1e8);
}

.fg-tab .nav-icon {
  width: 16px;
  height: 16px;
}

.fg-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.fg-workbench {
  padding-top: 20px;
}

.fg-workbench .gap-section-head {
  align-items: flex-start;
}

.fg-inline-action {
  min-height: 31px;
  margin-top: 8px;
  padding: 0 11px;
}

.fg-help,
.field > small.fg-help {
  color: var(--fg-muted);
  line-height: 1.5;
}

.fg-parse-result {
  min-height: 54px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px dashed var(--fg-line);
  border-radius: 7px;
  background: rgba(37, 99, 235, .035);
  color: var(--fg-muted);
  font-size: 12px;
}

.fg-parse-result strong {
  color: var(--fg-text);
  font-size: 13px;
}

.fg-parse-result span {
  overflow-wrap: anywhere;
  text-align: right;
}

.fg-checkset {
  min-width: 0;
  padding: 12px 14px 13px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px 17px;
  border: 1px solid var(--fg-line);
  border-radius: 7px;
  color: var(--fg-muted);
  font-size: 12px;
}

.fg-checkset legend {
  padding: 0 5px;
  color: var(--fg-text);
  font-size: 12px;
  font-weight: 750;
}

.fg-checkset label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.fg-checkset input {
  accent-color: var(--fg-accent);
}

.fg-disclaimer {
  margin: -1px 0 16px;
  border-left-color: #c77c0a;
  background: rgba(199, 124, 10, .08);
}

.fg-history {
  padding-bottom: 0;
}

.fg-history .gap-section-head {
  align-items: flex-start;
}

.fg-history .table-wrap {
  margin-top: 4px;
}

.fg-history .gap-table {
  min-width: 780px;
}

.fg-history td,
.fg-history th {
  vertical-align: middle;
}

.fg-actions {
  min-width: 170px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.fg-actions .btn {
  white-space: nowrap;
}

.fg-metrics .gap-metric strong {
  min-height: 24px;
}

.fg-dialog-mask {
  z-index: 120;
}

.fg-dialog {
  width: min(850px, calc(100% - 26px));
  max-height: min(760px, calc(100vh - 28px));
  overflow: auto;
}

.fg-dialog .modal-body {
  min-width: 0;
}

.fg-review-summary {
  margin-bottom: 15px;
  padding: 11px 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  border: 1px solid var(--fg-line);
  border-radius: 7px;
  color: var(--fg-muted);
  background: var(--fg-panel);
  font-size: 12px;
}

.fg-review-summary span {
  color: var(--fg-text);
  font-weight: 700;
}

html.workspace-theme-dark .feature-gap-nav {
  border-top-color: var(--ref-border, #303941);
}

html.workspace-theme-dark .fg-parse-result {
  background: rgba(82, 128, 220, .1);
}

html.workspace-theme-dark .fg-disclaimer {
  background: rgba(199, 124, 10, .14);
}

@media (max-width: 900px) {
  .fg-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .fg-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fg-page-head,
  .fg-workbench .gap-section-head,
  .fg-history .gap-section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .fg-head-meta {
    justify-items: start;
    grid-template-columns: auto auto;
    align-items: center;
  }

  .fg-parse-result {
    align-items: flex-start;
    flex-direction: column;
  }

  .fg-parse-result span {
    text-align: left;
  }

  .fg-checkset {
    align-items: flex-start;
    flex-direction: column;
  }

  .fg-actions {
    min-width: 0;
  }
}

/* Maintenance card for engineering runtime unavailable */
.gap-maintenance-card {
  max-width: 680px;
  margin: 24px auto;
  padding: 32px 28px;
  text-align: center;
  border: 1px solid var(--fg-line);
  border-radius: 12px;
  background: var(--fg-panel);
}

.gap-maintenance-icon {
  font-size: 56px;
  margin-bottom: 16px;
}

.gap-maintenance-card h3 {
  margin: 0 0 12px;
  color: var(--fg-text);
  font-size: 20px;
  font-weight: 750;
}

.gap-maintenance-card > p {
  margin: 0 0 20px;
  color: var(--fg-muted);
  font-size: 14px;
  line-height: 1.6;
}

.gap-technical-details {
  margin: 20px 0;
  text-align: left;
  border: 1px solid var(--fg-line);
  border-radius: 8px;
  background: rgba(37, 99, 235, .025);
}

.gap-technical-details summary {
  padding: 12px 16px;
  cursor: pointer;
  color: var(--fg-text);
  font-size: 13px;
  font-weight: 650;
}

.gap-technical-details summary:hover {
  background: rgba(37, 99, 235, .04);
}

.gap-details-content {
  padding: 16px;
  border-top: 1px solid var(--fg-line);
  color: var(--fg-muted);
  font-size: 12px;
  line-height: 1.7;
}

.gap-details-content p {
  margin: 12px 0;
}

.gap-details-content strong {
  color: var(--fg-text);
  font-weight: 700;
}

.gap-details-content ul {
  margin: 8px 0;
  padding-left: 20px;
}

.gap-details-content li {
  margin: 6px 0;
}

.gap-maintenance-card .btn {
  margin-top: 4px;
}

html.workspace-theme-dark .gap-technical-details {
  background: rgba(82, 128, 220, .06);
}

html.workspace-theme-dark .gap-technical-details summary:hover {
  background: rgba(82, 128, 220, .09);
}

@media (max-width: 430px) {
  .fg-metrics {
    gap: 7px;
  }

  .fg-metrics .gap-metric {
    min-height: 98px;
    padding: 12px;
  }

  .fg-metrics .gap-metric > strong {
    margin: 8px 0 5px;
    font-size: 20px;
  }

  .fg-tab {
    min-height: 38px;
    font-size: 11px;
  }

  .gap-maintenance-card {
    padding: 24px 20px;
  }

  .gap-maintenance-icon {
    font-size: 44px;
  }
}

.questionnaire-embed-shell {
  position: relative;
  width: 100%;
  min-width: 0;
  height: calc(100vh - 105px);
  height: calc(100dvh - 105px);
  min-height: 620px;
  overflow: hidden;
  background: var(--wc-bg, #f7f9fc);
}

.questionnaire-embed-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: inherit;
  border: 0;
  background: #f4f6f7;
}

.questionnaire-embed-loading {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--wc-bg, #f7f9fc);
  color: var(--wc-muted, #667085);
  font-size: 13px;
  pointer-events: none;
  transition: opacity .18s ease, visibility .18s ease;
}

.questionnaire-embed-loading[hidden],
.questionnaire-embed-shell.is-ready .questionnaire-embed-loading {
  visibility: hidden;
  opacity: 0;
}

.questionnaire-embed-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--wc-border, #e4e8ee);
  border-top-color: var(--wc-accent, #df672b);
  border-radius: 50%;
  animation: questionnaire-embed-spin .7s linear infinite;
}

@keyframes questionnaire-embed-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 760px) {
  .questionnaire-embed-shell {
    height: calc(100dvh - 82px);
    min-height: 540px;
  }
}
