/* Ad Budget Calculator - calculator-only styles.
 * Every class uses the abc- prefix. Colours, type sizes and spacing come from
 * landing-page-analyzer.css, which is linked first. The shared [hidden] rule lives
 * there and is not restated here.
 */

.abc-tool {
  font-family: Inter, sans-serif;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}

.abc-noscript {
  color: #fca5a5;
  text-align: center;
  margin: 0 0 1rem;
}

/* ---- Tabs and path switch ---- */

.abc-tabs {
  display: flex;
  gap: 0.375rem;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 1.5rem;
  padding: 0.3rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 99px;
}

.abc-tab {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 99px;
  color: rgba(255, 255, 255, 0.65);
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.3;
  padding: 0.55rem 1.4rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  outline-offset: 2px;
}

.abc-tab:hover {
  color: #a5b4fc;
}

.abc-tab[aria-selected="true"] {
  background: rgba(129, 140, 248, 0.15);
  border-color: rgba(129, 140, 248, 0.4);
  color: #a5b4fc;
}

.abc-fieldset {
  border: 0;
  margin: 0 0 1.25rem;
  padding: 0;
  min-width: 0;
}

.abc-seg-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.abc-seg {
  font-family: inherit;
  font-weight: 500;
  position: relative;
  display: inline-block;
  margin: 0;
  cursor: pointer;
}

.abc-seg input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.abc-seg span {
  display: inline-block;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 99px;
  color: rgba(255, 255, 255, 0.65);
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.3;
  padding: 0.45em 1.1em;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.abc-seg:hover span {
  background: rgba(129, 140, 248, 0.12);
  border-color: rgba(129, 140, 248, 0.35);
  color: #a5b4fc;
}

.abc-seg input:checked + span {
  background: rgba(129, 140, 248, 0.15);
  border-color: rgba(129, 140, 248, 0.4);
  color: #a5b4fc;
}

.abc-seg input:focus-visible + span {
  outline: 2px solid #818cf8;
  outline-offset: 2px;
}

/* ---- Layout ---- */

.abc-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .abc-workspace {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    align-items: start;
  }

  .abc-results {
    position: sticky;
    top: 6rem;
  }
}

.abc-panel {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  color: #e2e8f0;
  text-align: left;
  min-width: 0;
}

@media (max-width: 640px) {
  .abc-panel {
    padding: 1.125rem;
  }
}

.abc-subheading {
  font-family: "Aeonik Pro", Inter, sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: #fff;
  margin: 1.75rem 0 0;
  line-height: 1.3;
}

/* ---- Fields ---- */

.abc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

@media (max-width: 640px) {
  .abc-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.abc-field {
  min-width: 0;
}

.abc-label {
  display: block;
  margin: 0 0 0.4rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.3;
  color: #c8d0e0;
}

.abc-input {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  box-sizing: border-box;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  color: #fff;
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.4;
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.abc-input:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.22);
}

.abc-input::placeholder {
  color: rgba(255, 255, 255, 0.28);
}

.abc-input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.abc-input[type="number"]::-webkit-inner-spin-button,
.abc-input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.abc-select {
  color-scheme: dark;
  -webkit-appearance: none;
  appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%23b0b6c3' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
}

.abc-select option {
  background: #101020;
  color: #fff;
}

.abc-input-wrap {
  position: relative;
}

.abc-input-wrap .abc-input {
  padding-right: 3.5rem;
}

.abc-unit {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

.abc-hint {
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #b0b6c3;
  margin: 0.4rem 0 0;
}

/* ---- Channel rows ---- */

.abc-row {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1rem;
  margin-top: 1rem;
}

.abc-row-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 9rem auto;
  gap: 1rem;
  align-items: end;
}

@media (max-width: 640px) {
  .abc-row-head {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
  }

  .abc-field-channel {
    grid-column: 1 / -1;
  }
}

.abc-remove {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.65);
  font-family: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.abc-remove:hover {
  background: rgba(129, 140, 248, 0.12);
  border-color: rgba(129, 140, 248, 0.35);
  color: #a5b4fc;
}

.abc-row-fields {
  margin-top: 1rem;
}

.abc-cpr-chip,
.abc-add {
  margin-top: 1rem;
}

.abc-sources {
  margin-top: 1.25rem;
}

.abc-source {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #b0b6c3;
  margin: 0 0 0.4rem;
}

.abc-source a,
.abc-learning-source a {
  color: #a5b4fc;
}

/* ---- Results ---- */

.abc-summary {
  font-family: "Aeonik Pro", Inter, sans-serif;
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.3;
  color: #fff;
  margin: 0 0 1rem;
}

.abc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  color: #e2e8f0;
}

