/* Loaded after the other sheets. Keeps text inside its box.
   Body copy stays 16px. Tap targets stay at least 44px.
   Long ids may break. Ordinary words do not. */

.legal-toc {
  position: static !important;
  display: block !important;
  height: auto !important;
  min-height: 0;
  max-height: none !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  backdrop-filter: none !important;
  z-index: auto !important;
  overflow: visible;
}

.naics-category-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}

.naics-browse-link {
  align-items: flex-start;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.naics-browse-link .badge {
  flex: 0 0 5.25rem;
  min-width: 5.25rem;
  justify-content: center;
  box-sizing: border-box;
  font-variant-numeric: tabular-nums;
}

.payment-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 16px;
  padding: 12px 16px;
  background: #3b1d1d;
  border: 1px solid rgba(252, 165, 165, 0.55);
  color: #fee2e2;
  border-radius: 8px;
  font-size: 16px;
  line-height: 1.4;
}

.payment-banner p {
  margin: 0;
}

.payment-banner form {
  margin: 0;
  flex: 0 0 auto;
}

.payment-banner-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  font-size: 16px;
  font-weight: 600;
  box-sizing: border-box;
  background: #0b1120;
  color: #ffffff;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  cursor: pointer;
}

.payment-banner-cta:hover {
  border-color: #fecaca;
}

a.plan-chip:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

/* #your-plan is the page heading, so the title stays below the bar.
   Header is 52px from 769px up (68px margin) and 56px below that (72px margin).
   On a phone, overflow on the shell was stopping the bar from sticking. */
#your-plan {
  scroll-margin-top: 68px;
}
.settings-heading {
  margin-bottom: 24px;
}
.ai-summary-container .ai-summary-section p,
.ai-summary-container .ai-summary-section li {
  font-size: 16px;
}
.ai-summary-container .ai-summary-note {
  font-size: 14px !important;
  line-height: 1.4;
  font-weight: 500;
  color: #64748b;
  margin: 0 0 8px;
}
/* Password inputs were left at the browser default width. One column,
   360px at most, and the full card width below 600px. */
.settings-section input[type="password"] {
  width: 100%;
  max-width: 360px;
  box-sizing: border-box;
}
@media (max-width: 599px) {
  .settings-section input[type="password"] {
    max-width: none;
  }
}
.settings-password-form .settings-field {
  margin-bottom: 16px;
}
.settings-password-form .settings-field label {
  margin-bottom: 8px;
}
.settings-plan-row .settings-desc:last-child {
  margin-bottom: 0;
}
@media (max-width: 768px) {
  #your-plan {
    scroll-margin-top: 72px;
  }
  /* overflow-x: hidden on the shell computes to a scroll box and
     stops the top bar from sticking, so the bar is fixed instead. */
  .app-shell > .main-wrapper > .topbar {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    width: 100%;
  }
  .app-shell > .main-wrapper {
    padding-top: 56px;
  }
}
.settings-plan-row form .btn {
  min-height: 44px;
  box-sizing: border-box;
}

.plan-chip-header {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 44px;
  min-width: 44px;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .status-tabs {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    overflow: visible !important;
    flex-wrap: unset !important;
    -webkit-mask-image: none !important;
    mask-image: none !important;
    padding-bottom: 16px;
  }
  .status-tabs .btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
    white-space: nowrap;
    font-size: 16px !important;
    box-sizing: border-box;
  }
  .status-tabs > .btn + .btn {
    margin-left: 0 !important;
    margin-top: 0 !important;
  }
}

