/* RoofIntel AI additions (photo review, AI brief, dashboard lead) */
.aiq {
  padding: 12px 14px 12px;
  display: grid;
  gap: 10px;
}
.aiq-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.aiq-thumbs--one {
  grid-template-columns: 1fr;
}
.aiq-thumbs figure {
  margin: 0;
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--surface);
}
.aiq-thumbs--one figure {
  aspect-ratio: 16 / 8;
}
.aiq-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.aiq-thumbs figcaption {
  position: absolute;
  left: 5px;
  top: 5px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: rgba(11, 23, 38, 0.78);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.aiq-findings {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}
.aiq-findings li {
  display: flex;
  gap: 9px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-2);
  align-items: flex-start;
}
.aiq-findings li:last-child {
  border-bottom: 0;
}
.aiq-num {
  flex: none;
  width: 24px;
  height: 24px;
  margin-top: 0;
  border-radius: 50%;
  background: var(--blue-light);
  color: var(--blue);
  font-size: 12.5px;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.aiq-findings strong {
  display: block;
  font-size: 15.5px;
  line-height: 1.3;
  color: var(--ink);
}
.aiq-findings p {
  margin: 3px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}
.aiq-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}
.aiq-tags em {
  font-style: normal;
  font-size: 12.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--line-2);
  color: #4d5d6b;
}
.aiq-tags .aiq-sev--high {
  background: var(--red-light);
  color: var(--red-dark);
}
.aiq-tags .aiq-sev--medium {
  background: #fff6e6;
  color: #9a6400;
}
.aiq-tags .aiq-sev--low {
  background: #eaf8f2;
  color: #12804f;
}
.aiq-tags .aiq-tag--muted {
  background: transparent;
  color: var(--muted-2);
  padding-left: 0;
}
.aiq-meta {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--muted);
}
.aiq-meta strong {
  color: var(--ink);
  font-weight: 600;
}
.aiq-flag {
  color: var(--orange);
  font-weight: 600;
}
.aiq-summary {
  margin: 0;
  padding: 9px 11px;
  border-left: 3px solid var(--blue);
  border-radius: 0 6px 6px 0;
  background: var(--blue-light);
  font-size: 14.5px;
  line-height: 1.5;
  color: #3f505d;
}
.aiq-note {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--muted-2);
}
.aiq-box {
  margin: 14px;
  padding: 12px 13px;
  border-radius: 8px;
  font-size: 14.5px;
  line-height: 1.45;
}
.aiq .aiq-box,
.aiq-box--wide {
  margin: 0;
}
.aiq-box strong {
  display: block;
  font-size: 15.5px;
  color: var(--ink);
}
.aiq-box p {
  margin: 4px 0 0;
  color: var(--muted);
}
.aiq-box--warn {
  background: #fff7ec;
  border: 1px solid #f3d6a6;
}
.aiq-box--ok {
  background: #eef9f3;
  border: 1px solid #bfe6d1;
}
.aiq-section .aiq-findings strong {
  font-size: 16px;
}
.aiq-section .aiq-meta {
  margin-top: 8px;
}
.aiq-notes {
  display: grid;
  gap: 10px;
}
.aiq-notes > div {
  padding: 11px 13px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: #fafbfc;
}
.aiq-notes span {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--muted-2);
}
.aiq-notes p {
  margin: 5px 0 0;
  font-size: 14.5px;
  line-height: 1.5;
  color: #3f505d;
}
.aiq-ask .aiq-meta {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--muted-2);
}
.aiq-retry {
  margin-top: 10px;
  padding: 8px 12px;
  font-size: 14px;
}
.aiq-drawer__read {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: #3f505d;
}
.aiq-drawer ul {
  margin: 8px 0 0;
  padding-left: 16px;
  display: grid;
  gap: 4px;
  font-size: 13.5px;
  line-height: 1.45;
  color: #536573;
}
.lead-row--new td:first-child {
  box-shadow: inset 3px 0 0 var(--red);
}
.aiq-modal-backdrop {
  z-index: 200;
}
.aiq-modal {
  width: min(680px, 100%);
  max-height: min(86vh, 900px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.3);
  text-align: left;
}
.aiq-modal__head {
  padding: 18px 22px 12px;
  border-bottom: 1px solid var(--line-2);
}
.aiq-modal__head strong {
  display: block;
  font-size: 18px;
  color: var(--navy);
}
.aiq-modal__head small {
  font-size: 13px;
  color: var(--muted-2);
}
.aiq-modal__text {
  flex: 1;
  margin: 0;
  padding: 16px 22px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font: 14.5px/1.55 "DM Sans", Arial, sans-serif;
  color: #2b3a47;
}
.aiq-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--line-2);
}
@media (max-width: 560px) {
  .aiq-thumbs {
    grid-template-columns: repeat(2, 1fr);
  }
  .aiq-modal__actions {
    flex-direction: column-reverse;
  }
  .aiq-modal__actions .button {
    width: 100%;
    justify-content: center;
  }
}

/* Start prompt shown 1.5 s after the page opens (ai.js: showNudge) */
.roof-nudge-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 15, 25, 0.58);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: roof-nudge-fade 0.2s ease-out;
}
.roof-nudge {
  position: relative;
  width: min(490px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 28px 28px 24px;
  border-radius: 14px;
  border-top: 4px solid var(--red);
  background: #fff;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.32);
  text-align: left;
  color: var(--ink);
  animation: roof-nudge-rise 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.roof-nudge__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.roof-nudge__close:hover {
  background: var(--surface);
  color: var(--navy);
}
.roof-nudge__eyebrow {
  display: block;
  margin: 0 44px 8px 0;
  color: var(--blue);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.roof-nudge h2 {
  margin: 0 0 12px;
  padding-right: 30px;
  color: var(--navy);
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
}
.roof-nudge__text {
  margin: 0 0 16px;
  color: #3a4a59;
  font-size: 15.5px;
  line-height: 1.6;
}
.roof-nudge__facts {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--navy-3);
  font-size: 14px;
  font-weight: 600;
}
.roof-nudge__facts li {
  display: flex;
  align-items: center;
  gap: 6px;
}
.roof-nudge__facts svg {
  color: var(--green);
  flex: none;
}
.roof-nudge__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
}
.roof-nudge__start {
  cursor: pointer;
  border: 0;
}
.roof-nudge__start:hover {
  background: var(--red-dark);
}
.roof-nudge__later {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.roof-nudge__later:hover {
  color: var(--navy);
}
.roof-nudge:focus {
  outline: none;
}
.roof-nudge button:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}
@keyframes roof-nudge-fade {
  from {
    opacity: 0;
  }
}
@keyframes roof-nudge-rise {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
}
@media (max-width: 560px) {
  .roof-nudge-backdrop {
    place-items: end center;
    padding: 0;
  }
  .roof-nudge {
    width: 100%;
    max-height: 88vh;
    padding: 24px 20px calc(20px + env(safe-area-inset-bottom, 0px));
    border-radius: 16px 16px 0 0;
  }
  .roof-nudge h2 {
    font-size: 31px;
  }
  .roof-nudge__text {
    font-size: 15px;
  }
  .roof-nudge__actions {
    flex-direction: column;
    align-items: stretch;
  }
  .roof-nudge__start {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .roof-nudge-backdrop,
  .roof-nudge {
    animation: none;
  }
}
