:root {
  --scc-bg: #101722;
  --scc-card: #202732;
  --scc-card-2: #253041;
  --scc-text: #f3f4f6;
  --scc-muted: #a8adb7;
  --scc-line: rgba(255,255,255,.12);
  --scc-accent: #ff7a2f;
  --scc-accent-2: #ff995f;
  --scc-danger: #ff6b6b;
  --scc-ok: #60d394;
  --scc-radius: 18px;
  --scc-shadow: 0 18px 60px rgba(0,0,0,.22);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; background: transparent !important; }
body.scc-app-body {
  background: transparent !important;
  color: var(--scc-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
.scc-app {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px;
  background: transparent !important;
}
.scc-app.is-embedded {
  padding: 0;
}
.scc-app.is-embedded .scc-shell {
  box-shadow: none;
}
.scc-shell {
  border-radius: 24px;
  background: radial-gradient(circle at top left, rgba(68,96,132,.30), transparent 36%), linear-gradient(135deg, #1d2e42 0%, #172434 48%, #101722 100%);
  box-shadow: var(--scc-shadow);
  padding: 22px;
}
.scc-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.scc-title { margin: 0 0 8px; font-size: clamp(24px, 4vw, 38px); line-height: 1.1; letter-spacing: -.02em; }
.scc-subtitle { color: var(--scc-muted); margin: 0; line-height: 1.45; max-width: 760px; }
.scc-version { color: var(--scc-muted); font-size: 13px; white-space: nowrap; padding-top: 7px; }
.scc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.scc-card {
  background: rgba(31,39,52,.94);
  border: 1px solid var(--scc-line);
  border-radius: var(--scc-radius);
  padding: 18px;
}
.scc-card.scc-wide { grid-column: 1 / -1; }
.scc-card h2 {
  margin: 0 0 14px;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.scc-section-note {
  margin: -4px 0 14px;
  color: var(--scc-muted);
  font-size: 14px;
  line-height: 1.45;
}
.scc-additional-params {
  margin-top: 16px;
}

.scc-additional-params .scc-section-note a {
  color: #7dd3fc;
  text-decoration-color: rgba(125, 211, 252, .72);
  text-underline-offset: 3px;
}
.scc-additional-params .scc-section-note a:visited { color: #93c5fd; }
.scc-additional-params .scc-section-note a:hover,
.scc-additional-params .scc-section-note a:focus {
  color: #bae6fd;
  text-decoration-color: #bae6fd;
}
.scc-field { margin: 14px 0; }
.scc-field:first-child { margin-top: 0; }


.scc-option span span a {
  color: #7dd3fc;
  text-decoration-color: rgba(125, 211, 252, .72);
  text-underline-offset: 3px;
}
.scc-option span span a:visited { color: #93c5fd; }
.scc-option span span a:hover,
.scc-option span span a:focus {
  color: #bae6fd;
  text-decoration-color: #bae6fd;
}

.scc-option-note {
  margin: 6px 0 0 34px;
  color: var(--scc-muted);
  font-size: 14px;
  line-height: 1.45;
}
.scc-option-note a {
  color: #7dd3fc;
  text-decoration-color: rgba(125, 211, 252, .72);
  text-underline-offset: 3px;
}
.scc-option-note a:visited { color: #93c5fd; }
.scc-option-note a:hover,
.scc-option-note a:focus {
  color: #bae6fd;
  text-decoration-color: #bae6fd;
}
.scc-label { display: block; font-weight: 700; margin-bottom: 8px; color: var(--scc-text); }
.scc-help { color: var(--scc-muted); font-size: 14px; line-height: 1.35; margin: 6px 0 0; }
.scc-subfield { margin-top: 14px; margin-left: 18px; padding-left: 14px; border-left: 2px solid rgba(255,122,47,.45); }
.scc-label--sub { margin-bottom: 6px; }
.scc-select, .scc-input {
  width: 100%;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px;
  background-color: #111318;
  color: var(--scc-text);
  padding: 12px 12px;
  font-size: 16px;
  outline: none;
}
.scc-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 48px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23f3f4f6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  background-size: 18px 18px;
}
.scc-input[type="number"] { max-width: 160px; }
.scc-range-row { display: grid; grid-template-columns: 1fr 54px; gap: 12px; align-items: center; }
.scc-range-row input[type="range"] { width: 100%; accent-color: var(--scc-accent); }
.scc-range-value { text-align: center; font-weight: 800; color: #fff; background: #111318; border: 1px solid rgba(255,255,255,.14); border-radius: 10px; padding: 8px 0; }
.scc-radio-list, .scc-check-list { display: grid; gap: 10px; }
.scc-radio-list-inline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.scc-brand-choice-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.scc-brand-choice-list .scc-option { align-items: center; }
.scc-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 12px;
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 13px;
  cursor: pointer;
}
.scc-option:hover { border-color: rgba(255,122,47,.45); }
.scc-option input { margin-top: 3px; accent-color: var(--scc-accent); }
.scc-option strong { display: block; }
.scc-option span { color: var(--scc-muted); }
.scc-conditional {
  margin: 9px 0 0 30px;
  display: none;
}
.scc-option:has(input:checked) + .scc-conditional,
.scc-conditional.is-open { display: block; }
.scc-equipment { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.scc-outdoor-grid { display: grid; gap: 14px; }
.scc-outdoor-grid--checks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.scc-outdoor-grid--ranges { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 8px; }
.scc-outdoor-grid .scc-field { margin: 0; }
.scc-outdoor-grid .scc-input[type="number"] { max-width: 100%; }
.scc-submit-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.scc-submit-row[hidden], .scc-submit-row.scc-submit-row--hidden { display: none !important; }
.scc-button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  font-size: 16px;
  font-weight: 800;
  color: #121212;
  background: linear-gradient(135deg, var(--scc-accent), var(--scc-accent-2));
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(255,122,47,.28);
}
.scc-button:disabled { opacity: .65; cursor: wait; }
.scc-secondary { color: var(--scc-muted); font-size: 14px; }
.scc-result { margin-top: 18px; display: none; }
.scc-result.is-visible { display: block; }
.scc-result-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.scc-result-box { background: #111318; border: 1px solid var(--scc-line); border-radius: 14px; padding: 14px; }
.scc-result-box small { display: block; color: var(--scc-muted); margin-bottom: 8px; }
.scc-result-box strong { font-size: 20px; }
.scc-result-box.scc-total { border-color: rgba(255,122,47,.62); }
.scc-meta { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin: 12px 0; color: var(--scc-muted); }
.scc-note { color: var(--scc-muted); line-height: 1.45; font-size: 14px; border-top: 1px solid var(--scc-line); padding-top: 14px; }
.scc-groups { margin-top: 12px; border-top: 1px solid var(--scc-line); padding-top: 12px; }
.scc-groups table { width: 100%; border-collapse: collapse; }
.scc-groups th, .scc-groups td { padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.06); text-align: left; }
.scc-groups td:last-child { text-align: right; }
.scc-error { color: var(--scc-danger); background: rgba(255,107,107,.10); border: 1px solid rgba(255,107,107,.25); padding: 12px; border-radius: 14px; display:none; }
.scc-error.is-visible { display:block; }
.scc-lock { color: var(--scc-muted); font-size: 14px; margin-top: 10px; }

@media (max-width: 820px) {
  .scc-app { padding: 8px; }
  .scc-shell { padding: 14px; border-radius: 18px; }
  .scc-head { display: block; }
  .scc-version { margin-top: 8px; }
  .scc-grid, .scc-result-grid, .scc-meta { grid-template-columns: 1fr; }
  .scc-equipment, .scc-outdoor-grid--checks, .scc-outdoor-grid--ranges, .scc-radio-list-inline { grid-template-columns: 1fr; }
}

/* v0.1.1 UI refinements */
.scc-top-choice-card { margin-bottom: 16px; }
.scc-top-choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.scc-top-choice-card .scc-field { margin: 0; }
.scc-radio-list-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.scc-help-under-label { margin: -3px 0 10px; }
.scc-range-row { margin-top: 8px; }
.scc-range-row input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  height: 22px;
  background: transparent;
  accent-color: var(--scc-accent);
}
.scc-range-row input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,.22);
}
.scc-range-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--scc-accent);
  border: 2px solid #15171a;
  box-shadow: 0 4px 12px rgba(0,0,0,.28);
}
.scc-range-row input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,.22);
}
.scc-range-row input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--scc-accent);
  border: 2px solid #15171a;
  box-shadow: 0 4px 12px rgba(0,0,0,.28);
}
.scc-option-rich em {
  display: block;
  color: var(--scc-muted);
  font-style: normal;
  line-height: 1.38;
  margin-top: 3px;
}
.scc-scheme-list { gap: 9px; }
.scc-option-rich { padding: 12px 13px; }

