/* Responsive layout fixes shared by software profiles and the wider directory. */
.profile-identity,
.profile-identity > div,
.profile-overview > *,
.profile-overview-cards > *,
.profile-resource-brand strong,
.profile-alternatives article,
.profile-feature-grid li,
.reference-directory > *,
.comparison-card,
.product-top > div,
.quote-inputs > *,
.accounting-results > *,
.email-capacity-results > * {
  min-width: 0;
}

.profile-check-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}
.profile-check-meta a { color: #1c6fd1; }
.profile-mobile-navigation { display: none; }
.directory-filters > summary { display: none; }
.table-scroll { max-width: 100%; }
.comparison-card .versus-logos { flex-wrap: wrap; }
.buyer-comparison .page-section-tabs { margin: 0 0 32px; }
.buyer-comparison-table { min-width: 780px; }
.buyer-comparison-table td { line-height: 23px; }
.buyer-scenario-notes { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; margin-top: 24px; }
.buyer-scenario-notes > section { min-width: 0; border: 1px solid #e8e8e8; border-radius: 12px; padding: 22px; }
.buyer-scenario-notes h3 { font-size: 19px; line-height: 27px; margin-bottom: 12px; }
.buyer-scenario-notes p { font-size: 14px; line-height: 23px; margin-bottom: 0; }
.buyer-related-links { margin: 32px 0; font-size: 14px; line-height: 25px; color: #1c6fd1; }
.category-comparisons > p { color: #565656; margin-bottom: 28px; }
.profile-section .comparison-card h3 { margin-top: 0; }
.operations-planner { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 24px; margin: 28px 0; align-items: start; }
.operations-fields, .operations-result { min-width: 0; padding: 26px; border: 1px solid #e2e7ef; border-radius: 12px; }
.operations-fields label:not(.consent-label) { display: block; font-weight: 600; font-size: 14px; line-height: 22px; margin: 0 0 8px; }
.operations-fields > input { width: 100%; min-height: 46px; font-size: 16px; margin: 0 0 22px; }
.operations-fields .consent-label { margin: 4px 0 22px; }
.operations-fields .button { min-height: 46px; width: 100%; white-space: normal; }
.operations-fields > p { margin: 18px 0 0; font-size: 13px; line-height: 21px; }
.operations-result { background: #f0f5ff; }
.operations-result h3 { font-size: 24px; line-height: 32px; margin: 14px 0 16px; }
.operations-total { display: block; font-size: clamp(28px,4vw,38px); line-height: 1.25; letter-spacing: -.8px; color: #174aae; overflow-wrap: anywhere; }
.operations-total small { font-size: 16px; line-height: 24px; letter-spacing: 0; font-weight: 500; }
.operations-result dl { margin: 22px 0; }
.operations-result dl > div { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid #d7e3f7; padding: 12px 0; }
.operations-result dt { font-size: 14px; line-height: 22px; }
.operations-result dd { flex: 0 0 auto; margin: 0; font-weight: 700; }
.operations-result > p { font-size: 13px; line-height: 22px; margin-bottom: 0; }
@media (max-width: 800px) { .operations-planner { grid-template-columns: minmax(0,1fr); gap: 18px; } .operations-fields, .operations-result { padding: 22px; } }

@media (min-width: 801px) and (max-width: 1050px) {
  .comparison-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .comparison-card .versus-logos { gap: 12px; }
  .comparison-card .product-logo.wordmark { width: 110px; flex-basis: 110px; }
}

@media (max-width: 800px) {
  .button { max-width: 100%; white-space: normal; text-align: center; }
  .comparison-grid { grid-template-columns: minmax(0, 1fr); }
  .versus-logos { flex-wrap: wrap; gap: 12px; }
  .versus-logos .product-logo.wordmark { width: 100px; flex-basis: 100px; }
  .reference-directory { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .directory-filters { border: 1px solid #e8e8e8; border-radius: 12px; background: #fafafa; }
  .directory-filters > summary { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 12px 16px; font-size: 15px; font-weight: 600; cursor: pointer; list-style: none; }
  .directory-filters > summary::-webkit-details-marker { display: none; }
  .directory-filters > summary > span:first-child { margin-left: auto; font-size: 12px; font-weight: 400; color: #5c5c5c; }
  .directory-filters .filter-chevron { font-size: 21px; line-height: 20px; }
  .directory-filters[open] .filter-chevron { transform: rotate(180deg); }
  .directory-filters .filter-panel { border: 0; padding: 16px; }
  .directory-filters .filter-panel h2 { display: none; }
  .profile-overview-cards,
  .profile-alternatives,
  .profile-feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table-scroll {
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .table-scroll:focus-visible { outline-offset: 2px; }
}

@media (max-width: 640px) {
  .buyer-scenario-notes { grid-template-columns: minmax(0,1fr); gap: 16px; }
  .buyer-scenario-notes > section { padding: 20px; }
  /* Keep search usable instead of squeezing it beside the logo. */
  .header-inner {
    height: auto;
    min-height: 112px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 0 12px;
    padding: 8px 0 12px;
  }
  .header-inner > .brand { grid-column: 1; grid-row: 1; }
  .header-actions { grid-column: 2; grid-row: 1; margin: 0; }
  .header-actions .menu-toggle { width: 44px; height: 44px; border-radius: 8px; }
  .header-search {
    display: flex;
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    min-width: 0;
    height: 44px;
    margin-top: 4px;
    padding: 0 14px;
    gap: 10px;
    background: #fafafa;
  }
  .header-search input { font-size: 16px; line-height: 24px; }
  .header-search svg { width: 18px; height: 18px; }
  .mobile-nav {
    gap: 4px 12px;
    max-height: min(70vh, calc(100vh - 112px));
    max-height: min(70dvh, calc(100dvh - 112px - env(safe-area-inset-bottom)));
    overflow-y: auto;
    overscroll-behavior-y: contain;
  }
  .mobile-nav a { min-width: 0; border-radius: 6px; line-height: 22px; }
  .mobile-nav a:focus-visible { outline-offset: -2px; }

  input:not([type=checkbox]):not([type=radio]), select, textarea,
  .home-search input, .search-page-form input { font-size: 16px; }
  select, input:not([type=checkbox]):not([type=radio]) { min-height: 44px; }
  .enquiry-form label { font-size: 14px !important; }
  .button, .listing-product-actions .button,
  .home-card-footer .button, .card-actions .button { min-height: 44px; }
  .home-card-heading .save-button,
  .listing-product-actions .save-button { width: 44px; min-height: 44px; }
  .home-card-footer { flex-wrap: wrap; }
  .home-search input { min-height: 0; }
  .home-search .button { min-height: 40px; width: 40px; height: 40px; }
  .home-search { height: 52px; }
  .product-top { flex-wrap: wrap; }
  .product-top > div { flex: 1; }
  .product-top > .product-logo.wordmark { flex-basis: 100%; width: 120px; justify-content: start; }
  .card-actions { flex-wrap: wrap; }
  .card-actions .compare-check { min-height: 44px; }
  .listing-product-name { min-width: 0; flex: 1; }
  .listing-product-heading > .product-logo.wordmark { width: 120px; flex-basis: 100%; justify-content: start; }
  .product-top > .product-logo.wordmark img,
  .listing-product-heading > .product-logo.wordmark img { max-width: 132px; }
  .listing-product-actions { gap: 12px; }
  .listing-card-footer { align-items: center; flex-wrap: wrap; }
  .listing-card-footer a { max-width: none; min-height: 44px; display: inline-flex; align-items: center; text-align: left; }
  .listing-card-footer .compare-check { min-height: 44px; }

  /* Product names and wide vendor wordmarks each get enough room. */
  .product-profile-intro { padding-top: 20px; }
  .product-profile-intro .breadcrumbs { font-size: 12px; margin-bottom: 20px; }
  .profile-identity-row { margin: 0 0 20px; }
  .profile-identity { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px 14px; align-items: start; }
  .profile-identity .product-logo.large { width: 64px; height: 64px; flex-basis: auto; }
  .profile-identity .product-logo.large.wordmark { grid-column: 1 / -1; width: 132px; height: 52px; justify-self: start; }
  .profile-identity > .wordmark + div { grid-column: 1 / -1; }
  .profile-identity h1 { font-size: 28px; line-height: 34px; overflow-wrap: anywhere; margin-bottom: 6px; }
  .profile-identity .source-status { font-size: 12px; line-height: 20px; display: block; }
  .profile-identity .profile-check-meta { font-size: 12px; line-height: 20px; margin-top: 6px; gap: 2px; }
  .profile-check-meta > * { flex-basis: 100%; }
  .profile-identity-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
  .profile-identity-actions .button { min-width: 0; padding: 10px 8px; font-size: 13px; gap: 6px; }
  .has-section-jump .profile-section-tabs { display: none; }
  .profile-mobile-navigation:not([hidden]) { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid #e8e8e8; border-bottom: 1px solid #e8e8e8; }
  .profile-mobile-navigation label { margin: 0; font-size: 13px; color: #565656; white-space: nowrap; }
  .profile-mobile-navigation select { flex: 1; width: 0; min-width: 0; border-radius: 8px; padding: 10px 8px; background: #fafafa; }
  .profile-section-tabs { max-width: 100%; width: 100%; scrollbar-width: thin; }

  /* Remove nested page gutters while keeping individual cards clear. */
  .profile-overview { padding: 0; background: transparent; grid-template-columns: minmax(0, 1fr); gap: 24px; margin-top: 26px; }
  .profile-description h2 { font-size: 27px; line-height: 34px; margin-bottom: 14px; }
  .profile-description > p,
  .profile-description #use-cases p { font-size: 16px; line-height: 26px; }
  .profile-resource-panel { padding: 18px; margin: 22px 0 26px; background: #fafafa; }
  .profile-resource-brand { display: none; }
  .profile-resource-panel h3 { font-size: 18px; line-height: 26px; }
  .profile-resource-panel .button { width: 100%; }
  .profile-description #use-cases h3 { font-size: 22px; line-height: 30px; margin-bottom: 12px; }
  .profile-description #use-cases .small { font-size: 12px; line-height: 20px; display: block; }
  .profile-overview-cards, .profile-alternatives, .profile-feature-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .profile-overview-cards .summary-card { padding: 20px; }
  .profile-overview-cards .summary-card:last-child { grid-column: auto; }
  .profile-overview-cards h3 { margin-bottom: 12px; }
  .profile-overview-cards ul { padding-left: 20px; margin: 0; }
  .profile-overview-cards li + li { margin-top: 10px; }
  .profile-overview-cards .summary-card > a { margin-bottom: 0; padding: 8px 0; }
  .profile-section { padding-top: 32px; padding-bottom: 32px; }
  .profile-section h2 { font-size: 27px; line-height: 35px; overflow-wrap: anywhere; margin-bottom: 20px; }
  .profile-section > ul { padding-left: 20px; }
  .profile-alternatives article, .profile-pricing-panel { padding: 20px; }
  .profile-feature-grid li { padding: 16px; line-height: 24px; gap: 10px; }
  .profile-feature-grid li span { flex-shrink: 0; }
  .profile-pricing-panel h3 { font-size: 22px; line-height: 30px; }
  details summary { min-height: 44px; padding: 10px 0; line-height: 24px; }
  .profile-section details { border-bottom: 1px solid #e8e8e8; }
  .profile-section details p { margin-bottom: 16px; }

  .page-section-tabs { scrollbar-width: thin; }
  .table-scroll.has-horizontal-scroll::before {
    content: 'Swipe to see all columns →';
    display: block;
    position: sticky;
    left: 0;
    width: 100%;
    padding: 10px 12px;
    border-bottom: 1px solid #e8e8e8;
    background: #f4f7fc;
    color: #4c5d75;
    font-size: 12px;
    line-height: 20px;
  }
  .project-input-grid { grid-template-columns: minmax(0, 1fr); }
  .project-result-title { flex-wrap: wrap; gap: 8px; }
  .project-result-title strong { max-width: none; text-align: left; }
  .research-dataset-actions .button { width: 100%; }
  .citation-actions { gap: 12px; }
  .citation-actions > button { width: 100%; min-height: 44px; }
  .cost-total { font-size: clamp(28px, 8vw, 38px); overflow-wrap: anywhere; }
  .comparison-difference strong { white-space: normal; }
  .compare-tray { bottom: max(12px, env(safe-area-inset-bottom)); }
  .compare-tray > div { min-width: 0; flex: 1; }
  .compare-tray #compare-names { overflow-wrap: anywhere; font-size: 12px; }
  .compare-tray .text-button { min-height: 44px; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 20px; }
  .footer-grid > div:not(:first-child) { gap: 0; }
  .footer-grid > div:not(:first-child) a { display: flex; align-items: center; min-height: 44px; }
}

@media (max-width: 360px) {
  .profile-identity-actions { grid-template-columns: minmax(0, 1fr); }
  .home-card-footer .button { width: 100%; }
  .accounting-calculator, .email-planner, .project-plan-form { padding: 18px; }
}

/* Workflow usage planner: labels stay beside their own inputs at every width. */
.operations-planner-form { padding: 26px; margin: 24px 0; border: 1px solid #e2e7ef; border-radius: 12px; background: #fff; }
.operations-input-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 22px; margin-bottom: 24px; }
.operations-input-grid label { display: flex; flex-direction: column; gap: 9px; font-size: 14px; font-weight: 600; min-width: 0; }
.operations-input-grid input { box-sizing: border-box; width: 100%; min-width: 0; min-height: 46px; font-size: 16px; font-family: inherit; font-weight: 500; border: 1px solid #bac7d9; border-radius: 8px; background: #fff; padding: 11px 12px; }
.operations-planner-form > p { font-size: 13px; line-height: 22px; margin: 18px 0 0; }
.operations-result-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.operations-result-grid > section { min-width: 0; padding: 26px; border: 1px solid #d7e3f7; border-radius: 12px; background: #f0f5ff; }
.operations-result-money { display: block; margin: 14px 0; font-size: clamp(28px,4vw,38px); line-height: 1.25; color: #174aae; overflow-wrap: anywhere; }
.operations-result-grid p { font-size: 14px; line-height: 23px; }
@media (max-width: 800px) { .operations-input-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 560px) { .operations-input-grid, .operations-result-grid { grid-template-columns: minmax(0,1fr); } .operations-planner-form,.operations-result-grid > section { padding: 22px; } .operations-planner-form .button { width: 100%; min-height: 46px; white-space: normal; } }

/* New vendor wordmarks keep their original aspect ratio and remain legible. */
.product-logo.wordmark[data-vendor="wrike"],
.product-logo.wordmark[data-vendor="zoho-people"],
.product-logo.wordmark[data-vendor="zoho-crm"],
.product-logo.wordmark[data-vendor="smartsheet"],
.product-logo.wordmark[data-vendor="n8n"] { width: 120px; flex-basis: 120px; }
.product-logo.wordmark[data-vendor="wrike"] img,
.product-logo.wordmark[data-vendor="zoho-people"] img,
.product-logo.wordmark[data-vendor="zoho-crm"] img,
.product-logo.wordmark[data-vendor="smartsheet"] img,
.product-logo.wordmark[data-vendor="n8n"] img { width: 100%; height: auto; max-height: 100%; object-fit: contain; }
@media (max-width: 640px) {
 .accounting-vendor-strip .product-logo.wordmark[data-vendor="wrike"],
 .accounting-vendor-strip .product-logo.wordmark[data-vendor="zoho-people"],
 .accounting-vendor-strip .product-logo.wordmark[data-vendor="zoho-crm"],
 .accounting-vendor-strip .product-logo.wordmark[data-vendor="smartsheet"],
 .accounting-vendor-strip .product-logo.wordmark[data-vendor="n8n"] { width: 88px; flex-basis: 88px; }
}
