/* AI chat page (/community/ai/) and plans page (/community/ai/plans/). Same colours as the rest of the community (community.css vars).
   Light animations only, all switched off for prefers-reduced-motion. */

/* ---- chat page: the chat is the page ---- */
body.aipage .sitefoot { display: none; }
body.aipage .wrap { max-width: 880px; padding: 14px 14px 12px; }
.aip { display: block; }
.aip-card { position: relative; display: flex; flex-direction: column; height: calc(100vh - 190px); height: calc(100dvh - 190px); min-height: 440px;
	border: 1px solid var(--line); border-radius: 22px; overflow: hidden;
	background: linear-gradient(180deg, rgba(22,29,39,.92), rgba(12,16,22,.96)); box-shadow: 0 18px 50px rgba(0,0,0,.45), 0 0 0 1px rgba(63,169,255,.05) inset; }
.aip-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.aip-id { white-space: nowrap; display: inline-flex; align-items: center; gap: 9px; font: 700 .9rem "Rajdhani", sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--silver); }
.aip-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 10px var(--teal); animation: aipPulse 2.6s ease-in-out infinite; }
.aip-tools { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.aip-tb { background: none; border: 1px solid transparent; border-radius: 10px; padding: 5px 10px; color: var(--muted); font: 600 .8rem "Inter", sans-serif; cursor: pointer; transition: color .2s, background .2s, border-color .2s; }
.aip-tb:hover, .aip-tb[aria-expanded="true"] { color: var(--cyan); background: rgba(111,231,255,.07); border-color: var(--line); }
.aip-tb:focus-visible, .aip-chip:focus-visible, .aip-send:focus-visible, .aip-attach:focus-visible, .aip-hrow:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.aip-tb[hidden] { display: none; }
.aip-main { position: relative; flex: 1; min-height: 0; display: flex; }
.aip-log { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 18px 16px 10px; scroll-behavior: smooth; overscroll-behavior: contain; }
.aip .cmsg { animation: aipIn .28s ease-out both; }
.aip .cmsg .cbody { max-width: min(86%, 640px); font-size: .97rem; line-height: 1.55; }
.aip .cmsg.me .cbody { background: linear-gradient(180deg, rgba(63,169,255,.30), rgba(63,169,255,.18)); }
.aip .cmsg.bot .cbody { background: rgba(255,255,255,.04); }
.aip-welcome { margin: auto; max-width: 560px; text-align: center; padding: 10px 6px; animation: aipIn .4s ease-out both; }
.aip-orb { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%;
	background: radial-gradient(circle at 35% 30%, #bff3ff, var(--blue) 45%, #1b4f86 100%); box-shadow: 0 0 40px rgba(63,169,255,.55); animation: aipFloat 5s ease-in-out infinite; }
.aip-hello { color: var(--silver); font-size: 1.02rem; margin-bottom: 16px; }
.aip-sugg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.aip-chip { text-align: left; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--silver);
	font: 500 .88rem/1.35 "Inter", sans-serif; cursor: pointer; transition: transform .15s, border-color .2s, background .2s, color .2s; }
.aip-chip:hover { transform: translateY(-2px); border-color: rgba(111,231,255,.45); background: rgba(111,231,255,.07); color: var(--white); }
.aip-typing { display: inline-flex; gap: 5px; padding: 4px 2px; }
.aip-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); opacity: .35; animation: aipDot 1.1s ease-in-out infinite; }
.aip-typing i:nth-child(2) { animation-delay: .15s; }
.aip-typing i:nth-child(3) { animation-delay: .3s; }
.aip-comp { padding: 8px 12px 12px; }
.aip-box { display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 8px; border: 1px solid var(--line); border-radius: 18px; background: rgba(5,7,10,.7); transition: border-color .2s, box-shadow .2s; }
.aip-box:focus-within { border-color: rgba(111,231,255,.55); box-shadow: 0 0 0 3px rgba(63,169,255,.14); }
.aip-box textarea { flex: 1; min-height: 40px; max-height: 180px; resize: none; margin: 0; padding: 9px 4px; border: 0; outline: 0; background: transparent; color: var(--white); font: 400 1rem/1.4 "Inter", sans-serif; }
.aip-send, .aip-attach { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer; font-size: 1.25rem; line-height: 1; transition: transform .15s, filter .2s, opacity .2s; }
.aip-send { background: linear-gradient(180deg, #7fd0ff, var(--blue)); color: #04101c; font-weight: 800; }
.aip-send:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.1); }
.aip-send:disabled { opacity: .35; cursor: default; }
.aip-attach { background: rgba(255,255,255,.06); color: var(--silver); }
.aip-attach:hover:not(:disabled) { background: rgba(111,231,255,.14); color: var(--cyan); }
.aip-attach[hidden] { display: none; }
.aip-files { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.aip-files[hidden] { display: none; }
.aip-opts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.aip-opts select[hidden] { display: none; }
.aip-opts select { font-size: .78rem; padding: 3px 8px; border-radius: 8px; }
.aip-foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 8px 6px 0; font-size: .78rem; color: var(--muted); }
.aip-quota { color: var(--silver); }
.aip-more { font-weight: 600; }
.aip-more[hidden] { display: none; }
.aip-disc { flex-basis: 100%; opacity: .75; }
.aip .cnote { margin-top: 8px; }