@media (max-width: 820px) {
  .scc-top-choice-grid, .scc-radio-list-compact { grid-template-columns: 1fr; }
}

/* v0.1.2: field text should not be bold */
.scc-label,
.scc-option strong,
.scc-range-value,
.scc-result-box strong,
.scc-groups th {
  font-weight: 400;
}

.scc-sub-option {
  margin-top: 10px;
  margin-left: 18px;
}

/* v0.1.35: service calculation stats; parent shortcode renders the fixed row when embedded */
.scc-service-stats {
  position: sticky;
  bottom: 10px;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;
  align-items: center;
  width: 100%;
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid rgba(255,122,47,.34);
  border-radius: 14px;
  background: rgba(17,19,24,.94);
  box-shadow: 0 10px 30px rgba(0,0,0,.32);
  color: var(--scc-muted);
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
}
.scc-app.is-embedded .scc-service-stats {
  display: none;
}
.scc-service-stats__lines {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.scc-service-stats__items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
.scc-service-stats__items--money,
.scc-service-stats__items--labor {
  padding-top: 2px;
  border-top: 1px solid rgba(255,255,255,.07);
}

.scc-service-stats__items--labor {
  font-size: 12px;
  gap: 6px 12px;
}

.scc-service-stats__link {
  appearance: none;
  display: inline-flex;
  align-items: center;
  min-width: 0;
  min-height: 0;
  width: auto;
  height: auto;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  box-shadow: none;
  color: #7dd3fc;
  font: inherit;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: .04em;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-transform: uppercase;
  cursor: pointer;
}
.scc-service-stats__link:hover,
.scc-service-stats__link:focus {
  color: #bae6fd;
}

.scc-service-stats--public .scc-service-stats__items--money {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.scc-service-stats strong {
  color: var(--scc-text);
  font-weight: 700;
}
.scc-service-stats__status {
  white-space: normal;
  color: var(--scc-muted);
}
.scc-service-stats.is-loading .scc-service-stats__status { color: var(--scc-accent-2); }
.scc-service-stats.is-error .scc-service-stats__status { color: var(--scc-danger); }

@media (max-width: 820px) {
  .scc-service-stats {
    display: block;
    font-size: 12px;
  }
  .scc-service-stats__status {
    display: block;
    margin-top: 6px;
  }
}


/* v0.1.67: admin-only full specification */
.scc-admin-spec {
  margin-top: 18px;
}
.scc-admin-spec-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  background: rgba(17,19,24,.62);
}
.scc-admin-spec-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}
.scc-admin-spec-table th,
.scc-admin-spec-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  text-align: left;
  vertical-align: top;
}
.scc-admin-spec-table th {
  color: var(--scc-text);
  font-weight: 700;
  background: rgba(255,255,255,.035);
}
.scc-admin-spec-table th:nth-child(n+2),
.scc-admin-spec-table td:nth-child(n+2) {
  text-align: right;
  white-space: nowrap;
}
.scc-admin-spec-table tfoot td {
  border-bottom: 0;
  color: var(--scc-text);
  font-weight: 700;
  background: rgba(255,122,47,.08);
}
.scc-admin-spec-missing td {
  color: var(--scc-danger);
}