.abc-table th,
.abc-table td {
  padding: 0.6rem 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-variant-numeric: tabular-nums;
}

.abc-table thead th {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.4);
  text-align: right;
}

.abc-table tbody th {
  text-align: left;
  font-weight: 500;
  color: #fff;
}

.abc-table td {
  text-align: right;
}

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

.abc-cell-expected {
  color: #fff;
  font-weight: 500;
}

.abc-total-row th,
.abc-total-row td {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-weight: 500;
}

.abc-warning {
  background: rgba(245, 166, 35, 0.08);
  border: 1px solid rgba(245, 166, 35, 0.35);
  border-radius: 10px;
  color: #f5a623;
  font-size: 0.875rem;
  line-height: 1.5;
  padding: 0.7rem 0.9rem;
  margin: 1rem 0 0;
}

.abc-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1rem;
  margin: 1.25rem 0 0;
  font-size: 0.9375rem;
}

.abc-facts dt {
  color: #b0b6c3;
  font-weight: 400;
}

.abc-facts dd {
  margin: 0;
  text-align: right;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.abc-block {
  margin-top: 1.5rem;
}

.abc-block-heading {
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.4);
  margin: 0 0 0.625rem;
}

.abc-learning-line {
  font-size: 0.9rem;
  line-height: 1.55;
  color: #c8d0e0;
  margin: 0 0 0.5rem;
}

.abc-learning-source {
  font-size: 0.8125rem;
  margin: 0;
}

.abc-missing-lead {
  font-size: 0.9375rem;
  color: #c8d0e0;
  margin: 0 0 0.5rem;
}

.abc-missing {
  margin: 0;
  padding-left: 1.25rem;
  color: #e2e8f0;
  font-size: 0.9375rem;
  line-height: 1.7;
}

.abc-spread {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #b0b6c3;
  margin: 1.25rem 0 0;
}

.abc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.abc-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.abc-copy-status {
  min-height: 1.3em;
  font-size: 0.8125rem;
  color: #b0b6c3;
  margin: 0.6rem 0 0;
}

.abc-copy-buffer {
  position: fixed;
  top: 0;
  left: -9999px;
  opacity: 0;
}

/* ---- Show the math ---- */

.abc-math {
  margin-top: 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #e2e8f0;
  text-align: left;
}

.abc-math > summary {
  cursor: pointer;
  padding: 1rem 1.25rem;
  font-weight: 500;
  color: #fff;
}

.abc-math > div {
  padding: 0 1.25rem 1.25rem;
}

.abc-steps {
  margin: 0;
  padding-left: 1.25rem;
  color: #c8d0e0;
  font-size: 0.9375rem;
  line-height: 1.7;
}

.abc-math-note {
  font-size: 0.875rem;
  line-height: 1.55;
  color: #b0b6c3;
  margin: 0.5rem 0 0;
}

/* ---- Tables stack on phones ---- */

@media (max-width: 640px) {
  .abc-table,
  .abc-table tbody,
  .abc-table tr {
    display: block;
    width: 100%;
  }

  .abc-table thead {
    display: none;
  }

  .abc-table tr {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.2rem 0.6rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .abc-table tbody tr:last-child {
    border-bottom: 0;
  }

  .abc-table th,
  .abc-table td,
  .abc-table tbody tr:last-child th,
  .abc-table tbody tr:last-child td {
    border: 0;
    padding: 0;
  }

  .abc-table tbody th {
    flex: 0 0 100%;
  }

  .abc-table td {
    text-align: left;
  }

  .abc-table td::before {
    content: attr(data-label) " ";
    font-weight: 400;
    color: #b0b6c3;
  }

  .abc-range .abc-cell-expected {
    flex: 0 0 100%;
    order: 1;
  }

  .abc-range .abc-cell-low {
    order: 2;
  }

  .abc-range .abc-cell-high {
    order: 3;
  }

  .abc-range .abc-cell-low::after,
  .abc-channels-table td:first-of-type::after {
    content: "\00b7";
    margin-left: 0.6rem;
    color: rgba(255, 255, 255, 0.4);
  }

  .abc-total-row {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
  }
}

/* ---- Sample result card ---- */

.abc-sample-card {
  max-width: 46rem;
}

.abc-sample-first {
  margin-top: 0;
}

.lpa-content-wrap p.abc-sample-result {
  font-size: 1.25rem;
  color: #fff;
  line-height: 1.3;
  margin: 1.5rem 0 1rem;
}

.abc-sample-inputs thead th,
.abc-sample-inputs td {
  text-align: left;
}

.lpa-content-wrap p.abc-sample-note {
  margin: 1rem 0 0;
}
