/* BTCgold — "Ask BTCgold AI": the launcher button and the chat panel (home page only; behaviour in ask.js).
   Uses the colours of styles.css. Movement is slow and soft (opacity and transform only), and nothing here moves
   the page. Both parts carry the hidden attribute in the HTML and are shown by ask.js, so without scripts there is
   no button that does nothing. */

.ask-launch[hidden], .ask[hidden], .ask-link[hidden], .ask-chips[hidden] { display: none !important; }
.ask-launch, .ask { --ask-ease: cubic-bezier(.22, .61, .36, 1); }

/* ---------- Launcher (bottom left; the whitepaper button is bottom right) ---------- */
.ask-launch {
  position: fixed; left: calc(20px + env(safe-area-inset-left, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  display: inline-flex; align-items: center; gap: 9px; min-height: 48px; padding: 0 20px 0 15px; border-radius: 999px;
  border: 1px solid var(--gold-3); background: rgba(13, 11, 8, .94); color: var(--gold); font-weight: 700; font-size: 15px; white-space: nowrap; cursor: pointer;
  box-shadow: 0 14px 40px -14px rgba(242, 195, 91, .45), 0 4px 14px rgba(0, 0, 0, .55);
  visibility: hidden; opacity: 0; transform: translateY(10px);
  transition: opacity 1.1s var(--ask-ease), transform 1.1s var(--ask-ease), visibility 0s linear 1.1s, border-color .4s ease, background-color .4s ease;
}
.ask-launch .ico { width: 21px; height: 21px; }
.ask-launch.ready { visibility: visible; opacity: 1; transform: none; transition: opacity 1.1s var(--ask-ease), transform 1.1s var(--ask-ease), visibility 0s, border-color .4s ease, background-color .4s ease; }
.ask-launch.ready:hover { border-color: var(--gold); background: rgba(27, 23, 15, .96); }
/* While the panel is open the launcher steps aside (and cannot be reached by Tab). */
.ask-launch.ready.away { visibility: hidden; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .5s var(--ask-ease), transform .5s var(--ask-ease), visibility 0s linear .5s; }
/* Not during the vault opening. */
html.intro-on .ask-launch { visibility: hidden; opacity: 0; transition: none; }
@media (max-width: 480px) {
  .ask-launch { left: calc(16px + env(safe-area-inset-left, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); min-height: 46px; padding: 0 16px 0 13px; }
  .ask-l-mid { display: none; }
}

/* ---------- Panel ---------- */
.ask {
  position: fixed; left: calc(20px + env(safe-area-inset-left, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 80;
  width: min(400px, calc(100vw - 40px));
  /* Below the price strip and the header, when the window is tall enough for that. */
  height: min(640px, max(380px, calc(100vh - 136px)), calc(100vh - 40px)); height: min(640px, max(380px, calc(100dvh - 136px)), calc(100dvh - 40px));
  display: flex; flex-direction: column; overflow: hidden;
  background: linear-gradient(180deg, #17130b 0%, #0d0b08 38%); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: 22px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .9), 0 18px 60px -30px rgba(242, 195, 91, .35);
  visibility: hidden; opacity: 0; pointer-events: none; transform: translateY(18px) scale(.985); transform-origin: 0 100%;
  transition: opacity .6s var(--ask-ease), transform .6s var(--ask-ease), visibility 0s linear .6s;
}
.ask.open { visibility: visible; opacity: 1; pointer-events: auto; transform: none; transition: opacity .8s var(--ask-ease), transform .8s var(--ask-ease), visibility 0s; }
.ask:focus { outline: none; }

.ask-head { display: flex; align-items: center; gap: 11px; padding: 14px 12px 13px 16px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, rgba(242, 195, 91, .07), transparent); }
.ask-head img { width: 32px; height: 32px; flex: none; }
.ask-head-text { min-width: 0; flex: 1; }
.ask-head h2 { font-size: 16.5px; line-height: 1.25; font-weight: 800; letter-spacing: -.01em; }
.ask-head p { font-size: 12.5px; line-height: 1.35; color: var(--ink-3); }
.ask-new { flex: none; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--ink-2); font-size: 13px; font-weight: 600; cursor: pointer; transition: border-color .4s ease, color .4s ease; }
.ask-new:hover { border-color: var(--gold-3); color: var(--ink); }
.ask-new[hidden] { display: none; }
.ask-close { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer; transition: border-color .4s ease, color .4s ease, background-color .4s ease; }
.ask-close:hover { border-color: var(--line-2); color: var(--ink); background: rgba(255, 255, 255, .04); }

.ask-log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 14px 10px; display: flex; flex-direction: column; gap: 11px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.ask-log:focus-visible { outline-offset: -3px; }
.ask-msg { max-width: 90%; padding: 10px 14px; border-radius: 17px; font-size: 15px; line-height: 1.56; white-space: pre-wrap; overflow-wrap: anywhere; animation: ask-in .7s var(--ask-ease) both; }
.ask-msg p { white-space: normal; }
.ask-bot { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 6px; color: var(--ink); }
.ask-user { align-self: flex-end; background: rgba(242, 195, 91, .13); border: 1px solid rgba(242, 195, 91, .34); border-bottom-right-radius: 6px; }
.ask-notice { align-self: stretch; max-width: none; background: rgba(242, 195, 91, .06); border: 1px dashed var(--line-2); color: var(--ink-2); font-size: 14px; }
.ask-msg a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(242, 195, 91, .5); }
.ask-msg a:hover { text-decoration-color: var(--gold); }
.ask-msg a { unicode-bidi: isolate; }   /* a link keeps its own order inside right-to-left text */
.ask-addr { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.5; padding: 2px 6px; border-radius: 7px; background: #0a0806; border: 1px solid var(--line-2); color: var(--gold); word-break: break-all; unicode-bidi: isolate; direction: ltr; }
@keyframes ask-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* One reply: the website's own check of a pasted address, the answer, official addresses in boxes, fixed notes. */
.ask-reply { align-self: stretch; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.ask-checked { align-self: stretch; max-width: none; background: rgba(242, 195, 91, .1); border: 1px solid var(--gold-3); color: var(--ink); font-size: 14px; }
.ask-cards { align-self: stretch; display: grid; gap: 8px; animation: ask-in .9s var(--ask-ease) both; }
.ask-card { padding: 11px 13px 10px; border-radius: 15px; border: 1px solid var(--gold-3); background: linear-gradient(180deg, rgba(242, 195, 91, .09), rgba(242, 195, 91, .03)); direction: ltr; text-align: left; }
.ask-card-label { font-size: 12px; line-height: 1.4; font-weight: 700; letter-spacing: .02em; color: var(--gold); margin-bottom: 6px; }
.ask-card .ask-addr { display: block; padding: 7px 9px; font-size: 12.5px; }
.ask-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 8px; font-size: 13px; }
.ask-copy { min-height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .04); color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; transition: border-color .4s ease, background-color .4s ease; }
.ask-copy:hover { border-color: var(--gold-3); background: rgba(242, 195, 91, .08); }
.ask-card-actions a { color: var(--gold); text-underline-offset: 3px; text-decoration-color: rgba(242, 195, 91, .5); }
.ask-card-hint { font-size: 11.5px; line-height: 1.45; color: var(--ink-3); }
.ask-notes { align-self: stretch; list-style: none; margin: 0; padding: 2px 0 2px 11px; border-left: 2px solid var(--gold-3); display: grid; gap: 4px; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); overflow-wrap: anywhere; animation: ask-in .9s var(--ask-ease) both; }
.ask-notes[dir="rtl"] { padding: 2px 11px 2px 0; border-left: 0; border-right: 2px solid var(--gold-3); }
.ask-notes a { color: var(--gold); text-underline-offset: 2px; unicode-bidi: isolate; }

/* Waiting for the first words: three dots breathing slowly. */
.ask-dots { display: inline-flex; gap: 6px; align-items: center; height: 1.56em; vertical-align: top; }
.ask-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); opacity: .25; animation: ask-dot 1.8s ease-in-out infinite; }
.ask-dots i:nth-child(2) { animation-delay: .3s; }
.ask-dots i:nth-child(3) { animation-delay: .6s; }
@keyframes ask-dot { 0%, 100% { opacity: .22; transform: none; } 45% { opacity: 1; transform: translateY(-2px); } }