/* v0.1.120: separate admin channel calculation table */
.scc-admin-spec-subtitle {
  margin: 18px 0 10px;
  font-size: 18px;
}
.scc-admin-channels-table {
  min-width: 720px;
}
.scc-admin-channels-table th:nth-child(2),
.scc-admin-channels-table td:nth-child(2),
.scc-admin-channels-table th:nth-child(3),
.scc-admin-channels-table td:nth-child(3) {
  width: 190px;
  min-width: 190px;
  max-width: 190px;
}
.scc-admin-channels-table th:nth-child(2),
.scc-admin-channels-table th:nth-child(3) {
  white-space: normal;
  line-height: 1.15;
}


/* v0.1.94: Wiren Board smart home preparation block */
.scc-wiren-board-section {
  margin-top: 16px;
}
.scc-wiren-board-options {
  margin-left: 0;
}
.scc-wiren-board-subsection-body {
  margin-left: 30px;
  padding: 10px 12px;
  border-left: 2px solid rgba(255,122,47,.42);
  background: rgba(255,255,255,.025);
  border-radius: 0 12px 12px 0;
}
.scc-wiren-board-subsection-body .scc-help {
  margin: 0;
}

/* v0.1.95: Wiren Board lighting sliders */
.scc-wb-lighting-fields {
  display: grid;
  gap: 14px;
}
.scc-wb-lighting-field {
  margin: 0;
}
.scc-wb-lighting-field--sub {
  margin-top: -2px;
}
.scc-wb-lighting-field--sub .scc-label {
  font-style: italic;
}