/* history drawer */
.aip-hist { position: absolute; z-index: 3; top: 0; right: 0; bottom: 0; width: min(340px, 100%); overflow-y: auto; padding: 12px;
	background: rgba(9,12,17,.96); border-left: 1px solid var(--line); animation: aipSlide .22s ease-out both; }
.aip-hist[hidden] { display: none; }
.aip-hist-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.aip-hrow { display: block; width: 100%; text-align: left; margin-bottom: 6px; padding: 9px 11px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--silver); cursor: pointer; transition: border-color .2s, background .2s; }
.aip-hrow:hover { border-color: rgba(111,231,255,.45); background: rgba(111,231,255,.07); }
.aip-hts { display: block; font-size: .72rem; color: var(--muted); }
.aip-hq { display: block; font-size: .88rem; overflow-wrap: anywhere; }

/* quota used up: frosted glass over the chat (everything below the top bar) */
.aip-lock { position: absolute; z-index: 5; left: 0; right: 0; bottom: 0; top: 49px; display: flex; align-items: center; justify-content: center; padding: 20px;
	background: rgba(8,11,16,.38); -webkit-backdrop-filter: blur(9px) saturate(1.2); backdrop-filter: blur(9px) saturate(1.2); animation: aipFade .3s ease-out both; }
.aip-lock[hidden] { display: none; }
.aip-lock-in { max-width: 380px; text-align: center; padding: 22px 22px 20px; border-radius: 20px; border: 1px solid rgba(111,231,255,.28);
	background: rgba(17,22,29,.72); box-shadow: 0 14px 40px rgba(0,0,0,.45); }
.aip-lock-h { font: 800 1.05rem "Orbitron", sans-serif; letter-spacing: .04em; color: var(--white); margin-bottom: 8px; }
.aip-lock-act { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }

@keyframes aipIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes aipFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes aipSlide { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@keyframes aipDot { 0%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }
@keyframes aipFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes aipPulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) {
	.aip *, .aip-lock, .aip-hist, .pl-card { animation: none !important; transition: none !important; }
}
@media (max-width: 640px) {
	body.aipage .wrap { padding: 8px 8px 8px; }
	.aip-card { height: calc(100dvh - 150px); min-height: 380px; border-radius: 16px; }
	.aip-sugg { grid-template-columns: 1fr; }
	.aip .cmsg .cbody { max-width: 94%; }
	.aip-box textarea { font-size: 16px; }   /* no zoom on focus (iOS) */
	.aip-tb { padding: 5px 7px; }
}

/* ---- plans page ---- */
.pl-hero { text-align: center; padding: 18px 0 10px; }
.pl-hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--blue), var(--teal)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pl-hero .lead { max-width: 640px; margin: 10px auto 0; }
.pl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin: 22px 0; align-items: stretch; }
.pl-card { display: flex; flex-direction: column; gap: 10px; padding: 22px 20px; border-radius: 20px; border: 1px solid var(--line);
	background: linear-gradient(180deg, rgba(22,29,39,.9), rgba(12,16,22,.95)); transition: transform .2s, border-color .2s, box-shadow .2s; animation: aipIn .4s ease-out both; }
.pl-card:nth-child(2) { animation-delay: .05s; } .pl-card:nth-child(3) { animation-delay: .1s; } .pl-card:nth-child(4) { animation-delay: .15s; }
.pl-card:hover { transform: translateY(-3px); border-color: rgba(111,231,255,.4); box-shadow: 0 14px 34px rgba(0,0,0,.4); }
.pl-card.best { border-color: rgba(46,230,168,.55); box-shadow: 0 0 0 1px rgba(46,230,168,.15) inset, 0 10px 34px rgba(46,230,168,.12); }
.pl-card h2 { margin: 0; font-size: 1.15rem; }
.pl-tag { align-self: flex-start; padding: 2px 10px; border-radius: 99px; font: 700 .7rem "Rajdhani", sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--cyan); background: rgba(111,231,255,.09); border: 1px solid var(--line); }
.pl-tag.best { color: var(--teal); background: rgba(46,230,168,.1); border-color: rgba(46,230,168,.4); }
.pl-price strong { font: 900 2rem "Orbitron", sans-serif; color: var(--white); }
.pl-price span { color: var(--muted); font-size: .85rem; }
.pl-list { list-style: none; display: grid; gap: 7px; flex: 1; color: var(--silver); font-size: .92rem; }
.pl-list li { padding-left: 20px; position: relative; }
.pl-list li::before { content: "✓"; position: absolute; left: 0; color: var(--teal); }
.pl-card .btn { align-self: stretch; text-align: center; justify-content: center; }
.pl-how ol { margin: 8px 0 10px 20px; display: grid; gap: 6px; color: var(--silver); }
.pl-mine { margin-top: 18px; }

