.stcdb-ss-wrapper {
  max-width: 700px;
  margin: 2rem auto;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.stcdb-ss-form {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 12px;
  padding: 1.5rem;
}

.stcdb-ss-section-label {
  font-weight: 700;
  color: #023E73;
  font-size: 1rem;
  margin: 1.25rem 0 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid #008080;
}

.stcdb-ss-section-label:first-child {
  margin-top: 0;
}

.stcdb-ss-field {
  margin-bottom: 1.15rem;
}

.stcdb-ss-field > label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: #023E73;
  font-size: 0.95rem;
}

.stcdb-ss-field select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #ced4da;
  border-radius: 8px;
  font-size: 1rem;
  background: #fff;
  box-sizing: border-box;
}

.stcdb-ss-field select:focus {
  outline: none;
  border-color: #008080;
  box-shadow: 0 0 0 3px rgba(0, 128, 128, 0.15);
}

.stcdb-ss-radio-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.stcdb-ss-radio-option {
  position: relative;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: #fff;
}

.stcdb-ss-radio-option:has(input:checked) {
  border-color: #008080;
  background: #e6f5f5;
}

.stcdb-ss-radio-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.stcdb-ss-radio-option .stcdb-ss-option-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: #023E73;
  display: block;
}

.stcdb-ss-radio-option .stcdb-ss-option-desc {
  font-size: 0.78rem;
  color: #6c757d;
  display: block;
  margin-top: 2px;
}

.stcdb-ss-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.stcdb-ss-row > .stcdb-ss-field {
  flex: 1;
  margin-bottom: 0;
}

.stcdb-ss-checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
}

.stcdb-ss-checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #008080;
}

.stcdb-ss-checkbox-row label {
  font-weight: 600;
  color: #023E73;
  font-size: 0.9rem;
  cursor: pointer;
}

.stcdb-ss-btn {
  display: block;
  width: 100%;
  padding: 0.85rem;
  background: #008080;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 1rem;
  transition: background 0.2s;
}

.stcdb-ss-btn:hover {
  background: #006666;
}

/* =============================================
   RESULTS SECTION
   ============================================= */

/* Results container */
.stcdb-ss-results {
  display: none;
  margin-top: 1.5rem;
  animation: stcdb-ss-fadeIn 0.4s ease;
}

