/* Facebook UTM Builder - page-only styles. Shared tool-page styles live in
 * landing-page-analyzer.css (loaded first).
 */

.utm-tool-wrap {
  max-width: 820px;
}

/* ---- Tabs ---- */

.utm-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.utm-tab {
  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);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.3;
  padding: 0.5em 1.25em;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.utm-tab:hover {
  color: #fff;
}

.utm-tab[aria-selected="true"] {
  background: rgba(129, 140, 248, 0.18);
  border-color: rgba(129, 140, 248, 0.5);
  color: #fff;
}

.utm-tab:focus-visible,
.utm-copy-btn:focus-visible,
.utm-flag-btn:focus-visible,
.utm-output:focus-visible {
  outline: 2px solid #818cf8;
  outline-offset: 2px;
}

/* ---- Status and toggles ---- */

.utm-status {
  color: #a5b4fc;
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0.5rem 0 0;
  min-height: 0;
}

.utm-status:empty {
  margin: 0;
}

.utm-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin: 1.25rem 0 1rem;
}

.utm-check {
  align-items: center;
  color: #e2e8f0;
  cursor: pointer;
  display: inline-flex;
  font-family: inherit;
  font-size: 0.9375rem;
  gap: 0.5rem;
  margin: 0;
}

.utm-check input {
  accent-color: #818cf8;
  height: 1.1rem;
  margin: 0;
  width: 1.1rem;
}

.utm-check input:disabled + span {
  opacity: 0.5;
}

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

.utm-field-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.utm-label {
  color: #e2e8f0;
  display: block;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  margin: 0 0 0.4rem;
}

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

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

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

/* ---- Flags ---- */

.utm-flag:empty {
  display: none;
}

.utm-flag {
  margin-top: 0.5rem;
}

.utm-flag-text {
  color: #fcd34d;
  font-size: 0.8125rem;
  line-height: 1.5;
  margin: 0 0 0.4rem;
  overflow-wrap: anywhere;
}

.utm-flag-btn {
  background: rgba(252, 211, 77, 0.1);
  border: 1px solid rgba(252, 211, 77, 0.4);
  border-radius: 99px;
  color: #fcd34d;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8125rem;
  line-height: 1.3;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 0.35em 0.9em;
  text-align: left;
}

.utm-flag-btn:hover {
  background: rgba(252, 211, 77, 0.18);
}

/* ---- Outputs ---- */

.utm-output-block {
  margin-top: 1.5rem;
}

.utm-output-head {
  align-items: center;
  display: flex;
  gap: 0.5rem 1rem;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.utm-output-label {
  color: #e2e8f0;
  font-size: 0.875rem;
  font-weight: 600;
  min-width: 0;
}

.utm-output-head .utm-copy-btn {
  flex-shrink: 0;
}

.utm-output {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875rem;
  line-height: 1.55;
  min-height: 3.25rem;
  overflow-wrap: anywhere;
  padding: 14px 16px;
  word-break: break-word;
}

.utm-output:empty::before {
  color: rgba(255, 255, 255, 0.28);
  content: attr(data-placeholder);
  font-family: inherit;
}

.utm-output-primary .utm-output {
  border-color: rgba(129, 140, 248, 0.55);
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.12);
}

.utm-copy-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 99px;
  color: #e2e8f0;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8125rem;
  line-height: 1.3;
  padding: 0.45em 1.1em;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.utm-copy-btn:hover:not(:disabled) {
  background: rgba(129, 140, 248, 0.15);
  border-color: rgba(129, 140, 248, 0.5);
  color: #fff;
}

.utm-copy-btn:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

/* ---- Bulk ---- */

.utm-bulk-input {
  margin-top: 0.4rem;
}

.utm-bulk-file-row {
  margin-top: 1rem;
}

.utm-file {
  color: #e2e8f0;
  font-family: inherit;
  font-size: 0.875rem;
  max-width: 100%;
}

.utm-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.utm-table-wrap {
  margin-top: 1.25rem;
}

.utm-table {
  border-collapse: collapse;
  font-size: 0.8125rem;
  width: 100%;
}

.utm-table th,
.utm-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  overflow-wrap: anywhere;
  padding: 0.6rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.utm-table th {
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
}

/* ---- Hints and content ---- */

.utm-preset-hint {
  margin: 0 0 1rem;
}

.utm-output-hint {
  color: var(--color--neutral-light, #b0b6c3);
  font-size: 0.8125rem;
  line-height: 1.5;
  margin: 0.5rem 0 0;
}

.lpa-content-wrap code {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875em;
  overflow-wrap: anywhere;
  padding: 0.1em 0.4em;
}

.lpa-content-wrap .utm-code-block {
  display: block;
  line-height: 1.6;
  padding: 0.75rem 1rem;
}

.lpa-table.utm-ref-table td:first-child,
.lpa-table.utm-ref-table td:first-child code {
  white-space: nowrap;
}

.lpa-band-heading,
.lpa-band-heading-line {
  text-wrap: balance;
}

@media (max-width: 640px) {
  .lpa-table.utm-ref-table td:first-child,
  .lpa-table.utm-ref-table td:first-child code {
    white-space: normal;
  }
}

/* ---- Phones ---- */

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

  .utm-table thead {
    display: none;
  }

  .utm-table,
  .utm-table tbody,
  .utm-table tr,
  .utm-table td {
    display: block;
    width: 100%;
  }

  .utm-table tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 0;
  }

  .utm-table td {
    border-bottom: 0;
    padding: 0.25rem 0;
  }

  .utm-table td:empty {
    display: none;
  }

  .utm-table td::before {
    color: rgba(255, 255, 255, 0.5);
    content: attr(data-label);
    display: block;
    font-size: 0.75rem;
  }

  .lpa-table.utm-ref-table td:nth-child(2),
  .lpa-table.utm-ref-table td:nth-child(3) {
    display: block;
    font-weight: 400;
    margin-top: 0.3rem;
    padding-left: 0;
    font-size: 0.875rem;
    color: #94a3b8;
    line-height: 1.55;
  }

  .lpa-table.utm-ref-table td:nth-child(2)::before,
  .lpa-table.utm-ref-table td:nth-child(2)::after {
    content: none;
  }

  .lpa-table.utm-ref-table td:nth-child(3) {
    color: #c8d0e0;
  }
}
