/* Banca Legal: responsive layout corrections, 2026-10-02. */
/* Let grid tracks and form controls shrink to the available width. */
.hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.demo-panes { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.hero-grid > *, .demo-panes > *, .roi-grid > *, .pricing-grid > * { min-width: 0; }
.wa-input-row input { min-width: 0; }
.chat-bubble, .doc-preview-sim { overflow-wrap: anywhere; }
.chat-chips-bar > * { flex-shrink: 0; }
.hero-fine { flex-wrap: wrap; }

/* The full navigation needs more room than the original breakpoint allowed. */
@media (max-width: 1350px) {
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #141716;
    padding: 22px 24px;
    display: none;
    box-shadow: 0 16px 36px rgba(0, 0, 0,.6);
    border-bottom: 1px solid var(--border-dark-subtle);
    flex-direction: column;
    gap: 16px;
    z-index: 45;
    max-height: calc(100dvh - 120px);
    overflow-y: auto;
  }
  .nav-links.is-open { display: flex; }
  .nav-links > a {
    font-size: 15px;
    padding-block: 4px;
    border-bottom: 1px solid rgba(255, 255, 255,.06);
  }
  .mobile-toggle { display: flex; flex-shrink: 0; }
}

@media (max-width: 900px) {
  .hero-grid, .demo-panes { grid-template-columns: minmax(0, 1fr); }
  /* Absolutely positioned artwork does not provide an intrinsic width. */
  .data-engine {
    width: 100%;
    max-width: 520px;
    height: auto;
    padding-top: 320px;
    margin: 20px auto 0;
  }
  .data-output, .data-engine:hover .data-output {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    transform: none;
  }
  .data-output-top, .data-output-bottom { flex-wrap: wrap; gap: 8px; }
  .data-output pre { overflow-wrap: anywhere; }
  .engine-label { left: 0; flex-wrap: wrap; gap: 8px; }
  .hero-bottom {
    height: auto;
    min-height: 80px;
    padding-block: 20px;
    flex-wrap: wrap;
    gap: 16px;
  }
  .hero-bottom > div { flex-wrap: wrap; gap: 8px 16px; }
  .hero-bottom > a { flex-shrink: 0; }
  .dossier-pane { max-height: none; }
  .dossier-header { gap: 12px; }
  .dossier-title-group { min-width: 0; }
  .score-badge { flex-shrink: 0; }
  .section-top, .playground-under { flex-wrap: wrap; }
}

@media (max-width: 650px) {
  :root { scroll-padding-top: 125px; }
  .nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    height: auto;
    min-height: 104px;
    padding-block: 12px;
    gap: 10px 12px;
  }
  .brand { grid-column: 1 / 3; grid-row: 1; }
  .nav-actions { display: contents; }
  .nav-actions .text-link { grid-column: 1; grid-row: 2; }
  .nav-actions .button { grid-column: 2 / 4; grid-row: 2; }
  .mobile-toggle { grid-column: 3; grid-row: 1; justify-self: end; }
  .hero-grid { padding-top: 36px; padding-bottom: 36px; }
  .hero-copy h1 { font-size: clamp(34px, 10vw, 44px); }
  .hero-kicker { font-size: 10px; }
  .hero-description { font-size: 16px; }
  .hero-fine { gap: 8px 12px; }
  .hero-bottom > span { flex-basis: 100%; }
  .data-output pre { font-size: 11px; margin: 14px 12px; }
  .data-output-top, .data-output-bottom { padding-inline: 12px; }
  .orbit-three { right: 0; }
  .playground-nav, .sim-toolbar { padding-inline: 12px; }
  .tabs { flex-wrap: nowrap; }
  .tabs button { flex-shrink: 0; white-space: nowrap; }
  .demo-badge { font-size: 9px; letter-spacing: 0; }
  .sim-controls, .sim-speed-group { flex-wrap: wrap; }
  .chat-header { height: auto; min-height: 70px; padding: 12px; gap: 10px; }
  .chat-contact-name { font-size: 13px; }
  .chat-messages { padding: 16px 12px; }
  .chat-bubble { max-width: 92%; padding-inline: 12px; }
  .wa-interactive-footer { padding-inline: 10px; }
  .wa-input-row input { font-size: 16px; padding-inline: 10px; }
  .chat-chips-bar { padding-inline: 0; }
  .typing-box { max-width: calc(100% - 24px); flex-wrap: wrap; }
  .dossier-pane { padding: 18px 14px; }
  .doc-check-item { gap: 8px; }
  .doc-status { flex-shrink: 0; }
  .bento-grid { grid-template-columns: minmax(0, 1fr); }
  .bento-feature { grid-column: auto; }
  .bento, .control-strip { padding: 22px; }
  .night-ops-header, .timeline-item, .card-heading { flex-wrap: wrap; gap: 8px; }
  .diff-ui > div { white-space: normal; overflow-wrap: anywhere; }
  .schema-tags > span { flex-wrap: wrap; }
  .roi-grid { gap: 24px; padding: 18px; }
  .roi-outputs { padding: 20px 16px; }
  .roi-slider-header { flex-wrap: wrap; gap: 6px; }
  .roi-metrics-grid { gap: 16px 12px; }
  .roi-main-val { font-size: clamp(25px, 8vw, 36px); overflow-wrap: anywhere; }
  .roi-metric-val { font-size: 18px; overflow-wrap: anywhere; }
  .pricing-card { padding: 24px; }
  .pricing-toggle-wrap { flex-wrap: wrap; }
  .button { white-space: normal; }
  .toast { width: max-content; max-width: calc(100% - 32px); padding-inline: 16px; }
}