/*FULLSCREEN*/
/* ---- full-screen chat (like ChatGPT): the page is as high as the window (100dvh, or the visual viewport with the keyboard open);
   only the message list scrolls, the composer stays at the bottom. Phone < 600, tablet 600-1023, desktop >= 1024. ---- */
html.aipage-root { height: 100%; overflow: hidden; overscroll-behavior: none; }
body.aipage { position: fixed; left: 0; right: 0; top: var(--vvt, 0px); width: 100%; height: 100vh; height: 100dvh; height: var(--vvh, 100dvh);
	display: flex; flex-direction: column; overflow: hidden; overflow-x: clip; overscroll-behavior: none; min-height: 0; }
body.aipage > nav.bz-suite, body.aipage > .subnav, body.aipage > .skip { flex: none; }
body.aipage > main.wrap { flex: 1 1 auto; min-height: 0; width: 100%; max-width: 940px; margin: 0 auto; padding: 10px 14px calc(8px + env(safe-area-inset-bottom, 0px));
	display: flex; flex-direction: column; overflow: hidden; }
body.aipage .aip { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; min-width: 0; }
body.aipage .aip-card { flex: 1 1 auto; height: auto; min-height: 0; min-width: 0; }
body.aipage .aip-note, body.aipage .aip .cnote, body.aipage .aip-foot { flex: none; }
body.aipage .aip-comp { flex: none; padding-bottom: 10px; }
body.aipage .aip-log, body.aipage .aip .cbody { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
body.aipage .aip .cbody pre, body.aipage .aip .cbody code { max-width: 100%; overflow-x: auto; white-space: pre-wrap; }
body.aipage .aip .cbody img { max-width: 100%; height: auto; }
body.aipage .aip-foot { padding-top: 6px; line-height: 1.35; }
body.aipage .aip-hist { max-width: 100%; }
body.aipage .aip-lock { top: 0; }
body.aipage .aip-lock-in { max-width: min(380px, 100%); }
/* tablet */
@media (max-width: 1023px) { body.aipage > main.wrap { max-width: 760px; padding: 8px 10px calc(6px + env(safe-area-inset-bottom, 0px)); } }
/* phone: edge to edge, the compact quota line instead of the long disclaimer */
@media (max-width: 599px) {
	body.aipage > main.wrap { padding: 0 0 env(safe-area-inset-bottom, 0px); max-width: none; }
	body.aipage .aip-card { border-radius: 0; border-left: 0; border-right: 0; box-shadow: none; }
	body.aipage .aip-top { padding: 8px 10px; }
	body.aipage .aip-log { padding: 12px 10px 8px; }
	body.aipage .aip-comp { padding: 6px 8px 8px; }
	body.aipage .aip-foot { padding: 4px 12px 6px; font-size: .74rem; gap: 2px 10px; }
	body.aipage .aip-disc { display: none; }
	body.aipage .aip .cmsg .cbody { max-width: 94%; }
	body.aipage .aip-tools { gap: 0; }
	body.aipage .aip-sugg { grid-template-columns: 1fr; }
	body.aipage .aip-welcome { padding: 0 4px; }
	body.aipage .aip-orb { width: 48px; height: 48px; margin-bottom: 10px; }
}
/* keyboard open: the menu bar makes room for the chat */
body.aipage.kbd > nav.bz-suite, body.aipage.kbd > .subnav { display: none !important; }
body.aipage.kbd .aip-foot, body.aipage.kbd .aip-welcome .aip-orb { display: none; }
body.aipage.kbd > main.wrap { padding-bottom: 0; }
/* short windows (landscape phone): same idea */
@media (max-height: 480px) { body.aipage > nav.bz-suite, body.aipage > .subnav { display: none !important; } body.aipage .aip-foot { display: none; } }

/*PLANS2*/
.pl-test { text-align: center; padding: 8px 12px; border-radius: 12px; border: 1px dashed rgba(255,196,77,.6); background: rgba(255,196,77,.08); color: #ffd98a; font-weight: 600; margin: 10px 0; }
.pl-mineplan { margin: 14px 0; }
.pl-big strong { font: 900 2rem "Orbitron", sans-serif; color: var(--white); }
.pl-big span { color: var(--silver); }
.pl-bar { height: 10px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; margin: 8px 0 10px; }
.pl-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--blue), var(--teal)); }
.pl-card.current { border-color: rgba(111,231,255,.55); }
.pl-card .btn:disabled { opacity: .5; cursor: not-allowed; }
.pl-h2 { margin: 26px 0 0; font-size: 1.15rem; }
.pl-co { margin: 16px 0; }
.pl-co code, .pl-addr { overflow-wrap: anywhere; word-break: break-all; }
.pl-claim { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.pl-claim input { flex: 1 1 220px; min-width: 0; }
@media (max-width: 599px) { .pl-grid { grid-template-columns: 1fr; } .pl-big strong { font-size: 1.6rem; } }
