/* Prompt window hero, AI estimate result, cost section and the site assistant. Loaded after site.css. */
.hero h1 { font-size: clamp(42px, 6.6vw, 92px); line-height: 1.04; }
.hero-in { grid-template-columns: minmax(0, 1.05fr) minmax(0, 520px); }
.sec-head h2 .h-on { color: var(--on); }

.prompt { background: var(--panel); color: var(--panel-fg); border-radius: 8px; padding: clamp(18px, 2.4vw, 26px); display: grid; gap: 14px; min-width: 0; box-shadow: 0 24px 60px -30px rgba(18, 18, 18, .55); scroll-margin-top: 84px; }
.prompt-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--panel-line); }
.prompt-live { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--panel-muted); }
.prompt-live i { width: 8px; height: 8px; background: var(--on); animation: blink 1.6s steps(2) infinite; flex: none; }
@keyframes blink { 50% { opacity: .25; } }
.prompt-q { font-size: clamp(20px, 2.2vw, 26px); font-weight: 800; letter-spacing: -0.03em; }
.prompt textarea { width: 100%; min-height: 132px; padding: 14px; border: 1px solid var(--panel-line); border-radius: var(--r); background: var(--panel-2); color: #fff; font-size: 17px; line-height: 1.55; resize: vertical; }
.prompt textarea::placeholder { color: #7d828d; }
.prompt textarea:focus { outline: 2px solid var(--on); outline-offset: -1px; border-color: var(--on); }
.prompt .chip { background: transparent; border-color: var(--panel-line); color: var(--panel-fg); }
.prompt .chip:hover { border-color: #fff; }
.prompt-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.prompt-count { font-size: 13px; color: var(--panel-muted); font-variant-numeric: tabular-nums; }
.prompt-count b { color: var(--panel-fg); font-weight: 700; }
.btn.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-busy::after { content: ""; position: absolute; width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.result { padding-block: clamp(32px, 5vw, 64px); scroll-margin-top: 64px; }
.result .est-out { background: var(--paper); gap: 24px; padding: clamp(18px, 3vw, 36px); }
.est-wait { display: grid; gap: 10px; }
.est-wait b { font-size: 20px; }
.est-wait p { color: var(--muted); font-size: 14px; }
.est-wait .bar { height: 4px; background: var(--line); overflow: hidden; }
.est-wait .bar i { display: block; width: 35%; height: 100%; background: var(--on); animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.est-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 32px; align-items: start; }
.est-head h2 { font-size: clamp(24px, 3vw, 36px); font-weight: 800; }
.est-head .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.est-summary { margin-top: 10px; font-size: 16px; color: var(--ink-2); max-width: 64ch; }
.result .est-price { text-align: right; }
.est-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: clamp(20px, 3vw, 40px); align-items: start; }
.est-col { display: grid; gap: 24px; min-width: 0; align-content: start; }
.est-block { display: grid; gap: 10px; min-width: 0; }
.est-block h3 { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: 0; }
.est-block p { font-size: 14px; color: var(--ink-2); }
.est-lines { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.est-lines li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line-2); font-size: 14px; align-items: baseline; }
.est-lines li:last-child { border-bottom: 0; }
.est-lines li b { font-weight: 700; }
.est-lines li span { color: var(--muted); }
.est-lines li em { font-style: normal; font-weight: 700; }
.est-lines li.sum { background: var(--ink); color: #fff; }
.est-lines li.sum span { color: #b4b9c4; }
.feat { display: grid; border-top: 2px solid var(--ink); counter-reset: f; }
.feat li { counter-increment: f; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 4px 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.feat li::before { content: counter(f, decimal-leading-zero); font: 800 13px var(--display); color: var(--on); padding-top: 3px; }
.feat b { font-size: 16px; }
.feat span { grid-column: 2; font-size: 14px; color: var(--muted); }
.miles { display: grid; gap: 6px; }
.miles li { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); font-size: 14px; }
.miles li i { font: 800 13px var(--display); font-style: normal; color: var(--on); padding-top: 2px; }
.miles li b { display: block; }
.miles li span { color: var(--muted); }
.tagrow { display: flex; flex-wrap: wrap; gap: 6px; }
.tagrow li { padding: 5px 10px; border: 1px solid var(--line); border-radius: 2px; background: var(--surface); font-size: 13px; font-weight: 600; }
.dots li { font-size: 14px; padding: 3px 0 3px 14px; position: relative; color: var(--ink-2); }
.dots li::before { content: ""; position: absolute; left: 0; top: 12px; width: 5px; height: 5px; background: var(--on); }
.est-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.est-foot p { font-size: 13px; color: var(--muted); max-width: 60ch; }
.est-foot .est-actions { margin: 0; }

#cost .compare { margin-top: 0; }
.cost-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

/* assistant */
.chat-fab { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 70; display: inline-flex; align-items: center; gap: 12px; padding: 8px 20px 8px 8px; border: 0; border-radius: 12px; background: var(--ink); color: #fff; text-align: left; box-shadow: 0 14px 34px -10px rgba(18, 18, 18, .55), 0 0 0 1px rgba(255, 255, 255, .06) inset; transition: transform .15s, box-shadow .15s; }
.chat-fab:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -10px rgba(31, 77, 255, .55), 0 0 0 1px rgba(255, 255, 255, .1) inset; }
.chat-fab:active { transform: translateY(0); }
.chat-fab[aria-expanded="true"] { display: none; }
.fab-mark { position: relative; flex: none; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 9px; background: var(--on); color: #fff; --bot-visor: #0d1b52; --bot-eye: #9fb4ff; }
.fab-mark svg { width: 36px; height: 36px; display: block; }
.fab-ai { position: absolute; right: -6px; top: -6px; min-width: 22px; height: 20px; padding: 0 5px; display: grid; place-items: center; border-radius: 4px; background: #fff; color: var(--on); font: 800 11px/1 var(--display); font-style: normal; letter-spacing: .02em; box-shadow: 0 0 0 2px var(--ink); }
.fab-text { display: grid; gap: 1px; line-height: 1.25; }
.fab-text b { font-size: 15px; letter-spacing: -0.02em; }
.fab-text small { font-size: 12px; color: #b4b9c4; font-weight: 500; }
.bot-eye { transform-box: fill-box; transform-origin: center; animation: blinkeye 5s infinite; }
.bot-ant { animation: antenna 2.4s ease-in-out infinite; }
@keyframes blinkeye { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes antenna { 50% { opacity: .35; } }

.chat-teaser { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(92px + env(safe-area-inset-bottom, 0px)); z-index: 69; max-width: 250px; margin: 0; padding: 12px 36px 12px 14px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; font-size: 14px; line-height: 1.45; box-shadow: 0 14px 36px -12px rgba(18, 18, 18, .35); animation: rise .35s ease-out; }
.chat-teaser::after { content: ""; position: absolute; right: 38px; bottom: -7px; width: 12px; height: 12px; background: var(--surface); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: rotate(45deg); }
.chat-teaser button { position: absolute; right: 4px; top: 4px; width: 32px; height: 32px; border: 0; background: none; }
.chat-teaser button::before, .chat-teaser button::after { content: ""; position: absolute; left: 10px; right: 10px; top: 15px; height: 2px; background: var(--muted); transform: rotate(45deg); }
.chat-teaser button::after { transform: rotate(-45deg); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.chat { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 75; width: min(400px, calc(100vw - 32px)); height: min(620px, calc(100dvh - 96px)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 30px 80px -20px rgba(18, 18, 18, .5); overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 8px 12px 14px; background: var(--ink); color: #fff; }
.chat-head > div { flex: 1; min-width: 0; }
.head-mark { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; background: var(--on); color: #fff; --bot-visor: #0d1b52; --bot-eye: #9fb4ff; }
.head-mark svg { width: 28px; height: 28px; }
.chat-head b { display: block; font-size: 15px; }
.chat-head span { font-size: 12px; color: #b4b9c4; }
.chat-x { width: 40px; height: 40px; border: 0; background: none; position: relative; flex: none; }
.chat-x::before, .chat-x::after { content: ""; position: absolute; left: 11px; right: 11px; top: 19px; height: 2px; background: #fff; transform: rotate(45deg); }
.chat-x::after { transform: rotate(-45deg); }
.chat-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.chat-tabs button { min-height: 44px; border: 0; background: none; font-size: 14px; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; }
.chat-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--on); }
.chat-talk { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--paper); overscroll-behavior: contain; }
.msg { max-width: 86%; padding: 10px 12px; border-radius: var(--r); font-size: 14px; line-height: 1.55; white-space: pre-wrap; }
.msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); position: relative; margin-left: 30px; }
.msg.bot::before { content: ""; position: absolute; left: -30px; top: 0; width: 24px; height: 24px; border-radius: 6px; background: var(--on) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath d='M13 11h22a7 7 0 0 1 7 7v15a7 7 0 0 1-7 7H21l-9 7.5V40.6A7 7 0 0 1 6 33.6V18a7 7 0 0 1 7-7z' fill='%23fff'/%3E%3Crect x='11.5' y='17.5' width='25' height='15' rx='5' fill='%230d1b52'/%3E%3Crect x='17' y='22' width='5' height='6' rx='1.2' fill='%239fb4ff'/%3E%3Crect x='26' y='22' width='5' height='6' rx='1.2' fill='%239fb4ff'/%3E%3C/svg%3E") center / 18px no-repeat; }
.msg.me { align-self: flex-end; background: var(--ink); color: #fff; }
.msg.wait { color: var(--muted); }
.chat-quick { display: flex; gap: 6px; overflow-x: auto; padding: 8px 14px; scrollbar-width: none; border-top: 1px solid var(--line-2); }
.chat-quick::-webkit-scrollbar { display: none; }
.chat-quick .chip { flex: none; background: var(--surface); }
.chat-in { display: flex; gap: 8px; padding: 10px 14px 14px; }
.chat-in input { flex: 1; min-width: 0; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r); font-size: 16px; background: var(--surface); }
.chat-in input:focus { outline: 2px solid var(--on); outline-offset: -1px; }
.chat-ask { flex: 1; overflow-y: auto; padding: 14px; display: grid; gap: 12px; align-content: start; overscroll-behavior: contain; }
.chat-ask .field textarea { min-height: 84px; }
.chat-ask-note { font-size: 13px; color: var(--muted); }
.chat-ask .field small { font-weight: 500; color: var(--muted); }
.foot { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }

@media (prefers-reduced-motion: reduce) { .bot-eye, .bot-ant, .chat-teaser { animation: none; } }

@media (max-width: 1020px) {
  .hero-in, .est-body, .est-head { grid-template-columns: minmax(0, 1fr); }
  /* one column: headline, then the prompt window, then the facts */
  .hero-in { gap: 22px; }
  .hero-copy { display: contents; }
  .prompt { order: 2; }
  .hero-facts { order: 3; }
  .result .est-price { text-align: left; }
}
@media (max-width: 620px) {
  .prompt-foot .btn { width: 100%; }
  .prompt-count { order: 2; }
  .est-foot .btn, .est-foot .est-actions, .cost-cta .btn { width: 100%; }
  .est-lines li { grid-template-columns: minmax(0, 1fr) auto; }
  .est-lines li span { grid-column: 1; grid-row: 2; }
  .est-lines li em { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
  .chat { right: 0; left: 0; bottom: 0; top: 0; width: 100%; height: auto; border-radius: 0; border: 0; }
  .chat-head { padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
  .chat-in { padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .fab-text { display: none; }
  .chat-fab { padding: 6px; border-radius: 14px; }
  .fab-mark { width: 48px; height: 48px; }
  .chat-teaser { display: none; }
}