/* Mobile controls replace nested scrolling with wrapping and expansion. */
.mobile-stage-control, .chat-history-toggle { display: none; }

@media (max-width: 900px) {
  .tabs {
    width: 100%;
    flex-wrap: wrap;
    overflow: visible;
    padding-bottom: 0;
  }
  .tabs button {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    text-align: left;
  }
  .chat-chips-bar, .wa-quick-replies {
    flex-wrap: wrap;
    overflow: visible;
  }
  .chat-chips-label { flex-basis: 100%; }
  .chat-chip {
    flex-shrink: 1;
    max-width: 100%;
    white-space: normal;
    text-align: left;
  }
  .chat-messages {
    flex: none;
    max-height: none;
    overflow: visible;
  }
  .chat-messages:not(.is-expanded) > .chat-bubble:not(:nth-last-child(-n+3)) { display: none; }
  .chat-history-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    min-height: 44px;
    max-width: calc(100% - 24px);
    margin: 0 12px 12px;
    padding: 8px 14px;
    border: 1px solid #404245;
    border-radius: 6px;
    color: var(--lime);
    font-size: 13px;
    line-height: 1.4;
  }
  .chat-history-toggle[hidden] { display: none; }
  .mobile-stage-control {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    color: #caced4;
    font-size: 13px;
  }
  .mobile-stage-control select {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid #46484b;
    border-radius: 8px;
    background: #1d1f22;
    color: #f3f5f7;
    font-size: 16px;
    color-scheme: dark;
  }
  .kanban-board { grid-template-columns: minmax(0, 1fr); overflow: visible; }
  .kanban-col { min-width: 0; }
  .kanban-board.has-mobile-stage > .kanban-col:not(.is-mobile-active) { display: none; }
  .kanban-cards { min-height: 0; }
  .kanban-cards:empty::before {
    content: 'Nenhum lead nesta etapa para a área selecionada.';
    padding: 12px;
    color: #adb1b7;
    font-size: 13px;
  }
  .kanban-card-top { flex-wrap: wrap; gap: 6px; }
  .kanban-card-score { margin-left: auto; }
}

/* Custom stage picker: the open list uses the same tokens as the CRM. */
.stage-picker { position: relative; width: 100%; }
.stage-picker-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid #46484b;
  border-radius: 9px;
  background: #1d1f22;
  color: #f3f5f7;
  font-size: 15px;
  font-weight: 500;
  text-align: left;
}
.stage-picker-trigger:hover, .stage-picker-trigger[aria-expanded="true"] { border-color: var(--lime); }
.stage-picker-trigger .icon { width: 16px; height: 16px; color: var(--lime); transition: transform .15s; }
.stage-picker-trigger[aria-expanded="true"] .icon { transform: rotate(180deg); }
.stage-picker-options {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline: 0;
  z-index: 10;
  padding: 6px;
  border: 1px solid #46484b;
  border-radius: 10px;
  background: #1d1f22;
  box-shadow: 0 12px 32px rgba(0, 0, 0,.4);
}
.stage-picker-options[hidden] { display: none; }
.stage-picker-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 6px;
  color: #caced4;
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
}
.stage-picker-option:hover, .stage-picker-option:focus-visible { outline: none; background: #303235; color: #f3f5f7; }
.stage-picker-option[aria-selected="true"] { background: var(--lime); color: #1e2023; font-weight: 600; }
.stage-picker-option .stage-count {
  flex: none;
  padding: 1px 7px;
  border-radius: 20px;
  background: rgba(216, 223, 234,.1);
  color: var(--lime);
  font: 11px var(--mono);
}
.stage-picker-option[aria-selected="true"] .stage-count { background: rgba(30, 32, 35,.1); color: #1e2023; }

@media (max-width: 900px) {
  .playground-section, .platform-section, .crm-section, .roi-section,
  .compliance-section, .pricing-section, .faq-section { padding-block: 32px; }
  /* These two sections share the same background: use one compact transition. */
  .platform-section { padding-top: 8px; }
  .section-top { align-items: flex-start; gap: 8px 16px; margin-bottom: 16px; }
  .section-heading { flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 24px; }
  .playground-under { margin-top: 16px; gap: 12px; }
  .demo-panes, .chat-pane { min-height: 0; }
  .crm-filters { margin-bottom: 16px; }
  .pricing-toggle-wrap { margin: 20px 0 28px; }
  .closing-inner { padding-block: 40px; }
  .footer { padding-top: 32px; }
  /* All mobile sections remain visible while scrolling between them. */
  .js-motion .reveal { opacity: 1; transform: none; transition: none; }
}