/* v0.1.99: nested Wiren Board load-line voltage-control sliders */
.scc-wb-load-line-field--with-dependent {
  padding: 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 13px;
  background: rgba(255,255,255,.025);
}
.scc-wb-dependent-range {
  margin-top: 14px;
  padding: 12px 12px 4px;
  border-radius: 12px;
  background: rgba(0,0,0,.14);
  border: 1px solid rgba(255,255,255,.08);
}
.scc-wb-dependent-range[hidden] {
  display: none !important;
}

/* v0.1.109: disabled optional modules when controller is omitted */
.scc-wb-controller-modules-list.is-disabled {
  opacity: .45;
  filter: grayscale(.35);
}
.scc-wb-controller-modules-list.is-disabled .scc-option {
  cursor: not-allowed;
}
.scc-wb-controller-modules-list.is-disabled input {
  cursor: not-allowed;
}


/* v0.1.125: calculation input export/import */
.scc-calculation-data-tools__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}
.scc-button-secondary {
  background: rgba(255,255,255,.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: none;
}
.scc-button-secondary:hover {
  border-color: rgba(255,122,47,.55);
}
.scc-calculation-data-tools__status {
  min-height: 18px;
  margin-top: 10px;
}
.scc-calculation-data-tools__status.is-ok {
  color: #b7f7c2;
}
.scc-calculation-data-tools__status.is-error {
  color: var(--scc-danger);
}

/* v0.1.140: email result sending */
.scc-email-results {
  margin-top: 18px;
}
.scc-email-results__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}
.scc-email-results__status {
  min-height: 18px;
  margin-top: 10px;
}
.scc-email-results__status.is-ok {
  color: #b7f7c2;
}
.scc-email-results__status.is-error {
  color: var(--scc-danger);
}
@media (max-width: 820px) {
  .scc-email-results__row {
    grid-template-columns: 1fr;
  }
}
