/* Interactive Grounded "Ask the Building & Neighborhood" Card
   Follows Modern Web Guidance: container queries, 48px+ tap targets,
   :focus-visible rings, :user-invalid validation, high-contrast #2457c6 CTA */

.ask-bldg-sec {
  margin-block: 22px;
  container-type: inline-size;
}

.ask-bldg-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
  border: 1px solid rgba(36, 87, 198, 0.18);
  border-radius: 20px;
  padding: 22px 24px;
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.05);
}

.ask-bldg-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-block-end: 14px;
}

.ask-bldg-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ask-bldg-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(36, 87, 198, 0.10);
  color: #2457c6;
  flex: none;
}

.ask-bldg-title {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.28;
  font-weight: 700;
  color: #111827;
}

.ask-bldg-sub {
  margin: 4px 0 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #4b5563;
}

.ask-bldg-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: #eef4ff;
  border: 1px solid rgba(36, 87, 198, 0.2);
  color: #1e40af;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.ask-bldg-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-block-end: 14px;
}

.ask-bldg-chip {
  appearance: none;
  font: inherit;
  font-size: 0.86rem;
  line-height: 1.3;
  font-weight: 500;
  color: #1e293b;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 8px 14px;
  min-block-size: 38px;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ask-bldg-chip:hover {
  background: #eff6ff;
  border-color: #2457c6;
  color: #1d4ed8;
}

.ask-bldg-chip.is-selected {
  background: #dbeafe;
  border-color: #2457c6;
  color: #1e3a8a;
  font-weight: 600;
}

.ask-bldg-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ask-bldg-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
}

.ask-bldg-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.ask-bldg-input {
  font: inherit;
  font-size: max(1rem, 1em);
  line-height: 1.4;
  color: #0f172a;
  background: #ffffff;
  border: 1.5px solid #64748b;
  border-radius: 12px;
  padding: 11px 14px;
  min-block-size: 48px;
  box-sizing: border-box;
  width: 100%;
}

.ask-bldg-input::placeholder {
  color: #64748b;
}

.ask-bldg-input:user-invalid,
.ask-bldg-input[aria-invalid="true"] {
  border-color: #b91c1c;
  background-color: #fef2f2;
}

.ask-bldg-submit {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.2;
  background: #2457c6;
  color: #ffffff !important;
  border: 1px solid #1e46a3;
  border-radius: 12px;
  padding: 12px 22px;
  min-block-size: 48px;
  min-inline-size: 124px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.ask-bldg-submit svg {
  color: #ffffff !important;
  stroke: #ffffff !important;
  flex: none;
}

.ask-bldg-submit:hover:not(:disabled) {
  background: #1d4ed8;
  color: #ffffff !important;
}

.ask-bldg-submit:disabled {
  opacity: 0.72;
  cursor: wait;
  color: #ffffff !important;
}

.ask-bldg-input:focus-visible,
.ask-bldg-submit:focus-visible,
.ask-bldg-chip:focus-visible,
.ask-bldg-action:focus-visible {
  outline: 3px solid #1d4ed8;
  outline-offset: 2px;
}

.ask-bldg-error {
  margin: 4px 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: #b91c1c;
}

.ask-bldg-progress-wrap {
  margin-block-start: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: #334155;
}

.ask-bldg-progress-wrap[hidden] {
  display: none !important;
}

.ask-bldg-progress {
  inline-size: 140px;
  block-size: 8px;
  accent-color: #2457c6;
}

.ask-bldg-result {
  margin-block-start: 16px;
}

.ask-bldg-result:empty {
  margin-block-start: 0;
}

.ask-bldg-answer-box {
  background: #ffffff;
  border: 1px solid #dbe3f0;
  border-radius: 14px;
  padding: 16px 18px;
}

.ask-bldg-answer-text {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.58;
  color: #0f172a;
}

.ask-bldg-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.ask-bldg-fact {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 10px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-size: 0.82rem;
  line-height: 1.3;
  color: #334155;
}

.ask-bldg-fact-lbl {
  color: #475569;
  font-weight: 500;
}

.ask-bldg-fact-val {
  color: #0f172a;
  font-weight: 700;
}

.ask-bldg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-block-start: 14px;
}

.ask-bldg-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 15px;
  min-block-size: 40px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.ask-bldg-action:hover {
  background: #f8fafc;
  border-color: #2457c6;
  color: #1d4ed8;
}

.ask-bldg-action--primary,
.ask-bldg-action--primary:hover,
.ask-bldg-action--primary:visited {
  background: #2457c6;
  border-color: #1e46a3;
  color: #ffffff !important;
}

.ask-bldg-meta {
  margin: 10px 0 0;
  font-size: 0.76rem;
  color: #64748b;
}

@media (pointer: coarse) {
  .ask-bldg-input,
  .ask-bldg-submit {
    min-block-size: 52px;
  }
  .ask-bldg-chip {
    min-block-size: 44px;
    padding-block: 10px;
  }
}

@container (width < 600px) {
  .ask-bldg-card {
    padding: 16px;
  }
  .ask-bldg-row {
    grid-template-columns: 1fr;
  }
  .ask-bldg-submit {
    width: 100%;
  }
}
