/* Gravellis AI chat: shared by the AI page (/about/#ai) and the Oracle on the homepage.
   Colours come from --accent-gold, --text-main, --text-muted and --bg-dark on the page. */
/* ============================================================
   GRAVELLIS AI: its own view of the site, like the Observatory.
   The address ends in #ai while it is open. The chat has no boxes:
   the page's gold background shows through it. Models are chosen
   from the + menu beside the message line.
   ============================================================ */
#ai { display: none; min-height: 100vh; padding-top: 190px; border-bottom: none; }
.gsb-ai #ai { display: block; }
.gsb-ai .container > section:not(#ai) { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

.ai-panel { position: relative; }
.ai-log {
    height: min(56vh, 560px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 40px 0 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 48px, #000 calc(100% - 24px), transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 48px, #000 calc(100% - 24px), transparent 100%);
    scrollbar-width: thin;
    scrollbar-color: rgba(187, 165, 130, 0.25) transparent;
}
.ai-msg { max-width: 760px; line-height: 1.65; font-size: 0.97rem; overflow-wrap: anywhere; }
/* your message: a soft glass bubble on the right, in the same easy-to-read type as the answers */
.ai-msg.user {
    align-self: flex-end;
    max-width: min(80%, 620px);
    padding: 10px 16px;
    border-radius: 20px 20px 6px 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(187, 165, 130, 0.28);
    border-color: color-mix(in srgb, var(--accent-gold) 32%, transparent);
    color: #FFF;
    text-align: left;
    white-space: pre-wrap;
    font-size: 0.98rem;
    line-height: 1.55;
}
.ai-msg.bot { align-self: flex-start; color: rgba(234, 233, 231, 0.88); }
.ai-msg.bot .ai-tag { display: block; font-size: 10px; letter-spacing: 2px; font-weight: 500; text-transform: uppercase; color: var(--accent-gold); margin-bottom: 8px; }
.ai-msg.bot p { margin: 0 0 12px; }
.ai-msg.bot p:last-child { margin-bottom: 0; }
.ai-msg.bot ul, .ai-msg.bot ol { margin: 0 0 12px 1.3em; }
.ai-msg.bot li { margin-bottom: 4px; }
.ai-msg.bot h4 { font-family: 'Lexend Exa', serif; font-weight: 400; font-size: 1.05rem; color: #FFF; margin: 4px 0 10px; }
.ai-msg.bot strong { color: #FFF; font-weight: 600; }
.ai-msg.bot a { color: var(--accent-gold); }
.ai-msg code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.86em; background: rgba(255, 255, 255, 0.06); padding: 1px 5px; }
.ai-msg pre { background: rgba(0, 0, 0, 0.35); border-left: 1px solid rgba(187, 165, 130, 0.4); padding: 14px 16px; margin: 0 0 12px; overflow-x: auto; }
.ai-msg pre code { background: none; padding: 0; font-size: 0.84rem; line-height: 1.55; white-space: pre; }
.ai-msg.error { color: var(--text-muted); font-size: 0.92rem; }
/* friendly notes for limits: calm, centred, never red */
.ai-note { align-self: center; max-width: 540px; text-align: center; padding: 8px 12px 4px; }
.ai-log > .ai-note:only-child { margin: auto 0; }
.ai-note-mark { position: relative; display: block; width: 72px; height: 7px; margin: 0 auto 20px; }
.ai-note-mark::before { content: ""; position: absolute; left: 0; right: 0; top: 3px; height: 1px; background: linear-gradient(90deg, transparent, rgba(187, 165, 130, 0.85), transparent); }
.ai-note-mark::after { content: ""; position: absolute; left: 50%; top: 0; width: 5px; height: 5px; margin-left: -3.5px; border: 1px solid var(--accent-gold); background: var(--bg-dark); transform: rotate(45deg); }
.ai-note-title { font-family: 'Lexend Exa', serif; font-weight: 400; font-size: 1.2rem; letter-spacing: 0.5px; color: #FFF; margin: 0 0 10px; }
.ai-note-text { font-size: 0.93rem; line-height: 1.65; color: var(--text-muted); margin: 0; }
.ai-note-text b { color: var(--accent-gold); font-weight: 500; white-space: nowrap; }
.ai-note-sub { font-size: 9px; letter-spacing: 2.5px; text-transform: uppercase; color: rgba(187, 165, 130, 0.75); margin: 16px 0 0; }
.ai-typing { display: inline-flex; gap: 5px; padding: 6px 0; }
.ai-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-gold); opacity: 0.3; animation: ai-dot 1.2s ease-in-out infinite; }
.ai-typing i:nth-child(2) { animation-delay: 0.15s; }
.ai-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes ai-dot { 0%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.ai-empty { position: absolute; left: 0; right: 0; top: 44px; display: flex; flex-direction: column; gap: 14px; pointer-events: none; }
.ai-empty[hidden] { display: none; }
.ai-empty p { font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: var(--text-muted); margin: 0 0 4px; }
.ai-suggest {
    pointer-events: auto;
    align-self: flex-start;
    display: flex;
    align-items: baseline;
    gap: 14px;
    background: none;
    border: none;
    padding: 4px 0;
    font-family: 'Lexend Exa', serif;
    font-size: 1.25rem;
    color: rgba(234, 233, 231, 0.55);
    text-align: left;
    cursor: pointer;
    transition: color 0.3s ease;
}
.ai-suggest::before { content: "\25C6"; color: var(--accent-gold); font-size: 9px; transform: translateY(-3px); }
@media (hover: hover) and (pointer: fine) { .ai-suggest:hover { color: #FFF; } }

/* the message line: a single hairline that turns gold while typing, and scans while the model answers */
.ai-form {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding: 14px 0 12px;
    transition: border-color 0.4s ease;
}
.ai-form:focus-within { border-bottom-color: var(--accent-gold); }
.ai-form::after {
    content: "";
    position: absolute;
    left: 0; bottom: -1px;
    width: 30%; height: 1px;
    background: linear-gradient(90deg, transparent, #FFF3D6, transparent);
    opacity: 0;
    pointer-events: none;
}
.gsb-motion .ai-form.is-busy::after { opacity: 1; animation: ai-scan 1.4s cubic-bezier(0.65, 0, 0.35, 1) infinite; }
@keyframes ai-scan { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
.ai-form textarea {
    flex: 1 1 auto;
    min-height: 26px;
    max-height: 180px;
    resize: none;
    background: transparent;
    border: none;
    color: var(--text-main);
    font: inherit;
    font-size: 1rem; /* 16px: phones don't zoom in while typing */
    line-height: 1.55;
    padding: 8px 0;
    outline: none;
}
.ai-form textarea::placeholder { color: var(--text-muted); }
/* send: a round gold arrow; while the answer comes in it turns into a Stop square */
.ai-panel .ai-form .ai-send {
    flex: 0 0 auto; align-self: flex-end;
    width: 40px; height: 40px; min-width: 40px; margin: 0 0 3px; padding: 0;
    display: grid; place-items: center;
    border-radius: 50%; border: 1px solid var(--accent-gold);
    background: var(--accent-gold); color: #0b0a08;
    letter-spacing: 0; font-size: 0; line-height: 0; cursor: pointer;
    transition: background .3s ease, color .3s ease, border-color .3s ease, transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .3s ease;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.ai-panel .ai-form .ai-send svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) and (pointer: fine) { .ai-panel .ai-form .ai-send:hover:not(:disabled) { background: var(--accent-gold); color: #0b0a08; filter: brightness(1.1); } }
.ai-panel .ai-form .ai-send:active:not(:disabled) { transform: scale(.9); }
.ai-panel .ai-form .ai-send:disabled { background: transparent; color: var(--text-muted); border-color: rgba(255, 255, 255, 0.16); box-shadow: none; opacity: 1; cursor: default; }
@media (hover: hover) and (pointer: fine) { .ai-panel .ai-form .ai-send:disabled:hover { color: var(--text-muted); background: transparent; } }
.ai-panel .ai-form .ai-send.is-stop { background: rgba(255, 255, 255, 0.08); color: #FFF; border-color: rgba(255, 255, 255, 0.4); }
.ai-panel .ai-form .ai-send.is-stop svg { fill: currentColor; stroke: none; width: 14px; height: 14px; }
@media (hover: hover) and (pointer: fine) { .ai-panel .ai-form .ai-send.is-stop:hover { background: rgba(255, 255, 255, 0.16); color: #FFF; filter: none; } }
.gsb-motion .ai-panel .ai-form .ai-send.is-stop, .ai-panel .ai-form .ai-send.is-stop { animation: ai-stop-ring 1.6s ease-out infinite; }
@keyframes ai-stop-ring { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .28); } 100% { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); } }
.ai-panel .ai-form .ai-send.nudge { animation: ai-nudge .4s ease; }
@keyframes ai-nudge { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
@media (prefers-reduced-motion: reduce) { .ai-panel .ai-form .ai-send.is-stop, .ai-panel .ai-form .ai-send.nudge { animation: none; } }

/* attaching files: the clip, its little menu, the Docs picker and the chips above the line */
.ai-attach-wrap { position: relative; flex: 0 0 auto; align-self: flex-end; }
.ai-attach { width: 34px; height: 34px; margin-bottom: 2px; border-radius: 50%; border: 1px solid rgba(187, 165, 130, 0.35); background: transparent; cursor: pointer; display: grid; place-items: center; transition: border-color .3s, background .3s, transform .45s cubic-bezier(.16,1,.3,1); }
.ai-attach svg { width: 16px; height: 16px; fill: none; stroke: var(--accent-gold); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
 .ai-attach[aria-expanded="true"] { border-color: var(--accent-gold); background: rgba(187, 165, 130, 0.1); transform: rotate(-12deg); }
@media (hover: hover) and (pointer: fine) { .ai-attach:hover { border-color: var(--accent-gold); background: rgba(187, 165, 130, 0.1); transform: rotate(-12deg); } }
.ai-attach-menu, .ai-docs { position: absolute; left: 0; bottom: calc(100% + 12px); z-index: 25; width: 300px; max-width: calc(100vw - 40px); padding: 8px 0; background: rgba(16, 17, 20, 0.98); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid rgba(255, 255, 255, 0.08); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55); }
.ai-attach-menu[hidden], .ai-docs[hidden], .ai-files[hidden] { display: none; }
.gsb-motion .ai-attach-menu:not([hidden]), .gsb-motion .ai-docs:not([hidden]) { animation: ai-menu-in .3s cubic-bezier(.16,1,.3,1); }
.ai-attach-menu button, .ai-docs-list button { display: block; width: 100%; text-align: left; padding: 11px 18px; background: none; border: none; color: var(--text-main); font: inherit; font-size: .9rem; cursor: pointer; transition: background .2s; }
.ai-attach-menu button span, .ai-docs-list button span { display: block; font-size: .72rem; color: var(--text-muted); margin-top: 2px; }
 .ai-attach-menu button:focus-visible, .ai-docs-list button:focus-visible { background: rgba(187, 165, 130, 0.1); outline: none; }
@media (hover: hover) and (pointer: fine) { .ai-attach-menu button:hover,.ai-docs-list button:hover { background: rgba(187, 165, 130, 0.1); outline: none; } }
.ai-attach-menu button:disabled { opacity: .4; cursor: default; background: none; }
.ai-attach-signin { margin: 6px 18px 8px; font-size: .8rem; color: var(--text-muted); line-height: 1.5; }
.ai-attach-signin a, .ai-vault-link { color: var(--accent-gold); }
.ai-vault-link { font-size: 10px; letter-spacing: 2.5px; text-transform: uppercase; text-decoration: none; margin-right: 16px; }
.ai-vault-link[hidden] { display: none; }
.ai-docs-list { max-height: 300px; overflow-y: auto; scrollbar-width: thin; }
.ai-docs-list p { margin: 8px 18px; font-size: .82rem; color: var(--text-muted); }
.ai-files { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 0 2px; }
.ai-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 6px 8px 6px 12px; border: 1px solid rgba(187, 165, 130, 0.35); border-radius: 999px; font-size: .78rem; color: var(--text-main); background: rgba(187, 165, 130, 0.06); }
.gsb-motion .ai-chip { animation: ai-chip-in .45s cubic-bezier(.16,1,.3,1); }
@keyframes ai-chip-in { from { opacity: 0; transform: translateY(8px) rotateX(50deg); } to { opacity: 1; transform: none; } }
.ai-chip b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.ai-chip i { font-style: normal; font-size: .62rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent-gold); }
.ai-chip.is-reading i::after { content: "…"; }
.ai-chip.is-bad { border-color: rgba(220, 120, 110, .5); }
.ai-chip.is-bad i { color: #e3a39b; }
.ai-chip button { width: 20px; height: 20px; border-radius: 50%; border: none; background: rgba(255,255,255,.06); color: var(--text-muted); cursor: pointer; font: inherit; line-height: 1; }
@media (hover: hover) and (pointer: fine) { .ai-chip button:hover { color: #FFF; background: rgba(255,255,255,.14); } }
.ai-msg.user .ai-sent-files { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-top: 8px; font-family: inherit; }
.ai-msg.user .ai-sent-files span { font-size: .72rem; padding: 3px 10px; border: 1px solid rgba(187,165,130,.3); border-radius: 999px; color: var(--text-muted); }

/* a file Gravellis AI made: a small card that tilts in, with Download and Save to Docs */
.ai-filecard { display: flex; align-items: center; gap: 16px; margin: 14px 0 6px; padding: 16px 18px; max-width: 460px; border: 1px solid rgba(187,165,130,.35); background: linear-gradient(135deg, rgba(187,165,130,.12), rgba(187,165,130,.02)); border-radius: 14px; perspective: 600px; }
.gsb-motion .ai-filecard { animation: ai-card-in .8s cubic-bezier(.16,1,.3,1); transform-origin: 0 50%; }
@keyframes ai-card-in { from { opacity: 0; transform: perspective(700px) rotateY(-28deg) translateX(-10px); } to { opacity: 1; transform: none; } }
.ai-fileicon { position: relative; flex: 0 0 auto; width: 42px; height: 52px; border-radius: 4px 12px 4px 4px; background: linear-gradient(160deg, #e9dcc2, #9c8460); box-shadow: 0 8px 20px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.5); display: grid; place-items: end center; padding-bottom: 7px; font-size: 9px; font-weight: 700; letter-spacing: 1px; color: #1a1610; text-transform: uppercase; transform-style: preserve-3d; }
.gsb-motion .ai-fileicon { animation: ai-icon-float 5s ease-in-out infinite; }
@keyframes ai-icon-float { 0%,100% { transform: rotateY(-14deg) rotateX(6deg) translateY(0); } 50% { transform: rotateY(14deg) rotateX(-4deg) translateY(-3px); } }
.ai-filemeta { min-width: 0; flex: 1 1 auto; }
.ai-filemeta b { display: block; color: #FFF; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-filemeta span { font-size: .75rem; color: var(--text-muted); }
.ai-fileacts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ai-fileacts button { padding: 7px 14px; border-radius: 999px; border: 1px solid rgba(187,165,130,.5); background: transparent; color: var(--accent-gold); font: inherit; font-size: .72rem; letter-spacing: 1.5px; text-transform: uppercase; cursor: pointer; transition: background .25s, color .25s; }
@media (hover: hover) and (pointer: fine) { .ai-fileacts button:hover:not(:disabled) { background: var(--accent-gold); color: #0b0a08; } }
.ai-fileacts button:disabled { opacity: .55; cursor: default; }
.ai-fileacts a { display: inline-flex; align-items: center; padding: 7px 14px; border-radius: 999px; border: 1px solid rgba(187,165,130,.5); color: var(--accent-gold); text-decoration: none; font-size: .72rem; letter-spacing: 1.5px; text-transform: uppercase; transition: background .25s, color .25s; touch-action: manipulation; }
@media (hover: hover) and (pointer: fine) { .ai-fileacts a:hover { background: var(--accent-gold); color: #0b0a08; } }
.ai-fileacts button:active:not(:disabled), .ai-fileacts a:active { transform: scale(.97); transition-duration: .1s; }
.ai-invcard .ai-fileicon { background: linear-gradient(160deg, #f4ecdc, #BBA582); }
.ai-making { display: inline-flex; align-items: center; gap: 10px; margin-top: 10px; font-size: .8rem; color: var(--accent-gold); letter-spacing: 1px; }
.ai-making::before { content: ""; width: 14px; height: 14px; border: 1px solid var(--accent-gold); border-top-color: transparent; border-radius: 50%; }
.gsb-motion .ai-making::before { animation: ai-spin .9s linear infinite; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
/* chat history: a glass panel that slides in from the right, chats tilting in one by one */
.ai-hist-btn { display: inline-flex; align-items: center; gap: 8px; margin-right: 14px; padding: 8px 14px 8px 11px; border-radius: 999px; border: 1px solid var(--accent-gold); background: rgba(187,165,130,.12); font: inherit; font-size: 10px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--accent-gold); cursor: pointer; transition: background .25s, color .25s, box-shadow .25s; }
.ai-hist-btn::before { content: ""; width: 13px; height: 11px; border: 1.5px solid currentColor; border-radius: 3px 3px 3px 0; }
 .ai-hist-btn[aria-expanded="true"] { background: var(--accent-gold); color: #0b0a08; box-shadow: 0 0 22px rgba(187,165,130,.35); }
@media (hover: hover) and (pointer: fine) { .ai-hist-btn:hover { background: var(--accent-gold); color: #0b0a08; box-shadow: 0 0 22px rgba(187,165,130,.35); } }
.ai-hist-btn.has-run { box-shadow: 0 0 0 0 rgba(187,165,130,.6); }
.gsb-motion .ai-hist-btn.has-run { animation: ai-pulse 1.6s ease-out infinite; }
@keyframes ai-pulse { 0% { box-shadow: 0 0 0 0 rgba(187,165,130,.55); } 100% { box-shadow: 0 0 0 12px rgba(187,165,130,0); } }
.ai-hrun { color: var(--accent-gold) !important; }
.gsb-motion .ai-hrun { animation: ai-blink 1.2s ease-in-out infinite; }
@keyframes ai-blink { 50% { opacity: .35; } }
.ai-history { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); display: flex; justify-content: flex-end; }
.ai-history[hidden] { display: none; }
.ai-history-panel { width: min(400px, 92vw); height: 100%; display: flex; flex-direction: column; gap: 10px; padding: 26px 18px 18px; background: rgba(14,15,18,.97); border-left: 1px solid rgba(187,165,130,.25); box-shadow: -30px 0 80px rgba(0,0,0,.6); perspective: 900px; }
.gsb-motion .ai-history:not([hidden]) .ai-history-panel { animation: ai-hist-in .5s cubic-bezier(.16,1,.3,1); }
@keyframes ai-hist-in { from { transform: translateX(60px) rotateY(-8deg); opacity: 0; } }
.ai-history-head { display: flex; align-items: center; justify-content: space-between; }
.ai-history-head p { margin: 0; font-family: 'Lexend Exa', sans-serif; font-weight: 400; font-size: 1.1rem; color: #FFF; }
.ai-history-close { width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,.12); background: none; color: var(--text-muted); font-size: 20px; cursor: pointer; }
.ai-history-new { padding: 12px; border-radius: 12px; border: 1px solid rgba(187,165,130,.5); background: rgba(187,165,130,.08); color: var(--accent-gold); font: inherit; font-size: .8rem; letter-spacing: 2px; text-transform: uppercase; cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .ai-history-new:hover { background: var(--accent-gold); color: #0b0a08; } }
.ai-history-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; scrollbar-width: thin; }
.ai-hrow { display: flex; align-items: center; gap: 4px; border-radius: 12px; transition: background .2s, opacity .28s, transform .28s; }
.gsb-motion .ai-history:not([hidden]) .ai-hrow { animation: ai-chip-in .5s cubic-bezier(.16,1,.3,1) both; animation-delay: calc(var(--k, 0) * 30ms); }
 .ai-hrow.is-current { background: rgba(187,165,130,.09); }
@media (hover: hover) and (pointer: fine) { .ai-hrow:hover { background: rgba(187,165,130,.09); } }
.ai-hrow.is-current .ai-hopen b { color: var(--accent-gold); }
.ai-hrow.leaving { opacity: 0; transform: translateX(40px); }
.ai-hopen { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; padding: 11px 12px; background: none; border: none; text-align: left; color: var(--text-main); font: inherit; cursor: pointer; }
.ai-hopen b { flex: 1; min-width: 0; font-weight: 400; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-hopen span { flex: 0 0 auto; font-size: .7rem; color: var(--text-muted); }
.ai-hdel { flex: 0 0 auto; min-width: 32px; height: 32px; padding: 0 8px; border-radius: 999px; border: none; background: none; color: var(--text-muted); font: inherit; cursor: pointer; opacity: .5; }
 .ai-hdel:focus-visible, .ai-hdel.sure { opacity: 1; }
@media (hover: hover) and (pointer: fine) { .ai-hrow:hover .ai-hdel { opacity: 1; } }
.ai-hdel.sure { background: rgba(220,120,110,.18); color: #f0b3aa; font-size: .72rem; }
.ai-history-empty, .ai-history-note { font-size: .8rem; color: var(--text-muted); margin: 8px 4px; }
.ai-go { display: flex; width: max-content; max-width: 100%; align-items: center; gap: 10px; margin-top: 12px; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--accent-gold); color: var(--accent-gold); text-decoration: none; font-size: .75rem; letter-spacing: 1.5px; text-transform: uppercase; }
.ai-go::after { content: "\2192"; }
.gsb-motion .ai-go { animation: ai-chip-in .5s cubic-bezier(.16,1,.3,1); }
@media (hover: hover) and (pointer: fine) { .ai-go:hover { background: var(--accent-gold); color: #0b0a08; } }
.ai-remembered { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font-size: .72rem; color: var(--text-muted); }
.ai-remembered::before { content: "\25C6"; color: var(--accent-gold); font-size: 8px; }
.ai-remembered a { color: var(--accent-gold); }


/* under the line: + and the model on the left, the allowance and New chat on the right */
.ai-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-top: 14px; }
.ai-pick { position: relative; display: flex; align-items: center; gap: 12px; min-width: 0; }
.ai-plus {
    position: relative;
    flex: 0 0 auto;
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(187, 165, 130, 0.45);
    background: transparent;
    cursor: pointer;
    transition: border-color 0.3s ease, background 0.3s ease, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.ai-plus::before, .ai-plus::after {
    content: "";
    position: absolute;
    left: 50%; top: 50%;
    width: 12px; height: 1px;
    background: var(--accent-gold);
    transform: translate(-50%, -50%);
}
.ai-plus::after { transform: translate(-50%, -50%) rotate(90deg); }
@media (hover: hover) and (pointer: fine) { .ai-plus:hover { border-color: var(--accent-gold); background: rgba(187, 165, 130, 0.08); } }
.ai-pick.is-open .ai-plus { transform: rotate(45deg); border-color: var(--accent-gold); background: rgba(187, 165, 130, 0.1); }
.ai-plus:focus-visible, .ai-current:focus-visible { outline: 1px solid var(--accent-gold); outline-offset: 3px; }
.ai-current {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    max-width: 52vw;
    background: none;
    border: none;
    padding: 6px 0;
    font: inherit;
    font-size: 10px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: color 0.3s ease;
}
.ai-current::after {
    content: "";
    flex: 0 0 auto;
    width: 5px; height: 5px;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 0.3s ease;
}
 .ai-pick.is-open .ai-current { color: var(--accent-gold); }
@media (hover: hover) and (pointer: fine) { .ai-current:hover { color: var(--accent-gold); } }
.ai-pick.is-open .ai-current::after { transform: translateY(1px) rotate(225deg); }

.ai-menu {
    position: absolute;
    left: 0;
    bottom: calc(100% + 12px);
    z-index: 20;
    width: 300px;
    max-width: calc(100vw - 40px);
    padding: 10px 0;
    background: rgba(16, 17, 20, 0.98);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    transform-origin: 17px 100%;
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(187, 165, 130, 0.3) transparent;
}
.ai-menu[hidden] { display: none; }
.ai-pick.drops .ai-menu { bottom: auto; top: calc(100% + 12px); transform-origin: 17px 0; }
.gsb-motion .ai-menu:not([hidden]) { animation: ai-menu-in 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes ai-menu-in { from { opacity: 0; transform: translateY(10px) scale(0.96); } to { opacity: 1; transform: none; } }
.ai-menu-head { font-size: 9px; letter-spacing: 3px; text-transform: uppercase; color: var(--text-muted); padding: 6px 20px 10px; margin: 0; }
.ai-models { display: flex; flex-direction: column; }
.ai-model {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    padding: 11px 20px;
    background: none;
    border: none;
    color: var(--text-main);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
}
 .ai-model:focus-visible { background: rgba(187, 165, 130, 0.08); outline: none; }
@media (hover: hover) and (pointer: fine) { .ai-model:hover { background: rgba(187, 165, 130, 0.08); outline: none; } }
.ai-model-text { display: flex; flex-direction: column; gap: 2px; }
.ai-model b { font-family: 'Lexend Exa', serif; font-weight: 400; font-size: 15px; color: #FFF; letter-spacing: 0.3px; }
.ai-model-text span { font-size: 9px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-muted); }
.ai-model-meta { display: flex; flex-direction: column; gap: 4px; }
.ai-model-text .ai-model-note { font-size: 12px; letter-spacing: 0; text-transform: none; color: var(--text-muted); line-height: 1.35; }
.ai-model-row { display: flex; align-items: center; gap: 8px; }
.ai-power { display: inline-flex; align-items: flex-end; gap: 2px; height: 9px; }
.ai-power i { display: block; width: 3px; border-radius: 1px; background: rgba(187, 165, 130, 0.18); transform-origin: bottom; }
.ai-power i:nth-child(1) { height: 4px; } .ai-power i:nth-child(2) { height: 5px; } .ai-power i:nth-child(3) { height: 6px; }
.ai-power i:nth-child(4) { height: 7px; } .ai-power i:nth-child(5) { height: 8px; } .ai-power i:nth-child(6) { height: 9px; }
.ai-power i.on { background: var(--accent-gold); }
.gsb-motion .ai-menu:not([hidden]) .ai-power i.on { animation: ai-bar-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) both; }
.gsb-motion .ai-menu:not([hidden]) .ai-power i:nth-child(2) { animation-delay: 30ms; } .gsb-motion .ai-menu:not([hidden]) .ai-power i:nth-child(3) { animation-delay: 60ms; }
.gsb-motion .ai-menu:not([hidden]) .ai-power i:nth-child(4) { animation-delay: 90ms; } .gsb-motion .ai-menu:not([hidden]) .ai-power i:nth-child(5) { animation-delay: 120ms; }
.gsb-motion .ai-menu:not([hidden]) .ai-power i:nth-child(6) { animation-delay: 150ms; }
@keyframes ai-bar-in { from { transform: scaleY(0.2); opacity: 0.3; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ai-power i.on { animation: none !important; } }
.ai-model[aria-checked="true"] b { color: var(--accent-gold); }
.ai-check {
    flex: 0 0 auto;
    width: 10px; height: 5px;
    border-left: 1px solid var(--accent-gold);
    border-bottom: 1px solid var(--accent-gold);
    transform: rotate(-45deg) translateY(-2px);
    opacity: 0;
}
.ai-model[aria-checked="true"] .ai-check { opacity: 1; }
/* premium: visible, locked until card payments open */
.ai-premium { margin-top: 8px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.ai-premium[hidden] { display: none; }
.ai-premium .ai-menu-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ai-premium .ai-menu-head span { letter-spacing: 2px; color: var(--accent-gold); opacity: 0.8; }
.ai-locked { display: flex; flex-direction: column; }
.ai-model.is-locked { cursor: default; }
.ai-model.is-locked b { color: rgba(255, 255, 255, 0.5); transition: color 0.2s ease; }
 .ai-model.is-locked:focus-visible b { color: rgba(255, 255, 255, 0.78); }
@media (hover: hover) and (pointer: fine) { .ai-model.is-locked:hover b { color: rgba(255, 255, 255, 0.78); } }
.ai-lock {
    position: relative;
    flex: 0 0 auto;
    width: 11px; height: 8px;
    margin: 6px 0 0;
    border: 1px solid var(--accent-gold);
    border-radius: 1px;
    opacity: 0.75;
}
.ai-lock::before {
    content: "";
    position: absolute;
    left: 1.5px; top: -6px;
    width: 6px; height: 5px;
    border: 1px solid var(--accent-gold);
    border-bottom: none;
    border-radius: 4px 4px 0 0;
}
.ai-premium-note { margin: 6px 20px 8px; font-size: 12px; line-height: 1.6; color: var(--text-muted); }
.ai-premium-note[hidden] { display: none; }
.gsb-motion .ai-premium-note:not([hidden]) { animation: ai-menu-in 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.ai-meta { display: flex; align-items: center; gap: 18px; font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-muted); }
.ai-new { background: none; border: none; color: var(--text-muted); font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; padding: 6px 0; }
@media (hover: hover) and (pointer: fine) { .ai-new:hover { color: var(--accent-gold); } }
#ai .market-note { margin-top: 44px; }

/* everything rises into place as the view opens */
.gsb-motion.gsb-ai #ai .brief-lede { animation: legal-rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both; }
.gsb-motion.gsb-ai .ai-panel { animation: legal-rise 1s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both; }
.gsb-motion.gsb-ai .ai-suggest { animation: legal-rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) both; }
.gsb-motion.gsb-ai .ai-suggest:nth-of-type(1) { animation-delay: 0.45s; }
.gsb-motion.gsb-ai .ai-suggest:nth-of-type(2) { animation-delay: 0.55s; }
.gsb-motion.gsb-ai .ai-suggest:nth-of-type(3) { animation-delay: 0.65s; }
.gsb-motion .ai-msg { animation: legal-rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) both; }
.gsb-motion .ai-note { animation: legal-rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both; }
.gsb-motion .ai-note-mark::before { animation: ai-note-line 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both; }
@keyframes ai-note-line { from { transform: scaleX(0); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 900px) { #ai { padding-top: 150px; } }
@media (max-width: 600px) {
    .ai-log { padding: 30px 0 14px; height: 54vh; }
    .ai-empty { top: 34px; }
    .ai-suggest { font-size: 1.05rem; }
    .ai-msg { max-width: 94%; }
    .ai-msg.user { max-width: 86%; }
    .ai-form { padding: 12px 0 10px; }
    .ai-meta { gap: 14px; }
}
@media print { #ai .ai-form, #ai .ai-bar { display: none; } }
.ai-panel .btn{display:inline-block;color:var(--accent-gold);text-decoration:none;font-size:12px;letter-spacing:3px;text-transform:uppercase;transition: color .3s ease, background-color .3s ease, border-color .3s ease, box-shadow .3s ease, transform .3s ease, opacity .3s ease;cursor:pointer;background:transparent}

/* the row under the box: never breaks words onto two lines; on phones it lays out as two tidy rows */
.ai-meta { flex-wrap: wrap; gap: 8px 16px; letter-spacing: 1.5px; }
.ai-meta > * { white-space: nowrap; }
.ai-left { font-variant-numeric: tabular-nums; }
.ai-form textarea { align-self: center; height: auto; min-height: 26px; border: 0; border-radius: 0; box-shadow: none; padding: 8px 0; background: transparent; }
.ai-form textarea:focus { border: 0; box-shadow: none; }
@media (max-width: 600px) {
    .ai-bar { gap: 10px; }
    .ai-pick { width: 100%; }
    .ai-meta { width: 100%; justify-content: space-between; gap: 8px 10px; letter-spacing: 1.2px; }
    .ai-hist-btn { margin-right: 0; }
    .ai-vault-link { margin-right: 0; }
}
/* out of credits: the note in the model menu ends with a Refill button to the credit packs */
.ai-refill-btn { display: inline-flex; align-items: center; min-height: 32px; padding: 0 14px; margin-left: 4px; border-radius: 999px; font-weight: 600; text-decoration: none;
  border: 1px solid var(--accent-gold); color: #0b0a08; background: var(--accent-gold); touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: transform 0.14s ease-out; }
.ai-refill-btn:active { transform: scale(0.97); }
