/* AUREA AI page (/ai) — patch #133. Builds on rewards.css (.rw-card,
   .rw-sub, .rw-hidden) and boost.css (.fb-hero, .fb-soon); this file
   only adds the AI-specific pieces, in the shared neon shell style. */

.ai-balbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.ai-bal strong {
  font-size: 22px;
  color: var(--gold, #f5c451);
}

.ai-cats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0;
}
.ai-cat {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #39415F;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted, #A7ACC2);
  font-weight: 700;
  cursor: pointer;
}
.ai-cat.is-on {
  color: #0A0F1E;
  background: linear-gradient(90deg, #f5c451, #b78bff);
  border-color: transparent;
  box-shadow: 0 0 14px rgba(245, 196, 81, 0.35);
}

.ai-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.ai-card {
  text-align: left;
  border-radius: 16px;
  border: 1px solid #39415F;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px 14px;
  cursor: pointer;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ai-card:hover { border-color: rgba(245, 196, 81, 0.6); }
.ai-card.is-on {
  border-color: transparent;
  background: linear-gradient(#141b31, #141b31) padding-box,
    linear-gradient(90deg, #f5c451, #b78bff) border-box;
  border: 1px solid transparent;
  box-shadow: 0 0 16px rgba(183, 139, 255, 0.25);
}
.ai-card-name { font-weight: 800; font-size: 15px; }
.ai-card-meta { color: var(--muted, #A7ACC2); font-size: 12px; line-height: 1.45; }

.ai-opts {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.ai-opts .ai-field { flex: 1 1 160px; }

.ai-panel { margin-bottom: 14px; }
.ai-field {
  display: block;
  margin-bottom: 10px;
}
.ai-field > span {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
}
.ai-field textarea,
.ai-field select {
  width: 100%;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid #39415F;
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  padding: 10px 12px;
  font: inherit;
}
.ai-field textarea:focus,
.ai-field select:focus {
  outline: 2px solid rgba(183, 139, 255, 0.55);
  outline-offset: 1px;
}

.ai-log {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.ai-log:empty { display: none; }
.ai-msg {
  border-radius: 14px;
  padding: 10px 12px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
}
.ai-msg.user {
  align-self: flex-end;
  max-width: 88%;
  background: rgba(245, 196, 81, 0.12);
  border: 1px solid rgba(245, 196, 81, 0.35);
}
.ai-msg.assistant {
  align-self: flex-start;
  max-width: 92%;
  background: rgba(183, 139, 255, 0.08);
  border: 1px solid rgba(183, 139, 255, 0.35);
}

.ai-estrow { margin: 8px 0 12px; color: var(--muted, #A7ACC2); }
.ai-estrow strong { color: var(--gold, #f5c451); }

.ai-out {
  margin-top: 12px;
  border-radius: 14px;
  padding: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
  background: rgba(183, 139, 255, 0.08);
  border: 1px solid rgba(183, 139, 255, 0.35);
}

.ai-out-img {
  margin-top: 12px;
  max-width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(183, 139, 255, 0.35);
  box-shadow: 0 0 18px rgba(183, 139, 255, 0.18);
}

.ai-note { min-height: 1.2em; color: var(--muted, #A7ACC2); }
.ai-note.err { color: #ff8f8f; }

.ai-chatbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.ai-chatbar .ai-note { min-height: 0; margin: 0; font-size: 13px; }
.ai-clearbtn {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid #39415F;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted, #A7ACC2);
  font-weight: 700;
  cursor: pointer;
}
.ai-clearbtn:hover { border-color: rgba(245, 196, 81, 0.6); }

.ai-rate-row,
.ai-hist-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(57, 65, 95, 0.5);
  flex-wrap: wrap;
}
.ai-rate-row:last-child,
.ai-hist-row:last-child { border-bottom: none; }
.ai-hist-row .ai-hist-meta { color: var(--muted, #A7ACC2); font-size: 13px; }

/* AI rate cards — Launch-Pack style (2026-12-02): one card per feature,
   big credit price, unit underneath. Same markup is used on /credits. */
.ai-rate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.ai-rate-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
}
.ai-rate-name { font-weight: 700; color: #FFE873; font-size: 0.95rem; margin-bottom: 6px; }
.ai-rate-price { font-size: 1.05rem; color: var(--muted, #A7ACC2); }
.ai-rate-price strong { font-size: 1.35rem; font-weight: 800; color: #fff; }
.ai-rate-lab { font-size: 0.8rem; }
.ai-rate-unit { font-size: 0.8rem; color: var(--faint, #8B90A5); margin-top: 2px; }

/* "Fraction of the latest model" comparison badge + hero banner.
   Both are rendered by ai.js / credits.js ONLY from live ai_rates()
   rows whose own price is genuinely below the table's top tier. */
/* Per-run tier selection (patch #154) — rendered by ai.js only
   from live ai_rates() premium fields. */
.ai-tierrow {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 6px 14px; margin: 10px 0 2px;
}
.ai-tier-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; color: #FFE873; cursor: pointer;
}
.ai-tier-toggle input {
  accent-color: #FFD700; width: 16px; height: 16px; cursor: pointer;
}
.ai-tier-price { color: var(--muted, #A7ACC2); font-size: 0.85rem; }
.ai-tier-fixed { color: #FFD84D; margin: 10px 0 2px; }

.ai-cheap-badge {
  display: inline-block; margin-left: 8px; padding: 1px 8px;
  border: 1px solid rgba(255, 216, 77, 0.55); border-radius: 999px;
  background: rgba(255, 216, 77, 0.12); color: #FFD84D;
  font-size: 0.72rem; font-weight: 700; white-space: nowrap;
  vertical-align: 2px;
}
.ai-cheap-banner {
  margin: 12px 0 0; padding: 10px 16px; text-align: center;
  border: 1px solid rgba(255, 215, 0, 0.45); border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.10),
    rgba(124, 58, 237, 0.12) 55%, rgba(10, 15, 30, 0) 100%);
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.10);
  color: #FFE873; font-weight: 800; font-size: 1.05rem;
}

/* --- /ai hero (2026-12-03): the green dragon, large ---
   Image first, then heading and lead. On desktop the dragon sits
   beside the text; on mobile it becomes a wide banner on top so
   it never gets squeezed into a small left-hand thumbnail. */
.ai-hero {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 22px;
  align-items: center;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid rgba(255, 215, 0, 0.45);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.08),
    rgba(124, 58, 237, 0.10) 55%, rgba(10, 15, 30, 0) 100%);
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.10),
    0 0 22px rgba(124, 58, 237, 0.10);
}
.ai-hero-img {
  width: 100%;
  height: 100%;
  max-height: 320px;
  object-fit: cover;
  object-position: center 22%;
  border-radius: 16px;
  display: block;
}
.ai-hero-body h1 { margin: 0 0 8px; }
.ai-hero-body p { line-height: 1.65; }
.ai-hero-body .ai-aim { font-size: clamp(1.02rem, 2.4vw, 1.2rem); font-weight: 800; line-height: 1.55; color: var(--gold, #FFD700); letter-spacing: .01em; }
@media (max-width: 720px) {
  .ai-hero { grid-template-columns: 1fr; gap: 14px; padding: 14px; }
  .ai-hero-img { aspect-ratio: 16 / 10; height: auto; max-height: none; }
}

/* --- /ai quick chat (2026-12-03): inline chat in the hero card.
   Message bubbles reuse .ai-log / .ai-msg from this file; the
   markdown, waiting, feedback and composer pieces mirror chat.css
   under the aiqc- prefix so /ai does not load the app shell CSS. */
.aiqc { margin: 14px 0; }
/* Quick chat moved to the very top of /ai (2026-12-04, user request):
   breathing room under the topbar, and the hero section that used to
   open the page no longer needs its full top padding. */
.aiqc-top { margin-top: clamp(20px, 3.5vw, 36px); }
.ai-hero-sec { padding-top: 10px; }
.aiqc-head { display: flex; gap: 14px; align-items: flex-start; }
.aiqc-head img { border-radius: 50%; flex: none; }
.aiqc-head-t { min-width: 0; flex: 1; }
.aiqc-head-t h2 { margin: 2px 0 4px; }
.aiqc-head-t .rw-sub { margin: 0; }
.aiqc-bal {
  margin-left: auto;
  text-align: right;
  color: var(--muted, #A7ACC2);
  white-space: nowrap;
}
.aiqc-bal strong { color: var(--gold, #f5c451); font-size: 20px; }
@media (max-width: 560px) {
  .aiqc-head { flex-wrap: wrap; }
  .aiqc-bal { margin-left: 0; text-align: left; }
}
.aiqc-signin { margin-top: 12px; }
.aiqc-signin .rw-sub { margin-top: 0; }
.aiqc .fb-soon { margin-top: 12px; }

.aiqc-moderow {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.aiqc-modeseg {
  display: inline-flex;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  overflow: hidden;
}
.aiqc-modeseg button {
  background: transparent;
  border: none;
  color: var(--muted, #A7ACC2);
  padding: 7px 14px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}
.aiqc-modeseg button.is-on {
  background: linear-gradient(135deg, #FFD700, #f5c451);
  color: #14100a;
}
/* Trade Assistant swap-draft card (same block as chat.css). */
.trade-draft {
  margin: 10px 0 4px;
  padding: 14px 16px;
  border: 1px solid rgba(245, 197, 66, 0.55);
  border-radius: 14px;
  background: rgba(245, 197, 66, 0.07);
  max-width: 640px;
}
.trade-draft-t {
  font-weight: 800;
  color: #F5C542;
  letter-spacing: 0.04em;
  font-size: 0.82rem;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.trade-draft-line {
  font-size: 1.02rem;
  font-weight: 700;
  color: #EDEFF7;
  margin-bottom: 10px;
}
.trade-draft-btn { margin-bottom: 8px; }
.trade-draft-note {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--muted, #A7ACC2);
}

.aiqc-sugs { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 2px; }
.aiqc-sugs:empty { display: none; }
.aiqc-sug {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(147, 51, 234, 0.45);
  color: inherit;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.88rem;
  cursor: pointer;
}
.aiqc-sug:hover { border-color: rgba(255, 215, 0, 0.6); }

.aiqc-log {
  max-height: 440px;
  overflow-y: auto;
  margin: 12px 0 4px;
  padding-right: 2px;
}
.aiqc-log .ai-msg.is-typing { white-space: pre-wrap; }
.aiqc-log .ai-msg.is-waiting { min-width: 56px; min-height: 1.2em; }
.aiqc-log .ai-msg.is-waiting::after {
  content: "•••";
  letter-spacing: 3px;
  color: var(--muted, #A7ACC2);
  animation: aiqc-wait-pulse 1.2s ease-in-out infinite;
}
@keyframes aiqc-wait-pulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .aiqc-log .ai-msg.is-waiting::after { animation: none; }
}
.aiqc-charged {
  align-self: flex-start;
  font-size: 0.78rem;
  color: var(--muted, #A7ACC2);
  margin-top: -4px;
}
.aiqc-by {
  align-self: flex-start;
  font-size: 0.78rem;
  color: var(--muted, #A7ACC2);
  margin-top: -4px;
}
.aiqc-log .md p { margin: 0 0 8px; }
.aiqc-log .md p:last-child { margin-bottom: 0; }
.aiqc-log .md-h { font-weight: 800; }
.aiqc-log .md-ul { margin: 0 0 8px; padding-left: 20px; }
.aiqc-log .md-ul li { margin: 2px 0; }
.aiqc-log .md-pre {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 12px;
  overflow-x: auto;
  margin: 0 0 8px;
  font-size: 0.85rem;
  white-space: pre;
}
.aiqc-log .md-code {
  background: rgba(255, 255, 255, 0.10);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 0.88em;
}
.aiqc-log .md a { color: var(--gold, #f5c451); }

/* Patch #185 feedback (same behaviour as /chat): rendered only
   when the ai_feedback_state probe answers. */
.aiqc-fb {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  align-self: flex-start; margin: 2px 0 8px;
}
.aiqc-fb.done { color: var(--muted, #A7ACC2); font-size: 0.85em; }
.aiqc-fb-btn {
  background: var(--surface, #12182e); color: var(--text, #e8eaf2);
  border: 1px solid #39415F; border-radius: 999px;
  padding: 3px 10px; cursor: pointer; font-size: 0.85em;
}
.aiqc-fb-btn:disabled { opacity: 0.5; cursor: default; }
.aiqc-fb-form { flex-basis: 100%; display: flex; flex-direction: column; gap: 6px; }
.aiqc-fb-text {
  width: 100%; box-sizing: border-box;
  border-radius: 12px; border: 1px solid #39415F;
  background: rgba(255, 255, 255, 0.03); color: inherit;
  padding: 10px 12px; font: inherit;
}
.aiqc-fb-send {
  align-self: flex-start;
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid #39415F; background: rgba(255, 255, 255, 0.03);
  color: inherit; font-weight: 700; cursor: pointer;
}
.aiqc-fb-send:hover { border-color: rgba(245, 196, 81, 0.6); }
.aiqc-fb-note { color: #ff8a8a; font-size: 0.85em; }

.aiqc-composer {
  display: flex; gap: 10px; align-items: flex-end; margin-top: 10px;
}
.aiqc-composer textarea {
  flex: 1; min-width: 0; box-sizing: border-box;
  border-radius: 12px; border: 1px solid #39415F;
  background: rgba(255, 255, 255, 0.03); color: inherit;
  padding: 10px 12px; font: inherit; resize: none; max-height: 160px;
}
.aiqc-composer textarea:focus {
  outline: 2px solid rgba(183, 139, 255, 0.55);
  outline-offset: 1px;
}
.aiqc-meta {
  display: flex; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-top: 8px;
}
.aiqc-meta .ai-note { min-height: 1.2em; margin: 0; font-size: 13px; }
.aiqc-est { color: var(--muted, #A7ACC2); font-size: 0.9rem; }
.aiqc-est strong { color: var(--gold, #f5c451); }
.aiqc-note { margin: 10px 0 0; }
.aiqc-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }

/* --- /chat spotlight: hero CTA + dedicated chat section --- */
.ai-hero-cta { margin-top: 16px; }
.ai-hero-cta .btn {
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.30),
    0 0 26px rgba(124, 58, 237, 0.18);
}
.ai-chat-spot {
  margin: 14px 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 215, 0, 0.45);
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.08),
    rgba(124, 58, 237, 0.10) 55%, rgba(10, 15, 30, 0) 100%);
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.10),
    0 0 22px rgba(124, 58, 237, 0.10);
}
.ai-chat-banner { width: 100%; height: auto; display: block; }
.ai-chat-spot-body { padding: 18px 20px 20px; }
.ai-chat-spot-body h2 { margin: 0 0 8px; }
.ai-chat-feats { display: grid; gap: 6px; margin: 12px 0 6px; }

/* --- AUREA AI app install card (PWA) --- */
.ai-app-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin: 14px 0;
  border: 1px solid rgba(255, 215, 0, 0.45);
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.08),
    rgba(124, 58, 237, 0.10) 55%, rgba(10, 15, 30, 0) 100%);
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.10),
    0 0 22px rgba(124, 58, 237, 0.10);
}
.ai-app-char { width: 92px; height: 92px; border-radius: 16px; flex: none; }
.ai-app-body { min-width: 0; }
.ai-app-body h3 { margin: 2px 0 6px; }
.ai-app-btns { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 10px 0 4px; }
.ai-app-badge {
  font-size: 11px; font-weight: 800; letter-spacing: 0.08em;
  color: #FFD700; border: 1px solid rgba(255, 215, 0, 0.55);
  border-radius: 999px; padding: 2px 8px;
}
.ai-app-installed { color: #FFD700; font-weight: 600; }
.ai-how { display: grid; gap: 8px; margin: 10px 0 2px; }
.ai-how-item {
  border: 1px solid var(--border, #39415F); border-radius: 12px;
  padding: 8px 12px;
}
.ai-how-item p { margin: 2px 0 0; color: var(--muted, #A7ACC2); }
.ai-app-eco { margin-top: 10px; }
.ai-app-eco a { color: #FFD700; }
@media (max-width: 560px) {
  .ai-app-card { flex-direction: column; }
  .ai-app-char { width: 72px; height: 72px; }
}

/* --- AI Custom Development sales section (/ai#custom-ai) ----------------
   Launch Pack format (launch-pack.css .lp-tier) with a single wide card,
   the green-dragon OEM poster and a check-marked inclusion list. */
.aic-tiers { grid-template-columns: 1fr; max-width: 680px; }
.aic-poster {
  width: 100%; height: auto; border-radius: 12px;
  border: 1px solid rgba(255, 215, 0, 0.45);
  margin-bottom: 14px;
}
.aic-inc { list-style: none; padding-left: 0; }
.aic-inc li { position: relative; padding-left: 24px; }
.aic-inc li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  color: #FFD700; font-weight: 800;
}

/* AI mode tabs (2026-12-03, user order): the Local / Cloud / Agent
   three-page split — a tab-style switcher shared by /ai, /ai-local
   and /ai-agent (the same block lives in ai-local.css). */
.ai-mode-tabs{display:flex;gap:10px;flex-wrap:wrap;justify-content:center;margin:20px 0 6px}
.ai-mode-tabs a{padding:10px 26px;border-radius:999px;border:1px solid #39415F;background:rgba(20,26,46,.72);color:#A7ACC2;font-weight:700;font-size:.95rem;text-decoration:none;transition:border-color .15s,color .15s,box-shadow .15s}
.ai-mode-tabs a:hover{border-color:rgba(255,215,0,.65);color:#FFD700}
.ai-mode-tabs a.active{background:linear-gradient(90deg,#FFD700,#FFB300);border-color:#FFD700;color:#0A0F1E;font-weight:800;box-shadow:0 0 16px rgba(255,215,0,.35)}

/* AI uses list (2026-12-04): "The AI you grow here works here too!"
   Cards follow the .ail-pitch-item neon look; future-outlook items
   carry the .cs-pill (common.considering) in their headings. */
.aiuse-wrap{padding-top:6px}
.aiuse-card{padding:22px}
.aiuse-title{margin:0 0 8px;font-size:1.5rem;line-height:1.3}
.aiuse-group{margin:20px 0 10px;font-size:1.05rem;color:var(--gold-light,#FFE873)}
.aiuse-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.aiuse-item{border:1px solid rgba(255,215,0,.5);border-radius:12px;padding:12px 14px;background:rgba(147,51,234,.07);box-shadow:0 0 14px rgba(255,215,0,.10),inset 0 0 18px rgba(147,51,234,.08)}
.aiuse-item h4{margin:0 0 4px;font-size:.98rem;line-height:1.35;color:var(--gold-light,#FFE873)}
.aiuse-item p{margin:0;font-size:.88rem;line-height:1.5;color:var(--muted,#A7ACC2)}
.aiuse-item .cs-pill{margin-left:6px;vertical-align:middle}
.aiuse-promo{padding:0;overflow:hidden}
.aiuse-promo-img{display:block;width:100%;aspect-ratio:16/9;object-fit:cover;background:#0A0F1E}
.aiuse-promo-body{padding:12px 14px}
.aiuse-card .rw-note{margin-top:14px}
@media (max-width:900px){.aiuse-grid{grid-template-columns:repeat(2,1fr)}}
@media (max-width:600px){.aiuse-grid{grid-template-columns:1fr}}