.ask-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0 4px; animation: ask-in .9s var(--ask-ease) .15s both; }
.ask-chips button { min-height: 36px; padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); color: var(--ink-2); font-size: 13.5px; line-height: 1.3; text-align: start; cursor: pointer; transition: border-color .4s ease, color .4s ease, background-color .4s ease; }
.ask-chips button:hover { border-color: var(--gold-3); color: var(--ink); background: rgba(242, 195, 91, .08); }

.ask-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 8px; border-top: 1px solid var(--line); }
.ask-form textarea { flex: 1; min-width: 0; min-height: 46px; max-height: 118px; resize: none; padding: 11px 14px; border-radius: 15px; border: 1px solid var(--line-2); background: #0a0806; color: var(--ink); font: inherit; font-size: 16px; line-height: 1.4; transition: border-color .4s ease; }
.ask-form textarea::placeholder { color: var(--ink-3); }
.ask-form textarea:focus-visible { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(242, 195, 91, .16); }
.ask-send { flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; border: 0; background: var(--gold-fill); color: var(--gold-ink); cursor: pointer; transition: opacity .4s ease, box-shadow .4s ease; box-shadow: 0 8px 26px -12px rgba(242, 195, 91, .7); }
.ask-send:disabled { opacity: .4; cursor: default; box-shadow: none; }
.ask-send .ico { stroke-width: 2.2; }

.ask-check:empty { display: none; }
.ask-check { padding: 0 12px 6px; }
.ask-status { padding: 0 14px; font-size: 13px; line-height: 1.45; color: #f0b57a; }
.ask-status:empty { display: none; }
.ask-status:not(:empty) { padding-bottom: 6px; }
.ask-foot { padding: 0 14px calc(11px + env(safe-area-inset-bottom, 0px)); font-size: 12px; line-height: 1.5; color: var(--ink-3); }
.ask-foot a { color: var(--ink-2); text-underline-offset: 2px; }
.ask-safe { color: var(--ink-2); }

/* ---------- Phones: a sheet along the bottom edge, above the on-screen keyboard (ask.js sets the two values) ---------- */
@media (max-width: 560px) {
  .ask { left: 0; right: 0; bottom: var(--ask-kb, 0px); width: auto; border-radius: 20px 20px 0 0; border-width: 1px 0 0;
    height: min(640px, 88vh); height: min(640px, 88dvh); max-height: calc(var(--ask-vh, 100vh) - 8px);
    transform: translateY(26px); transform-origin: 50% 100%; }
  .ask-msg { max-width: 92%; }
}
@media (max-width: 340px) {
  .ask-head { gap: 8px; padding-left: 12px; }
  .ask-head p { display: none; }
  .ask-new { padding: 0 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .ask-launch, .ask-launch.ready, .ask-launch.ready.away, .ask, .ask.open { transition: none; transform: none; }
  .ask-msg, .ask-chips, .ask-cards, .ask-notes { animation: none; }
  .ask-dots i { animation: none; opacity: .7; }
}
@media print { .ask, .ask-launch { display: none !important; } }