@keyframes stcdb-ss-fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Color variant borders on results container */
.stcdb-ss-results-green { border-top: 4px solid #28a745; }
.stcdb-ss-results-blue { border-top: 4px solid #0077B6; }
.stcdb-ss-results-yellow { border-top: 4px solid #ffc107; }
.stcdb-ss-results-orange { border-top: 4px solid #FF6B35; }
.stcdb-ss-results-red { border-top: 4px solid #dc3545; }

/* Validation error */
.stcdb-ss-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
}

/* =============================================
   GAUGE / SCORE DISPLAY
   ============================================= */

.stcdb-ss-gauge {
  text-align: center;
  padding: 1.5rem;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 12px;
}

/* Circular score */
.stcdb-ss-score-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 6px solid #dee2e6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.stcdb-ss-score-number {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
}

.stcdb-ss-score-label {
  font-size: 0.8rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 0.15rem;
}

/* Horizontal meter */
.stcdb-ss-meter {
  margin: 0 auto;
  max-width: 400px;
}

.stcdb-ss-meter-track {
  width: 100%;
  height: 10px;
  background: #e9ecef;
  border-radius: 5px;
  overflow: hidden;
}

.stcdb-ss-meter-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.8s ease;
  background: linear-gradient(90deg, #28a745, #ffc107, #dc3545);
}

.stcdb-ss-meter-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: #6c757d;
}

.stcdb-ss-meter-label-low {
  color: #28a745;
  font-weight: 600;
}

.stcdb-ss-meter-label-high {
  color: #dc3545;
  font-weight: 600;
}

/* Risk level name + description */
.stcdb-ss-level-name {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 1rem 0 0.35rem;
}

.stcdb-ss-level-desc {
  font-size: 0.92rem;
  color: #495057;
  line-height: 1.5;
  max-width: 500px;
  margin: 0 auto;
}

/* =============================================
   SCORE BREAKDOWN
   ============================================= */

.stcdb-ss-breakdown-section {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 12px;
  padding: 1.25rem;
  margin-top: 1.25rem;
}

.stcdb-ss-section-title {
  margin: 0 0 0.85rem;
  color: #023E73;
  font-size: 1rem;
  font-weight: 700;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid #008080;
}

.stcdb-ss-breakdown-table {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.stcdb-ss-breakdown-row {
  display: flex;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.stcdb-ss-breakdown-row:last-child {
  border-bottom: none;
}

.stcdb-ss-breakdown-label {
  flex: 1;
  font-weight: 600;
  color: #023E73;
  font-size: 0.88rem;
}

.stcdb-ss-breakdown-value {
  flex: 1;
  color: #495057;
  font-size: 0.88rem;
  text-align: center;
}

.stcdb-ss-breakdown-points {
  width: 60px;
  text-align: right;
  font-weight: 700;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

.stcdb-ss-points-high {
  color: #dc3545;
}

.stcdb-ss-points-med {
  color: #FF6B35;
}

.stcdb-ss-points-low {
  color: #28a745;
}

.stcdb-ss-breakdown-modifier {
  background: #FFF1E6;
  border-radius: 6px;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  margin: 0.25rem 0;
  border-bottom: none;
}

/* =============================================
   SHIP CABIN DIAGRAM
   ============================================= */

.stcdb-ss-diagram-section {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 12px;
  padding: 1.25rem;
  margin-top: 1.25rem;
}

.stcdb-ss-ship-wrap {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.stcdb-ss-ship {
  flex: 1;
  position: relative;
  min-height: 160px;
}

/* Ship hull shape (side-profile silhouette) */
.stcdb-ss-ship-hull {
  position: absolute;
  inset: 0;
  background: #f0f7fb;
  border: 2px solid #b0d4e8;
  border-radius: 8px 40px 8px 8px;
  z-index: 0;
  pointer-events: none;
}

/* BOW / STERN labels */
.stcdb-ss-ship-label {
  position: absolute;
  bottom: -1.4rem;
  font-size: 0.65rem;
  font-weight: 700;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stcdb-ss-label-bow {
  right: 8px;
}

.stcdb-ss-label-stern {
  left: 8px;
}

/* 3x3 cabin grid */
.stcdb-ss-cabin-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 4px;
  padding: 12px;
  height: 100%;
  box-sizing: border-box;
}

.stcdb-ss-cabin-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e9ecef;
  border-radius: 4px;
  min-height: 42px;
  position: relative;
  font-size: 0.75rem;
  color: #6c757d;
  transition: background 0.3s, border-color 0.3s;
}

.stcdb-ss-zone-best {
  background: #d4edda;
  border: 2px solid #28a745;
}

.stcdb-ss-zone-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: #155724;
  text-align: center;
}

.stcdb-ss-zone-yours {
  background: #d1ecf1;
  border: 2px solid #0077B6;
}

.stcdb-ss-zone-badge-yours {
  font-size: 0.7rem;
  font-weight: 700;
  color: #0077B6;
  text-align: center;
}

/* When a zone is both "best" and "yours" */
.stcdb-ss-zone-best.stcdb-ss-zone-yours {
  background: linear-gradient(135deg, #d4edda 50%, #d1ecf1 50%);
  border: 2px solid #28a745;
  box-shadow: 0 0 0 2px #0077B6;
}

/* Deck labels (right side) */
.stcdb-ss-deck-labels {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  padding: 12px 0;
}

.stcdb-ss-deck-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #023E73;
  text-align: left;
  white-space: nowrap;
}

/* Legend */
.stcdb-ss-legend {
  display: flex;
  gap: 1.25rem;
  margin-top: 1.5rem;
  justify-content: center;
  font-size: 0.82rem;
  color: #495057;
}

.stcdb-ss-legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.stcdb-ss-legend-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

.stcdb-ss-swatch-best {
  background: #28a745;
}

.stcdb-ss-swatch-yours {
  background: #0077B6;
}

/* =============================================
   PREVENTION TIPS
   ============================================= */

.stcdb-ss-tips-section {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 12px;
  padding: 1.25rem;
  margin-top: 1.25rem;
}

.stcdb-ss-tips-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.stcdb-ss-tip-item {
  padding: 0.6rem 0 0.6rem 0.85rem;
  border-left: 3px solid #008080;
  margin-bottom: 0.6rem;
  font-size: 0.88rem;
  color: #495057;
  line-height: 1.45;
  background: #f8f9fa;
  border-radius: 0 6px 6px 0;
  padding-right: 0.75rem;
}

.stcdb-ss-tip-item:last-child {
  margin-bottom: 0;
}

/* =============================================
   IDEAL SETUP
   ============================================= */

.stcdb-ss-setup-section {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 12px;
  padding: 1.25rem;
  margin-top: 1.25rem;
}

.stcdb-ss-setup-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

.stcdb-ss-setup-card {
  background: #FFF1E6;
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  transition: transform 0.2s;
}

.stcdb-ss-setup-card:hover {
  transform: translateY(-2px);
}

.stcdb-ss-setup-icon {
  font-size: 1.75rem;
  margin-bottom: 0.4rem;
}

.stcdb-ss-setup-label {
  font-size: 0.72rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.stcdb-ss-setup-value {
  font-weight: 700;
  color: #023E73;
  font-size: 0.92rem;
  margin: 0.3rem 0;
  line-height: 1.3;
}

.stcdb-ss-setup-note {
  font-size: 0.78rem;
  color: #6c757d;
  line-height: 1.35;
}

/* =============================================
   SHARE BUTTON
   ============================================= */

.stcdb-ss-share-section {
  margin-top: 1.25rem;
  text-align: center;
}

.stcdb-ss-share-btn {
  display: inline-block;
  width: 100%;
  padding: 0.75rem 1.5rem;
  background: #008080;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.stcdb-ss-share-btn:hover {
  background: #006666;
  transform: translateY(-1px);
}

.stcdb-ss-share-copied {
  background: #28a745 !important;
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 560px) {
  .stcdb-ss-radio-group {
    grid-template-columns: 1fr;
  }

  .stcdb-ss-row {
    flex-direction: column;
    gap: 0;
  }

  .stcdb-ss-score-circle {
    width: 110px;
    height: 110px;
  }

  .stcdb-ss-score-number {
    font-size: 2.25rem;
  }

  .stcdb-ss-level-name {
    font-size: 1.2rem;
  }

  .stcdb-ss-breakdown-row {
    flex-wrap: wrap;
  }

  .stcdb-ss-breakdown-value {
    text-align: left;
    flex: unset;
    width: 100%;
    order: 3;
    font-size: 0.82rem;
    padding-left: 0;
    margin-top: 0.15rem;
  }

  .stcdb-ss-breakdown-points {
    flex-shrink: 0;
  }

  .stcdb-ss-ship-wrap {
    flex-direction: column;
  }

  .stcdb-ss-deck-labels {
    flex-direction: row;
    justify-content: space-around;
    padding: 0;
  }

  .stcdb-ss-cabin-grid {
    min-height: 130px;
  }

  .stcdb-ss-setup-cards {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .stcdb-ss-legend {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
}
