/* Salgoo Lite Interactive High-CPC Calculators & Policy Diagnostics */
.calc-hub-wrap {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.calc-tool-nav {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 8px;
}

.calc-tool-nav-list {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  list-style: none;
  margin: 0;
  padding: 2px 4px;
  scroll-snap-type: inline proximity;
  scrollbar-width: thin;
}

.calc-tool-link {
  flex: none;
  scroll-snap-align: start;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 9px;
  background: #f1f5f9;
  color: #334155;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
}

.calc-tool-link:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.calc-tool-link[aria-current="page"] {
  background: #eff6ff;
  color: var(--brand-primary);
  border-color: #bfdbfe;
}

.calc-tool-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  inset: auto 10px 0;
  border-block-end: 3px solid var(--brand-primary);
}

.calc-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.calc-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  color: #0f4c81;
  background: #dbeafe;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.calc-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 14px;
}

.calc-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.calc-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.calc-field label,
.calc-fieldset legend {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}

.calc-hint {
  font-size: 12px;
  color: #475569;
  margin: 0;
}

.calc-input,
.calc-select {
  width: 100%;
  font: inherit;
  font-size: max(1rem, 1em);
  min-height: 48px;
  padding: 10px 14px;
  border: 1.5px solid #94a3b8;
  border-radius: 10px;
  background: #ffffff;
  color: #0f172a;
  transition: border-color 0.15s ease;
}

.calc-input:focus-visible,
.calc-select:focus-visible,
.calc-submit-btn:focus-visible,
.calc-tool-link:focus-visible,
.calc-radio-label:focus-within {
  outline: 3px solid #0b57d0;
  outline-offset: 2px;
}

.calc-input:user-invalid,
.calc-input[aria-invalid="true"] {
  border-color: #dc2626;
  background: #fef2f2;
}

.calc-error {
  font-size: 13px;
  font-weight: 700;
  color: #b91c1c;
  min-height: 18px;
}

.calc-fieldset {
  margin: 0;
  padding: 12px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
}

.calc-fieldset legend {
  padding: 0 6px;
}

.calc-radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.calc-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
}

.calc-radio-label input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand-primary);
  margin: 0;
}

.calc-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.calc-chip-btn {
  border: 1px solid #cbd5e1;
  background: #f1f5f9;
  color: #1e293b;
  border-radius: 999px;
  padding: 6px 12px;
  min-height: 36px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.calc-chip-btn:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #0f4c81;
}

.calc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.calc-submit-btn {
  min-height: 50px;
  padding: 12px 24px;
  border: 0;
  border-radius: 10px;
  background: var(--brand-primary);
  color: #ffffff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.calc-submit-btn:hover {
  background: var(--brand-dark);
}

.calc-secondary-btn {
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  color: #334155;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.calc-result-panel {
  margin-top: 20px;
  padding: 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f0f9ff 0%, #eff6ff 100%);
  border: 1.5px solid #93c5fd;
}

.calc-result-main-label {
  font-size: 13px;
  font-weight: 800;
  color: #0f4c81;
}

.calc-result-main-val {
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin: 4px 0 12px;
}

.calc-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.calc-kpi-box {
  background: #ffffff;
  border: 1px solid #dbeafe;
  border-radius: 9px;
  padding: 10px 12px;
}

.calc-kpi-box span {
  display: block;
  font-size: 12px;
  color: #475569;
  font-weight: 700;
}

.calc-kpi-box strong {
  display: block;
  margin-top: 3px;
  font-size: 16px;
  font-weight: 900;
  color: #0f172a;
}

.calc-table-box {
  margin-top: 14px;
  background: #ffffff;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  overflow: auto;
  max-inline-size: 100%;
  container-type: inline-size;
}

.calc-table-box table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

.calc-table-box thead th {
  position: sticky;
  inset-block-start: 0;
  z-index: 1;
  background: #0f4c81;
  color: #ffffff;
  text-align: left;
  padding: 10px 12px;
  font-weight: 800;
}

.calc-table-box tbody th,
.calc-table-box tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

.calc-table-box tbody tr:last-child th,
.calc-table-box tbody tr:last-child td {
  border-bottom: 0;
}

.calc-benefit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.calc-benefit-item {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 13px;
}

.calc-benefit-item.is-eligible {
  border-color: #16a34a;
  background: #f0fdf4;
}

.calc-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}

.calc-pill-ok {
  background: #dcfce7;
  color: #166534;
}

.calc-pill-wait {
  background: #f1f5f9;
  color: #475569;
}

.calc-tools-index-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.calc-hub-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.calc-hub-tile:hover {
  border-color: var(--brand-primary);
  transform: translateY(-2px);
}

.calc-hub-tile h2 {
  margin: 0;
  font-size: 18px;
  color: #0f172a;
}

.calc-hub-tile p {
  margin: 0;
  font-size: 14px;
  color: #475569;
}

.calc-faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.calc-faq-item {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  background: #f8fafc;
}

.calc-faq-item summary {
  font-weight: 800;
  color: #0f172a;
  cursor: pointer;
}

.calc-faq-item p {
  margin: 8px 0 0;
  font-size: 14px;
  color: #334155;
  line-height: 1.65;
}

.visually-hidden {
  position: absolute;
  clip-path: inset(50%);
  overflow: hidden;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  white-space: nowrap;
}

@container (width < 540px) {
  .calc-table-box table.has-col-labels,
  .calc-table-box table.has-col-labels thead,
  .calc-table-box table.has-col-labels tbody,
  .calc-table-box table.has-col-labels tr,
  .calc-table-box table.has-col-labels th,
  .calc-table-box table.has-col-labels td {
    display: block;
  }
  .calc-table-box table.has-col-labels thead {
    display: none;
  }
  .calc-table-box table.has-col-labels tr {
    margin-bottom: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
  }
  .calc-table-box table.has-col-labels tbody th {
    background: #eff6ff;
    color: #0f4c81;
    font-weight: 800;
  }
  .calc-table-box table.has-col-labels td:nth-child(2)::before { content: var(--label-2) ": "; font-weight: 700; color: #475569; }
  .calc-table-box table.has-col-labels td:nth-child(3)::before { content: var(--label-3) ": "; font-weight: 700; color: #475569; }
  .calc-table-box table.has-col-labels td:nth-child(4)::before { content: var(--label-4) ": "; font-weight: 700; color: #475569; }
}

@media (max-width: 720px) {
  .calc-grid-2,
  .calc-kpi-grid,
  .calc-benefit-grid,
  .calc-tools-index-grid {
    grid-template-columns: 1fr;
  }
  .calc-card {
    padding: 16px;
  }
}
