/* ============================================================================
   Ask Hitch — per-opportunity chat card (askhitch.js). Uses the platform design
   tokens (explorer/hitch-tokens.css). Lives as the first card in the detail
   left column; an "expand" toggle (body.ah-zoom) floats it as a large overlay.
   ========================================================================== */

.ah-card {
  position: relative;
  background: linear-gradient(180deg, rgba(255,183,77,.05), rgba(0,0,0,0)) , var(--bg-soft, #101216);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 16px 12px;
  margin-bottom: 16px;
  font-family: var(--sans);
  box-shadow: 0 1px 0 rgba(255,255,255,.02) inset, 0 10px 30px rgba(0,0,0,.18);
}
.ah-head { display: flex; align-items: center; gap: .55rem; }
/* the canonical home-hero wordmark: two-tone serif — "Ask" ink + "Hitch" gold italic */
.ah-mark { font-family: var(--serif); font-weight: 400; font-size: 1.16rem; line-height: 1; letter-spacing: .01em; }
.ah-mark .ah-a { color: var(--ink); }
.ah-mark .ah-h { color: var(--accent); font-style: italic; }
.ah-sp { flex: 1; }
/* grounding status — states what Ask Hitch reads; no meaningless "live" pill.
   Idle: muted, no dot. Reading: gold with a pulsing dot. */
.ah-live {
  display: inline-flex; align-items: center; gap: .35rem;
  font-family: var(--mono); font-size: .56rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-faint); white-space: nowrap;
}
.ah-live i { width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.ah-live.reading { color: var(--accent); }
.ah-live.reading i { background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: ah-pulse 1s infinite; }
@keyframes ah-pulse { 0%,100% { opacity: 1 } 50% { opacity: .3 } }
.ah-icon {
  background: none; border: 1px solid transparent; color: var(--ink-faint);
  font-size: .95rem; line-height: 1; cursor: pointer; border-radius: 8px; padding: .2rem .35rem;
}
.ah-icon:hover { color: var(--ink); border-color: var(--line); }

.ah-sub { margin: .55rem 0 .6rem; font-size: .82rem; line-height: 1.55; color: var(--ink-dim); }
.ah-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .5rem; }
.ah-chip {
  font-family: var(--mono); font-size: .64rem; letter-spacing: .04em;
  color: var(--ink-faint); background: var(--field, #0c0e11); border: 1px solid var(--line);
  border-radius: 100px; padding: .28rem .6rem;
}
.ah-chip.hot { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }

/* transcript */
.ah-log { display: flex; flex-direction: column; gap: 12px; max-height: 52vh; overflow-y: auto; margin: .3rem 0; padding-right: 2px; }
.ah-log:empty { display: none; }
.ah-msg { display: flex; flex-direction: column; gap: 6px; }
.ah-msg.ah-user { align-items: flex-end; }
.ah-user .ah-b {
  background: color-mix(in srgb, var(--accent) 16%, var(--bg-soft));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  color: var(--ink); border-radius: 12px 12px 4px 12px; padding: .5rem .75rem; max-width: 88%;
  font-size: .86rem; line-height: 1.5;
}
.ah-asst .ah-b {
  background: var(--field, #0c0e11); border: 1px solid var(--line); border-radius: 12px 12px 12px 4px;
  padding: .7rem .85rem; color: var(--ink-dim); font-size: .87rem; line-height: 1.62; max-width: 100%;
}
.ah-asst .ah-b p { margin: 0 0 .5rem; }
.ah-asst .ah-b p:last-child { margin-bottom: 0; }
.ah-asst .ah-b ul { margin: .2rem 0 .5rem; padding-left: 1.1rem; }
.ah-asst .ah-b li { margin: .15rem 0; }
.ah-asst .ah-b b { color: var(--ink); font-weight: 600; }
.ah-asst .ah-b code { font-family: var(--mono); font-size: .8rem; background: var(--field, #05070a); border: 1px solid var(--line); border-radius: 5px; padding: .05rem .3rem; color: var(--ink); }
.ah-src { font-family: var(--mono); font-size: .72rem; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 5px; padding: .02rem .3rem; white-space: nowrap; }
.ah-err { color: #e0655f; }

.ah-badge { font-family: var(--mono); font-size: .56rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); margin-top: .5rem; }
.ah-cites { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .55rem; }
.ah-cite {
  font-family: var(--mono); font-size: .68rem; color: var(--ink-dim);
  background: var(--field, #05070a); border: 1px solid var(--line); border-radius: 6px; padding: .16rem .45rem; text-decoration: none;
}
a.ah-cite:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }

/* footnote citations — numbered superscript in the answer + a hover "ibox" that
   names the document and its page, and a footnotes list under the answer. */
.ah-fn {
  position: relative; cursor: default; font-family: var(--mono); font-size: .58rem;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 5px;
  padding: 0 .3rem; margin-left: .12rem; vertical-align: super; line-height: 1.3; outline: none;
}
.ah-fn:hover, .ah-fn:focus { background: color-mix(in srgb, var(--accent) 28%, transparent); }
/* fixed-positioned so the scrolling chat container can't clip it; JS places it
   (askhitch.js positionIbox) and clamps it on-screen. */
.ah-ibox {
  display: none; position: fixed; top: 0; left: 0; z-index: 200; width: 244px; max-width: 88vw;
  background: var(--bg-panel, #0c0e11); border: 1px solid var(--line); border-radius: 10px;
  padding: .6rem .7rem; box-shadow: 0 12px 34px rgba(0,0,0,.55); text-align: left; white-space: normal;
  pointer-events: none;
}
.ah-fn.ah-hot .ah-ibox { display: block; }
.ah-ibox b { display: block; font-family: var(--sans); font-size: .74rem; font-weight: 500; color: var(--ink); word-break: break-all; }
.ah-ibox-pg { display: block; font-family: var(--mono); font-size: .64rem; color: var(--ink-dim); margin-top: .25rem; }
.ah-ibox-hint { display: block; margin-top: .4rem; font-family: var(--mono); font-size: .6rem; letter-spacing: .04em; color: var(--accent); }
.ah-fnlist { margin: .65rem 0 0; padding: .5rem 0 0 1.2rem; border-top: 1px solid var(--line-soft); }
.ah-fnlist li { font-family: var(--mono); font-size: .68rem; color: var(--ink-dim); margin: .22rem 0; word-break: break-all; }
.ah-fnlist a { color: var(--ink-dim); text-decoration: none; }
.ah-fnlist a:hover { color: var(--accent); }

/* recommended follow-ups */
.ah-fu { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .3rem; padding-left: .1rem; }
.ah-fu-l { font-family: var(--mono); font-size: .58rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); margin-right: .1rem; }
.ah-fubtn, .ah-starter {
  text-align: left; background: var(--field, #0c0e11); border: 1px solid var(--line); color: var(--ink-dim);
  border-radius: 100px; padding: .34rem .7rem; font-size: .78rem; font-family: var(--sans); cursor: pointer;
  transition: border-color .12s, color .12s;
}
.ah-fubtn:hover, .ah-starter:hover { color: var(--ink); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }

/* starter suggestions (empty-thread state) */
.ah-starters { display: flex; flex-direction: column; align-items: stretch; gap: .4rem; margin: .3rem 0 .6rem; }
.ah-starters:empty { display: none; }
.ah-starter { border-radius: 10px; }

/* thinking dots */
.ah-think { display: inline-flex; gap: 4px; padding: .15rem 0; }
.ah-think i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-faint); animation: ah-blink 1.2s infinite; }
.ah-think i:nth-child(2) { animation-delay: .2s; }
.ah-think i:nth-child(3) { animation-delay: .4s; }
@keyframes ah-blink { 0%,80%,100% { opacity: .25 } 40% { opacity: 1 } }

/* composer */
.ah-composer { display: flex; align-items: center; gap: .5rem; background: var(--field, #0c0e11); border: 1px solid var(--line); border-radius: 12px; padding: .35rem .4rem .35rem .75rem; margin-top: .4rem; }
.ah-composer:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.ah-ta { flex: 1; resize: none; background: none; border: none; outline: none; color: var(--ink); font-family: var(--sans); font-size: .88rem; line-height: 1.5; max-height: 120px; }
.ah-ta::placeholder { color: var(--ink-faint); }
.ah-send { flex: none; align-self: flex-end; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--accent); background: var(--accent); color: #1a1206; font-size: .95rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ah-send:hover { filter: brightness(1.08); }

.ah-foot { display: flex; align-items: center; gap: .5rem; margin-top: .6rem; }
.ah-key { font-family: var(--mono); font-size: .62rem; letter-spacing: .08em; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 100px; padding: .16rem .5rem; }
.ah-disc { font-size: .72rem; color: var(--ink-faint); }

/* the on-ramp: the preview card is a doorway — this opens the shelf at this opp */
.ah-onramp {
  display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; cursor: pointer;
  font-family: var(--mono); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); background: rgba(232,161,60,.07);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
  border-radius: 100px; padding: .4rem .8rem; transition: background .15s, border-color .15s;
}
.ah-onramp:hover { background: rgba(232,161,60,.14); border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.ah-onramp .ah-arw { font-size: .85rem; line-height: 1; }

/* .ask-hitch-trigger (topbar pill that opens the shelf) is styled by
   ../explorer/platform/ask-shelf.css — loaded on this page alongside this file. */