@media (max-width: 768px) {
  .topbar:has(.plan-chip-header) .topbar-data-badge {
    display: none;
  }
  .topbar:has(.plan-chip-header) .topbar-left {
    min-width: 0;
    flex: 1 1 auto;
  }
  .topbar:has(.plan-chip-header) .topbar-brand {
    min-width: 0;
  }
  .topbar:has(.plan-chip-header) .topbar-word {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 600px) {
  .payment-banner {
    flex-direction: column;
    align-items: stretch;
  }
  .payment-banner form,
  .payment-banner-cta {
    width: 100%;
  }
}

.naics-category-grid > a + a {
  margin-left: 0 !important;
}

.naics-browse-desc {
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  overflow-wrap: break-word;
  font-size: 14px;
  line-height: 1.4;
}

.naics-search-form label {
  display: block;
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.naics-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.naics-search-row input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  font-size: 16px;
}

.naics-search-row .btn {
  flex: 0 0 auto;
  min-height: 44px;
}

@media (max-width: 600px) {
  .naics-search-form label { white-space: normal; }
  .naics-search-row {
    flex-direction: column;
    align-items: stretch;
  }
  .naics-search-row .btn { width: 100%; }
}

@media (min-width: 1200px) {
  .company-page .company-awards th:nth-child(1),
  .company-page .company-awards td:nth-child(1) {
    width: 248px;
    min-width: 248px;
  }
  .company-page .company-awards th:nth-child(5),
  .company-page .company-awards td:nth-child(5) { width: 112px; }
  .company-page .company-awards th:nth-child(6),
  .company-page .company-awards td:nth-child(6),
  .company-page .company-awards th:nth-child(7),
  .company-page .company-awards td:nth-child(7) { width: 92px; }
  .company-page .company-awards td[data-label="Award ID"] {
    overflow: visible;
    white-space: nowrap;
  }
  .company-page .company-awards .award-id {
    display: inline-block;
    max-width: none;
    overflow: visible;
    text-overflow: unset;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
    font-size: 16px;
    line-height: 1.35;
  }
}

.dash-for-you col.dash-col-type { width: 12rem; }

.dash-for-you td.dash-type,
.dash-for-you th.dash-col-type {
  overflow: visible;
  white-space: normal;
}

.dash-for-you .notice-type,
.cell-meta span.notice-type {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  max-width: 100%;
}

.cell-meta span.award-piid {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  overflow-wrap: anywhere;
  max-width: 100%;
  font-size: 16px;
  line-height: 1.35;
}

.progress-track {
  position: relative;
  min-width: 0;
  max-width: 100%;
}

.progress-step {
  min-width: 0;
}

.progress-step::after {
  content: none !important;
  width: 0 !important;
}

.progress-track::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 16%;
  right: 16%;
  height: 2px;
  background: var(--border, #314864);
  z-index: 0;
}

.step-label {
  white-space: normal !important;
  text-align: center;
  max-width: 100%;
  overflow-wrap: break-word;
  font-size: 16px;
}

.onboarding-page {
  min-height: 100vh;
  box-sizing: border-box;
  padding: 40px 16px;
}

.onboarding-wrap {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  box-sizing: border-box;
}

.onboarding-brand {
  display: flex;
  margin: 0 0 24px;
}

.onboarding-card,
#step1-form,
.onboarding-actions,
.onboarding-card .btn-row,
.onboarding-card .onboarding-btn-group {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

.mkt-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: #f8fafc;
  text-decoration: none;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.mkt-mark {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  flex: 0 0 28px;
  background: #2563eb;
  color: #fff;
}

.mkt-mark svg { width: 16px; height: 16px; display: block; }
.mkt-word { font-size: 16px; color: #f8fafc; }

.onboarding-card {
  font-size: 16px;
  line-height: 1.5;
}

.onboarding-card .subtitle,
.onboarding-card .chips-label,
.onboarding-empty,
.onboarding-card label,
.onboarding-card p,
.onboarding-card .agency-check span {
  font-size: 16px;
  line-height: 1.5;
}

.onboarding-card input:not([type="checkbox"]):not([type="radio"]) {
  font-size: 16px;
  line-height: 1.4;
  min-height: 44px;
  padding: 8px 12px;
  box-sizing: border-box;
}

.onboarding-card .btn-primary,
.onboarding-actions .btn-primary,
.onboarding-actions-main .btn-primary {
  min-height: 44px;
  padding: 0 20px;
  font-size: 16px;
  box-sizing: border-box;
  width: auto;
  white-space: nowrap;
}

.agency-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 16px 0 8px;
}

@media (min-width: 640px) {
  .agency-grid { grid-template-columns: 1fr 1fr; }
}

.agency-tile {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  column-gap: 8px;
  row-gap: 4px;
  align-items: start;
  align-content: start;
  min-height: 44px;
  padding: 16px;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
}

.onboarding-card input[type="checkbox"] {
  -webkit-appearance: checkbox !important;
  appearance: auto !important;
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  min-height: 20px !important;
  max-width: 20px !important;
  padding: 0 !important;
  border-radius: 4px !important;
  accent-color: #2563eb;
  background-color: #fff;
  flex: 0 0 20px;
}

.agency-tile input {
  grid-row: 1 / span 2;
  align-self: start;
  margin: 0;
}

.agency-tile-code {
  font-size: 16px;
  font-weight: 700;
  line-height: 20px;
}

.agency-tile-name {
  font-size: 16px;
  line-height: 1.35;
  color: var(--text-secondary, #94a3b8);
  overflow-wrap: break-word;
}

.onboarding-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 24px;
  min-height: 44px;
}

.onboarding-actions-main {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
  width: auto;
  max-width: none;
}

.onboarding-back,
.onboarding-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  box-sizing: border-box;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}

.onboarding-back {
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: #93c5fd;
}

.onboarding-ghost {
  padding: 0 16px;
  border: 1px solid var(--border, #314864);
  border-radius: 8px;
  background: transparent;
  color: var(--text, #f1f5f9);
}

.onboarding-card .onboarding-keyword-input { margin-bottom: 0; }

.onboarding-hint {
  margin: 8px 0 24px;
  color: var(--text-secondary, #94a3b8);
  font-size: 16px;
  line-height: 1.5;
}

.onboarding-digest {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin: 24px 0 8px;
  padding: 8px 16px;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.onboarding-digest input {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  margin: 0;
  flex: 0 0 20px;
  accent-color: var(--accent, #2563eb);
}

@media (max-width: 480px) {
  .onboarding-actions-row {
    flex-wrap: wrap;
    margin-left: 0;
    margin-right: 0;
    width: 100%;
  }
  .onboarding-actions-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
    margin: 0;
    justify-content: stretch;
  }
  .onboarding-ghost,
  .onboarding-actions-main .btn-primary {
    width: 100%;
    min-width: 0;
    margin: 0 !important;
    padding: 0 16px;
  }
}

.onboarding-card .btn-skip {
  min-height: 44px;
  font-size: 16px;
}

.onboarding-actions button + button,
.onboarding-actions .onboarding-skip,
.onboarding-card .btn-row button + button,
.onboarding-card .btn-row a + a,
.onboarding-card .onboarding-btn-group button + button,
.onboarding-card .onboarding-btn-group .btn-skip + .btn-primary {
  margin-left: 0 !important;
}

.onboarding-card .chip {
  max-width: 100%;
  white-space: normal;
  box-sizing: border-box;
}

.onboarding-card input,
.onboarding-card select {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.row-menu-panel select {
  min-height: 44px;
  font-size: 16px;
}

.row-menu-panel button.row-menu-save {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  padding: 8px 16px;
  border: 0;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  font-size: 16px;
  font-weight: 650;
  text-align: center;
}

.row-menu-panel button.row-menu-save:hover {
  background: #1d4ed8;
  color: #fff;
}

/* Alerts card uses one 16px inset so the per-page control is not on the edge. */
section[aria-label="Your alerts"] .card-padded-heading {
  padding: 16px 16px 8px;
}
section[aria-label="Your alerts"] .result-tools {
  margin: 0;
  padding: 8px 16px;
}
@media (max-width: 600px) {
  section[aria-label="Your alerts"] > .card.card-flush {
    padding: 0 !important;
  }
  section[aria-label="Your alerts"] .table-scroll-container {
    border: 0 !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 16px 16px !important;
    overflow: visible !important;
    background: transparent !important;
    min-width: 0 !important;
    width: auto !important;
  }
  section[aria-label="Your alerts"] .table-scroll-container table,
  section[aria-label="Your alerts"] table,
  section[aria-label="Your alerts"] table tbody {
    display: block !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    white-space: normal !important;
    overflow: visible !important;
  }
  section[aria-label="Your alerts"] table tbody tr {
    margin-left: 0;
    margin-right: 0;
    width: auto;
  }
  section[aria-label="Your alerts"] table tbody tr:last-child {
    margin-bottom: 0;
  }
  .settings-plan-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .settings-plan-row > .btn,
  .settings-plan-row > a.btn,
  .settings-plan-row > form {
    width: 100%;
  }
  .settings-plan-row > .btn,
  .settings-plan-row > a.btn,
  .settings-plan-row > form .btn {
    display: flex;
    width: 100%;
    min-height: 44px;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
  }
}

/* Alerts table: Pause and Delete stay inside the card from 1024px up.
   Below that, the action wrapper disappears so the phone card layout is unchanged. */
.alert-row-actions { display: contents; }

@media (min-width: 1024px) {
  section[aria-label="Your alerts"] .table-scroll-container {
    overflow-x: hidden;
  }
  section[aria-label="Your alerts"] table {
    width: 100%;
    table-layout: fixed;
  }
  section[aria-label="Your alerts"] th,
  section[aria-label="Your alerts"] th a {
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
    line-height: 1.15;
  }
  section[aria-label="Your alerts"] th:nth-child(1),
  section[aria-label="Your alerts"] td:nth-child(1) {
    width: 18%;
  }
  section[aria-label="Your alerts"] th:nth-child(4),
  section[aria-label="Your alerts"] td:nth-child(4) {
    width: 5.25rem;
  }
  section[aria-label="Your alerts"] th:nth-child(6),
  section[aria-label="Your alerts"] td:nth-child(6) {
    width: 6.25rem;
  }
  section[aria-label="Your alerts"] th:nth-child(7),
  section[aria-label="Your alerts"] td:nth-child(7) {
    width: 6.5rem;
  }
  section[aria-label="Your alerts"] th:nth-child(8),
  section[aria-label="Your alerts"] td:nth-child(8) {
    width: 6.75rem;
    overflow: visible;
  }
  section[aria-label="Your alerts"] .alert-row-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  section[aria-label="Your alerts"] .alert-row-actions .inline-form {
    display: block;
    margin: 0;
  }
  section[aria-label="Your alerts"] .alert-row-actions .btn {
    width: 100%;
    min-height: 44px;
    height: auto;
    box-sizing: border-box;
    padding: 8px 10px;
    font-size: 14px;
  }
}

@media (max-width: 600px) {
  section[aria-label="Your alerts"] .table-scroll-container,
  section[aria-label="Your alerts"] .table-scroll-container table {
    min-width: 0;
    width: 100%;
  }
}

/* Phone alert cards: Actions label on its own row, buttons share the width. */
@media (max-width: 768px) {
  .main-content section[aria-label="Your alerts"] table tbody tr td[data-label="Actions"] {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: stretch;
    justify-content: stretch;
    text-align: left;
  }
  .main-content section[aria-label="Your alerts"] table tbody tr td[data-label="Actions"]::before {
    grid-column: 1 / -1;
    flex: none;
    max-width: none;
    margin: 0;
  }
  .main-content section[aria-label="Your alerts"] table tbody tr td[data-label="Actions"] .inline-form {
    display: flex;
    min-width: 0;
    width: auto;
    margin: 0;
  }
  .main-content section[aria-label="Your alerts"] table tbody tr td[data-label="Actions"] .btn {
    width: 100%;
    min-height: 44px;
    height: auto;
    margin: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}
