/* AI search pop-up (concept B), drawn by public/js/ai-popup.js. Everything is scoped to .as-popup.
   From ai-search-popup/design-source/src/popup.css. */
.as-popup {
  --as-blue: var(--albastru, #2b49a3);
  --as-red: var(--rosuScris, #d93644);
  --as-text: var(--negru, #1f1e24);
  --as-muted: var(--griScris, #707070);
  --as-border: var(--griDeschis, #dae0e5);
  --as-white: var(--alb, #fff);
  --as-soft: #f3f5f8;
  --as-focus: #2b49a3;
  box-sizing: border-box;
  color: var(--as-text);
  font: 14px/1.5 "Open Sans", Arial, sans-serif;
  text-align: left;
  width: min(1040px, calc(100% - 48px));
  max-width: none;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  padding: 0;
  margin: auto;
  border: 1px solid var(--as-border);
  border-radius: 6px;
  background: var(--as-white);
  box-shadow: 0 24px 80px #1f1e2438;
  overflow: hidden;
}
.as-popup::backdrop { background: rgb(31 30 36 / 54%); }
.as-popup *, .as-popup *::before, .as-popup *::after { box-sizing: border-box; }
.as-popup [hidden] { display: none !important; }
.as-popup .as-shell { display: flex; flex-direction: column; max-height: calc(100vh - 50px); max-height: calc(100dvh - 50px); min-height: 0; }
.as-popup .as-header { flex: none; padding: 20px 24px 16px; border-bottom: 1px solid var(--as-border); }
/* piese: style.css fixes every <header> at the top of the page (header { position: fixed; top: 0; width: 100% }): the
   pop-up header stays inside the dialog */
.as-popup header.as-header { position: static; width: auto; left: auto; top: auto; z-index: auto; background: var(--as-white); }
.as-popup .as-titlebar { display: flex; align-items: center; gap: 10px; }
.as-popup .as-badge { flex: none; border: 1px solid var(--as-blue); color: var(--as-blue); font-size: 11px; padding: 0 5px; border-radius: 2px; font-weight: 700; white-space: nowrap; }
.as-popup .as-query { flex: 1; min-width: 0; margin: 0; font-size: 16px; line-height: 1.4; color: var(--as-muted); overflow-wrap: anywhere; }
.as-popup .as-query strong { color: var(--as-text); font-weight: 600; }
.as-popup .as-interpretation { margin: 6px 0 0; color: var(--as-muted); font-size: 12px; overflow-wrap: anywhere; }
.as-popup .as-scroll { min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.as-popup .as-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); }
.as-popup .as-vehicle { padding: 24px; background: var(--as-soft); border-right: 1px solid var(--as-border); min-width: 0; }
.as-popup .as-vehicle-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.as-popup .as-eyebrow { color: var(--as-muted); font-size: 12px; font-weight: 600; letter-spacing: .025em; }
.as-popup .as-vehicle-name { font-size: 17px; font-weight: 700; margin: 0 0 4px; overflow-wrap: anywhere; }
.as-popup .as-vehicle-label { margin: 0; overflow-wrap: anywhere; }
.as-popup .as-specs { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; margin: 18px 0; padding-top: 16px; border-top: 1px solid var(--as-border); }
.as-popup .as-specs dt { color: var(--as-muted); }
.as-popup .as-specs dd { margin: 0; overflow-wrap: anywhere; }
.as-popup .as-context { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.as-popup .as-chip { background: #e5e9f0; color: var(--as-text); padding: 3px 8px; font-size: 12px; border-radius: 2px; overflow-wrap: anywhere; }
.as-popup .as-main { padding: 24px; min-width: 0; }
.as-popup .as-question { margin: 0 0 6px; font-size: 20px; line-height: 1.35; font-weight: 700; overflow-wrap: anywhere; }
.as-popup .as-hint { margin: 0 0 18px; color: var(--as-muted); }
.as-popup .as-options { display: grid; gap: 10px; margin-top: 18px; }
.as-popup .as-options-2col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.as-popup .as-choice {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 13px 16px;
  border: 1px solid var(--as-border); border-radius: 2px; background: var(--as-white);
  color: var(--as-text); font: inherit; text-align: left; cursor: pointer;
  text-decoration: none; min-height: 58px; box-shadow: none; white-space: normal;
}
.as-popup .as-choice-copy { flex: 1; min-width: 0; }
.as-popup .as-choice-label { display: block; font-size: 15px; font-weight: 400; overflow-wrap: anywhere; }
.as-popup .as-path { display: block; color: var(--as-muted); font-size: 12px; margin-top: 2px; overflow-wrap: anywhere; }
.as-popup .as-choice:hover:not(:disabled) { border-color: var(--as-blue); background: #f7f9fd; }
.as-popup .as-choice:active:not(:disabled) { background: #edf1fa; }
.as-popup .as-count { color: var(--as-blue); background: #edf1fa; padding: 2px 7px; border-radius: 2px; font-size: 12px; }
.as-popup .as-actions { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 14px; }
.as-popup .as-link { color: var(--as-blue); background: transparent; border: 0; padding: 10px 0; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; gap: 7px; text-align: left; overflow-wrap: anywhere; }
.as-popup .as-reply { margin: 20px 0 0; }
.as-popup .as-label { display: block; font-weight: 600; margin-bottom: 7px; }
.as-popup .as-input-row { display: flex; align-items: stretch; gap: 8px; }
.as-popup .as-input { min-width: 0; flex: 1; width: 100%; padding: 11px 12px; border: 1px solid #89939f; border-radius: 2px; background: var(--as-white); color: var(--as-text); font: inherit; min-height: 44px; box-shadow: none; }
.as-popup .as-input::placeholder { color: var(--as-muted); opacity: 1; }
.as-popup .as-input[aria-invalid="true"] { border-color: #b22124; }
.as-popup .as-button { min-height: 44px; padding: 10px 20px; border-radius: 2px; border: 1px solid var(--as-border); background: var(--as-white); color: var(--as-text); font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; justify-content: center; align-items: center; gap: 8px; }
.as-popup .as-primary { background: var(--as-red); border-color: var(--as-red); color: #fff; }
.as-popup .as-primary:hover:not(:disabled) { background: #b22124; border-color: #b22124; }
.as-popup .as-button:not(.as-primary):hover:not(:disabled) { background: var(--as-soft); }
.as-popup .as-icon-button { background: transparent; border: 0; color: var(--as-text); width: 44px; height: 44px; flex: 0 0 44px; padding: 11px; cursor: pointer; margin-left: auto; border-radius: 2px; display: inline-flex; align-items: center; justify-content: center; }
.as-popup .as-icon-button:hover { background: #e5e9f0; }
.as-popup .as-icon { display: inline-block; width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.as-popup .as-sparkle { color: var(--as-red); width: 26px; height: 26px; flex-basis: 26px; }
.as-popup .as-footer { padding: 12px 24px; border-top: 1px solid var(--as-border); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none; background: var(--as-white); }
.as-popup .as-footer .as-link { font-weight: 600; font-size: 13px; text-decoration: none; }
.as-popup .as-error { color: #b22124; margin: 6px 0 0; font-size: 13px; }
.as-popup .as-notice { padding: 12px 14px; background: var(--as-soft); border-left: 3px solid var(--as-blue); margin: 0 0 16px; }
.as-popup .as-status { display: flex; align-items: center; gap: 10px; margin: 16px 0; color: var(--as-muted); }
.as-popup .as-spinner { width: 20px; height: 20px; border: 2px solid var(--as-border); border-top-color: var(--as-blue); border-radius: 50%; animation: as-popup-spin .8s linear infinite; }
.as-popup .as-skeleton { height: 58px; border: 1px solid var(--as-border); background: var(--as-soft); margin-top: 10px; border-radius: 2px; }
.as-popup :is(button, a, input):focus-visible { outline: 2px solid var(--as-focus); outline-offset: 3px; }
.as-popup :is(.as-question, .as-query):focus { outline: none; }
.as-popup :disabled { opacity: .55; cursor: wait; }
.as-popup .as-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@keyframes as-popup-spin { to { transform: rotate(360deg); } }
@media (max-width: 700px) {
  .as-popup .as-options-2col { grid-template-columns: minmax(0, 1fr); }
  .as-popup { width: calc(100% - 16px); max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
  .as-popup .as-shell { max-height: calc(100vh - 18px); max-height: calc(100dvh - 18px); }
  .as-popup .as-header { padding: 12px 16px; }
  .as-popup .as-titlebar { gap: 7px; }
  .as-popup .as-query { font-size: 14px; }
  .as-popup .as-titlebar .as-sparkle { width: 20px; height: 20px; flex-basis: 20px; }
  .as-popup .as-layout { grid-template-columns: minmax(0, 1fr); }
  .as-popup .as-vehicle { padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--as-border); }
  .as-popup .as-vehicle-top { margin-bottom: 2px; }
  .as-popup .as-specs { display: flex; flex-wrap: wrap; margin: 8px 0 0; padding-top: 8px; gap: 4px 8px; font-size: 13px; }
  .as-popup .as-specs dt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .as-popup .as-specs dd:not(:last-child)::after { content: " ·"; margin-left: 8px; color: var(--as-muted); }
  .as-popup .as-vehicle-name { font-size: 16px; display: inline; margin-right: 5px; }
  .as-popup .as-vehicle-label { display: inline; }
  .as-popup .as-main { padding: 18px 16px; }
  .as-popup .as-question { font-size: 18px; }
  .as-popup .as-choice { padding: 12px; }
  .as-popup .as-input-row { flex-direction: column; }
  .as-popup .as-input { font-size: 16px; }
  .as-popup .as-footer { padding: 8px 16px; gap: 8px; }
  .as-popup .as-footer .as-link { font-size: 12px; }
  .as-popup .as-footer .as-button { padding: 8px 12px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { .as-popup .as-spinner { animation: none; } }
@media (forced-colors: active) { .as-popup .as-choice, .as-popup .as-button { border: 1px solid ButtonText; } }
@media print { .as-popup { display: none !important; } }
